MZ                @                                       	!L!This program cannot be run in DOS mode.

$       PE  L Yo         " 0          Vʁ                                          `                           ʁ O                         Ɂ 8                                                             H           .text                            `.rsrc                        @  @.reloc                         @  B                8ʁ     H      | 	        u ȁ                                    {q  
*:(r  
}q  
* 0 #     u  
,(s  
{q  
{q  
ot  
**v  )UUZ(s  
{q  
ou  
X*   0 M     r  p  %{q  

     -q    -&+  ov  
(w  
*{x  
*{y  
*V(r  
}x  
}y  
* 0 ;     u  
,/(s  
{x  
{x  
ot  
,(z  
{y  
{y  
o{  
** 5{Z4 )UUZ(s  
{x  
ou  
X )UUZ(z  
{y  
o|  
X*0      r-  p  %{x  

     -q    -&+  ov  
%{y  
  	  -q  
	  -&+  ov  
(w  
*"(}  
*   0 y     {  -j}  ~  -F  (~  

(  
~  -rw  p  (~  
o  
s  
  
,(  
~  (  
o  
(  
(  
*      # /R 
    "(  
*2(  
o  
*2(  
o\ *2(  
o  
*2(  
o  
*   0 '     s_ 
}k
 }j
 ` s  
(  *J(  
o\ (  *  0 b     sc 
}o
 }n
 sa }m
 s  
}l
 b s  
(  {l
 (  
{l
 ,{l
 og  
*     ,  L     N(  
o\ (  *0 .     sd 
}r
 }p
 }q
 e s  
(  *  0 s   	  (  
o; o  
o  
o  

(  
o; o  
o  
o  
o  
(  
o; o  
o  
o  
(  
o; o  
o  
o  
*r(  
}  }  }  *{  *{  *"}  *{  *"}  *
* W  *.   (  
*.   (  
*r  p*r  p*"/(  
* 0    
  (  
(  

 (  
*( *"( *
* X  *.   (  
*.   (  
*r  p*r p*"/(  
*   0    
  (  
(  

 (  
*( *"( * Y  *.   (  
*.   (  
*r; p*( *z(  
,
(  
o  
-(>  **s  
*0      o=  
r? p. o  
&rI p. o  
&rY p
. o  
&rg p. o  
&rw p. o  
&r p. o  
&r p-. o  
&r p<. o  
&r pZ. o  
&r px. o  
&*
*.   (  
*.   (  
*r p*r p*
*( *"( *  0        o  
sM  o  
o  
sT  o  
o  
s[  o  
o  
sb  o  
o  
si  o  
o  
sp  o  
o  
sw  o  
o  
s~  o  
* v  *.   ( *.   ( *r p*r p*( *"( * Z  *.   (  
*.   (  
*r p*r# p*( *"( * [  *.   (  
*.   (  
*rA p*rE p*( *"( * \  *.   (  
*.   (  
*ra p*rg p*( *"( * ]  *.   (  
*.   (  
*r p*r p*( *"( * ^  *.   (  
*.   (  
*r p*r p*( *"( * _  *.   (  
*.   (  
*r p*r p*( *"( * V  *.   (  
*.   (  
*r
 p*r p*:( (  
*>( (  
*
*.   (  
*.   (  
*rI p*rM p*
*( *"( *0        o  
s  o  
o  
s  o  
o  
s  o  
o  
s  o  
o  
s  o  
o  
s  o  
o  
s  o  
o  
s  o  
o  
s  o  
o  
s~  o  
* `  *.   (  
*.   (  
*r} p*r p*( *"( * a  *.   (  
*.   (  
*r p*r p*( *"( * b  *.   (  
*.   (  
*r p*r p*( *"( * c  *.   (  
*.   (  
*r7 p*r= p*( *"( * d  *.   (  
*.   (  
*ry p*r p*( *"( * e  *.   (  
*.   (  
*r p*r p*( *"( * f  *.   (  
*.   (  
*r p*r	 p*( *"( * g  *.   (  
*.   (  
*rE p*rK p*( *"( * h  *.   (  
*.   (  
*r p*r p*( *"( *
*.   (  
*. 	  (  
*r p*r p*
*( *"( *o  
s  o  
o  
s  o  
o  
s  o  
* i  *.   (  
*.   (  
*r p*r p*( *"( * j  *.   (  
*.   (  
*r p*r p*( *"( * k  *.   (  
*.   (  
*rA p*rI p*( *"( *
*. 
  (  
*.   (  
*r p*r p*
*( *"( *o  
s  o  
o  
s  o  
o  
s o  
* l  *.   (  
*.   (  
*r p*r p*( *"( * m  *.    (  
*.   (  
*r p*r p*( *"( * n  *.   (  
*.   (  
*r p*r p*( *"( * y  *.   (  
*.   (  
*rA p*r? p*( *"( *   *.   (  
*.   (  
*rk p*rq p*( *"( *
*.   (  
*.   (  
*r p*r p*
*( *"( *  0        o  
s o  
o  
s% o  
o  
s+ o  
o  
s1 o  
o  
s7 o  
o  
s= o  
o  
sC o  
o  
sI o  
o  
sO o  
o  
sU o  
*   *.   (  
*.   (  
*r p*( *"( *   *.   (  
*.   (  
*r p*( *"( *   *.   (  
*.   (  
*r p*( *"( *   *.   (  
*.   (  
*r p*( *"( *   *.   (  
*.   (  
*r p*( *"( *   *.   (  
*.   (  
*r p*( *"( *   *.   (  
*.   (  
*r p*( *"( *   *.   (  
*.   (  
*r p*( *"( *   *.   (  
*.   (  
*r p*( *"( *   *.   (  
*.   (  
*r p*( *"( *
*.   (  
*.   (  
*r p*r p*
*( *"( *o  
se o  
o  
sl o  
o  
ss o  
* ~  *.   (  
*.   (  
*r p*r9 p*( *"( *   *.   (  
*.   (  
*rA p*ra p*( *"( * }  *.   (  
*.   (  
*r p*r p*( *"( *
*.   (  
*.   (  
*r p*r p*
*( *"( *o  
s o  
o  
s o  
o  
s o  
* {  *.   (  
*.   (  
*r p*r p*( *"( * |  *.   (  
*.   (  
*r p*ra p*( *"( * z  *.   (  
*.   (  
*r} p*r	 p*( *"( *   *.   (  
*.   (  
*rG	 p*rq p*( *"( * 0 0     sf 
}s
 {s
 rM	 pg s  
~  
(  
*0    
  s  

(  
-o o  
*Nr_	 p(  
( *(r  
*  0        sr  
P  sr  
Q  sr  
R  sr  
S  sr  
T  sr  
U  sr  
V  sr  
W  sr  
X  sr  
Y  sr  
Z  sr  
[  sr  
\  sr  
c  (  
*  0        ~  
}`  (  
@  (~  
(  
s6 }D  o }E  s }F  o }G  o }H  s }K  s }L  s }J  s }I  s }M  s }N  (  
-
(  
(  
*sF *s *sF *rrk	 po   (  
  *rk	 po     (  
(  
*
*n{@  -o2 }@  {@  *n{A  -o3 }A  {A  *6r	 p(  
*:r	 p(  
*Fr	 p~  
(  
*Jr	 p~  
(  
*{O  -( (  
}O  {O  *(  
*"(  
*6r	 p(  
*:r	 p(  
*{E  *6r	 p(  
*Rr	 p(  
o/ *{F  *2o  
tG  *{G  *2o  
uk *{H  *{I  *{J  *{K  *{L  *{M  *{N  *2(  
tB  *(  
*"(  
*(  
*"(  
*J(  
~  
o  
*J(  
~  
o  
*o  
*{D  *Fr	 p~  
(  
*Jr	 p~  
(  
*6r
 p(  
*b( 3*r
 p(  
*FrE
 p~  
(  
*( (  
,*rE
 p~  
(  
*b( ( o; o  
*f( ( o; o  
*f( ( o; o  
*f( ( o; o  
*j( ( o; o  
*j( ( o; o  
*F( o; o  
*( o;  s  
o  
( o;  s  
o  
*"( *{]  *"}]  *{^  *"}^  *{_  *"}_  *6rs
 p(  
*lrs
 p(  
rs
 p(  
(  
*6r
 p(  
*0 [       ( .Qr
 p(  
o  
-<( o; o  
o  
o  
, ( o; o  
o  
( o  
* 0        -*( o; o  
o  
o  
-@( o; o  
o  
(  
o  
( o; o  
o  
( o  
( ( ( ( ( ( *r( o; o  
o  
o  
*u= -(  +(  +*t= o  
*  0 ~     s  

s  
(  

+.	o  
,o  
o  
s  
o  
X	i2o  
s  
( o  
s zo  
*      ] 	f e  0 =   
  ,8( 1/( ( 
u= -
(  +(  +*t= o  
**6(  
( *R( r
 p(  
*R( 2Y*( *^r
 pf  (  
f  *   0 :     3( +
r
 pf  f  (  
,(  
(@ *nr
 p~  
g  (  
g  *r
 p~  
g  g  (  
(@ *(= ( o; o  
o  
o  
*J(  
~P  o  
*J(  
~P  o  
*J(  
~Q  o  
*J(  
~Q  o  
*J(  
~S  o  
*J(  
~S  o  
*J(  
~R  o  
*J(  
~R  o  
*J(  
~U  o  
*J(  
~U  o  
*J(  
~V  o  
*J(  
~V  o  
*J(  
~W  o  
*J(  
~W  o  
*J(  
~X  o  
*J(  
~X  o  
*J(  
~Y  o  
*J(  
~Y  o  
*J(  
~Z  o  
*J(  
~Z  o  
*J(  
~[  o  
*J(  
~[  o  
*J(  
~\  o  
*J(  
~\  o  
*J(  
~T  o  
*J(  
~T  o  
*J(  
(  
(  
*0        (  

h  %( %( %( %( %( %( %( %( %( %	( %
( %( %( (  
*(  
*(
 *"(+ *{`  *   0 @       {`  (  
,*{`  (  
o  
(  
}`  ~  
(  
,(@ *{a  *"}a  *   0 [     (
 (  
t+ 
-6(
 ~  
(  
~  
~ 
o 
(. -(
 ( (
 (  
t+ *( ~  
(  
,( (
 (  
,( ( 
*2( o 
*( (  
,*( 
(= ( o 
*{C  ~  
(  
,( 
}C  {C  *"}C  *{B  *"}B  *2r p(  +*2r p(  +*{b  *"}b  *(? *   0 X     (V 
-( o 
(W +-o	 
-( o
 
o	 
,( o  
,( o 
*0 M     ( o; o  
o  

o  
( o; ( o; o  
o 
o
 
o  
*N( o; o 
*   0 5     s  

( o; o 
jo 
(  

,og  
*       #) 
    ( ,'( o; o  
o 
( o; o 
*( ,(( o; o  
o 
( o; o 
* 0      s 

o, * 0      &  ov  
s 

o, *0 -     (- -#o 

&  ov  
s 
o, *   0       (- -o 

s 
o, *0 -     (- -#o 

&  ov  
s 
o, *   0       (- -o 

s 
o, *6o  (+ *  0	        ( ( ( ( ( ( o9 ( o: ( o= ( oC ( o@ o] ( o; o  
o 
( o@ o 
( o; o  
o 
o 
( oC o o o 
*o7 -(
 o 
(. o  
o! 
*  0      (" 
u  
,(* *   0	      sh 
}u
 }t
 {t
 i s# 
($ 
( ( ( ( ( ( o9 ( o: ( o= ( oC ( o@ o] ( o; o  
o 
( o@ o 
( o; o  
o 
o 
( oC o o o 
( *  0 "     ( ( oa 
,( }1 *  0 X     o 3,( 
,Do1 o (R o (S *o .,( o% 
( o
 *s *s
 *s
 *Z(E ,(E oQ **Z(& 
o' 
-(6 *  0 ;     ~c  
(  
(: ,( r	 p   (( 

,(  
*     (0 
    0 O       o  
,Eo  
o) 
-
o  
o* 
,+(P ,
(P o@ ,r9 p(  +-(8 *** 0 9     (+ 
,/~  

o  
o* 
,rA p(, 

,rO po- 
***2( (. 
*>( (  
*~( (  
-( * !  ( *2(
 ( 
*(> -(/ 
-(? o  
(  
( *0      (
 
 ~  
(0 
*^~  
~ 
o 
(. *v(> ,( ,( o1 
*   0 U       (2 
o  
-*o  
o) 
-
o  
o* 
,(B o  
o* 
,(3 
,( -(4 
&*   0 j       (5 
-*~6 
(  +(7 
( (
 ~  
(  
,8rc p(  +(8 
( ( ,o  
-(C *~  
( *  0 9     ro p(  +
(  
-$( ( s9 
%r{ po: 
( &*s& *{d  *"}d  *(; 
(H (F o< 
(E o= 
(= oI *Zo' 
-sP *sp *  0      o' 
:   ( (  
-_( (J ( ( o> 
o  
,,o  
o) 
,( o! 
( o? 
(@ 
+( oA 
( 
 (B 
,?(K ( o  
,*o  
o) 
,( o! 
( o? 
(@ 
* 0 &     (L 
u %-&+oC 
oD 
*  0      s:
 
r poD 
*  0      (^ 
 XlB    Q5T |5& FA;   ,;    |;s  8   ñ-;   ;@;\   Q;^  8g   N<`5& cqV;[   m}Y;   N<`;8  89   "b5 
Ga;t   "b;  8   ]yg;   Xl;5  8   8#H5l 
?5& 39w;   ,x;    
?;)  8   og5 Q;i   og;   8   kC;5   8#H;  8   er5&  ;    R ;   er;  8Y   5 &;   ;   86   ;   @s;   8  r p(  
:'  8  r p(  
:9  8  r p(  
:J  8  r p(  
:;  8  r p(  
:,  8  r; p(  
:  8  rW p(  
:  8  r{ p(  
:  8s  r p(  
:  8^  r p(  
:  8I  r p(  
:  84  r p(  
:  8  r
 p(  
:  8
  rI
 p(  
:  8  ro
 p(  
:  8  r
 p(  
:  8  r
 p(  
:y  8  r
 p(  
:j  8  r p(  
:[  8  r? p(  
:L  8w  rk p(  
:=  8b  r p(  
:.  8M  r p(  
:  88  r p(  
:  8#  r p(  
:  8  r? p(  
:   8   r] p(  
:   8   ( o9 oE 
,(: -sF 
zoN *( o9 oG 
,(: -sF 
zs *s
 *sg *sC *sK
 *s
 *oM *sW
 *s *s
 *s *s *s1
 *s
 *s *s
 *sg
 *s
 *s *s
 *sS
 *s *s*
 *s\
 *s *s
 *sH 
zs
 *s% *   0 I       o  
,((E , o .( (E oQ (I 
r p(  +( (J 
*{e  *"}e  *s< (Q (P o@ ,(C (P oD (S *0 )   !  (  
~P  oK 
uJ  
,sL 
oM 
*>{f  X}f  *>{f  Y}f  **{f  *0 <   "  (T sN 

(  
~T  oK 
uZ  ,oO 
(U *    -3     0 "   #  (  
~V  oK 
tN  
,oP 
*  0 "   $  (  
~W  oK 
tO  
,oQ 
*  0 "   %  (  
~X  oK 
tP  
,oR 
*  0 "   &  (  
~Y  oK 
tQ  
,oS 
*  0 "   '  (  
~Z  oK 
tR  
,oT 
*  0 "   (  (  
~[  oK 
tS  
,oU 
*  0 "   )  (  
~\  oK 
tY  
,oV 
*  0      (P o@ ,(` *(P oA ,D( ( s9 
%r{ p(P oB o: 
( oW 
t" 
r p(  
*oX 
(P oG ,(P oH ( (a *(P oI ,(P oJ (Y 
(g *(P oK ,(P oL (c *(P oM ,(P oN (W *r p(f *   0    *  sZ 

r p(
 
%  ov  
o[ 
r p( oJ o[ 
( ( s2 ( sj r p %o4 oW 
o[ 
r p( U o[ 
*0 O   +  r p(  
,!(e u 
o  
o o *(e u o  
o o * 0    ,  sZ 

o\ 
-r po[ 
8   (] 
( o; o  
o^ 
o_ 
o` 
r poa 
. o[ 
r pob 

(c 
. o[ 
r; pob 

(d 
. o[ 
(e 
,&rY pr po^ 
of 
(g 
(h 
o[ 
(i 
*  0    -  sR 
oS (d *0 l   .  r psj 

E      $      2   +Br p(  
ok 
&+.r pok 
&+ r pok 
&+r p(  
ok 
&ov  
*Noi r p(l 
*:oi (h *:oj (h *  0 !     r
 p
(m 
,(n 

(o 
*            ( *( *:(p 
(F *F( oq 
o  +*F( oq 
o  +*r( oq 
r p  o	  +*s *(t 
o  
@  (~  
r p(u 
o  
@  (~  
rg p(v 
*(w 
o  
@  (~  
r p(u 
*(x 
( o" ,( o  
o4 *b(y 
( o  
o4 *r p*   0 .   /  ( o  
oz 

o  
(w o  
o{ 
*  0 )  0  s| 

r) p( o ( o (x o} 
rI prs p( oR (u o} 
r p( o ( o (x o} 
r pr p( oN (u o} 
r p( o ( o (x o} 
r prA p( oP (u o} 
rm pr p( oL (u o} 
s| 
r pr p( oI (u o} 
r pr p( oJ (u o} 
r+ pr9 p( oK (u o} 
ra prq p( oH (u o} 
r po} 
r p( o ( o (x o} 
r p( o ( o (x o} 
r p( o ( o (x o} 
r p( o (x o} 
*o  
,o  
o~ 
o 
o 
*  0 :   1  ,o 
o 

o  
o 
o 
(  
,s 
*s 
*^(  
,s 
*s 
*  0    2  s 

r) p 
  ( o 
r p   ( o 
r p   ( o 
r p   ( o 
r p   ( o 
r p   ( o 
r+ p   ( o 
r; p   ( o 
rM p   ( o 
ra p   ( o 
*  0 h   3  s| 

rw p( o< o 
  o} 
r p( o< o 
. o} 
r p( o< o 
( 
o} 
*0 H   3  s| 

r p( oB o U o} 
r p( oB o U o} 
*0 M   3  s| 

r p( oA o . o} 
r1 p( oA o o o o} 
*   0    3  s| 

rC p(z o} 
rQ p(v o} 
r p( o; o 
. o} 
r_ p( o; o 
U o} 
r} p( o; o 
U o} 
r p( o; o 
U o} 
*  0    3  s| 

r p( o? o 
. o} 
r p( o? o 
( 
o} 
r p( o? o 
( 
o} 
r/ p( o@ o 
o 
o} 
rW p( o@ o 
o 
o} 
r p( o@ o 
o 
o} 
*0 E   4  s| 

( o7 .	( 
+( 
r po} 
r p( 
o} 
*   0   5  ( 
(= ( ( oa 
-(? r pU o 
( ( s2 ( sj  %o4 
r p	oW 
o 
r p( o7 . o 
r p(} o 
r p(: U o 
r5 p(~ o 
rQ p({ o 
ru p(| o 
o 3y( r p( 
--~  
+o 
+( o 
( 
,%s 
o 
( o" ( +=o 
o 
( +&o .(E oQ ( o" ( ( ,r p(; o 
r p( %  ov  
o 
r p( o 
( ,r pU o 
(
 ( (  
,r pU o 
r p( o 
r) p( o 
rS p( o 
r{ p( o 
r p~y  ( o" o 
o 
*   0 {   6  s 

r po  
r poz 
o 
o 
o 
r+ po  
re poz 
o 
o 
o 
r po  
r poz 
o 
o 
o 
* 0 c   3  s| 

r p( U o} 
r p( U o} 
r p( . o} 
r5 p( . o} 
* 0 z   7  s| 

r p( o= o U o} 
( o= (% rM p%  o} 
rw p( o= o ,
~  
(  
+U o} 
*  0    3  s| 

r p( o> o U o} 
r p( o> o 
U o} 
r p( o> o 
U o} 
r	 p( o> o 
U o} 
r3 p( o> o o o} 
*0 '   8  sU 
oX rK po` (i 
r p( 
* 0 '   8  sU 
oY r po` (i 
r p( 
* 0        ( 
o 
( 
( 
o 
@  (~  
r po 
@  (~  
rq po 
@  (~  
r po 
@  (~  
rG po 
@  (~  
r po 
~ 
-@  (~  
r% po 
*0 @       ( 
~ 
,s r
 p( 
r p( ( 
r p( ( 
*r  p*
*s *
*
*
*ol (
  +om (
  +on (
  +*0 "   9  (  
~Q  oK 
tK  
,o 
*  0 "   :  (  
~R  oK 
tM  
,o 
*  0 "   ;  (  
~S  oK 
tL  
,o 
*  0 "   <  (  
~U  oK 
t  
,o  *  0    =  {g  %-&o %
}g  *( *s *.@  (~  
*o *rC  p*(r  
*2r  p( 
*6r  p( 
*2r  p( 
*6r  p( 
*2r! p( 
*6r! p( 
*2r;! p( 
*6r;! p( 
*2r[! p( 
*6r[! p( 
*2ry! p( 
*6ry! p( 
*2r! p( 
*6r! p( 
*2r! p( 
*6r! p( 
*2r! p( 
*6r! p( 
*2r! p( 
*6r! p( 
*2r! p( 
*6r! p( 
*2r" p( 
*6r" p( 
*2r1" p( 
*6r1" p( 
*2rg" p( 
*6rg" p( 
*2r" p( 
*6r" p( 
*2r" p( 
*6r" p( 
*2r" p( 
*6r" p( 
*2r" p( 
*6r" p( 
*2r# p( 
*6r# p( 
*2r)# p( 
*6r)# p( 
*   0        ( 
r  po 
r  po 
r! po 
r[! po 
r;! po 
ry! po 
r! po 
r! po 
r" po 
r" po 
r! po 
r! po 
r! po 
r" po 
r1" po 
rg" po 
r" po 
r" po 
r# po 
r)# po 
*( 
*{i  *"}i  *r( 
C  (~  
r=# po 
*r# p*:( 
o 
*
*F( 
-o **"s *o 
*( 
*( 
*( 
*( 
*( 
*( 
*( 
*( 
*( 
*( 
*( 
*"( 
*"( 
*"( 
*"( 
*"( 
*"( 
*"( 
*"( 
*"( 
*"( 
*"( 
*"( 
*"( 
*"( 
*( 
*( 
*"( 
*( 
*{k  *"}k  *r( 
D  (~  
r# po 
*rU$ p*:( 
o 
*
*F( 
-o **o 
*( 
*( 
*( 
*( 
*( 
*( 
*( 
*( 
*( 
*( 
*( 
*"( 
*"( 
*"( 
*"( 
*"( 
*"( 
*"( 
*"( 
*"( 
*"( 
*"( 
*"( 
*"( 
*"( 
*( 
*( 
*"( 
*( 
*( 
*r$ p*r( 
E  (~  
r$ po 
*( 
*"( 
*( 
*"( 
*"( 
*"( 
*( 
*( 
*( 
*"( 
*( 
*&( 
*r( 
F  (~  
r;% po 
*r% p*2($ o; *N($ o< o 
*n{x  -o% }x  {x  *F( 
t7  s: *"( 
*~  
*( 
uG  ,tG  o" (# *:( 
(# *( 
o 
,
( 
*($ o 
*2r& p( 
*Fr8& p( 
t2  *Frd& p( 
t2  *Fr& p( 
t2  *Fr& p( 
t2  *.@  (~  
*r& p*Fr& p( 
(  
*r:' p*6($ oB *
*  0     /  s 

o 
o  
(+ o  
*0       ( 
r& ps 
o 
r' ps 
o 
r8& p~  
2  (~  
r8& ps 
o 
rd& p~  
2  (~  
rd& ps 
o 
r& p~  
2  (~  
r& ps 
o 
r& p~  
2  (~  
r& ps 
o 
r' ps 
o 
r' ps 
o 
r' ps 
o 
r( ps 
o 
r:( ps 
o 
rb( ps 
o 
*n( 
h  %($ (  
*0       s 
y  s 
z  s 
{  ~y  r( po 
~y  r( po 
~y  r( po 
~y  r( po 
~y  r( po 
~y  r( po 
~y  r( po 
~y  r( po 
~z  rg po 
~z  rg po 
~z  r( po 
~z  r&) po 
~z  r) po 
~z  r) po 
~z  r<* po 
~{  r* po 
~{  r* po 
~{  r* po 
~{  rJ+ po 
~{  r+ po 
~{  r , po 
~{  rZ, po 
*"( 
*^r, p  ( 
  *br, p    ( 
*.@  (~  
*r& p*F~{  (; o 
*F~z  (; o 
*F~y  (; o 
*"(  
*~  
*
*   0   >  ( 

r, p( 
r, ps 
o 
r, p( 
r, ps 
o 
r- p( 
r- ps 
o 
r6- p( 
r6- ps 
o 
rZ- p( 
rZ- ps 
o 
rz- p( 
rz- ps 
o 
r- p( 
r- ps 
o 
r- p( 
r- ps 
o 
r- p( 
r- ps 
o 
r- p( 
r- ps 
o 
r. p( 
r. ps 
o 
r. p( 
r. ps 
o 
r0. p( 
r0. ps 
o 
rF. p( 
rF. ps 
o 
r^. p( 
r^. ps 
o 
r. p( 
r. ps 
o 
r. p ( 
r. ps 
o 
r. p ( 
r. ps 
o 
r. p ( 
r. ps 
o 
r. p ( 
r. ps 
o 
r/ p ( 
r/ ps 
o 
r./ p( 
r./ ps 
o 
r8/ p( 
r8/ ps 
o 
r@/ p( 
r@/ ps 
o 
r p( 
r ps 
o 
rI p( 
rI ps 
o 
r p( 
r ps 
o 
rb/ p( 
rb/ ps 
o 
r p( 
r ps 
o 
r p( 
r ps 
o 
r p( 
r ps 
o 
r p( 
r ps 
o 
r/ p( 
r/ ps 
o 
r/ p( 
r/ ps 
o 
r/ p( 
r/ ps 
o 
r/ p( 
r/ ps 
o 
r/ p( 
r/ ps 
o 
r 0 p( 
r 0 ps 
o 
rX0 p( 
rX0 ps 
o 
r0 p( 
r0 ps 
o 
r0 p( 
r0 ps 
o 
r0 p( 
r0 ps 
o 
r0 p( 
r0 ps 
o 
r1 p( 
r1 ps 
o 
r61 p( 
r61 ps 
o 
rJ1 p( 
rJ1 ps 
o 
r^1 p( 
r^1 ps 
o 
rj1 p( 
rj1 ps 
o 
r1 p( 
r1 ps 
o 
r1 p( 
r1 ps 
o 
r1 p( 
r1 ps 
o 
r1 p( 
r1 ps 
o 
r1 p( 
r1 ps 
o 
r2 p( 
r2 ps 
o 
rJ2 p( 
rJ2 ps 
o 
r p( 
r ps 
o 
rj2 p ( 
rj2 ps 
o 
r p( 
r ps 
o 
r2 p ( 
r2 ps 
o 
r p( 
r ps 
o 
r2 p ( 
r2 ps 
o 
r# p( 
r# ps 
o 
r2 p ( 
r2 ps 
o 
rg p( 
rg ps 
o 
r3 p ( 
r3 ps 
o 
rE p( 
rE ps 
o 
rB3 p ( 
rB3 ps 
o 
r p( 
r ps 
o 
rh3 p ( 
rh3 ps 
o 
r3 p( 
r3 ps 
o 
r3 p( 
r3 ps 
o 
r3 p( 
r3 ps 
o 
r3 p( 
r3 ps 
o 
r"4 p( 
r"4 ps 
o 
r:4 p( 
r:4 ps 
o 
*"( 
*.@  (~  
*Frq p( 
t2  *Fr p( 
t2  *Fr p( 
t2  *Fr9 p( 
t2  *Fr p( 
t2  *Fr p( 
t2  *Fr p( 
t2  *FrA p( 
t2  *FrA p( 
t2  *Frs p( 
t2  *Frs p( 
t2  *0 h       ( 
r p(T rA p(T rs p(T rq p(T r p(T r p(T r9 p(T r p(T *~@~  
2  (~  
s 
o 
*( 
*0 	  ?  s 

 &  (     (  
([ o 
 '  (     (  
r/ p(] o 
 (  (     (  
r@/ p(] o 
 $  (     (  
r"4 p(] o 
 %  (     (  
r:4 p(] o 
 "  (     (  
r3 p(] o 
 #  (     (  
r3 p(] o 
 y  (  

(  
r8/ p(] o 
 e  (  
	(  
r./ p(\ o 
 g  (  
(  
r^1 p(\ o 
q(  
    (  
([ on  *  (  
    (  
r 0 p(\ o 
on  ,  (  
    (  
rX0 p(\ o 
on     (  
    (  
r0 p(\ o 
on     (  
    (  
r0 p(\ o 
on     (  
    (  
r/ p(\ o 
o 
    (  
    (  
(Z o 
 (  (  
    (  
r1 p(\ o 
 #  (  
    (  
r1 p(\ o 
 9  (  
    (  
(Z on  ;  (  
   (  
r- pr\4 p(_ o 
on  =  (  
   (  
r- pr\4 p(^ o 
on  ?  (  
   (  
r- pr\4 p(^ o 
on  A  (  
   (  
rZ- pr\4 p(_ o 
on  C  (  
   (  
r6- pr\4 p(^ o 
on  E  (  
 	  (  
rz- pr\4 p(^ o 
on  G  (  
 
  (  
r, pr\4 p(_ o 
on  I  (  
   (  
r, pr\4 p(^ o 
on  K  (  
   (  
r- pr\4 p(^ o 
o 
   (  
    (  
rJ2 p(\ o 
   (  
"(  
r/ p(] o 
   (  
#(  
r/ p(\ o 
   (  
4(  
r/ p(] o 
   (  
5(  
rJ1 p(\ o 
   (  
l(  
r0 p(\ o 
   (  
:(  
r- p(] o 
   (  
    (  
r/ p(\ o 
   (  
 o  (  
([ 
	on    (  v  (  
r prz4 p(^ o 
	on    (  
 Z  (  
r# prz4 p(^ o 
	on    (  
 [  (  
rE prz4 p(^ o 
	on    (  
 \  (  
rg prz4 p(^ o 
	on    (  
 ]  (  
r prz4 p(^ o 
	on    (  
 ^  (  
r prz4 p(^ o 
	on    (  
 _  (  
r prz4 p(^ o 
	o 
   (  
 o  (  
(Z on    (  
 i  (  
r p(\ o 
on    (  
 j  (  
r p(\ o 
on    (  
 k  (  
rI p(\ o 
o 
 
  (  
 o  (  
(Z on    (  
 l  (  
r p(\ o 
on     (  
 m  (  
r p(\ o 
on    (  
 n  (  
r p(\ o 
o 
   (  
 V  (  
r p(\ o 
l(  
j(  
r1 p(] o 
o 
*0 a  @  s 

 y  (  

(  
r8/ p(] o 
 e  (  
	(  
r./ p(\ o 
 g  (  
(  
r^1 p(\ o 
   (  
l(  
r0 p(\ o 
 &  (     (  
([ o 
 '  (     (  
r/ p(] o 
   (  
    (  
rJ2 p(\ o 
   (  
 V  (  
r p(\ o 
l(  
j(  
r1 p(] o 
o 
*o% 
( 
o 
o	 
,( 
o 
o
 
,(V +(W ( 
* 0 V  
  o% 
   (  
 <  
 (  
([ o 
   (  
 :  
 (  
([ o 
   (  
 ;  
 (  
(Z o 
   (  
 =  
 (  
(Z o 
   (  
 9  
 (  
r1 p(] o 
 y  (  


 (  
r8/ p(] o 
 e  (  
	
 (  
r./ p(\ o 
 g  (  

 (  
r^1 p(\ o 
   (  
    
 (  
r/ p(] o 
*>r
 p(] *>r
 p(] *.(] *Fr
 p(_ *6(_ *  0 !   A  sc 
ok oi om *   0 D   B  s
 

( 
+ok  
tK  oq o 
oh  
-u  
	,	og  
*   
 $1     Js 
}  ( 
*6~  
(c *V(a (e (g *Fr4 pr
 p( 
*Jr4 pr
 p( 
*Fr4 pr
 p( 
*Jr4 pr
 p( 
*Fr4 pr
 p( 
*Jr4 pr
 p( 
*6r4 p( 
*:r4 p( 
*Fr4 pr
 p( 
*Jr4 pr
 p( 
*{  *0 d   A  ( 
uK  
,Rod (e of (g oh (i oj (k ol (m (n on o 
o 
*(d *0    C  sZ 

r4 p(f o[ 
r5 p(d o[ 
(j ,r5 pU o[ 
(h (  
-r$5 p(h o[ 
(l (  
-r85 p(l o[ 
(n ,Ms
 
(n o 
+( 

	oq o 
( 
-  og  
rL5 po[ 
*    !     ( 
*N( 
(Q ( 
*~  
*~  
*( 
*"( 
*FrX5 pot (h 
*ot (  
-rd5 p( 
o  
(! 
*( 
*n(" 
(  
-(# 
*ou *($ 
*&(} *j($ 
(Q (% 
(& 
*s *n{  -o~ }  {  *(' 
*"(( 
*~  
*~  
*~  
* 0    
  o 
 (  
* 0 K     () 
o* 
-(+ 
*~  

o (  
-o r_	 p(  

( (T o *n(, 
(  
-(- 
*o *n(. 
(  
-(/ 
*o *N(0 
( ( *R(0 
( ( *V(0 
( (1 
*~  
*~2 
*(3 
*"(4 
*J( o (5 
*6o ( *J(6 
o (7 
*6o (1 
*~  
*~  
*~  
*~  
*~  
*
*s *n{  -o }  {  *(8 
*"(9 
*(: 
*6~  
(; 
*n(< 
(  
-(= 
*o *(> 
o* 
-(> 
*( (T o o *(? 
o* 
-(? 
*( (T o o *(@ 
(  
-(A 
*o -~  
*o (Q *(B 
(  
-(C 
*o oD 
*   0 #   
  (8 
(  
-(E 
*o 
 (  
*n(F 
(  
-(G 
*o *o *~  
*~  
*~  
*~  
*~  
*
*(8 
*"(9 
*(H 
*6~  
(I 
*s *n{  -o }  {  *n(< 
(  
-(= 
*o *(> 
o* 
-(> 
*( (T o o *(? 
o* 
-(? 
*( (T o o *(@ 
(  
-(A 
*o -~  
*o (Q *(B 
(  
-(C 
*o oD 
*   0 #   
  (8 
(  
-(E 
*o 
 (  
*n(F 
(  
-(G 
*o *o *~  
*~  
*
*~  
*~  
*rx5 p*(8 
*"(9 
*(J 
oK 
. (~  
oL 
o (M 
*o ,o o  
1o  
o oN 
*n(< 
(  
-(= 
*o *(B 
(  
-(C 
*o oD 
*   0 #   
  (8 
(  
-(E 
*o 
 (  
*n(F 
(  
-(G 
*o *o *~  
*~  
*~  
*
*
*~  
*~  
*s *n{  -o }  {  *(8 
*"(9 
*"( *f~  
(O 
o oP 
*n(< 
(  
-(= 
*o **(> 
o* 
-(> 
*( (T o o *(? 
o* 
-(? 
*( (T o o *(@ 
(  
-(A 
*o -~  
*o (Q *(B 
(  
-(C 
*o oD 
* 0 #   
  (8 
(  
-(E 
*o 
 (  
*n(F 
(  
-(G 
*o *o *~  
*~  
*~  
*
*
*~  
*~  
*s *n{  -o }  {  *(8 
*"(9 
*"( *f~  
(Q 
o oP 
*n(< 
(  
-(= 
*o *(> 
o* 
-(> 
*( (T o o *(? 
o* 
-(? 
*( (T o o *(@ 
(  
-(A 
*o -~  
*o (Q *(B 
(  
-(C 
*o oD 
*   0 #   
  (8 
(  
-(E 
*o 
 (  
*n(F 
(  
-(G 
*o *o *~  
*~  
*~  
*
*~  
*~  
*~2 
*~  
*
*~  
*(8 
*"(9 
*s *n{  -o	 }  {  *"( *  0 R       ~  
(R 
(S 
(T 
o (U 
o (V 
o (W 
(X 
o oY 
*n(< 
(  
-(= 
*o *(> 
o* 
-(> 
*(
 (T o o *(? 
o* 
-(? 
*(
 (T o o *(@ 
(  
-(A 
*o  -~  
*o (Q *(B 
(  
-(C 
*o oD 
*0 #   
  (8 
(  
-(E 
*o 
 (  
*n(F 
(  
-(G 
*o *o *~  
*~  
*~  
*
*~  
*(8 
*"(9 
*(Z 
*n(< 
(  
-(= 
*o *(B 
(  
-(C 
*o oD 
*0 #   
  (8 
(  
-(E 
*o 
 (  
*(@ 
(  
-(A 
*o -~  
*o (Q *n(F 
(  
-(G 
*o *o *~  
*~  
*~  
*
*r5 p*~  
*(8 
*"(9 
*N([ 
o) (M 
*n(< 
(  
-(= 
*o' *(B 
(  
-(C 
*o& oD 
*  0 #   
  (8 
(  
-(E 
*o$ 
 (  
*(@ 
(  
-(A 
*o( -~  
*o% (Q *n(F 
(  
-(G 
*o* *o% *~  
*~  
*
*
*
*
*A* * *~  
*(8 
*"(9 
*   0 t       (\ 
o7 o] 
o8 o^ 
o_ 
o9 o` 
o_ 
o: oa 
o; (b 
oc 
o= (b 
od 
o< (b 
oe 
*(@ 
(  
-(f 
*og 
-~  
*o5 (Q *(B 
(  
-(C 
*o6 oD 
*0 #   
  (8 
(  
-(E 
*o4 
 (  
*n(F 
(  
-(G 
*o> *o5 *~  
*(h 
*Z(i 
(j 
(k 
*(l 
*r p*(H *Rr5 p(  
(I *re p*(H *Rr5 p(  
(I *r5 pom 
-r5 pr
 pon 
*r5 pr5 pon 
*   0 `   D  ,P
+Dsj 
	oo 
o 
op 
}v
 	{v
 ,oo 
	k sq 
or 
Xi2oo 
os 
*0 `   E  ,P
+Dsl 
	ot 
o3 
ou 
}w
 	{w
 ,ot 
	m sv 
ow 
Xi2ot 
ox 
*0 3   F  u  
,oy 
(T *u  ,oz 
(T *u3  * 0   G  o{ 
:   o 

8   ok  
t  o| 
o 
+Xok  
t  
	o} 
o 
+ok  
t  (W (V oh  
-u  ,og  
oh  
-u  ,og  
oh  
:eu  ,og  
o{ 
:  o 
8   ok  
t  o~ 
o 
	8   	ok  
t  

o| 
o 
+Sok  
t  o} 
o 

+
ok  
t  (V 
oh  
-
u  ,og  
oh  
-u  ,og  
	oh  
:c	u  ,og  
oh  
:u  ,og  
*   X   J *t      / d             ;"]     `}                0 C   H  u  - u  -um  -un  -u
  ,uQ  
o  
o{ 
,o * 0    I  ~  o 
o 
,~  o 
o 
o 
o 
uR  
,<o  
o 
+ok  
t  (W oh  
-u  
	,	og  
o 
(X *   D c     0 D     o} 
~y
 %-&~x
 p s 
%y
 o 

,o 
o 
(Y *0 9     o| 
~z
 %-&~x
 q s 
%z
 o 

,o 
*ro 
-o 
-
o 
**  0 M  J  s 

 (~  
~x
 r s 
o 
  (~  
~x
 s s 
o 
 (~  
~x
 t s 
o 
  (~  
~x
 u s 
o 

 (~  
~x
 v s 
o 
  (~  
~x
 w s 
o 
 (~  
~x
 x s 
o 
 (~  
~x
 y s 
o 
Р  (~  
~x
 z s 
o 
  (~  
~x
 { s 
o 
  (~  
~x
 | s 
o 
  (~  
~x
 } s 
o 
  (~  
~x
 ~ s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
Ъ  (~  
~x
  s 
o 
Ы  (~  
~x
  s 
o 
С  (~  
~x
  s 
o 
Ь  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
 (~  
~x
  s 
o 
в  (~  
~x
  s 
o 
и  (~  
~x
  s 
o 
л  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  (~  
~x
  s 
o 
  *    *. :  (  
*. ;  (  
*r p*r5 p*( *"( *    *. <  (  
*. =  (  
*r5 p*r5 p*( *"( *    *. B  (  
*. C  (  
*r6 p*r6 p*( *"( *    *. @  (  
*. A  (  
*r p*r06 p*( *"( *    *. >  (  
*. ?  (  
*r p*rb6 p*( *"( *    *. D  (  
*. E  (  
*r p*r6 p*( *"( *    *. F  (  
*. G  (  
*r6 p*r6 p*( *"( * J  *.   ( *.   ( *r6 p*   0 J       (- o 
o 
o 
s 
o 
o 
~ 
o 
o 
s 
o 
* K  *.   ( *.   ( *r6 p*0 J       (- o 
o 
o 
s 
o 
o 
~ 
o 
o 
s 
o 
*    *. 6  (  
*. 7  (  
*r6 p*r6 p*( *"( *   *.   (  
*.   (  
*r p*( *   *.   (  
*.   (  
*rA p*( *   *. $  (  
*. %  (  
*r p*( *   *.    (  
*. !  (  
*r7 p*( *   *. "  (  
*. #  (  
*r7 p*( *   *. &  (  
*. '  (  
*r7 p*( * 
  *.    (  
*~ *~ *r p*(A * $  *. /  (  
*. 0  (  
*r
 p*( *z(  
,
(  
o  
-( **s  
*0 c     o 
r7 p. o  
&r&7 p. o  
&r47 p. o  
&rB7 p. o  
&rP7 p. o  
&* #  *. 1  (  
*. 2  (  
*r; p*( *z(  
,
(  
o  
-( **s  
* 0 z     o 
rI p. o  
&rY p
. o  
&rg p. o  
&rw p. o  
&r p. o  
&r^7 p(. o  
&* "  *. 3  (  
*. 4  (  
*rh7 p*".(  
*( 
*0    
  ~2 
(  

 (  
*r6 p*( *"( *
*. 5  (  
*. 6  (  
*r p*rz7 p*
*( *"( *0        o  
s o  
o  
s o  
o  
s o  
o  
s o  
o  
s o  
o  
s
 o  
o  
s o  
o  
s o  
o  
s" o  
o  
s) o  
o  
s0 o  
*   *. #  (  
*. $  (  
*r7 p*r. p*( *"( *   *. !  (  
*. "  (  
*r p*r. p*( *"( *   *. %  (  
*. &  (  
*r7 p*r0. p*( *"( *   *. '  (  
*. (  (  
*r7 p*rF. p*( *"( *   *. -  (  
*. .  (  
*r7 p*r7 p*:( (  
*>( (  
*   *.   (  
*.   (  
*r p*r. p*( *"( *   *.   (  
*.   (  
*r7 p*rz7 p*( *"( *   *.   (  
*.    (  
*r7 p*r7 p*( *"( *   *. )  (  
*. *  (  
*r7 p*r^. p*:( (  
*>( (  
*   *. +  (  
*. ,  (  
*r7 p*r. p*( *"( * '  *.   (  
*.   (  
*r7 p*r7 p*:( (  
*>( (  
* &  *.   (  
*.   (  
*r p*r 8 p*"/(  
* 0    
  (  
(  

 (  
*( *"( *
*. x  (  
*. y  (  
*r p*r08 p*
*( *"( *   0 A       o  
sI o  
o  
sP o  
o  
sW o  
o  
s^ o  
*   *. r  (  
*. s  (  
*r>8 p*rD8 p*( *"( *   *. p  (  
*. q  (  
*rd8 p*rj8 p*( *"( *    *. t  (  
*. u  (  
*r p*r8 p*( *"( * !  *. v  (  
*. w  (  
*rA p*r8 p*( *"( * '  *.   (  
*.   (  
*r7 p*r7 p*( *"( *    *.   (  
*.   (  
*r8 p*rJ2 p*( *"( *
*.    (  
*.    (  
*r p*r8 p*
*( *"( *  0 A       o  
s| o  
o  
s o  
o  
s o  
o  
s o  
*    *.    (  
*.    (  
*r>8 p*r8 p*( *"( *    *.    (  
*.    (  
*rd8 p*r9 p*( *"( *    *.    (  
*.    (  
*r p*r(9 p*( *"( *    *.    (  
*.    (  
*rA p*r8 p*( *"( *    *.    (  
*.    (  
*r p*r0 p*( *"( *    *.    (  
*.    (  
*rH9 p*r0 p*( *"( *    *. *  (  
*. +  (  
*r
 p*r 0 p*( *"( *    *. ,  (  
*. -  (  
*r p*rX0 p*( *"( *    *. #  (  
*. $  (  
*r7 p*r1 p*( *"( *    *. '  (  
*. )  (  
*rI p*r1 p*( *"( *
*. M  (  
*. N  (  
*r p*r1 p*
*( *"( *o  
s o  
o  
s o  
o  
s o  
*   *. O  (  
*. P  (  
*r6 p*r1 p*( *"( *   *. Q  (  
*. R  (  
*r; p*r1 p*( *"( *   *. S  (  
*. T  (  
*r7 p*r2 p*( *"( *   *. ;  (  
*. <  (  
*r} p*r- p*
*rN9 p*( *"( *   *. =  (  
*. >  (  
*r p*r- p*
*rN9 p*( *"( *   *. ?  (  
*. @  (  
*r p*r- p*
*rN9 p*( *"( *   *. A  (  
*. B  (  
*rj9 p*rZ- p*
*rp9 p*( *"( *   *. C  (  
*. D  (  
*r9 p*r6- p*
*rp9 p*( *"( * 	  *. E  (  
*. F  (  
*r9 p*rz- p*
*rp9 p*( *"( * 
  *. G  (  
*. H  (  
*r p*r, p*
*r9 p*( *"( *   *. I  (  
*. J  (  
*rE p*r, p*
*r9 p*( *"( *   *. K  (  
*. L  (  
*r p*r- p*
*r9 p*( *"( *    *.   ( *.   ( *r7 p*r9 p*( *"( *   *.   (  
*.   (  
*r
 p*r9 p*( *"( *   *.   (  
*.   (  
*rI p*r9 p*( *"( *^*.   (  
*.   (  
*r p*r: p*( *"( *b*.    ( *.    ( *r p*r8: p*( *"( *    *. /  ( *. 0  ( *rN: p*rT: p*( *"( *0 a       o  
s[ o  
o  
sa o  
o  
sg o  
o  
sm o  
o  
ss o  
o  
sy o  
*    *.   ( *.   ( *rt: p*( *"( *    *.   ( *.   ( *rz: p*( *"( *    *.   ( *.   ( *r: p*( *"( *    *.   ( *.   ( *r: p*( *"( * t  *.   ( *.   ( *r: p*( *"( * u  *.   ( *.   ( *r: p*( *"( *    *.    (  
*.    (  
*r p*rT: p*( *"( *    *.   (  
*.   (  
*rI p*r
 p*( *"( *    *.   (  
*.   (  
*r: p*r: p*( *"( *    *.   (  
*.   (  
*r: p*r: p*( *"( *    *. 1  ( *. 2  ( *r"4 p*r7 p*( *"( *    *. j  (  
*. k  (  
*r: p*r: p*( *"( *    *. f  (  
*. g  (  
*r ; p*r7 p*( *"( *    *. d  (  
*. e  (  
*r
; p*r6 p*( *"( *    *. h  (  
*. i  (  
*r; p*r6 p*( *"( *    *. l  (  
*. m  (  
*r; p*r p*( *"( *
*. Z  (  
*. [  (  
*r7 p*r2; p*
*( *"( *0 Q       o  
s o  
o  
s o  
o  
s o  
o  
s o  
o  
s o  
*B*rJ; p*.   ( *. ]  (  
*rP; p*( *"( *C*.   ( *. _  (  
*rt; p*rz; p*( *"( *D*.   ( *. a  (  
*r; p*r; p*( *"( *E*.   ( *. c  (  
*r; p*r; p*( *"( *F*.   (  
*. 
  (  
*r p*:( (  
*>( (  
*
*. J  (  
*. K  (  
*r8 p*r; p*
*( *"( *o  
s o  
o  
s o  
*G*. X  (  
*. Y  (  
*rI p*r< p*( *"( *H*. V  (  
*. W  (  
*r
 p*r<< p*( *"( *
*. L  (  
*. M  (  
*rn< p*rt< p*
*( *"( *   0        o  
s o  
o  
s o  
o  
s o  
o  
s o  
o  
s# o  
o  
s( o  
o  
s- o  
o  
s2 o  
o  
s8 o  
*    *( *r< p*( *"( *c*( *r< p*( *"( *d*"( *r p*( *"( *e*"	( *r< p*( *"( *h*"
( *r< p*( *"( *i*( *r p*( *"( *f*"( *r< p*( *"( *g*"F( *r< p*( *"( *I*.   (  
*.   (  
*r< p*:( (  
*>( (  
*
*. T  (  
*. U  (  
*r< p*r< p*
*( *"( *0 A       o  
sH o  
o  
sO o  
o  
sV o  
o  
s] o  
*J*. N  (  
*. O  (  
*r< p*r< p*( *"( *K*. P  (  
*. Q  (  
*r< p*r< p*( *"( *L*. R  (  
*. S  (  
*r< p*r< p*( *"( *M*.   (  
*.   (  
*r6 p*r= p*:( (  
*>( (  
*
*.    (  
*.    (  
*r p*r= p*
*( *"( *0 Q       o  
sm o  
o  
st o  
o  
s{ o  
o  
s o  
o  
s o  
*6*.    (  
*.    (  
*rI p*r= p*( *"( *O*.    (  
*.    (  
*r6 p*r8= p*( *"( *P*.    (  
*.    (  
*r\= p*rb= p*( *"( *Q*.    (  
*.    (  
*r= p*r= p*( *"( *R*.    (  
*.    (  
*r= p*r= p*( *"( *Z*.   (  
*.   (  
*r> p*"/(  
*(  
* 0    K  (  

 ( 
(  
*
*r"> p*( *"( *6*.    (  
*.    (  
*r p*r= p*( *"( *7*.    (  
*.    (  
*rA p*r(> p*( *"( *Fo  
s o  
*    *N( o o 
*6oE 
s 
*8*.    (  
*.    (  
*rI p*r@> p*( *"( *:*.   (  
*.   (  
*r p*r- p*( *"( *;*.   (  
*.   (  
*r p*r/ p*( *"( *    *. 2  (  
*. 3  (  
*r p*rX> p*( *"( *    *. 4  (  
*. 5  (  
*r8 p*rf> p*( *"( *    *.    (  
*.    (  
*rt> p*rz> p*( *"( *    *.    (  
*.    (  
*r"> p*r> p*( *"( * p  *.   (  
*.   (  
*r6 p*r> p*( *"( *A*.    (  
*.    (  
*r7 p*r> p*( *"( *
*
*"@(  
*"A(  
*r> p*r> p*( *"( *
*
*"B(  
*"C(  
*r> p*r> p*( *"( *
*. g  (  
*. h  (  
*r6 p*r^1 p*( *"( *	*. e  (  
*. f  (  
*r6 p*r./ p*( *"( *
*. y  (  
*. z  (  
*r6 p*r8/ p*( *"( **.    (  
*.    (  
*r? p*r? p*( oK 
o 
oK 
  (~  
oL 
*z(  
,
(  
o  
-( **s  
* 0 :   L  o 
+#~ oT ~ oT o  
&X~ i2*  0 _   M  s 

o  
o 
+.ok  
t  o 
r0? po 
o 
(! 
o 
oh  
-u  
	,	og  
*     :L     
*.    (  
*.    (  
*r? p*r? p*( oK 
o 
oK 
t (~  
oL 
*z(  
,
(  
o  
-( **s  
*   0 ?   N  o 
( 
o 
+o 
(  
o 
&oh  
-
,og  
*     !3 
    
**.    (  
*.    (  
*r? p*r? p*r? p*( *"( *
**.    (  
*.    (  
*r? p*r? p*r? p*( *"( *
*
*.   (  
*.   (  
*r
@ p*r@ p*
*( *"( *  0 Q       o  
s? o  
o  
sE o  
o  
sK o  
o  
sQ o  
o  
sW o  
*    *.   ( *.   ( *r p*( *"( **.   (  
*.   (  
*r7 p*( *"( **.   (  
*.   (  
*r
 p*( *"( **. ~  (  
*.   (  
*r6 p*( *"( **.   (  
*.   (  
*rA p*( *"( *
**.    (  
*.    (  
*r< p*r,@ p*r6@ p*( *"( *
**.    (  
*.    (  
*r< p*rB@ p*r6@ p*( *"( *
**.    (  
*.    (  
*r< p*rP@ p*r6@ p*( *"( *
**.    (  
*.    (  
*rd@ p*rh@ p*r6@ p*( *"( *
**.    (  
*.    (  
*r|@ p*r@ p*r@ p*( *"( *
**.    (  
*.    (  
*r@ p*r@ p*r@ p*( *"( *
**.    (  
*.    (  
*r: p*r@ p*r@ p*".(  
*( 
*  0    
  ~2 
(  

 (  
*( *"( *
**.    (  
*.    (  
*r p*r@ p*r@ p*"/(  
*   0    
  (  
(  

 (  
*( *
**.   (  
*.   (  
*r p*r@ p*( *"( *
**"z(  
*"{(  
*r7 p*r0 p*( *"( *
* *"~(  
*"(  
*r7 p*rA p*( *"( *
*!*"|(  
*"}(  
*r7 p*r*A p*( *"( *
*"*.   (  
*.   (  
*rHA p*r/ p*rNA p*( *"( *
*#*.   (  
*.   (  
*r\A p*r/ p*rNA p*( *"( *
*$*. {  (  
*. |  (  
*rbA p*rfA p*( *"( *
*%*.   (  
*.   (  
*r|A p*rA p*rA p*( *"( *
*&*.   (  
*.   (  
*rA p*rA p*rA p*( *"( *
*'*.   (  
*.   (  
*rA p*rA p*rA p*( *"( *
*(*.   (  
*.   (  
*rA p*rA p*rA p*( *"( *
*
*. H  (  
*. I  (  
*r p*rA p*
*( *"( *   0 q       o  
s	 o  
o  
s	 o  
o  
s	 o  
o  
s 	 o  
o  
s&	 o  
o  
s,	 o  
o  
s2	 o  
*)*.   (  
*.   (  
*( *"( ***. 
  (  
*.   (  
*( *"( *+*.   (  
*.   (  
*( *"( *-*.   (  
*.   (  
*r p*( *"( *.*.   (  
*.   (  
*r p*( *"( */*.   (  
*.   (  
*r p*( *"( *0*.   (  
*.   (  
*r p*( *"( *
*1*. 	  (  
*. 
  (  
*r p*r 8 p*"/(  
*  0    
  (  
(  

 (  
*( *"( *2*.   (  
*.   (  
*rB p*rB p*( *"( *3*.   (  
*.   (  
*r p*r$B p*( *"( *j*"l(  
*"m(  
*r  p*r1 p*( *"( **.    (  
*.    (  
*r
 p*~ *~ *(A *
*.   (  
*.   (  
*r7 p*r4B p*( *"( *
*.   (  
*.   (  
*r8 p*r<B p*( *"( *
*.   (  
*.   (  
*r p*rFB p*( *"( *
*.   (  
*.   (  
*r p*rPB p*( *"( *
*.   (  
*.   (  
*rI p*r^B p*( *"( *F    ( (~	 *"(| *( 
*"(& 
*( 
*"(% 
*rFB p*
*F    ( (	 *"(| *( 
*"(& 
*( 
*"(% 
*r> p*
*F    ( (	 *"(| *( 
*"(& 
*( 
*"(% 
*r^1 p*
*F    ( (	 *&(} *( 
*"(& 
*( 
*"(% 
*r/ p*4*rvB p*r|B p*F    ( (	 *&(} *( 
*"(& 
*( 
*"(% 
*rJ1 p*5*rB p*rB p*F    ( (	 *"(| *( 
*"(& 
*( 
*"(% 
*rB p*rB p*
*F    ( (	 *"(| *( 
*"(& 
*( 
*"(% 
*rB p*rB p*
*F    ( (	 *"(| *( 
*"(& 
*( 
*"(% 
*r= p*
*rB p*F    ( (	 *"(| *( 
*"(& 
*( 
*"(% 
*r(> p*
*rB p*F    ( (	 *"(| *( 
*"(& 
*( 
*"(% 
*r@> p*
*rB p*F    ( (	 *"(| *( 
*"(& 
*( 
*"(% 
*r/ p*
*rB p*F    ( (	 *"(| *rX> p*
*rB p*F    ( (	 *"(| *( 
*"(& 
*( 
*"(% 
*r> p*
*rB p*F    ( (	 *"(| *( 
*"(& 
*( 
*"(% 
*r> p*
*rB p*F    ( (	 *&(} *( 
*"(& 
*( 
*"(% 
*rt< p*k*rB p*rB p*F    ( (
 *&(} *( 
*"(& 
*( 
*"(% 
*r> p*
*rB p*:&(  
(

 *"(| *( 
*"(& 
*( 
*"(% 
*r? p*
*rB p*:)(  
(
 *"(| *( 
*"(& 
*( 
*"(% 
*r p*
*rB p*F    ( (
 *"(| *( 
*"(& 
*( 
*"(% 
*rT: p*
*rB p*F    ( (%
 *"(| *( 
*"(& 
*( 
*"(% 
*r:4 p*
*rB p*F    ( (.
 *"(| *( 
*"(& 
*( 
*"(% 
*r"4 p*
*rB p*F    ( (7
 *"(| *( 
*"(& 
*( 
*"(% 
*r; p*
*r|B p*:!(  
(@
 *"(| *( 
*"(& 
*( 
*"(% 
*r9 p*
*r: p*F    ( (I
 *"(| *( 
*"(& 
*( 
*"(% 
*r: p*
*rB p*F    ( (R
 *"(| *( 
*"(& 
*( 
*"(% 
*r8: p*
*rB p*F    ( ([
 *"(| *( 
*"(& 
*( 
*"(% 
*rJ2 p*
*rB p*F    ( (d
 *"(| *( 
*"(& 
*( 
*"(% 
*rC p*
*rB p*F    ( (m
 *&(} *( 
*"(& 
*( 
*"(% 
*rz7 p*   *r8 p*rB p*F    ( (w
 *"(| *( 
*"(& 
*( 
*"(% 
*rJ2 p*
*rB p*F    ( (
 *>(| (
 *( 
*"(& 
*( 
*"(% 
*r0 p*    *r p*r$C p*F    ( (
 *"(| *( 
*"(& 
*( 
*"(% 
*r1 p*
*rB p*F    ( (
 *>(| (
 *( 
*"(& 
*( 
*"(% 
*r1 p*    *r*C p*F    ( (
 *"(| *( 
*"(& 
*( 
*"(% 
*r6- p*
*r0C p*F    ( (
 *"(| *( 
*"(& 
*( 
*"(% 
*r5 p*
*r6C p*F    ( (
 *"(| *( 
*"(& 
*( 
*"(% 
*r6 p*
*rB p*F    ( (
 *"(| *( 
*"(& 
*( 
*"(% 
*r5 p*
*rB p*F    ( (
 *"(| *( 
*"(& 
*( 
*"(% 
*r6 p*
*r*C p*F    ( (
 *"(| *( 
*"(& 
*( 
*"(% 
*rB p*
*F    ( (
 *&(} *( 
*"(& 
*( 
*"(% 
*r p* V  *2( 
u@  *( 
-(
 %-&*(4 *( 
o 
*&( 
*(
 -(
 s ( +(
 o1 o (s 
*j( 
,( 
o 
( 
*2( 
u@  *"( 
*(
 -(
 s ( +(
 o1 o (x 
*j( 
,( 
o 
( 
*F    ( (s *:(r (
 *( 
*"( 
*r<C p*r p*F    ( (s *:(r (
 *( 
*"( 
*rFC p*r p*F    ( (s *:(r (
 *( 
*"( 
*rPC p*r7 p*F    ( (s *:(r (
 *( 
*"( 
*r^C p*rI p*F    ( (s *:(r (
 *( 
*"( 
*r; p*r7 p*F    ( (s *:(r ( *( 
*"( 
*rtC p*r; p*F    ( (s *:(r ( *( 
*"( 
*r~C p*r p*F    ( (s *:(r ( *( 
*"( 
*rC p*r> p*F    ( (s *:(r ( *( 
*"( 
*rC p*rC p*F    ( (s *:(r ( *( 
*"( 
*rC p*rC p*F    ( (s *:(r (  *( 
*"( 
*rC p*rC p*F    ( (s *:(r (& *( 
*"( 
*rD p*r$D p*  0    
      
 (  
*>    ( 
*( *  0    
      
 (  
*:    ( 
*( *   0    
   o  
 (  
*>    '( 
*( *( 
*"( 
*2( 
u@  *o 
*0        (3 sH }  sx }  s }  s }  s }  s }  s }  s }  s }  s }  s }  *^r*D p	  ( 
	  *br*D p	  	  ( 
*{  *{  *{  *{  *{  *{  *{  *{  *{  *{  *{  *  0    O  ( 
uJ 
9   o7 (8 (9 o9 o 
(: o: o 
(; o; o 
(< o< o 
(= o= o 
(> o> o 
(? o? o 
(@ o@ o 
(A oA o 
(B oB o 
(C oC o 
*0        ( 
h  %(9 oX %(: oX %(; oX %(< oX %(= %(> o %(> oX %(? oX %(@ oX %	(A %
(B %(C (  
*  0        (3 oG }  oH }  oI }  oJ }  oK }  oL }  oM }  oN }  oO }  oP }  oQ } *2( 
si *2( 
sp *2( 
sr *2( 
s 
*2( 
sz *2( 
s 
*2( 
s 
*2( 
s 
*2( 
s 
*2( 
s 
*2( 
s 
*{  *{  *{  *{  *{  *{  *{  *Fr4D pr
 p( 
*(Y (  
,*r4D pr
 p( 
*FrXD pr
 p( 
*JrXD pr
 p( 
*0    P  ( 
( 
uK 
9   (R oR o 
(S oS o 
(T oT o 
(U oU o 
(V oV o 
(W oW o 
(X oX o 
o[ (\ ( 
*          0 F       h  %(R %(S %(T %(U %(V %(W %(X *"( 
*( 
*"( 
*Ro 
~ (  +*2~ o 
*~ *
*( 
*"( 
*" %rtD p%r~D p%rD p%rD p%rD p *"(_ *(` *"(a *Ro 
~ (  +*2~ o 
*~ *   0 g       " %rD p%rD p%rD p%rD p%rD p%rD p%rD p%rD p%rE p%	rE p%
rE p *"( 
*
*"( 
*( 
*"( 
*
*"( 
*( 
*"( 
*   j*"( 
*( 
*"( 
*2( 
uP *sv *
*(3 o ( o ( o ( *{ *"} *{ *"} *{ *"} *s *s *s * 0 T   Q  ( 
( 
uR 
,3( o o 
( o o 
( o o 
( 
*    FL     ( 
h  %( %( %( (  
*"(3 *6r E p( 
*:r E p( 
*0 -   R  ( 
( 
uS 
,o ( ( 
*       %     "(3 *6rPE p( 
*:rPE p( 
*  0 -   S  ( 
( 
uT 
,o ( ( 
*       %     "(3 *^r|E pV ( 
V *br|E pV V ( 
*  0 -   T  ( 
( 
uU 
,o ( ( 
*       %     v(2 s 
} s }
 *6rE p( 
*:rE p( 
*6rE p( 
*jlrE p(  
rE p( 
*6rE p( 
*jlrE p( 
rE p( 
*JrE p( 
t  *:rE p( 
*{ *{
 * 0 s   U  ( 
( 
uW 
,Ro ( o ( o ( o ( ( o o 
( o o 
( 
*     ek     fh  %( %( *(2 *6r
F p( 
*:r
F p( 
*6r4F p( 
*:r4F p( 
*6r^F p( 
*:r^F p( 
*6rF p( 
*:rF p( 
*6rF p( 
*:rF p( 
*6rF p( 
*:rF p( 
*0 Z   V  ( 
uX 
,Ho ( o ( o ( o ( o ( o ( *6rF p( 
*:rF p( 
*6rG p( 
*:rG p( 
*0 9   W  ( 
( 
uY 
,o ( o ( ( 
*       +1     (2 *J(2 s } *^r:G p
  ( 

  *br:G p
  
  ( 
*{ *0 >   X  ( 
( 
uZ 
,o ( ( o o 
( 
*      06     Bh  %( *J(2 s } *{ *0 #   Y  ( 
u[ 
,( o o 
*Bh  %( *(2 *:rLG p( 
* 0 1   Z  rLG p( 
%( %( %
( ( *:rTG p( 
*>rTG p( 
*:r^G p( 
*>r^G p( 
*:rjG p( 
*>rjG p( 
*:rrG p( 
*>rrG p( 
*   0 ]   [  ( 
( 
u\ 
,<o ( o ( o ( o ( o ( ( 
*       OU     0 `   \  sZ 

r p( . o[ 
r p( . o[ 
rG p( . o[ 
rG p( . o[ 
*J(2 s } *{ * 0 2   ]  ( 
( 
u] 
,( o o 
( 
*      $*     Bh  %( *(2 *ZrG p( 
( 
t  *JrG p( 
( 
* 0    ^  ( 
u^ 
,o ( *{ *J{ rG po  +*N{ rG po
  +*J{ rG po  +*N{ rG po  +*J{ rH po  +*N{ rH po  +*Z{ r@ p~ 
o  +*^{ r@ p~ 
o  +*J{ r^H po  +*N{ r^H po  +*J{ rtH po  +*N{ rtH po  +*0 N   _  ( 
u_ 
,<o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
*Js] } ( 
*{ *Z{ rH p( 
o  +*^{ rH p( 
o  +*J{ r^H po  +*N{ r^H po  +*Z{ rH p~ 
o  +*^{ rH p~ 
o  +*Z{ rH p~ 
o  +*^{ rH p~ 
o  +*   0 B   `  ( 
u` 
,0o 
o 
o 
o 
o 
o 
o 
o 
*Js] } ( 
*{ *Z{ rI p~  
o  +*^{ rI p~  
o  +*Z{ rI p~  
o  +*^{ rI p~  
o  +*Z{ rI p~  
o  +*^{ rI p~  
o  +*Z{ r,I p~  
o  +*^{ r,I p~  
o  +*   0 B   a  ( 
ua 
,0o 
o 
o 
o 
o 
o 
o 
o 
*Js] } ( 
*{ *J{ r^H po  +*N{ r^H po  +*J{ r>I po  +*N{ r>I po  +*J{ r\I po  +*N{ r\I po  +*J{ r|I po  +*N{ r|I po  +*   0 B   b  ( 
ub 
,0o 
o 
o 
o 
o 
o 
o 
o 
*Js] } ( 
*{ *J{ rI po  +*N{ rI po  +*J{ r./ po  +*N{ r./ po  +*J{ rI po  +*N{ rI po  +*J{ r8/ po  +*N{ r8/ po  +*J{ r<B po  +*N{ r<B po  +*J{ r^1 po  +*N{ r^1 po  +*J{ rFB po  +*N{ rFB po  +*J{ rPB po  +*N{ rPB po  +*J{ rI po  +*N{ rI po  +*J{ rI po  +*N{ rI po  +*Z{ rI prI po  +*^{ rI prI po  +*J{ rI po  +*N{ rI po  +*J{ r8: po  +*N{ r8: po  +*J{ rJ po  +*N{ rJ po  +*J{ rJ po  +*N{ rJ po  +*J{ rhJ po  +*N{ rhJ po  +*J{ r~J po  +*N{ r~J po  +*J{ rJ po   +*N{ rJ po!  +*J{ rJ po  +*N{ rJ po  +*J{ rJ po  +*N{ rJ po  +*J{ rK po  +*N{ rK po  +*J{ r:K po  +*N{ r:K po  +*J{ rZK po  +*N{ rZK po  +*J{ rzK po  +*N{ rzK po  +*^{ rK p( 
o"  +*   0 %   c  o 
( 

{ rK p( 
o#  +*^{ rK p( 
o"  +*   0 2   c  ( 
( 

o 
( 

{ rK p( 
o#  +*J{ rK po$  +*N{ rK po%  +*J{ rK po$  +*N{ rK po%  +*J{ rK po  +*N{ rK po  +*J{ r2L po  +*N{ r2L po  +*J{ r~L po  +*N{ r~L po  +*   0 B   d  ( 
uc 
,0o! (" o' (( o# ($ o% (& *Js] } ( 
*{ *J{ rL po  +*N{ rL po  +*J{ rL po  +*N{ rL po  +*J{ rL po  +*N{ rL po  +*J{ r
M po  +*N{ r
M po  +*J{ rM po  +*N{ rM po  +*J{ r.M po  +*N{ r.M po  +*J{ r<M po  +*N{ r<M po  +*J{ rD po  +*N{ rD po  +*J{ rVM po  +*N{ rVM po  +*J{ rjM po  +*N{ rjM po  +*J{ rM po  +*N{ rM po  +*J{ rM po  +*N{ rM po  +*J{ rM po  +*N{ rM po  +*J{ rM po  +*N{ rM po  +*J{ rN po  +*N{ rN po  +*J{ r"N po  +*N{ r"N po  +*J{ r8N po  +*N{ r8N po  +*J{ rTN po  +*N{ rTN po  +*J{ rfN po  +*N{ rfN po  +*J{ rtN po  +*N{ rtN po  +*J{ rN po  +*N{ rN po  +*J{ r> po  +*N{ r> po  +* 0    e  s 
{ oY *0    f  s 
{ oY *Js] } ( 
*{ *J{ rN po  +*N{ rN po  +*J{ rN po  +*N{ rN po  +*J{ rN po  +*N{ rN po  +*Js] } ( 
*{ *^{ rN p jo&  +*b{ rN p jo'  +*Js] } (  
*{ *vs] } ( 
s } *J{ rN po  +*N{ rN po  +*J{ rO po  +*N{ rO po  +*J{ rBO po  +*N{ rBO po  +*J{ rXO po  +*N{ rXO po  +*{ *J{ rO po  +*N{ rO po  +*0 S   g  ( 
ug 
,Ao ( o 
o 
o 
o 
o 
o 
( o o 
*J(2 s } *6rO p( 
*:rO p( 
*j{ -s } { *Bh  %( * 0 :   \  sZ 

rO p( U o[ 
rO p{ ( o o[ 
*  0 /   h  ( 
uh 
,o ( ( o o 
* 0    i  ( 
u  
* 0 k   j  s
 

~|
 %-&~{
  s 
%|
 -( 
+( 
((  +o	 
+o
 
o o 
oh  
-
,og  
*    @ _ 
    ( 
*( 
*V( ( ( *FrP pr
 p( 
*JrP pr
 p( 
*FrP pr
 p( 
*JrP pr
 p( 
*0 *   k  ( 
uj 
,o ( o ( *  0 *   \  sZ 

rP p( o[ 
r$P p( o[ 
*"( 
*r.P p*~  
*(
 
*Fr8P p( 
t  *( 
r8P p~~
 %-&~}
  s 
%~
 s 
o 
* 0    l  s 

rZP po 
( o 
* 0 .   m  s 

( o 
r|P pr.P pr8P p(! 
o 
*"( 
*"( 
*0     n  s 

rP p( 
o 
o 
*0    o  ( 

o 
(b 
s 
o 
*"( 
*~  
*"(  
*~  
*"(! 
*~  
*"(" 
*(# 
*"($ 
*(% 
*"(& 
*2rP p( 
*(' 
rP p~
 %-&~
  s 
%
 s 
o 
*"( 
*~  
*"( 
*FrP p( 
t  *FrP p( 
t  *FrP p( 
t  *Fr p( 
t  *FrA p( 
t  *Frs p( 
t  *Fr p( 
t  *FrA p( 
t  *Frs p( 
t  *r.P p*~( 
%-&~) 
* 
s 
%( 
*  0 $   p  ()  +
  r|P po, 
(! 
o 
*2rP p(*  +*2rP p(*  +*2rP p(*  +*2r p(*  +*2rA p(*  +*2rs p(*  +*2rP p(*  +* 0        ( 
rP p(+  +s 
o 
rP p(+  +s 
o 
rP p(+  +s 
o 
r p(+  +s 
o 
rA p(+  +s 
o 
rs p(+  +s 
o 
rP p(+  +s 
o 
*  0 6   q  } (~  

rQ po- 
r8Q p( 
o  
s  
( *J  ( o  
*^o 
o. 
r8Q p(/ 
*2s (0 
*r<Q p*rQ p*^ s1 
s2 
(3 
*s *2(4 
o5 
*( * 0       r/ po6 
rQ po6 
	rQ po6 

r,@ po6 
rB@ po6 
rQ po6 
rR po6 
r(R po6 
r>R po6 
r^R po6 
r~R po6 
rR po6 
rR po6 

rR po6 
r7 po6 
r&7 po6 
r47 po6 
rB7 po6 
rR po6 
rR po6 
rP7 po6 
rS po6 
r$S po6 
r<S po6 
rVS po6 
rpS po6 
rS po6 
rS po6 
rS po6 
rS po6 
rT po6 
r T po6 
 r7 po6 
!r&7 po6 
"rP7 po6 
#rQ po6 
$r@ po6 
%r@ po6 
&r>T po6 
'rfT po6 
(rT po6 
)rT po6 
*rTG po6 
+r^G po6 
,rT po6 
-rT po6 
.rT po6 
/rT po6 
0r
U po6 
1rU po6 
2r.U po6 
3r>U po6 
4rDU po6 
5rRU po6 
6rhU po6 
7rxU po6 
8rU po6 
9rU po6 
:rU po6 
;rU po6 
<r&7 po6 
=rU po6 
>rP7 po6 
?rU po6 
@rU po6 
ArU po6 
Br
V po6 
CrrV po6 
DrV po6 
ErV po6 
FrV po6 
GrV po6 
Hr6@ po6 
Ir@ po6 
JrV po6 
Kr$W po6 
LrDW po6 
Mr\W po6 
NrpW po6 
OrW po6 
PrW po6 
QrW po6 
RrW po6 
Sr\X po6 
TrnX po6 
UrX po6 
VrX po6 
WrX po6 
XrX po6 
YrX po6 
ZrX po6 
[rY po6 
\r2Y po6 
]rXY po6 
^rhY po6 
_rtY po6 
`rjG po6 
arrG po6 
brY po6 
crY po6 
drY po6 
erY po6 
frY po6 
grY po6 
hrY po6 
irZ po6 
jrLZ po6 
krvZ po6 
lrZ po6 
mrX> po6 
nrf> po6 
orZ po6 
prZ po6 
qr<B po6 
rrFB po6 
srJ po6 
tr08 po6 
urPC po6 
vrZ po6 
wrZ po6 
xrZ po6 
yrZ po6 
zr[ po6 
{r"[ po6 
|rT[ po6 
}rx[ po6 
~r[ po6 
r[ po6 
    r[ po6 
    r
\ po6 
    r(\ po6 
    rL\ po6 
    rv\ po6 
    r\ po6 
    r\ po6 
    r\ po6 
    rV] po6 
    r? po6 
    rT po6 
    rr] po6 
    r] po6 
    r] po6 
    r] po6 
    r] po6 
    r^ po6 
    r*^ po6 
    r6^ po6 
    r>^ po6 
    rL^ po6 
    rV^ po6 
    rl^ po6 
    r^ po6 
    r^ po6 
    r^ po6 
    r^ po6 
    r^ po6 
    r>_ po6 
    rh_ po6 
    r_ po6 
    r_ po6 
    r` po6 
    r 8 po6 
    r$` po6 
    r.` po6 
    r7 po6 
    r` po6 
    rLG po6 
    r` po6 
    r` po6 
    r` po6 
    r` po6 
    ra po6 
    ra po6 
    rZ po6 
    r*a po6 
    rNa po6 
    rta po6 
    rY po6 
    rxU po6 
    r<C po6 
    rFC po6 
    rPC po6 
    ra po6 
    rC po6 
    ra po6 
    r~C po6 
    rtC po6 
    ra po6 
    ra po6 
    rtY po6 
    ra po6 
    r> po6 
    r/ po6 
    rJ1 po6 
    ra po6 
    rb po6 
    rb po6 
    r b po6 
    r.b po6 
    r8b po6 
    rBb po6 
    r4 po6 
    rfN po6 
    r^b po6 
    rnb po6 
    rzb po6 
    ra po6 
    rZ po6 
    rb po6 
    ra po6 
    rb po6 
    rtC po6 
    rb po6 
    rb po6 
    rb po6 
    rV po6 
    rc po6 
    rc po6 
    r*c po6 
    r:c po6 
    rLc po6 
    r\c po6 
    rnc po6 
    rc po6 
    rc po6 
    rc po6 
    rc po6 
    rc po6 
    rtC po6 
    rc po6 
    rd po6 
    r8d po6 
    r*^ po6 
    r`d po6 
    rd po6 
    rd po6 
    rT po6 
    rc po6 
    rc po6 
    rd po6 
    rd po6 
    rd po6 
    r4e po6 
    r<B po6 
    r/ po6 
    rJ1 po6 
    rc po6 
    r= po6 
    rDe po6 
    r^e po6 
    rxe po6 
    re po6 
    re po6 
    re po6 
   re po6 
   rf po6 
    rf po6 
    rDf po6 
    r- po6 
   r^f po6 
   rf po6 
   rf po6 
   rf po6 
   rf po6 
   rf po6 
 
  rf po6 
   rg po6 
   r.g po6 
   rFg po6 
   r`g po6 
   rrg po6 
   rg po6 
   rg po6 
   rQ po6 
   rg po6 
   rg po6 
   rg po6 
   rg po6 
   rh po6 
   ri po6 
    ruj po6 
   r6k po6 
   rl po6 
   rm po6 
   rn po6 
 !  rro po6 
 "  rp po6 
 #  rAp po6 
 $  rgp po6 
 %  rp po6 
 &  rp po6 
 '  rp po6 
 (  rp po6 
 )  r	q po6 
 *  rq po6 
 +  rr po6 
 -  rr po6 
 ,  res po6 
 .  rs po6 
 /  rs po6 
 0  rt po6 
 1  rt po6 
 2  rt po6 
 3  ru po6 
 4  ru po6 
 5  ru po6 
 6  ru po6 
 7  r!v po6 
 8  rQv po6 
 9  r/ po6 
 :  rv po6 
 ;  r^b po6 
 <  rv po6 
 =  rLG po6 
 >  rv po6 
 ?  rv po6 
 @  rw po6 
 A  rw po6 
 B  r3w po6 
 C  rSw po6 
 D  row po6 
 E  rw po6 
 F  rw po6 
 G  rw po6 
 H  rw po6 
 I  rw po6 
 J  rTG po6 
 K  rx po6 
 L  r^G po6 
 M  rx po6 
 N  r
U po6 
 O  r5x po6 
 P  rQx po6 
 Q  r]x po6 
 R  rmx po6 
 S  rN po6 
 T  rx po6 
 U  rx po6 
 V  rx po6 
 W  rx po6 
 X  r- po6 
 Y  rx po6 
 Z  rx po6 
 [  r!y po6 
 \  r5y po6 
 ]  rEy po6 
 ^  r4 po6 
 _  riy po6 
 `  ryy po6 
 a  ry po6 
 b  ry po6 
 c  ry po6 
 d  ry po6 
 e  ry po6 
 f  rz po6 
 g  rT po6 
 h  r7z po6 
 i  rTG po6 
 j  rx po6 
 k  r^G po6 
 l  rEz po6 
 m  r7 po6 
 n  rUz po6 
 o  rez po6 
 p  r}z po6 
 q  rP@ po6 
 r  rz po6 
 s  rz po6 
 t  rz po6 
 u  rz po6 
 v  rz po6 
 w  rz po6 
 x  rz po6 
 y  r{ po6 
 z  r#{ po6 
 {  r?{ po6 
 |  rW{ po6 
 }  r.M po6 
 ~  ro{ po6 
   r{ po6 
   r{ po6 
   r{ po6 
   r{ po6 
   r{ po6 
   r{ po6 
   r{ po6 
   rB po6 
   r)| po6 
   r$B po6 
   rE| po6 
   r]| po6 
   rw| po6 
   r
; po6 
   r| po6 
   r| po6 
   r| po6 
   r} po6 
   r} po6 
   r} po6 
   r} po6 
   r} po6 
   r ~ po6 
   r@~ po6 
   rX~ po6 
   rn~ po6 
   r{ po6 
   rZ po6 
   r~ po6 
   r~ po6 
   r~ po6 
   r~ po6 
   r po6 
   r: po6 
   r: po6 
   rX po6 
   rr po6 
   r po6 
   r po6 
   r po6 
   r{ po6 
   r po6 
   r< po6 
   rT po6 
   rx po6 
   r po6 
   r po6 
   r po6 
   rā po6 
   rށ po6 
   r po6 
   rc po6 
   r po6 
   r po6 
   r$ po6 
   r} po6 
   r< po6 
   r` po6 
   rT po6 
   r po6 
   r po6 
   r po6 
   rȂ po6 
   r po6 
   ra po6 
   r po6 
   r? po6 
   r( po6 
   r: po6 
   rL po6 
   rZ po6 
   rl po6 
   rx po6 
   r po6 
   r po6 
   r po6 
   r po6 
   r( po6 
   rn po6 
   rx po6 
   r po6 
   r po6 
   r  po6 
   r2 po6 
   rx po6 
   r po6 
   r po6 
   r po6 
*(7 
*F{ ok  
tz  *F{ ok  
tz  *:{ {
 X*F{ ok  
tz  *N( o (\ *j(r  
o8 
} ( &*{ oh  
,( V (,  +}
 *( ,( **>( { *0 D       { oh  
-*( o (,  +} ( o (-  +o8 
} *F{ ok  
tz  *F{ ok  
tz  *2{ o *2{ o *2( s9 
*2{ o *(r  
o8 
} o8 
} s } ( &* 0 F       { oh  
-*( S (,  +} { ( S (,  +X} *  0 X       { oh  
-*( \ (,  +} ( \ (,  +( \ (,  +X} ( &*2{ o *2{ o *>( { *F( { Y*>{ { *>{ { *r(r  
} } } *   0   r  s 
{ o: 
o; 
~< 

8   o ,{ o: 
o o= 
&o 9   o 
	{ { ( o ,o> 
{ o? 
,Ho ,@o { o@ 
{ ( o> 
oA 
oB 
o &+o &o> 
sC 
(D 
,{ oE 
oF 
o o ( o :(C 
o8 
+9ok  
tz  { oG 
oH 
{ ( 
 (I 
oh  
-u  		,	og  
*   (Fn    0    s  V (.  +
YE
            .   =   L   s   |   j      [         *sJ 
(/  +&*sK 
(0  +&*sL 
(1  +&*sM 
(2  +&*sN 
(3  +&*sO 
(4  +&*sP 
(5  +&*( *( *( *sJ 
(/  +&*   0    t  { o@ 
oQ 
W (,  +oR 

-r psS 
zsT 
(6  +W (7  +7 (7  +( (c 
k"  B[(d 
k"  B[(U 
* 0   u  Y (7  +
Y (7  +Y (,  +Y (7  +
	( { o@ 
oQ 
oR 
7 (7  +( 6 (,  +6 (Z sV 
	{ sW 


oX 
oY 
oZ 

oX 
o[ 
	
o\ 
	(8  +&	o] 
t o^ 
o_ 
o` 
	oa 
ob 
oc 
{ o@ 
od 
(e 
(c 
k(c 
k"  B[kZl(f 
i(g 
(h 
(d 
k(d 
k"  B[kZl(f 
i(g 
(i 
	oj 
(d 
ok 
	oj 
(c 
ol 
{ o@ 
	o] 
t o^ 
( &	(; * 0 ?  v  Z (7  +
Z (7  +Z (,  +Z (7  +( 
	Z (7  +6 (,  +6 (Z 9 (7  +( 9 (7  +( 9 (7  +( 	9 (7  +

G (9  +
G (:  +
(c 
(m 
,+	(c 
(n 
(d 
(m 
,+	(d 
(o 
{ op 
{ sq 
sr 
os 
ot 
~u 
ov 
ow 
ox 
sV 
o\ 
(8  +&o] 
t
 ot 
(/ { o@ 
o] 
t
 oy 
( &oj 
oz 
oj 

o{ 
oj 
o| 
oj 
(c 
ol 
oj 
(d 
ok 
oa 
ob 
oc 
o] 
t
 oy 
o_ 
o` 
oj 
o} 
	(; * 0 }  w  V (,  +
{ o- o~ 
o 
-r# p. ( 
sS 
z  V (,  +o 
{ oE 
o 
1B{ oE 
{ oE 
o 
Ys 
o 

  	o 
	o 
Xo 
+  o 
{ oE 
  o 
  o 
o 
~ 
( 
,  o 
  o 
o 
  o 
  o 
o 
  V (,  +o 
  o 
o 
{ { { o@ 
(L   o 
( 
o 
&*   0    x  S (,  +
S (,  +S (,  +S (,  +
S (-  +{ o@ 
o 
o 
	o 
o 
( 
o 
&o 
2,( 
o 
o 
o@ 
o 
o 
o 
o 
o 
( *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *   0	 B  y  o 
r p{ ( 

o 
o 
o 
o 
o 
   ( o 
o 
rň pr p{ (;  +(
 o 
r	 pr p{ (<  +(
 o 
( &r p   ( (
 (
 o 
r+ p   ( (
 (
 o 
r? p   ( (

 (	
 o 
o 
r
 p  %(
 %(
 %(	
 ( 
rO po 
*  0 !   z  ri pw( 
r} po 
o 
*   0        ( (
 o 
   ( . o  
&(
 o 
   ( . o  
&(
 o 
(
 o 
o 
(
 . (~  
o 
(
 . o 
*( r p ~  u r
 p( 
( r	 p   u r
 p( 
*r p*( *{ *"} *{  *"}  *{! *"}! *{" *"}" *{# *"}# *{$ *"}$ *{% *"}% *  0	   {  ( o o=  +(
 o 
r p  %(
 ( 

o 
( o   %~
 %-&~
  s 
%
 o>  +(
 o 
o 
&( o   %+
 s 
o>  +o 
o 
&(!
 ( o o=  +(
 (
 o 
    ( ( 
&(
 o 
( &( 
 (
 (
 o 
r p  %(
 ( 

	o 
	o 
o 
r	 p  %(
 ( 
#     R@( 
o 
(
 r	 po 
o 
(
 o 
r- pr p{ ( 
(
 (
 o 
rK pr p{ (?  +(
 (
 o 
rg pr p{ ( 
(
 ( o   %~
 %-&~
  s 
%
 o>  +(
 o 
o 
&o 
ry pr p{ (?  +(
 (
 ( 
*0   |  ( o o=  +
r po 
o 
r. p("
 ( 
o 
( o 
r p(  
o 
r po 
o 
r
 p  %( 
o 
o 
(b 
o 
o 

(b 
o 
o 
o 
r^. p("
 r. p("
 o 
r
 p  ( 
o 
r0. p("
 r. p("
 rF. p("
 ( 
*   0   }  " %r/ p%r. p%r. p%r. p%r. p
u %h
 ( 
" %r7 p%r` p%rLG p%r` p%r` p( 

8   ( o r# p  o@  +rC po 
o 
((
 o  
r[ p( (  
o 
o 
ro p(  
(  
o 
( o oA  +( o 
r po 
( 
r po 
o< 
o= 
o< 
o= 
	o< 
o= 
Xi?o 
r
 p  %	( 
o 
* 0    ~  ( o r# p  o@  +
( o o 
((
 o  
r׋ p(  
( o 
o 
rߋ po 
o 
o 
r
 p  %( 
o 
o 
o 
*b( (
 o 
o 
*0    
  ( (
 (%
 (
 (&
 (
 o 
(
 ( 
  o 
(
 o 
(
 o 
(
 (  
(  

 (  
o 
(
    (  
o 
(
 ~2 
o 
*  0 u     t %i
 ( 

t (~  
o 
#      ?t o 
r po 
+)(
 o 
t ( 
t o  
&Xi2*   0        . (~  
o 
o 
й (~  
 ( 
. o  
&o 
й (~  
 ( 
. o  
&o 
й (~  
 ( 
. o  
&o 
й (~  
 ( 
. o  
&. o 
*   0        (
 r
 p    u r
 p( 
(
 r' p    u r
 p( 
(
 r- pHu r
 p( 
(
 rK pIu r
 p( 
(
 rg pdu r
 p( 
(
 ry p    u r
 p( 
*  0 2   
  s  

(  
-"( o ( o  
oz 
o  
*rA p*( *   0 J       rs po 
r
 po 
o 
o 
#      9@( 
o 
( r po *  0 Q    o 
r
 pr p( 

o 
o 
rߌ p(.
 ( 
o 
r p @  ( r p ?  ( o 
r
 p  %%( 
o 
o 
r
 pr p( 

	o 
	o 
r1 prK p{ (B  +   s 
   s 
( ( o 
r
 pry p( 
o 
o 
r prK p{ (B  +   s 
   s 
( ( *   0        ( r p A  u r
 p( 
( r p B  u r
 p( 
( ry p C  u r
 p( 
( r1 p D  u r
 p( 
( r p E  u r
 p( 
*0 -     ~& i[  
+(/
 X~& i2*   0      ( o oC  +
~& o 
( 
o 
o 
~& o 
o 
o 
~ 
o 
o 
r po 
r po 
r p( (  
(  
o 
*r
 p*( *   0 x        % "   r> ps 
% %  r= ps 
% %  r= ps 
% %  r= ps 
% f&  r= ps 
% :&  r= ps 
& *{' *"}' *   0 `     ( 
( o oq 
oD  +
s 
(4
 o 
(3
 o= 
( o   ( 
(6
 o< 
o= 
*0      ( 

rI po 
(3
 o< 
o= 
(7
 o< 
o= 
+V( 

o< 
	o= 
	o< 
(8
 o= 
	o< 
rY p(9
 o= 
	o< 
rxU p(9
 o= 
X2*0      ( 

" %    ( %    ( %    ( +D( 

o< 
	o= 
( o oq 
oA  +o 
	o< 
o= 
Xi2*0 W     ( 

( o oq 
oE  +X(  
r p(  
o 
o 
r po 
o< 
o= 
* 0      ( 

( o oq 
oF  +~ 
   s 
( ( r p(  
( 
o 
rӎ po 
r pr	 p(  
( 
o 
o< 
o= 
*( *{( *"}( *{) *"}) *{* *"}* *{+ *"}+ *{, *"}, *  0     (H
 (<
 o 
ra p  %(;
 ( 

r
 po 
o 
o 
( &o 
r= prK p{ (B  +~ 
%o 
o 
ds 
o 
o 
( &( o oG  +(>
 o 
rc p  %(=
 ( 
o 
( o o=  +(@
 (?
 r} p( oV  
( o r p  %L
 s 
oH  +u' 
	,	rÏ po 
( o r p  %M
 s 
oH  +u' ,r po 
(?
 o 
r p{ ( 
(B
 (=
 o  
(?
 ( 
o 
( &o 
r' pr p{ ( 
(D
 * 0      ( (;
 (=
 ( 
%
o 
o 
(;
 (=
 (?
 #      Y@( 
%o 
%
o 
o 
(C
 o 
Y( . o  
&(C
 o 
Z( . o  
&(C
 o 
[( . o  
&(C
 o 
\( . o  
&(C
 . (~  
o 
*0 {       ( r= p    u r
 p( 
( r' pku r
 p( 
(A
     ( o 
(;
     ( o 
(=
     ( o 
* 0 4    ( o oG  +
" %r61 p%r3 p%r3 p%r0 p%rj1 p( 
r= po 
( 

o< 
	o= 
8   ( 
ra po 
	o< 
o= 
( o r# p  o@  +rC po 
o 
(I
 o  
r[ p( (  
(  
o 
o 
ro p(  
(  
o 
o< 
o= 
Xi?Eo  
o= 
*0 2   
  s  

(  
-"( o ( o  
oz 
o  
*r} p*( *z(?
 o 
o 
&r po 
*N(?
 o 
o 
&*{- *"}- *   0	 &       o 
r pr p{ (<  +(O
 *  0        ( (N
 o 
    ( . o  
&(N
 o 
    ( . o  
&(N
 o 
    ( . o  
&(N
 o 
    ( . o  
&(N
 . (~  
o 
(N
 o 
(N
 o 
o 
*r p*( *0 ,     o 
r
 p( 

r
 p( o 
o 
*0 !   z  r% pp( 
r} po 
o 
*r1 p*( *0 $    o 
rS p{ ( 
&o 
rc p{ ( 
&o 
( &(	 

o 
( o 
ry p(  
o 
o 
r p  %( 
r po 
#      Y@( 
o 
o 
rՑ pr p{ (;  +o
 
o 
r p{ ( 
   ( o 
o 
r/ p  %( 
( 

	o 
	r? po 
*0 }     ra p   ( 
rq p   ( r p   ( r p   ( 
o 
o 
o 
	o 
	o 
o 
o 
o 
*   0 ^       ( rS p   u r
 p( 
( rc p   u r
 p( 
( r p   u r
 p( 
*r p*( *{2 *"}2 *{3 *"}3 * 0
      o 
r
 pr p{ (<  +(^
 o 
r
 pr p( 

o 
r pr p{ ( 
~ 
o 
o 
r pr p{ ( 
~ 
o 
o 
r! pr p{ ( 
(`
 *N( (c
 (d
 *  0        (]
 o 
 w  ( . o  
&(]
 o 
 x  ( . o  
&(]
 o 
 y  ( . o  
&(]
 r; p( o 
(]
 o 
(]
 o 
( 
o 
(]
 . (~  
o 
*   0        (_
 o 
 z  ( . o  
&(_
 o 
 {  ( . o  
&(_
 o 
 |  ( . o  
&(_
 . (~  
o 
(_
 o
 
*   0 ^       ( r p t  u r
 p( 
( r p u  u r
 p( 
( r! p v  u r
 p( 
*ra p*( *{4 *"}4 *{5 *"}5 *{6 *"}6 *{7 *"}7 *{8 *"}8 *{9 *"}9 *{: *"}: *{; *"}; *{< *"}< *{= *"}= *{> *"}> *{? *"}? *   0	 y    s 
}
 {
 o 
{
 o 
r pr p{ ( 
(i
 {
 o 
r pr p{ ( 
(k
 {
 o 
r pr p{ ( 
(m
 {
 o 
rٓ pr p{ (?  +(w
 {
 o 
r pr p{ ( 
(o
 {
 o 
r pr p{ (?  +(y
 {
 o 
( &( o   % s 
o>  +o 
o 
#      Y@( 
o 
o 
r7 pr p{ (<  +(}
 o 
rQ pr p{ (<  +(
 ( o o=  +rk po 
o 
r
 p  %( 

	o 
	o 
	#      D@( 
o 
	o 
(b 
o 
o 
r p{ ( 
(q
 o 
r p{ ( 
(s
 o 
r p{ ( 
(u
 *   0 S    ( ( ( o 
+-(h
 o 
~ oT ~ oT o  
&X
~ i2(j
 o 
	( . o  
&(j
 o 

( . o  
&(j
 o 
( . o  
&(j
 o 
( . o  
&(j
 . (~  
o 
( 
o 
+o 
(l
 o 
(  
o 
&oh  
-
,og  
(l
 t (~  
o 
(l
 o 
(l
 o 
o 
(l
 o 
o 
(l
 o 
o 
(l
  Z  (  
o 
(n
 o 
( . o  
&(n
 o 
( . o  
&(n
 o 
( . o  
&(n
 o 
( . o  
&(n
 o 
( . o  
&(n
 o 
( . o  
&(n
 o 
( . o  
&(n
 o 
( . o  
&(n
 o 
( . o  
&(n
 o 
( 	. o  
&(n
 o 
( 
. o  
&(n
 o 
( . o  
&(n
 o 
( . o  
&(n
 o 
( 
. o  
&(n
 o 
( . o  
&(n
 o 
( . o  
&(n
 o 
( . o  
&(n
 o 
( . o  
&(n
 . (~  
o 
( r7 po 
o 
( rQ po 
o 
( r po 
#      I@( 
o 
( r po 
#      I@( 
o 
(
 (v
 (
 (x
 (
 *     +
    0        (|
 o 
 ( . o  
&(|
 o 
!( . o  
&(|
 o 
"( . o  
&(|
 (
 (~
 o 
#( . o  
&(~
 o 
$( . o  
&(~
 o 
%( . o  
&(~
 (
 *o 
o 
( 
o 
r po 
*. (~  
o 
o 
o 
( 
o 
*   0        ( r pu r
 p( 
( r pu r
 p( 
( r pu r
 p( 
( rٓ pu r
 p( 
( r pu r
 p( 
( r pu r
 p( 
( r pu r
 p( 
(p
 ( o 
(r
 ( o 
(t
 
( o 
*r
 p*( *F( o o *{@ *"}@ *{A *"}A *{B *"}B *{C *"}C *{D *"}D *{E *"}E *{F *"}F *  0	 -      o 
r- pr p{ (<  +(
 o 
( 
(
 (
 rA po 
(
 o 
r} pr p{ (I  +(
 (
 o 
r p{ ( 
(
 (
 r po 
(
 o 
r p{ ( 
(
 (
 o 
rѕ p{ ( 
&(
 o 
r p{ ( 
&(
 o 
r p{ ( 
&*N( (
 (
 *   0        (
 r
 po 
(
 o 
(
 o 
(
 o 
o 
(
 o 
(
 . (~  
o 
(
 o 
 Y  ( . o  
&(
 o 
 Z  ( . o  
&(
 o 
(
 o ,-(
 o 
 V  ( . o  
&(
 o 
* 0        ( r p W  u r
 p( 
( r p [  u r
 p( 
( rѕ p \  u r
 p( 
( r p ^  u r
 p( 
( r p _  u r
 p( 
( r} p X  u r
 p( 
* 0        (
 o 
rC po 
(
 o 
o 
rk po 
(
 o 
o 
 `  ( o 
(
 o 
( (
 o 
( (
 o 
( *rŖ p*( *F( o o *{G *"}G *{H *"}H *{I *"}I *{J *"}J *{K *"}K *   0	     (
 o ,%o 
r pr p{ (<  +(
 ( o o=  +(
 o 
r p  %(
 ( 

o 
(
 r) po 
(
 ( 
(
 rY p( oV  
(
 o 
r p{ ( 
(
 (
 r po 
(
 o 
r p  %(
 ( 
o 
(
 o 9   ( ol (
 (
 oY  
(
 
 s 
o\  
(
 r× p( oV  
(
 r po 
(
 #      Y@( 
o 
(
 o 
r՗ p  %(
 ( 
o 
o 
o 
s  
r p( o! 
(
 o" 
o= 
* 0      ( 

( 
( 
( o oA  +(
 (
 o 
(
 ( o 
r	 p(  
o 
o< 
(
 o= 
s# 

	o 
	( o 
r= p(  
o 
	o$ 
o< 
	o= 
o% 
o& 
&o' 
o( 
&rs po 
*( (
 o ,(
 (
 *0        (
 r
 po 
(
 o 
(
 o 
(
 o 
o 
(
 o 
(
 . (~  
o 
(
 o 
    ( . o  
&(
 o 
    ( . o  
&(
 . o 
*  0 a       (
 r p    u r
 p( 
(
 o ,(
 r՗ p    u r
 p( 
(
     ( o 
*   0 q       (
 o 
r po 
(
 o 
( (
 o ,>(
 o^  
" %rtD p%r~D p%rD p%rD p%rD po) 
*   0 H     o* 
o+ 
s, 

( ob o- 

,og  
o. 
o  
o/ 
 *    % 
        11 e  rј p*( *{L *"}L *{M *"}M *   0	 F       o 
r p{ ( 
(
 o 
r pr p{ (;  +(
 *  0 6     r' pu( 
r} po 
ri pw( o 
o 
*  0 ~     ( (
    ( r; p(  
o 
( o 
+%(
 o 
o0 
o1 
o  
&Xi2,
(
 o 
*(
 o 
*( r p }  u r
 p( 
*rC p*( *{N *"}N * 0	 &       o 
r pr p{ (<  +(
 *  0        ( (
 o 
|( . o  
&(
 o 
}( . o  
&(
 o 
~( . o  
&(
 o 
( . o  
&(
 . (~  
o 
(
 o 
(
 o 
o 
*r p*( *0
      ( o   %~
 %-&~
  s 
%
 o>  +
o 
o 
&o 
o 
r{ pr p{ ( 
?s 
o 
o 
r pr p{ ( 
&* 0 U       ( rݙ pxu r
 p( 
( r{ pyu r
 p( 
( r pzu r
 p( 
*r p*( *{O *"}O *{P *"}P *{Q *"}Q *{R *"}R *{S *"}S *{T *"}T *{U *"}U *{V *"}V *{W *"}W *{X *"}X *{Y *"}Y *{Z *"}Z *{[ *"}[ *{\ *"}\ *{] *"}] *{^ *"}^ *{_ *"}_ *{` *"}` *{a *"}a *{b *"}b *0        ( o oJ  +(
 (
 r p( o2 
o 
rC p  %(
 ( 
o 
(
 (
 (
 (
 (
 (
 (
 (
 (
 r
 prc p(
 (3 
(
 r
 prS p(
 (3 
(
 r
 pr? p(
 (3 
(
 r
 prXY p(
 (3 
*  0 T    ( o o=  +
rm po 
o 
r
 pr p( 
o 
o 
o 
r pr p{ (K  +   ( o 
r po4 
o 
rݚ pr p{ ( 
(
 o 
r pr p{ ( 
(
 r po 
#      >@( 
o 
rݚ po 
#      >@( 
o 
r po 
#      D@( 
o 
o 
rM pr p{ (K  +
	   ( o 
	r po4 
o 
ri pr p{ ( 
(
 o 
r pr p{ ( 
(
 rM po 
#      >@( 
o 
ri po 
#      >@( 
o 
r po 
#      D@( 
o 
o 
r͛ pr p{ (K  +   ( o 
r po4 
r p(
 &o 
r1 pr p{ ( 
(
 r͛ po 
#      >@( 
o 
r po 
#      >@( 
o 
r1 po 
#      D@( 
o 
o 
rk pr p{ (K  +   ( o 
r po4 
o 
r pr p{ ( 
(
 (
 r po 
(
 ~ 
o 
(
 ds 
o 
o 
r pr p{ ( 
(
 rk po 
#      >@( 
o 
r po 
#      >@( 
o 
r po 
#      D@( 
o 
o 
o 
&o 
r
 pr p( 
r) po 
o 
o 
o 
r[ pr p{ (K  +   ( o 
r po4 
o 
r pr p{ ( 
(
 o 
r pr p{ ( 
(
 r[ po 
#      >@( 
o 
r po 
#      >@( 
o 
r po 
#      D@( 
o 
o 
rٝ pr p{ (K  +   ( o 
r po4 
r p(
 &o 
r5 pr p{ ( 
(
 rٝ po 
#      >@( 
o 
r po 
#      >@( 
o 
r5 po 
#      D@( 
o 
o 
rW pr p{ (K  +		   ( o 
	r po4 
o 
r pr p{ ( 
(
 (
 r po 
(
 ~ 
o 
(
 ds 
o 
o 
rǞ pr p{ ( 
(
 rW po 
#      >@( 
o 
r po 
#      >@( 
o 
rǞ po 
#      D@( 
o 
o 
o 
&o 
r
 prV p( 


o 

o 
r p{ ( 
   ( o 

o 
o 

o 
&( 
*0	 C    ( o o=  +
o 
r
 pr p( 
o 
( r7 po (
 o 
r
 pri p( 
o 
o 
r{ pr p{ (<  +(
 (
 o 
( 
o 
r
 pr p( 

( 	r po 	o 
( o o=  +	o 
r p  %( 
o 
o 
o5 
o6 
r	 po 
( 
o 
r7 prE p{ (B  +~ 
~ 
( ( o 
r prE p{ (B  +~ 
~ 
( ( o 
r p( u' ,rՠ po 
o 
o 
r prE p{ (B  +		~ 
~ 
( ( o 
r prE p{ (B  +

~ 
~ 
( ( ( 
* 0
     ( o o=  +
r% po 
o 
r
 prY p( 
o 
o 
o 
rK pr p{ (K  +   ( o 
rY po4 
ro p(
 &rK po 
#      9@( 
o 
ro po 
#     R@( 
o 
o 
r pr p{ (K  +
	   ( o 
	rY po4 
	o 
o 
r pr p{ ( 
r po 
~ 
o 
   s 
o 
o 
rۡ pr p{ ( 
(
 r po 
#      9@( 
o 
r po 
#      >@( 
o 
rۡ po 
#     F@( 
o 
o 
r
 prY p( 
o 
o 
o 
r pr p{ (K  +   ( o 
rY po4 
r# p(
 &r po 
#      9@( 
o 
r# po 
#     R@( 
o 
o 
rE pr p{ (K  +   ( o 
rY po4 
o 
o 
rg pr p{ ( 
r po 
~ 
o 
   s 
o 
o 
r pr p{ ( 
(
 rE po 
#      9@( 
o 
rg po 
#      >@( 
o 
r po 
#     F@( 
o 
o 
r
 prL p( 
		o 
	o 
r pr p{ ( 
rŢ po 
o 
r
 prl p( 


o 

o 
rϢ p{ ( 
   ( o 
o 
r
 pr p( 
o 
( r po o 
o 
r= pr p(L  +&o 
ra pr p(L  +&( o oC  +r p( o 
o 
o 
   ( o 
o 
rx p  %( 
&( 
*  0     ( o o=  +
o 
r
 pr p( 
( r po o 
( o o=  +o 
r p  %( 
o 
o 
o5 
o6 
r	 po 
( 
o 
r prE p{ (B  +
	~ 
s 
( ( o 
rɣ prE p{ (B  +~ 
s 
( ( o 
r p( u' ,rՠ po 
o 
o 
r prE p{ (B  +~ 
s 
( ( o 
r prE p{ (B  +~ 
s 
( ( ( 
*   0     " %rj2 p%r2 p%rB3 p%r3 p%rh3 p%r2 p%r2 p
" %   ( %   (  
%   (  
%   (  
%   (  
%   (  
%   (  
i[  
8   ( 
r po 
( o r# p  o@  +rC po 
o 
( o ( o  
	oz 
o  
r[ p( 		o7 
Yo8 
(  
o 
o 
ro p(  
(  
o 
( o oA  +	o 
r po 
o< 
o= 
o< 
o= 
		X
	i?o 
r
 p( 
&*   0        (
 o 
(
 o 
(
 o 
(
 o 
o 
(
 o 
(
 . (~  
o 
(
 o 
   ( . o  
&(
 o 
   ( . o  
&(
 o 
   ( . o  
&(
 o 
   ( . o  
&(
 . o 
*0 Y      ( (
 (
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 . (~  
o 
(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 . (~  
o 
(
 o 
(
 o 
oN 
(
 . (~  
o 
(
 o 
   ( . o  
&(
 o 
   ( . o  
&(
 . (~  
o 
(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 . (~  
o 
(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 . (~  
o 
(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 . (~  
o 
(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 . (~  
o 
(
 o 
(
 o 
oN 
(
 o 
   (  
. o  
&(
 . (~  
o 
(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 . (~  
o 
(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 . (~  
o 
(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 o 
   (  
. o  
&(
 . (~  
o 
(
 rx po 
o 
(
 o9 
(
 o 
o 
(
 o 
o 
(
 o 
o 
(
 o 
o 
*   0 m    (
 o: 
rc po; 

   ( o< 
o= 
(
 r p   u r
 p( 
(
 r p   u r
 p( 
(
 rV pFu r
 p( 
(
 r p   u r
 p( 
(
 r p   u r
 p( 
(
 r p   u r
 p( 
(
 r1 p   u r
 p( 
(
 rǞ p   u r
 p( 
(
 r p   u r
 p( 
(
 r5 p   u r
 p( 
(
 o: 
rS po; 
   ( o< 
(
 r p   u r
 p( 
(
 ri p    u r
 p( 
(
 r p   u r
 p( 
(
 o: 
r? po; 
   ( o< 
(
 rY peu r
 p( 
(
 rY pdu r
 p( 
(
 rۡ p   u r
 p( 
(
 r p   u r
 p( 
(
 rL p   u r
 p( 
(
 r p   u r
 p( 
(
 rl p   u r
 p( 
(
 r p   u r
 p( 
(
 r= peu r
 p( 
(
 ra pdu r
 p( 
(
 o: 
rXY po; 
]( o< 
(
 r p]u r
 p( 
*   0 @     o 
r p{ (B  +
~ 
~ 
( ( . o 
*r# p*( *{c *"}c *{d *"}d *{e *"}e *{f *"}f *{g *"}g *0 m    o 
( o oM  +( ( rG po 
( r p( o 
( #      Y@( 
o> 
o 
r
U p  %( ( 

o 
o 
#      Y@( 
o? 
( o o=  +(
 o 
r p  %(
 ( 
o 
rͤ po 
(
 o 
r
 pr p( 
o 
o 
o 
r! p{ ( 
&(
 r! po 
#      Y@( 
o 
o 
rA pr_ p{ ( 
(
 o 
r prK p{ (B  +
o 
( #      Y@( 
o 
( o oC  +r po 
o 
 @  ( o 
r p( o 
rK p(@ 
o 
rͥ p  %( 
#      Y@( 
o 
o 
(
 o 
r
 pr p( 
o 
o 
o 
r pr_ p{ ( 
(
 o 
r1 prK p{ (B  +   s 
   s 
( ( (
 o 
r
 pry p( 
o 
o 
r prK p{ (B  +		   s 
   s 
( ( o 
r% pr_ p{ ( 
( *( ( r
U po 
o 
( (	 (
 ( *(
 o 
o 
(
 o 
   oA 
* 0 7      ( r
U p N  u r
 p( 
(
 r p G  u r
 p( 
(
 r! p G  u r
 p( 
(
 rA p H  u r
 p( 
(
 r p F  u r
 p( 
(
 r p I  u r
 p( 
(
 r% p M  u r
 p( 
(
 r1 p D  u r
 p( 
(
 r p E  u r
 p( 
(
 ry p C  u r
 p( 
* 0 0     
+&( o 
X(  
. o  
&X
	2*0 y       (  o 
 O  ( . o  
&(  o 
 P  ( . o  
&(  o 
 Q  ( . o  
&(  . (~  
o 
*   0 y       (
 o 
 J  ( . o  
&(
 o 
 K  ( . o  
&(
 o 
 L  ( . o  
&(
 . (~  
o 
*   0      (
 o 
oB 
(C 

oD 
+YoE 
~F 
(G 

rM p	joH 
	joH 
	joH 
(I 
(
 o 
oE 
. o  
&X2(
 . (~  
o 
*rk p*( *{h *"}h *0     ( o oJ  +( ( r p( o2 
( oJ 
o 
(b 
oK 
( o9 
o 
r p  %( ( 
o 
" %r p%r
 p(L 

o 
( o 
r7 p. (/ 
o 
" %r p%r
 p(L 
o 
( o 
r7 p. (/ 
o 
" %r p%r
 p(L 
o 
( o 
r7 p. (/ 
o 
( r
 prm p(3 
( r
 pr p(3 
( r
 pr p(3 
* 0 '   z  r p R  ( 
o 
o 
( * 0 @       ( rm p S  ( ( r p T  ( ( r p U  ( *r˧ p*( *{i *"}i *o ( o 
r
 p  %( ( 
o 
*2( om *0        ( ( r poM 
( r poV  
( oN 
o 
( o<  
oO 
#     @o@sP 
oQ 
( o<  
oR 
oS 
#      ?sP 
oT 
( ( r p( oV  
*   0     ( o<  
( o oU 
( oW  
( o o o 
( o>  
( o oR o 
( o?  
( o oS o 
( o@  
( o oT o 
( oA  
( o oU o 
( oB  
( o oV o 
( oC  
( o oW o 
( oD  
( o oX o 
( oE  
oV 
( o>  
( o9 o 
( o oJ 
(  
-
(W 
(. 
+r
 p( o9 (X 
o 
o 
( ,( o>  
r
 pon 
oY 
( oT  
( o o[ oZ 
(  s[ 
oF  
(  s\ 
oH  
(  s] 
oJ  
(  s^ 
oL  
(   s_ 
oN  
( ! s` 
oP  
( " sa 
oR  
( oT  
( o o[ oZ 
( o<  
oO 
#     A@( 
oQ 
*"ob 
*6( oX *oc 
od 
(# ,   ( oe 
of 
( oZ *0 9     og 
od 

(# ,   ( oe 
of 
( o[ *   0 9     oh 
od 

(# ,   ( oe 
of 
( oY *6( o\ *6( o] *6( o^ * 0 ,     (  
-( o9 (  
(X 
(i 

*r# p*( *{j *"}j *{k *"}k *{l *"}l *{m *"}m *{n *"}n *{o *"}o *{p *"}p *{q *"}q *{r *"}r *{s *"}s *{t *"}t *  0        ( o oJ  +(' (& rK p( o2 
o 
rC p  %(& ( 
o 
(= () (> (+ (? (- (& r
 pru p(( (3 
(& r
 pr< p(* (3 
(& r
 pr< p(, (3 
o 
( &o 
r' pr_ p{ ( 
(3 * 0	     ( o o=  +
( o   %~
 %-&~
  s 
%
 o>  +o 
o 
&o 
r7 pr p{ (B  +s 
s 
( ( o 
r pr p{ (B  +
	s 
s 
( ( o 
r pr p{ (B  +~ 
s 
( ( o 
r pr p{ (B  +~ 
s 
( ( ( o   %~
 %-&~
  s 
%
 o>  +o 
o 
&o 
r
 pr p{ (<  +(1 ( 
*   0      ( o o=  +
( o   %~
 %-&~
  s 
%
 o>  +o 
o 
&o 
ry pr_ p{ ( 
(5 o 
r prK p{ (B  +s 
s 
( ( o 
r prK p{ (B  +
	s 
s 
( ( ( 
*   0 _    ( o o=  +
( o   %~
 %-&~
  s 
%
 o>  +o 
o 
&o 
r pr_ p{ ( 
(7 ( o   %~
 %-&~
  s 
%
 o>  +o 
o 
&o 
r٨ p{ ( 
(9 o 
r p{ ( 
(; o 
r3 p( 

	rA po 
	o 
( o o=  +(/ (. o 
(. rA po 
(. ( 
( o oA  +l( o 
(. o 
r
 p  %( 
o 
o 
(. o 
rc prE p{ (B  +~ 
s 
( ( (. o 
r prE p{ (B  +~ 
s 
( ( 	o 
r p  %(. ( 
o 
( 
* 0 h    ( (0 o 
S( . o  
&(0 o 
T( . o  
&(0 . (~  
o 
(0 o 
(0 o 
( 
o 
(0 r po 
(0 r p( o 
  (~  
(j 

+>
  (~  
	(k 
  (4 o 
( . o  
&Xi2(4 . (~  
o 
(6 o 
U( . o  
&(6 o 
V( . o  
&(6 o 
W( . o  
&(6 o 
X( . o  
&(6 . (~  
o 
(2 o 
Y( . o  
&(2 o 
Z( . o  
&(2 o 
[( . o  
&(2 o 
\( . o  
&(2 . (~  
o 
(( o 
o 
(, o 
o 
(* o 
o 
(& o9 
*0       (& ru p]( (& r< p^( (& r< p_( (( r p]u r
 p( 
(( rݩ pbu r
 p( 
(( r7 p`u r
 p( 
(( r pau r
 p( 
(( r p*u r
 p( 
(( r p+u r
 p( 
(* r pcu r
 p( 
(* r pdu r
 p( 
(* r peu r
 p( 
(. rc pmu r
 p( 
(. r pnu r
 p( 
(, r pgu r
 p( 
(, r pfu r
 p( 
(, r7 phu r
 p( 
(8 i( o 
(: j( o 
( r' pku r
 p( 
*re p*( *{u *"}u *{v *"}v *{w *"}w *{x *"}x *{y *"}y *{z *"}z *{{ *"}{ *{| *"}| *{} *"}} *{~ *"}~ *{ *"} *{ *"} *{ *"} *{ *"} *0        ( o oJ  +(E o 
rC p  %(D ( 
o 
(a (G (b (Q (D r pr p(F (3 
(D r pr p(P (3 
(D o9 
*  0     ( o o=  +
o 
r
 prǪ p( 
o 
o 
r pr p{ ( 
(Y o 
r pr p{ ( 
([ o 
r
 pr p( 
o 
o 
( o o=  +(I o 
r5 p  %(H ( 

	o 
	#     F@( 
o 
(H o 
r pr p{ (B  +~ 
~ 
( ( (H o 
r pr p{ (B  +~ 
~ 
( ( ( o o=  +(K (J ra po 
(J o 
o 
r p  %(J ( 
o 
#     K@( 
o 
(J o 
rݫ pr p{ ( 
(] (J o 
r prK p{ (B  +~ 
s 
( ( (H o 
o 
(J o 
o 
(H ( 
(J ( 
( (J o o 
r
 pr p( 
o 
o 
( o o=  +(M o 
r p  %(L ( 
		o 
	#     F@( 
o 
(L o 
r= pr p{ (B  +

~ 
 0  s 
( ( (L o 
rQ pr p{ (B  +~ 
 0  s 
( ( ( o o=  +(O (N ra po 
(N o 
o 
rc p  %(N ( 
o 
#     K@( 
o 
(N o 
r pr p{ ( 
(_ (N o 
r prK p{ (B  +

s 
    s 
r p( (L o 
o 
(N o 
o 
(L ( 
(N ( 
( (N o o 
r p{ ( 
(S ( 
*0 o     ( o o=  +
o 
C( { ( 
&o 
r׬ p{ ( 
(U o 
r p{ ( 
(W ( 
* 0   
  ( (X o 
*( . o  
&(X o 
+( . o  
&(X o 
,( . o  
&(X o 
-( . o  
&(X . (~  
o 
(Z o 
/( . o  
&
+2(Z o 
r p0( . (! 
. o  
&X
	1(Z . (~  
o 
(\ o 
4( . o  
&(\ o 
5( . o  
&(\ o 
6( . o  
&(\ . (~  
o 
(^ o 
<( . o  
&(^ o 
=( . o  
&(^ o 
>( . o  
&(^ o 
?( . o  
&(^ o 
@( . o  
&(^ o 
A( . o  
&(^ . (~  
o 
(F o 
o 
(F o 
   oA 
(P o 
o 
(P o 
   oA 
*  0       (D r p&( (D r p'( (F rǪ p(u r
 p( 
(F r p1u r
 p( 
(F r p7u r
 p( 
(N r p9u r
 p( 
(N r p:u r
 p( 
(J rݫ p2u r
 p( 
(J r p3u r
 p( 
(F r p)u r
 p( 
(F r p.u r
 p( 
(H r p*u r
 p( 
(H r p+u r
 p( 
(L r= p8u r
 p( 
(L rQ p;u r
 p( 
(R B( o 
(T D( o 
(V E( o 
* 0 -   z  r p4( 
   (  
o 
o 
( *r p*( *F( o o *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *0	     (h o -%o 
r pr p{ (<  +(r o 
( 
(t (s rA po 
(h o ;  (s o 
r= pr p{ (N  +
ol 
( o oO  +om 
(s o 
rY p{ ( 
(l (s o 
rq pr p{ ( 
(n (w (j (i oA 
(i on 
oo 
(i on 
 ,  (b 
op 
(i    (b 
o 
(i on 
oq 
(i on 
or 
( o  
(i o= 
(h o .M(s o 
r pr p{ ( 
(p ( o o9 o# 3(o os 
*0 j     r ps( 
( o o9 o# 3os 
r% pr( r} po 
ri po( o 
o 
o 
*  0      ( o rɭ p  oP  +
ot 
ou 
ov 
r pow 
r pox 
oy 
oz 
o{ 
o| 
o} 
o 
#        sP 
oK 
o~ 
o 
( o r! p  oQ  +r! po 
s ( o o  
o 
rW po 
o< 
o= 
o 
o= 
*0 J     ( (h o .5s  

r p( o! 
r pR( o 
o< 
o= 
*  0      ( ( rî p( o 
(h o -( o o9 o# .(z (} 
(h o .(m o 
oN 
(| (h o .5(o o 
oN 
( o o9 o# 3(o os 
* 0        (q r
 po 
(q o 
(q o 
(q o 
o 
(q o 
(q . (~  
o 
(q o 
J( . o  
&(q o 
K( . o  
&(q . o 
( o o9 o# 3(q os 
*0        (h o .f( r= pLu r
 p( 
( rY pNu r
 p( 
( rq pMu r
 p( 
(i P( o 
(h o .( r pOu r
 p( 
* 0 \       (k o 
r߮ po 
(k o 
o 
r po 
(k o 
o 
Q( o 
(k o 
( *0 K    s  

( o oR o 
 s 

8  	( YE
   J   5   _      t                  8   r3 po 
o 
8   r po 
o 
8   r po 
o 
+|r po 
o 
+gr po 
o 
+Rrk po 
o 
+=r po 
o 
+(r po 
o 
+r) po 
o 
X	i?*ri p*( *  0 :     s 
}
 }
 ( o   % s 
oR  +*( on ( o 
r
 p  %( ( 
o 
*  0 6     r pt( 
r} po 
r po( o 
o 
*^( ( r
 po 
*(% *{ *"} *{ *"} *0     o 
r
 pr p( 

o 
o 
o 
r! p{ ( 
r_ po 
( o oC  +r po 
o 
 @  ( o 
r p( o 
o 
rͥ p  %( 
o 
( r! po 
#     @S@( 
o 
( rͥ po 
#      7@( 
o 
o 
rA pr_ p{ ( 
( o 
r prK p{ (B  +( rA po 
#     @S@( 
o 
( r po 
#      7@( 
o 
o 
r
 pr p( 

	o 
	o 
	o 
r pr_ p{ ( 
( 	o 
r1 prK p{ (B  +   s 
   s 
( ( ( r po 
#      N@( 
o 
( r1 po 
#      D@( 
o 
o 
r
 pry p( 
o 
o 
r prK p{ (B  +   s 
   s 
( ( *( ( r po 
o 
( ( *   0        ( r p G  u r
 p( 
( rA p H  u r
 p( 
( r p I  u r
 p( 
( ry p C  u r
 p( 
( r p F  u r
 p( 
( r1 p D  u r
 p( 
( r p E  u r
 p( 
*  0 y       ( o 
 J  ( . o  
&( o 
 K  ( . o  
&( o 
 L  ( . o  
&( . (~  
o 
*   0      ( o 
oB 
(C 

oD 
+YoE 
~F 
(G 

rM p	joH 
	joH 
	joH 
(I 
( o 
oE 
. o  
&X2( . (~  
o 
*rű p*( *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} * 0	 *    o 
( o oA  +
   ( o 
r p( o 
( o oA  +   ( o 
r) p( o 
o 
r
 p  %%( 
o 
#      Y@( 
o 
o 
rI prg p{ (S  +( ( o 
( rI po 
#      N@( 
o 
r{ p   ( ( ( r po 
r p   ( ( ( r po 
rŲ p   ( ( ( r po 
o 
r
 p  %( %( %( ( 

	o 
	#      D@( 
o 
	o 
( o oA  +   ( o 
o 
r
 p  %( 
o 
#      Y@( 
o 
o 
r pr p(;  +( ( r po 
#      N@( 
o 
r+ p   ( ( ( r po 
r% p   ( ( ( r po 
r9 p   ( ( ( r po 
o 
r
 p  %( %( %( ( 
o 
#      D@( 
o 
o 
*  0 =     rS p4( 
o 
rV po 
o 
ri po( o 
*   0 I       ( o 
( o 
( o 
( o 
( o 
( o 
*ri p*( *{ *"} *   0
      o 
r{ pr p{ ( 

~ 
o 
o 
r pr p{ ( 
r p( o 
~ 
o 
o 
( &o 
r p{ ( 
( *  0 K       ( r{ pyu r
 p( 
( r pzu r
 p( 
( {( o 
*r p*( *{ *"} * 0 W     o 
r pr_ p{ ( 
( o 
( &o 
r p( 
u' ,r po 
* 0 9     ( 
+$~ oT ( o 
o  
&X
~ i2*r( r pu r
 p( 
*r p*( *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *   0        ( o oJ  +( ( rE p( o2 
o 
rC p  %( ( 
o 
( ( ( ( ( ( ( ( ( r
 pru p( (3 
( r
 pr< p( (3 
( r
 pr< p( (3 
( r
 pr< p( (3 
*  0	 5    ( o o=  +
( o   %~
 %-&~
  s 
%
 o>  +o 
o 
&o 
r{ p{ ( 
( r{ po 
#      >@( 
o 
o 
r prK p{ (B  +r po 
#      4@( 
o 
~ 
~ 
( ( o 
. o 
o 
rô pr p{ ( 
( rô po 
#      I@( 
o 
( o 
( o   %~
 %-&~
  s 
%
 o>  +
o 
	o 
&	o 
r pr p{ (<  +( r po 
o 
	o 
r prK p{ (B  +~ 
~ 
( ( r p( ( o   %~
 %-&~
  s 
%
 o>  +o 
o 
&o 
r+ p{ ( 
( o 
rK prK p{ (B  +~ 
~ 
( ( o 
rK po 
t ra po 
o 
r p{ ( 
( r p    ( o 
r
 p  %( 
	( 	rO po ( 
*   0     ( o o=  +
( o   %~
 %-&~
  s 
%
 o>  +o 
o 
&o 
rϵ p{ ( 
( rϵ po 
#      >@( 
o 
o 
r prK p{ (B  +r po 
#      4@( 
o 
~ 
~ 
( ( o 
o 
r pr p{ ( 
( r po 
#      I@( 
o 
( o 
r% p    ( 
	o 
r; p    ( o 
o 
r
 p  %	%( 
o 
o 
( o   %~
 %-&~
  s 
%
 o>  +o 
o 
&o 
rQ p{ ( 
( ( 
*  0     ( o o=  +
( o   %~
 %-&~
  s 
%
 o>  +o 
o 
&o 
rk p{ ( 
( rk po 
#      >@( 
o 
o 
r prK p{ (B  +r po 
#      4@( 
o 
~ 
~ 
( ( o 
o 
r pr p{ ( 
( r po 
#      I@( 
o 
( o 
rݶ p    ( 
	o 
r p    ( o 
o 
r
 p  %	%( 
o 
o 
( 
* 0	 z    ( o o=  +
( o   %~
 %-&~
  s 
%
 o>  +o 
o 
&o 
r p{ ( 
( r po 
#      >@( 
o 
o 
r7 prK p{ (B  +r7 po 
#      4@( 
o 
~ 
~ 
( ( o 
o 
rY pr p{ ( 
( rY po 
#      I@( 
o 
( o 
( o   %~
 %-&~
  s 
%
 o>  +
o 
	o 
&	o 
r{ pr p{ (<  +( r{ po 
o 
( o 
r p{ ( 
( ( o   %~
 %-&~
  s 
%
 o>  +o 
o 
&o 
r p{ ( 
( ( o   %~
 %-&~
  s 
%
 o>  +o 
o 
&rٷ p*( o 
r p`( o 
r pa( 		o 
r; p+( 

o 
o 
r
 p  %( 
o 
o 
r
 p  %( 
&o 
r
 p  %
( 
o 
o 
r
 p  %	( 
&o 
( 
*  0     ( o   %~
 %-&~
  s 
%
 o>  +
o 
o 
&( o o=  +o 
r
 p  %( 
o 
o 
o5 
o6 
r	 po 
( 
o 
r p(  
rE p{ (B  +~ 
~ 
( ( o 
rɣ p(  
rE p{ (B  +
	~ 
~ 
( ( o 
r
 p( u' ,rՠ po 
o 
o 
r p(  
rE p{ (B  +~ 
~ 
( ( o 
r p(  
rE p{ (B  +~ 
~ 
( ( *0       ( ( o 
*( . o  
&( o 
B( 
. o  
&( o 
+( . o  
&( ( ( o 
`( . o  
&( o 
B( 
. o  
&( o 
a( . o  
&( ( ( o 
   (  
. o  
&( o 
   (  
. o  
&( . (~  
o 
 %( %( %( ( ( o 
o 
( o 
o 
( o 
o 
( o 
o 
( o9 
*o 
o 
. (~  
o 
o 
o 
o 
*0      
+r. (~  
o 
o 
( 
. o  
&o 
( o o7 .	( 
+( 
. o  
&. o 
Xi2* 0       ( ru p    ( ( r< p    ( ( r< p    ( ( r< p    ( (     ( o 
( r] p    u r
 p( 
( rq p    u r
 p( 
( rô p    u r
 p( 
( r p    u r
 p( 
( r p    u r
 p( 
(     ( o 
( r pFu r
 p( 
(     ( o 
(     ( o 
( r] p    u r
 p( 
( r p    u r
 p( 
( r pFu r
 p( 
(     ( o 
( r] p    u r
 p( 
(     ( o 
( r p    u r
 p( 
(     ( o 
(     ( o 
( r] p    u r
 p( 
( r˸ p    u r
 p( 
( r pFu r
 p( 
( r p    u r
 p( 
( rY p    u r
 p( 
(     ( o 
*r p*( *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} *{ *"} * 0	     o 
o 
r/ p{ ( 
( ( r/ po 
#      N@( 
o 
o 
rU prK p{ (B  +
( rU po 
#      D@( 
o 
~ 
   s 
( ( o 
r{ pr p{ (;  +&( r{ po 
#      N@( 
o 
( o oA  +( ( r p( o 
o 
rŹ p  %( ( 
( rŹ po 
#      D@( 
o 
o 
o 
o 
o 
r
 prݹ p( 
#      Y@( 
o 
o 
r pr p{ (<  +( o 
r
 pr7z p( 

	#      Y@( 
o 
	o 
r pr p{ (<  +( r- p a  ( ( ( o 
rA p b  ( ( ( o 
rY p c  ( ( o 
r
 p  %( %( %( ( 
#      Y@( 
o 
( rO po *( o 
( o 
( o 
*6( o 
*0 &      ( ( ( o ( ( o 
( o 
 i  ( . o  
&( o 
 j  ( . o  
&( o 
 k  ( . o  
&( o 
 l  ( . o  
&( o 
( o 
o 
( o 
( . (~  
o 
( o 
 m  ( . o  
&( o 
 n  ( . o  
&( o 
 o  ( . o  
&( o 
 p  ( . o  
&( o 
 q  ( . o  
&( o 
 r  ( . o  
&( o 
 s  ( . o  
&( o 
( o 
( o 
o 
( rw po 
( . (~  
o 
( *  0        ( r/ p d  u r
 p( 
( rU p e  u r
 p( 
( rݹ p g  u r
 p( 
( r7z p h  u r
 p( 
( rŹ p f  u r
 p( 
*0 _       ( o 
o 
r po 
( o 
o 
( o 
o 
( o 
o 
( o 
o 
*rպ p*( *  0    \  sZ 

- o 
( *  0    \  sZ 

. o 
( o 
* 0      sZ 

 o 
(T  + o 
( 
(T  + o 
(T  + o 
(T  + o 
(U  +. o 
( o 
. o 
(  o 
*0 A   \  sZ 

  ( 
(V  +  ( 
(V  +  ( 
(V  +*   0 A   \  sZ 

  ( 
(T  +  ( 
(T  +  ( 
(T  +*   0     sZ 

~ 
B ov  
o 
( o 
~ 
B ov  
o 
( o 
~ 
B ov  
o 
( o 
~ 
B ov  
o 
( o 
~ 
B ov  
o 
( o 
~ 
B ov  
o 
( o 
~ 
B ov  
o 
( o 
~ 
B ov  
o 
( o 
~ 
B ov  
o 
( o 
~ 
B ov  
o 
( o 
~ 
B ov  
o 
( o 
~ 
B ov  
o 
( o 
*0 P   \  sZ 

 o 
(  o 
(  o 
(  o 
( *0 T   a  s 
 (\ o 
 (\ o 
 (\ o 
 (\ o 
*0 $   \  sZ 

 o o o 
(T  +*0 $   ]  s 
o  (,  +( 
o *{ 
*"} 
*J(r  
s 
( 
*0 Q     ( 
o 
,*o 

+ C 
( 
( 
o 
Xi2( 
o 
*{ 
*"} 
*J(r  
s 
( 
*   0 5   
    -*( 
 o 
-( 
o 

( 
o 
*   0 g     sZ 

( 
o 
+8( 
sZ 

( 
	  o ( 
. 	o[ 
( 
-  og  
*     EW     0 -     s 

} 
( 
 
s 
(W  +( 
*   0     s 
}
 sZ 
. {
 { {
 { {
 { (i o 
. {
 ( o 
. o 
~
 %-&~
  s 
%
 (X  +o 
. o 
 s 
(Y  +o 
. o 
 s 
(Z  +o 
. {
 {
 ( o 
. {
 {
 ( o 
(e 
,. oQ 
( o 
,#{
 {
 o 
    s+ o 
+J. oE  s 
(Y  +o 
{
 {
 o 
        s* o 
	. o 
( o 

. o 
o 
( o 
. o 
( o 
*   0 _       * (7  +(j * (7  +( * (-  +(m * (-  +(p * (-  +( * 0 6     sZ 

+%(  
o 
( 
. o 
X?2*  0 [     s 

oR 
+DsZ 

	? (T  +	? o^ 
of 
(g 
( 	o 
&X%oR 
-* 0 `     ,\s o 
o8 

+-ok  
tz  ~ o 
t" ( 
s, 
o` 
&oh  
-u  ,og  
*    9N     F~ o 
. *(r  
*  0    
  
 (  
 
 (  
 *   0     s 
}
 sZ 
:1  . o 
~
 %-&~
  s 
%
 ([  +o[ 
. o 
~
 %-&~
  s 
%
 (\  +~
 %-&~
  s 
%
 (]  +o[ 
. o 
~
 %-&~
  s 
%
 (^  +~
 %-&~
  s 
%
 (^  + s 
(_  +o[ 
. o 
~
 %-&~
  s 
%
 (`  +o[ 
(9 
. {
 o- {
 {
 s ( o[ 
. {
 { ( o[ 
*0     o@ 
o 
s k (-  +k (-  +( k (-  +o8 
+ok  
tz  (v oh  
-u  
	,	og  

o 
o 
+o 
%X
o 
oh  
-,og  
k (-  +o8 
+ok  
tz  ( oh  
-u  
	,	og  
k (-  +o8 
+ok  
tz  		(r oh  
-u  
	,	og  
k (-  +o8 

+
ok  
tz  ( 
oh  
-
u  
	,	og  
o@ 
o 
* @   E d       "       $      #1     V#y    0    \  sZ 

+ o 
( + o 
(T  ++ o 
(T  ++ o 
(T  ++ o 
( + o 
( + o 
( + o 
( *0        + (Z o 
+ (a  +o 
+ (b  +o 
+ (,  +o 
+ ([ o 
+ ([ o  
+ ([ o 
+ ([ o 
*   0 d   \  sZ 

. o 
  o 
. o 
. o 
. o 
. o 
o 
. o 
o 
*0 c      (,  +
 (,  +s9 
Xs9 
s 
 (\ o	 
 (\ o
 
o 
o 
&* 0    \  sZ 

$  ( 
( $  (
 
( $  ( 
( $  ( 
( $  ( 
(T  +$  ( 
(T  +$  ( 
(T  +$  ( 
(T  +$  ( 
(T  +* 0       R  $ (\ ( 
 $ (\ ( 
 $ (\ ( 
 $ (\ ( 
 $ (c  +( 
 $ (c  +( 
 $ (c  +( 
 $ (c  +( 
 $ (d  +( 
*   0 I   \  sZ 

o 
-*o (T  +o ( o (e  +,
o ( *   0 _     o (-  +
o (,  +(9 
o8 
+ok  
tz  
	(# &oh  
-u  ,og  
*    ' #J     0     s 
}
 V (.  +V (,  +}
 V (,  +V (,  +
	o@ 
o 
o 
o  
/o@ 
o 
o 
	o! 
-r p	. ( 
sS 
zV (,  +oG 
 s" 
(f  +(g  +YE
         3   J   a   x   z  r     x           8  sJ 
($ *sK 
($ *sL 
($ *sM 
($ *sN 
($ *sO 
($ *sP 
($ ***W (7  +&W (7  +'W (,  +('7 (7  +( )o@ 
oQ 
(oR 
sT 
*oE 
*o 
*o 
o 
~ 
( 
,*o 
*o 
o 
*o 
*o 
o 
*t )(c 
k"  B[)(d 
k"  B[(U 
**Y (7  +Y (7  +Y (,  +	Y (7  +

( o@ 
oQ 
	oR 
7 (7  +( 
6 (,  +6 (Z sV 
sW 
oX 
oY 
oZ 
oX 
o[ 
o\ 
oE 
o 
o 
o 
~ 
( 
,o 
o 
o 
o 
o 
o 
o] 
t o^ 
o_ 
o` 
oa 
ob 
oc 
o@ 
od 
(e 
(c 
k
(c 
k"  B[kZl(f 
i(g 
(h 
(d 
k
(d 
k"  B[kZl(f 
i(g 
(i 
oj 
(d 
ok 
oj 
(c 
ol 
o@ 
o] 
t o^ 
( &(; *Z (7  +Z (7  +Z (,  +Z (7  +( 	Z (7  +6 (,  +6 (Z 9 (7  +( 9 (7  +( 9 (7  +( 9 (7  +G (9  +G (:  + (c 
(m 
,+(c 
(n 
!(d 
(m 
,+(d 
(o 
op 
"sq 
#"sr 
$#$os 
#ot 
~u 
ov 
#ow 
ox 
sV 
%%#o\ 
oE 
%o 
%o 
o 
~ 
( 
,%o 
%o 
o 
%o 
%o 
o 
%oj 
oz 
%oj 
 o{ 
%oj 
!o| 
%oj 
(c 
ol 
%oj 
(d 
ok 
%oa 
ob 
oc 
%o] 
t
 oy 
o_ 
o` 
%oj 
o} 
o@ 
%o] 
t o^ 
( &%o] 
t
 ot 
(/ ** 0 r       o 
oE 
o 
o 
o 
( 
o 
&o 
o 
~ 
( 
,o 
o 
o 
o 
o 
o 
*
*   0        ( Y o] 
t o^ 
( (h  +( Y (( (h  +( Y o] 
t o% 
oa 
(T  +( Y oj 
o& 
o' 
( (h  +*( * 0      sZ 

6 oa 
ob 
o( 
( (T  +6 o] 
t o^ 
o_ 
o) 
(T  +7 o] 
t o* 
( (h  +7 o+ 
(, 
o] 
t o* 
(c 
k["  BZo+ 
(- 
o] 
t o* 
(d 
k["  BZ( (h  +*   0 u     sZ 

6 o. 
( (T  +6 (T  +7 o/ 
( (h  +(0 
7 (, 
"  BZ(- 
"  BZ( (h  +*
*0      ( Z o] 
t
 oy 
( (h  +( Z (- (h  +( Z oj 
o& 
o' 
( (h  +( 	Z o] 
t
 (. (h  +o] 
t
 o1 

,%o2 
o3 
( Z o4 
(T  +*( Z (T  +*( * 0     sZ 

6 oa 
ob 
o( 
( (T  +6 o] 
t
 oy 
o_ 
o) 
(T  +9 o] 
t
 o5 
(6 
( (h  +9 oj 
o7 
(8 
oj 
o9 

(: 
( (h  +9 oj 
o7 
(; 
oj 
o9 

(< 
( (h  +9 oj 
o= 
( oj 
o> 
( ( (h  +*   0    \  sZ 

@ ot 
o? 
o@ 
( (T  +@ ot 
oA 
( (T  +@ ot 
oB 
(T  +@ ot 
oC 
( (T  +@ ot 
oD 
oE 
(V  +@ ot 
oD 
oF 
(V  +@ ot 
oD 
oG 
(V  +@ ot 
oD 
oH 
(V  +*  0        oI 
@ (Z -~J 
+~u 
ov 
@ (Z oK 
@ (i  +oL 
@ (Z -+oM 
oD 
@ (,  +koN 
oD 
@ (,  +koO 
oD 
@ (,  +koP 
oD 
@ (,  +koQ 
oR 
*
*( *
*( *
*( *
*( **( *	*  0 M       ( W ( (h  +( W oS 
oa 
(T  +( W () (h  +*( *	*   0 W       ( W ( (h  +( W o] 
t o% 
oa 
(T  +( W (( (h  +*( *
*sT 
z( **( *
*( *{ *"} *J(r  
s 
(H *(G o 
-#(G o 
oU 
oV 
(L o 
*(W oW 
-o 
oU 
(7  +(M oX 
*(,  +*   0      sZ 

C oY 
( C oZ 
(T  +oZ 
E   *   F         +^C o[ 
( +JC o\ 
(T  ++6C o] 
( 
(T  ++C o^ 

(_ 
(T  +*   0      s` 

C (j  +E   *   C         +XC (Z oa 
+DC (,  +ob 
+0C (,  +(c 
od 
+C (,  +se 
of 
C (Y og 
* 0 X   \  sZ 

 oh 
(T  + oi 
(T  + oj 
(T  +oi 
oJ oj 
oJ *0      sk 

 (k  +ol 
 (W o 
- (,  ++"om 
oU 
 (7  +(M oX 
on 
 (W o 
- (,  ++"om 
oU 
 (7  +(M oX 
oo 
*{ *"} *f(r  
s 
(Q } *(P o 
-)(P o 
op 
oq 
{ (N o 
*(W oW 
-o 
op 
(7  +(O or 
*(,  +*   0      t  os 

ot 
ou 
~v 
(w 
Xsx 
o? s0 sZ 

	3 -+Y(T  +	3 ( (h  +	3 (V (h  +	3   o1 (h  +	*   0 s     s 
}
 sZ 
}
 oy 
oz 
+1o{ 
oE 
{
 %-& s| 
%
}
 	o} 
oh  
-
,og  
{
 *    % =b 
    0    
  . 
 (  
*J(W o 
  *J(W o 
(~ 
*V(W o 
. * 0 3     (W o 
t" 
(  
-(W o 
t" ( 
** 0 '     (W o 
t" 
-~  
*-*( * 0 ]     t  os 

t  os 
o 
o 
(l  +o 
o 
(m  +o 
o 
(n  +o 
o 
(o  +*   0 @     o 

+"o 
  o 
o 
/o 
oh  
-
,og  
*    .5 
    0      -*(p  +
v (7  +rc p( 
	v (7  +r p( 
x (7  +
	r p( 
o4 ( 	* (-  +(a o 
* (-  +(q  +o 
* (-  +(r  +*0      o8 

+mok  
tz  s 
l (s  +
l (,  +op 
} 
 
s 
o 
  r p( 
  	o 
oh  
-u  ,og  
*       y     0      (d 
o 
+Dok  
C ( 
tz  p (7  +
( 
( 
op 
	( oh  
-u  ,og  
o8 
+Dok  
tz  \ (,  +s9 
o 
	o 
	o 


(b oh  
-u  ,og  
*     P_      { Q     0        \ (7  +( \ (7  +o 
~
 %-&~
  s 
%
 (t  +\ (7  +o 
~
 %-&~
  s 
%
 (u  +* 0 U     o 

+0ok  
C ( 
( 
( 
. o 
o 
oh  
-u  ,og  
*       <C     0 c    s 

s 
o 

+&	ok  
C ( 
( 
( 
o 
	oh  
-	u  ,og  
o 
8   ( 
( 
1( 
Y(e ( 
. (7  +p (v  +	
	E         2   X   +co 

+Ys 
o3 

o 
t o 
+3s 
o3 

o 
t o 
+
s 
(3 

( 

o 
( 
X( 
:  og  
*     2E      c S    0    
  
+s 
&X
2*(r  
*( 
*(y *0     sZ 

, o 
o 
(T  +, o 
o 
( , o 
o 
( , o 
o 
( 
(T  +, o 
o 
( (h  +, o 
o 
( (h  +, o 
( (h  +, o 
s  (" (h  +, o 
s ( (h  +	, o 
( (h  +*   0 ?    o 
, (,  +o 
o 
, (Z o 
o 
, (Z o 
o 
, (,  +(c 
o 
	, (7  +
o 
( , (7  +o 
o 
{ (L o 
( 
o 
&, (7  +
o 
o 
	(P o 
( 
o 
&, (7  +o 
( , (7  +o 
(% , (7  +o 
( * 0 ?   \  sZ 

J o 
( J o 
(T  +J (l (e  +* 0 9     s 

o 
o 
+o 
o 
({ o 
&X2*   0      o8 

8   ok  
tz  J (,  +J (-  +
s 
o 
	o8 
+\ok  
tz  o 
o 
X2o 
o 
+s 
o 
o 
(| Xoh  
-u  		,	og  
o 
o 
oh  
:)u  		,	og  
*     M i            0 I   \  sZ 

K o 
(T  +K o 
 o 
(T  +K (o (e  +*   0 \     s 

o 
o 
+@o 
o 

	um ,( o 
&+	tn (} o 
&X2*0 $    o8 

8   ok  
tz  K (,  +K (,  +
K (-  +	s 
s 
o 
o8 
+qok  
tz  	o 
o 
X2o 
o 
tn 	+(M (,  +

s 
	o 
	o 
	(~ Xoh  
-u  ,og  
o 
o 
oh  
:u  ,og  
*A4     b   ~                              0 R   \  sZ 

. o 
  o 
. o 
. o 
. o 
. o 
o 
*  0 R     n (,  +
n (,  +n (\ s9 
Xs9 
s 

	o 
o 
	o 
&*  0    \  sZ 

o9 o 
(t o9 o 
(t o9 o 
(t o9 o 
(t o9 o 
(t o9 o 
(t o9 o 
(t o9 o 
(t o9 o 
(t 	o9 o 
(t 
o9 o! (t o: o 
(t o: o 
(t 
o: o 
(t o: o 
(t o: o 
(t o: o 
(t o: o 
(t o: o 
(t o: o 
(t o: o 
(t o: o 
(t o: o 
(t o: o 
(t o: o 
o 
(t o: o 
o 
(t o: o 
o 
(t o: o 
(t o: o 
(t o: o 
(t !o9 o# (t o9 o 
rI p(5 
,. o9 o 
o 
o9 o 
,. o9 o 
. o 
o9 o' - . o9 o' U o 
". o9 o% ( . o 
*Z,. . o 
* 0 2    sZ 

. o 
o 
o 
o 
  o 
. o 
. o 
o 
o 
o 
  o 
. o 
. o 
o 
o 
o 
  o 
X. o 
o 
o 
o 
o 
,io 
o 
. o 
o 
. o  
o 
. o 
o 
. o 
( . . o 
+. . o 
*  0     . (,  +
. (,  +. (,  +. (Z 
s 
s9 
( 
o 
s9 
( 
o 
Ys9 
( 
o 
o 
o 
o 
( 
o 
o 
o 
	2	o	 
o
 
+]f	o 
/M	o	 
+3o 
o 
(
 
,o 
o 
( 
-
o 
-o
 
(w o 


,


iYXo 
	o 
	-js 
. (\ o 
. (\ o 
. (\ o 
. (Z o 
o 
o 
o 
*   0 L     o 

o 
,8
+,	o	 
o 
o 
3o	 
o
 
	X
	i2*0    \  sZ 

.    (  
o 
.    (  
o 
.    (  
o 
.    (  
o 
.    (  
o 
.    (  
o 
.    (  
o 
.    (  
o 
.    (  
o 
*  0     sZ 

Q o 
(T  +Q o 
(T  +Q o 
( Q o 
( Q o 
( Q o 
(T  +Q o 
( Q o  
(T  +Q o! 
( 
( 	Q o" 
(T  +
Q o# 
(T  +Q o$ 
( Q o% 
(T  +
Q o& 
(T  +*   0 	      Q (,  +o' 
Q (w  +o( 
Q (Z o) 
Q (Z o* 
Q (Z o+ 
Q (x  +o, 
Q (\ o- 
Q (,  +o. 
Q (\ (/ 
o0 
	Q (,  +o1 

Q (,  +o2 
Q (Z o3 
Q (,  +o4 

Q (,  +o5 
*   0      sZ 

o6 
o 
o7 
o8 
o9 
o: 

o; 
o< 
o- o 
o! 
C o= 
{ 	o 
	o 
C o> 
{ o; 
C o? 
L (T  +L 	(T  +L (T  +*  0      L (,  +
L (,  +L (,  +{ o@ 
oA 

o 
o 
o  
/o 
o 
o! 
+r p. ( 
sS 
zo7 
( 
o 
&o 
o 
oB 
/o 
o 
o 
+r p. ( 
sS 
zo9 
( 
o 
&	o; 
(z *0 >   \  sZ 

M oC 
(T  +M oD 
( M oE 
(T  +*  0 =     M (,  +
M (Z M (,  +oF 
oG 
oH 
*   0 =   \  ({ 
. oI 
. o 
. oJ 
( . o 
*   0   \  sZ 

 o 
(T  + o 
(T  + o 
(T  + oK 
(T  + oL 
(T  + o 
(T  + oM 
(T  + oN 
(T  + o 
(T  +	 o 
(T  +
 o 
(T  + o 
o 
(T  + o 
o 
(T  +
 o 
o 
(T  + o 
(T  + oO 
(T  + o 
(T  + o 
(T  + o 
(T  + o 
(T  + oP 
(T  + o 
(T  + o 
(T  + o 
(T  + o 
(T  + oQ 
(T  +*0     sx 
 (y  +oR 
 (y  +oS 
 (y  +oT 
 (y  +oU 
 (y  +oV 
 (y  +oW 
 (y  +oX 
 (y  +oY 
 (y  +oZ 
	 (y  +o[ 

 (y  +o\ 
o 
 (y  +o] 
o 
 (y  +o^ 
o 

 (y  +o_ 
 (y  +o` 
 (y  +oa 
 (y  +ob 
 (y  +oc 
 (y  +od 
 (y  +oe 
 (y  +of 
 (y  +og 
 (y  +oh 
 (y  +oi 
 (y  +oj 
 (y  +ok 
*0 Y  \  sZ 

' o 
(T  +' o 
(T  +' o 
(T  +' o 
(T  +' o 
(T  +' ol 
(T  +' om 
(T  +o 
(n 
,' rG p( +' o 
( ' o 
( 	' oo 
(T  +
' o 
(T  +' op 
( ' o 
(T  +
' o 
(T  +' oq 
(T  +' or 
( ' o 
(T  +' o 
(T  +' o 
(T  +' os 
(T  +' o 
( ' ot 
(T  +' ou 
( ' ov 
(T  +' ow 
( ' ox 
( ' o# (T  +' o' ( ' o! (T  +' o% ( *   0 t    ' (W o 

u" sH ' (y  +oy 
' (y  +oz 
' (y  +o{ 
' (y  +o| 
' (y  +o} 
' (z  +o~ 
' (z  +o 
,t" rG p(  
-( 
+"  o 

(  
o 
( 
o 
	' (y  +o 

' (y  +o 
' (Z o 
' ({  +o 

' (y  +o 
' (|  +o 
' (Z o 
' (y  +o 
' (y  +o 
' (y  +o 
' (y  +o 
' (\ o 
' (y  +o 
' (Z o 
' (y  +o 
' (Z o 
' (Z o 
' (y  +o" ' (y  +o$ ' (Z o( ' (Z o& *0     sZ 

 o -r
 p+o ov  
(  o (  o (T  + o (T  + o o (  o o (  o o (  o o (  o o ( 	 o o ( sZ 
o o 
8  ok  
ts 
sZ 
 	o 
-r
 p+	o 
ov  
(  	o 
(  	o 
( 	u ,C (T  + 	t o 
(  	t o 
( 8  	u ,C (T  + 	t o 
(  	t o 
( 8   	u ,+ (T  + 	t o 
( 8   	u ,X (T  + 	t o 
(  	t o 
(  	t o 
( +.	u ,& (T  + 	t o 
( 	o 
. o 
oh  
:+u  ,og  

 (h  +* A                   0     s 
 (\ ( 
o  (Z o  (,  +o  (,  +o o  (Z o o  (Z o o  (Z o o  (Z o o  (Z o o 	 (Z o 
 (7  +o 
om  
8  ok  
tz  
	 (}  +YE      h      C   8   s 
t 	 (\ o 
t 	 (\ o 
8   s 
t 	 (\ o 
8   s 
t 	 (\ o 
t 	 (\ o 
t 	 (\ o 
+[s 
t 	 (\ o 
+9s 
t 	 (\ o 
t 	 (\ o 
	 (\ ( 
o 
	 (\ o 
	 (\ o 
o o 
oh  
:]u  ,og  
*   A                   0    \  sZ 

. . o 
. . o 
. . o 
. . o 
. o 
. . o 
. . o 
*0      s 
S (,  +}
 S (,  +{
 -'oG 
o 
,oG 
 s" 
(~  ++$s 
oG 
o 
{
 s9 
o 
~ 
o 
o 
*{F *"}F *{G *"}G *J{N {O ( 
* 0      (r  
( s
 
( }H }J o@ 
o 
o 
}K }R oE 
o 
s 
}L ou 
( 

( 
}I {I ( 
,}I ( 
o 
}M o 
}N o 
}O ( ( *0      8   {H oE 
{M o 

( {O X}O {P X}P {O o 
2/{N o 
( 
}N }O {M ( 
}M ( {I ( 
,( *{P {R 2( {M {L (
 
:D*z}P s 
}Q s 
}S *   0     {N o 
( 
{I ( 
-{I ( (w 
+
o 
{O Y
o 
( o 
o 
{U 
{V ,{V o +P		3	s< +B	3>t o] 
o 
3s, 
+o 
,	
s? +s' o 
o8 
{J {K o! 
C o= 
{P o 
o 	YE         M   +yt t o& +et t o+ ,M( {H     s+ o 
+.u ,t t o; +t t o> {Q o o 
&{S {H o: 
{O {O XYo 
ok 
&*   0 \   
  ( {P ( 
  o 

( {S ov  
{Q {M {L ( 
( 
(! o 
( *~T *T * 0       s 
( ( Є (~  
~
  s s o 
( Ѕ (~  
~
  s s o 
( І (~  
~
  s s o 
( Ї (~  
~
  s s o 
( Ј (~  
~
  s s o 
( Љ (~  
~
  s s o 
( Њ (~  
~
  s s o 
(  (~  
~
  s s o 
(  (~  

~
  s s o 
(  (~  
	s o 
(  (~  
s o 
*(r  
*V(r  
}U }V *
*( *{W *"}W *J(r  
sZ 
( *0 b       ( V o (T  +( V (T  +( V (T  +( V (T  +( V (T  +*
*( *   0      ( 

! ( ! o 
#      Y@o 
l#      Y@[(  +! ( ! ( (T  +! o 
#      Y@o 
l#      Y@[(  +*0 4     ! (\ 
! (\ ! (Z s[ 
	*0   \  sZ 

; o 
( ; o 
( ; o 
( ; o 
( ; o 
( ; o 
(T  +; o 
(T  +; o 
(T  +; o 
(T  +	; o 
(T  +
; o 
(T  +; u -+t o 
(T  +; o 
(T  +
; o 
(T  +; o 
(T  +; o 
(T  +; o 
(T  +; o 
(T  +; o 
(T  +; o 
(T  +* 0 {    s 

; (Z o 
; (Z o 
; (Z o 
; (Z o 
; (Z o 
; (,  +o 
; (,  +o 
; (,  +o 
; (,  +o 
	; (,  +o 

; (  +o 
; (  +o 
; (  +o 

; (  +o 
; (  +o 
; (  +o 
; (,  +o 
; (,  +o 
; (,  +o 
; (,  +o 
* 0    \  sZ 

. o 
. o 
. o 
. o 
. o 
. o 
. o 
( . o 
. o 
( . o 
. o 
. o 
o 
o 
oJ *  0 {     o 

B (  +o 
B (,  +o 
B (,  +o 
B (Z o 
B (Z o 
B B (  +o 
* 0 W       o 
o 
3Go 
o 
39o 
o 
3+o 
o 
3o 
o 
3o 
o 
**o 
-+o 
ao 
-+ao 
ao 
ao 
a*  0    \  sZ 

. o 
. o 
. o 
. o 
. o  
. o 
. o 
( . o 
. o 
( . o 
. o 
. o 
o 
oJ *   0 {     s 

B (  +o 
B (,  +o 
B (,  +o 
B (Z o 
B (Z o	 
B B (  +o
 
* 0     o 

o 
tF sZ 
. o
 
. o 
. o 
. o 
. o 
. o 
. o 
. o 
. o 
 o 
. o 
. o 
. o 
. o 
. o 
. o 
. o 
. o 
	. o 
( . o 

. o 
( . o 
. o 
( . o 
. o 
( . o 

. o 
( . o 
. o 
( . o 
. o 
( . o 
. o 
( . o 
. o 
( . o 
. o 
. o 
. o  
. o 
. o! 
. o 
. o" 
( . o 
. o# 
. o 
. o$ 
( o 
. o% 
( o 
. o& 
( o 
. o' 
( o 
. o( 
( o 
o# 
oS * 0 '  
  R (  +o) 
R (,  +o* 
R (  +o+ 
R (,  +o, 

 (  
o 
( 
o- 
R (  +o. 
R (,  +o/ 
R (,  +o0 
R (,  +o1 
	R (Z o2 

R (Z o3 
R (Z o4 
R (Z o5 

R (Z o6 
R (Z o7 
R (Z o8 
R (Z o9 
R (Z o: 
R (,  +o; 
R (Z o< 
R (,  +o= 
R R (  +o> 
R (7  +( o? 
R (7  +( o@ 
R (7  +( oA 
R (7  +( oB 
R (7  +( oC 
* 0 V     oD 
oE 
.  +oD 
t! oF 
oG 

( oH 
oG 
( oI 
oJ 
( *^ (K 
- ( 
*~X *  0 /   \  sZ 

5 (T  +5 (T  +5 (T  +* 0 S       5 (,  +(c 
(L 
oM 
5 (,  +(c 
(N 
oO 
oI 
5 (,  +oP 
*.  X * 0      s 

oQ 
+e(R 
sZ 

  o3 
    s+ o 
	l   o3 
o4 
(T  +	l   oS 
(T  +	o 
&(T 
- og  
*    
 r     6o 
(U 
*6o 
(V 
*0      oW 
oX 
oY 
oG 

sZ 
 oZ 
(T  + o[ 
o\ 
s o] 
(T  + o^ 
(T  + o_ 
(@ (h  + o` 
(T  + oa 
oH 
ob 
  o 
(T  + oc 
(d 
oH 
ob 
  o 
(T  +*0 b       o[ 
  (,  +oe 
  (7  +o[ 
(   (7  +o[ 
of 
(A o[ 
  (  +og 
*  0 d     sh 

oi 
oj 
s9 
ok 
s9 
( 
ok 
,ol 

	,	(d 
om 
on 
oo 
*0       oW 

on 
op 
oi 
oq 
*0       (,  +
 (,  +s9 
ok 
s9 
( 
ok 

on 
	oo 
 (,  +{	 o ,
o[ 
( o[ 
 (,  +oe 
 (7  +o[ 
of 
(A  (  +or 
*0 I    s 
}
 }
 }
 sZ 
 os 
(T  + ot 
(T  + ou 
{
 { {
 { ( (h  + ov 
(T  + ow 
(@ (h  + ox 
(T  +oy 
,o sZ 
%. oy 
oz 
. o 
%. oy 
oW 
o{ 
. o 
%. oy 
o| 
ov 
. o 
(h  + o} 
  s~ 
(  +(e  +*   0      s 
(  
o 
tz  ou 
( (  
o 
t" }
 o 
{
 o 
/"(  s 
(  +
	,	o 
o 
(  
o 
tz  ou 
o 
(A ou 
(  
o 
 o 
*  0 6      (,  +s9 
ok 

on 
 (,  +o 
o| 
*  0 z     (,  +
 (,  + (,  + (,  +
 (7  +,\ (,  +	 (,  +
 (,  +o 
o 
o} 

o 


oi 
	o 
 (-  +s 
 (7  +ou 
( o 
 (7  +ow 
(A 	o 
o8 
+7ok  
tz  s 
( o} 
%Xo 
oh  
-u  ,og  
o 
o 
o 
*     DO    0      s 
}
 }
 }
 sZ 
 o 
(T  + o 
(T  + o 
(@ (h  + o 
(@ (h  + o 
s  o 
(T  + o 
{
 {
 ( (h  + o 
(D (h  + oi 
 s 
(  +(e  +*0        o 
 (,  +o 
o 
 (,  +o 
 (7  +o 
(%  (7  +o 
o 
(E  (7  +o 
(  (7  +o 
o 
(A  (7  +o 
o 
(A *   0 <   o 
 (,  +o 
o 
 (,  +o 
 (7  +o 
o 
(E  (7  +o 
(  (7  +o 
o 
(A  (7  +o 
o 
(A 
 (-  +o8 
+3ok  
tz  sh 
( oi 
%X
oj 
oh  
-u  ,og  
{  (,  +o 

sZ 
	o! o 
(% *    @     o 
o 
o 
o 
o 
o 
( *0     sZ 

 { { ( (h  +o8 
o: 
o- o 
C o= 
{ o 
C o> 
 { s  o 
(T  + {	 o 
{ { s o] 
(T  + (T  + (T  + ( (  +*  0     (7  +
  o 
(  (,  + (,  + (,  +
 (,  +{ o 
,&sZ 
		o! 	  o 
(% +rO psS 
z{	 o ,?  o 
( {	   o 
{ { s o] 
&o 
o 
oB 
/o 
o 
o 
+r p. ( 
sS 
z  o 
( 
o 
&	o 
o 
o  
/o 
o 
	o! 
+r p	. ( 
sS 
z  o 
( 
o 
&*   0 K    sZ 

( 
(  +
+.	o 
, o 
( (h  +	X
	2* 0	     (  +
b o 
rN p(  
( (T  +f o 
o 
o 
o 
o 
o 
( (h  +	f o 
( (h  +(e 
,( of 
(g 
b ( * 0 {    s 
b (\ }
 o 
 s 
(  +,"o 
 s 
(  +( *{
 s 
( o 
o 
&* 0     s 
b (\ }
 o 
	 s 
(  +b (\ }
 {
 ~  
(5 
,;o 

 s 
(  +,"o 
 s 
(  +,o 
*  0     f (7  +
(  + (-  +o 
( 	f (7  +o 

+c	ok  
C ( 
( 
s 
( 
tz  (  + (-  +o 
( o 
o 
	oh  
-	u  ,og  
b (Z o 
b (Z o 
b (Z o 
*     D o     0    	 sZ 

o 
o 
oG 
o 
oH 
o 
o 
o 
oG 
o 
oH 
o 
\   o 
(T  +\ (w 
X(T  +\ ( (h  +\ o 
( (h  +\ o 
( (h  +*  0 h   
 sZ 

` (~  
( 
o 
+.ok  
` . o 
h o 
. o[ 
oh  
-u  
	,	og  
*    :U     0 h   
 sZ 

` (~  
( 
o 
+.ok  
` . o 
i o 
. o[ 
oh  
-u  
	,	og  
*    :U     0 T    \ (,  +
\ (,  +(9 

-o 
b o 

+s 

o 
	o 
	*0   \  sZ 

. o 
o 
. o 
. o 
o 
. o 
. o 
o 
. o 
. o 
o 
. o 
. o 
o 
. o 
. o 
o 
. o 
. o 
o 
( . o 
. ( o 
. o 
o 
. o 
. o 
o 
. o 
	. o 
o 
. o 

. o 
o 
( . o 
. o 
o 
( . o 

. o 
o 
. o 
. o 
o 
. o 
* 0 e      o 
` (,  +o 
o 
` (,  +o 
o 
` (,  +o 
o 
` (,  +o 
o 
` (,  +o 
o 
` (,  +o 
o 
` (-  +( o 
o 
` (,  +o 
o 
` (,  +o 
o 
	` (  +o 
o 

` (Z o 
o 
` (Z o 
o 
` (Z o 
o 

` (,  +o 
o 
` (,  +o 
*   0 x    s 

o 
o 
o 
+B( 

sZ 
%. 	o 
. o 
%. 	o 
. o 
o 
&( 
- og  
*    Oh     0 W   
 s 

+Bo 
tz  s 

	] (,  +o 
	] (,  +o 
	o 
Xo 
2* 0     (  +
b o 
o 
o 
( (T  +o 
,c o 
o 
( o 
o8 
o 
o 
C o= 
	c (T  +(e 
,( of 
(g 
b ( *0     s 
b (\ }
 o 

 s 
(  +,o 
 s 
(  ++{
 s  
b (Z o 
b (Z o 
b (Z o 
	c (,  +o 
o 
o  
/o 
o 
o! 

+rb p. ( 
sS 
zo 
	( 
o 
&o 
o 
&*0     s 
b (\ }
 o 
 s 
(  +b (\ }
 {
 ~  
(5 
,"o 
 s 
(  +,o 
c (\ }
 {
 ~  
(5 
,(o 
 s 
(  +
	,
o 
	o 
*  0     s 
}
 sZ 
a o 
 s	 
(  +(e  +a o 
 s
 
(  +(e  +a o 
~
 %-&~
  s 
%
 (  +(e  +a o 
 s 
(  +(e  +*0 :   a (-  +
o8 
+ok  
tz  ( oh  
-u  ,og  
a (-  +o8 
+ok  
tz  ( oh  
-u  ,og  
a (-  +o8 
	+	ok  
tz  

( 	oh  
-	u  ,og  
a (-  +
	o8 
+ok  
tz  ( oh  
-u  ,og  
o8 

+
ok  
tz  ( 
oh  
-
u  ,og  
o8 
+ok  
tz  ( oh  
-u  ,og  
o8 
+ok  
tz  ( oh  
-u  ,og  
	o8 
+ok  
tz  ( oh  
-u  ,og  
*  d    $9      c $       #       $"     ?$c     $     #     #$    0 3    o
 
o 

s 
+o 
(F o 
X2* 0 Q    o8 

+)ok  
tz  (G o 

	o 
&	o 
oh  
-u  ,og  
*       5<     R (c 
 (d 
( *   0 "   \  sZ 

G (T  +G (T  +*  0 ,   \  sZ 

G ( 
(T  +G ( 
(T  +*0 "     G (,  +
G (,  +s 
*>(  +(  +*  0    
  . 
 (  
  o 
* 0 !   
  . 
 (  
-+. o 
*   0    
  . 
 (  
o 
*  0    
  . 
 (  
 o 
* 0    
  . 
 (  
t o 
* 0 !   
  . 
 (  
-+(g 
o 
*-**   0 3    ~2 

 ( 
3~2 
*(  

 ( 
3(  
*(c 
* 0 :    s 

o 
+o 
o 
o 
&oh  
-
,og  
*     
 !. 
    0 /     s 

o 
+o 
o 
o 
&X2*r pr pon 
r pr pon 
r pr+ pon 
r/ pr5 pon 
*  0 B       o 
o 
,*o 
o 
,*o 
o 
,*o 
o 
,*s 
z  0 p       E   8   &   ,             2      8         +6rD p*rD p*rD p*rD p*rD p*rD p*rE p*rE p*rE p*r
 p*0 .   o 

(^  S`5; ,5 bH;    ,.~8     8=;    S`;   8    
5 s7u.? 
.d8    . @.@ z;   8   rD p(  
-}8   rD p(  
-n+}rD p(  
-b+nrD p(  
-U+_rD p(  
-H+PrD p(  
-;+ArE p(  
-.+2rE p(  
-!+#rE p(  
-+
*	*********s 
*  0 u    sZ 

v ( (h  +	v s  
o1 (h  +v (x (h  +s! 
o" 
o# 
o$ 
o% 
(& 
*   0    s 
o' 
}
 o( 
tW sZ 
,%" {
 o) 
sZ od (T  ++Y~  s* 
(  +1$" ~   s* 
(  +(T  ++" {
 o) 
( " {
 o, 
k"   @[(V  +" {
 o- 
( (T  +" {
 o. 
( (T  +" {
 o/ 
(T  +" {
 o0 
(T  +" {
 o1 
( (T  +" {
 o2 
( (T  +" {
 o3 
( (T  +	" {
 o4 
(T  +
" {
 o5 
( (T  +" {
 o6 
(R (h  +" {
 o7 
( (h  +" {
 o8 
( (T  +" {
 o9 
(T  +" {
 o: 
(T  +" {
 o; 
(T  +" {
 o< 
(T  +" {
 o= 
(T  +
" o> 
(T  +o( 
tF 
{
 o9 
	oJ {
 o: 
	oS {
 o; 
	oJ {
 o= 
	oJ {
 o< 
	oJ *0    " (,  +oe 
-*" (,  +oe oT o? 
" (Y #       @Z(f 
(@ 
oA 
" (Z oB 
" (Z oC 
" (Z oD 
" (  +oE 
" (  +oF 
" (Z oG 
" (Z oH 
	" (  +oI 

" (Z oJ 
" (7  +(S oK 
" (7  +(  oL 
" (Z oM 
" " (  +oN 
" " (  +oO 
" " (  +oP 
" " (  +oQ 
" " (  +oR 
*   0 I   \  (  +
b oS 
o 
oT 
( (T  +e oU 
 oV 
(T  +*   0 `    b (\ 
e (,  +s 
sW 
b (Z oX 
b (Z oY 
b (Z oZ 
*0 y    s! 
b (\ }
 o 
" s[ 
(  +b (\ }
 {
 ~  
(5 
,"o 
# s[ 
(  +,o\ 
*   0 V   (  +
b o] 
o 
o^ 
( (T  +o_ 
o8 
o_ 
o 
C o= 
d (T  +o` 
o: 
o` 
o 
C o> 
	d (T  +oa 
,
d ob 
oc 
( od 
,d od 
o 
( d oe 
( (T  +
d of 
( (  +d og 
 oV 
(T  +d oh 
(T  +(e 
,( of 
(g 

b 	( *  0    s$ 
b (\ }
 o 
% s 
(  +,o 
& s 
(  ++{
 si 
b (Z oj 
b (Z ok 
b (Z ol 
d (Z om 
	d (,  +o 
o 
oB 
/o 
o 
o 

+r; p. ( 
sS 
zo` 
	( 
o 
&d (,  +o 
o 
o  
/o 
o 
o! 
+r p. ( 
sS 
zo_ 
( 
o 
&
d (-  +of 
( d (,  +( 
on 
d (,  +oo 
o 
op 
&*  0    s' 
b (\ }
 o 
( s 
(  +b (\ }
 {
 ~  
(5 
,"o 
) s 
(  +,oq 

d (\ }
 {
 ~  
(5 
,0oa 
-(o 
* s 
(  +
	,
o 
	o 
d (\ }
 {
 ~  
(5 
,%o 
+ s 
(  +,or 
*  0    \  sZ 

b   o 
( b   os 
( (T  +b   ot 
( (T  +  ou 
  ,!b   ou 
  o 
( b   ov 
( (T  +b   ow 
( *   0 .    ( 

oG 
o 
(C 
s
 

( 
o@ 
o 
o 
oE 
o 
o 
o 
o> 
oH 
o 
(x 
9   (I 
8   oH 
o 
( 
:   o 
o: 
o 
C o> 
	oy 
o 
  o 
oz 
o 
( o{ 
 oV 
o| 
( o 
(I 
(} 
:Y	*{ *"} *J(~ 
s 
(  *-*( o 
-( o 
-( o 
**   0 -   ! s, 
}
 ( - s 
(  +( 
*   0   \  sZ 

 o 
(; (h  + o 
(@ (h  + o 
(@ (h  + o 
(5 (h  + o 
(T  + o 
(T  + o 
( (T  + o 
( (T  +	 o 
(T  + o 
(T  + o 
(T  +
 o 
o 
(T  + o 
o 
(T  + o 
o 
(T  + o 
o 
(T  + o 
o 
(T  + o 
o 
(T  + o 
o 
(T  + o 
o 
(T  + o 
o 
(T  + o 
o 
(T  + o 
o 
(T  + o 
(T  +o 
o 
oS *   0 ?  "  (7  +o 
(<  (7  +o 
(A  (7  +o 
(A  (7  +o 
(6 o 
 (,  +o 
o 
 (,  +o 
o 
 (Z o 
o 
 (Z o 
o 
	 (  +o 
o 
 (  +o 
o 
o 
  (  +o 
o 

 (,  +o 
o 
 (,  +o 
o 
 (,  +o 
o 
 (,  +o 
o 
 (,  +o 
o 
 (,  +o 
o 
 (  +o 
o 
 (  +o 
o 
 (  +o 
o 
 (  +o 
o 
 (  +o 
o 

 (  +o 
( 
o 
&*{ *"} *2( o 
*2( o 
*2( o 
*2( o 
*2( o 
*2( o 
*2( o 
*2( o 
*2( o 
*(r  
( } } } *  0    \  sZ 

( * 0         ( (; (h  + (	 { (7 (h  + (
 ( (T  + ( ( (T  + ( ( (T  + (
 (T  + ( (T  + ( (T  +	 ( (T  +{ ( { oS *  0    # u 
-*( o (= ,v(	 o	 (9 ,c(
 o
 3U( o 3G( o 39(
 o
 3+( o 3( o 3( o ** 0 [       (	 (: ( (> a(
 -+a( -+a( -+a(
 a( a( a( a* 0    $  (7  +o 
(<  (7  +o 
(8  (Z o 
 (Z o 
 (Z o 
 (  +o 
 (  +o 
o 
  (  +o 
o 

	 (  +o 
( 
o 
&*{ *"} *2( o 
*2( o 
*2( o 
*2( o 
*2( o 
*2( o 
*2( o 
*:(r  
( * 0         ( (@ (h  + ( ( (T  + ( ( (T  + ( ( (T  + ( (T  + ( (T  + ( (T  +* 0    \  sZ 

(! * 0 A       ( -+( (B a( -+a( -+a( a( a*   0 h   % u 
-*o ( 3Lo ( (C ,9o ( 3+o ( 3o ( 3o ( **0    &  (7  +o 
(A  (Z o 
 (Z o 
 (Z o 
 (  +o 
 (,  +o 
o 

 (  +o 
( 
o 
&*( 
*{ *"} *Z{ ,{ o4 
**(r  
} (( } } } *vou 
  o 
X(* *~(' { { { ( *{ *"} **(0 *0        (r  
}  } } sI } { sR } { { sJ (. sN } sg } s& } s }	 s 
}
 *0   ' sZ 

8   {
 o 

	o' o? 
-{  o4 
o 
-l{  o4 
o 
&o4 
. sZ 
%. ( . o 
%. 	o, o 
%. 	o) . o 
o 
X{
 o 
?M{ _9   (- o~ 
o 
{ o 
o 
+0(- { o 
o 
o! 
C o= 
X{ o 
o 
o  
2+0{ { o 
o 
o 
C o> 
X{ o 
o 
oB 
2sZ 
%x (W (- o~ 
o 
%x (W { o 
o 
%x (W { o@ 
o 
%x (W { o 
o 
%x (W {	 o 
o 
%x (W o 
%x (W { oG o 
%x (W { oP o 
(B 
,'{ ( 
og (  
o 
*  0        sZ 
%x (W { oG o 
%x (W { oP o 
%x (W (- o~ 
o 
%x (W { o 
o 
%x (W { o 
o 
%x (W {	 o 
o 
%x (W { og o 
*0 U     o 
o 

+*ok  
C ( 
( 
( 
tz  o 
oh  
-u  ,og  
*      
 6C     0   ( x (7  +
x (7  +x (7  +x (7  +
x (7  +x (7  +x (7  +x (7  +(- o~ 
(3 { o 
(3 { o@ 
(3 { oh o 
{ o` o 
.ry psS 
zo 
o 
{ o 
~
 %-&~
 0 s 
%
 (  +o 

+l
o 
( 
o 
o 
oB 
2o 
s 
+o 
o 
( 
o 
( 
(P o 
o 
o 
&
oh  
-
,
og  
{ o 
o 
o 
o 
oB 
.r psS 
z(- o~ 
~
 %-&~
 1 s 
%
 (  +o 

+v
o 
( 
o 
o 
o  
2o 
s 
+o 
o 
( 
o! 
%( 
{ (L o 
o 
o 
&
oh  
-
,
og  
(- o~ 
o 
o 
o 
o  
.r psS 
z	o 
" 	o 
o 
~
 %-&~
 2 s 
%
 (  +(  ++Ao 
s 
	o 
tz  (% s  { o 
&Xi2o 
" 	o 
	o 
+.	{	 (Y 
o 
tz  o &X	i2{ oG (3 { oP (3 { oG ~
 %-&~
 3 s 
%
 (  +o 
++o 
( 
(M o 
oU 
o 
&oh  
-,og  
{ oP ~
 %-&~
 4 s 
%
 (  +o 
++o 
( 
(O o 
op 
o 
&oh  
-,og  
*4   y     |     85     w8    0    \  sZ 

 o 
( (h  + o 
( (h  + o 
( (h  + o 
( (h  + o 
( (h  + o 
( (h  +*0         (7  +o 
(  (7  +o 
(  (7  +o 
(  (7  +o 
(  (7  +o 
(  (7  +o 
( * 0    \  sZ 

 o 
( (h  + o 
( (h  + o 
( (h  + o 
( (h  + o 
( (h  + o 
( (h  +*0         (7  +o 
(  (7  +o 
(  (7  +o 
(  (7  +o 
(  (7  +o 
(  (7  +o 
( * 0 s       o 
o 
( ,^o 
o 
( ,Ko 
o 
( ,8o 
o 
( ,%o 
o 
( ,o 
o 
( ** 0 H       o 
( o 
( ao 
( ao 
( ao 
( ao 
( a*0 d   \  sZ 

 o 
(@ (h  + o 	 
(@ (h  + o	 
(@ (h  + o	 
(@ (h  +*0 ]        (7  +o 
(A  (7  +o 	 
(A  (7  +o	 
(A  (7  +o	 
(A *   0 M       o	 
o	 
(C ,8o 	 
o 	 
(C ,%o	 
o	 
(C ,o 
o 
(C **o	 
(B o 	 
(B ao	 
(B ao 
(B a*o 
C o	 
o 
( 
o	 
*0 ,   \  sZ 

 o	 
(T  + o	 
(T  +* (  +o	 
 (,  +o	 
*:o	 
o	 
a*~o	 
o	 
3o	 
o	 
**   0 ,   \  sZ 

 o	 
(T  + o	 
(T  +* (  +o		 
 (,  +o
	 
*  0 l   \  sZ 

q o	 
(T  +q o	 
(T  +q o
	 
(T  +q o	 
( (T  +q o	 
( (T  +*0 V       q (Z ,q (,  +s	 
*q (,  +q (  +q (  +q (Z s	 
*{ *"} *r(	 
(I } } *f(H { { ( *  0 P   ) o	 

( 
" (  +s	 
o 
o	 
o	 
o 
o	 
o	 

	o	 
*0     * o 

(L ( 
o 
&*:(	 
} *v{ { { { ( *   0 <   + o	 

o 
tF ( o	 
R (  +o	 
o	 
*0    , o 

(P ( 
o 
&*  0    \  sZ 

#  (	 
-~  
+ (	 
ov  
( #  ( 	 
-~  
+ ( 	 
ov  
( #  (!	 
-~  
+ (!	 
ov  
( *0 m   - # (\ 
# (\ # (\ (  
,+s"	 

(  
,+s"	 
(  
,+s"	 
	s#	 
*{ *"} *{ *"} *{ *"} *fr pr p(! 
([ *  0 U       (r  
(U (  
,1"  @As$	 
(%	 
~ o&	 
-+r p(h 
(W (Y *   0     \  sZ 

(T (X (V ( *0     u 
-*oT (T (  
*2(T o'	 
*Br ps(	 
 *{ *"} *   0 2   . (r  
s)	 
(a ~ 
+(f &Xi2*  0    / (` o*	 
o` o+	 

+bo,	 
(` (-	 
oT (-	 
oX (-	 
oV s[ (.	 
~
 %-&~
 7 s/	 
%
 o0	 
&oh  
-
,og  
*    n 
    0    
  -*(`  o1	 
,*(f * 0 A   0 (` o+	 

+o,	 
(.	 
3
(-	 
oh  
-
,og  
**       '3 
    (` (` o 
~
 %-&~
 8 s/	 
%
 o0	 
*0    1 (` o 
2*-~ i/	~ isZ 

(` o+	 
+/o,	 
(.	 
2(.	 
. (-	 
o\ o[ 
oh  
-
,og  
*    8 ;s 
    0    2 (` o*	 
o 
s2	 

o 
+ok  
C o3	 
oh  
-u  
	,	og  
~
 %-&~
 9 s4	 
%
 o5	 
o6	 
+!(7	 
( 
tz  ( (d &(8	 
-F og  
*    =      { .     0 s   3 s< 
~ i}
 (` = s9	 
(  +~
 %-&~
 : s:	 
%
 (  +~
 %-&~
 ; s;	 
%
 (  +* 0       G %r pr$ ps[ %r= prN ps[ %r pr ps[ %r pr ps[ %r pr0 ps[ %r\ pr ps[ %r pr ps[ %r psZ %r
 pr ps[ %	r8 prH ps[ %
rp pr ps[ %r pr ps[ %r pr ps[ %
rT prp ps[ %r pr ps[ %r pr ps[ %r@ prN ps[ %rt pr ps[ %r pr ps[ %r pr* ps[ %rT pr` ps[ %r pr ps[ %r pr ps[ %r. pr\ ps[ %r pr ps[ %r pr ps[ %r pr  ps[ %r> prX ps[ %r pr ps[ %r pr ps[ %r pr ps[ %r< prV ps[ % r pr ps[ %!r pr ps[ %"r pr ps[ %#r, pr8 ps[ %$r\ prz ps[ %%r pr ps[ %&r pr6 ps[ %'r pr ps[ %(r pr ps[ %)r6 prD ps[ %*rv pr ps[ %+r pr ps[ %,rT prd ps[ %-r pr ps[ %.r pr ps[ %/rB prV ps[ %0r pr ps[ %1r pr ps[ %2r@ prL ps[ %3rp pr ps[ %4r pr ps[ %5r< prX ps[ %6r pr ps[ %7r pr ps[ %8r$ pr6 ps[ %9rd pr ps[ %:r pr ps[ %;r pr ps[ %<r, pr: ps[ %=r^ prv ps[ %>r pr ps[ %?r pr ps[ %@r pr ps[ %ArZ prz ps[ %Br pr ps[ %Cr  pr, ps[ %DrP prd ps[ %Er pr ps[ %Fr pr ps[  *{ *"} *0 ^   4 { -O{ 2F(p oy 
oz 

+o{ 
o4 
{ 3	} oh  
-
,og  
{ *     # *M 
    { *"} *{ %-&(n o+ o; o  
*{ *"} *{ *"} *{ *"} *{ *"} *2(n o/ *2(n o+ **o{ *(r  
} o/ op o+ o? s0 (l (o ( *  0    5 t (W 
t (W t (W t (W 
t (W t (,  +(t oW 
-+
o 
( 
} oW 
,t (,  +s  
(v 	oW 
,t (,  +s  
(x o 
tz  %-&sZ 
(r * 0 w   6 sZ 

sZ 
o| ,o} t o{ (T  +t (s (T  +t (k (w o1 (h  +o 
1
t (h  +*&(=	 
*   0 5   7 (q u (  +
o>	 
-*o?	 
,o@	 
*s z
*&( *  0 B   8 (A	 
ol  

+oi  
oB	 
,	oC	 
+s zoh  
-
,og  
*      +7 
    >sD	 
%}E	 
*
*fo+ o; o  
( *   0    9 (u 
(p oF	 
 (G	 
0+ (B 
,Yo -r psH	 
z(p o 
o ,o s z(p o 
(p (u 
 ( 
oI	 
*    G ]     
*&(J	 
**Z(n o/ {3 oK	 
*
* 0 .   :  o^ (9 
(m o` o^ YoZ oL	 
&*(m o^ s9 
o` o^ YoM	 
*&(J	 
**Z(n o/ {3 oK	 
*
* 0 $   
  oZ o^ ( 
1(m oN	 
*
* 0 O   ; (m oO	 

+3oP	 
o 
(  
,oP	 
o 
  o 
3*XoQ	 
2*&( *
*
* 0    < (m ( ( oR	 

oS	 
oT	 
oU	 
oT	 
(V	 
,rt psS 
z(p oW	 
(m oS	 
o 
oU	 
o 
oS	 
o 
(X	 
XoY	 
*b(m ( ( oM	 
*^(q [ (,  +s9 
*J(q [ (,  +* 0 I   = (  
o 
 
~ oZ	 
,  %%([	 
u *r psS 
z   0    > s2 
o3 *   0   ? s\	 

j (~  
o]	 
 (~  
o]	 
 (~  
o]	 
п (~  
o]	 
 (~  
o]	 
 (~  
o]	 
	 (~  
o]	 
	 (~  
o]	 
 (~  
o]	 

 (~  
o]	 
о (~  
o]	 

 (~  
o]	 
М (~  
o]	 
Ќ (~  
o]	 
q (~  
o]	 
9 (~  
o]	 
W (~  
o]	 
4 (~  
o]	 
7 (~  
o]	 
o (~  
o]	 
 (~  
o]	 
E (~  
o]	 
6 (~  
o]	 
D (~  
o]	 
p (~  
o]	 
 (~  
o]	 
F (~  
o]	 
Њ (~  
o]	 
Ћ (~  
o]	 
n (~  
o]	 
= (~  
o]	 
r (~  
o]	 
н (~  
o]	 
Л (~  
o]	 
Џ (~  
o]	 
Б (~  
o]	 
 (~  
o]	 
А (~  
o]	 
5 (~  
o]	 
3 (~  
o]	 
h (~  
o]	 
2 (~  
o]	 
 (~  
o]	 
A (~  
o]	 
B (~  
o]	 
C (~  
o]	 
@ (~  
o]	 
м (~  
o]	 
л (~  
o]	 
 (~  
o]	 
 (~  
o]	 
m (~  
o]	 
i (~  
o]	 
k (~  
o]	 
К (~  
o]	 
 (~  
o]	 
 (~  
o]	 
 (~  
o]	 
 (~  
o]	 
 (~  
o]	 
 (~  
o]	 
 (~  
o]	 
 (~  
o]	 
 (~  
o]	 
 (~  
o]	 

 (~  
o]	 
 (~  
o]	 
 (~  
o]	 
 (~  
o]	 
 (~  
o]	 
 (~  
o]	 
 (~  
o]	 
 (~  
o]	 
 (~  
o]	 
 (~  
o]	 
 (~  
o]	 
8 (~  
o]	 
 (~  
o]	 
м (~  
o]	 
О (~  
o]	 
г (~  
o]	 
д (~  
o]	 
н (~  
o]	 
е (~  
o]	 
к (~  
o]	 
 *&( **
*0 $   
  (q ) (,  +
(p o 
o 
*>(p o^	 
*&( **>(p o^	 
*
*   0 $     (q ) (Z 
(p o 
o 
*&( **>(p o^	 
*
*   0 :   
  (q ) (,  +
(p o 
o 
(p o 
( o 
*(T 
*:o  
(_	 
*:o  
(_	 
*&(_	 
*&(_	 
*&(_	 
*&(_	 
*(T 
*&(_	 
*&(_	 
*&( **(m (q . (,  +s9 
oM	 
*
*   0 f   @ (q . (,  +
(m o 
(m Ys9 
( 
o 
s`	 
(  +
	/r  psS 
z(m 	o	 
ob	 
**( **F(y {2 oc	 
***( **(y {2 o# ,(y {2 o# **   0    A (n o0 -r  psS 
z(q v (  +
(n o0 o (q v (,  +od	 
(q v (,  +oe	 
(q v (  +of	 
s  
(n o0 ( o og	 
(g 

v 	(U  +v (T  +
,og  
*      A 
    &( **
*
**&(h	 
**F(y {3 oi	 
*  0 "   B ~  oj	 
-sH 
z(m ok	 
*  0       sl	 
%~
 I sm	 
on	 
%
~
 J sm	 
on	 
%~
 K sm	 
on	 
%~
 L sm	 
on	 
%~
 M sm	 
on	 
%~
 N sm	 
on	 
%
~
 O sm	 
on	 
%~
 P sm	 
on	 
%~
 Q sm	 
on	 
%~
 R sm	 
on	 
%~
 S sm	 
on	 
%~
 T sm	 
on	 
%~
 U sm	 
on	 
%~
 V sm	 
on	 
%~
 W sm	 
on	 
%~
 X sm	 
on	 
%~
 Y sm	 
on	 
%	~
 Z sm	 
on	 
 *"(o	 
*   0 D   C (p	 
oq	 
oS	 
o 

(p	 
oE 
o 
t oj 
o& 
or	 
*"(o	 
*   0 8   D (p	 
oq	 
oS	 
o 

(p	 
oE 
o 
t os	 
*0 i       %-&ot	 
E      6   (      
   *~u	 
ov	 
*sw	 
ov	 
*sx	 
ov	 
*sy	 
ov	 
*sz	 
ov	 
*"({	 
*
*"o 
*"(|	 
**o' 
u -+o' 
t o 
(}	 
*"(~	 
*
*Ro' 
o 
(	 
*"(	 
**"o 
*"(	 
**"o 
*"(	 
**"o 
*"(	 
**"o 
*"(	 
*
*"o 
*"(	 
*	*"o 
*"(	 
*
*"o 
*"(	 
*
*"o 
*"(	 
**"o 
*"(	 
**"o 
*"(	 
**"o 
*"(	 
**"o 
*"({	 
*
*"o 
*"({	 
**"o 
*"(	 
*
*"o 
*&(	 
** 0   E o< .r po< . (	 
o> tz  
7 (7  +G (Y (@ 
lG (Y (@ 
l
6 (Y (@ 
6 (Z (m o: o< oq	 
oS	 
o 
(m oE 
o 
t o] 
t o^ 
o_ 
o` 
o] 
t o% 
(p od 
(e 
(c 
k#      Y@[kZl(f 
i(g 
(h 
(d 
k	#      Y@[kZl(f 
i(g 
(i 
oj 
oz 
oj 
(d 
ok 
oj 
(c 
ol 
oa 
ob 
oc 
oj 
o} 
*F(y {3 oi	 
*b(m o: o< oM	 
*&(	 
** 0   F o< .r po< . (	 
o> tz  
9 (7  +9 (7  +9 (7  +
9 (7  +G (,  +G (,  +G (Z G (Z 6 (Y (@ 
	6 (Z 
,+G (,  +,+G (,  +	G (9  +
	G (:  +
(n 
(o 
(m o: o< oq	 
oS	 
o 
(m oE 
o 
t o] 
s	 
o	 
,o	 
~J 
ov 
oj 
oz 
oj 
o{ 
oj 
o| 
oj 
ol 
oj 
ok 
oa 
ob 

oc 
o] 
t
 oy 
o_ 
	o` 
oj 
o} 
*F(y {3 oi	 
*b(m o: o< oM	 
*&(	 
**F(y {3 oi	 
*  0 "   G ~  o	 
-sH 
z(m o	 
*  0 P       s	 
%~
 ] s	 
o	 
%~
 ^ s	 
o	 
%~
 _ s	 
o	 
 *"(	 
*   0 |   H .r p. (	 
(	 
oq	 
oS	 
o 

(	 
oE 
o 
t o] 
u
 -o] 
t o^ 
+o] 
t
 oy 
o	 
*"(	 
*b(	 
o@ 
(L 
oM 
*2. ( *"(	 
*(	 
o@ 
(N 
oO 
(	 
-+o	 
*2. ( *"(	 
*6oI 
oP 
*&(	 
**b(m o: o< oM	 
*F(y {3 oi	 
*0 |   I o< .r po< . (	 
o> tz  
(m o: o< oq	 
oS	 
o 
(m oE 
o 
t o] 
t
 ot 

	(/ *&( *
*Z(n o/ {3 oi	 
*N(m (: oM	 
*^(q A (,  +s9 
*oj 
o	 
oj 
o& 
o	 
o	 
o	 
(	 
oj 
o	 
*&(6 **  0   J (q A (7  +
7 (7  +G (Y (@ 
lG (Y (@ 
l
6 (Y (@ 
6 (Z (q A (,  +(q A (7  +(p oQ 
oR 
(m sW 
		oX 
oY 
oZ 
	oX 
o[ 
(m (: 	o	 

( 
(; 
o] 
t o^ 
o_ 
o` 

oa 
ob 
oc 
(p od 
(e 
(c 
k#      Y@[kZl(f 
i(g 
(h 
(d 
k	#      Y@[kZl(f 
i(g 
(i 

oj 
(d 
ok 

oj 
(c 
ol 
*&(6 **   0    K (q A (7  +
(m o@ 
od 
"  @?o	 
i(m sq 
(B 
	os 
ot 
~u 
ov 
ow 
ox 
oy 
(p ~	 
(N 
oO 
oy 
o	 
oy 
oI 
oP 
(m (: o	 
( (; *   0 V   L s` 
(q A (,  +}
 (p oy 
a s	 
(  +(  +-(p s	 
*sr 
**( **
*0     
  (q H (,  +
H (T  +*&( *
*F(y {2 o	 
*F(n ~  
o7 *
*&( *
*F(y {2 oE 
* 0 g   M ( 
(q 
v (\ r p( 
(X 
(	 
(X 
(	 

	o	 
-sT 
z(n o7 
s z*     2 *\ 
e  >( (  
*
*&( *
*
*
**B( } *
*F(y {2 oG 
*  0    N (q v (  +
(q v (\ (q v (\ ( 
( 	(a ,s z(X 
(	 
" %%r p%%%	(	 
(X 
(	 
o	 
-sT 
z*2(z oJ *J([ (Z (	 
*(\ ,(n { sb ( &+( (q v (  +*   0    O (Z 
(n o+ o  
(	 
(n o0 oW 
	s zo	 
-_o	 
3o	 
+,s	 
zs 
(n o+ o  
(	 

&s z(n o8 *(n (n o0 o o  
o8 * (     3 e    l     l  
e  >( (  
*
*(n o0 o oR o 
(  +**( *
*F(y {2 o	 
*0    P (p o  

(n o0 (z o 
oW o	 
,(z o 
+Mo  
~	 
(	 
,;o	 
,3(z o	 
(z o; o  
o  
o
 
(z o 
v (q v (,  +(T  +&s z*              e  &(W **  0    Q (q v (  +
(q v (\ (q v (\ ( 
( 	(a ,s z" %%r p%%%	(	 
(X 
(	 
(X 
(	 
o	 
-s z(n o0 o (q v (,  +od	 
(q v (,  +oe	 
(q v (  +of	 
(n o0 ( o *0    \  sZ 

t (T  +*R(i ( } *
*
*
**( 
v { (s (h  +v (x (h  +**( *
*
* 0    R (q I (\ s  
(n o0 o o  
s zI (q I (,  +(T  +o  u^  ,Oo  t^  (z o; o	 
(] I (n o+ o  t^  (p (U (h  +*o  u" -r
 pI ( *        + e  *( **
*  0    S (q & (7  +
(k { ! (\ sZ od (q & (,  +.,r p. (q & (,  +. (! 
sS 
z& (T  +*&( **
*
*(p o 
(q N (,  +s 
o	 
*&( **F(y {3 o	 
*0 
  T (m oG 
( oH 

o 
(q  (7  +(Q (p o 
(q  (\ o	 
o 
(q  (,  +(q  (,  +
	s 
o 
o 
(q  (-  +s	 
o8 
+ok  
tz  (G o	 
oh  
-u  ,og  
s	 
o	 
o	 
*      )     0 /   U (m oG 
( oH 

(m o 
o 
o	 
*^(q  (,  +sC 
*&( **
*z( (q T (Z ( * 0    V (m ok 

(m oG 
oH 
(m oG 
(d 
oH 
o 
o 
o	 

oz 
3( *(p oW	 
(m o 
oY	 
(p oW	 
(m o	 
,o 
	( 
o 
&*(p oW	 
(m o	 
(p oW	 
(m o	 
*   0 B   W (m ( ok 

(m oG 
oH 
(m o 
o 
( 
o	 
*^(q T (,  +s9 
**( *
*
*0 0  X (n o0 -rW psS 
z(q y (,  +
(q y (,  +(q y (,  +
(p oy 
oz 

+
o{ 
o4 
3

oh  
-
,
og  
	-r psS 
z	s9 
( 
	Xs9 
( 
s	 
o	 
o	 
o	 
u 	o	 
o	 
o	 
s	 
s	 
o	 
	y 	(U  +y (s (T  +*   c %     *( **
*  0    Y sb 
(n o0 -r! psS 
z}
 s	 
o	 
o	 
c s	 
o	 
(q z (  +( o	 
o	 
(n o+ o; o	 
(] {
 -+(n o+ o	 
(p (U 
z 	(h  +z (s (T  +*&( **
* 0 |   Z  (q ^ (,  +(	 
(p o 
o 
(p o 
oG 
o 
oH 
o 

(q ^ (Z (p oW	 
o	 
	( *&(	 
**F(y {3 o	 
*0 "   [ ~   o	 
-sH 
z(m o	 
*  0 R       s	 
%~
 f s	 
o	 
%
~
 g s	 
o	 
%~
 h s	 
o	 
  *"(	 
*6of 
(? *"(	 
*"og 
*"(	 
*"oe 
*&(	 
**F(y {3 o	 
*   0 "   \ ~  o	 
-sH 
z(m o	 
*  0        s	 
%~
 k s	 
o	 
%~
 l s	 
o	 
%~
 m s	 
o	 
%	~
 n s	 
o	 
%
~
 o s	 
o	 
 *"(	 
*o 
o 
D o		 
o 
o 
. o
	 
*"(	 
*"o 
*"(	 
*"o 
*"(	 
*o 
o 
C o	 
o 
o 
. o	 
*"(	 
*o 
o 
C o	 
o 
o 
. o	 
*&(	 
**F(y {3 o	 
* 0 "   ] ~  o	 
-sH 
z(m o	 
*s	 
%~
 r s	 
o	 
%
~
 s s	 
o	 
 *"(	 
*6o 
(? *"(	 
*"o 
*  0 '   ^ ~ 
(	 
t  (  +
3* 0 '   ^ ~ 
(	 
t  (  +
3*o	 
o	 
-r ps	 
z~ ,~ o	 
(  +-( *( *0 '   ^ ~ 
(	 
t  (  +
3* 0 '   ^ ~ 
(	 
t  (  +
3*o	 
o	 
-r ps	 
z~ ,~ o	 
(  +-( *( *0 !   _ o	 
s 
~ ,~ o *   0 !   _ o	 
s 
~ ,~ o *(  
( ( oq ( *{ *"} *{ *"} *{ *"} *&( *0    ` st 
(q g (\ }
 (p o 
{
 o	 
/u( u s 
(  +
	,[	(p o	 
	oa 
,F	ob 
(p o	 
(p o 
(p o 
o	 
(p o 
o	 
o 
(p o 
o	 
o *
*&( **
*0 o   a oa 
-f(p (p o 
o 
 .  (  
o 
(h 
s  

(p o 
o	 
o 
o_ 
o	 
(p o 
o	 
*&( **
*oa 
,'(p o 
ob 
o	 
(p o 
o	 
*&( * 0 <   
  (q j (,  +
( 
 
o
 
(q j (s  +o
 
o
 
*(y {3 o
 
,(y {3 o
 
**J(p ( 
 
o
 
*(p o 
(q j (,  +s	 
o 
*&(
 
**s
 
*o 
*&(	
 
**s

 
*o 
*&( * 0 @   b (q i (s  +o
 

(p oW	 
  o3 
o
 
o
 
o
 
*(y {3 o
 
,(y {3 o
 
**
*&(
 
**2(p o 
*6(p s 
*&(
 
**2(p o 
*6(p s 
*&( **F(y {3 o	 
* 0    c sv 
( (q  (7  + (\ }
 {
 (  
,o 
*(p o 
{
 o 
/'( w s 
(  +
	,
	(p o 
o 
*J(m ( (A *v(q  (7  +(m ( *&(
 
**F(y {3 o	 
*0 "   d ~  o
 
-sH 
z(m o
 
*  0        s
 
%~
 z s
 
o
 
%~
 { s
 
o
 
%~
 | s
 
o
 
%~
 } s
 
o
 
%	~
 ~ s
 
o
 
%~
  s
 
o
 
%~
  s
 
o
 
%
~
  s
 
o
 
%~
  s
 
o
 
%~
  s
 
o
 
 *"(
 
*0 O   e (
 
ok 

(
 
on 
o 
o| 
o} 
o 
oi 
o 

	o[ 
o
 
*"(
 
*0 y   f (
 
ok 

(
 
on 
o 
o| 
o} 
o 
oi 
o 

	o[ 
o 
	o[ 
o
 
	o[ 
o
 
( 
o 
&*"(
 
*  0 y   f (
 
ok 

(
 
on 
o 
o| 
o} 
o 
oi 
o 

	o[ 
o 
	o[ 
o 
 
	o[ 
o!
 
( 
o 
&*"("
 
*(#
 
*   0 "     ($
 
o@ 

o%
 
(&
 
('
 
*^tz  ($
 
o@ 
(O *"((
 
*
*Bo 
o)
 
*"(*
 
*(+
 
*V(c 
(,
 
(-
 
*"((
 
*
*Bo 
o.
 
*"((
 
*
*Bo 
o/
 
*"(0
 
*(1
 
*B(2
 
(3
 
*"(4
 
*
*Bo 
o5
 
*"(6
 
*
*Bo 
o7
 
*"(8
 
*
*  0   g x %o 
o 
%o 
o 
%o 
o 
%o 
o 
%o 
o9
 
%o 
o:
 

s;
 
(<
 
o@ 

8   	9   		o 
tz  (M o 
o 
o 
o=
 
(>
 
		o 
U o 
		o 
. o 
		o 
U o 
		o 
 o 
		o 
. o 
+	o?
 
	X
	?Do@
 
-
oA
 
o@
 
-
oB
 
o@
 
-
oC
 
o@
 
-
oD
 
o@
 
-
oE
 
o@
 
-
oF
 
*"(8
 
*
* 0    h  %o 
o 
%o 
o	 
%o 
o	 
%o 
o 	 

+0o 
C o	 
o 
. o	 
X2oG
 
oH
 
oI
 
oJ
 
*&(K
 
**F(y {3 o	 
*0 "   i ~	  oL
 
-sH 
z(m oM
 
*  0       sN
 
%~
  sO
 
oP
 
%~
  sO
 
oP
 
%~
  sO
 
oP
 
%~
  sO
 
oP
 
%~
  sO
 
oP
 
%~
  sO
 
oP
 
%~
  sO
 
oP
 
%	~
  sO
 
oP
 
%~
  sO
 
oP
 
%~
  sO
 
oP
 
%~
  sO
 
oP
 
	 *"(Q
 
*0 3   j (R
 
ok 

(R
 
on 
o 
o| 
ou 
oS
 
*"(T
 
*0 O   k (U
 
ok 

(U
 
on 
o 
o| 
ou 
o 
ou 
oV
 
ou 
oW
 
*"(X
 
*RoY
 
(Z
 
o 
&*"(X
 
*Ro[
 
(\
 
o 
&*"(]
 
*0 O   k (^
 
ok 

(^
 
on 
o 
o| 
ou 
o 
ou 
o_
 
ou 
o`
 
*"(a
 
*	*Bob
 
oc
 
*"(d
 
*
*o 
  (  +oe
 
of
 
*"(g
 
*
*Boh
 
oi
 
*"(j
 
*   0   g x %o 
o 
%o 
o 
%o 
o 
%o 
o 
%o 
o 
%o 
o 

s;
 
(k
 
o@ 

8   	9   		o 
tz  (M o 
o 
o 
o=
 
ol
 
		o 
U o 
		o 
. o 
		o 
U o 
		o 
 o 
		o 
. o 
+	o?
 
	X
	?Do@
 
-
om
 
o@
 
-
on
 
o@
 
-
oo
 
o@
 
-
op
 
o@
 
-
oq
 
o@
 
-
or
 
*>(s
 
o 
&*"(t
 
*
*Bou
 
ov
 
*"(w
 
*
*Box
 
oy
 
*"(w
 
*
*Boz
 
o{
 
*"(a
 
*
*Bo|
 
o}
 
*"(~
 
*o 
o 
C o	 
o 
o 
. o	 
o
 
**o 
&*"(j
 
*0    h  %o 
o 
%o 
o	 
%o 
o	 
%o 
o 	 

+0o 
C o	 
o 
. o	 
X2o
 
o
 
o
 
o
 
**o 
&*"(~
 
*o 
o 
C o	 
o 
o 
. o	 
o
 
**o 
&**( *	*Z(n o/ {4 o *   0    l (n o0 -r psS 
z(q F (\ 
(q F (\ (8 
(n o/ {4 ($ s
 
(n o0 o 
	o  
	s z*     a t e  *( *
*Z(n o/ {4 o *   0    m (q F (\ (8 

(n o/ {4 s (q F (-  +s
 

o8 
+nok  
tz  F (\ ( o sZ 
F (  +F (  +F o
 
(  +	o 
oh  
-u  		,	og  
F 	o
 
(  +o  *   O {     &(
 
**F(y {3 o	 
*0 "   n ~
  o
 
-sH 
z(m o
 
*  0        s
 
%~
  s
 
o
 
%~
  s
 
o
 
%~
  s
 
o
 
%~
  s
 
o
 
%~
  s
 
o
 
%~
  s
 
o
 

 *"(
 
* 0 A   o (
 
ok 

(
 
on 
o 
o| 
o} 
o 
o 
o
 
*"(
 
*  0 h   p (
 
ok 

(
 
on 
o 
o| 
o} 
o 
o 
o 

o 
	o
 
o 
	o
 
( 
o 
&*"(
 
*
*Bo 
o
 
*"(
 
*
*o 
o 
C o	 
o 
o 
. o	 
o
 
*"(
 
*
*Bo 
o
 
*"(
 
*
*Bo 
o
 
*"(
 
*
*Bo 
o
 
*"(
 
*
*Bo 
o
 
*&( **F(y {3 o	 
*  0   q  (q  (,  +(9 
(m ok 
(m on 
(m oG 
oH 
o
 
(m s 

(q  (-  +o8 
8   ok  
tz  	s
 
	o} 
o
 
 (-  +o8 
+Xok  
tz  	oi 
o
 
	 (,  +	 (,  +(m ( 

	 (7  +( oh  
-u  ,og  
 (7  +( oh  
:*u  ,og  
	(q  (7  +(p ( (m o 
	o 
*     e     n K    (m (q  (,  +s9 
oM	 
*&( **F(y {3 o	 
*0    r ( 
(q  (7  +o} 
 (,  +o 
 (7  +
	 (,  +	 (,  +	 (,  +(m ( 	 (7  +( *J(m ( (A *v(q  (7  +(m ( *&( **F(y {3 o	 
*  0 Y  s (q  (7  +(m ( 
(q  (7  + (,  + (-  +
o} 
o
 
1Vo} 
o 
		o 
Yo 
tz   (,  +(9 
(m o
 
(m ok 
om 
s 
o} 
o 
	o8 
+Xok  
tz  	oi 
o
 
	 (,  +	 (,  +(m ( 

	 (7  +( oh  
-u  ,og  
 (7  +( *       e0    J(m ( (A *v(q  (7  +(m ( *&( **F(y {3 o	 
*   0   t (q  (7  +(m ( 
(q  (7  +o} 
 (,  +o 
 (7  +
	 (,  +	 (Z ,Koi 
Xo 
(m ( (m oi 
o 
oi 
o 
oc 
(d 
o
 
*oi 
Yo 
(m ( (m oi 
Yo 
oi 
Yo 
oa 
(
 
om 
*  0 V   u ( 
(q  (7  + (,  + (7  +
	 (,  +(m ( (D *v(q  (7  +(m ( *&( **F(y {3 o	 
*0    v ( 
(q  (7  +o} 
 (,  +o 
 (7  +
oi 
	 (,  +o 
oa 
ol 
(m ( ,(m om 
*  0 V   u ( 
(q  (7  + (,  + (7  +
	 (,  +(m ( (D *v(q  (7  +(m ( *&( **F(y {3 o	 
*0 /   w (q  (7  +(m ( 
(m on 
o
 
*J(m ( (A *v(q  (7  +(m ( *&( **F(y {3 o	 
*0    x ( 
(q  (7  + (,  +o} 
o 
o
 

o
 
oa 
+oi 
o 
(m ( oi 
o
 
0o} 
o
 
	,(m 	o
 
om 
*J(m ( (A *v(q  (7  +(m ( *&( **F(y {3 o	 
*0 K   y ( 
o
 
o
 
(q  (,  +(9 
oa 

(m (m ok 
om 
*(m (q  (,  +s9 
oM	 
*v(q  (7  +(m ( *&( **F(y {3 o	 
*   0   z ( 
(q  (7  +o} 
 (,  +o 
 (7  +
	 (,  +oi 
o 
	 (Z (m oG 
oa 
oH 
o 
  o 
(m oG 
oc 
oH 
o 
  o 
X	,5(m oc 
(
 
o
 
X	Y	(m ( +X(m ( 	 (7  +( * 0 V   u ( 
(q  (7  + (,  + (7  +
	 (,  +(m ( (D *v(q  (7  +(m ( *2ri p(  
*r p*2u ( *(
 
*{ *"} *{
 *"}
 *{ *"} *2ri p(  
*b{ o { o
 
**b{ o { o
 
** 0   { ( 
( o oD  +( ( r po 
o< 
( o= 
( o oD  +( ( o  
( o= 
( o o=  +( ( o  
( ( 
( o 
( 

r po 
o 
o o
 
r po 
s
 
o ( o 
rf> po
 
(
 
o 
( r po o *  0        ( ( o
 
( r	 p( o 
( r} po
 
( r po 
( rM p( oV  
( to  o (@ 
( ( 
o *( o 
o 
( o 
   oA 
*  0 6     r% pp( 
r} po 
ri po( o 
o 
**0 O   z  ( o oC  +
rc po 
o 
4.( o 
( o 
{ o 
*vs
 
} s
 
} ( *bo: 
o; 
( o< 
*o
 
o
 
o
 
o 
o 
o 
o
 
    ( o 
*   0 (   | (
 
r p  oH  +
o 
o 
&*0 9     r
 p( 
u' ,!o 
t o
 
o 
r po 
*o
 
s 
o 
o 
o 
o 
* 0 T   }  (~  
r po
 
(k 
 
~ o
 
,  %%([	 
u  *r psS 
z0    ~ ( 
o * 0 /    s
 

! (~  
o
 
" (~  
o
 
 * 0 Z       (r  
o; ( r po
 
-+r po
 
(p  +( r po
 
(8 
oa {2 ( *{ *"} *{ *"} *{ *"} *n( r po 
 ( *   0     ( 
~	 
(
 
,r
 p*~
 
(
 
,rE p*~
 
(
 
,rE p*~
 
(
 
,rD p*~
 
(
 
,rD p*~
 
(
 
,rD p*~
 
(
 
,rE p*~
 
(
 
,rD p*~
 
(
 
,rD p*~
 
(
 
,rD p*r
 p* 0 m    s  

o ,o o o (  
og	 
s
 
o o
 
s
 
(
 
o
 
o
 
o
 

,og  
	*       [a 
    &( *z( o# ,( o# **   0 +     ( o  
o  
o  
(
 

(  
,r p
*
*N( ( o 
*&( *2( oc	 
*r p*r# p*
*  0 ,    s
 

o
 
( o  
o 
( o 
*0 :     ~ -(~ 
(  
~ -( 
,(  
~ o
 
*      % 
    0 :     ~ -(~ 
(  
~ -( 
,(  
~ o
 
*      % 
    0 :     ~ -(~ 
(  
~ -( 
,(  
~ o
 
*      % 
    0 F       ~ (
 
,3s 
 ~ (
 
(
 
~ o 
~ o 
~ *  0    s
 
 s
 
 s
 
 ~
 
s
 

s
 
o 
o
 
+o
 
oc 
o 
oh  
-,og  
( s
 
o 
o
 
+o
 
o 
o 
oh  
-,og  
( s
 

o 
o
 
+o
 
			o 
o 
oh  
-,og  
	(  * (   < #_       #       #     0 q   s
 

o 
o 
o
 
r- ps  
o
 
o 
o
 
o
 
r; ps  

	o
 
	o 
o
 
	o
 
rM ps  
o
 
o 
o
 
o 
    O        (
 
(
 
o
 
ro ps  
o
 
o 
o
 
o 
    @@@(
 
(
 
o
 
r ps  
o
 
o 
o
 
o 
o
 
o
 
o
 
+(
 
~ o
 
(
 
- og  
*      @"b    0     o 
o^ 

~ o
 
( r po
 
--si 

	o` 
o
 
	o` 
o
 
~ 	o
 
r po
 
-Rsi 
o` 
"    o
 
o` 
o
 
o` 
od 
"   ?o
 
io
 
~ o
 
*0 r	   o 
o^ 

r po 
o
 
:   si 
o
 
o` 
od 
o
 
o
 
o` 
o
 
o` 
o
 
or 
o_ 
r po
 
o_ 
 o
 
o_ 
    .t    (
 
(
 
(  r p
	o 
o
 
:   si 
o
 
o` 
od 
o
 
o
 
o` 
o
 
o` 
o
 
or 
o_ 
r po
 
o_ 
o
 
o_ 
    .t    (
 
(
 
	(  r po 
o
 
:   si 
ol 
o` 
od 
o
 
o
 
o` 
o
 
o` 
o
 
or 
o_ 
r po
 
o_ 
    Mx(
 
(
 
o_ 
o
 
(  r po 
o
 
:   si 
ol 
o` 
od 
o
 
o
 
o` 
o
 
o` 
o
 
or 
o_ 
r po
 
o_ 
    .t    (
 
(
 
o_ 
o
 
(  r) p		o 


o
 
:   
si 
ol 
o` 
od 
o
 
o
 
o` 
o
 
o` 
o
 
or 
o_ 
r po
 
o_ 
    .t    (
 
(
 
	(  r= po 
o
 
:   si 
ol 
o` 
od 
o
 
o
 
o` 
o
 
o` 
o
 
or 
o_ 
r po
 
o_ 
    Mx(
 
(
 
(  rQ p

o 
o
 
:   si 
ol 
o` 
od 
o
 
o
 
o` 
o
 
o` 
o
 
or 
o_ 
r po
 
o_ 
    Mx(
 
(
 
o_ 
o
 

(  re po 
o
 
:   si 
ol 
o` 
od 
o
 
o
 
o` 
o
 
o` 
o
 
or 
o_ 
r po
 
o_ 
    '''(
 
(
 
o_ 
o
 
(  ry po 
o
 
:   si 
ol 
o` 
od 
o
 
o
 
o` 
o
 
o` 
	o
 
or 
o_ 
r po
 
o_ 
    '''(
 
(
 
o_ 
o
 
o_ 
o
 
(   8   r p (  
(h 
!!o 
""o
 
-"si 
##ol 
#o` 
o
 
#o` 
od 
o
 
o
 
#or 
#o` 
o
 
#o` 
"q=?o
 
#o` 
     YZo
 
#"(   X  	>Lr po
 
-Asi 
$$o
 
$or 
$o_ 
    ZZZ(
 
(
 
$(  r po
 
-^si 
%%o
 
%o` 
o
 
%o` 
o
 
%or 
%o_ 
r po
 
%o_ 
8o
 
%(  r po
 
:   si 
&&o
 
&o` 
o
 
&o` 
od 

o
 
o
 
&o` 
od 
"?o
 
io
 
&o` 
od 
"?o
 
io
 
&or 
&o_ 
r po
 
&o_ 
o
 
&o_ 
    @@@(
 
(
 
&(  r po
 
:   si 
''o
 
'o` 
o
 
'o` 
od 
o
 
o
 
'o` 
od 
o
 
o
 
'o` 
od 
"?o
 
io
 
'o` 
od 
"?o
 
io
 
'or 
'o_ 
r po
 
'o_ 
o
 
'o_ 
    [        (
 
(
 
'(  *  0 z   a ~ o
 
o 
o 
 .  (  
%-&o 
(h 
s  

o
 
o 
o
 
o 
o 
o_ 
o	 
~ o
 
o 
o	 
*~ o 
o
 
o
 
( ( * 0    o 
o
 

s 
                (
 
(
 

o 
o 
s 
    (
 
(
 

o 
o 
r p
	o
 
:   	s 
		o  
	o 
o 
o 
o 
	o 
o 
o 
o 
	o 
o 
o 
o 
	o 
o 
o 
o 
	o 
o 
o 
o 
	o 
o 
o 
o 
~ 	o
 
r po
 
:  s 


o  

o 
o 
o 
o 

o 
o 
o 
o 

o 
o 
o 
o 

o 
o 
o 
o 

o 
o 
o 
o 

o 
o 
o 
o 

 s 
o 
                (
 
(&
 

o 
o 

    s 
o 
                (
 
(&
 

o 
o 

    s 


o 
o
 

o 

o 

    s 
o 
o
 

o 
o 

    s 
o 
o 
o 
o 
o 
o
 

o 
o 

    s 
o 
o
 
~ 
o
 
r! po
 
:  s 
o  
o 
o 
o 
o 
o 
o 
o 
o 
 s 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
@s 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
    s 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
    s 
o 
o
 
o 
o 
    s 
o 
o
 
o 
o 
    s 
o 
o 
o 
o 
o 
o
 
o 
o 
    s 
o 
o 
o 
o 
o 
o
 
o 
o 
~ o
 
r= po
 
:@  s 
o  
s 
o 
o 
o 
( o 
o 
o 
s 
o 
o 
o 
( o 
o 
o 
 s 
o 
                (
 
(&
 
o 
o 
    s 
o 
                (
 
(&
 
o 
o 
    s 
o 
o 
o 
( o 
o 
o 
o 
o
 
o 
o 
    s 
o 
o 
o 
o 
o 
o 
o 
o
 
o 
o 
    s 
  o 
o 
o 
( o 
 o 
o 
 o 
o
 
o 
 o 
    s 
!!o 
o 
o 
o 
!o 
o 
!o 
o
 
o 
!o 
~ o
 
rY po
 
:B  s 
""o  
" s 
##o 
                (
 
(&
 
"o 
#o 
"    s 
$$o 
                (
 
(&
 
"o 
$o 
"    s 
%%o 
o
 
"o 
%o 
"    s 
&&o 
o
 
"o 
&o 
"    s 
''o 
o
 
"o 
'o 
"    s 
((o 
o
 
"o 
(o 
~ "o
 
ru po
 
:C  s 
))o  
)s 
**o 
o 
o 
( o 
)o 
*o 
)s 
++o 
o 
o 
( o 
)o 
+o 
)s 
,,o 
o 
o 
( o 
)o 
,o 
)s 
--o 
o 
o 
( o 
)o 
-o 
) s 
..o 
                (
 
(&
 
)o 
.o 
)    s 
//o 
                (
 
(&
 
)o 
/o 
)    s 
00o 
                (
 
(&
 
0o 
o 
o 
o 
0o 
o
 
0o 
o
 
)o 
0o 
)    s 
11o 
                (
 
(&
 
1o 
o 
o 
o 
1o 
o
 
1o 
o
 
1o 
o
 
)o 
1o 
)    s 
22o 
                (
 
(&
 
2o 
o 
o 
o 
2o 
o
 
2o 
o
 
)o 
2o 
)    s 
33o 
                (
 
(&
 
3o 
o 
o 
o 
3o 
o
 
3o 
o
 
)o 
3o 
~ )o
 
*   0                       (
 
                (
 
    fff(
 
    (
 
r
 p(                 (
 
                (
 
                (
 
    [        (
 
r p(                 (
 
                (
 
        }1(
 
        }1(
 
r p(                 (
 
                (
 
                (
 
                (
 
r p(                 (
 
                (
 
            (
 
            (
 
r p(                 (
 
                (
 
    Dr    (
 
    Dr    (
 
r p(                 (
 
                (
 
    p    G(
 
    p    G(
 
r p( *   0     o 
o
 

                (
 
s 
(
 

o 
o 
s 

	(
 
	o 
	o 
s 
(
 

o 
o 
s 
(
 
o 

o 
s 
(
 
o 

o 
r	 p(  
o
 
:  s 
o  
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
    s 
o 
o
 
o 
o 
    s 
o 
o
 
o 
o 
    s 
o 
o
 
o 
o 
o 
	o 
o 
o 
    s 
o 
o
 
o 
o 
o 
	o 
o 
o 
o 
o 
o 
o 
~ o
 
r/ p(  
o
 
:p  s 
o  
o 
o 
o 
	o 
o 
o 
o 
	o 
o 
o 
o 
	o 
o 
o 
o 
	o 
 s 
o 
(&
 
o 
o 
    s 
o 
(&
 
o 
o 
    s 
o 
o
 
o 
o 
    s 
o 
o
 
o 
o 
    s 
o 
o
 
o 
(&
 
o 
o 
o 
( o 
o 
o 
o9
 
( o 
o 
o 
o:
 
( o 
o 
o 
o 
	o 
o 
o 
    s 
o 
o
 
o 
(&
 
o 
o 
o 
( o 
o 
o 
o9
 
( o 
o 
o 
o:
 
( o 
o 
o 
o 
	o 
o 
o 
o 
o 
o 
o 
~ o
 
rI p(  
		o
 
:  	s 
o  
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
o 
s 
o 
o 
o 
o 
o 
o 
s 
o 
o 
o 
o 
s 
o 
o 
o 
o 
o 
o 
s 
o 
o 
o 
o 
o 
o 
 s 
o 
(&
 
o 
o 
    s 
  o 
o
 
 o 
(&
 
 o 
o 
o9
 
( o 
 o 
o 
o:
 
( o 
 o 
o 
o 
( o 
 o 
o 
o 
( o 
 o 
o 
o 
( o 
o 
 o 
    s 
!!o 
o
 
!o 
o
 
!o 
(&
 
!o 
o 
o9
 
( o 
!o 
o 
o:
 
( o 
!o 
o 
o 
( o 
!o 
o 
o 
( o 
!o 
o 
o 
( o 
o 
!o 
    s 
""o 
o
 
"o 
(&
 
"o 
o 
o 
( o 
"o 
o 
o9
 
( o 
"o 
o 
o:
 
( o 
"o 
o 
o 
( o 
"o 
o 
o 
( o 
o 
"o 
    s 
##o 
o
 
#o 
(&
 
#o 
o 
o 
( o 
#o 
o 
o9
 
( o 
#o 
o 
o:
 
( o 
#o 
o 
o 
( o 
#o 
o 
o 
( o 
o 
#o 
~ o
 
rc p(  


o
 
:k  
s 
$$o  
$o 
o 
o 
o 
$o 
o 
o 
o 
$o 
o 
o 
o 
$o 
o 
o 
o 
$o 
o 
o 
o 
$o 
o 
o 
o 
$ s 
%%o 
(&
 
$o 
%o 
$    s 
&&o 
(&
 
$o 
&o 
$    s 
''o 
o
 
$o 
'o 
$    s 
((o 
o
 
$o 
(o 
$    s 
))o 
o
 
)o 
o 
o 
o 
$o 
)o 
$    s 
**o 
o
 
*o 
(
 
*o 
(&
 
*o 
o 
o 
o 
*o 
o 
o 
o 
*o 
o 
o 
o 
*o 
o 
o 
o 
*o 
o 
o9
 
( o 
*o 
o 
o:
 
( o 
$o 
*o 
~ $o
 
r} p(  
o
 
:  s 
++o  
+o 
o 
o 
o 
+o 
o 
o 
o 
+o 
o 
o 
o 
+o 
o 
o 
o 
+o 
o 
o 
o 
+o 
o 
o 
o 
+o 
(&
 
+ s 
,,o 
(&
 
+o 
,o 
+    s 
--o 
(&
 
+o 
-o 
+    s 
..o 
o
 
.o 
(
 
.o 
(&
 
.o 
o 
o 
o 
.o 
o 
o:
 
( o 
.o 
o 
o 
o 
.o 
o 
o 
o 
+o 
.o 
+    s 
//o 
o
 
/o 
(
 
/o 
(&
 
/o 
o 
o 
o 
/o 
o 
o:
 
( o 
/o 
o 
o 
o 
/o 
o 
o 
o 
+o 
/o 
+    s 
00o 
o
 
0o 
(
 
0o 
(&
 
0o 
o 
o 
o 
0o 
o 
o9
 
( o 
0o 
o 
o:
 
( o 
0o 
o 
o 
o 
0o 
o 
o 
o 
+o 
0o 
+    s 
11o 
o
 
1o 
(
 
1o 
(&
 
1o 
o 
o 
o 
1o 
o 
o9
 
( o 
1o 
o 
o:
 
( o 
1o 
o 
o 
o 
1o 
o 
o 
o 
+o 
1o 
~ +o
 
r p(  
o
 
:  s 
22o  
2o 
(
 
2o 
o 
o 
o 
2o 
o 
o 
o 
2o 
o 
o 
o 
2o 
o 
o 
o 
2o 
o 
o 
o 
2o 
o 
o 
o 
2 s 
33o 
(&
 
2o 
3o 
2    s 
44o 
(&
 
2o 
4o 
2    s 
55o 
o
 
2o 
5o 
2    s 
66o 
o
 
2o 
6o 
2    s 
77o 
o
 
7o 
o 
o 
o 
2o 
7o 
2    s 
88o 
o
 
8o 
o 
o 
o 
8o 
o 
o 
o 
2o 
8o 
~ 2o
 
r p(  


o
 
:  
s 
99o  
9o 
(
 
9o 
o 
o 
o 
9o 
o 
o 
o 
9o 
o 
o 
o 
9o 
o 
o 
o 
9o 
o 
o 
o 
9o 
o 
o 
o 
9s 
::o 
o 
o 
o 
9o 
:o 
9s 
;;o 
o 
o 
o 
9o 
;o 
9s 
<<o 
o 
o 
o 
9o 
<o 
9s 
==o 
o 
o 
o 
9o 
=o 
9 s 
>>o 
(&
 
9o 
>o 
9    s 
??o 
(&
 
9o 
?o 
9    s 
@@o 
o
 
@o 
(&
 
@o 
o 
o 
( o 
@o 
o 
o9
 
( o 
@o 
o 
o:
 
( o 
@o 
o 
o 
( o 
@o 
o 
o 
( o 
9o 
@o 
9    s 
AAo 
o
 
Ao 
o
 
Ao 
(&
 
Ao 
o 
o 
( o 
Ao 
o 
o9
 
( o 
Ao 
o 
o:
 
( o 
Ao 
o 
o 
( o 
Ao 
o 
o 
( o 
9o 
Ao 
9    s 
BBo 
o
 
Bo 
(&
 
Bo 
o 
o 
( o 
Bo 
o 
o9
 
( o 
Bo 
o 
o:
 
( o 
Bo 
o 
o 
( o 
Bo 
o 
o 
( o 
9o 
Bo 
9    s 
CCo 
o
 
Co 
(&
 
Co 
o 
o9
 
( o 
Co 
o 
o:
 
( o 
Co 
o 
o 
( o 
Co 
o 
o 
( o 
Co 
o 
o 
( o 
9o 
Co 
~ 9o
 
*0 6    ~ ~ s 

( ~ ~ s 
(
 ( 
*  0 6    ~ ~ s 

( ~ ~ s 
( ( 
*  0 6    ~ ~ s 

( 
~ ~ s 
( ( 
*  0     ( 

o 
o 
*sr  
  <   $ *-*o	 
o
 
o` 
o 
o] 
(
 *-*o 
o
 
~2 
o 
(
 *6-*( *0 G    (
 
k"  @?Zi
( 
( 
k( 
kkk( 
( ( * 0 )   ( 
o) 
o, 
k"   @[s 
o 
o 
o 
k[
o 
o 
o 
o 
k	Z( 
o 
k	Z( 
o 
k	Z( 
YY	o 

( 
k( 
k( 
k(
 
k( 

( 
o  
(! 
YX	X(" 
(# 
($ 
( r p(% 
( ( o& 

o  
*Z(' 
-
s( 
o) 
*0     o* 
o+ 
s
 

ot 
ot 
o, 
o- 
&+o 
o. 
o 
o/ 
0o 
o 
&o 
o 
o 
o 
o 
o0 
o 
o 
o1 
ot 
o 
o 
o2 
( 
0Yk"   ?Zi
(
 
 Yk"   ?Zi	( 	( *    K 
U     0 0    s 
}
 }
 }
  s3 
o4 
*0 <    oz 
ZX
o5 
ZX(6 
s( 
o7 

,og  
*   # 1 
    0 0    s 
}
 }
 }
  s3 
o4 
*0    oz 
ZX
o5 
ZXXX
(8 
	(8 
(8 
	(8 
XX(8 
	X	X(8 

XX(8 
X	X(8 
x %o9 
%o: 
%o; 
%o< 
 %o| 
    o= 
%o| 
     o= 
%o| 
  @  o= 
%o| 
    o= 


-+
o 
o 
	( 
-+
o 
o 

( 
-+
o 
o 

( 
-+
o 
o 
	( ( *  0     (> 

~2 
(? 
,( 

o 
,s@ 
oA 
o 
1Vs@ 
oA 
s@ 
(B 
Y(C 
s8 
oA 
s@ 
(B 
(C 
Ys8 
oA 
*z( 
s@ 
XX	XXoD 
*   0     (' 
-+( 

s( 
*0     
o- 
,`
o. 
,`
*0 $    (E 
oF 
t 
%oG 
    `oH 
*j(r  
s" }# ( *:( {$ *  0 s   {# o oI 
{# o oJ 
{# o -(K 
+o oL 
{# oM 
o o -+oN 
{# oM 
o o -+oO 
{# oM 
o o -+oP 
{# oM 
o o -+oQ 
{# oM 
o o -+oR 
{# oM 
o o -+oS 
o o 

+>ok  
ts oT 
-
sU 
oV 
+(- 
	,{# oW 
oX 
oh  
-u  ,og  
*    J^    0 x       s
 
}$ {#  sY 
oZ 
{#  s[ 
o\ 
{# o] 
&/{#  sY 
o^ 
{#  s[ 
o_ 
*   9 H /    0    \  sZ 

	. . o[ 

. o` 
oa 
o[ 
. ob 
o[ 
. oc 
t~ od 
. o[ 

. oe 
t~ od 
. o[ 
{$ o 
*   0    \  sZ 

	. . o[ 

. o[ 
. ob 
o[ 
. oc 
t~ od 
. o[ 

. oe 
t~ od 
. o[ 
{$ o 
*2{# of 
*sg 
*(h 
*.(i 
oj 
* 0 3    (- 
,(ok 
(& ol 
(' om 
-(* * 0 _    (& 
,Ool 
(' (( 
	(- ,-)s1 (2 (* (. (+ *	*~  
* 0 j    o o 

+=ok  
ts oT 
,)() on 
(o 
-(K 
on 
om 
,oh  
-u  
	,	og  
**      IU     F(# op 
u *  0 &    (# ~% (  
op 

-~  
*%  *Vo -(K 
*o *oq 
-or 
oq 
,(# os 
*r(# ~% (  
%  os 
*.r p% *n~& ot 
-*~& ou 
*   0      (/ 
~& ov 
*0      ( 

~& ot 
-*.sw 
& *"(U 
*2(x 
u *(5 *(y 
*r p~
 %-&~
  s# 
%
 (z 
*(5 *nsr  
}( ({ 
(8 *^sb (@ s| 
(D *(} 
**{) *{) *"}) *{* *"}* *{+ *"}+ *{, *"}, *{- *"}- *{. *"}. *&(e 
*2(; o~ 
*R(; o 
( 
*Z(; o  
o  
o  
*0      {( 
(  
(; o  
o 
o 
(; o  
o  
o 
(; o  
o 
o 
(; o  
o 
o 
o 
(; o  
o 
o 
o 
(; s 
o  +&
,(  
*    	  
    0    {( 
(  
(; o 
o	 
o 
(; o 
o	 
oI	 
(; o 
o	 
oy 
oz 

8   	o{ 
oE 
o 
Y( 
8   oE 
o 
o 
Ј (~  
( 
,,o 
o 
o 
o 
o 
o 
 (~  
( 
,4t o] 
o 
,.o 
o 
o 
( 
~ 
( 
:F	oh  
:
	,	og  
(; o 
o	 
(; o 
o	 
od 
(; o 
o	 
o 
o 
( 
(F ,(n (M -r+ psS 
z
,(  
*A4     [      I  
          	       
       {/ *"}/ *( 
(; o 
&( 
(L * 0 C   	  o 

(Q ~	 
(	 
,*o 
,(; o  
o 
o 
*~	 
* 0    
   ( 
,s 
*~	 
* 0     ( 
(P 
o 
,o 
(U +?o 
,o 
(T +(o 
, o 
s, 
(T 
,og  
(; o  
o  
o  
( 
(L *      P 
Z 
    0 .    o 
(Q 
o 
s, 
(T 
,og  
*      
# 
    ~	 
(
 
,(; o  +o 
(V (; o 
&*Z(V (; o 
&*(; o  
o  
~
 
(	 
o 
*0     r po
 
(8 

(C o 
-rO ps 
zo 
~
 %-&~
  s 
%
 (  +(  +,o
 
( (X 
	,	*o 
r p(  +,( *( * 0 {   s 
}
 r{ p(  
-2r p(  
-Ur p(  
:   r p(  
:   8  {
 ( 
9   (; o  
oQ 
oR 
8   (; o  
o 
{
 o 

	-(  s 
(  +
	9   	( 8   (; o  
o 
{
 o 
-(  s 
(  +,O( +E(; o  
o 
{
 o 
-(  s 
(  +,( ,$s 
of 
o 
r po 
**n{) ,(; o 
}) * 0 x    ( 
(\ 
s  
(; o 
jo 
 &  ov  
s 
(; o  
o 
s7 
	o? (? oc 	
,og  
*    Xk 
    0     ( 
(P 
~	 
(
 
,(\ 
o 
,(; o 
o
 
*o 
,3s  
(; o 
jo 
(  
o 
$,og  
o 
,(; o 
o 
*    K #n 
    0 =    (; o  
o  
o 

(; o  
o  
o  
~	 
(	 
-**   0      so 
(^ * 0 -    s 
}
 (C {
  s 
o 
&*   0      (C  o 
&*6(C o 
*  0      (C  o 
-**0 j       ss (< (> (; c s	 
o 
(; o  
o 
o 
(K o 
,o 
*o 
(= -o 
*f(	 
o 
( (> *s  *Z(; o  
o  
o  
*(; o 
(; o  
o  
o  
o
 
( 
*r p*   0     ~
 

(G ,.s  

(; 	o 
	jo 
	(  
N	,	og  
sx 
(? (; o  
s0 (; o  
(? ( s 
o 
 &  ov  
s 
o 
(l *       1 
    o 
*o 
*0     ss (< (K (8 (G ,	(S +?sx 
(? (; o  
s0 s 
(; o  
o 
o 
(_ o 
(m (A (a 
,E(; o  
o 
o 
{5 o o o 
(; o  
o 
{6 o 
(; o  
o  
o  
(L *  0 +   r pr p(? oi ~
 %-&~
  s 
%
 (  +(  +( 
o 
r p(A %  ov  
o 
r p(  
( 
o 
r	 p(; o  
o  
o  
o 
r# p(; o  
o  
o  

&  ov  
o 
sZ 

(C o 
8  o 
sZ 
r? p( 
{0 o[ 
rE p( 
{1 U o[ 
rK p( 
{2 ( o[ 
rQ p( 
{3 ( o[ 
rY p( 
{4 ( o[ 
ra p( 
{5 ( o[ 
rg p( 
{6 ( o[ 
rm pry p( 
op (  +o[ 
( 
%  ov  
o[ 
oh  
:,og  
r} p( 
o 
* A        (  
         0 A   sb (@ r po 
~  
(5 
,Ir po 
" %r po 

+	(? sZ od &	X
	i2r po 
(8 
(B r} po 
(p  +
(; o  
o  
r	 po 
o  
(; o  
o  
r# po 
( 
s 
o  
r po 
( 
( 
o 
om  
8  ok  
s o 
tz  r? po 
t" 	rE po 
U 
rK po 
tz  rQ po 
tz  rY po 
tz  
ra po 
tz  rg po 
tz  	
( ( 
( -s +( -s +( so }
 (C t" (8 
{
  s 
o 
&oh  
:u  ,og  
*   A        ,  +         0 <    s 
( 

(; o  
o 
o` 
oa 
(N 
,og  
*   
 $1 
    0 M       (r  
}0 }1 }2 }3 }4 }5 }6 sx 
(q (r *{7 *"}7 *f(p o 
(p o 
&*2( 
( 
*J-su *sv *"( 
*&( 
*.( 
sx *"(
 
**( 
*2(+ 
sx *:(+ 
sy *s 
*r p@  (~  
r p( 
(~ o 
r p( o 
*  0     s 
}
  s 
*~
 %-&~
  s 
%
 *(r  
*Fra p( o 
*~
 %-&~
  s 
%
 *  0 x      r psZ 
%r= p    ( o 
%rf p   ( o 
%r/ p    ( o 
%r(> p    ( o 
%r/ p    ( o 
%r8 p    ( o 
%r1 p    ( o 
%rJ2 p    ( o 
%r p    ( o 
%r p    ( o 
%r- p    ( o 
%r- p    ( o 
%rE p   ( o 
%r@> p   ( o 
%r] p    ( o 
%ro p    ( o 
%rJ1 p    ( o 
%r p    ( o 
%r p 5  ( o 
%r p 6  ( o 
%r p 7  ( o 
%r p 8  ( o 
%r/ p 9  ( o 
%rv p :  ( o 
%r^b p ;  ( o 
%rf p   ( o 
%rf p   ( o 
%rf p   ( o 
%rtY p_( o 
(i 
r p( 
*0       rM psZ 
%.    ( ( 
o 
o 
-r p+r p(h 
o 
%.    ( o 
%.    ( o 
%.    ( o 
%
.     ( o 
%.    ( o 
%.    ( o 
%.    ( o 
%.  )  ( o 
%.  *  ( o 
%.  +  ( o 
%.  -  ( o 
%	. ^( 
o 
%
.  ,  ( o 
%.    ( o 
%.  .  ( o 
(i 
r p( 
*0        r psZ 
%r7 p <  ( o 
%rLG p =  ( o 
%rA p >  ( o 
%r{ p   ( o 
%r p   ( o 
%r p   ( o 
%r p   ( o 
(i 
r p( 
*   0 Y       r psZ 
%r} p   ( o 
%rQ p   ( o 
%re p   ( o 
(i 
r p( 
*   0 Y       rk psZ 
%r p   (  
o 
%r p   (  
o 
%r p   (  
o 
(i 
r p( 
*   0 Y       r	 psZ 
%rK p   (  
o 
%ro p s  (  
o 
%r p   (  
o 
(i 
r p( 
*   0     sZ 

s! 
o" 
o# 
( o 
+o
 

	oc 
	o 
o 
oh  
-
,og  
( o 
+o
 
o 
o 
o 
oh  
-,og  
( o 
+o
 
o 
o 
o 
oh  
-,og  
r p(& 
r p( 
*  (   ( %M 
     c *       *     (r  
*&( **
*   0     (p s 

(q O (,  +o 
(q O (Z o 
(q O (-  +8   o 
tz  
(p s 
	O (7  +	O (7  +	O (7  +o7 
(z o? (p (M o; 
(z o9 
(Q o 
Xo 
?h(p o 
o 
*   0 U       (n o/ {3 o 
o 
-7(n o/ {3 o 
o 
-(n o/ {3 o 
o 
**
*&( **
*
*0 M   (p (q O (,  +s 
s 

(q O (,  +o 
(q O (-  +8   o 
tz  
O (W 	o 
,}(p s 
	O (7  +	O (7  +	O (7  +o7 
(z o? (p (M o; 
(z o9 
(Q o 
+8s 
			O (Z oG 
		O (,  +oF 
	o 
Xo 
?(p o 
o 
*&(	 
**
*  0     o< >   s 
o> t" }
 (p o 
{
 o 
/s(  s 
(  +,Y(p o	 
o 
,Do 
(p o	 

(p o 
(p o 
	o	 
(p o 
o	 
o 
(m o: o< o 
*Z(n o/ {3 o 
*  0 K       (m o: o: o< ( 
( 
(m ou 
( 
-o< +o< YoM	 
*&(	 
**
*0     o> t  
o 
( 
( 
o 
( 
(m o: ok 

o: o< ( 
(m oG 
	oH 
o 
,(m o 
&~ 
( 
,~ 
( 
,(m o 
o 
oz 
( 
( 
-		(I 

+*  0 U       (n o/ {3 o 
o 
-7(n o/ {3 o 
o 
-(n o/ {3 o 
o 
**   0 K       (m o: o: o< ( 
( 
(m ou 
( 
-o< +o< YoM	 
*&(	 
**
*0    s 
o> t" }  (p o 
{  o	 
/u(  s 
(  +
	,[	(p o	 
	oa 
,F	ob 
(p o	 
(p o 
(p o 
o	 
(p o 
o	 
o 
(m o: o< oq	 
oS	 
oT	 
+!(m oG 
oH 
o 
(I 
oU	 
oT	 
( 
-*Z(n o/ {3 o 
* 0 K       (m o: o: o< ( 
( 
(m ou 
( 
-o< +o< YoM	 
*&(	 
**
*0 *    o>  s 
(m o: o< o 
*Z(n o/ {3 o 
*   0 K       (m o: o: o< ( 
( 
(m ou 
( 
-o< +o< YoM	 
*&(	 
**
*0 l    s 

o> tz  (n o+ o? (p ( 
(  
o 
 s 
s 
(m o: o< 	o 
*Z(n o/ {3 o 
* 0 K       (m o: o: o< ( 
( 
(m ou 
( 
-o< +o< YoM	 
*&( 
**
*0     ~8 o 

(m s *Z(n o/ {3 o 
*0        s  
%sY o 
%s_ o 
%sd o 
%si o 
%s} o 
%s o 
%sn o 
%ss o 
%sx o 
%	s o 
%
s o 
%s o 
%s o 
%s o 
%s o 
%s o 
%s o 
%s o 
%s o 
8 *>( }9 *n{9 ,	( 
`*( 
f_*"( 
*2o 
o> 
*Zo 
o 
o 
o 
*  0 ;    o 
o 

o 
o> 
o o 
o 
o 
o' 
o	 
* 0 ]    o 
o 

o 
o 
o 
o 
o 
o o 
o' 
o	 
o 
( 
o 
&o
 
*( 
*( 
*&( 
**
*  0 T    s 
~ %-&~  s	 
% o
 
~ %-&~  s	 
% o
 
*0 "   G ~:  o 
-sH 
z(m o	 
*.( : *"( 
* 0 j    .r p. (	 
( 
oq	 
oS	 
o 

( 
oE 
o 
u ,
t o 
*t oa 
ob 
oc 
*"( 
* 0    .r p. (	 
( 
oq	 
oS	 
o 

( 
oE 
o 
o 
( 
"  B[o 
( 
"  B[
u ,t 	(U 
*t o] 
t o% 
( 
o@ 
od 
(e 
(c 
kZl(f 
i(g 
(h 
(d 
k	Zl(f 
i(g 
(i 
t oj 
(d 
ok 
t oj 
(c 
ol 
*&( 
**
*  0 "    ~;  o 
-sH 
z(p o 
*s 
%~  s 
o 
%~  s 
o 
; *&( 
**
*   0     ~< o 

(p s *   0        s  
%sY o 
%s_ o 
%sd o 
%si o 
%s} o 
%s o 
%sn o 
%ss o 
%sx o 
%s o 
%s o 
%s o 
%s o 
%s o 
%	s o 
%
s o 
%s o 
%s o 
%s o 
< *&( 
**
*  0     ~= o 

(p s *   0 a      s 
%s o 
%s o 
%s o 
%s o 
%s o 
%s o 
%s o 
%s o 
%s o 
%	s o 
%
s o 
%s o 
%s o 
%
s  o 
%s o 
%s o 
%s o 
%s o 
%s o 
%s o 
%s! o 
%s% o 
%s) o 
%s- o 
%s1 o 
%s5 o 
%s9 o 
= *&( 
**
*  0 "    ~>  o  
-sH 
z(p o 
*  0 R      s! 
%~  s 
o" 
%~  s 
o" 
%~  s 
o" 
%~   s 
o" 
%~  s 
o" 
%
~  s 
o" 
%~  s 
o" 
%
~  s 
o" 
%~  s 
o" 
%~  s 
o" 
%~  s 
o" 
%~  s 
o" 
%~ 	 s 
o" 
%	~ 
 s 
o" 
> *&(	 
**
* 0 *    o>  s 
(m o: o< o# 
*Z(n o/ {3 o$ 
*   0 K       (m o: o: o< ( 
( 
(m ou 
( 
-o< +o< YoM	 
*&(% 
**
*0     ~? o 

(m s *Z(n o/ {3 o$ 
*0 n      s 
%s o 
%s o 
%s o 
%s o 
%s o 
%s o 
%s o 
%s o 
%s o 
%	s o 
%
s o 
%s o 
%s o 
%
s  o 
%s o 
%s o 
%s o 
%s o 
%s o 
%s o 
%s o 
%s! o 
%s% o 
%s) o 
%s- o 
%s1 o 
%s5 o 
%s9 o 
? *&(& 
**
* 0 H   s' 


~ %-&~
  s( 
% o) 
~ %-&~
  s( 
% o) 
~
 %-&~
  s( 
%
 o) 
~ %-&~
  s( 
% o) 
~ %-&~
  s( 
% o) 
~ %-&~
  s( 
% o) 
~ %-&~
  s( 
% o) 
~ %-&~
  s( 
% o) 
~ %-&~
  s( 
% o) 
~ %-&~
   s( 
% o) 
~ %-&~
 ! s( 
% o) 
	~ %-&~
 " s( 
% o) 
~ %-&~
 # s( 
% o) 

~ %-&~
 $ s( 
% o) 
~ %-&~
 % s( 
% o) 
*0 "    ~@  o* 
-sH 
z(p o+ 
*Z(n o/ {3 o
 
*.( @ *"(, 
*  0     (- 
o 
o 

o. 
*0     o/ 

o0 
*2(- 
od 
*"(1 
*s2 
*"(1 
*0 &       o 
o3 
o 
o 
o 
o4 
*           
*"(5 
*0 &       o 
o3 
o 
o 
o 
o4 
*           
*"(6 
*0 1       o 
o7 
o 
(8 
o9 
o 
o 
o: 
*       $     
*"(6 
*0 1       o 
o7 
o 
(8 
o9 
o 
o 
o: 
*       $     
*"(6 
*0 1       o 
o7 
o 
(8 
o9 
o 
o 
o: 
*       $     
*"(6 
*0 1       o 
o7 
o 
(8 
o9 
o 
o 
o: 
*       $     
*"(6 
*0 1       o 
o7 
o 
(8 
o9 
o 
o 
o: 
*       $     
*"(6 
*0 1       o 
o7 
o 
(8 
o9 
o 
o 
o: 
*       $     
*"(6 
*0 1       o 
o; 
o 
(8 
o9 
o 
o 
o< 
*       $     
*"(6 
*0 1       o 
o; 
o 
(8 
o9 
o 
o 
o< 
*       $     
*"(6 
*0 &       o 
o= 
o 
o 
o 
o> 
*           
*"(6 
*0 1       o 
o= 
o 
(8 
o9 
o 
o 
o> 
*       $     
*"(1 
*0 &       o 
o= 
o 
o 
o 
o> 
*           
*"(? 
*0 &       o 
o= 
o 
o 
o 
o> 
*           2t  ( *
*&(	 
**b(m o: o< oM	 
*
*  0     o> t" ( 
o7 
o< .rO p(	 
(m o: 
(m o: o< oR	 

o< oS	 
o 
+N(m oE 
o 
+!o 
X	%X
o@ 
oA 
Xo 
2( 
oU	 
o 
(B 
-*{A *"}A *{B *"}B *J(+ (- oa *{C *"}C *r(r  
(, (. (1 *   0     r{ po
 

(/ -"sZ 
%(  
. o 
(6 * (  +sC 

o8 
+/ok  
tz  ( -r psS 
z	oD 
oh  
-u  ,og  
	~ %-&~ ( sE 
% oF 
	(4 %&sZ 
%(  
. o 
(6  *     L <       7  %e  0 l   s 

(+ o; o 
o	 
oF	 
oG 

8  	oH 
os o~ ,(/ {1 ,(5   (+ oA (- (  
9   ou (G	 
0+(B 
,sou 	(B 
-
  
+(G	 
	Ys  
(G	 
.+
(B 
,(5 i  X(+ (- oB o~ ,(+ o9 (+ o 
(+ ( o o 
&   &,(5   &,	(5    &,(5    &,(5    &,(5 ݬ   &,
(5 ݖ   &,(5 ݁   &,(5 o&,
(5 \(+ ( (0 -(+ o	 
( ,(5 "	oh  
:
	,	og  
(5 **A     7     U          7     j          7               7               7               7               7               7               7               7       :   e     *   ,  V  
       sZ 
%. . o 
%. o 
(6 *0 P    sI 

s! 
o" 
o# 
o$ 
o% 
(& 
oJ 
r[ po 
(
 
o
 
*0 B    s) 
} s 
} (+ o  
{ * s# 
($ 
(8 *  0        (  
t+ (, (0 ,s(0 o (0 o! 
(+ o; o  
o 
(0 o o@ o 
(+ o; o  
o  
o  
,(+ o; o  
oK 
*{D *"}D *{E *"}E *{F *"}F *o 
. s9 
(; o 
. (= o 
(? *(r  
*{G *"}G *v(@ o 
. (C *(A *{H *"}H *{I *"}I *{J *"}J *{K *"}K * 0 G       o 
. (G o 
. (I o 
. (K o 
(M *(r  
*{L *"}L *v(N o 
. (Q *(O *{M *"}M *{N *"}N *o 
( 
s	 
(U o 
(W *(r  
*{O *"}O *No 
t" ([ *(r  
*{P *"}P *{Q *"}Q *(\ o 
. (_ o 
. (a *(] *{R *"}R *{S *"}S *{T *"}T *o 
( 
s9 
(e o 
. (g o 
(i *(r  
*{U *"}U *{V *"}V * 0 l       (j o 
u  ,Ao 
t  (  +~ %-&~ - sL 
% (  +(  +(o *o 
. (m *(k *{W *"}W *{X *"}X *{Y *"}Y *{Z *"}Z *0 I       o 
( 
s9 
(s o 
. (u o 
. (w o 
(y *(r  
*{[ *"}[ *v(z o 
. (} *({ *{\ *"}\ *{] *"}] *{^ *"}^ *{_ *"}_ *{` *"}` *   0 [       o 
( 
s9 
( o 
. ( o 
. ( o 
. ( o 
( *(r  
*{a *"}a *{b *"}b *   0 l       ( o 
u  ,Ao 
t  (  +~! %-&~  0 sL 
%! (  +(  +( *o 
. ( *( *{c *"}c *{d *"}d *o 
( 
s9 
( o 
( *(r  
*&( **
*
*(p o 
(q N (,  +s 
oM 
**( **
*  0 s   (n o0 -r} psS 
z(n o0 (q / (,  +o sZ 

(q / (7  +o 
s2	 
o 

+	ok  
C o3	 
	oh  
-	u  ,og  
~# %-&~" 3 s4	 
%# o5	 
o6	 
+m(7	 
( 
tz  0 (7  +	0 (  +

.
.+,( 
	( o 
+( 
	( o 
(8	 
-F og  
/ (m o4 
(T  +/ (h  +*    d !       z@    0    1 (-  +
sN 
o8 
+hok  
tz  2 (\ 2 (,  +2 (,  +	
(9 

	YsO 
sP 
oQ 
oh  
-u  

,
og  
1 (\ sR 

(n o0 	o o  
s z	oS 
9   	oT 
u^  ,9(z o; o	 
(] (n o+ (p 	oU 
(U +u	oT 
u" -
	oT 
ov  
sZ 
3 ( +?(p oV 
	oW 
oX 
sZ 
3 -r
 p+ov  
( *      u         e  0 D    sZ 

1 (\ (n o0 o 3 -r
 p+ov  
( *0    o+ o; o  
( h (W 
h (W h (W h (W 
(q 	oY 
-+(q h (Z (k {
 -|(m (q oY 
-+(q o 
. (q oY 
-    +(q o 
. (q oY 
-    +(q o 
. s* +(m     s+ o 
*
*
**&( **(m (q . (,  +s9 
(q . (,  +s9 
o	 
*
*0 E   (q . (,  +
(m o 
(m Ys9 
( 
o 
s`	 
(  +
	/r  psS 
z	o	 
(q . (W oY 
,(m o 
oZ 
*(m o 
o 
o 
-(s 
~  
o[ 
(m o 
o\ 
&(m o 
o 
o 
(q . (\ o 
(q . (\ o 
(q . (Z o 
(q . (\ o 
*   0 &     ( (w 
 (B 
-s  
(x *  0    o 9  (n o+ 
o (n o+ .(n o- oa (n o+ (n o- o^ (n o- o_ (n o/ op (n o+ o? (n o+ o; o  
s0 (l (y or t ( v o ( v (z o  
%  ov  
( v (z oJ (  
,~  
+(z oJ (] 
( v (p oF	 
(T  +v (z oM (T  +v (p o^ 
(T  +v (z o  
( v (z o	 
o_ 
(  
( o ,C(z o= -
v ( v (n o+ (p (k ( (h  +*(n o+ (n o- oa {0 *
*&( **(m (q . (,  +s9 
(q . (,  +s9 
o	 
*
*  0     (q . (,  +
(q . (,  +(q . (,  +(m s` 

	(m s9 
( 
o 
oa 
	(m s9 
( 
o 
ob 
	(m Ys9 
( 
o 
oc 
	od 
	oe 
*&( **
*  0     (q < (Y (@ 

(q < (Y (@ 
(q < (,  +(p oQ 
oR 

k"  B[k"  B[	(p od 
(e 
(c 
kZl(f 
i(g 
(h 
(d 
kZl(f 
i(g 
(i 
(m ( 	of 
&*Z(n o/ {3 og 
*N(m ( oM	 
*^(q < (,  +s9 
*&( **
*   0 (   U (m ( oh 

( ( ( *Z(n o/ {3 o	 
* 0 8     (q U (,  +
(q U (,  +s 
oi 
o 
*0     s4 
(q U (\ }$ {$ 9   (p o 
{$ o	 
/s( 5 s 
(  +,Y(p o	 
oa 
,Dob 
(p o	 

(p o 
(p o 
o	 
(p o 
	o	 
o 
o 
* 0    1  U (W 
(q oW 
,o 
(q o 
tz  (Q *U (W (q oW 
,1o 
(p o 
o 
(q o 
. o 
oj 
*N(m ( oM	 
*^(q U (,  +s9 
*&( **
*0 8    ( 
(p ok 
(p o 
(p o 
o 
( *Z(n o/ {3 o
 
* 0 (   \  (q _ (W o 
uz  
-*( *0 /    (p ( o 

(p (p o 
o 
o
 
*^(q _ (,  +s9 
*&( **
*0     (q % (\ 
(  
,*( (q % (.  +3>o7 
(q % (,  +.r p(  
sS 
z(m ( ol 
*3!(m ( 

(m 	oT	 
om 
*3(m ( on 
&*3(m ( oo 
&*3(m ( op 
&*rE psS 
zN(m ( oM	 
*^(q % (,  +s9 
*0     s6 
(m ( 
(m sq 
or 
os 
oT	 
ot 
( (q % (\ }% (p o 
{% o 

	/z( 7 s 
(  +,^(p o	 

o 
,Go 
(p o	 
(p o 
(p o 
o	 
(p o 
	o	 
o 
	ou 
*0     (q % (W o 
uz  
,o 
(z o? (p (L *% (W (q oW 
,B(q o 
  (B 
,'o 
(p o 
o 
( 
o! 
ov 
*fo+ o; o  
( **
* 0 A   sZ 

8  s8 (q (  
o 
tz  
	< (\ }& 	< (,  +(9 
(z oM 	
sw 
{& ox 
		-h{& (y 
}& ~e 9 s 
(  +-ro psS 
z{& (z 


o{ 

s  
	
o| 
	o} 
	jo 
(p 	o` 
oa 
ob 
(c 
ob 
(d 
(o  
s z	,	o~ 

,
o 
sZ 
. . o 
. . o 
. . o 
(e 
,S-(p oQ 
(z oM oR 
+r po^ 
of 
(g 
(h 
. o 
	< (\ o 
X(q o 
?> (m o4 
(T  +> (h  +*       m -e   m >    r" %r p%r pe *:(r  
( 
*{ 
*"} 
*~o: o< o> o 
o 
*b(	 
o: o< oM	 
*  *:(r  
( *{g *"}g *~o: o< o> oB o *b( o: o< oM	 
*:(r  
( 
*{ 
*"} 
*oF oH oJ oL o 
o 
*
*  *:(r  
( *{i *"}i *oF oH oJ oL oP o *
*:(r  
( 
*{ 
*"} 
*foT oV o 
o 
*(- 
(- 
o 
oT o 
o
 
*  *:(r  
( 
*{ 
*"} 
*~od of oh o 
o 
*  0    j (R
 
o@ 
o^	 
-*(R
 
od ok 

(R
 
on 
of o 
o| 
oY 
(R
 
oG 
o 
oH 
o 
(R
 
oG 
o 
oH 
o 
o	 
*  *:(r  
( 
*{ 
*"} 
*od of oh o 
ol o 
*b(U
 
od of (B *  *:(r  
( 
*{ 
*"} 
*0 A    oh t  (  + 
s 
(  +(  +
od of on o 
*b(^
 
od of (B *  *"o 
*:(r  
( 
*{ 
*"} 
*or ot ov ox o 
o 
*b(
 
or ot (B *  *:(r  
( 
*{ 
*"} 
*or ot ov ox o 
o| o 
*b(
 
or ot (B *  *:(r  
( 
*{ 
*"} 
*o o o o o o 
o 
*(
 
o o o o (C *  *:(r  
( 
*{ 
*"} 
*o o o o o o 
o o 
*(
 
o o o o (C *  *:(r  
( 
*{ 
*"} 
* 0 M    o t  (  + 
s 
(  +(  +
o o o o o o 
*(
 
o o o o (C *  *"o 
*:(r  
( 
*{ 
*"} 
*fo o o 
o 
*N(p	 
o oM	 
*  *   0 G       o@ 
o^	 
-*oY 
oG 
o 
oH 
o 
oG 
o 
oH 
o 
o	 
* 0 b   j o@ 
o^	 
-*ok 

on 
o 
o| 
oY 
oG 
o 
oH 
o 
oG 
o 
oH 
o 
o	 
*  0 {    o@ 
o^	 
-*ok 

on 
o 
o| 
o} 
o 
oi 
o 
oY 
oG 
oa 
oH 
o 
oG 
oc 
oH 
o 
o	 
* 0 _    o@ 
o^	 
-*o} 
o 
oi 
o 

oY 
oG 
oa 
oH 
o 
oG 
oc 
oH 
o 
o	 
* 0 G    o 

o	 
o 
o 
oI (J o	 
oF ( 
o 
&*Z,	oG `*oG f_*Ro 
(H o 
*(r  
*  * 0    b o 

o 
*>o 
o 
*(L *tz  (M o 
o 
o 
o=
 
*( 
*
*s 
*"o? 
*
*( 
*
*s 
*:( 
"   @Zi*"oA 
*
*( 
*
*s 
*"oB 
*
*( 
*
*s 
*"oC 
*
*( 
*@*s 
*"oD 
*
*( 
*    *s 
*"oG 
*
*( 
*    *s 
*"oH 
**( 
**s 
*"oE 
*
*( 
* *s 
*"oF 
*
*( 
*    *s 
*&o 
*
*(T *    *Ntz  (O o%
 
*s 
*&o 
**(T *    *s 
*&o 
*	*(T *    *s 
*&o 
*
*(T *    *s 
*&o 
**(T *     *s 
*"oI 
**( 
*  @  *s 
*"oJ 
**( 
*    *s 
*"oM 
**( 
*    *2tz  (S *s 
*"oK 
**( 
*    *2tz  (  *s 
*"oL 
**( 
*0 G    o 

o	 
o	 
o 
o ( o	 
o ( 
o 
&*Z,	o `*o f_*Ro 
( o	 
*(r  
*  * 0    b o 

o 
*( *( 
*( 
*2. ( *( 
*0     tz  
s 
r po 
 o 
r po 
. o
 
r po 
. o 
r po 
. o 
r po 
( 
o 
r po 
( 
o	 
*( 
*
*"o) 
*
*( 
*@*"o* 
*	*( 
*@*"o+ 
*
*( 
*
*"o, 
*
*( 
* *"o- 
*
*( * *"o. 
*
*( 
*
*"o/ 
*
*( 
*
*"o1 
*
*( 
**"o0 
*
*( 
*    *"o2 
*
*( 
*    *"o3 
**( 
*    *"o4 
**( 
*    *"o5 
*
*( 
*    *"o6 
**( 
*    *"o7 
**( 
*     *"o8 
**( 
*  @  *"o9 
**( 
*    *"o: 
**( 
*    *"o; 
**( 
*    *6tz  (O *>o%
 
o 
**( 
*    *"o> 
**( 
*    *"o? 
**( *    *"o@ 
**( *    *"oA 
**( *     *"oB 
**( *   @ *"o= 
**( 
*    *"o< 
**( 
*    *"oC 
**( 
*&(	 
* 0 k    o> uz  (G 
(m o: ok 
o: o< ( 
(m oG 
oH 

	o< (I 
	o 
( 
( 
,*Z(n o/ {3 o 
*b(m o: o< oM	 
*&(: **
*0 *    o 
o 

o 
-o 
&o 
o 
*&(: **
* 0 g    o 

o 
,Vo 
o 
o 
o 
o 
o 
,"o
	 
o	 
o	 
s	 
o 
&o 
o 
*&( **
*0    (  

8  (q (  
o 
tz  
	< (,  +(9 
(m oq	 
oS	 
o 
(m oE 
o 
	< (Y (@ 
	< (Y (@ 
	< (,  +	(m oR	 

(p oW	 
(m 
oS	 
o 

oU	 
o 

oS	 
o 
(X	 
XoY	 
(p oQ 
	oR 
(p od 
(e 
(c 
d( 
(g 
(h 
(d 
d( 
(g 
(i 
u ,(m of 
&+f(m sW 


oX 
oY 
oZ 

oX 
o[ 
(m 
o	 
oj 
(d 
ok 
oj 
(c 
ol 
X(q o 
?(*Z(n o/ {3 og 
*   0 Q    
+=(q  (  
o 
tz  (m < (,  +s9 
oM	 
-*X
(q o 
2*:( 
(O *{t *"}t *"(M *{u *"}u *{v *"}v *{w *"}w *{x *"}x *{y *"}y *{z *"}z *( 
o^ od of oi oj ol *0        (N o 3S(N o (R (Q 9   (Q ( 
(Q oo 
(Q ot 
(N o (U 8   (N o .v(b (R (` o_ (Q o 
(Q r
 po 
(Q o 
o 
o< 
(Q o= 
(Q o 
(N o o" o 
(Q ,(Q ( 
*6(Q o 
*0 7    (N o 
(N o ( 
o 
o 
-_**s 
*  0 G   oa 
r po 
o 
#      Y@( 
o 
(N o 
o
 
(N o 
o 
 
o
 
oo 
o{ 
,a(N o o{ 
,oo 
(N o1 o os 
+oo 
(N o o 
oo 
ot 
(N o (U ot 
o{ 
,a(N o o{ 
,ot 
(N o1 o ox 
+ot 
(N o o 
oo 
ot 
(N o (U (N o o
 
*2(N s} *zoc (V o< 
(U o= 
*2(N sy *zoe (T o< 
(S o= 
*6o< 
o= 
*2(N s *(N o ,oh (X (W og *(N o&  
oq 
o  +(Z o< 
(Y o= 
*2(N s *zok (\ o< 
([ o= 
* 0        (
 
r p(@ 
(N o
 
o
 
(N (
 
(N o .(N o 3r! p(@ 
(N o o" .(N o o" 3(Q ,(Q rM p(@ 
**
*"(P *   0     (N o 3(N o (R 8   (N o .z(b (R (Q (N o o 
( 

( 
o< 
(Q o= 
o< 
o= 
o< 
o= 
(Q o 
(N o o" o 
(Q ,(Q ( 
*   0     (N sy 
#      Y@( 
o> 
( 
#      Y@( 
o 
#      Y@( 
o> 
ri p(@ 
o< 
o= 
( 
    (b 
o 
#      Y@( 
o> 
r{ p(@ 
o< 
o= 
( 

	#      Y@( 
o> 
( 
o< 
o= 
	o< 
o= 
o< 
	o= 
*  0 J    (N o ,<(N s 
( 
( 
o< 
o= 
o< 
o= 
o< 
o= 
***  0 T       r p(@ 
(N o
 
o
 
(N (
 
(
 
r pru po
 
(
 
r pru po
 
*R*
*"(M *J( 
r po 
**
*"(M *{{ *"}{ *{| *"}| *{} *"}} *{~ *"}~ *{ *"} *{ *"} *{ *"} *b( 
r po 
( * 0 5      (N o' 
,*( 
( (~ r po 
( 
( o ( ( r po 
(    ( r; p(  
o	
 
( o< 
( o= 
o ( o ( o ( o ( ( o< 
( o= 
( o< 
( o= 
( o< 
( o= 
( o< 
( o= 
(~ o< 
( o= 
o< 
(~ o= 
*   0        (
 
(N o' 
:   ( r pr8& po ( r prd& po ( r pr& po ( r- pr& po (    ( o

 
rE p(@ 
(~ re p(@ 
( r p(@ 
(N o o ( o
 
*s
 
*s
 
*   0 Q       o 
o 
(N o (N o  
oz 
o  
r p(@ 
o

 
r po 
o 
**
*"(M *{ *"} *>(N o' 
*>(N o' 
*b( 
r3 po 
o * 0     o 9   ( 

r; po 
o< 
o= 
o ,ks ( ( o> 
( (N o o6 o
 
( (N s
 
o
 
( o
 
o
 
o< 
( o= 
*(
 
( ,( (N o o o
 
rC p(@ 
**
*"(
 
*"(
 
*{ *"} *
*s *J(
 
rS p(@ 
*"(M *{ *"} *:(
 
( * 0 W    ( 
o ( ( ri po 
( u 
,3o
 
o< 
( o= 
( ( *s
 
*v(
 
( (N o o
 
*0 T       ( 
o 
o	 
o
 
o
 
o
 
(N o 
o
 
( o> 
o
 
ru po
 
*R(r  
o ( *s< *{ *"} *"o 
*"o 
***{ *"} *F( o&  
t *n{ -( } { *n{ -o } { *6( 
( 
 
*:(!
 
("
 
*:(#
 
o * *; *
*  0     s$
 

o ,o%
 
o&
 
*  0 $     o'
 

+u@  ,u@  *o'
 

-*0 0     ( o o7 .	( 
+( 

r p(  
*oX 
*>,-*o(
 
*o)
 
*2~*
 
o#
 
*"( *(+
 
*{ *"} *:(,
 
} *  0 u    { -fs-
 

( o.
 
( o.
 
( o.
 
( o.
 
( o.
 
( o.
 
( o.
 
o/
 
} { *   0 E    { -6s0
 

( o1
 
() o1
 
(5 o1
 
o2
 
} { *   0     (  +
o| 
( o4
 
*n{ -( } { *n{ -( } { *  0 q    (  +
(  +o} 
o6
 
(  +o} 
o6
 
(  +
o} 
	o6
 
(  +o} 
o6
 
(  +o} 
o6
 
*   0 o    (  +
o| 
( o4
 
o| 
( o4
 
o| 
( o4
 
o| 
( o4
 
o| 
( o4
 
o| 
( o4
 
*n{ -( } { *n{ -( } { *n{ -( } { *n{ -( } { *n{ -( } { *n{ -( } { *n{ -( } { * 0 /    (  +
(  +o} 
o6
 
(  +o} 
o6
 
* 0 C    (  +
(  +o} 
o6
 
(  +o} 
o6
 
(  +
o} 
	o6
 
* 0 f   (  +
(  +( ,
( o' 
-o o} 
o6
 
(  +( ,
( o' 
-o o} 
o6
 
(  +
o} 
	o6
 
(  +o} 
o6
 
(  +o o} 
o6
 
(  +o} 
o6
 
(  +o} 
o6
 
(  +o} 
o6
 
(  +	o} 
	o6
 
(  +
o} 

o6
 
(  +o} 
o6
 
(  +o} 
o6
 
(  +
o} 

o6
 
( +o} 
o6
 
*  0    ( +
( +o} 
o6
 
( +o} 
o6
 
( +
o} 
	o6
 
( +o} 
o6
 
( +o} 
o6
 
( +o} 
o6
 
(	 +o} 
o6
 
(
 +o} 
o6
 
( +	o} 
	o6
 
( +
o} 

o6
 
(
 +o o} 
o6
 
( +o} 
o6
 
*  0     ( +
( +o} 
o6
 
*0 B    ( +
( +o} 
o6
 
( +o} 
o6
 
( +
o} 
	o6
 
*  0     ( +
o| 
( o4
 
o| 
( o4
 
o| 
( o4
 
o| 
( o4
 
o| 
( o4
 
o| 
( o4
 
o| 
( o4
 
*n{ -( } { *n{ -( } { *n{ -( } { *n{ -( } { *n{ -( } { *n{ -( } { *n{ -( } { *n{ -( } { *0     ( +
( +o} 
o6
 
*   0 #    ( +
( +o o} 
o6
 
* 0     ( +
( +o} 
o6
 
*   0 1    ( +
( +o} 
o6
 
( +o} 
o6
 
*   0 [    ( +
(  +o} 
o6
 
(! +o} 
o6
 
(" +
o} 
	o6
 
(# +o} 
o6
 
* 0     ($ +
(% +o} 
o6
 
*   0     (& +
(' +o} 
o6
 
*   0 +    (( +
o| 
( o4
 
o| 
( o4
 
*n{ -( } { *n{ -( } { *n{ -( } { * 0     () +
(* +o o} 
o6
 
(+ +o o} 
o6
 
(, +
	o o} 
	o6
 
(- +o o} 
o6
 
(. +o o} 
o6
 
*   0     (/ +
(0 +o} 
o6
 
*   0 +    (1 +
o| 
( o4
 
o| 
( o4
 
*n{ -( } { *n{ -( } { *n{ -( } { * 0 K    (2 +
(3 +o} 
o6
 
(4 +o} 
o6
 
(5 +
	o o} 
	o6
 
* 0 Q    (6 +
(7 +o o} 
o6
 
(8 +o o} 
o6
 
(9 +
o} 
	o6
 
*   0 M    (: +
o| 
( o4
 
o| 
( o4
 
o| 
( o4
 
o| 
( o4
 
*n{ -(  } { *n{ -( } { *n{ -( } { *n{ -( } { *n{ -(	 } { *   0 7    (; +
(< +o o} 
o6
 
(= +o} 
o6
 
* 0 [    (> +
(? +o} 
o6
 
(@ +o} 
o6
 
(A +
o} 
	o6
 
(B +o} 
o6
 
* 0 [    (C +
(D +o} 
o6
 
(E +o} 
o6
 
(F +
o} 
	o6
 
(G +o} 
o6
 
* 0     (H +
(I +o} 
o6
 
*   0 <     (J +
o| 
( o4
 
o| 
(
 o4
 
o| 
( o4
 
*n{ -(
 } { *n{ -( } { *n{ -( } { *n{ -( } { *0 1    (K +
(L +o} 
o6
 
(M +o} 
o6
 
*   0 F    (N +
(O +( ,( o o; o 
+o7
 
o} 
o6
 
*  0     (P +
(Q +o} 
o6
 
*( *   0 G       { -8(R +} { o~ 
( o8
 
{ o~ 
( o8
 
{ * 0 <    (S +
o| 
( o4
 
o| 
( o4
 
o| 
( o4
 
*n{ -( } { *n{ -( } { *n{ -( } { *n{ -( } { *0     (T +
(U +o} 
o6
 
(V +o} 
o6
 
(W +
o} 
	o6
 
(X +o} 
o6
 
(Y +o} 
o6
 
(Z +o} 
o6
 
*   0     ([ +
(\ +o} 
o6
 
*0     (] +
(^ +( ,
( o' 
-o o} 
o6
 
(_ +( ,
( o' 
-o o} 
o6
 
(` +
o} 
	o6
 
(a +o o} 
o6
 
(b +o} 
o6
 
*0 ^    (c +
o| 
( o4
 
o| 
( o4
 
o| 
(  o4
 
o| 
(! o4
 
o| 
(" o4
 
*n{ -( } { *n{ -(# } { *n{ -($ } { *n{ -(% } { *n{ -(& } { *n{ -(' } { *  0 K   	 (d +
(e +o o} 
o6
 
(f +o} 
o6
 
(g +
o} 
	o6
 
* 0 w   
 (h +
(i +o o} 
o6
 
(j +o} 
o6
 
(k +
o} 
	o6
 
(l +o} 
o6
 
(m +o} 
o6
 
* 0 1    (n +
(o +o} 
o6
 
(p +o} 
o6
 
*   0 #    (q +
(r +o o} 
o6
 
* 0    
 (s +
(t +o} 
o6
 
(u +o} 
o6
 
(v +
o} 
	o6
 
(w +o} 
o6
 
(x +o} 
o6
 
(y +o} 
o6
 
(z +o} 
o6
 
({ +o} 
o6
 
(| +	o} 
	o6
 
(} +
o} 

o6
 
*() *{ -"(~ +} { o~ 
(+ o8
 
{ *0 M    ( +
o| 
(, o4
 
o| 
(. o4
 
o| 
(0 o4
 
o| 
(2 o4
 
*n{ -(* } { *n{ -(- } { *   0 c    ( +
o} 
( +o6
 
o} 
( +o6
 
o} 
( +o6
 
o} 
( +o6
 
o} 
( +o6
 
*n{ -(/ } { * 0 +    ( +
o} 
( +o6
 
o} 
( +o6
 
*n{ -(1 } { * 0 +    ( +
o} 
( +o6
 
o} 
( +o6
 
*n{ -(3 } { * 0     ( +
o} 
( +o6
 
*(5 *{ -"( +} { o~ 
(7 o8
 
{ *   0 +    ( +
o| 
(8 o4
 
o| 
(: o4
 
*n{ -(6 } { *n{ -(9 } { * 0 <    ( +
o} 
( +o6
 
o} 
( +o6
 
o} 
( +o6
 
*n{ -(; } { *0 t    ( +
( +o o} 
o6
 
( +o o} 
o6
 
( +
	o o} 
	o6
 
( +o o} 
o6
 
*:(r  
(> *{L
 *"}L
 *{K
 -s| 
}K
 (= {K
 (9
 
&{K
 *R(= r pob 
*>(B (  
*2r p(O *F(? r po:
 
*2r p(P *>(F (  
*2r p(O *>(H (  
*2r p(O *>(J (  
*2r p(O *>(L (  
*2r p(O *>(N (  
*2r p(O *Jr p(  
(P *(? o:
 
-*(? o;
 
t" *{R
 *:(r  
}R
 *0    s@ 
}( ~  
r ps(	 
{( o&	 
,G{( o<
 
o=
 
r# po>
 
o?
 
( 
s, 

(Q 	ob 3  	,	og  
{( (@
 
-[(i 
oA
 
oB
 
sC
 
r
 poD
 
(E
 
oB
 
oF
 
{( (G
 
oH
 
oI
 
oJ
 
}( ~e A s 
(  +-ro psS 
z{( (z 
o{ 
(T TJ-0o| 
s  
		o} 
	jo 
(Q 	ob B&T<

o  

oK
 
,

oK
 
o  
T,o~ 
,o 
*  4   W i 
       yZ    y`%e        0 +    
oL
 
(U -
,oM
 
(V -
*
*
*   0     sN
 

sO
 
sP
 
oQ
 
-
_+;(R
 
(S
 
oT
 
,--oU
 
X   2( 

,og  
	*     dw 
    6{g
 oV
 
*N  ( 
  *R    ( 
*( 
{g
 ~* %-&~) D sW
 
%* ( +( +(  
*JsX
 
}g
 (Y
 
*  0 ,    ,' ŝ
+o@ 
a  Z
Xo7 
2*(r  
*{k
 (  
o; {j
 {k
 (  
o\ o
 
*(r  
*{m
 {o
 (  
o; {l
 {m
 {n
 o 
*(r  
*(r  
*{r
 (  
o; {p
 {q
 o 
*(r  
*^{s
 o 
o 
s 
*(r  
*   0 0    {t
 {u
 ( o: s7 
{u
 ( oB *(r  
*^o 
{v
 o 
(  
*(r  
*^o3 
{w
 o3 
(  
*.so x
 *(r  
*oZ
 
*o[
 
*Jo9 o 
*Jo9 o 
*Jo9 o 
*Jo9 o 
*Jo9 o 
*Jo9 o 
*Jo9 o 
*Jo9 o 
*Jo9 o! *Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*^o: o 
o 
*^o: o 
o 
*^o: o 
o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*Jo: o 
*.s {
 *(r  
*o *.s }
 *(r  
*s 
*.s 
 *(r  
*s\
 
*.s]
 
^
 
*(r  
*.( +  *.s 
 *(r  
*r
 po 
o 
o 
r
 po 
*zr' po 
o 
r
 po 
*(r  
*zr po 
{
 o 
o 
&*.s 
 *(r  
*2rݙ po 
*.s 
 *(r  
*r po 
r
 po 
o 
o 
*zrݩ po 
r
 po 
o 
*zr po 
r
 po 
o 
*zr po 
r
 po 
o 
*r7 po 
r
 po 
r- po 
o 
*(r  
*z{
 o_
 
{
 . o`
 
*.s 
 *(r  
*r] po 
r
 po 
o 
o 
*rq po 
r
 po 
o 
o 
*r po 
r
 po 
o 
o 
*r] po 
r
 po 
o 
o 
*zr po 
r
 po 
o 
*r] po 
r
 po 
o 
o 
*r] po 
r
 po 
o 
o 
*zr˸ po 
r
 po 
o 
*zr po 
r
 po 
o 
*   0 C       re po 
r
 po 
o 
r po 
o 
o 
oa
 
ob
 
*r po 
r
 po 
o 
oa
 
ob
 
r po 
*(r  
*B( 
{ 
*(r  
*6{
 (k *6{
 (n *6{
 (k *.s 
 *(r  
*( *btz  ( tz  ( Y*(r  
*(r  
*{
 { {
 {	 {
 ( *.s 
 *(r  
*(q *2o 
o 
*(u *ot 
*ov 
*( *(r  
*{
 {
 ( 
o 
( 
,{
 {
 ( 
o 
( 
**(r  
*0     
u ,u oS 

u ,%u o] 
o 
-o] 
t o% 

,D{
 oc
 
{
 oQ 
od
 
oe
 
{
 oa 
. oa 
. o 
*(r  
*z  o3 
o4 
{f
 
o4 
*.s 
 *(r  
*s
 
*s

 
*(r  
*^o 
{
 s9 
( 
*.s 
 *(r  
*s *s *sF *s5 *s3 *s7 *sD *s9 *s1 *(r  
*{
 {
 {
 { {
 { ( *(r  
*Jo 
{
 (  
*(r  
*f{
 {
 {
 ( *(r  
*Jo 
{
 (  
*Jo 
{
 (  
*(r  
*Jo 
{
 (  
*Jo 
{
 (  
*Jo 
{
 (  
*(r  
*Joc 
{
 (  
*Joc 
{
 (  
*(r  
*Joc 
{
 (  
*Joc 
{
 (  
*Jo 
{
 (  
*(r  
*J{
 o- ( *v{
 o- {
 { ( *6{
 ( *.s 
 *(r  
*( *(r  
*^oT {
 o) 
(  
*^oT {
 o) 
(  
*(r  
*Jog
 
{
 (  
*Jog
 
{
 (  
*(r  
*Jo 
{
 (  
*Jo 
{
 (  
*(r  
*Jo 
{
 (  
*Jo 
{
 (  
*Joc 
{
 (  
*Jo 
{
 (  
*(r  
*B( 
{
 *.s/ 
 *(r  
*"( 
*"( 
*
*"( 
*"( 
*.s6 
 *(r  
*
*
*j( 
( 
( 
( 
Y*"(.	 
*"(-	 
*(r  
*N(.	 
{
 *f(r  
}h
 
(i
 
}j
 
*  0    
  {h
 

.3
 (k
 
*          0     {h
 
,.t
ݚ   }h
 
{E	 
oq u (-  +o8 
}l
 
}h
 
+A{l
 
ok  
t  
( +	  o9 }m
 
}h
 

-}h
 
{l
 
oh  
-(k
 
}l
 

(n
 
*             0     }h
 
{l
 
u  
,og  
*{m
 
*so
 
z2{m
 
  *   0 7    {h
 
3{j
 
(i
 
3}h
 

+sD	 

{E	 
}E	 
*(p
 
*.sH 
 *(r  
*s *s *s *s *s *s *s *s *s *s *s *s *s *s *s *s *s *s *.s\ 
 *(r  
*s) *s, *s/ *(r  
*>o4 
{
 *(r  
*"}
 *.se 
 *(r  
*s *s *s *.sj 
 *(r  
*s *s *s *s *s *.sq 
 *(r  
*s *s *(r  
*Jo 
{
 (  
*(r  
*Jo 
{
 (  
*.sy 
 *(r  
*s *s' *s* *s *s *s *s *s *s! *s$ *.s 
 *(r  
*sC *sF *sL *s^ *s[ *sa *sX *sI *sO *sR *sU *.s 
 *(r  
*sx *s{ *s~ *s *s *s *(r  
*f{
 {
 {
 ( *(r  
*f{
 {
 {
 ( *.s 
 *(r  
*Js 
s 
s7 *2r{ pom 
*oT *(r  
*Jo 
{
 (  
*Joc 
{
 (  
*Jo 
{
 (  
*(r  
*{
 *(r  
*{
 *(r  
*{
 *(r  
*J{
 o- ( *v{
 o- {
 { ( *6{
 ( *.s 
 *(r  
*  0     s 
sZ 
sb s0 }
 . (  s	 
(  +o 
. (  s
 
(  +o 
. (  s 
(  +o 
. {
 o2 o 
s! 
o" 
o# 
(& 
*.s 
 *(r  
*  0 a   .  s 

( ok 
&( ok 
&( ok 
&( ok 
&( ok 
&( ok 
&( ok 
&ov  
*(r  
*Joc 
{
 (  
*(r  
*Jo 
{  (  
*"(q
 
*ro 
o' 
o 
o> 
s 
*o 
o 
o' 
o 
o 
o 
o 
s 
*   0 5    o 
o 

(r
 
os
 
o 
o 
o 
o' 
o	 
*   0 R    o 
o 

o 
(r
 
os
 
o 
(r
 
ot
 
o	 
o 
( 
o 
&o
 
*>( ( *{ *"} * 0 t       -r p. (	 
~u
 
(x 
,r p  (	 
( ( ( o@ 
oK o 
( ( oG s o 
*0 K       ( o: o: o< ( 
( 
( ou 
( 
-o< +o< YoM	 
*.s  *(r  
*s *s *"(v
 
*0 ,     (w
 
o 
s 
o 
o 
o 

ox
 
*"(y
 
*"oz
 
*"({
 
*"o|
 
*.s  *(r  
*s *s *>( ( *{ *"} *   0    ! ,>( o 
s 
o}
 
o 
o 

( o7 
oE o~
 
*( o 
s 
o 
o 
o 
tm ( o7 
oE o~
 
*>( ( *{ *"} *   0    ! ,>( o 
s 
o}
 
o 
o 

( o9 
o o
 
*( o 
s 
o 
o 
o 
tm ( o9 
o o
 
*"(
 
*"o, 
*"(
 
*"o) 
*"(
 
*"o- 
*"(
 
*"o( 
*"(
 
*"o3 
*"(
 
*"o5 
*"(
 
*"o4 
*"(
 
*"o2 
*"(
 
*"o. 
*"(
 
*"o0 
*(
 
*"(
 
*"o' 
*"(
 
*"o* 
*"(
 
*"o+ 
*"(
 
*"o1 
*"(v
 
*   0 X   " ,$(w
 
o 
s 
o}
 
o 
o 

+"(w
 
o 
s 
o 
o 
o 

o
 
o
 
*.s  *(r  
*s *s *s *s *s *s *s *s *s *s *s *s *s *s *"(
 
*Fo 
o 
o  
* 0 m   # o 
o 

o	 
o 
o 
o  
o o	 
o
 
o
 
o 
o
 
o
 
o
 
o 
( 
o 
&o	 
*(
 
*>( ( *{	 *"}	 *  0    $ -r p. (	 
~u
 
(x 
,r p  (	 
( oq	 

oS	 
oT	 
+!( oG 
oH 
( (I 
oU	 
oT	 
( 
-*n( o 
o o	 
*   0 K       ( o: o: o< ( 
( 
( ou 
( 
-o< +o< YoM	 
*.s 
 *(r  
*s *s *s" *s *s *s *s *s
 *s *s *s *s *s *s
 *s *.s'  *(r  
*^(
 
os os o
 
*(r  
*v{ { (/ {3 s7 *.s,  *(r  
**.s/   *(r  
**.s2 " *(r  
*( 
t" ( 
( 
t" ( 
Y*(r  
*Jo 
{$ (  
*(r  
*Joc 
{% (  
*(r  
*J{& o 
ob 
*{' *"}' *:(
 
(; * 0 
       ( + ( + ( + ( + ( + ( + ( + ( + ( + ( + ( + ( + ( + ( + ( + ( +  ( +r# p  ( + ( + ( + ( + ( +  ( +rɭ p  ( +r! p ( +r p ( + ( + ( +  ( + ( + ( + %> s
 
( + %? s
 
( + ( +r p ( + ( +~, %-&~+ G s
 
%, ( +*"o
 
*  0        (: o o{ 
o
 
o
 
o| 
ot 
ou 
oy 
oz 
(: o
 
ox 
ov 
r po 
on 
oo 
on 
 ,  (b 
op 
on 
oq 
on 
or 
*(r  
*J{( o 
ob 
*.sC ) *(r  
*oX *.sF + *(r  
*s
 
*BSJB         v4.0.30319     l   k #~  (l V #Strings       #US     #GUID    x  #Blob        W+	   3        I  ,  G  
  O   
    3     $          	    o           
   +   u   H     !            x  .    .  #  .    ;  6          \    8  K    0     0    0    0  ^  0  w  0    0    ]        ]    0  =  . 
   4%  
 j  4%         +     ,  -     A  .     I  ;  @  ;  `  ;          (  v  d ]    D  :    O   ^         %   u.   &    b   "    |   E"     +   L2 +   ʬ +   ' +     +   } +   R +    ,  F  v    v    $  Y  ?      
   4%   ^ ,  p  v  @ +       e       $   ,  T +    D    v   +     +      + ǁ  x   ̃ +    +    +    +   	 +   & +   a  v  `  v  [  v  HK v    v   +   2   
 E 4%   ֦  P     +    P   h P      [      +   'J &      =     D  "  
 e 4%         "      D  %      +  
 W   1 E9   B  +       J +   + +   k +    +    +   i +   @ +      &    & f      ?   F`   b     +     +   D   v  D  |  +   J ,    +   S +    ǁ    D    v  %  v  t  v  [  v 
   4%  
   4%   A  v 
   4%     v    v    v    v    +   K  v  e +   + +   d    +    +    +     +    +   \ +   /  +    +   G +   &L +         +     
       +        +   . +    +    , 
 .  4%   yH ,   ,        +   ՟   g    N +        )  +   JR +   G +   ^ ?    +   : ,  ] +    +    +   t +    +    +   * +    +    +       [  +   p0 +   4 +     	      U  D  = +   W  +   % +    ,    +   y +   ; +    +     +   n +  * 4   H ,      2   ).   `    J    y  f   &K   }      K   #   J   L        5    ;                 0   _3   =  +   H ,   ,  8  +   ] +   ) +   |  +   #  +    +    +   q +          ,  G  0-  a   7 	  "  	  =  	  ~( 	  / 	  E 	  DI 	  F 	  8  	   	   	  1  	    	    	  B= 	    	    	    	  m. 	  < +    +   ,D +   Z +   H> +    +      < +    +   	 +   C        +    +    +     , 
 #  
     +   z4 +    +     
      +  
 	       BX  +   K  +    %   ] +   B +     +  & 9   & q    b +    +    +       iL +         +    	 &  %  & I %  & %  	 &  	 & 3 %  & I+ 	  BJ  w      a  +   Z 	   	   	 &   	 & )  	     3Y  	    	   	  X* 	  ) 	   	  K 	  h$  ?  &  %  & I 	 & 7  	  _ 	  'I 	 & Z      	    	    	          "  	    	     ) 	    	  ?      +        [  	  
+ 	  + 	  2 	  l 	  S 	  T 	  R 	  3 	  I 	  0 	  i  	 * D   m  	  8 	     M 	  1  	  J 	  J 	  pI 	 & ҭ %    	  1 	  # 	  =  	    	  N 	   	   	  	 	  e 	   	  ء  	  8 	   	  A 	   	  3 	  +J 	    	    	  b  	  G 	  ^I 	  w  +        ,  I 	  P  	  W 	   	   	 & 5 2    	  n 	 {       	  5 	   	      .   +   , 	    	   	   	   	  I 	  . I    U        .  zJ 	  O  	    	    	  +' 	  h  	   	    	  Y 	  S 	  ; %   ; D  5   . S,  g S,     u  	  ߹ 	  ' D  J    ] 	   	    	  D 	    	  ,  	    	    	  l  	  y +   c2 +   
   H D  K  D    %
  XM ?   2 ?     ?   ]$  ?   D  ?   5
 ?   B ?     	    ?   ] ?   I ?  2 
F ǁ 2  ǁ 2  ǁ *    2 4 ǁ 
     2 |E ǁ *  ` s   k  D    D  L  +   b  	  A] D  p  D  h    0   2      +_ ,  v  	         	      9 	   	  B 	    	         	 &  2     	 & ?`   t; D  /  D  74   b#   U   r J  #   & _ ,  >     	    	    	 &  2     	  < 	   	  y  	    +  
   4%    , 
  4%   " +   X ,  ^ _`  "  
 * 4%   5/  ,    
 8  4%   s , 
  +   T`   K=  & ~  %  & S %   f +   4  +       _       ء    B 0   ,  w    ɖ N-  <-  N-   N-  !-  N-   ?   S      +   2 +   7 ,   ,    +    D   ,  K    ,  4 v  /      +   `    ,     <  . \  [  +0   ȇ  6 a!   &  D   D   ,  < D  m D &   	        *g     ,      ,   D 
 %2 4%    ,  <   c=      "  &    d D   ,  ۇ ,  d ,   , 
 G1 4%  
   4%     & h - & ,  -   +   &     +   J ,  5" ,  w +   x +     +   j  +    +   Z  +     +   3 +   72 +    +    +   ~ +   ܤ  +     +       f   5 +   "      .   [  (  +   ' +   ʠ   +a &     , 	e         c  3 	 &       	  F 	  E 	  E 	  :F 	  OE 	  _E 	  nF 	   	  " 	 & k %  & N %    	 & 
  %  & d"  %   s 	  /  	 &    M 	  L  	 & V v%  & U v%   ­ 	 &   2  & A 2  &   2   1 	   	 & K  2    	  h4 	  !  +      * +     +   {  +    +     +  
 15   U +   1  +  
     "   $ +  
   4%    .  >        +   0$ +    +   ΍  +    +     +     	  + +   ]  
 K  
      +   1 +   q> +  
     E +   1E +   ( +  
    
 4  
 1   W  +     +    +   0 +     +  & ,     .  +     +  
       +    +   f  %    +   X  +     +   3 +   C +    +     +   # +   p$ +   U. +   p. +   2  +   $ +   $ +   2 +     +   : +  & 0  %  & 	 	 &  	  2 	  `4 	 & o  %   1 	  0 	  2 	    	    	  	 	    	  t  	  ( 	  v 	  F 	  P  	   	 &   v%  & V  v%  & >  v%  & q %  & K %  & 1 v%     	    	  . S,  1 	  .1 	   1 	  Z1 	  Ǆ    3 	  3 	  U  	   	  +  	    	  O. 	   	  _   I 	  C   * xE  * "F  * *   * D  * &E  * GE   E 	  E 	  :g   cK   G  	  y  	 &   2  & D
 2  & Q %  &   %  & @ %  &   %   1 	  g 	  4 	    	    	   	   	  k  	    	  f 	  :   U  	   	  <7 	  P  	  >  	   	   	  M  	 g       	   	   	    	  fc 	  c 	  c 	  b 	  !b 	  a 	  a 	  a 	    	    	    	  X  	  G 	    	  ʓ  	   ?   <    	  ?  	     i    ɋ  P   b  	  Ͽ  	  9  	   	  1 	 & R     & Ѹ  %   (@          	  2 P  & p  2   / P   H  S,  N  P   = 	  M   s3     H 0    0  ;    	  Y 	   	  ; 	    	    +    +   E +     ?   9   0  G"    	  p  	 &      ?   # ?   ʼ ?  2   ǁ 2   ǁ 2 _ ǁ 2 A ǁ 2 2 ǁ  :  2 9   ^ v 
 p! +  2 :  ǁ  e D            e    & S  ӥ  F 	  ׈          ©  &   	  x ,  -  ,  <  	  Z  	  j 	  6J 	  J 	  JH 	  J 	    	      0     J & z I      * 	  F 	  ,i 	  Zh 	  vz 	  ۀ 	   	  l 	  Lk 	  w 	  ^s 	  Yx 	  \w 	  x 	  ' 	  r 	  n 	  4k 	  ~ 	     ! +  
   4%  
 w1 4%   K  +   M +   h6 +    ,  f ,    +   L. +   4 +    , 
 { 4%    ,    +     I  3 I  [ I    I  h   & ֌ # & w  %  &  #  I ,  N     	  <  +    +   U  +   ~ +    +   " +    +   Z +   ҹ  +      "                  q     i      q                 AK        ؄       !           	 #       #   v     #     P #   p   P -   8g   D 7   'b   H ?   7a   L H   ea   L O   Rb   L V   a   L ]   a   L d   	a   L k   a   L r   `k   L y   z   H    #{   L    y   L    9|   L    lz   L    )y   L    ~{   L    z   L    y   L    {   L    +n   H    \   H    F}   H    ~   H    m   H    s\   H    g   H    ~   H    0w   <   v   <   w   H   i   L   Mh   L !  qh   L '  h   L -  h   L 3  h   L 9  i   L ?  %i   L E  Ii   L K  mi   L Q  Om   H W  m   H `  l   H g  .m   H n  u   H u  s   H ~  6s   H   u   H   u   <   D  q             q h     Yh   ye  ah   f  aj    el    l   ը  l "     y 9     F  x2    U     a  '    r  N   {  G           &            A            q   	      
       $  X    4      G    ` K    ` N   q  Q  m   < \  o   < c  p   < j  Xp   < q  pw   @ x  ]   @   7r   @   w   X   x   X   8p   <      T      T   w   T   l   T   l   T   k   T   #`   \   U`   D   Nv   D   ^q   P   v   H   
o   L   1o   L   Uo   L   zo   L   `   H   )v   L   n   L   [n   L   n   L   n   L $  ws   L +  Ie   P 2  v   H ;  j   H D  k   H K     H R  _   H Y  Ts   @ `  k   < g  v   H n  (t   H w  ,u   H ~  w   H   _   H   c   <      <   x   <   Qx   <   t   <   Ct   <   x   H   Pw   H      H   cg   H   z   @   y   @   
|   @   >z   @   x   @   O{   @   z   @   Zy   @   {   @ #  Bk   < ,     @ 3  7   @ :  o   @ A  k   @ H  [   H O  e[   H W  K[   H ]  Z   H c  [   H i  [   H o  %[   H u  Z   < {  Y   @   q   <   v   <   q   <   ]   <   \   <   *]   <   \   <   c_   <   ]t   H   t   L   t   L   t   L   st   L   j   H   ql   H   l   L   Kl   L   R\   H   Y   L      L   '   L      L   c   L       L %  7   L *     L /  j   H 4  Iu   H :  k   L C  eu   L J  u   L Q  j   H X  g   H _  Y   H h  g   H o  ]   H v  ]   H }  n]   H   p   P   g   <   _   H   e   H   b   <   &k   <   lj   <   m   <   p   <   [   <   [   <   p   <   j   <   vm   <   gm   <   vc   <      <   ~   <   `   D   &d   D   Td   <   9d   < (  c   H 1  b   H ;  -c   H A  Ac   H G  \   H M  c   H S  0\   @ Y  PZ   @ b  `   @ k  ~   @ t  }   @ }  k}   @   q   P   Fq   P   e   <   }   @   }   @   i~   @   x   <   x   <   U]   @   =x   @   o   @   wx   @      @   d   H 	  d   L 
	  e   L 	  d   L 	  pf   H 	  f   H "	  f   H (	  f   H .	  )q   P 4	  C\   < >	  C]   < E	  i   < L	  
`   \ S	     < Z	  k   < a	  c   < h	  q   < o	  "}   < v	  lS  4 }	  S  4 	  N  4 	  kZ  4 	  Q  4 	  KU  4 	  Q  4 	  T  4 	  U  4 	  W  4 	  V  4 	  T  4 	  Z  4 	  W  4 	  S  4 	  N  4  
  SY  4 	
  X  4 
  T  4 
  [  4 $
  4O  4 -
  8P  4 6
  Y  4 ?
  [  4 H
  Z  4 Q
  X  4 Z
  jU  4 c
  fV  4 l
  P  4 v
  `W  4 
  
P  4 
  RQ  4 
  
Z  4 
  jR  4 
  {X  4 
  R  4 
  P  4 
  U  4 
  O  4 
  h0  % 
  4  ) 
  '   0 
  1(   0 
  *   0 
  Q*   0 
  '   0 
  *   0 
  *   0   )   0   I)   0   *   0   )   0   )   0 #  H  8 )  <H  8 ,  fH  8 /  )   I 2    $ 6    $ F  j  u_    0i    yp  r  }r  f  ]v    z    $    $  ?  $    $          $  m   $    $    $  I  $    $    $    $    m  ^        &    J      I  f  y            $  S3     'H        U  ,  <  ,    ,  u  ,  ~  ,    m,    -    - - s- q 4  Q-  s-  4   s-     ߖ s-       q      q     q      t
    t
  !  t&,
  u   $'3
  !  t(;
     t-N
  !  t.T
  e  t.X
  \    .]
    t2]
  !  t4h
    t@
  u  tG
  P  tL
     tN
    tO
  G!  tO
  !  tc
  "  th    ti    tj&  \  tuD    th  5   8  !  t  
  t     t  !  t     t     t ȓ  q   wS     R     sL     _S    y  q  ב  q    q  f  q     q   T    )  q   IU      q      q      q  E  q    q    0  q  C  q  2  q  Ϗ  q  .  q  &  q !  M  % n  q (    *   q -   q .    0    2  ݐ  4  3  6    8  u  :  h  =  1  @    C  ʐ  E     q G ޑ  q L  ZR   N   q N     q P b  q U  Q   W  V   W  U   W  T   W  cU   W  |U   W  _N   W    q W     . g O  q i s  q k {  q n 4  q q   q s "  q u   q x   q y   q { [  q }   q   !U      q  c  q   T     S   '  9T   / G  q 5   q 5      5    q D      q T   J  q U    W  K  q W    X 7  q X   q X [  q X   q X   q X Ѝ  q X J   q Y H  q Y W  q Y  T#   Y  V   b  K   j      n  V   v  ͗      N     J     H           6          P     I           Q      q  H  q    q    q    q  V  q    q    q    q    q    q    q         O     9      c       y^       q    q    q    q  i  q  ލ  q    q      2  Ȓ  q     q   j  q   ܔ   6 &  %  q '  j  q  -  S   5  O   5  ER   ,5  )S   05  M   :5  m    B5  T   E5  T   d5  V   5  4P   5  S   5  T   5  aT   5  L   5  [    5  G   5  H   5  >   5  o   5  D    5  N   5      5      5  Y    5  o    5     5  R   5  `H   5  U   5  b    5  M   5     5  G   5  dO   5  rR   %5  
    ,5     15  je    45  a    C5  p    F5  p    H5  cV   M5  IV   Q5  P   U5  P   Z5  M   ^5  F   `5  ~P   j5  hP   m5  O   |5  O   5  'M   5  L   5  PO   5  Q   5  R   5  Q   5  Q   5  kM   5  .   5  R   5  JM   5  M   5  Q   5  &T   5  :O   5  N   5  DN   5  N   5  -N   5  N   5     
5  O   5      5  s    5  R   5  S   "5  P   ,5  
P   05  H   55  1R   95  2    ?5     C5  U   Q5  Z    Z5  qQ   ]5  NP   r5  L   u5  d    5  d    5   q 5   q 7   q ; =  q ? O  q D b  q F     : H    > N r  q R  {K  q T  S   q `  x   q k     B   ,   $
     
  !h   N   7h   N   u   $
 FI  q   ^      g   $
  r   $
  p   $
  ;    :    Q;    u=    <    :    ;    ;    [   $
  2}   
  eZ   
   m   $
   b   R      V      V    t  Z    'l  ^    Kj  b    k  f    }  j    k  n    ~  r    i  v    i  v    i  v    #j  v    h  v    g  v    8h  v    g  v    i  Z    h  Z    Ku  v    d   z    od   z    (   ~ !      &   w   )   w   ,   q   /   s   z 1     $
6   b   
<   S   
?   p   
C  }   
G  |   
L  f|   
R  |   
W  |   
b  ||   f  }   
i   p   
p  m   
t  ,~   $
x  `r   $
}  L     s   $
   d   
   d   
   u   ,   i        p      Kp      r     Y       v|      v      m      v      _m     _       p      y    a  q        v        $
  g   |  
h   |     $
  !      :         $
  m      $p      >`   $
  C      k    	  Y    	      	
   1w   	      	   w   	   2q   	   t   	   (p   	   s   	!   }   	$   *{   	'   $z   	*  
    	-  J    
2      
5  *    
9      
<     
?   z  
C   us  

F   l  
I   {  
L   ~  
O   <n  
R   in  
U   t  
X   o  
[   z  
^   |  
a     

d  ne   

h     "
l     &q     *t   |  .x   o  2{   *u  .~   Zq  .   ~  6   h  :  _   $
  1j   $
     $
     $
   j   $
  _   $
  o   $
  l   $
     $
  
       $   q  d  q   ~Z   q   |     |    r  q  0  q 
  N  q #    %!   q %# B  q &-  _  '1  +  '3   (  >'5    q 0o  	  98s  ,  8u  V  8x _  q 8} M_  q 8  ~   $
8  }   $
8  `   z 8  O~   z 8  `   z 8  c   z 8  r   z 8  f   F8   n  9   m  J:     N:  w   R:  jt  V;  y  Z;  i   ^;  r   n<  r   r=  r   v>  c   z ?  e   ?  e   @     A  k  A  j  A  |l  A  Yr  A  {  A  -|  A  u  A
  {  A
  {  A  R|  A  p  A    A  gi  A  Kz  A  t  A"  o   z A&  d  q A+        D9     q D:     h
GB     q HF     p
LP  *   q MT     q OZ     |
P^  >   q Rd  f   
Ul  X   q Wr     
[|     q \  y   
a     q c  }   $
e  Uc   
e  |_   
e  Z   $
e  8l   
e  \   $
e  b   $
e  g   $
e  l   $
e  ~   $
e  s   
e   R     f  D   q f  q  q g  \   q h  q  q i  u   q j     q k   w   q l     q m  #   q n     q o     q p$     q q+     q r2     q s: 8  q tA  ty  q tE     tM  5x  tS  j  tU  n  tZ  @i  t`  ph  te  z  tj    to    tt  l  ty  ik  t~  w  t  s  t  sx  t  vw  t  x  t  9  t  r  t   o  t  7s  t  :t  t  y  q t  C   dt  o{  t  x  
t  s  t  G~  t  |  t  Jl  t  5}  t  &o  lt  k  t  ^}  t  3m  t  v  t  r  "t  z  "t  Po  "t  m  "t  o  "t  o  "t    "t  >v  "t	    "t
  q  t  s  &t  ;  t  u  tt  v  tt"  u  tt&  lu  tt*  h  t.  |  "t2  u  *t6     z t:  Z   t?  1Z   tC  s   $
tG  G   9tM    uP     {p  8  {y  I  {}      {  A      #     xe        q     Y  &  i  x    <  Y^  q B
<  A    M
Q    q R
Q g  q S
W  ˾    S
X  c   V
X   cf    g
X  f  g
Y   "      q h
^ [      q j
_       q l
a       q n
c       q p
d =      q s
f ^      q t
h 3      q v
j       q w
l! +      q x
n! +      q {
! +      q }
! +      q 
!       q 
! +      q 
       q 
! +      q 
! +      q 
       q 
! +      q 
 n      q 
 =      q 
! +      q 
       q 
 =      q 
! +      q 
       q 
 3      q 
 R      q 
! +      q 
 3      q 
! +      q 
  %      
 =      q 
 3      q 
 =      q 
 3      q 
       q 
 3      q 
       q 
 =      q 
! +      q 
         
 =      q 
       q 
! 3      q 
$       q 
'       q 
,! +      q 
.! +      q 
5 H      q 
< <      q 
>! +      q 
G! +      q 
[ V      q 
` V      q 
b! +      q 
d! +      q 
i! +      q 
p 3      q 
t V      q 
v! +      q 
x! +      q 
! +      q 
 H      q 
       q 
! +      q 
       q 
        q 
       q 
 3      q 
       q 
! +      q 
! +      q 
 V      q 
 V      q    y     B       
! +      q         b       f  ^     j! +      q   y     
  Oy     
  o~     z  q     ~  vp       M{       j     ~  }       i       }       )r       x       ~       n     ~       ~  nj       d      b! +      q   m     	  +y     
	! +      q 
! +      q &       q )! +      q +! +      q  .! +      q "1 n      q $4 n      q %6 x      q &8  U     Q': V      q (@! +      q )B  V       y+E         y+E! +      q +E! :  0! :  0! :  z B"  30  
 X.  n g    
m&  _ V' V& V  VL V& m&  _ VH V  m&  _ V  VE UC  nUU  nUS  nU0  nU  nU  nUz  nUv  nU  nU  nU  nU  nUS  nUө  nU2  nU  nUͨ  nU  nUY  nUw  nU  nU  nU  nUë  nU  nU  nU  nU,  nU  nU  nUI  nUw  nU  nUȧ  nU#  nU#  nU#  nUg0 nU  nU0 nU0 nU0 nUB? n     F  a:     x  7      &  !  ?C Ą  Ʉ fe ΄ :\ ӄ  ؄1  1 R@ 1 RA 1 4@ 1 &  1 oA 1 @ 1 @ 1 @ 1 A 1 t@ 1 .A 1 A  $I  _  G   .F  ݄ 9   C<   A   J  A   D   
 _   UP  n >  
UP  n >  
U  nU  nU(  nU  nU  nUծ  nU nU% nU%  nU%  nU&  nU n  3 O 3 g 3 N V  nV,  nVI  nQh  _ Q  _ V nV8 nV nV̊ nV nVh nV nV nV nV nV`N nV? nV nV nVt nV	 nVY nV/< nV nV9  nVy  nVD nV nV' nV  nV nV:
 nV nV# nV̈́  nVF nV  nV5
 nV nV  nV  nV? nV nVB nV.  nV$ nV nVF nV nV% nV=  nV  nV nVd nV\ nV/ nV nV$ nV  nV	 nVɵ  nV  nV  nVՑ  nV nVS  nV˿  nV  nV5  nV  nV nV@  nV nV&  nV@ nV nV  nV  nV;  nV nVª  nV  nV  nV`  nVE  nV
  nV(  nV|  n   _  _  _  _  _  _  F Q _ Q _ QfN _ QE _ Q _ Q _ QfN _ QE _ Q _ Q _ QfN _ QE _ Q _ Q _ QfN _ QE _   #  ( ƅ -  2 + 7 Y < } A G* F 2 K  P  U  Z Ѿ _  d  i ܽ n  s  x  } X    "   y  y Q   R>   w>   2>  m&  _ V V=/ V.  i     h  0    f Ņ f Ņ f Ņ f Ņ f Ņ f Ņ f Ņ f Ņ H  ʅ f Ņ Q υQ;0 nVc nVz  nV  nV  nVn  nV=  nVS  nV-  nV  nV  nVͰ  nV  nV  nV2  nVd  nQ~  nV~  nV  nV  nVج  nV  nV  nV  nm&  _ V5
 ԅVD  ԅV6  ԅV) ԅV  ԅV$ ԅVp ԅV ԅV# ԅV ԅVxY  ԅV+  ԅV+  ԅVC ԅV!  ԅV  ԅV5  ԅVc2  ԅV5  ԅV;6  ԅVR  ԅV  ԅVx2  ԅV'  ԅV!6  ԅV2  ԅV6  ԅVW6  ԅV2  ԅV  ԅV  ԅVL ԅV4  ԅV  ԅVg  ԅV ԅV
 ԅV?
 ԅV
  ԅV  ԅVS ԅV= ԅV ԅV ԅV4  ԅV3  ԅV ԅVX! ԅV ԅV, ԅVv ԅVj> ԅV  ԅV  ԅV  ԅV  ԅV  ԅV  ԅV ԅV ԅVC  ԅVw ԅV  ԅV  ԅVD ԅV* ԅV  ԅV+ ԅV&  ԅV;"  ԅV7 ԅV# ԅV  ԅV^ ԅVו ԅVD ԅV  ԅV  ԅVG  ԅV  ԅV ԅV  ԅVp ԅVi ԅV  ԅV
 ԅV+  ԅVb  ԅV;  ԅV ԅV/ ԅVf ԅV  ԅV ԅV} ԅVJ ԅVfN ԅVE ԅVG, ԅV  ԅV  ԅV' ԅV/ ԅV
 ԅV ԅV# ԅV  ԅVG ԅV  ԅV^ ԅVH ԅVA ԅVA ԅVB ԅV!C ԅV9@ ԅVLC ԅVC ԅV@ ԅV@ ԅV  ԅV` ԅVb ԅV	 ԅV ԅVF ԅV# ԅV& ԅV ԅVL ԅV# ԅV% ԅV +  ԅVV ԅV ԅV ԅV" ԅV~  ԅV  ԅVO ԅVJ" ԅV  ԅV ԅV ԅV ԅV(  ԅV# ԅV% ԅV ԅV ԅV  ԅV# ԅV$ ԅV*& ԅVl& ԅV ԅV ԅVA  ԅV  ԅV  ԅV ԅV  ԅV ԅV? ԅVk  ԅV!< ԅVK ԅV~9  ԅV ԅV ԅV  ԅV ԅVR ԅV| ԅVA  ԅV  ԅV ԅVk  ԅV1  ԅV  ԅVߴ  ԅVt ԅV< ԅVN ԅV9 ԅV" ԅVg" ԅVY ԅV$ ԅVk ԅV  ԅVG ԅV
 ԅV+  ԅV  ԅVF  ԅV@ ԅV ԅV ԅV$ ԅV ԅV) ԅV ԅVT ԅV ԅVק ԅV ԅV  ԅV+ ԅV|  ԅV ԅVp" ԅV-  ԅV  ԅV ԅVB ԅV8 ԅV[ ԅV5 ԅV  ԅV  ԅV  ԅV ԅV  ԅV! ԅV? ԅVR  ԅV  ԅV" ԅV ԅVش ԅVܼ ԅV`  ԅV ԅV  ԅVy  ԅV ԅVF ԅV  ԅV ԅVI# ԅV> ԅV  ԅV  ԅV  ԅV  ԅV1  ԅV  ԅV}  ԅV  ԅVj  ԅV  ԅVU  ԅV  ԅV4  ԅVl  ԅV  ԅVJ  ԅV[  ԅV@  ԅV  ԅV   ԅV͞  ԅVş  ԅVڟ  ԅV  ԅV	  ԅV4  ԅV   ԅVI  ԅVc  ԅV  ԅV{  ԅV  ԅV  ԅVݝ  ԅVȝ  ԅV+% ԅV ԅVr  ԅV  ԅVj ԅV ԅVÜ ԅV~ ԅV  ԅV ԅV͝ ԅVR ԅVA ԅV  ԅV  ԅV;  ԅV ԅV| ԅV ԅVl ԅV' ԅV ԅV ԅV ԅV ԅV ԅV;  ԅVB> ԅVV ԅV> ԅV ԅVa ԅVڞ  ԅV  ԅVˠ  ԅV  ԅV  ԅVK  ԅV  ԅVQ  ԅV ԅVĜ  ԅV׉ ԅV ԅV ԅVc9 ԅV9 ԅV ԅV ԅV ԅVV ԅV  ԅV99 ԅV ԅV ԅV ԅV  ԅV
 ԅV ԅVn  ԅV  ԅV  ԅV,5  ԅV4  ԅV4  ԅVJ ԅVi ԅVz ԅV  ԅV ԅVtG ԅV ԅV ԅV ԅVM ԅV ԅV ԅV\ ԅV= ԅV$9 ԅV ԅVh4  ԅV  ԅV
^ ԅV ԅV ԅV ԅV ԅVG  ԅV ԅV# ԅVk ԅVص  ԅVu ԅVO  ԅV ԅVU
 ԅV  ԅV ԅV  ԅV
  ԅV  ԅV/ ԅV ԅV ԅV  ԅV\> ԅV  ԅVV* ԅV/  ԅV  ԅVG ԅVP ԅVׁ  ԅV  ԅVZ  ԅV ԅV  ԅV ԅVw ԅV|  ԅV ԅV ԅV ԅVA ԅVi ԅV ԅV+  ԅV3+ ԅV  ԅV  ԅVE ԅV  ԅVq  ԅV
 ԅVE ԅV/  ԅVe ԅV ԅVI  ԅV> ԅV'! ԅV> ԅV ԅV ԅV8? ԅVX? ԅV  ԅV  ԅVK ԅV ԅV ԅV6D ԅVMD ԅVeD ԅV(  ԅVX  ԅV6 ԅV[ ԅV ԅV7G ԅVU  ԅV6 ԅV7 ԅV  ԅV ԅV:  ԅV$ ԅV  ԅV8  ԅV ԅV* ԅV  ԅV  ԅV  ԅV  ԅV, ԅV  ԅV  ԅV ԅV ԅVh ԅV;  ԅV'> ԅVx;  ԅV> ԅV:  ԅV= ԅVY  ԅVa> ԅV/;  ԅV= ԅV\;  ԅV= ԅ  _   _   oX  oX  م  _  @ _   _  P _   oX  oX -  % t ޅ   V   J   GB   B   _C   M   %M   M   S   Q   H   qH     I   Z@   ?   K   lP   U   I  m&  _ V !V2  !Vk  ! I   Q   VR   3R   S   Q   Q   P   O   H   H   :?  & J   I   7N  + /=  & W  0 W  0 D   OF   hD  5 7N   W  0 }?  & @  : aI   ?W   W  0 I   @  ? L   K   MK   M   J   yV   V   ZS   -U   U   *S   NV   U   V   ZU   #H  D G  D U   T   HM   T   R   S   !W   @  ? E  I @  ? M   L   M   N   I   U   R   T   P    O   @  ? oM   L   K   mK   K   pL   N   P   P   +V   xR   S   S  T  n D  N W  0 R   R   aI   hD  5 T   R  Q nQ+ nQw n bB   C   C   HD  S B   B   B   ^W   CO   VR   @  ? ,K   M   NL   L   O   CP   P   8Q   T   hT   AT   V   eJ   J   O   O   bO   Q   _Q   X  0 W?  & J   EJ   C   {C   ?C  m&  _ V^ Xm&  _ V7  ]Vh+  ]V ]V  ]V ]V? ]V`+  ]m&  _ V  bV, bVՇ  bm&  _ V%  gV$  gVC"  gm&  _ V lV[ lVQ  lV  lm&  _ V  q <   <   B&  n 7&  n <  m&  _ VD vVe vV vV+ vV, v   { <  m&  _ V2 V  V  V[ m&  _ V  Vl  m&  _ V  Vl  m&  _ VfN V V VE m&  _ Vfc Vc Vc Vb V!b Va m&  _ Vfc Vc Vc Vb Va Va m&  _ V	 VF- V- VG& Vk& V( m&  _ V V  V  V V V V V7 V V V VY5  V V  V  V  V< V
 V  Vv V V  V" V=  V VG V m&  _ V  V 4  V!  V V} VA V Vs V2  V V\ m&  _ V  V  V0? VH  V  V  VT  m&  _ VE VE V6E V E VKE m&  _ V^4  VF VE VE V:F VOE V_E VE VF VE VF V'F VE VE V&  _ V  _  s=   F  Ɔ -  % X6 $ + І Y  Ն    a*  ^ $  _    _  ; چ   _  <d ߆ G      1  H    _ m&  _ VL  Ve V V  VF- V< V' VJ m&  _ VU  V^ VU VO V5 V  V}.  m&  _ V. VJ VK m&  _ V' 	VL  	Ve 	V 	V  	Ve 	V< 	m&  _ V' VU  V^ VU VO V5 V  Ve VL  V V  V}.  m&  _ VY' VF V	 V. V  V V Vv m&  _ V VU  Vz V  V V  Va  V'M Vn V  V߹ V'I V5 V` V V V V8 Vw8 VP  V>  V
  V  VM  V  V* m&  _ V?) V. V& m&  _ V6 "V: "Vv "VH "m&  _ V	 'Vܭ  'V  'V 'm&  _ V9 ,VF ,m&  _ VY' 1V- 1V" 1V  1V  1VB8 1V-8 1m&  _ V 6V 6VU 6V|M 6Vt  6V5 6V 6V'I 6V* 6V  6m&  _ V8 ;V8 ;V?) ;VJ ;VA5 ;m&  _ V" @V @V  @V  @m&  _ V EV  EV EVU EV|M EVt  EV5 EV EV EVO EV)  EV  EV" EV  Em&  _ V-% JV^ JVH JVL> Jm&  _ V^4  OV OV  OV OV OV OVo%  OVn OV+  OV,  O <     {   T h N F  Y F  ^   _  H  _  9 _    % W=  % ~ c h N d  k   {   T E  І  p  u ܔ  z     m&  _ V0  V Vv  V VP m&  _ V* V  VxY  V+  V  V  V V#D VC V 
 V# VI V  V  V>  VK VB V'I Vԛ V$ V3 V, V* VS, V+ V, m&  _ V% V
  V&  m&  _ V  Vز  V1  VZ  Vp	 V	 V	 V8	 V1
 m&  _ V\! V  V  V: V  V-- VN m&  _ VK V* m&  _ VD V]" V V,  VwN V  Ve  VF V	 V  V# V7  VL  V  V? V V  V  V> V" Vc V/  V@ V  Vh  V
  Vw/  V*  VW# V$  m&  _ VD V]" V V,  VwN V# V  V  V  V> VW# V V  V  V V V V  V
 V  Vv V V VG VY5  V V  V V" V=  Vc VL  V*  Vw/  V$  m&  _ V  VR V
 m&  _ V0 V V V/ V7 V_ V V Vݨ V` VN V m&  _ V5 V'  V  V V  V. Vn  V  m&  _ V  V Vݶ  V V- V V V^ Vy V m&  _ V  m&  _ V ŇV ŇVW ŇVh  ŇV ŇVM ŇV5  ŇVJ Ňm&  _ V  ʇVK ʇV.  ʇm&  _ VH  χV'  χm&  _ V ԇVۦ  ԇm&  _ V هV
 هVY  هm&  _ Vt އVw  އVZ އVň  އV އm&  _ V  V:;  m&  _ V Vi V`  m&  _ V3L V, VS$  m&  _ V  V  m&  _ V  m&  _ V  V$  V  V  m&  _ V V VfN VE m&  _ VKM V# V{ Vl3  V,  Vj  V  VI  V  VDa VO  V  Vͺ  Vf Vu  V V/&  Ve&  V(&  V^&  m&  _ V V: V:  V,  Vz  Vj VA  V^ V0  m&  _ V3 V3L m&  _ V.  VJ m&  _ V.  VG  m&  _ Vg  V5 V V  Vi% V{% VX% VD% m&  _ V: $V,  $V  $VJ $VA,  $m&  _ V  )V^ )V, )V  )VY )VU  )V$ )m&  _ V7  .VL .VI+ .VX .Vh+  .V, .m&  _ V5 3V"&  3VE  3V 3m&  _ V2 8V  8m&  _ V9 =VL6 =Vx =V =Vg =V =V.  =V%  =V:  =VN  =V =VX  =V
 =VW  =m&  _ V  BV' Bm&  _ V.  Gm&  _ VJ.  LV.  LV LVt Lm&  _ V$5  QV.  QVa Qm&  _ V( VV.  VVa Vm&  _ V-- [V, [V, [VS$  [m&  _ V/ `V
 `V `m&  _ V. em&  _ V-  jV$5  jVa jV jV2 jVN jV
 jV/ jVO. jm&  _ V/ oV
 om&  _ V2 tV tV tV  tVd tV= tV  tV- tV˟ tV  tV tV> tVц  tVt tm&  _ V= yV yVܽ  yV yV  yV.  yVS yVm  yV yVq+ yV yV  yV  yV{  yV  yV yVg yV yV yV'I yV* yVc yVc yVfc yVb yV}.  yVs yVc yV  ym&  _ V, ~V& ~V8 ~V  ~V( ~Vv. ~V) ~m&  _ V: V m&  _ V: Vm. V) Vܭ  V V, m&  _ V  VY V  Vk& V<' VS$  m&  _ V&  V  V,  m&  _ V&  V  VA,  V m&  _ V&  V  V,  VJ m&  _ V&  V  VA,  VJ V m&  _ V: V  m&  _ V V  V V_ V m&  _ V  V׆  m&  _ V) V m&  _ V: V¯ m&  _ VT VVN V V$ Vt V׆  VJ V  V, V  V  V V  V VC m&  _ V> ĈV=  ĈV  ĈV ĈV ĈV Ĉm&  _ Vܭ  ɈV$5  ɈV# ɈVƭ  ɈV # ɈV  ɈVB ɈVG  ɈVS$  Ɉm&  _ Vg  ΈV& Έm&  _ V& ӈVM& ӈVg  ӈV#  ӈVz  ӈV( ӈVm. ӈV) ӈm&  _ Vm. ؈m&  _ V%  ݈V ݈m&  _ Vܭ  m&  _ VI V9 V9  V  m&  _ V  m&  _ V) V- V  m&  _ V V V" V V
 Vl m&  _ V.  V  m&  _ V^  VH  V]  V  V]  V{  V]  Vm  V  m&  _ V V  V0  m&  _ V 
VEd 
V6 
V 
m&  _ V  VK V,  m&  _ V= V[  V: VB V"5  m&  _ V
  V  Va m&  _ V V.1  V`< V; Vd  V Vj VQ; V; VW  V< V; V4  m&  _ V^  #V6,  #VN #V2,  #V  #V.  #V #V( #m&  _ V  (VV (m&  _ V	 -V
:  -VG  -V,  -V"  -VE -V2  -V -V -V -V7 -Vn -V.  -V#,  -V  -VO -V& -V% -Vɋ  -Vu  -m&  _ VԊ  2V% 2m&  _ VÔ  7Vr  7V  7Vܔ  7V  7V 7VV  7V  7V  7m&  _ V: <V  <V.  <V  <V.  <m&  _ V AVQ AV.  A =  k   {   T t ޅ  F =  n >  n G  
6 ^ K =  Q h N -  % #.  _  E  ޅ D  \ KG   <  _   <  a >  a =F im&  _ V/G uV{  uVn uV! uV uV uV uV}  uVK  uVE uV  uV  uV uV uV uV uVqE uVGS uV+d uV  uVW  uV  uV uVO uV  uV5  uV/ uVw uV uV uV uV  uV uVl uV uVc uV  uV uV uV uV uVc uVt uV uV uV uVa uV uVM uVo  uV  uV uV uV-Y  uV  uV1  uV;  uV] uV uV+ uV+ uVl  uV  uV9 uV uVP uV'# uVV uV8  uVN uVC uVvC uVz# uVE# uV uVk uV8  uVK uV uVG uV  uVR uVN uV  uV?  uV= uV u  z   s    m&  _ V~( V Vm. V) V Vܭ        ǉ 6  ى < ى *D  މ <   /G        T-  n ?@   E   .L   E #  - =F 7 G  C /G   F  # J  d9  
 [ H ޵ R  \ a f   _   _   _ Qw! nQ~ _ Q
 _ Q  _ Qy _  + k  Ɔ 0 n # pQ  n J  	 C ?  
 =  k <   mG  } pF   ;  _  I n C 
 # # ;   7  U } F E  c     
          Ɗ    ؊ A   m<   @   A  $ >  _  =   =  
 G  
 N  _  qN  _  =   =  
 N   =   =  n JI  _  <  _  B  $ x@  _  =   =  
 F   B  $ x@  _  N  _  =   =  
 B  $ x@  _  N  _  N  _  =   =  
 F   *B  $ =   L  W=  % W=  % ?  N ?  N ?  N W=  % W=  % W=  % W=  % W=  % W=  % W=  % W=  % W=  % G   OA  ؄ 2A   A   nA   @  N VN   YE   @   OH   C   C   B   B   ?   G   VN    D  % 	    n BE  * 	  Ң / G 5 G 5 H 5 )(  : V(  : G*  : *  : )  : '  : *  : ^(  : 0)  : (  : )  : S ? S ? %O ? Z ? R ? ZV ? Q ? U ? ?U ? W ? W ? kT ? Z ? @W ? T ? N ? Y ? #Y ? T ? W[ ? zO ? P ? Y ? [ ? z[ ? dX ? U ? V ? P ? W ? P ? Q ? GZ ? R ? X ? BS ? /Q ? (V ? O ? / Dm&  _ V  JVC" JVz# JV  JV: JVp JVG JVG JV/ JV0 JV/ JVk  JV̡  JV  JV.  JV  JV  JV  JV  JV  JVdY  JV+  JV  JV  JV JVe
 JV+
 JV JV[ JV   JVZ JVq JV JV JV JV  JV JV JV JVA JV  JV  JV  JV  JV:  JV  JVS  JV" JV  JVf  JV! JVX JVp  JV JVE  JV JV JV JV; JVm JV JV JV  JV8, JV, JV JV% JV JV6 JV   JV  JV  JVP  JV)  JV JV JVW# JV  JV@  JV!  JVM  JV  JVy  JV؂  JVd JV JV" JVF JVY  JV
 JVL JV4 JV JVp  JV  JV@! JVF JVY  JV
 JVL JV: JV JVv  JV> JVl? JV  JV
  JVю  JV}  JVw  JV  JV JVo JV JV JV  JVH JV JV JV JV= JV JV JV JV
 JVY  JVY  JVw  JVq  JV  JV  JV  JV  JVY  JVS  JV JV]  JVR^  JV  JV{^  JVs  JV%^  JV  JV  JV  JV! JV! JV! JV JVm JV JV| JV8 JV JV]$ JV8$ JV;  JV;  JV JV$ JV JVF JV JV JV JV=_  JV_  JV JV| JVl JV^  JV^  JVq  JV^ JV  JV JV;  JVx;  JV:  JVj JVY  JV  JV߅  JV  JV  JV̅  JV&  JVL JV;  JV JVk! JV  JV] JVB JV JV JV8 JV] JV JV JVڋ JV  JV JVċ JV JVX  JVY  JV JV  JV: JV  JV/! JV JV& JV% JVC  JVR JVM JV JVKC JVx  JV  JV  JV JV  JVFt  JVB JVB JV JV JV JV JV JVÊ JV_ JV/ JVފ JVy JV8  JVVc JVc JVb JVc JVc JV JV JV JV JV
 JV)$ JV$ JVZ& JVI& JVA JV% JV[ JV% JVk# JV3  JVM JV( JV JV&f  JV  JV^ JVU JV% JVe# JV-  JV%  JV JV	% JV& JVy JV JVw  JVW JV JV  JV  JV JVF  JV> JV JVE  JVE JV* JV JV  JV  JV JV   JV  JV JV JV JV JV& JV JV= JVw/  JV^  JVb  JV  JV  JV  JV  JV  JVW JV JVC! JV JVU JVL  JV  JV5  JV̻  JV  JV9  JV  JVR JV JV JV JV JVt JV- JV JV JV  JV:
 JV JV̈́  JV  JVF JV JV= JV> JV JV  JV/;  JV\;  JV]  JVv6 JV JV:  JVX  JVX  JVX  JVX  JVjX  JVRX  JV JV JV
 JV
 JV7
 JVQ
 JVk
 JV
 JV
 JV
 JV
 JV JV JV  JV\ JV JV$ JV  JV  JV  JV JV" JV" JVg  JV JVBf  JVC JVB JV2C JV JVC JV  JS1/ nS/ nSH/ nS/ nS/ nS/ nS/ nSn/ nS/ n F O F  nm&  _ V  XV XV XVk X 	 m&  _ V ]V ]m&  _ V.1  bV4  bV4  bV3  bV`< bV; bV  bV  bV<; bV; bV bVk5  bV  bVW  bV< bV b 1 g3   q3p"  v   n  {      ^ X;  {   ^ X;  { ' ؄  X	   '  : H 56 !   A     6 !     6 !     6 !      6 !     6 !      t   [ 56 !  ˋ   6 !  Ћ    e            w! n r  _ 6 !  Ջ          u      a      .            . _  t ޅ6 !  ڋ   ߋ   ޅ6 !      ?   j         N   | $ ` _  
 N g  p  $ -  %6 !  . R  3 \  > !8 _ 6 !  I K  z <   t ޅ   n <     {   T   n   n ֭  n   n   n ֭  n w  n t ޅ6 !  N j  S K ]   n ֭  n   n   n ֭  n w  n :  n . _ 6 !  b   g #
  g   x }  g   g6 !      0   R          _    _  H 0 e,  _   78 	  oX6 !  6 !  Ō <,  _    
6 !  ʌ6 !  ό6 !  Ԍ Q  n   n6 !  ٌ6 !  ތ6 !      * _  v* _     * _  v* _ 6 !      ;      r  n 7   7    n t ޅ6 !     6 !  &      n   n #E  +6 !  0 -  5   56 !  ? #E  + #E  D6 !  I #E  D6 !  N -  S   S )  S M  S   S   S   S Y   S K!  S !  S #   S 
  S   S s  S   S6 !  ] k  b  X	  \6 !  l   q6 !  z   q6 !        n   n  n G   7 n6 !     6 !   )  P         X     Ԡ  h       +$         G       N  c  !        !      @  !!    Ԡ  8!      +$ !       G !     N  c  H"    Ԡ   T"    = c  "    Ԡ  "    9  P  #      #    2   #       ,#     D   _#     D 	 t#     D 	 #     D 	
 $     D ! D$       
      Ԡ         Í        ʍ        ׍ $    Ԡ   $    <.  c  $    L  $    W u  $       %        
%    K!  
%    Y  ލ %      c   %    M c  ,%    @ c  3%      c  :%    a: c  D%      c  c%    Ԡ   k%    Ԡ  t%    K!  w%    Y  ލ ~%      c  %    M c  %    @ c  %      c  %    a: c  %      c  %    Ԡ   %    Ԡ  %    Y  ލ %      c  %    M c  %    @ c  &    Ԡ   &     A -&    !4 A 4&      A '    Y  ލ '      c  '    M c   '    @ c  ''      c  .'       1'    Ԡ   9'    Ԡ  D'        '    Y  ލ '      c  '    M c  '    @ c  '      c  '    Ԡ   (    Ԡ  (    Y  ލ (      c  "(    M c  .(    @ c  5(      c  <(    Ԡ   D(    Ԡ  M(    Y  ލ T(      c  `(    M c  l(    @ c  s(      c  z(    Ԡ   (    Ԡ  (    Y  ލ  (      c   (    M c   (    @ c   (      c   (    Ԡ    (    Ԡ   (    Y  ލ! (      c ! (    M c ! (    @ c ! (      c ! (    Ԡ  ! (    Ԡ ! )    Y  ލ" )      c " )    M c " &)    @ c " -)      c " 4)    Ԡ  " <)    Ԡ " E)    Y  ލ# L)      c # X)    M c # d)    @ c # k)      c # r)    Ԡ  # z)    Ԡ # )    Y  ލ$ )      c $ )    M c $ )    @ c $ )      c $ )    Ԡ  $ )    Ԡ $ )    Y  ލ% )      c % )    M c % )    @ c % )      c % )      % )    Ԡ  % *    Ԡ % *       & *    Y  ލ& *      c & *    M c & *    @ c & *      c & *    Ԡ  & *    Ԡ & *    Y  ލ' *      c ' 
+    M c ' +    @ c ' +      c ' $+    Ԡ  ' ,+    Ԡ ' 5+    Y  ލ( <+      c ( H+    M c ( T+    @ c ( [+      c ( b+    Ԡ  ( j+    Ԡ ( s+    Y  ލ) z+      c ) +    M c ) +    @ c ) +      c ) +    Ԡ  ) +    Ԡ ) +    Y  ލ* +      c * +    M c * +    @ c * +      c * +    Ԡ  * +    Ԡ * +    Y  ލ+ +      c + ,    M c + ,    @ c + ,      c + ,    Ԡ  + $,    Ԡ + -,    Y  ލ, 4,      c , @,    M c , L,    @ c , S,      c , Z,    Ԡ  , b,    Ԡ , k,    Y  ލ- r,      c - ~,    M c - ,    @ c - ,      c - ,    Ԡ  - ,    Ԡ - ,    Y  ލ. ,      c . ,    M c . ,    @ c . ,      c . ,    Ԡ  . ,    Ԡ . ,    Y  ލ/ ,      c / ,    M c / -    @ c / 	-      c / -      / -    Ԡ  / -    Ԡ / $-       0 V-    Y  ލ0 ]-      c 0 i-    M c 0 u-    @ c 0 |-      c 0 -    Ԡ  0 -    Ԡ 0 -    Y  ލ1 -      c 1 -    M c 1 -    @ c 1 -      c 1 -    Ԡ  1 -    Ԡ 1 -    Y  ލ2 -      c 2 -    M c 2 -    @ c 2 -      c 2 -    Ԡ  2 .    Ԡ 2 .    Y  ލ3 .      c 3 .    M c 3 +.    @ c 3 2.      c 3 9.      3 <.    Ԡ  3 D.    Ԡ 3 M.       4 .    Y  ލ4 .      c 4 .    M c 4 .    @ c 4 .      c 4 .    Ԡ  4 .    Ԡ 4 .    Y  ލ5 .      c 5 .    M c 5 .    @ c 5 .      c 5 .    Ԡ  5 .    Ԡ 5 .    Y  ލ6 /      c 6 /    M c 6 /    @ c 6 !/      c 6 (/    Ԡ  6 0/    Ԡ 6 9/    Y  ލ7 @/      c 7 L/    M c 7 X/    @ c 7 _/      c 7 f/    Ԡ  7 n/    Ԡ 7 w/    Y  ލ8 ~/      c 8 /    M c 8 /    @ c 8 /      c 8 /    Ԡ  8 /    Ԡ 8 /    Y  ލ9 /      c 9 /    M c 9 /    @ c 9 /      c 9 /      9 /    Ԡ  9 /    Ԡ 9 /       : 0    Y  ލ: 0      c : 0    M c : 0    @ c : 0    Ԡ  : 0    Ԡ : 0    Y  ލ; 0      c ; 0    M c ; 0    @ c ; 0    Ԡ  ; 1    Ԡ ; 1    Y  ލ< 1      c < "1    M c < .1    @ c < 51    Ԡ  < =1    Ԡ < F1    Y  ލ= M1      c = Y1    M c = e1    @ c = l1    Ԡ  = t1    Ԡ = }1    Y  ލ> 1      c > 1    M c > 1    @ c > 1    Ԡ  > 1    Ԡ > 1    Y  ލ? 1      c ? 1    M c ? 1    @ c ? 1    Ԡ  ? 1    Ԡ ? 1    Y  ލ@ 1      c @ 1    M c @ 
2    @ c @ 2    Ԡ  @ 2    Ԡ @ "2    Y  ލA )2      c A 52    M c A A2    @ c A H2    Ԡ  A P2    Ԡ A Y2    Y  ލB `2      c B l2    M c B x2    @ c B 2    Ԡ  B 2    Ԡ B 2    Y  ލC 2      c C 2    M c C 2    @ c C 2    Ԡ  C 2    Ԡ C 2    Y  ލD 2      c D 2    M c D 2    @ c D 2      c D 2      D 2    Ԡ  D 2    Ԡ D 3       E 63    Y  ލE =3      c E I3    M c E U3    @ c E \3      c E c3    Ԡ  E k3    Ԡ E t3    Y  ލF {3      c F 3    M c F 3    @ c F 3      c F 3    Ԡ  F 3    Ԡ F 3    Y  ލG 3      c G 3    M c G 3    @ c G 3      c G 3    Ԡ  G 3    Ԡ G 3    Y  ލH 3      c H 3    M c H 4    @ c H 4      c H 4      H 4    Ԡ  H $4    Ԡ H -4       I _4    Y  ލI f4      c I r4    M c I ~4    @ c I 4      c I 4    Ԡ  I 4    Ԡ I 4    Y  ލJ 4      c J 4    M c J 4    @ c J 4      c J 4    Ԡ  J 4    Ԡ J 4    Y  ލK 4      c K 4    M c K 4    @ c K 5      c K 5    Ԡ  K 5    Ԡ K 5    Y  ލL  5      c L ,5    M c L 85    @ c L ?5      c L F5    Ԡ  L N5    Ԡ L X5     M 5     1  O 5    {  Q 5    Ԡ  S 5    T S |6    Ԡ  S >7    g S F7    ȶ S N7     S V7    	s  S s7    	  S 7    |  T 7     T 7     "T 7    X% GT 7    k%  T 7    "  c U 8    #   U 8     V 68    3  V >8    3   V G8    J\ W U8    \\  W d8    [ X l8    C X z8    C  X 8    # (Y 8     .Y 8    օ Y 8     4Y 8     Y 8    & :Y 8    ! @Y 8    .C FY 8     LY 8    Pe RY 8    &\ XY 8     ^Y 8    D  c Y 9       Y 9    %  Z 9    %   Z  9     d[ 39    Ы d\ F9     
] N9    s k] V9    I c ] h9    I  ] {9     ^ 9    9  ^ 9     c _ 9      _ 9       ` 9       !a 	:       +c #:       3e =:       =g X:       Jj s:     I Um :       m :       
m :    q
 Go :    
  o :     p :     u p :     q :    ' q :    % Gr 	;    %  r *;    &  s 8;    &   s ;     U  qt 4<        v Q<     
 yv t<     ; w =      x Y=     ; y g=       Fy |=     % Cz =    	
  { =    	  { =    	 | >    	 | 1>      c } S>      } f>      ~ y>      [ >    ǘ  [ >    :0   >    T0   >      >      >      >      ?        $?        7?        J?        ]?        p?         ?        ?        ?        ?        ?    
    ?    -    ?    ^   @       @      Ǝ .@      Ǝ A@      ͎ T@      	 @       c  @    #  P  @    ]( V  A    9  P  A    9  V  \A    9  P  dA    9  V  pA    z) Վ A      )   	B    -  c  B    .    ?B    :  P  dB    (:  V  mB     mP uB    0 
 ~B    a  c  B     ێ B    [  mP B    q  
 B     c"   B         C     D   qC     D ! C     D  C       	 
D       	 @D     #   \D     # + D     # 䎪 D     #  D     #  (E     #  TE     #  dE     # V  %F      G PF     .  
 |F     M( " pG       G        H    & - H      H    4 " H       3H     a `
 LH     1   H    F    I     2  EI     I c  RI     I  bI       c  I     )   I     '   I     F4   I     (   I     /   J      `
 xJ     Z   J        5K     *  =K     3 EK     9 NK     7B   K      3 K       lL      @ L     F J L     Y! S Q      mP Q    T  mP Q     z'   R    !^ Z R    =^ ` "R        TR         R     n   R        R     [3   R       g S     #  q <S       x lS     $   S        S        S     P   ,T       \T       hU     G  V     _  dV        @W     )  hW       W     ;e S W      F X       X       TX     S \X    a  dX     n   sX     ŏ X    )e ˏ X    f ˏ X     s  X     f    X     |    Y         AY     ;    ZY       c  dY     n я Y     ڶ  [      P [     = ُ >\     =  X\     Y  @]      
 ]      
 ^      
 d^     \ 
 _      
 _      
 D`      Q
 b     ̱  `c      
 c     > 
 Xd     s 
 e      c  @e     m c  te        $f     P   pf     a  c  wf     -  zf       f     3   f       f     3   f     +  f     
   f       g     q0  
 @g       pg     ]  g    0 ]  g     ]  g     ݸ  u g    	  c  g    Ҽ  c  g    Ԡ   g    7  c  g    7    g    - c  g    .   g    - c  h    -   h    1  c  'h    2    5h    /  c  Bh    0    Ph    2  c  ]h    82    kh    F c  xh    F   h    L c  h    L   h    G c  h    #G   h    L c  h    L   h    5  c  h    5    h    57  c  h    H7    
i    1  c  i    1    (i    =1  c  5i    \1    Ci    9 c  Pi    I   ^i    N  c  ki    c    yi     c  i       i    0  c  i    1    i     c  i       i     c  i       i      j    Ԡ  j    	` j    	  j       k     a  c k    | F$k     ` 'k      9k      Bk     Jk    Ԡ  Rk    	h  Zk    	  bk    	F  jk    	S   rk    	o  zk    	\  k    	/   k    	  k    	  k    	K  k    	<   k    	|   k    	G   k    	   k    	2   	k    	n   
k    	   k    	*   k    	1   
k    	p   k    	x   l    	   l    	  l    	   l    	` (l    	  c 0l    	[   9l    	   Al    	` Il    	  Rl       ol     a  c vl    | Fl     ` l      l     l    Ԡ  l    	h  l    	  l    	F  l    	S   l    	o  l    	\  l    	/   l    	  l    	  l    	K  l    	<   m    	|   m    	G   m    	   m    	2   'm    	n   0m    	   9m    	*   Bm    	1   Km    	p   Tm    	x    ]m    	   !fm    	  "om    	  #xm    	` $m    	  c $m    	[   $m    	   %m    Ԡ  %m     a  c %m       %m    	 B %m    	pB  %m    	  &m    	I  &m    	  'm    	a  (m    	 )n    	 )	n    	  c )n    	[   )n    	   *"n    Ԡ $*,n       ,In     a  c ,Pn    ( e
,]n    8 O,qn    _  -n    n  -n    Ԡ X
-n     N  c .n      4.n       /n     Ǭ W/o    
\ p2o    
D p2'o    C p29o    $A p2Ko    @ p2]o     j  u2io     i  c 2po     ~  c 2o       c 2o     !  2o    b 3o     X p3o      v3p      	4q    T 4r    Ԡ X
4r    ( e
5r    8 O5r     j  u6r     i  c 6r     ~  c 6r       c 6s     I c 6s    !  6#s     . c 7*s    b 70s      v7{    Ԡ X
8{     j  u9{    	Ś  p9{    	  p9{    	  p9|    	ޚ  p9"|    	#  p94|    [  p9F|    	  p9X|    s  p9j|    	Û  p9||    >  p9|    	  p9|      v9}     SH &:4}    Ԡ  <<}     V 3<؆     A 3<E     .  <       <     / :<     / B>     / KA     / TD$     / ^H4     / hLd       sQĊ    Ԡ  Q׊    Ԡ  Q    Ԡ  R    # c T
    ,  T       c U2       UE      c VW       Vj    !R Wx    0R  W    q  c X       X    { ~Y     $ Y$     N  c Z,       
Z    Ԡ  Z$    Ԡ  Z8    	ڱ  c [?    	@ c [F    Ħ  c [N    ͦ   [W     ȱ  c \i     N  c \     @ c \    Ԡ  \    Ԡ  \Í    Ԡ C ]ލ    > _    ' _    Ħ  c _	    ͦ   _      
Y  ލ`    	:  c `    	@ c `     	? c `(     ȱ  c `D     1  ]`     @ c `     ? c `ӎ    Ԡ  `    Ԡ  `    Ԡ a    	ڱ  c c    	 
c     Ħ  c c(    ͦ   c1     +  dD     б   dR     Ι de       d      
Y  ލds    	  c dz    	M c d    	@ c d    	  c d    	  c d    	K! d    > d    ' d    Ħ  c dď    ͦ   d͏    Ԡ  eՏ    Ԡ e     a  c f       ]f,     {  ]fY       c f     M c f     ȱ  c fې     @ c f    	  c f      
Y  ލf    	  c f    	M c f
    	@ c f    	  c f    	  c f"    	K! f%    Ħ  c f-    ͦ   f6    Ԡ  g>    Ԡ gL    > hS    ' ho     a  c h       ]h     {  ]h       c h     M c h8     ȱ  c hg     @ c h    	  c h      
Y  ލh    	  c h    	M c h    	 Ah    	  c h    	@ c h    	O c h    Ħ  c h    ͦ   h    Ԡ  i       i     a  c i0     M c iT     ȱ  c i     @ c i    	  c i      
Y  ލi    	  c i    	M c i    	  c i    	  i    	K! i    	  c iɓ    	@ c iГ    > iד    ' i    Ħ  c i    ͦ   i    Ԡ  j
    Ԡ j'     a  c kC      kE       ]kr     {  ]k       c kΔ     M c k     ȱ  c k     @ c k;    	  c k      
Y  ލkC    	  c kJ    	M c kQ    	  c kX    	  k[    	K! k^    	  c ke    	@ c kl    > ks    ' k    Ħ  c k    ͦ   k    Ԡ  l    Ԡ lÕ     a  c mߕ       ]m     {  ]m9       c mh     M c m     ȱ  c m     @ c mז    	  c m      
Y  ލmߖ    	  c m    	M c m    	  c m    	K! m    	  c m    	a: c m    	ٗ 
m    	  c m    	  m    	@ c m    Ħ  c m%    ͦ   m.    > n5    ' nQ    Ԡ  n\    Ԡ n     a  c o֗       ]o     {  ]o0       c o_     M c o     ȱ  c o     @ c o˘    	  c o      
Y  ލoӘ    	  c oژ    	M c o    	  c o    	K! o    	@ c o    Ħ  c o    ͦ   o    Ԡ  p     a  c p'     M c pH     ȱ  c pw       c p     @ c p    	  c p      
Y  ލpʙ    	  c pљ    	M c pؙ    	  c pߙ    	K! p    	O c p    	@ c p    Ħ  c p    ͦ   p    Ԡ  q     a  c q1     M c qT     ȱ  c q       c q     @ c qΚ    	  c q      
Y  ލq֚    	  c qݚ    	M c q    	 Gq    	, Gq    	T Gq    	. Gq    	~  Gq    	+  Gq    	G Gq    	@ c q    Ħ  c q    ͦ   q    Ԡ  r       c rǛ     M c r     ȱ  c r     @ c r3    	  c r;    	:  c rB    Ԡ  rJ    Ԡ ra    	  c ui    :  c up    Ԡ  ux    Ԡ u    :  c x    Ԡ  x    Ԡ x       
{      |P     1            N0 <      ̐     K Ӑ(     hK ݐx     J 䐊       됋ܡ    T 5    Y  ލ<      c H    M c T    @ c [      c b    Ԡ  j    Ԡ 䍌s    Y  ލz      c     M c     @ c       c     Ԡ      Ԡ 䍍    Y  ލ      c Ĩ    M c Ш    @ c ר      c ި    Ԡ      Ԡ 䍎    Y  ލ      c     M c     @ c       c     Ԡ  $    Ԡ 䍏-    Y  ލ4      c @    M c L    @ c S      c Z    Ԡ  b    Ԡ 䍐k    Y  ލr      c ~    M c     @ c       c     Ԡ      Ԡ 䍑    Y  ލ      c     M c ȩ    @ c ϩ      c ֩    Ԡ  ީ    Ԡ 䍒    Y  ލ      c     M c     @ c     Ԡ  f    Y  ލm      c y    M c     @ c     Ԡ      Y  ލ      c     M c     @ c       c     Ԡ      Ԡ 䍓     Y  ލ'      c 3    M c ?    @ c F    Ԡ  N    Y  ލU      c a    M c m    @ c t    Ԡ  |    Y  ލ      c     M c     @ c     Ԡ      Y  ލ      c     M c ɫ    @ c Ы    Ԡ  ث    Y  ލ߫      c     M c     @ c     Ԡ      Y  ލ
      c     M c %    @ c ,    Ԡ  4    Y  ލ;      c G    G GN    +  GU    @ c \    Ԡ  d    Y  ލk      c w    M c     @ c     Ԡ       A    !4 A      A'    Y  ލ.      c :    M c F    @ c M    Ԡ  U     At    !4 A|      A    Y  ލ	      c     M c !      c (    a: c 1    ٗ 
8      c W    @ c ^    Ԡ  f    Ԡ 䍔o    Y  ލr      c ~    M c     @ c       c           Ԡ      Ԡ 䍕       i    Y  ލp      c |    M c     @ c       c     Ԡ      Ԡ 䍖    Y  ލ      c     M c Ư    @ c ͯ      c ԯ    Ԡ  ܯ    Ԡ 䍗    Y  ލ      c     M c     @ c       c     Ԡ      Ԡ 䍘#    Y  ލ*      c 6    M c B    @ c I      c P    Ԡ  X    Ԡ 䍙a    Y  ލh      c t    M c     @ c       c     Ԡ      Ԡ 䍚    Y  ލ      c     M c ̰    @ c Ӱ      c ڰ    Ԡ      Ԡ 䍛    Y  ލ      c     M c 
    @ c       c     Ԡ       Ԡ 䍜)    Y  ލ0      c <    M c H    @ c O      c V    Ԡ  ^    Ԡ 䍝g    Y  ލn      c z    M c     @ c       c     Ԡ      Ԡ 䍞    Y  ލ      c Ʊ    M c ұ    @ c ٱ      c     Ԡ      Ԡ 䍟    Y  ލ      c     M c     @ c       c     Ԡ  -    Ԡ 䍠=    Y  ލD      c P    M c \    @ c c      c j    a: c t      c     Ԡ      Ԡ 䍡    Y  ލ      c     M c     @ c Ʋ      c Ͳ      в    Ԡ  ز    Ԡ 䍢       1    Y  ލ8      c D    M c P    @ c W      c ^    Ԡ  f    Ԡ 䍣o    Y  ލv      c     M c     @ c       c     Ԡ      Ԡ 䍤    Y  ލ      c     M c ̳    @ c ӳ      c ڳ    Ԡ      Ԡ 䍥    Y  ލ      c     M c 
    @ c       c     Ԡ       Ԡ 䍦)    Y  ލ0      c <    M c H    @ c O      c V    Ԡ  ^    Ԡ 䍧g    Y  ލn      c z    M c     @ c       c     Ԡ      Ԡ 䍨    Y  ލ      c     M c     @ c Ǵ      c δ      Ѵ    Ԡ  ٴ    Ԡ 䍩       1    Y  ލ8      c D    M c P    @ c W      c ^    Ԡ  f    Ԡ 䍪o    Y  ލv      c     M c     @ c       c     Ԡ      Ԡ 䍫    Y  ލ      c     M c ̵    @ c ӵ      c ڵ    Ԡ      Ԡ 䍬    Y  ލ      c     M c 
    @ c       c     Ԡ       Ԡ 䍭)    Y  ލ0      c <    M c H    @ c O      c V    Ԡ  ^    Ԡ 䍮g    Y  ލn      c z    M c     @ c       c     Ԡ      Ԡ 䍯    Y  ލ      c     M c Ķ    @ c ˶      c Ҷ    Ԡ  ڶ    Ԡ 䍰    Y  ލ      c     M c     @ c 	      c     Ԡ      Ԡ 䍱!    Y  ލ(      c 4    M c @    @ c G      c N    Ԡ  V    Ԡ 䍲_    Y  ލf      c r    M c ~    @ c       c     Ԡ      Ԡ 䍳    Y  ލ      c     M c     @ c       c Ʒ      ɷ    Ԡ  ѷ    Ԡ 䍴ڷ           Y  ލ      c     M c +    @ c 2      c 9    Ԡ  A    Ԡ 䍵J    Y  ލQ      c ]    M c i    @ c p      c w    Ԡ      Ԡ 䍶    Y  ލ      c     M c     @ c       c     Ԡ      Ԡ 䍷Ƹ    Y  ލ͸      c ٸ    M c     @ c       c     K!      a  c     Ԡ      Ԡ 䍸    Y  ލ      c !    M c -    @ c 4      c ;    K! >     a  c E    Ԡ  M    Ԡ 䍹V    Y  ލ]      c i    M c u    @ c |      c     K!      a  c     Ԡ      Ԡ 䍺    Y  ލ      c     M c     @ c Ĺ      c ˹    K! ι     a  c չ    Ԡ  ݹ    Ԡ 䍻    Y  ލ      c     M c     @ c       c     K!      a  c     Ԡ  %    Ԡ 䍼.    Y  ލ5      c A    M c M    @ c T      c [    K! ^     a  c e    Ԡ  m    Ԡ 䍽v    Y  ލ}      c     M c     @ c       c     K!      a  c     Ԡ      Ԡ 䍾    Y  ލź      c Ѻ    M c ݺ    @ c       c     K!      a  c     Ԡ      Ԡ 䍿    Y  ލ
      c     M c %    @ c ,      c 3    K! 6     a  c =    Ԡ  E    Ԡ N    Y  ލU      c a    M c m    @ c t      c {    Ԡ      Ԡ     Y  ލ      c     M c     @ c       c     Ԡ      Ԡ ʻ    Y  ލѻ      c ݻ    M c     @ c       c     Ԡ      Ԡ     Y  ލ      c     M c $    @ c +      c 2    Ԡ  :    Ԡ C    Y  ލG      c S    M c _    @ c f      c m    Ԡ  u    Ԡ ~    Y  ލ      c     M c     @ c       c     Ԡ      Ԡ        )    Y  ލ0      c <    M c H    @ c O    Ԡ  W    Ԡ `    Y  ލg      c s    M c     @ c     Ԡ      Ԡ     Y  ލ      c     M c     @ c     Ԡ  Ž    Ԡ ν    Y  ލս      c     M c     @ c     Ԡ      Ԡ     Y  ލ      c     M c $    @ c +    Ԡ  3    Ԡ <    Y  ލC      c O    M c [    @ c b    Ԡ  j    Ԡ s    Y  ލz      c     M c     @ c       c     Ԡ      Ԡ     Y  ލ      c ľ    M c о    @ c ׾      c ޾    Ԡ      Ԡ     Y  ލ      c     M c       c     @ c     Ԡ  $    Ԡ -    Y  ލ4      c @    M c L      c S    @ c Z    Ԡ  b    Ԡ k    Y  ލr      c ~    M c       c     @ c     Ԡ      Ԡ     Y  ލ      c     M c ȿ      c Ͽ    @ c ֿ    Ԡ  ޿    Ԡ     Y  ލ      c     M c       c 
    @ c     Ԡ      Ԡ %    Y  ލ,      c 8    M c D      c K    @ c R    Ԡ  Z    Ԡ c    Y  ލj      c v    M c       c     @ c     Ԡ      Ԡ     Y  ލ      c     M c       c     @ c     Ԡ      Ԡ     Y  ލ      c     M c     @ c       c           Ԡ      Ԡ        y    Y  ލ}    @ c       c     M c       c     Ԡ      Ԡ     Y  ލ      c     M c     @ c       c     Ԡ      Ԡ     Y  ލ      c     M c     @ c       c     Ԡ  !    Ԡ *    Y  ލ.      c :    M c F    @ c M      c T    Ԡ  \    Ԡ e    Y  ލi      c u    M c     @ c     Ԡ      Ԡ     Y  ލ      c     M c     @ c       c           Ԡ      Ԡ            Y  ލ
      c     M c "    @ c )      c 0    Ԡ  8    Ԡ A    Y  ލE      c Q    M c ]    @ c d      c k    Ԡ  s    Ԡ |    Y  ލ      c     M c     @ c       c           Ԡ      Ԡ        Y    Y  ލ`      c h    @ c o    Ԡ  w    Ԡ     Y  ލ      c     @ c     Ԡ      Ԡ     Y  ލ      c     @ c     Ԡ      Ԡ     Y  ލ      c     @ c     Ԡ      Ԡ     Y  ލ      c     @ c     Ԡ  
    Ԡ     Y  ލ      c     @ c &    Ԡ  .    Ԡ 7    Y  ލ;      c D    @ c K    Ԡ  S    Ԡ \    Y  ލ`      c i    @ c p    Ԡ  x    Ԡ     Y  ލ      c     M c     @ c     Ԡ      Ԡ     Y  ލ      c     M c     @ c       c           Ԡ      Ԡ         M    Y  ލQ      c ]    M c i    @ c p      c w    Ԡ      Ԡ     Y  ލ      c     M c     @ c       c     Ԡ      Ԡ     Y  ލ      c     M c     @ c       c     Ԡ      Ԡ     Y  ލ      c     M c     @ c !      c (    Ԡ  7    Ԡ G    Y  ލJ      c V    M c b    @ c i      c p      s    Ԡ  {    Ԡ            Y  ލ      c     M c     @ c       c     Ԡ      Ԡ     Y  ލ       c ,    M c 8    @ c ?      c F    Ԡ  N    Ԡ W    Y  ލ[      c g    M c s    @ c z      c     Ԡ      Ԡ     Y  ލ      c     M c     @ c       c     Ԡ      Ԡ     Y  ލ      c     M c     @ c       c     Ԡ      Ԡ     Y  ލ      c     M c $      c +    a: c 4    ٗ 
<      c ^      a    @ c h    Ԡ  p    Ԡ y    Y  ލ}      c     M c     @ c       c     Ԡ      Ԡ     Y  ލ      c     M c     @ c       c     Ԡ      Ԡ            Y  ލ    Ԡ      O  *    Y  ލ.      c :    M c F    @ c M      c T    Ԡ  \    Ԡ e    Y  ލi      c u    M c     @ c       c     Ԡ      Ԡ     Y  ލ      c     M c     @ c       c     Ԡ      Ԡ     Y  ލ      c     M c     @ c       c     Ԡ      Ԡ     Y  ލ       c ,    M c 8    @ c ?      c F    Ԡ  N    Ԡ W    Y  ލ^      c j    M c v    @ c }      c     Ԡ      Ԡ     Y  ލ      c     M c     @ c       c     Ԡ      Ԡ     Y  ލ      c     M c     @ c       c      Ԡ      Ԡ     Y  ލ       c  !    M c  -    @ c  4      c  ;    Ԡ   C    Ԡ  L    K! O    Y  ލR      c [    M c d    @ c k      c r    Ԡ  z    Ԡ     K!     Y  ލ      c     M c     @ c       c     Ԡ      Ԡ     Y  ލ      c     M c     @ c       c     Ԡ      Ԡ     Y  ލ      c     M c     @ c       c     Ԡ  &    Ԡ /    Y  ލ3      c ?    M c K    @ c R      c Y    Ԡ  a    Ԡ j    Y  ލn      c z    M c     @ c     O c     Ԡ       A    !4 A      A,     PF     Y  ލ      c     M c     @ c     O c     Ԡ       A    !4 A$      A    K!     Y  ލ      c     M c     @ c       c      a  c     Ԡ      Ԡ     K!     Y  ލ      c     M c     @ c       c      a  c     Ԡ      Ԡ 
    K! 
    Y  ލ      c     M c (    @ c /      c 6      9    Ԡ  A    Ԡ L       	    Y  ލ	      c 	    M c 	    @ c 	    Ԡ  	    Ԡ 	    Y  ލ
      c 
    M c 
    @ c 
    Ԡ  
    Ԡ 
    Y  ލ      c $    M c 0    @ c 7    Ԡ  ?    Ԡ H    Y  ލL      c X    M c d    @ c k    Ԡ  s    Ԡ |    Y  ލ
      c 
    M c 
    @ c 
    Ԡ  
    Ԡ 
    K!     Y  ލ      c     M c     @ c       c      a  c     Ԡ      Ԡ     K!     Y  ލ      c     M c     @ c       c "     a  c )    Ԡ  1    Ԡ :    K! =    Y  ލA      c M    M c Y    @ c `      c g     a  c n    Ԡ  v    Ԡ     K!     Y  ލ      c     M c     @ c       c      a  c     Ԡ      Ԡ     K!     Y  ލ      c     M c     @ c       c      a  c     Ԡ       Ԡ 	    K!     Y  ލ      c     M c (    @ c /      c 6     a  c =    Ԡ  E    Ԡ N    K! Q    Y  ލU      c a    M c m    @ c t      c {     a  c     a: c     ٗ 
      c     Ԡ      Ԡ     K!     Y  ލ      c     M c     @ c       c      a  c     a: c       c #    Ԡ  +    K! .    Y  ލ2      c >    M c J    @ c Q      c X    Ԡ  `    Ԡ i    K! l    Y  ލp      c y    M c     @ c       c     Ԡ      Ԡ     K!     Y  ލ      c     M c     @ c       c     Ԡ      Ԡ     K!     Y  ލ      c     M c     @ c       c      Ԡ      Ԡ     K!     Y  ލ      c $    M c 0    @ c 7      c >     a  c E    Ԡ  M    Ԡ V    K! Y    Y  ލ]      c i    M c u    @ c |      c      a  c     Ԡ      Ԡ     K!     Y  ލ      c     M c     @ c       c     Ԡ      Ԡ     K!     Y  ލ      c     M c     @ c       c      a  c 
    Ԡ      Ԡ     K! !    Y  ލ%      c 1    M c =    @ c D      c K     a  c R    Ԡ  Z    Ԡ c    K! f    Y  ލj      c v    M c     @ c       c      a  c     Ԡ      Ԡ     K!     Y  ލ      c     M c     @ c       c      a  c     Ԡ      Ԡ     K!      Y  ލ       c      M c      @ c        c             Ԡ   $    Ԡ  0       !    Y  ލ!      c !    M c !    Ԡ  !    Ԡ !    Y  ލ"      c "    M c "    Ԡ  "    Ԡ "    Y  ލ#      c #    M c ##    Ԡ  #+    Ԡ #4    Y  ލ$8      c $D    M c $P    @ c $W    Ԡ  $_    Ԡ $h    Y  ލ%l      c %x    M c %    @ c %    Ԡ  %    Ԡ %    Y  ލ&      c &    M c &    @ c &    Ԡ  &    Ԡ &    Y  ލ'      c '    M c '    @ c '    Ԡ  '    Ԡ '    K! (    Y  ލ(      c (    M c (#    @ c (*      c (1    a: c (<      c ([    Ԡ  (c    Ԡ (l    Y  ލ)p      c )|    M c )    @ c )      c )    Ԡ  )    Ԡ )    Y  ލ*      c *    M c *    @ c *      c *    Ԡ  *    Ԡ *    Y  ލ+      c +    M c +    @ c +      c +    Ԡ  +    Ԡ +    Y  ލ,      c ,'    M c ,3    @ c ,:    G G,A    +  G,H    Ԡ  ,P    Y  ލ,S      c ,_    M c ,k    @ c ,r      c ,y    Ԡ  ,    Ԡ ,    Y  ލ-      c -    M c -    @ c -      c -    Ԡ  -    Ԡ -    Y  ލ.      c .    M c .    @ c .      c .    Ԡ  .    Ԡ .    Y  ލ/      c /
    M c /    @ c /       c /'    Ԡ  //    Ԡ /8    Y  ލ0;      c 0G    M c 0S    @ c 0Z      c 0a    Ԡ  0i    Ԡ 0r    Ԡ  1    Ԡ  1    Ng 2    hg  2    # c 3    ,  3    :  c 4    Y  ލ4    Ԡ  4    Ԡ  4    Ng 5    hg  5    # c 6    ,  6    :  c 7    Y  ލ7     Ԡ  7    Ԡ  7    Ng 8#    hg  8,    # c 94    ,  9=    :  c :D    Y  ލ:G    Ԡ  :Y    Ԡ  :c    Ng ;k    hg  ;t    # c <|    ,  <    :  c =    Y  ލ=    ? c =    @ c =    Ԡ  =    Ԡ  =    Ng >    hg  >    # c ?    ,  ?    :  c @    Y  ލ@    ? c @    @ c @    Ԡ  @    Ԡ  @    Ng A    hg  A!    # c B)    ,  B2    :  c C9    @ c C@    Y  ލCC    Ԡ  CU    Ԡ  C^    Ng Df    hg  Do    # c Ew    ,  E    :  c F    @ c F    Y  ލF    Ԡ  F    Ԡ  F    Ng G    hg  G    # c H    ,  H    :  c I    Y  ލI    @ c I    Ԡ  I    Ԡ  I    Ng J    hg  J    # c K    ,  K    :  c L#    Y  ލL&    @ c L-    Ԡ  L?    Ԡ  LH    Ng MP    hg  MY    # c Na    ,  Nj    :  c Oq    Y  ލOt    @ c O{    Ԡ  O    Ԡ  O    Ng P    hg  P    # c Q    ,  Q    :  c R    Y  ލR    @ c R    Ԡ  R    Ԡ  R    :  c S    Y  ލS    @ c S    Ԡ  S    Ԡ  S    Ng T    hg  T!    # c U)    ,  U2    :  c V9    Y  ލV<    @ c VC    Ԡ  VU    Ԡ  V^    Ng Wf    hg  Wo    # c Xw    ,  X    :  c Y    Y  ލY    @ c Y    Ԡ  Y    Ԡ  Y    Ng Z    hg  Z    # c [    ,  [    :  c \    Y  ލ\    ? c \    @ c \    Ԡ  \    Ԡ  \    Ng ]    hg  ]    # c ^    ,  ^&    :  c _-    Y  ލ_0    @ c _7    Ԡ  _F    Ԡ  _O    Ng `W    hg  ``    # c ah    ,  aq    :  c bx    Y  ލb{    @ c b    Ԡ  b    Ԡ  b    Ng c    hg  c    # c d    ,  d    :  c e    Y  ލe    @ c e    Ԡ  e    Ԡ  e    Ng f    hg  f    # c g    ,  g
    :  c h    Y  ލh    @ c h    Ԡ  h-    Ԡ  h6    Ng i>    hg  iG    # c jO    ,  jX    :  c k_    Y  ލkb    @ c ki    Ԡ  k{    Ԡ  k    Ng l    hg  l    # c m    ,  m    :  c n    Y  ލn    @ c n    Ԡ  n    Ԡ  n    Ng o    hg  o    # c p    ,  p    :  c q    Y  ލq    @ c q    Ԡ  q    Ԡ  q    Ng r%    hg  r.    # c s6    ,  s?    :  c tF    Y  ލtI    @ c tP    Ԡ  tb    Ԡ  tk    Ng us    hg  u|    # c v    ,  v    :  c w    Y  ލw    @ c w    Ԡ  w    Ԡ  w    Ng x    hg  x    # c y    ,  y    :  c z    Y  ލz    @ c z    Ԡ  z    Ԡ  z    Ng {    hg  {    # c |     ,  |)    :  c }0    Y  ލ}3    @ c }:    Ԡ  }L    Ԡ  }U    Ng ~]    hg  ~f    # c n    ,  w    :  c ~    Y  ލ    @ c     Ԡ      Ԡ      Ng     hg      # c     ,      :  c     Y  ލ    ? c     @ c     Ԡ      Ԡ      Ng     hg      # c     ,      :  c &    Y  ލ)    @ c 0    Ԡ  B    Ԡ  R    Ng Z    hg  c    # c k    ,  t    :  c {    Y  ލ    ? c     @ c     Ԡ      Ԡ      Ng     hg      # c     ,      :  c     Y  ލ    @ c     Ԡ      Ԡ       Ng     hg      # c     ,  "    :  c )    Y  ލ0    @ c 7    Ԡ  I    Ԡ  R    Ng Z    hg  c    # c k    ,  t    :  c {    Y  ލ~    @ c     Ԡ      Ԡ      Ng     hg      # c     ,      :  c     Y  ލ    @ c     Ԡ      Ԡ      Ng     hg      # c     ,      :  c     Y  ލ    @ c !    Ԡ  3    Ԡ  <    Ng D    hg  M    # c U    ,  ^    :  c e    Y  ލh    @ c o    Ԡ      Ԡ      Ng     hg      # c     ,      :  c     Y  ލ    @ c     Ԡ      Ԡ      Ng     hg      # c     ,      :  c     Y  ލ    Ԡ      Ԡ       Ng (    hg  1    # c 9    ,  B    :  c I    Y  ލP     ]    &     Ԡ }            0            Ԡ }     Ԫ  #     0   >    Ԡ  P    Ԡ  _    # c g    ,  p    ڱ  c w    @ c ~    Ԡ      Ԡ      # c     ,      ڱ  c     @ c     Ԡ      Ԡ      # c     ,      ڱ  c     @ c     Ԡ      Ԡ      # c '    ,  0    ڱ  c 7    @ c >    Ԡ  P    Ԡ  _    # c g    ,  p    ڱ  c w    @ c ~    Ԡ      Ԡ      # c     ,      ڱ  c     @ c     Ԡ      Ԡ      # c     ,      ڱ  c     @ c     Ԡ      Ԡ      # c '    ,  0    ڱ  c 7    @ c >    Ԡ  P    Ԡ  _    # c g    ,  p    ڱ  c w    @ c ~    Ԡ      Ԡ      # c     ,      ڱ  c     @ c     Ԡ      Ԡ      # c     ,      ڱ  c     @ c     Ԡ      Ԡ      # c '    ,  0    ڱ  c 7    @ c @    ڱ  c Z     
j    Ԡ  t    ڱ  c      
    Ԡ      ڱ  c      
    Ԡ      Ԡ      Ԡ          0  7     Ԡ                    z       &     ,     2    9 8    h >    4* D     J    У P     V     $ 7       	    Ԡ P    U \]     bj    \ hw           n    .            \ t     z         ?     B \     b    H h           n    G            M  c )    c   K    Hj  c ]    Zj   p     $ 74      	    Ԡ                                       ` c     `      T     Ԡ      #     ,      A       N      X    T     Ԡ     n/      Ԡ     %     ?       Y     Ԡ             >           Ԡ     3  '    3   0     =      E     3  H    Ԡ x    i                              &           c      ˑ     $ 74      	b    Ԡ k    O/ y    k/       $ 7    Ԡ     .     .       $ 7H    Ԡ Q      ԑi    ό  ڑ     $ 7    Ԡ      3      3         G       4     GB      ]    S  )p    _  )         Y       $ 7       	:    Ԡ  B    V P    o  _    $ m    =  |                          h     y             .        $ 7V    z d      s                  $ 7    Ԡ      Ԡ      M      Z  4    " <     $ 7      	    Ԡ            $ 7      	    Ԡ       G      Y     Gh      x     G          FN G    NN       G           $ 7T       
    Ԡ            $ 7,      	=    Ԡ  E    u  
\      
p     $ 7    	f     x? 
    ? Q      X       ^     H     l       
.     cF    J 
Y    J Jm    ~            $     Ԡ      	f 	     
     - c8    J !
K    J q_    ? 
v    Z c     
	     c	     $ 
    Ԡ  !    	f )     c @      X    N c o    N      @  c 
    M   
      c             $ 6    Ԡ  I    	f Q    J 
d    J x               7     K                   $ >   Ԡ  Q   	f Y     (l     T)   D (   D T)   K" (   Y" T)    (    T)   h# (   q# T)     (/     T)C     (V     T)j   $ (}   / T)     (   (  T)   jN (   sN T)   Q c    _     0  (( !   H  ) 5   +# (!H   :# T)!\   T/  ("o   a/  T)"   $  #   $   #   )  $   
*   $   ! (%   " T)%   ? f)&   ? )&     ('2     T)'F   ? (Y   @  (m    )     )   7  *   7   *     (+     T)+     (,     T),	    -$   ) $-U   ڠ .p    $.     [)/     u)/   M  [)0   a  u)0   C  1   d   1#     26      2J   5 (3]   5 T)3t    $ 4   Ԡ  5   	f 5    (5   * T)5   0  (6   H  T)6+   G  (7>   Z  T)7R   o (8e   | T)8y    (9    T)9   У (:   ۣ T):    (;    T);    (<    T)<   % (=(   3 T)=<    (>O    T)>c    (?v    T)?   F (@   Y T)@   >  (A   V  T)A   $ (B   8 T)B   T  (C	   g  T)C&	    (D9	    T)DM	   ` (E`	   r T)Et	   L (F	   Y T)F	   M (G	   X T)G	     (H	     T)H	    (I	   
 T)I
   G (J#
   G T)J8
     KX
     "(Kx
   Ԡ  K
   	f K
   ?5  (K
   L5  T)K
    (L
    T)L
     (M
     T)M   Ԡ  N   	f N#    N;    "NT   Ԡ  Og   	f Oo   Ԡ  O   h  O      O    P     P   0 Q   ?  Q     R   4   R)    )S1    SD     SX    $ T   Ԡ  U     U      U   .3 /V
     	V
      
V\
    $ 7V
    $ W
      5X<   Ԡ  YD   Ԡ  YL   Ԡ  Yb    c [t     [     c \      \    $ ]      
^   Ԡ X
^#    / c _*    N  c _1    L_9   b A_K     Y_   :  L`    O  A`   Ԡ `   Ԡ X
a      b(      bS   Ԡ b\    N  c cc   Ԡ X
cl    N  c ds   Ԡ X
d|    N  c e   Ԡ X
e     c f      f   0 c g   0  g   ( h     Yh   Ԡ X
i    N  c j   Ԡ X
j   ( Ak   <  Ak0     AkB   [  AkT   s  Akf   >  Akx     Ak   Û  Ak     Ak    / c k     Gk    ܥ  h	k   Ȥ  Al   0  Al"     Al/     Al<     AlI   p  AlV   S  Ald     Yl    γ  NmV    γ  Uni      p   Ԡ  q     c q   [  c q   T q      _q      jq    T qr       r/   Ԡ  r/   ,'  
r/   Z'  
r/    Gr/   E 
r/   d c r/   Ԡ |r 0    `F s80    
 sH0     s0   '  
s0   B'  
s0    Gs0   d c s0   q F"s0   E 
s0   Ԡ s$1      vx1    / v1     v1    
 v1    
 v2    Y  v2    . v(2    / v82   Ԡ vX2     y3    LF |4    E p5    E <7    F 9    
 ;     Œ;   :< Ғ;   S< ؒ;   3 ߒ;   B 咋<   H@ 쒌
<   V@ <   TA 쒍<   eA $<   B 쒎,<   B 8<    VZ =      =      P>       >      c >   Ԡ  >    >    >   V >   l >   g >   } >   r7 >   7 >   4 >   4 >    &>    ,?   2 &
?   D ,?    VZ A     B    p pD    C 3E       0E      E    7 \F    4 $G       G    M ;"H      c )H   Ԡ  4H    
  H    VZ I       J    b BJ    uC IjK      c qK   Ԡ  |K   T  L   s PL    VL      L       M    # ]M     cN     jN   Ԡ  N    rN    xN    rN    xN    N    N   2 N   3 N   : N   : O    VZ P      Q       xR    b rS    M ;S      c S   Ԡ  T       $T    !  8T   p ߒ@T    咰LT    VZ T      IU      c PU   Ԡ  XU    VZ U      U      c U   Ԡ  U    VZ V      W       W      c W   Ԡ  X    ߒ	X    咶X   4 X   4 $X    VZ X      X      Y    4  PZ       Z      c Z   Ԡ  Z   5 Z   5 Z   o5 Z   5 Z   6 Z   6 Z   	5 [   $5 
[   3 [   3 [   N3 &[   a3 /[   1 7[   1 @[    &H[    ,Q[   V &Y[   l ,b[   2	 j[   B	 s[   f ߒ{[    [   , ߒ[   I [    VZ  ^      b      ic    ! ,c    0 c       d      c d   Ԡ  d     d   ! d   3 d     d   
  d   = e   = e   = e   = e   PG ߒ'e   [G 0e    8e    Ae   1Y Ie   BY Te    VZ f      f    fG  g       \h    N  h      c h   Ԡ  h     i   ! i   3 i   = !i   = *i   	 2i   	 ;i   q ŏCi    Li   J ߒTi   ] `i    VZ Pk    {  mP#l      Dl    *   m       pm    N  m    E  Ǔ`n      c gn   Ԡ  on   < Ғwn   < ؒn   ]= n   o= n    VZ n      ,o      o       o      c o   Ԡ  o   p ߒo    o    VZ ,p      p      c p   Ԡ  p    VZ q       r      c r   Ԡ  r   = ϓr   M Փ%r    -r    6r    >r    Gr    Or   2 Xr    `r   ( ir     ߒqr    zr   ^; r   ~; r   ; r   ; r   6 r   7 r   9 r   9 r   : r   -: r   6 r   6 r   "; r   @; r   C9 r   a9 s   ; 
s   ; s   9 s   9 $s   [ ܓ,s   z 5s   ! ܓ=s   > Fs   S: Ns   o: Ws   
9 _s   (9 hs    VZ dt     {     ~    E $    >     *                                 c    Ԡ             8    8    ?5 !   W5 *   7 2   7 ;   l< ҒC   }< ؒL    VZ ŗ             $       h            ,            T      c [   Ԡ  c   = ϓk   M Փt    VZ        <             c    Ԡ     d ˏ   e     VZ ۝   )e ˏ          e  ]    ` f      Ot      k      y	    k  ]9      
G      U    = d    ,4  
      c    Ԡ     = ϓ   M Փ    Ģ   ( ͢    բ    ޢ   &    ;              ߒ   
    :    : "   `6 *   v6 3   8 ;   8 D   t3 L   3 U   71 ]   M1 h    VZ l    >  0      <    P                 '      c  .   Ԡ   6   = ϓ >   M Փ G    !O    !X   Y "`   s "i   & #q   H #z   Z $   p $    %    %    &   % &   1 '   #1 '   3 (Ʈ   3 (Ϯ   "3 )׮   83 )   : *   ; *   5 +   5 +   7 ,
   7 ,   B7 -   Z7 -$    VZ .ȯ     /    > /(      /       /      /ɹ      c 0й   Ԡ  0ع   9  0   [ 0   [ 0   = 1   .= 1   5 2   6 2   6 3%   46 3.   J ߒ46   ] 4?   1Y 5G   BY 5P    VZ 6<      7    O 8      8      8Ծ    *  8       8X    N  8    0 A8      c 8   Ԡ  8(      8n    VZ :      ;      <   Ԡ  <
   8 <   8 <   ?5 =#   W5 =,    VZ >      ?$       ?      ?      ?4      c ?;   Ԡ  ?C   d@ ?K   y@ ?T   A @\   A @e   7D Am   QD Av   CL B~   VL B   TA C   eA C   @ D   @ D   A E   A E   < ҒF   < ؒF    VZ G      HP     #I      c J   Ԡ  J   c1 J   u1 J    VZ Kl       L      c L   Ԡ  L   5 L   5 L    VZ MH      N       N      c N   Ԡ  N   = ϓN   M ՓN    O    O    P    P    Q    Q   j R   } R   R2 S   m2 S   2 T'   2 T0   2 U8   2 UA   3 VI   
4 VR   
8 WZ   (8 Wc   w8 Xk   8 Xt   C8 Y|   ]8 Y   : Z   : Z   | ߒ[    [    ߒ\    \    2 ]   92 ]   1 ^   	2 ^   1 _   1 _   P4 `   e4 `   $4 a   :4 a    VZ b    	 cP     cl     c      c    MW /cx      e%     eX    o  9f       g      c g   Ԡ  g   = g    > g	   R	 h   k	 h    ߒi"    i+    ߒj3   ! j<   YC kD   gC kM   B lU   B l^   A mf   B mp    VZ n<     #ob    k App      q       qL    N  q      c q   Ԡ  q    ؙ  Mq    ؙ  Vr    ؙ  _s    ؙ  ht    ؙ  qu`    ؙ  zv$    ؙ  w    ʙ  x    ؙ  y    ʙ  z@     b{H     {Q   Ԡ  |d     .)|                     Ԡ       W,      
    .     ؙ      ę  X    ؙ  Ĕ    _ ͔    Q ֔    -     Ԡ     T     ؙ  甏x    ʙ  \    ؙ       ʙ      ؙ  %    ʙ  .    ؙ  8@    ʙ  A    ؙ  J`    ʙ  V    VF l    E N   2  T         Ԡ              a   2  d      C   Ԡ  L    ؙ  x    ؙ  t    ʙ  ˕I	   2  M	   Ԡ  U	   2  X	   Ԡ  `	   2  c	   Ԡ  k	   2  n	   Ԡ  v	   2  z	   Ԡ  	   2  	      Օ	   Ԡ  	   2  	      S
   Ԡ  [
   2  _
      Օf
   Ԡ  n
   2  r
   Ԡ  z
   2  }
   Ԡ  
     b
     
   Ԡ  
     ܕ
    *     ؙ      ʙ  p    ؙ  	    ʙ  
     b
     
   Ԡ $
     ܕ
    * (    ,! +     ;`    ? {    h  G      Q     Y     a      j,    f s    x  }    %      " d    7 p     Ж    ^- ږp    }         Ԡ  $   Ԡ  ,      
4    ؙ  X    ʙ      ؙ  (    ^ 4
8    ʙ  @\    ؙ  M    ^ Y    ʙ  @    ؙ  e    ʙ  .@    ؙ  nL     J wd     ؙ   !    ʙ  .!|#    # ##    ؙ  %$    ؙ  %%    ʙ  &&    ؙ  ('    ʙ  *(    ؙ  ̗.(    ʙ  ՗/<)    ؙ  ߗ1)    ؙ  3+    ʙ  4-    ؙ  5 0    ʙ  62    ؙ  75    ʙ  88    ؙ  !99    ʙ  5@9     DC9     OC9    sD9    [D9   R9 F"E9   Ԡ gE:    n'   K;      K;    E ~K=      L >    L>   * L>   T M?   Ԡ  M?   Ԡ M?   2  O?   Ԡ  O@   X 
O@   c O@   Ԡ  P      
2  P(@    $ P@   2  U@   Ԡ  U@      U<A    ʙ  ĘY|A    ؙ  ͘ZC    ʙ  ٘\D    ؙ  ]XE    ʙ  _E     aCF      c|F    ؙ  	d4G    ʙ  gG    ؙ  $iJ    ʙ  3lL    ؙ  @oZM     :ptM    ؙ  IqM    ʙ  RtN   T wN    > ,wN    ؙ  ayN    ؙ  a{N    ؙ  r}O      DP     P     P    ʙ  Q    ؙ  S      ʙS    IJ יT    ʙ  㙘U    ؙ  V      lW    ʙ  X    ؙ  X    ؙ  +Y    ʙ  F[    ؙ  V[    ؙ  b\    ʙ   ]      n]      x^    ؙ  _    \ $`    
 `      a    ؙ  b    ʙ  @d    ؙ  d    ʙ  Ś8e    ؙ  Κe    ʙ  f      g    ؙ  ښh    ʙ  4k     tk          Ԡ        O9                   Ԡ        J                      k    ؙ  %k    ؙ  .,l    ؙ  6dl    ʙ  >l     Gl    /  Sl     ^l      g m     pHm      ypm     m    n m    l+  ^$m    _ @n    _ 	{n     
n      o    @  ě
o     ˛p    3 қp    %  ۛPq    ؙ  Xt    ʙ  0v    ؙ  
v    ʙ  nv      n|w    ؙ   x    ʙ  #z      &{    ؙ  ")|     +*}     b.}     .}   Ԡ  /~    8  @/<~      H1x~    ؙ  O2    ʙ  ^5    *'7    h7     28
    38   , 8'   _M 84   @  8A   P5 38N   q 38[   x* G8h     38u   Ԡ o8    ؙ  
<     <     +$=D      G>    ʙ  >    $'@    @     -A   u] A   , A   , A͆    2Aچ   b.  GA     3A   Ԡ A     B    ؙ  
C      GC     +$C    ʙ  D)   Ԡ  F1   U  F9   d  SFB   ,  GGY   Ԡ G   Ԡ L    ؙ  Oĉ   Ԏ P̉    PՉ   Ԡ  Q   Ԡ ȜQt    ؙ  ؜T     
W    J Wh    ʙ  Yd    ؙ  \    ʙ  ^    ؙ  `D    ʙ  %bܕ     /d\      9f    ؙ  @g     ʙ  Ih     Sj      ]l      dm<    ؙ  not    ʙ  wp      r     s̘    ؙ  u    ʙ  v,    ؙ  x    ʙ  y   /  z   A  z   Ԡ ĝ{4      ѝ~P    H ڝ    ݰ ꝃؚ   Ԡ           H 
P     |    ؙ      ʙ  '   Ħ  c    ͦ      d  c    r               Ԡ C М   Ԡ 04    ؙ  
`     +$      G   T    D  7   X  C   Ԡ            PԞ    " W4     Pl    ؙ  ^    ę       fh   T    X q   f    U     ld w   xd }   S
 	   j 
Ƨ    ϧ   o-  Gק   -      -  ێ   -       ێ            ' Վ      
2        3            !* '   Ԡ h      @      
é   Ԡ 7Щ           Q      n 8   Ԡ 7            %8                    Q   Ԡ 7     P   +                S   Ԡ 7]   2  a    + x    3  |           ۫   Ԡ 7   2      +      3        4     8    -    Ԡ 7   2      3        /     H    7 F"`    c  Gt      ̭     ˞   T    Ԡ 7   2      3        8     H   Ԡ 7R   2  V     f    3  l         Ԡ 7   2           3           Ԡ     Ԡ ݞ   Ԡ ݞ,   Ԡ 86   Ԡ 8@   Ԡ 8J   Ԡ 8T   Ԡ  \   Ԡ 8f   Ԡ 8p   Ԡ 7z   2  ~         3           Ԡ 7%   2  )    3  ;     =   Ԡ 7H   2  L    3  x     l   Ԡ 7v   2  z     }    3           Ԡ 7   2      3      n Է   T    Ԡ S      N      &  p9      
K     Ԡ S      N      &  9      
K  @    M 9   Ԡ S   K      &  ʺ   Ԡ SӺ   K   ׺    &       Ԡ S
   K      &  
#   Ԡ S,   K  0    &  9   Ԡ SB   K  	F    &  	O   Ԡ SX   K  \    &  (e   Ԡ Sn   K  r    &  2{   Ԡ S   K      &  <   Ԡ S   K      &  <   Ԡ S   K      &  <   Ԡ SĻ   K  ǻ    &  <л   Ԡ Sٻ   K  ݻ    &  <   Ԡ S    K  !    &  <!   Ԡ S#   K  $	    &  <$   Ԡ S&   K  '    &  <'(   Ԡ S)1   K  *4    &  *=   Ԡ S,F   K  -J    &  -S   Ԡ S/\   K  0`    &  <0i   Ԡ 72s   2  4x      D4"    3  54     K5M   Ԡ 76W   2  8\      D8c    3  9u     K9   Ԡ 7:   2  <    3  <    n R<   T =<   Ԡ S=H      N>      &  C:A   Ԡ SC    &  `D      jF   Ԡ SG    &  `H3      jJ@   Ԡ SKI    &  qLW   Ԡ 7Na   2  Pe     KP~    3  Q      DQ   Ԡ 7R"    3  T%    + T<     TP    7 F"Th     yT   Ԡ 7V   2  X      Xs   Ԡ 7X}   2  Z      ZX    1 #Z   Ԡ 7Z   2  \    3  \     \   Ԡ 7^   2  `    3  `    '  `)    `,   Ԡ 7`6   2  b9    3  bL    '  b   y  b    b   Ԡ 7b   2  d    3  d    d    '  d   Ԡ 7d	   2  f    3  f       c f    
  c f      f     f8    '  h0   y  h@    hC    C' 
hh   Ԡ 7is   2  kv    3  k     kl   Ԡ 7mv   2  o|    '  o    [ o   Ԡ o   2  q    3  q    q    '  q     q   Ԡ 7s(   2  u,    3  u0     u$   Ԡ 7w/   2  y3    3  y8     y   Ԡ 7{   2  }     }    3  }      }   Ԡ 7}   2      3  $      L         ' r   Ԡ 7   2      3                  j  x     
    7 F""   Ԡ 7-   2  1    3  4        Ԡ 7   2      3       n   Ԡ 7x   2  |    3           Ԡ 7   2      3  (    n X   T    Ԡ S         Ԡ S         Ԡ S         Ԡ 7   2      3      n D   T    Ԡ S      ͟	   Ԡ S      ן   Ԡ S$      ן-   Ԡ S6      ͟f   Ԡ So      ͟   Ԡ 7   2      3      n ߟ   T )   Ԡ S2      ퟰ@   Ԡ SI      T   6     6     x6     6     o< 0   < c   <    2<     6      [<      Ԡ                      ׍   Ԡ ,#   	K {=+   K 64   Y  =<   Y  CE    
M    V   Ԡ 7`      4           z  I27   Ԡ 7A   2  E    3  H    z  I2   Ԡ 7   2      3      z  I2   Ԡ 7      X    3         =      d' =~         / a<   Ԡ 7   2      d' J     Q   Ԡ 7   2      d' b     i   Ԡ 7       L    3          =       =r     u   Ԡ 7   2       z         Ԡ 7   2                Ԡ 7   2      3                 ?  8,   Ԡ 7   2      3      n    T    Ԡ S      qN        >>g   Ԡ Sp      }N        a>      
߷  n>   Ԡ S       N        |>      
߷  n>   Ԡ S   ߷  n>            Ġ   Ԡ S   ߷  n>      ˠ   Ԡ S   ߷  n>      נ!   Ԡ S *   ߷  n>!-      ˠ!>   Ԡ S%G   ߷  n>&J      ˠ&[   Ԡ S*d   ߷  n>+k      +|   Ԡ S/   ߷  n>0      0   Ԡ S4   ߷  n>5      5   Ԡ S9   ߷  n>:      
:s   Ԡ S>|   ߷  n>?      
?,   Ԡ 7C6   2  E:    3  EL    n E|   T F   Ԡ SF      NG        4?J   Ԡ SL      (NM      >H V?Q        I?S?   Ԡ SW      
  h?XH    >H V?X]   Ԡ SZ      
  ?[f    >H V?[{   Ԡ S]      MN^        ?b      >H V?f   Ԡ Sh     h?i      +i   Ԡ Sm     h?n	      7n3   Ԡ Sr<     h?s?      EsP   Ԡ Sw\      Sx    >H V?|   Ԡ S~$     h?'      c8   Ԡ SA     h?D      qU   Ԡ S^     h?a      qr   Ԡ S{     h?~      +   Ԡ S      }    >H V?   Ԡ S      S    >H V?   Ԡ S      }    >H V?   Ԡ 7   2      3          Ԡ 7   2      3          Ԡ 7   2      3      n <   T    Ԡ S      ZN        -@5   Ԡ S@      eN        M@      
h  Z@   Ԡ S   h  Z@         Ԡ S   h  Z@         Ԡ S   h  Z@!      2   Ԡ S;   h  Z@>      O   Ԡ SX   h  Z@[      l   Ԡ Su   h  Z@y         Ԡ 7   2      3        d        Ԡ 7   2      3        9     L    ?  8,j   Ԡ 7t   2  x    3                 ?  8,5   Ԡ 7?   2  C    3  X      t         ?  8,   Ԡ 7   2      3                 ?  8,,   Ԡ 76   2  :    3  L               ?  8,   Ԡ 7   2      3        s         ?  8,   Ԡ 7   2      3             ?    ?  8,]   Ԡ 7g   2  k    3                 ?  8,,      9    '0 c @    5 ͡M   Ԡ  U    ԡ]    ڡf   c ԡn   y ڡw                      k A         #                        VZ         c                vA O   Ԡ  m    ;      ) 	     	      	A     ) 	p     hc  ,
	       8	    T 	(   Ԡ D	    N	    T	    
	    	    	    [	      3  	        c 	    ! 	   ]' c 	        	      d 		      b	D   Ԡ D	N    3  	p      c 	      	    d 		   Ԡ D	    3  	      c 	    ]' c 	      	    d 		    A h	x   ĵ s	    ~	(   oa 	|     	     	L     		    
 	    
  	     #	@    3 %	l     '	H"    j  )	t9      0	9      ʢ1	9      Ӣ2	@:     ܢ3	c:   T 4	:    У  4	:      7	:    )  :	:      =	8;    u  B	m<      2G	<      J	=    f  ?M	=    z  KQ	>    ( ?U	P>     KY	@    
d W]	@    ^  mc	@      yg	@    ;  h	A    " Fi	@A   Ԡ i	[A    K  k	lA     l	B      n	C    &  o	4D    Ճ  q	D      s	D    4 XFs	D   Ԡ  s	D   ' s	D    ^E s	4E    :  £v	E    E ˣw	(F    c) ԣx	<F    9) 
y	nF    k  ۣz	F    J) {	F    &) }	F   T 	F     	F    /  	G    l:  b		1G   T 	=G   Ԡ KF	FG   D 	SG    gI  	ZG   Ԡ  	bG    UI 	G   T 	G   Ԡ 	G       	G    ɴ   	G   V 	G    N	G    T	G   
 	G   
  	G   /  	H   A  	H   7:  P 	H   L:  V 	H   W 	'H   c '	0H    6	8H   Ѻ =	AH   .  	KH    2  	XH    2   	mH   	  c 	H      	HI    w
  	PK   "  G	XK   "   	aK      	K     E	K      N	K     G	L     U	L     !	#M     +	:M    /  	\M      \	N    m  e	O       	O      m	@P    > G	P     	<Q     w	dQ     	Q     V 	Q      
	Q    $  	Q    B  	bR    += 	|R    +K {=	R      c 	R       	R      c 	R    ;] 	S    D  	S    -I  	S    ] 	T    ( 	V    ( 	XY    e   	Y   Ԡ ̤		Z   N ᤸ	Z   f ꤸ	Z      	4Z   Ԡ  	AZ     	TZ   Ԡ  I	]Z   Ԡ I	gZ    R  		sZ   Ԡ OB	|Z   Ԡ I	Z    ]" 		Z    ]" 	Z    Ғ  	Z    	Z      	
[      	+[   Ԡ  	3[    	E[      	h[    I W	]    p W	_    % W	T`     W	`    A W	$a     W	a     W	b   Ԡ  	b   Ԡ 7	b   2  	b    3  	b      	c    + 	=d     	@d   Ԡ 7	Jd   2  	Nd     	Qd    3  	Td      	e   Ԡ 7	e   2  	e    3  	e      D	f    + 	f     K	g   Ԡ 7	g   2  	g    3  	g      D	g    + 	Th     K	h   Ԡ 7	h   2  	h    3  	h      D	i    + 	i     K	;j   Ԡ 7	Ej   2  	Ij    3  	Lj      D	j    + 	j     K	j   Ԡ 7	j   2  	k    3  	k      D	|k    + 	k     K	k   Ԡ 7	k   2  	k    3  	k    n 	!l    + 	8l   T 	=m   Ԡ (	Mm     0	im   Ԡ 5	rm      9	m    <  B	m      K	m    F R	In    0	Qn   Ԡ  	Yn   Ԡ 7	cn   2  	gn    3  	ln     \	n    n b	n   T 	o   Ԡ S	o      PG	o   Ԡ S	o      p	p   Ԡ 7	p   2  	p    3  	p    n {	p   T 	(q   Ԡ 7	2q   2  	6q    3  	<q    n 	dq   T 	ir   Ԡ 7	sr   2  	wr    3  	|r    n 	r   T 	t   Ԡ 7	t   2  
t    3  
$t    n 
Tt   T 
u   Ԡ 7
u   2  
u    3  
u      D
u    + 
v     K
kv   Ԡ 7
uv   2  
yv    3  
|v    n 
v    + 	
v   T 	
2x   Ԡ 7	
<x   2  
@x    3  
Dx     
z    n ԥ
z    + 
z   T 
z   Ԡ '
z      N
{     GK
      n ]K
9{    
F{   Ԡ '
O{    n 
W{   Ԡ '
`{      
{    n 
{   Ԡ '
{      
{    n 
{   Ԡ '
 |       
P|    n #
S|   Ԡ '$
\|      %
|    n (
|   Ԡ ')
|      *
}    n -
}   Ԡ '.
}      /
d}    n 2
g}   Ԡ '3
p}      4
}    n 7
}   Ԡ '8
}      9
~    n <
~   Ԡ '=
(~      >
x~    n A
{~   Ԡ 'B
~      C
~    n F
~   Ԡ 'G
~      H
$    n K
'   Ԡ 'L
0      M
    n P
   Ԡ 'Q
      R
    n U
   Ԡ 'V
      'W
       4Z
-    n ;[
0   Ԡ 7\
:   2  ^
>     K^
W    3  _
\      D_
2   ' Վ`
:   ' `
C   :  P a
K   (:  V a
T    b
g   ( b
o   4 b
x   Ԡ Ic
     \f
     Vg
<      ei
h    و  qk
Ć    =  l
    = V m
      O/  |n
   26 F"o
   ?6 )o
     Gp
Ƈ      p
χ     q
ׇ     u q
   O/  |r
   Ԡ  s
      s
(   (   s
1    O/  |t
O   Ԡ  u
W    u
_     u
h   - Gv
p   -  v
y   ( Gw
   (  w
     x
     u x
   O/  |y
   Ԡ  z
     z
   (   z
    O/  |{
&   Ԡ  |
.   `) z|
6   q) |
?     }
G     u }
P   O/  |~
v   Ԡ  
~   5  c 
   >   
   O/  |
   Ԡ  
   8 G
   B  
     G
ĉ      
͉    O/  |
   Ԡ  
   6 F"

   6 )
    G
   ,  
$     
,     u 
5   O/  |
m   Ԡ  
u     
}   (   
   û 
   ػ 
    O/  |
   Ԡ  
   6 F"
    6 )
)    G
1   ,  
:   . G
B   .  
K     
S     u 
\   O/  |
   Ԡ  
     
   (   
ʋ    O/  |
   Ԡ  
   6 F"
   6 )
    G
	   ,  
   . G
   .  
#   -) G
+   ;)  
4     
<     u 
H   O/  |
   Ԡ  
     
   (   
Ȍ   û 
Ќ   ػ 
܌    O/  |
T   Ԡ  
\   R7 F"
d   b7 )
m     
u     u 
~   O/  |
   Ԡ  
   Ԡ 7
   2  
     
    3  
      
   Ԡ 7
   2  
    3  
     
    E;  
p    
;  
   Ԡ 7
ڒ   2  
ݒ    3  
     
   Ԡ 7
   2  
     
)    3  
,      
   Ԡ 7
     
    I c 
ݖ   	y  
      '  
      
 
   Ԡ 7
   2  
     
'    3  
,      
ݗ   Ԡ 7
   2  
    3  
      
ɘ    + 
     
    7 F"
   Ԡ 7
   2  
    3  
       
T    + 
l    
 
      
|      
     
    7 F"
7   Ԡ 7
A   2  
E    3  
H      
    + 
     
؛     
    7 F"
+   Ԡ 7
5   2  
9    3  
<      
8     
L    7 F"
d    9 
d    z  K

   Ԡ 7
$   2  
(    3  
,     
   T 
      A 
      A Q
   Ԡ S
ġ   U  
̡   d  S
ա   A D
   A K
        N
     N
   Ԡ S
%   U  
-   d  S
6   A 
V   A 
        
o   Ԡ '
~   S
 	
   e
 '
   A æ
   A ʦ
        N
     N
   Ԡ '
Ϣ   S
 	
ע   e
 '
   A Ѧ
   A ئ
        ߦ
	   Ԡ '
   S
 	
    e
 '
)   A 
C   A 
        N
f     N
n   Ԡ S
}   U  
   d  S
   A 
   A 
        N
A     N
I   Ԡ S
X   U  
`   d  S
i   A 
   A 
        (N
     N
   Ԡ S    U  Ǥ   d  SФ   A    A         MN6     N>    i  N	G   Ԡ S
V   U  ^   d  Sg   A    A 
        ZN     N   Ԡ S   U  ť   d  SΥ   A     A '        eN     N   Ԡ S*   U  2   d  S;   A .g   A 5         qN!     N&   Ԡ S'   U  (   d  S(   A <)   A C*        }N+     N1   Ԡ S2"   U  3*   d  S34   A <4   A C5        N6     N<    i  N=ç   Ԡ S>ҧ   U  ?ڧ   d  S?   A J@   A QA        NB     ND      XEp      bG     mJh     zOԩ    H S      
  V      
 \1V'     V        X>    y  [      h ]S   Ԡ  _      `  N_[     Nbd      d    h g      n Ni   Ԡ  j      j   Ԡ  lǪ    \1lʪ    n ƧlҪ    `  Чm۪     pު   Ԡ  p    \1p    n ۧp      q     `  s	     v   Ԡ  v    \1v    n v    `  w(     z+   Ԡ  z3    \1z6    n z>    `  {G     ~J   Ԡ  ~R    \1~V    n ~^    `  g     j   Ԡ  r    \1y    n     `          Ԡ      \1    n     `          Ԡ      \1    n 
ƫ    `  ϫ     ҫ   Ԡ  ګ    \1ޫ    n (    `  6        Ԡ      \1    n C	    `  Q        Ԡ      \1%      9    n CA    `  QK     O   Ԡ  W    \1^    n Cf    `  Qp     t   Ԡ  |    \1    n C    `  Q        Ԡ      \1    n C    `  Q        Ԡ  Ƭ    \1ͬ    n ^լ    `  lެ        Ԡ      \1    n     `          Ԡ      \1    n     `  &     *   Ԡ  2    \19      yF    n N    `  W     [   Ԡ  c    \1j      w    n     `          Ԡ      Ǯ è      
  ̨      
 O+     Ҩ        ܨ    y     Ԡ        n  O     N$      ܨC   Ԡ  K      S   Ԡ  [      h   Ԡ  p         Ԡ      O+    n  #     ̨&   Ԡ  .    O+2    n  ;     ̨?   Ԡ  G    O+K    n  T     ̨W   Ԡ  _    O+b    n  k     ̨n   Ԡ  v    O+z    n  &     ̨   Ԡ      O+    n  1     ̨   Ԡ      O+    n       ̨   Ԡ      O+    n  ɯ     ̨̯   Ԡ  ԯ    O+د    n       ̨   Ԡ      O+    n  >     ̨    Ԡ      O+    n  >     ̨   Ԡ  $    O++    n  >4     ̨8   Ԡ  @    O+G    n  >P     ̨T   Ԡ  \    O+c    n  >l     ̨p   Ԡ  x    O+    n  >     ̨   Ԡ      O+    n  >     ̨   Ԡ      O+    n  >     ̨İ   Ԡ  ̰    O+Ӱ    n  >ܰ     ̨   Ԡ      O+    n       ̨   Ԡ      O+      I    n  S)     ̨-   Ԡ  5    O+<    n  E     ̨I   Ԡ  Q    O+X    n  `a     ̨e   Ԡ  m    O+t    n  `}     ̨   Ԡ      O+    n  `     ̨"   Ԡ  "    O+"    n  `"     ̨%   Ԡ  %    O+%ȱ    n  %ѱ     ̨(ձ   Ԡ  (ݱ    O+(    n  >(     ̨+   Ԡ  +    O++     n  m+	     ̨.
   Ԡ  .   Ԡ 7.       D0      7  z1    + 3     K3ǲ   Ԡ 74Ѳ   2  6ղ    3  6ز    7  z6   Ԡ 78   2  :    3  :     7  z:   Ԡ 7<   2  >    3  >      >    + >     >   Ԡ >     ?(    ?1   Ԡ @:   L AB   ^ AK    BS    B\    Cd    Cm   s Du    D~    E    E   |! F   ! F    7B  G̶   &  Gҷ      G      H#   p H,      H   0 H      H   & H   u&   H׹   dB H    I   [  I     IG    IT   !  It    B  I   |? I      I   Ԡ I(    &  J    u&   J    [  JJ      JL    !  JP    B  J   |? J      J   Ԡ J    7B  Kӽ   |? K׽      Kڽ   Ԡ K    ũL   9 ˩L   b ũM   w ˩M    ҩN
    ةN   C O   C O'   C P/   C P8   @ Q@   A QI   @ RQ   @ RZ    7B  St      S    B  S    ҩS   GA S   @ ߩS   |? V      V   Ԡ V
    W    W   	9 X.   	0 X>    7B  XX   &  X     B  X6   |? X:      X=   Ԡ  XF   Ԡ  YO    YW    Y`      
Zc    s [k    B  [~   Ԡ [   |! \   ! \    n  ]    7B  ]    ]    B  ]0    < ]      
 ^      
  ^       F_       `   Ԡ `   ^ a   	^ Rb   ^ [b   8 c    e   @ g   U  h   ׆ i    
i    !j    j     c j/   $  c j=     `
jL    ./  `
k[    lc    lk    rlp   : 'l     l     c l     l     .l    a  n(   .   n5     
n>   Ԡ  oF    oN    oW   Ԡ ph    8q    ?q@    (  qf   '  q   \S q    S q     H(  q   <(  q   S q   N q   xZ q   Q q'   ZU qC   Q q`    S q    O q    Z q`    Q qt    HV q    Q q    7*  qx   )*  q   T q   U q   W q   V q   7T q    Z q<   W qX    T q    -U q    W q    V q     PT q    Z q    -W q    t*  q   b*  q3   S qO   N ql    S q    N q8    )  qo   )  q   kY q   X q    Y q    Y q|    '  q   '  q   T q
   '[ q)   JO qE   PP qd    T q    >[ q    aO qx    iP q    *  q   *  q   Y q$   [ q@   [ q\    Y q    [ q    j[ q    fG oq$   JG oqx    n)  q   [)  q   ,X q   ~U q   V q0    GX q    U q    V q    *  q
   *  q&   P qB   vW q^   P qz   cQ q   Z q    P q    W q    'P q    uQ q     2Z q    G oq   G oq    (  qu   w(  q   R q    R q   X q<    X qs   S q    "S q   P q    Q q    H oq   H oqH    (  q   (  q   U q    V q    O q    O q   Ԡ  q   G c r   X  r   kF 
s     s   0  s      c s     s-     c s:   z  sJ     c sW     sg   &  c st     s    c s   `  s    c s    s     c s      s    < t    u	   Ԡ u     Fv      Ox/    !  
y2      Xz8    N 
{      
Rf |     ]|    P  d}    a  m     	K   Ԡ  `      w   Ԡ      |
      Ԡ      |
      Ԡ  
   Ԡ      |
   5   Ԡ  =    	  |U   Ԡ  `    F	     Ԡ           Ԡ           T    Ԡ      J             y      f  &      9      L      _    }  r    k      *       !      !             
            Q  
    	      )  0      C      V       i    {!  |    s       
      /            M      J                     '    !  ?       W    
  o    @            ^      [      ,                    !               -    Y  @      S    o  f    l  y    =                    !     T    Ԡ      !     T    Ԡ           T    Ԡ            T #   Ԡ  +      7   T C   Ԡ  K      q    ~     Ԡ      	     T    Ԡ            T    Ԡ            o  1      P    !  o         Ԡ      
     T    Ԡ                     F      l          k            8               g         Ԡ      U
  b    Ԡ      
                 T    Ԡ        ʪ     ^   Ԡ  %   Ԡ  -      ӪQ   T ]   Ԡ  e      ܪm    H  z    s                  W     Ԡ      v	  I   Ԡ      	     Ԡ      	  Q   T    Ԡ        J    v  b   Ԡ        I   T    Ԡ      (      V            >        !      (      /    J   6    <!       Ԡ                      =   Ԡ  E      'o   Ԡ  w    ~  0   Ԡ        7   Ԡ        0    S
  0   Ԡ        0    g
  0      0   Ԡ  #      @6    S
  @I   Ԡ  Q      @d    g
  @w      G   Ԡ        N    
  W      `   T    Ԡ      s  i     Ԡ               r       ~
   Ԡ  
      

    
  
%   Ԡ  
-      
@    g
  
S   Ԡ  
[      G
n    S
  G
   Ԡ  
      G
    g
  G	
      @

      G
   Ԡ  
      
   T 

   Ԡ  

      

    -
  
      
      
       
)   T 
5   Ԡ  
=      
@    9  
C    \  
^      
g      Ϋ
p   Ԡ  
x    
  ݫ
   Ԡ  
      
    
    Y   
   	  
   v  
   	 
   ) 
;   a 
C   T 
O   Ԡ  
W      
_      
g    e  
o    n  
w       
      !
      "
    z   #
    l!  $
    "  %
    F   &
    
  '
      (
      )
    =  *
    :  +
      ,
      -
   T .
   Ԡ  .
      .
      /
    e  0
   Ԡ  1
    j
  1
+   Ԡ  2
3      2
<   T 4
H   Ԡ  4
P      
4
X      
5
`    e  
6
h   T 7
t   Ԡ  7
|      7
      8
    e  9
    n  :
      ;
   T <
   Ԡ  <
      )<
      )=
   Ԡ  >
      G>
   Ԡ  ?
      0?
   T @
   Ԡ  @
      7@
      7A
"    e  7B
*    n  7C
2      7D
:      7E
B      7F
J    z   7G
R    l!  7H
Z    "  7I
b   T J
n   Ԡ  J
v      EJ
~      EK
    e  EL
    n  EM
      EN
      EO
      EP
    z   EQ
    l!  ER
    "  ES
    F   ET
   T U
   Ԡ  U
      SU
      SV
    e  SW
    n  SX
      SY
      SZ
   Ԡ  [
    w  ,[
4   Ԡ  \
<    
  ,\
V   T ]
b   Ԡ  ]
j      ]
}    E  
^
      a_
   Ԡ  `
    .  G`
    
  @a
      0b
   Ԡ  c
    -
  hc
   Ԡ  e
    )	  he
   Ԡ  g
    U  g
   Ԡ  h
    
  Nh
      Wi
<      `j
J   T k
V   Ԡ  k
`      k
&   T l
2   Ԡ  l
<      l
   Ԡ  m
      @m
   Ԡ  n
      Gn
   Ԡ to
      p
    <  q
4      Kr
x    F Rs
   Ԡ u
   nv w
   v w
      x
x    A |
   T }
   Ԡ  }
    Q  }
      ~
   Ԡ '
      f X
      N
4   Ԡ '
=    f 
F   Ԡ '
O    f Ĭ
X   T 
d   Ԡ  
l    L  ̬
t    D
  ̬
|   Ԡ ڬ
   nv 
   v 
      ߦ
0   Ԡ 䬖
@   nv 
H   v 
T      ߦ
   Ԡ '
    , 
   Ԡ '
    , 
   Ԡ '
    , 

   Ԡ '
#    , 
,   Ԡ '
5    , 
>   Ԡ '
G    , 
P   Ԡ '
Y    , 
b   Ԡ '
k    , 
t   Ԡ '
}    , 
   Ԡ '
    , '
      /
   Ԡ '
    , 
   Ԡ '
    , 
   Ԡ '
    , 
   Ԡ '
    , 
   Ԡ '
      , X
      N
X   T 
d   Ԡ  
l      ̬
t      ̬
|      ̬
      ̬
      ̬
      ̬
    {  ̬
    :   ̬
    ,!  ̬
    !  ̬
       ̬
    
  ̬
      ̬
    b  ̬
   Ԡ $6
      4
    7  =
q     G
y    Ԡ P
    nv 
    v 
       
)    7  Z
H    A 
   T 
   Ԡ  
    Q  c
      c
    M  c
    V  c
      c
      c
      c
    b   c
    T!  c
    !  c
    -   c
    
  c
      c
    }  c
#    $  c
+   T 
7   Ԡ  
?    u  q
W   Ԡ  
_    @
  
}   T     Ԡ         O(    T    Ԡ        O(   T    Ԡ           Ԡ        G   Ԡ  
    \	  @    Ԡ  (      
;    C    L   Ԡ \      	u    6  {	      
-   Ԡ  5    	  
H   T T   Ԡ  \    7  d   T 
p   Ԡ  
x    2  
        r               r     B     )         ^            ^    a.             $a    )     $a    )     )        g    X.     r     r     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     '    ӫ     '    ӫ     '    ӫ     r     r     r     r     r     r     r     r     r     r     r     r     r             ^    P     ^    y        y        ^    y    P     ^    $a    )     r     r     r     r     r     ݯ     '     '     '     '          
    r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     $a    ',     k#     r     r     r     r     r     r     $                             {    {        1.             1.         1.             1.         VK    9         1.     z,         -     N    )     )     r     w             ̮     4    r     P    P    H$                                     i    w         7    X         w     w     G    M    w     G    X          ڬ    (                      (    (        H                        r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r         r     i    w    r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     i    r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     w    e    r     w    ̉          ӫ               k    w    r          k        k    k    ӫ     w!         w!         ?R    w!         ӫ     w!         ?R    ӫ     w!         ӫ          w!         ?R    ӫ          w!    w!         r     r     r     r     r     ̉     w!    r     w!    w!    g    r     B     B     d    r     r     &     r     &     r     r     &     r     &     r     &     r     r     r     '    w!    B     '    w!    B     '    w!    B     w!    '    -    N    '    Z        w        H                    [    +          &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     &     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w!    r     r     w    w    w!    r     w!    r     w!    r     w!    r     w!    r     w!    r     w!    r     w!    r     w!    r     w!    r     w!    r     w!    r     w    (    w    r     ̉     w    r     r     ̉     w    r     r     w    r     w    w    r     w    r     w    r     w    r     r     r     w    w    w    ̉     w    r     ̉     w    r     ̉     w    r     ̉     r     r     r     r     ̉     r     r     r     r     r     r     ̉     r     r     ̉     r     ̉     ̉     r     r     r     r     r     ̉     ̉     r     ̉     r     r     r     r     r     r     ]    r     r     r     r     ]    r     r     r     r     ]    r     r     r     r     ]    r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     ]    r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     ]    r     ]    ̉                   r     r     ̉     w    k    	    w    	            w    r     r     k    w    w    T     k         d              :                         -     t                E    |    G     E    G     E    G     E    G     E    F    G          t    r     r     r     r     r     [    '    r     r     r     r     r     r     r     [        Q    ӫ               ӫ          [    .    r     :    .    .    B     r     r     r     r     r     [    ӫ     j     j     r     [    [    '    [    '    r     r     [    r     r     r     r     r     r     r     r     r     r     r     r     [        k    r     r     r     r     r     r     r     [    r     r     r     r     r     [    $a    )     r     r     [    '    r     [    [    r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     [        B     [  :    r     r     r     r     r     [    r     [    '    r     [              $a    )     ̉     )     $a    )     $a    )     $a    )     $a    )     ̉     )          r     r     r     r     r     r     r     r     r     r     r     [    r     r     r     r     r     r     r     r     r     r     r     r     r     r     [    '    r     r     r     r     r     r     [    '    w!    r     [    '    r     r     [    r     r     r     r     r     r     r     r     [    '    k    r     [    r     [    r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     r     [    g    [0    k    W    r     r     r     r     r     r     r     [    k    k                                ̉         ̉     r     A    r             r         .        )    h    t    h    
    t              h             -          9         H     h    -     
     t            ̉     ̉     |N    )         -     K    ̉         Pd    ;    #        -     t        |    E    t    -         -     G          P'    b    t    F    ̉     ?    ̉     ̉     ̉     ̉     ̉     }    ̉     ̉     ̉     r     A    h    h    ̉     +            h        h        h             h    r          A    h    h    ̉     +        )    ]    
         
    
         :         :         :         :         :                  L            h    W     t    h        5    P    h    ǳ        t    5     /        5    p'    h    ǳ    h            h    d               h    2    t        t        t    h    +    t    !    t    !    t    h        t             -         g         J    9Y          -     9Y     -     K    ̉     K    v    t    h    v        t    v    v        v    t    ]    ̉     ]    ̉         ̉     ,    '    !8         -    .    )         -     t    r     r         -     n         1     і     F    r          1    r     `    -         &    P'    g    B              ̉     K    M    ̉     K         ̉     K              d    K         h    ̉     h                  ̉     K    h        d        v    m     h    ,          ͆        h        h            <                       5%    .    9    X6        -         -             -     t         K     <     t         H     h    6    -          -     t    5%    K     <               5%    $    5%    #    t    -         t    ^    h    )    H    q    Q    t         H     t    h        t        t    h         t    h         h         H     t    5    g        h     /    t    5    ̉     5    5    J             h    m     t    h    m     t    h    t    h    j    t                         -     -     )        g                     )        g    g    &          .         .         L             :         r     :         r     :         r     :         r     :         r     :         r     "	    +     5    F    5    F    w!    -     ^    n'    ^    h    d     t        d               ̉     d     K    h         h    ^     h    ^              ϔ    h         t    h         t             -     n         r     A         .    (              ̉     }    r     (    h              g    l     ̉     }    r     (    g    l     ̉     }    r          -     9     H          -   H     t    r     ~    d     h    I    ~                       t    h                 L                 L    9     1                 L    ,     $             L            L         '     +             L            r     d                   ̉     V    d     h    (    :    d     h    t        ̉     V    (    :    K    ̉     r     r     r     B         B              l     r     ̉     K    .    K    -        ̉     r     r     r     r     r     r         ;    d        h        d        b    b    V    d        b    b    d            ;    d        b    b    d        b    b    B     n    d        d        )    a:     M        d        d        d        ',     ',     ؐ     ',     ؐ     ',     ؐ     ',     ؐ     ',     ؐ     ',     ؐ     ',     d        d            ;    d            ;    d        d        V    -     !8    r     (    r     -     !8    r     (    r     F          7'    -     (    r     -     F    r     -     F    r     -     (    r     -     (    r     -     (    r     -     (    r     -     (    r     -     (    r     -     (    r     -     (    r     -     (    r     -     (    r     -     (    r     -     (    r     -     (    r     -     (    r     -     (    r     d        b    b    d        b    b    d        V    -     !8         r     ,     r     -     ,     r     l     -     ,     r     l     -     ,     r     d        b    b    d        CE    K    d        d        d            ;    d        d        d        d            ;    n'    d            ;    d        d            ;    d            ;    d            ;    d        Fg        d        ":        (    d            ;    d            ;    d        d        V    -     (    r     -     (    r     -     (    r     d        V    -     (    r     -     (    r     -     (    r     -     (    r     -     (    r     d        V    -     (    r     -     (    r     r     r     r     r     r     r     r     r     )         )                  )    )     )    )     )        g    VK         r     r     r     d             d             d             d        5    .    d        .    5    d        .    5    d             d             d             d        d        V    -     6    A    .    I)    r     (    r     -     6    A    .    I)    r          (    ]    r          -     6    A    .    I)    %        (    ]    %        -     (    ]    r          r     -     (    ]    r          -     (    ]    r          -     (    ]    r          -     (    ]    r          -     (    ]    r          -     (    ]    r          -     (    ]    r          -     (    ]    %        -     (    ]    %        d        V    -     6    A    r     (    r     -     6    A    r          (    ]    (    ]    r          -     (    ]    -     (    ]    -     6    A    %        (    ]    %        (    ]    -     (    ]    r          -     (    ]    r          -     (    ]    r          -     (    ]    %        (    ]    -     (    ]    r          -     (    ]    r          -     (    ]    r          -     (    ]    r          -     (    ]    r          (    ]    -     (    ]    %        (    ]    -     (    ]    r          (    ]    d            ;    d            ;    d        V    -     6    A    .    r     (    r     -     6    A    .    r          (    ]    r          -     (    ]    r          -     (    ]    r          -     (    ]    r          -     (    ]    r          -     (    ]    r          -     (    ]    r          d        d        d        d        d        d        d        d        d        B     r     r     r     r     B     k    k    [    '    B     f-     M         f-         2    B     2                       )        )        )        r     r     r         )            )            h    )    h        h        h            h    Ĵ    h    Ĵ    h    Ĵ    h    ؛    ˘        o    J0    Ĵ              H     BN              Ȥ              Ȥ    H          Ȥ    J         Ȥ    ;    _    J         `    ٤    _             `    H          ٤              *    v*             *    v*              *    v*             *    v*    d    n         sY     ?Y              *    *             J        :             :     w!    $a    )     $a    )     U     :                 9?    9?        F    9?    :     9?    :     F    F        :         r     r     r     r     r     r     r     z     r                  T]            P             1    ?    r     Z#     #         a:     I    C                        a:     7     a:     a:     a:             $a    )     T]    o    ̉     I    C            +        G*    r     h    w    w    h        [             F         z        z    d        d        d        b    b    d        b    b    d        b    b    d        b    b    d        b    b    d        V                         F        F    a*        d        V    -     ":         r     -     ":         r     d        V    d        V    d        V    d        V    d        b    b    d        V    d        V        )    r     5    .                           5    .                  5    .                  5    .                  5    .                  5    .                  5    .                  5    .                  5    .                  5    .                  5    .                  5    .                  5    .                  5    .                  5    .         l          d        b    b    r     r     r     )    a:     M            M    5    	    :    $     -     k    r     r     r     k    r     k    r     r     r     r     k    r     k    r     r     k    r     k    r     r     k    r     r     r     k    r     r     k    r     r     r     r     k    r     k    r     r     r     r     r     k    r     r     k    r     r     k    d        d            ;    '     '     d            ;    d        d            ;    d        d        d        G     G     G     d        5    d        !8        d            ;    b    b    -     r     b    b    ":         r     r     -     r     b    b    ":         r          h    r     b    b        .    )    r     r     h    r     b    b        .    )    r              r     b    b    )    r     r     -     r     b    b    6    A    r     r     -     r     b    b    6    A    r          r     -     r     b    b    6    A    %        r     l     -     r     b    b    6    A    .    r     r     -     r     b    b    6    A    .    r          r     -     r     b    b    6    A    .    I)    r     r     -     r     b    b    6    A    .    I)    r          r     -     r     b    b    6    A    .    I)    %        r     l     -     r     b    b    !8    r     r     -          -     6    A    -     6    A    .    I)    -          .    I)    (                       K         _    ]              _    K    r   _    r   _    K         _         _         l     _         K    r   _         l   _    K    r   _         K    r   _         K    r   _         K    r   _         K    r   _         K    r   _         K    r   _         K    r   _         K    r     _    l     _         K    r     _         K    r     _         K    r     _         K    r     _         K    r   _         K    r   _         K    r   _    l   _         K    r   _    l   _         K    r   _    (                       K         _    ]         K    r   _    r   _    K         _    l   _    l   _    l   _    K    r   _    K    r   _    K    r   _    K    r   _    K    r   _    K    r   _    K    r   _    K    r   _    K    r   _    K    r   _    K    r   _    K    r   _    K    r   _    K    r   _    K    r   _    K    r   _    K    r   _    K    r   _    K    r   _    l     _    K    r     _    K    r   _    K    r   _    K    r   _    K    r   _    K    r   _    K    r   _    K    r   _    K    r   _    d        b    G     +     b    d        G     +     d        G     +     d        w    r     	    r     r     r     r     r     r              	    	    	    r     r     r     r     r     r     r     kD    :     ӫ     	    r     C    r          	    r     ,"    r     i    	    	    r     [                      kD    r     )     )     M    i     w    r     	    i    r     0    0    	    7    X          h     &     G         A         A         r             |:     j     j               {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    {
    j                                                  j                                                                k    k    k    5    R>    V                   9Y     z!    z!    )    [    F                   [             )        g    5%                                K    K        K                                     >     >     )        g    K    K    P    P                    K        j     :    :    j     :    :                        '     +     @"    @"    @"         -     -     -     -     -     -     -     -     -     -     -     -     -     -     -     -     -     -     -     -     -     [        )     -     -     -     -     -     -     -     -     -     -             -     -     -     -     -     -     -     -     -     -     -     -     -     -     -     -     -     -     -     -     -     -     -     -     -     -     -             :         j                 :     {    :     .     [                   [    [            r         F        F    a*    -         r     ":         r          b    -     -     h    v    r         .    )    r     h    v    r     h    v    r             h        r         .    )    r          h        r         .    )    r          h    (    r     h    (    r     h    (    r     h    (    r     h    (    r     h    (    r     h    (    r     h    (    r     h    (    r     h    (    r     r     h    (    r     h    (    r     h    (    r     h    (    r     h    (    r         .    )    r                                                                 G     G     (        -         r     ":         r          G     r          b                                                                R>    V    |:     j     j     '     +             4"    r     	         ,     4"        ' @ @ @  @ @ @ @ 	C C iC 
 C D D iD 
 D E E  E O P Q R S T U V W X 8AI_H`HaHbHcHdHeHfHgHHH%01Zd
\d
^d
_d
ad
cd
ed
gd
tuvwxyz{|}~Ei
 
]a-J F 	 Ԡ   Ԡ   Ԡ  ! Ԡ 
 1 Ԡ  9 Ԡ  A Ԡ  I Ԡ  Q Ԡ  Y Ԡ  a Ԡ  i Ԡ  q Ԡ  y Ԡ   Ԡ   Ԡ   Ԡ   Ԡ   Ԡ   Ԡ   Ԡ   Ԡ    Ԡ &  Ԡ   Ԡ   Ԡ -  Ԡ  	Ԡ 3 Ԡ  Ԡ  Ԡ C Ԡ I Ԡ  Ԡ  Ԡ   	I#  P 	( V t ] !  c AԠ  Ԡ  Ԡ g Ԡ n QԠ u YԠ  aԠ  iԠ  yԠ z Ԡ  Ԡ  Ԡ  QԠ  QԠ  Ԡ  Ԡ  QԠ  Ԡ  QԠ I Ԡ      s       \  /     2  L  i      t      _         W   ^              !     9D  c 9   9   OB B  :  x  .        Ԡ    c 1[2  7QԠ >	Ԡ  Y
ÿ  ^q
Ԡ        <    <   	 yX   .   \:  0 Ԡ  d Ed Od  W N  c  gt:  0t:  z| E| O|  WԠ   ݛ  )  B Ԡ ) = c       Ԡ  '  I"  P I2  I  QԠ y	Ԡ  9o q 	A Q  c Qm Q   Q   Q qԠ  I  "Y  )~ 4i  :qN  c { Ayg
 GԠ  /  Q{ Y/  A0R  Ԡ mL n qԠ  DL  7  )mL Ԡ    )  G 4  9QQ 9aQ 9U2   9+V 9:V 9{O 9O  93  93   91Q 9AQ 9 9# 96 9W c 9v  9 9+   9v   9
 
xJ q  q  !q  +q  3q  =q  JqI UYԠ qǘ  [q  [9  b  9 An  h  &    n  u AУ w5   } g
 GԠ  	Ԡ  	$J   Ħ  c +: c Ԡ  /  > !Ԡ )  c !Ը     2 ! 	9U 9U qS
 	1
 9 
	9 9΂ 9 	)x 	9  c )xJ *	1.( 4	  ;	94  A	)J *	1( O	amL X	$  c 1' 4	I#  c 1x  ]	I#   )t:  b	9  h	I4  I   I2    	q! +q! !I?6 >1
  q  	q  	aԠ  aԠ     aԠ 	aԠ 	   aԠ 	aԠ 	A4* 	 
A 
I 
Q  
qNB  ΁   Y !
Ԡ 1M( :
y\  a `
qd  aI l
y y  92 
w 
 
q  
qa ) 
Id 
 `
"  B  9.  
yX? ny
:  
)  
Ԡ  /   97B   
/  
D   970 
  
   M    
9 
)U8  Ԡ  )e8  Ԡ  2 
9z'   Ԡ  Q  %IԠ 9  Aq  Oy  ]  k  y         Q  Ԡ   I  
ʏ  
 
 ʏ  
? G
 y  G Gr" 
t    %  Ԡ  ǁ  1  8q   + Kq   9n  ^ Rm Xm s9f       9|   9   9;   qǬ  Ԡ  /  w c &   A A c AP   c Ԡ Ԡ Ԡ  /  x? 
J 
 
i 
J 
 7  J !
 
? 
 c L c N c   c   2
9 Q
/  q` Ԡ  9 X
 _
 e
 u
)Ԡ 
 
	 c q q0 q   
9  9  9  9  9  9 I e 
9P  9 
9  /  
Y  
i  
a  
1 1Ȅ   /  Ԡ       9   Ԡ      s       \  /     2  L  i      t      _         W   ^              !   D  c    y   Ԡ    OB B  :  x  .      D  c    qԠ $[2   ׆ .qԠ X
q 4q  qj* ;? QqǬ Wq1  bq  iq  c Ԡ  q7 pq vԠ  /  Ԡ  	Ԡ  /  QQ aQ q;  I	r Ԡ $ Ԡ  Ԡ  /  > ˉ !(" )a%  )Q%  $ /  $ /  Ԡ  y /  Ԡ  {O O 1Q AQ $ ^J GkJ   =<   Ԡ  ,  Ħ  c ͦ   N  c ȱ  c  P? c @ c Ԡ  ,  hg  Ħ  c ͦ   3  WgL 1  ]? c @ c ? c ? c Ԡ   cmL jĦ  c ͦ   J  
J oAĦ  c Aͦ   Ԡ  Ԡ yAP  c Aa  c   ]{  ]A# c A  c AM c AM c  c Aȱ  c A? c A@ c Ԡ  Ԡ yԠ  : 9    A  A  Ԡ y   	Ԡ yԠ yn    C:  Ɨ c   I4      Ԡ  !Ԡ  )Ԡ  )  )m  )F Qq  Q  I	 )m  )7 )  )  c )K! 1Ԡ  1Ԡ  1  u 1M  1M c  
f  E $h  ,Ԡ 43 4  v <h  DԠ L3 L  A& & ygL  T{ ZE  t  uT? QT u
\  u
A   AN dԠ l     '  tԠ |     Y
5  Y# Y# TԠ  \Ԡ T/  !   A	Ԡ `  A	rL 	  A	Ԡ    R 4}+  GB  iԠ 
ؤ  Ԡ  D% G# c /  w K <  /  bNg # c ׆ iI3G o& IԠ uU2   $0   QԠ }<0   # c t+  Ԡ  Ԡ $ 7$ Ԡ Ԡ Ԡ Ԡ Ԡ Ԡ Ԡ       Ԡ    ` c `  Ԡ Ԡ % ?  Ԡ a  a  >	Ԡ 	3  	3   	 Ԡ  +V :V 94  bU U $    j cJ J? Q  X  ^~   Ԡ   4u j͛ j 
- cJ qZ c cԠ    N  @  c M      Ԡ  J   K     Ԡ  ); )ڠ 9% ) ) % )$ )Ԡ  QԠ  aԠ  YԠ  qԠ  q  q?  q4   Ԡ f    T>  <  , Ԡ  Ԡ X
 Lӥ  R YԠ Ԡ e/  Ԡ  A  	Ԡ  Ԡ X
Ԡ X
Ԡ  s  RRJ    	 Ԡ $ Ԡ X
Ԡ X
Ԡ X
Ԡ X
  c    0 c 0   Y  !      / c  ݆  c    c  4 Ԡ Ԡ Ԡ < _ <   <   (<   .< Ԡ   Ԡ  	d `\  rL fǁ  kD% r	'% 	S
 	!F( x!u( xԠ  xJ 	 \  	  S  !Ԡ )Ԡ 1Ԡ 9Ԡ AԠ IԠ QԠ Ò  Q
A )Ԡ  )Ԡ Yו  )9Ԡ AԠ SA^ ZiM `q=  fi   9 m9 zA `"  ,  9X F &    A  9%    !  95   ]   " YԠ aԠ 
 u
iԠ SqԠ Si< ۲ #&  )
I .i 5<        GZ  N   t   bp  x y   g
 Gy
Ԡ   y- Gy  Gy-  /  yE  ) y
  y
xJ y) 4* 
* y8'  yn )   >H 1
  L   /  >H &  Ԡ  j. U  1
  A
0   )  E 1{ @O= F) ^aw  da*  aB   k3   /   "   $/  9{ AA-5 9da Y   9    	  u ;  Q	: ,Ԡ m { @i/  &	 Q	\$ #I	  *Q	    1Q6 8 V9  
  6" iފ  oy     Q	"  Q	"  > B   3        ,  Q	# L   n       C:  Ɨ c       { AN  c yȱ  Q	ͦ   Q	7:  + 
  Z \ N  c ,  y	 #  c ͦ   Α  )  .Ԡ 5  	Ԡ  1 GQ  Ml  _6# e z,  	C  	    A	  	  `    <Ԡ 9	  1  
/  )	 9  y  1	,  )	3  9~%  	3   &	 9   7Y"  ~%  Q	"  ؤ  am> n)B  FQ u    A )4   A  aVR  a) )  B  DԠ Q	"    !i* i	Ԡ  i	   9 
q	Ԡ  	"   )8 1/  	 9/  a YS  A y	Ԡ Y&   Yr9   YB    c Ħ  c I   '  	B    pQ\$ #  GZ  I   	E Yh  a,  a3   y! Q	!   2   A\  	/ 0Lg
 GL i  D	O I	g] U ZI  n6  6" t9"   da b |I	Ԡ y  J   2%  !3   $  
q-  
`  1Zj   qԠ Ԡ Ԡ yԠ Ԡ Ԡ Ԡ   
   c B  	    1o y y   T/  `	L g  m  # t\$ {y3   	<. 	   	l.    	5$   	$ 	$    	l  	  	c   J4 i	/     3  dԠ d  /  lԠ "   t/    1|/  a: >ay  	  G  /  	"  Z	L+  
	Ț `	 f	 c 	; l	\+  r	  	+ 	̇  
%  G
$  G
?"  G
F  	
B  
>  	
:  
  	
  
  	
  
Q  	
M  
I  	
E  
  	
  
!  	
  
  	
  
  	
  
 	
8 
J 	
F C  G  <  Ԡ      b? Q  
> 
  /  <  Ԡ      p  xg
 G/    < + >    @  Ԡ  . _ U
  b Ԡ / } 1
L  Ԡ 1
  Ԡ Ԡ 1
  /  1
   |   QC  1
  I
 
!Ԡ  /  ! /! 6!  ;!	 M!Ԡ 	У b!Ԡ T> t!Ԡ 	M !Ԡ Ԡ 	h !Ԡ     "<  a
N%     
5 
   "
  &"
 G
  
. 
Q  
  
5  
  2"
  ?"
  
  
. 
j  
  
 F"r G  G
  c 
N c 
Ԡ ]"
   
N  $/  W
z  c 
  c 
  c 
0  c 
J	 s"
	 s"
	 s"
	 s"

 y"
   
²   
   
E   
]	 "
	 "
	 "
"	 "
$
 "g
 Gi  !#,g
 G, 4Ԡ ڿ  :# Z#A3  g#3I m#9M s# , GA    #
y  
 )L   Y  #i< #qs #9U  	+,  G  #
    #Yy  GA  #a GY #a #  s  
= #2  #
   

 #
8  #
g #  FN  <     )
0   
 	$
I  $ $ $NN $ $<   )3  g#)Ԡ    $D ? +$DS) W
K ?$
"  C$
wL 
++ G
L+  
[  I$
r G
Ԡ  
L  
:+  t+  ^$
T+  c
Ԡ  
e  e$
T l$
rD q$
+ G
+ G
Ԡ  
D $
  
+  
+    $L LS) W
S
 	1
  	7 F"rL $|. $TԠ  1
׳ $\ d<  lԠ   %|  
%1
 %1
 '%1
 3%1
 ?%t |<  D Y  c   o%  %  %){ %1
5 %1
 %Ԡ  -  %	  QԠ   
z  % (&1
) .& !5 C&Ԡ ! S&Ԡ   - &Ԡ  Ԡ  /   &< + >  Ԡ &/  !Ԡ &/  AԠ '  \ Ԡ  1
 'I  GI_ I  I 
1
 G  1
 G  1
 '1
Z $'1
u *'1
ԯ 0'I   I|  Iٶ   I c)  9

5  +,  G9
S b'g
 G 9
Ԡ '-   YԠ '/  /  +,  GA
K. 'r GA
S 'g
 G aԠ  A
Ԡ '-   qԠ (/  /  q
Ħ  c q
Ԡ ]"q
ͦ   $/  W)D ()K" () ()  ()jN ()h# ()  ()  ()  ()$ (Q (Q0  (QG  (QУ (Q (QF (Q>  (Q (QT  (Q` (QL (Q (QG (QZ  "(a?5  (a (a  (Q (QM (Q  ()Q c )0  ((a
U  a
  :(i
 	7 @(i}Y  a
L :(	 I(a
D% Gy O(y T(<  c 
 c M c 5  a
Ԡ Sq8 z() i		 (y
6 (	- ( (a
s (g
 Ga
"* y
" a
) y
" a
h (	, (x (Ԡ    L   M  5   y/  (Q
 GQ (Q Q  QL Q  (Q  c Q GQ Q  GQ GQ> Q  GQ_ GQ
  Q (Q  Q   Q`  Q  (Q   Q)  	] )Qǟ )Q   Q  Q>  Q͆   Qp  YS
 	Yn D% GY/ D% GY ),D% Gt  .)|  .)\  .)\   b u
g
 Gq Gq
 q
 Gq+  q
  q   i Gi
 Qo (Q (Q (Q% (Q$ (Qh  (Q (Q* T)QH  T)QZ  T)Q| T)Q T)Qۣ T)Q T)Q3 T)Q T)Q T)QY T)aL5  T)a T)a  T)QV  T)Q8 T)Q T)Qg  T)Qr T)QY T)Q{  T)QX T)Q  T)Q
 T)QG T)Q T))  [))M  [)K a))  ()7  )? f)) )! ()  ()? )  ()C  )  )D T))Y" T)) T))(  T))sN T))  u))a  u)A  |))) $) $)  T))q# T))7   )H  ))  T))? ))  )  T))  T))/ T))" T))_  )  T))@  )  T))d   )   S  )? c 1  c   c ?  c y  c   c y  c H ) )Ԡ     P   Ԡ     Ԡ        Ԡ  Ԡ  _  )?  D   4/  g
 GԠ S/  7 ) m   6 )" 	*7 F" Gy
S  * 	*Ԡ   	*< u
y2  C*9  y ' Gy  I*|. )y
|. (y
 <Ԡ  </   X*nK a*j  g* g*16M 1# 1) 1E3  1  1U  G1w  G15  G1߇  G15a G2  y*Ӊ  *1  *1 *16  *1 *1> G1 G1h G1
 G1Ԡ  1GM  1#  1?  1P3   1!  1f   1   1E   1   1@a  1(  *1  *1  *19 *1O  *1 *1S  1  1  1$    *y  G GG  $ ++ GDS
 	  +     Q   $  :+    *y  G GG  $ ++ GԠ    +     Q   $  :+  LG  LS
 7+  =+ G  C+Q GY    I+ Go GW  GU+      a     g  n G  O+b.  G_ x* Gpc U+c U+)c U+b U+b U+  a+  ؽ  n+`  i  $*  {+
    i   m+          w        g      o  l.   *  c +c +7c +b +b +. +  +	 	y 
3   +y  GgL 	  +7 +	  +D +   T =\<  
2  +\ d> ,l> ,# 2,>  8,i
U  & G *'S
 	d  W" G  >,  D,' r7 F"' r6 J,9"  9  >,9  Z,Ԡ p, w,  },	' , ,	( ,	f ,! ,! , ,  Z,i
& Gi
 Gi
 'i
D% Gi
  >,i
 ,i
 ,# Gۗ  G>  8,i
8 ,tԠ |  o%Ԡ D -i
   )  >,) "-! /-a b-  i
Ԡ -i
N%  i
 "-Ԡ -)  -a/  -9  GS G{  - - $'l  W< ' -Ԡ 1a  1H   1 -1 -1{  -l . 	n 	/ 	E 1	 '	C $'	F *'S
 	A 'AC $'AF *'A/ An I .Iť  +.I 2.Y  c n / E 1 'C $'F *' K.D Z. } Ԡ n.|/  W  	Ԡ .I  .r         !S
 	!]( rR7 F"!/( rr7 F"y . z- .r Gz- .r G!Ԡ '/  ! /A GAFN GA GA G! #/I
 GI~  GI !  )/Qy  GQ G!׿ //Y  5/Q  Y  A GA GA  ANN  A  A  I  I   I ;/Q   Q!  Y  M/Q   Y   I  A  A,  I h/ =<  qy  Gq~  G iԠ   qԠ  q   q   /  S
 	J  y!  y  /Y  c yn 	Ԡ yԠ /r         /  W  	Ԡ 1
f /a /	Ԡ 	Ԡ $	Ԡ ,	Ԡ 4	G  g
 GԠ  ! 04	)  /  0! 0Q  0Ԡ 0<	  D	g
 GD	 	  09] 95 9:> 9'% iԠ  1Ԡ  Ԡ Ԡ 0,   b  1    %  0L	G  L	S
 7+  c T	Ԡ % )1  GJY  +  ߾  >1  D1 D C  J1# 
I P1K V1  + Gx* G , GY+ Gg, G  \1#   Q  h1
   WY   +   
    s1  1D  C   1#  I 1K 1   +  *  8,  q+  ,  \	S
 	d	J  . 1l	r GԠ 1\	r   \	   \	   t	Ԡ \	  S
 	|	J  n 	/ !    
2Y  c   /%  	E 12. 1( GԠ +2r         4   j. (  |	/  W    I2D 
5  D # D h  D # D   c " 	*& G  G. 1( G" d Ԡ  Z  q2	Ԡ 	  @ ) 2)  2) 2) 2)  G)&  G)L )9 )K 2)  2)x* G)'7 2I G Go G G8 GY8 GH$ 2# 2_ 29 28  2)  2	S
 	)׿ 	3	   @   
M  P  [ 3 "3*  \        8  s8  \$ 53# B3t O3L \3I  i3	)    3 3	>H 9 29 39, 9_M 9@  9P5 39q 39x* G9  39=  9jM  9L   9b5 39 3	S
 	9*  	)    3	>H 1  -1u] 1, 1, 1 21b.  G1  31]  1=  1:  1 "31l.   	)  
  4 #4	>H l Ԡ  Ԡ   T QT/  Qg
 G\  |   bl   
d   
   g
 G	g
 G\  	Ԡ 	 	<  	>  Ԡ 5 Wg
 GԠ 5, W{ )G $5	Ԡ > 951Ԡ SD WL W	)c P5	pc V5	c \5	b b5	a h5	a n5	)c P5	pc V5	c \5	b b5a }5a 5FN 5 5 5 5
;  5
   
2  5
  G9
2  59
  G9
;  59
     5^ 526 G
5  > 9Ԡ  Ԡ 5t Ԡ  L	)  A
Ԡ 5  5	 WƓ   6
 WL	~ 0| Ԡ  L)  L* @ I
  $6L>H Q
% )Q
	  )Q
&  )Ԡ  Q
Ԡ @6Ԡ M6Ħ  c Y
  
   GY
Ԡ  	Ԡ  	\  	 ~6
<  
>  
  @ 
Ԡ 	  6	p  x$
Ԡ  $
/  ,
Ԡ $
 27$
 =4
<  4
 <
Ԡ D
Ԡ L
Ԡ  7 Ԡ 7T
n 8\
A Q\
A   %8  Q   d
Ԡ  d
 781
,  G  YԠ  1
,    Ԡ 7Q8  	  P8	;  [8	/   	 o8l
 l
g
 G	`J 8y

 8|' ry
}Y  8J 1
 8y
|. 8a 8t
p  x  8t
Ԡ  t
/  1
3  )Ԡ 8iԠ qKa 8	;  ()7  &  %  ŋ  #9y	>  Ԡ 7Q9  |
p  x
  O9|
Ԡ  
Ԡ |
/   Ԡ S U  	vJ 8
&  p9
&  99%' 9  99M 9Ԡ *Ԡ 9Ԡ 9Ԡ   Ԡ S Ԡ S M 9 Ԡ S M 9 Ԡ S Ԡ S Ԡ S Ԡ S Ԡ S Ԡ 7^= 9
Ԡ m
< #
۲ # Ԡ 7
p  x
  O9
Ԡ  
Ԡ 
/  Ԡ SU  
&  C:Ԡ S
U   U:͸  \:Ԡ S  1 r:1  y*1  *M 9Y  	#  :$  :V j	  :
Ԡ / Z#qԠ ')09  A  
  : ;a  1 ";I ,;I  2;Ԡ  1( 8;z  D;)7  1^4  X;1J ];Q3  I   qZ ; ;Q8  |	  o%
Ԡ  
/  Ԡ ; 0 ;	;  ;  ;a ;a  <a <
Ԡ  
Z ;L F<
 
Z U<
 [<
,/ a<
Ԡ g<Ԡ t<
 <
	 <	S
 	Ԡ 1
= <
  Ԡ  a <Ԡ 7Q8  
p  x
  O9
Ԡ  
Ԡ 
/  $Ԡ S,Ԡ S4Ԡ S<Ԡ 7
p  x
  O9
Ԡ  
Ԡ 
/  DԠ SLԠ STԠ 7
p  x
  O9
Ԡ  
Ԡ 
/  \Ԡ SdԠ S  5=  A=Z  5=  T=),  1Ԡ  8 Z= a=I	K {=D -D -|	  j   =a  /a
  /N   / a< =d' =- &Q8  Q8  1
/ =lԠ 7AԠ  tԠ 7IԠ    =a  S =T/  |Ԡ 7Ԡ 7Ԡ 7p  x$  O9Ԡ  $Ԡ /  Ԡ SU  ,  >>Ԡ SU  4  a>4߷  n>Ԡ SU  <  |><߷  n>Ԡ S9_ >DU  
 >9 >9 >Ԡ SX   Ԡ S9 >9H >9 >N  uM  Ԡ S9D >9D >9D >Ԡ St5  Ԡ S  Ԡ S	a h5	a n5LԠ  TU  
f+  >9 >L/  L QEc  c  b  c  b  a  Q%  t%  =%  b%  Ԡ 7\p  xd  O9\Ԡ  dԠ \/  Ԡ SU  l  4?Ԡ SU    I?>H V?Ԡ St  h?A n?|  ?I ?Ԡ SU    ?>H V?Ԡ S)P  g  Ԡ S)*  *  Ԡ S)[ 3{  $Ԡ SU  , cEc  c  b  c  b  a  Q ?,Ԡ S) "3&  4Ԡ S)      )@   Z   )
M   M  <Ԡ S.   Q%  t%  =%  b%  AԠ  > DԠ 7p  x  O9Ԡ  Ԡ /  LԠ SLU    -@TԠ STU    M@h  Z@\Ԡ S
H  dԠ S
.   
]  
N  lԠ S
.  tԠ S
v.   ! @Ԡ @)K p,g
 Gg
 G ,	' ,|. J,!  - 2,) p,i
$ 2,a	Ԡ  |> t>   UA$Ԡ  $> " [Ai%   C  tԠ  |Ԡ  a:  jAq4   a   ^ vA
 G   p  xԠ  /  1xJ ];1 X;1  X;1 X;1 X;1 X;1o%  X;1n X;1+  X;1,  X;yԠ Ayn   Ԡ  !     
  A6   |' 
YԠ  Y#  C AC AC AxJ At+  A9L BԠ  Ԡ  Ԡ  qmL JB1
Ԡ OBԠ   <   <   <  /  D  WY   +   9 B =<   /   Q  a+*  {+i  $~$  :`  D   Ci       #   
   
  # # |J  /  9ؚ CD   
  Ԡ 0Ԡ D
ʏ  D  D5 D,  D  DG   
y  D Gy  G GFN GԠ DԠ EB 
E   EU&   : En$   E  E E&  GI&  Ge  EN  E O&  $! $9N 'E9 4E  @ERL U:Ԡ c  QES
 	1
 gE	8 F"	T  mE|N   |g
 G| I xEi
&  Ԡ i
 E. G9 E  EԠ 0ib Eb ERb E8b Ei
^ E9 ExJ oԠ c  E&  GI&  G  F+  F    F &F     v  ?F_  )Y  EFy =  o .   E !Ԡ KF!F RF XF	/  ^FԠ   eFԠ   lF   eF  lFz sF>   c 9 yF|9 G  yF   	Ԡ  Ԡ  < F' F   -? c   +$k  )  F F	/  	O/    ? Q u
/  Ԡ  !D RF)Ԡ   F|Ԡ F$Ԡ  Iɴ   q2  q2   I0   A  F      I  G!  !  G1Ԡ  qD  
Gq	 <-J   xJ ?G	M* GG	 PGy
F  *y
rL I4+  YGIK  q gGI4   a  c a  ay#  c  q  lGa aG |Ga> ay> I0  GI  c I&  q  XQm Gq Gq G/   $? QԠ   ,Ԡ |	    |  QԠ  Q[d    q   Az Ga> Qz 4Ԡ $  6$W  x$p  xq= <Q 
HagL I  I G
: HI  c YԠ   )HIԠ 	I'  /HI-I  I     EH<Ԡ % H N  c $ ~6D<  L  @ % HL>  %  H u
S Hq  " 
  T\  a HqԠ OBaԠ  IaԠ I1
Ԡ IiԠ I !IT/  \Ԡ )%  q  GId   c l   c t   c 9
5    Ia[7  a?8  ao7  iԠ ' I  o%	  IQ7  xJ 	*/ 	  I5  IJ J I	  J Q7  	z  0JQ 8  Ԡ  |Ԡ Ԡ 7 u
Ԡ  /     Ԡ 0  iJL	 @ A
  \1L	* @ A
  5L	>H y ;Ԡ  Ԡ 7/  p  xԠ SU  )/L  Ԡ SU  Ԡ 7p  x  JԠ  Ԡ /  Ԡ 7Ԡ 7 u
Ԡ  /  Ԡ 7p  xԠ  /  	  JQ8  ,Ԡ 74Ԡ 7Ԡ  Ԡ /  p  x  J<Ԡ '<S
 	  GKn ]K/ iKDԠ 'Ԡ        LԠ 'TԠ '   T  C               \Ԡ ' K Ky
 Ԡ  /  Ԡ  27 <  Ԡ    1
9 @L
Ԡ  ;Ԡ  Ԡ L	Ԡ L
/  Ԡ L4      1
) Lݫ  c 
  L +$	I  d  	I M  
1
c G-  c Ԡ S) ) )       	  <MQ8  	  KM.  1
/ )	  {M	hF M	\  M	&  M	@  MԠ SR7 F"b7 )' x8'   M!Ԡ  ! Mq 
)  M)  MR |GIG 	I      d  SW=  %  N  Ne
 '?  N  N  N<e
 '<?  N<  N<  Nd  SW=  %  N  Ni
' ri
' rd  SW=  %  N  (Nd  SW=  %i  N
Ԡ   MN  NLd  SLW=  %L  NL  ZNTd  STW=  %T  NT  eNd  SW=  %  N  qNd  SW=  %  N  }Nd  SW=  %i  N  N  N d  S W=  %   N   N
  N
`  N
n N
   
|   Ԡ  Ԡ  Ԡ  Ԡ  Ԡ  Ԡ  Ԡ  Ԡ  	Ԡ  Ԡ  Ԡ  !Ԡ s1Ԡ  )Ԡ 1Ԡ  1Ԡ c+ N9Ԡ c* NAԠ cP, NIԠ c+ NQԠ c, NYԠ 1Ԡ  aԠ  iԠ  qԠ 1Ԡ  yԠ 1Ԡ  $
S
 	I
  O+,
  N,
n  OԠ  Ԡ  " %OԠ  $Ԡ  ,Ԡ  4Ԡ  <Ԡ  DԠ  $I NLԠ  TԠ  Qw8  ! ?O EO ?OZ  XOT  /	 ?O23  OqԠ  q7B  3  O    ! O    OӋ   qˉ )B%  (   9   O3   k%  qB  9Ȥ   Oc OyA O  	  yM  	Ԡ  Ԡ    O=  PԠ  Ps Pd6 P  PԠ  	Ԡ &P9B  qn  + 3PԠ  9з x     <. :P AP  $$  GP  OP `
./  `
4
Ԡ  4
/  4
> h mPd" 
   qmL sPԠ  Ԡ  <
Ԡ  <
/  <
> D
Ԡ  D
/  D
> U X|/  U Pl/  &3   4/    eW? Q u
Y
  W W	 W  c q 2 
w WԠ WG  q  W!  c q  
'     W!\  c )H< H  c   L
Ԡ  )Ԡ  1Ԡ WP Wy W	I W] WL
/  T
/  \
Ԡ T
Ԡ  Ԡ  A    Ԡ  d
Ԡ  d
!  ,    u  pQ: 
  >X
֏  GXQ
#  MXl
-  %\	Y  c d
  _ IJ,  ^Xd
e,  _ d
Y   d
	  oXd
H 0d
   1Ԡ  d
) Ԡ    |  @ |   
  $Ԡ 'S
 	t
f XԠ 'a+  Ԡ 'a
   Y1   Y{1   Ԡ 'Ԡ 'Ԡ 'Ԡ 'Ԡ 'Ԡ '	] X )|
, X$Ԡ Lj* GS
 	  X
 WL~ 0$   
 X
ÿ  XԠ  6 Y6 <ZdԠ lԠ Ԡ 6 [a	^ [%   ɹ  ["  c Ԡ [ ( w\ , |\ 0 \ 4 \ 8 \ @ w\ D |\ L w\ P |\ T \ X \ \ ] ` i] d ] h ^ l \^ p ^ t _ x a_ | _  `  v`  `  2a  a  
b  ib  b  7c  c  d  d  e  ke  e  f  pf  f   g  }g  g  1h  ~h  h  h  h   i  i   i  +i  6i  =i b 7c Xi i i i i +j Xj ij j j j k  k /k @k Sk  Xk ]k k k k k l #l  @l $Yl (tl ,l 0l 4l 8l <l @
m D3m HHm L]m Pxm Tm Xm \m `m dm hn lMn pn tn xn |/o ho o o o o o p Gp p p p p  q q 2q Eq Pq iq |q q q q q )r Hr er r r r r 0s Ms  ts s s s s %t Xt qt  t $t (t ,t 0u 4;u 8fu <u @u Du H
v L1v pdv tiv xnv |nv sv sv w\ sv sv xv xv }v }v v v }v }v
 v $w\ (|\ ,\ pv tv xv |v v 	w w 9w dw yw w w w x Jx }x x x x x u ;u fu x w\ |\ \ \ \ 	y y y y y "y  'y ,y 1y 6y ;y Sk @y Ey  Jy $Oy (Ty ,Yy 0^y 4cy 8hy <my @ry Dwy H|y Ly Py TXk Xy \y `y dy hy ly py ty xy |y y y y y y y y y y y y y y y z z 
z z z z !z &z +z 0z 5z :z ?z Dz Iz Nz Sz Xz  ]z bz gz lz qz vz {z z  z $z (z ,z 0z 4z 8z <z @z Dz Hz Lz Pz Tz Xz \z `z dz hz lz pz tz xz |z z { { { { { {  { %{ *{ /{ 4{ 9{ >{ C{ H{ M{ R{ W{ \{ a{ f{ k{ p{ u{ z{ { { { { { {  { { { { { { { {  { ${ ({ ,{ 0{ 4{ 8{ <{ @{ D{ H{ L{ P| T| X| \| `| d| h| l$| p)| t.| x3| |8| =| B| G| L| Q| V| [| `| e| j| o| t| y| ~| | | | | | | | | | | | | | | | | | |  | | | | | | |  }  } $
} (} ,} 0} 4} 8#} <(} @-} D2} H7} L<} PA} TF} XK} \P} `U} dZ} h_} ld} pi} tn} xs} |x} }} } } } } } } } } } } } } } } } } } } } } } } } } } } ~ 	~ ~ ~ ~  	~ 	"~ 	'~ 	,~ 	1~ 	6~ 	;~ 	@~  	E~ $	J~ (	O~ ,	T~ 0	Y~ 4	^~ 8	c~ <	h~ @	m~ D	r~ H	w~ L	|~ P	~ T	~ X	~ \	~ `	~ d	~ h	~ l	~ p	~ t	~ x	~ |	~ 	~ 	~ 	~ 	~ 	~ 	~ 	~ 	~ 	~ 	~ 	~ 	~ 	~ 	~ 	 	 	
 	 	 	 	! 	& 	+ 	0 	5 	: 	? 	D 	I 	N 	S 	X  
] 
b 
g 
l 
q 
v 
{ 
  
 $
 (
 ,
 0
 4
 8
 <
 @
 D
 H
 L
 P
 T
 X
 \
 `
 d
 h
 l
 p
 t
 x
 |
 
 
 
 
 
 
 
 
  
% 
* 
/ 
4 
9 
> 
C 
H 
M 
R 
W 
\ 
a 
f 
k 
p 
u 
z 
 
 
 
 
 
           ŀ $ʀ (π ,Ԁ 0ـ 4ހ 8 < @ D H L P T X \ ` d h l$ p) t. x3 |8 = B G L Q V [ ` e j o t y ~              ā Ɂ ΁ Ӂ ؁  ݁           $
 ( , w\ |\ \  0B 4U 8h w\ w\ |\ \ \ \ 	y y w\  |\ \ w\ |\ \ w\  |\ $\ (\ 0w\ Lw\ P|\ T\ X\ \\ lw\ p|\ t\ x\ w\ |\ w\ |\ w\ |\ \ \ w\ |\ \ \ \ 	y w\ |\ \ \ \ 	y  w\ |\ \ \ \ 	y  w\ |\ \ \ \ 	y y y  y $y ("y ,'y 0,y 41y 86y <;y @Sk D@y HEy LJy POy TTy XYy \^y `cy dhy hmy pw\ t|\ x\ |\ \ 	y y y y y "y w\ |\ \ \ \ 	y y w\ |\ \ \ \ { |\ \ \ \ 	y y y y y  "y 'y ,y 1y   hw\ l|\ p\ t\ x\ |	y y y w\ |\ \ \ \ 	y y w\ |\ \ w\ |\ \ \ \ 	y y w\ |\ \ \ \ 	y y y y  y "y 'y w\ |\ \ \  \ $	y (y ,y 4w\ 8|\ <\ @\ D\ H	y Ly Py Ty Xy \"y `'y d,y h1y l6y p;y tSk x@y |Ey Jy Oy Ty Yy ^y cy hy w\ |\ \ w\ |\ \ \ w\ |\ \ \ w\ |\ w\ |\ \ \ \ 	y y w\ |\ \ \ \ 	y y  y $y (y 0w\ 4|\ 8\ <\ @\ Hw\ L|\ P\ T\ \w\ `|\ d\ h\ l\ p	y ty xy |y y "y 'y ,y 1y w\ |\ \ \ w\ |\ \ \ \ 	y y y y "y 0w\ 4|\ 8\ <\ @\ Hw\ L|\ P\ T\ X\ \	y `y dy hy ly p"y t'y x,y |1y 6y ;y Sk @y Ey Jy Oy Ty Yy ^y cy hy w\ |\ \ w\ |\ \ \ \ 	y y y y w\ |\ \ \ \  	y y w\ |\ w\ |\  \ $\ (\ ,	y 0y 4y 8y <y @"y D'y H,y L1y P6y T;y XSk \@y `Ey dJy hOy lTy pYy t^y xcy |hy my ry wy |y w\ |\ \ \ \ 	y y y y y "y 'y ,y 1y 6y ;y Sk @y Ey Jy Oy Ty Yy ^y cy hy my  ry wy |y y y Xk y y $w\ (|\ ,\ 4w\ 8|\ <\ @\ D\ H	y Ly Py Ty Xy \"y `'y hw\ l|\ p\ t\ x\ |	y y y w\ |\ \ \ \ 	y y y y y w\ w\ |\ \ \ \ 	y y y w\ |\ \ w\ |\  w\ |\ w\ |\ \ w\  |\ $\ (\ ,\ 4|\ 8\ @w\ D|\ H\ Pw\ T|\ X\ `\ d\ l\ t\ x\ |\ 	y w\ |\ \ \ w\ |\ \ \ \ 	y y y y y "y 'y ,y 1y 6y ;y Sk @y Ey Jy w\ |\ \ \  \ 	y y y y w\ |\ $w\ (|\ 0w\ 4|\ <w\ @|\ D\ H\ L\ P	y Ty Xy `w\ d|\ h\ l\ p\ xw\ ||\ \ \ \ 	y y w\ |\ \ \ \ 	y w\ |\ \ \ w\ |\ w\ |\ \ \ \ 	y y y y y "y  'y ,y 1y w\ |\ w\ $w\ (|\ ) ,\ - 0\ 8w\ 9 <|\ @\ Hw\ L|\ P\ Xw\ \|\ `\ d\ l\ p\ t	y |w\ w\ |\ \ \ \ 	y y y y w\ |\ w\ |\ \ \ \ 	y y y y y "y 'y ,y 1y w\ |\ \  \ \ 	y y y y y "y  'y $,y (1y ,6y 0;y 4Sk 8@y <Ey @Jy DOy HTy LYy P^y Tcy Xhy \my `ry dwy lw\ p|\ t\ x\ |\ 	y y w\ |\ w\ |\ \ \ \ 	y w\ |\ \ \ \ 	y 	y y y 	y y y y 	y y y  y 	y y y y y  w\ $|\ ,w\ 0|\ 4\ 8\ <\ Dw\ H|\ Pw\ T|\ \w\ `|\ hw\ l|\ p\ t\ x\ |	y y y y y "y 'y ,y 1y 6y w\ |\ \ \ \ 	y w\ |\ \ \ \ 	y y y y w\ y w\ y y y  "y 'y ,y 1y 6y ;y y $y (y 0w\ 8w\ <|\ @\ D\ Lw\ Tw\ X|\ \\ dw\ h|\ l\ p\ t\ x	y w\ |\ w\ |\ \ \ \ 	y y y y w\ |\ \ w\ |\ \ \ w\ |\ \ w\ |\ \ \ \  w\ |\ \ w\ |\ \ \  \ $	y (y ,y 0y 4y 8"y <'y @,y Hw\ L|\ P\ T\ X\ \	y `y dy lw\ p|\ xw\ ||\ \ \ \ 	y y y y y "y 'y ,y 1y 6y ;y Sk @y Ey Jy w\ |\ w\ |\ \ \ \ 	y y y y  w\ |\ \ \ \ w\ |\  \ xw\ ||\ \ \ \ 	y y y y y "y 'y ,y 1y 6y {             Ƃ ˂ Ђ Ղ ڂ ߂            $ ( , 0  4% 8* </ @4 D9 H> LC PH TM XR \W `\ da hf lk pp tu xz |              Ń ʃ σ ԃ ك ރ   w\ |\ \ \ \ 	y ,  x  | \  \  ,y  y   #w\ #|\ #\ #\ #\ #	y  #y $#y (#y ,#y 0#"y 4#'y 8#,y <#1y @#6y D#;y H#Sk L#@y P#Ey T#Jy X#Oy \#Ty `#Yy d#^y h#cy l#my p#ry t#wy x#|y |#y #y #Xk #y #y #y #y #y #y #y #y #y #y #y #y #y #y #y #y #y #y #y #y #y #y #y #z #
z #+z #0z #5z #:z #?z  $Dz $Iz $Nz $Sz $Xz $]z $bz $gz  $qz $$vz (${z ,$z 0$z 4$z 8$z <$z @$z D$z H$z L$z P$z T$z X$z \$z `${ d${ h${ l${ p${ t${ x$ { |$%{ $*{ $/{ $4{ $w\ $9{ $>{ $C{ $H{ $M{ $R{ $W{ $\{ $a{ $f{ $k{ $p{ $u{ $z{ ${ ${ ${ ${ ${ ${ ${ ${ ${ ${ ${ ${ ${ ${ ${  %{ %{ %{ %{ %{ %{ %{ %{  %{ $%{ (%{ ,%| 0%| 4%| 8%| <%| @%| D%| H%$| L%)| P%.| T%3| X%8| \%=| `%B| d%G| h%L| l%Q| p%V| t%[| x%`| |%e| %j| %| %| %| %| %| %| %| %| %| %| %| %| %| %| %| %| %| %| %| %| %| %| %| %| % } %} %
} %} %} %} %}  &(} &-} &2} &7} &<} &K} &P} &U}  &Z} $&_} (&d} ,&i} 0&n} 4&s} 8&x} <&}} @&} D&} H&} L&} P&} T&} X&} \&} `&} d&} h&} l&} p&} t&} x&} |&} &} &} &} &} &} &} &} &} &} &~ &	~ &~ &~ &~ &~ &"~ &'~ &,~ &1~ &6~ &;~ &@~ &E~ &J~ &O~ &T~ &Y~ &^~ &c~ &h~ &m~ &r~  'w~ '|~ '~ '~ '~ '~ '~ '~  '~ $'~ ('~ ,'~ 0'~ 4'~ 8'~ <'~ @'~ D'~ H'~ L'~ P'~ T'~ X'~ \'~ `'~ d'~ h'~ l' p' t'
 x' |' ' '! '& '+ '0 '5 ': '? 'D 'I 'N 'S 'X '] 'b 'g 'l 'q 'v '{ ' ' ' ' ' ' ' ' ' ' ' '  ( ( ( ( ( ( ( (  ( $( (( ,( 0( 4( 8( <( @( D( H( L( P(  T(% X(* \(/ `(4 d(9 h(> l(C p(H t(M x(R |(W (\ (a (f (k (p (u (z ( ( ( ( ( ( ( ( ( ( ( ( ( ( (ŀ (ʀ (π (Ԁ (ـ (ހ ( ( ( ( (  ) ) ), )3 )> )I )T )]  )f $)o ()x 8)w\ <)|\ @)\ D)\ P)w\ T)|\ \)w\ `)|\ d)\ h)\ l)\ p)	y t)y x)y |)y )y )"y )'y ),y )1y )6y );y -w\ -w\ -w\ -w\ -w\ -w\ -w\ .w\ .w\ %.w\ 5.w\ E.w\ .w\ .w\ .w\ .w\ .w\ .w\ .w\ 1/w\ 9/w\ M/w\ U/w\ ]/w\ i/w\ u/w\ /w\ /w\ /w\ /w\ /w\ /w\ /w\ /w\ /w\ /w\ /w\ 0w\ 0w\ 0w\ )0w\ 50w\ A0w\ a0w\ m0w\ y0w\ 0w\ 0w\ 0w\ 0w\ 0w\!    *   b b*   C.    |\.    D.    M.   # l.   + u.   3 {.   ; |\.   C .   K u.   S u.   [ Ʋ.   c .   k .   s u.   { .    !.    '.    5.    C.    .    -.    Q.    .    .    B.    .    .    8.    .    .    4.    .    .    F.    .    .    4.    {.    ƻ.    .    k.    .    #.    `.    .    ߽.    .    \.    .    .    ).    n.    .    .    ).    t.    .    .    F.    .    .    1.    z.   |\.    .    1@    |\A    C    |\J   b J   C`    |\a    c    |\j   b j   C    |\    Ŋ   b    C    |\   b    C   b    b $   C   b    b K   C    |\	  b 
  b {
  C    |\*  b *  C@   |\J  b J  C`   |\j  b j  C  b 2  C  Ku  SĪ  [  b _  C   !      ~        Xc  u  u  u  u   |\   |\   |\!   |\A   |\   |\   |\!
   |\a
   |\    |\    |\    |\i"  b $i"  C@i"  cLi"  k|\i"  su"  b ɉ"  {!"  ĉ"  [l"  u"  k|\"  u"  C@ɉ"  ǩ"  b ɩ"  {!"  ĩ"  [l"  u"  k|\"  u"  C@"  b "  C@"  "  k|\"  b "  C@"  u"  k|\"  "  {!"  su)#  Ku)#  u)#  [)#  SI#  b I#  CI#  !I#  k|\I#  sui#  b i#  C i#  k|\i#  i#  [l#  b ˉ#  C(ˉ#  u#  su#  k|\#  b 6˩#  ĩ#  C ˩#  [l#  k|\#  b W#  Co#  |\#  #  [l#  b {#  Co#  |\#  #  [l	$  b 	$  C	$  |\	$  	$  [l)$  b )$  C)$  |\)$  )$  [lI$  b I$  CI$  |\I$  I$  [li$  b i$  Ci$  |\i$  i$  [l$  b ̉$  Cˉ$  |\$  ĉ$  [l$  b 6̩$  C˩$  |\$  ĩ$  [l$  b U$  C$  |\$  $  [l$  b x$  C$  |\$  $  [l	%  b 	%  C	%  	%  [l	%  k|\	%  u)%  b )%  C)%  u)%  su)%  k|\I%  b I%  CI%  uI%  k|\i%  b i%  Ci%  Kui%  k|\i%  [ĉ%  b 3͉%  C ˉ%  |\%  ĉ%  [l%  b Mͩ%  Clͩ%  u%  {!%  k|\%  su%  b v%  C(%  !%  {!%  k|\%  b %  C(%  u%  {!%  s!%  k|\&  b ͉&  C(ˉ&  u&  {!&  k|\&  b ͩ&  C(˩&  cΩ&  {!&  k|\&  b &  C(&  &  {!&  k|\'  #'  i'  Kui'  [ĩ(  b &ϩ(  u(  {!(  su(  (  b Y(  u(  {!(  su(  (  b (  u(  {!(  su(  	)  b 	)  u	)  {!	)  su	)  ))  b ))  u))  {!))  su))  I)  b I)  uI)  {!I)  suI)  i)  b Ji)  ui)  {!i)  sui)  ǉ)  b sЉ)  u)  {!)  su)  ǩ)  b Щ)  u)  {!)  su)  )  b )  u)  {!)  su)  )  b )  u)  {!)  su)  	*  b 	*  u	*  {!	*  su	*  )*  b ;)*  u)*  {!)*  su)*  I*  b sI*  uI*  {!I*  suI*  i*  b i*  ui*  {!i*  sui*  ǉ*  b щ*  u*  {!*  su*  ǩ*  b ҩ*  u*  {!*  su*  *  b .*  u*  {!*  su*  *  b \*  u*  {!*  su*  	+  b 	+  u	+  {!	+  su	+  i+  b i+  Coi+  |\i+  {!i+  cҩ+  b Lө+  Co˩+  ĩ+  |\+  [l+  {!+  b w+  {!+  |\+  +  [l+  b +  {!+  |\+  +  [l	,  b 	,  {!	,  |\	,  	,  [l),  b ),  {!),  |\),  ),  [l,  b 4ԩ,  {!,  |\,  ĩ,  [l,  b a,  {!,  |\,  ,  [l,  b ,  {!,  |\,  ,  [l	-  b 	-  {!	-  |\	-  	-  [l)-  b )-  {!)-  |\)-  )-  [lI-  b I-  {!I-  |\I-  I-  [lI-  KuI-  SI-  =i-  b qi-  {!i-  |\i-  i-  [l-  b Չ-  {!-  |\-  ĉ-  [l-  Ku-  Sĉ-  թ-  b  ֩-  {!-  |\-  ĩ-  [l-  b .-  {!-  |\-  -  [l-  Ku-  S-  _-  b -  {!-  |\-  -  [l	.  b 	.  s!).  b ).  suI.  b I.  sui.  b 3׉.  b X׉.  su.  b 	/  KuI/  Ku)0  KuI1  Kui2  Ku3  Ku	5  Kui6  Ku	8  Ku)9  KuI:  Ku:   |\ ;   |\ ;   |\@;   |\`;   |\;   |\;  KuA   |\ B   |\`C   |\C   |\G  KuG  SG  G  KuG  SG  ,H  KuH  SH  f!H  Ku!H  S!H  ŠH   |\H   |\ J   |\ J   |\ K  Ku K  S K  Ku K  S@K  Ku@K  S`K  Ku`K  SĀK  KuK  SĠK  KuK  SK  KuK  S@L  Ku@L  SX   |\X   |\]   |\]   |\Ac   |\ac   |\c   |\c  uc   |\c  uc   |\c   |\c   |\d   |\!d   |\Ad   |\ad   |\d   |\d   |\d   |\e   |\!e   |\Ae   |\Ce   ae   |\e   |\e   |\Af   |\af   |\f   |\f   |\f   |\f   |\g   |\!g   |\Ag   |\ag   |\g   |\g   |\g   |\g   |\h   |\!h   |\Ah   |\ah   |\h   |\h   |\h   |\h   |\i   |\!i   |\Ai   |\ai   |\i   |\i   |\i   |\i   |\j   |\!j   |\Aj   |\aj   |\j   |\j   |\j   |\j   |\k   |\!k   |\Ak   |\ak   |\k   |\k   |\k   |\k   |\l   |\!l   |\Al   |\al   |\l   |\l   |\l   |\l   |\m   |\!m   |\Am   |\am   |\m   |\m   |\m   |\m   |\n   |\!n   |\An   |\an   |\n   |\n   |\n   |\n   |\o   |\!o   |\Ao   |\ao   |\o   |\o   |\o   |\o   |\p   |\!p   |\Ap   |\p   |\p   |\p   |\p   |\q   |\!q   |\Aq   |\aq   |\q   |\r   |\!r   |\Ar   |\ar   |\r   |\r   |\r   |\r   |\s   |\!s   |\As   |\as   |\s   |\s   |\s   |\s   |\t   |\!t   |\At   |\at   |\t   |\t   |\t   |\t   |\u   |\!u   |\Au   |\au   |\u   |\u   |\u   |\u   |\v   |\!v   |\Av   |\av   |\w  uw  u#x  uCx  ucx  ux  ux  ux  u#y  uy   |\y   |\!z   |\z   |\z   |\z   |\z   |\{   |\!{   |\#{   |\C{   |\c{   |\{   |\{   |\{   |\{   |\|   |\#|   |\C|   |\c|   |\|   |\|   |\|   |\|   |\}   |\#}   |\C}   |\}   |\}   |\}   |\}   |\~   |\#~   |\C~   |\c~   |\~   |\~   |\~   |\   |\#   |\C   |\c   |\   |\   |\   |\   |\#   |\C   |\c   |\   |\   |\À   |\   |\   |\#   |\C   |\c   |\   |\   |\Á   |\   |\   |\#   |\C   |\c   |\   |\   |\Â   |\   |\   |\#   |\C   |\c   |\   |\   |\Ã   |\   |\C   |\Ä   |\   |\c   |\   |\   |\Ç   |\   |\   |\#   |\C   |\c   |\   |\   |\È   |\   |\#   |\   |\   |\Č  #|\ď  #|\   |\!   |\A   |\   |\   |\  u  	  u)  ׉  u  	  !)  ɱ  !  ׉  u  )  uI  ɳ  u  i  u  	  u)  ة  uɵ  ة  uɶ  #I  ui  -  !	  :ة  uɸ  JI  ui  Z  u	  q؉  u  )  uI  ɻ  u  i  u  	  u)  ة  uɽ  I  ui    u	  ؉  u  )  !I    u	  ى  u  I  ui  '  u	  2ى  u  A)  uI  P  u  `i  u  m	  u)  {٩  u  )  uI  ٩  Ku  [  Ku  [  b 	  i    )  ى    I  ک  )	  9i  E  Q)  fi  b ri  sui  k|\i  {!i  cډ  b ډ  C(ˉ  k|\  ĉ  [l  {!  b ک  C(˩  k|\  ĩ  [l  {!  b   C(  k|\    [l  {!  b <  C(  k|\    [l  {!	  b _	  C(	  k|\	  	  [l	  {!)  b )  C()  k|\)  )  [l)  {!I  b I  C(I  k|\I  I  [lI  {!i  b i  C(i  k|\i  i  [li  {!  b ۉ  C(ˉ  k|\  ĉ  [l  {!  b ܩ  C(˩  k|\  ĩ  [l  {!  b ;  C(  k|\    [l  {!  b [  k|\    {!  [l	  b 	  k|\	  	  {!	  [l)  b )  k|\)  )  {!)  [lI  b I  k|\I  I  {!I  [li  b .i  k|\i  i  {!i  [l  b b݉  k|\  ĉ  {!  [l  b ݩ  k|\  ĩ  {!  [l  su  k|\  u  {!  Ku  S    b 
  u  {!  su	  b =)  Ku)  [)  SI  KuI  uI  [I  Si  b yމ  Ku  [ĉ  Sĩ  b ީ  u  b   -  k|\  su  {!  b :  u	  b m)  b )  )  [l)  {!I  b I  I  [lI  {!i  b i  i  [li  {!  b 0  !  {!  b m  !  {!  b   {!  c  b (  u  k|\  {!	  b U	  	  k|\	  {!)  b )  )  k|\)  {!I  b I  I  k|\I  {!i  b i  i  ui  {!i  [li  k|\  b :  ĉ  u  {!  [l  k|\  b o  !  k|\  {!  b   !  k|\  {!  b   !  k|\  {!	  b 	  u	  k|\	  {!)  b D)  !)  k|\)  {!I  b qI  !I  k|\I  {!i  b i  !i  k|\i  {!  b   !  k|\  {!  b   su  k|\  {!  c,  b c    u  {!  [l  k|\  b     u  {!  [l  k|\	  b 	  	  k|\	  {!)  b )  )  k|\)  {!I  b I  I  k|\I  {!i  b 9i  i  k|\i  {!  b `    k|\  {!  ĩ  u  {!  [l  k|\    k|\  {!  Ku  [	  Ku	  S	  [)  b )  cI  KuI  SI  [i  b n  b   c  Ku  Sĩ  [  Ku  S  [	  b d	  c)  b I  b   b 
  u  su  {!  b :  u  su  {!  Ku  S  [  b g  u  su  {!)  b )  cI  b jI  !i  b i  !  b   !  b 
  c4  {!  b   {!	  b 	  c4)  b  I  b EI  c4i  b k  b   c4  b   c4  b   b 	  b ,	  su)  b W)  {!I  b I  c4I  {!i  b i  c4i  {!  b   !  {!  b *  !  {!  Ku  [  S  Ku  [  S	  Ku	  [	  S)  Ku)  [)  SI  KuI  [I  Si  Kui  [i  Sĉ  Ku  [ĉ  Sĩ  Ku  [ĩ  Sĩ  c4  Ku  [  S  Ku  [  S	  Ku	  [	  S)  Ku)  [)  SI  KuI  [I  Si  Kui  [i  Sĉ  Ku  [ĉ  S  b V  b 	  b )  Ku)  [)  SI  KuI  [I  Si  b 
  Ku  [ĉ  Sĩ  Ku  [ĩ  S  Ku  [  S  b >	  b z)  b I  b i  Kui  [i  Sĉ  b /  b k  b   b 	  b )  b HI  b i  b   b   b   b A)  cji  b i  !i  {!  b [  u  b   u  b   u  b     u  {!  [l  k|\	  Ku	  [	  S)  b C)  u)  k|\)  {!I  b I  I  uI  {!I  [lI  k|\i  b i  ui  {!i  su  b   u  {!  su  ĩ  |\  {!  [l  [l    |\  {!  Ku	  Ku)  b <)  {!)  [l)  )  |\I  [lI  I  |\I  {!i  [li  i  |\i  {!  [l  ĉ  |\  {!  [l  ĩ  |\  {!  Ku  Sĩ  =  [l    |\  {!  Ku  S    [l    |\  {!  Ku  S  _	  [l	  	  |\	  {!)  [l)  )  |\)  {!I  [lI  I  |\I  {!!   |\   |\   |\   |\A   |\   |\   |\   |\!   |\A   |\a   |\a   |\   |\   |\   |\   |\  |\  |\  |\A  |\a  |\  |\A  |\a  |\  |\  |\  |\  |\  |\!  |\A  |\a  |\  |\  |\  |\  |\	  |\!	  |\A	  |\a	  |\	  |\	  |\	  |\	  |\
  |\!
  |\A
  |\a
  |\
  |\
  |\
  |\
  |\  |\!  |\A  |\a  |\  |\  |\  |\  |\  |\!  |\A  |\a  |\  |\  |\  |\
  |\!
  |\A
  |\a
  |\
  |\
  |\
  |\
  |\  |\!  |\A  |\a  |\  |\  |\  |\  |\  |\!  |\A  |\a  |\  |\  |\  |\  |\  |\!  |\A  |\a  |\  |\  |\  |\I  |\!`  |\`  |\`  |\!a  |\d  |\ p  |\@p  |\`p  |\p  |\p  |\p  |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\`  |\`  |\  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\  |\  |\  |\  |\   |\   |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\   |\@  |\`  |\  |\  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\   |\  |\  |\  |\   |\   |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\  |\  |\`  |\  |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\`  |\  |\  |\   |\   |\   |\   |\   |\@  |\`  |\@  |\`  |\   |\@  |\  |\    |\   |\   |\  |\   |\  |\   |\  |\  |\ 	  |\ 	  |\
  |\
  |\
  |\
  |\   |\   |\   |\   |\`
  |\
  |\
  |\
  |\   |\@  |\`  |\  |\  |\  |\  |\   |\  3@7  |\`7  |\7  |\7  |\ 9  |\@9  |\`9  |\9  |\9  |\9  |\`X  |\X  |\X  |\X  |\X  |\ Y  |\Z  |\ [  |\ [  |\@[  |\`[  |\ \  |\ \  |\@\  |\`\  |\\  |\\  |\g  |\g  |\g  |\ h  |\ h  |\@h  |\`h  |\h  |\h  |\h  |\i  |\i  |\ n  |\ n  |\`  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\@  |\`  |\  |\  |\   |\   |\@  |\`  |\  |\  |\   |\   |\  |\  |\  |\  |\@  |\`  |\  |\  |\   |\   |\  |\  |\  |\  |\   |\   |\  |\  |\  |\  |\@  |\`  |\  |\  |\  |\  |\   |\   |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\  |\  |\  |\  |\@  |\`  |\  |\  |\   |\   |\  |\   |\  |\  |\  |\  |\@  |\`  |\   |\@  |\   |\   |\  |\   |\  |\  |\   |\  |\  |\  |\  |\  |\  |\`  |\  |\   |\`  |\  |\  |\  |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\  |\  |\   |\   |\@  |\`  |\  |\  |\   |\   |\  |\  |\`  |\  |\   |\@  |\  |\  |\  |\  |\@  |\`  |\  |\  |\  |\   |\   |\  |\  |\   |\   |\ "  |\ "  |\@'  |\`'  |\'  |\'  |\    G 0   H4]~0KhH	|						
(
Q
W
g
|




-IWes!+'
9
|







 $$`f#>&DkxFv|?2U7]v
;Rk
"1Tc	"LvbBH 5Mt}#QxE   !!#!A!!U""""y####0$O$w$$$%K%t%% &c&&6'Z'v'''
(.([((()9)H)N)l)))) **#*R*p** +++++),a,,,,,)-9-----.;.Q.y..../T/////0/0q0000001b1111272P2w233334,4B4566+616Y6d6667F777778@8J8c888888
9*9\9y999
:/:c:y:::::;N;g;v;;;;;<"<<<<<=)=u=====>'>G>>>>#?=????@6@`@@@@@@AAA+ADApAAAAAAABBBB#CCDDDD[EEEEEFF-FFFFFGsGGGGGGH9HKHHH9INIIIIIJ*J;JWJoJuJ~JJJJJJK.K9KSKKKK1L:LTLLLLLM%M.MTM_MhMnMMMM3NNNNNO*O9OLO_OOOOOOOO-PVPxPPPPPPQ?QQARVR}RRRRRRS+S@SLSSSSSS TTNT~TTTTTTT;UPUUUUUV(VVVVVVWW9WqWWWX$X2XbXtXzXXXXXXX@     ׫ %    )    -  v0  1    5       (  9    =  )  A  
  E    I  U  M   e  +  i  6  t  6  t  < t  `< t         	     
   !  '  ,  1  6  ;  @  E  J  O  U  Z  _  d  i  n  s  x   } !  "  #  $  %  &  '  (  )  *  +  ,  -  .  /  0  1  2  3  4  5  6  7  8  9  :  ;  < = 	> @ B EC YD ZG [H cI eK pL vM y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 2n 7o <p Dq Jr Os Tt Yu ^v cw hx my rz w{ || } ~                             # ) / 4 9 > C H M Q U Y ] a e j o t y ~                                     ) . 3 4 9 > C H M R W \ a g m r w |                              & -036:>BFN	S
X]c
hmrw| !"#$%&'()*+,-./012!3&4+5065798=9?:@;C<F=I>L?O@RAUBXC[D^EaFdGfHhIjJkKwLMNOPQRSTUWXYZ[\]^_`abcdefghjkqs
vxy{ |%~,-235AIOQRfklmx  	

 #$%'()*+,-./012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 i#l'p)q+r,|2}3~456789=@ABCDEFGWXZ[\]^_`abcdefghijklmnopqrtuvwxyz{|}~ 					
											 	"	$	&	(	*	,	.	0	1	2	3	4	;	<	=	E	I	J	K	L	M	R					!	'	(	:	D	              l?   9    O   2    д    N.    Q ɭ      O!     ͭ      M   #@   ɫ    e:       O!     ͭ      M   #@   ɫ    e:         ͭ      M   #@   4 ӭ    ͭ      M   #@   ɫ          ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ          ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ          ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ          ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ          ͭ      M   #@     ͭ      M   #@     ͭ      M   #@     ͭ      M   #@     ͭ      M   #@     ͭ      M   #@     ͭ      M   #@     ͭ      M   #@     ͭ      M   #@     ͭ      M   #@     ͭ      M   #@   ɫ          ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ          ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ٭  ٢ ޭ     o%   #        4    `\   _   C   '   ݨ    څ         &   !   2C $   *  Te 0  *\ 6  8 <       %    ݫ B   L  I   =   A   
    ɭ  > R  %   &      Y   _      9    9    ) e  &.    V:    4 k  e     q  u  k   z  a^      f    7    .   -   E2    $0    <2    F   L   'G   L   5    L7    1    }1    M   g       1                <      \   D   C   (A   @   f   <   f   ɚ                '    _        w    Ǜ    B        \!       ɫ    4R          
    #@   0    L   0      ͭ  >    #@   ?   
       0      ͭ      M   #@   ɫ        O!   L   0    |      ͭ      M   #@   ɫ        O!   0    L   |      ͭ      M   4 ӭ      #@   S   0    |      ͭ      M           O!   ɫ    #@   L   0    |      ͭ      M           O!   ɫ    #@   L   0    |      ͭ      M       O!   ɫ    e:   ݗ           #@   0    L   |      ͭ      M       O!   #@   0    |      ͭ      M       O!   S   #@   0    |      ͭ      M      0   X   2       /    K   #@   0    |    >    |    >    >      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@     ͭ      M   #@     ͭ      M   #@   ɫ      ͭ      M   #@     ͭ      M   #@     ͭ      M   #@     ͭ      M   #@     ͭ      M   #@     ͭ      M   #@     ͭ      K   /    #@     ͭ      M   #@   4 ӭ    ͭ      M   #@   4 ӭ    ͭ      M   ɫ    e:   ݗ       #@     ͭ      M   #@   ɫ          ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ    e:         ͭ      M   #@   ɫ          ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ          ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ          ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@     ͭ      M   #@     ͭ      M   #@     ͭ      M   #@     ͭ      M   #@     ͭ      M   #@     ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   ɫ    #@     ͭ      M   ɫ    #@     ͭ      M   ɫ    #@     ͭ      M   ɫ    #@     ͭ      M   ɫ    #@     ͭ      M   ɫ    #@     ͭ      M   ɫ    #@     ͭ      M   ɫ    #@     ͭ      M   #@   ɫ          ͭ  #@       M   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@     ͭ      M   #@   ɫ          ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ          ͭ      #@     ͭ      #@     ͭ      #@     ͭ      #@     ͭ      #@     ͭ      #@     ͭ      #@     ͭ      #@     ͭ      M   #@     ͭ      M   #@   ɫ          ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ          ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   ɫ    e:   ݗ           #@     ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ    ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   S   4 ӭ    ͭ      M   #@   S   4 ӭ  O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ          ͭ      M   #@     ͭ      M   #@     ͭ      M   #@     ͭ      M   #@     ͭ      M   #@   O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    e:   ݗ       O!     ͭ      M   #@   ɫ    e:       O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ    O!     ͭ      M   #@   ɫ          ͭ      M     ͭ      M     ͭ      M     ͭ      M   #@     ͭ      M   #@     ͭ      M   #@     ͭ      M   #@   O!     ͭ      M   #@   ɫ    e:         ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   K   /      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ      ͭ      M   #@   ɫ    lg   \!   >      ͭ  lg   \!   >      ͭ  lg   \!   >      ͭ  lg   \!   >      ͭ  ?   #@   lg   \!   >      ͭ  ?   #@   lg   \!   >    #@     ͭ  lg   \!   >    #@     ͭ  lg   \!   >      ͭ  #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  #@   >      ͭ  #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  ?   #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  ?   #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  ?   #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  #@   lg   \!   >      ͭ  lg   \!   >      ͭ      '       \!   
    #@   \!   
    #@   \!   
    #@   \!   
    #@   \!   
    #@   \!   
    #@   \!   
    #@   \!   
    #@   \!   
    #@   \!   
    #@   \!   
    #@   \!   
    #@   
       
       
                 ~ Ʈ   ̮   Ү   خ  M ޮ  l   8*   ,      	               ͽ   o     &  g    ^j     ,     `    ,  r/    c     1   4    y 5    ;    A  E  G  o/   .     M   4    !         S  \ Y  y  _  s   A         }   2           ~  e  " j  ' p  j         fN   E    v    |  e   ?       p   ^   K      e      K   |   ԛ   e      [   Q        e   K      O   $   e       D   ]"      #           >   ,    wN   c   L    W#   w/    $    *    "   ?   /    @      7            F   	       e    h    
    5   e                             7                <       
   v      "   =       G   e   b5           e    ¯  e          C   8     ȯ         _3 ί         U ԯ   گ      0   E   E گ    گ    گ  _  گ  w  گ  B  گ    گ  Ǜ  گ    گ  	    _    0'    ^'       E   Ed   '    F'       Ed      E   W<   F   Z@   iA   B            7 
  5 
     H               3 "  : 
        4 
  5 
  5 
  6 
  (5 
  3 "  e3 "  1 "     p   F	 (     M     A  7 .    (  = 4  = 4  mG   ĸ 
  FY :    ;  7   = 4  	 (  / @  a   <   s= 4     a F        K   D      ; 
  ; 
  #7 
  9 
  1: 
  6 
  D; 
  e9 
  ; 
  9 
  ~ L  B L  s: 
  ,9 
     8 
  [5 
  7 
  <   a F  e R  a F  D      V         : 
  z6 
  8 
  3 "  Q1 "  a F     w   L         D   '1 "  3 "  <3 "  ; 
  5 
  7 
  ^7 
  =  G  [ X  2= 4  @6 
  86 
  a   FY :  8 
  [5 
  }@   A   UD   ZL ^  iA   @   A   <   y1 "  5 
  a F              q2 "  2 "  2 "  4 "  ,8 
  8 
  a8 
  : 
        =2 "  
2 "  1 "  i4 "  >4 "  > 4  o	 (     %   kC   C   B     d    p    {    {    {    {    {    {    {    {    {    {    {    {    d    d         V9   .     {  g     {    {  =  d           U   |M   t    5      *     °   Ȱ  U  ΰ  ^   U   O   5 ԰  }.      ڰ  "    ,       V    0    v       \    j   "    >g   Z 
     -    -  q    q  0    ) e      %*                                               O    O    O    O    O    O    O    O    O    O    O    O    O    O    O    O    O    O    O    O                                    	       }    	       	       }    	               	                                               IK "    (                                       .    .    .    .    .    .    .    .    .    .    .    .        4    :    4    4    4    4    4    4    4              l  @  l  @  l  @  l  @  l  @  l  @  l  @                                       F  } F       L     +   E R  ȵ ]   h  sa s  ) y  F   Z     L  
   V    P:    g      .    @    "    j                                                                   Ȍ       ) e  V:    0    E   :       l  ɭ         v.   )   l  ɭ      )   l  ɭ  B    n   ʁ    6   0   l  ɭ      ܻ   6   0   .   l  ɭ      6   0   .   ?)   l  ɭ      ܻ   8   l  ɭ                  }    	                           "    "    Z 
  Z 
  Z 
  "    "    "    "    "    "    "    "    "                                                                                                                                                  ı   ʱ   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı   ʱ    ı                     @ б  Q ֱ   ܱ   X  ""   ?   ?   ?   =         !D   C   8A   @   ?   U   =   4   ?       ""       ^   q              ,$           ڪ   !(  &  S ,  N(  &  S ,  O ,  Z ,  R ,  NV ,  Q ,  =*  &  T ,  3U ,  W ,  V ,  VT ,  Z ,  3W ,  z*  &  T ,  N ,  )  &  Y ,  Y ,  '  &  T ,  D[ ,  gO ,  oP ,  *  &  Y ,  [ ,  p[ ,  lG 2  t)  &  MX ,  U ,  V ,  *  &  P ,  W ,  P ,  {Q ,  8Z ,  G 2  (  &  R ,  X ,  (S ,  Q ,  H 2  (  &  V ,  O ,  \   oF B      4                ~            &        :   d                  f       ɭ  v 8  v 8  v >  v >                              
 	  
  
          
                                       !   "       #       $       %       &         ' !  "  "  ( #  $  $  ) %  * '  - )  . +  / -  0 /  1 1  2 3  3 5  4 7  7 9  8 ;  9 =  : ?  < A  ? C  @ E  A G  B I  C K  D M  H O  I Q  J S  K U  L W  O Y  P [  Q ]  R _  S a  V c  W e  X g  Y i  Z k  ] m  ^ o  _ q  ` s  a u  d w  e y  f {  g }  h   k   l   m   n   o   r   s   t   u   v   y   z   {   |   }                                                                                                                                                               	    
                    !  #  %  '  )  +  -  /  1  3  5  7  9  ;  =  ?  A  C  E  G  I  K  M  O  Q  S  U W Y [ ] _ a c e 
g i k m o q s u w y { }  ! " # $ ' ( ) * - . / 0 3 4 5 6 9 : ; < ? @ A B E F G H K L M N Q R S T W X Y Z [ \ ` a b c d g h i j k n o p q r u v w x y z ~     	  
          ! # % ' ' ) + - - / / 1 3 3 5 5 7 9 9 ; = ? A C E G I K M O Q S S U U W Y [ [ ] ] _ _ a a c c e e g g i i k k m m o 
q q s s u w w y y { { }    E F P Q                                               " # $ + , - . / 5 ; < D H I J K L M N O P Q R d e f g h i j k l m n t u v w              	  
           ! # % ' ' ) + - / 1 3 5 7 9 ; ; = ? A C E G I K M O Q Q S U W Y [ ] _ a c e g g i k m o q  s u w y { }    
          # $ % & ' ( ) * + , 3 4 5 6 7 8 9 : ; < = > ? @ F G J K N \ ] ^ _ ` c d e f g j k l m n q r s t u x y z { |       	  
          ! # % ' ) + - / 1 3 5 7 9 ; = ? A C E G I K M O Q S U W Y [ ] _ a c e g i k m o q s u w y { }                                      	 
                  ! $ % & ' ( + , - . / 2 3 4 5	 6 7
 8 ; < = > ? @ D E F! G# H% K' L) M+ N- O/ R1 S3 T5 U7 V9 Y; Z= [? \A ]C `E aG bI cK dM gO hQ iS jU kW nY o[ p] q_ ra sc we xg yi zk {m ~o q s u w y { }                                                                      	  
          ! #  % ' ) + - / 	1 
3 5 7 
9 ; = ? A C E G I K M O Q #S $U %W &Y '[ (] ,_ -a .c /e 0g 3i 4k 5m 6o 7q :s ;u <w =y >{ A} B C D E H I J K L O P Q R S W X Y Z ] ^ _ ` c d e f i j k l o p q r u v w x { | } ~                            	  
          ! # % ' ) + - / 1 3 5 7 9 ; = ? A C E G I K M O Q S U W Y [ ] _ a c e g i k m o q s u w y { }               
             ! " % & ' * + , / 0 1 4 5 6 7 : ; < = > ? C D E F G J K L M N Q R S T U X Y Z [ \ _ ` a b	 c d
 h i j k l o p q r s! v# w% x' y) z+ }- ~/ 1 3 5 7 9 ; = ? A C E G I K M O Q S U W Y [ ] _ a c e g i k m o q s u w y { }                                                              	  
   	 	 	 	 		 	 
	 	 	  	 !	 "	 #	 $	 (	 )	 *!	 +#	 ,%	 -'	 1)	 2+	 3-	 4/	 51	 63	 75	 ;7	 <9	 =;	 >=	 A?	 BA	 CC	 DE	 GG	 HI	 IK	 JM	 MO	 NQ	 OS	 PU	 SW	 TY	 U[	 V]	 Y_	 Za	 [c	 \e	 ]g	 ^i	 bk	 cm	 do	 eq	 fs	 gu	 kw	 ly	 m{	 n}	 o	 p	 t	 u	 v	 w	 x	 y	 }	 ~	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 
 
 
 
 	
 
 
 
 
 
 
 
 
 
 
 
 !
 #
 %
 '
 )
 +
 -
 /
 1
 3
 5
 7
 9
 ;
 =
 ?
 A
 C
 E
 G
 I
 K
 	M
 	O
 	Q
 	S
 	U
 	W
 		Y
 
	[
 	]
 	_
 	a
 	c
 	e
 	g
 	i
 	k
 	m
 	o
 	q
 	s
 "	u
 #	w
 $	y
 %	{
 (	}
 )	
 *	
 +	
 .	
 /	
 0	
 1	
 4	
 5	
 6	
 7	
 8	
 9	
 :	
 ;	
 >	
 ?	
 @	
 A	
 B	
 E	
 F	
 G	
 H	
 I	
 L	
 M	
 N	
 O	
 P	
 S	
 T	
 U	
 V	
 W	
 X	
 Z	
 [	
 \	
 ]	
 ^	
 a	
 b	
 c	
 d	
 e	
 h	
 i	
 j	
 k	
 l	
 o	
 p	
 q	
 r	
 s	
 v	
 w	
 x	
 y	
 z	
 	
 	
 	
 	
 	
 	
 	 	 	 	 	 	 		 		 	 	 	
 	 	 	 	 	 	 	 	 	 	 	 	 	 	! 	# 	% 	' 	) 	) 	+ 	+ 	- 	/ 	1 	3 	3 	5 	5 	7 	9 	; 	= 	= 	? 	? 	A 	C 	E 	G 	G 	I 	I 	K 	M 	O 	Q 	Q 	S 	S 	U 	W 	Y 	[ 	[ 	] 	] 	_ 	a 	c 	e 	g 	i 	k 	k 	m 	m 	o 	q 	s 	u 	u 	w 	w 	y 	{ 	} 	 	 	 	 	 	 	 	 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 !
 "
 #
 &
 '
 (
 )
 *
 +
 ,
 /
 0
 1
 2
 3
 4
 5
 8
 9
 :
 ;
 <
 =
 >
 A
 B
 C
 D
 E
 F
 G
 J
 K
 L
 M
 N
 O
 P
 S
 T
 U
 V
 W
 X
 Y
 \
 ]
 ^
 _
 `
 a
 b
 e
 f
 g
 h
 i
 j
 k
 n
 o
 p
 q
 r
 s
	 t
 u

 x
 y
 z
 {
 |
 }
 ~
 
 
 
 
 
 
 
! 
# 
% 
% 
' 
' 
) 
+ 
- 
/ 
/ 
1 
1 
3 
5 
7 
9 
9 
; 
; 
= 
? 
A 
C 
C 
E 
E 
G 
I 
K 
M 
M 
O 
O 
Q 
S 
U 
W 
W 
Y 
Y 
[ 
] 
_ 
a 
a 
c 
c 
e 
g 
i 
k 
k 
m 
m 
o 
q 
s 
s 
u 
u 
w 
y 
{ 
} 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
       	 
 
               ! " % & ' ( ) * , - / 0 4 7 8 9 : ; < = > ? @ A B C R S T U V W X Y Z [ \ `
 a
 e
 f
 g
 j
 k
 q	
 s
 t
 w

 x

 {
 |
 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 !
 !
 #
 #
 %
 %
 '
 )
 +
 +
 -
 -
 /
 /
 1
 1
 3
 3
 5
 5
 7
 7
 9
 9
 ;
 ;
 =
 ?
 A
 A
 C
 C
 E
 E
 G
 G
 I
 I
 K
 M
 M
 O
 Q
 Q
 S
 S
 U
 U
 W
 W
 Y
 Y
 [
 [
 ]
 _
 _
 a
 a
 c
 c
 e
 e
 g
 i
 i
 k
 k
 m
 m
 o
 o
 q
 s
 s
  u
 u
 w
 w
 y
 y
 {
 	}
 
}
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 !
 "
 #
 $
 %
 &
 '
 (
 )
 *
 +
 ,
 -
 .
 /
 0
 1
 2
 3
 4
 5
 6
 7
 8
 9
 :
 ;
 <
 =
 >
 ?
 @
 A
 B
 C
 D
 E
 F
 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
 y
 z
 {
 |
 }
 ~
 
 
 
 
 
 
 
 
 
 
 
 
 
 
        	 	  
            ! # % ' ) + - / 1 3 5 7 9 ; = ? 
A 
A 
C 
C 
E 
E 
G 
G 	
I 

I 
K 
K 
M 
M 
O 
O 
Q 
Q 
S 
S 
U 
U 
W 
W 3
Y 4
Y ;
[ <
[ =
] >
] ?
_ @
_ A
a B
a C
c D
c N
e O
e ]
g ^
g _
i `
i h
k i
k j
m k
m l
o m
o n
q o
q p
s q
s r
u s
u t
w u
w v
y w
y x
{ y
{ z
} {
} |
 }
 ~
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
          & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; D E F G H I J K L M N O P Q R S T U V W X Y Z [ \	 ]	 ^ _ h
 i j k l m n o p q r s t       ! ! # # % % ' ' ) ) + + - - / / 1 1 3 3 5 5 7 7 9 9 ; ; = = ? ? A A C C E E G G I I K K M M O O Q Q S S U U W W Y Y [ [ ] ] _ _ a a c c e e g g i i k k %m *o 0q 2s 4u 6w 8y :{ =} @ C E G H P Q                   	 
   
             ' ( ) - . H I T U V W X Y ` a k l m n o p q r s t u v w x y z { ~                  	  
        	   ! # % ' ") 2+ =- @/ D1 H3 K5 M7 P9 Q; S= U? XA _C `E cG gI kK mM qO uQ yS ~U W Y [ ] _ a c e e g g i i k m o q s u w y 	{ 
}       " % ( + . : = D G J P S V Y e i m w y |                              # 2 : ; < = > ? @ A B C D E F G J M N p q        	  
        ' + , -! .! /# 0% 1% :' ;' <) =) >+ ?+ B- C- F/ G/ H1 I1 J3 K3 L5 M5 P7 Q7 T9 U9 V; W; Z= [= ^? _? `A aA dC eC fE gE hG iG lI mI nK oK rM sM tO uO vQ wQ xS yS |U }U W W Y Y [ [ ] ] _ _ a a c c e e g g i k m o q s u w y { }               	       % & , - 3 4 ; < F G U X Z ^ ` c e h j m o r t w y | ~                                    	  
          ! # % ' ) + - / 	1 3 
5 7 9 ; = ? A C E  G "I $K &M (O *Q ,S .U 0W 2Y 4[ 6] 8_ @a Dc He Ng Og Qi Ri Sk Tk Um Vm Wo Xo Yq Zq [s \s nu ww {y ~{ { } }                                                                 
            ! " ) + , . 0	 2 5
 7 8 : = > ? @ A B C D! E# F% G' H) I+ J- K/ L1 M3 N5 Q7 X9 B; D= ? ? A A C C E E :G ;G@ I @ K @ ,M @ 2O C Z-C \-C ^-C `-C y C { C } C  C  C  C  C  C  C  C  C  C  C  C  C  C  C  C  C  C  C  C  C  C  C  C  C  D Z-D \-D ^-D `-D y D { D } D  D  D  D  D  D  D  D  D   D  D  D  D  D 
 D  D  D  D  D  D  D  D  D  D  D   E ( E * E , E . E 0 E 2 E 4 E 6 E 8 E : E < O R P | Q  R  S  T ( U F V f W  X  Ij _.`.a.b.c.d.e.f.g
.0& 1' - - / ~0 0 0 0 0 0 0 :  %.CLUdlt|&/6?KS\cox&-6?HQ]emu}+4EQXamu|'09BKT]fox )=dq_			.

jk
GGz6T[4=m;n%;&k5E" 7 W n     S!h!!!!!"L"j"'#0##"$$$$$$W%_%g%%%%7&I&Y&o&x&&&&&'Q'm'''''("))8**+++++,,,--i-u---B..../n/w//////000&0~0001 1111112222p333
4444	5,5G5t556666 7)7=7L7h7778/8{8859F9h99:&:;:L::;L<<<<<= ====
>>6>Y>t>>>>	??,?`?w????@%@E@AAAAVB_BhBqBzBBBCDFFGGvHHH+I?IxIIIKJ]JJJJJK%K?KsKKKKKKL(LGLL9NNNOdPPPWWX*XTXXXXXY%Y7YIY[YmYYYYYYYYYZ!ZJZ\ZnZZZZZZZ[[+[=[O[a[s[\ʁ h
tʁ i
    	      [                 [+                   [+          	       [}                   [         	       [?          	       [g                   [?          	       [          	       [          	       [                   [^          	       [                   [              ~           HP                     h           m   H    >   0       %       x       X	    N   	       b       h       Xh       i    l   xi       P]l       bl       el    4   ol    O   8rl        `l        l    6    !m        Pm        Qm    g    Sm        `^m    q    im        8im        im    '    im        0jm        um    Z    zm    z    }m    .     m    i    xm        Xm    D    Xm        hr            ? @ [ [ [ ikqs|  	


$$++++000146 8!9"=#@$@%@&@'A(B)C*C+C,C-C.C/C0C1C2C3C4C5C6C7C8C9D:E;F<X=X>b?f@iAoBqCrDEFGHID     n\      n\     \     N&      P&         =%     &     "&     &     L    &      >&      @&      l&         =%        =%     &      &      &      &      &      &      &      &      &      &      &      &      &      &      &      &      &      &      &      &      &      &       &      &      &      4&     &      &      &    &      &     &      F&      n&     &     &      &      &      &      &            &    &         =%     &      &      &      &      &            .&      .&  o	s	x
^dde
o	.,.,.2.2.x
.x
.8.8.>.>.e.e.o	.o	.~.~............-W59#tUUsUPUAUUFUUNZs/Ue5o		    \!	!!	!!!,"9"""9G
T#I
T##$X$}$!%-%9%E%#%%%%%&(()	T#l*******++[+h+u++T,,	9%--%.9%k9%m9%9%.G/-%k-%m-%	-%	!%-%!%E%9%W81m1z1111E%	E%!%k!%m!%	233)3/3<3I3V3c3|333334	4	45o	555556G
\7	x7y77!99G
:G:5_o	o	N=o=?GCGG
o	o	yH595yOLx
Lko	yBNHNgPgPkPkPkPkPkPgPgQgQgQg'Qk-Qg3Qg9QgoQguQg{QgQgQgQgQgQgQgQgQgQgQgQgQgQgQgQgRgRgRgRgRg#Rg)Rg/Rg5Rg;RgJRgPRgeRgkRgqRgwRgRgRkRgRkRgRkRgRkRkRgRkRkSk
SkSgSk%Sg4Sk:SgFSgaSkgSkmSksSkySkSgSkSgSgSkSkSkSgSkSkSkSgSgTkTkTg0Tk6Tk<TkBTkHTg`TkfTklTkrTkxTgTkTgTgTkTkTgTkTgTkTgTgTgUgUgUg#Ug)Ug/Ug5UgDUgJUgeUgkUgqUkwUk}UkUgUgUkUkUkUgUkUkUkUkUkUgVkVk
VgVk"VgLVgRVgXVg^VgdVgjVgpVgvVg|VgVkVgVgVgVkVkVkVkVkVgVgVgVgVgVgVg WkWgWgWg$Wg*Wg/Wg4WgIWkOWkTWkYWk_WyXXWHN'Y'.Y'@Y'RY'dY'vY'Y'Y'Y'Y'Y'Y'Y'Z'Z'*Z'3Z)3Z'SZ'eZ'wZ'Z'Z)Z)Z)Z'Z'Z'Z'Z'['"['4['F[)X['j[1[ H q *  y d
	 d
 d
 d
 q *  y q *  y d
. / H0 q1 * 1 y3 d
6 7 8 =< " = q> & > y? q@ & @ yA !F "      <.cctor>b__11_10 <.cctor>b__21_10 <>9__5_10 <CreateModifiers>b__5_10 <.cctor>b__6_10 __StaticArrayInitTypeSize=20 <.cctor>b__11_20 <.cctor>b__11_30 <.cctor>b__11_40 <>9__10_0 <PopulateStyleInfoList>b__10_0 <PopulateContentGroup>b__20_0 <>c__DisplayClass60_0 <>9__0_0 <ToHashtable>b__0_0 <PopulateContentGroup>b__0_0 <>c__DisplayClass0_0 <>9__11_0 <ImportFromHashtable>b__11_0 <.cctor>b__11_0 <ApplySectionProperties>b__11_0 <>c__DisplayClass11_0 <.cctor>b__21_0 <>9__81_0 <CreateTableFormLayout>b__81_0 <>9__1_0 <GetLocalizationDelegate>b__1_0 <Serialize>b__1_0 <>c__DisplayClass1_0 <>c__DisplayClass12_0 <>c__DisplayClass282_0 <>9__82_0 <CreateRowFormLayout>b__82_0 <>9__2_0 <GetPresetStylesResourceDelegate>b__2_0 <RegisterInFactory>b__2_0 <>c__DisplayClass2_0 <>c__DisplayClass13_0 <>9__23_0 <PopulateStyleInfoList>b__23_0 <>9__53_0 <ProcessRequestCore>b__53_0 <>9__83_0 <CreateColumnFormLayout>b__83_0 <>c__DisplayClass14_0 <>c__DisplayClass54_0 <>9__74_0 <SerializeWorkSession>b__74_0 <>9__84_0 <CreateCellFormLayout>b__84_0 <>9__4_0 <ExecuteInternal>b__4_0 <.cctor>b__4_0 <GetStateManagedObjects>b__4_0 <>c__DisplayClass4_0 <>9__15_0 <ExecuteCommands>b__15_0 <GetAllowedFileCollection>b__35_0 <>c__DisplayClass35_0 <>9__45_0 <CreateMarginsFormLayout>b__45_0 <>c__DisplayClass75_0 <>9__85_0 <CreateMarginsGroup>b__85_0 <>9__5_0 <RegisterKnownTypes>b__5_0 <CreateModifiers>b__5_0 <Modify>b__5_0 <>c__DisplayClass5_0 <>9__46_0 <CreatePaperFormLayout>b__46_0 <>9__6_0 <CopyFrom>b__6_0 <.cctor>b__6_0 <>c__DisplayClass6_0 <>9__27_0 <GetStyleHandler>b__27_0 <>9__47_0 <CreateLayoutFormLayout>b__47_0 <>9__7_0 <UpdateRibbonGroupVisibility>b__7_0 <>c__DisplayClass7_0 <>9__28_0 <PopulateContentGroup>b__28_0 <>c__DisplayClass48_0 <>9__8_0 <Load>b__8_0 <UpdateRibbonTabVisibility>b__8_0 <>9__19_0 <FromHashtable>b__19_0 <>c__DisplayClass19_0 <>9__9_0 <AppendItem>b__9_0 <.cctor>b__9_0 <>c__DisplayClass9_0 <>9__0 <DrawTableBackground>b__0 <GetItemFromHashtableCache>b__0 <FromHashtable>b__0 <FinishImportFromHashtable>b__0 <ToHashtable>b__0 <ApplyParagraphStyle>b__0 <PerformModifyModelCore>b__0 <GetBinaryDocumentHandlerResponse>b__0 <GetImageLoadingUrlResourceDelegate>b__0 <ApplyTableFormatting>b__0 <ExecuteInternal>b__0 <PerformModifyModel>b__0 <AddTabCollectionToControl>b__0 <AddContextCategoriesToControl>b__0 <AddImageToCacheFromUrl>b__0 <DeserializeWorkSession>b__0 <OpenWorkSession>b__0 <CreateInputPosition>b__0 <ImportRun>b__0 <PopulateContentGroup>b__0 <ImportHeaderFooter>b__0 <GetRibbonImageProperties>b__0 <GetCorrespondenceTableForPictures>b__0 <GetCustomItems>b__0 <DrawTableBorders>b__0 <AttachClient>b__0 <SwitchDocument>b__0 <GetItemByIndex>b__0 <GetShapeBox>b__0 <SaveCopy>b__0 ParagraphTab0 <.cctor>b__11_11 <.cctor>b__21_11 <>9__5_11 <CreateModifiers>b__5_11 <.cctor>b__6_11 <.cctor>b__11_21 <.cctor>b__11_31 <.cctor>b__11_41 <PopulateContentGroup>b__20_1 <>9__0_1 <ToHashtable>b__0_1 <>9__11_1 <.cctor>b__11_1 <ApplySectionProperties>b__11_1 <>c__DisplayClass11_1 <.cctor>b__21_1 <>9__81_1 <CreateTableFormLayout>b__81_1 <>9__12_1 <GetCustomItems>b__12_1 <>9__82_1 <CreateRowFormLayout>b__82_1 <>9__84_1 <CreateCellFormLayout>b__84_1 <.cctor>b__4_1 <>9__45_1 <CreateMarginsFormLayout>b__45_1 <>9__5_1 <RegisterKnownTypes>b__5_1 <CreateModifiers>b__5_1 <.cctor>b__6_1 <>9__47_1 <CreateLayoutFormLayout>b__47_1 <PopulateContentGroup>b__28_1 <>9__19_1 <FromHashtable>b__19_1 <.cctor>b__9_1 <FromHashtable>b__1 <FinishImportFromHashtable>b__1 <ToHashtable>b__1 <GetBinaryDocumentHandlerResponse>b__1 <GetPresetStylesResourceDelegate>b__1 <GetAllowedFileCollection>b__1 <>f__AnonymousType0`1 <>c__27`1 Func`1 WebRichEditStateBasedCommand`1 UniqueItemsCache`1 Nullable`1 IComparable`1 IEnumerable`1 IOrderedEnumerable`1 ParagraphPropertiesBasedStyle`1 StyleBase`1 DocumentModelBase`1 WorkSessionBase`1 StyleCollectionBase`1 TablePropertyWithUseModelModifierBase`1 TableGeneralPropertyWithUseModelModifierBase`1 TableCellPropertyWithUseModelModifierBase`1 TableFloatingPositionPropertyWithUseModelModifierBase`1 TableRowPropertyWithUseModelModifierBase`1 TableComplexPropertyWithUseModelModifierBase`1 TableCellComplexPropertyWithUseModelModifierBase`1 TablePropertyModelModifierBase`1 TableCellPropertyModelModifierBase`1 AnchorInfoPropertyModelModifierBase`1 TableRowPropertyModelModifierBase`1 ASPxResLocalizerBase`1 BordersBase`1 OfficeDocumentBase`1 Predicate`1 IControl`1 NumberingListBaseImpl`1 Action`1 ICollection`1 RibbonTabCollection`1 ISimpleCollection`1 DocumentIntervalCollection`1 ListLevelCollection`1 ReadOnlyCollection`1 RibbonContextTabCategoryCollection`1 Comparison`1 ASPxActiveLocalizerProvider`1 ListLevelIOverrideModifier`1 JSONPieceTableModifier`1 IModelModifier`1 JSONModelModifier`1 TablePropertyWithUseModelModifier`1 TableCellPropertyWithUseModelModifier`1 TableRowPropertyWithUseModelModifier`1 TableComplexPropertyWithUseModelModifier`1 TableCellComplexPropertyWithUseModelModifier`1 IntervalModelModifier`1 ListLevelModelModifier`1 SectionModelModifier`1 AnchorWrapModelModifier`1 TablePropertyModelModifier`1 ShapePropertyModelModifier`1 TableCellPropertyModelModifier`1 AnchorInfoPropertyModelModifier`1 TableRowPropertyModelModifier`1 WebParagraphPropertiesModifier`1 ListLevelPropertiesModifier`1 SectionPropertiesModifier`1 WebCharacterPropertiesModifier`1 ParagraphPropertyModifier`1 SectionPropertyModifier`1 RunPropertyModifier`1 ItemHandler`1 EventHandler`1 IComparer`1 EqualityComparer`1 XtraLocalizer`1 IEnumerator`1 InstanceActivator`1 RichEditIndexBasedObject`1 CacheByObject`1 HashSet`1 IConvertToInt`1 IList`1 CacheByIndex`1 IVectorReadOnly`1 ParagraphTab1 get_Dark1 get_Item1 <>7__wrap1 border1 CS$<>8__locals1 cellMargins1 borders1 get_Light1 get_Accent1 <>m__Finally1 DevExpress.Data.v18.2 DevExpress.Web.v18.2 DevExpress.Web.ASPxSpellChecker.v18.2 DevExpress.Web.ASPxRichEdit.v18.2 <.cctor>b__11_12 <.cctor>b__21_12 <>9__5_12 <CreateModifiers>b__5_12 <.cctor>b__6_12 <.cctor>b__11_22 <.cctor>b__11_32 ToInt32 <.cctor>b__11_42 <>9__0_2 <ToHashtable>b__0_2 <.cctor>b__11_2 <.cctor>b__21_2 <>9__81_2 <CreateTableFormLayout>b__81_2 <>9__12_2 <GetCustomItems>b__12_2 <>9__84_2 <CreateCellFormLayout>b__84_2 <.cctor>b__4_2 <>9__5_2 <RegisterKnownTypes>b__5_2 <CreateModifiers>b__5_2 <.cctor>b__6_2 <>9__28_2 <PopulateContentGroup>b__28_2 <>9__19_2 <FromHashtable>b__19_2 <FinishImportFromHashtable>b__2 <ToHashtable>b__2 <GetBinaryDocumentHandlerResponse>b__2 <GetPresetStylesResourceDelegate>b__2 <GetStateObjects>d__2 <>c__DisplayClass9_0`2 <>f__AnonymousType1`2 Func`2 WebRichEditPropertyStateBasedCommand`2 IndexedTree`2 Tuple`2 TableItemCollectionCore`2 CreateHeaderFooterCommandBase`2 ChangeHeaderFooterIndexCommandBase`2 HeaderFooterCollectionBase`2 Function`2 HeaderFooterExporter`2 KeyValuePair`2 MergedProperties`2 SectionHeadersFooters`2 UndoableIndexBasedObject`2 MultiIndexObject`2 List`2 IDictionary`2 SortedDictionary`2 ConcurrentDictionary`2 get_Dark2 get_Item2 border2 cellMargins2 borders2 get_Light2 get_Accent2 <.cctor>b__11_13 <.cctor>b__21_13 <>9__5_13 <CreateModifiers>b__5_13 <.cctor>b__6_13 <.cctor>b__11_23 <.cctor>b__11_33 <.cctor>b__11_43 <>9__0_3 <ToHashtable>b__0_3 <.cctor>b__11_3 <.cctor>b__21_3 <>9__84_3 <CreateCellFormLayout>b__84_3 <.cctor>b__4_3 <>9__5_3 <CreateModifiers>b__5_3 <.cctor>b__6_3 <>9__19_3 <FromHashtable>b__19_3 <FinishImportFromHashtable>b__3 <ToHashtable>b__3 <GetPresetStylesResourceDelegate>b__3 Func`3 get_Accent3 <.cctor>b__11_14 <>9__5_14 <CreateModifiers>b__5_14 <.cctor>b__6_14 <.cctor>b__11_24 <.cctor>b__11_34 <.cctor>b__11_44 <>9__0_4 <ToHashtable>b__0_4 <.cctor>b__11_4 <.cctor>b__21_4 <.cctor>b__4_4 <>9__5_4 <CreateModifiers>b__5_4 <.cctor>b__6_4 <>9__19_4 <FromHashtable>b__19_4 get_Accent4 <.cctor>b__11_15 <.cctor>b__6_15 <.cctor>b__11_25 <.cctor>b__11_35 <.cctor>b__11_45 <.cctor>b__11_5 <.cctor>b__21_5 <.cctor>b__4_5 <>9__5_5 <CreateModifiers>b__5_5 <.cctor>b__6_5 <ToHashtable>b__5 get_Accent5 <.cctor>b__11_16 <.cctor>b__6_16 <.cctor>b__11_26 <.cctor>b__11_36 <.cctor>b__11_46 <>9__0_6 <ToHashtable>b__0_6 <.cctor>b__11_6 <.cctor>b__21_6 <.cctor>b__4_6 <>9__5_6 <CreateModifiers>b__5_6 <.cctor>b__6_6 get_Accent6 <.cctor>b__11_17 <.cctor>b__6_17 <.cctor>b__11_27 <.cctor>b__11_37 <.cctor>b__11_47 <.cctor>b__11_7 <.cctor>b__21_7 <.cctor>b__4_7 <>9__5_7 <CreateModifiers>b__5_7 <.cctor>b__6_7 <.cctor>b__11_18 <.cctor>b__11_28 <.cctor>b__11_38 __StaticArrayInitTypeSize=48 <.cctor>b__11_48 08D96E00C93AA1B5FC5B91CDB38349FC1EA17E88 get_UTF8 <.cctor>b__11_8 <.cctor>b__21_8 <.cctor>b__4_8 <>9__5_8 <CreateModifiers>b__5_8 <.cctor>b__6_8 <.cctor>b__11_19 <.cctor>b__11_29 <.cctor>b__11_39 <.cctor>b__11_49 <>9 <.cctor>b__11_9 <.cctor>b__21_9 <>9__5_9 <CreateModifiers>b__5_9 <.cctor>b__6_9 <Module> <PrivateImplementationDetails> PBB get_ScB System.Drawing.Drawing2D get_Transform2D 357FACC3060673EFE58C0DCDB5AF0E35937850CD get_ID set_ID IsBoundUsingDataSourceID get_EmptyImageCacheID set_EmptyImageCacheID get_AssociatedRibbonID set_AssociatedRibbonID DevExpress.Web.Office.OfficeWorkSessionControl.GetWorkSessionID newWorkSessionID workSessionID get_PathOrID get_DocumentPathOrID set_DocumentPathOrID documentPathOrID RicheditPopupDialogContainerID RichEditRibbonContainerID RichEditPopupMenuContainerID get_ClientID GenerateClientID set_PopupElementID documentID MAX_VALUE RectangleF SizeF PointsToPixelsF InchesToModelUnitsF PointsToModelUnitsF get_ScG get_RaiseClientEventsOnModificationsViaAPI set_RaiseClientEventsOnModificationsViaAPI get_EnableClientSideAPI set_EnableClientSideAPI System.Web.UI get_IsMobileUI get_IsMSTouchUI get_IsTouchUI WordML DevExpress.Office.DrawingML ColorHSL ImportModelFromJSON ExportModelToJSON AutoScrollCursorN System.IO get_ScR AutoScrollCursorNS get_IsMacOS AutoScrollCursorS KLT U get_X KeepX PercentOffsetX BASE64_KEY ID_KEY get_Y set_Y get_DpiY PercentOffsetY value__ CreateMainArea get_EastAsia DevExpress.Data get_Data get_ViewMergedData set_ViewMergedData ToggleViewMergedData set_CallbackData get_FileManagerCallbackData get_CurrParagraphJsonData get_CurrChunkJsonData get_CurrSectionJsonData get_CurrRunJsonData CollectData LoadPostData get_Metadata RERTab get_Tab AddTab foundTab RERMailMergeTab get_MailMergeTab CreateMailMergeTab mailMergeTab RERFileTab get_FileTab CreateFileTab set_ShowFileTab fileTab RERHomeTab get_HomeTab CreateHomeTab homeTab tableDesignContextualTab get_HeaderFooterContextualTab CreateHeaderFooterContextualTab headerFooterContextualTab get_FloatingObjectsContextualTab CreateFloatingObjectsContextualTab floatingObjectsContextualTab tableLayoutContextualTab RERTableDesignTab get_TableDesignTab CreateTableDesignTab RibbonTab RERHeaderAndFooterTab RERReferencesTab get_ReferencesTab CreateReferencesTab referencesTab RERFloatingObjectsTab get_AcceptsTab set_AcceptsTab RERInsertTab get_InsertTab CreateInsertTab insertTab RERPageLayoutTab get_PageLayoutTab CreatePageLayoutTab pageLayoutTab RERTableLayoutTab get_TableLayoutTab CreateTableLayoutTab RERViewTab get_ViewTab CreateViewTab RERReviewTab tab System.Web DevExpress.Web InsertImage_FromWeb GetNumberingListsForWeb get_Rgb set_Rgb get_ScRgb ToRgb GetColorFromArgb ToArgb argb mscorlib ePub <>c get_GenericTypographic BoldItalic get_FontItalic set_FontItalic ToggleFontItalic System.Collections.Generic get_IsStatic IsBehindDoc pc Src exc get_Id EditIncId innerSubDocId get_CurrentManagedThreadId <>l__initialThreadId sessionGuidId get_LastExecutedEditCommandId set_LastExecutedEditCommandId LanguageId ImageCacheId get_ParentPieceTableId PictureId OfficeStringId ASPxperienceStringId RichEditExtensionsStringId XtraRichEditStringId ASPxRichEditStringId stringId get_IncrementalId set_IncrementalId get_EditIncrementalId set_EditIncrementalId newSessinId SubmitButtonId InnerId SetId getId clientId get_DocumentId set_DocumentId SubDocumentId subDocumentId documentId get_RequestId UserRequestId requestId get_DivId set_DivId set_UseDivId ConnectToOpenedDocumentById HistoryId get_IsHibernateViaSaveAndLoad DevExpress.Web.Internal.IDialogFormElementRequiresLoad.ForceLoad PrepareBeforeLoad set_UpdateHyperlinksOnLoad IDialogFormElementRequiresLoad get_Download set_Download get_AllowDownload DevExpress.Web.Internal.Dialogs.IFileManager.get_SettingsUpload FileManagerSettingsUpload Bookmarks_Add HtAdd get_Loaded get_DocumentLoaded set_DocumentLoaded OnNewDocumentLoaded loaded add_SpellCheckerWordAdded remove_SpellCheckerWordAdded RaiseSpellCheckerWordAdded OnParagraphAdded Base64Encoded DevExpress.Web.IPropertiesOwner.Changed OnModifiedChanged OnChanged get_SelectionChanged set_SelectionChanged HyperlinkInfoChanged ModelIsChanged get_ParagraphPropertiesChanged set_ParagraphPropertiesChanged OnParagraphPropertiesChanged get_CharacterPropertiesChanged set_CharacterPropertiesChanged OnCharacterPropertiesChanged get_DocumentChanged set_DocumentChanged get_ActiveSubDocumentChanged set_ActiveSubDocumentChanged LayoutChanged UnderlineType_Dashed UnderlineType_LongDashed UnderlineType_ThickLongDashed UnderlineType_ThickDashed get_Modified set_Modified IsModified GetModified SetModified Justified ClipboardAccessDenied set_Checked MulDivRoundChecked get_Locked set_Locked RaiseSavingCallIsLocked Interlocked get_Enabled set_Enabled get_IsDocumentProtectionEnabled IsEnabled IsCallBacksEnabled GetDefaultEnabled set_ClientEnabled IsScriptEnabled get_Handled EnsurePageUnloadHandled CheckDeletingFileIsOpened WorkSessionGuidAssigned Undefined Tabs_TabStopsToBeCleared Numbering_Numbered Numbering_OutlineNumbered Centered SessionHasExpired set_IsRequired OnNewDocumentCreated set_IsAutomaticColorSelected get_Deleted set_Deleted IsDeleted Numbering_Bulleted get_Bulleted set_Bulleted NumberingBulleted SpellingCheckCompleted get_Visited set_Visited get_ContentInserted set_ContentInserted ListIndexNotSetted UnderlineType_Dotted UnderlineType_DashDotted UnderlineType_ThickDashDotted UnderlineType_ThickDotted UnderlineType_DashDotDotted UnderlineType_ThickDashDotDotted add_BeforeCommandExecuted remove_BeforeCommandExecuted RaiseBeforeCommandExecuted add_beforeCommandExecuted remove_beforeCommandExecuted get_CustomCommandExecuted set_CustomCommandExecuted get_ContentRemoved set_ContentRemoved get_BulletedAllowed get_SimpleAllowed get_ParagraphStyleAllowed get_CharacterStyleAllowed get_OvertypeAllowed set_OvertypeAllowed get_SaveAllowed get_PrintingAllowed get_ParagraphFormattingAllowed get_CharacterFormattingAllowed get_MultiLevelAllowed get_OpenAllowed get_SaveAsAllowed get_ParagraphTabsAllowed get_TablesAllowed get_InlinePicturesAllowed get_ParagraphsAllowed get_BookmarksAllowed get_SectionsAllowed get_HeadersFootersAllowed get_FloatingObjectsAllowed get_CreateNewAllowed System.Collections.Specialized isInitialized set_IsValid BorderShading_BordersGrid get_WorkSessionGuid set_WorkSessionGuid get_TemporaryWorkSessionGuid set_TemporaryWorkSessionGuid workSessionGuid GetSessionGuid get_ClientGuid set_ClientGuid get_EditorClientGuid set_EditorClientGuid clientGuid GenerateNewGuid newGuid GetCustomDictionaryGuid customDictionaryGuid guid <className>i__Field <cssText>i__Field CreateTocField get_RequiredField CreatePageField UpdateMergeField CreateMergeField CreateEmptyMergeField UpdateDocVariableField CreateEmptyDocVariableField CreateTimeField CreateDateField UpdateField MenuCmd_CreateField DeleteField RemoveField LocalizeField <EmptyImageCacheID>k__BackingField <IncrementalId>k__BackingField <EditIncrementalId>k__BackingField <TemporaryWorkSessionGuid>k__BackingField <ClientGuid>k__BackingField <EditorClientGuid>k__BackingField <Command>k__BackingField <end>k__BackingField <Cache>k__BackingField <HashtableCache>k__BackingField <FontInfoCache>k__BackingField <DisplayPropertiesLable>k__BackingField <PieceTable>k__BackingField <AdditionalPieceTable>k__BackingField <InnerCacheTable>k__BackingField <Name>k__BackingField <name>k__BackingField <Value>k__BackingField <UseValue>k__BackingField <CssString>k__BackingField <SaveFileDialog>k__BackingField <InsertPictureDialog>k__BackingField <InsertLinkDialog>k__BackingField <Length>k__BackingField <ClientFontInfoCacheLength>k__BackingField <DevExpress.Web.ASPxRichEdit.Internal.IRichEditFileManager.IsRichEditCallback>k__BackingField <EffectLabel>k__BackingField <ToBeClearedListLabel>k__BackingField <PreviewTextLabel>k__BackingField <IsValidModel>k__BackingField <DocumentModel>k__BackingField <WidthSpacingPanel>k__BackingField <LoadingPanel>k__BackingField <QuickSearchPanel>k__BackingField <MainPanel>k__BackingField <PresetsPanel>k__BackingField <TableNestedLevel>k__BackingField <Control>k__BackingField <UploadControl>k__BackingField <PageControl>k__BackingField <DialogControl>k__BackingField <QuickSearchControl>k__BackingField <MainControl>k__BackingField <RibbonControl>k__BackingField <StatusBarControl>k__BackingField <RichEditControl>k__BackingField <ColumnsEditorForm>k__BackingField <WorkSession>k__BackingField <Position>k__BackingField <TablePosition>k__BackingField <LogPosition>k__BackingField <AddButton>k__BackingField <IgnoreOnceButton>k__BackingField <ChangeButton>k__BackingField <CloseButton>k__BackingField <CollapseButton>k__BackingField <DeleteButton>k__BackingField <ChangeAllButton>k__BackingField <IgnoreAllButton>k__BackingField <ClearAllButton>k__BackingField <GoToButton>k__BackingField <ClearButton>k__BackingField <SetButton>k__BackingField <NextButton>k__BackingField <PrevButton>k__BackingField <AddToDictionaryButton>k__BackingField <LinkTo>k__BackingField <DocumentInfo>k__BackingField <MisspelledMemo>k__BackingField <EditorsGroup>k__BackingField <BrowsePopup>k__BackingField <CallbackArgumentsReader>k__BackingField <ControlProvider>k__BackingField <Manager>k__BackingField <FileManager>k__BackingField <InnerModifier>k__BackingField <Owner>k__BackingField <QuickSearchPanelWrapper>k__BackingField <FormLayoutWrapper>k__BackingField <CharacterFormattingExporter>k__BackingField <LoadedPieceTableIds>k__BackingField <WebCaches>k__BackingField <Properties>k__BackingField <MergeFieldNames>k__BackingField <CbBookmarkNames>k__BackingField <NumberingListTemplates>k__BackingField <ComplexUseValues>k__BackingField <CallbackArgs>k__BackingField <Chunks>k__BackingField <BehaviorOptions>k__BackingField <WinToAspRuns>k__BackingField <Parameters>k__BackingField <ServerParameters>k__BackingField <Clients>k__BackingField <IsAbstract>k__BackingField <CurrentDataObject>k__BackingField <CanBeSet>k__BackingField <RichEdit>k__BackingField <VerticalRelativeSpinEdit>k__BackingField <HorizontalRelativeSpinEdit>k__BackingField <SearchButtonEdit>k__BackingField <FillColorEdit>k__BackingField <UnderlinColorEdit>k__BackingField <BorderColorEdit>k__BackingField <FontColorEdit>k__BackingField <result>k__BackingField <Content>k__BackingField <MailMergeRecordCount>k__BackingField <start>k__BackingField <NavigationList>k__BackingField <CellOperationList>k__BackingField <RadioButtonList>k__BackingField <OrientationRadioButtonList>k__BackingField <SubscriptRadioButtonList>k__BackingField <StrikeoutRadioButtonList>k__BackingField <TabsLeaderList>k__BackingField <AlignmentList>k__BackingField <VerticalAlignmentList>k__BackingField <TabsAlignmentList>k__BackingField <WrapTextList>k__BackingField <SortByList>k__BackingField <WidthSpacingLayout>k__BackingField <TableFormLayout>k__BackingField <SizeFormLayout>k__BackingField <SpacingFormLayout>k__BackingField <LineSpacingFormLayout>k__BackingField <TextWrappingFormLayout>k__BackingField <IndentationSprecialFormLayout>k__BackingField <CellFormLayout>k__BackingField <MainFormLayout>k__BackingField <ColumnFormLayout>k__BackingField <PaginationFormLayout>k__BackingField <IndentationFormLayout>k__BackingField <PositionFormLayout>k__BackingField <PaperFormLayout>k__BackingField <MarginsFormLayout>k__BackingField <OptionsFormLayout>k__BackingField <MainOptionsFormLayout>k__BackingField <IndentsFormLayout>k__BackingField <ContentFormLayout>k__BackingField <LayoutFormLayout>k__BackingField <PreviewFormLayout>k__BackingField <RowFormLayout>k__BackingField <OffsetLayout>k__BackingField <ContentLayout>k__BackingField <PopupMenu>k__BackingField <ListLevelIndex>k__BackingField <CellIndex>k__BackingField <SectionIndex>k__BackingField <ListIndex>k__BackingField <RowIndex>k__BackingField <NoSpaceCheckBox>k__BackingField <FirstPageCheckBox>k__BackingField <MergeCheckBox>k__BackingField <SameAsTableCheckBox>k__BackingField <UnderlineCheckBox>k__BackingField <AutoResizeCheckBox>k__BackingField <AllowSpacingCheckBox>k__BackingField <TablePrefWidthCheckBox>k__BackingField <CellPrefWidthCheckBox>k__BackingField <ColumnPrefWidthCheckBox>k__BackingField <EqualWidthCheckBox>k__BackingField <PageBreakCheckBox>k__BackingField <HiddenCheckBox>k__BackingField <OddEvenCheckBox>k__BackingField <KeepLinesCheckBox>k__BackingField <AllCapsCheckBox>k__BackingField <SpecifyHeightCheckBox>k__BackingField <CantSplitCheckBox>k__BackingField <WrapTextCheckBox>k__BackingField <MergeModeComboBox>k__BackingField <StyleComboBox>k__BackingField <UnderlineStyleComboBox>k__BackingField <NumberStyleComboBox>k__BackingField <FontStyleComboBox>k__BackingField <FontNameComboBox>k__BackingField <OutlineComboBox>k__BackingField <FileTypeComboBox>k__BackingField <DownloadFileTypeComboBox>k__BackingField <PaperSizeComboBox>k__BackingField <FontSizeComboBox>k__BackingField <HorizontalToTheRightOfComboBox>k__BackingField <HorizontalBookLayoutOfComboBox>k__BackingField <LineSpacingComboBox>k__BackingField <WidthComboBox>k__BackingField <FollowNumberWithComboBox>k__BackingField <SpecialComboBox>k__BackingField <TableMeasureInComboBox>k__BackingField <CellMeasureInComboBox>k__BackingField <ColumnMeasureInComboBox>k__BackingField <SectionComboBox>k__BackingField <NumberPositionComboBox>k__BackingField <WidthRelativToComboBox>k__BackingField <VerticalRelativToComboBox>k__BackingField <HorizontalRelativToComboBox>k__BackingField <VerticalRelPosRelativToComboBox>k__BackingField <HorizontalRelPosRelativToComboBox>k__BackingField <HeightRelativToComboBox>k__BackingField <ApplyToComboBox>k__BackingField <RowHeightComboBox>k__BackingField <AlignmentComboBox>k__BackingField <VerticalAlignmentComboBox>k__BackingField <HorizontalAlignmentComboBox>k__BackingField <HorizontalBookLayoutComboBox>k__BackingField <VerticalBelowComboBox>k__BackingField <BookmarksNameListBox>k__BackingField <LevelListBox>k__BackingField <FieldsListBox>k__BackingField <SuggestionsListBox>k__BackingField <FileNameTextBox>k__BackingField <SearchTextBox>k__BackingField <EmailTextBox>k__BackingField <UrlTextBox>k__BackingField <ImageUrlTextBox>k__BackingField <StopPositionTextBox>k__BackingField ASPxHiddenField CreateTableCaptionField CreateFigureCaptionField CreateEquationCaptionField InsertPageNumberField CreateTableOfTablesField CreateTableOfFiguresField CreateTableOfEquationsField CreatePageCountField InsertPageCountField InsertField field finishBold get_FontBold set_FontBold ToggleFontBold startBold get_End ExtendLineEnd IsParagraphEnd IntervalEnd ExtendDocumentEnd RERInsertPageBreak2Command get_Command set_Command RERToggleViewMergedDataCommand InsertTabToParagraphWebCommand DeleteTabAtParagraphWebCommand RERFontItalicCommand DownloadMergedDocCommand RichEditDownloadCommand HyperlinkInfoChangedCommand JSONPropertyStateBasedCommand RERCreatePageFieldCommand RERInsertMergeFieldCommand RERCreateEmptyMergeFieldCommand RERCreateEmptyDocVariableFieldCommand RERCreateTimeFieldCommand RERCreateDateFieldCommand JSONUpdateFieldCommand RERCreateFieldCommand DeleteFieldCommand RERInsertPageNumberFieldCommand RERCreatePageCountFieldCommand RERInsertPageCountFieldCommand InsertFieldCommand RERFontBoldCommand RERFindCommand RERChangeSectionPaperKindCommand RERFloatingObjectSendBackwardCommand RERFloatingObjectBringForwardCommand RERCapitalizeEachWordCommand RERPreviousDataRecordCommand RERLastDataRecordCommand RERFirstDataRecordCommand RERNextDataRecordCommand RERReplaceCommand RERShowWhitespaceCommand RERInsertSectionBreakOddPageCommand RERInsertSectionBreakEvenPageCommand RERToggleDifferentFirstPageCommand RERInsertSectionBreakNextPageCommand ShowErrorModelIsChangedMessageCommand ShowErrorClipboardAccessDeniedMessageCommand ShowErrorSessionHasExpiredMessageCommand ShowErrorOpeningAndOverstoreImpossibleMessageCommand ShowErrorOpeningMessageCommand ShowErrorSavingMessageCommand ShowErrorCantSaveToEmptyPathMessageCommand ShowErrorAuthExceptionMessageCommand ShowErrorInnerExceptionMessageCommand RERFinishAndMergeCommand LoadPieceTableCommand ChangeTableCommand CreateTableCommand RERDeleteTableCommand RemoveTableCommand RERSelectTableCommand RERInsertTableCommand RERChangeStyleCommand RERChangeTableStyleCommand ApplyTableStyleCommand RERChangeCurrentBorderRepositoryItemLineStyleCommand ApplyParagraphStyleCommand ApplyCharacterStyleCommand RERFontNameCommand RERFontUnderlineCommand RERBorderLineStyleNoneCommand RERSetFloatingObjectBehindTextWrapTypeCommand RERSetFloatingObjectInlineTextWrapTypeCommand RERSetFloatingObjectSquareTextWrapTypeCommand RERSetFloatingObjectInFrontOfTextWrapTypeCommand RERSetFloatingObjectThroughTextWrapTypeCommand RERSetFloatingObjectTopAndBottomTextWrapTypeCommand RERChangeFloatingObjectTextWrapTypeCommand RERSetFloatingObjectTightTextWrapTypeCommand InsertAnchoredPictureCommand JSONLoadInlinePictureCommand InsertInlinePictureCommand RERInsertPictureCommand RERSentenceCaseCommand RERChangeCaseCommand RERToggleCaseCommand RERUpperCaseCommand RERLowerCaseCommand FieldUpdateCommand CreateCommand RERPasteCommand ChangeParagraphFormattingUseValueCommand ChangeCharacterFormattingUseValueCommand RERSaveCommand RERInsertTableRowAboveCommand ChangeAnchoredPictureSizeCommand RERFontSizeCommand RERDecreaseFontSizeCommand RERIncreaseFontSizeCommand ChangeAnchoredTextBoxSizeCommand JSONGetRtfCommand JSONInsertRtfCommand RERParagraphLineSpacingCommand RERSetDoubleParagraphSpacingCommand RERSetSingleParagraphSpacingCommand RERSetSesquialteralParagraphSpacingCommand RERChangeTableCellShadingCommand JSONCheckSpellingCommand RERInsertTableByGridHighlightingCommand ChangeParagraphFormattingCommand ChangeSectionFormattingCommand RERClearFormattingCommand ChangeCharacterFormattingCommand ShowErrorPathTooLongCommand ShowInsertContentFromServerErrorDialogCommand RERAddSpacingBeforeParagraphCommand RERRemoveSpacingBeforeParagraphCommand RERAddSpacingAfterParagraphCommand RERRemoveSpacingAfterParagraphCommand InsertParagraphCommand ChangeDefaultTabWidthCommand RERChangeFloatingObjectOutlineWidthCommand RERToggleFixedColumnWidthCommand RERInsertPageBreakCommand RERInsertColumnBreakCommand RERInsertBreakCommand RERFloatingObjectSendToBackCommand CreateStyleLinkCommand DeleteStyleLinkCommand CreateBookmarkCommand DeleteBookmarkCommand RERSetParagraphHeading1LevelCommand RERSetParagraphHeading2LevelCommand RERSetParagraphHeading3LevelCommand RERSetParagraphHeading4LevelCommand RERSetParagraphHeading5LevelCommand RERSetParagraphHeading6LevelCommand RERSetParagraphHeading7LevelCommand RERSetParagraphHeading8LevelCommand RERSetParagraphHeading9LevelCommand ChangeIOverrideListLevelCommand RERSetParagraphBodyTextLevelCommand RERSelectAllCommand ChangeTableCellCommand RemoveTableCellCommand RERSelectTableCellCommand InsertTableCellCommand get_CustomCommand set_CustomCommand RERShowHyperlinkFormCommand RERShowSymbolFormCommand RERShowPagePaperSetupFormCommand RERShowPageMarginsSetupFormCommand RERShowColumnsSetupFormCommand RERShowTablePropertiesFormCommand RERShowBookmarksFormCommand RERShowCellOptionsFormCommand RERShowLayoutOptionsFormCommand RERToggleFullScreenCommand REROpenCommand RERToggleBandedColumnCommand RERSelectTableColumnCommand RERSetSectionOneColumnCommand RERToggleLastColumnCommand RERToggleFirstColumnCommand InitSessionCommand RERSetLandscapePageOrientationCommand RERChangeSectionPageOrientationCommand RERSetPortraitPageOrientationCommand InsertSectionCommand ShiftTableStartPositionCommand RERInsertTablesCaptionCommand RERInsertFiguresCaptionCommand RERInsertEquationsCaptionCommand RERInsertCaptionCommand RERRedoCommand RERUndoCommand ChangeAnchorInfoCommand JSONLoadFontInfoCommand RERGoToPageHeaderCommand REREditPageHeaderCommand CreateHeaderCommand RERFloatingObjectSendBackwardPlaceholderCommand RERFloatingObjectBringForwardPlaceholderCommand RERToggleTableCellsInsideBorderCommand RERToggleTableCellsOutsideBorderCommand RERToggleTableCellsInsideVerticalBorderCommand RERToggleTableCellsInsideHorizontalBorderCommand RERToggleTableCellsBottomBorderCommand RERToggleTableCellsTopBorderCommand RERToggleTableCellsLeftBorderCommand RERToggleTableCellsRightBorderCommand ChangeTextBufferCommand RERToggleShowHorizontalRulerCommand RERAlignCenterCommand RERGoToPageFooterCommand REREditPageFooterCommand CreateFooterCommand RERClosePageHeaderFooterCommand RERGoToPreviousPageHeaderFooterCommand RERGoToNextPageHeaderFooterCommand JSONForceSyncWithServerCommand JSONInsertContentFromServerCommand RERChangePageColorCommand RERChangeFloatingObjectOutlineColorCommand RERParagraphBackColorCommand RERFontBackColorCommand RERChangeCurrentBorderRepositoryItemColorCommand RERFontColorCommand ShowErrorDocVariableErrorCommand RERSaveAsCommand RERUpdateAllFieldsCommand RERToggleShowAllFieldCodesCommand ChangeDifferentOddAndEvenPagesCommand RERToggleDifferentOddAndEvenPagesCommand ChangeParagraphPropertiesCommand ChangeListLevelParagraphPropertiesCommand ChangeListLevelPropertiesCommand ChangeCharacterPropertiesCommand ChangeListLevelCharacterPropertiesCommand ChangeTextBoxPropertiesCommand RERInsertTableOfTablesCommand RERToggleShowTableGridLinesCommand RERDropDownToggleShowTableGridLinesCommand RERInsertTableOfFiguresCommand LoadInlinePicturesCommand UpdateInlinePicturesCommand MergeParagraphsCommand RERMergeTableCellsCommand RERDeleteTableCellsCommand RERSplitTableCellsCommand RERPageMarginsCommand RERSetWideSectionPageMarginsCommand RERSetModerateSectionPageMarginsCommand RERSetNormalSectionPageMarginsCommand RERSetNarrowSectionPageMarginsCommand RERSetSectionThreeColumnsCommand RERDeleteTableColumnsCommand RERSetSectionColumnsCommand RERSetSectionTwoColumnsCommand RERInsertTableOfEquationsCommand MergeSectionsCommand RERUpdateTableOfCaptionsCommand RERInsertTableOfCaptionsCommand DeleteRunsCommand RERChangeTableBordersCommand RERToggleTableCellsAllBordersCommand RERChangeCurrentBorderRepositoryItemLineThicknessCommand RERToggleShowAllFieldResultsCommand RERDeleteTableElementsCommand RERSelectTableElementsCommand RERUpdateTableOfContentsCommand RERAddParagraphsToTableOfContentsCommand RERInsertTableOfContentsCommand RERToggleAutoFitContentsCommand RERToggleHeaderFooterLinkToPreviousCommand RERToggleBandedRowsCommand RERDeleteTableRowsCommand ChangeInlineObjectCommand RERHeaderOffsetCommand RERFooterOffsetCommand RERInsertTableColumnToTheLeftCommand RERAlignLeftCommand RERInsertTableColumnToTheRightCommand RERAlignRightCommand RERAutoFitCommand WebRichEditCommand RERDecreaseIndentCommand RERIncreaseIndentCommand RichEditClientCommand RERToggleTableCellsMiddleCenterAlignmentCommand RERSetFloatingObjectMiddleCenterAlignmentCommand RERToggleTableCellsBottomCenterAlignmentCommand RERSetFloatingObjectBottomCenterAlignmentCommand RERToggleTableCellsTopCenterAlignmentCommand RERSetFloatingObjectTopCenterAlignmentCommand RERChangeFloatingObjectAlignmentCommand RERToggleTableCellsMiddleLeftAlignmentCommand RERSetFloatingObjectMiddleLeftAlignmentCommand RERToggleTableCellsBottomLeftAlignmentCommand RERSetFloatingObjectBottomLeftAlignmentCommand RERToggleTableCellsTopLeftAlignmentCommand RERSetFloatingObjectTopLeftAlignmentCommand RERToggleTableCellsMiddleRightAlignmentCommand RERSetFloatingObjectMiddleRightAlignmentCommand RERToggleTableCellsBottomRightAlignmentCommand RERSetFloatingObjectBottomRightAlignmentCommand RERToggleTableCellsTopRightAlignmentCommand RERSetFloatingObjectTopRightAlignmentCommand ReloadDocumentCommand SaveMergedDocumentCommand SaveDocumentCommand OpenDocumentCommand SaveAsDocumentCommand DownloadCurrentDocumentCommand PrintCurrentDocumentCommand NewDocumentCommand RERPrintCommand DelayedPrintCommand RERFloatingObjectBringToFrontCommand RERFontSubscriptCommand RERFontSuperscriptCommand StartCommand RERBulletedListCommand RERNumberingListCommand AddNumberingListCommand DeleteNumberingListCommand AddAbstractNumberingListCommand DeleteAbstractNumberingListCommand ApplyNumberingListCommand RERMultilevelListCommand RERCutCommand RERFontStrikeoutCommand RERFloatingObjectSendBehindTextCommand RERFloatingObjectBringInFrontOfTextCommand InsertTextCommand RERNewCommand RERSwitchToSimpleViewCommand RERSwitchToPrintLayoutViewCommand ChangeTableRowCommand RemoveTableRowCommand RERSelectTableRowCommand InsertTableRowCommand RERToggleLastRowCommand RERToggleFirstRowCommand RERToggleAutoFitWindowCommand RERInsertTableRowBelowCommand ChangeHeaderIndexCommand ChangeFooterIndexCommand InsertFloatingTextBoxCommand RERInsertTextBoxCommand RERAlignJustifyCommand MergeTableCellHorizontallyCommand SplitTableCellHorizontallyCommand RERCopyCommand AddWordToDictionaryCommand ChangeTablePropertyCommand ChangeShapePropertyCommand ChangeTableCellPropertyCommand ChangeAnchorInfoPropertyCommand ChangeTableRowPropertyCommand command ClearAmpersand get_end set_end Append DataBind FindReplace_Find FindReplace_AdvancedFind TokenKind RERSectionA4PaperKind SetSectionA4PaperKind RERSectionA5PaperKind SetSectionA5PaperKind RERSectionB5PaperKind SetSectionB5PaperKind RERSectionA6PaperKind SetSectionA6PaperKind RERSectionExecutivePaperKind SetSectionExecutivePaperKind RERSectionLegalPaperKind SetSectionLegalPaperKind RERSectionFolioPaperKind SetSectionFolioPaperKind RERSectionLetterPaperKind SetSectionLetterPaperKind paperKind TextWrapBehind add_RepeatedWordFound remove_RepeatedWordFound OnRepeatedWordFound add_NotInDictionaryWordFound remove_NotInDictionaryWordFound OnNotInDictionaryWordFound Round WrapAround GroupPageBackground DrawTableBackground DrawTableCellStyleBackground DrawBackground get_Method method GroupClipboard Guard FloatingObjectSendBackward FloatingObjectBringForward ThisPointForward get_Word AddWord AddedWord Spelling_RepeatedWord DeleteRepeatedWord ErrorWord RemoveNextWord ExtendGoToNextWord RemovePrevWord ExtendGoToPrevWord GoToDataRecord GoToPreviousDataRecord GoToLastDataRecord GoToFirstDataRecord GoToNextDataRecord ActiveRecord FinishMerge_CurrentRecord GroupCurrentRecord get_Password set_Password FindReplace_Replace Numbering_Space get_Space set_Space InsertNonBreakingSpace NoSpace InsertSpace get_LegacySpace set_LegacySpace get_Namespace ToggleShowWhitespace DeleteTableCellsByBackspace DevExpress.Web.Office DevExpress.Office ReplaceService IUriStreamService ASPxOfficeUriStreamService IUrlResolutionService IFormatDetectorService GetService Spelling_IgnoreOnce get_FloatLuminance get_BottomDistance set_BottomDistance get_LevenshteinDistance set_LevenshteinDistance get_TopDistance set_TopDistance get_LeftDistance set_LeftDistance get_RightDistance set_RightDistance CreateInstance CreateResLocalizerInstance ImageCorrespondence MakeResponce get_DataSource set_DataSource FileManagerSettingsDataSource settingsDataSource RichEditBaseValueSource get_ForeColorSource set_ForeColorSource DocumentHasSource get_FontSource set_FontSource RegisterSpriteCssResource RegisterCssResource get_WrapSide get_TextWrapSide set_TextWrapSide DrawingObjectTextWrapSide MarginsWide LayoutOptions_HorizontalPositionAlignmentInside LayoutOptions_HorizontalPositionAlignmentOutside get_Code get_TemplateCode set_TemplateCode GetHashCode CreateFieldWithCode ErrorCode set_ClientIDMode UpdateClientIDMode set_Mode DevExpress.Web.Internal.Dialogs.IUploadControl.get_UploadMode DevExpress.Web.Internal.Dialogs.IUploadControl.set_UploadMode UploadControlUploadMode PersistenceMode FinishMerge_MergeMode set_MergeMode set_OneLineMode SetRibbonOneLineMode set_ViewStateMode get_AutoSaveMode set_AutoSaveMode set_SmoothingMode VerticalAlignMode HorizontalAlignMode get_DesignMode get_RibbonMode set_RibbonMode IsOneLineRibbonMode RichEditRibbonMode get_DisplaySectionMode set_DisplaySectionMode SaveFileDialogDisplaySectionMode set_DropDownMode get_DefaultDropDownMode get_PageBreakInsertMode set_PageBreakInsertMode PdfBookmarkDisplayMode set_ErrorDisplayMode set_AdaptivityMode PopupControlAdaptivityMode SetupAdaptivityMode FormLayoutAdaptivityMode encode GetImageBytesStreamSafe get_Page TabPage Hyperlink_WebPage InsertSectionBreakOddPage get_CodePage InsertSectionBreakEvenPage SectionPage ExtendPreviousPage get_DifferentFirstPage set_DifferentFirstPage ToggleDifferentFirstPage ExtendNextPage InsertSectionBreakNextPage ExtendGoToStartNextPage ExtendGoToStartPrevPage NewPage get_Image set_Image Base64EncodedImage OfficeImage OfficeReferenceImage GetLargeImage GetTableStyleImage GetParagraphStyleImage GetCharacterStyleImage CreateImage get_EncapsulatedOfficeNativeImage RibbonWithSvgImage GetSmallImage FromImage RegisterImage GetImage get_DefaultImage ASPxImage ASPxBinaryImage InitializeEmptyImage initEmptyImage page get_Message ShowSpellingCheckCompletedMessage ShowErrorLoadPictureMessage message Percentage GroupDocumentLanguage FromEdge FinishMerge_Range AddRange SelectTableCellsRange CanEditRange NativeDocumentRange MailMergeExportRange Spelling_Change CompareExchange GroupFloatingPictureToolsArrange GroupFloatingObjectsArrange XLarge TextWrapBehindLarge TextWrapInlineLarge TextWrapSquareLarge TextWrapThroughLarge TextWrapTopAndBottomLarge TextWrapTightLarge TextWrapInFrontOfTextLarge get_MailMerge GroupMailMerge GroupTableToolsLayoutMerge get_Cache set_Cache webCache get_ImageCache CreateImageCache PersistentImageCache get_HashtableCache set_HashtableCache GetItemFromHashtableCache AddToHashtableCache get_ParagraphFormattingCache get_CharacterFormattingCache jsonCache AddImageToCache get_ShadingInfoCache shadingInfoCache get_CharacterFormattingInfoCache get_ColorModelInfoCache RichEditColorModelInfoCache colorModelInfoCache get_FontInfoCache set_FontInfoCache WebFontInfoCache fontInfoCache ParagraphPropertiesCache ListLevelPropertiesCache TableCellPropertiesCache MaskedCharacterPropertiesCache TableRowPropertiesCache get_ParagraphFormattingOptionsCache get_CharacterFormattingOptionsCache cellPropsCache rowPropsCache charFormatCache DocumentCache GdiPlusFontCache cache EndInvoke BeginInvoke ToOle LayoutOptions_Scale ChangeInlinePictureScale UpdateScale CalculateScale get_DisplayPropertiesLable set_DisplayPropertiesLable TableProperties_Table get_Table replaceTable get_PieceTable set_PieceTable JSONEnumLoadPieceTable get_ActivePieceTable get_AdditionalPieceTable set_AdditionalPieceTable additionalPieceTable numRunsInPieceTable get_MainPieceTable jsonPieceTable parentPieceTable pieceTable ChangeTable get_InnerCacheTable set_InnerCacheTable CreateTable DeleteTable RemoveTable PopulateStringTable SingleSectionFromHashTable InternalTable JSONEnumTable get_IndexInTable jsonTable CellOptions_SameAsTable JSONInlineObjectModifiersTable ExtendSelectTable GetTable clientTable InsertTable GroupTableToolsLayoutTable CreatePreviewTable CanModifyTable DocVariable add_CalculateDocumentVariable remove_CalculateDocumentVariable RaiseWebCalculateDocumentVariable RaiseCalculateDocumentVariable get_Enable set_Enable FieldLastRunIndexComparable IEnumerable IDisposable initCommandHashtable MakeResponceHashtable getFinalHashtable FillHashtable FinishImportFromHashtable ToHashtable getHashtable hashtable get_Visible set_Visible IsStyleVisible set_ClientVisible OpeningAndOverstoreImpossible UnderlineType_Double StrikeoutType_Double ToDouble HtDouble RuntimeFieldHandle RuntimeTypeHandle get_TabDragHandle get_DecimalTabDragHandle get_CenterTabDragHandle get_LeftTabDragHandle get_RightTabDragHandle get_CellDivisionDragHandle get_FirstLineIdentDragHandle get_LeftIdentDragHandle get_RightIdentDragHandle get_FirstLineIndentDragHandle get_LeftIndentDragHandle get_RightIndentDragHandle GetTypeFromHandle FillRectangle UnderlineType_Single StrikeoutType_Single UnderlineType_ThickSingle ToSingle get_File get_UploadedFile CantSaveToAlreadyOpenedFile PageFile SaveInTheSameFile IsSameFile set_ResponseFile CantSaveFile OtherLabels_ConfirmToRewriteExistingFile CantOpenFile get_IsFile RegisterCustomSpriteCssFile RegisterIconSpriteCssFile RegisterDefaultSpriteCssFile spriteCssFile RegisterSystemCssFile RegisterDefaultRenderCssFile Multiple get_Simple set_Simple NumberingSimple RulerDecimalTabTitle RulerCenterTabTitle RulerLeftTabTitle RulerRightTabTitle CustomizeOutlineNumberedTitle InsertMergeFieldTitle FindReplaceTitle InsertImageTitle ExportRangeTitle InsertTableTitle OpenFileTitle SaveAsFileTitle BorderShadingTitle SpellingTitle WarningTitle BulletedAndNumberingTitle ParagraphTitle HyperlinkTitle BookmarkTitle InformationTitle PageSetupTitle ErrorTitle TabsTitle TablePropertiesTitle DeleteTableCellsTitle SplitTableCellsTitle InsertTableCellsTitle SymbolsTitle ColumnsTitle RulerMarginLeftTitle RulerMarginRightTitle RulerFirstLineIdentTitle RulerHangingIdentTitle RulerLeftIdentTitle RulerRightIdentTitle RulerFirstLineIndentTitle RulerHangingIndentTitle RulerLeftIndentTitle RulerRightIndentTitle FontTitle CustomizeNumberedListTitle CustomizeBulletedListTitle IStyle TStyle get_Style set_Style AddStyle get_LinkedStyle get_HasLinkedStyle set_EnableFocusedStyle AppearanceSelectedStyle get_ModalBackgroundStyle PopupControlModalBackgroundStyle GetDefaultModalBackgroundStyle AppearanceStyle ChangeStyle ITableStyle get_TableStyle set_TableStyle jsonTableStyle changeDefaultTableStyle DrawTableStyle ApplyTableStyle tableStyle GetDefaultTabDragHandleStyle GetDefaultFirstLineIndentDragHandleStyle GetDefaultLeftIndentDragHandleStyle GetDefaultRightIndentDragHandleStyle FileManagerFileStyle BorderLineStyle GetDefaultLineStyle UnderlineStyle PopulateStyle LayoutOptions_WrappingStyle get_ParagraphStyle set_ParagraphStyle UpdateParagraphStyle jsonParagraphStyle get_NextParagraphStyle set_NextParagraphStyle DrawParagraphStyle ApplyParagraphStyle paragraphStyle TableConditionalStyle jsonTableBaseConditionalStyle GetLoadingPanelStyle GetQuickSearchPanelStyle get_TableCellStyle set_TableCellStyle DevExpress.Web.Internal.Dialogs.IControl.get_ControlStyle GetControlStyle set_DropDownStyle Numbering_NumberStyle set_BorderStyle FileManagerFolderContainerStyle GetDefaultWrapperStyle get_CharacterStyle set_CharacterStyle jsonCharacterStyle DrawCharacterStyle ApplyCharacterStyle characterStyle get_HoverStyle ContainsStyle GetStyle GetDefaultStyle SetParentStyle get_ContentStyle GetDefaultContentStyle PopupWindowContentStyle CalculateFontStyle RemoveLastStyle jsonNumberingListStyle DrawStyle get_GroupBoxStyle LayoutGroupBoxStyle copyStyle style Bookmarks_Name get_Name set_Name MergeFieldName fieldName get_CommandName set_CommandName commandName DevExpress.Web.Internal.Dialogs.IControl.get_ClientInstanceName DevExpress.Web.Internal.Dialogs.IControl.set_ClientInstanceName GetClientInstanceName EmptyImageResourceName ImageLoadingResourceName WTSVGSpriteCssResourceName GrayScaleIconSpriteCssResourceName GrayScaleWithWhiteHottrackIconSpriteCssResourceName GrayScaleWithWhiteHottrackInToolbarIconSpriteCssResourceName SystemCssResourceName DefaultCssResourceName GetResourceName CompiledScriptResourceName CompiledCoreScriptResourceName FileManagerUploadControlScriptResourceName RichEditLocalizationScriptResourceName FileManagerScriptResourceName FolderManagerScriptResourceName CustomResourcesScriptResourceName DialogsScriptResourceName RichEditScriptResourceName get_ImageName set_ImageName DecimalTabDragHandleImageName CenterTabDragHandleImageName LeftTabDragHandleImageName RightTabDragHandleImageName ColumnSeparatorDragHandleImageName FirstLineIndentDragHandleImageName LeftIndentDragHandleImageName RightIndentDragHandleImageName ErrorUnderlineImageName WTSVGSpriteImageName GrayScaleIconSpriteImageName GrayScaleWithWhiteHottrackIconSpriteImageName GrayScaleWithWhiteHottrackInToolbarIconSpriteImageName CursorTouchImageName CursorImageName imageName get_VariableName Invalid_FileName GetFileName get_CurrentFileName set_CurrentFileName get_CanSaveToCurrentFileName fileName get_StyleName LinkedStyleName linkedStyleName get_LocalizedStyleName TabDragHandleStyleName FirstLineIndentDragHandleStyleName LeftIndentDragHandleStyleName RightIndentDragHandleStyleName LineStyleName NextParagraphStyleName nextParagraphStyleName paragraphStyleName QuickSearchPanelStyleName ControlStyleName knownCharStyleName WrapperStyleName CharacterStyleName ParentStyleName parentStyleName styleName GetWorkSessionDocumentTypeName spriteName get_RelativeName ShouldSerializeName get_EncodingName set_EncodingName get_CurrentDialogName dialogName Bookmarks_BookmarkName get_FullName GetSkinControlName get_DialogFormName formName QuickSearchCloseButtonName QuickSearchCollapseButtonName QuickSearchNextButtonName QuickSearchPrevButtonName set_GroupName get_SubGroupName GetSubGroupName get_CheckedGroupName set_CheckedGroupName checkedGroupName get_DefaultGroupName LoadingPanelOnStatusBarName dataHelperName get_UserName set_UserName AppendDefaultDXClassName PageClassName DialogClassName LoadingPanelClassName NotInternalRibbonClassName StatusBarClassName InputTargetContainerClassName GetDialogCssClassName QuickSearchCssClassName QuickSearchButtonCssClassName QuickSearchPanelWrapperCssClassName QuickSearchButtonHoverCssClassName QuickSearchButtonEditCssClassName cssClassName GetClientObjectClassName ViewClassName get_className get_FormatName ParseDocumentFormatName formatName GetName ResetName get_DefaultName GetDesignTimeResourceSpriteImageDefaultName get_FontName set_FontName get_EastAsiaFontName set_EastAsiaFontName eastAsiaFontName ChangeFontName get_AsciiFontName set_AsciiFontName asciiFontName get_HightAnsiFontName set_HightAnsiFontName hightAnsiFontName get_SymbolFontName get_ComplexScriptFontName set_ComplexScriptFontName complexScriptFontName fontName ScriptName get_ResxName FindByName CreateStyleByName GetStyleByName FindItemOrGroupByName GetStyleIndexByName get_DisplayName GetPaperKindDisplayName FolderDoesNotExistParamKeyName get_GlobalResourceAssemblyName GetDirectoryName get_name set_name get_Frame set_Frame get_Theme set_Theme IOfficeTheme get_OfficeTheme Scheme DateTime RichEditControlDesignTime get_LastModifyTime RefreshLastModifyTime PageHome One get_DisplayBookmarksInPdfNavigationPane set_DisplayBookmarksInPdfNavigationPane get_Line EndOfLine Tabs_ThickLine DrawCharacterLine ExtendSelectLine FirstLine DrawLine AddEmptyLine Combine LayoutOptions_Inline get_Inline TextWrapInline Tabs_Underline ToggleFontDoubleUnderline ToggleFontUnderline get_Outline UnderlineType_None StrikeoutType_None Tabs_None OtherLabels_None WrapNone BorderShading_BordersNone Clone none set_CloseOnEscape get_Landscape set_Landscape get_DisplayBackgroundShape set_DisplayBackgroundShape InsertDrawingShape ModelShape ChangeFloatingObjectShape shape get_Type set_Type JSONServerUpdateFieldType CommandType GetResourceType OverrideType get_TableChangeType get_ParagraphFormattingChangeType get_CharacterFormattingChangeType get_TableCellChangeType get_TableFloatingPositionChangeType BorderChangeType TableGeneralSettingsChangeType get_FloatingObjectChangeType get_TableRowChangeType ResetFormattingCacheType FileType get_FontUnderlineType set_FontUnderlineType set_OutlineType GetLicenseType ChooseType set_ValueType RelativeSizeType get_LineSpacingType set_LineSpacingType DrawingTextWrappingType DrawingTextAnchoringType PrepareWidthType get_FillType DrawingFillType get_HashAlgorithmType set_HashAlgorithmType set_PopupAnimationType UpdateFieldOperationType get_ProtectionType set_ProtectionType DocumentProtectionType get_VerticalPositionType set_VerticalPositionType DrawingObjectVerticalPositionType get_HorizontalPositionType set_HorizontalPositionType DrawingObjectHorizontalPositionType WebRunType SubDocumentInfoType GetDocumentInfoType get_TextWrapType set_TextWrapType SetFloatingObjectBehindTextWrapType SetFloatingObjectInlineTextWrapType SetFloatingObjectSquareTextWrapType SetFloatingObjectInFrontOfTextWrapType SetFloatingObjectThroughTextWrapType SetFloatingObjectTopAndBottomTextWrapType DrawingObjectTextWrapType SetFloatingObjectTightTextWrapType TabLeaderType DevExpress.Web.Design.IControlDesigner.DesignerType DevExpress.Web.Design.IControlDesigner.get_DesignerType GetControlDesignerType HeaderFooterType VerticalAnchorType HorizontalAnchorType get_ColorType DrawingColorType DownloadImageErrorType errorType DrawingObjectType GetType MenuIconSetType DrawingTextAutoFitType WidthUnitType HeightUnitType get_FirstLineIndentType set_FirstLineIndentType TabAlignmentType get_ContentType set_ContentType IsAllowedContentType set_AutodetectContentType ShapeTextBoxContentType contentType ThemeFontType get_StartType set_StartType SectionStartType set_CssPropertiesExportType DownloadRequestType get_FontStrikeoutType set_FontStrikeoutType TableLayoutType get_ReplaceTextAsYouType set_ReplaceTextAsYouType get_ViewType set_ViewType ChangeViewType RichEditViewType NumberingAnyType type DontCare System.Collections.IComparer.Compare TextWrapSquare Where DevExpress.Office.v18.2.Core DevExpress.Printing.v18.2.Core DevExpress.SpellChecker.v18.2.Core DevExpress.RichEdit.v18.2.Core System.Core AddCore set_DeletedCore InsertTableCore ModifyTableCore FromHashtableCore SaveInTheSameFileCore DrawTableStyleCore DrawParagraphStyleCore CloseCore CreateLinkCore DeleteLinkCore CreateBookmarkCore DeleteBookmarkCore CreateModelCore CreateDocumentModelCore AddGridTableStylesToDocumentModelCore PerformModifyModelCore SetLevelCore AddCellCore set_HiddenCore set_SemihiddenCore OpenCore CreateRibbonCore ModifySectionCore ModifyInputPositionCore InsertFieldCodeEndRunCore InsertFieldResultEndRunCore InsertFieldCodeStartRunCore ReviseStylesCore MergeParagraphsCore CreateEmptyObjectCore RaisePostBackEventCore ProcessRequestCore InsertTextCore AddRowCore SetTableStyleIndexCore ModifyCore SaveCopyCore ModifyPropertyCore get_GridBefore set_GridBefore get_SpacingBefore set_SpacingBefore get_WidthBefore get_PageBreakBefore set_PageBreakBefore isRestore ToHashtableFromAnchoredPicture InsertAnchoredPicture ToHashtableFromInlinePicture InsertInlinePicture InsertDrawingPicture ModelPicture InsertPicture get_Culture set_Culture GetCulture get_InvariantCulture Capture newUse TabBase TabParagraphWebCommandBase RERDropDownToggleCommandBase StyleLinkCommandBase WebRichEditUpdateModelCommandBase RERButtonCommandBase RERToggleButtonCommandBase RERDropDownCommandBase RERGalleryBarCommandBase RERColorCommandBase InsertAnchoredObjectCommandBase RERSpinEditCommandBase JSONChangeHeaderFooterIndexCommandBase RERCheckBoxCommandBase RERComboBoxCommandBase MethodBase GetImageBase ImageCacheBase AppearanceStyleBase ModelShapeBase ContentTypeBase WorkSessionRegistrationAttributeBase OptionsSpellingBase ParagraphFormattingBase CharacterFormattingBase RichEditDialogBase ASPxPanelBase ASPxTabControlBase ASPxDataWebControlBase ASPxWebControlBase ASPxPopupControlBase RichEditControlBase RibbonItemBase RibbonColorButtonItemBase ListEditItemBase LayoutItemBase RERGalleryItemBase AddFieldHistoryItemBase WorkSessionBase StateManagedCollectionBase ListEditItemCollectionBase TextRunBase LayoutGroupBase BorderBase ParagraphPropertyModifierBase SectionPropertyModifierBase RunPropertyModifierBase SpellCheckerBase CallbackEventHandlerBase ASPxPanelContainerBase SectionHeaderFooterBase ImagesBase ItemImagePropertiesBase ShapePropertiesBase StylesBase ASPxRichEditSettingsBase CallbackEventArgsBase FileManagerActionEventArgsBase RichEditControlOptionsBase CallbackClientSideEventsBase ASPxButtonEditBase ASPxEditBase MarginUnitBase ASPxCheckListBase DialogFormLayoutBase ASPxMenuBase ASPxAutoCompleteBoxBase ASPxSpellCheckerDictionaryBase MenuCmd_MakeTextSentenceCase get_OrdinalIgnoreCase FindReplace_MatchCase MakeTextUpperCase MakeTextLowerCase CapitalizeEachWordTextCase ToggleTextCase SwitchTextCase IndentDecrease IndentIncrease False ValidateLicense WebResponse JSONDocumentHandlerResponse AttachmentDocumentHandlerResponse GetBinaryDocumentHandlerResponse GetResponse response GroupHeaderFooterToolsDesignClose System.IDisposable.Dispose TryParse Validate FieldUpdate EndUpdate GetConfirmUpdate BeginUpdate get_AutoUpdate set_AutoUpdate get_DocumentPropertiesAutoUpdate set_DocumentPropertiesAutoUpdate AddOrUpdate DisableAutoFieldsUpdate Create GetImageLoadingUrlResourceDelegate GetPresetStylesResourceDelegate GetLocalizationDelegate TableCellProcessorDelegate MulticastDelegate ITemplate set_Template CreateInsertTableTemplate template MarginsModerate ICommandState IntervalWithUseCommandState ListLevelWithUseCommandState CreateBookmarkCommandState DeleteBookmarkCommandState IntervalCommandState ListLevelCommandState SectionCommandState TableState DebuggerBrowsableState EditorBrowsableState MergingState TableCellState AddSelectedLineCommandNoUpdateControlState ExtendSelectLineNoUpdateControlState System.Web.SessionState HttpSessionState JSONSelectionState LoadWindowsState get_ClientObjectState set_EnableViewState TableRowState TablePropertyState TableCellPropertyState AnchorInfoPropertyState TableRowPropertyState LayoutOptions_Rotate <>1__state Spelling_Delete Bookmarks_Delete DevExpress.Web.Internal.Dialogs.IUploadControl.add_FileUploadComplete uplImage_FileUploadComplete DevExpress.Web.Internal.Dialogs.IUploadControl.remove_FileUploadComplete get_Paste set_Paste get_UpdateFieldsOnPaste set_UpdateFieldsOnPaste get_Palette palette ToolboxDataAttribute DXClientDocumentationProviderWebAttribute CompilerGeneratedAttribute GuidAttribute WebResourceAttribute PersistenceModeAttribute AttributeUsageAttribute NeutralResourcesLanguageAttribute BindableAttribute ThemeableAttribute DebuggableAttribute AutoFormatEnableAttribute AutoFormatDisableAttribute DebuggerBrowsableAttribute EditorBrowsableAttribute LocalizableAttribute ComVisibleAttribute AssemblyTitleAttribute ToolboxTabNameAttribute IteratorStateMachineAttribute ObsoleteAttribute DefaultValueAttribute AssemblyTrademarkAttribute TargetFrameworkAttribute DXWebToolboxItemAttribute DebuggerHiddenAttribute ExtensionAttribute AssemblyFileVersionAttribute SatelliteContractVersionAttribute AssemblyConfigurationAttribute DevExpressWebASPxRichEditLocalizedDescriptionAttribute AssemblyDescriptionAttribute InternalsVisibleToAttribute ToolboxBitmapAttribute LicenseProviderAttribute WebResourceCustomHandlerProviderAttribute DesignerAttribute TypeConverterAttribute EditorAttribute ScriptResourceWithCustomNamespacesAttribute CompilationRelaxationsAttribute AllowPartiallyTrustedCallersAttribute AssemblyProductAttribute AssemblyCopyrightAttribute CLSCompliantAttribute TagPrefixAttribute ParamArrayAttribute AssemblyCompanyAttribute CategoryAttribute DesignerSerializationVisibilityAttribute RuntimeCompatibilityAttribute MergablePropertyAttribute NotifyParentPropertyAttribute get_AllowedExecute LayoutOptions_Absolute LineBreakSubstitute get_FloatHue get_Value set_Value GetMergeFieldValue GetFieldValue oneLineModeValue GetVariableValue get_UseValue set_UseValue ChangeParagraphPropertiesUseValue ChangeCharacterPropertiesUseValue ApplyNewUseValue useValue GetClientObjectStateValue CheckNegativeValue set_AutomaticColorItemValue get_DefaultAutomaticColorItemValue enumValue set_MinValue minValue set_DescriptionValue CheckNegativeOrZeroValue get_HasValue ContainsValue HtValue TryGetValue GetRibbonModeDefaultValue GetMaxFileSizeDefaultValue defaultValue get_NewValue GetNewValue ApplyNewValue newValue set_MaxValue maxValue GetParagraphPropertyValue GetInputPositionPropertyValue GetRunPropertyValue GetPropertyValue SetPropertyValue value CheckDocumentIsUnique True get_Save set_Save FileSave UnderlineType_Wave UnderlineType_DoubleWave UnderlineType_HeavyWave set_ValidateOnLeave LoadPostDataRecursive LookupControlRecursive EnsureChildControlsRecursive DevExpress.XtraRichEdit.API.Native DevExpress.Web.ASPxSpellChecker.Native DevExpress.ASPxSpellChecker.Native LayoutOptions_Relative get_Active get_CaseSensitive set_CaseSensitive caseSensitive get_MultiUserConflictResolve InsertTableRowsAbove InsertTableRowAbove TryRemove JSONSize GetSuperscriptYSize TableProperties_Size LayoutOptions_Size get_Size set_Size get_TableStyleColBandSize set_TableStyleColBandSize set_UseTableStyleColBandSize set_TableStyleColumnBandSize get_TableStyleRowBandSize set_TableStyleRowBandSize set_UseTableStyleRowBandSize SetSectionPageSize DefaultLargeSize InsertTable_TableSize get_MaxFileSize set_MaxFileSize JSONPictureSize ChangeAnchoredPictureSize JSONAnchorInlineBaseSize UseAbsoluteSize RelativeSize maxChunkBufSize get_RelativeVerticalSize set_RelativeVerticalSize get_UseRelativeVerticalSize DrawingObjectRelativeVerticalSize LayoutOptions_OriginalSize get_OriginalSize get_RelativeHorizontalSize set_RelativeHorizontalSize get_UseRelativeHorizontalSize DrawingObjectRelativeHorizontalSize SetButtonSmallSize DefaultSmallSize GroupTableToolsLayoutCellSize RibbonItemSize jsonSize ToSize maxChunkBufferSize PaperSize IsAllowedContentSize ChangeFontSize get_DoubleFontSize set_DoubleFontSize DecreaseFontSize IncreaseFontSize ChangeAnchoredTextBoxSize JSONInlineTextBoxSize JSONAnchorTextBoxSize Localize Serialize Deserialize FrameworkInitialize AdditionalInitialize Numbering_Customize TableOptions_AutoResize get_SuppressBulletResize set_SuppressBulletResize FindReplace_Of LayoutOptions_ToTheRightOf LayoutOptions_HorizontalBookLayoutOf IndexOf ExportToPdf DevExpress.Web.ASPxRichEdit.Images.1x1.gif DevExpress.Web.ASPxRichEdit.Images.reErrorUnderline.gif DevExpress.Web.ASPxRichEdit.Images.reImageLoading.gif DevExpress.Web.ASPxRichEdit.Images.CursorTouch.gif DevExpress.Web.ASPxRichEdit.Images.reLoadingOnStatusBar.gif DevExpress.Web.ASPxRichEdit.Images.Cursor.gif get_NoProof set_NoProof isValidRtf GetRtf ResultRtf InsertRtf HtmlTextWriterTag HasRootTag get_Drag set_Drag Columns_Spacing Columns_WidthAndSpacing get_LineSpacing set_LineSpacing ParagraphLineSpacing GetLineSpacing SetDoubleParagraphSpacing SetSingleParagraphSpacing SetSesquialteralParagraphSpacing get_ContextualSpacing set_ContextualSpacing get_CellSpacing set_UseCellSpacing TableOptions_DefaultCellSpacing get_BeforeAutoSpacing set_BeforeAutoSpacing get_AfterAutoSpacing set_AfterAutoSpacing TableOptions_AllowSpacing System.Threading BorderShading_Shading TableProperties_BordersAndShading ChangeTableCellShading DevExpress.Web.Internal.Dialogs.IFileManager.add_FileUploading DevExpress.Web.Internal.Dialogs.IFileManager.remove_FileUploading FileManager_FileUploading add_DocumentSelectorFileUploading remove_DocumentSelectorFileUploading RaiseDocumentSelectorFileUploading set_Padding RequireDataBinding PerformDataBinding UTF8Encoding get_Encoding set_Encoding GetEncoding set_ContentEncoding GroupDocumentProofing set_AllowDragging Hanging get_VerticalMerging set_VerticalMerging Numbering_Nothing GroupDocumentTracking GraphicalObjectFrameLocking CheckSpelling get_OptionsSpelling ASPxRichEditOptionsSpelling optionsSpelling set_EnableTabScrolling get_OfficeScrolling set_OfficeScrolling set_EnableScrolling DevExpress.Web.Internal.Dialogs.IFileManager.add_ItemRenaming DevExpress.Web.Internal.Dialogs.IFileManager.remove_ItemRenaming FileManager_ItemRenaming add_DocumentSelectorItemRenaming remove_DocumentSelectorItemRenaming RaiseDocumentSelectorItemRenaming get_Zooming set_Zooming System.Runtime.Versioning LayoutOptions_TextWrapping get_TextWrapping set_TextWrapping get_Numbering get_EnableAutomaticNumbering set_EnableAutomaticNumbering ContinueNumbering RestartNumbering EndRendering BeginRendering FromBase64String ToBase64String AddString GetLocalizedString get_AppDomainAppVirtualPathString DocumentFormatToString jsonAsString get_CssString set_CssString cssString HtString get_UnitFormatString GetUnitFormatString unitFormatString get_DisplayFormatString set_DisplayFormatString displayFormatString GetString DrawString WorkSessionProcessing DevExpress.Web.Internal.Dialogs.IFileManager.add_FolderCreating DevExpress.Web.Internal.Dialogs.IFileManager.remove_FolderCreating FileManager_FolderCreating add_DocumentSelectorFolderCreating remove_DocumentSelectorFolderCreating RaiseDocumentSelectorFolderCreating DevExpress.Web.Internal.Dialogs.IFileManager.add_ItemDeleting DevExpress.Web.Internal.Dialogs.IFileManager.remove_ItemDeleting FileManager_ItemDeleting add_DocumentSelectorItemDeleting remove_DocumentSelectorItemDeleting RaiseDocumentSelectorItemDeleting GroupEditing DevExpress.Web.Internal.Dialogs.IFileManager.get_SettingsEditing FileManagerSettingsEditing System.Drawing.Printing get_Printing set_Printing DevExpress.XtraPrinting JSONEnumClientTableFormatting ApplyTableFormatting set_UseFormatting get_ParagraphFormatting set_ParagraphFormatting ModifyParagraphFormatting ApplyParagraphFormatting JSONEnumClientTableCellFormatting ApplyTableCellFormatting get_KeepTextHighlightingOnClearFormatting set_KeepTextHighlightingOnClearFormatting get_CharacterFormatting set_CharacterFormatting ModifyCharacterFormatting ApplyCharacterFormatting FieldResultFormatting JSONEnumClientTableRowFormatting ApplyTableRowFormatting add_Saving remove_Saving EnsureDocumentPathBeforeSaving RaiseSaving EventSaving DevExpress.Web.Internal.Dialogs.IFileManager.add_ItemMoving DevExpress.Web.Internal.Dialogs.IFileManager.remove_ItemMoving FileManager_ItemMoving add_DocumentSelectorItemMoving remove_DocumentSelectorItemMoving RaiseDocumentSelectorItemMoving DevExpress.Office.Drawing System.Drawing get_PopupMenuShowing set_PopupMenuShowing DevExpress.Web.Internal.Dialogs.IFileManager.add_ItemCopying DevExpress.Web.Internal.Dialogs.IFileManager.remove_ItemCopying FileManager_ItemCopying add_DocumentSelectorItemCopying remove_DocumentSelectorItemCopying RaiseDocumentSelectorItemCopying DevExpress.Web.ASPxRichEdit.Images.dt_SVGSprite.png DevExpress.Web.ASPxRichEdit.Images.ISprite.png DevExpress.Web.ASPxRichEdit.Images.GISprite.png DevExpress.Web.ASPxRichEdit.Images.GWTISprite.png DevExpress.Web.ASPxRichEdit.Images.GWISprite.png DevExpress.Web.ASPxRichEdit.Images.sprite.png DevExpress.Web.ASPxRichEdit.Images.dt_WTSVGsprite.png DevExpress.Web.ASPxRichEdit.Images.reAnchor.png CreateInsertImageDialog get_SaveFileDialog set_SaveFileDialog get_SettingsSaveFileDialog CreateOpenFileDialog get_InsertPictureDialog set_InsertPictureDialog get_SettingsInsertPictureDialog get_InsertLinkDialog set_InsertLinkDialog get_SettingsInsertLinkDialog get_CommandCallbackArg get_PerformCallbackArg DevExpress.Web.ASPxRichEdit.Images.reAutoScrollCursorN.svg DevExpress.Web.ASPxRichEdit.Images.reAutoScrollCursorNS.svg DevExpress.Web.ASPxRichEdit.Images.reAutoScrollCursorS.svg DevExpress.Web.ASPxRichEdit.Images.SVGSprite.svg DevExpress.Web.ASPxRichEdit.Images.WTSVGSprite.svg DevExpress.Web.ASPxRichEdit.Images.startTableMark.svg DevExpress.Web.ASPxRichEdit.Images.reAutoScrollArrow.svg ForEach Inch CreateQuickSearch IsMatch set_Stretch get_Touch set_Touch ClipboardAccessDeniedTouch ClipboardAccessDeniedErrorTouch TextWrapThrough get_Paragraph ExtendGoToEndParagraph RemoveWholeParagraph AddSpacingBeforeParagraph RemoveSpacingBeforeParagraph RemoveNumberingFromParagraph DeleteAllRunsInParagraph jsonParagraph InsertTabToParagraph AddNumberingListToParagraph GroupParagraph AddSpacingAfterParagraph RemoveSpacingAfterParagraph DeleteTabAtParagraph SelectParagraph ExtendGoToStartParagraph InsertParagraph get_KeepLastParagraph set_KeepLastParagraph keepLastParagraph InsertFirstParagraph NextParagraph FinishMerge_NewParagraph ModifyParagraph paragraph get_Word2003PasswordHash set_Word2003PasswordHash get_PasswordHash set_PasswordHash get_OpenOfficePasswordHash set_OpenOfficePasswordHash ComputeStringHash English GroupFinish finish SolidBrush CalculateBrush Math set_Path ImagesResourcePath CssResourcePath UIScriptsResourcePath GetResourceImagePath GetDesignTimeResourceSpriteImagePath AreSameFilePath get_CssFilePath set_CssFilePath GetCurrentDocumentFilePath GetNewFilePath filePath get_AbsolutePath NormalizeRelativePath ResolvePhysicalPath GetFullPath get_RootFolderUrlPath set_RootFolderUrlPath get_GrammarPath set_GrammarPath fileLocatedFolderPath workingFolderPath GetResourceSpriteCssPath get_AlphabetPath set_AlphabetPath get_DocumentPath GetCurrentDocumentPath documentPath get_DictionaryPath set_DictionaryPath CantSaveToEmptyPath Columns_Width get_Width set_Width get_DefaultTabWidth set_DefaultTabWidth ChangeDefaultTabWidth TableProperties_PreferredWidth get_PreferredWidth UpdatePreferredWidth PageWidth set_ImageWidth get_DefaultImageWidth ScaleWidth ChangeFloatingObjectOutlineWidth outlineWidth OriginalWidth Columns_EqualWidth ChangeTableCellWidth cellWidth PresetStyleItemWidth set_MinWidth TableFixedColumnWidth SetFixedColumnWidth RulerChangeTableColumnWidth set_BorderWidth set_SwitchToSingleColumnAtWindowInnerWidth set_ExtentWidth set_MaxTextWidth get_DefaultMaxTextWidth width get_Length set_Length maxDataLength get_ClientFontInfoCacheLength set_ClientFontInfoCacheLength clientFontInfoCacheLength currChunkLength DefaultChunkLength MaxChunkLength maxChunkLength ErrorLength GetLength SetLength DocumentLength get_ContentLength DefaultRequestLength length get_With set_With FindReplace_ReplaceWith Numbering_FollowNumberWith StartsWith with get_Bidi fi gi get_Uri get_IgnoreUri set_IgnoreUri get_NavigateUri set_NavigateUri get_AbsoluteUri obj InsertPageBreak get_DontJustifyLinesEndingInSoftLineBreak InsertLineBreak InsertColumnBreak FloatingObjectSendToBack set_AutoPostBack get_IsPostBack add_Callback remove_Callback AsyncCallback get_IsCommandCallback IsInternalServiceCallback get_IsUploadImageCallback get_IsDialogCallback RaiseCustomCallback get_IsCustomCallback get_IsPerformCallback get_IsFileManagerCallback get_IsColumnsEditorCallback get_IsCallback DevExpress.Web.ASPxRichEdit.Internal.IRichEditFileManager.IsRichEditCallback DevExpress.Web.ASPxRichEdit.Internal.IRichEditFileManager.get_IsRichEditCallback DevExpress.Web.ASPxRichEdit.Internal.IRichEditFileManager.set_IsRichEditCallback EventCallback get_IsSymbolListCallback callback IsInternalUploadControlPostback get_Black SpellCheck IntervalsToCheck TextToCheck textToCheck SetRelativeLastRunIndexWithoutCheck get_HyperlinkClick set_HyperlinkClick set_ItemClick RegisterScriptBlock CreateStyleLink DeleteStyleLink CreateLink Delete_Hyperlink get_Hyperlink get_FollowedHyperlink ChangeHyperlink RemoveHyperlink OpenHyperlink IsHyperlink EditHyperlink PushChunk jsonChunk NextChunk StartNewChunk get_TableLook set_TableLook ChangeTableLook InsertShiftTabMark InsertTabMark StartTableMark get_HideCellMark set_HideCellMark set_UseHideCellMark set_UseDoubleQuotesMark Hyperlink_Bookmark CreateBookmark DeleteBookmark GoToBookmark bookmark get_Mask oldMask GetNewMask mask get_Val set_Val LayoutOptions_Vertical BorderInsideVertical DrawingObjectRelativeFromVertical SetFormLayoutVertical InsertImage_FromLocal set_Modal Special SetIndexInitial Tabs_Decimal get_ConvertPreviousLevelNumberingToDecimal set_ConvertPreviousLevelNumberingToDecimal CharacterFormattingScript_Normal MarginsNormal get_Ordinal DevExpress.Web.Internal DevExpress.Web.Office.Internal DevExpress.Utils.Localization.Internal DevExpress.Office.Utils.Internal DevExpress.Utils.Internal DevExpress.XtraRichEdit.Internal DevExpress.Web.ASPxRichEdit.Internal get_EnableClientSideAPIInternal set_EnableClientSideAPIInternal AddInternal get_ClientInstanceNameInternal set_ClientInstanceNameInternal DeleteInternal ExecuteInternal RemoveInternal get_LoadingPanelInternal RaiseCallbackErrorInternal get_ImagesInternal get_JSPropertiesInternal get_StylesInternal get_ClientSideEventsInternal General LayoutOptions_Horizontal BorderInsideHorizontal DrawingObjectRelativeFromHorizontal SequenceEqual op_GreaterThanOrEqual op_LessThanOrEqual JSONFixedInterval FieldRunInterval SetInterval DocumentInterval CreateLabel get_EffectLabel set_EffectLabel get_ToBeClearedListLabel set_ToBeClearedListLabel get_PreviewTextLabel set_PreviewTextLabel ASPxLabel set_Cancel DevExpress.Office.Model DevExpress.XtraRichEdit.Model get_Model get_IsValidModel set_IsValidModel System.Collections.ObjectModel IDocumentModel get_DocumentModel set_DocumentModel PrepareDocumentModel fromDocumentModel MainDocumentModel mainDocumentModel jsonDocumentModel AddLinkedStyleToDocumentModel AddLinkedStylesToDocumentModel AddGridTableStylesToDocumentModel AddPlainTableStylesToDocumentModel ASPxDocumentModel documentModel System.ComponentModel PerformModifyModel CanModifyModel model ASPxRoundPanel ASPxCollapsiblePanel get_WidthSpacingPanel set_WidthSpacingPanel get_LoadingPanel set_LoadingPanel CreateLoadingPanel get_HasLoadingPanel SettingsLoadingPanel get_QuickSearchPanel set_QuickSearchPanel CreateQuickSearchPanel get_MainPanel set_MainPanel get_PresetsPanel set_PresetsPanel GetChildDxRichEditPanel ASPxPanel SetParagraphHeading1Level SetParagraphHeading2Level SetParagraphHeading3Level SetParagraphHeading4Level SetParagraphHeading5Level SetParagraphHeading6Level SetParagraphHeading7Level SetParagraphHeading8Level SetParagraphHeading9Level Numbering_Level get_Level get_NestedLevel get_TableNestedLevel set_TableNestedLevel tableNestedLevel NumberingListReferenceLevel get_OutlineLevel set_OutlineLevel ChangeHeadingLevel GetCellByNestingLevel SetParagraphLevel get_MultiLevel set_MultiLevel NumberingMultiLevel jsonLevel SetLevel get_RelativeRestartLevel set_RelativeRestartLevel IListLevel ChangeIOverrideListLevel ModifyListLevel listLevel SetParagraphBodyTextLevel Pixel fl get_EMail set_EMail Hyperlink_InvalidEmail OtherLabels_All get_All set_All FindAll FindReplace_ReplaceAll Spelling_ChangeAll Spelling_IgnoreAll RemoveAll Tabs_ClearAll BorderShading_BordersAll SelectAll LockRaiseSavingCall UnlockRaiseSavingCall DevExpress.Web.ASPxRichEdit.v18.2.dll TableProperties_Cell ChangeTableCell CreateTableCell RemoveTableCell InitializeTableCell JSONEnumTableCell get_LayoutInTableCell set_LayoutInTableCell ExtendSelectTableCell InsertTableCell LayoutTableCell CanModifyTableCell ForEachCell jsonCell GetCell CreateSpinEditCell clientCell get_ParentCell get_FirstCell shiftNextCell CreateTextBoxCell cell BorderShading_Fill get_Fill set_Fill DrawingSolidFill IDrawingFill get_BlipFill DrawingBlipFill ArgumentNotNull OpenXml DevExpress.XtraRichEdit.Export.Html get_Html get_EncodeHtml set_EncodeHtml ToHtml InsertHtml Columns_Col get_TabSymbol set_TabSymbol HtBool IControl get_Control set_Control ASPxDataWebControl ASPxWebControl IUploadControl get_UploadControl set_UploadControl CreateUploadControl RichEditFileManagerUploadControl DevExpress.Web.ASPxRichEdit.Internal.IRichEditFileManager.GetUploadControl RichEditUploadControl ASPxUploadControl get_PageControl set_PageControl ASPxPageControl CreateControl TemplateControl IAutoSaveControl get_DialogControl set_DialogControl CreateDialogControl RichEditDialogControl GetCurrentDialogControl get_QuickSearchControl set_QuickSearchControl CreateQuickSearchControl RichEditQuickSearchControl SyncSettingWithControl RichEditLoadingPanelControl CreateDialogFromControl get_WidowOrphanControl set_WidowOrphanControl WebParagraphPropertiesWidowOrphanControl get_MainControl set_MainControl CreateMainControl RichEditMainControl get_RibbonControl set_RibbonControl CreateRibbonControl get_ExternalRibbonControl externalRibbonControl LookupRibbonControl GetRibbonControl OfficeWorkSessionControl AddTemplateToControl AssignToControl AddTabCollectionToControl AddContextCategoriesToControl CreatePopupControl ASPxPopupControl get_StatusBarControl set_StatusBarControl CreateStatusBarControl RichEditStatusBarControl statusBarControl PrepareUserControl IDialogUserControl RichEditDialogUserControl InitializeAsUserControl RegisterControl CreateColumnsEditorControl GetColumnsEditorControl IsControl System.Security.AccessControl get_RichEditControl set_RichEditControl CreateRichEditControl PopupControlContentControl CreateMenuControl CreatePopupMenuControl RichEditPopupMenuControl SetupMenuControl control ControlProviderImpl Hyperlink_Url get_Url set_Url SourceUrl GetResourceUrl get_ImageUrl InvalidImageUrl ResolveImageUrl IsAbsoluteUrl GetAbsoluteUrl imageLoadingUrl AddImageToCacheFromUrl InsertImage_EnterUrl ResolveClientUrl url get_Hsl rtl get_Stream GetResponseStream FillStream GetBytesFromStream get_IsStream GetImageBytesStream GetStream contentAccessorByStream MemoryStream stream elem get_Item set_Item AddItem AppendItem RERParagraphStyleItem RERCharacterStyleItem CreateItem IRibbonInternalItem CollectionItem RibbonToggleButtonItem RibbonDropDownToggleButtonItem RibbonButtonItem RibbonDropDownButtonItem RibbonColorButtonItem RibbonGalleryBarItem FileManagerItem RegisterItem set_EnableAutomaticColorItem GetItem RibbonSpinEditItem ListEditItem get_DefaultItem ToggleBulletedListItem ToggleNumberingListItem ToggleMultilevelListItem AddEmptyLayoutItem RichEditPopupMenuItem RibbonCheckBoxItem RibbonComboBoxItem RibbonGalleryItem ChangeTableBorderStyleRepositoryItem ChangeTableBorderWidthRepositoryItem ChangeTableBorderColorRepositoryItem AddFieldHistoryItem item System Trim GroupZoom FinishMerge_From get_From HtCopyFrom from BorderShading_BordersCustom get_Bottom set_Bottom TextWrapTopAndBottom set_PaddingBottom MarginBottom WrapTopBottom BorderBottom ShowInsertMergeFieldForm FindReplaceForm InsertImageForm ShowFinishAndMergeForm FinishMergeForm ShowInsertTableForm SaveFileForm OpenFileForm ShowServiceBorderShadingForm ShowBorderShadingForm SpellingForm get_CurrentDialogForm set_CurrentDialogForm currentDialogForm ShowParagraphForm ShowCreateHyperlinkForm ShowEditHyperlinkForm InsertHyperlinkForm ShowHyperlinkForm ShowBookmarkForm ShowSymbolForm ShowPageSetupForm ShowPagePaperSetupForm ShowPageMarginsSetupForm ShowColumnsSetupForm SelectFolderForm ShowSpellCheckerForm get_ColumnsEditorForm set_ColumnsEditorForm ShowTabsForm ShowTablePropertiesForm BookmarksForm ShowDeleteTableCellsForm ShowSplitTableCellsForm ShowInsertTableCellsForm ShowServiceSymbolsForm ColumnsForm MenuCmd_ShowCellOptionsForm ShowLayoutOptionsForm CreateDefaultForm ShowSaveMergedDocumentForm ShowServiceFontForm ShowFontForm AlertForm BulletedListForm SimpleNumberingListForm MultiLevelNumberingListForm ShowCustomNumberingListForm ShowNumberingListForm get_Platform BrowserPlatform Enum TableProperties_MeasureIn InstantiateIn get_RemoteStateStorageModeOn ToBoolean DefaultBoolean op_GreaterThan op_LessThan TimeSpan set_ColSpan get_ColumnSpan set_ColumnSpan set_RowSpan Pen get_Hidden set_Hidden get_Semihidden get_FullScreen set_FullScreen MenuCmd_ToggleFullScreen Token get_Open set_Open FileOpen set_ShowPrintDialogOnOpen SetAsParentForAllChildren DifferentOddAndEven Tabs_EqualSign get_VerticalAlign set_VerticalAlign PopupAdaptiveVerticalAlign set_PopupVerticalAlign FormLayoutVerticalAlign get_HorizontalAlign set_HorizontalAlign PopupAdaptiveHorizontalAlign set_PopupHorizontalAlign FormLayoutHorizontalAlign DevExpress.Web.Design DevExpress.Utils.Design PageTableDesign Assign Min ChangeActiveSubDocumentToMain get_IsMain set_Margin set_UseBottomMargin set_UseTopMargin set_UseLeftMargin set_UseRightMargin Join get_Latin TableProperties_Column ToggleBandedColumn ExtendSelectTableColumn SetSectionOneColumn DeleteCells_DeleteEntireColumn InsertCells_InsertEntireColumn TableProperties_PreviousColumn ToggleLastColumn ToggleFirstColumn TableProperties_NextColumn get_Ribbon OneLineRibbon CreateRibbon ActivateRibbon ExternalRibbon get_StylesRibbon stylesRibbon CreateDefaultRibbon RichEditDefaultRibbon ASPxRibbon ribbon CreateWrapPolygon wrapPolygon IsNotAllowedFileExtension GetFileExtension fileExtension GetFileNameWithoutExtension get_Session SwitchSession IWorkSession get_WorkSession set_WorkSession EnsureWorkSession CloseWorkSession SerializeWorkSession DeserializeWorkSession OnControlDetachFromWorkSession OpenWorkSession DevExpress.Web.Office.OfficeWorkSessionControl.AttachToWorkSession SaveAsWorkSession RichEditWorkSession CheckOutWorkSession CreateNewWorkSession IsNewWorkSession CloseTemporaryWorkSession workSession StoreGuidInSession GetGuidInSession StoreDictionaryInSession GetDictionaryInSession get_CurrentSession CloseCurrentSession set_ValidationExpression get_RegularExpression RangePermission rangePermission GetInfoForModification GetOptionsForModification get_IsModification get_Authentication authentication Bookmarks_Location set_Location topImageLocation leftImageLocation verticalCellLocation horizontalCellLocation LayoutItemCaptionLocation set_EnableCustomValidation PrepareNavigation GroupHeaderFooterToolsDesignNavigation SpellingCheckCompletedInformation get_SuppressHyphenation set_SuppressHyphenation Pagination IsValidOperation set_GroupBoxDecoration RichEditWorkSessionRegistration PrepareForScriptManagerRegistration get_FloatSaturation Indentation SetLandscapePageOrientation SetPortraitPageOrientation DevExpress.XtraRichEdit.API.Native.Implementation DevExpress.Office.Services.Implementation LayoutOptions_Rotation get_Rotation set_Rotation System.Globalization DevExpress.Web.Localization DevExpress.Office.Localization DevExpress.Utils.Localization DevExpress.XtraRichEdit.Localization DevExpress.Web.ASPxRichEdit.Localization RichEditLocalization HasClientInitialization get_EndSynchronization set_EndSynchronization get_BeginSynchronization set_BeginSynchronization ConflictNameAction set_CloseAction PopupMenuCloseAction saveAction set_PopupAction op_Subtraction JSONSection ShowDownloadSection get_ShowFileUploadSection set_ShowFileUploadSection NativeSection IsLastParagraphOfSection IsFirstParagraphOfSection jsonSection get_InnerSection ShowServerSection get_ShowEmailAddressSection set_ShowEmailAddressSection GetSection CanEditSection CurrentSection InsertSection NextSection FinishMerge_NewSection ModifySection PasteSelection CutSelection CopySelection System.Reflection ICollection get_PostDataCollection UpdateRibbonTabCollection RichEditRibbonTabCollection FieldCollection TabPageCollection TableCollection DocumentVariableCollection IAssignableCollection GetAllowedFileCollection TableStyleCollection ParagraphStyleCollection CharacterStyleCollection CssStyleCollection NumberingListStyleCollection AttributeCollection NameValueCollection nameValueCollection ParagraphCollection BookmarkCollection get_PanelCollection TableCellCollection SyncRibbonControlCollection ContentControlCollection RibbonItemCollection ListEditItemCollection LayoutItemCollection RichEditPopupMenuItemCollection itemCollection RangePermissionCollection SectionCollection SuggestionCollection RibbonDropDownButtonCollection EditButtonCollection TextRunCollection get_AutoCorrectReplaceInfoCollection ASPxRichEditAutoCorrectReplaceInfoCollection HyperlinkInfoCollection ColumnInfoCollection RibbonGroupCollection HeaderCollection FooterCollection ThemeDrawingColorCollection GetSharedDictionariesCollection CreateItemsCollection ArgumentCollection get_ContentCollection AbstractNumberingListCollection postCollection TableRowCollection SpellCheckerDictionaryCollection CreateContextTabCategoryCollection RichEditRibbonContextTabCategoryCollection collection ForwardDirection set_RepeatDirection RightDirection get_TextDirection set_TextDirection set_UseTextDirection get_RightToLeftTextDirection set_RightToLeftTextDirection section get_EnforceProtection set_EnforceProtection GroupDocumentProtection op_Addition LayoutOptions_Position get_Position set_Position EndPosition endPosition set_ImagePosition FloatingObjectDragDropChangePosition get_TablePosition set_TablePosition JSONEnumClientTablePosition tablePosition LayoutOptions_AbsolutePosition LayoutOptions_RelativePosition get_FloatingPosition TableFloatingPosition get_LogPosition set_LogPosition get_EndLogPosition get_DocumentEndLogPosition SetRelativeLogPosition GetRunLogPosition GetLogPosition DocumentLogPosition get_RunStartLogPosition get_DocumentStartLogPosition logPosition EndParagraphPosition StartParagraphPosition get_TableVerticalPosition set_TableVerticalPosition get_TableHorizontalPosition set_TableHorizontalPosition ToDocumentModelPosition EndCellPosition StartCellPosition GroupHeaderFooterToolsDesignPosition Tabs_TabStopPosition Numbering_NumberPosition get_CurrPosition Numbering_BulletPosition get_ActualIntPosition get_StartPosition ShiftTableStartPosition ParagraphStartPosition startPosition CreateInputPosition Numbering_TextPosition set_ErrorTextPosition position get_Caption set_Caption set_AutomaticColorItemCaption get_DefaultAutomaticColorItemCaption set_ShowCaption showCaption get_Exception SpellCheckerWordAddedException DocumentCannotBeOpenedException NotImplementedException NotSupportedException DocumentCannotBeSavedException DocVariableException CalculateDocumentVariableException CantSaveToAlreadyOpenedFileException LoadPictureException PathTooLongException CantSaveToEmptyPathException AuthException AuthenticationException AccessViolationException add_InnerException remove_InnerException get_InnerException RaiseInnerException add_innerException remove_innerException InsertContentFromServerException CustomizeMergeFieldsException get_TablePropertiesException UnauthorizedAccessException add_InvalidFormatException RichEdit_InvalidFormatException UriFormatException ThrowArgumentException InsertContentToClientEventException get_Description CreatePageFieldDescription CreateEmptyMergeFieldDescription CreateEmptyDocVariableFieldDescription CreateTimeFieldDescription CreateDateFieldDescription MenuCmd_CreateFieldDescription CreatePageCountFieldDescription MenuCmd_MakeTextSentenceCaseDescription MenuCmd_ShowCellOptionsFormDescription MenuCmd_ToggleFullScreenDescription MenuCmd_UpdateAllFieldsDescription BorderShading_BordersDescription MenuCmd_HeaderOffsetDescription MenuCmd_FooterOffsetDescription get_ConflictNameResolution set_ConflictNameResolution get_PasteLineBreakSubstitution set_PasteLineBreakSubstitution get_UseFontSubstitution set_UseFontSubstitution GroupCommon StringComparison DownloadButton get_AddButton set_AddButton get_IgnoreOnceButton set_IgnoreOnceButton get_ChangeButton set_ChangeButton PrepareButton get_CloseButton set_CloseButton get_QuickSearchPanelCloseButton get_CollapseButton set_CollapseButton get_QuickSearchPanelCollapseButton CreateButton get_DeleteButton set_DeleteButton CreateDialogButton OkButton CancelButton get_ChangeAllButton set_ChangeAllButton get_IgnoreAllButton set_IgnoreAllButton get_ClearAllButton set_ClearAllButton OpenButton DevExpress.Web.Internal.Dialogs.IUploadControl.get_ShowClearFileSelectionButton DevExpress.Web.Internal.Dialogs.IUploadControl.set_ShowClearFileSelectionButton get_GoToButton set_GoToButton ASPxRadioButton get_ClearButton set_ClearButton CreateBorderButton SaveAsButton get_StylesButton stylesButton SelectButton get_SetButton set_SetButton CreatePresetButton EditButton set_DefaultButton InsertButton get_NextButton set_NextButton get_QuickSearchPanelNextButton get_PrevButton set_PrevButton get_QuickSearchPanelPrevButton ASPxButton get_AddToDictionaryButton set_AddToDictionaryButton button get_ShadingPattern set_ShadingPattern GetTableCellChangeTypeShadingPattern SetTableCellPropertiesOptionUseShadingPattern SetCellShadingPattern RequiredFieldValidationPattern RegularExpressionValidationPattern anchoredRun FieldCodeEndRun FieldResultEndRun InsertSimpleRun InsertAnchoredPictureRun InsertInlinePictureRun CreateRun EndNoteRun FootNoteRun ParagraphRun PushRun SectionRun jsonRun get_CurrRun InlineObjectRun DrawingObjectRun LayoutDependentRun FieldCodeStartRun InsertRun ImportRun NextRun InsertLayoutDependentTextRun ModifyTextRun CheckBoxRun InsertAnchoredTextBoxRun InlineTextBoxRun run ExtendLineDown get_PointerDown set_PointerDown InsertCells_ShiftCellsDown get_KeyDown set_KeyDown Unknown LayoutOptions_RelativeTo get_LinkTo set_LinkTo PrepareLinkTo Hyperlink_EmailTo Bookmarks_GoTo ApplyTo CopyTo Redo get_Undo set_Undo GroupUndo get_Info DefaultTabInfo JSONUpdateFieldCommandInfo JSONInsertFloatingObjectCommandInfo MethodInfo ASPxRichEditAutoCorrectReplaceInfo PageInfo AddImageInfo JSONInlinePictureCommandsImageInfo JSONPieceTableInfo JSONEnumClientTableInfo JSONUpdateFieldCommandDocVariableInfo ResponseFileInfo StyleInfo RestoreInfo GetCultureInfo get_LangInfo set_LangInfo SetShadingInfo get_FloatingInfo DrawingObjectFloatingInfo TabFormattingInfo ParagraphFormattingInfo CharacterFormattingInfo RemoveHyperlinkInfo InsertHyperlinkInfo DrawingColorModelInfo ListLevelInfo JSONEnumClientTableCellInfo JSONEnumTableParentCellInfo GetDataColumnInfo GeneralSectionInfo GetTableByPositionInfo ObtainAffectedRunInfo FindRunInfo NoInfo charInfo IBorderInfo BrowserInfo AnchorInfo LoadedImagesInfo MarginsInfo ColumnsInfo columnsInfo WinToAspRunsInfo IDocumentInfo get_DocumentInfo set_DocumentInfo GetCreateDocumentInfo RichEditDocumentInfo documentInfo TTFontInfo get_FontInfo WebFontInfo LoadFontInfo get_CompositeFontInfo set_CompositeFontInfo fontInfo JSONEnumClientTableRowInfo DrawingTextBodyInfo info LayoutOptions_LockAspectRatio get_LockAspectRatio set_LockAspectRatio get_MisspelledMemo set_MisspelledMemo ASPxMemo Zero get_Auto set_Auto ExtendLineUp get_PointerUp set_PointerUp DeleteCells_ShiftCellsUp get_KeyUp set_KeyUp UnderlineType_DashSmallGap get_IsTableOverlap set_IsTableOverlap set_UseIsTableOverlap get_AllowOverlap set_AllowOverlap Bitmap get_NoWrap set_NoWrap set_UseNoWrap get_TextWrap set_TextWrap ApplyTextWrap textWrap Hyperlink_ToolTip get_ToolTip set_ToolTip GetToolTip get_DefaultToolTip get_Blip DrawingBlip SetClip DevExpress.Web.ASPxRichEdit.ASPxRichEdit.bmp get_Top set_Top MarginTop BorderTop get_Drop set_Drop prop RERGroup get_Group set_Group RERBackgroundGroup get_BackgroundGroup CreateBackgroundGroup backgroundGroup RERClipboardGroup get_ClipboardGroup CreateClipboardGroup clipboardGroup RERCurrentRecordGroup get_CurrentRecordGroup CreateCurrentRecordGroup currentRecordGroup RERFloatingObjectsArrangeGroup get_FloatingObjectsArrangeGroup CreateFloatingObjectsArrangeGroup floatingObjectsArrangeGroup RERMergeGroup get_MergeGroup CreateMergeGroup RERFinishMailMergeGroup get_FinishMailMergeGroup CreateFinishMailMergeGroup finishMailMergeGroup mergeGroup RERTableGroup get_TableGroup CreateTableGroup tableGroup RERHeaderFooterCloseGroup get_HeaderFooterCloseGroup CreateHeaderFooterCloseGroup headerFooterCloseGroup CreateGroup RERCellSizeGroup get_CellSizeGroup CreateCellSizeGroup cellSizeGroup REREditingGroup get_EditingGroup CreateEditingGroup editingGroup RERParagraphGroup get_ParagraphGroup CreateParagraphGroup paragraphGroup get_BeginGroup set_BeginGroup beginGroup RibbonGroup set_ValidationGroup RERHeaderFooterNavigationGroup get_HeaderFooterNavigationGroup CreateHeaderFooterNavigationGroup headerFooterNavigationGroup RERHeaderFooterPositionGroup get_HeaderFooterPositionGroup CreateHeaderFooterPositionGroup headerFooterPositionGroup get_CommonGroup RERFileCommonGroup CreateFileCommonGroup commonGroup RERUndoGroup get_UndoGroup CreateUndoGroup undoGroup RERPageSetupGroup get_PageSetupGroup CreatePageSetupGroup pageSetupGroup RERHeaderAndFooterGroup get_HeaderAndFooterGroup CreateHeaderAndFooterGroup headerAndFooterGroup RERInsertFieldsGroup get_InsertFieldsGroup CreateInsertFieldsGroup insertFieldsGroup RERPagesGroup get_PagesGroup CreatePagesGroup pagesGroup RERTablesGroup get_TablesGroup CreateTablesGroup tablesGroup RERStylesGroup get_StylesGroup RERTableStylesGroup get_TableStylesGroup CreateTableStylesGroup tableStylesGroup RERFloatingObjectsShapeStylesGroup get_FloatingObjectsShapeStylesGroup CreateFloatingObjectsShapeStylesGroup floatingObjectsShapeStylesGroup CreateStylesGroup stylesGroup RERBordersAndShadingsGroup get_BordersAndShadingsGroup CreateBordersAndShadingsGroup bordersAndShadingsGroup RERLinksGroup get_LinksGroup CreateLinksGroup linksGroup RERSymbolsGroup get_SymbolsGroup CreateSymbolsGroup symbolsGroup CreateMarginsGroup RERRowAndColumnsGroup get_RowAndColumnsGroup CreateRowAndColumnsGroup rowAndColumnsGroup RERIllustrationsGroup get_IllustrationsGroup CreateIllustrationsGroup illustrationsGroup RERTableStyleOptionsGroup get_TableStyleOptionsGroup CreateTableStyleOptionsGroup tableStyleOptionsGroup RERHeaderFooterOptionsGroup get_HeaderFooterOptionsGroup CreateHeaderFooterOptionsGroup headerFooterOptionsGroup RERCaptionsGroup get_CaptionsGroup CreateCaptionsGroup captionsGroup get_EditorsGroup set_EditorsGroup RERTableOfContentsGroup get_TableOfContentsGroup CreateTableOfContentsGroup tableOfContentsGroup RERDocumentViewsGroup get_DocumentViewsGroup CreateDocumentViewsGroup documentViewsGroup RERAlignmentGroup get_AlignmentGroup CreateAlignmentGroup alignmentGroup PopulateContentGroup RERFontGroup get_FontGroup CreateFontGroup fontGroup AddLayoutGroup TabbedLayoutGroup RERTextGroup get_TextGroup CreateTextGroup textGroup RERViewGroup get_ViewGroup RERMailMergeViewGroup get_MailMergeViewGroup CreateMailMergeViewGroup mailMergeViewGroup CreateViewGroup viewGroup RERShowGroup get_ShowGroup CreateShowGroup showGroup group get_BrowsePopup set_BrowsePopup GroupPageSetup System.Linq CreateStatusBar get_LoadingPanelOnStatusBar get_StylesStatusBar stylesStatusBar get_ShowStatusBar set_ShowStatusBar <className>j__TPar <cssText>j__TPar DevExpress.Web.Internal.Dialogs.IFileManager.get_SettingsToolbar FileManagerSettingsToolbar Tabs_Clear get_UnicodeChar ToChar ContainsChar RestoreFromHibernationChamber SaveToHibernationChamber hibernationChamber ConvertNumber get_Header set_Header OddPageHeader EvenPageHeader GoToPageHeader FirstPageHeader set_UseHeader CreateHeader SectionHeader get_IsHeader InsertHeader Tabs_Leader get_Leader get_CallbackArgumentsReader set_CallbackArgumentsReader RichEditCallbackArgumentsReader IHashtableProvider ASPxperienceLicenseProvider get_ControlProvider set_ControlProvider CreateControlProvider DialogControlProvider GetControlProvider DataStringUriStreamProvider ICustomWebResourceHandlerProvider RichEditLocalizationCustomWebResourceHandlerProvider RichEditCustomWebResourceHandlerProvider SetActiveLocalizerProvider IColorProvider colorProvider IFormatProvider RichEditSpellCheckerCustomDictionaryProvider SpellCheckerDictionaryProvider ChunkedStringBuilder UriBuilder DevExpress.Web.Internal.LayoutBuilder IsCurrentFileLocatedBelowWorkingFolder set_InitialFolder IsNeedResetToInitialFolder get_RootFolder set_RootFolder IsMvcRender OnPreRender IsMvcResourcesRender sender ResFinder get_ZOrder set_ZOrder BinarySearchReverseOrder get_Border get_EmptyTableBorder emptyTableBorder get_InsideVerticalBorder set_UseInsideVerticalBorder get_TopLeftDiagonalBorder get_TopRightDiagonalBorder get_InsideHorizontalBorder set_UseInsideHorizontalBorder GetActualBottomCellBorder GetActualTopCellBorder GetActualLeftCellBorder GetActualRightCellBorder get_BottomBorder set_BottomBorder set_UseBottomBorder ToggleTableCellsBottomBorder get_BetweenBorder set_BetweenBorder ToggleTableCellNoBorder get_TopBorder set_TopBorder set_UseTopBorder ToggleTableCellsTopBorder get_LeftBorder set_LeftBorder set_UseLeftBorder ToggleTableCellsLeftBorder get_RightBorder set_RightBorder set_UseRightBorder ToggleTableCellsRightBorder DrawBorder border get_TextBuffer ChangeTextBuffer currChunkTextBuffer textBuffer set_BinaryBuffer get_Manager set_Manager RichEditDownloadManager CommandManager commandManager ServiceManager ResourceManager resourceManager IFileManager get_FileManager set_FileManager PrepareFileManager CreateFileManager GetDialogFileManager get_StylesFileManager stylesFileManager IRichEditFileManager ASPxFileManager fileManager DevExpress.Web.ASPxRichEdit.Internal.ISettingsWithExternalStateManager.StateManager IStateManager DevExpress.Web.ASPxRichEdit.Internal.ISettingsWithExternalStateManager.get_StateManager ISettingsWithExternalStateManager RichEditOptionsStateManager stateManager FontSizeManager get_StyleLinkManager CreateFolderManager RichEditFolderManager get_TableCellsManager RichEditSymbolsManager DocumentManager FontManager manager get_ShowDialogBoxLauncher set_ShowDialogBoxLauncher showDialogBoxLauncher get_KeepLinesTogether set_KeepLinesTogether AnchorInfoPropertyPercentOffsetXModifier AnchorInfoPropertyOffsetXModifier AnchorInfoPropertyPercentOffsetYModifier AnchorInfoPropertyOffsetYModifier RunFontItalicModifier WebCharacterPropertiesFontItalicModifier AnchorInfoPropertyIsBehindDocModifier WebParagraphPropertiesDivIdModifier TableRowPropertiesTableRowDivIdModifier AnchorInfoPropertyLockedModifier RunFontBoldModifier WebCharacterPropertiesFontBoldModifier SectionPropertiesSpaceModifier ListLevelPropertiesLegacySpaceModifier AnchorInfoPropertyBottomDistanceModifier AnchorInfoPropertyTopDistanceModifier AnchorInfoPropertyLeftDistanceModifier AnchorInfoPropertyRightDistanceModifier AnchorInfoPropertyWrapSideModifier ListLevelPropertiesTemplateCodeModifier SectionPropertiesDifferentFirstPageModifier WebCharacterPropertiesFontNameModifier SectionPageOrientationLandscapeModifier SectionPropertiesLandscapeModifier RunLanguageTypeModifier RunFontUnderlineTypeModifier WebCharacterPropertiesFontUnderlineTypeModifier WebParagraphPropertiesLineSpacingTypeModifier AnchorInfoPropertyVerticalPositionTypeModifier AnchorInfoPropertyHorizontalPositionTypeModifier AnchorInfoPropertyWrapTypeModifier WebParagraphPropertiesFirstLineIndentTypeModifier SectionPropertiesStartTypeModifier RunFontStrikeoutTypeModifier WebCharacterPropertiesFontStrikeoutTypeModifier TablePropertiesLayoutTypeModifier TableRowPropertiesGridBeforeModifier WebParagraphPropertiesSpacingBeforeModifier TableRowPropertiesWidthBeforeModifier WebParagraphPropertiesPageBreakBeforeModifier ParagraphPropertiesUseValueBaseModifier RunCharacterPropertiesUseValueBaseModifier CreateModifier RunCharacterPropertiesUseValueModifier TablePropertiesTableStyleColBandSizeModifier TablePropertiesTableStyleRowBandSizeModifier WebCharacterPropertiesFontSizeModifier ListLevelPropertiesSuppressBulletResizeModifier RunNoProofModifier WebCharacterPropertiesNoProofModifier WebParagraphPropertiesLineSpacingModifier WebParagraphPropertiesContextualSpacingModifier TablePropertiesCellSpacingModifier TableRowPropertiesCellSpacingModifier WebParagraphPropertiesBeforeAutoSpacingModifier WebParagraphPropertiesAfterAutoSpacingModifier TableCellPropertiesShadingModifier TableCellPropertiesVerticalMergingModifier ListLevelPropertiesDisplayFormatStringModifier TablePropertiesPreferredWidthModifier TableCellPropertiesPreferredWidthModifier SectionPropertiesPageWidthModifier ShapeOutlineWidthModifier TableCellPropertiesHideCellMarkModifier TableRowPropertiesHideCellMarkModifier ListLevelPropertiesConvertPreviousLevelNumberingToDecimalModifier IntervalWithUseModelModifier ListLevelWithUseModelModifier WebParagraphPropertiesOutlineLevelModifier ListLevelPropertiesRelativeRestartLevelModifier SectionPropertiesMarginBottomModifier TableCellPropertiesColumnSpanModifier RunHiddenModifier WebCharacterPropertiesHiddenModifier WebParagraphPropertiesSuppressHyphenationModifier TableCellPropertiesTextDirectionModifier WebCharacterPropertiesLangInfoModifier RunShadingInfoModifier TablePropertiesShadingInfoModifier WebParagraphPropertiesShadingInfoModifier WebCharacterPropertiesShadingInfoModifier WebParagraphPropertiesBorderInfoModifier SectionPropertiesColumnsInfoModifier WebCharacterPropertiesCompositeFontInfoModifier InlineObjectPropertiesLockAspectRatioModifier TablePropertiesIsTableOverlapModifier AnchorInfoPropertyAllowOverlapModifier TableCellPropertiesNoWrapModifier SectionPropertiesMarginTopModifier TableRowPropertiesHeaderModifier AnchorInfoPropertyZOrderModifier WebParagraphPropertiesBottomBorderModifier WebParagraphPropertiesBetweenBorderModifier WebParagraphPropertiesTopBorderModifier WebParagraphPropertiesLeftBorderModifier WebParagraphPropertiesRightBorderModifier WebParagraphPropertiesKeepLinesTogetherModifier get_InnerModifier set_InnerModifier TableRowPropertiesGridAfterModifier WebParagraphPropertiesSpacingAfterModifier TableRowPropertiesWidthAfterModifier TableCellPropertiesForegroundColorModifier TableCellPropertiesBackgroundColorModifier RunUnderlineColorModifier WebCharacterPropertiesUnderlineColorModifier ShapeOutlineColorModifier RunForeColorModifier WebCharacterPropertiesForeColorModifier ShapeFillColorModifier WebParagraphPropertiesColorModifier WebCharacterPropertiesColorModifier RunHighlightColorModifier WebCharacterPropertiesHighlightColorModifier RunStrikeoutColorModifier WebCharacterPropertiesStrikeoutColorModifier ListLevelPropertiesSeparatorModifier WebParagraphPropertiesModifier IntervalParagraphPropertiesModifier ListLevelParagraphPropertiesModifier WebCharacterPropertiesModifier RunCharacterPropertiesModifier TablePropertiesTableLookTypesModifier InlineObjectPropertiesScaleRatesModifier TablePropertiesCellMarginsModifier TableCellPropertiesCellMarginsModifier SectionPropertiesEqualWidthColumnsModifier RunAllCapsModifier WebCharacterPropertiesAllCapsModifier WebParagraphPropertiesSuppressLineNumbersModifier TablePropertiesAvoidDoubleBordersModifier TablePropertiesBordersModifier TableCellPropertiesBordersModifier ListLevelPropertiesFormatModifier WebParagraphPropertiesFloatModifier SectionPropertiesHeaderOffsetModifier SectionPropertiesFooterOffsetModifier SectionPropertiesMarginLeftModifier WebParagraphPropertiesRightToLeftModifier SectionPropertiesMarginRightModifier SectionPropertiesPageHeightModifier TableRowPropertiesHeightModifier TableRowPropertiesCantSplitModifier WebParagraphPropertiesFirstLineIndentModifier TablePropertiesIndentModifier ListLevelPropertiesOriginalLeftIndentModifier WebParagraphPropertiesLeftIndentModifier WebParagraphPropertiesRightIndentModifier ListLevelPropertiesLegacyIndentModifier TableCellPropertiesVerticalAlignmentModifier AnchorInfoPropertyVerticalPositionAlignmentModifier AnchorInfoPropertyHorizontalPositionAlignmentModifier WebParagraphPropertiesAlignmentModifier ListLevelPropertiesAlignmentModifier TablePropertiesTableRowAlignmentModifier TableRowPropertiesTableRowAlignmentModifier RunCompositeFontModifier SectionPropertiesColumnCountModifier RunScriptModifier WebCharacterPropertiesScriptModifier ListLevelIOverrideStartModifier ListLevelPropertiesStartModifier ListLevelIOverrideNewStartModifier ListLevelPropertiesSuppressRestartModifier WebParagraphPropertiesKeepWithNextModifier TableCellPropertiesFitTextModifier WebParagraphPropertiesShadingInfoIndexModifier ListLevelPropertiesLegacyModifier RunUnderlineWordsOnlyModifier WebCharacterPropertiesUnderlineWordsOnlyModifier RunStrikeoutWordsOnlyModifier WebCharacterPropertiesStrikeoutWordsOnlyModifier RunFontNamePropertyModifier RunDoubleFontSizePropertyModifier CreateRunPropertyModifier CharacterPropertyModifier modifier ScriptMultiplier get_SpellChecker DevExpress.XtraSpellChecker WebSpellChecker WebRichEditSpellChecker DevExpress.Web.ASPxSpellChecker spellChecker PermissionChecker locker get_TabMarker set_TabMarker PageUnloadHandler AddHandler CreateStyleHandler GetStyleHandler RemoveHandler AddErrorForHandler ClearErrorForHandler RichEditCommandDiagnosticEventHandler FileManagerFileUploadEventHandler WordAddedEventHandler RepeatedWordFoundEventHandler NotInDictionaryWordFoundEventHandler CalculateDocumentVariableEventHandler FileManagerItemRenameEventHandler FileManagerFolderCreateEventHandler FileManagerItemDeleteEventHandler FileManagerItemMoveEventHandler DocumentSavingEventHandler RichEditInvalidFormatExceptionEventHandler CustomizeMergeFieldsEventHandler CustomJSPropertiesEventHandler GetEventHandler SetEventHandler InsertContentToClientEventHandler FileManagerCloudProviderRequestEventHandler FileManagerItemCopyEventHandler handler RichEditSpellCheckerController DeleteTabRuler MoveTabRuler InsertTabRuler get_HorizontalRuler ToggleShowHorizontalRuler horizontalRuler get_ImagesRuler imagesRuler get_StylesRuler stylesRuler IControlDesigner INamingContainer get_HasLoadingPanelContainer destinationContainer get_FolderContainer IDrawingObjectContainer GetContainer DocumentContentContainer documentContentContainer container get_Owner set_Owner ISkinOwner IParentSkinOwner set_ParentSkinOwner skinOwner IRibbonOwner IInnerRichEditDocumentServerOwner IPropertiesOwner IDialogUtilsOwner owner Paper ClientIDHelper RichEditDownloadImageHelper InternalOfficeImageHelper MasterDetailHelper FindControlHelper RichEditRibbonHelper OfficeRegistrationHelper ColorHelper get_RibbonImagesHelper CreateRichEditRibbonImagesHelper ribbonImagesHelper RichEditPresetStylesHelper RichEditDialogsHelper JSONImportHelper ExportHelper DocumentRequestHelper DefaultNumberingListHelper RichEditSpellCheckerCustomDictionaryHelper get_QuickSearchPanelWrapper set_QuickSearchPanelWrapper BorderWrapper get_FormLayoutWrapper set_FormLayoutWrapper IComparer StringComparer DevExpress.XtraSpellChecker.Parser get_Browser Numbering_Character Numbering_TabCharacter ExtendPreviousCharacter Numbering_BulletCharacter ExtendNextCharacter Centimeter get_GridAfter set_GridAfter get_SpacingAfter set_SpacingAfter get_WidthAfter Enter Numbering_Center Tabs_Center TableCellAlignMiddleCenter TableCellAlignBottomCenter TableCellAlignTopCenter ToggleParagraphAlignmentCenter RichEditStylePainter SubDocumentsCounter PageHeaderAndFooter OddPageFooter EvenPageFooter GoToPageFooter FirstPageFooter CreateFooter SectionFooter ClosePageHeaderFooter GoToPreviousPageHeaderFooter GoToNextPageHeaderFooter GroupHeaderFooter ImportHeaderFooter get_IsFooter InsertFooter CreateConverter PositionConverter OrdinalBasedNumberConverter get_UnitConverter DocumentModelUnitConverter DocumentLayoutUnitConverter DocumentLayoutUnitDocumentConverter MainStructuresImporter ColorHSLExporter FieldExporter ImageCacheExporter PieceTableExporter TableStyleExporter ParagraphStyleExporter TableConditionalStyleExporter CharacterStyleExporter NumberingListStyleExporter ShapeExporter StyleBaseExporter paragraphFormattingBaseExporter charFormattingBaseExporter characterFormattingBaseExporter RunBaseExporter BorderBaseExporter PictureSizeExporter AnchorTextBoxSizeExporter ParagraphFormattingExporter ListLevelFormattingExporter get_CharacterFormattingExporter set_CharacterFormattingExporter ParagraphExporter ChunkExporter BookmarkExporter DocumentModelExporter NumberingListReferenceLevelExporter NumberingOverrideListLevelExporter NumberingListLevelExporter TableCellExporter RangePermissionExporter SectionExporter ThemeDrawingColorCollectionExporter FieldCodeEndRunExporter FieldResultEndRunExporter AnchoredPictureRunExporter DrawingObjectInlinePictureRunExporter EndNoteRunExporter FootNoteRunExporter ParagraphRunExporter SectionRunExporter FieldCodeStartRunExporter LayoutDependentTextRunExporter AnchoredTextBoxRunExporter InlineTextBoxRunExporter PushHashtableToExporter TabInfoExporter LangInfoExporter ShadingInfoExporter ParagraphFormattingInfoExporter CharacterFormattingInfoExporter DrawingColorModelInfoExporter ColumnInfoExporter BorderInfoExporter AnchorInfoExporter CompositeFontInfoExporter HeaderExporter FooterExporter ScRGBColorExporter DrawingColorExporter HeaderFooterStringResourcesExporter TabPropertiesExporter TablePropertiesExporter ListLevelPropertiesExporter TableCellPropertiesExporter SectionPropertiesExporter ProtectionPropertiesExporter DocumentPropertiesExporter TableRowPropertiesExporter AnchorTextBoxPropertiesExporter TableBaseConditionalStylesExporter CompatibilitySettingsExporter ParagraphsExporter TableCellMarginsExporter ControlOptionsExporter AuthenticationOptionsExporter SpellCheckerOptionsExporter RichEditBehaviorOptionsExporter DocumentCapabilitiesOptionsExporter ExportOptionsExporter charPropsExporter parPropsExporter TableBordersExporter TableCellBordersExporter PalleteCollorsExporter GetExporter getExporter WidthUnitExporter HeightUnitExporter DocumentExporter AbstractNumberingListExporter TableRowExporter Register ForceSyncWithServer InsertContentFromServer SaveToServer CreateInnerServer get_DocumentServer ASPxInternalRichEditDocumentServer ASPxInnerRichEditDocumentServer ToLower CreateResXLocalizer OfficeLocalizer ASPxperienceLocalizer ASPxRichEditResourcesLocalizer RichEditExtensionsLocalizer XtraRichEditLocalizer ASPxRichEditLocalizer DictionarySerializer get_Anchor set_Anchor LayoutOptions_LockAnchor get_VerticalAnchor set_VerticalAnchor get_HorizontalAnchor set_HorizontalAnchor get_Behavior behavior ScRGBColor DXColor get_Color set_Color set_AutomaticColor get_DefaultAutomaticColor GetTableCellChangeTypeForegroundColor SetTableCellPropertiesOptionUseForegroundColor SetCellForegroundColor GetTableCellChangeTypeBackgroundColor SetTableCellPropertiesOptionUseBackgroundColor SetCellBackgroundColor mediumBackgroundColor GetBackgroundColor backgroundColor ChangePageColor get_SchemeColor UnderlineColor get_OutlineColor set_OutlineColor ChangeFloatingObjectOutlineColor outlineColor charForeColor GetForeColor SetForeColor ChangeFontForeColor enumValueColor ShouldSerializeColor DrawingColor get_BackColor get_PageBackColor set_PageBackColor ChangeParagraphBackColor paragraphBackColor GetBackColor ChangeFontBackColor darkColor get_FinalColor CalculateActualColor RERChangeFloatingObjectFillColor fillColor get_SystemColor SetBorderInfoColor mediumBorderColor GetBorderColor SetBorderColor get_BracketsColor set_BracketsColor get_HighlightBracketsColor set_HighlightBracketsColor defaultHighlightBracketsColor GetColor ResetColor get_HighlightColor set_HighlightColor defaultHighlightColor get_DefaultColor defaultColor convertToClientColor IsTransparentColor FontColor StrikeoutColor TextColor SetBorderInfoEmptyColor color ModelIsChangedError ClipboardAccessDeniedError SessionHasExpiredError RequiredFieldError OpeningAndOverstoreImpossibleError LoadPictureError JSONResponseError responseError ImageFileSizeError ChangeSpellingError IgnoreSpellingError CantSaveToEmptyPathError InternalError set_SetFocusOnError DocVariableExceptionError InsertContentFromServerExceptionError AuthExceptionsError InnerExceptionsError InvalidDocumentFormatError CantSaveDocumentError CantOpenDocumentError DocumentModelAccessor DrawingObjectPropertiesAccessor RibbonObjectCreator ColorTranslator ParagraphFormattingChangeActionsCalculator CharacterFormattingChangeActionsCalculator TableCellChangeActionsCalculator TableFloatingPositionChangeActionsCalculator BorderChangeActionsCalculator TableGeneralSettingsChangeActionsCalculator TableRowChangeActionsCalculator TextRunDeterminator get_Separator set_Separator IEnumerator paragraphsEnumerator chunksEnumerator sectionsEnumerator runsEnumerator System.Collections.Generic.IEnumerable<T>.GetEnumerator System.Collections.IEnumerable.GetEnumerator IDictionaryEnumerator MainIterator runIterator RunsIterator Activator .ctor get_MinZoomFactor set_MinZoomFactor get_DefaultMinZoomFactor get_MaxZoomFactor set_MaxZoomFactor get_DefaultMaxZoomFactor .cctor get_SettingsDocumentSelector settingsDocumentSelector ChunkCollector get_UnsafeEditor CreateEditor UnsafeDocumentModelEditor Monitor GetFontDescriptor HtmlConvertor UploadControlUrlParametr SaveFileAs get_SaveAs set_SaveAs FileSaveAs get_Tabs clearExistingTabs get_ParagraphTabs set_ParagraphTabs get_RibbonTabs CreateRibbonTabs get_DefaultRibbonTabs CreateDefaultRibbonTabs defaultRibbonTabs ribbonTabs jsonTabs SetOwnTabs GetTabs SetTabs get_ShowTabs set_ShowTabs tabs Graphics System.Diagnostics get_LoadedPieceTableIds set_LoadedPieceTableIds loadedPieceTableIds CmpIds DevExpress.XtraRichEdit.Fields InsertMergeField_Fields get_Fields set_Fields add_CustomizeMergeFields remove_CustomizeMergeFields RaiseCustomizeMergeFields set_UpdateFields ToggleAllFields MenuCmd_UpdateAllFields ClearControlFields GroupInsertFields fields ExecuteCommands ApplyRequestCommands commands styleImageBounds imageBounds get_ClipBounds get_IgnoreRepeatedWords set_IgnoreRepeatedWords get_IgnoreMixedCaseWords set_IgnoreMixedCaseWords get_IgnoreUpperCaseWords set_IgnoreUpperCaseWords FinishMerge_AllRecords set_DecimalPlaces HasWhitespaces ResetCachedIndices DevExpress.Office.Services DevExpress.XtraRichEdit.Services System.Runtime.InteropServices System.Runtime.CompilerServices PageReferences System.Resources StringResources DevExpress.Web.ASPxRichEdit.LocalizationRes.resources DevExpress.Web.ASPxRichEdit.Descriptions.resources LayoutOptions_BothSides ToggleFieldCodes ToggleAllFieldCodes ShowAllFieldCodes DebuggingModes get_TabPages OddEvenPages get_DifferentOddAndEvenPages set_DifferentOddAndEvenPages ChangeDifferentOddAndEvenPages ToggleDifferentOddAndEvenPages GroupPages DevExpress.Web.Internal.Dialogs.IFileManager.get_Images set_EmbedImages CreateImages CreateRibbonImages RichEditRibbonImages get_IconImages CreateIconImages RichEditIconImages iconImages FileManagerImages CreateRulerImages RichEditRulerImages RichEditImages get_ConfirmOnLosingChanges set_ConfirmOnLosingChanges get_ShowConfirmOnLosingChanges set_ShowConfirmOnLosingChanges get_WebCaches set_WebCaches webCaches getAllCaches FindReplace_NoMatches CreateDocumentFormatsDependecies RichEditDocumentFormatsDependecies get_DocumentFormatsDependencies dependencies get_Dictionaries DictionaryOfCustomDictionaries RichEditSpellCheckerCustomDictionaries dictionaries get_ContextTabCategories get_RibbonContextTabCategories get_DefaultRibbonContextTabCategories CreateDefaultRibbonContextTabCategories ribbonContextTabCategories clearExistingCategories defaultContextCategories contextCategories categories WorkSessionFactories get_DocumentCapabilities documentCapabilities get_JSProperties add_CustomJSProperties remove_CustomJSProperties get_Properties set_Properties TabProperties tabProperties SetBasicProperties GetDefaultLoadingImageProperties GetLoadingPanelImageProperties RibbonItemImageProperties GetRibbonImageProperties CheckedButtonImageProperties GetImageProperties imageProperties get_TableProperties get_DefaultTableProperties get_ConditionalStyleProperties TableConditionalStyleProperties get_GraphicFrameProperties NonVisualGraphicFrameProperties get_ShapeProperties get_DrawingShapeProperties NonVisualDrawingShapeProperties get_SpriteProperties ImageSpriteProperties ApplyParagraphNumberingProperties get_ParagraphProperties ChangeParagraphProperties ChangeListLevelParagraphProperties ApplyHashtableToParagraphProperties get_DefaultParagraphProperties ModifyParagraphProperties ApplyParagraphProperties get_ListLevelProperties ChangeListLevelProperties ModifyListLevelProperties get_TableCellProperties GetTableCellProperties get_DefaultTableCellProperties SymbolProperties ChangeSectionProperties ApplySectionProperties get_ProtectionProperties DocumentProtectionProperties ApplyRunProperties SetAnchorInfoProperties get_ContainerProperties DrawingObjectContainerProperties get_CharacterProperties MergedCharacterProperties ChangeCharacterProperties ChangeListLevelCharacterProperties ApplyHashtableToCharacterProperties get_DefaultCharacterProperties GetMergedWithDefaultCharacterProperties ModifyCharacterProperties characterProperties EventCustomJsProperties TabsProperties SymbolsProperties ChangeInlineObjectProperties AppendRibbonToCreateClientObjectProperties GetCreateClientObjectProperties RibbonSpinEditProperties DocumentProperties get_TableRowProperties get_DefaultTableRowProperties RibbonComboBoxProperties JSONTextBoxProperties ChangeTextBoxProperties Hyperlink_DisplayProperties get_BodyProperties DrawingTextBodyProperties RibbonDropDownGalleryProperties properties Scales ContextItem_Tables get_Tables set_Tables get_CountIdForPeaceTables AddPieceTables AdditionalPieceTables additionalPieceTables allPieceTables jsonPieceTables GetPieceTables AddEmptyPieceTables pieceTables FinishMerge_JoinTables GroupTables get_Variables ImportPiecetables GetDialogTitles GetRulerTitles DevExpress.Web.Internal.Dialogs.IFileManager.get_Styles get_TableStyles PopulateTableStyles existingTableStyles GroupTableToolsDesignTableStyles get_PresetTableStyles presetTableStyles GroupFloatingPictureToolsShapeStyles GroupFloatingObjectsShapeStyles ReviseStyles CreateStyles get_ParagraphStyles PopulateParagraphStyles existingParagraphStyles get_PresetParagraphStyles presetParagraphStyles originalStyles ConditionalStyles ButtonControlStyles PopupControlStyles RichEditDialogFormStyles RichEditRibbonStyles jsonStyles RichEditButtonStyles GroupStyles RichEditStatusBarStyles RichEditFileManagerStyles CreateRulerStyles GetRulerStyles RichEditRulerStyles get_CharacterStyles PopulateCharacterStyles existingCharacterStyles get_PresetCharacterStyles presetCharacterStyles EditorStyles RichEditEditorsStyles ToHashtablePresetStyles PopulatePresetStyles RichEditStyles set_ParentStyles get_NumberingListStyles RichEditMenuStyles styles get_MergeFieldNames set_MergeFieldNames GetMergeFieldNames SpriteImageResourceNames SpriteCssResourceNames get_CaseSensitiveNames set_CaseSensitiveNames get_CbBookmarkNames set_CbBookmarkNames get_MergeFieldsNames GetLocalizedPresetStylesNames GetNames AddEventNames names get_ParagraphFrames set_ParagraphFrames AllowedURISchemes ToggleShowTableGridLines spacing_1_5_lines get_InlineShapes set_InlineShapes get_StyleTypes ConditionalTableStyleFormattingTypes TableLookTypes RegisterKnownTypes VerticalAnchorTypes HorizontalAnchorTypes set_AvailableItemsFeatures get_InlinePictures set_InlinePictures LoadInlinePictures UpdateInlinePictures GetCorrespondenceTableForPictures get_NumberingListTemplates set_NumberingListTemplates AbstractNumberingListTemplates get_EndNotes set_EndNotes get_FootNotes set_FootNotes get_Attributes GetStyleAttributes AssignAttributes GetImageBytes get_FileBytes HtBytes GetBytes contentAccessorByBytes get_Values get_ComplexUseValues set_ComplexUseValues useValues SchemeColorValues SystemColorValues GetValues values GetChildFieldIndexes GetSeqCaptionPrefixes comboBoxes get_KeepDefaultSizes GetPredefinedFontSizes ImageFlags MenuSamplesFlags get_FormatFlags set_FormatFlags StringFormatFlags GroupTableToolsDesignBordersAndShadings get_Paddings ASPxRichEditSimpleViewPaddings paddings PageMailings DevExpress.Web.Internal.Dialogs.IFileManager.get_Settings set_Settings get_UploadSettings CreateUploadSettings RichEditDocumentSelectorUploadSettings uploadSettings ASPxRichEditCharacterFormattingDetailedSettings RegisterChildSettings childSettings CreateDataSourceSettings azureSettings ASPxRichEditNumberingSettings get_EditingSettings CreateEditingSettings RichEditFileManagerEditingSettings editingSettings CreateSaveFileDialogSettings RichEditSaveFileDialogSettings CreateInsertPictureDialogSettings RichEditInsertPictureDialogSettings CreateInsertLinkDialogSettings RichEditInsertLinkDialogSettings RichEditDialogSettings ASPxRichEditBookmarkSettings get_GeneralSettings TableGeneralSettings SectionGeneralSettings LayoutGroupItemSettings SyncWorkSessionSettings get_PermissionSettings ASPxRichEditRangePermissionSettings permissionSettings ASPxRichEditAuthenticationSettings authenticationSettings DevExpress.Web.Internal.Dialogs.IUploadControl.get_ValidationSettings CreateValidationSettings UploadControlValidationSettings SetupValidationSettings RichEditFileManagerValidationSettings validationSettings get_ReplaceInfoCollectionSettings ASPxRichEditAutoCorrectReplaceInfoCollectionSettings GetDocumentProtectionSettings get_CaptionSettings LayoutItemCaptionSettings get_CommonSettings CreateCommonSettings RichEditFileManagerCommonSettings RichEditDocumentSelectorCommonSettings ApplyCommonSettings commonSettings amazonSettings get_ToolbarSettings CreateToolbarSettings toolbarSettings CreateAzureProviderSettings FileManagerAzureProviderSettings CreateAmazonProviderSettings FileManagerAmazonProviderSettings CreateDropBoxProviderSettings FileManagerDropBoxProviderSettings FileManagerSettings ASPxRichEditSpellCheckerSettings spellCheckerSettings ASPxRichEditHorizontalRulerSettings ASPxRichEditBehaviorSettings CreateDocumentSelectorSettings RichEditDocumentSelectorSettings GetFieldsSettings ASPxRichEditFieldsSettings ASPxRichEditDocumentCapabilitiesSettings GetBookmarksSettings RulerSectionColumnsSettings CreatePermissionsSettings get_FoldersSettings CreateFoldersSettings RichEditFileManagerFoldersSettings foldersSettings GetViewsSettings ASPxRichEditViewsSettings ASPxRichEditAutoCorrectSettings SetSettings ASPxRichEditSettings AutoSaveDefaultSettings SetupDefaultSettings GetSpellCheckerClientSettings GetRulerClientSettings GetAutoCorrectClientSettings get_DocumentSettings ASPxRichEditExportSettings ASPxRichEditPlainTextExportSettings exportSettings get_FileListSettings CreateFileListSettings fileListSettings SetupDefaultListSettings ASPxRichEditSimpleViewSettings simpleViewSettings exSettings dropboxSettings get_CompatibilitySettings PopupControlAdaptivitySettings FormLayoutAdaptivitySettings settings DevExpress.Web.Internal.Dialogs CreateDialogs get_SettingsDialogs settingsDialogs get_CallbackArgs set_CallbackArgs callbackArgs RichEditCommandDiagnosticEventArgs FileManagerFileUploadEventArgs WordAddedEventArgs RepeatedWordFoundEventArgs NotInDictionaryWordFoundEventArgs CalculateDocumentVariableEventArgs FileManagerItemRenameEventArgs FileManagerFolderCreateEventArgs FileManagerItemDeleteEventArgs FileUploadCompleteEventArgs FileManagerItemMoveEventArgs DocumentSavingEventArgs RichEditInvalidFormatExceptionEventArgs CustomizeMergeFieldsEventArgs InsertContentToClientEventArgs FileManagerCloudProviderRequestEventArgs FileManagerItemCopyEventArgs args get_Paragraphs set_Paragraphs MergeParagraphs DeleteParagraphs DeleteNumerationFromParagraphs jsonParagraphs InsertNumerationToParagraphs <>4__this DevExpress.Web.ASPxRichEdit.Scripts.compiled.js DevExpress.Web.ASPxRichEdit.Scripts.UI.UploadControl.js DevExpress.Web.ASPxRichEdit.Scripts.UI.FileManagerUploadControl.js DevExpress.Web.ASPxRichEdit.Scripts.Localization.js DevExpress.Web.ASPxRichEdit.Scripts.UI.FileManager.js DevExpress.Web.ASPxRichEdit.Scripts.UI.FolderManager.js DevExpress.Web.ASPxRichEdit.Scripts.RichEditCustomResources.js DevExpress.Web.ASPxRichEdit.Scripts.UI.Dialogs.js DevExpress.Web.ASPxRichEdit.Scripts.clientBaseScripts.js DevExpress.Web.ASPxRichEdit.Scripts.RichEdit.js get_Locks RegisterScriptBlocks RegisterLocalizationResourcesAsScriptBlocks RegisterCustomWebResourceHandlersAsScriptBlocks GroupLinks get_Hyperlinks set_Hyperlinks RemoveHyperlinks get_Chunks set_Chunks jsonChunks get_Bookmarks set_Bookmarks DeleteBookmarks get_DisplayUnreferencedPdfBookmarks set_DisplayUnreferencedPdfBookmarks GetBookmarks bookmarks get_CorrectTwoInitialCapitals set_CorrectTwoInitialCapitals Equals CheckedIntervals GetQuickSearchPanelLabels GetCommonLabels GetDialogOtherLabels GetChildDxRichEditPanels get_Levels getLevels get_IgnoreEmails set_IgnoreEmails DevExpress.Office.Utils DevExpress.Utils DevExpress.XtraRichEdit.Utils DataUtils FileUtils LicenseUtils ViewStateUtils IDialogUtils get_DialogUtils CreateDialogUtils DevExpress.Web.FormLayout.Internal.RuntimeHelpers.IDialogUtilsOwner.GetDialogUtils RichEditDialogUtils dialogUtils MathUtils UrlUtils CommonUtils HttpUtils RenderUtils ScalableObjectUtils AccessibilityUtils get_Cells SplitCells_MergeCells MergeTableCells SplitTableCells InsertTableCells nls GroupSymbols RichEditDiagnosticTools DevExpress.Utils.Controls get_Controls System.Web.UI.WebControls PrepareChildControls EnsureChildControls CreateChildControls PopulateBottomItemControls relatedInnerControls controls get_DetectUrls set_DetectUrls ServerParams GetInitParams FindReplace_Items get_Items InitNumberStyleItems CreateSpellingItems InitLevelItems FillItems GetCustomItems InitFollowNumberItems get_SettingsItems InitNumberFormatItems GetItems get_DefaultItems CreateDefaultItems CreateTouchMenuItems CreateDesktopMenuItems GetSpellingPopupMenuItems GetPopupMenuItems items Algorithms System.Windows.Forms DevExpress.Web.ASPxRichEdit.Forms Tabs_Hyphens Contains get_Margins SetWideSectionPageMargins SetModerateSectionPageMargins SetNormalSectionPageMargins SetSectionPageMargins SetNarrowSectionPageMargins CellOptions_CellMargins get_CellMargins TableOptions_DefaultCellMargins cellMargins SectionMargins JSONTextBoxContentMargins get_Columns GroupTableToolsLayoutRowsAndColumns SetSectionThreeColumns DeleteTableColumns InsertTable_NumberOfColumns Columns_NumberOfColumns get_EqualWidthColumns set_EqualWidthColumns SectionColumns SetSectionTwoColumns set_RepeatColumns GetColumns SetColumns LeftColumns RightColumns get_ShowLockedFolderIcons set_ShowLockedFolderIcons GetDefaultShowLockedFolderIcons DefaultAllowedExtensions get_AllowedFileExtensions set_AllowedFileExtensions ShouldSerializeAllowedFileExtensions ResetAllowedFileExtensions GetDefaultAllowedFileExtensions EnvironmentExtensions WorkSessions System.Text.RegularExpressions get_RangePermissions rangePermissions DevExpress.Web.Internal.Dialogs.IFileManager.get_SettingsPermissions FileManagerSettingsPermissions GetUnitAbbreviations GroupIllustrations CalculateChangeActions DocumentModelChangeActions get_Sections set_Sections SelectedSections MergeSections DeleteSections ShowAllSections jsonSections System.Collections InsertImage_UploadInstructions JSONOptions TableProperties_Options get_Options CreateCharacterFormattingDetailedOptions FieldOptions CreateMailMergeOptions RichEditMailMergeOptions mailMergeOptions GroupTableToolsDesignTableStyleOptions BaseOptions get_DocumentSaveOptions CreateNumberingOptions PrintingOptions ParagraphFormattingOptions CharacterFormattingOptions BookmarkOptions GroupHeaderFooterToolsDesignOptions RangePermissionOptions AuthenticationOptions SpellCheckerOptions HorizontalRulerOptions HtmlDocumentExporterOptions PlainTextDocumentExporterOptions get_BehaviorOptions set_BehaviorOptions RichEditBehaviorOptions DocumentCapabilitiesOptions TablePropertiesOptions TableCellPropertiesOptions TableRowPropertiesOptions AutoCorrectOptions StringSplitOptions GetMailMergeClientOptions PdfExportOptions pdfExportOptions RichEditDocumentExportOptions FloatingObjectLayoutOptions GroupCaptions throwExceptions options Spelling_Suggestions get_Suggestions Spelling_NoSpellingSuggestions get_UseSpellCheckerSuggestions set_UseSpellCheckerSuggestions get_Buttons GetChildDxButtons get_Runs DeleteRuns get_WinToAspRuns set_WinToAspRuns runs paragraphEndPos sectionEndPos currRunAbsolutePos get_LogPos runLogPos currChunkPos currRelativeRunPos SeparatorPos get_CurrPos paragraphStartPos sectionStartPos startPos get_HyperlinkInfos pos get_AllCaps set_AllCaps get_SizeInTwips tabProps jsonDocProps objProps tblProps tblCellProps charProps parProps tblRowProps props Tabs_DefaultTabStops get_Groups get_Chars set_EnableTruncatedUnicodeNumbers get_SuppressLineNumbers set_SuppressLineNumbers get_IgnoreWordsWithNumbers set_IgnoreWordsWithNumbers get_Headers SectionHeaders jsonHeaders GetHeaders headers DevExpress.Web.Internal.Dialogs.IFileManager.get_SettingsFolders FileManagerSettingsFolders BorderShading_Borders get_Borders ToggleTableCellInsideBorders ToggleTableCellOutsideBorders DrawTableBorders get_AvoidDoubleBorders set_AvoidDoubleBorders set_UseAvoidDoubleBorders ToggleTableCellInsideVerticalBorders ToggleTableCellInsideHorizontalBorders ToggleTableCellAllBorders DrawTableCellBorders borders CreateModifiers modifiers DevExpress.Web.Internal.ICustomWebResourceHandlerProvider.RegisterCustomWebResourceHandlers handlers DevExpress.Data.Helpers DevExpress.Web.FormLayout.Internal.RuntimeHelpers get_Parameters set_Parameters JSONEnumLoadPieceTableCommandParameters commandParameters LoadPieceTableParameters JSONUpdateFieldCommandDocVariableParameters get_ServerParameters set_ServerParameters parameters get_Footers HeadersAndFooters SectionFooters ContextItem_HeadersFooters get_HeadersFooters set_HeadersFooters GetFooters footers DevExpress.Office.NumberConverters get_Colors OfficeThemeColors PaletteColors set_EnableCustomColors ChangeAllSpellingErrors IgnoreAllSpellingErrors NoErrors CreateEditors get_StylesEditors stylesEditors get_CssClass set_CssClass SetLayoutItemCssClass buttonCssClass memoCssClass SetLayoutGroupCssClass get_DefaultCssClass MainElementCssClass listBoxCssClass DevExpress.Web.ASPxRichEdit.Css.SVGSprite.css DevExpress.Web.ASPxRichEdit.Css.WTSVGSprite.css DevExpress.Web.ASPxRichEdit.Css.ISprite.css DevExpress.Web.ASPxRichEdit.Css.GISprite.css DevExpress.Web.ASPxRichEdit.Css.GWTISprite.css DevExpress.Web.ASPxRichEdit.Css.GWISprite.css DevExpress.Web.ASPxRichEdit.Css.sprite.css DevExpress.Web.ASPxRichEdit.Css.System.css DevExpress.Web.ASPxRichEdit.Css.Default.css ToolboxBitmapAccess CheckWorkDirectoryAccess Hyperlink_EmailAddress SaveInProgress Effects GetMergedStateManagedObjects GetStateManagedObjects GetStateObjects ContextItem_FloatingObjects get_FloatingObjects set_FloatingObjects PageFloatingObjects jsonObjects AttributeTargets set_AddRoundBrackets ListBullets Columns_Presets CreatePresets PopulatePresets presets FileSystemRights GetChildDxEdits CalculateImageSizeInModelUnits TwipsToModelUnits PointsToModelUnits FindReplace_Results ShowAllFieldResults HideFindResults CommandsResults results RulerParagraphLeftIndents get_Clients set_Clients get_Comments set_Comments SubDocuments UpdateTableOfContents GroupTableOfContents TableAutoFitContents SetAutoFitContents get_Events DevExpress.Web.Internal.Dialogs.IControl<DevExpress.Web.UploadControlClientSideEvents>.get_ClientSideEvents DevExpress.Web.Internal.Dialogs.IControl<DevExpress.Web.FileManagerClientSideEvents>.get_ClientSideEvents CreateClientSideEvents UploadControlClientSideEvents FileManagerClientSideEvents RichEditClientSideEvents MenuClientSideEvents forceIncludeAllFonts DefaultFonts Tabs_Dots Tabs_MiddleDots RegisterIncludeScripts RegisterOfficeUtilsScripts RegisterDialogUtilsScripts HasFunctionalityScripts get_NumberingLists jsonNumberingLists get_AbstractNumberingLists jsonAbstractNumberingLists addDefaultLists get_DocumentControlExists GetAlertDialogTexts get_GotFocus set_GotFocus get_LostFocus set_LostFocus set_CornerRadius FindReplace_Previous LinkHeaderFooterToPrevious SameAsPrevious Continuous get_Views GroupDocumentViews views get_Rows ToggleBandedRows DeleteTableRows InsertTable_NumberOfRows get_Keys get_AllKeys Numbering_AlignedAt RemoveAt Numbering_IndentAt ElementAt Numbering_StartAt Concat get_What set_What what get_Format set_Format OfficeImageFormat CreateFormat GetSupportNumberingFormat StringFormat Numbering_NumberFormat DetectFormat get_DefaultFormat get_DocumentFormat ShowErrorInvalidDocumentFormat ParseDocumentFormat CalculateDocumentFormat FileExtensionToDocumentFormat AutodetectDocumentFormat GetDocumentFormat DocumentFormatToXtraRichEditDocumentFormat documentFormat get_CurrentFormat set_CurrentFormat get_RawFormat format HtFloat get_IsAbstract set_IsAbstract isAbstract TObject GetMailMergeDataObject get_CurrentDataObject set_CurrentDataObject IRectangularScalableObject CreateClientStyleObject CreateObject stateObject GetRulerSpiteObject IDrawingObject get_DrawingObject SetDrawingObject IWebControlObject GetScriptObject object Hyperlink_Subject get_EnableMultiSelect PerformSelect get_NoChangeAspect set_NoChangeAspect get_AutoCorrect set_AutoCorrect autoCorrect Intersect DetectMultiUserDeletingConflict DetectMultiUserSavingConflict get_MultiUserConflict multiUserConflict Get System.Net Tabs_Set get_CanBeSet set_CanBeSet canBeSet get_IconSet set_IconSet get_MenuIconSet set_MenuIconSet iconSet GetFontCharacterSet set_Target target System.Collections.IEnumerator.Reset LayoutOptions_Reset get_Preset GetSubscriptYOffset get_Offset set_Offset get_VerticalOffset set_VerticalOffset get_PercentVerticalOffset set_PercentVerticalOffset get_HorizontalOffset set_HorizontalOffset get_PercentHorizontalOffset set_PercentHorizontalOffset get_RunOffset currRunOffset MenuCmd_HeaderOffset get_HeaderOffset set_HeaderOffset ChangeHeaderOffset MenuCmd_FooterOffset get_FooterOffset set_FooterOffset ChangeFooterOffset SubScriptOffset offset get_Inset DrawingTextInset Numbering_Left Tabs_Left get_Left set_Left InsertTableColumnToTheLeft InsertTableColumnsToTheLeft InsertTableCellWithShiftToTheLeft TableCellAlignMiddleLeft set_PaddingLeft TableCellAlignBottomLeft RulerSectionMarginLeft get_RightToLeft set_RightToLeft TableCellAlignTopLeft BorderLeft DeleteCells_ShiftCellsLeft TableProperties_IndentLeft ToggleParagraphAlignmentLeft Mht Numbering_Right Tabs_Right get_Right set_Right InsertTableColumnToTheRight InsertTableColumnsToTheRight TableCellAlignMiddleRight TableCellAlignBottomRight RulerSectionMarginRight TableCellAlignTopRight BorderRight InsertCells_ShiftCellsRight ToggleParagraphAlignmentRight TextWrapTight get_Height set_Height PageHeight set_ImageHeight get_DefaultImageHeight ScaleHeight OriginalHeight cellHeight GetEmHeight PresetTableStyleItemHeight PresetStyleItemHeight GetHeight set_ExtentHeight TableProperties_RowHeight RulerChangeTableRowHeight TableProperties_SpecifyHeight height Upright get_AutoFit set_AutoFit IDrawingTextAutoFit Portrait op_Implicit ASPxTimeEdit ASPxDateEdit get_RichEdit set_RichEdit DevExpress.XtraRichEdit PrepareRichEdit FindParentRichEdit DevExpress.Web.ASPxRichEdit richEdit CreateSpinEdit get_VerticalRelativeSpinEdit set_VerticalRelativeSpinEdit get_HorizontalRelativeSpinEdit set_HorizontalRelativeSpinEdit get_PropertiesSpinEdit ASPxSpinEdit spinEdit CreateButtonEdit get_SearchButtonEdit set_SearchButtonEdit ASPxButtonEdit ASPxDropDownEdit PrepareColorEdit get_FillColorEdit set_FillColorEdit get_UnderlinColorEdit set_UnderlinColorEdit get_BorderColorEdit set_BorderColorEdit get_FontColorEdit set_FontColorEdit ASPxColorEdit colorEdit ASPxListEdit ASPxTextEdit ASPxEdit richedit TableProperties_CantSplit get_CantSplit set_CantSplit set_UseCantSplit EndInit DevExpress.Web.Internal.IDialogFormElementRequiresLoad.ForceInit OnInit BeginInit get_Unit set_Unit WidthUnit GraphicsUnit HeightUnit RichEditUnit FontUnit Exit get_Default includeDefault GetValueOrDefault FirstOrDefault get_IsDefault get_Result set_Result IAsyncResult JSONUpdateFieldCommandResult IsNeedToAddCallbackCommandResult commandResult set_ResponseResult GetResponseResult saveResult FindReplace_TooLongResult GetInsertImageFromUrlCallbackResult InsertImageFromCallbackResult GetCustomCallbackResult GetFileManagerCallbackResult DevExpress.Web.ASPxRichEdit.Internal.IRichEditFileManager.GetCallbackResult FindReplace_NoResult GetControlRenderResult GetDialogFormRenderResult GetColumnsEditorRenderResult GetRenderResult serverParamsResult GetResult get_result set_result BoolToInt set_AccessibilityCompliant GetCellAscent GetCellDescent get_TableIndent get_FirstLineIndent set_FirstLineIndent ParagraphFirstLineIndent DecreaseIndent IncreaseIndent DecrementNumberingIndent IncrementNumberingIndent get_LeftIndent set_LeftIndent DecrementParagraphLeftIndent IncrementParagraphLeftIndent get_OriginalLeftIndent set_OriginalLeftIndent get_ShowLeftIndent set_ShowLeftIndent get_RightIndent set_RightIndent RulerParagraphRightIndent get_ShowRightIndent set_ShowRightIndent get_LegacyIndent set_LegacyIndent get_Client DetachClient AttachClient AssignReadOnlyToWorkSessionClient add_InsertContentToClient remove_InsertContentToClient RaiseInsertContentToClient HasClient GetClient exClient client element op_Decrement op_Increment set_Increment set_AsAttachment IsAsAttachment GroupDocumentComment Tabs_Alignment TableProperties_Alignment LayoutOptions_Alignment get_Alignment set_Alignment get_TableAlignment set_TableAlignment set_UseTableAlignment ParagraphAlignment TableProperties_VerticalAlignment get_VerticalAlignment set_VerticalAlignment set_UseVerticalAlignment get_VerticalPositionAlignment set_VerticalPositionAlignment DrawingObjectVerticalPositionAlignment get_HorizontalPositionAlignment set_HorizontalPositionAlignment DrawingObjectHorizontalPositionAlignment ListNumberAlignment SetFloatingObjectMiddleCenterAlignment SetFloatingObjectBottomCenterAlignment SetFloatingObjectTopCenterAlignment SetFloatingObjectMiddleLeftAlignment SetFloatingObjectBottomLeftAlignment SetFloatingObjectTopLeftAlignment SetFloatingObjectMiddleRightAlignment SetFloatingObjectBottomRightAlignment SetFloatingObjectTopRightAlignment GroupTableToolsLayoutAlignment get_TableRowAlignment set_TableRowAlignment set_UseTableRowAlignment IsAzureEnvironment get_Document NativeSubDocument ChangeActiveSubDocumentToHeaderFooterBySubDocument LoadDocument ReloadDocument DownloadMergedDocument SaveMergedDocument InvalidDocument FindDocument WholeDocument CantSaveDocument NativeDocument SwitchDocument originalDocument fromDocument CantOpenDocument pathToDocument SaveAsDocument Hyperlink_PlaceInThisDocument DownloadCurrentDocument PrintCurrentDocument ExportDocument CreateNewDocument get_IsNewDocument document GetInternalCallbackArgument GetCallbackArgument eventArgument Component get_Parent set_Parent get_Transparent System.Collections.Generic.IEnumerator<T>.Current System.Collections.IEnumerator.Current System.Collections.Generic.IEnumerator<T>.get_Current System.Collections.IEnumerator.get_Current <>2__current System.Collections.Concurrent get_Content set_Content loadWholeContent DeleteContent DragMoveContent PanelContent FillRibbonItemContent DragCopyContent SubscribeCalculateDocumentVariableEvent RaiseCallbackEvent FontTypeHint set_TextRenderingHint get_Tint set_Tint Point DelayedPrint FilePrint get_UpdateFieldsBeforePrint set_UpdateFieldsBeforePrint set_UpdateDocVariablesBeforePrint set_EnablePageBackgroundOnPrint Numbering_Font get_Font get_EastAsiaThemeFont set_EastAsiaThemeFont eastAsiaThemeFont get_AsciiThemeFont set_AsciiThemeFont asciiThemeFont get_HightAnsiThemeFont set_HightAnsiThemeFont hightAnsiThemeFont get_ComplexScriptThemeFont set_ComplexScriptThemeFont complexScriptThemeFont GroupFont get_HintFont set_HintFont hintFont FloatingObjectBringToFront FinishMerge_Count get_Count get_MailMergeRecordCount set_MailMergeRecordCount GetRecordCount recordCount raiseSavingCallLockCount cellCount get_ColCount set_ColCount get_ColumnCount set_ColumnCount set_MinColumnCount get_DefaultDropDownGalleryMinColumnCount SetSectionColumnCount set_MaxColumnCount get_HashIterationCount set_HashIterationCount get_SuggestionCount set_SuggestionCount defaultItemsCount get_ColumnsCount get_DefaultMinColumnsCount get_CurrentColumnsCount get_DefaultMaxColumnsCount columnsCount get_DefaultDropDownRowsCount set_RowCount rowCount count get_Script set_Script RegisterIncludeScript CharacterFormattingScript RegisterDateFormatterScript RegisterFormatterScript CharacterFormattingScript_Subscript ToggleFontSubscript CharacterFormattingScript_Superscript ToggleFontSuperscript opt get_Start set_Start get_OverrideStart SetOverrideStart ExtendLineStart IsParagraphStart isChunkStart IntervalStart SectionStart ErrorStart ExtendDocumentStart get_NewStart set_NewStart get_start set_start get_SuppressRestart set_SuppressRestart PageInsert Convert Sort DevExpress.Web.ASPxRichEdit.Import set_KeyboardSupport DevExpress.XtraRichEdit.Export DevExpress.Web.ASPxRichEdit.Export get_Export export Cast IsLast isLast AtLeast get_Request WebRequest LoadOnOneRequest LoadWorkSessionIdFromRequest GetValueFromRequest RestoreTextFromRequest HttpRequest DevExpress.Web.Internal.Dialogs.IFileManager.add_CloudProviderRequest DevExpress.Web.Internal.Dialogs.IFileManager.remove_CloudProviderRequest FileManager_CloudProviderRequest add_DocumentSelectorCloudProviderRequest remove_DocumentSelectorCloudProviderRequest RaiseDocumentSelectorCloudProviderRequest IList FromHashtableList ToHashtableList DevExpress.Web.Internal.Dialogs.IFileManager.get_SettingsFileList FileManagerSettingsFileList AddNumberingList DeleteNumberingList ContinueNumberingList NoNumberingList AddAbstractNumberingList DeleteAbstractNumberingList abstractNumberingList RestartNumberingList ApplyNumberingList numberingList IsInList GetInvocationList get_NavigationList set_NavigationList get_CellOperationList set_CellOperationList PopulateButtonList get_RadioButtonList set_RadioButtonList PrepareRadioButtonList get_OrientationRadioButtonList set_OrientationRadioButtonList get_SubscriptRadioButtonList set_SubscriptRadioButtonList get_StrikeoutRadioButtonList set_StrikeoutRadioButtonList ASPxRadioButtonList ConvertEnumerableToList PopulateImageInfoList PopulateStyleInfoList spellingErrorInfoList get_TabsLeaderList set_TabsLeaderList EventHandlerList ButtonsList infosList addDefaultsList PopulateEditList get_AlignmentList set_AlignmentList get_VerticalAlignmentList set_VerticalAlignmentList get_TabsAlignmentList set_TabsAlignmentList get_WrapTextList set_WrapTextList ASPxCheckBoxList get_SortByList set_SortByList FromArrayList ToArrayList list PathDoesNotExist ClientNoColorConst First get_Cut set_Cut set_KeyTipModeShortcut AssignShortcut ToggleFontStrikeout get_AutoSaveTimeout set_AutoSaveTimeout DefaultAutoSaveTimeout DevExpress.Office.Layout PagePageLayout get_TableLayout set_TableLayout PageTableLayout set_UseTableLayout get_WidthSpacingLayout set_WidthSpacingLayout LayoutOptions_BookLayout IFormLayout get_TableFormLayout set_TableFormLayout CreateTableFormLayout get_SizeFormLayout set_SizeFormLayout CreateSizeFormLayout get_SpacingFormLayout set_SpacingFormLayout get_LineSpacingFormLayout set_LineSpacingFormLayout get_TextWrappingFormLayout set_TextWrappingFormLayout CreateTextWrappingFormLayout RichEditDialogFormLayout get_IndentationSprecialFormLayout set_IndentationSprecialFormLayout get_CellFormLayout set_CellFormLayout CreateCellFormLayout get_MainFormLayout set_MainFormLayout get_ColumnFormLayout set_ColumnFormLayout CreateColumnFormLayout get_PaginationFormLayout set_PaginationFormLayout CreatePaginationFormLayout get_IndentationFormLayout set_IndentationFormLayout get_PositionFormLayout set_PositionFormLayout CreatePositionFormLayout get_PaperFormLayout set_PaperFormLayout CreatePaperFormLayout get_MarginsFormLayout set_MarginsFormLayout CreateMarginsFormLayout get_OptionsFormLayout set_OptionsFormLayout get_MainOptionsFormLayout set_MainOptionsFormLayout get_IndentsFormLayout set_IndentsFormLayout CreateIndentsFormLayout get_ContentFormLayout set_ContentFormLayout get_LayoutFormLayout set_LayoutFormLayout CreateLayoutFormLayout get_PreviewFormLayout set_PreviewFormLayout CreatePreviewFormLayout get_RowFormLayout set_RowFormLayout CreateRowFormLayout formLayout set_RepeatLayout get_OffsetLayout set_OffsetLayout get_ContentLayout set_ContentLayout PrintLayout layout IPopupMenuExt ASPxPopupMenuExt FindReplace_Next get_Next ReplaceNext MoveNext get_KeepWithNext set_KeepWithNext GetPropertiesFromNext getPropertiesFromNext System.Drawing.Text System.Text Hyperlink_Text get_Text set_Text GetLocalizedText FloatingObjectSendBehindText AlertMessageText SimpleText PureText FloatingObjectBringInFrontOfText TextWrapInFrontOfText FloatingObjectBringToFrontOfText set_RtfText GetRtfText GetGraphicsForStyleWithText CheckText set_NullText LayoutOptions_DistanceFromText get_BottomFromText set_BottomFromText get_TopFromText set_TopFromText get_LeftFromText set_LeftFromText get_RightFromText set_RightFromText get_PlainText plainText CellOptions_WrapText LayoutOptions_WrapText PrepareWrapText GroupText set_HeaderText set_ErrorText Bookmarks_NameErrorText FileManager_OpenedFileRenameErrorText FileManager_OpenedFileDeleteErrorText FileManager_OpenedFileMoveErrorText get_PasteSingleCellAsText set_PasteSingleCellAsText get_cssText GetText get_UprightText set_UprightText get_FitText set_FitText set_UseFitText ResizeShapeToFitText DevExpress.Web.Internal.IRibbonInternalItem.DefaultText DevExpress.Web.Internal.IRibbonInternalItem.get_DefaultText get_DisplayBehindDocumentText set_DisplayBehindDocumentText CollectDocumentText InsertText get_ShowText BodyText BindingContext HttpContext get_PopupMenu set_PopupMenu CreatePopupMenu get_StylesPopupMenu stylesPopupMenu get_SettingsPopupMenu RibbonSettingsPopupMenu get_ShowPopupMenu set_ShowPopupMenu ASPxPopupMenu popupMenu CreateDiv kv FileNew get_CreateNew set_CreateNew PageView GroupMailMergeView DialogTableView InsertTableView get_SimpleView SwitchToSimpleView GroupView SwitchToPrintLayoutView PageReview InsertImage_ImagePreview TableProperties_Row get_Row ChangeTableRow CreateTableRow RemoveTableRow JSONEnumTableRow ExtendSelectTableRow InsertTableRow DeleteCells_DeleteEntireRow InsertCells_InsertEntireRow get_IndexInRow jsonRow CreateHeaderRow TableProperties_PreviousRow clientRow ToggleLastRow get_FirstRow ToggleFirstRow DecrementParagraphIndentFromFirstRow IncrementParagraphIndentFromFirstRow TableProperties_NextRow get_Shadow set_Shadow TableAutoFitWindow SetAutoFitWindow GroupShow LayoutOptions_Below InsertTableRowsBelow InsertTableRowBelow AutoScrollArrow MarginsNarrow Max TIndex get_Index set_Index get_ActiveTabIndex set_ActiveTabIndex set_SelectedIndex FindIndex get_MailMergeActiveRecordIndex set_MailMergeActiveRecordIndex GetActiveRecordIndex set_LastRecordIndex set_FirstRecordIndex ChangeActiveSubDocumentToHeaderFooterByPageIndex MaskedParagraphPropertiesCacheIndex MaskedCharacterPropertiesCacheIndex maskedCharacterPropertiesCacheIndex TableIndex get_StyleIndex set_StyleIndex get_ParagraphStyleIndex set_ParagraphStyleIndex paragraphStyleIndex get_CharacterStyleIndex set_CharacterStyleIndex characterStyleIndex CreateIndex createIndex get_ParagraphIndex set_ParagraphIndex get_EndParagraphIndex ChangeCellEndParagraphIndex FindParagraphIndex GetParagraphIndex get_StartParagraphIndex ChangeCellStartParagraphIndex get_LastParagraphIndex set_LastParagraphIndex get_FirstParagraphIndex set_FirstParagraphIndex paragraphIndex AlIndex get_ListLevelIndex set_ListLevelIndex SetNumberingListLevelIndex GetOwnListLevelIndex GetListLevelIndex SetListLevelIndex listLevelIndex get_CellIndex set_CellIndex cellIndex GetItemIndex get_SectionIndex set_SectionIndex FindSectionIndex sectionIndex get_RunIndex set_CodeEndRunIndex set_ResultEndRunIndex GetRunIndex set_CodeStartRunIndex get_LastRunIndex SetRelativeLastRunIndex get_FirstRunIndex SetRelativeFirstRunIndex FindFieldByRunIndex runIndex get_InfoIndex get_ShadingInfoIndex set_ShadingInfoIndex set_UseShadingInfoIndex SetShadingInfoIndex getShadingInfoIndex getColorModelInfoIndex FontInfoIndex ChangeHeaderIndex ChangeFooterIndex get_ColorIndex set_ColorIndex ThemeColorIndex get_UnderlineColorIndex set_UnderlineColorIndex SetUnderlineColorIndex get_ForeColorIndex set_ForeColorIndex SetForeColorIndex enumValueColorIndex get_BackColorIndex set_BackColorIndex SetColorIndex get_HighlightColorIndex set_HighlightColorIndex SetHighlightColorIndex get_StrikeoutColorIndex set_StrikeoutColorIndex SetStrikeoutColorIndex TextColorIndex MaskedParagraphPropertiesIndex maskedParagraphPropertiesIndex ListLevelPropertiesIndex TableCellPropertiesIndex CharacterPropertiesIndex TableRowPropertiesIndex SetHeaderFooterObjectsIndex GetObjectIndex SetObjectIndex NewObjectIndex GetIndex get_StartIndex set_StartIndex startIndex GetInsertIndex get_ListIndex set_ListIndex get_NumberingListIndex set_NumberingListIndex GetOwnNumberingListIndex get_AbstractNumberingListIndex SetNumberingListIndex listIndex newIndex get_RowIndex set_RowIndex rowIndex GetItemByIndex index Regex GetCssPostFix get_PasswordPrefix set_PasswordPrefix GetCssClassNamePrefix CommandCallbackPrefix InternalCallbackPrefix SaveImageToServerNewUrlCallbackPrefix PerformCallbackPrefix FileManagerCallbackPrefix SaveImageToServerCallbackPrefix SaveImageToServerErrorCallbackPrefix ColumnsEditorCallbackPrefix SymbolListCallbackPrefix callbackPrefix GetControlCssPrefix CssClassPrefix styleNamePostfix namePostfix InternalCallbackPostfix ClientGuidParamsPostfix InternalServiceCallbackParamsPostfix SyncCommandsParamsPostfix get_CssPostfix set_CssPostfix guidKeyPostfix GetShapeBox get_NoSpaceCheckBox set_NoSpaceCheckBox get_FirstPageCheckBox set_FirstPageCheckBox get_MergeCheckBox set_MergeCheckBox get_SameAsTableCheckBox set_SameAsTableCheckBox get_UnderlineCheckBox set_UnderlineCheckBox CreateCheckBox get_AutoResizeCheckBox set_AutoResizeCheckBox get_AllowSpacingCheckBox set_AllowSpacingCheckBox get_TablePrefWidthCheckBox set_TablePrefWidthCheckBox get_CellPrefWidthCheckBox set_CellPrefWidthCheckBox get_ColumnPrefWidthCheckBox set_ColumnPrefWidthCheckBox get_EqualWidthCheckBox set_EqualWidthCheckBox get_PageBreakCheckBox set_PageBreakCheckBox get_HiddenCheckBox set_HiddenCheckBox get_OddEvenCheckBox set_OddEvenCheckBox get_KeepLinesCheckBox set_KeepLinesCheckBox get_AllCapsCheckBox set_AllCapsCheckBox get_SpecifyHeightCheckBox set_SpecifyHeightCheckBox get_CantSplitCheckBox set_CantSplitCheckBox get_WrapTextCheckBox set_WrapTextCheckBox ASPxCheckBox get_MergeModeComboBox set_MergeModeComboBox PrepareMergeModeComboBox get_StyleComboBox set_StyleComboBox PrepareLineStyleComboBox get_UnderlineStyleComboBox set_UnderlineStyleComboBox get_NumberStyleComboBox set_NumberStyleComboBox get_FontStyleComboBox set_FontStyleComboBox get_FontNameComboBox set_FontNameComboBox get_OutlineComboBox set_OutlineComboBox get_FileTypeComboBox set_FileTypeComboBox get_DownloadFileTypeComboBox set_DownloadFileTypeComboBox CreateComboBox get_PaperSizeComboBox set_PaperSizeComboBox get_FontSizeComboBox set_FontSizeComboBox get_HorizontalToTheRightOfComboBox set_HorizontalToTheRightOfComboBox get_HorizontalBookLayoutOfComboBox set_HorizontalBookLayoutOfComboBox get_LineSpacingComboBox set_LineSpacingComboBox get_WidthComboBox set_WidthComboBox PrepareWidthComboBox get_FollowNumberWithComboBox set_FollowNumberWithComboBox get_SpecialComboBox set_SpecialComboBox get_TableMeasureInComboBox set_TableMeasureInComboBox get_CellMeasureInComboBox set_CellMeasureInComboBox get_ColumnMeasureInComboBox set_ColumnMeasureInComboBox get_SectionComboBox set_SectionComboBox get_NumberPositionComboBox set_NumberPositionComboBox get_WidthRelativToComboBox set_WidthRelativToComboBox get_VerticalRelativToComboBox set_VerticalRelativToComboBox get_HorizontalRelativToComboBox set_HorizontalRelativToComboBox get_VerticalRelPosRelativToComboBox set_VerticalRelPosRelativToComboBox get_HorizontalRelPosRelativToComboBox set_HorizontalRelPosRelativToComboBox get_HeightRelativToComboBox set_HeightRelativToComboBox get_ApplyToComboBox set_ApplyToComboBox get_PropertiesComboBox get_RowHeightComboBox set_RowHeightComboBox get_AlignmentComboBox set_AlignmentComboBox get_VerticalAlignmentComboBox set_VerticalAlignmentComboBox get_HorizontalAlignmentComboBox set_HorizontalAlignmentComboBox get_HorizontalBookLayoutComboBox set_HorizontalBookLayoutComboBox get_VerticalBelowComboBox set_VerticalBelowComboBox ASPxComboBox BorderShading_BordersBox get_BookmarksNameListBox set_BookmarksNameListBox get_LevelListBox set_LevelListBox get_FieldsListBox set_FieldsListBox get_SuggestionsListBox set_SuggestionsListBox ASPxListBox get_TextBox set_TextBox InsertAnchoredTextBox get_FileNameTextBox set_FileNameTextBox ShapeTextBox CreateTextBox get_SearchTextBox set_SearchTextBox get_EmailTextBox set_EmailTextBox get_UrlTextBox set_UrlTextBox get_ImageUrlTextBox set_ImageUrlTextBox get_StopPositionTextBox set_StopPositionTextBox ChangeActiveSubDocumentToTextBox get_IsTextBox ASPxTextBox OrderBy Bookmarks_SortBy set_Display get_Array set_Array ToHashtableArray InitializeArray ToStringArray ToArray get_IsArray get_Legacy set_Legacy get_Key ToggleBackspaceKey get_CacheKey set_CacheKey get_ImageCacheKey GetCacheKey cacheKey ViewMergeDataStateKey SessionGuidStateKey ToggleDeleteKey get_TagKey imgKey StringKey ContainsKey get_AccessKey get_DefaultDialogLauncherAccessKey get_DialogBoxLauncherAccessKey GetDialogBoxLauncherAccessKey GetAccessKey get_DefaultAccessKey SpellCheckerWordAddedEventKey CalculateDocumentVariableEventKey DocumentSelectorFileUploadingEventKey DocumentSelectorItemRenamingEventKey DocumentSelectorFolderCreatingEventKey DocumentSelectorItemDeletingEventKey DocumentSelectorItemMovingEventKey DocumentSelectorItemCopyingEventKey CustomizeMergeFieldsEventKey InsertContentToClientEventKey DocumentSelectorCloudProviderRequestEventKey GetImageByKey PropertyKey key CanModify FindReplace_ReplaceAllNotify ToggleParagraphAlignmentJustify PrepareControlHierarchy CreateControlHierarchy ResetControlHierarchy AddStatusBarControlToHierarchy get_Assembly get_FontFamily DeleteTableCellsWithShiftToTheVertically InsertTableCellsWithShiftToTheVertically InsertPictureLocally DownloadDocumentLocally OpenDocumentLocally CreateNewDocumentLocally DeleteTableCellsWithShiftToTheHorizontally MergeTableCellHorizontally SplitTableCellHorizontally get_ReadOnly set_ReadOnly AsReadOnly readOnly get_UnderlineWordsOnly set_UnderlineWordsOnly get_StrikeoutWordsOnly set_StrikeoutWordsOnly LayoutOptions_LeftOnly LayoutOptions_RightOnly LayoutOptions_LargestOnly Exactly Any Destroy get_Copy set_Copy DownloadCopy SaveCopy set_Primary IDictionary get_Dictionary WebDictionary ASPxSpellCheckerOpenOfficeDictionary SimpleDictionary ASPxSpellCheckerISpellDictionary ASPxHunspellDictionary AddWordToCustomDictionary ASPxSpellCheckerCustomDictionary get_IsCustomDictionary GetCustomDictionary Spelling_NotInDictionary Spelling_AddToDictionary AddWordToDictionary ISpellCheckerDictionary ASPxSpellCheckerDictionary CommandsDictionary GetHtmlTextItemsDictionary get_ArgumentsDictionary argumentsDictionary GetDictionary CheckVisibilityDictionary dictionary get_PropertiesDropDownGallery JSONAddAbstractNumberingListCommandPropery set_Query RERContextTabCategory get_ContextTabCategory get_TableContextTabCategory CreateTableContextTabCategory tableContextTabCategory RibbonContextTabCategory get_HeaderFooterContextTabCategory CreateHeaderFooterContextTabCategory headerFooterContextTabCategory RERTableToolsContextTabCategory RERHeaderAndFooterToolsContextTabCategory RERFloatingObjectsContextTabCategory get_FloatingObjectsContextTabCategory CreateFloatingObjectsContextTabCategory floatingObjectsContextTabCategory foundCategory GetUnicodeCategory GetImageCategory UnloadDocumentFromMemory CommandFactory RegisterInFactory RegisterWorkSessionFactory CheckOrCreateDirectory get_WorkDirectory set_WorkDirectory HasWorkDirectory GetWorkDirectory workDirectory DevExpress.Office.History DevExpress.XtraRichEdit.Model.History SwitchToEmptyHistory DictionaryEntry set_Opacity get_Capacity set_Capacity op_Equality op_Inequality RegisterDocumentCapability capability get_Visibility set_Visibility UpdateRibbonTabVisibility RichEditBookmarkVisibility UpdateRibbonItemVisibility RichEditRangePermissionVisibility DesignerSerializationVisibility UpdateRibbonGroupVisibility RichEditRulerVisibility AzureCompatibility IsInfinity System.Security RefreshLastTimeActivity DevExpress.Web.Internal.Dialogs.IFileManager.get_SettingsAdaptivity FileManagerSettingsAdaptivity IsNullOrEmpty IsTransparentOrEmpty get_IsEmpty JSONSColorHSLProperty TProperty JSONCachesDataProperty JSONParagraphPropertiesChangedProperty JSONFieldProperty JSONInsertParagraphCommandProperty JSONInsertSectionCommandProperty JSONMergeParagraphsCommandProperty JSONMergeSectionsCommandProperty JSONDeleteRunsCommandProperty JSONDeleteAbstractNumberingListCommandProperty JSONInsertTextCommandProperty JSONCachedImageProperty GetItemImageProperty ChangeTableProperty JSONEnumTableProperty JSONTableStyleProperty JSONParagraphStyleProperty JSONTableConditionalStyleProperty JSONCharacterStyleProperty JSONNumberingListStyleProperty JSONShapeProperty ChangeAnchoredObjectShapeProperty JSONStyleLinkCommandBaseProperty JSONCreateHeaderFooterCommandBaseProperty JSONStyleBaseProperty JSONRunBaseProperty JSONBorderBaseProperty GetStringProperty SetStringProperty JSONParagraphFormattingProperty JSONCharacterFormattingProperty JSONParagraphProperty ChangeParagraphProperty JSONChunkProperty JSONBookmarkProperty JSONDocumentModelProperty JSONResponceLevelProperty JSONListLevelProperty JSONIOverrideListLevelProperty JSONNumberingOverrideListLevelProperty JSONNumberingListLevelProperty ChangeTableCellProperty JSONEnumTableCellProperty JSONServerTableCellProperty GetBoolProperty SetBoolProperty GetEnumProperty SetEnumProperty JSONInitSessionProperty JSONRangePermissionProperty JSONSectionProperty JSONAnchoredPictureRunProperty JSONInlinePictureRunProperty JSONAnchoredTextBoxRunProperty JSONInlineTextBoxRunProperty JSONTabInfoProperty JSONLangInfoProperty JSONShadingInfoProperty JSONColorModelInfoProperty JSONSDrawingColorModelInfoProperty JSONColumnInfoProperty JSONHeaderFooterInfoProperty JSONAnchorInfoProperty ChangeAnchorInfoProperty JSONFontInfoProperty JSONCompositeFontInfoProperty ChangeCharacterProperty JSONSScRGBColorProperty JSONSDrawingColorProperty JSONHeaderFooterStringResourcesProperty JSONSpellCheckerDictionariesProperty JSONDocumentProtectionPropertiesProperty JSONDocumentPropertiesProperty JSONStylesProperty JSONSpellCheckerDictionaryTypesProperty JSONCompatibilitySettingsProperty JSONTableCellMarginsProperty JSONControlOptionsProperty JSONAuthenticationOptionsProperty JSONSpellCheckerOptionsProperty JSONRichEditBehaviorOptionsProperty JSONDocumentCapabilitiesOptionsProperty JSONExportOptionsProperty JSONTableBordersProperty JSONTableCellBordersProperty JSONCommandParametersProperty JSONInlineObjectProperty GetObjectProperty SetObjectProperty JSONTableWidthUnitProperty JSONTableHeightUnitProperty GetIntProperty SetIntProperty JSONNumberingListProperty JSONAbstractNumberingListProperty ChangeTableRowProperty JSONEnumTableRowProperty JSONServerTableRowProperty JSONModelPropertyProperty property   +{ {   c l a s s N a m e   =   { 0 }   } }  I{ {   c l a s s N a m e   =   { 0 } ,   c s s T e x t   =   { 1 }   } }  QD e v E x p r e s s . W e b . A S P x R i c h E d i t . D e s c r i p t i o n s  S H  /F l o a t i n g O b j e c t F i l l C o l o r  S A  5F l o a t i n g O b j e c t O u t l i n e C o l o r  W  	0   p t  0 . 2 5   p t  
0 . 5   p t  0 . 7 5   p t  	1   p t  
1 . 5   p t  2 . 2 5   p t  	3   p t  
4 . 5   p t  	6   p t  T W  5F l o a t i n g O b j e c t T e x t W r a p T y p e  I  T e x t W r a p I n l i n e  S  T e x t W r a p S q u a r e  T  T e x t W r a p T i g h t  T H  T e x t W r a p T h r o u g h  T B  )T e x t W r a p T o p A n d B o t t o m  B T  T e x t W r a p B e h i n d  I F  +T e x t W r a p I n F r o n t O f T e x t  L  7F l o a t i n g O b j e c t L a y o u t O p t i o n s  P  /F l o a t i n g O b j e c t A l i g n m e n t  T L  5A l i g n F l o a t i n g O b j e c t T o p L e f t  T C  9A l i g n F l o a t i n g O b j e c t T o p C e n t e r  T R  7A l i g n F l o a t i n g O b j e c t T o p R i g h t  M L  ;A l i g n F l o a t i n g O b j e c t M i d d l e L e f t  M C  ?A l i g n F l o a t i n g O b j e c t M i d d l e C e n t e r  M R  =A l i g n F l o a t i n g O b j e c t M i d d l e R i g h t  B L  ;A l i g n F l o a t i n g O b j e c t B o t t o m L e f t  B C  ?A l i g n F l o a t i n g O b j e c t B o t t o m C e n t e r  B R  =A l i g n F l o a t i n g O b j e c t B o t t o m R i g h t  A F  5F l o a t i n g O b j e c t B r i n g F o r w a r d  F  R  5F l o a t i n g O b j e c t B r i n g T o F r o n t  AF l o a t i n g O b j e c t B r i n g I n F r o n t O f T e x t  A E  5F l o a t i n g O b j e c t S e n d B a c k w a r d  B  K  1F l o a t i n g O b j e c t S e n d T o B a c k  H  9F l o a t i n g O b j e c t S e n d B e h i n d T e x t  +I n s e r t T a b l e O f C o n t e n t s  U P  +U p d a t e T a b l e O f C o n t e n t s  A  ;A d d P a r a g r a p h T o T a b l e O f C o n t e n t s  D  L 1  L 2  L 3  L 4  L 5  L 6  L 7  L 8  L 9  I N  I n s e r t C a p t i o n  'I n s e r t F i g u r e C a p t i o n  %I n s e r t T a b l e C a p t i o n  E  +I n s e r t E q u a t i o n C a p t i o n  I S  +I n s e r t T a b l e O f C a p t i o n s  T A  )I n s e r t T a b l e O f F i g u r e s  -I n s e r t T a b l e O f E q u a t i o n s  U D  R E S p r i t e  L a r g e  R i b b o n M o d e  A c t i v e T a b I n d e x  %A s s o c i a t e d R i b b o n I D  S h o w S t a t u s B a r  R e a d O n l y  W o r k D i r e c t o r y  5S h o w C o n f i r m O n L o s i n g C h a n g e s  -C o n f i r m O n L o s i n g C h a n g e s  5M a i l M e r g e A c t i v e R e c o r d I n d e x  V i e w M e r g e d D a t a   A u t o S a v e M o d e  A u t o S a v e T i m e o u t  c u r r e n t D i a l o g  c o l u m n s C o u n t  i s c  
R E U C U P  % R i c h E d i t  c g u i d  s c m d s  c o m m a n d s  c o l u m n s E d i t o r  o p e n f i l e d i a l o g  s a v e f i l e d i a l o g  f o n t d i a l o g  p a r a g r a p h d i a l o g  p a g e s e t u p d i a l o g  c o l u m n s d i a l o g  #i n s e r t t a b l e d i a l o g  #i n s e r t i m a g e d i a l o g  a l e r t d i a l o g  'n u m b e r i n g l i s t d i a l o g  h y p e r l i n k d i a l o g  t a b s d i a l o g  3s i m p l e n u m b e r i n g l i s t d i a l o g  %b u l l e t e d l i s t d i a l o g  ;m u l t i l e v e l n u m b e r i n g l i s t d i a l o g  s y m b o l s d i a l o g  -i n s e r t m e r g e f i e l d d i a l o g  )f i n i s h a n d m e r g e d i a l o g  b o o k m a r k s d i a l o g  +t a b l e p r o p e r t i e s d i a l o g  -i n s e r t t a b l e c e l l s d i a l o g  -d e l e t e t a b l e c e l l s d i a l o g  +s p l i t t a b l e c e l l s d i a l o g  'b o r d e r s h a d i n g d i a l o g  #f i n d r e p l a c e d i a l o g  s p e l l i n g d i a l o g  'l a y o u t o p t i o n s d i a l o g  v i e w M e r g e D a t a  	R E C |  D i a l o g F o r m  s e s s i o n G u i d  f i l e N a m e  s t a r t R e s p o n s e  r e a d O n l y  i d  o r i g i n a l W i d t h  o r i g i n a l H e i g h t  %b a s e 6 4 E n c o d e d I m a g e  3d a t a : i m a g e / p n g ; b a s e 6 4 , { 0 }  
R E I T S :  
R E I S U :  
R E I S E :  F i l e M a n a g e r  f o l d e r M a n a g e r  UD e v E x p r e s s . W e b . A S P x R i c h E d i t . C s s . S y s t e m . c s s  WD e v E x p r e s s . W e b . A S P x R i c h E d i t . C s s . I S p r i t e . c s s  WD e v E x p r e s s . W e b . A S P x R i c h E d i t . C s s . D e f a u l t . c s s  R i c h E d i t  f i r s t L i n e I n d e n t  )f i r s t L i n e I n d e n t I m a g e  3F i r s t L i n e I n d e n t D r a g H a n d l e  l e f t I n d e n t  l e f t I n d e n t I m a g e  )L e f t I n d e n t D r a g H a n d l e  r i g h t I n d e n t  !r i g h t I n d e n t I m a g e  +R i g h t I n d e n t D r a g H a n d l e  )c o l u m n S e p a r a t o r I m a g e  3C o l u m n S e p a r a t o r D r a g H a n d l e  	l e f t  #L e f t T a b D r a g H a n d l e  r i g h t  %R i g h t T a b D r a g H a n d l e  
c e n t e r  'C e n t e r T a b D r a g H a n d l e  d e c i m a l  )D e c i m a l T a b D r a g H a n d l e  t a b I m a g e s  t a b  	l i n e  c o n t r o l  w r a p p e r  h a n g i n g I n d e n t  m a r g i n L e f t  m a r g i n R i g h t  t a b L e f t  t a b R i g h t  t a b C e n t e r  t a b D e c i m a l  -c o n f l i c t N a m e R e s o l u t i o n  v i s i b i l i t y  c o l o r  /u p d a t e F i e l d s B e f o r e P r i n t  'u p d a t e F i e l d s O n P a s t e  v i e w T y p e  p a d d i n g s  
t i t l e s  
s t y l e s  s h o w L e f t I n d e n t  s h o w R i g h t I n d e n t  s h o w T a b s  r a n g e V i s i b i l i t y  'r a n g e H i g h l i g h t C o l o r  7r a n g e H i g h l i g h t B r a c k e t s C o l o r  'a u t h e n t i c a t i o n E M a i l  'a u t h e n t i c a t i o n G r o u p  -a u t h e n t i c a t i o n U s e r N a m e  	u n i t  p e r c e n t  #w o r k S e s s i o n I s L o s t  u n i t s  v i e w s S e t t i n g s  !h a s W o r k D i r e c t o r y  r u l e r S e t t i n g s  #b o o k m a r k s S e t t i n g s  f i e l d s S e t t i n g s  r i b b o n C l i e n t I D  c o n f i r m U p d a t e  c l i e n t G u i d  #u n i t A b b r e v i a t i o n s  !m a i l M e r g e O p t i o n s  )s p e l l C h e c k e r S e t t i n g s  'a u t o C o r r e c t S e t t i n g s  5d o c u m e n t P r o t e c t i o n S e t t i n g s  m e n u I c o n S e t  9p a r a g r a p h R i b b o n S t y l e C s s C l a s s  'P a r a g r a p h S t y l e L a r g e  9c h a r a c t e r R i b b o n S t y l e C s s C l a s s  'C h a r a c t e r S t y l e L a r g e  1t a b l e R i b b o n S t y l e C s s C l a s s  T a b l e S t y l e L a r g e  i s E n a b l e d  v i e w M e r g e d D a t a  #a c t i v e R e c o r d I n d e x  r e c o r d C o u n t  )c u s t o m D i c t i o n a r y G u i d  c a n A d d W o r d  1e n a b l e A u t o m a t i c N u m b e r i n g  3c o r r e c t T w o I n i t i a l C a p i t a l s  d e t e c t U r l s  )r e p l a c e T e x t A s Y o u T y p e  r e p l a c e I n f o  WA S P x C l i e n t R i c h E d i t . P o p u p M e n u I t e m P r o p e r t i e s =  ; 
  gA S P x C l i e n t R i c h E d i t . S p e l l i n g P o p u p M e n u I t e m P r o p e r t i e s =  _D e v E x p r e s s . W e b . A S P x R i c h E d i t . S c r i p t s . R i c h E d i t . j s  cD e v E x p r e s s . W e b . A S P x R i c h E d i t . S c r i p t s . U I . D i a l o g s . j s  qD e v E x p r e s s . W e b . A S P x R i c h E d i t . S c r i p t s . c l i e n t B a s e S c r i p t s . j s  _D e v E x p r e s s . W e b . A S P x R i c h E d i t . S c r i p t s . c o m p i l e d . j s  }D e v E x p r e s s . W e b . A S P x R i c h E d i t . S c r i p t s . R i c h E d i t C u s t o m R e s o u r c e s . j s  gD e v E x p r e s s . W e b . A S P x R i c h E d i t . S c r i p t s . L o c a l i z a t i o n . j s  ?R i c h E d i t P o p u p M e n u I t e m P r o p e r t i e s  OR i c h E d i t S p e l l i n g P o p u p M e n u I t e m P r o p e r t i e s  %A S P x C l i e n t R i c h E d i t  {D e v E x p r e s s . W e b . A S P x R i c h E d i t . D e s i g n . R i c h E d i t C o m m o n F o r m D e s i g n e r  +C u s t o m C o m m a n d E x e c u t e d  )B e g i n S y n c h r o n i z a t i o n  %E n d S y n c h r o n i z a t i o n  D o c u m e n t C h a n g e d  D o c u m e n t L o a d e d  1A c t i v e S u b D o c u m e n t C h a n g e d  P o i n t e r D o w n  P o i n t e r U p  K e y D o w n  K e y U p  C o n t e n t I n s e r t e d  C o n t e n t R e m o v e d  5C h a r a c t e r P r o p e r t i e s C h a n g e d  5P a r a g r a p h P r o p e r t i e s C h a n g e d  A u t o C o r r e c t  !P o p u p M e n u S h o w i n g  H y p e r l i n k C l i c k  !S e l e c t i o n C h a n g e d  G o t F o c u s  L o s t F o c u s  kD e v E x p r e s s . W e b . A S P x R i c h E d i t . S c r i p t s . U I . F i l e M a n a g e r . j s  ;A S P x C l i e n t R i c h E d i t F i l e M a n a g e r  oD e v E x p r e s s . W e b . A S P x R i c h E d i t . S c r i p t s . U I . F o l d e r M a n a g e r . j s  ?A S P x C l i e n t R i c h E d i t F o l d e r M a n a g e r  5A S P x . R i c h E d i t U p l o a d C o n t r o l  oD e v E x p r e s s . W e b . A S P x R i c h E d i t . S c r i p t s . U I . U p l o a d C o n t r o l . j s  D e v E x p r e s s . W e b . A S P x R i c h E d i t . S c r i p t s . U I . F i l e M a n a g e r U p l o a d C o n t r o l . j s  KA S P x . R i c h E d i t F i l e M a n a g e r U p l o a d C o n t r o l  )r e L o a d i n g O n S t a t u s B a r  +Q u i c k S e a r c h P r e v B u t t o n  +Q u i c k S e a r c h N e x t B u t t o n  3Q u i c k S e a r c h C o l l a p s e B u t t o n  -Q u i c k S e a r c h C l o s e B u t t o n  GD e v E x p r e s s . W e b . A S P x R i c h E d i t . I m a g e s .  UD e v E x p r e s s . W e b . A S P x R i c h E d i t . C s s . s p r i t e . c s s  !r e E r r o r U n d e r l i n e  r e A n c h o r  #r e A u t o S c r o l l A r r o w  'r e A u t o S c r o l l C u r s o r N  )r e A u t o S c r o l l C u r s o r N S  'r e A u t o S c r o l l C u r s o r S  s t a r t T a b l e M a r k  I c o n s  
G I c o n s  G W I c o n s  G W T I c o n s  S V G I c o n  YD e v E x p r e s s . W e b . A S P x R i c h E d i t . C s s . G I S p r i t e . c s s  [D e v E x p r e s s . W e b . A S P x R i c h E d i t . C s s . G W I S p r i t e . c s s  ]D e v E x p r e s s . W e b . A S P x R i c h E d i t . C s s . G W T I S p r i t e . c s s  [D e v E x p r e s s . W e b . A S P x R i c h E d i t . C s s . S V G S p r i t e . c s s  _D e v E x p r e s s . W e b . A S P x R i c h E d i t . C s s . W T S V G S p r i t e . c s s  UD e v E x p r e s s . W e b . A S P x R i c h E d i t . I m a g e s . I S p r i t e  WD e v E x p r e s s . W e b . A S P x R i c h E d i t . I m a g e s . G I S p r i t e  YD e v E x p r e s s . W e b . A S P x R i c h E d i t . I m a g e s . G W I S p r i t e  [D e v E x p r e s s . W e b . A S P x R i c h E d i t . I m a g e s . G W T I S p r i t e  YD e v E x p r e s s . W e b . A S P x R i c h E d i t . I m a g e s . S V G S p r i t e  ]D e v E x p r e s s . W e b . A S P x R i c h E d i t . I m a g e s . W T S V G S p r i t e  M e n u I c o n S e t  #A l i g n B o t t o m C e n t e r  A l i g n B o t t o m L e f t  !A l i g n B o t t o m R i g h t  #A l i g n M i d d l e C e n t e r  A l i g n M i d d l e L e f t  !A l i g n M i d d l e R i g h t  A l i g n T o p C e n t e r  A l i g n T o p L e f t  A l i g n T o p R i g h t  B o o k m a r k  B o r d e r T o p  B o r d e r B o t t o m  B o r d e r L e f t  B o r d e r R i g h t  -B o r d e r I n s i d e H o r i z o n t a l  )B o r d e r I n s i d e V e r t i c a l  B o r d e r s A l l  B o r d e r s B o x  B o r d e r s C u s t o m  B o r d e r s G r i d  B o r d e r s N o n e  	C o p y  C u t  !D e l e t e _ H y p e r l i n k  AF l o a t i n g O b j e c t B r i n g T o F r o n t O f T e x t  	F o n t  H y p e r l i n k  I n d e n t D e c r e a s e  I n d e n t I n c r e a s e  !I n s e r t T a b l e C e l l s  7I n s e r t T a b l e C o l u m n s T o T h e L e f t  9I n s e r t T a b l e C o l u m n s T o T h e R i g h t  )I n s e r t T a b l e R o w s A b o v e  )I n s e r t T a b l e R o w s B e l o w  L e f t C o l u m n s  L i s t B u l l e t s  M e r g e T a b l e C e l l s  O n e C o l u m n  P a r a g r a p h  P a s t e  R i g h t C o l u m n s  S e l e c t A l l  S p e l l C h e c k  S p l i t T a b l e C e l l s  )T a b l e A u t o F i t C o n t e n t s  %T a b l e A u t o F i t W i n d o w  +T a b l e F i x e d C o l u m n W i d t h  T a b l e P r o p e r t i e s  'T e x t W r a p I n l i n e L a r g e  'T e x t W r a p B e h i n d L a r g e  5T e x t W r a p I n F r o n t O f T e x t L a r g e  'T e x t W r a p S q u a r e L a r g e  )T e x t W r a p T h r o u g h L a r g e  %T e x t W r a p T i g h t L a r g e  3T e x t W r a p T o p A n d B o t t o m L a r g e  T h r e e C o l u m n s  T w o C o l u m n s  )R e s t a r t N u m b e r i n g L i s t  +C o n t i n u e N u m b e r i n g L i s t  U p d a t e F i e l d  !T o g g l e F i e l d C o d e s  t a b l e C e l l A l i g n  w r a p T y p e  	T e x t  C o m m a n d N a m e  I m a g e N a m e  B e g i n G r o u p  !C h e c k e d G r o u p N a m e  	n a m e  	t e x t  b e g i n G r o u p  i m a g e N a m e  g r o u p N a m e  i t e m s  r e { 0 }  { 0 }   ( { 1 } )  %d x r e R i b b o n C B M i d d l e  d x r e R i b b o n S E  P S - C S - & &  &  G o T o H e a d e r  G  G o T o F o o t e r  X  )G o T o N e x t H e a d e r F o o t e r  1G o T o P r e v i o u s H e a d e r F o o t e r  L i n k T o P r e v i o u s  %D i f f e r e n t F i r s t P a g e  V  +D i f f e r e n t O d d E v e n P a g e s  H O  F O  C  )C l o s e H e a d e r A n d F o o t e r  M  N  U  	N o n e  
S i n g l e  
D o t t e d  
D a s h e d  
D o u b l e  	2   p t  P e n C o l o r  B o r d e r s O u t s i d e  B B  L B  R B  B o r d e r N o n e  O B  I B  B o r d e r s I n s i d e  H B  V B  T G  %V i e w T a b l e G r i d l i n e s  S h a d i n g  
S e l e c t  C E  S e l e c t T a b l e C e l l  C O  #S e l e c t T a b l e C o l u m n  S e l e c t T a b l e R o w  S e l e c t T a b l e  O  D e l e t e T a b l e  !D e l e t e T a b l e C e l l s  %D e l e t e T a b l e C o l u m n s  D e l e t e T a b l e R o w s  B E  T a b l e C e l l s T o p  C L  !T a b l e C e l l s M i d d l e  C C  C R  !T a b l e C e l l s B o t t o m  !T a b l e C e l l M a r g i n s  S i m p l e V i e w  P r i n t L a y o u t V i e w  R u l e r H o r i z o n t a l  F u l l S c r e e n  C F  I n s e r t D a t a F i e l d  D F  T F  P F  N P  M F  D V  #S h o w A l l F i e l d C o d e s  F C  'S h o w A l l F i e l d R e s u l t s  F R  F i r s t  Q  	P r e v  	N e x t  	L a s t  M a i l M e r g e  P a g e M a r g i n s  N O  #P a g e M a r g i n s N o r m a l  N A  #P a g e M a r g i n s N a r r o w  M O  'P a g e M a r g i n s M o d e r a t e  P a g e M a r g i n s W i d e  P a g e O r i e n t a t i o n  /P a g e O r i e n t a t i o n P o r t r a i t  1P a g e O r i e n t a t i o n L a n d s c a p e  S Z  P a p e r S i z e  L T  L P  A 4  B 5  A 5  A 6  P S  J  C o l u m n s T w o  1  C o l u m n s O n e  2  3  C o l u m n s T h r e e  C o l u m n s  I n s e r t P a g e B r e a k  #I n s e r t C o l u m n B r e a k  S N  5I n s e r t S e c t i o n B r e a k N e x t P a g e  S E  5I n s e r t S e c t i o n B r e a k E v e n P a g e  S O  3I n s e r t S e c t i o n B r e a k O d d P a g e  P a g e C o l o r  P C  I n s e r t T a b l e  I n s e r t I m a g e  
H e a d e r  
F o o t e r  P N  !I n s e r t P a g e N u m b e r  I n s e r t P a g e C o u n t  I n s e r t T e x t B o x  
S y m b o l  U N  	U n d o  R E  	R e d o  F F  #d x r e R i b b o n C B L a r g e  U< s p a n   s t y l e = " f o n t - f a m i l y :   { 0 } ; " > { 1 } < / s p a n > F S  #d x r e R i b b o n C B S m a l l  F G  !F o n t S i z e I n c r e a s e  	S i z e  F K  !F o n t S i z e D e c r e a s e  7  C h a n g e T e x t C a s e  	B o l d  S t y l e  
I t a l i c  U n d e r l i n e  4  S t r i k e o u t  5  S u p e r s c r i p t  
S c r i p t  6  S u b s c r i p t  F o n t C o l o r  C o l o r  H i g h l i g h t  C l e a r F o r m a t t i n g  L i s t N u m b e r s  L i s t M u l t i l e v e l  A O  
I n d e n t  A I  8  S h o w H i d d e n  A L  A l i g n L e f t  A l i g n  A C  A l i g n C e n t e r  A R  A l i g n R i g h t  A J  A l i g n J u s t i f y  L i n e S p a c i n g  F D  	F i n d  R e p l a c e  N e w  	O p e n  	S a v e  
S a v e A s  P r i n t D i a l o g  F N  Z F  P G  Z P  C h a n g e F o n t S t y l e  Z S  Z E  Z T  Z I  Z L  Z H  T E  S P  Z B  T O  C A  Z M  Z V  Z O  !M o d i f y T a b l e S t y l e  Z R  Z C  Z A  Z N  	F i l e  	H o m e  
I n s e r t  P a g e L a y o u t  	V i e w  
R e v i e w  R e f e r e n c e s  T a b l e D e s i g n  J T  T a b l e L a y o u t  J L  H e a d e r A n d F o o t e r  J H  F l o a t i n g O b j e c t s  J D  	U n i t  #R o o t F o l d e r U r l P a t h  C u s t o m C o m m a n d  	. j p e  . j p e g  	. j p g  	. g i f  	. p n g  	. d o c  . d o c x  . e p u b  . h t m l  	. h t m  	. m h t  
. m h t m l  	. o d t  	. t x t  	. r t f  	. x m l  /S h o w E m a i l A d d r e s s S e c t i o n  +S h o w F i l e U p l o a d S e c t i o n  %D i s p l a y S e c t i o n M o d e  E n a b l e d  'L e v e n s h t e i n D i s t a n c e  S u g g e s t i o n C o u n t  C u l t u r e  )I g n o r e U p p e r C a s e W o r d s  )I g n o r e M i x e d C a s e W o r d s  -I g n o r e W o r d s W i t h N u m b e r s  'I g n o r e R e p e a t e d W o r d s  I g n o r e E m a i l s  I g n o r e U r i  /U p d a t e F i e l d s B e f o r e P r i n t  'U p d a t e F i e l d s O n P a s t e  V i e w T y p e  A l l  	L e f t  R i g h t  T o p  
B o t t o m  t o p  
b o t t o m  E n c o d i n g  -C o n f l i c t N a m e R e s o l u t i o n  GD i s p l a y B o o k m a r k s I n P d f N a v i g a t i o n P a n e  ?D i s p l a y U n r e f e r e n c e d P d f B o o k m a r k s  V i s i b i l i t y  %C a s e S e n s i t i v e N a m e s  B r a c k e t s C o l o r  -H i g h l i g h t B r a c k e t s C o l o r  H i g h l i g h t C o l o r  E M a i l  G r o u p  P a s s w o r d  U s e r N a m e  S h o w L e f t I n d e n t  S h o w R i g h t I n d e n t  S h o w T a b s  P r i n t i n g  C r e a t e N e w  	D r a g  	D r o p  T a b M a r k e r  	  'P a g e B r e a k I n s e r t M o d e  D o w n l o a d  MR a i s e C l i e n t E v e n t s O n M o d i f i c a t i o n s V i a A P I  A c c e p t s T a b  %D o c u m e n t C a p a b i l i t y  5P a s t e L i n e B r e a k S u b s t i t u t i o n  T o u c h  'U s e F o n t S u b s t i t u t i o n  +P a s t e S i n g l e C e l l A s T e x t  O v e r t y p e A l l o w e d  O f f i c e S c r o l l i n g  Z o o m i n g  M a x Z o o m F a c t o r  M i n Z o o m F a c t o r  F o n t S o u r c e  F o r e C o l o r S o u r c e  9D o c u m e n t P r o p e r t i e s A u t o U p d a t e  KK e e p T e x t H i g h l i g h t i n g O n C l e a r F o r m a t t i n g  1R i g h t T o L e f t T e x t D i r e c t i o n  B o o k m a r k s  'C h a r a c t e r F o r m a t t i n g  C h a r a c t e r S t y l e  C o m m e n t s  E n d N o t e s  
F i e l d s  I n l i n e S h a p e s  F o o t N o t e s  H e a d e r s F o o t e r s  H y p e r l i n k s  I n l i n e P i c t u r e s  'P a r a g r a p h F o r m a t t i n g  P a r a g r a p h F r a m e s  P a r a g r a p h S t y l e  P a r a g r a p h s  P a r a g r a p h T a b s  S e c t i o n s  
T a b l e s  T a b l e S t y l e  T a b S y m b o l  B u l l e t e d  M u l t i L e v e l  
S i m p l e  V a l  1E n a b l e A u t o m a t i c N u m b e r i n g  3C o r r e c t T w o I n i t i a l C a p i t a l s  D e t e c t U r l s  )R e p l a c e T e x t A s Y o u T y p e  5U s e S p e l l C h e c k e r S u g g e s t i o n s  C a s e S e n s i t i v e  c a s e S e n s i t i v e  d i c t i o n a r y  	W h a t  	W i t h  	w h a t  	w i t h  	d x r e  !Q u i c k S e a r c h P a n e l  !d x r e L o a d i n g P a n e l  
{ 0 } { 1 }  M o d a l B a c k L i t e  C o n t r o l S t y l e  R u l e r  R u l e r L i n e  T a b D r a g H a n d l e  R u l e r W r a p p e r  !P r o p e r t y N a m e s R e s  .  CD e v E x p r e s s . W e b . A S P x R i c h E d i t . v 1 8 . 2  WD e v E x p r e s s . W e b . A S P x R i c h E d i t . L o c a l i z a t i o n R e s  F o n t   s t y l e  
N o r m a l  B o l d   I t a l i c  F o n t   s i z e  F o n t   c o l o r  U n d e r l i n e   s t y l e  U n d e r l i n e   c o l o r  
E f f e c t  A l l   c a p s  
H i d d e n  )U n d e r l i n e   w o r d s   o n l y  D a s h   D o t t e d  D a s h   D o t   D o t t e d  H e a v y   W a v e  L o n g   D a s h e d  T h i c k   S i n g l e  T h i c k   D o t t e d  T h i c k   D a s h e d  #T h i c k   D a s h   D o t t e d  +T h i c k   D a s h   D o t   D o t t e d  #T h i c k   L o n g   D a s h e d  D o u b l e   W a v e  	W a v e  D a s h   S m a l l   G a p  'I n d e n t s   A n d   S p a c i n g  )L i n e   A n d   P a g e   B r e a k s  G e n e r a l  A l i g n m e n t  C e n t e r e d  J u s t i f i e d  O u t l i n e   l e v e l  B o d y   T e x t  L e v e l  I n d e n t a t i o n  S p e c i a l  B y  
( n o n e )  F i r s t   l i n e  H a n g i n g  S p a c i n g  
B e f o r e  L i n e   s p a c i n g  A t  A f t e r  1 . 5   l i n e s  M u l t i p l e  E x a c t l y  A t   l e a s t  gD o n ' t   a d d   s p a c e   b e t w e e n   p a r a g r a p h   o f   t h e   s a m e   s t y l e P a g i n a t i o n  'K e e p   l i n e s   t o g e t h e r  #P a g e   b r e a k   b e f o r e  O p t i o n s  P r e v i e w  /S a v e   f i l e   t o   t h e   s e r v e r  D o w n l o a d   a   c o p y  F o l d e r   p a t h  F i l e   t y p e  F i l e   n a m e  3C h o o s e   d o w n l o a d   f i l e   t y p e  S a v e   f i l e   a s  #I n v a l i d   f i l e   n a m e  eP a t h   d o e s   n o t   e x i s t . 
 C h e c k   t h e   p a t h   a n d   t r y   a g a i n .  P o r t r a i t  L a n d s c a p e  C o n t i n u o u s  N e w   p a g e  E v e n   p a g e  O d d   p a g e  W h o l e   d o c u m e n t  C u r r e n t   s e c t i o n  #S e l e c t e d   s e c t i o n s  %T h i s   p o i n t   f o r w a r d  M a r g i n s  P a p e r  
L a y o u t  O r i e n t a t i o n  P a p e r   s i z e  W i d t h  
H e i g h t  S e c t i o n  S e c t i o n   s t a r t  'H e a d e r s   a n d   f o o t e r s  -D i f f e r e n t   o d d   a n d   e v e n  )D i f f e r e n t   f i r s t   p a g e  A p p l y   t o  F r o m   e d g e  
C a n c e l  O K  
C h a n g e  C l o s e  T a b l e   S i z e  #N u m b e r   o f   c o l u m n s  N u m b e r   o f   r o w s  1M e r g e   c e l l s   b e f o r e   s p l i t  #S h i f t   c e l l s   r i g h t  !S h i f t   c e l l s   d o w n  #I n s e r t   e n t i r e   r o w  )I n s e r t   e n t i r e   c o l u m n  !S h i f t   c e l l s   l e f t  S h i f t   c e l l s   u p  #D e l e t e   e n t i r e   r o w  )D e l e t e   e n t i r e   c o l u m n  %F r o m   t h e   w e b   ( U R L )  %F r o m   y o u r   c o m p u t e r  /E n t e r   i m a g e   w e b   a d d r e s s  cB r o w s e   y o u r   c o m p u t e r   f o r   t h e   i m a g e   f i l e   t o   u p l o a d  I m a g e   p r e v i e w  %V e r t i c a l   a l i g n m e n t  M e a s u r e   i n  P r e f e r r e d   w i d t h  !I n d e n t   f r o m   l e f t  S p e c i f y   h e i g h t  R o w   h e i g h t   i s  T a b l e  R o w  
C o l u m n  	C e l l  O p t i o n s . . .  -B o r d e r s   a n d   S h a d i n g . . .  P r e v i o u s   r o w  N e x t   r o w  P r e v i o u s   c o l u m n  N e x t   c o l u m n  ?A l l o w   r o w   t o   b r e a k   a c r o s s   p a g e s  )D e f a u l t   c e l l   m a r g i n s  )D e f a u l t   c e l l   s p a c i n g  7A l l o w   s p a c i n g   b e t w e e n   c e l l s  IA u t o m a t i c a l l y   r e s i z e   t o   f i t   c o n t e n t s  B o r d e r s  	F i l l  mC l i c k   o n   d i a g r a m   b e l o w   o r   u s e   b u t t o n s   t o   a p p l y   b o r d e r s  B o x  	G r i d  
C u s t o m  C e l l   m a r g i n s  /S a m e   a s   t h e   w h o l e   t a b l e  W r a p   t e x t  P r e s e t s  #W i d t h   a n d   s p a c i n g  %E q u a l   c o l u m n   w i d t h  
C o l   # :  P a g e   L a y o u t  M a i l   M e r g e  !H e a d e r   & &   F o o t e r  
D e s i g n  
F o r m a t  C l i p b o a r d  E d i t i n g  
C o m m o n  
S t y l e s  	Z o o m  	S h o w  I l l u s t r a t i o n s  S y m b o l s  L i n k s  P a g e s  N a v i g a t i o n  I n s e r t   F i e l d s  C u r r e n t   R e c o r d  
F i n i s h  D o c u m e n t   V i e w s  P o s i t i o n  P a g e   S e t u p  P r o t e c t  P r o o f i n g  C o m m e n t  T r a c k i n g  #T a b l e   o f   C o n t e n t s  A r r a n g e  S h a p e   S t y l e s  C a p t i o n s  B a c k g r o u n d  L a n g u a g e  'T a b l e   S t y l e   O p t i o n s  T a b l e   S t y l e s  'B o r d e r s   & &   S h a d i n g s  R o w s   & &   C o l u m n s  M e r g e  C e l l   S i z e  -T h i s   f i e l d   i s   r e q u i r e d  F u l l   S c r e e n  ME n a b l e   /   d i s a b l e   t h e   f u l l   s c r e e n   m o d e .  S a v e   A s  I n s e r t   T a b l e  I n s e r t   C e l l s  D e l e t e   C e l l s  S p l i t   C e l l s  !T a b l e   P r o p e r t i e s  'B o r d e r s   a n d   S h a d i n g  I n s e r t   P i c t u r e  E r r o r  %I n s e r t   M e r g e   F i e l d  E x p o r t   R a n g e  !F i n d   a n d   R e p l a c e  S p e l l i n g  I n f o r m a t i o n  W a r n i n g  M a r g i n   L e f t  M a r g i n   R i g h t  #F i r s t   L i n e   I n d e n t  H a n g i n g   I n d e n t  L e f t   I n d e n t  R i g h t   I n d e n t  L e f t   T a b  R i g h t   T a b  C e n t e r   T a b  D e c i m a l   T i t l e  
N a r r o w  M o d e r a t e  	W i d e  T h e   d o c u m e n t   h a s   b e e n   m o d i f i e d   o u t s i d e   t h e   e d i t o r   a n d   n e e d s   t o   b e   r e l o a d e d .   < b r   / > Y o u r   l a s t - m i n u t e   c h a n g e s   m i g h t   n o t   b e   p r e s e r v e d ,   i f   a n y . Y o u r   s e s s i o n   h a s   e x p i r e d .   < b r   / > P l e a s e   r e f r e s h   t h e   p a g e   t o   c o n t i n u e .  T h e   o p e n   a n d   s a v e   d o c u m e n t   o p e r a t i o n s   a r e   n o t   a l l o w e d < b r   / > s i n c e   t h e   w o r k i n g   d i r e c t o r y   i s   n o t   s p e c i f i e d   f o r   t h e   e d i t o r .  C a n n o t   s a v e   a   d o c u m e n t   o p e n e d   n o t   f r o m   a   f i l e .   H a n d l e   t h e   S a v i n g   e v e n t   t o   p r o c e s s   c u s t o m   s a v i n g  [A c c e s s   t o   t h e   c l i p b o a r d   i s   d e n i e d   d u e   t o   y o u r   b r o w s e r ' s   s e c u r i t y   p o l i c y .   < b r   / > I n s t e a d ,   y o u   c a n   u s e   t h e   k e y b o a r d   s h o r t c u t s : < b r   / > { 0 } + X   ( c u t ) ,   { 0 } + C   ( c o p y )   a n d   { 0 } + V   ( p a s t e ) . EA c c e s s   t o   t h e   c l i p b o a r d   i s   d e n i e d   d u e   t o   y o u r   b r o w s e r ' s   s e c u r i t y   p o l i c y .   I n s t e a d ,   u s e   t h e   n a t i v e   m e n u   t h a t   c a n   b e   i n v o k e d   b y   t a p p i n g   a n d   h o l d i n g   s e l e c t e d   c o n t e n t . A n   u n s p e c i f i e d   e r r o r   o c c u r r e d   a n d   t h e   e d i t o r   n e e d s   t o   b e   r e l o a d e d .   Y o u r   l a s t   c h a n g e s   c a n   b e   l o s t .  A c c e s s   t o   t h e   d o c u m e n t   i s   r e s t r i c t e d   a n d   t h e   e d i t o r   n e e d s   t o   b e   r e l o a d e d .   Y o u r   l a s t   c h a n g e s   c a n   b e   l o s t .  A r e   y o u   s u r e   y o u   w a n t   t o   p e r f o r m   t h e   a c t i o n ?   A l l   u n s a v e d   d o c u m e n t   d a t a   w i l l   b e   l o s t .  #R e s t a r t   N u m b e r i n g  %C o n t i n u e   N u m b e r i n g  U p d a t e   F i e l d  %T o g g l e   F i e l d   C o d e s  O p e n   h y p e r l i n k  !E d i t   h y p e r l i n k . .  !R e m o v e   h y p e r l i n k  T h e   d o c u m e n t   c o u l d   n o t   b e   o p e n e d   b e c a u s e   a   s e r v e r   e r r o r   o c c u r r e d .  T h e   d o c u m e n t   c o u l d   n o t   b e   s a v e d   b e c a u s e   a   s e r v e r   e r r o r   o c c u r r e d .  T h e   D O C V A R I A B L E   f i e l d   c o u l d   n o t   b e   c a l c u l a t e d   b e c a u s e   a   s e r v e r   e r r o r   o c c u r r e d .  T h e   I n s e r t C o n t e n t F r o m S e r v e r C o m m a n d   c o u l d   n o t   b e   e x e c u t e d   b e c a u s e   a   s e r v e r   e r r o r   o c c u r r e d .  ST h e   f i l e   i s   c o r r u p t   a n d   c a n n o t   b e   o p e n e d .  3C o u l d   n o t   l o a d   t h e   i m a g e .  C r e a t e   F i e l d  C r e a t e   a   d y n a m i c   e l e m e n t   u s e d   a s   a   p l a c e h o l d e r   f o r   d a t a   t h a t   m i g h t   c h a n g e   i n   a   d o c u m e n t .  #U p d a t e   A l l   F i e l d s  R e f r e s h   a l l   d y n a m i c   e l e m e n t s   i n   t h e   d o c u m e n t   b y   g e t t i n g   t h e   l a t e s t   s o u r c e   d a t a .  !P a r a g r a p h   S t y l e s  !C h a r a c t e r   S t y l e s  -B u l l e t e d   a n d   N u m b e r i n g  /C u s t o m i z e   N u m b e r e d   L i s t  /C u s t o m i z e   B u l l e t e d   L i s t  -C u s t o m i z e   O u t l i n e   L i s t  	T a b s  	n o n e  Sa l r e a d y   e x i s t .   D o   y o u   w a n t   t o   r e p l a c e   i t ?  C h a r a c t e r . . .  F o n t . . .  !B u l l e t   c h a r a c t e r  B u l l e t   p o s i t i o n  T e x t   p o s i t i o n  A l i g n e d   a t  I n d e n t   a t  S t a r t   a t  N u m b e r   f o r m a t  N u m b e r   s t y l e  N u m b e r   p o s i t i o n  
C e n t e r  %F o l l o w   N u m b e r   W i t h  T a b   c h a r a c t e r  S p a c e  N o t h i n g  C u s t o m i z e . . .  N u m b e r e d  !O u t l i n e   N u m b e r e d  E - m a i l   a d d r e s s U R L  W e b   p a g e  -P l a c e   i n   t h i s   d o c u m e n t  E - m a i l   t o S u b j e c t  #D i s p l a y P r o p e r t i e s  T o o l T i p  I n v a l i d   E - m a i l S e t  C l e a r  C l e a r   A l l  #T a b   s t o p   p o s i t i o n  #D e f a u l t   t a b   s t o p s  /T a b   s t o p s   t o   b e   c l e a r e d  
L e a d e r  D e c i m a l  H y p h e n s  E q u a l   s i g n s  	D o t s  M i d d l e   d o t s  T h i c k   l i n e  	F r o m  C o u n t  M e r g e   m o d e  A l l   r e c o r d s  C u r r e n t   r e c o r d  R a n g e  N e w   P a r a g r a p h  N e w   S e c t i o n  J o i n   T a b l e s  B o o k m a r k   n a m e  S o r t   b y  	N a m e  L o c a t i o n  A d d  
D e l e t e  G o   T o  OB o o k m a r k   n a m e s   m u s t   b e g i n   w i t h   a   l e t t e r  A d v a n c e d   f i n d  R e p l a c e   A l l  R e p l a c e   w i t h  P r e v i o u s  M a t c h   c a s e  R e s u l t s  WW e   c o u l d n ' t   f i n d   w h a t   y o u   w e r e   l o o k i n g   f o r . T h e   r e s u l t   i s   t o o   l o n g .   C h e c k   o u t   t h e   p a g e s   t o   s e e   y o u r   r e s u l t s   i n   t e x t .  ={ 0 }   e n t r i e s   h a v e   b e e n   r e p l a c e d  I t e m s  N o   m a t c h e s  o f  ?T h e   s p e l l i n g   c h e c k   i s   c o m p l e t e .  I g n o r e   O n c e  I g n o r e   A l l  #A d d   t o   D i c t i o n a r y  C h a n g e   A l l  %N o t   i n   D i c t i o n a r y :  R e p e a t e d   W o r d :  S u g g e s t i o n s :  3( n o   s p e l l i n g   s u g g e s t i o n s )  S e n t e n c e   c a s e .  C e l l   M a r g i n s  -C u s t o m i z e   c e l l   m a r g i n s  !H e a d e r   f r o m   T o p :  'F o o t e r   f r o m   B o t t o m :  S p e c i f y   t h e   d i s t a n c e   f r o m   t h e   t o p   o f   t h e   p a g e   t o   t h e   t o p   o f   t h e   h e a d e r .  S p e c i f y   t h e   d i s t a n c e   f r o m   t h e   b o t t o m   o f   t h e   p a g e   t o   t h e   b o t t o m   o f   t h e   f o o t e r .  #I n   l i n e   w i t h   t e x t  L o c k   A n c h o r  #L o c k   a s p e c t   r a t i o  R e s e t  B o t h   s i d e s  L e f t   o n l y  R i g h t   o n l y  L a r g e s t   o n l y  
I n s i d e  O u t s i d e  V e r t i c a l  H o r i z o n t a l  r e l a t i v e   t o  #A b s o l u t e   p o s i t i o n  #R e l a t i v e   p o s i t i o n  B o o k   l a y o u t  t o   t h e   r i g h t   o f  b e l o w  T e x t   W r a p p i n g  W r a p p i n g   s t y l e  %D i s t a n c e   f r o m   t e x t  A b s o l u t e  R e l a t i v e  
R o t a t e  R o t a t i o n  S c a l e  O r i g i n a l   s i z e  T h e   f i l e   c a n n o t   b e   d e l e t e d .   I t   i s   a l r e a d y   o p e n e d   b y   a n o t h e r   u s e r .  T h e   f i l e   c a n n o t   b e   m o v e d .   I t   i s   a l r e a d y   o p e n e d   b y   a n o t h e r   u s e r .  T h e   f i l e   c a n n o t   b e   r e n a m e d .   I t   i s   a l r e a d y   o p e n e d   b y   a n o t h e r   u s e r .  	D A T E  EI n s e r t s   t h e   c u r r e n t   d a t e   a n d   t i m e .  	T I M E  3I n s e r t s   t h e   c u r r e n t   t i m e .  	P A G E  iI n s e r t s   t h e   n u m b e r   o f   t h e   p a g e   c o n t a i n i n g   t h e   f i e l d .  N U M P A G E S  EI n s e r t s   t h e   t o t a l   n u m b e r   o f   p a g e s .  M E R G E F I E L D  [R e t r i e v e s   a   v a l u e   f r o m   t h e   b o u n d   d a t a   s o u r c e .  D O C V A R I A B L E  E n a b l e s   y o u   t o   p r o g r a m m a t i c a l l y   i n s e r t   c o m p l e x   c o n t e n t   w h e n   t h i s   f i e l d   i s   u p d a t e d .  yM a i n S t r u c t u r e s I m p o r t e r :   I n s e r t I n l i n e P i c t u r e R u n   -   i m g   i s   n u l l I m p o r t i n g :   C h a r a c t e r F o r m a t t i n g E x p o r t e r . C a c h e   h a s   n o   s u c h   i n d e x    !T x b B o o k m a r k s N a m e  !L s b B o o k m a r k N a m e s  !d x - j u s t i f i c a t i o n R b l S o r t B y  
B t n A d d  B t n D e l e t e  B t n G o T o  d x r e D l g R i g h t  B t n C a n c e l  S u b m i t B u t t o n  )d x r e D l g B o o k m a r k s F o r m  #C o n t e n t F o r m L a y o u t  #P r e v i e w F o r m L a y o u t  #O p t i o n s F o r m L a y o u t  C m b B o r d e r S t y l e  C e B o r d e r C o l o r  C m b W i d t h  C e F i l l C o l o r  -d x r e T a b l e B o r d e r P r e v i e w  /_ b o r d e r C o n t a i n e r P r e v i e w  3d x r e T a b l e P r e v i e w C o n t a i n e r  b u t t o n W i t h I m a g e  p r e s e t G r o u p  B t n P r e s e t  B t n P r e s e t    !d x r e - b u t t o n L a b l e /d x r e - d i a l o g P r e s e t B u t t o n B t n  !d x r e B o r d e r B u t t o n  { 0 } p t  B o r d e r s G r o u p  S h a d i n g G r o u p  1d x r e D l g B o r d e r S h a d i n g F o r m  P r e s e t s G r o u p  1d x r e - d i a l o g B o r d e r P r e s e t s B u l l e t C h a r a c t e r  C h a r a c t e r  B t n F o n t  B t n C h a r  B u l l e t P o s i t i o n  S p n A l i g n e d A t  -d x r e - d i a l o g S h o r t E d i t o r T e x t P o s i t i o n  S p n I n d e n t A t  b u l l e t C h a r  -d x r e D l g B u l l e t P r e s e t B t n  B u l l e t e d P r e s e t  /d x r e D l g B u l l e t e d L i s t F o r m  A r i a l  ;d x r e D l g C o l u m n s E d i t o r M a i n T a b l e  :  d x r e D l g T e x t B o x  +d x r e D i a l o g _ S p n C o l u m n s  d x r e D l g S p i n E d i t  S p n C o l u m n s     /d x r e - d i a l o g P r e s e t s P a n e l %S p n N u m b e r O f C o l u m n s  W i d t h S p a c i n g  %W i d t h S p a c i n g L a y o u t  e m p t y L a y o u t I t e m  )d x r e D l g C o l u m n s E d i t o r  d x r e - S e p a r a t o r C h k E q u a l W i d t h  C b x A p p l y T o  #d x r e D l g T a b l e W i d t h  d x r e D l g C e n t e r  %d x r e D l g C o l u m n s F o r m  C o l u m n s E d i t o r  !R b l C e l l O p e r a t i o n  +d x r e D l g T a b l e C e l l s F o r m  M e s s a g e T e x t  B t n O k  !d x r e D l g A l e r t F o r m  T x b F i n d  T x b R e p l a c e  )_ d x S e a r c h R e s u l t L a b e l  
R e s u l t  #d x r e - s e a r c h R e s u l t L s b R e s u l t  +d x r e - s e a r c h R e s u l t L i s t C h k M a t c h C a s e  I n f o B o x  !d x r e - r e p l a c e I n f o B t n N e x t  B t n P r e v i o u s  B t n R e p l a c e  B t n R e p l a c e A l l  -d x r e D l g F i n d R e p l a c e F o r m  R a n g e G r o u p  S p n F r o m  S p n C o u n t  C m b M e r g e M o d e  %R d B t t n L i s t S w i t c h e r  -d x r e D l g F i n i s h M e r g e F o r m  C b x F o n t N a m e  C b x F o n t S t y l e  C b x F o n t S i z e  C e F o n t C o l o r  #C b x U n d e r l i n e S t y l e  !C e U n d e r l i n e C o l o r  R b l S t r i k e o u t  R b l S u b s c r i p t  +d x r e C h e c k B o x C o n t a i n e r  C h k A l l C a p s  C h k H i d d e n  )C b U n d e r l i n e W o r d s O n l y  	A u t o  E f f e c t G r o u p  d x r e D l g F o n t F o r m  R b l L i n k T o  ;d x r e - e d i t o r s G r o u p W i t h P a d d i n g s C b B o o k m a r k N a m e s  
T x b U R L  h t t p : / /  T x b E m a i l T o  T x b S u b j e c t  T x b T e x t  T x b T o o l T i p  5d x r e - d i a l o g R a d i o N a v i g a t i o n '_ d x e T x b E m a i l T o G r o u p  Y\ w + ( [ - + . ' ] \ w + ) * @ \ w + ( [ - . ] \ w + ) * \ . \ w + ( [ - . ] \ w + ) * )d x r e D l g H y p e r l i n k F o r m  R b l N a v i g a t i o n  g e n e r a l C o n t e n t  /d x r e D l g I n s e r t I m a g e P a n e l  +I n s e r t I m a g e F o r m L a y o u t  #T x b I n s e r t I m a g e U r l  I m a g e P r e v i e w  U p l I m a g e  U p l o a d C o n t r o l  H i d d e n F i e l d  3_ d x I n s e r t I m a g e P r e v i e w T e x t  5_ d x I n s e r t I m a g e P r e v i e w I m a g e  'd x r e D l g I m a g e P r e v i e w  5_ d x e T b x I n s e r t I m a g e U r l G r o u p  -d x r e D l g I n s e r t I m a g e F o r m  T x b S e a r c h  L s b F i e l d s  B t n I n s e r t  . . .  7d x r e D l g I n s e r t M e r g e F i e l d F o r m  !S p n C o l u m n s N u m b e r  #d x r e - d i a l o g E d i t o r S p n R o w s N u m b e r  T a b l e S i z e  -d x r e D l g I n s e r t T a b l e F o r m  #L a y o u t P a g e C o n t r o l  c o n t e n t  T e x t W r a p p i n g  -d x r e - p o s i t i o n T a b L a y o u t H o r i z o n a l  -R b t H o r i z o n t a l A l i g n m e n t  -C b x H o r i z o n t a l A l i g n m e n t  AC b x H o r i z o n t a l A l i g n m e n t R e l a t i v e T o  R b t B o o k L a y o u t  /C b x H o r i z o n t a l B o o k L a y o u t  3C b x H o r i z o n t a l B o o k L a y o u t O f  1R b t H o r i z o n t a l A b s P o s i t i o n  1S p n H o r i z o n t a l A b s P o s i t i o n  9C b x H o r i z o n t a l A b s T o T h e R i g h t O f  ;R b t H o r i z o n t a l R e l a t i v e P o s i t i o n  ;S p n H o r i z o n t a l R e l a t i v e P o s i t i o n  	{ 0 } %  ;C b x H o r i z o n t a l R e l P o s R e l a t i v e T o  1d x r e - d i a l o g V e r t i c a l G r o u p )R b t V e r t i c a l A l i g n m e n t  )C b x V e r t i c a l A l i g n m e n t  )C b x V e r t i c a l R e l a t i v T o  -R b t V e r t i c a l A b s P o s i t i o n  -S p n V e r t i c a l A b s P o s i t i o n  !C b x V e r t i c a l B e l o w  7R b t V e r t i c a l R e l a t i v e P o s i t i o n  7S p n V e r t i c a l R e l a t i v e P o s i t i o n  7C b x V e r t i c a l R e l P o s R e l a t i v e T o  C h k L o c k A n c h o r  W r a p p i n g S t y l e  1d x r e - d i a l o g W r a p p i n g S t y l e W r a p T e x t  R b l W r a p T e x t  !D i s t a n c e F r o m T e x t  7d x r e - d i a l o g C e l l M a r g i n s G r o u p D i s t a n c e G r o u p  -d x r e - d i a l o g C e l l M a r g i n s 
S p n T o p  kd x r e - d i a l o g S h o r t E d i t o r   d x r e - d i a l o g N o t R e s p o n s i v e E d i t o r S p n L e f t  C e l l B l o c k  )d x r e - d i a l o g C e l l B l o c k S p n R i g h t  S p n B o t t o m  %d x r e - s i z e T a b L a y o u t #R b t A b s o l u t e H e i g h t  #S p n A b s o l u t e H e i g h t  #R b t R e l a t i v e H e i g h t  #S p n R e l a t i v e H e i g h t  %C b x H e i g h t R e l a t i v T o  !R b t A b s o l u t e W i d t h  !S p n A b s o l u t e W i d t h  !R b t R e l a t i v e W i d t h  !S p n R e l a t i v e W i d t h  #C b x W i d t h R e l a t i v T o  S p n R o t a t i o n  	{ 0 }  C h k S c a l e  O r i g i n a l S i z e  Ad x r e - l a y o u t F o r m O r i g i n a l S i z e G r o u p #L b l O r i g i n a l H e i g h t  !L b l O r i g i n a l W i d t h  B t n R e s e t  M a r g i n s G r o u p  S p n T o p M a r g i n  S p n L e f t M a r g i n  S p n R i g h t M a r g i n  S p n B o t t o m M a r g i n  #d x r e D l g L a y o u t F o r m  Id x r e M u l t i L e v e l N u m b e r i n g L i s t B o x L a y o u t  L b L e v e l  +M a i n O p t i o n s F o r m L a y o u t  9d x r e - m u l t i L e v e l O p t i o n s L a y o u t N u m b e r F o r m a t  T x b N u m b e r F o r m a t  C b x N u m b e r S t y l e  +d x r e - d i a l o g L o n g E d i t o r S p n S t a r t A t  +d x r e D l g I n L a y o u t B u t t o n  F o n t B u t t o n  N u m b e r P o s i t i o n  #C b x N u m b e r P o s i t i o n  'C b x F o l l o w N u m b e r W i t h  { 0 } , { 1 } , { 2 } . . .  Ed x r e D l g M u l t i L e v e l N u m b e r i n g L i s t F o r m  1N u m b e r i n g L i s t P a g e C o n t r o l  )d x r e D l g M a i n C o n t a i n e r  )d x r e D l g N u m b e r i n g L i s t  5_ d x e A b s t r a c t N u m b e r i n g L i s t _  B u l l e t T a b  S i m p l e T a b  M u l t i L e v e l T a b  B t n C u s t o m i z e  1d x r e D l g N u m b e r i n g L i s t F o r m  %O p e n F i l e F o r m L a y o u t  'd x r e D l g O p e n F i l e F o r m  )P a g e S e t u p P a g e C o n t r o l  0  C b x P a p e r S i z e  S p n W i d t h  S p n H e i g h t  C b x S e c t i o n S t a r t  -C h k D i f f e r e n t O d d A n d E v e n  +C h k D i f f e r e n t F i r s t P a g e  
O f f s e t  !d x r e - o f f s e t G r o u p S p n H e a d e r O f f s e t  S p n F o o t e r O f f s e t  O f f s e t C o n t e n t  R b l O r i e n t a t i o n  !O r i e n t a t i o n G r o u p  P a p e r S i z e G r o u p  S e c t i o n G r o u p  -H e a d e r s A n d F o o t e r s G r o u p  )d x r e D l g P a g e S e t u p F o r m  P a r a g r a p h T a b 0  P a r a g r a p h T a b 1  G e n e r a l G r o u p  C b x A l i g n  C b x O u t l i n e L e v e l  !I n d e n t a t i o n G r o u p  +I n d e n t a t i o n F o r m L a y o u t  ?d x r e - d i a l o g P a r a g r a p h I n n e r L a y o u t ;I n d e n t a t i o n S p r e c i a l F o r m L a y o u t  C b x S p e c i a l  S p n B y  S p a c i n g G r o u p  #S p a c i n g F o r m L a y o u t  S p n B e f o r e  S p n A f t e r  +L i n e S p a c i n g F o r m L a y o u t  C b x L i n e S p a c i n g  S p n A t  0 . #  C h k N o S p a c e  
C h k K L T  
C h k P B B  { 0 }   { 1 }  B t n T a b s  )d x r e D l g P a r a g r a p h F o r m  T b x F o l d e r P a t h  T b x F i l e N a m e  C b x F i l e T y p e  'C b x D o w n l o a d F i l e T y p e  B t n D o w n l o a d  %f o l d e r M a n a g e r P o p u p  B r o w s e P o p u p  d x p M a i n P a n e l  5p o p u p C o n t r o l C o n t e n t C o n t r o l  )u c S e l e c t F o l d e r D i a l o g  d x H f M e s s a g e  )F o l d e r I n v a l i d M e s s a g e  L a y o u t W r a p p e r  1_ d x e T b x S a v e F i l e P a t h G r o u p  !^ [ ^ / ? * : | " < > \ \ ] + $  KM i c r o s o f t   W o r d   2 0 0 7   D o c u m e n t   ( * . d o c x )  ?M i c r o s o f t   W o r d   D o c u m e n t   ( * . d o c )  1R i c h   T e x t   F o r m a t   ( * . r t f )  %T e x t   F i l e s   ( * . t x t )  SH y p e r T e x t   M a r k u p   L a n g u a g e   F o r m a t   ( * . h t m l )  AW e b   A r c h i v e ,   s i n g l e   f i l e   ( * . m h t )  GO p e n t D o c u m e n t   T e x t   D o c u m e n t   ( * . o d t )  3W o r d   X M L   D o c u m e n t   ( * . x m l )  ?E l e c t r o n i c   P u b l i c a t i o n   ( * . e p u b )  'd x r e D l g S a v e F i l e F o r m  B t n S e l e c t  B t n C a n c l e S e l e c t  =d x r e D l g S i m p l e N u m b e r i n g L i s t F o r m  %L b l N o t I n D i c t i o n a r y  L b l R e p e a t e d W o r d  M i s s p e l l e d M e m o  d x r e D l g S M  B t n I g n o r e O n c e  d x r e D l g S B  B t n I g n o r e A l l  %B t n A d d T o D i c t i o n a r y  %S u g g e s t i o n s L i s t B o x  d x r e D l g S S  B t n C h a n g e  B t n C h a n g e A l l  B t n O p t i o n s  'd x r e D l g S p e l l i n g F o r m  C h k M e r g e C e l l s  5d x r e D l g S p l i t T a b l e C e l l s F o r m  S y m b o l L i s t  %d x r e D l g S y m b o l s L i s t  %d x r e D l g S y m b o l s F o r m  5T a b l e P r o p e r t i e s P a g e C o n t r o l  #C h k T a b l e P r e f W i d t h  #S p n T a b l e P r e f W i d t h  #C b x T a b l e M e a s u r e I n  R b l A l i g m e n t  S p n I n d e n t L e f t  D e f a u l t  C h k A l l o w S p a c i n g  S p n S p a c i n g  /d x r e - d i a l o g T a b l e S p a c i n g C h k A u t o R e s i z e  !B t n B o r d e r S h a d i n g  !C h k S p e c i f y H e i g h t  S p n R o w H e i g h t  C b x R o w H e i g h t  B t n P r e v R o w  B t n N e x t R o w  C h k C a n t S p l i t  %C h k C o l u m n P r e f W i d t h  %S p n C o l u m n P r e f W i d t h  %C b x C o l u m n M e a s u r e I n  B t n P r e v C o l u m n  B t n N e x t C o l u m n  !C h k C e l l P r e f W i d t h  !S p n C e l l P r e f W i d t h  !C b x C e l l M e a s u r e I n  'R b l V e r t i c a l A l i g m e n t  C h k S a m e A s T a b l e  C h k W r a p T e x t  B t n M o v e L e f t C e l l  B t n M o v e T o p C e l l  #B t n M o v e B o t t o m C e l l  !B t n M o v e R i g h t C e l l  S i z e G r o u p  A l i g n m e n t G r o u p  !C e l l M a r g i n s G r o u p  O p t i o n s G r o u p  -V e r t i c a l A l i g n m e n t G r o u p  5d x r e D l g T a b l e P r o p e r t i e s F o r m  %T x b T a b S t o p P o s i t i o n  %S p n D e f a u l t T a b S t o p s  #L b T a b S t o p P o s i t i o n  %L b l T o B e C l e a r e d L i s t  T o B e C l e a r e d  A l i g m e n t  !R b l T a b s A l i g n m e n t  R b l T a b s L e a d e r  B t n T a b S e t  B t n T a b C l e a r  B t n T a b C l e a r A l l  1d x r e - f l o w R a d i o B u t t o n L i s t +^ - { 0 , 1 } \ d + \ . { 0 , 1 } \ d * $ d x r e D l g T a b s F o r m  mI m p o r t i n g :   C h a r a c t e r F o r m a t t i n g C a c h e   h a s   n o   s u c h   i n d e x    #j s o n D o c u m e n t M o d e l  j s o n C a c h e s  j s o n P i e c e t a b l e s  ;p i e c e   t a b l e   f o r   h e a d e r / f o o t e r  I m p o r t i n g :   N u m b e r i n g L i s t L e v e l E x p o r t e r ,   C h a r a c t e r F o r m a t t i n g C a c h e   h a s   n o   s u c h   i n d e x    I m p o r t i n g :   N u m b e r i n g L i s t L e v e l E x p o r t e r ,   P a r a g r a p h F o r m a t t i n g C a c h e   h a s   n o   s u c h   i n d e x    I n f  T a b l e C o n d i t i o n a l S t y l e E x p o r t e r . F r o m H a s h t a b l e :   T a b l e R o w P r o p e r t i e s E x p o r t e r   i s   n u l l  I m p o r t i n g :   T a b l e C o n d i t i o n a l S t y l e E x p o r t e r s ,   P a r a g r a p h F o r m a t t i n g C a c h e   h a s   n o   s u c h   i n d e x    I m p o r t i n g :   T a b l e C o n d i t i o n a l S t y l e E x p o r t e r s ,   C h a r a c t e r F o r m a t t i n g C a c h e   h a s   n o   s u c h   i n d e x    T a b l e G r i d  I m p o r t i n g :   C h a r a c t e r S t y l e E x p o r t e r ,   C h a r a c t e r F o r m a t t i n g C a c h e   h a s   n o   s u c h   i n d e x    	& l t ;  <  	& g t ;  >  
& q u o t ;  "  & a m p ;  I m p o r t i n g :   P a r a g r a p h S t y l e E x p o r t e r ,   P a r a g r a p h F o r m a t t i n g C a c h e   h a s   n o   s u c h   i n d e x    I m p o r t i n g :   P a r a g r a p h S t y l e E x p o r t e r ,   C h a r a c t e r F o r m a t t i n g C a c h e   h a s   n o   s u c h   i n d e x    I m p o r t i n g :   f o n t I n f o C a c h e . I n n e r C a c h e T a b l e . C o u n t   ! =   j s o n F o n t I n f o C a c h e . C o u n t  I m p o r t i n g :   P a r a g r a p h F o r m a t t i n g C a c h e . C a c h e . C o u n t   ! =   d o c u m e n t M o d e l . C a c h e . P a r a g r a p h F o r m a t t i n g C a c h e . C o u n t  I m p o r t i n g :   C h a r a c t e r F o r m a t t i n g E x p o r t e r . C a c h e . C o u n t   ! =   d o c u m e n t M o d e l . C a c h e . C h a r a c t e r F o r m a t t i n g C a c h e . C o u n t  ' { 0 } ' ,   ' { 1 } ' )M i c r o s o f t   S a n s   S e r i f  ' { 0 } ' 
^ \ w + \ s  A n g s a n a   N e w  )' A n g s a n a   N e w ' ,   s e r i f 9A r i a l ,   H e l v e t i c a ,   s a n s - s e r i f A r i a l   B l a c k  C' A r i a l   B l a c k ' ,   G a d g e t ,   s a n s - s e r i f 
B a t a n g  #B a t a n g ,   ,   s e r i f B o o k   A n t i q u a  +' B o o k   A n t i q u a ' ,   s e r i f #B o o k m a n   O l d   S t y l e  5' B o o k m a n   O l d   S t y l e ' ,   s e r i f C a l i b r i  'C a l i b r i ,   s a n s - s e r i f C a l i b r i   L i g h t  C a m b r i a  C a m b r i a ,   s e r i f  C a n d a r a  'C a n d a r a ,   s a n s - s e r i f C e n t u r y  C e n t u r y ,   s e r i f  C e n t u r y   G o t h i c  9' C e n t u r y   G o t h i c ' ,   s a n s - s e r i f %C e n t u r y   S c h o o l b o o k  7' C e n t u r y   S c h o o l b o o k ' ,   s e r i f C o m i c   S a n s   M S  [' C o m i c   S a n s   M S ' ,   f a n t a s y ,   c u r s i v e ,   s a n s - s e r i f C o n s o l a s  'C o n s o l a s ,   m o n o s p a c e  C o n s t a n t i a  #C o n s t a n t i a ,   s e r i f  
C o r b e l  %C o r b e l ,   s a n s - s e r i f C o r d i a   N e w  1' C o r d i a   N e w ' ,   s a n s - s e r i f C o u r i e r   N e w  C' C o u r i e r   N e w ' ,   C o u r i e r ,   m o n o s p a c e D a u n P e n h  )D a u n P e n h ,   s a n s - s e r i f D o t u m  +D o t u m ,   ˳,   s a n s - s e r i f F a n g S o n g  F a n g S o n g ,   s e r i f  )F r a n k l i n   G o t h i c   B o o k  E' F r a n k l i n   G o t h i c   B o o k ' ,   s a n s - s e r i f -F r a n k l i n   G o t h i c   M e d i u m  I' F r a n k l i n   G o t h i c   M e d i u m ' ,   s a n s - s e r i f G a r a m o n d  G a r a m o n d ,   s e r i f  G a u t a m i  'G a u t a m i ,   s a n s - s e r i f G e o r g i a  G e o r g i a ,   s e r i f  G i l l   S a n s   M T  5' G i l l   S a n s   M T ' ,   s a n s - s e r i f G u l i m  +G u l i m ,   t,   s a n s - s e r i f G u n g S u h  G u n g S u h ,   s e r i f  
I m p a c t  9I m p a c t ,   C h a r c o a l ,   s a n s - s e r i f I s k o o l a   P o t a  5' I s k o o l a   P o t a ' ,   s a n s - s e r i f K a i T i  #K a i T i ,   s a n s - s e r i f K a l i n g a  'K a l i n g a ,   s a n s - s e r i f K a r t i k a  'K a r t i k a ,   s a n s - s e r i f L a t h a  #L a t h a ,   s a n s - s e r i f L u c i d a   C o n s o l e  G' L u c i d a   C o n s o l e ' ,   M o n a c o ,   m o n o s p a c e L u c i d a   S a n s  3' L u c i d a   S a n s ' ,   s a n s - s e r i f 'L u c i d a   S a n s   U n i c o d e  e' L u c i d a   S a n s   U n i c o d e ' ,   ' L u c i d a   G r a n d e ' ,   s a n s - s e r i f M a l g u n   G o t h i c  I' M a l g u n   G o t h i c ' ,   ' ѹ@  ' ,   s a n s - s e r i f 
M a n g a l  %M a n g a l ,   s a n s - s e r i f 
M e i r y o  1M e i r y o ,   0000,   s a n s - s e r i f %M i c r o s o f t   J h e n g H e i  O' M i c r o s o f t   J h e n g H e i ' ,   _ߎckўԚ,   s a n s - s e r i f M i c r o s o f t   Y a H e i  G' M i c r o s o f t   Y a H e i ' ,   _oŖў,   s a n s - s e r i f M i n g L i U  'M i n g L i U ,   0}fԚ,   s e r i f M i n g L i U _ H K S C S  ?M i n g L i U _ H K S C S ,   0}fԚ_ H K S C S ,   s e r i f M S   G o t h i c  E' M S   G o t h i c ' ,   ' -3  0000' ,   s a n s - s e r i f M S   M i n c h o  7' M S   M i n c h o ' ,   ' -3  fg' ,   s e r i f M S   P G o t h i c  I' M S   P G o t h i c ' ,   ' -3  00000' ,   s a n s - s e r i f M S   P M i n c h o  ;' M S   P M i n c h o ' ,   ' -3  0fg' ,   s e r i f N y a l a  #N y a l a ,   s a n s - s e r i f #P a l a t i n o   L i n o t y p e  i' P a l a t i n o   L i n o t y p e ' ,   ' B o o k   A n t i q u a ' ,   P a l a t i n o ,   s e r i f P M i n g L i U  +P M i n g L i U ,   e0}fԚ,   s e r i f P M i n g L i U - E x t B iP M i n g L i U - E x t B ,   e0}fԚ- E x t B ,   e0}fԚ- E x t B ,   P M i n g L i U ,   s e r i f R a a v i  #R a a v i ,   s a n s - s e r i f R o c k w e l l  R o c k w e l l ,   s e r i f  S e g o e   U I  -' S e g o e   U I ' ,   s a n s - s e r i f S e g o e   U I   L i g h t  9' S e g o e   U I   L i g h t ' ,   s a n s - s e r i f 
S h r u t i  %S h r u t i ,   s a n s - s e r i f 
S i m H e i  -S i m H e i ,   ўSO,   s a n s - s e r i f 
S i m S u n  #S i m S u n ,   [SO,   s e r i f S i m S u n - E x t B %S i m S u n - E x t B ,   s e r i f S y l f a e n  S y l f a e n ,   s e r i f  
T a h o m a  5T a h o m a ,   G e n e v a ,   s a n s - s e r i f T i m e s  ?T i m e s ,   ' T i m e s   N e w   R o m a n ' ,   s e r i f T i m e s   N e w   R o m a n  ?' T i m e s   N e w   R o m a n ' ,   T i m e s ,   s e r i f T r e b u c h e t   M S  K' T r e b u c h e t   M S ' ,   H e l v e t i c a ,   s a n s - s e r i f T u n g a  #T u n g a ,   s a n s - s e r i f T W   C e n   M T  /' T W   C e n   M T ' ,   s a n s - s e r i f V e r d a n a  7V e r d a n a ,   G e n e v a ,   s a n s - s e r i f 
V r i n d a  %V r i n d a ,   s a n s - s e r i f cO p e r a t i o n   i s   d i s a b l e d   b y   t h e   s e r v e r - s i d e   s e t t i n g s gT h i s   c o m m a n d   r e m o v e s   r u n s   o n l y   i n s i d e   o n e   p a r a g r a p h  #C o m m a n d   N o t   F o u n d  F i e l d   n o t   f o u n d  oD o w n l o a d M e r g e d D o c u m e n t   c o u l d   b e   c a l l e d   o n l y   o n   c a l l b a c k  
l e n g t h  \  A S P x R i c h E d i t I n t e r n a l   e x c e p t i o n   ( I n c o r r e c t   f o n t I n d e x .   S e r v e r N e w V a l u e = { 0 } ,   C l i e n t V a l u e = { 1 } )  ]G e t R t f C o m m a n d   c o u l d   b e   c a l l e d   o n l y   o n   c a l l b a c k  kG e t R t f C o m m a n d   w a s   c a l l e d   w i t h   i n c o r r e c t   s u b D o c u m e n t I d  cI n s e r t R t f C o m m a n d   c o u l d   b e   c a l l e d   o n l y   o n   c a l l b a c k  kO n l y   S t a t i c   e v e n t   h a n d l e r s   a r e   a l l o w e d   f o r   t h i s   e v e n t  wA d d W o r d T o D i c t i o n a r y C o m m a n d   c o u l d   b e   c a l l e d   o n l y   o n   c a l l b a c k  d x r e D i a l o g _  d x r e - /d x r e - d i a l o g C o n t e n t G r o u p 'd x r e - d i a l o g F i r s t L G B #d x r e - d i a l o g F o o t e r M a i n P a n e l  /d x r e - d i a l o g W r a p p e r P a n e l F o r m L a y o u t  !d x r e D l g F o o t e r B t n  d x r e - E m p t y L i n e 'd o w n l o a d R e q u e s t T y p e  p a r a m e t e r s  c  d o c u m e n t F o r m a t  D o c u m e n t 1  P r i n t  	. p d f  
S t r o n g  E m p h a s i s  !I n t e n s e   E m p h a s i s  S u b t l e   E m p h a s i s  B o o k   T i t l e  N o   S p a c i n g  L i s t   P a r a g r a p h  H e a d i n g   1  H e a d i n g   2  H e a d i n g   3  H e a d i n g   4  H e a d i n g   5  H e a d i n g   6  H e a d i n g   7  H e a d i n g   8  H e a d i n g   9  T O C   { 0 }  S u b t i t l e  T i t l e  Q u o t e  I n t e n s e   Q u o t e  !G r i d   T a b l e   L i g h t  P l a i n   T a b l e   1  P l a i n   T a b l e   2  P l a i n   T a b l e   3  P l a i n   T a b l e   4  P l a i n   T a b l e   5    A c c e n t   1    A c c e n t   2    A c c e n t   3    A c c e n t   4    A c c e n t   5    A c c e n t   6  %G r i d   T a b l e   1   L i g h t  G r i d   T a b l e   2  G r i d   T a b l e   3  G r i d   T a b l e   4  #G r i d   T a b l e   5   D a r k  +G r i d   T a b l e   6   C o l o r f u l  +G r i d   T a b l e   7   C o l o r f u l  A a B b C c D d E e  	G u i d  r i c h e d i t  #I n t e r n a l E x c e p t i o n  +C l i e n t G u i d   i s   u n k n o w n  i m g  p s i m g  c s i m g  t s i m g  i m a g e / p n g  f o n t I n f o s  , ,  !e d i t o r C l i e n t G u i d  m o d i f i e d  D o c u m e n t P a t h  C u r r e n t F o r m a t  w d  r o  b o  d c o  s c o  e o  a o  l p i d s  ,  c l i e n t s  I m a g e L o a d i n g U r l  kD e v E x p r e s s . W e b . A S P x R i c h E d i t . I m a g e s . r e I m a g e L o a d i n g . g i f  GR i c h E d i t D e f a u l t F o n t s A n d P r e s e t S t y l e s  )R i c h E d i t L o c a l i z a t i o n  cA S P x C l i e n t R i c h E d i t . A S P x R i c h E d i t D i a l o g L i s t . T i t l e s =  B o r d e r S h a d i n g  !I n s e r t M e r g e F i e l d  E x p o r t R a n g e  F i n d R e p l a c e  O p e n F i l e  P a g e S e t u p  S a v e A s F i l e  )B u l l e t e d A n d N u m b e r i n g  +C u s t o m i z e N u m b e r e d L i s t  +C u s t o m i z e B u l l e t e d L i s t  1C u s t o m i z e O u t l i n e N u m b e r e d  kA S P x C l i e n t R i c h E d i t . A S P x R i c h E d i t D i a l o g L i s t . A l e r t T e x t s =  	C t r l  C o m m a n d  mA S P x C l i e n t R i c h E d i t . A S P x R i c h E d i t D i a l o g L i s t . O t h e r L a b e l s =  9C o n f i r m T o R e w r i t e E x i s t i n g F i l e  F i n d N o R e s u l t  #F i n d T o o L o n g R e s u l t  !R e p l a c e A l l N o t i f y  +N o S p e l l i n g S u g g e s t i o n s  IA S P x C l i e n t R i c h E d i t . Q u i c k S e a r c h P a n e l =  N o M a t c h e s  O f  MA S P x C l i e n t R i c h E d i t . S e q C a p t i o n P r e f i x e s =  F i g u r e P r e f i x  T a b l e P r e f i x  E q u a t i o n P r e f i x  AA S P x C l i e n t R i c h E d i t . C o m m o n L a b e l s =  #N o T o c E n t r i e s F o u n d  -C l i c k T o F o l l o w H y p e r l i n k  ?C u r r e n t D o c u m e n t H y p e r l i n k T o o l t i p  q_ _ a s p x R i c h E d i t . S t y l e s M a n a g e r . p r e s e t S t y l e s L o c a l i z e d N a m e s =  s t a t e  !a p p l i c a t i o n / j s o n  gF i e l d U p d a t e C o m m a n d   c o u l d   b e   c a l l e d   o n l y   o n   c a l l b a c k  _T e x t . L e n g t h   i s   n o t   e q u a l   t o   P a r a m e t e r s . L e n g t h :    )G e t   u n k n o w n   r u n   t y p e  7U R I   s c h e m e   i s   n o t   s u p p o r t e d  h t t p s : / /  s t y l e  c o l o r I n d e x  w i d t h  
o f f s e t  
s h a d o w  d x r e C o n t r o l S y s  +d x r e N o t I n t e r n a l R i b b o n  d x - s v g - i m a g e s d x r e V i e w  d x r e P a g e  c e l l p a d d i n g  c e l l s p a c i n g  	M a i n  Q S  	Q S P W  Q S P B E  Q S P P r e v B t n  Q S P N e x t B t n  Q S P C o l l a p s e B t n  Q S P C l o s e B t n  d x r e Q u i c k S e a r c h  7d x r e Q u i c k S e a r c h P a n e l W r a p p e r  3d x r e Q u i c k S e a r c h B u t t o n E d i t  +d x r e Q u i c k S e a r c h B u t t o n  5d x r e Q u i c k S e a r c h B u t t o n H o v e r  B a r  L P C  d x r e B a r  d x r e D i a l o g  R E P U M  f u n c t i o n ( ) { }  { 0 }  I C - R E C  	R E P C  	R E F M  	R E C E  R E I T S  	R E S L  Gd a t a : i m a g e \ / ( . + ) ; b a s e 6 4 , ( ? < d a t a > . * )  	d a t a  7d x r e - h e a d e r s A n d F o o t e r s G r o u p N a v i g a t i o n G r o u p  3d x r e - d i a l o g C e l l N a v i g a t i o n p o s i t i o n  	R E D C     vމBxOwe(Q         ]  u   ]     
   U ]  9  m  q  u  y  }           9 A E = I M e             , I 
 i uuptAE  =   Q 	  =     |||||| hh ,,

    aqu    )  0000 u]lu@hhp@ ttHpDlHx 5hlptx!%Ihhhh-hh1h5hhah    	           	  
 
  ] ]        
  T 
\X `                 9  d      ]         	 m           	  u  y	  	 }y }
 }  } - 
     
Q 
Q qq 	    q  q
 Q         	      %   0 

!   	          %  ) i 	h% %(  5
  m         A m  
 mm 	 mm	  )  i  9 = A E I M e  `   
   Y Y    Y   	84  mmm m  Q0  

u0 u 	 ]	  uuu    qu	uu	u  q  y       
u `
 	     	u  	   u(   
- 5 1 !
	   e    	 a     u	u  
       ]   ,,,,,,,,      ,, ,,	   ,      	        
l  %  1
 1 
 Q 
p  )1!  /!!    DH!  ]u](	(  1!!  1   1u](     e  u9u=  QQ= 9  E   E E  ( },   Q Q   ]HLPT\ `dhlpt  ix
q
u

y| y q  u u
 
 


  
 

=	  ! Q  
Q=                 
  
] 
     
  	       

 
	

  
   
 
	 

  	==  
	
   


 	




!
%
)  ) 	 	e

 1 !   5  9 e =
  =    E  I  M   e 

   U5%)-159
%
)  % )	u 9  Q] a  eiUm - 1A=  u	u     	  ==	 == =  	qAu u  EI    a}E    
 u)qEu I    	!I  ]a  5 ]5  1  5
M
Q a5Um     eaYYaY
e uY
0 u 
Y  q5  
  i5
m eea   Uq	 uU
U  
qUa    
 ] YUUY}Y}
 Y5
}
mUU      
       q  	]
]} a}a
u
 5	 AUqaMa  UUUUY 
}5Yea
= 
 Y5
i   	aa           !   UUqY}
	 #eYYY
#eYYYe}}}}  ))
eY}Y}YYYU	eYe}}}}mUq   - } 
aaY}UaY}Y} 
  5 5 
   9   = 
A  E  I   Q eY}}}}YeY}}	eYYYqa}}a ] ],eYYa}}a}Ya}}a}e
  ]
a a  e i m qUUUHu
 u y    u
   9<
9   9u9
9YU}Y}Y}qqaaqaa
U}} 
eY}Y}YY}UaeY}UUaYeY}UUa#eY}YYYYUUUUYe}}}}
ii}aYYa qm          		   i 
u u


   	u u  u 
  u                     Q  

   
  
!
!|  %      	   -    9
9  1= Q  
1=1
1  	5
55
5  A
A)=11
  =1=1    
 
   uA A    I
 
 o+A	!%)-159=  }A		Q Q  
	 Q   e    M  MM M19  9  M-1  -  1  %  )  a        q
     }U Y	  
  Y  	UY
Y  	 
  a
   }a	 =u= Q=u=
 u  
  
A  	
=  

  
E=  Q = m  u    

  
  	 
1 		  'u
   	  -	  1	
	  9
u
8   
8	 	
	   %        EAE)
  --
	1)  1u1

  --!	 1 !99        5 =    
1===1 	 ==	 == 1 1 1  1 1 1     
 
     q=u
  
AE            e\| e  
| e		 	 	 = ==
u]      i 


            
 
 
 
 
 
   q
 
u  y  -  1  5    
- -
1 1
5 5
H   }     y } y   		    
 } |    5    	 


 

     
  	 
   

 

h    

m	i  
	 
(55 55  5     
	xtqA


tEA))  )
) ) )  %Q  
 	
	 )
  ]
 uu
           Q9
 599  59959i=m=  AiA=A	= ===A	A  	 A==AEAqMu IIM I M  =   U   	Y  Y]u]1 1 
    !  %    I   

 
! !
% %  I
iEmE  IuIE
 I EE	EmAA  =	AEAI AAA=A A 	
a
	 
	  i        )                qee  
) )
 

 
 
 
 
 qeu
  u  m  q  u  }py
q q
u uqy
qyu
} }  tqu
  u-	|=E=At=U=a	
Q=  

 Q             }    	   
  


  
     

 
]
   !}  %}]A
 Eeee eee Y)
=  = =	
   ==





  


QQ  

=	 ` 
	    =  	  Q    	
 9 9 99	     1	 ==
 =8]
u8] ]`u8] 
= = <}
<
A A
@u@@  =|   =     E 	  	

= .%)-1=
@hu@h@h=     a=Q 


e!
 !59  5(	
	 e< 	     i 	  		 <}  y 		II I m		 
		E  E 			 

 

	#=  quy         ,   	 
@u@@
@u@@
@u@@ttt     
t    
Q  
x  	
<AA= q 	    	   	     } @5
@u@@
5   
5y  y     y   a ]	  y	   %	 
@u@@
5   
5e e 	 e   ! u!   % u%  e  u!(


@u@@
5,   
50     -&
5 	 55$55
55
55
5

5Yma   a5m   Q5@]
u@]u@]=A
  ==	  E A	 	 	 8
====AA= Q===QA=AQ='	=========	 	=
AAAH(AAAAAAAAAAAAAAA 4 ]quDIM   MM    ]U Y]aUU Y  a Y  U U ]] ]] ]iUq	 iU5  
 5 %Pe ei 
 iTe&mmmmmmmm   }  mm
 Yq  q   uu  e     u   u            u %    
   0  
#	==== ]] 1= 
      
) 	  \eA=%  `    	  u *=	
 =Q  )d	 -e   	   y	 ]
uh =)Y====AA=E=EAE  
!
x=	 I
	 	I	 II
 	I|A

 ]]u  AA==
==
Dpu@DpDp  duHduDDp
 AuDxuDxDx
Dx   	    	 qMuqQuqUuqYu==  	
,=
Q=Y ]
-




,y a  1  e =1	 	
e e 	
A  
q == A.e
e    
  	      
    
 
   
            
5A]   ] ] ]   	 ]EqEh   ] I
	M  M IMMM I#==e!  m     	            M     m Y
  m


D048<@
D0 
0
4
8
<
@
Htx
H
t
xL|
L
|

/P
P













)
T
T











X,
X
,\ $(
\
 
$
(
`D
`
DdH
d
HhP
h
PlTX
l
T
Xp\`dh
p
\
`
d
htl
t
lxp
x
p
|(
|




(@

@

























tx

t
x|

|























$(,0


$
(
,
048

4
8<

<#LPTX\`dhlp

L
P
T
X
\
`
d
h
l
p



p
t
|
x









 


,
0
48\

8
\

 !
mq    	     4y}  }  ! HHL
HL
L	 ee ey   	    	 lY       E  )}
-	  -    u0u
u1
11u5
55uM
MMum
mmui
iiu]
]]u}
}}u9
99u=
==u
u
uQ
QQuA
AAu
uq
qq
UU
0uu
u
u
ua
aa
99
uE
Eu
ua
aauI
II
YYu
u
up
epu
u
u
u
QmU
0 
UQm Q M Qmz\V4?_
:T 䚀 $          $  RSA1     ͌$L\J|-fQ UkKT+VHv)Z"[to=>T|[&n:gQ$y 2BMSZ6sYVn8hBdMY8]
'                @D e v E x p r e s s . W e b . A S P x R i c h E d i t . C s s . HD e v E x p r e s s . W e b . A S P x R i c h E d i t . S c r i p t s . ND e v E x p r e s s . W e b . A S P x R i c h E d i t . S c r i p t s . U I . FD e v E x p r e s s . W e b . A S P x R i c h E d i t . I m a g e s . TD e v E x p r e s s . W e b . A S P x R i c h E d i t . C s s . S y s t e m . c s s VD e v E x p r e s s . W e b . A S P x R i c h E d i t . C s s . D e f a u l t . c s s TD e v E x p r e s s . W e b . A S P x R i c h E d i t . C s s . s p r i t e . c s s VD e v E x p r e s s . W e b . A S P x R i c h E d i t . C s s . I S p r i t e . c s s XD e v E x p r e s s . W e b . A S P x R i c h E d i t . C s s . G I S p r i t e . c s s ZD e v E x p r e s s . W e b . A S P x R i c h E d i t . C s s . S V G S p r i t e . c s s ^D e v E x p r e s s . W e b . A S P x R i c h E d i t . C s s . W T S V G S p r i t e . c s s ZD e v E x p r e s s . W e b . A S P x R i c h E d i t . C s s . G W I S p r i t e . c s s \D e v E x p r e s s . W e b . A S P x R i c h E d i t . C s s . G W T I S p r i t e . c s s ^D e v E x p r e s s . W e b . A S P x R i c h E d i t . S c r i p t s . R i c h E d i t . j s fD e v E x p r e s s . W e b . A S P x R i c h E d i t . S c r i p t s . L o c a l i z a t i o n . j s pD e v E x p r e s s . W e b . A S P x R i c h E d i t . S c r i p t s . c l i e n t B a s e S c r i p t s . j s ^D e v E x p r e s s . W e b . A S P x R i c h E d i t . S c r i p t s . c o m p i l e d . j s bD e v E x p r e s s . W e b . A S P x R i c h E d i t . S c r i p t s . U I . D i a l o g s . j s jD e v E x p r e s s . W e b . A S P x R i c h E d i t . S c r i p t s . U I . F i l e M a n a g e r . j s nD e v E x p r e s s . W e b . A S P x R i c h E d i t . S c r i p t s . U I . F o l d e r M a n a g e r . j s nD e v E x p r e s s . W e b . A S P x R i c h E d i t . S c r i p t s . U I . U p l o a d C o n t r o l . j s D e v E x p r e s s . W e b . A S P x R i c h E d i t . S c r i p t s . U I . F i l e M a n a g e r U p l o a d C o n t r o l . j s |D e v E x p r e s s . W e b . A S P x R i c h E d i t . S c r i p t s . R i c h E d i t C u s t o m R e s o u r c e s . j s RD e v E x p r e s s . W e b . A S P x R i c h E d i t . I m a g e s . C u r s o r \D e v E x p r e s s . W e b . A S P x R i c h E d i t . I m a g e s . C u r s o r T o u c h RD e v E x p r e s s . W e b . A S P x R i c h E d i t . I m a g e s . s p r i t e TD e v E x p r e s s . W e b . A S P x R i c h E d i t . I m a g e s . I S p r i t e VD e v E x p r e s s . W e b . A S P x R i c h E d i t . I m a g e s . G I S p r i t e XD e v E x p r e s s . W e b . A S P x R i c h E d i t . I m a g e s . S V G S p r i t e \D e v E x p r e s s . W e b . A S P x R i c h E d i t . I m a g e s . W T S V G S p r i t e XD e v E x p r e s s . W e b . A S P x R i c h E d i t . I m a g e s . G W I S p r i t e ZD e v E x p r e s s . W e b . A S P x R i c h E d i t . I m a g e s . G W T I S p r i t e LD e v E x p r e s s . W e b . A S P x R i c h E d i t . I m a g e s . 1 x 1 jD e v E x p r e s s . W e b . A S P x R i c h E d i t . I m a g e s . r e I m a g e L o a d i n g . g i f R R E D C 
R E P U M % R i c h E d i t R E U C U P 
c g u i d 
s c m d s i s c v i e w M e r g e D a t a (r e L o a d i n g O n S t a t u s B a r  r e E r r o r U n d e r l i n e *Q u i c k S e a r c h P r e v B u t t o n *Q u i c k S e a r c h N e x t B u t t o n 2Q u i c k S e a r c h C o l l a p s e B u t t o n ,Q u i c k S e a r c h C l o s e B u t t o n r e A n c h o r "r e A u t o S c r o l l A r r o w &r e A u t o S c r o l l C u r s o r N (r e A u t o S c r o l l C u r s o r N S &r e A u t o S c r o l l C u r s o r S s t a r t T a b l e M a r k I S p r i t e G I S p r i t e G W I S p r i t e        "A l i g n B o t t o m C e n t e r A l i g n B o t t o m L e f t  A l i g n B o t t o m R i g h t "A l i g n M i d d l e C e n t e r A l i g n M i d d l e L e f t  A l i g n M i d d l e R i g h t A l i g n T o p C e n t e r A l i g n T o p L e f t A l i g n T o p R i g h t B o o k m a r k B o r d e r T o p B o r d e r B o t t o m B o r d e r L e f t B o r d e r R i g h t ,B o r d e r I n s i d e H o r i z o n t a l (B o r d e r I n s i d e V e r t i c a l B o r d e r s A l l B o r d e r s B o x B o r d e r s C u s t o m B o r d e r s G r i d B o r d e r s N o n e C o p y C u t  D e l e t e _ H y p e r l i n k 4F l o a t i n g O b j e c t B r i n g F o r w a r d @F l o a t i n g O b j e c t B r i n g I n F r o n t O f T e x t 4F l o a t i n g O b j e c t B r i n g T o F r o n t @F l o a t i n g O b j e c t B r i n g T o F r o n t O f T e x t 6F l o a t i n g O b j e c t L a y o u t O p t i o n s 4F l o a t i n g O b j e c t S e n d B a c k w a r d 8F l o a t i n g O b j e c t S e n d B e h i n d T e x t 0F l o a t i n g O b j e c t S e n d T o B a c k F o n t H y p e r l i n k I n d e n t D e c r e a s e I n d e n t I n c r e a s e  I n s e r t T a b l e C e l l s 6I n s e r t T a b l e C o l u m n s T o T h e L e f t 8I n s e r t T a b l e C o l u m n s T o T h e R i g h t (I n s e r t T a b l e R o w s A b o v e (I n s e r t T a b l e R o w s B e l o w L e f t C o l u m n s L i s t B u l l e t s M e r g e T a b l e C e l l s O n e C o l u m n P a r a g r a p h 
P a s t e R i g h t C o l u m n s S e l e c t A l l S p e l l C h e c k S p l i t T a b l e C e l l s (T a b l e A u t o F i t C o n t e n t s $T a b l e A u t o F i t W i n d o w *T a b l e F i x e d C o l u m n W i d t h T a b l e P r o p e r t i e s T e x t W r a p I n l i n e &T e x t W r a p I n l i n e L a r g e T e x t W r a p B e h i n d &T e x t W r a p B e h i n d L a r g e *T e x t W r a p I n F r o n t O f T e x t 4T e x t W r a p I n F r o n t O f T e x t L a r g e T e x t W r a p S q u a r e &T e x t W r a p S q u a r e L a r g e T e x t W r a p T h r o u g h (T e x t W r a p T h r o u g h L a r g e T e x t W r a p T i g h t $T e x t W r a p T i g h t L a r g e (T e x t W r a p T o p A n d B o t t o m 2T e x t W r a p T o p A n d B o t t o m L a r g e T h r e e C o l u m n s T w o C o l u m n s (R e s t a r t N u m b e r i n g L i s t *C o n t i n u e N u m b e r i n g L i s t U p d a t e F i e l d  T o g g l e F i e l d C o d e s (L e f t I n d e n t D r a g H a n d l e *R i g h t I n d e n t D r a g H a n d l e 2F i r s t L i n e I n d e n t D r a g H a n d l e $R i g h t T a b D r a g H a n d l e "L e f t T a b D r a g H a n d l e (D e c i m a l T a b D r a g H a n d l e &C e n t e r T a b D r a g H a n d l e 2C o l u m n S e p a r a t o r D r a g H a n d l e   R  m    8    @        d x r e d x r e C o n t r o l S y s d x r e V i e w d x r e P a g e 0d x r e I n p u t T a r g e t C o n t a i n e r d x r e B a r  d x r e L o a d i n g P a n e l *d x r e N o t I n t e r n a l R i b b o n d x r e D i a l o g d x - s v g - i m a g e s d x r e Q u i c k S e a r c h *d x r e Q u i c k S e a r c h B u t t o n 4d x r e Q u i c k S e a r c h B u t t o n H o v e r 6d x r e Q u i c k S e a r c h P a n e l W r a p p e r 2d x r e Q u i c k S e a r c h B u t t o n E d i t  Q u i c k S e a r c h P a n e l C o n t r o l S t y l e 
R u l e r R u l e r W r a p p e r R u l e r L i n e T a b D r a g H a n d l e             	   
         
                                                      !   "   #   $   %   &   '   (   )   *   +   ,   -   .   /   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   {   |   }   ~                                                                                                                                                                                                                                                                                                                                                                                                                         	  
      
                                         !  "  #  $  %  &  '  (  )  *  +  ,  -  .  /  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  {  |  }  ~                                                                                                                                                                                  (F o l d e r I n v a l i d M e s s a g e d x r e D l g S B d x r e D l g S M d x r e D l g S S       S u b m i t B u t t o n A a B b C c D d E e r i c h e d i t I C - 
R E I S E 
R E I S U 
R E I T S R E F M R E C E R E S L R E P C R E C  $(m(,H$q0
 
u	,u](|\hdt08<DMQUY
PLTXa`lpxL
uMQUeimyq]Y}hlpt  $(,0htx|	|	u] 8<8xh  $(,048<@DHLPTX\`dhlptx|
`u8]8u@u@h(u@u@u@t	u@u@u@	U	u@]9	=	A	uuu@DpuHduDDpuDx AIQ	,u4@D	H \t	1!	1x
|	uY		91=	1
5	A	u=

	E]	
 $048DHLMX%
pt	@hd	Dx	 HL$QmU        , 	 	   ,    $           H                   %  (  	 q        ) 1 5  i          
   (   	 m m m  0 0	           4 m m     	  	    !  e      , , , ,	 ,	 ,
 ,
  
  ,        %)( !	 !(   -  5	  u       $ $        |  \        h  d  t  0  8  <  D  M  Q  U  Y  @  P P  L L  T T P L T  X X  a  `  ( (  l  p  x  i  L            0  	 
   
     u 		 	
0   	  M M  Q Q  U U Y m  e e  i i  m m e   m U                q q     ] ]  Y       } }
 }Y      9    U	 Ye i          t t   % )	    u E	 E A	  I I  u u 	A=       5	 Q   U U] a  a]   y 	  
   	 yym m 
 u}  u	   u        ! ! 9 (  1	 1   	    	       \ \  	
  | |  | =  u]
 u]	   	      	 	      E      | h 	  	   5xh 5 5  xh 	    	
  % 	    - 1 	   5 = 
 	         
     
	  Q  U   8 < < <  A  ] E A      	    	  	  
      
  u   	  m 	 m	 mm m i	 i	 ii i	  	  	  	  I I      A A 	  E	 E	 
         
  Q    ` `	     8	  `   ` 
  
    	 	 	 	 	 	   h h
 h	   	 	 `( 
 	 	  
 	  
 	 	  t	 %	 x x	 	 	     
  
  }
 

  } 
 
 ya a y y
 y
 yq
 yu y
  e
 e
 e) e
 e e
 e
  
 
          U	 U
  1	 5 5
 }  
	   9 9   
  E=
  EA
  E   
 A  eA e= e MI AMQ =MQ MQ ]MQ] ]MUQ] MU M5 M mmmmM M i Y]	 \  y }  
 \ \ \  e\       
          
 	 % \t	  	     
 u \t  	   
 	  
 l    = 	 ==  
 h
 
 p@
 t
 tH
 pD
 lH  uDx
 x	 
  
 
 	  5 5
 55   
Q            l l	  p p t t  x x              	 5
   5 	  	 
 ]] 	 ]	 ]	 
 ]]	  ]
 ]]	 
 ]]
  ]]
 !! ]!]
  ]]
 %% ]%]	 ]
  ]]	 I]
 II ]I] 
  )	 
 ]  ]	 ] -]
 ] 1]
 ] 5]
 ]	 a] a] ] ]	 	I               =       U  A A  I I Q  Y a  	     	 me     4 4
 
 H0  	0   	  %   !  (   !  5 9 =1 1 5 A =  	      = A = A  E     E   	 

   
 
 h 
 
 
 
 
 
    ] ] ]=	      
 p	 	 d  d d	   	     		 	
 	 d 	
 x	  p  LH
 UQm(  ( ( ( ( ( 
( ( ( ,( (  ( ( ( ( ( ,( H( ( $( ( ( ( ( ( ( ( ( 	( u( (( q( ( ( ( m( ( ( 0( 
( (  ( 
( ,( ( (  ( $( ( ( ( |( \( ( ( ( h( d( t( 0( 8( <( ( D( ( ( ( 
( @( P( L( T( X( e( a( `( (( l( p( x( i( L( q( u( y( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( M( Q( U( e( i( m( ( ( ( q( ( ]( Y( ( ( }( ( ( ( u
( u ( 
( |
(  u]( ( i( m( q( u( }( ( ( ( ( ( ( ( ( ( `( ( ( 8( ( 	( ( ( !( %( -( ( 9
 E=
 EA
 E  ( 
( (  ( ( ( ( ( ( ( )( ( ( ( ( ( =( ( ( A( I( Q( 	(  ( ( ( ( ( ( ( d        TWrapNonExceptionThrows          ) $afe88cb7-3c0e-4efe-91fc-ab65d1c0371c    DevExpress.Web.ASPxRichEdit   Developer Express Inc.  3 .Copyright (c) 2000-2019 Developer Express Inc.  
 en-US     
 18.2.0.0  
 18.2.9.0  m gDevExpress.Web.v18.2.Design, PublicKey=0024000004800000940000000602000000240000525341310004000001000100dfcd8cadc2dd24a7cd4ce95c4a9c1b8e7cb1dc2d665120556b4b0ec35495fddb2bd6eed0ca1e56480276295a225ba2a9746f3d3e1a04547ccf5b26acc3f96eb2a13ac467512497aa79208e32f242fd0618014d53c95a36e5de0e891873841fa8f559566e38e968426488b4aa4d0f0b59e59f38dcf3fbccf25d990ab19c27ddc2  y sDevExpress.Web.ASPxRichEdit.v18.2.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100dfcd8cadc2dd24a7cd4ce95c4a9c1b8e7cb1dc2d665120556b4b0ec35495fddb2bd6eed0ca1e56480276295a225ba2a9746f3d3e1a04547ccf5b26acc3f96eb2a13ac467512497aa79208e32f242fd0618014d53c95a36e5de0e891873841fa8f559566e38e968426488b4aa4d0f0b59e59f38dcf3fbccf25d990ab19c27ddc2  # DevExpress.Web.ASPxRichEditdx  O *DevExpress.Web.ASPxRichEdit.Css.System.csstext/css TPerformSubstitutionP +DevExpress.Web.ASPxRichEdit.Css.Default.csstext/css TPerformSubstitutionO *DevExpress.Web.ASPxRichEdit.Css.sprite.csstext/css TPerformSubstitutionP +DevExpress.Web.ASPxRichEdit.Css.ISprite.csstext/css TPerformSubstitutionQ ,DevExpress.Web.ASPxRichEdit.Css.GISprite.csstext/css TPerformSubstitutionR -DevExpress.Web.ASPxRichEdit.Css.SVGSprite.csstext/css TPerformSubstitutionT /DevExpress.Web.ASPxRichEdit.Css.WTSVGSprite.csstext/css TPerformSubstitutionR -DevExpress.Web.ASPxRichEdit.Css.GWISprite.csstext/css TPerformSubstitutionS .DevExpress.Web.ASPxRichEdit.Css.GWTISprite.csstext/css TPerformSubstitutionR MDevExpress.Web.ASPxRichEdit.Internal.RichEditCustomWebResourceHandlerProvider  _ 3DevExpress.Web.ASPxRichEdit.Scripts.Localization.jstext/javascript TPerformSubstitution^ YDevExpress.Web.ASPxRichEdit.Internal.RichEditLocalizationCustomWebResourceHandlerProvider  X 8DevExpress.Web.ASPxRichEdit.Scripts.clientBaseScripts.jsREWebUtils,__aspxRichEdit  O /DevExpress.Web.ASPxRichEdit.Scripts.compiled.jsREWebUtils,__aspxRichEdit  D /DevExpress.Web.ASPxRichEdit.Scripts.RichEdit.jstext/javascript  F 1DevExpress.Web.ASPxRichEdit.Scripts.UI.Dialogs.jstext/javascript  J 5DevExpress.Web.ASPxRichEdit.Scripts.UI.FileManager.jstext/javascript  L 7DevExpress.Web.ASPxRichEdit.Scripts.UI.UploadControl.jstext/javascript  W BDevExpress.Web.ASPxRichEdit.Scripts.UI.FileManagerUploadControl.jstext/javascript  L 7DevExpress.Web.ASPxRichEdit.Scripts.UI.FolderManager.jstext/javascript  j >DevExpress.Web.ASPxRichEdit.Scripts.RichEditCustomResources.jstext/javascript TPerformSubstitution< -DevExpress.Web.ASPxRichEdit.Images.Cursor.gif	image/gif  A 2DevExpress.Web.ASPxRichEdit.Images.CursorTouch.gif	image/gif  < -DevExpress.Web.ASPxRichEdit.Images.sprite.png	image/png  = .DevExpress.Web.ASPxRichEdit.Images.ISprite.png	image/png  > /DevExpress.Web.ASPxRichEdit.Images.GISprite.png	image/png  C 0DevExpress.Web.ASPxRichEdit.Images.SVGSprite.svg
image/svg+xml  E 2DevExpress.Web.ASPxRichEdit.Images.WTSVGSprite.svg
image/svg+xml  B 3DevExpress.Web.ASPxRichEdit.Images.dt_SVGSprite.png	image/png  D 5DevExpress.Web.ASPxRichEdit.Images.dt_WTSVGSprite.png	image/png  ? 0DevExpress.Web.ASPxRichEdit.Images.GWISprite.png	image/png  @ 1DevExpress.Web.ASPxRichEdit.Images.GWTISprite.png	image/png  9 *DevExpress.Web.ASPxRichEdit.Images.1x1.gif	image/gif  J ;DevExpress.Web.ASPxRichEdit.Images.reLoadingOnStatusBar.gif	image/gif  F 7DevExpress.Web.ASPxRichEdit.Images.reErrorUnderline.gif	image/gif  > /DevExpress.Web.ASPxRichEdit.Images.reAnchor.png	image/png  K 8DevExpress.Web.ASPxRichEdit.Images.reAutoScrollArrow.svg
image/svg+xml  M :DevExpress.Web.ASPxRichEdit.Images.reAutoScrollCursorN.svg
image/svg+xml  N ;DevExpress.Web.ASPxRichEdit.Images.reAutoScrollCursorNS.svg
image/svg+xml  M :DevExpress.Web.ASPxRichEdit.Images.reAutoScrollCursorS.svg
image/svg+xml  H 5DevExpress.Web.ASPxRichEdit.Images.startTableMark.svg
image/svg+xml  D 5DevExpress.Web.ASPxRichEdit.Images.reImageLoading.gif	image/gif  p jDevExpress.Web.Bootstrap.v18.2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100dfcd8cadc2dd24a7cd4ce95c4a9c1b8e7cb1dc2d665120556b4b0ec35495fddb2bd6eed0ca1e56480276295a225ba2a9746f3d3e1a04547ccf5b26acc3f96eb2a13ac467512497aa79208e32f242fd0618014d53c95a36e5de0e891873841fa8f559566e38e968426488b4aa4d0f0b59e59f38dcf3fbccf25d990ab19c27ddc2  M .NETFramework,Version=v4.5.2 TFrameworkDisplayName.NET Framework 4.5.2      ^ YDevExpress.Web.ASPxRichEdit.Internal.WebRichEditStateBasedCommand`1+<GetStateObjects>d__2         ; 6You should use the 'RulerFirstLineIndentTitle' member.  9 4You should use the 'RulerHangingIndentTitle' member.  7 2You should use the 'RulerRightIndentTitle' member.  6 1You should use the 'RulerLeftIndentTitle' member.        DevExpress.Web.ASPxRichEdit.Design.ASPxRichEditDesigner, DevExpress.Web.v18.2.Design, Version=18.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a   ASPxRichEdit   E /DevExpress.Web.ASPxRichEdit.ToolboxBitmapAccessASPxRichEdit.bmp   DX.18.2: Common Controls  b ]<{0}:ASPxRichEdit runat="server" WorkDirectory="~\App_Data\WorkDirectory"></{0}:ASPxRichEdit>   DevExpress.Web.Internal.ASPxperienceLicenseProvider, DevExpress.Web.v18.2, Version=18.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a   DevExpress.Web.Design.CommonDesignerEditor, DevExpress.Web.v18.2.Design, Version=18.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a1System.Drawing.Design.UITypeEditor,System.Drawing  ' "RichEditDocumentInfoDocumentFormat  ! RichEditDocumentInfoModified  ' "RichEditDocumentInfoLastModifyTime   ASPxRichEditRibbonMode   Ribbon  8 U.DevExpress.Web.ASPxRichEdit.RichEditRibbonMode      ASPxRichEditRibbonTabs  + &ASPxRichEditRibbonContextTabCategories   ASPxRichEditActiveTabIndex  # ASPxRichEditAssociatedRibbonID   DevExpress.Web.Design.RibbonControlIDConverter, DevExpress.Web.v18.2.Design, Version=18.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a   ASPxRichEditShowStatusBar   	StatusBar  ) $ASPxRichEditSettingsDocumentSelector  
 Settings   ASPxRichEditReadOnly  
 Behavior    ASPxRichEditSettingsDialogs   ASPxRichEditImages   Images   ASPxRichEditImagesRuler   ASPxRichEditStyles   Styles   ASPxRichEditStylesRuler   ASPxRichEditStylesRibbon    ASPxRichEditStylesPopupMenu   ASPxRichEditStylesButton   ASPxRichEditStylesEditors  " ASPxRichEditStylesFileManager    ASPxRichEditStylesStatusBar  ! ASPxRichEditClientSideEvents   Client-Side  # ASPxRichEditClientInstanceName  $ ASPxRichEditEnableClientSideAPI   ASPxRichEditJSProperties   ASPxRichEditSettings   ASPxRichEditWorkDirectory  	 Misc  + &ASPxRichEditShowConfirmOnLosingChanges  ' "ASPxRichEditConfirmOnLosingChanges   ASPxRichEditViewMergedData   ASPxRichEditAutoSaveMode   UDevExpress.Web.Office.Internal.AutoSaveMode, DevExpress.Web.v18.2, Version=18.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a        ASPxRichEditAutoSaveTimeout  j \System.TimeSpan, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e08900:05:00  2 -RichEditClientSideEventsCustomCommandExecuted  1 ,RichEditClientSideEventsBeginSynchronization  / *RichEditClientSideEventsEndSynchronization  , 'RichEditClientSideEventsDocumentChanged  + &RichEditClientSideEventsDocumentLoaded  5 0RichEditClientSideEventsActiveSubDocumentChanged  ( #RichEditClientSideEventsPointerDown  & !RichEditClientSideEventsPointerUp  $ RichEditClientSideEventsKeyDown  " RichEditClientSideEventsKeyUp  , 'RichEditClientSideEventsContentInserted  + &RichEditClientSideEventsContentRemoved  7 2RichEditClientSideEventsCharacterPropertiesChanged  7 2RichEditClientSideEventsParagraphPropertiesChanged  ( #RichEditClientSideEventsAutoCorrect  - (RichEditClientSideEventsPopupMenuShowing  + &RichEditClientSideEventsHyperlinkClick  - (RichEditClientSideEventsSelectionChanged  %  RichEditClientSideEventsGotFocus  & !RichEditClientSideEventsLostFocus   RichEditImagesMenuIconSet   UxDevExpress.Web.MenuIconSetType, DevExpress.Web.v18.2, Version=18.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a      * %RichEditImagesLoadingPanelOnStatusBar  - (RichEditImagesQuickSearchPanelPrevButton  - (RichEditImagesQuickSearchPanelNextButton  1 ,RichEditImagesQuickSearchPanelCollapseButton  . )RichEditImagesQuickSearchPanelCloseButton  , 'RichEditRulerImagesDecimalTabDragHandle  ) $RichEditRulerImagesLeftTabDragHandle  * %RichEditRulerImagesRightTabDragHandle  + &RichEditRulerImagesCenterTabDragHandle  . )RichEditRulerImagesCellDivisionDragHandle  + &RichEditRulerImagesLeftIdentDragHandle  3 .Use the LeftIndentDragHandle property instead.  , 'RichEditRulerImagesLeftIndentDragHandle  , 'RichEditRulerImagesRightIdentDragHandle  4 /Use the RightIndentDragHandle property instead.  - (RichEditRulerImagesRightIndentDragHandle  0 +RichEditRulerImagesFirstLineIdentDragHandle  8 3Use the FirstLineIndentDragHandle property instead.  1 ,RichEditRulerImagesFirstLineIndentDragHandle   RichEditPopupMenuItemText  %  RichEditPopupMenuItemCommandName  # RichEditPopupMenuItemImageName  $ RichEditPopupMenuItemBeginGroup  * %RichEditPopupMenuItemCheckedGroupName   RichEditPopupMenuItemItems   Common  	 Undo   	Clipboard  	 Font   	Paragraph   Editing  
 Pages   Tables   
Illustrations  
 Links  	 Text   Symbols   
Page Setup   
Background   Table of Contents  
 Captions   
Insert Fields  	 View   Current Record   Finish  	 Show   Table Style Options   Table Styles   Border & Shadings  
 Table   Rows & Columns  
 Merge   	Cell Size   	Alignment   
Navigation   Options  
 Position  
 Close   Shape Styles   Arrange  7 2RichEditRibbonContextTabCategoryCollectionRichEdit  	 File  	 Home   Insert   Page Layout   	MailMerge   Review   
References   Design   Layout   HeaderAndFooter   Format   ASPxRichEditSettingsUnit  2 U(DevExpress.Web.ASPxRichEdit.RichEditUnit     ! ASPxRichEditSettingsBehavior  - (ASPxRichEditSettingsDocumentCapabilities  ( #ASPxRichEditSettingsHorizontalRuler  " ASPxRichEditSettingsBookmarks  %  ASPxRichEditSettingsSpellChecker  $ ASPxRichEditSettingsAutoCorrect  ) $ASPxRichEditSettingsRangePermissions  ' "ASPxRichEditSettingsAuthentication   ASPxRichEditSettingsViews   ASPxRichEditSettingsFields   ASPxRichEditSettingsExport  3 .RichEditDocumentSelectorSettingsCommonSettings  4 /RichEditDocumentSelectorSettingsEditingSettings  4 /RichEditDocumentSelectorSettingsFoldersSettings  4 /RichEditDocumentSelectorSettingsToolbarSettings  3 .RichEditDocumentSelectorSettingsUploadSettings  7 2RichEditDocumentSelectorSettingsPermissionSettings  5 0RichEditDocumentSelectorSettingsFileListSettings  9 4Use the ASPxRichEdit.WorkDirectory property instead.  2 -RichEditDocumentSelectorSettingsCustomCommand  ; 6RichEditFileManagerCommonSettingsAllowedFileExtensions  @ ;RichEditDocumentSelectorCommonSettingsAllowedFileExtensions  < 7RichEditFileManagerFoldersSettingsShowLockedFolderIcons  5 0RichEditFileManagerValidationSettingsMaxFileSize           2 -RichEditDocumentSelectorUploadSettingsEnabled  = 8RichEditDocumentSelectorUploadSettingsValidationSettings  . )RichEditDialogSettingsInsertPictureDialog  + &RichEditDialogSettingsInsertLinkDialog  ) $RichEditDialogSettingsSaveFileDialog  < 7RichEditInsertLinkDialogSettingsShowEmailAddressSection  = 8RichEditInsertPictureDialogSettingsShowFileUploadSection  5 0RichEditSaveFileDialogSettingsDisplaySectionMode  F U<DevExpress.Web.ASPxRichEdit.SaveFileDialogDisplaySectionMode      , 'ASPxRichEditSpellCheckerSettingsEnabled  8 3ASPxRichEditSpellCheckerSettingsLevenshteinDistance        4 /ASPxRichEditSpellCheckerSettingsSuggestionCount        , 'ASPxRichEditSpellCheckerSettingsCulture     1 ,ASPxRichEditSpellCheckerSettingsDictionaries  4 /ASPxRichEditSpellCheckerSettingsOptionsSpelling  4 /ASPxRichEditOptionsSpellingIgnoreUpperCaseWords  4 /ASPxRichEditOptionsSpellingIgnoreMixedCaseWords  6 1ASPxRichEditOptionsSpellingIgnoreWordsWithNumbers  3 .ASPxRichEditOptionsSpellingIgnoreRepeatedWords  , 'ASPxRichEditOptionsSpellingIgnoreEmails  ) $ASPxRichEditOptionsSpellingIgnoreUri  6 1ASPxRichEditFieldsSettingsUpdateFieldsBeforePrint  2 -ASPxRichEditFieldsSettingsUpdateFieldsOnPaste  & !ASPxRichEditViewsSettingsViewType  6 U,DevExpress.Web.ASPxRichEdit.RichEditViewType     ( #ASPxRichEditViewsSettingsSimpleView  + &ASPxRichEditSimpleViewSettingsPaddings  & !ASPxRichEditSimpleViewPaddingsAll        ' "ASPxRichEditSimpleViewPaddingsLeft  ( #ASPxRichEditSimpleViewPaddingsRight  & !ASPxRichEditSimpleViewPaddingsTop  ) $ASPxRichEditSimpleViewPaddingsBottom  D ?ASPxRichEditBookmarkSettingsDisplayBookmarksInPdfNavigationPane   UDevExpress.XtraRichEdit.PdfBookmarkDisplayMode, DevExpress.RichEdit.v18.2.Core, Version=18.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a      & !ASPxRichEditBookmarkSettingsColor  + &ASPxRichEditBookmarkSettingsVisibility   UDevExpress.XtraRichEdit.RichEditBookmarkVisibility, DevExpress.RichEdit.v18.2.Core, Version=18.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a      2 -ASPxRichEditRangePermissionSettingsVisibility  > 9ASPxRichEditRangePermissionSettingsHighlightBracketsColor  6 1ASPxRichEditRangePermissionSettingsHighlightColor  , 'ASPxRichEditAuthenticationSettingsEMail  , 'ASPxRichEditAuthenticationSettingsGroup  / *ASPxRichEditAuthenticationSettingsUserName  2 -ASPxRichEditHorizontalRulerSettingsVisibility   UDevExpress.XtraRichEdit.RichEditRulerVisibility, DevExpress.RichEdit.v18.2.Core, Version=18.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a      6 1ASPxRichEditHorizontalRulerSettingsShowLeftIndent  7 2ASPxRichEditHorizontalRulerSettingsShowRightIndent  0 +ASPxRichEditHorizontalRulerSettingsShowTabs  ) $ASPxRichEditBehaviorSettingsPrinting   UDevExpress.XtraRichEdit.DocumentCapability, DevExpress.RichEdit.v18.2.Core, Version=18.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a      %  ASPxRichEditBehaviorSettingsCopy  * %ASPxRichEditBehaviorSettingsCreateNew  $ ASPxRichEditBehaviorSettingsCut  %  ASPxRichEditBehaviorSettingsOpen  & !ASPxRichEditBehaviorSettingsPaste  %  ASPxRichEditBehaviorSettingsSave  ' "ASPxRichEditBehaviorSettingsSaveAs  %  ASPxRichEditBehaviorSettingsDrag  %  ASPxRichEditBehaviorSettingsDrop  * %ASPxRichEditBehaviorSettingsTabMarker  4 /ASPxRichEditBehaviorSettingsPageBreakInsertMode  + &ASPxRichEditBehaviorSettingsFullScreen  ) $ASPxRichEditBehaviorSettingsDownload  G BASPxRichEditBehaviorSettingsRaiseClientEventsOnModificationsViaAPI  + &ASPxRichEditBehaviorSettingsAcceptsTab  6 1ASPxRichEditDocumentCapabilitiesSettingsBookmarks  @ ;ASPxRichEditDocumentCapabilitiesSettingsCharacterFormatting  ; 6ASPxRichEditDocumentCapabilitiesSettingsCharacterStyle  3 .ASPxRichEditDocumentCapabilitiesSettingsFields  ; 6ASPxRichEditDocumentCapabilitiesSettingsHeadersFooters  7 2ASPxRichEditDocumentCapabilitiesSettingsHyperlinks  ; 6ASPxRichEditDocumentCapabilitiesSettingsInlinePictures  @ ;ASPxRichEditDocumentCapabilitiesSettingsParagraphFormatting  ; 6ASPxRichEditDocumentCapabilitiesSettingsParagraphStyle  7 2ASPxRichEditDocumentCapabilitiesSettingsParagraphs  : 5ASPxRichEditDocumentCapabilitiesSettingsParagraphTabs  5 0ASPxRichEditDocumentCapabilitiesSettingsSections  3 .ASPxRichEditDocumentCapabilitiesSettingsTables  7 2ASPxRichEditDocumentCapabilitiesSettingsTableStyle  6 1ASPxRichEditDocumentCapabilitiesSettingsTabSymbol  1 ,ASPxRichEditDocumentCapabilitiesSettingsUndo  * %ASPxRichEditNumberingSettingsBulleted  , 'ASPxRichEditNumberingSettingsMultiLevel  ( #ASPxRichEditNumberingSettingsSimple   UDevExpress.XtraRichEdit.CharacterFormattingDetailedOptions+Mask, DevExpress.RichEdit.v18.2.Core, Version=18.2.9.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a      < 7ASPxRichEditAutoCorrectSettingsEnableAutomaticNumbering  = 8ASPxRichEditAutoCorrectSettingsCorrectTwoInitialCapitals  . )ASPxRichEditAutoCorrectSettingsDetectUrls  8 3ASPxRichEditAutoCorrectSettingsReplaceTextAsYouType  A <ASPxRichEditAutoCorrectSettingsReplaceInfoCollectionSettings  F AASPxRichEditAutoCorrectReplaceInfoCollectionSettingsCaseSensitive  Y TASPxRichEditAutoCorrectReplaceInfoCollectionSettingsAutoCorrectReplaceInfoCollection  + &ASPxRichEditAutoCorrectReplaceInfoWhat  + &ASPxRichEditAutoCorrectReplaceInfoWith  %  RichEditFileManagerStylesControl  # ASPxRichEditCustomJSProperties   ASPxRichEditCallback   Action  * %ASPxRichEditCalculateDocumentVariable  & !ASPxRichEditSpellCheckerWordAdded  %  ASPxRichEditCustomizeMergeFields  & !ASPxRichEditInsertContentToClient  / *ASPxRichEditDocumentSelectorFolderCreating  - (ASPxRichEditDocumentSelectorItemRenaming  - (ASPxRichEditDocumentSelectorItemDeleting  + &ASPxRichEditDocumentSelectorItemMoving  . )ASPxRichEditDocumentSelectorFileUploading  , 'ASPxRichEditDocumentSelectorItemCopying   ASPxRichEditSaving           lSystem.Resources.ResourceReader, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089#System.Resources.RuntimeResourceSet         PADPADP^8+ł!ƂQi9iDw)c  .2EZ&3އ'6ӈӈՈ;Q<79&9'ֺY>ǋL苉y+Vc.RM#GC]r4;3.Ӕ'֔@ͦʕЈ͕ @Q'2>їi誘˘hX˚fsc6Λ|Y,?6u;(- OWkjl⟠|_شR 4YᕢףQ}U	3T6mg. D=Gt\ny$ܭoͮ3L>&gɞX]>i렳,$TAE1/,\۶iAjطJSoڽ*j牻bNpL&$b\@5f|ξ7WIeP|IԐÅR,K-KÞJđıFhdzĶ%c44dȾy=ʕ
u˞#kɂH=Ҙ8Ԟ̐ ^֔֩~S#Q@لsڱPmeAܠܶK+MxK;yyFD9|NED%0߬L3骤2ՍQo/25iSĻíL
x=RtW<hzuQ;0cpYXJ\&	}LGQuB~OUGLO4y Ȃ ѽ   c 7 Y><GI[Vj
zpn.n6#Fϋ}X1K	;[z5WpyZ%%:eb; *YLrBU.yҫwNLsIja;*l!+!/!.4!;4!)!iy#^#?$ŗ$$Ϣ$JE%Q%c%a&;>'2'!g))ey)$*0+GD+ʡ,D,L-0G.w...eR*//V-0o11D1#1*
d2Z3'
33^5K5 !6h/8;8h]"9I;R);=WG;a<f<P=<>69D>>c>C??dBsyjBzBBBCLnC}D{ojDkEÅFgGGG~-HcFHeiH%zHG|H$HHZuHҌH7oH$HHjII#J{JZKK*L̼7M7M7'OVɺO ټO
O/OOE:O`PPPʋTUdV>"W[WZY>iZ^[4[a:R[[t]G^}_L`P`/`ɺacT^cBkd
PsddRYee.Qee{p6f)fHgdh6'hUhhh	iEiUAj(k,kUkkRlEolҺl)mvn)yo}.proTvrtrr0sm,Msgct&sGuKu$uuvvvL?w`Kwdwfwexxxpy˛y˛yQy$yz}z
{|SK|e{|}R~"S   \[  ހ          ,    S  DD      #  _    J  Q  ϓ    *    :  &  }  9  >  .  F    wX  y  8T  Ԕ  0&  -  ?    /  3  s      H  [0      ˍ  b  B-  kx  3      4  җ    q  +  9H  t  5K    Z  Y`  &  Y  C^  "  JY  Z      >  `  Fr  V        C  o  #    /?  05  ^n  5  7    J  ݑ  ,l  `  M    <  p  v    2c  iM    ='    3N  K  ]  j  w|  r  n  \  e	    
  ~  }g  6  Ћ  Q.  ~  e  ~  P  y  _  i]   :  43    h  p  U  =    B  0      q  cq  )      O    y    d#  `z  /  |  [$  4G  _  R    -Z  X    $        >  ]  2  G*  %  VI  ~  cE  d  zA  *  *    e  *  o  al  Jm  a  aR  +  _~  }    3  G    W
  z8  
!  
  :Q  T  &a  1  D      K  j  pF  D2    a  9   f  0g  ~d  w  h  q    eB  N  }  c  CJ  @  P  B  m  8  4  v   i  t  C+  O  l    \  =    D@  x   <  ;  ^6  ~;  =;  A1  ,    J  7  z    n  0  n  %  d  Vu  /f  '  Hj  bs  N  i    S  T  1  XL  l    ?t  @      3  ?  8    g  l  z  I  l}  M  5  P    ؅  "  O4    q  w      6  W  
  `  (  we  &    +    >  w  Q  W  q  3  x  [  b  x  u  (  k  'S      r  *	  j  B  Z  bw  
  /    f  H  _  `  )h    Y    @
  s    Ry  J  L  /  U      Z  E    
#  .          W  6  x  E=  s  ߁  Sp  
=  ~<  9b  +7  o  T    j  XV  M  _  J  P  G  :  (X  )  3  sW    K  z   ?  cv  ]     \  Ci    5    Q{  8O  7o  k    ?U  @(  3  {  {    E  E  ~  3d  c  D/      M  '  Ŋ  A  A<    l!  e"  z%     $    p     4  	  S,  '    ^  U  z  E  i  K)  b    =  C  @            k  R  m  ]  |  |C    F  .  ?  	     -  Y  ,  R      B  
  )A  !  T9    4A S P x R i c h E d i t S t r i n g I d . A f t e r     <A S P x R i c h E d i t S t r i n g I d . A l i g n m e n t    8A S P x R i c h E d i t S t r i n g I d . A l l C a p s    8A S P x R i c h E d i t S t r i n g I d . A p p l y T o    .A S P x R i c h E d i t S t r i n g I d . A t &   8A S P x R i c h E d i t S t r i n g I d . A t L e a s t *   PA S P x R i c h E d i t S t r i n g I d . A u t h E x c e p t i o n s E r r o r 4   6A S P x R i c h E d i t S t r i n g I d . B e f o r e    :A S P x R i c h E d i t S t r i n g I d . B o d y T e x t    2A S P x R i c h E d i t S t r i n g I d . B o l d    >A S P x R i c h E d i t S t r i n g I d . B o l d I t a l i c    DA S P x R i c h E d i t S t r i n g I d . B o o k m a r k T i t l e    DA S P x R i c h E d i t S t r i n g I d . B o o k m a r k s _ A d d    VA S P x R i c h E d i t S t r i n g I d . B o o k m a r k s _ B o o k m a r k N a m e    JA S P x R i c h E d i t S t r i n g I d . B o o k m a r k s _ D e l e t e    FA S P x R i c h E d i t S t r i n g I d . B o o k m a r k s _ G o T o    NA S P x R i c h E d i t S t r i n g I d . B o o k m a r k s _ L o c a t i o n    FA S P x R i c h E d i t S t r i n g I d . B o o k m a r k s _ N a m e    XA S P x R i c h E d i t S t r i n g I d . B o o k m a r k s _ N a m e E r r o r T e x t   JA S P x R i c h E d i t S t r i n g I d . B o o k m a r k s _ S o r t B y *  NA S P x R i c h E d i t S t r i n g I d . B o r d e r S h a d i n g T i t l e 3  TA S P x R i c h E d i t S t r i n g I d . B o r d e r S h a d i n g _ B o r d e r s H  ZA S P x R i c h E d i t S t r i n g I d . B o r d e r S h a d i n g _ B o r d e r s A l l Q  ZA S P x R i c h E d i t S t r i n g I d . B o r d e r S h a d i n g _ B o r d e r s B o x V  `A S P x R i c h E d i t S t r i n g I d . B o r d e r S h a d i n g _ B o r d e r s C u s t o m [  jA S P x R i c h E d i t S t r i n g I d . B o r d e r S h a d i n g _ B o r d e r s D e s c r i p t i o n c  \A S P x R i c h E d i t S t r i n g I d . B o r d e r S h a d i n g _ B o r d e r s G r i d   \A S P x R i c h E d i t S t r i n g I d . B o r d e r S h a d i n g _ B o r d e r s N o n e   NA S P x R i c h E d i t S t r i n g I d . B o r d e r S h a d i n g _ F i l l   TA S P x R i c h E d i t S t r i n g I d . B o r d e r S h a d i n g _ S h a d i n g   6A S P x R i c h E d i t S t r i n g I d . B o t t o m   \A S P x R i c h E d i t S t r i n g I d . B u l l e t e d A n d N u m b e r i n g T i t l e   .A S P x R i c h E d i t S t r i n g I d . B y   BA S P x R i c h E d i t S t r i n g I d . C a n c e l B u t t o n   TA S P x R i c h E d i t S t r i n g I d . C a n t O p e n D o c u m e n t E r r o r   TA S P x R i c h E d i t S t r i n g I d . C a n t S a v e D o c u m e n t E r r o r %  ZA S P x R i c h E d i t S t r i n g I d . C a n t S a v e T o E m p t y P a t h E r r o r g  XA S P x R i c h E d i t S t r i n g I d . C e l l O p t i o n s _ C e l l M a r g i n s   XA S P x R i c h E d i t S t r i n g I d . C e l l O p t i o n s _ S a m e A s T a b l e   RA S P x R i c h E d i t S t r i n g I d . C e l l O p t i o n s _ W r a p T e x t   :A S P x R i c h E d i t S t r i n g I d . C e n t e r e d   BA S P x R i c h E d i t S t r i n g I d . C h a n g e B u t t o n   jA S P x R i c h E d i t S t r i n g I d . C h a r a c t e r F o r m a t t i n g S c r i p t _ N o r m a l   pA S P x R i c h E d i t S t r i n g I d . C h a r a c t e r F o r m a t t i n g S c r i p t _ S u b s c r i p t   tA S P x R i c h E d i t S t r i n g I d . C h a r a c t e r F o r m a t t i n g S c r i p t _ S u p e r s c r i p t   HA S P x R i c h E d i t S t r i n g I d . C h a r a c t e r S t y l e s ,  >A S P x R i c h E d i t S t r i n g I d . C h o o s e T y p e >  ^A S P x R i c h E d i t S t r i n g I d . C l i p b o a r d A c c e s s D e n i e d E r r o r Y  hA S P x R i c h E d i t S t r i n g I d . C l i p b o a r d A c c e s s D e n i e d E r r o r T o u c h 	  @A S P x R i c h E d i t S t r i n g I d . C l o s e B u t t o n   4A S P x R i c h E d i t S t r i n g I d . C o l o r   BA S P x R i c h E d i t S t r i n g I d . C o l u m n s T i t l e   @A S P x R i c h E d i t S t r i n g I d . C o l u m n s _ C o l   NA S P x R i c h E d i t S t r i n g I d . C o l u m n s _ E q u a l W i d t h   XA S P x R i c h E d i t S t r i n g I d . C o l u m n s _ N u m b e r O f C o l u m n s   HA S P x R i c h E d i t S t r i n g I d . C o l u m n s _ P r e s e t s   HA S P x R i c h E d i t S t r i n g I d . C o l u m n s _ S p a c i n g   DA S P x R i c h E d i t S t r i n g I d . C o l u m n s _ W i d t h   XA S P x R i c h E d i t S t r i n g I d . C o l u m n s _ W i d t h A n d S p a c i n g 
  VA S P x R i c h E d i t S t r i n g I d . C o n f i r m O n L o s i n g C h a n g e s    LA S P x R i c h E d i t S t r i n g I d . C o n t i n u e N u m b e r i n g v  >A S P x R i c h E d i t S t r i n g I d . C o n t i n u o u s   HA S P x R i c h E d i t S t r i n g I d . C r e a t e D a t e F i e l d   ^A S P x R i c h E d i t S t r i n g I d . C r e a t e D a t e F i e l d D e s c r i p t i o n   `A S P x R i c h E d i t S t r i n g I d . C r e a t e E m p t y D o c V a r i a b l e F i e l d   vA S P x R i c h E d i t S t r i n g I d . C r e a t e E m p t y D o c V a r i a b l e F i e l d D e s c r i p t i o n   TA S P x R i c h E d i t S t r i n g I d . C r e a t e E m p t y M e r g e F i e l d !  jA S P x R i c h E d i t S t r i n g I d . C r e a t e E m p t y M e r g e F i e l d D e s c r i p t i o n -  RA S P x R i c h E d i t S t r i n g I d . C r e a t e P a g e C o u n t F i e l d \  hA S P x R i c h E d i t S t r i n g I d . C r e a t e P a g e C o u n t F i e l d D e s c r i p t i o n f  HA S P x R i c h E d i t S t r i n g I d . C r e a t e P a g e F i e l d   ^A S P x R i c h E d i t S t r i n g I d . C r e a t e P a g e F i e l d D e s c r i p t i o n   HA S P x R i c h E d i t S t r i n g I d . C r e a t e T i m e F i e l d   ^A S P x R i c h E d i t S t r i n g I d . C r e a t e T i m e F i e l d D e s c r i p t i o n   FA S P x R i c h E d i t S t r i n g I d . C u r r e n t S e c t i o n   ^A S P x R i c h E d i t S t r i n g I d . C u s t o m i z e B u l l e t e d L i s t T i t l e   ^A S P x R i c h E d i t S t r i n g I d . C u s t o m i z e N u m b e r e d L i s t T i t l e   dA S P x R i c h E d i t S t r i n g I d . C u s t o m i z e O u t l i n e N u m b e r e d T i t l e *  fA S P x R i c h E d i t S t r i n g I d . D e l e t e C e l l s _ D e l e t e E n t i r e C o l u m n B  `A S P x R i c h E d i t S t r i n g I d . D e l e t e C e l l s _ D e l e t e E n t i r e R o w X  ^A S P x R i c h E d i t S t r i n g I d . D e l e t e C e l l s _ S h i f t C e l l s L e f t k  ZA S P x R i c h E d i t S t r i n g I d . D e l e t e C e l l s _ S h i f t C e l l s U p }  TA S P x R i c h E d i t S t r i n g I d . D e l e t e T a b l e C e l l s T i t l e   NA S P x R i c h E d i t S t r i n g I d . D i f f e r e n t F i r s t P a g e   PA S P x R i c h E d i t S t r i n g I d . D i f f e r e n t O d d A n d E v e n   \A S P x R i c h E d i t S t r i n g I d . D o c V a r i a b l e E x c e p t i o n E r r o r   6A S P x R i c h E d i t S t r i n g I d . D o u b l e   FA S P x R i c h E d i t S t r i n g I d . D o w n l o a d B u t t o n !  BA S P x R i c h E d i t S t r i n g I d . D o w n l o a d C o p y +  DA S P x R i c h E d i t S t r i n g I d . E d i t H y p e r l i n k <  8A S P x R i c h E d i t S t r i n g I d . E f f e c t s N  >A S P x R i c h E d i t S t r i n g I d . E r r o r T i t l e V  :A S P x R i c h E d i t S t r i n g I d . E v e n P a g e ]  8A S P x R i c h E d i t S t r i n g I d . E x a c t l y h  JA S P x R i c h E d i t S t r i n g I d . E x p o r t R a n g e T i t l e q  tA S P x R i c h E d i t S t r i n g I d . F i l e M a n a g e r _ O p e n e d F i l e D e l e t e E r r o r T e x t   pA S P x R i c h E d i t S t r i n g I d . F i l e M a n a g e r _ O p e n e d F i l e M o v e E r r o r T e x t   tA S P x R i c h E d i t S t r i n g I d . F i l e M a n a g e r _ O p e n e d F i l e R e n a m e E r r o r T e x t 	  :A S P x R i c h E d i t S t r i n g I d . F i l e N a m e F	  :A S P x R i c h E d i t S t r i n g I d . F i l e T y p e Q	  JA S P x R i c h E d i t S t r i n g I d . F i n d R e p l a c e T i t l e \	  ZA S P x R i c h E d i t S t r i n g I d . F i n d R e p l a c e _ A d v a n c e d F i n d n	  JA S P x R i c h E d i t S t r i n g I d . F i n d R e p l a c e _ F i n d }	  LA S P x R i c h E d i t S t r i n g I d . F i n d R e p l a c e _ I t e m s 	  TA S P x R i c h E d i t S t r i n g I d . F i n d R e p l a c e _ M a t c h C a s e 	  JA S P x R i c h E d i t S t r i n g I d . F i n d R e p l a c e _ N e x t 	  TA S P x R i c h E d i t S t r i n g I d . F i n d R e p l a c e _ N o M a t c h e s 	  RA S P x R i c h E d i t S t r i n g I d . F i n d R e p l a c e _ N o R e s u l t 	  FA S P x R i c h E d i t S t r i n g I d . F i n d R e p l a c e _ O f 	  RA S P x R i c h E d i t S t r i n g I d . F i n d R e p l a c e _ P r e v i o u s 	  PA S P x R i c h E d i t S t r i n g I d . F i n d R e p l a c e _ R e p l a c e 	  VA S P x R i c h E d i t S t r i n g I d . F i n d R e p l a c e _ R e p l a c e A l l 	  bA S P x R i c h E d i t S t r i n g I d . F i n d R e p l a c e _ R e p l a c e A l l N o t i f y 	  XA S P x R i c h E d i t S t r i n g I d . F i n d R e p l a c e _ R e p l a c e W i t h 
  PA S P x R i c h E d i t S t r i n g I d . F i n d R e p l a c e _ R e s u l t s '
  \A S P x R i c h E d i t S t r i n g I d . F i n d R e p l a c e _ T o o L o n g R e s u l t 0
  VA S P x R i c h E d i t S t r i n g I d . F i n i s h M e r g e _ A l l R e c o r d s z
  LA S P x R i c h E d i t S t r i n g I d . F i n i s h M e r g e _ C o u n t 
  \A S P x R i c h E d i t S t r i n g I d . F i n i s h M e r g e _ C u r r e n t R e c o r d 
  JA S P x R i c h E d i t S t r i n g I d . F i n i s h M e r g e _ F r o m 
  VA S P x R i c h E d i t S t r i n g I d . F i n i s h M e r g e _ J o i n T a b l e s 
  TA S P x R i c h E d i t S t r i n g I d . F i n i s h M e r g e _ M e r g e M o d e 
  ZA S P x R i c h E d i t S t r i n g I d . F i n i s h M e r g e _ N e w P a r a g r a p h 
  VA S P x R i c h E d i t S t r i n g I d . F i n i s h M e r g e _ N e w S e c t i o n 
  LA S P x R i c h E d i t S t r i n g I d . F i n i s h M e r g e _ R a n g e 
  <A S P x R i c h E d i t S t r i n g I d . F i r s t L i n e 
  >A S P x R i c h E d i t S t r i n g I d . F o l d e r P a t h 
  2A S P x R i c h E d i t S t r i n g I d . F o n t 
  <A S P x R i c h E d i t S t r i n g I d . F o n t C o l o r 
  :A S P x R i c h E d i t S t r i n g I d . F o n t S i z e   <A S P x R i c h E d i t S t r i n g I d . F o n t S t y l e   <A S P x R i c h E d i t S t r i n g I d . F o n t T i t l e "  6A S P x R i c h E d i t S t r i n g I d . F o o t e r (  :A S P x R i c h E d i t S t r i n g I d . F r o m E d g e 0  8A S P x R i c h E d i t S t r i n g I d . G e n e r a l ;  DA S P x R i c h E d i t S t r i n g I d . G r o u p C a p t i o n s D  FA S P x R i c h E d i t S t r i n g I d . G r o u p C l i p b o a r d N  @A S P x R i c h E d i t S t r i n g I d . G r o u p C o m m o n Y  NA S P x R i c h E d i t S t r i n g I d . G r o u p C u r r e n t R e c o r d a  RA S P x R i c h E d i t S t r i n g I d . G r o u p D o c u m e n t C o m m e n t q  TA S P x R i c h E d i t S t r i n g I d . G r o u p D o c u m e n t L a n g u a g e z  TA S P x R i c h E d i t S t r i n g I d . G r o u p D o c u m e n t P r o o f i n g   XA S P x R i c h E d i t S t r i n g I d . G r o u p D o c u m e n t P r o t e c t i o n   TA S P x R i c h E d i t S t r i n g I d . G r o u p D o c u m e n t T r a c k i n g   NA S P x R i c h E d i t S t r i n g I d . G r o u p D o c u m e n t V i e w s   BA S P x R i c h E d i t S t r i n g I d . G r o u p E d i t i n g   @A S P x R i c h E d i t S t r i n g I d . G r o u p F i n i s h   `A S P x R i c h E d i t S t r i n g I d . G r o u p F l o a t i n g O b j e c t s A r r a n g e   hA S P x R i c h E d i t S t r i n g I d . G r o u p F l o a t i n g O b j e c t s S h a p e S t y l e s   jA S P x R i c h E d i t S t r i n g I d . G r o u p F l o a t i n g P i c t u r e T o o l s A r r a n g e   rA S P x R i c h E d i t S t r i n g I d . G r o u p F l o a t i n g P i c t u r e T o o l s S h a p e S t y l e s   <A S P x R i c h E d i t S t r i n g I d . G r o u p F o n t   LA S P x R i c h E d i t S t r i n g I d . G r o u p H e a d e r F o o t e r   lA S P x R i c h E d i t S t r i n g I d . G r o u p H e a d e r F o o t e r T o o l s D e s i g n C l o s e   vA S P x R i c h E d i t S t r i n g I d . G r o u p H e a d e r F o o t e r T o o l s D e s i g n N a v i g a t i o n   pA S P x R i c h E d i t S t r i n g I d . G r o u p H e a d e r F o o t e r T o o l s D e s i g n O p t i o n s   rA S P x R i c h E d i t S t r i n g I d . G r o u p H e a d e r F o o t e r T o o l s D e s i g n P o s i t i o n $  NA S P x R i c h E d i t S t r i n g I d . G r o u p I l l u s t r a t i o n s .  LA S P x R i c h E d i t S t r i n g I d . G r o u p I n s e r t F i e l d s =  >A S P x R i c h E d i t S t r i n g I d . G r o u p L i n k s L  FA S P x R i c h E d i t S t r i n g I d . G r o u p M a i l M e r g e S  NA S P x R i c h E d i t S t r i n g I d . G r o u p M a i l M e r g e V i e w _  PA S P x R i c h E d i t S t r i n g I d . G r o u p P a g e B a c k g r o u n d e  FA S P x R i c h E d i t S t r i n g I d . G r o u p P a g e S e t u p q  >A S P x R i c h E d i t S t r i n g I d . G r o u p P a g e s }  FA S P x R i c h E d i t S t r i n g I d . G r o u p P a r a g r a p h   <A S P x R i c h E d i t S t r i n g I d . G r o u p S h o w   @A S P x R i c h E d i t S t r i n g I d . G r o u p S t y l e s   BA S P x R i c h E d i t S t r i n g I d . G r o u p S y m b o l s   RA S P x R i c h E d i t S t r i n g I d . G r o u p T a b l e O f C o n t e n t s   xA S P x R i c h E d i t S t r i n g I d . G r o u p T a b l e T o o l s D e s i g n B o r d e r s A n d S h a d i n g s   vA S P x R i c h E d i t S t r i n g I d . G r o u p T a b l e T o o l s D e s i g n T a b l e S t y l e O p t i o n s   jA S P x R i c h E d i t S t r i n g I d . G r o u p T a b l e T o o l s D e s i g n T a b l e S t y l e s   fA S P x R i c h E d i t S t r i n g I d . G r o u p T a b l e T o o l s L a y o u t A l i g n m e n t   dA S P x R i c h E d i t S t r i n g I d . G r o u p T a b l e T o o l s L a y o u t C e l l S i z e   ^A S P x R i c h E d i t S t r i n g I d . G r o u p T a b l e T o o l s L a y o u t M e r g e 
  pA S P x R i c h E d i t S t r i n g I d . G r o u p T a b l e T o o l s L a y o u t R o w s A n d C o l u m n s 
  ^A S P x R i c h E d i t S t r i n g I d . G r o u p T a b l e T o o l s L a y o u t T a b l e 
  @A S P x R i c h E d i t S t r i n g I d . G r o u p T a b l e s &
  <A S P x R i c h E d i t S t r i n g I d . G r o u p T e x t .
  <A S P x R i c h E d i t S t r i n g I d . G r o u p U n d o 4
  <A S P x R i c h E d i t S t r i n g I d . G r o u p V i e w :
  <A S P x R i c h E d i t S t r i n g I d . G r o u p Z o o m @
  8A S P x R i c h E d i t S t r i n g I d . H a n g i n g F
  6A S P x R i c h E d i t S t r i n g I d . H e a d e r O
  LA S P x R i c h E d i t S t r i n g I d . H e a d e r s A n d F o o t e r s W
  6A S P x R i c h E d i t S t r i n g I d . H e i g h t l
  6A S P x R i c h E d i t S t r i n g I d . H i d d e n t
  FA S P x R i c h E d i t S t r i n g I d . H y p e r l i n k T i t l e |
  NA S P x R i c h E d i t S t r i n g I d . H y p e r l i n k _ B o o k m a r k 
  `A S P x R i c h E d i t S t r i n g I d . H y p e r l i n k _ D i s p l a y P r o p e r t i e s 
  VA S P x R i c h E d i t S t r i n g I d . H y p e r l i n k _ E m a i l A d d r e s s 
  LA S P x R i c h E d i t S t r i n g I d . H y p e r l i n k _ E m a i l T o 
  VA S P x R i c h E d i t S t r i n g I d . H y p e r l i n k _ I n v a l i d E m a i l 
  dA S P x R i c h E d i t S t r i n g I d . H y p e r l i n k _ P l a c e I n T h i s D o c u m e n t 
  LA S P x R i c h E d i t S t r i n g I d . H y p e r l i n k _ S u b j e c t 
  FA S P x R i c h E d i t S t r i n g I d . H y p e r l i n k _ T e x t 
  LA S P x R i c h E d i t S t r i n g I d . H y p e r l i n k _ T o o l T i p 
  DA S P x R i c h E d i t S t r i n g I d . H y p e r l i n k _ U r l 
  LA S P x R i c h E d i t S t r i n g I d . H y p e r l i n k _ W e b P a g e   @A S P x R i c h E d i t S t r i n g I d . I n d e n t a t i o n   JA S P x R i c h E d i t S t r i n g I d . I n f o r m a t i o n T i t l e   RA S P x R i c h E d i t S t r i n g I d . I n n e r E x c e p t i o n s E r r o r (  BA S P x R i c h E d i t S t r i n g I d . I n s e r t B u t t o n   fA S P x R i c h E d i t S t r i n g I d . I n s e r t C e l l s _ I n s e r t E n t i r e C o l u m n   `A S P x R i c h E d i t S t r i n g I d . I n s e r t C e l l s _ I n s e r t E n t i r e R o w   ^A S P x R i c h E d i t S t r i n g I d . I n s e r t C e l l s _ S h i f t C e l l s D o w n   `A S P x R i c h E d i t S t r i n g I d . I n s e r t C e l l s _ S h i f t C e l l s R i g h t   tA S P x R i c h E d i t S t r i n g I d . I n s e r t C o n t e n t F r o m S e r v e r E x c e p t i o n E r r o r   JA S P x R i c h E d i t S t r i n g I d . I n s e r t I m a g e T i t l e <  RA S P x R i c h E d i t S t r i n g I d . I n s e r t I m a g e _ E n t e r U r l L  TA S P x R i c h E d i t S t r i n g I d . I n s e r t I m a g e _ F r o m L o c a l e  PA S P x R i c h E d i t S t r i n g I d . I n s e r t I m a g e _ F r o m W e b y  ZA S P x R i c h E d i t S t r i n g I d . I n s e r t I m a g e _ I m a g e P r e v i e w   fA S P x R i c h E d i t S t r i n g I d . I n s e r t I m a g e _ U p l o a d I n s t r u c t i o n s   TA S P x R i c h E d i t S t r i n g I d . I n s e r t M e r g e F i e l d T i t l e   XA S P x R i c h E d i t S t r i n g I d . I n s e r t M e r g e F i e l d _ F i e l d s   TA S P x R i c h E d i t S t r i n g I d . I n s e r t T a b l e C e l l s T i t l e   JA S P x R i c h E d i t S t r i n g I d . I n s e r t T a b l e T i t l e   `A S P x R i c h E d i t S t r i n g I d . I n s e r t T a b l e _ N u m b e r O f C o l u m n s   ZA S P x R i c h E d i t S t r i n g I d . I n s e r t T a b l e _ N u m b e r O f R o w s   TA S P x R i c h E d i t S t r i n g I d . I n s e r t T a b l e _ T a b l e S i z e *  ^A S P x R i c h E d i t S t r i n g I d . I n v a l i d D o c u m e n t F o r m a t E r r o r 6  JA S P x R i c h E d i t S t r i n g I d . I n v a l i d _ F i l e N a m e a  6A S P x R i c h E d i t S t r i n g I d . I t a l i c t  <A S P x R i c h E d i t S t r i n g I d . J u s t i f i e d |  0A S P x R i c h E d i t S t r i n g I d . K L T   <A S P x R i c h E d i t S t r i n g I d . L a n d s c a p e   6A S P x R i c h E d i t S t r i n g I d . L a y o u t   VA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ A b s o l u t e   fA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ A b s o l u t e P o s i t i o n   XA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ A l i g n m e n t   PA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ B e l o w   ZA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ B o o k L a y o u t   XA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ B o t h S i d e s   fA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ D i s t a n c e F r o m T e x t   ZA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ H o r i z o n t a l   rA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ H o r i z o n t a l B o o k L a y o u t O f   A S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ H o r i z o n t a l P o s i t i o n A l i g n m e n t I n s i d e   A S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ H o r i z o n t a l P o s i t i o n A l i g n m e n t O u t s i d e #  RA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ I n l i n e ,  \A S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ L a r g e s t O n l y ?  VA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ L e f t O n l y M  ZA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ L o c k A n c h o r X  dA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ L o c k A s p e c t R a t i o e  ^A S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ O r i g i n a l S i z e x  VA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ P o s i t i o n   VA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ R e l a t i v e   fA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ R e l a t i v e P o s i t i o n   ZA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ R e l a t i v e T o   PA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ R e s e t   XA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ R i g h t O n l y   RA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ R o t a t e   VA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ R o t a t i o n   PA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ S c a l e   NA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ S i z e   ^A S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ T e x t W r a p p i n g   ^A S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ T o T h e R i g h t O f   VA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ V e r t i c a l 
  VA S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ W r a p T e x t   `A S P x R i c h E d i t S t r i n g I d . L a y o u t O p t i o n s _ W r a p p i n g S t y l e "  2A S P x R i c h E d i t S t r i n g I d . L e f t 2  4A S P x R i c h E d i t S t r i n g I d . L e v e l 8  @A S P x R i c h E d i t S t r i n g I d . L i n e S p a c i n g ?  JA S P x R i c h E d i t S t r i n g I d . L o a d P i c t u r e E r r o r M  8A S P x R i c h E d i t S t r i n g I d . M a r g i n s h  HA S P x R i c h E d i t S t r i n g I d . M a r g i n s M o d e r a t e q  DA S P x R i c h E d i t S t r i n g I d . M a r g i n s N a r r o w {  DA S P x R i c h E d i t S t r i n g I d . M a r g i n s N o r m a l   @A S P x R i c h E d i t S t r i n g I d . M a r g i n s W i d e   PA S P x R i c h E d i t S t r i n g I d . M e n u C m d _ C r e a t e F i e l d   fA S P x R i c h E d i t S t r i n g I d . M e n u C m d _ C r e a t e F i e l d D e s c r i p t i o n   RA S P x R i c h E d i t S t r i n g I d . M e n u C m d _ F o o t e r O f f s e t   hA S P x R i c h E d i t S t r i n g I d . M e n u C m d _ F o o t e r O f f s e t D e s c r i p t i o n   RA S P x R i c h E d i t S t r i n g I d . M e n u C m d _ H e a d e r O f f s e t ]  hA S P x R i c h E d i t S t r i n g I d . M e n u C m d _ H e a d e r O f f s e t D e s c r i p t i o n o  bA S P x R i c h E d i t S t r i n g I d . M e n u C m d _ M a k e T e x t S e n t e n c e C a s e   xA S P x R i c h E d i t S t r i n g I d . M e n u C m d _ M a k e T e x t S e n t e n c e C a s e D e s c r i p t i o n   `A S P x R i c h E d i t S t r i n g I d . M e n u C m d _ S h o w C e l l O p t i o n s F o r m   vA S P x R i c h E d i t S t r i n g I d . M e n u C m d _ S h o w C e l l O p t i o n s F o r m D e s c r i p t i o n   ZA S P x R i c h E d i t S t r i n g I d . M e n u C m d _ T o g g l e F u l l S c r e e n   pA S P x R i c h E d i t S t r i n g I d . M e n u C m d _ T o g g l e F u l l S c r e e n D e s c r i p t i o n   XA S P x R i c h E d i t S t r i n g I d . M e n u C m d _ U p d a t e A l l F i e l d s 3  nA S P x R i c h E d i t S t r i n g I d . M e n u C m d _ U p d a t e A l l F i e l d s D e s c r i p t i o n F  PA S P x R i c h E d i t S t r i n g I d . M o d e l I s C h a n g e d E r r o r   :A S P x R i c h E d i t S t r i n g I d . M u l t i p l e $  8A S P x R i c h E d i t S t r i n g I d . N e w P a g e .  8A S P x R i c h E d i t S t r i n g I d . N o S p a c e 8  6A S P x R i c h E d i t S t r i n g I d . N o r m a l m  PA S P x R i c h E d i t S t r i n g I d . N u m b e r i n g _ A l i g n e d A t u  \A S P x R i c h E d i t S t r i n g I d . N u m b e r i n g _ B u l l e t C h a r a c t e r   ZA S P x R i c h E d i t S t r i n g I d . N u m b e r i n g _ B u l l e t P o s i t i o n   NA S P x R i c h E d i t S t r i n g I d . N u m b e r i n g _ B u l l e t e d   JA S P x R i c h E d i t S t r i n g I d . N u m b e r i n g _ C e n t e r   PA S P x R i c h E d i t S t r i n g I d . N u m b e r i n g _ C h a r a c t e r   PA S P x R i c h E d i t S t r i n g I d . N u m b e r i n g _ C u s t o m i z e   ^A S P x R i c h E d i t S t r i n g I d . N u m b e r i n g _ F o l l o w N u m b e r W i t h   FA S P x R i c h E d i t S t r i n g I d . N u m b e r i n g _ F o n t   NA S P x R i c h E d i t S t r i n g I d . N u m b e r i n g _ I n d e n t A t   FA S P x R i c h E d i t S t r i n g I d . N u m b e r i n g _ L e f t   HA S P x R i c h E d i t S t r i n g I d . N u m b e r i n g _ L e v e l    LA S P x R i c h E d i t S t r i n g I d . N u m b e r i n g _ N o t h i n g   VA S P x R i c h E d i t S t r i n g I d . N u m b e r i n g _ N u m b e r F o r m a t   ZA S P x R i c h E d i t S t r i n g I d . N u m b e r i n g _ N u m b e r P o s i t i o n   TA S P x R i c h E d i t S t r i n g I d . N u m b e r i n g _ N u m b e r S t y l e 0  NA S P x R i c h E d i t S t r i n g I d . N u m b e r i n g _ N u m b e r e d >  \A S P x R i c h E d i t S t r i n g I d . N u m b e r i n g _ O u t l i n e N u m b e r e d H  HA S P x R i c h E d i t S t r i n g I d . N u m b e r i n g _ R i g h t Z  HA S P x R i c h E d i t S t r i n g I d . N u m b e r i n g _ S p a c e a  LA S P x R i c h E d i t S t r i n g I d . N u m b e r i n g _ S t a r t A t h  VA S P x R i c h E d i t S t r i n g I d . N u m b e r i n g _ T a b C h a r a c t e r r  VA S P x R i c h E d i t S t r i n g I d . N u m b e r i n g _ T e x t P o s i t i o n   8A S P x R i c h E d i t S t r i n g I d . O d d P a g e   :A S P x R i c h E d i t S t r i n g I d . O k B u t t o n   >A S P x R i c h E d i t S t r i n g I d . O p e n B u t t o n   DA S P x R i c h E d i t S t r i n g I d . O p e n F i l e T i t l e   DA S P x R i c h E d i t S t r i n g I d . O p e n H y p e r l i n k   nA S P x R i c h E d i t S t r i n g I d . O p e n i n g A n d O v e r s t o r e I m p o s s i b l e E r r o r   8A S P x R i c h E d i t S t r i n g I d . O p t i o n s 3  @A S P x R i c h E d i t S t r i n g I d . O r i e n t a t i o n <  HA S P x R i c h E d i t S t r i n g I d . O t h e r L a b e l s _ A l l I  zA S P x R i c h E d i t S t r i n g I d . O t h e r L a b e l s _ C o n f i r m T o R e w r i t e E x i s t i n g F i l e N  JA S P x R i c h E d i t S t r i n g I d . O t h e r L a b e l s _ N o n e y  BA S P x R i c h E d i t S t r i n g I d . O u t l i n e L e v e l   0A S P x R i c h E d i t S t r i n g I d . P B B   :A S P x R i c h E d i t S t r i n g I d . P a g e F i l e   PA S P x R i c h E d i t S t r i n g I d . P a g e F l o a t i n g O b j e c t s   PA S P x R i c h E d i t S t r i n g I d . P a g e H e a d e r A n d F o o t e r   :A S P x R i c h E d i t S t r i n g I d . P a g e H o m e   >A S P x R i c h E d i t S t r i n g I d . P a g e I n s e r t   BA S P x R i c h E d i t S t r i n g I d . P a g e M a i l i n g s   FA S P x R i c h E d i t S t r i n g I d . P a g e P a g e L a y o u t   FA S P x R i c h E d i t S t r i n g I d . P a g e R e f e r e n c e s   >A S P x R i c h E d i t S t r i n g I d . P a g e R e v i e w   FA S P x R i c h E d i t S t r i n g I d . P a g e S e t u p T i t l e   HA S P x R i c h E d i t S t r i n g I d . P a g e T a b l e D e s i g n   HA S P x R i c h E d i t S t r i n g I d . P a g e T a b l e L a y o u t   :A S P x R i c h E d i t S t r i n g I d . P a g e V i e w   >A S P x R i c h E d i t S t r i n g I d . P a g i n a t i o n   4A S P x R i c h E d i t S t r i n g I d . P a p e r *  <A S P x R i c h E d i t S t r i n g I d . P a p e r S i z e 1  HA S P x R i c h E d i t S t r i n g I d . P a r a g r a p h S t y l e s =  DA S P x R i c h E d i t S t r i n g I d . P a r a g r a p h T a b 0 O  DA S P x R i c h E d i t S t r i n g I d . P a r a g r a p h T a b 1 d  FA S P x R i c h E d i t S t r i n g I d . P a r a g r a p h T i t l e z  JA S P x R i c h E d i t S t r i n g I d . P a t h D o e s N o t E x i s t   :A S P x R i c h E d i t S t r i n g I d . P o r t r a i t   8A S P x R i c h E d i t S t r i n g I d . P r e v i e w   HA S P x R i c h E d i t S t r i n g I d . R e m o v e H y p e r l i n k   NA S P x R i c h E d i t S t r i n g I d . R e q u i r e d F i e l d E r r o r   JA S P x R i c h E d i t S t r i n g I d . R e s t a r t N u m b e r i n g   4A S P x R i c h E d i t S t r i n g I d . R i g h t 
  PA S P x R i c h E d i t S t r i n g I d . R u l e r C e n t e r T a b T i t l e   RA S P x R i c h E d i t S t r i n g I d . R u l e r D e c i m a l T a b T i t l e   ZA S P x R i c h E d i t S t r i n g I d . R u l e r F i r s t L i n e I d e n t T i t l e ,  \A S P x R i c h E d i t S t r i n g I d . R u l e r F i r s t L i n e I n d e n t T i t l e .  VA S P x R i c h E d i t S t r i n g I d . R u l e r H a n g i n g I d e n t T i t l e A  XA S P x R i c h E d i t S t r i n g I d . R u l e r H a n g i n g I n d e n t T i t l e C  PA S P x R i c h E d i t S t r i n g I d . R u l e r L e f t I d e n t T i t l e S  RA S P x R i c h E d i t S t r i n g I d . R u l e r L e f t I n d e n t T i t l e U  LA S P x R i c h E d i t S t r i n g I d . R u l e r L e f t T a b T i t l e b  RA S P x R i c h E d i t S t r i n g I d . R u l e r M a r g i n L e f t T i t l e l  TA S P x R i c h E d i t S t r i n g I d . R u l e r M a r g i n R i g h t T i t l e y  RA S P x R i c h E d i t S t r i n g I d . R u l e r R i g h t I d e n t T i t l e   TA S P x R i c h E d i t S t r i n g I d . R u l e r R i g h t I n d e n t T i t l e   NA S P x R i c h E d i t S t r i n g I d . R u l e r R i g h t T a b T i t l e   BA S P x R i c h E d i t S t r i n g I d . S a v e A s B u t t o n   HA S P x R i c h E d i t S t r i n g I d . S a v e A s F i l e T i t l e   >A S P x R i c h E d i t S t r i n g I d . S a v e F i l e A s   BA S P x R i c h E d i t S t r i n g I d . S a v e T o S e r v e r   8A S P x R i c h E d i t S t r i n g I d . S e c t i o n   BA S P x R i c h E d i t S t r i n g I d . S e c t i o n S t a r t   BA S P x R i c h E d i t S t r i n g I d . S e l e c t B u t t o n   JA S P x R i c h E d i t S t r i n g I d . S e l e c t e d S e c t i o n s   VA S P x R i c h E d i t S t r i n g I d . S e s s i o n H a s E x p i r e d E r r o r   6A S P x R i c h E d i t S t r i n g I d . S i n g l e Q  8A S P x R i c h E d i t S t r i n g I d . S p a c i n g Y  8A S P x R i c h E d i t S t r i n g I d . S p e c i a l b  lA S P x R i c h E d i t S t r i n g I d . S p e l l i n g C h e c k C o m p l e t e d I n f o r m a t i o n k  DA S P x R i c h E d i t S t r i n g I d . S p e l l i n g T i t l e   ZA S P x R i c h E d i t S t r i n g I d . S p e l l i n g _ A d d T o D i c t i o n a r y   HA S P x R i c h E d i t S t r i n g I d . S p e l l i n g _ C h a n g e   NA S P x R i c h E d i t S t r i n g I d . S p e l l i n g _ C h a n g e A l l   HA S P x R i c h E d i t S t r i n g I d . S p e l l i n g _ D e l e t e   NA S P x R i c h E d i t S t r i n g I d . S p e l l i n g _ I g n o r e A l l   PA S P x R i c h E d i t S t r i n g I d . S p e l l i n g _ I g n o r e O n c e   fA S P x R i c h E d i t S t r i n g I d . S p e l l i n g _ N o S p e l l i n g S u g g e s t i o n s   ZA S P x R i c h E d i t S t r i n g I d . S p e l l i n g _ N o t I n D i c t i o n a r y   TA S P x R i c h E d i t S t r i n g I d . S p e l l i n g _ R e p e a t e d W o r d 
  RA S P x R i c h E d i t S t r i n g I d . S p e l l i n g _ S u g g e s t i o n s   TA S P x R i c h E d i t S t r i n g I d . S p l i t C e l l s _ M e r g e C e l l s +  RA S P x R i c h E d i t S t r i n g I d . S p l i t T a b l e C e l l s T i t l e E  RA S P x R i c h E d i t S t r i n g I d . S t r i k e o u t T y p e _ D o u b l e R  NA S P x R i c h E d i t S t r i n g I d . S t r i k e o u t T y p e _ N o n e Z  RA S P x R i c h E d i t S t r i n g I d . S t r i k e o u t T y p e _ S i n g l e `  4A S P x R i c h E d i t S t r i n g I d . S t y l e h  BA S P x R i c h E d i t S t r i n g I d . S y m b o l s T i t l e o  \A S P x R i c h E d i t S t r i n g I d . T a b l e O p t i o n s _ A l l o w S p a c i n g x  XA S P x R i c h E d i t S t r i n g I d . T a b l e O p t i o n s _ A u t o R e s i z e   hA S P x R i c h E d i t S t r i n g I d . T a b l e O p t i o n s _ D e f a u l t C e l l M a r g i n s   hA S P x R i c h E d i t S t r i n g I d . T a b l e O p t i o n s _ D e f a u l t C e l l S p a c i n g   RA S P x R i c h E d i t S t r i n g I d . T a b l e P r o p e r t i e s T i t l e   \A S P x R i c h E d i t S t r i n g I d . T a b l e P r o p e r t i e s _ A l i g n m e n t   lA S P x R i c h E d i t S t r i n g I d . T a b l e P r o p e r t i e s _ B o r d e r s A n d S h a d i n g   \A S P x R i c h E d i t S t r i n g I d . T a b l e P r o p e r t i e s _ C a n t S p l i t   RA S P x R i c h E d i t S t r i n g I d . T a b l e P r o p e r t i e s _ C e l l =  VA S P x R i c h E d i t S t r i n g I d . T a b l e P r o p e r t i e s _ C o l u m n C  ^A S P x R i c h E d i t S t r i n g I d . T a b l e P r o p e r t i e s _ I n d e n t L e f t K  \A S P x R i c h E d i t S t r i n g I d . T a b l e P r o p e r t i e s _ M e a s u r e I n ]  ^A S P x R i c h E d i t S t r i n g I d . T a b l e P r o p e r t i e s _ N e x t C o l u m n i  XA S P x R i c h E d i t S t r i n g I d . T a b l e P r o p e r t i e s _ N e x t R o w v  XA S P x R i c h E d i t S t r i n g I d . T a b l e P r o p e r t i e s _ O p t i o n s   fA S P x R i c h E d i t S t r i n g I d . T a b l e P r o p e r t i e s _ P r e f e r r e d W i d t h   fA S P x R i c h E d i t S t r i n g I d . T a b l e P r o p e r t i e s _ P r e v i o u s C o l u m n   `A S P x R i c h E d i t S t r i n g I d . T a b l e P r o p e r t i e s _ P r e v i o u s R o w   PA S P x R i c h E d i t S t r i n g I d . T a b l e P r o p e r t i e s _ R o w   \A S P x R i c h E d i t S t r i n g I d . T a b l e P r o p e r t i e s _ R o w H e i g h t   RA S P x R i c h E d i t S t r i n g I d . T a b l e P r o p e r t i e s _ S i z e   dA S P x R i c h E d i t S t r i n g I d . T a b l e P r o p e r t i e s _ S p e c i f y H e i g h t   TA S P x R i c h E d i t S t r i n g I d . T a b l e P r o p e r t i e s _ T a b l e   lA S P x R i c h E d i t S t r i n g I d . T a b l e P r o p e r t i e s _ V e r t i c a l A l i g n m e n t   <A S P x R i c h E d i t S t r i n g I d . T a b s T i t l e   FA S P x R i c h E d i t S t r i n g I d . T a b s _ A l i g n m e n t   @A S P x R i c h E d i t S t r i n g I d . T a b s _ C e n t e r   >A S P x R i c h E d i t S t r i n g I d . T a b s _ C l e a r   DA S P x R i c h E d i t S t r i n g I d . T a b s _ C l e a r A l l !  BA S P x R i c h E d i t S t r i n g I d . T a b s _ D e c i m a l ,  RA S P x R i c h E d i t S t r i n g I d . T a b s _ D e f a u l t T a b S t o p s 5  <A S P x R i c h E d i t S t r i n g I d . T a b s _ D o t s H  FA S P x R i c h E d i t S t r i n g I d . T a b s _ E q u a l S i g n N  BA S P x R i c h E d i t S t r i n g I d . T a b s _ H y p h e n s [  @A S P x R i c h E d i t S t r i n g I d . T a b s _ L e a d e r d  <A S P x R i c h E d i t S t r i n g I d . T a b s _ L e f t l  HA S P x R i c h E d i t S t r i n g I d . T a b s _ M i d d l e D o t s r  <A S P x R i c h E d i t S t r i n g I d . T a b s _ N o n e   >A S P x R i c h E d i t S t r i n g I d . T a b s _ R i g h t   :A S P x R i c h E d i t S t r i n g I d . T a b s _ S e t   RA S P x R i c h E d i t S t r i n g I d . T a b s _ T a b S t o p P o s i t i o n   ZA S P x R i c h E d i t S t r i n g I d . T a b s _ T a b S t o p s T o B e C l e a r e d   FA S P x R i c h E d i t S t r i n g I d . T a b s _ T h i c k L i n e   FA S P x R i c h E d i t S t r i n g I d . T a b s _ U n d e r l i n e   JA S P x R i c h E d i t S t r i n g I d . T h i s P o i n t F o r w a r d   JA S P x R i c h E d i t S t r i n g I d . T o g g l e F i e l d C o d e s   0A S P x R i c h E d i t S t r i n g I d . T o p   FA S P x R i c h E d i t S t r i n g I d . U n d e r l i n e C o l o r   FA S P x R i c h E d i t S t r i n g I d . U n d e r l i n e S t y l e   `A S P x R i c h E d i t S t r i n g I d . U n d e r l i n e T y p e _ D a s h D o t D o t t e d #  ZA S P x R i c h E d i t S t r i n g I d . U n d e r l i n e T y p e _ D a s h D o t t e d 4  ^A S P x R i c h E d i t S t r i n g I d . U n d e r l i n e T y p e _ D a s h S m a l l G a p A  RA S P x R i c h E d i t S t r i n g I d . U n d e r l i n e T y p e _ D a s h e d Q  RA S P x R i c h E d i t S t r i n g I d . U n d e r l i n e T y p e _ D o t t e d Y  RA S P x R i c h E d i t S t r i n g I d . U n d e r l i n e T y p e _ D o u b l e a  ZA S P x R i c h E d i t S t r i n g I d . U n d e r l i n e T y p e _ D o u b l e W a v e i  XA S P x R i c h E d i t S t r i n g I d . U n d e r l i n e T y p e _ H e a v y W a v e v  ZA S P x R i c h E d i t S t r i n g I d . U n d e r l i n e T y p e _ L o n g D a s h e d   NA S P x R i c h E d i t S t r i n g I d . U n d e r l i n e T y p e _ N o n e   RA S P x R i c h E d i t S t r i n g I d . U n d e r l i n e T y p e _ S i n g l e   jA S P x R i c h E d i t S t r i n g I d . U n d e r l i n e T y p e _ T h i c k D a s h D o t D o t t e d   dA S P x R i c h E d i t S t r i n g I d . U n d e r l i n e T y p e _ T h i c k D a s h D o t t e d   \A S P x R i c h E d i t S t r i n g I d . U n d e r l i n e T y p e _ T h i c k D a s h e d   \A S P x R i c h E d i t S t r i n g I d . U n d e r l i n e T y p e _ T h i c k D o t t e d   dA S P x R i c h E d i t S t r i n g I d . U n d e r l i n e T y p e _ T h i c k L o n g D a s h e d   \A S P x R i c h E d i t S t r i n g I d . U n d e r l i n e T y p e _ T h i c k S i n g l e   NA S P x R i c h E d i t S t r i n g I d . U n d e r l i n e T y p e _ W a v e   NA S P x R i c h E d i t S t r i n g I d . U n d e r l i n e W o r d s O n l y 
  @A S P x R i c h E d i t S t r i n g I d . U p d a t e F i e l d    BA S P x R i c h E d i t S t r i n g I d . W a r n i n g T i t l e .  DA S P x R i c h E d i t S t r i n g I d . W h o l e D o c u m e n t 7  4A S P x R i c h E d i t S t r i n g I d . W i d t h G  2A S P x R i c h E d i t S t r i n g I d . n o n e N  LA S P x R i c h E d i t S t r i n g I d . s p a c i n g _ 1 _ 5 _ l i n e s V  After	AlignmentAll capsApply toAtAt leasthAccess to the document is restricted and the editor needs to be reloaded. Your last changes can be lost.Before	Body TextBoldBold ItalicBookmarkAdd
Bookmark nameDeleteGo ToLocationName'Bookmark names must begin with a letterSort byBorders and ShadingBordersAllBoxCustom6Click on diagram below or use buttons to apply bordersGridNoneFillShadingBottomBulleted and NumberingByCancelAThe document could not be opened because a server error occurred.@The document could not be saved because a server error occurred._Cannot save a document opened not from a file. Handle the Saving event to process custom savingCell marginsSame as the whole table	Wrap textCenteredChangeNormal	SubscriptSuperscriptCharacter StylesChoose download file typeAccess to the clipboard is denied due to your browser's security policy. <br />Instead, you can use the keyboard shortcuts:<br />{0}+X (cut), {0}+C (copy) and {0}+V (paste).Access to the clipboard is denied due to your browser's security policy. Instead, use the native menu that can be invoked by tapping and holding selected content.CloseColorColumnsCol #:Equal column widthNumber of columnsPresetsSpacingWidthWidth and spacingTAre you sure you want to perform the action? All unsaved document data will be lost.Continue Numbering
ContinuousDATE"Inserts the current date and time.DOCVARIABLEREnables you to programmatically insert complex content when this field is updated.
MERGEFIELD-Retrieves a value from the bound data source.NUMPAGES"Inserts the total number of pages.PAGE4Inserts the number of the page containing the field.TIMEInserts the current time.Current sectionCustomize Bulleted ListCustomize Numbered ListCustomize Outline ListDelete entire columnDelete entire rowShift cells leftShift cells upDelete CellsDifferent first pageDifferent odd and evenNThe DOCVARIABLE field could not be calculated because a server error occurred.DoubleDownloadDownload a copyEdit hyperlink..EffectError	Even pageExactlyExport RangeAThe file cannot be deleted. It is already opened by another user.?The file cannot be moved. It is already opened by another user.AThe file cannot be renamed. It is already opened by another user.	File name	File typeFind and Replace
Advanced findFindItems
Match caseNext
No matches+We couldn't find what you were looking for.ofPreviousReplaceReplace All{0} entries have been replacedReplace withResultsHThe result is too long. Check out the pages to see your results in text.All recordsCountCurrent recordFromJoin Tables
Merge mode
New ParagraphNew SectionRange
First lineFolder pathFont
Font color	Font size
Font styleFontFooter	From edgeGeneralCaptions	ClipboardCommonCurrent RecordCommentLanguageProofingProtectTrackingDocument ViewsEditingFinishArrangeShape StylesArrangeShape StylesFontHeader && FooterClose
NavigationOptionsPosition
Illustrations
Insert FieldsLinks
Mail MergeView
Background
Page SetupPages	ParagraphShowStylesSymbolsTable of ContentsBorders && ShadingsTable Style OptionsTable Styles	Alignment	Cell SizeMergeRows && ColumnsTableTablesTextUndoViewZoomHangingHeaderHeaders and footersHeightHidden	HyperlinkBookmarkDisplayPropertiesE-mail address	E-mail toInvalid E-mailPlace in this documentSubjectTextToolTipURLWeb pageIndentationInformationaAn unspecified error occurred and the editor needs to be reloaded. Your last changes can be lost.InsertInsert entire columnInsert entire rowShift cells downShift cells rightYThe InsertContentFromServerCommand could not be executed because a server error occurred.Insert PictureEnter image web addressFrom your computerFrom the web (URL)
Image preview1Browse your computer for the image file to uploadInsert Merge FieldFieldsInsert CellsInsert TableNumber of columnsNumber of rows
Table Size)The file is corrupt and cannot be opened.Invalid file nameItalic	JustifiedKeep lines together	LandscapeLayoutAbsoluteAbsolute position	AlignmentbelowBook layout
Both sidesDistance from text
HorizontalofInsideOutsideIn line with textLargest only	Left onlyLock AnchorLock aspect ratio
Original sizePositionRelativeRelative positionrelative toReset
Right onlyRotateRotationScaleSize
Text Wrappingto the right ofVertical	Wrap textWrapping styleLeftLevelLine spacingCould not load the image.MarginsModerateNarrowNormalWideCreate FieldXCreate a dynamic element used as a placeholder for data that might change in a document.Footer from Bottom:MSpecify the distance from the bottom of the page to the bottom of the footer.Header from Top:GSpecify the distance from the top of the page to the top of the header.Sentence case.Sentence case.Cell MarginsCustomize cell marginsFull Screen&Enable / disable the full screen mode.Update All FieldsORefresh all dynamic elements in the document by getting the latest source data.The document has been modified outside the editor and needs to be reloaded. <br />Your last-minute changes might not be preserved, if any.MultipleNew page3Don't add space between paragraph of the same styleNormal
Aligned atBullet characterBullet positionBulletedCenterCharacter...Customize...Follow Number WithFont...	Indent atLeftLevelNothing
Number formatNumber positionNumber styleNumberedOutline NumberedRightSpaceStart at
Tab character
Text positionOdd pageOKOpenOpenOpen hyperlinkwThe open and save document operations are not allowed<br />since the working directory is not specified for the editor.OptionsOrientationAll)already exist. Do you want to replace it?none
Outline levelPage break beforeFileFormatHeader && FooterHomeInsert
Mail MergePage Layout
ReferencesReview
Page SetupDesignLayoutView
PaginationPaper
Paper sizeParagraph StylesIndents And SpacingLine And Page Breaks	Paragraph3Path does not exist.
Check the path and try again.PortraitPreviewRemove hyperlinkThis field is requiredRestart NumberingRight
Center Tab
Decimal Title First Line Indent Hanging Indent Left IndentLeft TabMargin LeftMargin Right Right Indent	Right TabSaveSave AsSave file asSave file to the serverSection
Section startSelectSelected sectionsDYour session has expired. <br />Please refresh the page to continue.SingleSpacingSpecialThe spelling check is complete.SpellingAdd to DictionaryChange
Change AllDelete
Ignore AllIgnore Once(no spelling suggestions)Not in Dictionary:Repeated Word:Suggestions:Merge cells before splitSplit CellsDoubleNoneSingleStyleSymbolsAllow spacing between cells$Automatically resize to fit contentsDefault cell marginsDefault cell spacingTable Properties	AlignmentBorders and Shading...Allow row to break across pagesCellColumnIndent from left
Measure inNext columnNext row
Options...Preferred widthPrevious columnPrevious rowRow
Row height isSizeSpecify heightTableVertical alignmentTabs	AlignmentCenterClear	Clear AllDecimalDefault tab stopsDotsEqual signsHyphensLeaderLeftMiddle dotsNoneRightSetTab stop positionTab stops to be cleared
Thick line	UnderlineThis point forwardToggle Field CodesTopUnderline colorUnderline styleDash Dot DottedDash DottedDash Small GapDashedDottedDoubleDouble Wave
Heavy WaveLong DashedNoneSingleThick Dash Dot DottedThick Dash DottedThick DashedThick DottedThick Long DashedThick SingleWaveUnderline words onlyUpdate FieldWarningWhole documentWidth(none)	1.5 lines      3        lSystem.Resources.ResourceReader, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089#System.Resources.RuntimeResourceSet          PADPADPVI\輄BPÊq	Ӎl)Gut2@$	dД~kϾ֗[tV6 hYbT)gIAY_ǰ3p!sg$*lLeٽ#žBZXĬLLpǎ(oIA8Zy>caE 29\k:F}p7~FԖr
,.eu5Vh22\TJs4 ;H)4Z茬fwXmG}6j" awbkݶIkiCwJ{
QbQGEdx Px^$xg뿱	l6R^"y f}>!"a"g
& c7)	)d+{m,X-z.ZS0|#2ip23
4M4>t44RI-666y7T7o!8!|849\;v;0};;;;+5==?.DŘUEFzGSG	GG'LS-MPSMDO-Pr<P\4SRS)TJU(WYo,[b[^K];'`6bo1eGffnFgGfg-T(hjlѝoۑnpp`s
t7$uv*vvˇv)v9mdwFyNyo|U;9}C~Y<      *  L,  
;  d(  !    }  9    c  E:  1  Q!  '  ,    '	    0    u  l  T6  5  ?    p  ~  "    (  8  !  r  >  "  "    x  -  N1    <  1  t	  <      <3  %'  Q8    +  &  Q    ?  '  )    5   )  2  ;  %              ]#  s      s=  A  &  6  /  )    #  '5  t   9  F)    3  3  L  <    C
  '  %  L*         *  9
  |    7  9  &  =  '  2  (  z
  .  O-  
  #  >      (7       ,  >.    E  /  8  !  "  0      q$  +  M  X/  9   
  3+  @  E  	  8  9    ]  5  /    4  -(     z   b  ($  &?  j@    :  -      w?  ;2  ;      
  
  N    0  y     n>  6  S0  9  T%  x  ["  .  W&    <9    _4  *    $  #  -  %  s  @      
=    wH  4A S P x R i c h E d i t A c t i v e T a b I n d e x     <A S P x R i c h E d i t A s s o c i a t e d R i b b o n I D R   NA S P x R i c h E d i t A u t h e n t i c a t i o n S e t t i n g s E M a i l    NA S P x R i c h E d i t A u t h e n t i c a t i o n S e t t i n g s G r o u p    TA S P x R i c h E d i t A u t h e n t i c a t i o n S e t t i n g s U s e r N a m e Y  A S P x R i c h E d i t A u t o C o r r e c t R e p l a c e I n f o C o l l e c t i o n S e t t i n g s A u t o C o r r e c t R e p l a c e I n f o C o l l e c t i o n   A S P x R i c h E d i t A u t o C o r r e c t R e p l a c e I n f o C o l l e c t i o n S e t t i n g s C a s e S e n s i t i v e   LA S P x R i c h E d i t A u t o C o r r e c t R e p l a c e I n f o W h a t   LA S P x R i c h E d i t A u t o C o r r e c t R e p l a c e I n f o W i t h   pA S P x R i c h E d i t A u t o C o r r e c t S e t t i n g s C o r r e c t T w o I n i t i a l C a p i t a l s   RA S P x R i c h E d i t A u t o C o r r e c t S e t t i n g s D e t e c t U r l s C  nA S P x R i c h E d i t A u t o C o r r e c t S e t t i n g s E n a b l e A u t o m a t i c N u m b e r i n g   xA S P x R i c h E d i t A u t o C o r r e c t S e t t i n g s R e p l a c e I n f o C o l l e c t i o n S e t t i n g s   fA S P x R i c h E d i t A u t o C o r r e c t S e t t i n g s R e p l a c e T e x t A s Y o u T y p e {  0A S P x R i c h E d i t A u t o S a v e M o d e   6A S P x R i c h E d i t A u t o S a v e T i m e o u t ?  LA S P x R i c h E d i t B e h a v i o r S e t t i n g s A c c e p t s T a b j  @A S P x R i c h E d i t B e h a v i o r S e t t i n g s C o p y   JA S P x R i c h E d i t B e h a v i o r S e t t i n g s C r e a t e N e w <  >A S P x R i c h E d i t B e h a v i o r S e t t i n g s C u t   HA S P x R i c h E d i t B e h a v i o r S e t t i n g s D o w n l o a d   @A S P x R i c h E d i t B e h a v i o r S e t t i n g s D r a g   @A S P x R i c h E d i t B e h a v i o r S e t t i n g s D r o p :  LA S P x R i c h E d i t B e h a v i o r S e t t i n g s F u l l S c r e e n u  @A S P x R i c h E d i t B e h a v i o r S e t t i n g s O p e n   ^A S P x R i c h E d i t B e h a v i o r S e t t i n g s P a g e B r e a k I n s e r t M o d e   BA S P x R i c h E d i t B e h a v i o r S e t t i n g s P a s t e ]  HA S P x R i c h E d i t B e h a v i o r S e t t i n g s P r i n t i n g   A S P x R i c h E d i t B e h a v i o r S e t t i n g s R a i s e C l i e n t E v e n t s O n M o d i f i c a t i o n s V i a A P I   @A S P x R i c h E d i t B e h a v i o r S e t t i n g s S a v e O	  DA S P x R i c h E d i t B e h a v i o r S e t t i n g s S a v e A s 	  JA S P x R i c h E d i t B e h a v i o r S e t t i n g s T a b M a r k e r 	  BA S P x R i c h E d i t B o o k m a r k S e t t i n g s C o l o r  
  ~A S P x R i c h E d i t B o o k m a r k S e t t i n g s D i s p l a y B o o k m a r k s I n P d f N a v i g a t i o n P a n e e
  LA S P x R i c h E d i t B o o k m a r k S e t t i n g s V i s i b i l i t y 
  JA S P x R i c h E d i t C a l c u l a t e D o c u m e n t V a r i a b l e 0  (A S P x R i c h E d i t C a l l b a c k d  <A S P x R i c h E d i t C l i e n t I n s t a n c e N a m e %  8A S P x R i c h E d i t C l i e n t S i d e E v e n t s f  DA S P x R i c h E d i t C o n f i r m O n L o s i n g C h a n g e s   <A S P x R i c h E d i t C u s t o m J S P r o p e r t i e s /
  @A S P x R i c h E d i t C u s t o m i z e M e r g e F i e l d s }
  bA S P x R i c h E d i t D o c u m e n t C a p a b i l i t i e s S e t t i n g s B o o k m a r k s 
  vA S P x R i c h E d i t D o c u m e n t C a p a b i l i t i e s S e t t i n g s C h a r a c t e r F o r m a t t i n g #  lA S P x R i c h E d i t D o c u m e n t C a p a b i l i t i e s S e t t i n g s C h a r a c t e r S t y l e h  \A S P x R i c h E d i t D o c u m e n t C a p a b i l i t i e s S e t t i n g s F i e l d s   lA S P x R i c h E d i t D o c u m e n t C a p a b i l i t i e s S e t t i n g s H e a d e r s F o o t e r s   dA S P x R i c h E d i t D o c u m e n t C a p a b i l i t i e s S e t t i n g s H y p e r l i n k s 2  lA S P x R i c h E d i t D o c u m e n t C a p a b i l i t i e s S e t t i n g s I n l i n e P i c t u r e s d  vA S P x R i c h E d i t D o c u m e n t C a p a b i l i t i e s S e t t i n g s P a r a g r a p h F o r m a t t i n g   lA S P x R i c h E d i t D o c u m e n t C a p a b i l i t i e s S e t t i n g s P a r a g r a p h S t y l e   jA S P x R i c h E d i t D o c u m e n t C a p a b i l i t i e s S e t t i n g s P a r a g r a p h T a b s /  dA S P x R i c h E d i t D o c u m e n t C a p a b i l i t i e s S e t t i n g s P a r a g r a p h s f  `A S P x R i c h E d i t D o c u m e n t C a p a b i l i t i e s S e t t i n g s S e c t i o n s   bA S P x R i c h E d i t D o c u m e n t C a p a b i l i t i e s S e t t i n g s T a b S y m b o l   dA S P x R i c h E d i t D o c u m e n t C a p a b i l i t i e s S e t t i n g s T a b l e S t y l e   \A S P x R i c h E d i t D o c u m e n t C a p a b i l i t i e s S e t t i n g s T a b l e s \  XA S P x R i c h E d i t D o c u m e n t C a p a b i l i t i e s S e t t i n g s U n d o   RA S P x R i c h E d i t D o c u m e n t S e l e c t o r F i l e U p l o a d i n g   TA S P x R i c h E d i t D o c u m e n t S e l e c t o r F o l d e r C r e a t i n g .  NA S P x R i c h E d i t D o c u m e n t S e l e c t o r I t e m C o p y i n g   PA S P x R i c h E d i t D o c u m e n t S e l e c t o r I t e m D e l e t i n g >  LA S P x R i c h E d i t D o c u m e n t S e l e c t o r I t e m M o v i n g   PA S P x R i c h E d i t D o c u m e n t S e l e c t o r I t e m R e n a m i n g A  >A S P x R i c h E d i t E n a b l e C l i e n t S i d e A P I   bA S P x R i c h E d i t F i e l d s S e t t i n g s U p d a t e F i e l d s B e f o r e P r i n t 1  ZA S P x R i c h E d i t F i e l d s S e t t i n g s U p d a t e F i e l d s O n P a s t e {  bA S P x R i c h E d i t H o r i z o n t a l R u l e r S e t t i n g s S h o w L e f t I n d e n t   dA S P x R i c h E d i t H o r i z o n t a l R u l e r S e t t i n g s S h o w R i g h t I n d e n t   VA S P x R i c h E d i t H o r i z o n t a l R u l e r S e t t i n g s S h o w T a b s T  ZA S P x R i c h E d i t H o r i z o n t a l R u l e r S e t t i n g s V i s i b i l i t y   $A S P x R i c h E d i t I m a g e s   .A S P x R i c h E d i t I m a g e s R u l e r   BA S P x R i c h E d i t I n s e r t C o n t e n t T o C l i e n t w  0A S P x R i c h E d i t J S P r o p e r t i e s   JA S P x R i c h E d i t N u m b e r i n g S e t t i n g s B u l l e t e d   NA S P x R i c h E d i t N u m b e r i n g S e t t i n g s M u l t i L e v e l 0  FA S P x R i c h E d i t N u m b e r i n g S e t t i n g s S i m p l e   NA S P x R i c h E d i t O p t i o n s S p e l l i n g I g n o r e E m a i l s   ^A S P x R i c h E d i t O p t i o n s S p e l l i n g I g n o r e M i x e d C a s e W o r d s &  \A S P x R i c h E d i t O p t i o n s S p e l l i n g I g n o r e R e p e a t e d W o r d s   ^A S P x R i c h E d i t O p t i o n s S p e l l i n g I g n o r e U p p e r C a s e W o r d s   HA S P x R i c h E d i t O p t i o n s S p e l l i n g I g n o r e U r i C  bA S P x R i c h E d i t O p t i o n s S p e l l i n g I g n o r e W o r d s W i t h N u m b e r s   rA S P x R i c h E d i t R a n g e P e r m i s s i o n S e t t i n g s H i g h l i g h t B r a c k e t s C o l o r   bA S P x R i c h E d i t R a n g e P e r m i s s i o n S e t t i n g s H i g h l i g h t C o l o r   ZA S P x R i c h E d i t R a n g e P e r m i s s i o n S e t t i n g s V i s i b i l i t y   (A S P x R i c h E d i t R e a d O n l y b  LA S P x R i c h E d i t R i b b o n C o n t e x t T a b C a t e g o r i e s   ,A S P x R i c h E d i t R i b b o n M o d e   ,A S P x R i c h E d i t R i b b o n T a b s ,  $A S P x R i c h E d i t S a v i n g _  (A S P x R i c h E d i t S e t t i n g s   DA S P x R i c h E d i t S e t t i n g s A u t h e n t i c a t i o n   >A S P x R i c h E d i t S e t t i n g s A u t o C o r r e c t k  8A S P x R i c h E d i t S e t t i n g s B e h a v i o r   :A S P x R i c h E d i t S e t t i n g s B o o k m a r k s %  6A S P x R i c h E d i t S e t t i n g s D i a l o g s f  PA S P x R i c h E d i t S e t t i n g s D o c u m e n t C a p a b i l i t i e s   HA S P x R i c h E d i t S e t t i n g s D o c u m e n t S e l e c t o r   4A S P x R i c h E d i t S e t t i n g s E x p o r t D   4A S P x R i c h E d i t S e t t i n g s F i e l d s i   FA S P x R i c h E d i t S e t t i n g s H o r i z o n t a l R u l e r    HA S P x R i c h E d i t S e t t i n g s R a n g e P e r m i s s i o n s    @A S P x R i c h E d i t S e t t i n g s S p e l l C h e c k e r s!  0A S P x R i c h E d i t S e t t i n g s U n i t !  2A S P x R i c h E d i t S e t t i n g s V i e w s !  LA S P x R i c h E d i t S h o w C o n f i r m O n L o s i n g C h a n g e s L"  2A S P x R i c h E d i t S h o w S t a t u s B a r "  BA S P x R i c h E d i t S i m p l e V i e w P a d d i n g s A l l E#  HA S P x R i c h E d i t S i m p l e V i e w P a d d i n g s B o t t o m y#  DA S P x R i c h E d i t S i m p l e V i e w P a d d i n g s L e f t #  FA S P x R i c h E d i t S i m p l e V i e w P a d d i n g s R i g h t #  BA S P x R i c h E d i t S i m p l e V i e w P a d d i n g s T o p $  LA S P x R i c h E d i t S i m p l e V i e w S e t t i n g s P a d d i n g s G$  NA S P x R i c h E d i t S p e l l C h e c k e r S e t t i n g s C u l t u r e $  XA S P x R i c h E d i t S p e l l C h e c k e r S e t t i n g s D i c t i o n a r i e s $  NA S P x R i c h E d i t S p e l l C h e c k e r S e t t i n g s E n a b l e d %  fA S P x R i c h E d i t S p e l l C h e c k e r S e t t i n g s L e v e n s h t e i n D i s t a n c e D%  ^A S P x R i c h E d i t S p e l l C h e c k e r S e t t i n g s O p t i o n s S p e l l i n g %  ^A S P x R i c h E d i t S p e l l C h e c k e r S e t t i n g s S u g g e s t i o n C o u n t %  BA S P x R i c h E d i t S p e l l C h e c k e r W o r d A d d e d &  $A S P x R i c h E d i t S t y l e s 7&  0A S P x R i c h E d i t S t y l e s B u t t o n &  2A S P x R i c h E d i t S t y l e s E d i t o r s 8'  :A S P x R i c h E d i t S t y l e s F i l e M a n a g e r '  6A S P x R i c h E d i t S t y l e s P o p u p M e n u (  0A S P x R i c h E d i t S t y l e s R i b b o n (  .A S P x R i c h E d i t S t y l e s R u l e r _)  6A S P x R i c h E d i t S t y l e s S t a t u s B a r )  4A S P x R i c h E d i t V i e w M e r g e d D a t a -*  FA S P x R i c h E d i t V i e w s S e t t i n g s S i m p l e V i e w *  BA S P x R i c h E d i t V i e w s S e t t i n g s V i e w T y p e *  2A S P x R i c h E d i t W o r k D i r e c t o r y +  `R i c h E d i t C l i e n t S i d e E v e n t s A c t i v e S u b D o c u m e n t C h a n g e d E+  FR i c h E d i t C l i e n t S i d e E v e n t s A u t o C o r r e c t _+  XR i c h E d i t C l i e n t S i d e E v e n t s B e g i n S y n c h r o n i z a t i o n l+  dR i c h E d i t C l i e n t S i d e E v e n t s C h a r a c t e r P r o p e r t i e s C h a n g e d +  NR i c h E d i t C l i e n t S i d e E v e n t s C o n t e n t I n s e r t e d +  LR i c h E d i t C l i e n t S i d e E v e n t s C o n t e n t R e m o v e d +  ZR i c h E d i t C l i e n t S i d e E v e n t s C u s t o m C o m m a n d E x e c u t e d +  NR i c h E d i t C l i e n t S i d e E v e n t s D o c u m e n t C h a n g e d +  LR i c h E d i t C l i e n t S i d e E v e n t s D o c u m e n t L o a d e d +  TR i c h E d i t C l i e n t S i d e E v e n t s E n d S y n c h r o n i z a t i o n +  @R i c h E d i t C l i e n t S i d e E v e n t s G o t F o c u s ,  LR i c h E d i t C l i e n t S i d e E v e n t s H y p e r l i n k C l i c k ,  >R i c h E d i t C l i e n t S i d e E v e n t s K e y D o w n %,  :R i c h E d i t C l i e n t S i d e E v e n t s K e y U p .,  BR i c h E d i t C l i e n t S i d e E v e n t s L o s t F o c u s 5,  dR i c h E d i t C l i e n t S i d e E v e n t s P a r a g r a p h P r o p e r t i e s C h a n g e d @,  FR i c h E d i t C l i e n t S i d e E v e n t s P o i n t e r D o w n \,  BR i c h E d i t C l i e n t S i d e E v e n t s P o i n t e r U p i,  PR i c h E d i t C l i e n t S i d e E v e n t s P o p u p M e n u S h o w i n g t,  PR i c h E d i t C l i e n t S i d e E v e n t s S e l e c t i o n C h a n g e d ,  LR i c h E d i t D i a l o g S e t t i n g s I n s e r t L i n k D i a l o g ,  RR i c h E d i t D i a l o g S e t t i n g s I n s e r t P i c t u r e D i a l o g ,  HR i c h E d i t D i a l o g S e t t i n g s S a v e F i l e D i a l o g G-  DR i c h E d i t D o c u m e n t I n f o D o c u m e n t F o r m a t -  DR i c h E d i t D o c u m e n t I n f o L a s t M o d i f y T i m e -  8R i c h E d i t D o c u m e n t I n f o M o d i f i e d -  vR i c h E d i t D o c u m e n t S e l e c t o r C o m m o n S e t t i n g s A l l o w e d F i l e E x t e n s i o n s <.  \R i c h E d i t D o c u m e n t S e l e c t o r S e t t i n g s C o m m o n S e t t i n g s .  ZR i c h E d i t D o c u m e n t S e l e c t o r S e t t i n g s C u s t o m C o m m a n d .  ^R i c h E d i t D o c u m e n t S e l e c t o r S e t t i n g s E d i t i n g S e t t i n g s )/  `R i c h E d i t D o c u m e n t S e l e c t o r S e t t i n g s F i l e L i s t S e t t i n g s /  ^R i c h E d i t D o c u m e n t S e l e c t o r S e t t i n g s F o l d e r s S e t t i n g s /  dR i c h E d i t D o c u m e n t S e l e c t o r S e t t i n g s P e r m i s s i o n S e t t i n g s [0  ^R i c h E d i t D o c u m e n t S e l e c t o r S e t t i n g s T o o l b a r S e t t i n g s 0  \R i c h E d i t D o c u m e n t S e l e c t o r S e t t i n g s U p l o a d S e t t i n g s 71  ZR i c h E d i t D o c u m e n t S e l e c t o r U p l o a d S e t t i n g s E n a b l e d 1  pR i c h E d i t D o c u m e n t S e l e c t o r U p l o a d S e t t i n g s V a l i d a t i o n S e t t i n g s 2  lR i c h E d i t F i l e M a n a g e r C o m m o n S e t t i n g s A l l o w e d F i l e E x t e n s i o n s 2  nR i c h E d i t F i l e M a n a g e r F o l d e r s S e t t i n g s S h o w L o c k e d F o l d e r I c o n s 2  @R i c h E d i t F i l e M a n a g e r S t y l e s C o n t r o l 3  `R i c h E d i t F i l e M a n a g e r V a l i d a t i o n S e t t i n g s M a x F i l e S i z e 3  JR i c h E d i t I m a g e s L o a d i n g P a n e l O n S t a t u s B a r p4  2R i c h E d i t I m a g e s M e n u I c o n S e t 4  RR i c h E d i t I m a g e s Q u i c k S e a r c h P a n e l C l o s e B u t t o n !5  XR i c h E d i t I m a g e s Q u i c k S e a r c h P a n e l C o l l a p s e B u t t o n 5  PR i c h E d i t I m a g e s Q u i c k S e a r c h P a n e l N e x t B u t t o n 5  PR i c h E d i t I m a g e s Q u i c k S e a r c h P a n e l P r e v B u t t o n F6  nR i c h E d i t I n s e r t L i n k D i a l o g S e t t i n g s S h o w E m a i l A d d r e s s S e c t i o n 6  pR i c h E d i t I n s e r t P i c t u r e D i a l o g S e t t i n g s S h o w F i l e U p l o a d S e c t i o n I7  >R i c h E d i t P o p u p M e n u I t e m B e g i n G r o u p 7  JR i c h E d i t P o p u p M e n u I t e m C h e c k e d G r o u p N a m e I8  @R i c h E d i t P o p u p M e n u I t e m C o m m a n d N a m e 8  <R i c h E d i t P o p u p M e n u I t e m I m a g e N a m e 8  4R i c h E d i t P o p u p M e n u I t e m I t e m s &9  2R i c h E d i t P o p u p M e n u I t e m T e x t w9  dR i c h E d i t R i b b o n C o n t e x t T a b C a t e g o r y C o l l e c t i o n R i c h E d i t 9  RR i c h E d i t R u l e r I m a g e s C e l l D i v i s i o n D r a g H a n d l e +:  LR i c h E d i t R u l e r I m a g e s C e n t e r T a b D r a g H a n d l e v:  NR i c h E d i t R u l e r I m a g e s D e c i m a l T a b D r a g H a n d l e :  VR i c h E d i t R u l e r I m a g e s F i r s t L i n e I d e n t D r a g H a n d l e ;  XR i c h E d i t R u l e r I m a g e s F i r s t L i n e I n d e n t D r a g H a n d l e V;  LR i c h E d i t R u l e r I m a g e s L e f t I d e n t D r a g H a n d l e ;  NR i c h E d i t R u l e r I m a g e s L e f t I n d e n t D r a g H a n d l e ;  HR i c h E d i t R u l e r I m a g e s L e f t T a b D r a g H a n d l e 7<  NR i c h E d i t R u l e r I m a g e s R i g h t I d e n t D r a g H a n d l e }<  PR i c h E d i t R u l e r I m a g e s R i g h t I n d e n t D r a g H a n d l e <  JR i c h E d i t R u l e r I m a g e s R i g h t T a b D r a g H a n d l e =  `R i c h E d i t S a v e F i l e D i a l o g S e t t i n g s D i s p l a y S e c t i o n M o d e X=  PGets or sets the index of the active ribbon tab within the ASPxRichEdit control.GSpecifies the ID of an ASPxRibbon control, used as an external toolbar.]Gets or sets the email address used to authenticate a user if document protection is enabled.]Gets or sets a user group name used to authenticate a user if document protection is enabled.RGets or sets a name used to authenticate a user if document protection is enabled.;A collection of ASPxRichEditAutoCorrectReplaceInfo objects.Gets or sets whether to perform a case-sensitive string comparison when searching through the ASPxRichEditAutoCorrectReplaceInfoCollection's items.Gets the text to be replaced.Gets the replacement text.Gets or sets whether the control should correct words that start with two capital letters by changing the second letter to lowercase.YGets or sets whether the control should detect URI strings and format them as hyperlinks.wGets or sets whether the control should automatically create numbered or bulleted lists when certain symbols are typed.bProvides access to options specific to the collection of ASPxRichEditAutoCorrectReplaceInfo items.Gets or sets whether the control should replace the typed text if it matches to one of the ASPxRichEditAutoCorrectReplaceInfoCollection dictionary's entries."Gets or sets the auto-saving mode.)Gets or sets the timeout for auto-saving.Gets or sets a value indicating whether pressing the TAB key types a TAB character instead of moving the focus to the next control in the tab order.9Specifies whether or not the Copy operation is permitted.HSpecifies whether or not the Create New Document operation is permitted.8Specifies whether or not the Cut operation is permitted.=Specifies whether or not the Download operation is permitted.9Specifies whether or not the Drag operation is permitted.9Specifies whether or not the Drop operation is permitted.@Specifies whether or not the Full Screen operation is permitted.BSpecifies whether or not the Open Document operation is permitted.`Gets or sets whether a page break is inserted next to the specified position or in the new line.:Specifies whether or not the Paste operation is permitted.?Specifies whether or not the printing operations are permitted.sGets or sets whether to raise client-side events when a document (or its selection) are changed via the client API.BSpecifies whether or not the Save Document operation is permitted.HSpecifies whether or not the Save Document As... operation is permitted.ASpecifies which character(s) to insert when pressing the TAB key.CGets or sets the color used to indicate a bookmark in the document.Gets or sets a value specifying the mode for displaying bookmarks in the Bookmarks pane of PDF viewer when a document is exported to PDF.=Gets or sets whether bookmarks are displayed in the document.2Fires when the DOCVARIABLE field field is updated.Fires when a round trip to the server has been initiated either manually (by a call to the client PerformCallback method) or automatically by the ASPxRichEdit (an internal service callback).?Gets or sets the ASPxRichEdit's client programmatic identifier.NGets an object that lists the client-side events specific to the ASPxRichEdit.wGets or sets the text of the confirmation message that is displayed when any unsaved data changes are going to be lost.LEnables you to supply any server data that can then be parsed on the client.sFires when the 'Insert Merge Field' command button is clicked, and enables you to customize a drop-down field list./Gets or sets the bookmark feature availability.CGets or sets the availability of the character formatting features.CGets or sets the availability of the apply character style feature.IGets or sets the document's capability to recognize and work with fields.8Gets whether the headers and footers feature is allowed.0Gets or sets the hyperlink feature availability.?Gets or sets the document capability to handle inline pictures.CGets or sets the availability of the paragraph formatting features.CGets or sets the availability of the apply paragraph style feature.5Gets or sets the availability of paragraph tab stops.6Gets or sets the availability of the paragraph breaks.CGets or sets the document's capability to handle document sections.6Gets or sets the document's capability to insert tabs.?Gets or sets the availability of the apply table style feature.8Gets or sets the document's capability to handle tables.7Gets or sets the availability of the Undo/Redo feature.]Fires before a file is uploaded to the Document Selector and allows you to cancel the action.Fires on the server side before a folder is created within the FileManager (a document selector) embedded into built-in file dialogs, and allows you to cancel the action.aFires before an item is copied within the Document Selector, and allows you to cancel the action.Fires before an item is deleted within the FileManager embedded into built-in file dialogs, and allows you to cancel the action.~Fires before an item is moved within the FileManager embedded into built-in file dialogs, and allows you to cancel the action.Fires before an item is renamed within the FileManager embedded into built-in file dialogs, and allows you to cancel the action.kGets or sets a value that specifies whether the ASPxRichEdit can be manipulated on the client side in code.HGets or sets whether the control updates fields' values before printing.dGets or sets whether the control updates the value of the field that has been pasted by an end-user.7Gets or sets whether the left indent marker is visible.8Gets or sets whether the right indent marker is visible.EGets or sets whether tab stops are displayed in the horizontal ruler.(Gets or sets whether the ruler is shown.UProvides access to the settings that define images displayed within the ASPxRichEdit.YProvides access to the settings that define images displayed within the RichEdit's ruler.insertContentFromServerLEnables you to supply any server data that can then be parsed on the client.PGets or sets the availability of operations with bulleted lists in the document.RGets or sets the availability of operations with multilevel lists in the document.WGets or sets the availability of operations with simple numbered lists in the document.GGets or sets whether email addresses should be skipped during checking.yGets or sets whether the spell checker ignores words containing different case letters in positions other than the first.>Gets or sets whether the spell checker ignores repeated words.`Gets or sets whether words in which all letters are uppercase should be skipped during checking.tGets or sets whether the spell checker ignores strings which can be qualified as Uniform Resource Identifiers (URI).JGets or sets whether the spell checker ignores words that contain numbers.Gets or sets the color of the visual marks (brackets) that indicate the start and the end of each editable range in a protected document with protection enabled.mGets or sets the color used to highlight each editable range in a protected document with protection enabled.HGets or sets whether the ranges with permissions are visually indicated.`Gets or sets a value indicating whether an end-user can change the editor's contents at runtime.5Gets the collection of ribbon context tab categories./Specifies the type of the ASPxRichEdit toolbar.1Provides access to the collection of ribbon tabs.WAllows the current rich text document to be processed before it is saved to the server.4Provides access to the ASPxRichEdit's main settings.{Provides access to an object used to specify a user's credentials used to identify editable ranges in a protected document.SProvides access to an object used to specify what autocorrect features are enabled.cProvides access to an object that enables you to apply restrictions on different editor operations.?Provides access to an object used to specify bookmark settings.2Provides access to the built-in dialogs' settings.CProvides access to an object used to specify document restrictions.cProvides access to settings that are related to the FileManager used in some built-in File Dialogs.#Provides access to export settings.=Provides access to an object used to specify Fields settings.TProvides access to options specific to the horizontal ruler element of the RichEdit.sProvides access to an object used to specify highlighting of permitted ranges while document protection is enabled.MProvides access to the spelling settings for checking the RichEdit's content.8Gets or sets a unit of measure used in the ASPxRichEdit.NProvides access to an object used to specify the control's document view type.Gets or sets a value that specifies whether a confirmation alert should be displayed when any unsaved changes are going to be lost due to an end-user action.WGets or sets a value that specifies whether the ASPxRichEdit's status bar is displayed.2Gets or sets the simple view mode's paddings size.3Gets or sets the simple view mode's bottom padding.1Gets or sets the simple view mode's left padding.2Gets or sets the simple view mode's right padding.0Gets or sets the simple view mode's top padding.MProvides access to an object used to specify the simple view mode's paddings.IGets or sets the culture-specific settings of the built-in spell checker.0Provides access to a collection of dictionaries./Gets or sets a the spell checking availability.BGets or sets the parameter used to measure the proximity of words.+Provides access to basic spelling settings.JGets or sets the number of suggested words displayed in the spelling form.4Occurs after a word is added to a custom dictionary._Provides access to the style settings that control the appearance of the ASPxRichEdit elements.Provides access to the style settings that define the appearance of button elements used by the ASPxRichEdit control (within built-in dialogs, for instance).Provides access to the style settings that define the appearance of editor elements used by the ASPxRichEdit control (for instance, within built-in dialogs).Provides access to the style settings that define the appearance of File Manager elements used by the ASPxRichEdit control (for instance, within the built-in file dialogs).eProvides access to the style settings that define the appearance of the ASPxRichEdit's context menus.oProvides access to the style settings that define the appearance of the ASPxRichEdit's ribbon toolbar elements.hProvides access to the style settings that define the appearance of the ASPxRichEdit's horizontal ruler.bProvides access to the style settings that define the appearance of the ASPxRichEdit's status bar.mGets or sets a value that specifies whether to display mail-merge field results or field codes in a document.MProvides access to an object used to specify the simple view mode's settings..Gets or sets the control's document view type.(Gets or sets the working directory path.ActiveSubDocumentChangedAutoCorrectBeginSynchronizationCharacterPropertiesChangedContentInsertedContentRemovedCustomCommandExecutedDocumentChangedDocumentLoadedEndSynchronizationGotFocusHyperlinkClickKeyDownKeyUp	LostFocusParagraphPropertiesChangedPointerDown	PointerUpPopupMenuShowingSelectionChangedUProvides access to customization settings for the Insert Link dialog's form elements.VProvides access to customization settings for the Insert Image dialog's form elements.SProvides access to customization settings for the Save File dialog's form elements.Gets the document format.+Gets the last modify time for the document.VGets a value indicating whether the current document was modified after it was opened.aGets or sets the file extensions allowed for display in the FileManager used within file dialogs.\Provides access to the main settings of the FileManager embedded into built-in file dialogs.*Gets or sets the name of a custom command._Provides access to the editing settings of the FileManager embedded into built-in file dialogs.cProvides access to the file list's settings of the FileManager embedded into built-in file dialogs.jProvides access to the folder container's settings of the FileManager embedded into built-in file dialogs.iProvides access to permission settings that relate to the FileManager used in some built-in File Dialogs.oProvides access to the toolbar item visibility settings of the FileManager embedded into built-in file dialogs.fProvides access to the upload panel's settings of the FileManager embedded into built-in file dialogs.yGets or sets a value that indicates whether upload is enabled for the FileManager used within some built-in file dialogs.gGets the upload validation settings applied for the FileManager used within some built-in file dialogs.mGets or sets the file extensions allowed for display in the FileManager used within certain built-in dialogs.Gets or sets a value specifying whether the FileManager embedded into some built-in dialogs displays a special icon for folders that are locked for upload.lGets the style settings that relate to styles declared at the control level of the embedded ASPxFileManager.pGets or sets the maximum size of an uploaded file within the FileManager embedded into certain built-in dialogs.qGets the settings of an image displayed within a loading panel when it is displayed at the RichEdit's status bar.<Gets or sets a set of icons to be used within the ribbon UI._Gets the settings of an image displayed within the Close button of the RichEdit's Search Panel.bGets the settings of an image displayed within the Collapse button of the RichEdit's Search Panel.^Gets the settings of an image displayed within the Next button of the RichEdit's Search Panel.^Gets the settings of an image displayed within the Prev button of the RichEdit's Search Panel.Gets or sets a value that specifies whether a section that allows an e-mail address to be entered is displayed within the Insert Hyperlink built-in dialog form.Gets or sets a value that specifies whether a section that allows end-users to upload their local files is displayed within the Insert Image built-in dialog form.YGets or sets a value that specifies whether the current context menu item starts a group.NGets or sets the name of a logical check group to which the menu item belongs.DGets or sets the command name associated with the context menu item.EGets or sets the name of an image displayed by the context menu item.OGets a collection that contains the sub-items of the current context menu item.?Gets or sets the text content of the current context menu item.qGets the ASPxRichEdit control to which the current RichEditRibbonContextTabCategoryCollection collection belongs.IGets the settings of an image displayed in the cell division drag handle.FGets the settings of an image displayed in the center tab drag handle.GGets the settings of an image displayed in the decimal tab drag handle.MGets the settings of an image displayed in the first line indent drag handle.MGets the settings of an image displayed in the first line indent drag handle.GGets the settings of an image displayed in the left indent drag handle.GGets the settings of an image displayed in the left indent drag handle.DGets the settings of an image displayed in the left tab drag handle.HGets the settings of an image displayed in the right indent drag handle.HGets the settings of an image displayed in the right indent drag handle.EGets the settings of an image displayed in the right tab drag handle.bGets or sets a value that specifies which sections are displayed within the Save File dialog form. WC  .dxreControl
{
    border: solid 1px #a7a7a7;
    font: 12px Tahoma, Geneva, sans-serif;
}
.dxreControl .dxreTableBorderLine
{
    background-color: #599eff;
}
.dxreControl .dxrePage
{
    border: 1px solid #808080;
}
.dxreControl .dxreView
{
    background-color: #E0E0E0;
}
.dxreControl .dxflFormLayout .dxre-editorsGroupWithPaddings
{
    padding-left: 32px;
    padding-right: 32px;
}
.dxreControl .dxrControl .dxr-minBtn
{
    padding-right: 7px;
}
.dxreControl .dxrControl .dxtcLite
{
    background: #cecece;
}
.dxreControl .dxrControl .dxtcLite.dxtc-top .dxtc-leftIndent
{
    width: 3px;
}
.dxreControl .dxrControl .dxr-tabContent
{
    border-left-style: none;
    border-right-style: none;
}
.dxrControl .dxreRibbonCBSmall
{
    width: 60px;
}
.dxrControl .dxreRibbonCBLarge
{
    width: 140px;
}
.dxrControl .dxreRibbonCBMiddle
{
    width: 100px;
}
.dxrControl .dxreRibbonSE
{
    width: 70px;
}
.dxreControl .dxreRulerWrapper
{
    padding-top: 2px;
    background-color: #e0e0e0;
}
.dxreControl .dxreRulerWrapper .dxre-rulertabAlignBox
{
    background-color: #d3d3d3;
}
.dxreControl .dxreRulerWrapper .dxre-rulertabAlignBox > div
{
    background-color: #fff;
}
.dxreControl .dxreRulerLine
{
    border-left: 1px dashed #717171;
}
.dxreControl .dxreRulerLine.table
{
    border-left: 1px solid #599eff;
}
.dxreControl .dxreRuler .dxre-columnHandleLeftPart,
.dxreControl .dxreRuler .dxre-columnHandleRightPart
{
    width: 5px;
    background-color: #bcb8b8;
}
.dxreControl .dxreRuler .dxre-rulerTableColumnSeparatorHandle
{
    height: 12px;
    background-color: #d3d3d3;
}
.dxreControl .dxreRuler .dxre-rulerTableColumnSeparatorHandle > div
{
    margin-top: 2px;
}
.dxreControl .dxreRuler .dxre-rulerDivisions
{
    height: 12px;
    background-color: #fff;
}
.dxreControl .dxreRuler .dxre-rulerDivisions div
{
    height: 12px;
}
.dxreControl .dxreRuler .dxre-rulerDivisions .dxre-rulerMinorDivision,
.dxreControl .dxreRuler .dxre-rulerDivisions .dxre-rulerMajorDivision
{
    border-left: 1px solid #a3a3a3;
}
.dxreControl .dxreRuler .dxre-rulerDivisions .dxre-rulerNumberDivision
{
    color: #4e4e4e;
}
.dxreControl .dxreRuler .dxre-rulerMarginLeftPanel,
.dxreControl .dxreRuler .dxre-rulerMarginRightPanel,
.dxreControl .dxreRuler .dxre-rulerMarginLeftHandlePanel,
.dxreControl .dxreRuler .dxre-rulerMarginRightHandlePanel,
.dxreControl .dxreRuler .dxre-columnHandle,
.dxreControl .dxreRuler .dxre-columnHandle > div
{
    height: 12px;
}
.dxreControl .dxreRuler .dxre-rulerMarginLeftPanel,
.dxreControl .dxreRuler .dxre-rulerMarginRightPanel,
.dxreControl .dxreRuler .dxre-rulerMarginLeftHandlePanel,
.dxreControl .dxreRuler .dxre-rulerMarginRightHandlePanel,
.dxreControl .dxreRuler .dxre-columnHandle
{
    background-color: #d3d3d3;
}
.dxreControl .dxre-leftIndentDragHandleBody
{
    background-color: #fff;
    border: 1px solid #929292;
    border-top: none;
    height: 6px;
}
.dxreControl .dxreQuickSearchPanel
{
    background-color: #FFFFFF;
    border: 1px solid #a7a7a7;
    border-top: none;
    padding: 6px;
}
.dxreControl .dxreQuickSearchPanel .dxreQuickSearchButtonEdit
{
    width: 200px;
}
.dxreControl .dxreQuickSearchPanel .dxreQuickSearchButton:first-of-type
{
    margin-top: 1px;
    margin-right: 2px;
    margin-left: 5px;
}
.dxreControl .dxreQuickSearchPanel .dxreQuickSearchButton:nth-of-type(2)
{
    margin-top: 1px;
}
.dxreControl .dxreQuickSearchPanel .dxreQuickSearchButton:nth-of-type(3)
{
    margin-top: 2px;
    margin-right: 2px;
    margin-left: 25px;
}
.dxreControl .dxreQuickSearchPanel .dxreQuickSearchButton:nth-of-type(4)
{
    margin-top: 2px;
}
.dxreControl .dxreQuickSearchPanel .dxreQuickSearchButton,
.dxreControl .dxreQuickSearchPanel .dxreQuickSearchButton .dxb
{
    padding: 0px !important;
    border: none !important;
    cursor: pointer;
}
.dxreControl .dxreQuickSearchPanel .dxreQuickSearchButton.dxbButtonSys
{
    background: none !important;
}
.dxreControl .dxreBar
{
    background-color: #F2F2F2;
    border-top: 1px solid #a7a7a7;
    height: 22px;
}
.dxreControl .dxreBar .dxreLoadingPanel
{
    float: right;
    margin: 3px 4px 0 0;
    color: #666666;
}
.dxreControl .dxreBar .dxreLoadingPanel .dx
{
    line-height: 0;
}
.dxreControl .dxreBar .dxreLoadingPanel .dxlp-loadingImage
{
    width: 16px;
    height: 16px;
    background: url('<%=WebResource("DevExpress.Web.ASPxRichEdit.Images.reLoadingOnStatusBar.gif")%>');
}
.dxreControl .dxreDlgListBox
{
    padding: 1px;
}
.dxreControl .dxreDlgListBox > div
{
    border: 1px solid #808080;
    margin: 1px;
}
.dxreControl .dxreDlgListBox .dxreDlgListHover
{
    background-color: #F0F0F0;
}
.dxreControl .dxreDlgListBox .dxreDlgListSelected
{
    background-color: #E0E0E0;
}
.dxreControl .dxre-numberinglistdialog
{
    max-width: 541px;
}
.dxreControl .dxre-simplenumberinglistdialog
{
    max-width: 385px;
}
.dxreControl .dxreDlgNumberingListForm .dxreDlgNumberingListPreview
{
    padding: 10px;
    width: 90px;
    height: 90px;
}
.dxreControl .dxreDlgNumberingListForm .dxreDlgMainContainer
{
    height: 220px;
}
.dxreControl .dxreDlgNumberingListForm .dxreDlgListBox > div
{
    width: 120px;
    height: 120px;
    line-height: 120px;
}
.dxreControl .dxre-bulletedlistdialog
{
    max-width: 348px;
}
.dxreControl .dxreDlgBulletedListForm .dxreDlgBulletPresetBtn
{
    width: 45px !important;
    height: 45px !important;
    float: left;
    margin: 0px 0px 5px 5px;
}
.dxreControl .dxre-multilevelnumberinglistdialog
{
    max-width: 422px;
}
.dxreControl .dxreMultiLevelNumberingListBoxLayout,
.dxreControl .dxreMultiLevelNumberingListBoxLayout .dxlbd
{
    width: 30px;
    height: 100% !important;
}
.dxreControl .dxre-multiLevelOptionsLayout .dxflGroup
{
    padding: 0px;
}
.dxreControl .dxreDlgMultiLevelNumberingListForm .dxre-dialogContentGroup > tbody > tr > td:first-child
{
    padding-right: 0px;
}
.dxreControl .dxreDlgMultiLevelNumberingListForm .dxre-dialogContentGroup > tbody > tr > td:last-child
{
    padding: 0px;
}
.dxreControl .dxre-alertdialog
{
    max-width: 350px;
}
.dxreControl .dxre-alertdialog span
{
    user-select: text;
}
.dxreControl .dxre-layoutoptionsdialog
{
    max-width: 500px;
}
.dxreControl .dxreDlgLayoutForm .dxtc-content
{
    min-height: 420px;
}
.dxreControl .dxreDlgLayoutForm .dxre-layoutFormOriginalSizeGroup .dxflCaptionCellSys
{
    padding-top: 0px;
}
.dxreControl .dxreDlgLayoutForm .dxre-dialogPresetButton
{
    width: 25% !important;
    text-align: center;
    float: left;
}
@media (max-width: 500px)
{
    .dxreControl .dxreDlgLayoutForm .dxre-dialogPresetButton
    {
        width: 33% !important;
    }
}
@media (max-width: 380px)
{
    .dxreControl .dxreDlgLayoutForm .dxre-dialogPresetButton
    {
        width: 50% !important;
    }
}
.dxreControl .dxreDlgLayoutForm .dxre-buttonLable
{
    display: block;
    text-align: center;
    padding-top: 3px;
    padding-bottom: 5px;
}
.dxreControl .dxreDlgLayoutForm .dxre-sizeTabLayout .dx-dialogEditRoot > tbody > tr > td:first-child,
.dxreControl .dxreDlgLayoutForm .dxre-positionTabLayout .dx-dialogEditRoot > tbody > tr > td:first-child
{
    width: 5% !important;
}
.dxreControl .dxreDialog .dxrpControl.dxrp-noCollapsing > tbody > tr.dxrpCR > .dxrpcontent
{
    padding: 15px;
}
.dxreControl .dxreDialog .dxrpControlGB > tbody > tr.dxrpCR > .dxrpcontent
{
    padding: 6px 10px 10px 10px;
}
@media (max-width: 420px)
{
    .dxreControl .dxreDialog .dxre-dialogShortEditor:not(.dxre-dialogNotResponsiveEditor),
    .dxreControl .dxreDialog .dxre-dialogEditor:not(.dxre-dialogNotResponsiveEditor),
    .dxreControl .dxreDialog .dxre-dialogLongEditor:not(.dxre-dialogNotResponsiveEditor)
    {
        max-width: 100%;
    }
    .dxreControl .dxreDialog .dxflItemSys .dxflCaptionCellSys
    {
        min-width: 25px !important;
    }
}
.dxreControl .dxre-dialogShortEditor
{
    max-width: 70px;
}
.dxreControl .dxre-dialogEditor
{
    max-width: 110px;
}
.dxreControl .dxre-dialogLongEditor
{
    max-width: 170px;
}
.dxreControl .dxreDlgInLayoutButton
{
    width: 68px !important;
}
.dxreControl .dxreDlgFooterBtn
{
    width: 80px !important;
    margin-left: 8px;
}
.dxreControl .dxre-EmptyLine
{
    height: 10px;
}
.dxreControl .dxre-dialogFooter
{
    width: auto;
    padding: 11px;
    background-color: #F3F3F3;
    border-top: Solid 1px #E0E0E0;
}
.dxreControl .dxre-dialogLG.dxflGroupSys.dxre-dialogContentGroup
{
    padding: 11px 3px;
}
.dxreControl .dxre-dialogLGB > .dxre-dialogLG > div > .dxre-dialogLGC > .dxre-dialogLI
{
    padding-top: 2px;
}
.dxreControl .dxre-bookmarksdialog
{
    max-width: 300px;
}
.dxreControl .dxre-columnsdialog
{
    max-width: 400px;
}
.dxreControl .dxreDlgColumnsForm .dxreDlgColumnsEditorMainTable > tbody > tr > td
{
    padding: 2px 4px;
}
.dxreControl .dxreDlgColumnsForm .dxreDlgColumnsEditor
{
    height: 100px;
}
.dxreControl .dxreDlgColumnsForm .dxreDlgColumnsEditor .dxreDlgTextBox
{
    width: 40px;
}
.dxreControl .dxreDlgColumnsForm .dxreDlgColumnsEditor .dxreDlgSpinEdit
{
    width: 90px;
}
@media (max-width: 420px)
{
    .dxreControl .dxreDlgColumnsForm .dxbButton div.dxb
    {
        padding: 3px 5px 3px !important;
        border: none;
    }
    .dxreControl .dxreDlgColumnsForm tbody > tr.dxrpCR > .dxrpcontent > .dxrpAW > .dxrpCW
    {
        padding: 10px 0;
    }
    .dxreControl .dxreDlgColumnsForm .dxflGroup, .dxreControl .dxreDlgColumnsForm .dxflGroupCell
    {
        padding: 0 4px;
    }
    .dxreControl .dxreDlgColumnsForm .dxreDlgColumnsEditorMainTable
    {
        width: 100%;
    }
    .dxreControl .dxreDlgColumnsForm .dxflNotFloatedElSys .dxrpControl .dxflGroupCell
    {
        padding: 0px;
    }
}
.dxreControl .dxre-Separator
{
    height: 0px;
    margin: 5px 0;
    border-top: 1px solid #808080;
}
.dxreControl .dxre-findreplacedialog
{
    max-width: 426px;
}
.dxreControl .dxre-findreplacedialog .dxre-searchResultList
{
    width: 100%;
    height: 180px;
}
.dxreControl .dxre-findreplacedialog .dxre-searchResultList .dxeListBoxItem
{
    white-space: normal;
}
.dxreControl .dxre-findreplacedialog .dxre-dialogContentGroup
{
    padding: 24px !important;
}
.dxreControl .dxre-findreplacedialog .dxre-searchResult
{
    width: 100% !important;
}
.dxreControl .dxre-findreplacedialog .dxre-searchResult > div
{
    float: none !important;
    width: auto !important;
}
.dxreControl .dxre-findreplacedialog .dxre-searchResult .dxflCaptionCell
{
    padding-top: 0px;
}
.dxreControl .dxre-findreplacedialog .dxre-searchResult .dxflNestedControlCell
{
    text-align: right;
    white-space: nowrap;
    color: #acacac;
}
.dxreControl .dxre-findreplacedialog .dxre-dialogControlsWrapper > tbody > tr > td:first-child
{
    width: auto;
}
.dxreControl .dxre-findreplacedialog .dxre-dialogControlsWrapper > tbody > tr > td:nth-child(2)
{
    width: 100%;
    text-align: left;
}
.dxreControl .dxre-findreplacedialog .dxre-replaceInfo
{
    position: absolute;
    left: 0;
    visibility: hidden;
}
.dxreControl .dxre-findreplacedialog .dxre-replaceInfo > div
{
    padding: 8px;
    background: #FFF2C0;
    box-sizing: border-box;
    text-align: center;
}
@media (max-width: 420px)
{
    .dxreControl .dxre-findreplacedialog .dxre-dialogFooter .dxreDlgFooterBtn
    {
        width: auto !important;
    }
    .dxreControl .dxre-findreplacedialog .dxre-dialogFooter .dxreDlgFooterBtn > div.dxb
    {
        padding-left: 5px;
        padding-right: 5px;
        font-size: 12px;
    }
}
.dxreControl .dxre-fontdialog
{
    max-width: 500px;
}
.dxreControl .dxreDlgFontForm .dxreCheckBoxContainer .dxflGroup,
.dxreControl .dxreDlgFontForm .dxreCheckBoxContainer .dxflGroupCell
{
    padding: 0px;
}
.dxreControl .dxreDlgFontForm .dxreCheckBoxContainer .dxflItem
{
    padding: 0px !important;
}
@media (max-width: 420px)
{
    .dxreControl .dxreDlgFontForm .dxre-dialogContentGroup .dxflLastChildSys .dxflGroupSys > div:not(.dxflFirstChildSys)
    {
        margin-top: 7px;
    }
}
.dxreControl .dxre-hyperlinkdialog
{
    max-width: 470px;
}
.dxreControl .dxre-insertimagedialog
{
    max-width: 400px;
}
.dxreControl .dxreDlgInsertImageForm .dxreDlgImagePreview
{
    margin-top: 10px;
    width: 100%;
    height: 170px;
    color: #878787;
    border: dashed 1px #cac8c8;
    text-align: center;
}
.dxreControl .dxreDlgInsertImageForm .dxflCaption
{
    white-space: normal;
}
.dxreControl .dxreDlgInsertImageForm .dxre-dialogRadioNavigation
{
    padding-bottom: 7px;
}
.dxreControl .dxre-insertmergefielddialog
{
    max-width: 300px !important;
}
.dxreControl .dxre-insertmergefielddialog .dxeListBox
{
    height: 250px;
}
.dxreControl .dxre-finishandmergedialog
{
    max-width: 215px;
}
.dxreControl .dxre-openfiledialog
{
    max-width: 800px;
}
.dxreControl .dxreDlgOpenFileForm
{
    height: 500px;
}
.dxreControl .dxreDlgOpenFileForm .dxflGroupCell,
.dxreControl .dxreDlgOpenFileForm .dxre-dialogContentGroup,
.dxreControl .dxreDlgOpenFileForm .dxre-dialogContentGroup .dxflItem
{
    padding: 0px !important;
}
.dxreControl .dxre-pagesetupdialog
{
    max-width: 380px;
}
.dxreControl .dxreDlgPageSetupForm .dxre-headersAndFootersGroup .dxflLastChildSys > .dxre-dialogLGC
{
    padding: 0px;
}
.dxreControl .dxreDlgPageSetupForm .dxre-offsetGroup .dxflGroupCell
{
    padding: 0px;
}
.dxreControl .dxreDlgPageSetupForm .dxre-offsetGroup tr:first-child .dxflGroupCell:first-child
{
    padding-right: 10px;
}
@media (min-width: 420px)
{
    .dxreControl .dxreDlgPageSetupForm .dxtc-content
    {
        min-height: 255px;
    }
}
.dxreControl .dxre-paragraphdialog
{
    max-width: 430px;
}
.dxreControl .dxreDlgParagraphForm .dxtc-content
{
    min-height: 335px;
}
.dxreControl .dxreDlgParagraphForm .dxre-dialogControlsWrapper > tbody > tr > td:first-child
{
    text-align: left;
}
@media (min-width: 420px)
{
    .dxreControl .dxreDlgParagraphForm .dxre-dialogParagraphInnerLayout
    {
        padding-top: 2px;
    }
    .dxreControl .dxreDlgParagraphForm .dxre-dialogParagraphInnerLayout .dxflFirstChildSys .dxflGroupCell
    {
        padding-right: 8px;
    }
}
.dxreControl .dxreDlgSaveFileForm
{
    width: 470px;
}
.dxreControl .dxre-spellingdialog
{
    max-width: 455px;
}
.dxreControl .dxreDlgSpellingForm .dxreDlgSB
{
    min-width: 80px;
    width: 100%;
    margin-bottom: 5px;
}
.dxreControl .dxreDlgSymbolsForm .dxreDlgSymbolsList
{
    height: 250px;
    border: 1px solid #808080;
}
.dxreControl .dxreDlgSymbolsForm .dxreDlgListBox > div
{
    width: 30px;
    height: 30px;
    line-height: 30px;
    font-size: large;
}
.dxreControl .dxre-splittablecellsdialog,
.dxreControl .dxre-deletetablecellsdialog,
.dxreControl .dxre-inserttabledialog
{
    max-width: 300px;
}
.dxreControl .dxre-tablepropertiesdialog
{
    max-width: 500px;
}
.dxreControl .dxreDlgTablePropertiesForm .dxtc-content
{
    min-height: 420px;
}
.dxreControl .dxreDlgTablePropertiesForm .dxre-dialogTableSpacing
{
    text-align: right;
}
.dxreControl .dxreDlgTablePropertiesForm .dxre-dialogTableSpacing table
{
    display: inline-block;
}
@media (max-width: 380px)
{
    .dxreControl .dxreDlgTablePropertiesForm .dxre-dialogTableSpacing
    {
        text-align: left;
    }
}
.dxreControl .dxreDlgTablePropertiesForm .dxreDlgRight .dxreDlgFooterBtn
{
    display: inline-table;
}
.dxreControl .dxre-bordershadingdialog
{
    max-width: 410px;
}
.dxreControl .dxreDlgBorderShadingForm .dxre-dialogBorderPresets
{
    padding: 6px 0;
}
.dxreControl .dxreDlgBorderShadingForm .dxre-dialogBorderPresets .dxre-dialogLGC
{
    padding: 0px;
}
.dxreControl .dxreDlgBorderShadingForm .dxre-dialogBorderPresets .dxre-dialogPresetButton
{
    padding-bottom: 5px;
    text-align: center;
}
.dxreControl .dxreDlgBorderShadingForm .dxre-dialogBorderPresets .dxre-dialogPresetButton .dxre-buttonLable
{
    display: block;
}
.dxreControl .dxreDlgBorderShadingForm .dxreTableBorderPreview
{
    width: 130px !important;
    display: inline-block;
}
.dxreControl .dxre-dialogCellMargins td.dxre-dialogLGC
{
    padding: 0 2px 0 0 !important;
}
.dxreControl .dxre-dialogCellBlock
{
    width: 68px;
    background-color: #E0E0E0;
    border: dashed 1px #818181;
}
.dxreControl .dxreBorderButton
{
    visibility: hidden;
}
.dxreControl .dxreBorderButton div.dxb
{
    padding: 0px !important;
}
.dxreControl .dxre-tabsdialog
{
    max-width: 380px;
}
.dxreControl .dxreDlgTabsForm .dxreDlgTabsList
{
    height: 70px;
}
.dxreControl .dxreDlgTabsForm .dxre-flowRadioButtonList span.dxichCellSys
{
    min-width: 90px;
}       
.dxRichEdit_CenterTabDragHandle, .dxRichEdit_ColumnSeparatorDragHandle, .dxRichEdit_DecimalTabDragHandle, .dxRichEdit_FirstLineIndentDragHandle, .dxRichEdit_LeftIndentDragHandle, .dxRichEdit_LeftTabDragHandle, .dxRichEdit_QuickSearchCloseButton, .dxRichEdit_QuickSearchCollapseButton, .dxRichEdit_QuickSearchNextButton, .dxRichEdit_QuickSearchPrevButton, .dxRichEdit_RightIndentDragHandle, .dxRichEdit_RightTabDragHandle { background-image: url('<%=WebResource("DevExpress.Web.ASPxRichEdit.Images.sprite.png")%>'); background-repeat: no-repeat; background-color: transparent } 
.dxRichEdit_CenterTabDragHandle { background-position: -112px 0px; width: 8px; height: 6px } 
.dxRichEdit_ColumnSeparatorDragHandle { background-position: -103px 0px; width: 7px; height: 8px } 
.dxRichEdit_DecimalTabDragHandle { background-position: -122px 0px; width: 8px; height: 6px } 
.dxRichEdit_FirstLineIndentDragHandle { background-position: -70px 0px; width: 9px; height: 8px } 
.dxRichEdit_LeftIndentDragHandle { background-position: -81px 0px; width: 9px; height: 8px } 
.dxRichEdit_LeftTabDragHandle { background-position: -132px 0px; width: 6px; height: 6px } 
.dxRichEdit_QuickSearchCloseButton { background-position: -36px 0px; width: 15px; height: 14px } 
.dxRichEdit_QuickSearchCollapseButton { background-position: -53px 0px; width: 15px; height: 14px } 
.dxRichEdit_QuickSearchNextButton { background-position: 0px 0px; width: 16px; height: 17px } 
.dxRichEdit_QuickSearchPrevButton { background-position: -18px 0px; width: 16px; height: 17px } 
.dxRichEdit_RightIndentDragHandle { background-position: -92px 0px; width: 9px; height: 8px } 
.dxRichEdit_RightTabDragHandle { background-position: -140px 0px; width: 6px; height: 6px } 
  (  
.dxRichEdit_Icons_AlignBottomCenter, .dxRichEdit_Icons_AlignBottomLeft, .dxRichEdit_Icons_AlignBottomRight, .dxRichEdit_Icons_AlignMiddleCenter, .dxRichEdit_Icons_AlignMiddleLeft, .dxRichEdit_Icons_AlignMiddleRight, .dxRichEdit_Icons_AlignTopCenter, .dxRichEdit_Icons_AlignTopLeft, .dxRichEdit_Icons_AlignTopRight, .dxRichEdit_Icons_Bookmark, .dxRichEdit_Icons_BorderBottom, .dxRichEdit_Icons_BorderInsideHorizontal, .dxRichEdit_Icons_BorderInsideVertical, .dxRichEdit_Icons_BorderLeft, .dxRichEdit_Icons_BorderRight, .dxRichEdit_Icons_BordersAll, .dxRichEdit_Icons_BordersBox, .dxRichEdit_Icons_BordersCustom, .dxRichEdit_Icons_BordersGrid, .dxRichEdit_Icons_BordersNone, .dxRichEdit_Icons_BorderTop, .dxRichEdit_Icons_ContinueNumberingList, .dxRichEdit_Icons_Copy, .dxRichEdit_Icons_Cut, .dxRichEdit_Icons_Delete_Hyperlink, .dxRichEdit_Icons_FloatingObjectBringForward, .dxRichEdit_Icons_FloatingObjectBringInFrontOfText, .dxRichEdit_Icons_FloatingObjectBringToFront, .dxRichEdit_Icons_FloatingObjectBringToFrontOfText, .dxRichEdit_Icons_FloatingObjectLayoutOptions, .dxRichEdit_Icons_FloatingObjectSendBackward, .dxRichEdit_Icons_FloatingObjectSendBehindText, .dxRichEdit_Icons_FloatingObjectSendToBack, .dxRichEdit_Icons_Font, .dxRichEdit_Icons_Hyperlink, .dxRichEdit_Icons_IndentDecrease, .dxRichEdit_Icons_IndentIncrease, .dxRichEdit_Icons_InsertTableCells, .dxRichEdit_Icons_InsertTableColumnsToTheLeft, .dxRichEdit_Icons_InsertTableColumnsToTheRight, .dxRichEdit_Icons_InsertTableRowsAbove, .dxRichEdit_Icons_InsertTableRowsBelow, .dxRichEdit_Icons_LeftColumns, .dxRichEdit_Icons_ListBullets, .dxRichEdit_Icons_MergeTableCells, .dxRichEdit_Icons_OneColumn, .dxRichEdit_Icons_Paragraph, .dxRichEdit_Icons_Paste, .dxRichEdit_Icons_RestartNumberingList, .dxRichEdit_Icons_RightColumns, .dxRichEdit_Icons_SelectAll, .dxRichEdit_Icons_SpellCheck, .dxRichEdit_Icons_SplitTableCells, .dxRichEdit_Icons_TableAutoFitContents, .dxRichEdit_Icons_TableAutoFitWindow, .dxRichEdit_Icons_TableFixedColumnWidth, .dxRichEdit_Icons_TableProperties, .dxRichEdit_Icons_TextWrapBehind, .dxRichEdit_Icons_TextWrapBehindLarge, .dxRichEdit_Icons_TextWrapInFrontOfText, .dxRichEdit_Icons_TextWrapInFrontOfTextLarge, .dxRichEdit_Icons_TextWrapInline, .dxRichEdit_Icons_TextWrapInlineLarge, .dxRichEdit_Icons_TextWrapSquare, .dxRichEdit_Icons_TextWrapSquareLarge, .dxRichEdit_Icons_TextWrapThrough, .dxRichEdit_Icons_TextWrapThroughLarge, .dxRichEdit_Icons_TextWrapTight, .dxRichEdit_Icons_TextWrapTightLarge, .dxRichEdit_Icons_TextWrapTopAndBottom, .dxRichEdit_Icons_TextWrapTopAndBottomLarge, .dxRichEdit_Icons_ThreeColumns, .dxRichEdit_Icons_ToggleFieldCodes, .dxRichEdit_Icons_TwoColumns, .dxRichEdit_Icons_UpdateField { background-image: url('<%=WebResource("DevExpress.Web.ASPxRichEdit.Images.ISprite.png")%>'); background-repeat: no-repeat; background-color: transparent } 
.dxRichEdit_Icons_AlignBottomCenter { background-position: -342px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_AlignBottomLeft { background-position: -36px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_AlignBottomRight { background-position: -18px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_AlignMiddleCenter { background-position: -486px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_AlignMiddleLeft { background-position: -504px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_AlignMiddleRight { background-position: 0px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_AlignTopCenter { background-position: -518px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_AlignTopLeft { background-position: -68px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_AlignTopRight { background-position: -86px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_Bookmark { background-position: -104px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_BorderBottom { background-position: -122px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_BorderInsideHorizontal { background-position: -140px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_BorderInsideVertical { background-position: -158px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_BorderLeft { background-position: -176px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_BorderRight { background-position: -194px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_BordersAll { background-position: -68px 0px; width: 32px; height: 32px } 
.dxRichEdit_Icons_BordersBox { background-position: -34px 0px; width: 32px; height: 32px } 
.dxRichEdit_Icons_BordersCustom { background-position: -238px 0px; width: 32px; height: 32px } 
.dxRichEdit_Icons_BordersGrid { background-position: -34px -34px; width: 32px; height: 32px } 
.dxRichEdit_Icons_BordersNone { background-position: 0px 0px; width: 32px; height: 32px } 
.dxRichEdit_Icons_BorderTop { background-position: -212px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_ContinueNumberingList { background-position: -230px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_Copy { background-position: -248px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_Cut { background-position: -500px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_Delete_Hyperlink { background-position: -482px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_FloatingObjectBringForward { background-position: -464px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_FloatingObjectBringInFrontOfText { background-position: -446px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_FloatingObjectBringToFront { background-position: -428px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_FloatingObjectBringToFrontOfText { background-position: -410px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_FloatingObjectLayoutOptions { background-position: -270px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_FloatingObjectSendBackward { background-position: -392px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_FloatingObjectSendBehindText { background-position: -356px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_FloatingObjectSendToBack { background-position: -338px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_Font { background-position: -320px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_Hyperlink { background-position: -302px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_IndentDecrease { background-position: -284px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_IndentIncrease { background-position: -266px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_InsertTableCells { background-position: -72px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_InsertTableColumnsToTheLeft { background-position: -54px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_InsertTableColumnsToTheRight { background-position: -374px -34px; width: 16px; height: 16px } 
.dxRichEdit_Icons_InsertTableRowsAbove { background-position: -90px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_InsertTableRowsBelow { background-position: -234px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_LeftColumns { background-position: -374px 0px; width: 32px; height: 32px } 
.dxRichEdit_Icons_ListBullets { background-position: -396px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_MergeTableCells { background-position: -414px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_OneColumn { background-position: -204px 0px; width: 32px; height: 32px } 
.dxRichEdit_Icons_Paragraph { background-position: -450px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_Paste { background-position: -378px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_RestartNumberingList { background-position: -468px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_RightColumns { background-position: 0px -34px; width: 32px; height: 32px } 
.dxRichEdit_Icons_SelectAll { background-position: -510px 0px; width: 16px; height: 16px } 
.dxRichEdit_Icons_SpellCheck { background-position: -432px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_SplitTableCells { background-position: -360px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_TableAutoFitContents { background-position: -108px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_TableAutoFitWindow { background-position: -324px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_TableFixedColumnWidth { background-position: -306px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_TableProperties { background-position: -288px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_TextWrapBehind { background-position: 0px -86px; width: 16px; height: 16px } 
.dxRichEdit_Icons_TextWrapBehindLarge { background-position: -136px 0px; width: 32px; height: 32px } 
.dxRichEdit_Icons_TextWrapInFrontOfText { background-position: -252px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_TextWrapInFrontOfTextLarge { background-position: -102px 0px; width: 32px; height: 32px } 
.dxRichEdit_Icons_TextWrapInline { background-position: -216px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_TextWrapInlineLarge { background-position: -170px 0px; width: 32px; height: 32px } 
.dxRichEdit_Icons_TextWrapSquare { background-position: -198px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_TextWrapSquareLarge { background-position: -272px 0px; width: 32px; height: 32px } 
.dxRichEdit_Icons_TextWrapThrough { background-position: -180px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_TextWrapThroughLarge { background-position: -306px 0px; width: 32px; height: 32px } 
.dxRichEdit_Icons_TextWrapTight { background-position: -162px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_TextWrapTightLarge { background-position: -340px 0px; width: 32px; height: 32px } 
.dxRichEdit_Icons_TextWrapTopAndBottom { background-position: -144px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_TextWrapTopAndBottomLarge { background-position: -408px 0px; width: 32px; height: 32px } 
.dxRichEdit_Icons_ThreeColumns { background-position: -442px 0px; width: 32px; height: 32px } 
.dxRichEdit_Icons_ToggleFieldCodes { background-position: -126px -68px; width: 16px; height: 16px } 
.dxRichEdit_Icons_TwoColumns { background-position: -476px 0px; width: 32px; height: 32px } 
.dxRichEdit_Icons_UpdateField { background-position: -18px -86px; width: 16px; height: 16px } 
   x)  
.dxRichEdit_GIcons_AlignBottomCenter, .dxRichEdit_GIcons_AlignBottomLeft, .dxRichEdit_GIcons_AlignBottomRight, .dxRichEdit_GIcons_AlignMiddleCenter, .dxRichEdit_GIcons_AlignMiddleLeft, .dxRichEdit_GIcons_AlignMiddleRight, .dxRichEdit_GIcons_AlignTopCenter, .dxRichEdit_GIcons_AlignTopLeft, .dxRichEdit_GIcons_AlignTopRight, .dxRichEdit_GIcons_Bookmark, .dxRichEdit_GIcons_BorderBottom, .dxRichEdit_GIcons_BorderInsideHorizontal, .dxRichEdit_GIcons_BorderInsideVertical, .dxRichEdit_GIcons_BorderLeft, .dxRichEdit_GIcons_BorderRight, .dxRichEdit_GIcons_BordersAll, .dxRichEdit_GIcons_BordersBox, .dxRichEdit_GIcons_BordersCustom, .dxRichEdit_GIcons_BordersGrid, .dxRichEdit_GIcons_BordersNone, .dxRichEdit_GIcons_BorderTop, .dxRichEdit_GIcons_ContinueNumberingList, .dxRichEdit_GIcons_Copy, .dxRichEdit_GIcons_Cut, .dxRichEdit_GIcons_Delete_Hyperlink, .dxRichEdit_GIcons_FloatingObjectBringForward, .dxRichEdit_GIcons_FloatingObjectBringInFrontOfText, .dxRichEdit_GIcons_FloatingObjectBringToFront, .dxRichEdit_GIcons_FloatingObjectBringToFrontOfText, .dxRichEdit_GIcons_FloatingObjectLayoutOptions, .dxRichEdit_GIcons_FloatingObjectSendBackward, .dxRichEdit_GIcons_FloatingObjectSendBehindText, .dxRichEdit_GIcons_FloatingObjectSendToBack, .dxRichEdit_GIcons_Font, .dxRichEdit_GIcons_Hyperlink, .dxRichEdit_GIcons_IndentDecrease, .dxRichEdit_GIcons_IndentIncrease, .dxRichEdit_GIcons_InsertTableCells, .dxRichEdit_GIcons_InsertTableColumnsToTheLeft, .dxRichEdit_GIcons_InsertTableColumnsToTheRight, .dxRichEdit_GIcons_InsertTableRowsAbove, .dxRichEdit_GIcons_InsertTableRowsBelow, .dxRichEdit_GIcons_LeftColumns, .dxRichEdit_GIcons_ListBullets, .dxRichEdit_GIcons_MergeTableCells, .dxRichEdit_GIcons_OneColumn, .dxRichEdit_GIcons_Paragraph, .dxRichEdit_GIcons_Paste, .dxRichEdit_GIcons_RestartNumberingList, .dxRichEdit_GIcons_RightColumns, .dxRichEdit_GIcons_SelectAll, .dxRichEdit_GIcons_SpellCheck, .dxRichEdit_GIcons_SplitTableCells, .dxRichEdit_GIcons_TableAutoFitContents, .dxRichEdit_GIcons_TableAutoFitWindow, .dxRichEdit_GIcons_TableFixedColumnWidth, .dxRichEdit_GIcons_TableProperties, .dxRichEdit_GIcons_TextWrapBehind, .dxRichEdit_GIcons_TextWrapBehindLarge, .dxRichEdit_GIcons_TextWrapInFrontOfText, .dxRichEdit_GIcons_TextWrapInFrontOfTextLarge, .dxRichEdit_GIcons_TextWrapInline, .dxRichEdit_GIcons_TextWrapInlineLarge, .dxRichEdit_GIcons_TextWrapSquare, .dxRichEdit_GIcons_TextWrapSquareLarge, .dxRichEdit_GIcons_TextWrapThrough, .dxRichEdit_GIcons_TextWrapThroughLarge, .dxRichEdit_GIcons_TextWrapTight, .dxRichEdit_GIcons_TextWrapTightLarge, .dxRichEdit_GIcons_TextWrapTopAndBottom, .dxRichEdit_GIcons_TextWrapTopAndBottomLarge, .dxRichEdit_GIcons_ThreeColumns, .dxRichEdit_GIcons_ToggleFieldCodes, .dxRichEdit_GIcons_TwoColumns, .dxRichEdit_GIcons_UpdateField { background-image: url('<%=WebResource("DevExpress.Web.ASPxRichEdit.Images.GISprite.png")%>'); background-repeat: no-repeat; background-color: transparent } 
.dxRichEdit_GIcons_AlignBottomCenter { background-position: -342px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_AlignBottomLeft { background-position: -36px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_AlignBottomRight { background-position: -18px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_AlignMiddleCenter { background-position: -486px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_AlignMiddleLeft { background-position: -504px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_AlignMiddleRight { background-position: 0px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_AlignTopCenter { background-position: -518px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_AlignTopLeft { background-position: -68px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_AlignTopRight { background-position: -86px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_Bookmark { background-position: -104px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_BorderBottom { background-position: -122px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_BorderInsideHorizontal { background-position: -140px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_BorderInsideVertical { background-position: -158px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_BorderLeft { background-position: -176px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_BorderRight { background-position: -194px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_BordersAll { background-position: -68px 0px; width: 32px; height: 32px } 
.dxRichEdit_GIcons_BordersBox { background-position: -34px 0px; width: 32px; height: 32px } 
.dxRichEdit_GIcons_BordersCustom { background-position: -238px 0px; width: 32px; height: 32px } 
.dxRichEdit_GIcons_BordersGrid { background-position: -34px -34px; width: 32px; height: 32px } 
.dxRichEdit_GIcons_BordersNone { background-position: 0px 0px; width: 32px; height: 32px } 
.dxRichEdit_GIcons_BorderTop { background-position: -212px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_ContinueNumberingList { background-position: -230px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_Copy { background-position: -248px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_Cut { background-position: -500px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_Delete_Hyperlink { background-position: -482px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_FloatingObjectBringForward { background-position: -464px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_FloatingObjectBringInFrontOfText { background-position: -446px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_FloatingObjectBringToFront { background-position: -428px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_FloatingObjectBringToFrontOfText { background-position: -410px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_FloatingObjectLayoutOptions { background-position: -270px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_FloatingObjectSendBackward { background-position: -392px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_FloatingObjectSendBehindText { background-position: -356px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_FloatingObjectSendToBack { background-position: -338px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_Font { background-position: -320px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_Hyperlink { background-position: -302px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_IndentDecrease { background-position: -284px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_IndentIncrease { background-position: -266px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_InsertTableCells { background-position: -72px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_InsertTableColumnsToTheLeft { background-position: -54px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_InsertTableColumnsToTheRight { background-position: -374px -34px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_InsertTableRowsAbove { background-position: -90px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_InsertTableRowsBelow { background-position: -234px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_LeftColumns { background-position: -374px 0px; width: 32px; height: 32px } 
.dxRichEdit_GIcons_ListBullets { background-position: -396px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_MergeTableCells { background-position: -414px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_OneColumn { background-position: -204px 0px; width: 32px; height: 32px } 
.dxRichEdit_GIcons_Paragraph { background-position: -450px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_Paste { background-position: -378px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_RestartNumberingList { background-position: -468px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_RightColumns { background-position: 0px -34px; width: 32px; height: 32px } 
.dxRichEdit_GIcons_SelectAll { background-position: -510px 0px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_SpellCheck { background-position: -432px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_SplitTableCells { background-position: -360px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_TableAutoFitContents { background-position: -108px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_TableAutoFitWindow { background-position: -324px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_TableFixedColumnWidth { background-position: -306px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_TableProperties { background-position: -288px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_TextWrapBehind { background-position: 0px -86px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_TextWrapBehindLarge { background-position: -136px 0px; width: 32px; height: 32px } 
.dxRichEdit_GIcons_TextWrapInFrontOfText { background-position: -252px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_TextWrapInFrontOfTextLarge { background-position: -102px 0px; width: 32px; height: 32px } 
.dxRichEdit_GIcons_TextWrapInline { background-position: -216px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_TextWrapInlineLarge { background-position: -170px 0px; width: 32px; height: 32px } 
.dxRichEdit_GIcons_TextWrapSquare { background-position: -198px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_TextWrapSquareLarge { background-position: -272px 0px; width: 32px; height: 32px } 
.dxRichEdit_GIcons_TextWrapThrough { background-position: -180px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_TextWrapThroughLarge { background-position: -306px 0px; width: 32px; height: 32px } 
.dxRichEdit_GIcons_TextWrapTight { background-position: -162px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_TextWrapTightLarge { background-position: -340px 0px; width: 32px; height: 32px } 
.dxRichEdit_GIcons_TextWrapTopAndBottom { background-position: -144px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_TextWrapTopAndBottomLarge { background-position: -408px 0px; width: 32px; height: 32px } 
.dxRichEdit_GIcons_ThreeColumns { background-position: -442px 0px; width: 32px; height: 32px } 
.dxRichEdit_GIcons_ToggleFieldCodes { background-position: -126px -68px; width: 16px; height: 16px } 
.dxRichEdit_GIcons_TwoColumns { background-position: -476px 0px; width: 32px; height: 32px } 
.dxRichEdit_GIcons_UpdateField { background-position: -18px -86px; width: 16px; height: 16px } 
    [  
.dxm-hovered .dxRichEdit_GWIcons_AlignBottomCenter, .dxm-hovered .dxRichEdit_GWIcons_AlignBottomLeft, .dxm-hovered .dxRichEdit_GWIcons_AlignBottomRight, .dxm-hovered .dxRichEdit_GWIcons_AlignMiddleCenter, .dxm-hovered .dxRichEdit_GWIcons_AlignMiddleLeft, .dxm-hovered .dxRichEdit_GWIcons_AlignMiddleRight, .dxm-hovered .dxRichEdit_GWIcons_AlignTopCenter, .dxm-hovered .dxRichEdit_GWIcons_AlignTopLeft, .dxm-hovered .dxRichEdit_GWIcons_AlignTopRight, .dxm-hovered .dxRichEdit_GWIcons_Bookmark, .dxm-hovered .dxRichEdit_GWIcons_BorderBottom, .dxm-hovered .dxRichEdit_GWIcons_BorderInsideHorizontal, .dxm-hovered .dxRichEdit_GWIcons_BorderInsideVertical, .dxm-hovered .dxRichEdit_GWIcons_BorderLeft, .dxm-hovered .dxRichEdit_GWIcons_BorderRight, .dxm-hovered .dxRichEdit_GWIcons_BordersAll, .dxm-hovered .dxRichEdit_GWIcons_BordersBox, .dxm-hovered .dxRichEdit_GWIcons_BordersCustom, .dxm-hovered .dxRichEdit_GWIcons_BordersGrid, .dxm-hovered .dxRichEdit_GWIcons_BordersNone, .dxm-hovered .dxRichEdit_GWIcons_BorderTop, .dxm-hovered .dxRichEdit_GWIcons_ContinueNumberingList, .dxm-hovered .dxRichEdit_GWIcons_Copy, .dxm-hovered .dxRichEdit_GWIcons_Cut, .dxm-hovered .dxRichEdit_GWIcons_Delete_Hyperlink, .dxm-hovered .dxRichEdit_GWIcons_FloatingObjectBringForward, .dxm-hovered .dxRichEdit_GWIcons_FloatingObjectBringInFrontOfText, .dxm-hovered .dxRichEdit_GWIcons_FloatingObjectBringToFront, .dxm-hovered .dxRichEdit_GWIcons_FloatingObjectBringToFrontOfText, .dxm-hovered .dxRichEdit_GWIcons_FloatingObjectLayoutOptions, .dxm-hovered .dxRichEdit_GWIcons_FloatingObjectSendBackward, .dxm-hovered .dxRichEdit_GWIcons_FloatingObjectSendBehindText, .dxm-hovered .dxRichEdit_GWIcons_FloatingObjectSendToBack, .dxm-hovered .dxRichEdit_GWIcons_Font, .dxm-hovered .dxRichEdit_GWIcons_Hyperlink, .dxm-hovered .dxRichEdit_GWIcons_IndentDecrease, .dxm-hovered .dxRichEdit_GWIcons_IndentIncrease, .dxm-hovered .dxRichEdit_GWIcons_InsertTableCells, .dxm-hovered .dxRichEdit_GWIcons_InsertTableColumnsToTheLeft, .dxm-hovered .dxRichEdit_GWIcons_InsertTableColumnsToTheRight, .dxm-hovered .dxRichEdit_GWIcons_InsertTableRowsAbove, .dxm-hovered .dxRichEdit_GWIcons_InsertTableRowsBelow, .dxm-hovered .dxRichEdit_GWIcons_LeftColumns, .dxm-hovered .dxRichEdit_GWIcons_ListBullets, .dxm-hovered .dxRichEdit_GWIcons_MergeTableCells, .dxm-hovered .dxRichEdit_GWIcons_OneColumn, .dxm-hovered .dxRichEdit_GWIcons_Paragraph, .dxm-hovered .dxRichEdit_GWIcons_Paste, .dxm-hovered .dxRichEdit_GWIcons_RestartNumberingList, .dxm-hovered .dxRichEdit_GWIcons_RightColumns, .dxm-hovered .dxRichEdit_GWIcons_SelectAll, .dxm-hovered .dxRichEdit_GWIcons_SpellCheck, .dxm-hovered .dxRichEdit_GWIcons_SplitTableCells, .dxm-hovered .dxRichEdit_GWIcons_TableAutoFitContents, .dxm-hovered .dxRichEdit_GWIcons_TableAutoFitWindow, .dxm-hovered .dxRichEdit_GWIcons_TableFixedColumnWidth, .dxm-hovered .dxRichEdit_GWIcons_TableProperties, .dxm-hovered .dxRichEdit_GWIcons_TextWrapBehind, .dxm-hovered .dxRichEdit_GWIcons_TextWrapBehindLarge, .dxm-hovered .dxRichEdit_GWIcons_TextWrapInFrontOfText, .dxm-hovered .dxRichEdit_GWIcons_TextWrapInFrontOfTextLarge, .dxm-hovered .dxRichEdit_GWIcons_TextWrapInline, .dxm-hovered .dxRichEdit_GWIcons_TextWrapInlineLarge, .dxm-hovered .dxRichEdit_GWIcons_TextWrapSquare, .dxm-hovered .dxRichEdit_GWIcons_TextWrapSquareLarge, .dxm-hovered .dxRichEdit_GWIcons_TextWrapThrough, .dxm-hovered .dxRichEdit_GWIcons_TextWrapThroughLarge, .dxm-hovered .dxRichEdit_GWIcons_TextWrapTight, .dxm-hovered .dxRichEdit_GWIcons_TextWrapTightLarge, .dxm-hovered .dxRichEdit_GWIcons_TextWrapTopAndBottom, .dxm-hovered .dxRichEdit_GWIcons_TextWrapTopAndBottomLarge, .dxm-hovered .dxRichEdit_GWIcons_ThreeColumns, .dxm-hovered .dxRichEdit_GWIcons_ToggleFieldCodes, .dxm-hovered .dxRichEdit_GWIcons_TwoColumns, .dxm-hovered .dxRichEdit_GWIcons_UpdateField, .dxRichEdit_GWIcons_AlignBottomCenter, .dxRichEdit_GWIcons_AlignBottomLeft, .dxRichEdit_GWIcons_AlignBottomRight, .dxRichEdit_GWIcons_AlignMiddleCenter, .dxRichEdit_GWIcons_AlignMiddleLeft, .dxRichEdit_GWIcons_AlignMiddleRight, .dxRichEdit_GWIcons_AlignTopCenter, .dxRichEdit_GWIcons_AlignTopLeft, .dxRichEdit_GWIcons_AlignTopRight, .dxRichEdit_GWIcons_Bookmark, .dxRichEdit_GWIcons_BorderBottom, .dxRichEdit_GWIcons_BorderInsideHorizontal, .dxRichEdit_GWIcons_BorderInsideVertical, .dxRichEdit_GWIcons_BorderLeft, .dxRichEdit_GWIcons_BorderRight, .dxRichEdit_GWIcons_BordersAll, .dxRichEdit_GWIcons_BordersBox, .dxRichEdit_GWIcons_BordersCustom, .dxRichEdit_GWIcons_BordersGrid, .dxRichEdit_GWIcons_BordersNone, .dxRichEdit_GWIcons_BorderTop, .dxRichEdit_GWIcons_ContinueNumberingList, .dxRichEdit_GWIcons_Copy, .dxRichEdit_GWIcons_Cut, .dxRichEdit_GWIcons_Delete_Hyperlink, .dxRichEdit_GWIcons_FloatingObjectBringForward, .dxRichEdit_GWIcons_FloatingObjectBringInFrontOfText, .dxRichEdit_GWIcons_FloatingObjectBringToFront, .dxRichEdit_GWIcons_FloatingObjectBringToFrontOfText, .dxRichEdit_GWIcons_FloatingObjectLayoutOptions, .dxRichEdit_GWIcons_FloatingObjectSendBackward, .dxRichEdit_GWIcons_FloatingObjectSendBehindText, .dxRichEdit_GWIcons_FloatingObjectSendToBack, .dxRichEdit_GWIcons_Font, .dxRichEdit_GWIcons_Hyperlink, .dxRichEdit_GWIcons_IndentDecrease, .dxRichEdit_GWIcons_IndentIncrease, .dxRichEdit_GWIcons_InsertTableCells, .dxRichEdit_GWIcons_InsertTableColumnsToTheLeft, .dxRichEdit_GWIcons_InsertTableColumnsToTheRight, .dxRichEdit_GWIcons_InsertTableRowsAbove, .dxRichEdit_GWIcons_InsertTableRowsBelow, .dxRichEdit_GWIcons_LeftColumns, .dxRichEdit_GWIcons_ListBullets, .dxRichEdit_GWIcons_MergeTableCells, .dxRichEdit_GWIcons_OneColumn, .dxRichEdit_GWIcons_Paragraph, .dxRichEdit_GWIcons_Paste, .dxRichEdit_GWIcons_RestartNumberingList, .dxRichEdit_GWIcons_RightColumns, .dxRichEdit_GWIcons_SelectAll, .dxRichEdit_GWIcons_SpellCheck, .dxRichEdit_GWIcons_SplitTableCells, .dxRichEdit_GWIcons_TableAutoFitContents, .dxRichEdit_GWIcons_TableAutoFitWindow, .dxRichEdit_GWIcons_TableFixedColumnWidth, .dxRichEdit_GWIcons_TableProperties, .dxRichEdit_GWIcons_TextWrapBehind, .dxRichEdit_GWIcons_TextWrapBehindLarge, .dxRichEdit_GWIcons_TextWrapInFrontOfText, .dxRichEdit_GWIcons_TextWrapInFrontOfTextLarge, .dxRichEdit_GWIcons_TextWrapInline, .dxRichEdit_GWIcons_TextWrapInlineLarge, .dxRichEdit_GWIcons_TextWrapSquare, .dxRichEdit_GWIcons_TextWrapSquareLarge, .dxRichEdit_GWIcons_TextWrapThrough, .dxRichEdit_GWIcons_TextWrapThroughLarge, .dxRichEdit_GWIcons_TextWrapTight, .dxRichEdit_GWIcons_TextWrapTightLarge, .dxRichEdit_GWIcons_TextWrapTopAndBottom, .dxRichEdit_GWIcons_TextWrapTopAndBottomLarge, .dxRichEdit_GWIcons_ThreeColumns, .dxRichEdit_GWIcons_ToggleFieldCodes, .dxRichEdit_GWIcons_TwoColumns, .dxRichEdit_GWIcons_UpdateField { background-image: url('<%=WebResource("DevExpress.Web.ASPxRichEdit.Images.GWISprite.png")%>'); background-repeat: no-repeat; background-color: transparent } 
.dxm-hovered .dxRichEdit_GWIcons_AlignBottomCenter { background-position: -406px -68px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_AlignBottomLeft { background-position: -180px -102px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_AlignBottomRight { background-position: -162px -102px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_AlignMiddleCenter { background-position: -144px -102px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_AlignMiddleLeft { background-position: -126px -102px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_AlignMiddleRight { background-position: -510px -34px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_AlignTopCenter { background-position: -270px -102px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_AlignTopLeft { background-position: -306px -102px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_AlignTopRight { background-position: -288px -120px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_Bookmark { background-position: -342px -102px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_BorderBottom { background-position: -378px -102px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_BorderInsideHorizontal { background-position: -432px -138px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_BorderInsideVertical { background-position: -234px -138px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_BorderLeft { background-position: -216px -138px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_BorderRight { background-position: -162px -120px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_BordersAll { background-position: -306px -34px; width: 32px; height: 32px } 
.dxm-hovered .dxRichEdit_GWIcons_BordersBox { background-position: -102px -34px; width: 32px; height: 32px } 
.dxm-hovered .dxRichEdit_GWIcons_BordersCustom { background-position: -442px -34px; width: 32px; height: 32px } 
.dxm-hovered .dxRichEdit_GWIcons_BordersGrid { background-position: -340px -34px; width: 32px; height: 32px } 
.dxm-hovered .dxRichEdit_GWIcons_BordersNone { background-position: 0px -68px; width: 32px; height: 32px } 
.dxm-hovered .dxRichEdit_GWIcons_BorderTop { background-position: -180px -120px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_ContinueNumberingList { background-position: -198px -120px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_Copy { background-position: -324px -102px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_Cut { background-position: -234px -120px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_Delete_Hyperlink { background-position: -270px -120px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_FloatingObjectBringForward { background-position: 0px -138px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_FloatingObjectBringInFrontOfText { background-position: -306px -138px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_FloatingObjectBringToFront { background-position: -342px -120px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_FloatingObjectBringToFrontOfText { background-position: -90px -120px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_FloatingObjectLayoutOptions { background-position: -324px -138px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_FloatingObjectSendBackward { background-position: -252px -120px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_FloatingObjectSendBehindText { background-position: -378px -120px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_FloatingObjectSendToBack { background-position: -396px -120px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_Font { background-position: -414px -120px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_Hyperlink { background-position: -432px -120px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_IndentDecrease { background-position: -288px -102px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_IndentIncrease { background-position: -216px -102px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_InsertTableCells { background-position: -234px -102px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_InsertTableColumnsToTheLeft { background-position: -198px -102px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_InsertTableColumnsToTheRight { background-position: -54px -102px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_InsertTableRowsAbove { background-position: -432px -102px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_InsertTableRowsBelow { background-position: -450px -102px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_LeftColumns { background-position: 0px -34px; width: 32px; height: 32px } 
.dxm-hovered .dxRichEdit_GWIcons_ListBullets { background-position: -468px -102px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_MergeTableCells { background-position: -486px -102px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_OneColumn { background-position: -68px -68px; width: 32px; height: 32px } 
.dxm-hovered .dxRichEdit_GWIcons_Paragraph { background-position: -504px -102px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_Paste { background-position: 0px -120px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_RestartNumberingList { background-position: -378px -138px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_RightColumns { background-position: -476px -34px; width: 32px; height: 32px } 
.dxm-hovered .dxRichEdit_GWIcons_SelectAll { background-position: -396px -138px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_SpellCheck { background-position: -414px -138px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_SplitTableCells { background-position: -450px -138px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_TableAutoFitContents { background-position: -54px -156px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_TableAutoFitWindow { background-position: -468px -138px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_TableFixedColumnWidth { background-position: -486px -138px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_TableProperties { background-position: -486px -120px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_TextWrapBehind { background-position: -504px -138px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_TextWrapBehindLarge { background-position: -476px 0px; width: 32px; height: 32px } 
.dxm-hovered .dxRichEdit_GWIcons_TextWrapInFrontOfText { background-position: -18px -156px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_TextWrapInFrontOfTextLarge { background-position: -442px 0px; width: 32px; height: 32px } 
.dxm-hovered .dxRichEdit_GWIcons_TextWrapInline { background-position: -36px -156px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_TextWrapInlineLarge { background-position: -374px 0px; width: 32px; height: 32px } 
.dxm-hovered .dxRichEdit_GWIcons_TextWrapSquare { background-position: -72px -102px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_TextWrapSquareLarge { background-position: -34px -68px; width: 32px; height: 32px } 
.dxm-hovered .dxRichEdit_GWIcons_TextWrapThrough { background-position: -288px -138px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_TextWrapThroughLarge { background-position: -238px 0px; width: 32px; height: 32px } 
.dxm-hovered .dxRichEdit_GWIcons_TextWrapTight { background-position: -414px -102px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_TextWrapTightLarge { background-position: -170px 0px; width: 32px; height: 32px } 
.dxm-hovered .dxRichEdit_GWIcons_TextWrapTopAndBottom { background-position: -252px -138px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_TextWrapTopAndBottomLarge { background-position: 0px 0px; width: 32px; height: 32px } 
.dxm-hovered .dxRichEdit_GWIcons_ThreeColumns { background-position: -102px 0px; width: 32px; height: 32px } 
.dxm-hovered .dxRichEdit_GWIcons_ToggleFieldCodes { background-position: -396px -102px; width: 16px; height: 16px } 
.dxm-hovered .dxRichEdit_GWIcons_TwoColumns { background-position: -34px 0px; width: 32px; height: 32px } 
.dxm-hovered .dxRichEdit_GWIcons_UpdateField { background-position: -468px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_AlignBottomCenter { background-position: -360px -102px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_AlignBottomLeft { background-position: -18px -102px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_AlignBottomRight { background-position: -324px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_AlignMiddleCenter { background-position: -36px -102px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_AlignMiddleLeft { background-position: -108px -102px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_AlignMiddleRight { background-position: -216px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_AlignTopCenter { background-position: -252px -102px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_AlignTopLeft { background-position: -450px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_AlignTopRight { background-position: 0px -156px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_Bookmark { background-position: -90px -102px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_BorderBottom { background-position: -306px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_BorderInsideHorizontal { background-position: -172px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_BorderInsideVertical { background-position: -280px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_BorderLeft { background-position: -244px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_BorderRight { background-position: -334px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_BordersAll { background-position: -272px -34px; width: 32px; height: 32px } 
.dxRichEdit_GWIcons_BordersBox { background-position: -68px -34px; width: 32px; height: 32px } 
.dxRichEdit_GWIcons_BordersCustom { background-position: -68px 0px; width: 32px; height: 32px } 
.dxRichEdit_GWIcons_BordersGrid { background-position: -136px 0px; width: 32px; height: 32px } 
.dxRichEdit_GWIcons_BordersNone { background-position: -204px 0px; width: 32px; height: 32px } 
.dxRichEdit_GWIcons_BorderTop { background-position: -36px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_ContinueNumberingList { background-position: -316px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_Copy { background-position: -298px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_Cut { background-position: -262px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_Delete_Hyperlink { background-position: -388px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_FloatingObjectBringForward { background-position: -510px 0px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_FloatingObjectBringInFrontOfText { background-position: -226px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_FloatingObjectBringToFront { background-position: -190px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_FloatingObjectBringToFrontOfText { background-position: -154px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_FloatingObjectLayoutOptions { background-position: -208px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_FloatingObjectSendBackward { background-position: -352px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_FloatingObjectSendBehindText { background-position: -504px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_FloatingObjectSendToBack { background-position: -442px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_Font { background-position: -144px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_Hyperlink { background-position: -126px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_IndentDecrease { background-position: -108px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_IndentIncrease { background-position: -198px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_InsertTableCells { background-position: -424px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_InsertTableColumnsToTheLeft { background-position: -180px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_InsertTableColumnsToTheRight { background-position: -162px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_InsertTableRowsAbove { background-position: -144px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_InsertTableRowsBelow { background-position: -126px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_LeftColumns { background-position: -408px 0px; width: 32px; height: 32px } 
.dxRichEdit_GWIcons_ListBullets { background-position: -108px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_MergeTableCells { background-position: -90px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_OneColumn { background-position: -340px 0px; width: 32px; height: 32px } 
.dxRichEdit_GWIcons_Paragraph { background-position: -72px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_Paste { background-position: -54px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_RestartNumberingList { background-position: -36px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_RightColumns { background-position: -306px 0px; width: 32px; height: 32px } 
.dxRichEdit_GWIcons_SelectAll { background-position: -18px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_SpellCheck { background-position: -360px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_SplitTableCells { background-position: -270px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_TableAutoFitContents { background-position: -360px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_TableAutoFitWindow { background-position: -18px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_TableFixedColumnWidth { background-position: -370px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_TableProperties { background-position: -136px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_TextWrapBehind { background-position: -342px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_TextWrapBehindLarge { background-position: -272px 0px; width: 32px; height: 32px } 
.dxRichEdit_GWIcons_TextWrapInFrontOfText { background-position: -54px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_TextWrapInFrontOfTextLarge { background-position: -170px -34px; width: 32px; height: 32px } 
.dxRichEdit_GWIcons_TextWrapInline { background-position: -72px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_TextWrapInlineLarge { background-position: -238px -34px; width: 32px; height: 32px } 
.dxRichEdit_GWIcons_TextWrapSquare { background-position: 0px -102px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_TextWrapSquareLarge { background-position: -204px -34px; width: 32px; height: 32px } 
.dxRichEdit_GWIcons_TextWrapThrough { background-position: -514px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_TextWrapThroughLarge { background-position: -102px -68px; width: 32px; height: 32px } 
.dxRichEdit_GWIcons_TextWrapTight { background-position: -496px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_TextWrapTightLarge { background-position: -374px -34px; width: 32px; height: 32px } 
.dxRichEdit_GWIcons_TextWrapTopAndBottom { background-position: -478px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_TextWrapTopAndBottomLarge { background-position: -34px -34px; width: 32px; height: 32px } 
.dxRichEdit_GWIcons_ThreeColumns { background-position: -408px -34px; width: 32px; height: 32px } 
.dxRichEdit_GWIcons_ToggleFieldCodes { background-position: -460px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWIcons_TwoColumns { background-position: -136px -34px; width: 32px; height: 32px } 
.dxRichEdit_GWIcons_UpdateField { background-position: -72px -156px; width: 16px; height: 16px } 
      b  
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_AlignBottomCenter, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_AlignBottomLeft, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_AlignBottomRight, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_AlignMiddleCenter, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_AlignMiddleLeft, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_AlignMiddleRight, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_AlignTopCenter, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_AlignTopLeft, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_AlignTopRight, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_Bookmark, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_BorderBottom, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_BorderInsideHorizontal, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_BorderInsideVertical, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_BorderLeft, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_BorderRight, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_BordersAll, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_BordersBox, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_BordersCustom, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_BordersGrid, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_BordersNone, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_BorderTop, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_ContinueNumberingList, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_Copy, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_Cut, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_Delete_Hyperlink, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_FloatingObjectBringForward, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_FloatingObjectBringInFrontOfText, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_FloatingObjectBringToFront, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_FloatingObjectBringToFrontOfText, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_FloatingObjectLayoutOptions, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_FloatingObjectSendBackward, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_FloatingObjectSendBehindText, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_FloatingObjectSendToBack, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_Font, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_Hyperlink, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_IndentDecrease, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_IndentIncrease, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_InsertTableCells, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_InsertTableColumnsToTheLeft, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_InsertTableColumnsToTheRight, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_InsertTableRowsAbove, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_InsertTableRowsBelow, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_LeftColumns, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_ListBullets, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_MergeTableCells, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_OneColumn, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_Paragraph, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_Paste, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_RestartNumberingList, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_RightColumns, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_SelectAll, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_SpellCheck, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_SplitTableCells, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TableAutoFitContents, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TableAutoFitWindow, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TableFixedColumnWidth, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TableProperties, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapBehind, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapBehindLarge, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapInFrontOfText, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapInFrontOfTextLarge, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapInline, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapInlineLarge, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapSquare, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapSquareLarge, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapThrough, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapThroughLarge, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapTight, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapTightLarge, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapTopAndBottom, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapTopAndBottomLarge, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_ThreeColumns, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_ToggleFieldCodes, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TwoColumns, .dxm-main .dxm-hovered .dxRichEdit_GWTIcons_UpdateField, .dxRichEdit_GWTIcons_AlignBottomCenter, .dxRichEdit_GWTIcons_AlignBottomLeft, .dxRichEdit_GWTIcons_AlignBottomRight, .dxRichEdit_GWTIcons_AlignMiddleCenter, .dxRichEdit_GWTIcons_AlignMiddleLeft, .dxRichEdit_GWTIcons_AlignMiddleRight, .dxRichEdit_GWTIcons_AlignTopCenter, .dxRichEdit_GWTIcons_AlignTopLeft, .dxRichEdit_GWTIcons_AlignTopRight, .dxRichEdit_GWTIcons_Bookmark, .dxRichEdit_GWTIcons_BorderBottom, .dxRichEdit_GWTIcons_BorderInsideHorizontal, .dxRichEdit_GWTIcons_BorderInsideVertical, .dxRichEdit_GWTIcons_BorderLeft, .dxRichEdit_GWTIcons_BorderRight, .dxRichEdit_GWTIcons_BordersAll, .dxRichEdit_GWTIcons_BordersBox, .dxRichEdit_GWTIcons_BordersCustom, .dxRichEdit_GWTIcons_BordersGrid, .dxRichEdit_GWTIcons_BordersNone, .dxRichEdit_GWTIcons_BorderTop, .dxRichEdit_GWTIcons_ContinueNumberingList, .dxRichEdit_GWTIcons_Copy, .dxRichEdit_GWTIcons_Cut, .dxRichEdit_GWTIcons_Delete_Hyperlink, .dxRichEdit_GWTIcons_FloatingObjectBringForward, .dxRichEdit_GWTIcons_FloatingObjectBringInFrontOfText, .dxRichEdit_GWTIcons_FloatingObjectBringToFront, .dxRichEdit_GWTIcons_FloatingObjectBringToFrontOfText, .dxRichEdit_GWTIcons_FloatingObjectLayoutOptions, .dxRichEdit_GWTIcons_FloatingObjectSendBackward, .dxRichEdit_GWTIcons_FloatingObjectSendBehindText, .dxRichEdit_GWTIcons_FloatingObjectSendToBack, .dxRichEdit_GWTIcons_Font, .dxRichEdit_GWTIcons_Hyperlink, .dxRichEdit_GWTIcons_IndentDecrease, .dxRichEdit_GWTIcons_IndentIncrease, .dxRichEdit_GWTIcons_InsertTableCells, .dxRichEdit_GWTIcons_InsertTableColumnsToTheLeft, .dxRichEdit_GWTIcons_InsertTableColumnsToTheRight, .dxRichEdit_GWTIcons_InsertTableRowsAbove, .dxRichEdit_GWTIcons_InsertTableRowsBelow, .dxRichEdit_GWTIcons_LeftColumns, .dxRichEdit_GWTIcons_ListBullets, .dxRichEdit_GWTIcons_MergeTableCells, .dxRichEdit_GWTIcons_OneColumn, .dxRichEdit_GWTIcons_Paragraph, .dxRichEdit_GWTIcons_Paste, .dxRichEdit_GWTIcons_RestartNumberingList, .dxRichEdit_GWTIcons_RightColumns, .dxRichEdit_GWTIcons_SelectAll, .dxRichEdit_GWTIcons_SpellCheck, .dxRichEdit_GWTIcons_SplitTableCells, .dxRichEdit_GWTIcons_TableAutoFitContents, .dxRichEdit_GWTIcons_TableAutoFitWindow, .dxRichEdit_GWTIcons_TableFixedColumnWidth, .dxRichEdit_GWTIcons_TableProperties, .dxRichEdit_GWTIcons_TextWrapBehind, .dxRichEdit_GWTIcons_TextWrapBehindLarge, .dxRichEdit_GWTIcons_TextWrapInFrontOfText, .dxRichEdit_GWTIcons_TextWrapInFrontOfTextLarge, .dxRichEdit_GWTIcons_TextWrapInline, .dxRichEdit_GWTIcons_TextWrapInlineLarge, .dxRichEdit_GWTIcons_TextWrapSquare, .dxRichEdit_GWTIcons_TextWrapSquareLarge, .dxRichEdit_GWTIcons_TextWrapThrough, .dxRichEdit_GWTIcons_TextWrapThroughLarge, .dxRichEdit_GWTIcons_TextWrapTight, .dxRichEdit_GWTIcons_TextWrapTightLarge, .dxRichEdit_GWTIcons_TextWrapTopAndBottom, .dxRichEdit_GWTIcons_TextWrapTopAndBottomLarge, .dxRichEdit_GWTIcons_ThreeColumns, .dxRichEdit_GWTIcons_ToggleFieldCodes, .dxRichEdit_GWTIcons_TwoColumns, .dxRichEdit_GWTIcons_UpdateField { background-image: url('<%=WebResource("DevExpress.Web.ASPxRichEdit.Images.GWTISprite.png")%>'); background-repeat: no-repeat; background-color: transparent } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_AlignBottomCenter { background-position: -406px -68px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_AlignBottomLeft { background-position: -180px -102px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_AlignBottomRight { background-position: -162px -102px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_AlignMiddleCenter { background-position: -144px -102px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_AlignMiddleLeft { background-position: -126px -102px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_AlignMiddleRight { background-position: -510px -34px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_AlignTopCenter { background-position: -270px -102px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_AlignTopLeft { background-position: -306px -102px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_AlignTopRight { background-position: -288px -120px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_Bookmark { background-position: -342px -102px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_BorderBottom { background-position: -378px -102px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_BorderInsideHorizontal { background-position: -432px -138px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_BorderInsideVertical { background-position: -234px -138px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_BorderLeft { background-position: -216px -138px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_BorderRight { background-position: -162px -120px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_BordersAll { background-position: -306px -34px; width: 32px; height: 32px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_BordersBox { background-position: -102px -34px; width: 32px; height: 32px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_BordersCustom { background-position: -442px -34px; width: 32px; height: 32px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_BordersGrid { background-position: -340px -34px; width: 32px; height: 32px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_BordersNone { background-position: 0px -68px; width: 32px; height: 32px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_BorderTop { background-position: -180px -120px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_ContinueNumberingList { background-position: -198px -120px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_Copy { background-position: -324px -102px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_Cut { background-position: -234px -120px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_Delete_Hyperlink { background-position: -270px -120px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_FloatingObjectBringForward { background-position: 0px -138px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_FloatingObjectBringInFrontOfText { background-position: -306px -138px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_FloatingObjectBringToFront { background-position: -342px -120px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_FloatingObjectBringToFrontOfText { background-position: -90px -120px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_FloatingObjectLayoutOptions { background-position: -324px -138px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_FloatingObjectSendBackward { background-position: -252px -120px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_FloatingObjectSendBehindText { background-position: -378px -120px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_FloatingObjectSendToBack { background-position: -396px -120px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_Font { background-position: -414px -120px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_Hyperlink { background-position: -432px -120px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_IndentDecrease { background-position: -288px -102px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_IndentIncrease { background-position: -216px -102px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_InsertTableCells { background-position: -234px -102px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_InsertTableColumnsToTheLeft { background-position: -198px -102px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_InsertTableColumnsToTheRight { background-position: -54px -102px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_InsertTableRowsAbove { background-position: -432px -102px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_InsertTableRowsBelow { background-position: -450px -102px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_LeftColumns { background-position: 0px -34px; width: 32px; height: 32px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_ListBullets { background-position: -468px -102px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_MergeTableCells { background-position: -486px -102px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_OneColumn { background-position: -68px -68px; width: 32px; height: 32px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_Paragraph { background-position: -504px -102px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_Paste { background-position: 0px -120px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_RestartNumberingList { background-position: -378px -138px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_RightColumns { background-position: -476px -34px; width: 32px; height: 32px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_SelectAll { background-position: -396px -138px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_SpellCheck { background-position: -414px -138px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_SplitTableCells { background-position: -450px -138px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TableAutoFitContents { background-position: -54px -156px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TableAutoFitWindow { background-position: -468px -138px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TableFixedColumnWidth { background-position: -486px -138px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TableProperties { background-position: -486px -120px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapBehind { background-position: -504px -138px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapBehindLarge { background-position: -476px 0px; width: 32px; height: 32px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapInFrontOfText { background-position: -18px -156px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapInFrontOfTextLarge { background-position: -442px 0px; width: 32px; height: 32px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapInline { background-position: -36px -156px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapInlineLarge { background-position: -374px 0px; width: 32px; height: 32px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapSquare { background-position: -72px -102px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapSquareLarge { background-position: -34px -68px; width: 32px; height: 32px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapThrough { background-position: -288px -138px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapThroughLarge { background-position: -238px 0px; width: 32px; height: 32px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapTight { background-position: -414px -102px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapTightLarge { background-position: -170px 0px; width: 32px; height: 32px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapTopAndBottom { background-position: -252px -138px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TextWrapTopAndBottomLarge { background-position: 0px 0px; width: 32px; height: 32px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_ThreeColumns { background-position: -102px 0px; width: 32px; height: 32px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_ToggleFieldCodes { background-position: -396px -102px; width: 16px; height: 16px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_TwoColumns { background-position: -34px 0px; width: 32px; height: 32px } 
.dxm-main .dxm-hovered .dxRichEdit_GWTIcons_UpdateField { background-position: -468px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_AlignBottomCenter { background-position: -360px -102px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_AlignBottomLeft { background-position: -18px -102px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_AlignBottomRight { background-position: -324px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_AlignMiddleCenter { background-position: -36px -102px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_AlignMiddleLeft { background-position: -108px -102px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_AlignMiddleRight { background-position: -216px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_AlignTopCenter { background-position: -252px -102px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_AlignTopLeft { background-position: -450px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_AlignTopRight { background-position: 0px -156px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_Bookmark { background-position: -90px -102px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_BorderBottom { background-position: -306px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_BorderInsideHorizontal { background-position: -172px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_BorderInsideVertical { background-position: -280px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_BorderLeft { background-position: -244px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_BorderRight { background-position: -334px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_BordersAll { background-position: -272px -34px; width: 32px; height: 32px } 
.dxRichEdit_GWTIcons_BordersBox { background-position: -68px -34px; width: 32px; height: 32px } 
.dxRichEdit_GWTIcons_BordersCustom { background-position: -68px 0px; width: 32px; height: 32px } 
.dxRichEdit_GWTIcons_BordersGrid { background-position: -136px 0px; width: 32px; height: 32px } 
.dxRichEdit_GWTIcons_BordersNone { background-position: -204px 0px; width: 32px; height: 32px } 
.dxRichEdit_GWTIcons_BorderTop { background-position: -36px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_ContinueNumberingList { background-position: -316px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_Copy { background-position: -298px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_Cut { background-position: -262px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_Delete_Hyperlink { background-position: -388px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_FloatingObjectBringForward { background-position: -510px 0px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_FloatingObjectBringInFrontOfText { background-position: -226px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_FloatingObjectBringToFront { background-position: -190px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_FloatingObjectBringToFrontOfText { background-position: -154px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_FloatingObjectLayoutOptions { background-position: -208px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_FloatingObjectSendBackward { background-position: -352px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_FloatingObjectSendBehindText { background-position: -504px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_FloatingObjectSendToBack { background-position: -442px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_Font { background-position: -144px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_Hyperlink { background-position: -126px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_IndentDecrease { background-position: -108px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_IndentIncrease { background-position: -198px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_InsertTableCells { background-position: -424px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_InsertTableColumnsToTheLeft { background-position: -180px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_InsertTableColumnsToTheRight { background-position: -162px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_InsertTableRowsAbove { background-position: -144px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_InsertTableRowsBelow { background-position: -126px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_LeftColumns { background-position: -408px 0px; width: 32px; height: 32px } 
.dxRichEdit_GWTIcons_ListBullets { background-position: -108px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_MergeTableCells { background-position: -90px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_OneColumn { background-position: -340px 0px; width: 32px; height: 32px } 
.dxRichEdit_GWTIcons_Paragraph { background-position: -72px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_Paste { background-position: -54px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_RestartNumberingList { background-position: -36px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_RightColumns { background-position: -306px 0px; width: 32px; height: 32px } 
.dxRichEdit_GWTIcons_SelectAll { background-position: -18px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_SpellCheck { background-position: -360px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_SplitTableCells { background-position: -270px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_TableAutoFitContents { background-position: -360px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_TableAutoFitWindow { background-position: -18px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_TableFixedColumnWidth { background-position: -370px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_TableProperties { background-position: -136px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_TextWrapBehind { background-position: -342px -138px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_TextWrapBehindLarge { background-position: -272px 0px; width: 32px; height: 32px } 
.dxRichEdit_GWTIcons_TextWrapInFrontOfText { background-position: -54px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_TextWrapInFrontOfTextLarge { background-position: -170px -34px; width: 32px; height: 32px } 
.dxRichEdit_GWTIcons_TextWrapInline { background-position: -72px -120px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_TextWrapInlineLarge { background-position: -238px -34px; width: 32px; height: 32px } 
.dxRichEdit_GWTIcons_TextWrapSquare { background-position: 0px -102px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_TextWrapSquareLarge { background-position: -204px -34px; width: 32px; height: 32px } 
.dxRichEdit_GWTIcons_TextWrapThrough { background-position: -514px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_TextWrapThroughLarge { background-position: -102px -68px; width: 32px; height: 32px } 
.dxRichEdit_GWTIcons_TextWrapTight { background-position: -496px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_TextWrapTightLarge { background-position: -374px -34px; width: 32px; height: 32px } 
.dxRichEdit_GWTIcons_TextWrapTopAndBottom { background-position: -478px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_TextWrapTopAndBottomLarge { background-position: -34px -34px; width: 32px; height: 32px } 
.dxRichEdit_GWTIcons_ThreeColumns { background-position: -408px -34px; width: 32px; height: 32px } 
.dxRichEdit_GWTIcons_ToggleFieldCodes { background-position: -460px -68px; width: 16px; height: 16px } 
.dxRichEdit_GWTIcons_TwoColumns { background-position: -136px -34px; width: 32px; height: 32px } 
.dxRichEdit_GWTIcons_UpdateField { background-position: -72px -156px; width: 16px; height: 16px } 
     z  /* AutoScroll */
.dxreAutoScroll
{
    position: fixed;
    width: 20px;
    height: 20px;
    background: url('<%=WebResource("DevExpress.Web.ASPxRichEdit.Images.reAutoScrollArrow.svg")%>');
    z-index: 165;
}
.dxreAutoScrollCursor
{
    position: fixed;
    left: 0px;
    width: 100%;
    z-index: 166;
}
.dxreAutoScrollCursorN
{
    cursor: url('<%=WebResource("DevExpress.Web.ASPxRichEdit.Images.reAutoScrollCursorN.svg")%>') 10 10, n-resize;
}
.dxreAutoScrollCursorNS
{
    cursor: url('<%=WebResource("DevExpress.Web.ASPxRichEdit.Images.reAutoScrollCursorNS.svg")%>') 10 10, ns-resize;
}
.dxreAutoScrollCursorS
{
    cursor: url('<%=WebResource("DevExpress.Web.ASPxRichEdit.Images.reAutoScrollCursorS.svg")%>') 10 10, s-resize;
}
/* AutoScroll */
/* Bootstrap correction */
.dxreMeasurer *,
.dxreRulerWrapper div
{
    -moz-box-sizing: content-box;
    -webkit-box-sizing: content-box;
    box-sizing: content-box;
}
/* Bootstrap correction */
/* Cursor */
.dxreCursorDefault .dxrePage
{
    cursor: default;
}
.dxreCursorNoDrop .dxrePage
{
    cursor: no-drop;
}
.dxreCursorCopy .dxrePage
{
    cursor: copy;
}
.dxreCursorNResize .dxrePage
{
    cursor: n-resize;
}
.dxreCursorSResize .dxrePage
{
    cursor: s-resize;
}
.dxreCursorWResize .dxrePage
{
    cursor: w-resize;
}
.dxreCursorEResize .dxrePage
{
    cursor: e-resize;
}
.dxreCursorEWResize .dxrePage
{
    cursor: ew-resize;
}
.dxreCursorNWResize .dxrePage
{
    cursor: nw-resize;
}
.dxreCursorNEResize .dxrePage
{
    cursor: ne-resize;
}
.dxreCursorNSResize .dxrePage
{
    cursor: ns-resize;
}
.dxreCursorSEResize .dxrePage
{
    cursor: se-resize;
}
.dxreCursorSWResize .dxrePage
{
    cursor: sw-resize;
}
/* Cursor */
/* HeaderFooter */
.dxreHeaderInfo
{
    position: absolute;
    left: 0;
    width: 100%;
    height: 20px;
    z-index: 161;
    border-top: #b9b9b9 1px dashed;
}
.dxreHeaderInfo b
{
    border: #b9b9b9 1px solid;
    margin: 0 5px;
    padding: 3px 5px;
    background: #CCCCCC;
    display: block;
    font-weight: normal;
    float: right;
}
.dxreHeaderInfo b:first-child
{
    float: left;
}
.dxreFooterInfo
{
    position: absolute;
    left: 0;
    width: 100%;
    height: 20px;
    z-index: 161;
    border-bottom: #b9b9b9 1px dashed;
}
.dxreFooterInfo b
{
    border: #b9b9b9 1px solid;
    margin: 0 5px;
    padding: 3px 5px;
    background: #CCCCCC;
    display: block;
    font-weight: normal;
    float: right;
}
.dxreFooterInfo b:first-child
{
    float: left;
}
/* HeaderFooter */
/* Layout */
.dxrePage
{
    position: relative;
    background: white;
    margin: 15px auto;
    cursor: text;
    overflow: hidden;
    -webkit-box-sizing: content-box;
    -moz-box-sizing: content-box;
    box-sizing: content-box;
}
.dxWebKitTouchUI .dxrePage
{
    overflow: scroll;
}
.dxreSimpleView
{
    padding: 0px !important;
}
.dxreSimplePage
{
    margin: 0;
    border-width: 0 !important;
    box-shadow: none !important;
    width: 100% !important;
}
.dxrePageArea
{
    position: absolute;
    overflow: visible;
}
.dxreTextBoxArea
{
    cursor: text;
}
.dxreColumn
{
    position: absolute;
    overflow: visible;
    cursor: text;
}
.dxreRow
{
    white-space: nowrap;
    overflow: hidden;
    position: absolute;
    font-size: 0;
}
.dxreBox
{
    position: absolute;
    white-space: nowrap;
    display: inline-block;
    text-decoration: inherit;
}
.dxreBoxSpace
{
    position: absolute;
    display: inline-block;
    overflow: hidden;
}
.dxreBoxSpace img
{
    vertical-align: bottom;
}
.dxreHiddenBox
{
    border-bottom: 1px dotted gray;
}
.dxreTextBoxBg
{
    position: absolute;
}
.dxreBoxBg
{
    position: absolute;
    display: block;
}
.dxrePic
{
    cursor: move;
}
.dxreParFrame
{
    position: absolute;
}
.dxreStartBookmark
{
    border: 2px solid #b9b9b9;
    position: absolute;
    box-sizing: border-box;
    border-right: none;
}
.dxreEndBookmark
{
    border: 2px solid #b9b9b9;
    position: absolute;
    box-sizing: border-box;
    border-left: none;
}
.dxreFieldBg
{
    position: absolute;
    display: inline-block;
}
.dxreFieldBoxLevel1
{
    background: #cecece;
}
.dxreFieldBoxLevel2
{
    background: #b9b9b9;
}
.dxreFieldBoxLevel3
{
    background: #a0a0a0;
}
.dxreAnchor
{
    background: url('<%=WebResource("DevExpress.Web.ASPxRichEdit.Images.reAnchor.png")%>');
    width: 16px;
    height: 16px;
    position: absolute;
    z-index: 154;
}
.dxreSelectedTextBox
{
    transform: none !important;
}
.dxreAncPic
{
    position: absolute;
}
/* Table */
.dxreTable
{
    position: absolute;
}
.dxreTableBrd
{
    position: absolute;
}
.dxreTableRowBg
{
    position: absolute;
}
.dxreTableCellBg
{
    position: absolute;
}
.dxreTableColumnCursor
{
    position: absolute;
    background-color: transparent;
    cursor: col-resize;
    width: 4px;
}
.dxreTableRowCursor
{
    position: absolute;
    background-color: transparent;
    cursor: row-resize;
    height: 4px;
}
.dxreTableBorderLine
{
    position: absolute;
    z-index: 155;
}
.dxreTblSelector
{
    position: absolute;
    background: url('<%=WebResource("DevExpress.Web.ASPxRichEdit.Images.startTableMark.svg")%>');
    cursor: pointer;
    z-index: 163;
}
/* Table */
/* QuickSearch */
.dxreQuickSearch
{
    position: relative;
}
.dxreQuickSearchPanelWrapper
{
    position: absolute;
    right: 20px;
    top: -1px;
    z-index: 164;
    overflow: hidden;
    visibility: hidden;
    transition: all 0.3s;
}
.dxreNotInternalRibbon .dxreQuickSearchPanelWrapper
{
    top: 0px;
}
.dxreQuickSearchPanel
{
    display: inline-block;
}
.dxreQuickSearchPanel .dxreQuickSearchButtonEdit
{
    float: left;
}
.dxreQuickSearchPanel .dxreQuickSearchButtonEdit td.dxic
{
    position: relative;
}
.dxreQuickSearchPanel span
{
    position: absolute;
    top: 0;
    right: 0;
    padding: 0px 5px;
    color: #acacac;
    background-color: #FFFFFF;
}
/* QuickSearch */
/* Ruler */
.dxreRulerLine
{
    width: 0;
    z-index: 100;
    position: absolute;
    display: none;
}
.dxreRulerWrapper
{
    cursor: default;
    overflow: hidden;
    position: relative;
}
.dxreRulerWrapper .dxre-rulertabAlignBox
{
    position: absolute;
    top: 0;
    left: 0;
}
.dxreRulerWrapper .dxre-rulertabAlignBox div
{
    position: absolute;
}
.dxreRulerWrapper .dxreRuler
{
    visibility: hidden;
    overflow: hidden;
    position: relative;
}
.dxreRuler .dxre-columnHandle
{
    position: absolute;
    z-index: 1;
    cursor: e-resize;
}
.dxreRuler .dxre-columnHandle > div
{
    position: absolute;
}
.dxreRuler .dxre-leftIndentDragHandleBody
{
    box-sizing: border-box;
}
.dxreRuler .dxre-rulerTableColumnSeparatorHandle
{
    position: absolute;
}
.dxreRuler .dxre-rulerTableColumnSeparatorHandle > div
{
    position: absolute;
    z-index: 1;
}
.dxreRuler .dxre-columnHandleLeftPart
{
    left: 0;
}
.dxreRuler .dxre-columnHandleRightPart
{
    right: 0;
}
.dxreRuler .dxreTabDragHandle,
.dxreRuler .dxreFirstLineIndentDragHandle,
.dxreRuler .dxreRightIndentDragHandle,
.dxreRuler .dxreLeftIndentDragHandle
{
    position: absolute;
    z-index: 2;
}
.dxreRuler .dxre-rulerDivisions
{
    position: absolute;
}
.dxreRuler .dxre-rulerDivisions > div
{
    z-index: 1;
    position: absolute;
    box-sizing: border-box;
}
.dxreRuler .dxre-rulerDivisions .dxre-rulerNumberDivision
{
    font-size: 10px;
    line-height: 10px;
}
.dxTouchUI .dxreRuler .dxre-rulerDivisions .dxre-rulerNumberDivision
{
    line-height: 12px;
}
.dxreRuler .dxre-rulerDivisions .dxre-rulerNumberDivision > div
{
    position: absolute;
    width: 100%;
    left: -50%;
    text-align: center;
}
.dxreRuler .dxre-rulerMarginLeftHandlePanel, .dxreRuler .dxre-rulerMarginRightHandlePanel
{
    position: absolute;
    z-index: 1;
    cursor: e-resize;
    background: url('<%=WebResource("DevExpress.Web.ASPxRichEdit.Images.1x1.gif")%>') !important;
}
.dxreRuler .dxre-rulerMarginLeftHandlePanel
{
    left: 0;
}
.dxreRuler .dxre-rulerMarginRightHandlePanel
{
    right: 0;
}
.dxreRuler .dxre-rulerMarginLeftPanel
{
    position: absolute;
    left: 0;
}
.dxreRuler .dxre-rulerMarginRightPanel
{
    position: absolute;
    right: 0;
}
/* Ruler */
/* Selection */
.dxreSelRow
{
    position: absolute;
    background: #a7a7a7;
    opacity: 0.50;
}
.dxTouchUI .dxreSelRow
{
    background: #a7a7a7;
}
.dxreInFocus .dxreSelRow
{
    background: #76a7fa;
}
.dxTouchUI .dxreInFocus .dxreSelRow
{
    background: #76a7fa;
}
.dxreSelFloatingObjects
{
    z-index: 152;
}
.dxreSelCursor
{
    position: absolute;
    opacity: 1;
    width: 1px;
    visibility: hidden;
}
.dxreInFocus .dxreSelCursor
{
    visibility: visible;
}
.dxreInFocus .dxreSelCursor
{
    background: url('<%=WebResource("DevExpress.Web.ASPxRichEdit.Images.Cursor.gif")%>');
}
.dxTouchUI .dxreInFocus .dxreSelCursor
{
    background: url('<%=WebResource("DevExpress.Web.ASPxRichEdit.Images.CursorTouch.gif")%>');
}
.dxreSelCursor.dxreSelNoblink
{
    position: absolute;
}
.dxreInFocus .dxreSelCursor.dxreSelNoblink
{
    background: #000000;
}
.dxTouchUI .dxreInFocus .dxreSelCursor.dxreSelNoblink
{
    background: #156ee4;
}
.dxreSelSearch
{
    position: absolute;
    background: #FFFF00;
    opacity: 0.50;
}
.dxTouchUI .dxreSelSearch
{
    background: #FFFF00;
}
.dxreInFocus .dxreSelSearch
{
    background: #FFFF00;
}
.dxTouchUI .dxreInFocus .dxreSelSearch
{
    background: #FFFF00;
}
.dxreSelRangePerm
{
    position: absolute;
}
.dxreSelMisspelled
{
    position: absolute;
    background: url('<%=WebResource("DevExpress.Web.ASPxRichEdit.Images.reErrorUnderline.gif")%>') bottom;
    background-repeat: repeat-x;
    padding-bottom: 4px;
    box-sizing: content-box;
}
.dxreSelBar
{
    z-index: 153;
    position: absolute;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: white;
    visibility: hidden;
}
.dxreSelBar:after
{
    position: absolute;
    width: 13px;
    height: 13px;
    content: '';
    top: 1px;
    left: 1px;
    right: 1px;
    bottom: 1px;
    border-radius: 50%;
    border: 2px solid #bbd3fd;
}
.dxreInFocus .dxreSelBar
{
    visibility: visible;
}
/* Selection */
/* ShapeResizeBox */
.dxreResBox
{
    position: absolute;
    cursor: move;
}
.dxreResBox.dxreResBoxTextBoxArea
{
    cursor: text;
}
.dxreResBox.dxreResBoxRotated
{
    z-index: 162;
}
.dxreResBoxCornerLineN
{
    position: absolute;
    z-index: 158;
    cursor: move;
    width: 100%;
    height: 5px;
    top: 0px;
    border-top: 1px solid #5A93D3;
}
.dxreResBoxCornerLineW
{
    position: absolute;
    z-index: 158;
    cursor: move;
    width: 5px;
    height: 100%;
    left: 0px;
    border-left: 1px solid #5A93D3;
}
.dxreResBoxCornerLineE
{
    position: absolute;
    z-index: 158;
    cursor: move;
    width: 5px;
    height: 100%;
    right: 0px;
    border-right: 1px solid #5A93D3;
}
.dxreResBoxCornerLineS
{
    position: absolute;
    z-index: 158;
    cursor: move;
    width: 100%;
    height: 5px;
    bottom: 0px;
    border-bottom: 1px solid #5A93D3;
}
.dxreResBox .dxreResBoxRotation
{
    position: absolute;
    border: 1px solid #989898;
    background-color: #F2FAFB;
    z-index: 160;
    width: 9px;
    height: 9px;
    margin-top: -6px;
    margin-left: -6px;
    border-radius: 5px;
    background-color: #88E43A;
    left: 50%;
    top: -20px;
    cursor: pointer;
    display: none;
}
.dxTouchUI .dxreResBox .dxreResBoxRotation
{
    top: -30px;
    width: 15px;
    height: 15px;
    margin-top: -9px;
    margin-left: -9px;
    border-radius: 50%;
}
.dxreResBox .dxreResBoxRotationLine
{
    position: absolute;
    z-index: 157;
    background-color: #5A93D3;
    left: 50%;
    top: -16px;
    width: 1px;
    height: 10px;
    margin-left: -1px;
    cursor: text;
    display: none;
}
.dxTouchUI .dxreResBox .dxreResBoxRotationLine
{
    top: -26px;
    height: 20px;
}
.dxreResBox.dxreResBoxAnchored .dxreResBoxRotation,
.dxreResBox.dxreResBoxAnchored .dxreResBoxRotationLine
{
    display: block;
}
.dxreResBoxCornerElemTouchN
{
    position: absolute;
    cursor: n-resize;
    left: 50%;
    top: 0;
    width: 15px;
    height: 15px;
    margin-left: -9px;
    margin-top: -9px;
    border-radius: 3px;
    border: 1px solid #989898;
    background-color: #F2FAFB;
}
.dxreResBoxCornerElemTouchE
{
    position: absolute;
    cursor: e-resize;
    left: 100%;
    top: 50%;
    width: 15px;
    height: 15px;
    margin-left: -8px;
    margin-top: -9px;
    border-radius: 3px;
    border: 1px solid #989898;
    background-color: #F2FAFB;
}
.dxreResBoxCornerElemTouchS
{
    position: absolute;
    cursor: s-resize;
    left: 50%;
    top: 100%;
    width: 15px;
    height: 15px;
    margin-left: -9px;
    margin-top: -8px;
    border-radius: 3px;
    border: 1px solid #989898;
    background-color: #F2FAFB;
}
.dxreResBoxCornerElemTouchW
{
    position: absolute;
    cursor: w-resize;
    left: 0;
    top: 50%;
    width: 15px;
    height: 15px;
    margin-left: -9px;
    margin-top: -9px;
    border-radius: 3px;
    border: 1px solid #989898;
    background-color: #F2FAFB;
}
.dxreResBoxCornerElemTouchNE
{
    position: absolute;
    cursor: ne-resize;
    left: 100%;
    top: 0;
    width: 15px;
    height: 15px;
    margin-left: -8px;
    margin-top: -9px;
    border-radius: 3px;
    border: 1px solid #989898;
    background-color: #F2FAFB;
}
.dxreResBoxCornerElemTouchSE
{
    position: absolute;
    cursor: se-resize;
    left: 100%;
    top: 100%;
    width: 15px;
    height: 15px;
    margin-left: -8px;
    margin-top: -8px;
    border-radius: 3px;
    border: 1px solid #989898;
    background-color: #F2FAFB;
}
.dxreResBoxCornerElemTouchSW
{
    position: absolute;
    cursor: sw-resize;
    left: 0;
    top: 100%;
    width: 15px;
    height: 15px;
    margin-left: -9px;
    margin-top: -8px;
    border-radius: 3px;
    border: 1px solid #989898;
    background-color: #F2FAFB;
}
.dxreResBoxCornerElemTouchNW
{
    position: absolute;
    cursor: nw-resize;
    left: 0;
    top: 0;
    width: 15px;
    height: 15px;
    margin-left: -9px;
    margin-top: -9px;
    border-radius: 3px;
    border: 1px solid #989898;
    background-color: #F2FAFB;
}
.dxreResBoxCornerElemN
{
    position: absolute;
    cursor: n-resize;
    left: 50%;
    top: 0;
    width: 9px;
    height: 9px;
    margin-left: -6px;
    margin-top: -6px;
    border-radius: 3px;
    border: 1px solid #989898;
    background-color: #F2FAFB;
}
.dxreResBoxCornerElemE
{
    position: absolute;
    cursor: e-resize;
    left: 100%;
    top: 50%;
    width: 9px;
    height: 9px;
    margin-left: -5px;
    margin-top: -6px;
    border-radius: 3px;
    border: 1px solid #989898;
    background-color: #F2FAFB;
}
.dxreResBoxCornerElemS
{
    position: absolute;
    cursor: s-resize;
    left: 50%;
    top: 100%;
    width: 9px;
    height: 9px;
    margin-left: -6px;
    margin-top: -5px;
    border-radius: 3px;
    border: 1px solid #989898;
    background-color: #F2FAFB;
}
.dxreResBoxCornerElemW
{
    position: absolute;
    cursor: w-resize;
    left: 0;
    top: 50%;
    width: 9px;
    height: 9px;
    margin-left: -6px;
    margin-top: -6px;
    border-radius: 3px;
    border: 1px solid #989898;
    background-color: #F2FAFB;
}
.dxreResBoxCornerElemNE
{
    position: absolute;
    cursor: ne-resize;
    left: 100%;
    top: 0;
    width: 9px;
    height: 9px;
    margin-left: -5px;
    margin-top: -6px;
    border-radius: 3px;
    border: 1px solid #989898;
    background-color: #F2FAFB;
}
.dxreResBoxCornerElemSE
{
    position: absolute;
    cursor: se-resize;
    left: 100%;
    top: 100%;
    width: 9px;
    height: 9px;
    margin-left: -5px;
    margin-top: -5px;
    border-radius: 3px;
    border: 1px solid #989898;
    background-color: #F2FAFB;
}
.dxreResBoxCornerElemSW
{
    position: absolute;
    cursor: sw-resize;
    left: 0;
    top: 100%;
    width: 9px;
    height: 9px;
    margin-left: -6px;
    margin-top: -5px;
    border-radius: 3px;
    border: 1px solid #989898;
    background-color: #F2FAFB;
}
.dxreResBoxCornerElemNW
{
    position: absolute;
    cursor: nw-resize;
    left: 0;
    top: 0;
    width: 9px;
    height: 9px;
    margin-left: -6px;
    margin-top: -6px;
    border-radius: 3px;
    border: 1px solid #989898;
    background-color: #F2FAFB;
}
/* ShapeResizeBox */
/* TableBorderPreview */
.dxreTablePreviewContainer
{
    width: 102px;
    height: 94px;
    position: relative;
    background-color: #FFFFFF;
}
.dxrePreviewBorderLine
{
    position: absolute;
    background-color: #FFFFFF;
}
.dxrePreviewVerticalLine
{
    position: absolute;
    height: 100%;
    z-index: 2;
}
.dxrePreviewHorizontalLine
{
    position: absolute;
    width: 100%;
    z-index: 4;
}
.dxrePreviewBorderControlLine
{
    border: 0 !important;
}
.dxrePreviewBorderControlLine.dxrePreviewVerticalLine
{
    width: 10%;
    z-index: 5;
}
.dxrePreviewBorderControlLine.dxrePreviewHorizontalLine
{
    height: 10%;
    z-index: 5;
}
.dxrePreviewBorderControlLine.dxrePreviewMiddleLine
{
    top: 45%;
}
.dxrePreviewBorderControlLine.dxrePreviewCenterLine
{
    left: 45%;
}
.dxrePreviewMiddleLine
{
    z-index: 2;
}
.dxrePreviewBottomLine
{
    bottom: 0%;
}
.dxrePreviewCenterLine
{
    z-index: 1;
}
.dxrePreviewRightLine
{
    right: 0%;
}
.dxrePreviewTopRightCell
{
    top: 50%;
    left: 0;
}
.dxrePreviewTopLeftCell
{
    top: 0;
    left: 0;
}
.dxrePreviewBottomRight
{
    top: 50%;
    left: 50%;
}
.dxrePreviewBottomLeft
{
    top: 0;
    left: 50%;
}
.dxrePreviewCell
{
    position: absolute;
    padding: 3px;
}
.dxrePreviewCell .dxrePreviewTextLine
{
    background-color: #a9a9a9;
}
.dxrePreviewCell .dxrePreviewTextLine:first-child
{
    margin-left: 12px;
}
.dxrePreviewCell .dxrePreviewTextLine:last-child
{
    margin-right: 12px;
}
.dxreBorderButton div.dxb.dxbf
{
    border: none !important;
}
/* TableBorderPreview */
.dxreTextBoxBgZL0
{
    z-index: 0;
}
.dxreTblRowBgZL0
{
    z-index: 1;
}
.dxreTblCellBgZL0
{
    z-index: 2;
}
.dxreParBgZL0
{
    z-index: 3;
}
.dxreBoxBgZL0
{
    z-index: 4;
}
.dxreFieldBgZL0
{
    z-index: 5;
}
.dxreSelRangeZL0
{
    z-index: 6;
}
.dxreBoxSpaceZL0
{
    z-index: 7;
}
.dxreSelSearchZL0
{
    z-index: 8;
}
.dxreSelRowZL0
{
    z-index: 9;
}
.dxreBoxZL0
{
    z-index: 10;
}
.dxreBookmarkZL0
{
    z-index: 11;
}
.dxreTableBorderZL0
{
    z-index: 12;
}
.dxreSelMisspZL0
{
    z-index: 13;
}
.dxreSelCursorZL0
{
    z-index: 14;
}
.dxreSelTouchBarZL0
{
    z-index: 15;
}
.dxreTblCursorZL0
{
    z-index: 16;
}
.dxreAnchoredPictureZL0
{
    z-index: 17;
}
.dxreTextBoxZL0
{
    z-index: 18;
}
.dxreTextBoxBgZL1
{
    z-index: 19;
}
.dxreTblRowBgZL1
{
    z-index: 20;
}
.dxreTblCellBgZL1
{
    z-index: 21;
}
.dxreParBgZL1
{
    z-index: 22;
}
.dxreBoxBgZL1
{
    z-index: 23;
}
.dxreFieldBgZL1
{
    z-index: 24;
}
.dxreSelRangeZL1
{
    z-index: 25;
}
.dxreBoxSpaceZL1
{
    z-index: 26;
}
.dxreSelSearchZL1
{
    z-index: 27;
}
.dxreSelRowZL1
{
    z-index: 28;
}
.dxreBoxZL1
{
    z-index: 29;
}
.dxreBookmarkZL1
{
    z-index: 30;
}
.dxreTableBorderZL1
{
    z-index: 31;
}
.dxreSelMisspZL1
{
    z-index: 32;
}
.dxreSelCursorZL1
{
    z-index: 33;
}
.dxreSelTouchBarZL1
{
    z-index: 34;
}
.dxreTblCursorZL1
{
    z-index: 35;
}
.dxreAnchoredPictureZL1
{
    z-index: 36;
}
.dxreTextBoxZL1
{
    z-index: 37;
}
.dxreTextBoxBgZL2
{
    z-index: 38;
}
.dxreTblRowBgZL2
{
    z-index: 39;
}
.dxreTblCellBgZL2
{
    z-index: 40;
}
.dxreParBgZL2
{
    z-index: 41;
}
.dxreBoxBgZL2
{
    z-index: 42;
}
.dxreFieldBgZL2
{
    z-index: 43;
}
.dxreSelRangeZL2
{
    z-index: 44;
}
.dxreBoxSpaceZL2
{
    z-index: 45;
}
.dxreSelSearchZL2
{
    z-index: 46;
}
.dxreSelRowZL2
{
    z-index: 47;
}
.dxreBoxZL2
{
    z-index: 48;
}
.dxreBookmarkZL2
{
    z-index: 49;
}
.dxreTableBorderZL2
{
    z-index: 50;
}
.dxreSelMisspZL2
{
    z-index: 51;
}
.dxreSelCursorZL2
{
    z-index: 52;
}
.dxreSelTouchBarZL2
{
    z-index: 53;
}
.dxreTblCursorZL2
{
    z-index: 54;
}
.dxreAnchoredPictureZL2
{
    z-index: 55;
}
.dxreTextBoxZL2
{
    z-index: 56;
}
.dxreTextBoxBgZL3
{
    z-index: 57;
}
.dxreTblRowBgZL3
{
    z-index: 58;
}
.dxreTblCellBgZL3
{
    z-index: 59;
}
.dxreParBgZL3
{
    z-index: 60;
}
.dxreBoxBgZL3
{
    z-index: 61;
}
.dxreFieldBgZL3
{
    z-index: 62;
}
.dxreSelRangeZL3
{
    z-index: 63;
}
.dxreBoxSpaceZL3
{
    z-index: 64;
}
.dxreSelSearchZL3
{
    z-index: 65;
}
.dxreSelRowZL3
{
    z-index: 66;
}
.dxreBoxZL3
{
    z-index: 67;
}
.dxreBookmarkZL3
{
    z-index: 68;
}
.dxreTableBorderZL3
{
    z-index: 69;
}
.dxreSelMisspZL3
{
    z-index: 70;
}
.dxreSelCursorZL3
{
    z-index: 71;
}
.dxreSelTouchBarZL3
{
    z-index: 72;
}
.dxreTblCursorZL3
{
    z-index: 73;
}
.dxreAnchoredPictureZL3
{
    z-index: 74;
}
.dxreTextBoxZL3
{
    z-index: 75;
}
.dxreTextBoxBgZL4
{
    z-index: 76;
}
.dxreTblRowBgZL4
{
    z-index: 77;
}
.dxreTblCellBgZL4
{
    z-index: 78;
}
.dxreParBgZL4
{
    z-index: 79;
}
.dxreBoxBgZL4
{
    z-index: 80;
}
.dxreFieldBgZL4
{
    z-index: 81;
}
.dxreSelRangeZL4
{
    z-index: 82;
}
.dxreBoxSpaceZL4
{
    z-index: 83;
}
.dxreSelSearchZL4
{
    z-index: 84;
}
.dxreSelRowZL4
{
    z-index: 85;
}
.dxreBoxZL4
{
    z-index: 86;
}
.dxreBookmarkZL4
{
    z-index: 87;
}
.dxreTableBorderZL4
{
    z-index: 88;
}
.dxreSelMisspZL4
{
    z-index: 89;
}
.dxreSelCursorZL4
{
    z-index: 90;
}
.dxreSelTouchBarZL4
{
    z-index: 91;
}
.dxreTblCursorZL4
{
    z-index: 92;
}
.dxreAnchoredPictureZL4
{
    z-index: 93;
}
.dxreTextBoxZL4
{
    z-index: 94;
}
.dxreTextBoxBgZL5
{
    z-index: 95;
}
.dxreTblRowBgZL5
{
    z-index: 96;
}
.dxreTblCellBgZL5
{
    z-index: 97;
}
.dxreParBgZL5
{
    z-index: 98;
}
.dxreBoxBgZL5
{
    z-index: 99;
}
.dxreFieldBgZL5
{
    z-index: 100;
}
.dxreSelRangeZL5
{
    z-index: 101;
}
.dxreBoxSpaceZL5
{
    z-index: 102;
}
.dxreSelSearchZL5
{
    z-index: 103;
}
.dxreSelRowZL5
{
    z-index: 104;
}
.dxreBoxZL5
{
    z-index: 105;
}
.dxreBookmarkZL5
{
    z-index: 106;
}
.dxreTableBorderZL5
{
    z-index: 107;
}
.dxreSelMisspZL5
{
    z-index: 108;
}
.dxreSelCursorZL5
{
    z-index: 109;
}
.dxreSelTouchBarZL5
{
    z-index: 110;
}
.dxreTblCursorZL5
{
    z-index: 111;
}
.dxreAnchoredPictureZL5
{
    z-index: 112;
}
.dxreTextBoxZL5
{
    z-index: 113;
}
.dxreTextBoxBgZL6
{
    z-index: 114;
}
.dxreTblRowBgZL6
{
    z-index: 115;
}
.dxreTblCellBgZL6
{
    z-index: 116;
}
.dxreParBgZL6
{
    z-index: 117;
}
.dxreBoxBgZL6
{
    z-index: 118;
}
.dxreFieldBgZL6
{
    z-index: 119;
}
.dxreSelRangeZL6
{
    z-index: 120;
}
.dxreBoxSpaceZL6
{
    z-index: 121;
}
.dxreSelSearchZL6
{
    z-index: 122;
}
.dxreSelRowZL6
{
    z-index: 123;
}
.dxreBoxZL6
{
    z-index: 124;
}
.dxreBookmarkZL6
{
    z-index: 125;
}
.dxreTableBorderZL6
{
    z-index: 126;
}
.dxreSelMisspZL6
{
    z-index: 127;
}
.dxreSelCursorZL6
{
    z-index: 128;
}
.dxreSelTouchBarZL6
{
    z-index: 129;
}
.dxreTblCursorZL6
{
    z-index: 130;
}
.dxreAnchoredPictureZL6
{
    z-index: 131;
}
.dxreTextBoxZL6
{
    z-index: 132;
}
.dxreTextBoxBgZL7
{
    z-index: 133;
}
.dxreTblRowBgZL7
{
    z-index: 134;
}
.dxreTblCellBgZL7
{
    z-index: 135;
}
.dxreParBgZL7
{
    z-index: 136;
}
.dxreBoxBgZL7
{
    z-index: 137;
}
.dxreFieldBgZL7
{
    z-index: 138;
}
.dxreSelRangeZL7
{
    z-index: 139;
}
.dxreBoxSpaceZL7
{
    z-index: 140;
}
.dxreSelSearchZL7
{
    z-index: 141;
}
.dxreSelRowZL7
{
    z-index: 142;
}
.dxreBoxZL7
{
    z-index: 143;
}
.dxreBookmarkZL7
{
    z-index: 144;
}
.dxreTableBorderZL7
{
    z-index: 145;
}
.dxreSelMisspZL7
{
    z-index: 146;
}
.dxreSelCursorZL7
{
    z-index: 147;
}
.dxreSelTouchBarZL7
{
    z-index: 148;
}
.dxreTblCursorZL7
{
    z-index: 149;
}
.dxreAnchoredPictureZL7
{
    z-index: 150;
}
.dxreTextBoxZL7
{
    z-index: 151;
}
.dxreTextBoxBgZL8
{
    z-index: 152;
}
.dxreTblRowBgZL8
{
    z-index: 153;
}
.dxreTblCellBgZL8
{
    z-index: 154;
}
.dxreParBgZL8
{
    z-index: 155;
}
.dxreBoxBgZL8
{
    z-index: 156;
}
.dxreFieldBgZL8
{
    z-index: 157;
}
.dxreSelRangeZL8
{
    z-index: 158;
}
.dxreBoxSpaceZL8
{
    z-index: 159;
}
.dxreSelSearchZL8
{
    z-index: 160;
}
.dxreSelRowZL8
{
    z-index: 161;
}
.dxreBoxZL8
{
    z-index: 162;
}
.dxreBookmarkZL8
{
    z-index: 163;
}
.dxreTableBorderZL8
{
    z-index: 164;
}
.dxreSelMisspZL8
{
    z-index: 165;
}
.dxreSelCursorZL8
{
    z-index: 166;
}
.dxreSelTouchBarZL8
{
    z-index: 167;
}
.dxreTblCursorZL8
{
    z-index: 168;
}
.dxreAnchoredPictureZL8
{
    z-index: 169;
}
.dxreTextBoxZL8
{
    z-index: 170;
}
.dxreDebugTableColumnBound
{
    position: absolute;
    color: green;
    text-align: left;
    opacity: 1;
    z-index: 100;
    border: 1px solid green;
}
.dxreDebugTableRowBound
{
    position: absolute;
    color: red;
    border-color: red;
    text-align: center;
    opacity: 0.6;
    z-index: 99;
    border: 1px solid red;
}
.dxreDebugTableCellBound
{
    position: absolute;
    color: blue;
    text-align: right;
    opacity: 0.7;
    z-index: 98;
    border: 1px solid blue;
}
.dxreDebugPageAreaBounds
{
    position: absolute;
    color: red;
    text-align: right;
    opacity: 1;
    z-index: 100;
    border: 1px solid red;
}
.dxreDebugColumnBounds
{
    position: absolute;
    color: blue;
    text-align: center;
    opacity: 0.7;
    z-index: 99;
    border: 1px solid blue;
}
.dxreDebugRowBounds
{
    position: absolute;
    color: green;
    text-align: left;
    opacity: 0.6;
    z-index: 98;
    border: 1px solid green;
}
/* System */
.dxreControlSys
{
    width: 1000px;
    height: 500px;
    box-sizing: border-box;
}
.dxreMeasurer
{
    position: absolute;
    top: -100000px;
    left: -100000px;
    overflow: hidden;
    line-height: normal;
}
.dxreMeasurer pre
{
    position: absolute;
    visibility: hidden;
    /* for bootstrap */
    white-space: pre !important;
    border: none;
    padding: 0;
    margin: 0;
    line-height: initial;
    word-break: initial;
    word-wrap: initial;
    border-radius: 0;
    display: initial;
}
.dxreView
{
    position: relative;
    overflow: auto;
    padding: 0 10px;
    -webkit-overflow-scrolling: touch;
    -webkit-appearance: none;
    -ms-touch-action: pan-y pinch-zoom;
    touch-action: pan-y pinch-zoom;
}
.dxreInputTargetContainer
{
    position: absolute;
    overflow: hidden;
    height: 0;
}
.dxreInputTarget
{
    position: fixed;
    overflow: hidden;
    left: -1px;
    top: -1px;
    height: 0;
    width: 0;
    padding: 0;
    outline: none;
    border: none;
}
.dxTouchUI .dxreInputTarget
{
    -webkit-user-select: auto;
    user-select: all;
    position: absolute;
    font-size: 1px;
    color: transparent;
    height: 1px;
    width: 1px;
}
.dxMacOSPlatform.dxSafari .dxreInputTarget
{
    top: -5000px;
    width: 5000px;
    height: 5000px;
}
.dxTouchUI.dxAndroidMobilePlatform .dxreInputTarget
{
    font-size: inherit;
    opacity: 0;
}
.dxTouchUI.dxMacOSMobilePlatform .dxreInputTarget
{
    font-size: 16px;
    margin-top: 10px;
    line-height: 0;
    transform: scale(0);
    -webkit-transform: scale(0);
}
.dxTouchUI .dxreControlSys .dxm-popupMain,
.dxTouchUI .dxreView,
.dxreControlSys
{
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.dxre-pum-suggestionItem
{
    font-weight: bold;
}
.dxreControlSys .dxm-item .dxm-content.dxalink:focus
{
    outline: none;
}
.dxreBlackout
{
    opacity: 0.4;
}
.dxreControlSys .dxr-itemDisabled .dxr-img16,
.dxreControlSys .dxr-itemDisabled .dxr-img32
{
    opacity: .35;
    filter: alpha(opacity=35);
}
.dxreDragCaret
{
    position: absolute;
    width: 1px;
    border-left: 1px dotted black;
    z-index: 156;
}
.dxre-helperFrame
{
    top: -100px;
    left: -100px;
    overflow: hidden;
    position: absolute;
    border-style: none;
}
.dxrePlaceholderDiv
{
    background-color: white;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
}
/* System */
/* Dialogs */
.dxre-dialogPreparing > .dxre-dialogWrapperPanel
{
    overflow: hidden;
    width: 0px;
    height: 0px;
    position: absolute;
}
.dxre-dialogControlsWrapper
{
    width: 100%;
}
.dxre-dialogControlsWrapper > tbody > tr > td:first-child .dxreDlgFooterBtn
{
    margin-left: 0px;
}
.dxreDialog
{
    -moz-user-select: none;
}
.dxre-dialogWrapperPanel .dxreDialog
{
    width: 100%;
}
.dxreDialog .dxre-dialogControlsWrapper > tbody > tr > td:first-child
{
    width: 100%;
    text-align: right;
}
div.dxreDialog tr:first-child > td.dxre-dialogLGC > div.dxre-dialogFirstLGB
{
    padding: 0px;
}
.dxreDialog .dxflRadioButtonListItemSys td.dxe
{
    padding: 0px !important;
}
.dxre-dialog > .dxre-dialogLG.dxflGroupSys
{
    padding: 0px !important;
}
.dxre-dialog > .dxre-dialogLG.dxflGroupSys > div > .dxre-dialogLGC,
.dxre-dialog > .dxre-dialogLG.dxflGroupSys > tbody > tr > .dxre-dialogLGC
{
    padding: 0px;
}
.dxre-openfiledialog .dxre-dialogLGC,
.dxreDlgOpenFileForm .dxre-dialogLGC
{
    padding: 0;
}
.dxre-dialogRadioNavigation .dxichTextCellSys
{
    padding-right: 23px !important;
}
.dxreDlgColumnsEditor
{
    overflow-y: auto;
}
.dxreDlgListBox
{
    overflow-y: auto;
}
.dxreDlgListBox > div
{
    float: left;
    text-align: center;
    cursor: pointer;
    overflow: hidden;
}
.dxreDlgListBox .dxreDlgNumberingListPreview
{
    line-height: normal;
    text-align: left;
    overflow: hidden;
    position: relative;
}
.dxreDlgRight
{
    text-align: right;
}
.dxreDlgCenter
{
    text-align: center;
}
.dxreDlgTableWidth
{
    width: 100%;
}
/* Dialogs */    
dxSpriteWidth { width : 538 }
.dxRichEdit_SVGIcon_AddParagraphToTableOfContents, .dxRichEdit_SVGIcon_AlignBottomCenter, .dxRichEdit_SVGIcon_AlignBottomLeft, .dxRichEdit_SVGIcon_AlignBottomRight, .dxRichEdit_SVGIcon_AlignCenter, .dxRichEdit_SVGIcon_AlignFloatingObjectBottomCenter, .dxRichEdit_SVGIcon_AlignFloatingObjectBottomLeft, .dxRichEdit_SVGIcon_AlignFloatingObjectBottomRight, .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleCenter, .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleLeft, .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleRight, .dxRichEdit_SVGIcon_AlignFloatingObjectTopCenter, .dxRichEdit_SVGIcon_AlignFloatingObjectTopLeft, .dxRichEdit_SVGIcon_AlignFloatingObjectTopRight, .dxRichEdit_SVGIcon_AlignJustify, .dxRichEdit_SVGIcon_AlignLeft, .dxRichEdit_SVGIcon_AlignMiddleCenter, .dxRichEdit_SVGIcon_AlignMiddleLeft, .dxRichEdit_SVGIcon_AlignMiddleRight, .dxRichEdit_SVGIcon_AlignRight, .dxRichEdit_SVGIcon_AlignTopCenter, .dxRichEdit_SVGIcon_AlignTopLeft, .dxRichEdit_SVGIcon_AlignTopRight, .dxRichEdit_SVGIcon_Background, .dxRichEdit_SVGIcon_Bold, .dxRichEdit_SVGIcon_Bookmark, .dxRichEdit_SVGIcon_BorderBottom, .dxRichEdit_SVGIcon_BorderInsideHorizontal, .dxRichEdit_SVGIcon_BorderInsideVertical, .dxRichEdit_SVGIcon_BorderLeft, .dxRichEdit_SVGIcon_BorderNone, .dxRichEdit_SVGIcon_BorderRight, .dxRichEdit_SVGIcon_BordersAll, .dxRichEdit_SVGIcon_BordersInside, .dxRichEdit_SVGIcon_BordersOutside, .dxRichEdit_SVGIcon_BorderTop, .dxRichEdit_SVGIcon_ChangeFontStyleLarge, .dxRichEdit_SVGIcon_ChangeTextCase, .dxRichEdit_SVGIcon_ClearFormatting, .dxRichEdit_SVGIcon_ClearTableStyle, .dxRichEdit_SVGIcon_CloseHeaderAndFooter, .dxRichEdit_SVGIcon_ColumnOne, .dxRichEdit_SVGIcon_Columns, .dxRichEdit_SVGIcon_ColumnsThree, .dxRichEdit_SVGIcon_ColumnsTwo, .dxRichEdit_SVGIcon_Copy, .dxRichEdit_SVGIcon_Cut, .dxRichEdit_SVGIcon_Delete, .dxRichEdit_SVGIcon_Delete_Hyperlink, .dxRichEdit_SVGIcon_DeleteComment, .dxRichEdit_SVGIcon_DeleteTable, .dxRichEdit_SVGIcon_DeleteTableCells, .dxRichEdit_SVGIcon_DeleteTableColumns, .dxRichEdit_SVGIcon_DeleteTableRows, .dxRichEdit_SVGIcon_DifferentFirstPage, .dxRichEdit_SVGIcon_DifferentOddEvenPages, .dxRichEdit_SVGIcon_DraftView, .dxRichEdit_SVGIcon_EditRangePermission, .dxRichEdit_SVGIcon_Find, .dxRichEdit_SVGIcon_FindLarge, .dxRichEdit_SVGIcon_First, .dxRichEdit_SVGIcon_FloatingObjectAlignment, .dxRichEdit_SVGIcon_FloatingObjectBringForward, .dxRichEdit_SVGIcon_FloatingObjectBringInFrontOfText, .dxRichEdit_SVGIcon_FloatingObjectBringToFront, .dxRichEdit_SVGIcon_FloatingObjectBringToFrontOfText, .dxRichEdit_SVGIcon_FloatingObjectLayoutOptions, .dxRichEdit_SVGIcon_FloatingObjectOutlineColor, .dxRichEdit_SVGIcon_FloatingObjectSendBackward, .dxRichEdit_SVGIcon_FloatingObjectSendBehindText, .dxRichEdit_SVGIcon_FloatingObjectSendToBack, .dxRichEdit_SVGIcon_FloatingObjectTextWrapType, .dxRichEdit_SVGIcon_Font, .dxRichEdit_SVGIcon_FontColor, .dxRichEdit_SVGIcon_FontLarge, .dxRichEdit_SVGIcon_FontSize, .dxRichEdit_SVGIcon_FontSizeDecrease, .dxRichEdit_SVGIcon_FontSizeIncrease, .dxRichEdit_SVGIcon_Footer, .dxRichEdit_SVGIcon_FullScreen, .dxRichEdit_SVGIcon_GoToFooter, .dxRichEdit_SVGIcon_GoToHeader, .dxRichEdit_SVGIcon_GoToNextHeaderFooter, .dxRichEdit_SVGIcon_GoToPreviousHeaderFooter, .dxRichEdit_SVGIcon_Header, .dxRichEdit_SVGIcon_Highlight, .dxRichEdit_SVGIcon_Hyperlink, .dxRichEdit_SVGIcon_ImagePlaceHolder, .dxRichEdit_SVGIcon_IndentDecrease, .dxRichEdit_SVGIcon_IndentIncrease, .dxRichEdit_SVGIcon_InsertCaption, .dxRichEdit_SVGIcon_InsertColumnBreak, .dxRichEdit_SVGIcon_InsertDataField, .dxRichEdit_SVGIcon_InsertEquationCaption, .dxRichEdit_SVGIcon_InsertFigureCaption, .dxRichEdit_SVGIcon_InsertFloatingObjectImage, .dxRichEdit_SVGIcon_InsertImage, .dxRichEdit_SVGIcon_InsertPageBreak, .dxRichEdit_SVGIcon_InsertPageCount, .dxRichEdit_SVGIcon_InsertPageNumber, .dxRichEdit_SVGIcon_InsertSectionBreakContinuous, .dxRichEdit_SVGIcon_InsertSectionBreakEvenPage, .dxRichEdit_SVGIcon_InsertSectionBreakNextPage, .dxRichEdit_SVGIcon_InsertSectionBreakOddPage, .dxRichEdit_SVGIcon_InsertTable, .dxRichEdit_SVGIcon_InsertTableCaption, .dxRichEdit_SVGIcon_InsertTableCells, .dxRichEdit_SVGIcon_InsertTableColumnsToTheLeft, .dxRichEdit_SVGIcon_InsertTableColumnsToTheRight, .dxRichEdit_SVGIcon_InsertTableOfCaptions, .dxRichEdit_SVGIcon_InsertTableOfContents, .dxRichEdit_SVGIcon_InsertTableOfEquations, .dxRichEdit_SVGIcon_InsertTableOfFigures, .dxRichEdit_SVGIcon_InsertTableRowsAbove, .dxRichEdit_SVGIcon_InsertTableRowsBelow, .dxRichEdit_SVGIcon_InsertTextBox, .dxRichEdit_SVGIcon_Italic, .dxRichEdit_SVGIcon_Language, .dxRichEdit_SVGIcon_Last, .dxRichEdit_SVGIcon_LeftColumns, .dxRichEdit_SVGIcon_LineNumbering, .dxRichEdit_SVGIcon_LineSpacing, .dxRichEdit_SVGIcon_LinkToPrevious, .dxRichEdit_SVGIcon_ListBullets, .dxRichEdit_SVGIcon_ListMultilevel, .dxRichEdit_SVGIcon_ListNumbers, .dxRichEdit_SVGIcon_MailMerge, .dxRichEdit_SVGIcon_MergeTableCells, .dxRichEdit_SVGIcon_ModifyTableStyle, .dxRichEdit_SVGIcon_New, .dxRichEdit_SVGIcon_NewComment, .dxRichEdit_SVGIcon_NewTableStyle, .dxRichEdit_SVGIcon_Next, .dxRichEdit_SVGIcon_NextComment, .dxRichEdit_SVGIcon_Open, .dxRichEdit_SVGIcon_PageColor, .dxRichEdit_SVGIcon_PageMargins, .dxRichEdit_SVGIcon_PageMarginsModerate, .dxRichEdit_SVGIcon_PageMarginsNarrow, .dxRichEdit_SVGIcon_PageMarginsNormal, .dxRichEdit_SVGIcon_PageMarginsWide, .dxRichEdit_SVGIcon_PageOrientation, .dxRichEdit_SVGIcon_PageOrientationLandscape, .dxRichEdit_SVGIcon_PageOrientationPortrait, .dxRichEdit_SVGIcon_PaperSize, .dxRichEdit_SVGIcon_Paragraph, .dxRichEdit_SVGIcon_ParagraphLarge, .dxRichEdit_SVGIcon_Paste, .dxRichEdit_SVGIcon_PasteLarge, .dxRichEdit_SVGIcon_PasteSpecial, .dxRichEdit_SVGIcon_PenColor, .dxRichEdit_SVGIcon_Prev, .dxRichEdit_SVGIcon_Preview, .dxRichEdit_SVGIcon_PreviousComment, .dxRichEdit_SVGIcon_Print, .dxRichEdit_SVGIcon_PrintBrowser, .dxRichEdit_SVGIcon_PrintDialog, .dxRichEdit_SVGIcon_PrintLayoutView, .dxRichEdit_SVGIcon_PrintPreviewBrowser, .dxRichEdit_SVGIcon_ProtectDocument, .dxRichEdit_SVGIcon_Redo, .dxRichEdit_SVGIcon_Replace, .dxRichEdit_SVGIcon_Reviewers, .dxRichEdit_SVGIcon_ReviewingPane, .dxRichEdit_SVGIcon_RightColumns, .dxRichEdit_SVGIcon_RulerHorizontal, .dxRichEdit_SVGIcon_RulerVertical, .dxRichEdit_SVGIcon_Save, .dxRichEdit_SVGIcon_SaveAs, .dxRichEdit_SVGIcon_Select, .dxRichEdit_SVGIcon_SelectAll, .dxRichEdit_SVGIcon_SelectTable, .dxRichEdit_SVGIcon_SelectTableCell, .dxRichEdit_SVGIcon_SelectTableColumn, .dxRichEdit_SVGIcon_SelectTableRow, .dxRichEdit_SVGIcon_Shading, .dxRichEdit_SVGIcon_ShowAllFieldCodes, .dxRichEdit_SVGIcon_ShowAllFieldResults, .dxRichEdit_SVGIcon_ShowComments, .dxRichEdit_SVGIcon_ShowHidden, .dxRichEdit_SVGIcon_SimpleView, .dxRichEdit_SVGIcon_SpacingDecrease, .dxRichEdit_SVGIcon_SpellCheck, .dxRichEdit_SVGIcon_SpellCheckAsYouType, .dxRichEdit_SVGIcon_SplitTable, .dxRichEdit_SVGIcon_SplitTableCells, .dxRichEdit_SVGIcon_Strikeout, .dxRichEdit_SVGIcon_StrikeoutDouble, .dxRichEdit_SVGIcon_Subscript, .dxRichEdit_SVGIcon_Superscript, .dxRichEdit_SVGIcon_Symbol, .dxRichEdit_SVGIcon_TableAutoFitContents, .dxRichEdit_SVGIcon_TableAutoFitWindow, .dxRichEdit_SVGIcon_TableCellMargins, .dxRichEdit_SVGIcon_TableFixedColumnWidth, .dxRichEdit_SVGIcon_TableProperties, .dxRichEdit_SVGIcon_TextWrapBehind, .dxRichEdit_SVGIcon_TextWrapInFrontOfText, .dxRichEdit_SVGIcon_TextWrapInline, .dxRichEdit_SVGIcon_TextWrapSquare, .dxRichEdit_SVGIcon_TextWrapThrough, .dxRichEdit_SVGIcon_TextWrapTight, .dxRichEdit_SVGIcon_TextWrapTopAndBottom, .dxRichEdit_SVGIcon_ToggleFieldCodes, .dxRichEdit_SVGIcon_Underline, .dxRichEdit_SVGIcon_UnderlineDouble, .dxRichEdit_SVGIcon_Undo, .dxRichEdit_SVGIcon_UnprotectDocument, .dxRichEdit_SVGIcon_UpdateField, .dxRichEdit_SVGIcon_UpdateTableOfContents, .dxRichEdit_SVGIcon_ViewMergedData, .dxRichEdit_SVGIcon_ViewTableGridlines, .dxRichEdit_SVGIcon_ZoomIn, .dxRichEdit_SVGIcon_ZoomOut, .dxRichEdit_SVGIcon_AddParagraphToTableOfContentsLarge, .dxRichEdit_SVGIcon_AlignBottomCenterLarge, .dxRichEdit_SVGIcon_AlignBottomLeftLarge, .dxRichEdit_SVGIcon_AlignBottomRightLarge, .dxRichEdit_SVGIcon_AlignCenterLarge, .dxRichEdit_SVGIcon_AlignFloatingObjectBottomCenterLarge, .dxRichEdit_SVGIcon_AlignFloatingObjectBottomLeftLarge, .dxRichEdit_SVGIcon_AlignFloatingObjectBottomRightLarge, .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleCenterLarge, .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleLeftLarge, .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleRightLarge, .dxRichEdit_SVGIcon_AlignFloatingObjectTopCenterLarge, .dxRichEdit_SVGIcon_AlignFloatingObjectTopLeftLarge, .dxRichEdit_SVGIcon_AlignFloatingObjectTopRightLarge, .dxRichEdit_SVGIcon_AlignJustifyLarge, .dxRichEdit_SVGIcon_AlignLeftLarge, .dxRichEdit_SVGIcon_AlignMiddleCenterLarge, .dxRichEdit_SVGIcon_AlignMiddleLeftLarge, .dxRichEdit_SVGIcon_AlignMiddleRightLarge, .dxRichEdit_SVGIcon_AlignRightLarge, .dxRichEdit_SVGIcon_AlignTopCenterLarge, .dxRichEdit_SVGIcon_AlignTopLeftLarge, .dxRichEdit_SVGIcon_AlignTopRightLarge, .dxRichEdit_SVGIcon_BackgroundLarge, .dxRichEdit_SVGIcon_BoldLarge, .dxRichEdit_SVGIcon_BookmarkLarge, .dxRichEdit_SVGIcon_BorderBottomLarge, .dxRichEdit_SVGIcon_BorderInsideHorizontalLarge, .dxRichEdit_SVGIcon_BorderInsideVerticalLarge, .dxRichEdit_SVGIcon_BorderLeftLarge, .dxRichEdit_SVGIcon_BorderNoneLarge, .dxRichEdit_SVGIcon_BorderRightLarge, .dxRichEdit_SVGIcon_BordersAllLarge, .dxRichEdit_SVGIcon_BordersInsideLarge, .dxRichEdit_SVGIcon_BordersOutsideLarge, .dxRichEdit_SVGIcon_BorderTopLarge, .dxRichEdit_SVGIcon_ChangeFontStyleLargeLarge, .dxRichEdit_SVGIcon_ChangeTextCaseLarge, .dxRichEdit_SVGIcon_ClearFormattingLarge, .dxRichEdit_SVGIcon_ClearTableStyleLarge, .dxRichEdit_SVGIcon_CloseHeaderAndFooterLarge, .dxRichEdit_SVGIcon_ColumnOneLarge, .dxRichEdit_SVGIcon_ColumnsLarge, .dxRichEdit_SVGIcon_ColumnsThreeLarge, .dxRichEdit_SVGIcon_ColumnsTwoLarge, .dxRichEdit_SVGIcon_CopyLarge, .dxRichEdit_SVGIcon_CutLarge, .dxRichEdit_SVGIcon_DeleteLarge, .dxRichEdit_SVGIcon_Delete_HyperlinkLarge, .dxRichEdit_SVGIcon_DeleteCommentLarge, .dxRichEdit_SVGIcon_DeleteTableLarge, .dxRichEdit_SVGIcon_DeleteTableCellsLarge, .dxRichEdit_SVGIcon_DeleteTableColumnsLarge, .dxRichEdit_SVGIcon_DeleteTableRowsLarge, .dxRichEdit_SVGIcon_DifferentFirstPageLarge, .dxRichEdit_SVGIcon_DifferentOddEvenPagesLarge, .dxRichEdit_SVGIcon_DraftViewLarge, .dxRichEdit_SVGIcon_EditRangePermissionLarge, .dxRichEdit_SVGIcon_FindLarge, .dxRichEdit_SVGIcon_FindLargeLarge, .dxRichEdit_SVGIcon_FirstLarge, .dxRichEdit_SVGIcon_FloatingObjectAlignmentLarge, .dxRichEdit_SVGIcon_FloatingObjectBringForwardLarge, .dxRichEdit_SVGIcon_FloatingObjectBringInFrontOfTextLarge, .dxRichEdit_SVGIcon_FloatingObjectBringToFrontLarge, .dxRichEdit_SVGIcon_FloatingObjectBringToFrontOfTextLarge, .dxRichEdit_SVGIcon_FloatingObjectLayoutOptionsLarge, .dxRichEdit_SVGIcon_FloatingObjectOutlineColorLarge, .dxRichEdit_SVGIcon_FloatingObjectSendBackwardLarge, .dxRichEdit_SVGIcon_FloatingObjectSendBehindTextLarge, .dxRichEdit_SVGIcon_FloatingObjectSendToBackLarge, .dxRichEdit_SVGIcon_FloatingObjectTextWrapTypeLarge, .dxRichEdit_SVGIcon_FontLarge, .dxRichEdit_SVGIcon_FontColorLarge, .dxRichEdit_SVGIcon_FontLargeLarge, .dxRichEdit_SVGIcon_FontSizeLarge, .dxRichEdit_SVGIcon_FontSizeDecreaseLarge, .dxRichEdit_SVGIcon_FontSizeIncreaseLarge, .dxRichEdit_SVGIcon_FooterLarge, .dxRichEdit_SVGIcon_FullScreenLarge, .dxRichEdit_SVGIcon_GoToFooterLarge, .dxRichEdit_SVGIcon_GoToHeaderLarge, .dxRichEdit_SVGIcon_GoToNextHeaderFooterLarge, .dxRichEdit_SVGIcon_GoToPreviousHeaderFooterLarge, .dxRichEdit_SVGIcon_HeaderLarge, .dxRichEdit_SVGIcon_HighlightLarge, .dxRichEdit_SVGIcon_HyperlinkLarge, .dxRichEdit_SVGIcon_ImagePlaceHolderLarge, .dxRichEdit_SVGIcon_IndentDecreaseLarge, .dxRichEdit_SVGIcon_IndentIncreaseLarge, .dxRichEdit_SVGIcon_InsertCaptionLarge, .dxRichEdit_SVGIcon_InsertColumnBreakLarge, .dxRichEdit_SVGIcon_InsertDataFieldLarge, .dxRichEdit_SVGIcon_InsertEquationCaptionLarge, .dxRichEdit_SVGIcon_InsertFigureCaptionLarge, .dxRichEdit_SVGIcon_InsertFloatingObjectImageLarge, .dxRichEdit_SVGIcon_InsertImageLarge, .dxRichEdit_SVGIcon_InsertPageBreakLarge, .dxRichEdit_SVGIcon_InsertPageCountLarge, .dxRichEdit_SVGIcon_InsertPageNumberLarge, .dxRichEdit_SVGIcon_InsertSectionBreakContinuousLarge, .dxRichEdit_SVGIcon_InsertSectionBreakEvenPageLarge, .dxRichEdit_SVGIcon_InsertSectionBreakNextPageLarge, .dxRichEdit_SVGIcon_InsertSectionBreakOddPageLarge, .dxRichEdit_SVGIcon_InsertTableLarge, .dxRichEdit_SVGIcon_InsertTableCaptionLarge, .dxRichEdit_SVGIcon_InsertTableCellsLarge, .dxRichEdit_SVGIcon_InsertTableColumnsToTheLeftLarge, .dxRichEdit_SVGIcon_InsertTableColumnsToTheRightLarge, .dxRichEdit_SVGIcon_InsertTableOfCaptionsLarge, .dxRichEdit_SVGIcon_InsertTableOfContentsLarge, .dxRichEdit_SVGIcon_InsertTableOfEquationsLarge, .dxRichEdit_SVGIcon_InsertTableOfFiguresLarge, .dxRichEdit_SVGIcon_InsertTableRowsAboveLarge, .dxRichEdit_SVGIcon_InsertTableRowsBelowLarge, .dxRichEdit_SVGIcon_InsertTextBoxLarge, .dxRichEdit_SVGIcon_ItalicLarge, .dxRichEdit_SVGIcon_LanguageLarge, .dxRichEdit_SVGIcon_LastLarge, .dxRichEdit_SVGIcon_LeftColumnsLarge, .dxRichEdit_SVGIcon_LineNumberingLarge, .dxRichEdit_SVGIcon_LineSpacingLarge, .dxRichEdit_SVGIcon_LinkToPreviousLarge, .dxRichEdit_SVGIcon_ListBulletsLarge, .dxRichEdit_SVGIcon_ListMultilevelLarge, .dxRichEdit_SVGIcon_ListNumbersLarge, .dxRichEdit_SVGIcon_MailMergeLarge, .dxRichEdit_SVGIcon_MergeTableCellsLarge, .dxRichEdit_SVGIcon_ModifyTableStyleLarge, .dxRichEdit_SVGIcon_NewLarge, .dxRichEdit_SVGIcon_NewCommentLarge, .dxRichEdit_SVGIcon_NewTableStyleLarge, .dxRichEdit_SVGIcon_NextLarge, .dxRichEdit_SVGIcon_NextCommentLarge, .dxRichEdit_SVGIcon_OpenLarge, .dxRichEdit_SVGIcon_PageColorLarge, .dxRichEdit_SVGIcon_PageMarginsLarge, .dxRichEdit_SVGIcon_PageMarginsModerateLarge, .dxRichEdit_SVGIcon_PageMarginsNarrowLarge, .dxRichEdit_SVGIcon_PageMarginsNormalLarge, .dxRichEdit_SVGIcon_PageMarginsWideLarge, .dxRichEdit_SVGIcon_PageOrientationLarge, .dxRichEdit_SVGIcon_PageOrientationLandscapeLarge, .dxRichEdit_SVGIcon_PageOrientationPortraitLarge, .dxRichEdit_SVGIcon_PaperSizeLarge, .dxRichEdit_SVGIcon_ParagraphLarge, .dxRichEdit_SVGIcon_ParagraphLargeLarge, .dxRichEdit_SVGIcon_PasteLarge, .dxRichEdit_SVGIcon_PasteLargeLarge, .dxRichEdit_SVGIcon_PasteSpecialLarge, .dxRichEdit_SVGIcon_PenColorLarge, .dxRichEdit_SVGIcon_PrevLarge, .dxRichEdit_SVGIcon_PreviewLarge, .dxRichEdit_SVGIcon_PreviousCommentLarge, .dxRichEdit_SVGIcon_PrintLarge, .dxRichEdit_SVGIcon_PrintBrowserLarge, .dxRichEdit_SVGIcon_PrintDialogLarge, .dxRichEdit_SVGIcon_PrintLayoutViewLarge, .dxRichEdit_SVGIcon_PrintPreviewBrowserLarge, .dxRichEdit_SVGIcon_ProtectDocumentLarge, .dxRichEdit_SVGIcon_RedoLarge, .dxRichEdit_SVGIcon_ReplaceLarge, .dxRichEdit_SVGIcon_ReviewersLarge, .dxRichEdit_SVGIcon_ReviewingPaneLarge, .dxRichEdit_SVGIcon_RightColumnsLarge, .dxRichEdit_SVGIcon_RulerHorizontalLarge, .dxRichEdit_SVGIcon_RulerVerticalLarge, .dxRichEdit_SVGIcon_SaveLarge, .dxRichEdit_SVGIcon_SaveAsLarge, .dxRichEdit_SVGIcon_SelectLarge, .dxRichEdit_SVGIcon_SelectAllLarge, .dxRichEdit_SVGIcon_SelectTableLarge, .dxRichEdit_SVGIcon_SelectTableCellLarge, .dxRichEdit_SVGIcon_SelectTableColumnLarge, .dxRichEdit_SVGIcon_SelectTableRowLarge, .dxRichEdit_SVGIcon_ShadingLarge, .dxRichEdit_SVGIcon_ShowAllFieldCodesLarge, .dxRichEdit_SVGIcon_ShowAllFieldResultsLarge, .dxRichEdit_SVGIcon_ShowCommentsLarge, .dxRichEdit_SVGIcon_ShowHiddenLarge, .dxRichEdit_SVGIcon_SimpleViewLarge, .dxRichEdit_SVGIcon_SpacingDecreaseLarge, .dxRichEdit_SVGIcon_SpellCheckLarge, .dxRichEdit_SVGIcon_SpellCheckAsYouTypeLarge, .dxRichEdit_SVGIcon_SplitTableLarge, .dxRichEdit_SVGIcon_SplitTableCellsLarge, .dxRichEdit_SVGIcon_StrikeoutLarge, .dxRichEdit_SVGIcon_StrikeoutDoubleLarge, .dxRichEdit_SVGIcon_SubscriptLarge, .dxRichEdit_SVGIcon_SuperscriptLarge, .dxRichEdit_SVGIcon_SymbolLarge, .dxRichEdit_SVGIcon_TableAutoFitContentsLarge, .dxRichEdit_SVGIcon_TableAutoFitWindowLarge, .dxRichEdit_SVGIcon_TableCellMarginsLarge, .dxRichEdit_SVGIcon_TableFixedColumnWidthLarge, .dxRichEdit_SVGIcon_TablePropertiesLarge, .dxRichEdit_SVGIcon_TextWrapBehindLarge, .dxRichEdit_SVGIcon_TextWrapInFrontOfTextLarge, .dxRichEdit_SVGIcon_TextWrapInlineLarge, .dxRichEdit_SVGIcon_TextWrapSquareLarge, .dxRichEdit_SVGIcon_TextWrapThroughLarge, .dxRichEdit_SVGIcon_TextWrapTightLarge, .dxRichEdit_SVGIcon_TextWrapTopAndBottomLarge, .dxRichEdit_SVGIcon_ToggleFieldCodesLarge, .dxRichEdit_SVGIcon_UnderlineLarge, .dxRichEdit_SVGIcon_UnderlineDoubleLarge, .dxRichEdit_SVGIcon_UndoLarge, .dxRichEdit_SVGIcon_UnprotectDocumentLarge, .dxRichEdit_SVGIcon_UpdateFieldLarge, .dxRichEdit_SVGIcon_UpdateTableOfContentsLarge, .dxRichEdit_SVGIcon_ViewMergedDataLarge, .dxRichEdit_SVGIcon_ViewTableGridlinesLarge, .dxRichEdit_SVGIcon_ZoomInLarge, .dxRichEdit_SVGIcon_ZoomOutLarge, .dxRichEdit_SVGIcon_AddParagraphToTableOfContentsLargeDisabled, .dxRichEdit_SVGIcon_AlignBottomCenterLargeDisabled, .dxRichEdit_SVGIcon_AlignBottomLeftLargeDisabled, .dxRichEdit_SVGIcon_AlignBottomRightLargeDisabled, .dxRichEdit_SVGIcon_AlignCenterLargeDisabled, .dxRichEdit_SVGIcon_AlignFloatingObjectBottomCenterLargeDisabled, .dxRichEdit_SVGIcon_AlignFloatingObjectBottomLeftLargeDisabled, .dxRichEdit_SVGIcon_AlignFloatingObjectBottomRightLargeDisabled, .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleCenterLargeDisabled, .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleLeftLargeDisabled, .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleRightLargeDisabled, .dxRichEdit_SVGIcon_AlignFloatingObjectTopCenterLargeDisabled, .dxRichEdit_SVGIcon_AlignFloatingObjectTopLeftLargeDisabled, .dxRichEdit_SVGIcon_AlignFloatingObjectTopRightLargeDisabled, .dxRichEdit_SVGIcon_AlignJustifyLargeDisabled, .dxRichEdit_SVGIcon_AlignLeftLargeDisabled, .dxRichEdit_SVGIcon_AlignMiddleCenterLargeDisabled, .dxRichEdit_SVGIcon_AlignMiddleLeftLargeDisabled, .dxRichEdit_SVGIcon_AlignMiddleRightLargeDisabled, .dxRichEdit_SVGIcon_AlignRightLargeDisabled, .dxRichEdit_SVGIcon_AlignTopCenterLargeDisabled, .dxRichEdit_SVGIcon_AlignTopLeftLargeDisabled, .dxRichEdit_SVGIcon_AlignTopRightLargeDisabled, .dxRichEdit_SVGIcon_BackgroundLargeDisabled, .dxRichEdit_SVGIcon_BoldLargeDisabled, .dxRichEdit_SVGIcon_BookmarkLargeDisabled, .dxRichEdit_SVGIcon_BorderBottomLargeDisabled, .dxRichEdit_SVGIcon_BorderInsideHorizontalLargeDisabled, .dxRichEdit_SVGIcon_BorderInsideVerticalLargeDisabled, .dxRichEdit_SVGIcon_BorderLeftLargeDisabled, .dxRichEdit_SVGIcon_BorderNoneLargeDisabled, .dxRichEdit_SVGIcon_BorderRightLargeDisabled, .dxRichEdit_SVGIcon_BordersAllLargeDisabled, .dxRichEdit_SVGIcon_BordersInsideLargeDisabled, .dxRichEdit_SVGIcon_BordersOutsideLargeDisabled, .dxRichEdit_SVGIcon_BorderTopLargeDisabled, .dxRichEdit_SVGIcon_ChangeFontStyleLargeLargeDisabled, .dxRichEdit_SVGIcon_ChangeTextCaseLargeDisabled, .dxRichEdit_SVGIcon_ClearFormattingLargeDisabled, .dxRichEdit_SVGIcon_ClearTableStyleLargeDisabled, .dxRichEdit_SVGIcon_CloseHeaderAndFooterLargeDisabled, .dxRichEdit_SVGIcon_ColumnOneLargeDisabled, .dxRichEdit_SVGIcon_ColumnsLargeDisabled, .dxRichEdit_SVGIcon_ColumnsThreeLargeDisabled, .dxRichEdit_SVGIcon_ColumnsTwoLargeDisabled, .dxRichEdit_SVGIcon_CopyLargeDisabled, .dxRichEdit_SVGIcon_CutLargeDisabled, .dxRichEdit_SVGIcon_DeleteLargeDisabled, .dxRichEdit_SVGIcon_Delete_HyperlinkLargeDisabled, .dxRichEdit_SVGIcon_DeleteCommentLargeDisabled, .dxRichEdit_SVGIcon_DeleteTableLargeDisabled, .dxRichEdit_SVGIcon_DeleteTableCellsLargeDisabled, .dxRichEdit_SVGIcon_DeleteTableColumnsLargeDisabled, .dxRichEdit_SVGIcon_DeleteTableRowsLargeDisabled, .dxRichEdit_SVGIcon_DifferentFirstPageLargeDisabled, .dxRichEdit_SVGIcon_DifferentOddEvenPagesLargeDisabled, .dxRichEdit_SVGIcon_DraftViewLargeDisabled, .dxRichEdit_SVGIcon_EditRangePermissionLargeDisabled, .dxRichEdit_SVGIcon_FindLargeDisabled, .dxRichEdit_SVGIcon_FindLargeLargeDisabled, .dxRichEdit_SVGIcon_FirstLargeDisabled, .dxRichEdit_SVGIcon_FloatingObjectAlignmentLargeDisabled, .dxRichEdit_SVGIcon_FloatingObjectBringForwardLargeDisabled, .dxRichEdit_SVGIcon_FloatingObjectBringInFrontOfTextLargeDisabled, .dxRichEdit_SVGIcon_FloatingObjectBringToFrontLargeDisabled, .dxRichEdit_SVGIcon_FloatingObjectBringToFrontOfTextLargeDisabled, .dxRichEdit_SVGIcon_FloatingObjectLayoutOptionsLargeDisabled, .dxRichEdit_SVGIcon_FloatingObjectOutlineColorLargeDisabled, .dxRichEdit_SVGIcon_FloatingObjectSendBackwardLargeDisabled, .dxRichEdit_SVGIcon_FloatingObjectSendBehindTextLargeDisabled, .dxRichEdit_SVGIcon_FloatingObjectSendToBackLargeDisabled, .dxRichEdit_SVGIcon_FloatingObjectTextWrapTypeLargeDisabled, .dxRichEdit_SVGIcon_FontLargeDisabled, .dxRichEdit_SVGIcon_FontColorLargeDisabled, .dxRichEdit_SVGIcon_FontLargeLargeDisabled, .dxRichEdit_SVGIcon_FontSizeLargeDisabled, .dxRichEdit_SVGIcon_FontSizeDecreaseLargeDisabled, .dxRichEdit_SVGIcon_FontSizeIncreaseLargeDisabled, .dxRichEdit_SVGIcon_FooterLargeDisabled, .dxRichEdit_SVGIcon_FullScreenLargeDisabled, .dxRichEdit_SVGIcon_GoToFooterLargeDisabled, .dxRichEdit_SVGIcon_GoToHeaderLargeDisabled, .dxRichEdit_SVGIcon_GoToNextHeaderFooterLargeDisabled, .dxRichEdit_SVGIcon_GoToPreviousHeaderFooterLargeDisabled, .dxRichEdit_SVGIcon_HeaderLargeDisabled, .dxRichEdit_SVGIcon_HighlightLargeDisabled, .dxRichEdit_SVGIcon_HyperlinkLargeDisabled, .dxRichEdit_SVGIcon_ImagePlaceHolderLargeDisabled, .dxRichEdit_SVGIcon_IndentDecreaseLargeDisabled, .dxRichEdit_SVGIcon_IndentIncreaseLargeDisabled, .dxRichEdit_SVGIcon_InsertCaptionLargeDisabled, .dxRichEdit_SVGIcon_InsertColumnBreakLargeDisabled, .dxRichEdit_SVGIcon_InsertDataFieldLargeDisabled, .dxRichEdit_SVGIcon_InsertEquationCaptionLargeDisabled, .dxRichEdit_SVGIcon_InsertFigureCaptionLargeDisabled, .dxRichEdit_SVGIcon_InsertFloatingObjectImageLargeDisabled, .dxRichEdit_SVGIcon_InsertImageLargeDisabled, .dxRichEdit_SVGIcon_InsertPageBreakLargeDisabled, .dxRichEdit_SVGIcon_InsertPageCountLargeDisabled, .dxRichEdit_SVGIcon_InsertPageNumberLargeDisabled, .dxRichEdit_SVGIcon_InsertSectionBreakContinuousLargeDisabled, .dxRichEdit_SVGIcon_InsertSectionBreakEvenPageLargeDisabled, .dxRichEdit_SVGIcon_InsertSectionBreakNextPageLargeDisabled, .dxRichEdit_SVGIcon_InsertSectionBreakOddPageLargeDisabled, .dxRichEdit_SVGIcon_InsertTableLargeDisabled, .dxRichEdit_SVGIcon_InsertTableCaptionLargeDisabled, .dxRichEdit_SVGIcon_InsertTableCellsLargeDisabled, .dxRichEdit_SVGIcon_InsertTableColumnsToTheLeftLargeDisabled, .dxRichEdit_SVGIcon_InsertTableColumnsToTheRightLargeDisabled, .dxRichEdit_SVGIcon_InsertTableOfCaptionsLargeDisabled, .dxRichEdit_SVGIcon_InsertTableOfContentsLargeDisabled, .dxRichEdit_SVGIcon_InsertTableOfEquationsLargeDisabled, .dxRichEdit_SVGIcon_InsertTableOfFiguresLargeDisabled, .dxRichEdit_SVGIcon_InsertTableRowsAboveLargeDisabled, .dxRichEdit_SVGIcon_InsertTableRowsBelowLargeDisabled, .dxRichEdit_SVGIcon_InsertTextBoxLargeDisabled, .dxRichEdit_SVGIcon_ItalicLargeDisabled, .dxRichEdit_SVGIcon_LanguageLargeDisabled, .dxRichEdit_SVGIcon_LastLargeDisabled, .dxRichEdit_SVGIcon_LeftColumnsLargeDisabled, .dxRichEdit_SVGIcon_LineNumberingLargeDisabled, .dxRichEdit_SVGIcon_LineSpacingLargeDisabled, .dxRichEdit_SVGIcon_LinkToPreviousLargeDisabled, .dxRichEdit_SVGIcon_ListBulletsLargeDisabled, .dxRichEdit_SVGIcon_ListMultilevelLargeDisabled, .dxRichEdit_SVGIcon_ListNumbersLargeDisabled, .dxRichEdit_SVGIcon_MailMergeLargeDisabled, .dxRichEdit_SVGIcon_MergeTableCellsLargeDisabled, .dxRichEdit_SVGIcon_ModifyTableStyleLargeDisabled, .dxRichEdit_SVGIcon_NewLargeDisabled, .dxRichEdit_SVGIcon_NewCommentLargeDisabled, .dxRichEdit_SVGIcon_NewTableStyleLargeDisabled, .dxRichEdit_SVGIcon_NextLargeDisabled, .dxRichEdit_SVGIcon_NextCommentLargeDisabled, .dxRichEdit_SVGIcon_OpenLargeDisabled, .dxRichEdit_SVGIcon_PageColorLargeDisabled, .dxRichEdit_SVGIcon_PageMarginsLargeDisabled, .dxRichEdit_SVGIcon_PageMarginsModerateLargeDisabled, .dxRichEdit_SVGIcon_PageMarginsNarrowLargeDisabled, .dxRichEdit_SVGIcon_PageMarginsNormalLargeDisabled, .dxRichEdit_SVGIcon_PageMarginsWideLargeDisabled, .dxRichEdit_SVGIcon_PageOrientationLargeDisabled, .dxRichEdit_SVGIcon_PageOrientationLandscapeLargeDisabled, .dxRichEdit_SVGIcon_PageOrientationPortraitLargeDisabled, .dxRichEdit_SVGIcon_PaperSizeLargeDisabled, .dxRichEdit_SVGIcon_ParagraphLargeDisabled, .dxRichEdit_SVGIcon_ParagraphLargeLargeDisabled, .dxRichEdit_SVGIcon_PasteLargeDisabled, .dxRichEdit_SVGIcon_PasteLargeLargeDisabled, .dxRichEdit_SVGIcon_PasteSpecialLargeDisabled, .dxRichEdit_SVGIcon_PenColorLargeDisabled, .dxRichEdit_SVGIcon_PrevLargeDisabled, .dxRichEdit_SVGIcon_PreviewLargeDisabled, .dxRichEdit_SVGIcon_PreviousCommentLargeDisabled, .dxRichEdit_SVGIcon_PrintLargeDisabled, .dxRichEdit_SVGIcon_PrintBrowserLargeDisabled, .dxRichEdit_SVGIcon_PrintDialogLargeDisabled, .dxRichEdit_SVGIcon_PrintLayoutViewLargeDisabled, .dxRichEdit_SVGIcon_PrintPreviewBrowserLargeDisabled, .dxRichEdit_SVGIcon_ProtectDocumentLargeDisabled, .dxRichEdit_SVGIcon_RedoLargeDisabled, .dxRichEdit_SVGIcon_ReplaceLargeDisabled, .dxRichEdit_SVGIcon_ReviewersLargeDisabled, .dxRichEdit_SVGIcon_ReviewingPaneLargeDisabled, .dxRichEdit_SVGIcon_RightColumnsLargeDisabled, .dxRichEdit_SVGIcon_RulerHorizontalLargeDisabled, .dxRichEdit_SVGIcon_RulerVerticalLargeDisabled, .dxRichEdit_SVGIcon_SaveLargeDisabled, .dxRichEdit_SVGIcon_SaveAsLargeDisabled, .dxRichEdit_SVGIcon_SelectLargeDisabled, .dxRichEdit_SVGIcon_SelectAllLargeDisabled, .dxRichEdit_SVGIcon_SelectTableLargeDisabled, .dxRichEdit_SVGIcon_SelectTableCellLargeDisabled, .dxRichEdit_SVGIcon_SelectTableColumnLargeDisabled, .dxRichEdit_SVGIcon_SelectTableRowLargeDisabled, .dxRichEdit_SVGIcon_ShadingLargeDisabled, .dxRichEdit_SVGIcon_ShowAllFieldCodesLargeDisabled, .dxRichEdit_SVGIcon_ShowAllFieldResultsLargeDisabled, .dxRichEdit_SVGIcon_ShowCommentsLargeDisabled, .dxRichEdit_SVGIcon_ShowHiddenLargeDisabled, .dxRichEdit_SVGIcon_SimpleViewLargeDisabled, .dxRichEdit_SVGIcon_SpacingDecreaseLargeDisabled, .dxRichEdit_SVGIcon_SpellCheckLargeDisabled, .dxRichEdit_SVGIcon_SpellCheckAsYouTypeLargeDisabled, .dxRichEdit_SVGIcon_SplitTableLargeDisabled, .dxRichEdit_SVGIcon_SplitTableCellsLargeDisabled, .dxRichEdit_SVGIcon_StrikeoutLargeDisabled, .dxRichEdit_SVGIcon_StrikeoutDoubleLargeDisabled, .dxRichEdit_SVGIcon_SubscriptLargeDisabled, .dxRichEdit_SVGIcon_SuperscriptLargeDisabled, .dxRichEdit_SVGIcon_SymbolLargeDisabled, .dxRichEdit_SVGIcon_TableAutoFitContentsLargeDisabled, .dxRichEdit_SVGIcon_TableAutoFitWindowLargeDisabled, .dxRichEdit_SVGIcon_TableCellMarginsLargeDisabled, .dxRichEdit_SVGIcon_TableFixedColumnWidthLargeDisabled, .dxRichEdit_SVGIcon_TablePropertiesLargeDisabled, .dxRichEdit_SVGIcon_TextWrapBehindLargeDisabled, .dxRichEdit_SVGIcon_TextWrapInFrontOfTextLargeDisabled, .dxRichEdit_SVGIcon_TextWrapInlineLargeDisabled, .dxRichEdit_SVGIcon_TextWrapSquareLargeDisabled, .dxRichEdit_SVGIcon_TextWrapThroughLargeDisabled, .dxRichEdit_SVGIcon_TextWrapTightLargeDisabled, .dxRichEdit_SVGIcon_TextWrapTopAndBottomLargeDisabled, .dxRichEdit_SVGIcon_ToggleFieldCodesLargeDisabled, .dxRichEdit_SVGIcon_UnderlineLargeDisabled, .dxRichEdit_SVGIcon_UnderlineDoubleLargeDisabled, .dxRichEdit_SVGIcon_UndoLargeDisabled, .dxRichEdit_SVGIcon_UnprotectDocumentLargeDisabled, .dxRichEdit_SVGIcon_UpdateFieldLargeDisabled, .dxRichEdit_SVGIcon_UpdateTableOfContentsLargeDisabled, .dxRichEdit_SVGIcon_ViewMergedDataLargeDisabled, .dxRichEdit_SVGIcon_ViewTableGridlinesLargeDisabled, .dxRichEdit_SVGIcon_ZoomInLargeDisabled, .dxRichEdit_SVGIcon_ZoomOutLargeDisabled { background-image: url('<%=WebResource("DevExpress.Web.ASPxRichEdit.Images.SVGSprite.svg")%>'); background-repeat: no-repeat; background-color: transparent } 
.dxIE .dx-acc-r .dxRichEdit_SVGIcon_AddParagraphToTableOfContents::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignBottomCenter::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignBottomLeft::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignBottomRight::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignCenter::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignFloatingObjectBottomCenter::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignFloatingObjectBottomLeft::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignFloatingObjectBottomRight::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleCenter::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleLeft::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleRight::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignFloatingObjectTopCenter::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignFloatingObjectTopLeft::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignFloatingObjectTopRight::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignJustify::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignLeft::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignMiddleCenter::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignMiddleLeft::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignMiddleRight::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignRight::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignTopCenter::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignTopLeft::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignTopRight::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Background::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Bold::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Bookmark::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_BorderBottom::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_BorderInsideHorizontal::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_BorderInsideVertical::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_BorderLeft::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_BorderNone::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_BorderRight::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_BordersAll::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_BordersInside::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_BordersOutside::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_BorderTop::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ChangeFontStyleLarge::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ChangeTextCase::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ClearFormatting::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ClearTableStyle::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_CloseHeaderAndFooter::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ColumnOne::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Columns::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ColumnsThree::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ColumnsTwo::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Copy::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Cut::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Delete::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Delete_Hyperlink::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_DeleteComment::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_DeleteTable::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_DeleteTableCells::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_DeleteTableColumns::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_DeleteTableRows::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_DifferentFirstPage::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_DifferentOddEvenPages::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_DraftView::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_EditRangePermission::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Find::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FindLarge::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_First::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FloatingObjectAlignment::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FloatingObjectBringForward::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FloatingObjectBringInFrontOfText::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FloatingObjectBringToFront::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FloatingObjectBringToFrontOfText::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FloatingObjectLayoutOptions::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FloatingObjectOutlineColor::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FloatingObjectSendBackward::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FloatingObjectSendBehindText::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FloatingObjectSendToBack::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FloatingObjectTextWrapType::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Font::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FontColor::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FontLarge::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FontSize::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FontSizeDecrease::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FontSizeIncrease::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Footer::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FullScreen::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_GoToFooter::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_GoToHeader::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_GoToNextHeaderFooter::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_GoToPreviousHeaderFooter::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Header::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Highlight::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Hyperlink::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ImagePlaceHolder::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_IndentDecrease::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_IndentIncrease::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertCaption::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertColumnBreak::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertDataField::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertEquationCaption::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertFigureCaption::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertFloatingObjectImage::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertImage::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertPageBreak::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertPageCount::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertPageNumber::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertSectionBreakContinuous::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertSectionBreakEvenPage::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertSectionBreakNextPage::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertSectionBreakOddPage::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTable::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTableCaption::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTableCells::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTableColumnsToTheLeft::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTableColumnsToTheRight::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTableOfCaptions::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTableOfContents::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTableOfEquations::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTableOfFigures::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTableRowsAbove::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTableRowsBelow::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTextBox::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Italic::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Language::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Last::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_LeftColumns::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_LineNumbering::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_LineSpacing::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_LinkToPrevious::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ListBullets::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ListMultilevel::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ListNumbers::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_MailMerge::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_MergeTableCells::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ModifyTableStyle::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_New::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_NewComment::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_NewTableStyle::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Next::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_NextComment::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Open::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PageColor::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PageMargins::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PageMarginsModerate::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PageMarginsNarrow::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PageMarginsNormal::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PageMarginsWide::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PageOrientation::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PageOrientationLandscape::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PageOrientationPortrait::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PaperSize::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Paragraph::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ParagraphLarge::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Paste::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PasteLarge::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PasteSpecial::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PenColor::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Prev::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Preview::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PreviousComment::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Print::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PrintBrowser::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PrintDialog::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PrintLayoutView::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PrintPreviewBrowser::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ProtectDocument::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Redo::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Replace::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Reviewers::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ReviewingPane::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_RightColumns::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_RulerHorizontal::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_RulerVertical::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Save::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SaveAs::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Select::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SelectAll::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SelectTable::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SelectTableCell::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SelectTableColumn::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SelectTableRow::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Shading::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ShowAllFieldCodes::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ShowAllFieldResults::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ShowComments::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ShowHidden::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SimpleView::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SpacingDecrease::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SpellCheck::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SpellCheckAsYouType::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SplitTable::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SplitTableCells::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Strikeout::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_StrikeoutDouble::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Subscript::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Superscript::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Symbol::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TableAutoFitContents::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TableAutoFitWindow::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TableCellMargins::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TableFixedColumnWidth::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TableProperties::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TextWrapBehind::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TextWrapInFrontOfText::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TextWrapInline::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TextWrapSquare::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TextWrapThrough::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TextWrapTight::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TextWrapTopAndBottom::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ToggleFieldCodes::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Underline::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_UnderlineDouble::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Undo::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_UnprotectDocument::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_UpdateField::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_UpdateTableOfContents::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ViewMergedData::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ViewTableGridlines::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ZoomIn::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ZoomOut::before { width: 538px } 
.dxRichEdit_SVGIcon_AddParagraphToTableOfContents { background-position: 0.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AddParagraphToTableOfContentsDisabled { background-position: 0.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AddParagraphToTableOfContentsLarge { background-position: 0px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AddParagraphToTableOfContentsLargeDisabled { background-position: 0px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_AlignBottomCenter { background-position: -221.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignBottomCenterDisabled { background-position: -221.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignBottomCenterLarge { background-position: -442px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignBottomCenterLargeDisabled { background-position: -442px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_AlignBottomLeft { background-position: -17.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignBottomLeftDisabled { background-position: -17.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignBottomLeftLarge { background-position: -34px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignBottomLeftLargeDisabled { background-position: -34px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_AlignBottomRight { background-position: -51.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignBottomRightDisabled { background-position: -51.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignBottomRightLarge { background-position: -102px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignBottomRightLargeDisabled { background-position: -102px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_AlignCenter { background-position: -34.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignCenterDisabled { background-position: -34.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignCenterLarge { background-position: -68px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignCenterLargeDisabled { background-position: -68px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomCenter { background-position: -17.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomCenterDisabled { background-position: -17.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomCenterLarge { background-position: -34px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomCenterLargeDisabled { background-position: -34px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomLeft { background-position: -170.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomLeftDisabled { background-position: -170.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomLeftLarge { background-position: -340px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomLeftLargeDisabled { background-position: -340px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomRight { background-position: -17.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomRightDisabled { background-position: -17.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomRightLarge { background-position: -34px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomRightLargeDisabled { background-position: -34px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleCenter { background-position: -34.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleCenterDisabled { background-position: -34.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleCenterLarge { background-position: -68px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleCenterLargeDisabled { background-position: -68px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleLeft { background-position: -51.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleLeftDisabled { background-position: -51.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleLeftLarge { background-position: -102px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleLeftLargeDisabled { background-position: -102px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleRight { background-position: -68.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleRightDisabled { background-position: -68.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleRightLarge { background-position: -136px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleRightLargeDisabled { background-position: -136px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopCenter { background-position: -85.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopCenterDisabled { background-position: -85.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopCenterLarge { background-position: -170px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopCenterLargeDisabled { background-position: -170px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopLeft { background-position: -102.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopLeftDisabled { background-position: -102.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopLeftLarge { background-position: -204px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopLeftLargeDisabled { background-position: -204px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopRight { background-position: -119.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopRightDisabled { background-position: -119.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopRightLarge { background-position: -238px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopRightLargeDisabled { background-position: -238px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_AlignJustify { background-position: -136.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignJustifyDisabled { background-position: -136.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignJustifyLarge { background-position: -272px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignJustifyLargeDisabled { background-position: -272px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_AlignLeft { background-position: -153.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignLeftDisabled { background-position: -153.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignLeftLarge { background-position: -306px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignLeftLargeDisabled { background-position: -306px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_AlignMiddleCenter { background-position: -187.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignMiddleCenterDisabled { background-position: -187.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignMiddleCenterLarge { background-position: -374px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignMiddleCenterLargeDisabled { background-position: -374px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_AlignMiddleLeft { background-position: -102.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignMiddleLeftDisabled { background-position: -102.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignMiddleLeftLarge { background-position: -204px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignMiddleLeftLargeDisabled { background-position: -204px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_AlignMiddleRight { background-position: -204.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignMiddleRightDisabled { background-position: -204.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignMiddleRightLarge { background-position: -408px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignMiddleRightLargeDisabled { background-position: -408px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_AlignRight { background-position: -221.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignRightDisabled { background-position: -221.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignRightLarge { background-position: -442px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignRightLargeDisabled { background-position: -442px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_AlignTopCenter { background-position: -238.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignTopCenterDisabled { background-position: -238.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignTopCenterLarge { background-position: -476px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignTopCenterLargeDisabled { background-position: -476px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_AlignTopLeft { background-position: 0.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignTopLeftDisabled { background-position: 0.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignTopLeftLarge { background-position: 0px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignTopLeftLargeDisabled { background-position: 0px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_AlignTopRight { background-position: -102.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignTopRightDisabled { background-position: -102.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignTopRightLarge { background-position: -204px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignTopRightLargeDisabled { background-position: -204px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Background { background-position: -221.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BackgroundDisabled { background-position: -221.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BackgroundLarge { background-position: -442px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BackgroundLargeDisabled { background-position: -442px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Bold { background-position: -187.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BoldDisabled { background-position: -187.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BoldLarge { background-position: -374px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BoldLargeDisabled { background-position: -374px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Bookmark { background-position: -238.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BookmarkDisabled { background-position: -238.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BookmarkLarge { background-position: -476px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BookmarkLargeDisabled { background-position: -476px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_BorderBottom { background-position: -153.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderBottomDisabled { background-position: -153.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderBottomLarge { background-position: -306px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BorderBottomLargeDisabled { background-position: -306px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_BorderInsideHorizontal { background-position: -34.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderInsideHorizontalDisabled { background-position: -34.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderInsideHorizontalLarge { background-position: -68px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BorderInsideHorizontalLargeDisabled { background-position: -68px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_BorderInsideVertical { background-position: -51.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderInsideVerticalDisabled { background-position: -51.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderInsideVerticalLarge { background-position: -102px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BorderInsideVerticalLargeDisabled { background-position: -102px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_BorderLeft { background-position: -68.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderLeftDisabled { background-position: -68.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderLeftLarge { background-position: -136px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BorderLeftLargeDisabled { background-position: -136px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_BorderNone { background-position: -170.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderNoneDisabled { background-position: -170.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderNoneLarge { background-position: -340px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BorderNoneLargeDisabled { background-position: -340px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_BorderRight { background-position: -187.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderRightDisabled { background-position: -187.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderRightLarge { background-position: -374px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BorderRightLargeDisabled { background-position: -374px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_BordersAll { background-position: 0.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BordersAllDisabled { background-position: 0.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BordersAllLarge { background-position: 0px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BordersAllLargeDisabled { background-position: 0px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_BordersInside { background-position: -34.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BordersInsideDisabled { background-position: -34.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BordersInsideLarge { background-position: -68px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BordersInsideLargeDisabled { background-position: -68px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_BordersOutside { background-position: -51.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BordersOutsideDisabled { background-position: -51.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BordersOutsideLarge { background-position: -102px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BordersOutsideLargeDisabled { background-position: -102px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_BorderTop { background-position: -51.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderTopDisabled { background-position: -51.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderTopLarge { background-position: -102px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BorderTopLargeDisabled { background-position: -102px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ChangeFontStyleLarge { background-position: -68.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ChangeFontStyleLargeDisabled { background-position: -68.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ChangeFontStyleLargeLarge { background-position: -136px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ChangeFontStyleLargeLargeDisabled { background-position: -136px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ChangeTextCase { background-position: -85.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ChangeTextCaseDisabled { background-position: -85.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ChangeTextCaseLarge { background-position: -170px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ChangeTextCaseLargeDisabled { background-position: -170px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ClearFormatting { background-position: -102.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ClearFormattingDisabled { background-position: -102.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ClearFormattingLarge { background-position: -204px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ClearFormattingLargeDisabled { background-position: -204px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ClearTableStyle { background-position: -119.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ClearTableStyleDisabled { background-position: -119.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ClearTableStyleLarge { background-position: -238px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ClearTableStyleLargeDisabled { background-position: -238px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_CloseHeaderAndFooter { background-position: -136.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_CloseHeaderAndFooterDisabled { background-position: -136.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_CloseHeaderAndFooterLarge { background-position: -272px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_CloseHeaderAndFooterLargeDisabled { background-position: -272px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ColumnOne { background-position: -153.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ColumnOneDisabled { background-position: -153.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ColumnOneLarge { background-position: -306px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ColumnOneLargeDisabled { background-position: -306px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Columns { background-position: -170.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ColumnsDisabled { background-position: -170.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ColumnsLarge { background-position: -340px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ColumnsLargeDisabled { background-position: -340px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ColumnsThree { background-position: -187.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ColumnsThreeDisabled { background-position: -187.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ColumnsThreeLarge { background-position: -374px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ColumnsThreeLargeDisabled { background-position: -374px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ColumnsTwo { background-position: -204.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ColumnsTwoDisabled { background-position: -204.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ColumnsTwoLarge { background-position: -408px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ColumnsTwoLargeDisabled { background-position: -408px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Copy { background-position: -221.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_CopyDisabled { background-position: -221.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_CopyLarge { background-position: -442px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_CopyLargeDisabled { background-position: -442px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Cut { background-position: -85.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_CutDisabled { background-position: -85.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_CutLarge { background-position: -170px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_CutLargeDisabled { background-position: -170px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Delete { background-position: -238.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteDisabled { background-position: -238.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteLarge { background-position: -476px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DeleteLargeDisabled { background-position: -476px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Delete_Hyperlink { background-position: -17.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_Delete_HyperlinkDisabled { background-position: -17.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_Delete_HyperlinkLarge { background-position: -34px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Delete_HyperlinkLargeDisabled { background-position: -34px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_DeleteComment { background-position: -68.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteCommentDisabled { background-position: -68.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteCommentLarge { background-position: -136px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DeleteCommentLargeDisabled { background-position: -136px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_DeleteTable { background-position: -170.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteTableDisabled { background-position: -170.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteTableLarge { background-position: -340px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DeleteTableLargeDisabled { background-position: -340px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_DeleteTableCells { background-position: -51.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteTableCellsDisabled { background-position: -51.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteTableCellsLarge { background-position: -102px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DeleteTableCellsLargeDisabled { background-position: -102px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_DeleteTableColumns { background-position: -136.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteTableColumnsDisabled { background-position: -136.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteTableColumnsLarge { background-position: -272px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DeleteTableColumnsLargeDisabled { background-position: -272px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_DeleteTableRows { background-position: -85.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteTableRowsDisabled { background-position: -85.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteTableRowsLarge { background-position: -170px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DeleteTableRowsLargeDisabled { background-position: -170px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_DifferentFirstPage { background-position: -17.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DifferentFirstPageDisabled { background-position: -17.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DifferentFirstPageLarge { background-position: -34px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DifferentFirstPageLargeDisabled { background-position: -34px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_DifferentOddEvenPages { background-position: -187.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DifferentOddEvenPagesDisabled { background-position: -187.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DifferentOddEvenPagesLarge { background-position: -374px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DifferentOddEvenPagesLargeDisabled { background-position: -374px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_DraftView { background-position: -170.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DraftViewDisabled { background-position: -170.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DraftViewLarge { background-position: -340px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DraftViewLargeDisabled { background-position: -340px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_EditRangePermission { background-position: -153.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_EditRangePermissionDisabled { background-position: -153.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_EditRangePermissionLarge { background-position: -306px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_EditRangePermissionLargeDisabled { background-position: -306px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Find { background-position: -354.78260869565217391304347825px -23.652173913043478260869565217px; background-size: 374.26086956521739130434782608px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FindDisabled { background-position: -354.78260869565217391304347825px -23.652173913043478260869565217px; background-size: 374.26086956521739130434782608px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FindLarge { background-position: -709.56521739130434782608695650px -47.304347826086956521739130434px; background-size: 748.52173913043478260869565216px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FindLargeDisabled { background-position: -709.56521739130434782608695650px -47.304347826086956521739130434px; background-size: 748.52173913043478260869565216px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_FindLarge { background-position: -354.78260869565217391304347825px 0px; background-size: 374.26086956521739130434782608px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FindLargeDisabled { background-position: -354.78260869565217391304347825px 0px; background-size: 374.26086956521739130434782608px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FindLargeLarge { background-position: -709.56521739130434782608695650px 0px; background-size: 748.52173913043478260869565216px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FindLargeLargeDisabled { background-position: -709.56521739130434782608695650px 0px; background-size: 748.52173913043478260869565216px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_First { background-position: -136.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FirstDisabled { background-position: -136.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FirstLarge { background-position: -272px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FirstLargeDisabled { background-position: -272px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_FloatingObjectAlignment { background-position: -119.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectAlignmentDisabled { background-position: -119.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectAlignmentLarge { background-position: -238px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectAlignmentLargeDisabled { background-position: -238px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_FloatingObjectBringForward { background-position: -102.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectBringForwardDisabled { background-position: -102.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectBringForwardLarge { background-position: -204px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectBringForwardLargeDisabled { background-position: -204px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_FloatingObjectBringInFrontOfText { background-position: -85.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectBringInFrontOfTextDisabled { background-position: -85.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectBringInFrontOfTextLarge { background-position: -170px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectBringInFrontOfTextLargeDisabled { background-position: -170px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_FloatingObjectBringToFront { background-position: -153.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectBringToFrontDisabled { background-position: -153.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectBringToFrontLarge { background-position: -306px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectBringToFrontLargeDisabled { background-position: -306px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_FloatingObjectBringToFrontOfText { background-position: -68.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectBringToFrontOfTextDisabled { background-position: -68.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectBringToFrontOfTextLarge { background-position: -136px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectBringToFrontOfTextLargeDisabled { background-position: -136px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_FloatingObjectLayoutOptions { background-position: -136.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectLayoutOptionsDisabled { background-position: -136.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectLayoutOptionsLarge { background-position: -272px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectLayoutOptionsLargeDisabled { background-position: -272px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_FloatingObjectOutlineColor { background-position: -221.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectOutlineColorDisabled { background-position: -221.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectOutlineColorLarge { background-position: -442px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectOutlineColorLargeDisabled { background-position: -442px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_FloatingObjectSendBackward { background-position: -68.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectSendBackwardDisabled { background-position: -68.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectSendBackwardLarge { background-position: -136px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectSendBackwardLargeDisabled { background-position: -136px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_FloatingObjectSendBehindText { background-position: -119.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectSendBehindTextDisabled { background-position: -119.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectSendBehindTextLarge { background-position: -238px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectSendBehindTextLargeDisabled { background-position: -238px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_FloatingObjectSendToBack { background-position: -238.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectSendToBackDisabled { background-position: -238.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectSendToBackLarge { background-position: -476px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectSendToBackLargeDisabled { background-position: -476px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_FloatingObjectTextWrapType { background-position: -34.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectTextWrapTypeDisabled { background-position: -34.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectTextWrapTypeLarge { background-position: -68px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectTextWrapTypeLargeDisabled { background-position: -68px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Font { background-position: -136.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontDisabled { background-position: -136.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontLarge { background-position: -272px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FontLargeDisabled { background-position: -272px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_FontColor { background-position: -119.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontColorDisabled { background-position: -119.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontColorLarge { background-position: -238px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FontColorLargeDisabled { background-position: -238px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_FontLarge { background-position: -102.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontLargeDisabled { background-position: -102.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontLargeLarge { background-position: -204px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FontLargeLargeDisabled { background-position: -204px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_FontSize { background-position: -85.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontSizeDisabled { background-position: -85.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontSizeLarge { background-position: -170px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FontSizeLargeDisabled { background-position: -170px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_FontSizeDecrease { background-position: 0.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontSizeDecreaseDisabled { background-position: 0.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontSizeDecreaseLarge { background-position: 0px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FontSizeDecreaseLargeDisabled { background-position: 0px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_FontSizeIncrease { background-position: -238.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontSizeIncreaseDisabled { background-position: -238.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontSizeIncreaseLarge { background-position: -476px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FontSizeIncreaseLargeDisabled { background-position: -476px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Footer { background-position: -34.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FooterDisabled { background-position: -34.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FooterLarge { background-position: -68px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FooterLargeDisabled { background-position: -68px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_FullScreen { background-position: -204.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FullScreenDisabled { background-position: -204.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FullScreenLarge { background-position: -408px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FullScreenLargeDisabled { background-position: -408px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_GoToFooter { background-position: -85.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_GoToFooterDisabled { background-position: -85.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_GoToFooterLarge { background-position: -170px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_GoToFooterLargeDisabled { background-position: -170px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_GoToHeader { background-position: -221.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_GoToHeaderDisabled { background-position: -221.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_GoToHeaderLarge { background-position: -442px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_GoToHeaderLargeDisabled { background-position: -442px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_GoToNextHeaderFooter { background-position: -221.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_GoToNextHeaderFooterDisabled { background-position: -221.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_GoToNextHeaderFooterLarge { background-position: -442px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_GoToNextHeaderFooterLargeDisabled { background-position: -442px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_GoToPreviousHeaderFooter { background-position: -204.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_GoToPreviousHeaderFooterDisabled { background-position: -204.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_GoToPreviousHeaderFooterLarge { background-position: -408px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_GoToPreviousHeaderFooterLargeDisabled { background-position: -408px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Header { background-position: -187.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_HeaderDisabled { background-position: -187.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_HeaderLarge { background-position: -374px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_HeaderLargeDisabled { background-position: -374px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Highlight { background-position: -204.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_HighlightDisabled { background-position: -204.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_HighlightLarge { background-position: -408px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_HighlightLargeDisabled { background-position: -408px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Hyperlink { background-position: -17.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_HyperlinkDisabled { background-position: -17.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_HyperlinkLarge { background-position: -34px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_HyperlinkLargeDisabled { background-position: -34px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ImagePlaceHolder { background-position: -221.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ImagePlaceHolderDisabled { background-position: -221.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ImagePlaceHolderLarge { background-position: -442px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ImagePlaceHolderLargeDisabled { background-position: -442px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_IndentDecrease { background-position: 0.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_IndentDecreaseDisabled { background-position: 0.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_IndentDecreaseLarge { background-position: 0px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_IndentDecreaseLargeDisabled { background-position: 0px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_IndentIncrease { background-position: -17.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_IndentIncreaseDisabled { background-position: -17.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_IndentIncreaseLarge { background-position: -34px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_IndentIncreaseLargeDisabled { background-position: -34px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertCaption { background-position: -187.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertCaptionDisabled { background-position: -187.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertCaptionLarge { background-position: -374px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertCaptionLargeDisabled { background-position: -374px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertColumnBreak { background-position: -51.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertColumnBreakDisabled { background-position: -51.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertColumnBreakLarge { background-position: -102px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertColumnBreakLargeDisabled { background-position: -102px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertDataField { background-position: -34.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertDataFieldDisabled { background-position: -34.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertDataFieldLarge { background-position: -68px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertDataFieldLargeDisabled { background-position: -68px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertEquationCaption { background-position: -238.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertEquationCaptionDisabled { background-position: -238.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertEquationCaptionLarge { background-position: -476px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertEquationCaptionLargeDisabled { background-position: -476px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertFigureCaption { background-position: 0.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertFigureCaptionDisabled { background-position: 0.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertFigureCaptionLarge { background-position: 0px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertFigureCaptionLargeDisabled { background-position: 0px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertFloatingObjectImage { background-position: -153.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertFloatingObjectImageDisabled { background-position: -153.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertFloatingObjectImageLarge { background-position: -306px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertFloatingObjectImageLargeDisabled { background-position: -306px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertImage { background-position: -119.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertImageDisabled { background-position: -119.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertImageLarge { background-position: -238px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertImageLargeDisabled { background-position: -238px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertPageBreak { background-position: -136.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertPageBreakDisabled { background-position: -136.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertPageBreakLarge { background-position: -272px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertPageBreakLargeDisabled { background-position: -272px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertPageCount { background-position: -153.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertPageCountDisabled { background-position: -153.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertPageCountLarge { background-position: -306px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertPageCountLargeDisabled { background-position: -306px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertPageNumber { background-position: -17.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertPageNumberDisabled { background-position: -17.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertPageNumberLarge { background-position: -34px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertPageNumberLargeDisabled { background-position: -34px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertSectionBreakContinuous { background-position: -51.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertSectionBreakContinuousDisabled { background-position: -51.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertSectionBreakContinuousLarge { background-position: -102px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertSectionBreakContinuousLargeDisabled { background-position: -102px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertSectionBreakEvenPage { background-position: -204.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertSectionBreakEvenPageDisabled { background-position: -204.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertSectionBreakEvenPageLarge { background-position: -408px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertSectionBreakEvenPageLargeDisabled { background-position: -408px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertSectionBreakNextPage { background-position: -51.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertSectionBreakNextPageDisabled { background-position: -51.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertSectionBreakNextPageLarge { background-position: -102px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertSectionBreakNextPageLargeDisabled { background-position: -102px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertSectionBreakOddPage { background-position: -102.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertSectionBreakOddPageDisabled { background-position: -102.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertSectionBreakOddPageLarge { background-position: -204px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertSectionBreakOddPageLargeDisabled { background-position: -204px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertTable { background-position: -238.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableDisabled { background-position: -238.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableLarge { background-position: -476px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableLargeDisabled { background-position: -476px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertTableCaption { background-position: -221.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableCaptionDisabled { background-position: -221.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableCaptionLarge { background-position: -442px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableCaptionLargeDisabled { background-position: -442px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertTableCells { background-position: -68.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableCellsDisabled { background-position: -68.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableCellsLarge { background-position: -136px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableCellsLargeDisabled { background-position: -136px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertTableColumnsToTheLeft { background-position: 0.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableColumnsToTheLeftDisabled { background-position: 0.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableColumnsToTheLeftLarge { background-position: 0px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableColumnsToTheLeftLargeDisabled { background-position: 0px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertTableColumnsToTheRight { background-position: 0.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableColumnsToTheRightDisabled { background-position: 0.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableColumnsToTheRightLarge { background-position: 0px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableColumnsToTheRightLargeDisabled { background-position: 0px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertTableOfCaptions { background-position: -102.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableOfCaptionsDisabled { background-position: -102.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableOfCaptionsLarge { background-position: -204px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableOfCaptionsLargeDisabled { background-position: -204px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertTableOfContents { background-position: -119.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableOfContentsDisabled { background-position: -119.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableOfContentsLarge { background-position: -238px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableOfContentsLargeDisabled { background-position: -238px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertTableOfEquations { background-position: -136.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableOfEquationsDisabled { background-position: -136.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableOfEquationsLarge { background-position: -272px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableOfEquationsLargeDisabled { background-position: -272px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertTableOfFigures { background-position: -170.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableOfFiguresDisabled { background-position: -170.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableOfFiguresLarge { background-position: -340px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableOfFiguresLargeDisabled { background-position: -340px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertTableRowsAbove { background-position: -221.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableRowsAboveDisabled { background-position: -221.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableRowsAboveLarge { background-position: -442px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableRowsAboveLargeDisabled { background-position: -442px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertTableRowsBelow { background-position: -187.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableRowsBelowDisabled { background-position: -187.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableRowsBelowLarge { background-position: -374px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableRowsBelowLargeDisabled { background-position: -374px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_InsertTextBox { background-position: -204.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTextBoxDisabled { background-position: -204.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTextBoxLarge { background-position: -408px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTextBoxLargeDisabled { background-position: -408px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Italic { background-position: -221.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ItalicDisabled { background-position: -221.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ItalicLarge { background-position: -442px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ItalicLargeDisabled { background-position: -442px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Language { background-position: -238.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LanguageDisabled { background-position: -238.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LanguageLarge { background-position: -476px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_LanguageLargeDisabled { background-position: -476px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Last { background-position: 0.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LastDisabled { background-position: 0.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LastLarge { background-position: 0px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_LastLargeDisabled { background-position: 0px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_LeftColumns { background-position: -170.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LeftColumnsDisabled { background-position: -170.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LeftColumnsLarge { background-position: -340px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_LeftColumnsLargeDisabled { background-position: -340px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_LineNumbering { background-position: -187.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LineNumberingDisabled { background-position: -187.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LineNumberingLarge { background-position: -374px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_LineNumberingLargeDisabled { background-position: -374px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_LineSpacing { background-position: 0.0px -238.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LineSpacingDisabled { background-position: 0.0px -238.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LineSpacingLarge { background-position: 0px -476px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_LineSpacingLargeDisabled { background-position: 0px -476px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_LinkToPrevious { background-position: -119.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LinkToPreviousDisabled { background-position: -119.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LinkToPreviousLarge { background-position: -238px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_LinkToPreviousLargeDisabled { background-position: -238px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ListBullets { background-position: -170.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ListBulletsDisabled { background-position: -170.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ListBulletsLarge { background-position: -340px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ListBulletsLargeDisabled { background-position: -340px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ListMultilevel { background-position: -187.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ListMultilevelDisabled { background-position: -187.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ListMultilevelLarge { background-position: -374px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ListMultilevelLargeDisabled { background-position: -374px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ListNumbers { background-position: -204.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ListNumbersDisabled { background-position: -204.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ListNumbersLarge { background-position: -408px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ListNumbersLargeDisabled { background-position: -408px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_MailMerge { background-position: -238.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_MailMergeDisabled { background-position: -238.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_MailMergeLarge { background-position: -476px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_MailMergeLargeDisabled { background-position: -476px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_MergeTableCells { background-position: -68.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_MergeTableCellsDisabled { background-position: -68.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_MergeTableCellsLarge { background-position: -136px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_MergeTableCellsLargeDisabled { background-position: -136px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ModifyTableStyle { background-position: -85.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ModifyTableStyleDisabled { background-position: -85.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ModifyTableStyleLarge { background-position: -170px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ModifyTableStyleLargeDisabled { background-position: -170px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_New { background-position: -85.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_NewDisabled { background-position: -85.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_NewLarge { background-position: -170px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_NewLargeDisabled { background-position: -170px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_NewComment { background-position: -68.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_NewCommentDisabled { background-position: -68.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_NewCommentLarge { background-position: -136px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_NewCommentLargeDisabled { background-position: -136px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_NewTableStyle { background-position: -34.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_NewTableStyleDisabled { background-position: -34.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_NewTableStyleLarge { background-position: -68px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_NewTableStyleLargeDisabled { background-position: -68px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Next { background-position: -85.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_NextDisabled { background-position: -85.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_NextLarge { background-position: -170px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_NextLargeDisabled { background-position: -170px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_NextComment { background-position: -68.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_NextCommentDisabled { background-position: -68.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_NextCommentLarge { background-position: -136px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_NextCommentLargeDisabled { background-position: -136px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Open { background-position: -51.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_OpenDisabled { background-position: -51.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_OpenLarge { background-position: -102px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_OpenLargeDisabled { background-position: -102px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_PageColor { background-position: -187.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageColorDisabled { background-position: -187.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageColorLarge { background-position: -374px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageColorLargeDisabled { background-position: -374px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_PageMargins { background-position: -17.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageMarginsDisabled { background-position: -17.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageMarginsLarge { background-position: -34px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageMarginsLargeDisabled { background-position: -34px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_PageMarginsModerate { background-position: -34.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageMarginsModerateDisabled { background-position: -34.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageMarginsModerateLarge { background-position: -68px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageMarginsModerateLargeDisabled { background-position: -68px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_PageMarginsNarrow { background-position: -51.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageMarginsNarrowDisabled { background-position: -51.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageMarginsNarrowLarge { background-position: -102px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageMarginsNarrowLargeDisabled { background-position: -102px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_PageMarginsNormal { background-position: -68.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageMarginsNormalDisabled { background-position: -68.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageMarginsNormalLarge { background-position: -136px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageMarginsNormalLargeDisabled { background-position: -136px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_PageMarginsWide { background-position: -85.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageMarginsWideDisabled { background-position: -85.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageMarginsWideLarge { background-position: -170px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageMarginsWideLargeDisabled { background-position: -170px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_PageOrientation { background-position: -102.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageOrientationDisabled { background-position: -102.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageOrientationLarge { background-position: -204px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageOrientationLargeDisabled { background-position: -204px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_PageOrientationLandscape { background-position: -119.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageOrientationLandscapeDisabled { background-position: -119.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageOrientationLandscapeLarge { background-position: -238px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageOrientationLandscapeLargeDisabled { background-position: -238px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_PageOrientationPortrait { background-position: -136.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageOrientationPortraitDisabled { background-position: -136.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageOrientationPortraitLarge { background-position: -272px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageOrientationPortraitLargeDisabled { background-position: -272px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_PaperSize { background-position: -153.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PaperSizeDisabled { background-position: -153.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PaperSizeLarge { background-position: -306px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PaperSizeLargeDisabled { background-position: -306px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Paragraph { background-position: -170.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ParagraphDisabled { background-position: -170.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ParagraphLarge { background-position: -340px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ParagraphLargeDisabled { background-position: -340px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ParagraphLarge { background-position: -204.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ParagraphLargeDisabled { background-position: -204.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ParagraphLargeLarge { background-position: -408px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ParagraphLargeLargeDisabled { background-position: -408px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Paste { background-position: -34.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PasteDisabled { background-position: -34.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PasteLarge { background-position: -68px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PasteLargeDisabled { background-position: -68px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_PasteLarge { background-position: -221.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PasteLargeDisabled { background-position: -221.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PasteLargeLarge { background-position: -442px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PasteLargeLargeDisabled { background-position: -442px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_PasteSpecial { background-position: -238.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PasteSpecialDisabled { background-position: -238.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PasteSpecialLarge { background-position: -476px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PasteSpecialLargeDisabled { background-position: -476px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_PenColor { background-position: 0.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PenColorDisabled { background-position: 0.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PenColorLarge { background-position: 0px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PenColorLargeDisabled { background-position: 0px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Prev { background-position: -17.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrevDisabled { background-position: -17.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrevLarge { background-position: -34px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PrevLargeDisabled { background-position: -34px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Preview { background-position: -204.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PreviewDisabled { background-position: -204.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PreviewLarge { background-position: -408px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PreviewLargeDisabled { background-position: -408px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_PreviousComment { background-position: -17.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PreviousCommentDisabled { background-position: -17.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PreviousCommentLarge { background-position: -34px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PreviousCommentLargeDisabled { background-position: -34px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Print { background-position: -85.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrintDisabled { background-position: -85.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrintLarge { background-position: -170px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PrintLargeDisabled { background-position: -170px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_PrintBrowser { background-position: -119.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrintBrowserDisabled { background-position: -119.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrintBrowserLarge { background-position: -238px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PrintBrowserLargeDisabled { background-position: -238px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_PrintDialog { background-position: -153.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrintDialogDisabled { background-position: -153.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrintDialogLarge { background-position: -306px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PrintDialogLargeDisabled { background-position: -306px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_PrintLayoutView { background-position: -17.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrintLayoutViewDisabled { background-position: -17.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrintLayoutViewLarge { background-position: -34px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PrintLayoutViewLargeDisabled { background-position: -34px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_PrintPreviewBrowser { background-position: -51.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrintPreviewBrowserDisabled { background-position: -51.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrintPreviewBrowserLarge { background-position: -102px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PrintPreviewBrowserLargeDisabled { background-position: -102px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ProtectDocument { background-position: -68.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ProtectDocumentDisabled { background-position: -68.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ProtectDocumentLarge { background-position: -136px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ProtectDocumentLargeDisabled { background-position: -136px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Redo { background-position: -85.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_RedoDisabled { background-position: -85.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_RedoLarge { background-position: -170px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_RedoLargeDisabled { background-position: -170px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Replace { background-position: -102.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ReplaceDisabled { background-position: -102.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ReplaceLarge { background-position: -204px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ReplaceLargeDisabled { background-position: -204px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Reviewers { background-position: -238.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ReviewersDisabled { background-position: -238.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ReviewersLarge { background-position: -476px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ReviewersLargeDisabled { background-position: -476px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ReviewingPane { background-position: 0.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ReviewingPaneDisabled { background-position: 0.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ReviewingPaneLarge { background-position: 0px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ReviewingPaneLargeDisabled { background-position: 0px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_RightColumns { background-position: -102.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_RightColumnsDisabled { background-position: -102.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_RightColumnsLarge { background-position: -204px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_RightColumnsLargeDisabled { background-position: -204px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_RulerHorizontal { background-position: -221.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_RulerHorizontalDisabled { background-position: -221.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_RulerHorizontalLarge { background-position: -442px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_RulerHorizontalLargeDisabled { background-position: -442px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_RulerVertical { background-position: 0.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_RulerVerticalDisabled { background-position: 0.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_RulerVerticalLarge { background-position: 0px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_RulerVerticalLargeDisabled { background-position: 0px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Save { background-position: 0.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SaveDisabled { background-position: 0.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SaveLarge { background-position: 0px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SaveLargeDisabled { background-position: 0px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_SaveAs { background-position: -153.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SaveAsDisabled { background-position: -153.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SaveAsLarge { background-position: -306px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SaveAsLargeDisabled { background-position: -306px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Select { background-position: -17.0px -238.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectDisabled { background-position: -17.0px -238.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectLarge { background-position: -34px -476px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SelectLargeDisabled { background-position: -34px -476px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_SelectAll { background-position: -34.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectAllDisabled { background-position: -34.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectAllLarge { background-position: -68px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SelectAllLargeDisabled { background-position: -68px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_SelectTable { background-position: -204.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectTableDisabled { background-position: -204.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectTableLarge { background-position: -408px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SelectTableLargeDisabled { background-position: -408px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_SelectTableCell { background-position: -119.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectTableCellDisabled { background-position: -119.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectTableCellLarge { background-position: -238px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SelectTableCellLargeDisabled { background-position: -238px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_SelectTableColumn { background-position: -238.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectTableColumnDisabled { background-position: -238.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectTableColumnLarge { background-position: -476px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SelectTableColumnLargeDisabled { background-position: -476px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_SelectTableRow { background-position: -153.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectTableRowDisabled { background-position: -153.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectTableRowLarge { background-position: -306px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SelectTableRowLargeDisabled { background-position: -306px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Shading { background-position: -34.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ShadingDisabled { background-position: -34.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ShadingLarge { background-position: -68px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ShadingLargeDisabled { background-position: -68px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ShowAllFieldCodes { background-position: -17.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ShowAllFieldCodesDisabled { background-position: -17.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ShowAllFieldCodesLarge { background-position: -34px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ShowAllFieldCodesLargeDisabled { background-position: -34px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ShowAllFieldResults { background-position: -102.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ShowAllFieldResultsDisabled { background-position: -102.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ShowAllFieldResultsLarge { background-position: -204px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ShowAllFieldResultsLargeDisabled { background-position: -204px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ShowComments { background-position: -119.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ShowCommentsDisabled { background-position: -119.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ShowCommentsLarge { background-position: -238px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ShowCommentsLargeDisabled { background-position: -238px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ShowHidden { background-position: -17.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ShowHiddenDisabled { background-position: -17.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ShowHiddenLarge { background-position: -34px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ShowHiddenLargeDisabled { background-position: -34px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_SimpleView { background-position: -136.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SimpleViewDisabled { background-position: -136.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SimpleViewLarge { background-position: -272px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SimpleViewLargeDisabled { background-position: -272px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_SpacingDecrease { background-position: -153.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SpacingDecreaseDisabled { background-position: -153.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SpacingDecreaseLarge { background-position: -306px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SpacingDecreaseLargeDisabled { background-position: -306px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_SpellCheck { background-position: -68.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SpellCheckDisabled { background-position: -68.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SpellCheckLarge { background-position: -136px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SpellCheckLargeDisabled { background-position: -136px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_SpellCheckAsYouType { background-position: -51.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SpellCheckAsYouTypeDisabled { background-position: -51.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SpellCheckAsYouTypeLarge { background-position: -102px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SpellCheckAsYouTypeLargeDisabled { background-position: -102px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_SplitTable { background-position: -170.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SplitTableDisabled { background-position: -170.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SplitTableLarge { background-position: -340px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SplitTableLargeDisabled { background-position: -340px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_SplitTableCells { background-position: -34.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SplitTableCellsDisabled { background-position: -34.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SplitTableCellsLarge { background-position: -68px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SplitTableCellsLargeDisabled { background-position: -68px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Strikeout { background-position: -102.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_StrikeoutDisabled { background-position: -102.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_StrikeoutLarge { background-position: -204px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_StrikeoutLargeDisabled { background-position: -204px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_StrikeoutDouble { background-position: -34.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_StrikeoutDoubleDisabled { background-position: -34.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_StrikeoutDoubleLarge { background-position: -68px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_StrikeoutDoubleLargeDisabled { background-position: -68px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Subscript { background-position: -187.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SubscriptDisabled { background-position: -187.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SubscriptLarge { background-position: -374px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SubscriptLargeDisabled { background-position: -374px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Superscript { background-position: -119.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SuperscriptDisabled { background-position: -119.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SuperscriptLarge { background-position: -238px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SuperscriptLargeDisabled { background-position: -238px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Symbol { background-position: -136.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SymbolDisabled { background-position: -136.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SymbolLarge { background-position: -272px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SymbolLargeDisabled { background-position: -272px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_TableAutoFitContents { background-position: -153.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TableAutoFitContentsDisabled { background-position: -153.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TableAutoFitContentsLarge { background-position: -306px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TableAutoFitContentsLargeDisabled { background-position: -306px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_TableAutoFitWindow { background-position: -170.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TableAutoFitWindowDisabled { background-position: -170.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TableAutoFitWindowLarge { background-position: -340px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TableAutoFitWindowLargeDisabled { background-position: -340px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_TableCellMargins { background-position: -187.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TableCellMarginsDisabled { background-position: -187.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TableCellMarginsLarge { background-position: -374px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TableCellMarginsLargeDisabled { background-position: -374px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_TableFixedColumnWidth { background-position: -170.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TableFixedColumnWidthDisabled { background-position: -170.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TableFixedColumnWidthLarge { background-position: -340px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TableFixedColumnWidthLargeDisabled { background-position: -340px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_TableProperties { background-position: -204.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TablePropertiesDisabled { background-position: -204.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TablePropertiesLarge { background-position: -408px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TablePropertiesLargeDisabled { background-position: -408px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_TextWrapBehind { background-position: -136.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapBehindDisabled { background-position: -136.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapBehindLarge { background-position: -272px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TextWrapBehindLargeDisabled { background-position: -272px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_TextWrapInFrontOfText { background-position: -221.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapInFrontOfTextDisabled { background-position: -221.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapInFrontOfTextLarge { background-position: -442px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TextWrapInFrontOfTextLargeDisabled { background-position: -442px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_TextWrapInline { background-position: -136.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapInlineDisabled { background-position: -136.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapInlineLarge { background-position: -272px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TextWrapInlineLargeDisabled { background-position: -272px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_TextWrapSquare { background-position: -51.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapSquareDisabled { background-position: -51.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapSquareLarge { background-position: -102px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TextWrapSquareLargeDisabled { background-position: -102px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_TextWrapThrough { background-position: -170.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapThroughDisabled { background-position: -170.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapThroughLarge { background-position: -340px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TextWrapThroughLargeDisabled { background-position: -340px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_TextWrapTight { background-position: -153.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapTightDisabled { background-position: -153.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapTightLarge { background-position: -306px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TextWrapTightLargeDisabled { background-position: -306px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_TextWrapTopAndBottom { background-position: -170.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapTopAndBottomDisabled { background-position: -170.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapTopAndBottomLarge { background-position: -340px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TextWrapTopAndBottomLargeDisabled { background-position: -340px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ToggleFieldCodes { background-position: -187.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ToggleFieldCodesDisabled { background-position: -187.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ToggleFieldCodesLarge { background-position: -374px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ToggleFieldCodesLargeDisabled { background-position: -374px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Underline { background-position: -204.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UnderlineDisabled { background-position: -204.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UnderlineLarge { background-position: -408px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_UnderlineLargeDisabled { background-position: -408px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_UnderlineDouble { background-position: -238.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UnderlineDoubleDisabled { background-position: -238.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UnderlineDoubleLarge { background-position: -476px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_UnderlineDoubleLargeDisabled { background-position: -476px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_Undo { background-position: -119.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UndoDisabled { background-position: -119.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UndoLarge { background-position: -238px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_UndoLargeDisabled { background-position: -238px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_UnprotectDocument { background-position: 0.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UnprotectDocumentDisabled { background-position: 0.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UnprotectDocumentLarge { background-position: 0px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_UnprotectDocumentLargeDisabled { background-position: 0px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_UpdateField { background-position: -85.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UpdateFieldDisabled { background-position: -85.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UpdateFieldLarge { background-position: -170px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_UpdateFieldLargeDisabled { background-position: -170px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_UpdateTableOfContents { background-position: -102.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UpdateTableOfContentsDisabled { background-position: -102.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UpdateTableOfContentsLarge { background-position: -204px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_UpdateTableOfContentsLargeDisabled { background-position: -204px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ViewMergedData { background-position: -68.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ViewMergedDataDisabled { background-position: -68.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ViewMergedDataLarge { background-position: -136px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ViewMergedDataLargeDisabled { background-position: -136px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ViewTableGridlines { background-position: -238.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ViewTableGridlinesDisabled { background-position: -238.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ViewTableGridlinesLarge { background-position: -476px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ViewTableGridlinesLargeDisabled { background-position: -476px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ZoomIn { background-position: -136.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ZoomInDisabled { background-position: -136.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ZoomInLarge { background-position: -272px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ZoomInLargeDisabled { background-position: -272px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
.dxRichEdit_SVGIcon_ZoomOut { background-position: -204.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ZoomOutDisabled { background-position: -204.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ZoomOutLarge { background-position: -408px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ZoomOutLargeDisabled { background-position: -408px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
        
dxSpriteWidth { width : 538 }
.dxRichEdit_SVGIcon_AddParagraphToTableOfContents, .dxRichEdit_SVGIcon_AlignBottomCenter, .dxRichEdit_SVGIcon_AlignBottomLeft, .dxRichEdit_SVGIcon_AlignBottomRight, .dxRichEdit_SVGIcon_AlignCenter, .dxRichEdit_SVGIcon_AlignFloatingObjectBottomCenter, .dxRichEdit_SVGIcon_AlignFloatingObjectBottomLeft, .dxRichEdit_SVGIcon_AlignFloatingObjectBottomRight, .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleCenter, .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleLeft, .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleRight, .dxRichEdit_SVGIcon_AlignFloatingObjectTopCenter, .dxRichEdit_SVGIcon_AlignFloatingObjectTopLeft, .dxRichEdit_SVGIcon_AlignFloatingObjectTopRight, .dxRichEdit_SVGIcon_AlignJustify, .dxRichEdit_SVGIcon_AlignLeft, .dxRichEdit_SVGIcon_AlignMiddleCenter, .dxRichEdit_SVGIcon_AlignMiddleLeft, .dxRichEdit_SVGIcon_AlignMiddleRight, .dxRichEdit_SVGIcon_AlignRight, .dxRichEdit_SVGIcon_AlignTopCenter, .dxRichEdit_SVGIcon_AlignTopLeft, .dxRichEdit_SVGIcon_AlignTopRight, .dxRichEdit_SVGIcon_Background, .dxRichEdit_SVGIcon_Bold, .dxRichEdit_SVGIcon_Bookmark, .dxRichEdit_SVGIcon_BorderBottom, .dxRichEdit_SVGIcon_BorderInsideHorizontal, .dxRichEdit_SVGIcon_BorderInsideVertical, .dxRichEdit_SVGIcon_BorderLeft, .dxRichEdit_SVGIcon_BorderNone, .dxRichEdit_SVGIcon_BorderRight, .dxRichEdit_SVGIcon_BordersAll, .dxRichEdit_SVGIcon_BordersInside, .dxRichEdit_SVGIcon_BordersOutside, .dxRichEdit_SVGIcon_BorderTop, .dxRichEdit_SVGIcon_ChangeFontStyleLarge, .dxRichEdit_SVGIcon_ChangeTextCase, .dxRichEdit_SVGIcon_ClearFormatting, .dxRichEdit_SVGIcon_ClearTableStyle, .dxRichEdit_SVGIcon_CloseHeaderAndFooter, .dxRichEdit_SVGIcon_ColumnOne, .dxRichEdit_SVGIcon_Columns, .dxRichEdit_SVGIcon_ColumnsThree, .dxRichEdit_SVGIcon_ColumnsTwo, .dxRichEdit_SVGIcon_Copy, .dxRichEdit_SVGIcon_Cut, .dxRichEdit_SVGIcon_Delete, .dxRichEdit_SVGIcon_Delete_Hyperlink, .dxRichEdit_SVGIcon_DeleteComment, .dxRichEdit_SVGIcon_DeleteTable, .dxRichEdit_SVGIcon_DeleteTableCells, .dxRichEdit_SVGIcon_DeleteTableColumns, .dxRichEdit_SVGIcon_DeleteTableRows, .dxRichEdit_SVGIcon_DifferentFirstPage, .dxRichEdit_SVGIcon_DifferentOddEvenPages, .dxRichEdit_SVGIcon_DraftView, .dxRichEdit_SVGIcon_EditRangePermission, .dxRichEdit_SVGIcon_Find, .dxRichEdit_SVGIcon_FindLarge, .dxRichEdit_SVGIcon_First, .dxRichEdit_SVGIcon_FloatingObjectAlignment, .dxRichEdit_SVGIcon_FloatingObjectBringForward, .dxRichEdit_SVGIcon_FloatingObjectBringInFrontOfText, .dxRichEdit_SVGIcon_FloatingObjectBringToFront, .dxRichEdit_SVGIcon_FloatingObjectBringToFrontOfText, .dxRichEdit_SVGIcon_FloatingObjectLayoutOptions, .dxRichEdit_SVGIcon_FloatingObjectOutlineColor, .dxRichEdit_SVGIcon_FloatingObjectSendBackward, .dxRichEdit_SVGIcon_FloatingObjectSendBehindText, .dxRichEdit_SVGIcon_FloatingObjectSendToBack, .dxRichEdit_SVGIcon_FloatingObjectTextWrapType, .dxRichEdit_SVGIcon_Font, .dxRichEdit_SVGIcon_FontColor, .dxRichEdit_SVGIcon_FontLarge, .dxRichEdit_SVGIcon_FontSize, .dxRichEdit_SVGIcon_FontSizeDecrease, .dxRichEdit_SVGIcon_FontSizeIncrease, .dxRichEdit_SVGIcon_Footer, .dxRichEdit_SVGIcon_FullScreen, .dxRichEdit_SVGIcon_GoToFooter, .dxRichEdit_SVGIcon_GoToHeader, .dxRichEdit_SVGIcon_GoToNextHeaderFooter, .dxRichEdit_SVGIcon_GoToPreviousHeaderFooter, .dxRichEdit_SVGIcon_Header, .dxRichEdit_SVGIcon_Highlight, .dxRichEdit_SVGIcon_Hyperlink, .dxRichEdit_SVGIcon_ImagePlaceHolder, .dxRichEdit_SVGIcon_IndentDecrease, .dxRichEdit_SVGIcon_IndentIncrease, .dxRichEdit_SVGIcon_InsertCaption, .dxRichEdit_SVGIcon_InsertColumnBreak, .dxRichEdit_SVGIcon_InsertDataField, .dxRichEdit_SVGIcon_InsertEquationCaption, .dxRichEdit_SVGIcon_InsertFigureCaption, .dxRichEdit_SVGIcon_InsertFloatingObjectImage, .dxRichEdit_SVGIcon_InsertImage, .dxRichEdit_SVGIcon_InsertPageBreak, .dxRichEdit_SVGIcon_InsertPageCount, .dxRichEdit_SVGIcon_InsertPageNumber, .dxRichEdit_SVGIcon_InsertSectionBreakContinuous, .dxRichEdit_SVGIcon_InsertSectionBreakEvenPage, .dxRichEdit_SVGIcon_InsertSectionBreakNextPage, .dxRichEdit_SVGIcon_InsertSectionBreakOddPage, .dxRichEdit_SVGIcon_InsertTable, .dxRichEdit_SVGIcon_InsertTableCaption, .dxRichEdit_SVGIcon_InsertTableCells, .dxRichEdit_SVGIcon_InsertTableColumnsToTheLeft, .dxRichEdit_SVGIcon_InsertTableColumnsToTheRight, .dxRichEdit_SVGIcon_InsertTableOfCaptions, .dxRichEdit_SVGIcon_InsertTableOfContents, .dxRichEdit_SVGIcon_InsertTableOfEquations, .dxRichEdit_SVGIcon_InsertTableOfFigures, .dxRichEdit_SVGIcon_InsertTableRowsAbove, .dxRichEdit_SVGIcon_InsertTableRowsBelow, .dxRichEdit_SVGIcon_InsertTextBox, .dxRichEdit_SVGIcon_Italic, .dxRichEdit_SVGIcon_Language, .dxRichEdit_SVGIcon_Last, .dxRichEdit_SVGIcon_LeftColumns, .dxRichEdit_SVGIcon_LineNumbering, .dxRichEdit_SVGIcon_LineSpacing, .dxRichEdit_SVGIcon_LinkToPrevious, .dxRichEdit_SVGIcon_ListBullets, .dxRichEdit_SVGIcon_ListMultilevel, .dxRichEdit_SVGIcon_ListNumbers, .dxRichEdit_SVGIcon_MailMerge, .dxRichEdit_SVGIcon_MergeTableCells, .dxRichEdit_SVGIcon_ModifyTableStyle, .dxRichEdit_SVGIcon_New, .dxRichEdit_SVGIcon_NewComment, .dxRichEdit_SVGIcon_NewTableStyle, .dxRichEdit_SVGIcon_Next, .dxRichEdit_SVGIcon_NextComment, .dxRichEdit_SVGIcon_Open, .dxRichEdit_SVGIcon_PageColor, .dxRichEdit_SVGIcon_PageMargins, .dxRichEdit_SVGIcon_PageMarginsModerate, .dxRichEdit_SVGIcon_PageMarginsNarrow, .dxRichEdit_SVGIcon_PageMarginsNormal, .dxRichEdit_SVGIcon_PageMarginsWide, .dxRichEdit_SVGIcon_PageOrientation, .dxRichEdit_SVGIcon_PageOrientationLandscape, .dxRichEdit_SVGIcon_PageOrientationPortrait, .dxRichEdit_SVGIcon_PaperSize, .dxRichEdit_SVGIcon_Paragraph, .dxRichEdit_SVGIcon_ParagraphLarge, .dxRichEdit_SVGIcon_Paste, .dxRichEdit_SVGIcon_PasteLarge, .dxRichEdit_SVGIcon_PasteSpecial, .dxRichEdit_SVGIcon_PenColor, .dxRichEdit_SVGIcon_Prev, .dxRichEdit_SVGIcon_Preview, .dxRichEdit_SVGIcon_PreviousComment, .dxRichEdit_SVGIcon_Print, .dxRichEdit_SVGIcon_PrintBrowser, .dxRichEdit_SVGIcon_PrintDialog, .dxRichEdit_SVGIcon_PrintLayoutView, .dxRichEdit_SVGIcon_PrintPreviewBrowser, .dxRichEdit_SVGIcon_ProtectDocument, .dxRichEdit_SVGIcon_Redo, .dxRichEdit_SVGIcon_Replace, .dxRichEdit_SVGIcon_Reviewers, .dxRichEdit_SVGIcon_ReviewingPane, .dxRichEdit_SVGIcon_RightColumns, .dxRichEdit_SVGIcon_RulerHorizontal, .dxRichEdit_SVGIcon_RulerVertical, .dxRichEdit_SVGIcon_Save, .dxRichEdit_SVGIcon_SaveAs, .dxRichEdit_SVGIcon_Select, .dxRichEdit_SVGIcon_SelectAll, .dxRichEdit_SVGIcon_SelectTable, .dxRichEdit_SVGIcon_SelectTableCell, .dxRichEdit_SVGIcon_SelectTableColumn, .dxRichEdit_SVGIcon_SelectTableRow, .dxRichEdit_SVGIcon_Shading, .dxRichEdit_SVGIcon_ShowAllFieldCodes, .dxRichEdit_SVGIcon_ShowAllFieldResults, .dxRichEdit_SVGIcon_ShowComments, .dxRichEdit_SVGIcon_ShowHidden, .dxRichEdit_SVGIcon_SimpleView, .dxRichEdit_SVGIcon_SpacingDecrease, .dxRichEdit_SVGIcon_SpellCheck, .dxRichEdit_SVGIcon_SpellCheckAsYouType, .dxRichEdit_SVGIcon_SplitTable, .dxRichEdit_SVGIcon_SplitTableCells, .dxRichEdit_SVGIcon_Strikeout, .dxRichEdit_SVGIcon_StrikeoutDouble, .dxRichEdit_SVGIcon_Subscript, .dxRichEdit_SVGIcon_Superscript, .dxRichEdit_SVGIcon_Symbol, .dxRichEdit_SVGIcon_TableAutoFitContents, .dxRichEdit_SVGIcon_TableAutoFitWindow, .dxRichEdit_SVGIcon_TableCellMargins, .dxRichEdit_SVGIcon_TableFixedColumnWidth, .dxRichEdit_SVGIcon_TableProperties, .dxRichEdit_SVGIcon_TextWrapBehind, .dxRichEdit_SVGIcon_TextWrapInFrontOfText, .dxRichEdit_SVGIcon_TextWrapInline, .dxRichEdit_SVGIcon_TextWrapSquare, .dxRichEdit_SVGIcon_TextWrapThrough, .dxRichEdit_SVGIcon_TextWrapTight, .dxRichEdit_SVGIcon_TextWrapTopAndBottom, .dxRichEdit_SVGIcon_ToggleFieldCodes, .dxRichEdit_SVGIcon_Underline, .dxRichEdit_SVGIcon_UnderlineDouble, .dxRichEdit_SVGIcon_Undo, .dxRichEdit_SVGIcon_UnprotectDocument, .dxRichEdit_SVGIcon_UpdateField, .dxRichEdit_SVGIcon_UpdateTableOfContents, .dxRichEdit_SVGIcon_ViewMergedData, .dxRichEdit_SVGIcon_ViewTableGridlines, .dxRichEdit_SVGIcon_ZoomIn, .dxRichEdit_SVGIcon_ZoomOut, .dxRichEdit_SVGIcon_AddParagraphToTableOfContentsLarge, .dxRichEdit_SVGIcon_AlignBottomCenterLarge, .dxRichEdit_SVGIcon_AlignBottomLeftLarge, .dxRichEdit_SVGIcon_AlignBottomRightLarge, .dxRichEdit_SVGIcon_AlignCenterLarge, .dxRichEdit_SVGIcon_AlignFloatingObjectBottomCenterLarge, .dxRichEdit_SVGIcon_AlignFloatingObjectBottomLeftLarge, .dxRichEdit_SVGIcon_AlignFloatingObjectBottomRightLarge, .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleCenterLarge, .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleLeftLarge, .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleRightLarge, .dxRichEdit_SVGIcon_AlignFloatingObjectTopCenterLarge, .dxRichEdit_SVGIcon_AlignFloatingObjectTopLeftLarge, .dxRichEdit_SVGIcon_AlignFloatingObjectTopRightLarge, .dxRichEdit_SVGIcon_AlignJustifyLarge, .dxRichEdit_SVGIcon_AlignLeftLarge, .dxRichEdit_SVGIcon_AlignMiddleCenterLarge, .dxRichEdit_SVGIcon_AlignMiddleLeftLarge, .dxRichEdit_SVGIcon_AlignMiddleRightLarge, .dxRichEdit_SVGIcon_AlignRightLarge, .dxRichEdit_SVGIcon_AlignTopCenterLarge, .dxRichEdit_SVGIcon_AlignTopLeftLarge, .dxRichEdit_SVGIcon_AlignTopRightLarge, .dxRichEdit_SVGIcon_BackgroundLarge, .dxRichEdit_SVGIcon_BoldLarge, .dxRichEdit_SVGIcon_BookmarkLarge, .dxRichEdit_SVGIcon_BorderBottomLarge, .dxRichEdit_SVGIcon_BorderInsideHorizontalLarge, .dxRichEdit_SVGIcon_BorderInsideVerticalLarge, .dxRichEdit_SVGIcon_BorderLeftLarge, .dxRichEdit_SVGIcon_BorderNoneLarge, .dxRichEdit_SVGIcon_BorderRightLarge, .dxRichEdit_SVGIcon_BordersAllLarge, .dxRichEdit_SVGIcon_BordersInsideLarge, .dxRichEdit_SVGIcon_BordersOutsideLarge, .dxRichEdit_SVGIcon_BorderTopLarge, .dxRichEdit_SVGIcon_ChangeFontStyleLargeLarge, .dxRichEdit_SVGIcon_ChangeTextCaseLarge, .dxRichEdit_SVGIcon_ClearFormattingLarge, .dxRichEdit_SVGIcon_ClearTableStyleLarge, .dxRichEdit_SVGIcon_CloseHeaderAndFooterLarge, .dxRichEdit_SVGIcon_ColumnOneLarge, .dxRichEdit_SVGIcon_ColumnsLarge, .dxRichEdit_SVGIcon_ColumnsThreeLarge, .dxRichEdit_SVGIcon_ColumnsTwoLarge, .dxRichEdit_SVGIcon_CopyLarge, .dxRichEdit_SVGIcon_CutLarge, .dxRichEdit_SVGIcon_DeleteLarge, .dxRichEdit_SVGIcon_Delete_HyperlinkLarge, .dxRichEdit_SVGIcon_DeleteCommentLarge, .dxRichEdit_SVGIcon_DeleteTableLarge, .dxRichEdit_SVGIcon_DeleteTableCellsLarge, .dxRichEdit_SVGIcon_DeleteTableColumnsLarge, .dxRichEdit_SVGIcon_DeleteTableRowsLarge, .dxRichEdit_SVGIcon_DifferentFirstPageLarge, .dxRichEdit_SVGIcon_DifferentOddEvenPagesLarge, .dxRichEdit_SVGIcon_DraftViewLarge, .dxRichEdit_SVGIcon_EditRangePermissionLarge, .dxRichEdit_SVGIcon_FindLarge, .dxRichEdit_SVGIcon_FindLargeLarge, .dxRichEdit_SVGIcon_FirstLarge, .dxRichEdit_SVGIcon_FloatingObjectAlignmentLarge, .dxRichEdit_SVGIcon_FloatingObjectBringForwardLarge, .dxRichEdit_SVGIcon_FloatingObjectBringInFrontOfTextLarge, .dxRichEdit_SVGIcon_FloatingObjectBringToFrontLarge, .dxRichEdit_SVGIcon_FloatingObjectBringToFrontOfTextLarge, .dxRichEdit_SVGIcon_FloatingObjectLayoutOptionsLarge, .dxRichEdit_SVGIcon_FloatingObjectOutlineColorLarge, .dxRichEdit_SVGIcon_FloatingObjectSendBackwardLarge, .dxRichEdit_SVGIcon_FloatingObjectSendBehindTextLarge, .dxRichEdit_SVGIcon_FloatingObjectSendToBackLarge, .dxRichEdit_SVGIcon_FloatingObjectTextWrapTypeLarge, .dxRichEdit_SVGIcon_FontLarge, .dxRichEdit_SVGIcon_FontColorLarge, .dxRichEdit_SVGIcon_FontLargeLarge, .dxRichEdit_SVGIcon_FontSizeLarge, .dxRichEdit_SVGIcon_FontSizeDecreaseLarge, .dxRichEdit_SVGIcon_FontSizeIncreaseLarge, .dxRichEdit_SVGIcon_FooterLarge, .dxRichEdit_SVGIcon_FullScreenLarge, .dxRichEdit_SVGIcon_GoToFooterLarge, .dxRichEdit_SVGIcon_GoToHeaderLarge, .dxRichEdit_SVGIcon_GoToNextHeaderFooterLarge, .dxRichEdit_SVGIcon_GoToPreviousHeaderFooterLarge, .dxRichEdit_SVGIcon_HeaderLarge, .dxRichEdit_SVGIcon_HighlightLarge, .dxRichEdit_SVGIcon_HyperlinkLarge, .dxRichEdit_SVGIcon_ImagePlaceHolderLarge, .dxRichEdit_SVGIcon_IndentDecreaseLarge, .dxRichEdit_SVGIcon_IndentIncreaseLarge, .dxRichEdit_SVGIcon_InsertCaptionLarge, .dxRichEdit_SVGIcon_InsertColumnBreakLarge, .dxRichEdit_SVGIcon_InsertDataFieldLarge, .dxRichEdit_SVGIcon_InsertEquationCaptionLarge, .dxRichEdit_SVGIcon_InsertFigureCaptionLarge, .dxRichEdit_SVGIcon_InsertFloatingObjectImageLarge, .dxRichEdit_SVGIcon_InsertImageLarge, .dxRichEdit_SVGIcon_InsertPageBreakLarge, .dxRichEdit_SVGIcon_InsertPageCountLarge, .dxRichEdit_SVGIcon_InsertPageNumberLarge, .dxRichEdit_SVGIcon_InsertSectionBreakContinuousLarge, .dxRichEdit_SVGIcon_InsertSectionBreakEvenPageLarge, .dxRichEdit_SVGIcon_InsertSectionBreakNextPageLarge, .dxRichEdit_SVGIcon_InsertSectionBreakOddPageLarge, .dxRichEdit_SVGIcon_InsertTableLarge, .dxRichEdit_SVGIcon_InsertTableCaptionLarge, .dxRichEdit_SVGIcon_InsertTableCellsLarge, .dxRichEdit_SVGIcon_InsertTableColumnsToTheLeftLarge, .dxRichEdit_SVGIcon_InsertTableColumnsToTheRightLarge, .dxRichEdit_SVGIcon_InsertTableOfCaptionsLarge, .dxRichEdit_SVGIcon_InsertTableOfContentsLarge, .dxRichEdit_SVGIcon_InsertTableOfEquationsLarge, .dxRichEdit_SVGIcon_InsertTableOfFiguresLarge, .dxRichEdit_SVGIcon_InsertTableRowsAboveLarge, .dxRichEdit_SVGIcon_InsertTableRowsBelowLarge, .dxRichEdit_SVGIcon_InsertTextBoxLarge, .dxRichEdit_SVGIcon_ItalicLarge, .dxRichEdit_SVGIcon_LanguageLarge, .dxRichEdit_SVGIcon_LastLarge, .dxRichEdit_SVGIcon_LeftColumnsLarge, .dxRichEdit_SVGIcon_LineNumberingLarge, .dxRichEdit_SVGIcon_LineSpacingLarge, .dxRichEdit_SVGIcon_LinkToPreviousLarge, .dxRichEdit_SVGIcon_ListBulletsLarge, .dxRichEdit_SVGIcon_ListMultilevelLarge, .dxRichEdit_SVGIcon_ListNumbersLarge, .dxRichEdit_SVGIcon_MailMergeLarge, .dxRichEdit_SVGIcon_MergeTableCellsLarge, .dxRichEdit_SVGIcon_ModifyTableStyleLarge, .dxRichEdit_SVGIcon_NewLarge, .dxRichEdit_SVGIcon_NewCommentLarge, .dxRichEdit_SVGIcon_NewTableStyleLarge, .dxRichEdit_SVGIcon_NextLarge, .dxRichEdit_SVGIcon_NextCommentLarge, .dxRichEdit_SVGIcon_OpenLarge, .dxRichEdit_SVGIcon_PageColorLarge, .dxRichEdit_SVGIcon_PageMarginsLarge, .dxRichEdit_SVGIcon_PageMarginsModerateLarge, .dxRichEdit_SVGIcon_PageMarginsNarrowLarge, .dxRichEdit_SVGIcon_PageMarginsNormalLarge, .dxRichEdit_SVGIcon_PageMarginsWideLarge, .dxRichEdit_SVGIcon_PageOrientationLarge, .dxRichEdit_SVGIcon_PageOrientationLandscapeLarge, .dxRichEdit_SVGIcon_PageOrientationPortraitLarge, .dxRichEdit_SVGIcon_PaperSizeLarge, .dxRichEdit_SVGIcon_ParagraphLarge, .dxRichEdit_SVGIcon_ParagraphLargeLarge, .dxRichEdit_SVGIcon_PasteLarge, .dxRichEdit_SVGIcon_PasteLargeLarge, .dxRichEdit_SVGIcon_PasteSpecialLarge, .dxRichEdit_SVGIcon_PenColorLarge, .dxRichEdit_SVGIcon_PrevLarge, .dxRichEdit_SVGIcon_PreviewLarge, .dxRichEdit_SVGIcon_PreviousCommentLarge, .dxRichEdit_SVGIcon_PrintLarge, .dxRichEdit_SVGIcon_PrintBrowserLarge, .dxRichEdit_SVGIcon_PrintDialogLarge, .dxRichEdit_SVGIcon_PrintLayoutViewLarge, .dxRichEdit_SVGIcon_PrintPreviewBrowserLarge, .dxRichEdit_SVGIcon_ProtectDocumentLarge, .dxRichEdit_SVGIcon_RedoLarge, .dxRichEdit_SVGIcon_ReplaceLarge, .dxRichEdit_SVGIcon_ReviewersLarge, .dxRichEdit_SVGIcon_ReviewingPaneLarge, .dxRichEdit_SVGIcon_RightColumnsLarge, .dxRichEdit_SVGIcon_RulerHorizontalLarge, .dxRichEdit_SVGIcon_RulerVerticalLarge, .dxRichEdit_SVGIcon_SaveLarge, .dxRichEdit_SVGIcon_SaveAsLarge, .dxRichEdit_SVGIcon_SelectLarge, .dxRichEdit_SVGIcon_SelectAllLarge, .dxRichEdit_SVGIcon_SelectTableLarge, .dxRichEdit_SVGIcon_SelectTableCellLarge, .dxRichEdit_SVGIcon_SelectTableColumnLarge, .dxRichEdit_SVGIcon_SelectTableRowLarge, .dxRichEdit_SVGIcon_ShadingLarge, .dxRichEdit_SVGIcon_ShowAllFieldCodesLarge, .dxRichEdit_SVGIcon_ShowAllFieldResultsLarge, .dxRichEdit_SVGIcon_ShowCommentsLarge, .dxRichEdit_SVGIcon_ShowHiddenLarge, .dxRichEdit_SVGIcon_SimpleViewLarge, .dxRichEdit_SVGIcon_SpacingDecreaseLarge, .dxRichEdit_SVGIcon_SpellCheckLarge, .dxRichEdit_SVGIcon_SpellCheckAsYouTypeLarge, .dxRichEdit_SVGIcon_SplitTableLarge, .dxRichEdit_SVGIcon_SplitTableCellsLarge, .dxRichEdit_SVGIcon_StrikeoutLarge, .dxRichEdit_SVGIcon_StrikeoutDoubleLarge, .dxRichEdit_SVGIcon_SubscriptLarge, .dxRichEdit_SVGIcon_SuperscriptLarge, .dxRichEdit_SVGIcon_SymbolLarge, .dxRichEdit_SVGIcon_TableAutoFitContentsLarge, .dxRichEdit_SVGIcon_TableAutoFitWindowLarge, .dxRichEdit_SVGIcon_TableCellMarginsLarge, .dxRichEdit_SVGIcon_TableFixedColumnWidthLarge, .dxRichEdit_SVGIcon_TablePropertiesLarge, .dxRichEdit_SVGIcon_TextWrapBehindLarge, .dxRichEdit_SVGIcon_TextWrapInFrontOfTextLarge, .dxRichEdit_SVGIcon_TextWrapInlineLarge, .dxRichEdit_SVGIcon_TextWrapSquareLarge, .dxRichEdit_SVGIcon_TextWrapThroughLarge, .dxRichEdit_SVGIcon_TextWrapTightLarge, .dxRichEdit_SVGIcon_TextWrapTopAndBottomLarge, .dxRichEdit_SVGIcon_ToggleFieldCodesLarge, .dxRichEdit_SVGIcon_UnderlineLarge, .dxRichEdit_SVGIcon_UnderlineDoubleLarge, .dxRichEdit_SVGIcon_UndoLarge, .dxRichEdit_SVGIcon_UnprotectDocumentLarge, .dxRichEdit_SVGIcon_UpdateFieldLarge, .dxRichEdit_SVGIcon_UpdateTableOfContentsLarge, .dxRichEdit_SVGIcon_ViewMergedDataLarge, .dxRichEdit_SVGIcon_ViewTableGridlinesLarge, .dxRichEdit_SVGIcon_ZoomInLarge, .dxRichEdit_SVGIcon_ZoomOutLarge, .dxRichEdit_SVGIcon_AddParagraphToTableOfContentsLargeDisabled, .dxRichEdit_SVGIcon_AlignBottomCenterLargeDisabled, .dxRichEdit_SVGIcon_AlignBottomLeftLargeDisabled, .dxRichEdit_SVGIcon_AlignBottomRightLargeDisabled, .dxRichEdit_SVGIcon_AlignCenterLargeDisabled, .dxRichEdit_SVGIcon_AlignFloatingObjectBottomCenterLargeDisabled, .dxRichEdit_SVGIcon_AlignFloatingObjectBottomLeftLargeDisabled, .dxRichEdit_SVGIcon_AlignFloatingObjectBottomRightLargeDisabled, .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleCenterLargeDisabled, .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleLeftLargeDisabled, .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleRightLargeDisabled, .dxRichEdit_SVGIcon_AlignFloatingObjectTopCenterLargeDisabled, .dxRichEdit_SVGIcon_AlignFloatingObjectTopLeftLargeDisabled, .dxRichEdit_SVGIcon_AlignFloatingObjectTopRightLargeDisabled, .dxRichEdit_SVGIcon_AlignJustifyLargeDisabled, .dxRichEdit_SVGIcon_AlignLeftLargeDisabled, .dxRichEdit_SVGIcon_AlignMiddleCenterLargeDisabled, .dxRichEdit_SVGIcon_AlignMiddleLeftLargeDisabled, .dxRichEdit_SVGIcon_AlignMiddleRightLargeDisabled, .dxRichEdit_SVGIcon_AlignRightLargeDisabled, .dxRichEdit_SVGIcon_AlignTopCenterLargeDisabled, .dxRichEdit_SVGIcon_AlignTopLeftLargeDisabled, .dxRichEdit_SVGIcon_AlignTopRightLargeDisabled, .dxRichEdit_SVGIcon_BackgroundLargeDisabled, .dxRichEdit_SVGIcon_BoldLargeDisabled, .dxRichEdit_SVGIcon_BookmarkLargeDisabled, .dxRichEdit_SVGIcon_BorderBottomLargeDisabled, .dxRichEdit_SVGIcon_BorderInsideHorizontalLargeDisabled, .dxRichEdit_SVGIcon_BorderInsideVerticalLargeDisabled, .dxRichEdit_SVGIcon_BorderLeftLargeDisabled, .dxRichEdit_SVGIcon_BorderNoneLargeDisabled, .dxRichEdit_SVGIcon_BorderRightLargeDisabled, .dxRichEdit_SVGIcon_BordersAllLargeDisabled, .dxRichEdit_SVGIcon_BordersInsideLargeDisabled, .dxRichEdit_SVGIcon_BordersOutsideLargeDisabled, .dxRichEdit_SVGIcon_BorderTopLargeDisabled, .dxRichEdit_SVGIcon_ChangeFontStyleLargeLargeDisabled, .dxRichEdit_SVGIcon_ChangeTextCaseLargeDisabled, .dxRichEdit_SVGIcon_ClearFormattingLargeDisabled, .dxRichEdit_SVGIcon_ClearTableStyleLargeDisabled, .dxRichEdit_SVGIcon_CloseHeaderAndFooterLargeDisabled, .dxRichEdit_SVGIcon_ColumnOneLargeDisabled, .dxRichEdit_SVGIcon_ColumnsLargeDisabled, .dxRichEdit_SVGIcon_ColumnsThreeLargeDisabled, .dxRichEdit_SVGIcon_ColumnsTwoLargeDisabled, .dxRichEdit_SVGIcon_CopyLargeDisabled, .dxRichEdit_SVGIcon_CutLargeDisabled, .dxRichEdit_SVGIcon_DeleteLargeDisabled, .dxRichEdit_SVGIcon_Delete_HyperlinkLargeDisabled, .dxRichEdit_SVGIcon_DeleteCommentLargeDisabled, .dxRichEdit_SVGIcon_DeleteTableLargeDisabled, .dxRichEdit_SVGIcon_DeleteTableCellsLargeDisabled, .dxRichEdit_SVGIcon_DeleteTableColumnsLargeDisabled, .dxRichEdit_SVGIcon_DeleteTableRowsLargeDisabled, .dxRichEdit_SVGIcon_DifferentFirstPageLargeDisabled, .dxRichEdit_SVGIcon_DifferentOddEvenPagesLargeDisabled, .dxRichEdit_SVGIcon_DraftViewLargeDisabled, .dxRichEdit_SVGIcon_EditRangePermissionLargeDisabled, .dxRichEdit_SVGIcon_FindLargeDisabled, .dxRichEdit_SVGIcon_FindLargeLargeDisabled, .dxRichEdit_SVGIcon_FirstLargeDisabled, .dxRichEdit_SVGIcon_FloatingObjectAlignmentLargeDisabled, .dxRichEdit_SVGIcon_FloatingObjectBringForwardLargeDisabled, .dxRichEdit_SVGIcon_FloatingObjectBringInFrontOfTextLargeDisabled, .dxRichEdit_SVGIcon_FloatingObjectBringToFrontLargeDisabled, .dxRichEdit_SVGIcon_FloatingObjectBringToFrontOfTextLargeDisabled, .dxRichEdit_SVGIcon_FloatingObjectLayoutOptionsLargeDisabled, .dxRichEdit_SVGIcon_FloatingObjectOutlineColorLargeDisabled, .dxRichEdit_SVGIcon_FloatingObjectSendBackwardLargeDisabled, .dxRichEdit_SVGIcon_FloatingObjectSendBehindTextLargeDisabled, .dxRichEdit_SVGIcon_FloatingObjectSendToBackLargeDisabled, .dxRichEdit_SVGIcon_FloatingObjectTextWrapTypeLargeDisabled, .dxRichEdit_SVGIcon_FontLargeDisabled, .dxRichEdit_SVGIcon_FontColorLargeDisabled, .dxRichEdit_SVGIcon_FontLargeLargeDisabled, .dxRichEdit_SVGIcon_FontSizeLargeDisabled, .dxRichEdit_SVGIcon_FontSizeDecreaseLargeDisabled, .dxRichEdit_SVGIcon_FontSizeIncreaseLargeDisabled, .dxRichEdit_SVGIcon_FooterLargeDisabled, .dxRichEdit_SVGIcon_FullScreenLargeDisabled, .dxRichEdit_SVGIcon_GoToFooterLargeDisabled, .dxRichEdit_SVGIcon_GoToHeaderLargeDisabled, .dxRichEdit_SVGIcon_GoToNextHeaderFooterLargeDisabled, .dxRichEdit_SVGIcon_GoToPreviousHeaderFooterLargeDisabled, .dxRichEdit_SVGIcon_HeaderLargeDisabled, .dxRichEdit_SVGIcon_HighlightLargeDisabled, .dxRichEdit_SVGIcon_HyperlinkLargeDisabled, .dxRichEdit_SVGIcon_ImagePlaceHolderLargeDisabled, .dxRichEdit_SVGIcon_IndentDecreaseLargeDisabled, .dxRichEdit_SVGIcon_IndentIncreaseLargeDisabled, .dxRichEdit_SVGIcon_InsertCaptionLargeDisabled, .dxRichEdit_SVGIcon_InsertColumnBreakLargeDisabled, .dxRichEdit_SVGIcon_InsertDataFieldLargeDisabled, .dxRichEdit_SVGIcon_InsertEquationCaptionLargeDisabled, .dxRichEdit_SVGIcon_InsertFigureCaptionLargeDisabled, .dxRichEdit_SVGIcon_InsertFloatingObjectImageLargeDisabled, .dxRichEdit_SVGIcon_InsertImageLargeDisabled, .dxRichEdit_SVGIcon_InsertPageBreakLargeDisabled, .dxRichEdit_SVGIcon_InsertPageCountLargeDisabled, .dxRichEdit_SVGIcon_InsertPageNumberLargeDisabled, .dxRichEdit_SVGIcon_InsertSectionBreakContinuousLargeDisabled, .dxRichEdit_SVGIcon_InsertSectionBreakEvenPageLargeDisabled, .dxRichEdit_SVGIcon_InsertSectionBreakNextPageLargeDisabled, .dxRichEdit_SVGIcon_InsertSectionBreakOddPageLargeDisabled, .dxRichEdit_SVGIcon_InsertTableLargeDisabled, .dxRichEdit_SVGIcon_InsertTableCaptionLargeDisabled, .dxRichEdit_SVGIcon_InsertTableCellsLargeDisabled, .dxRichEdit_SVGIcon_InsertTableColumnsToTheLeftLargeDisabled, .dxRichEdit_SVGIcon_InsertTableColumnsToTheRightLargeDisabled, .dxRichEdit_SVGIcon_InsertTableOfCaptionsLargeDisabled, .dxRichEdit_SVGIcon_InsertTableOfContentsLargeDisabled, .dxRichEdit_SVGIcon_InsertTableOfEquationsLargeDisabled, .dxRichEdit_SVGIcon_InsertTableOfFiguresLargeDisabled, .dxRichEdit_SVGIcon_InsertTableRowsAboveLargeDisabled, .dxRichEdit_SVGIcon_InsertTableRowsBelowLargeDisabled, .dxRichEdit_SVGIcon_InsertTextBoxLargeDisabled, .dxRichEdit_SVGIcon_ItalicLargeDisabled, .dxRichEdit_SVGIcon_LanguageLargeDisabled, .dxRichEdit_SVGIcon_LastLargeDisabled, .dxRichEdit_SVGIcon_LeftColumnsLargeDisabled, .dxRichEdit_SVGIcon_LineNumberingLargeDisabled, .dxRichEdit_SVGIcon_LineSpacingLargeDisabled, .dxRichEdit_SVGIcon_LinkToPreviousLargeDisabled, .dxRichEdit_SVGIcon_ListBulletsLargeDisabled, .dxRichEdit_SVGIcon_ListMultilevelLargeDisabled, .dxRichEdit_SVGIcon_ListNumbersLargeDisabled, .dxRichEdit_SVGIcon_MailMergeLargeDisabled, .dxRichEdit_SVGIcon_MergeTableCellsLargeDisabled, .dxRichEdit_SVGIcon_ModifyTableStyleLargeDisabled, .dxRichEdit_SVGIcon_NewLargeDisabled, .dxRichEdit_SVGIcon_NewCommentLargeDisabled, .dxRichEdit_SVGIcon_NewTableStyleLargeDisabled, .dxRichEdit_SVGIcon_NextLargeDisabled, .dxRichEdit_SVGIcon_NextCommentLargeDisabled, .dxRichEdit_SVGIcon_OpenLargeDisabled, .dxRichEdit_SVGIcon_PageColorLargeDisabled, .dxRichEdit_SVGIcon_PageMarginsLargeDisabled, .dxRichEdit_SVGIcon_PageMarginsModerateLargeDisabled, .dxRichEdit_SVGIcon_PageMarginsNarrowLargeDisabled, .dxRichEdit_SVGIcon_PageMarginsNormalLargeDisabled, .dxRichEdit_SVGIcon_PageMarginsWideLargeDisabled, .dxRichEdit_SVGIcon_PageOrientationLargeDisabled, .dxRichEdit_SVGIcon_PageOrientationLandscapeLargeDisabled, .dxRichEdit_SVGIcon_PageOrientationPortraitLargeDisabled, .dxRichEdit_SVGIcon_PaperSizeLargeDisabled, .dxRichEdit_SVGIcon_ParagraphLargeDisabled, .dxRichEdit_SVGIcon_ParagraphLargeLargeDisabled, .dxRichEdit_SVGIcon_PasteLargeDisabled, .dxRichEdit_SVGIcon_PasteLargeLargeDisabled, .dxRichEdit_SVGIcon_PasteSpecialLargeDisabled, .dxRichEdit_SVGIcon_PenColorLargeDisabled, .dxRichEdit_SVGIcon_PrevLargeDisabled, .dxRichEdit_SVGIcon_PreviewLargeDisabled, .dxRichEdit_SVGIcon_PreviousCommentLargeDisabled, .dxRichEdit_SVGIcon_PrintLargeDisabled, .dxRichEdit_SVGIcon_PrintBrowserLargeDisabled, .dxRichEdit_SVGIcon_PrintDialogLargeDisabled, .dxRichEdit_SVGIcon_PrintLayoutViewLargeDisabled, .dxRichEdit_SVGIcon_PrintPreviewBrowserLargeDisabled, .dxRichEdit_SVGIcon_ProtectDocumentLargeDisabled, .dxRichEdit_SVGIcon_RedoLargeDisabled, .dxRichEdit_SVGIcon_ReplaceLargeDisabled, .dxRichEdit_SVGIcon_ReviewersLargeDisabled, .dxRichEdit_SVGIcon_ReviewingPaneLargeDisabled, .dxRichEdit_SVGIcon_RightColumnsLargeDisabled, .dxRichEdit_SVGIcon_RulerHorizontalLargeDisabled, .dxRichEdit_SVGIcon_RulerVerticalLargeDisabled, .dxRichEdit_SVGIcon_SaveLargeDisabled, .dxRichEdit_SVGIcon_SaveAsLargeDisabled, .dxRichEdit_SVGIcon_SelectLargeDisabled, .dxRichEdit_SVGIcon_SelectAllLargeDisabled, .dxRichEdit_SVGIcon_SelectTableLargeDisabled, .dxRichEdit_SVGIcon_SelectTableCellLargeDisabled, .dxRichEdit_SVGIcon_SelectTableColumnLargeDisabled, .dxRichEdit_SVGIcon_SelectTableRowLargeDisabled, .dxRichEdit_SVGIcon_ShadingLargeDisabled, .dxRichEdit_SVGIcon_ShowAllFieldCodesLargeDisabled, .dxRichEdit_SVGIcon_ShowAllFieldResultsLargeDisabled, .dxRichEdit_SVGIcon_ShowCommentsLargeDisabled, .dxRichEdit_SVGIcon_ShowHiddenLargeDisabled, .dxRichEdit_SVGIcon_SimpleViewLargeDisabled, .dxRichEdit_SVGIcon_SpacingDecreaseLargeDisabled, .dxRichEdit_SVGIcon_SpellCheckLargeDisabled, .dxRichEdit_SVGIcon_SpellCheckAsYouTypeLargeDisabled, .dxRichEdit_SVGIcon_SplitTableLargeDisabled, .dxRichEdit_SVGIcon_SplitTableCellsLargeDisabled, .dxRichEdit_SVGIcon_StrikeoutLargeDisabled, .dxRichEdit_SVGIcon_StrikeoutDoubleLargeDisabled, .dxRichEdit_SVGIcon_SubscriptLargeDisabled, .dxRichEdit_SVGIcon_SuperscriptLargeDisabled, .dxRichEdit_SVGIcon_SymbolLargeDisabled, .dxRichEdit_SVGIcon_TableAutoFitContentsLargeDisabled, .dxRichEdit_SVGIcon_TableAutoFitWindowLargeDisabled, .dxRichEdit_SVGIcon_TableCellMarginsLargeDisabled, .dxRichEdit_SVGIcon_TableFixedColumnWidthLargeDisabled, .dxRichEdit_SVGIcon_TablePropertiesLargeDisabled, .dxRichEdit_SVGIcon_TextWrapBehindLargeDisabled, .dxRichEdit_SVGIcon_TextWrapInFrontOfTextLargeDisabled, .dxRichEdit_SVGIcon_TextWrapInlineLargeDisabled, .dxRichEdit_SVGIcon_TextWrapSquareLargeDisabled, .dxRichEdit_SVGIcon_TextWrapThroughLargeDisabled, .dxRichEdit_SVGIcon_TextWrapTightLargeDisabled, .dxRichEdit_SVGIcon_TextWrapTopAndBottomLargeDisabled, .dxRichEdit_SVGIcon_ToggleFieldCodesLargeDisabled, .dxRichEdit_SVGIcon_UnderlineLargeDisabled, .dxRichEdit_SVGIcon_UnderlineDoubleLargeDisabled, .dxRichEdit_SVGIcon_UndoLargeDisabled, .dxRichEdit_SVGIcon_UnprotectDocumentLargeDisabled, .dxRichEdit_SVGIcon_UpdateFieldLargeDisabled, .dxRichEdit_SVGIcon_UpdateTableOfContentsLargeDisabled, .dxRichEdit_SVGIcon_ViewMergedDataLargeDisabled, .dxRichEdit_SVGIcon_ViewTableGridlinesLargeDisabled, .dxRichEdit_SVGIcon_ZoomInLargeDisabled, .dxRichEdit_SVGIcon_ZoomOutLargeDisabled,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AddParagraphToTableOfContents,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignBottomCenter,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignBottomLeft,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignBottomRight,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignCenter,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectBottomCenter,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectBottomLeft,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectBottomRight,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleCenter,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleLeft,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleRight,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectTopCenter,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectTopLeft,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectTopRight,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignJustify,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignLeft,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignMiddleCenter,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignMiddleLeft,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignMiddleRight,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignRight,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignTopCenter,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignTopLeft,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignTopRight,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Background,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Bold,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Bookmark,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderBottom,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderInsideHorizontal,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderInsideVertical,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderLeft,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderNone,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderRight,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BordersAll,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BordersInside,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BordersOutside,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderTop,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ChangeFontStyleLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ChangeTextCase,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ClearFormatting,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ClearTableStyle,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_CloseHeaderAndFooter,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ColumnOne,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Columns,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ColumnsThree,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ColumnsTwo,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Copy,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Cut,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Delete,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Delete_Hyperlink,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DeleteComment,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DeleteTable,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DeleteTableCells,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DeleteTableColumns,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DeleteTableRows,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DifferentFirstPage,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DifferentOddEvenPages,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DraftView,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_EditRangePermission,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Find,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FindLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_First,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectAlignment,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectBringForward,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectBringInFrontOfText,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectBringToFront,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectBringToFrontOfText,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectLayoutOptions,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectOutlineColor,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectSendBackward,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectSendBehindText,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectSendToBack,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectTextWrapType,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Font,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FontColor,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FontLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FontSize,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FontSizeDecrease,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FontSizeIncrease,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Footer,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FullScreen,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_GoToFooter,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_GoToHeader,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_GoToNextHeaderFooter,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_GoToPreviousHeaderFooter,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Header,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Highlight,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Hyperlink,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ImagePlaceHolder,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_IndentDecrease,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_IndentIncrease,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertCaption,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertColumnBreak,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertDataField,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertEquationCaption,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertFigureCaption,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertFloatingObjectImage,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertImage,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertPageBreak,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertPageCount,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertPageNumber,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertSectionBreakContinuous,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertSectionBreakEvenPage,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertSectionBreakNextPage,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertSectionBreakOddPage,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTable,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableCaption,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableCells,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableColumnsToTheLeft,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableColumnsToTheRight,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableOfCaptions,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableOfContents,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableOfEquations,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableOfFigures,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableRowsAbove,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableRowsBelow,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTextBox,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Italic,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Language,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Last,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_LeftColumns,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_LineNumbering,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_LineSpacing,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_LinkToPrevious,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ListBullets,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ListMultilevel,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ListNumbers,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_MailMerge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_MergeTableCells,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ModifyTableStyle,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_New,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_NewComment,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_NewTableStyle,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Next,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_NextComment,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Open,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageColor,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageMargins,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageMarginsModerate,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageMarginsNarrow,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageMarginsNormal,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageMarginsWide,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageOrientation,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageOrientationLandscape,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageOrientationPortrait,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PaperSize,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Paragraph,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ParagraphLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Paste,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PasteLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PasteSpecial,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PenColor,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Prev,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Preview,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PreviousComment,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Print,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PrintBrowser,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PrintDialog,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PrintLayoutView,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PrintPreviewBrowser,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ProtectDocument,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Redo,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Replace,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Reviewers,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ReviewingPane,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_RightColumns,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_RulerHorizontal,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_RulerVertical,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Save,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SaveAs,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Select,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SelectAll,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SelectTable,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SelectTableCell,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SelectTableColumn,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SelectTableRow,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Shading,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ShowAllFieldCodes,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ShowAllFieldResults,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ShowComments,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ShowHidden,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SimpleView,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SpacingDecrease,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SpellCheck,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SpellCheckAsYouType,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SplitTable,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SplitTableCells,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Strikeout,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_StrikeoutDouble,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Subscript,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Superscript,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Symbol,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TableAutoFitContents,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TableAutoFitWindow,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TableCellMargins,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TableFixedColumnWidth,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TableProperties,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapBehind,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapInFrontOfText,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapInline,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapSquare,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapThrough,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapTight,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapTopAndBottom,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ToggleFieldCodes,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Underline,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_UnderlineDouble,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Undo,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_UnprotectDocument,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_UpdateField,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_UpdateTableOfContents,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ViewMergedData,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ViewTableGridlines,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ZoomIn,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ZoomOut,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AddParagraphToTableOfContentsLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignBottomCenterLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignBottomLeftLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignBottomRightLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignCenterLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectBottomCenterLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectBottomLeftLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectBottomRightLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleCenterLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleLeftLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleRightLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectTopCenterLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectTopLeftLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectTopRightLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignJustifyLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignLeftLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignMiddleCenterLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignMiddleLeftLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignMiddleRightLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignRightLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignTopCenterLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignTopLeftLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignTopRightLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BackgroundLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BoldLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BookmarkLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderBottomLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderInsideHorizontalLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderInsideVerticalLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderLeftLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderNoneLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderRightLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BordersAllLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BordersInsideLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BordersOutsideLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderTopLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ChangeFontStyleLargeLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ChangeTextCaseLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ClearFormattingLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ClearTableStyleLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_CloseHeaderAndFooterLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ColumnOneLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ColumnsLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ColumnsThreeLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ColumnsTwoLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_CopyLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_CutLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DeleteLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Delete_HyperlinkLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DeleteCommentLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DeleteTableLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DeleteTableCellsLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DeleteTableColumnsLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DeleteTableRowsLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DifferentFirstPageLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DifferentOddEvenPagesLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DraftViewLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_EditRangePermissionLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FindLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FindLargeLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FirstLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectAlignmentLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectBringForwardLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectBringInFrontOfTextLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectBringToFrontLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectBringToFrontOfTextLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectLayoutOptionsLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectOutlineColorLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectSendBackwardLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectSendBehindTextLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectSendToBackLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectTextWrapTypeLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FontLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FontColorLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FontLargeLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FontSizeLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FontSizeDecreaseLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FontSizeIncreaseLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FooterLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FullScreenLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_GoToFooterLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_GoToHeaderLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_GoToNextHeaderFooterLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_GoToPreviousHeaderFooterLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_HeaderLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_HighlightLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_HyperlinkLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ImagePlaceHolderLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_IndentDecreaseLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_IndentIncreaseLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertCaptionLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertColumnBreakLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertDataFieldLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertEquationCaptionLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertFigureCaptionLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertFloatingObjectImageLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertImageLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertPageBreakLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertPageCountLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertPageNumberLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertSectionBreakContinuousLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertSectionBreakEvenPageLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertSectionBreakNextPageLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertSectionBreakOddPageLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableCaptionLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableCellsLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableColumnsToTheLeftLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableColumnsToTheRightLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableOfCaptionsLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableOfContentsLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableOfEquationsLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableOfFiguresLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableRowsAboveLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableRowsBelowLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTextBoxLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ItalicLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_LanguageLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_LastLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_LeftColumnsLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_LineNumberingLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_LineSpacingLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_LinkToPreviousLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ListBulletsLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ListMultilevelLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ListNumbersLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_MailMergeLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_MergeTableCellsLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ModifyTableStyleLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_NewLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_NewCommentLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_NewTableStyleLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_NextLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_NextCommentLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_OpenLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageColorLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageMarginsLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageMarginsModerateLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageMarginsNarrowLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageMarginsNormalLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageMarginsWideLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageOrientationLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageOrientationLandscapeLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageOrientationPortraitLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PaperSizeLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ParagraphLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ParagraphLargeLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PasteLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PasteLargeLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PasteSpecialLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PenColorLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PrevLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PreviewLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PreviousCommentLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PrintLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PrintBrowserLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PrintDialogLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PrintLayoutViewLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PrintPreviewBrowserLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ProtectDocumentLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_RedoLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ReplaceLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ReviewersLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ReviewingPaneLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_RightColumnsLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_RulerHorizontalLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_RulerVerticalLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SaveLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SaveAsLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SelectLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SelectAllLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SelectTableLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SelectTableCellLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SelectTableColumnLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SelectTableRowLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ShadingLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ShowAllFieldCodesLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ShowAllFieldResultsLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ShowCommentsLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ShowHiddenLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SimpleViewLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SpacingDecreaseLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SpellCheckLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SpellCheckAsYouTypeLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SplitTableLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SplitTableCellsLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_StrikeoutLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_StrikeoutDoubleLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SubscriptLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SuperscriptLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SymbolLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TableAutoFitContentsLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TableAutoFitWindowLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TableCellMarginsLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TableFixedColumnWidthLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TablePropertiesLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapBehindLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapInFrontOfTextLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapInlineLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapSquareLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapThroughLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapTightLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapTopAndBottomLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ToggleFieldCodesLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_UnderlineLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_UnderlineDoubleLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_UndoLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_UnprotectDocumentLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_UpdateFieldLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_UpdateTableOfContentsLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ViewMergedDataLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ViewTableGridlinesLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ZoomInLarge,  .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ZoomOutLarge { background-image: url('<%=WebResource("DevExpress.Web.ASPxRichEdit.Images.WTSVGSprite.svg")%>'); background-repeat: no-repeat; background-color: transparent } 
.dxIE .dx-acc-r .dxRichEdit_SVGIcon_AddParagraphToTableOfContents::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignBottomCenter::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignBottomLeft::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignBottomRight::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignCenter::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignFloatingObjectBottomCenter::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignFloatingObjectBottomLeft::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignFloatingObjectBottomRight::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleCenter::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleLeft::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleRight::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignFloatingObjectTopCenter::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignFloatingObjectTopLeft::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignFloatingObjectTopRight::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignJustify::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignLeft::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignMiddleCenter::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignMiddleLeft::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignMiddleRight::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignRight::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignTopCenter::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignTopLeft::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_AlignTopRight::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Background::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Bold::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Bookmark::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_BorderBottom::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_BorderInsideHorizontal::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_BorderInsideVertical::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_BorderLeft::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_BorderNone::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_BorderRight::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_BordersAll::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_BordersInside::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_BordersOutside::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_BorderTop::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ChangeFontStyleLarge::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ChangeTextCase::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ClearFormatting::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ClearTableStyle::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_CloseHeaderAndFooter::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ColumnOne::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Columns::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ColumnsThree::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ColumnsTwo::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Copy::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Cut::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Delete::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Delete_Hyperlink::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_DeleteComment::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_DeleteTable::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_DeleteTableCells::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_DeleteTableColumns::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_DeleteTableRows::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_DifferentFirstPage::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_DifferentOddEvenPages::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_DraftView::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_EditRangePermission::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Find::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FindLarge::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_First::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FloatingObjectAlignment::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FloatingObjectBringForward::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FloatingObjectBringInFrontOfText::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FloatingObjectBringToFront::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FloatingObjectBringToFrontOfText::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FloatingObjectLayoutOptions::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FloatingObjectOutlineColor::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FloatingObjectSendBackward::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FloatingObjectSendBehindText::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FloatingObjectSendToBack::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FloatingObjectTextWrapType::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Font::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FontColor::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FontLarge::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FontSize::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FontSizeDecrease::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FontSizeIncrease::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Footer::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_FullScreen::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_GoToFooter::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_GoToHeader::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_GoToNextHeaderFooter::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_GoToPreviousHeaderFooter::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Header::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Highlight::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Hyperlink::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ImagePlaceHolder::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_IndentDecrease::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_IndentIncrease::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertCaption::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertColumnBreak::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertDataField::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertEquationCaption::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertFigureCaption::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertFloatingObjectImage::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertImage::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertPageBreak::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertPageCount::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertPageNumber::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertSectionBreakContinuous::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertSectionBreakEvenPage::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertSectionBreakNextPage::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertSectionBreakOddPage::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTable::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTableCaption::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTableCells::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTableColumnsToTheLeft::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTableColumnsToTheRight::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTableOfCaptions::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTableOfContents::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTableOfEquations::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTableOfFigures::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTableRowsAbove::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTableRowsBelow::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_InsertTextBox::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Italic::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Language::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Last::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_LeftColumns::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_LineNumbering::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_LineSpacing::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_LinkToPrevious::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ListBullets::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ListMultilevel::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ListNumbers::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_MailMerge::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_MergeTableCells::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ModifyTableStyle::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_New::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_NewComment::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_NewTableStyle::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Next::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_NextComment::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Open::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PageColor::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PageMargins::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PageMarginsModerate::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PageMarginsNarrow::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PageMarginsNormal::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PageMarginsWide::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PageOrientation::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PageOrientationLandscape::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PageOrientationPortrait::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PaperSize::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Paragraph::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ParagraphLarge::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Paste::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PasteLarge::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PasteSpecial::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PenColor::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Prev::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Preview::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PreviousComment::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Print::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PrintBrowser::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PrintDialog::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PrintLayoutView::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_PrintPreviewBrowser::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ProtectDocument::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Redo::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Replace::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Reviewers::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ReviewingPane::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_RightColumns::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_RulerHorizontal::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_RulerVertical::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Save::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SaveAs::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Select::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SelectAll::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SelectTable::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SelectTableCell::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SelectTableColumn::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SelectTableRow::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Shading::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ShowAllFieldCodes::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ShowAllFieldResults::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ShowComments::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ShowHidden::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SimpleView::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SpacingDecrease::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SpellCheck::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SpellCheckAsYouType::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SplitTable::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_SplitTableCells::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Strikeout::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_StrikeoutDouble::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Subscript::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Superscript::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Symbol::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TableAutoFitContents::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TableAutoFitWindow::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TableCellMargins::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TableFixedColumnWidth::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TableProperties::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TextWrapBehind::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TextWrapInFrontOfText::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TextWrapInline::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TextWrapSquare::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TextWrapThrough::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TextWrapTight::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_TextWrapTopAndBottom::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ToggleFieldCodes::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Underline::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_UnderlineDouble::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_Undo::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_UnprotectDocument::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_UpdateField::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_UpdateTableOfContents::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ViewMergedData::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ViewTableGridlines::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ZoomIn::before, .dxIE .dx-acc-r .dxRichEdit_SVGIcon_ZoomOut::before { width: 538px } 
.dxRichEdit_SVGIcon_AddParagraphToTableOfContents { background-position: 0.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AddParagraphToTableOfContentsDisabled { background-position: 0.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AddParagraphToTableOfContentsLarge { background-position: 0px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AddParagraphToTableOfContentsLargeDisabled { background-position: 0px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AddParagraphToTableOfContents { background-position: 0.0px -255.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AddParagraphToTableOfContentsLarge { background-position: 0px -510px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignBottomCenter { background-position: -221.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignBottomCenterDisabled { background-position: -221.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignBottomCenterLarge { background-position: -442px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignBottomCenterLargeDisabled { background-position: -442px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignBottomCenter { background-position: -221.0px -323.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignBottomCenterLarge { background-position: -442px -646px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignBottomLeft { background-position: -17.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignBottomLeftDisabled { background-position: -17.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignBottomLeftLarge { background-position: -34px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignBottomLeftLargeDisabled { background-position: -34px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignBottomLeft { background-position: -17.0px -408.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignBottomLeftLarge { background-position: -34px -816px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignBottomRight { background-position: -51.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignBottomRightDisabled { background-position: -51.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignBottomRightLarge { background-position: -102px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignBottomRightLargeDisabled { background-position: -102px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignBottomRight { background-position: -51.0px -306.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignBottomRightLarge { background-position: -102px -612px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignCenter { background-position: -34.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignCenterDisabled { background-position: -34.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignCenterLarge { background-position: -68px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignCenterLargeDisabled { background-position: -68px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignCenter { background-position: -34.0px -306.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignCenterLarge { background-position: -68px -612px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomCenter { background-position: -17.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomCenterDisabled { background-position: -17.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomCenterLarge { background-position: -34px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomCenterLargeDisabled { background-position: -34px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectBottomCenter { background-position: -17.0px -306.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectBottomCenterLarge { background-position: -34px -612px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomLeft { background-position: -170.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomLeftDisabled { background-position: -170.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomLeftLarge { background-position: -340px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomLeftLargeDisabled { background-position: -340px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectBottomLeft { background-position: -170.0px -272.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectBottomLeftLarge { background-position: -340px -544px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomRight { background-position: -17.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomRightDisabled { background-position: -17.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomRightLarge { background-position: -34px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectBottomRightLargeDisabled { background-position: -34px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectBottomRight { background-position: -17.0px -272.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectBottomRightLarge { background-position: -34px -544px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleCenter { background-position: -34.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleCenterDisabled { background-position: -34.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleCenterLarge { background-position: -68px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleCenterLargeDisabled { background-position: -68px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleCenter { background-position: -34.0px -272.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleCenterLarge { background-position: -68px -544px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleLeft { background-position: -51.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleLeftDisabled { background-position: -51.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleLeftLarge { background-position: -102px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleLeftLargeDisabled { background-position: -102px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleLeft { background-position: -51.0px -272.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleLeftLarge { background-position: -102px -544px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleRight { background-position: -68.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleRightDisabled { background-position: -68.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleRightLarge { background-position: -136px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectMiddleRightLargeDisabled { background-position: -136px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleRight { background-position: -68.0px -272.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectMiddleRightLarge { background-position: -136px -544px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopCenter { background-position: -85.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopCenterDisabled { background-position: -85.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopCenterLarge { background-position: -170px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopCenterLargeDisabled { background-position: -170px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectTopCenter { background-position: -85.0px -272.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectTopCenterLarge { background-position: -170px -544px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopLeft { background-position: -102.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopLeftDisabled { background-position: -102.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopLeftLarge { background-position: -204px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopLeftLargeDisabled { background-position: -204px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectTopLeft { background-position: -102.0px -272.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectTopLeftLarge { background-position: -204px -544px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopRight { background-position: -119.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopRightDisabled { background-position: -119.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopRightLarge { background-position: -238px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignFloatingObjectTopRightLargeDisabled { background-position: -238px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectTopRight { background-position: -119.0px -272.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignFloatingObjectTopRightLarge { background-position: -238px -544px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignJustify { background-position: -136.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignJustifyDisabled { background-position: -136.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignJustifyLarge { background-position: -272px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignJustifyLargeDisabled { background-position: -272px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignJustify { background-position: -136.0px -272.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignJustifyLarge { background-position: -272px -544px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignLeft { background-position: -153.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignLeftDisabled { background-position: -153.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignLeftLarge { background-position: -306px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignLeftLargeDisabled { background-position: -306px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignLeft { background-position: -153.0px -272.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignLeftLarge { background-position: -306px -544px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignMiddleCenter { background-position: -187.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignMiddleCenterDisabled { background-position: -187.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignMiddleCenterLarge { background-position: -374px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignMiddleCenterLargeDisabled { background-position: -374px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignMiddleCenter { background-position: -187.0px -272.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignMiddleCenterLarge { background-position: -374px -544px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignMiddleLeft { background-position: -102.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignMiddleLeftDisabled { background-position: -102.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignMiddleLeftLarge { background-position: -204px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignMiddleLeftLargeDisabled { background-position: -204px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignMiddleLeft { background-position: -102.0px -374.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignMiddleLeftLarge { background-position: -204px -748px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignMiddleRight { background-position: -204.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignMiddleRightDisabled { background-position: -204.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignMiddleRightLarge { background-position: -408px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignMiddleRightLargeDisabled { background-position: -408px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignMiddleRight { background-position: -204.0px -272.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignMiddleRightLarge { background-position: -408px -544px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignRight { background-position: -221.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignRightDisabled { background-position: -221.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignRightLarge { background-position: -442px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignRightLargeDisabled { background-position: -442px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignRight { background-position: -221.0px -272.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignRightLarge { background-position: -442px -544px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignTopCenter { background-position: -238.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignTopCenterDisabled { background-position: -238.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignTopCenterLarge { background-position: -476px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignTopCenterLargeDisabled { background-position: -476px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignTopCenter { background-position: -238.0px -272.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignTopCenterLarge { background-position: -476px -544px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignTopLeft { background-position: 0.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignTopLeftDisabled { background-position: 0.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignTopLeftLarge { background-position: 0px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignTopLeftLargeDisabled { background-position: 0px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignTopLeft { background-position: 0.0px -289.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignTopLeftLarge { background-position: 0px -578px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignTopRight { background-position: -102.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignTopRightDisabled { background-position: -102.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_AlignTopRightLarge { background-position: -204px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_AlignTopRightLargeDisabled { background-position: -204px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignTopRight { background-position: -102.0px -425.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_AlignTopRightLarge { background-position: -204px -850px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Background { background-position: -221.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BackgroundDisabled { background-position: -221.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BackgroundLarge { background-position: -442px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BackgroundLargeDisabled { background-position: -442px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Background { background-position: -221.0px -357.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BackgroundLarge { background-position: -442px -714px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Bold { background-position: -187.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BoldDisabled { background-position: -187.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BoldLarge { background-position: -374px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BoldLargeDisabled { background-position: -374px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Bold { background-position: -187.0px -459.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BoldLarge { background-position: -374px -918px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Bookmark { background-position: -238.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BookmarkDisabled { background-position: -238.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BookmarkLarge { background-position: -476px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BookmarkLargeDisabled { background-position: -476px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Bookmark { background-position: -238.0px -340.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BookmarkLarge { background-position: -476px -680px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BorderBottom { background-position: -153.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderBottomDisabled { background-position: -153.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderBottomLarge { background-position: -306px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BorderBottomLargeDisabled { background-position: -306px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderBottom { background-position: -153.0px -425.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderBottomLarge { background-position: -306px -850px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BorderInsideHorizontal { background-position: -34.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderInsideHorizontalDisabled { background-position: -34.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderInsideHorizontalLarge { background-position: -68px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BorderInsideHorizontalLargeDisabled { background-position: -68px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderInsideHorizontal { background-position: -34.0px -476.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderInsideHorizontalLarge { background-position: -68px -952px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BorderInsideVertical { background-position: -51.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderInsideVerticalDisabled { background-position: -51.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderInsideVerticalLarge { background-position: -102px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BorderInsideVerticalLargeDisabled { background-position: -102px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderInsideVertical { background-position: -51.0px -459.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderInsideVerticalLarge { background-position: -102px -918px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BorderLeft { background-position: -68.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderLeftDisabled { background-position: -68.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderLeftLarge { background-position: -136px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BorderLeftLargeDisabled { background-position: -136px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderLeft { background-position: -68.0px -459.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderLeftLarge { background-position: -136px -918px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BorderNone { background-position: -170.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderNoneDisabled { background-position: -170.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderNoneLarge { background-position: -340px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BorderNoneLargeDisabled { background-position: -340px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderNone { background-position: -170.0px -476.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderNoneLarge { background-position: -340px -952px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BorderRight { background-position: -187.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderRightDisabled { background-position: -187.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderRightLarge { background-position: -374px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BorderRightLargeDisabled { background-position: -374px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderRight { background-position: -187.0px -476.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderRightLarge { background-position: -374px -952px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BordersAll { background-position: 0.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BordersAllDisabled { background-position: 0.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BordersAllLarge { background-position: 0px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BordersAllLargeDisabled { background-position: 0px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BordersAll { background-position: 0.0px -357.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BordersAllLarge { background-position: 0px -714px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BordersInside { background-position: -34.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BordersInsideDisabled { background-position: -34.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BordersInsideLarge { background-position: -68px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BordersInsideLargeDisabled { background-position: -68px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BordersInside { background-position: -34.0px -442.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BordersInsideLarge { background-position: -68px -884px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BordersOutside { background-position: -51.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BordersOutsideDisabled { background-position: -51.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BordersOutsideLarge { background-position: -102px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BordersOutsideLargeDisabled { background-position: -102px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BordersOutside { background-position: -51.0px -442.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BordersOutsideLarge { background-position: -102px -884px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BorderTop { background-position: -51.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderTopDisabled { background-position: -51.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_BorderTopLarge { background-position: -102px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_BorderTopLargeDisabled { background-position: -102px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderTop { background-position: -51.0px -340.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_BorderTopLarge { background-position: -102px -680px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ChangeFontStyleLarge { background-position: -68.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ChangeFontStyleLargeDisabled { background-position: -68.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ChangeFontStyleLargeLarge { background-position: -136px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ChangeFontStyleLargeLargeDisabled { background-position: -136px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ChangeFontStyleLarge { background-position: -68.0px -306.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ChangeFontStyleLargeLarge { background-position: -136px -612px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ChangeTextCase { background-position: -85.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ChangeTextCaseDisabled { background-position: -85.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ChangeTextCaseLarge { background-position: -170px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ChangeTextCaseLargeDisabled { background-position: -170px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ChangeTextCase { background-position: -85.0px -306.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ChangeTextCaseLarge { background-position: -170px -612px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ClearFormatting { background-position: -102.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ClearFormattingDisabled { background-position: -102.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ClearFormattingLarge { background-position: -204px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ClearFormattingLargeDisabled { background-position: -204px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ClearFormatting { background-position: -102.0px -306.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ClearFormattingLarge { background-position: -204px -612px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ClearTableStyle { background-position: -119.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ClearTableStyleDisabled { background-position: -119.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ClearTableStyleLarge { background-position: -238px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ClearTableStyleLargeDisabled { background-position: -238px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ClearTableStyle { background-position: -119.0px -306.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ClearTableStyleLarge { background-position: -238px -612px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_CloseHeaderAndFooter { background-position: -136.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_CloseHeaderAndFooterDisabled { background-position: -136.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_CloseHeaderAndFooterLarge { background-position: -272px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_CloseHeaderAndFooterLargeDisabled { background-position: -272px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_CloseHeaderAndFooter { background-position: -136.0px -306.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_CloseHeaderAndFooterLarge { background-position: -272px -612px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ColumnOne { background-position: -153.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ColumnOneDisabled { background-position: -153.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ColumnOneLarge { background-position: -306px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ColumnOneLargeDisabled { background-position: -306px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ColumnOne { background-position: -153.0px -306.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ColumnOneLarge { background-position: -306px -612px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Columns { background-position: -170.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ColumnsDisabled { background-position: -170.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ColumnsLarge { background-position: -340px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ColumnsLargeDisabled { background-position: -340px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Columns { background-position: -170.0px -306.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ColumnsLarge { background-position: -340px -612px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ColumnsThree { background-position: -187.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ColumnsThreeDisabled { background-position: -187.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ColumnsThreeLarge { background-position: -374px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ColumnsThreeLargeDisabled { background-position: -374px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ColumnsThree { background-position: -187.0px -306.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ColumnsThreeLarge { background-position: -374px -612px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ColumnsTwo { background-position: -204.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ColumnsTwoDisabled { background-position: -204.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ColumnsTwoLarge { background-position: -408px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ColumnsTwoLargeDisabled { background-position: -408px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ColumnsTwo { background-position: -204.0px -306.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ColumnsTwoLarge { background-position: -408px -612px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Copy { background-position: -221.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_CopyDisabled { background-position: -221.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_CopyLarge { background-position: -442px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_CopyLargeDisabled { background-position: -442px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Copy { background-position: -221.0px -306.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_CopyLarge { background-position: -442px -612px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Cut { background-position: -85.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_CutDisabled { background-position: -85.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_CutLarge { background-position: -170px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_CutLargeDisabled { background-position: -170px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Cut { background-position: -85.0px -425.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_CutLarge { background-position: -170px -850px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Delete { background-position: -238.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteDisabled { background-position: -238.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteLarge { background-position: -476px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DeleteLargeDisabled { background-position: -476px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Delete { background-position: -238.0px -306.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DeleteLarge { background-position: -476px -612px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Delete_Hyperlink { background-position: -17.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_Delete_HyperlinkDisabled { background-position: -17.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_Delete_HyperlinkLarge { background-position: -34px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Delete_HyperlinkLargeDisabled { background-position: -34px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Delete_Hyperlink { background-position: -17.0px -340.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Delete_HyperlinkLarge { background-position: -34px -680px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DeleteComment { background-position: -68.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteCommentDisabled { background-position: -68.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteCommentLarge { background-position: -136px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DeleteCommentLargeDisabled { background-position: -136px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DeleteComment { background-position: -68.0px -425.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DeleteCommentLarge { background-position: -136px -850px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DeleteTable { background-position: -170.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteTableDisabled { background-position: -170.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteTableLarge { background-position: -340px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DeleteTableLargeDisabled { background-position: -340px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DeleteTable { background-position: -170.0px -374.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DeleteTableLarge { background-position: -340px -748px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DeleteTableCells { background-position: -51.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteTableCellsDisabled { background-position: -51.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteTableCellsLarge { background-position: -102px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DeleteTableCellsLargeDisabled { background-position: -102px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DeleteTableCells { background-position: -51.0px -476.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DeleteTableCellsLarge { background-position: -102px -952px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DeleteTableColumns { background-position: -136.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteTableColumnsDisabled { background-position: -136.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteTableColumnsLarge { background-position: -272px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DeleteTableColumnsLargeDisabled { background-position: -272px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DeleteTableColumns { background-position: -136.0px -425.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DeleteTableColumnsLarge { background-position: -272px -850px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DeleteTableRows { background-position: -85.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteTableRowsDisabled { background-position: -85.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DeleteTableRowsLarge { background-position: -170px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DeleteTableRowsLargeDisabled { background-position: -170px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DeleteTableRows { background-position: -85.0px -374.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DeleteTableRowsLarge { background-position: -170px -748px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DifferentFirstPage { background-position: -17.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DifferentFirstPageDisabled { background-position: -17.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DifferentFirstPageLarge { background-position: -34px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DifferentFirstPageLargeDisabled { background-position: -34px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DifferentFirstPage { background-position: -17.0px -459.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DifferentFirstPageLarge { background-position: -34px -918px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DifferentOddEvenPages { background-position: -187.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DifferentOddEvenPagesDisabled { background-position: -187.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DifferentOddEvenPagesLarge { background-position: -374px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DifferentOddEvenPagesLargeDisabled { background-position: -374px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DifferentOddEvenPages { background-position: -187.0px -374.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DifferentOddEvenPagesLarge { background-position: -374px -748px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DraftView { background-position: -170.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DraftViewDisabled { background-position: -170.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_DraftViewLarge { background-position: -340px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_DraftViewLargeDisabled { background-position: -340px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DraftView { background-position: -170.0px -340.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_DraftViewLarge { background-position: -340px -680px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_EditRangePermission { background-position: -153.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_EditRangePermissionDisabled { background-position: -153.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_EditRangePermissionLarge { background-position: -306px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_EditRangePermissionLargeDisabled { background-position: -306px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_EditRangePermission { background-position: -153.0px -340.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_EditRangePermissionLarge { background-position: -306px -680px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Find { background-position: -354.78260869565217391304347825px -23.652173913043478260869565217px; background-size: 374.26086956521739130434782608px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FindDisabled { background-position: -354.78260869565217391304347825px -23.652173913043478260869565217px; background-size: 374.26086956521739130434782608px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FindLarge { background-position: -709.56521739130434782608695650px -47.304347826086956521739130434px; background-size: 748.52173913043478260869565216px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FindLargeDisabled { background-position: -709.56521739130434782608695650px -47.304347826086956521739130434px; background-size: 748.52173913043478260869565216px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Find { background-position: -354.78260869565217391304347825px -378.43478260869565217391304347px; background-size: 374.26086956521739130434782608px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FindLarge { background-position: -709.56521739130434782608695650px -756.86956521739130434782608693px; background-size: 748.52173913043478260869565216px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FindLarge { background-position: -354.78260869565217391304347825px 0px; background-size: 374.26086956521739130434782608px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FindLargeDisabled { background-position: -354.78260869565217391304347825px 0px; background-size: 374.26086956521739130434782608px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FindLargeLarge { background-position: -709.56521739130434782608695650px 0px; background-size: 748.52173913043478260869565216px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FindLargeLargeDisabled { background-position: -709.56521739130434782608695650px 0px; background-size: 748.52173913043478260869565216px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FindLarge { background-position: -354.78260869565217391304347825px -354.78260869565217391304347825px; background-size: 374.26086956521739130434782608px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FindLargeLarge { background-position: -709.56521739130434782608695650px -709.56521739130434782608695650px; background-size: 748.52173913043478260869565216px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_First { background-position: -136.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FirstDisabled { background-position: -136.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FirstLarge { background-position: -272px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FirstLargeDisabled { background-position: -272px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_First { background-position: -136.0px -340.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FirstLarge { background-position: -272px -680px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectAlignment { background-position: -119.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectAlignmentDisabled { background-position: -119.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectAlignmentLarge { background-position: -238px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectAlignmentLargeDisabled { background-position: -238px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectAlignment { background-position: -119.0px -340.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectAlignmentLarge { background-position: -238px -680px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectBringForward { background-position: -102.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectBringForwardDisabled { background-position: -102.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectBringForwardLarge { background-position: -204px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectBringForwardLargeDisabled { background-position: -204px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectBringForward { background-position: -102.0px -340.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectBringForwardLarge { background-position: -204px -680px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectBringInFrontOfText { background-position: -85.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectBringInFrontOfTextDisabled { background-position: -85.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectBringInFrontOfTextLarge { background-position: -170px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectBringInFrontOfTextLargeDisabled { background-position: -170px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectBringInFrontOfText { background-position: -85.0px -340.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectBringInFrontOfTextLarge { background-position: -170px -680px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectBringToFront { background-position: -153.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectBringToFrontDisabled { background-position: -153.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectBringToFrontLarge { background-position: -306px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectBringToFrontLargeDisabled { background-position: -306px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectBringToFront { background-position: -153.0px -374.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectBringToFrontLarge { background-position: -306px -748px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectBringToFrontOfText { background-position: -68.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectBringToFrontOfTextDisabled { background-position: -68.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectBringToFrontOfTextLarge { background-position: -136px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectBringToFrontOfTextLargeDisabled { background-position: -136px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectBringToFrontOfText { background-position: -68.0px -340.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectBringToFrontOfTextLarge { background-position: -136px -680px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectLayoutOptions { background-position: -136.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectLayoutOptionsDisabled { background-position: -136.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectLayoutOptionsLarge { background-position: -272px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectLayoutOptionsLargeDisabled { background-position: -272px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectLayoutOptions { background-position: -136.0px -374.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectLayoutOptionsLarge { background-position: -272px -748px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectOutlineColor { background-position: -221.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectOutlineColorDisabled { background-position: -221.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectOutlineColorLarge { background-position: -442px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectOutlineColorLargeDisabled { background-position: -442px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectOutlineColor { background-position: -221.0px -374.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectOutlineColorLarge { background-position: -442px -748px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectSendBackward { background-position: -68.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectSendBackwardDisabled { background-position: -68.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectSendBackwardLarge { background-position: -136px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectSendBackwardLargeDisabled { background-position: -136px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectSendBackward { background-position: -68.0px -408.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectSendBackwardLarge { background-position: -136px -816px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectSendBehindText { background-position: -119.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectSendBehindTextDisabled { background-position: -119.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectSendBehindTextLarge { background-position: -238px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectSendBehindTextLargeDisabled { background-position: -238px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectSendBehindText { background-position: -119.0px -374.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectSendBehindTextLarge { background-position: -238px -748px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectSendToBack { background-position: -238.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectSendToBackDisabled { background-position: -238.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectSendToBackLarge { background-position: -476px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectSendToBackLargeDisabled { background-position: -476px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectSendToBack { background-position: -238.0px -442.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectSendToBackLarge { background-position: -476px -884px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectTextWrapType { background-position: -34.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectTextWrapTypeDisabled { background-position: -34.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FloatingObjectTextWrapTypeLarge { background-position: -68px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FloatingObjectTextWrapTypeLargeDisabled { background-position: -68px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectTextWrapType { background-position: -34.0px -374.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FloatingObjectTextWrapTypeLarge { background-position: -68px -748px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Font { background-position: -136.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontDisabled { background-position: -136.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontLarge { background-position: -272px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FontLargeDisabled { background-position: -272px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Font { background-position: -136.0px -408.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FontLarge { background-position: -272px -816px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FontColor { background-position: -119.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontColorDisabled { background-position: -119.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontColorLarge { background-position: -238px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FontColorLargeDisabled { background-position: -238px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FontColor { background-position: -119.0px -408.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FontColorLarge { background-position: -238px -816px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FontLarge { background-position: -102.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontLargeDisabled { background-position: -102.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontLargeLarge { background-position: -204px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FontLargeLargeDisabled { background-position: -204px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FontLarge { background-position: -102.0px -408.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FontLargeLarge { background-position: -204px -816px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FontSize { background-position: -85.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontSizeDisabled { background-position: -85.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontSizeLarge { background-position: -170px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FontSizeLargeDisabled { background-position: -170px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FontSize { background-position: -85.0px -408.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FontSizeLarge { background-position: -170px -816px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FontSizeDecrease { background-position: 0.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontSizeDecreaseDisabled { background-position: 0.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontSizeDecreaseLarge { background-position: 0px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FontSizeDecreaseLargeDisabled { background-position: 0px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FontSizeDecrease { background-position: 0.0px -391.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FontSizeDecreaseLarge { background-position: 0px -782px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FontSizeIncrease { background-position: -238.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontSizeIncreaseDisabled { background-position: -238.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FontSizeIncreaseLarge { background-position: -476px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FontSizeIncreaseLargeDisabled { background-position: -476px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FontSizeIncrease { background-position: -238.0px -374.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FontSizeIncreaseLarge { background-position: -476px -748px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Footer { background-position: -34.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FooterDisabled { background-position: -34.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FooterLarge { background-position: -68px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FooterLargeDisabled { background-position: -68px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Footer { background-position: -34.0px -340.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FooterLarge { background-position: -68px -680px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FullScreen { background-position: -204.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FullScreenDisabled { background-position: -204.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_FullScreenLarge { background-position: -408px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_FullScreenLargeDisabled { background-position: -408px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FullScreen { background-position: -204.0px -374.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_FullScreenLarge { background-position: -408px -748px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_GoToFooter { background-position: -85.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_GoToFooterDisabled { background-position: -85.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_GoToFooterLarge { background-position: -170px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_GoToFooterLargeDisabled { background-position: -170px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_GoToFooter { background-position: -85.0px -442.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_GoToFooterLarge { background-position: -170px -884px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_GoToHeader { background-position: -221.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_GoToHeaderDisabled { background-position: -221.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_GoToHeaderLarge { background-position: -442px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_GoToHeaderLargeDisabled { background-position: -442px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_GoToHeader { background-position: -221.0px -425.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_GoToHeaderLarge { background-position: -442px -850px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_GoToNextHeaderFooter { background-position: -221.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_GoToNextHeaderFooterDisabled { background-position: -221.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_GoToNextHeaderFooterLarge { background-position: -442px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_GoToNextHeaderFooterLargeDisabled { background-position: -442px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_GoToNextHeaderFooter { background-position: -221.0px -340.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_GoToNextHeaderFooterLarge { background-position: -442px -680px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_GoToPreviousHeaderFooter { background-position: -204.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_GoToPreviousHeaderFooterDisabled { background-position: -204.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_GoToPreviousHeaderFooterLarge { background-position: -408px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_GoToPreviousHeaderFooterLargeDisabled { background-position: -408px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_GoToPreviousHeaderFooter { background-position: -204.0px -340.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_GoToPreviousHeaderFooterLarge { background-position: -408px -680px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Header { background-position: -187.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_HeaderDisabled { background-position: -187.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_HeaderLarge { background-position: -374px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_HeaderLargeDisabled { background-position: -374px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Header { background-position: -187.0px -340.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_HeaderLarge { background-position: -374px -680px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Highlight { background-position: -204.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_HighlightDisabled { background-position: -204.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_HighlightLarge { background-position: -408px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_HighlightLargeDisabled { background-position: -408px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Highlight { background-position: -204.0px -425.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_HighlightLarge { background-position: -408px -850px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Hyperlink { background-position: -17.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_HyperlinkDisabled { background-position: -17.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_HyperlinkLarge { background-position: -34px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_HyperlinkLargeDisabled { background-position: -34px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Hyperlink { background-position: -17.0px -476.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_HyperlinkLarge { background-position: -34px -952px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ImagePlaceHolder { background-position: -221.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ImagePlaceHolderDisabled { background-position: -221.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ImagePlaceHolderLarge { background-position: -442px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ImagePlaceHolderLargeDisabled { background-position: -442px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ImagePlaceHolder { background-position: -221.0px -476.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ImagePlaceHolderLarge { background-position: -442px -952px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_IndentDecrease { background-position: 0.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_IndentDecreaseDisabled { background-position: 0.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_IndentDecreaseLarge { background-position: 0px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_IndentDecreaseLargeDisabled { background-position: 0px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_IndentDecrease { background-position: 0.0px -459.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_IndentDecreaseLarge { background-position: 0px -918px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_IndentIncrease { background-position: -17.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_IndentIncreaseDisabled { background-position: -17.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_IndentIncreaseLarge { background-position: -34px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_IndentIncreaseLargeDisabled { background-position: -34px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_IndentIncrease { background-position: -17.0px -374.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_IndentIncreaseLarge { background-position: -34px -748px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertCaption { background-position: -187.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertCaptionDisabled { background-position: -187.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertCaptionLarge { background-position: -374px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertCaptionLargeDisabled { background-position: -374px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertCaption { background-position: -187.0px -442.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertCaptionLarge { background-position: -374px -884px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertColumnBreak { background-position: -51.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertColumnBreakDisabled { background-position: -51.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertColumnBreakLarge { background-position: -102px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertColumnBreakLargeDisabled { background-position: -102px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertColumnBreak { background-position: -51.0px -408.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertColumnBreakLarge { background-position: -102px -816px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertDataField { background-position: -34.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertDataFieldDisabled { background-position: -34.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertDataFieldLarge { background-position: -68px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertDataFieldLargeDisabled { background-position: -68px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertDataField { background-position: -34.0px -408.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertDataFieldLarge { background-position: -68px -816px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertEquationCaption { background-position: -238.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertEquationCaptionDisabled { background-position: -238.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertEquationCaptionLarge { background-position: -476px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertEquationCaptionLargeDisabled { background-position: -476px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertEquationCaption { background-position: -238.0px -476.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertEquationCaptionLarge { background-position: -476px -952px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertFigureCaption { background-position: 0.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertFigureCaptionDisabled { background-position: 0.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertFigureCaptionLarge { background-position: 0px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertFigureCaptionLargeDisabled { background-position: 0px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertFigureCaption { background-position: 0.0px -442.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertFigureCaptionLarge { background-position: 0px -884px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertFloatingObjectImage { background-position: -153.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertFloatingObjectImageDisabled { background-position: -153.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertFloatingObjectImageLarge { background-position: -306px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertFloatingObjectImageLargeDisabled { background-position: -306px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertFloatingObjectImage { background-position: -153.0px -408.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertFloatingObjectImageLarge { background-position: -306px -816px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertImage { background-position: -119.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertImageDisabled { background-position: -119.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertImageLarge { background-position: -238px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertImageLargeDisabled { background-position: -238px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertImage { background-position: -119.0px -442.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertImageLarge { background-position: -238px -884px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertPageBreak { background-position: -136.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertPageBreakDisabled { background-position: -136.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertPageBreakLarge { background-position: -272px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertPageBreakLargeDisabled { background-position: -272px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertPageBreak { background-position: -136.0px -459.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertPageBreakLarge { background-position: -272px -918px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertPageCount { background-position: -153.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertPageCountDisabled { background-position: -153.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertPageCountLarge { background-position: -306px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertPageCountLargeDisabled { background-position: -306px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertPageCount { background-position: -153.0px -476.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertPageCountLarge { background-position: -306px -952px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertPageNumber { background-position: -17.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertPageNumberDisabled { background-position: -17.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertPageNumberLarge { background-position: -34px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertPageNumberLargeDisabled { background-position: -34px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertPageNumber { background-position: -17.0px -425.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertPageNumberLarge { background-position: -34px -850px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertSectionBreakContinuous { background-position: -51.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertSectionBreakContinuousDisabled { background-position: -51.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertSectionBreakContinuousLarge { background-position: -102px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertSectionBreakContinuousLargeDisabled { background-position: -102px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertSectionBreakContinuous { background-position: -51.0px -425.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertSectionBreakContinuousLarge { background-position: -102px -850px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertSectionBreakEvenPage { background-position: -204.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertSectionBreakEvenPageDisabled { background-position: -204.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertSectionBreakEvenPageLarge { background-position: -408px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertSectionBreakEvenPageLargeDisabled { background-position: -408px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertSectionBreakEvenPage { background-position: -204.0px -442.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertSectionBreakEvenPageLarge { background-position: -408px -884px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertSectionBreakNextPage { background-position: -51.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertSectionBreakNextPageDisabled { background-position: -51.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertSectionBreakNextPageLarge { background-position: -102px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertSectionBreakNextPageLargeDisabled { background-position: -102px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertSectionBreakNextPage { background-position: -51.0px -391.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertSectionBreakNextPageLarge { background-position: -102px -782px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertSectionBreakOddPage { background-position: -102.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertSectionBreakOddPageDisabled { background-position: -102.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertSectionBreakOddPageLarge { background-position: -204px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertSectionBreakOddPageLargeDisabled { background-position: -204px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertSectionBreakOddPage { background-position: -102.0px -476.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertSectionBreakOddPageLarge { background-position: -204px -952px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTable { background-position: -238.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableDisabled { background-position: -238.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableLarge { background-position: -476px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableLargeDisabled { background-position: -476px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTable { background-position: -238.0px -408.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableLarge { background-position: -476px -816px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableCaption { background-position: -221.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableCaptionDisabled { background-position: -221.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableCaptionLarge { background-position: -442px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableCaptionLargeDisabled { background-position: -442px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableCaption { background-position: -221.0px -459.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableCaptionLarge { background-position: -442px -918px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableCells { background-position: -68.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableCellsDisabled { background-position: -68.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableCellsLarge { background-position: -136px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableCellsLargeDisabled { background-position: -136px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableCells { background-position: -68.0px -391.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableCellsLarge { background-position: -136px -782px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableColumnsToTheLeft { background-position: 0.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableColumnsToTheLeftDisabled { background-position: 0.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableColumnsToTheLeftLarge { background-position: 0px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableColumnsToTheLeftLargeDisabled { background-position: 0px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableColumnsToTheLeft { background-position: 0.0px -408.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableColumnsToTheLeftLarge { background-position: 0px -816px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableColumnsToTheRight { background-position: 0.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableColumnsToTheRightDisabled { background-position: 0.0px -85.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableColumnsToTheRightLarge { background-position: 0px -170px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableColumnsToTheRightLargeDisabled { background-position: 0px -170px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableColumnsToTheRight { background-position: 0.0px -340.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableColumnsToTheRightLarge { background-position: 0px -680px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableOfCaptions { background-position: -102.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableOfCaptionsDisabled { background-position: -102.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableOfCaptionsLarge { background-position: -204px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableOfCaptionsLargeDisabled { background-position: -204px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableOfCaptions { background-position: -102.0px -289.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableOfCaptionsLarge { background-position: -204px -578px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableOfContents { background-position: -119.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableOfContentsDisabled { background-position: -119.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableOfContentsLarge { background-position: -238px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableOfContentsLargeDisabled { background-position: -238px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableOfContents { background-position: -119.0px -289.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableOfContentsLarge { background-position: -238px -578px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableOfEquations { background-position: -136.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableOfEquationsDisabled { background-position: -136.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableOfEquationsLarge { background-position: -272px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableOfEquationsLargeDisabled { background-position: -272px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableOfEquations { background-position: -136.0px -289.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableOfEquationsLarge { background-position: -272px -578px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableOfFigures { background-position: -170.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableOfFiguresDisabled { background-position: -170.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableOfFiguresLarge { background-position: -340px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableOfFiguresLargeDisabled { background-position: -340px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableOfFigures { background-position: -170.0px -289.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableOfFiguresLarge { background-position: -340px -578px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableRowsAbove { background-position: -221.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableRowsAboveDisabled { background-position: -221.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableRowsAboveLarge { background-position: -442px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableRowsAboveLargeDisabled { background-position: -442px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableRowsAbove { background-position: -221.0px -391.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableRowsAboveLarge { background-position: -442px -782px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableRowsBelow { background-position: -187.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableRowsBelowDisabled { background-position: -187.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTableRowsBelowLarge { background-position: -374px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTableRowsBelowLargeDisabled { background-position: -374px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableRowsBelow { background-position: -187.0px -289.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTableRowsBelowLarge { background-position: -374px -578px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTextBox { background-position: -204.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTextBoxDisabled { background-position: -204.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_InsertTextBoxLarge { background-position: -408px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_InsertTextBoxLargeDisabled { background-position: -408px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTextBox { background-position: -204.0px -289.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_InsertTextBoxLarge { background-position: -408px -578px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Italic { background-position: -221.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ItalicDisabled { background-position: -221.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ItalicLarge { background-position: -442px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ItalicLargeDisabled { background-position: -442px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Italic { background-position: -221.0px -289.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ItalicLarge { background-position: -442px -578px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Language { background-position: -238.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LanguageDisabled { background-position: -238.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LanguageLarge { background-position: -476px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_LanguageLargeDisabled { background-position: -476px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Language { background-position: -238.0px -289.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_LanguageLarge { background-position: -476px -578px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Last { background-position: 0.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LastDisabled { background-position: 0.0px -51.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LastLarge { background-position: 0px -102px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_LastLargeDisabled { background-position: 0px -102px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Last { background-position: 0.0px -306.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_LastLarge { background-position: 0px -612px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_LeftColumns { background-position: -170.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LeftColumnsDisabled { background-position: -170.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LeftColumnsLarge { background-position: -340px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_LeftColumnsLargeDisabled { background-position: -340px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_LeftColumns { background-position: -170.0px -442.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_LeftColumnsLarge { background-position: -340px -884px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_LineNumbering { background-position: -187.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LineNumberingDisabled { background-position: -187.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LineNumberingLarge { background-position: -374px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_LineNumberingLargeDisabled { background-position: -374px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_LineNumbering { background-position: -187.0px -391.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_LineNumberingLarge { background-position: -374px -782px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_LineSpacing { background-position: 0.0px -238.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LineSpacingDisabled { background-position: 0.0px -238.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LineSpacingLarge { background-position: 0px -476px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_LineSpacingLargeDisabled { background-position: 0px -476px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_LineSpacing { background-position: 0.0px -493.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_LineSpacingLarge { background-position: 0px -986px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_LinkToPrevious { background-position: -119.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LinkToPreviousDisabled { background-position: -119.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_LinkToPreviousLarge { background-position: -238px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_LinkToPreviousLargeDisabled { background-position: -238px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_LinkToPrevious { background-position: -119.0px -391.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_LinkToPreviousLarge { background-position: -238px -782px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ListBullets { background-position: -170.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ListBulletsDisabled { background-position: -170.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ListBulletsLarge { background-position: -340px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ListBulletsLargeDisabled { background-position: -340px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ListBullets { background-position: -170.0px -408.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ListBulletsLarge { background-position: -340px -816px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ListMultilevel { background-position: -187.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ListMultilevelDisabled { background-position: -187.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ListMultilevelLarge { background-position: -374px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ListMultilevelLargeDisabled { background-position: -374px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ListMultilevel { background-position: -187.0px -408.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ListMultilevelLarge { background-position: -374px -816px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ListNumbers { background-position: -204.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ListNumbersDisabled { background-position: -204.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ListNumbersLarge { background-position: -408px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ListNumbersLargeDisabled { background-position: -408px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ListNumbers { background-position: -204.0px -408.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ListNumbersLarge { background-position: -408px -816px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_MailMerge { background-position: -238.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_MailMergeDisabled { background-position: -238.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_MailMergeLarge { background-position: -476px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_MailMergeLargeDisabled { background-position: -476px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_MailMerge { background-position: -238.0px -425.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_MailMergeLarge { background-position: -476px -850px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_MergeTableCells { background-position: -68.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_MergeTableCellsDisabled { background-position: -68.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_MergeTableCellsLarge { background-position: -136px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_MergeTableCellsLargeDisabled { background-position: -136px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_MergeTableCells { background-position: -68.0px -476.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_MergeTableCellsLarge { background-position: -136px -952px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ModifyTableStyle { background-position: -85.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ModifyTableStyleDisabled { background-position: -85.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ModifyTableStyleLarge { background-position: -170px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ModifyTableStyleLargeDisabled { background-position: -170px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ModifyTableStyle { background-position: -85.0px -476.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ModifyTableStyleLarge { background-position: -170px -952px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_New { background-position: -85.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_NewDisabled { background-position: -85.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_NewLarge { background-position: -170px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_NewLargeDisabled { background-position: -170px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_New { background-position: -85.0px -459.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_NewLarge { background-position: -170px -918px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_NewComment { background-position: -68.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_NewCommentDisabled { background-position: -68.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_NewCommentLarge { background-position: -136px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_NewCommentLargeDisabled { background-position: -136px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_NewComment { background-position: -68.0px -442.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_NewCommentLarge { background-position: -136px -884px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_NewTableStyle { background-position: -34.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_NewTableStyleDisabled { background-position: -34.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_NewTableStyleLarge { background-position: -68px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_NewTableStyleLargeDisabled { background-position: -68px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_NewTableStyle { background-position: -34.0px -323.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_NewTableStyleLarge { background-position: -68px -646px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Next { background-position: -85.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_NextDisabled { background-position: -85.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_NextLarge { background-position: -170px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_NextLargeDisabled { background-position: -170px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Next { background-position: -85.0px -289.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_NextLarge { background-position: -170px -578px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_NextComment { background-position: -68.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_NextCommentDisabled { background-position: -68.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_NextCommentLarge { background-position: -136px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_NextCommentLargeDisabled { background-position: -136px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_NextComment { background-position: -68.0px -289.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_NextCommentLarge { background-position: -136px -578px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Open { background-position: -51.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_OpenDisabled { background-position: -51.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_OpenLarge { background-position: -102px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_OpenLargeDisabled { background-position: -102px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Open { background-position: -51.0px -289.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_OpenLarge { background-position: -102px -578px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageColor { background-position: -187.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageColorDisabled { background-position: -187.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageColorLarge { background-position: -374px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageColorLargeDisabled { background-position: -374px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageColor { background-position: -187.0px -255.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageColorLarge { background-position: -374px -510px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageMargins { background-position: -17.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageMarginsDisabled { background-position: -17.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageMarginsLarge { background-position: -34px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageMarginsLargeDisabled { background-position: -34px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageMargins { background-position: -17.0px -255.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageMarginsLarge { background-position: -34px -510px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageMarginsModerate { background-position: -34.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageMarginsModerateDisabled { background-position: -34.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageMarginsModerateLarge { background-position: -68px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageMarginsModerateLargeDisabled { background-position: -68px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageMarginsModerate { background-position: -34.0px -255.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageMarginsModerateLarge { background-position: -68px -510px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageMarginsNarrow { background-position: -51.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageMarginsNarrowDisabled { background-position: -51.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageMarginsNarrowLarge { background-position: -102px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageMarginsNarrowLargeDisabled { background-position: -102px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageMarginsNarrow { background-position: -51.0px -255.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageMarginsNarrowLarge { background-position: -102px -510px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageMarginsNormal { background-position: -68.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageMarginsNormalDisabled { background-position: -68.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageMarginsNormalLarge { background-position: -136px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageMarginsNormalLargeDisabled { background-position: -136px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageMarginsNormal { background-position: -68.0px -255.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageMarginsNormalLarge { background-position: -136px -510px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageMarginsWide { background-position: -85.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageMarginsWideDisabled { background-position: -85.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageMarginsWideLarge { background-position: -170px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageMarginsWideLargeDisabled { background-position: -170px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageMarginsWide { background-position: -85.0px -255.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageMarginsWideLarge { background-position: -170px -510px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageOrientation { background-position: -102.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageOrientationDisabled { background-position: -102.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageOrientationLarge { background-position: -204px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageOrientationLargeDisabled { background-position: -204px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageOrientation { background-position: -102.0px -255.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageOrientationLarge { background-position: -204px -510px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageOrientationLandscape { background-position: -119.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageOrientationLandscapeDisabled { background-position: -119.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageOrientationLandscapeLarge { background-position: -238px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageOrientationLandscapeLargeDisabled { background-position: -238px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageOrientationLandscape { background-position: -119.0px -255.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageOrientationLandscapeLarge { background-position: -238px -510px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageOrientationPortrait { background-position: -136.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageOrientationPortraitDisabled { background-position: -136.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PageOrientationPortraitLarge { background-position: -272px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PageOrientationPortraitLargeDisabled { background-position: -272px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageOrientationPortrait { background-position: -136.0px -255.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PageOrientationPortraitLarge { background-position: -272px -510px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PaperSize { background-position: -153.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PaperSizeDisabled { background-position: -153.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PaperSizeLarge { background-position: -306px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PaperSizeLargeDisabled { background-position: -306px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PaperSize { background-position: -153.0px -255.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PaperSizeLarge { background-position: -306px -510px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Paragraph { background-position: -170.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ParagraphDisabled { background-position: -170.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ParagraphLarge { background-position: -340px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ParagraphLargeDisabled { background-position: -340px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Paragraph { background-position: -170.0px -255.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ParagraphLarge { background-position: -340px -510px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ParagraphLarge { background-position: -204.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ParagraphLargeDisabled { background-position: -204.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ParagraphLargeLarge { background-position: -408px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ParagraphLargeLargeDisabled { background-position: -408px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ParagraphLarge { background-position: -204.0px -255.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ParagraphLargeLarge { background-position: -408px -510px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Paste { background-position: -34.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PasteDisabled { background-position: -34.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PasteLarge { background-position: -68px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PasteLargeDisabled { background-position: -68px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Paste { background-position: -34.0px -289.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PasteLarge { background-position: -68px -578px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PasteLarge { background-position: -221.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PasteLargeDisabled { background-position: -221.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PasteLargeLarge { background-position: -442px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PasteLargeLargeDisabled { background-position: -442px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PasteLarge { background-position: -221.0px -255.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PasteLargeLarge { background-position: -442px -510px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PasteSpecial { background-position: -238.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PasteSpecialDisabled { background-position: -238.0px 0.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PasteSpecialLarge { background-position: -476px 0px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PasteSpecialLargeDisabled { background-position: -476px 0px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PasteSpecial { background-position: -238.0px -255.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PasteSpecialLarge { background-position: -476px -510px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PenColor { background-position: 0.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PenColorDisabled { background-position: 0.0px -17.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PenColorLarge { background-position: 0px -34px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PenColorLargeDisabled { background-position: 0px -34px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PenColor { background-position: 0.0px -272.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PenColorLarge { background-position: 0px -544px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Prev { background-position: -17.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrevDisabled { background-position: -17.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrevLarge { background-position: -34px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PrevLargeDisabled { background-position: -34px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Prev { background-position: -17.0px -442.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PrevLarge { background-position: -34px -884px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Preview { background-position: -204.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PreviewDisabled { background-position: -204.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PreviewLarge { background-position: -408px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PreviewLargeDisabled { background-position: -408px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Preview { background-position: -204.0px -459.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PreviewLarge { background-position: -408px -918px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PreviousComment { background-position: -17.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PreviousCommentDisabled { background-position: -17.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PreviousCommentLarge { background-position: -34px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PreviousCommentLargeDisabled { background-position: -34px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PreviousComment { background-position: -17.0px -323.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PreviousCommentLarge { background-position: -34px -646px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Print { background-position: -85.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrintDisabled { background-position: -85.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrintLarge { background-position: -170px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PrintLargeDisabled { background-position: -170px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Print { background-position: -85.0px -357.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PrintLarge { background-position: -170px -714px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PrintBrowser { background-position: -119.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrintBrowserDisabled { background-position: -119.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrintBrowserLarge { background-position: -238px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PrintBrowserLargeDisabled { background-position: -238px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PrintBrowser { background-position: -119.0px -357.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PrintBrowserLarge { background-position: -238px -714px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PrintDialog { background-position: -153.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrintDialogDisabled { background-position: -153.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrintDialogLarge { background-position: -306px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PrintDialogLargeDisabled { background-position: -306px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PrintDialog { background-position: -153.0px -289.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PrintDialogLarge { background-position: -306px -578px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PrintLayoutView { background-position: -17.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrintLayoutViewDisabled { background-position: -17.0px -34.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrintLayoutViewLarge { background-position: -34px -68px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PrintLayoutViewLargeDisabled { background-position: -34px -68px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PrintLayoutView { background-position: -17.0px -289.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PrintLayoutViewLarge { background-position: -34px -578px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PrintPreviewBrowser { background-position: -51.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrintPreviewBrowserDisabled { background-position: -51.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_PrintPreviewBrowserLarge { background-position: -102px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_PrintPreviewBrowserLargeDisabled { background-position: -102px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PrintPreviewBrowser { background-position: -51.0px -323.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_PrintPreviewBrowserLarge { background-position: -102px -646px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ProtectDocument { background-position: -68.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ProtectDocumentDisabled { background-position: -68.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ProtectDocumentLarge { background-position: -136px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ProtectDocumentLargeDisabled { background-position: -136px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ProtectDocument { background-position: -68.0px -323.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ProtectDocumentLarge { background-position: -136px -646px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Redo { background-position: -85.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_RedoDisabled { background-position: -85.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_RedoLarge { background-position: -170px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_RedoLargeDisabled { background-position: -170px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Redo { background-position: -85.0px -323.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_RedoLarge { background-position: -170px -646px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Replace { background-position: -102.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ReplaceDisabled { background-position: -102.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ReplaceLarge { background-position: -204px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ReplaceLargeDisabled { background-position: -204px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Replace { background-position: -102.0px -323.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ReplaceLarge { background-position: -204px -646px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Reviewers { background-position: -238.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ReviewersDisabled { background-position: -238.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ReviewersLarge { background-position: -476px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ReviewersLargeDisabled { background-position: -476px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Reviewers { background-position: -238.0px -459.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ReviewersLarge { background-position: -476px -918px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ReviewingPane { background-position: 0.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ReviewingPaneDisabled { background-position: 0.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ReviewingPaneLarge { background-position: 0px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ReviewingPaneLargeDisabled { background-position: 0px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ReviewingPane { background-position: 0.0px -476.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ReviewingPaneLarge { background-position: 0px -952px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_RightColumns { background-position: -102.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_RightColumnsDisabled { background-position: -102.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_RightColumnsLarge { background-position: -204px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_RightColumnsLargeDisabled { background-position: -204px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_RightColumns { background-position: -102.0px -442.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_RightColumnsLarge { background-position: -204px -884px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_RulerHorizontal { background-position: -221.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_RulerHorizontalDisabled { background-position: -221.0px -153.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_RulerHorizontalLarge { background-position: -442px -306px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_RulerHorizontalLargeDisabled { background-position: -442px -306px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_RulerHorizontal { background-position: -221.0px -408.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_RulerHorizontalLarge { background-position: -442px -816px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_RulerVertical { background-position: 0.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_RulerVerticalDisabled { background-position: 0.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_RulerVerticalLarge { background-position: 0px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_RulerVerticalLargeDisabled { background-position: 0px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_RulerVertical { background-position: 0.0px -425.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_RulerVerticalLarge { background-position: 0px -850px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Save { background-position: 0.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SaveDisabled { background-position: 0.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SaveLarge { background-position: 0px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SaveLargeDisabled { background-position: 0px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Save { background-position: 0.0px -323.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SaveLarge { background-position: 0px -646px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SaveAs { background-position: -153.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SaveAsDisabled { background-position: -153.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SaveAsLarge { background-position: -306px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SaveAsLargeDisabled { background-position: -306px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SaveAs { background-position: -153.0px -391.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SaveAsLarge { background-position: -306px -782px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Select { background-position: -17.0px -238.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectDisabled { background-position: -17.0px -238.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectLarge { background-position: -34px -476px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SelectLargeDisabled { background-position: -34px -476px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Select { background-position: -17.0px -493.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SelectLarge { background-position: -34px -986px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SelectAll { background-position: -34.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectAllDisabled { background-position: -34.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectAllLarge { background-position: -68px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SelectAllLargeDisabled { background-position: -68px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SelectAll { background-position: -34.0px -425.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SelectAllLarge { background-position: -68px -850px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SelectTable { background-position: -204.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectTableDisabled { background-position: -204.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectTableLarge { background-position: -408px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SelectTableLargeDisabled { background-position: -408px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SelectTable { background-position: -204.0px -476.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SelectTableLarge { background-position: -408px -952px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SelectTableCell { background-position: -119.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectTableCellDisabled { background-position: -119.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectTableCellLarge { background-position: -238px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SelectTableCellLargeDisabled { background-position: -238px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SelectTableCell { background-position: -119.0px -476.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SelectTableCellLarge { background-position: -238px -952px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SelectTableColumn { background-position: -238.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectTableColumnDisabled { background-position: -238.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectTableColumnLarge { background-position: -476px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SelectTableColumnLargeDisabled { background-position: -476px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SelectTableColumn { background-position: -238.0px -391.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SelectTableColumnLarge { background-position: -476px -782px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SelectTableRow { background-position: -153.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectTableRowDisabled { background-position: -153.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SelectTableRowLarge { background-position: -306px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SelectTableRowLargeDisabled { background-position: -306px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SelectTableRow { background-position: -153.0px -357.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SelectTableRowLarge { background-position: -306px -714px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Shading { background-position: -34.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ShadingDisabled { background-position: -34.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ShadingLarge { background-position: -68px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ShadingLargeDisabled { background-position: -68px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Shading { background-position: -34.0px -357.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ShadingLarge { background-position: -68px -714px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ShowAllFieldCodes { background-position: -17.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ShowAllFieldCodesDisabled { background-position: -17.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ShowAllFieldCodesLarge { background-position: -34px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ShowAllFieldCodesLargeDisabled { background-position: -34px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ShowAllFieldCodes { background-position: -17.0px -357.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ShowAllFieldCodesLarge { background-position: -34px -714px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ShowAllFieldResults { background-position: -102.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ShowAllFieldResultsDisabled { background-position: -102.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ShowAllFieldResultsLarge { background-position: -204px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ShowAllFieldResultsLargeDisabled { background-position: -204px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ShowAllFieldResults { background-position: -102.0px -459.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ShowAllFieldResultsLarge { background-position: -204px -918px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ShowComments { background-position: -119.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ShowCommentsDisabled { background-position: -119.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ShowCommentsLarge { background-position: -238px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ShowCommentsLargeDisabled { background-position: -238px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ShowComments { background-position: -119.0px -459.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ShowCommentsLarge { background-position: -238px -918px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ShowHidden { background-position: -17.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ShowHiddenDisabled { background-position: -17.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ShowHiddenLarge { background-position: -34px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ShowHiddenLargeDisabled { background-position: -34px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ShowHidden { background-position: -17.0px -391.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ShowHiddenLarge { background-position: -34px -782px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SimpleView { background-position: -136.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SimpleViewDisabled { background-position: -136.0px -221.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SimpleViewLarge { background-position: -272px -442px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SimpleViewLargeDisabled { background-position: -272px -442px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SimpleView { background-position: -136.0px -476.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SimpleViewLarge { background-position: -272px -952px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SpacingDecrease { background-position: -153.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SpacingDecreaseDisabled { background-position: -153.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SpacingDecreaseLarge { background-position: -306px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SpacingDecreaseLargeDisabled { background-position: -306px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SpacingDecrease { background-position: -153.0px -459.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SpacingDecreaseLarge { background-position: -306px -918px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SpellCheck { background-position: -68.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SpellCheckDisabled { background-position: -68.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SpellCheckLarge { background-position: -136px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SpellCheckLargeDisabled { background-position: -136px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SpellCheck { background-position: -68.0px -374.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SpellCheckLarge { background-position: -136px -748px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SpellCheckAsYouType { background-position: -51.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SpellCheckAsYouTypeDisabled { background-position: -51.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SpellCheckAsYouTypeLarge { background-position: -102px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SpellCheckAsYouTypeLargeDisabled { background-position: -102px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SpellCheckAsYouType { background-position: -51.0px -374.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SpellCheckAsYouTypeLarge { background-position: -102px -748px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SplitTable { background-position: -170.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SplitTableDisabled { background-position: -170.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SplitTableLarge { background-position: -340px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SplitTableLargeDisabled { background-position: -340px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SplitTable { background-position: -170.0px -425.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SplitTableLarge { background-position: -340px -850px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SplitTableCells { background-position: -34.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SplitTableCellsDisabled { background-position: -34.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SplitTableCellsLarge { background-position: -68px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SplitTableCellsLargeDisabled { background-position: -68px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SplitTableCells { background-position: -34.0px -391.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SplitTableCellsLarge { background-position: -68px -782px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Strikeout { background-position: -102.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_StrikeoutDisabled { background-position: -102.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_StrikeoutLarge { background-position: -204px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_StrikeoutLargeDisabled { background-position: -204px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Strikeout { background-position: -102.0px -357.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_StrikeoutLarge { background-position: -204px -714px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_StrikeoutDouble { background-position: -34.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_StrikeoutDoubleDisabled { background-position: -34.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_StrikeoutDoubleLarge { background-position: -68px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_StrikeoutDoubleLargeDisabled { background-position: -68px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_StrikeoutDouble { background-position: -34.0px -459.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_StrikeoutDoubleLarge { background-position: -68px -918px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Subscript { background-position: -187.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SubscriptDisabled { background-position: -187.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SubscriptLarge { background-position: -374px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SubscriptLargeDisabled { background-position: -374px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Subscript { background-position: -187.0px -425.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SubscriptLarge { background-position: -374px -850px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Superscript { background-position: -119.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SuperscriptDisabled { background-position: -119.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SuperscriptLarge { background-position: -238px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SuperscriptLargeDisabled { background-position: -238px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Superscript { background-position: -119.0px -323.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SuperscriptLarge { background-position: -238px -646px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Symbol { background-position: -136.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SymbolDisabled { background-position: -136.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_SymbolLarge { background-position: -272px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_SymbolLargeDisabled { background-position: -272px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Symbol { background-position: -136.0px -323.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_SymbolLarge { background-position: -272px -646px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TableAutoFitContents { background-position: -153.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TableAutoFitContentsDisabled { background-position: -153.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TableAutoFitContentsLarge { background-position: -306px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TableAutoFitContentsLargeDisabled { background-position: -306px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TableAutoFitContents { background-position: -153.0px -323.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TableAutoFitContentsLarge { background-position: -306px -646px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TableAutoFitWindow { background-position: -170.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TableAutoFitWindowDisabled { background-position: -170.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TableAutoFitWindowLarge { background-position: -340px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TableAutoFitWindowLargeDisabled { background-position: -340px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TableAutoFitWindow { background-position: -170.0px -323.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TableAutoFitWindowLarge { background-position: -340px -646px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TableCellMargins { background-position: -187.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TableCellMarginsDisabled { background-position: -187.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TableCellMarginsLarge { background-position: -374px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TableCellMarginsLargeDisabled { background-position: -374px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TableCellMargins { background-position: -187.0px -323.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TableCellMarginsLarge { background-position: -374px -646px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TableFixedColumnWidth { background-position: -170.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TableFixedColumnWidthDisabled { background-position: -170.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TableFixedColumnWidthLarge { background-position: -340px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TableFixedColumnWidthLargeDisabled { background-position: -340px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TableFixedColumnWidth { background-position: -170.0px -391.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TableFixedColumnWidthLarge { background-position: -340px -782px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TableProperties { background-position: -204.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TablePropertiesDisabled { background-position: -204.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TablePropertiesLarge { background-position: -408px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TablePropertiesLargeDisabled { background-position: -408px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TableProperties { background-position: -204.0px -323.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TablePropertiesLarge { background-position: -408px -646px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TextWrapBehind { background-position: -136.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapBehindDisabled { background-position: -136.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapBehindLarge { background-position: -272px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TextWrapBehindLargeDisabled { background-position: -272px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapBehind { background-position: -136.0px -391.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapBehindLarge { background-position: -272px -782px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TextWrapInFrontOfText { background-position: -221.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapInFrontOfTextDisabled { background-position: -221.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapInFrontOfTextLarge { background-position: -442px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TextWrapInFrontOfTextLargeDisabled { background-position: -442px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapInFrontOfText { background-position: -221.0px -442.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapInFrontOfTextLarge { background-position: -442px -884px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TextWrapInline { background-position: -136.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapInlineDisabled { background-position: -136.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapInlineLarge { background-position: -272px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TextWrapInlineLargeDisabled { background-position: -272px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapInline { background-position: -136.0px -357.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapInlineLarge { background-position: -272px -714px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TextWrapSquare { background-position: -51.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapSquareDisabled { background-position: -51.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapSquareLarge { background-position: -102px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TextWrapSquareLargeDisabled { background-position: -102px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapSquare { background-position: -51.0px -357.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapSquareLarge { background-position: -102px -714px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TextWrapThrough { background-position: -170.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapThroughDisabled { background-position: -170.0px -204.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapThroughLarge { background-position: -340px -408px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TextWrapThroughLargeDisabled { background-position: -340px -408px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapThrough { background-position: -170.0px -459.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapThroughLarge { background-position: -340px -918px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TextWrapTight { background-position: -153.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapTightDisabled { background-position: -153.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapTightLarge { background-position: -306px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TextWrapTightLargeDisabled { background-position: -306px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapTight { background-position: -153.0px -442.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapTightLarge { background-position: -306px -884px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TextWrapTopAndBottom { background-position: -170.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapTopAndBottomDisabled { background-position: -170.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_TextWrapTopAndBottomLarge { background-position: -340px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_TextWrapTopAndBottomLargeDisabled { background-position: -340px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapTopAndBottom { background-position: -170.0px -357.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_TextWrapTopAndBottomLarge { background-position: -340px -714px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ToggleFieldCodes { background-position: -187.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ToggleFieldCodesDisabled { background-position: -187.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ToggleFieldCodesLarge { background-position: -374px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ToggleFieldCodesLargeDisabled { background-position: -374px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ToggleFieldCodes { background-position: -187.0px -357.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ToggleFieldCodesLarge { background-position: -374px -714px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Underline { background-position: -204.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UnderlineDisabled { background-position: -204.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UnderlineLarge { background-position: -408px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_UnderlineLargeDisabled { background-position: -408px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Underline { background-position: -204.0px -357.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_UnderlineLarge { background-position: -408px -714px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_UnderlineDouble { background-position: -238.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UnderlineDoubleDisabled { background-position: -238.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UnderlineDoubleLarge { background-position: -476px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_UnderlineDoubleLargeDisabled { background-position: -476px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_UnderlineDouble { background-position: -238.0px -357.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_UnderlineDoubleLarge { background-position: -476px -714px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_Undo { background-position: -119.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UndoDisabled { background-position: -119.0px -170.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UndoLarge { background-position: -238px -340px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_UndoLargeDisabled { background-position: -238px -340px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_Undo { background-position: -119.0px -425.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_UndoLarge { background-position: -238px -850px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_UnprotectDocument { background-position: 0.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UnprotectDocumentDisabled { background-position: 0.0px -119.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UnprotectDocumentLarge { background-position: 0px -238px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_UnprotectDocumentLargeDisabled { background-position: 0px -238px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_UnprotectDocument { background-position: 0.0px -374.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_UnprotectDocumentLarge { background-position: 0px -748px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_UpdateField { background-position: -85.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UpdateFieldDisabled { background-position: -85.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UpdateFieldLarge { background-position: -170px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_UpdateFieldLargeDisabled { background-position: -170px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_UpdateField { background-position: -85.0px -391.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_UpdateFieldLarge { background-position: -170px -782px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_UpdateTableOfContents { background-position: -102.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UpdateTableOfContentsDisabled { background-position: -102.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_UpdateTableOfContentsLarge { background-position: -204px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_UpdateTableOfContentsLargeDisabled { background-position: -204px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_UpdateTableOfContents { background-position: -102.0px -391.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_UpdateTableOfContentsLarge { background-position: -204px -782px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ViewMergedData { background-position: -68.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ViewMergedDataDisabled { background-position: -68.0px -102.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ViewMergedDataLarge { background-position: -136px -204px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ViewMergedDataLargeDisabled { background-position: -136px -204px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ViewMergedData { background-position: -68.0px -357.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ViewMergedDataLarge { background-position: -136px -714px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ViewTableGridlines { background-position: -238.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ViewTableGridlinesDisabled { background-position: -238.0px -68.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ViewTableGridlinesLarge { background-position: -476px -136px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ViewTableGridlinesLargeDisabled { background-position: -476px -136px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ViewTableGridlines { background-position: -238.0px -323.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ViewTableGridlinesLarge { background-position: -476px -646px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ZoomIn { background-position: -136.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ZoomInDisabled { background-position: -136.0px -187.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ZoomInLarge { background-position: -272px -374px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ZoomInLargeDisabled { background-position: -272px -374px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ZoomIn { background-position: -136.0px -442.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ZoomInLarge { background-position: -272px -884px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ZoomOut { background-position: -204.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ZoomOutDisabled { background-position: -204.0px -136.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
.dxRichEdit_SVGIcon_ZoomOutLarge { background-position: -408px -272px; background-size: 538px auto; width: 32px; height: 32px } 
.dxRichEdit_SVGIcon_ZoomOutLargeDisabled { background-position: -408px -272px; background-size: 538px auto; width: 32px; height: 32px; opacity: 0.5 } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ZoomOut { background-position: -204.0px -391.0px; background-size: 269.0px auto; width: 16px; height: 16px } 
 .dxm-main .dxm-hovered .dxRichEdit_SVGIcon_ZoomOutLarge { background-position: -408px -782px; background-size: 538px auto; width: 32px; height: 32px } 
   d  BMd      b   (                                  jii     qqp mml BBB 













































	

	




















	








	  @ var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    }
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var ASPx;
(function (ASPx) {
    var RichEditCommands = (function () {
        function RichEditCommands(core) {
            this._core = core;
        }
        RichEditCommands.prototype.beginUpdate = function () {
            this._core.beginUpdate();
        };
        RichEditCommands.prototype.endUpdate = function () {
            this._core.endUpdate();
        };
        Object.defineProperty(RichEditCommands.prototype, "fileNew", {
            get: function () {
                return new ASPx.FileNewCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "fileOpen", {
            get: function () {
                return new ASPx.FileOpenCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "fileOpenDialog", {
            get: function () {
                return new ASPx.FileOpenDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "fileSave", {
            get: function () {
                return new ASPx.FileSaveCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "fileDownload", {
            get: function () {
                return new ASPx.FileDownloadCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "fileSaveAs", {
            get: function () {
                return new ASPx.FileSaveAsCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "fileSaveAsDialog", {
            get: function () {
                return new ASPx.FileSaveAsDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "filePrint", {
            get: function () {
                return new ASPx.FilePrintCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "undo", {
            get: function () {
                return new ASPx.UndoCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "redo", {
            get: function () {
                return new ASPx.RedoCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "copy", {
            get: function () {
                return new ASPx.CopyCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "paste", {
            get: function () {
                return new ASPx.PasteCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "cut", {
            get: function () {
                return new ASPx.CutCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeFontName", {
            get: function () {
                return new ASPx.ChangeFontNameCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeFontSize", {
            get: function () {
                return new ASPx.ChangeFontSizeCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "increaseFontSize", {
            get: function () {
                return new ASPx.IncreaseFontSizeCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "decreaseFontSize", {
            get: function () {
                return new ASPx.DecreaseFontSizeCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "makeTextUpperCase", {
            get: function () {
                return new ASPx.MakeTextUpperCaseCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "makeTextLowerCase", {
            get: function () {
                return new ASPx.MakeTextLowerCaseCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "capitalizeEachWordTextCase", {
            get: function () {
                return new ASPx.CapitalizeEachWordTextCaseCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleTextCase", {
            get: function () {
                return new ASPx.ToggleTextCaseCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeFontBold", {
            get: function () {
                return new ASPx.ChangeFontBoldCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeFontItalic", {
            get: function () {
                return new ASPx.ChangeFontItalicCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeFontUnderline", {
            get: function () {
                return new ASPx.ChangeFontUnderlineCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeFontStrikeout", {
            get: function () {
                return new ASPx.ChangeFontStrikeoutCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeFontSuperscript", {
            get: function () {
                return new ASPx.ChangeFontSuperscriptCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeFontSubscript", {
            get: function () {
                return new ASPx.ChangeFontSubscriptCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeFontForeColor", {
            get: function () {
                return new ASPx.ChangeFontForeColorCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeFontBackColor", {
            get: function () {
                return new ASPx.ChangeFontBackColorCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "clearFormatting", {
            get: function () {
                return new ASPx.ClearFormattingCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeStyle", {
            get: function () {
                return new ASPx.ChangeStyleCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleBulletedList", {
            get: function () {
                return new ASPx.ToggleBulletedListCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleNumberingList", {
            get: function () {
                return new ASPx.ToggleNumberingListCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleMultilevelList", {
            get: function () {
                return new ASPx.ToggleMultilevelListCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "increaseIndent", {
            get: function () {
                return new ASPx.IncreaseIndentCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "decreaseIndent", {
            get: function () {
                return new ASPx.DecreaseIndentCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "showHiddenSymbols", {
            get: function () {
                return new ASPx.ShowHiddenSymbolsCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleParagraphAlignmentLeft", {
            get: function () {
                return new ASPx.ToggleParagraphAlignmentLeftCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleParagraphAlignmentCenter", {
            get: function () {
                return new ASPx.ToggleParagraphAlignmentCenterCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleParagraphAlignmentRight", {
            get: function () {
                return new ASPx.ToggleParagraphAlignmentRightCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleParagraphAlignmentJustify", {
            get: function () {
                return new ASPx.ToggleParagraphAlignmentJustifyCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "setSingleParagraphSpacing", {
            get: function () {
                return new ASPx.SetSingleParagraphSpacingCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "setSesquialteralParagraphSpacing", {
            get: function () {
                return new ASPx.SetSesquialteralParagraphSpacingCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "setDoubleParagraphSpacing", {
            get: function () {
                return new ASPx.SetDoubleParagraphSpacingCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "addSpacingBeforeParagraph", {
            get: function () {
                return new ASPx.AddSpacingBeforeParagraphCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "addSpacingAfterParagraph", {
            get: function () {
                return new ASPx.AddSpacingAfterParagraphCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "removeSpacingBeforeParagraph", {
            get: function () {
                return new ASPx.RemoveSpacingBeforeParagraphCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "removeSpacingAfterParagraph", {
            get: function () {
                return new ASPx.RemoveSpacingAfterParagraphCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeParagraphBackColor", {
            get: function () {
                return new ASPx.ChangeParagraphBackColorCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "openFontFormattingDialog", {
            get: function () {
                return new ASPx.OpenFontFormattingDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeFontFormatting", {
            get: function () {
                return new ASPx.ChangeFontFormattingCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "openParagraphFormattingDialog", {
            get: function () {
                return new ASPx.OpenParagraphFormattingDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeParagraphFormatting", {
            get: function () {
                return new ASPx.ChangeParagraphFormattingCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertPageBreak", {
            get: function () {
                return new ASPx.InsertPageBreakCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "openInsertTableDialog", {
            get: function () {
                return new ASPx.OpenInsertTableDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertTable", {
            get: function () {
                return new ASPx.InsertTableCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "openInsertPictureDialog", {
            get: function () {
                return new ASPx.OpenInsertPictureDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertPicture", {
            get: function () {
                return new ASPx.InsertPictureCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "openInsertBookmarkDialog", {
            get: function () {
                return new ASPx.OpenInsertBookmarkDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertBookmark", {
            get: function () {
                return new ASPx.InsertBookmarkCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "deleteBookmark", {
            get: function () {
                return new ASPx.DeleteBookmarkCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "goToBookmark", {
            get: function () {
                return new ASPx.GoToBookmarkCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "openInsertHyperlinkDialog", {
            get: function () {
                return new ASPx.OpenInsertHyperlinkDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertHyperlink", {
            get: function () {
                return new ASPx.InsertHyperlinkCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "deleteHyperlink", {
            get: function () {
                return new ASPx.DeleteHyperlinkCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "deleteHyperlinks", {
            get: function () {
                return new ASPx.DeleteHyperlinksCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "openHyperlink", {
            get: function () {
                return new ASPx.OpenHyperlinkCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "openInsertSymbolDialog", {
            get: function () {
                return new ASPx.OpenInsertSymbolDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertSymbol", {
            get: function () {
                return new ASPx.InsertSymbolCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changePageMargins", {
            get: function () {
                return new ASPx.ChangePageMarginsCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "openPageMarginsDialog", {
            get: function () {
                return new ASPx.OpenPageMarginsDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changePageOrientation", {
            get: function () {
                return new ASPx.ChangePageOrientationCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "setPageSizeDialog", {
            get: function () {
                return new ASPx.SetPageSizeDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "openPagePaperSizeDialog", {
            get: function () {
                return new ASPx.OpenPagePaperSizeDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changePageSize", {
            get: function () {
                return new ASPx.ChangePageSizeCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeSectionEqualColumnCount", {
            get: function () {
                return new ASPx.ChangeSectionEqualColumnCountCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "openSectionColumnsDialog", {
            get: function () {
                return new ASPx.OpenSectionColumnsDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeSectionColumns", {
            get: function () {
                return new ASPx.ChangeSectionColumnsCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertColumnBreak", {
            get: function () {
                return new ASPx.InsertColumnBreakCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertSectionBreakNextPage", {
            get: function () {
                return new ASPx.InsertSectionBreakNextPageCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertSectionBreakEvenPage", {
            get: function () {
                return new ASPx.InsertSectionBreakEvenPageCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertSectionBreakOddPage", {
            get: function () {
                return new ASPx.InsertSectionBreakOddPageCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changePageColor", {
            get: function () {
                return new ASPx.ChangePageColorCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "showHorizontalRuler", {
            get: function () {
                return new ASPx.ShowHorizontalRulerCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "setFullscreen", {
            get: function () {
                return new ASPx.SetFullscreenCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeViewType", {
            get: function () {
                return new ASPx.ChangeViewTypeCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "forceSyncWithServer", {
            get: function () {
                return new ASPx.ForceSyncWithServerCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertContentFromServer", {
            get: function () {
                return new ASPx.InsertContentFromServerCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "openNumberingListDialog", {
            get: function () {
                return new ASPx.OpenNumberingListDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertParagraph", {
            get: function () {
                return new ASPx.InsertParagraphCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertText", {
            get: function () {
                return new ASPx.InsertTextCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "delete", {
            get: function () {
                return new ASPx.DeleteCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "removePrevWord", {
            get: function () {
                return new ASPx.RemovePrevWordCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "removeNextWord", {
            get: function () {
                return new ASPx.RemoveNextWordCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "backspace", {
            get: function () {
                return new ASPx.BackspaceCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertLineBreak", {
            get: function () {
                return new ASPx.InsertLineBreakCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changePictureScale", {
            get: function () {
                return new ASPx.ChangePictureScaleCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "incrementParagraphLeftIndent", {
            get: function () {
                return new ASPx.IncrementParagraphLeftIndentCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "decrementParagraphLeftIndent", {
            get: function () {
                return new ASPx.DecrementParagraphLeftIndentCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "moveContent", {
            get: function () {
                return new ASPx.MoveContentCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "copyContent", {
            get: function () {
                return new ASPx.CopyContentCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertTab", {
            get: function () {
                return new ASPx.InsertTabCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertNonBreakingSpace", {
            get: function () {
                return new ASPx.InsertNonBreakingSpaceCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "openTabsDialog", {
            get: function () {
                return new ASPx.OpenTabsDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeTabs", {
            get: function () {
                return new ASPx.ChangeTabsCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "openCustomNumberingListDialog", {
            get: function () {
                return new ASPx.OpenCustomNumberingListDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeCustomNumberingList", {
            get: function () {
                return new ASPx.ChangeCustomNumberingListCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "restartNumberingList", {
            get: function () {
                return new ASPx.RestartNumberingListCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "incrementNumberingIndent", {
            get: function () {
                return new ASPx.IncrementNumberingIndentCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "decrementNumberingIndent", {
            get: function () {
                return new ASPx.DecrementNumberingIndentCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "createField", {
            get: function () {
                return new ASPx.CreateFieldCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "updateField", {
            get: function () {
                return new ASPx.UpdateFieldCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "showFieldCodes", {
            get: function () {
                return new ASPx.ShowFieldCodesCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "showAllFieldCodes", {
            get: function () {
                return new ASPx.ShowAllFieldCodesCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "continueNumberingList", {
            get: function () {
                return new ASPx.ContinueNumberingListCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertNumeration", {
            get: function () {
                return new ASPx.InsertNumerationCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "removeNumeration", {
            get: function () {
                return new ASPx.RemoveNumerationCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "updateAllFields", {
            get: function () {
                return new ASPx.UpdateAllFieldsCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "createDateField", {
            get: function () {
                return new ASPx.CreateDateFieldCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "createTimeField", {
            get: function () {
                return new ASPx.CreateTimeFieldCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "createPageField", {
            get: function () {
                return new ASPx.CreatePageFieldCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertFiguresCaption", {
            get: function () {
                return new ASPx.InsertFiguresCaptionCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertTablesCaption", {
            get: function () {
                return new ASPx.InsertTablesCaptionCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertEquationsCaption", {
            get: function () {
                return new ASPx.InsertEquationsCaptionCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertTableOfFigures", {
            get: function () {
                return new ASPx.InsertTableOfFiguresCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertTableOfTables", {
            get: function () {
                return new ASPx.InsertTableOfTablesCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertTableOfEquations", {
            get: function () {
                return new ASPx.InsertTableOfEquationsCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertTableOfContents", {
            get: function () {
                return new ASPx.InsertTableOfContentsCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeHyperlink", {
            get: function () {
                return new ASPx.ChangeHyperlinkCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "updateTableOfContents", {
            get: function () {
                return new ASPx.UpdateTableOfContentsCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "setParagraphLevel", {
            get: function () {
                return new ASPx.SetParagraphLevelCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "makeTextSentenceCase", {
            get: function () {
                return new ASPx.MakeTextSentenceCaseCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "switchTextCase", {
            get: function () {
                return new ASPx.SwitchTextCaseCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "goToFirstDataRecord", {
            get: function () {
                return new ASPx.GoToFirstDataRecordCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "goToPreviousDataRecord", {
            get: function () {
                return new ASPx.GoToPreviousDataRecordCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "goToNextDataRecord", {
            get: function () {
                return new ASPx.GoToNextDataRecordCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "goToDataRecord", {
            get: function () {
                return new ASPx.GoToDataRecordCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "goToLastDataRecord", {
            get: function () {
                return new ASPx.GoToLastDataRecordCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "showMergedData", {
            get: function () {
                return new ASPx.ShowMergedDataCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "mergeFieldDialog", {
            get: function () {
                return new ASPx.MergeFieldDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "createMergeField", {
            get: function () {
                return new ASPx.CreateMergeFieldCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "mailMergeDialog", {
            get: function () {
                return new ASPx.MailMergeDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "mailMergeAndDownload", {
            get: function () {
                return new ASPx.MailMergeAndDownloadCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "mailMergeAndSaveAs", {
            get: function () {
                return new ASPx.MailMergeAndSaveAsCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertHeader", {
            get: function () {
                return new ASPx.InsertHeaderCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertFooter", {
            get: function () {
                return new ASPx.InsertFooterCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "linkHeaderFooterToPrevious", {
            get: function () {
                return new ASPx.LinkHeaderFooterToPreviousCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "goToFooter", {
            get: function () {
                return new ASPx.GoToFooterCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "goToHeader", {
            get: function () {
                return new ASPx.GoToHeaderCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "goToNextHeaderFooter", {
            get: function () {
                return new ASPx.GoToNextHeaderFooterCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "goToPreviousHeaderFooter", {
            get: function () {
                return new ASPx.GoToPreviousHeaderFooterCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "setDifferentFirstPageHeaderFooter", {
            get: function () {
                return new ASPx.SetDifferentFirstPageHeaderFooterCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "setDifferentOddAndEvenPagesHeaderFooter", {
            get: function () {
                return new ASPx.SetDifferentOddAndEvenPagesHeaderFooterCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "closeHeaderFooter", {
            get: function () {
                return new ASPx.CloseHeaderFooterCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "createPageCountField", {
            get: function () {
                return new ASPx.CreatePageCountFieldCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "openTableFormattingDialog", {
            get: function () {
                return new ASPx.OpenTableFormattingDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeTableFormatting", {
            get: function () {
                return new ASPx.ChangeTableFormattingCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeTableRowPreferredHeight", {
            get: function () {
                return new ASPx.ChangeTableRowPreferredHeightCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeTableCellPreferredWidth", {
            get: function () {
                return new ASPx.ChangeTableCellPreferredWidthCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleTableCellInsideBorders", {
            get: function () {
                return new ASPx.ToggleTableCellInsideBordersCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeTableColumnPreferredWidth", {
            get: function () {
                return new ASPx.ChangeTableColumnPreferredWidthCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeTableCellFormatting", {
            get: function () {
                return new ASPx.ChangeTableCellFormattingCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertTableColumnToTheLeft", {
            get: function () {
                return new ASPx.InsertTableColumnToTheLeftCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertTableColumnToTheRight", {
            get: function () {
                return new ASPx.InsertTableColumnToTheRightCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertTableRowBelow", {
            get: function () {
                return new ASPx.InsertTableRowBelowCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertTableRowAbove", {
            get: function () {
                return new ASPx.InsertTableRowAboveCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "deleteTableRows", {
            get: function () {
                return new ASPx.DeleteTableRowsCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "deleteTableColumns", {
            get: function () {
                return new ASPx.DeleteTableColumnsCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertTableCellWithShiftToTheLeft", {
            get: function () {
                return new ASPx.InsertTableCellWithShiftToTheLeftCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "deleteTableCellsWithShiftHorizontally", {
            get: function () {
                return new ASPx.DeleteTableCellsWithShiftHorizontallyCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "deleteTableCellsWithShiftVertically", {
            get: function () {
                return new ASPx.DeleteTableCellsWithShiftVerticallyCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "deleteTable", {
            get: function () {
                return new ASPx.DeleteTableCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertTableCellsDialog", {
            get: function () {
                return new ASPx.InsertTableCellsDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "deleteTableCellsDialog", {
            get: function () {
                return new ASPx.DeleteTableCellsDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "mergeTableCells", {
            get: function () {
                return new ASPx.MergeTableCellsCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "splitTableCellsDialog", {
            get: function () {
                return new ASPx.SplitTableCellsDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "splitTableCells", {
            get: function () {
                return new ASPx.SplitTableCellsCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertTableCellsWithShiftToTheVertically", {
            get: function () {
                return new ASPx.InsertTableCellsWithShiftToTheVerticallyCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "openTableBordersAndShadingDialog", {
            get: function () {
                return new ASPx.OpenTableBordersAndShadingDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeTableBordersAndShading", {
            get: function () {
                return new ASPx.ChangeTableBordersAndShadingCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleTableCellAlignTopLeft", {
            get: function () {
                return new ASPx.ToggleTableCellAlignTopLeftCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleTableCellAlignTopCenter", {
            get: function () {
                return new ASPx.ToggleTableCellAlignTopCenterCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleTableCellAlignTopRight", {
            get: function () {
                return new ASPx.ToggleTableCellAlignTopRightCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleTableCellAlignMiddleLeft", {
            get: function () {
                return new ASPx.ToggleTableCellAlignMiddleLeftCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleTableCellAlignMiddleCenter", {
            get: function () {
                return new ASPx.ToggleTableCellAlignMiddleCenterCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleTableCellAlignMiddleRight", {
            get: function () {
                return new ASPx.ToggleTableCellAlignMiddleRightCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleTableCellAlignBottomLeft", {
            get: function () {
                return new ASPx.ToggleTableCellAlignBottomLeftCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleTableCellAlignBottomCenter", {
            get: function () {
                return new ASPx.ToggleTableCellAlignBottomCenterCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleTableCellAlignBottomRight", {
            get: function () {
                return new ASPx.ToggleTableCellAlignBottomRightCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeTableStyle", {
            get: function () {
                return new ASPx.ChangeTableStyleCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleTableCellTopBorder", {
            get: function () {
                return new ASPx.ToggleTableCellTopBorderCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleTableCellRightBorder", {
            get: function () {
                return new ASPx.ToggleTableCellRightBorderCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleTableCellBottomBorder", {
            get: function () {
                return new ASPx.ToggleTableCellBottomBorderCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleTableCellLeftBorder", {
            get: function () {
                return new ASPx.ToggleTableCellLeftBorderCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "removeTableCellBorders", {
            get: function () {
                return new ASPx.RemoveTableCellBordersCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleTableCellAllBorders", {
            get: function () {
                return new ASPx.ToggleTableCellAllBordersCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleTableCellInsideHorizontalBorders", {
            get: function () {
                return new ASPx.ToggleTableCellInsideHorizontalBordersCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleTableCellInsideVerticalBorders", {
            get: function () {
                return new ASPx.ToggleTableCellInsideVerticalBordersCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleTableCellOutsideBorders", {
            get: function () {
                return new ASPx.ToggleTableCellOutsideBordersCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeTableLook", {
            get: function () {
                return new ASPx.ChangeTableLookCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeTableBorderRepositoryItem", {
            get: function () {
                return new ASPx.ChangeTableBorderRepositoryItemCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeTableCellShading", {
            get: function () {
                return new ASPx.ChangeTableCellShadingCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "showTableGridLines", {
            get: function () {
                return new ASPx.ShowTableGridLinesCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleTableAutoFitContents", {
            get: function () {
                return new ASPx.ToggleTableAutoFitContentsCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleTableAutoFitWindow", {
            get: function () {
                return new ASPx.ToggleTableAutoFitWindowCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "toggleTableFixedColumnWidth", {
            get: function () {
                return new ASPx.ToggleTableFixedColumnWidthCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "openFindPanel", {
            get: function () {
                return new ASPx.OpenFindPanelCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "openFindAndReplaceDialog", {
            get: function () {
                return new ASPx.OpenFindAndReplaceDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "findAll", {
            get: function () {
                return new ASPx.FindAllCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "hideFindResults", {
            get: function () {
                return new ASPx.HideFindResultsCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "replaceAll", {
            get: function () {
                return new ASPx.ReplaceAllCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "replaceNext", {
            get: function () {
                return new ASPx.ReplaceNextCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "openSpellingDialog", {
            get: function () {
                return new ASPx.OpenSpellingDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "assignShortcut", {
            get: function () {
                return new ASPx.AssignShortcutCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "openLayoutOptionsDialog", {
            get: function () {
                return new ASPx.OpenLayoutOptionsDialogCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertFloatingTextBox", {
            get: function () {
                return new ASPx.InsertFloatingTextBoxCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeFloatingObjectAlignmentPosition", {
            get: function () {
                return new ASPx.ChangeFloatingObjectAlignmentPositionCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeFloatingObjectAbsolutePosition", {
            get: function () {
                return new ASPx.ChangeFloatingObjectAbsolutePositionCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeFloatingObjectRelativePosition", {
            get: function () {
                return new ASPx.ChangeFloatingObjectRelativePositionCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeFloatingObjectLockAnchor", {
            get: function () {
                return new ASPx.ChangeFloatingObjectLockAnchorCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeFloatingObjectTextWrapping", {
            get: function () {
                return new ASPx.ChangeFloatingObjectTextWrappingCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeFloatingObjectAbsoluteSize", {
            get: function () {
                return new ASPx.ChangeFloatingObjectAbsoluteSizeCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeTextBoxRelativeSize", {
            get: function () {
                return new ASPx.ChangeTextBoxRelativeSizeCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeFloatingObjectRotation", {
            get: function () {
                return new ASPx.ChangeFloatingObjectRotationCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeFloatingObjectLockAspectRatio", {
            get: function () {
                return new ASPx.ChangeFloatingObjectLockAspectRatioCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeFloatingObjectFillColor", {
            get: function () {
                return new ASPx.ChangeFloatingObjectFillColorCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeFloatingObjectOutlineColor", {
            get: function () {
                return new ASPx.ChangeFloatingObjectOutlineColorCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeFloatingObjectOutlineWidth", {
            get: function () {
                return new ASPx.ChangeFloatingObjectOutlineWidthCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeTextBoxContentMargins", {
            get: function () {
                return new ASPx.ChangeTextBoxContentMarginsCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "changeTextBoxResizeShapeToFitText", {
            get: function () {
                return new ASPx.ChangeTextBoxResizeShapeToFitTextCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertHtml", {
            get: function () {
                return new ASPx.InsertHtmlCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "insertRtf", {
            get: function () {
                return new ASPx.InsertRtfCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditCommands.prototype, "getRtf", {
            get: function () {
                return new ASPx.GetRtfCommand(this._core);
            },
            enumerable: true,
            configurable: true
        });
        return RichEditCommands;
    }());
    ASPx.RichEditCommands = RichEditCommands;
    var CommandBase = (function () {
        function CommandBase(core) {
            this._hasValue = false;
            this._core = core;
        }
        Object.defineProperty(CommandBase.prototype, "coreCommand", {
            get: function () {
                return this._core.commandManager.getCommand(this._coreCommandId);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(CommandBase.prototype, "coreState", {
            get: function () {
                return this.coreCommand.getState();
            },
            enumerable: true,
            configurable: true
        });
        return CommandBase;
    }());
    ASPx.CommandBase = CommandBase;
    var CommandDialogBase = (function (_super) {
        __extends(CommandDialogBase, _super);
        function CommandDialogBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CommandDialogBase.prototype.applyParameters = function (initParameters, newParameters, command) {
            if (!command)
                command = this.coreCommand;
            var modifiedState = this._core.getModifiedState();
            this._core.beginUpdate();
            var result = command.applyParameters(this.coreState, newParameters, initParameters);
            this._core.endUpdate();
            command.updateControlState(modifiedState);
            return result;
        };
        return CommandDialogBase;
    }(CommandBase));
    ASPx.CommandDialogBase = CommandDialogBase;
    var CommandWithSimpleStateBase = (function (_super) {
        __extends(CommandWithSimpleStateBase, _super);
        function CommandWithSimpleStateBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        return CommandWithSimpleStateBase;
    }(CommandBase));
    ASPx.CommandWithSimpleStateBase = CommandWithSimpleStateBase;
    var CommandWithSimpleStateDialogBase = (function (_super) {
        __extends(CommandWithSimpleStateDialogBase, _super);
        function CommandWithSimpleStateDialogBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        return CommandWithSimpleStateDialogBase;
    }(CommandDialogBase));
    ASPx.CommandWithSimpleStateDialogBase = CommandWithSimpleStateDialogBase;
    var CommandWithBooleanStateBase = (function (_super) {
        __extends(CommandWithBooleanStateBase, _super);
        function CommandWithBooleanStateBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        return CommandWithBooleanStateBase;
    }(CommandBase));
    ASPx.CommandWithBooleanStateBase = CommandWithBooleanStateBase;
    var SimpleCommandState = (function () {
        function SimpleCommandState(visible, enabled) {
            this.visible = visible;
            this.enabled = enabled;
        }
        return SimpleCommandState;
    }());
    ASPx.SimpleCommandState = SimpleCommandState;
    var CommandState = (function (_super) {
        __extends(CommandState, _super);
        function CommandState(visible, enabled, value) {
            var _this = _super.call(this, visible, enabled) || this;
            _this.value = value;
            return _this;
        }
        return CommandState;
    }(SimpleCommandState));
    ASPx.CommandState = CommandState;
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var ApiParameterDescriptor = (function () {
        function ApiParameterDescriptor(parameterName, parameterType, typeAssertion, getResult) {
            this.parameterName = parameterName;
            this.parameterType = parameterType;
            this.typeAssertion = typeAssertion;
            this.getResult = getResult;
        }
        ApiParameterDescriptor.prototype.getStringRepresentation = function (canBeUndefined) {
            return this.parameterName + ": " + this.parameterType + (canBeUndefined ? "|undefined" : "");
        };
        return ApiParameterDescriptor;
    }());
    ASPx.ApiParameterDescriptor = ApiParameterDescriptor;
    var ApiParametersChecker = (function () {
        function ApiParametersChecker() {
        }
        ApiParametersChecker.check = function (value, parameterIndex, canBeUndefined, pairs) {
            for (var _i = 0, pairs_1 = pairs; _i < pairs_1.length; _i++) {
                var pair = pairs_1[_i];
                if (pair.typeAssertion(value))
                    return pair.getResult(value);
            }
            if (canBeUndefined && value === undefined)
                return undefined;
            ApiParametersChecker.showErrorString(parameterIndex, canBeUndefined, pairs);
        };
        ApiParametersChecker.showErrorString = function (parameterIndex, canBeUndefined, pairs) {
            var pairStringRepresentation = __aspxRichEdit.ListUtils.map(pairs, function (pair) { return pair.getStringRepresentation(canBeUndefined); });
            var parameterIndexAsString;
            switch (parameterIndex) {
                case 1:
                    parameterIndexAsString = "First";
                    break;
                case 2:
                    parameterIndexAsString = "Second";
                    break;
                case 3:
                    parameterIndexAsString = "Third";
                    break;
                case 4:
                    parameterIndexAsString = "Fourth";
                    break;
                case 5:
                    parameterIndexAsString = "Fifth";
                    break;
                case 6:
                    parameterIndexAsString = "Sixth";
                    break;
                case 7:
                    parameterIndexAsString = "Seventh";
                    break;
                case 8:
                    parameterIndexAsString = "Eighth";
                    break;
                case 9:
                    parameterIndexAsString = "Ninth";
                    break;
                case 10:
                    parameterIndexAsString = "Tenth";
                    break;
                default:
                    parameterIndexAsString = "One of the last";
                    break;
            }
            throw new Error(parameterIndexAsString + " parameter must be one of [" + pairStringRepresentation.join(", ") + "]");
        };
        ApiParametersChecker.defaultDescriptor = function (getResult) {
            return new ApiParameterDescriptor("", "", function () { return true; }, getResult);
        };
        ApiParametersChecker.numberDescriptor = function (parameterName, getResult, minBound, maxBound) {
            if (minBound === void 0) { minBound = __aspxRichEdit.Constants.MIN_SAFE_INTEGER; }
            if (maxBound === void 0) { maxBound = __aspxRichEdit.Constants.MAX_SAFE_INTEGER; }
            return new ApiParameterDescriptor(parameterName, "number on interval [" + minBound + ", " + maxBound + "]", function (value) { return __aspxRichEdit.Utils.isNumber(value) && (value >= minBound && value < maxBound); }, getResult);
        };
        ApiParametersChecker.booleanDescriptor = function (parameterName, getResult) {
            return new ApiParameterDescriptor(parameterName, "boolean", function (value) { return typeof value === "boolean"; }, getResult);
        };
        ApiParametersChecker.arrayDescriptor = function (parameterName, getResult) {
            return new ApiParameterDescriptor(parameterName, "array", function (value) { return value instanceof Array; }, getResult);
        };
        ApiParametersChecker.functionDescriptor = function (parameterName, getResult) {
            return new ApiParameterDescriptor(parameterName, "function", function (value) { return typeof value === "function"; }, getResult);
        };
        ApiParametersChecker.stringDescriptor = function (parameterName, getResult, canBeEmpty) {
            return new ApiParameterDescriptor(parameterName, "string", function (value) { return (typeof value === "string") && (canBeEmpty || !!value.length); }, getResult);
        };
        ApiParametersChecker.stringDescriptorPredefined = function (parameterName, map, canBeEmpty) {
            return new ApiParameterDescriptor(parameterName, "string of constants(" + __aspxRichEdit.MapUtilsKeyAsString.toList(__aspxRichEdit.MapUtilsKeyAsString.map(map, function (_e, key) { return "\"" + key + "\""; })).join(", ") + ")", function (value) { return (typeof value === "string") && (canBeEmpty || !!value.length) && map[value] !== undefined; }, function (val) { return map[val]; });
        };
        ApiParametersChecker.regExpDescriptor = function (parameterName, getResult) {
            return new ApiParameterDescriptor(parameterName, "RegExp", function (value) { return (typeof value === "object"); }, getResult);
        };
        ApiParametersChecker.intervalDescriptor = function (parameterName, getResult, minBound, maxBound) {
            if (minBound === void 0) { minBound = __aspxRichEdit.Constants.MIN_SAFE_INTEGER; }
            if (maxBound === void 0) { maxBound = __aspxRichEdit.Constants.MAX_SAFE_INTEGER; }
            return new ApiParameterDescriptor(parameterName, "ASPx.Interval on interval [" + minBound + ", " + maxBound + ")", function (value) { return (value instanceof ASPx.Interval) && value.start >= minBound && value.start + value.length <= maxBound; }, getResult);
        };
        ApiParametersChecker.intervalsDescriptor = function (parameterName, getResult, minBound, maxBound) {
            return new ApiParameterDescriptor(parameterName, "ASPx.Interval[] on interval [" + minBound + ", " + maxBound + ")", function (intervals) { return __aspxRichEdit.ListUtils.isList(intervals) && __aspxRichEdit.ListUtils.allOf(intervals, function (interval) {
                return (interval instanceof ASPx.Interval) && interval.start >= minBound && interval.start + interval.length <= maxBound;
            }); }, getResult);
        };
        ApiParametersChecker.enumDescriptor = function (parameterName, getResult, enumTypeObj, enumTypeName) {
            return new ApiParameterDescriptor(parameterName, enumTypeName, function (value) { return enumTypeObj[value] !== undefined; }, getResult);
        };
        ApiParametersChecker.objectDescriptor = function (parameterName, objectTypeAsString, getResult) {
            return new ApiParameterDescriptor(parameterName, objectTypeAsString, function (value) { return typeof value === "object"; }, getResult);
        };
        ApiParametersChecker.colorDescriptors = function (parameterName) {
            return [
                new ApiParameterDescriptor(parameterName, "\"Auto\"", function (value) { return typeof value === "string" && value.toLowerCase() == "auto"; }, function (_value) { return __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR; }),
                new ApiParameterDescriptor(parameterName, "\"NoColor\"", function (value) { return typeof value === "string" && value.toLowerCase() == "nocolor"; }, function (_value) { return __aspxRichEdit.ColorHelper.NO_COLOR; }),
                new ApiParameterDescriptor(parameterName, "KnownColorName(darkblue, darkcyan, etc)", function (value) { return typeof value === "string" && __aspxRichEdit.ColorHelper.colorNames[value.toLowerCase()]; }, function (value) { return __aspxRichEdit.ColorHelper.stringToColor(__aspxRichEdit.ColorHelper.colorNames[value.toLowerCase()]); }),
                new ApiParameterDescriptor(parameterName, "HEX(#354843)|RGB(A)(0%, 0%, 0%);", function (value) {
                    if (typeof value !== "string")
                        return false;
                    var val = __aspxRichEdit.ColorHelper.stringToColor(value.toLowerCase());
                    return val !== null && val != undefined;
                }, function (value) { return __aspxRichEdit.ColorHelper.stringToColor(value.toLowerCase()); })
            ];
        };
        ApiParametersChecker.subDocumentById = function (subDocumentId, parameterIndex, canBeUndefined, _core, isShowErrorIfIdNotFound) {
            var pairs = [ApiParametersChecker.numberDescriptor("subDocumentId", function (id) { return _core.model.subDocuments[id]; })];
            var subDocument = ApiParametersChecker.check(subDocumentId, parameterIndex, canBeUndefined, pairs);
            if (subDocument)
                return subDocument;
            if (subDocumentId === undefined)
                return _core.model.activeSubDocument;
            if (isShowErrorIfIdNotFound)
                ApiParametersChecker.showErrorString(parameterIndex, canBeUndefined, pairs);
            return null;
        };
        return ApiParametersChecker;
    }());
    ASPx.ApiParametersChecker = ApiParametersChecker;
    var ApiUtils = (function () {
        function ApiUtils() {
        }
        ApiUtils.makeInterval = function (from) {
            return new ASPx.Interval(from.start, from.length);
        };
        ApiUtils.getAllRunsByFullSearch = function (sd, callback) {
            var it = new __aspxRichEdit.ModelIterator(sd, false);
            it.setPosition(0);
            do {
                if (callback(it))
                    return it;
            } while (it.moveToNextRun());
            return null;
        };
        ApiUtils.internalColorToApiColor = function (color) {
            if (color === undefined)
                return undefined;
            if (color === __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR)
                return "Auto";
            if (color === __aspxRichEdit.ColorHelper.NO_COLOR)
                return "NoColor";
            return __aspxRichEdit.ColorHelper.colorToHash(color).toUpperCase();
        };
        ApiUtils.getBackApiColor = function (characterProperties, colorProvider) {
            var highlightColor = characterProperties.highlightColor;
            var backColor = characterProperties.shadingInfo ? characterProperties.shadingInfo.backColor : undefined;
            if (highlightColor)
                if (highlightColor.isEmpty || highlightColor.toRgb(colorProvider) == __aspxRichEdit.ColorHelper.NO_COLOR)
                    if (backColor)
                        if (backColor.isEmpty)
                            return ApiUtils.internalColorToApiColor(__aspxRichEdit.ColorHelper.NO_COLOR);
                        else
                            return ApiUtils.internalColorToApiColor(backColor.toRgb(colorProvider));
                    else
                        return undefined;
                else
                    return ApiUtils.internalColorToApiColor(highlightColor.toRgb(colorProvider));
            else
                return undefined;
        };
        ApiUtils.assertObject = function (value, parameter) {
            if (typeof value !== "object")
                throw new Error(parameter + " must be object");
        };
        ApiUtils.assertBoolean = function (value, parameter) {
            if (typeof value !== "boolean")
                throw new Error(parameter + " must be boolean or undefined");
        };
        ApiUtils.assertArray = function (value, parameter) {
            if (!(value instanceof Array))
                throw new Error(parameter + " must be array or undefined");
        };
        ApiUtils.assertNumber = function (value, parameter) {
            if (!__aspxRichEdit.Utils.isNumber(value))
                throw new Error(parameter + " must be number or undefined");
        };
        ApiUtils.assertNonNegativeNumber = function (value, parameter) {
            ApiUtils.assertNumber(value, parameter);
            if (value < 0)
                throw new Error(parameter + " must be non-negative");
        };
        ApiUtils.assertNumberByBounds = function (value, minValue, maxValue, parameter) {
            ApiUtils.assertNumber(value, parameter);
            if (value < minValue || value > maxValue)
                throw new Error(parameter + " must be between " + minValue + " and " + maxValue);
        };
        ApiUtils.assertPositiveNumber = function (value, parameter) {
            ApiUtils.assertNumber(value, parameter);
            if (value <= 0)
                throw new Error(parameter + " must be positive");
        };
        ApiUtils.assertFunction = function (value, parameter) {
            if (typeof value !== "function")
                throw new Error(parameter + " must be function");
        };
        ApiUtils.assertString = function (value, notEmpty, parameter) {
            if (typeof value !== "string")
                throw new Error(parameter + " must be string or undefined");
            if (notEmpty && !value)
                throw new Error(parameter + " must be non-empty or undefined");
        };
        ApiUtils.assertAndConvertColor = function (value, allowNull, parameter) {
            var typeMessage = parameter + " must be string" + (allowNull ? " or null" : "");
            if (value === undefined)
                throw new Error(typeMessage);
            if (value === null || value === "") {
                if (allowNull)
                    return null;
                throw new Error(typeMessage);
            }
            if (typeof value !== "string")
                throw new Error(typeMessage);
            if (__aspxRichEdit.ColorHelper.colorNames[value])
                value = __aspxRichEdit.ColorHelper.colorNames[value];
            else if (value.length !== 4 && value.length !== 7 && value.charAt(0) != "#")
                throw new Error(parameter + " must be hash code or a known color");
            if (value.toLocaleLowerCase() === "auto")
                return null;
            var color = __aspxRichEdit.ColorHelper.stringToColor(value);
            if (color === null)
                throw new Error(parameter + " is unknown color (" + value + ")");
            return color;
        };
        ApiUtils.assertFile = function (value, parameter) {
            if (typeof value === 'string') {
                if (value.length > 0)
                    return;
            }
            throw new Error(parameter + " must be non-empty string or File");
        };
        ApiUtils.assertEnum = function (value, enumType, enumTypeName, parameter) {
            if (enumType[value] === undefined)
                throw new Error(parameter + " must be " + enumTypeName);
        };
        ApiUtils.isNullOrEmptyString = function (value) {
            return value === null || value === "";
        };
        ApiUtils.createSimpleState = function (state) {
            return new ASPx.SimpleCommandState(state.visible, state.enabled && state.visible);
        };
        ApiUtils.createState = function (state) {
            return new ASPx.CommandState(state.visible, state.enabled && state.visible, state.value);
        };
        ApiUtils.createStateWithValue = function (state, value) {
            return new ASPx.CommandState(state.visible, state.enabled && state.visible, value);
        };
        ApiUtils.createParagraphStyle = function (style, existedStyles) {
            return existedStyles.filter(function (s) { return s.name === style.styleName && s instanceof ASPx.ParagraphStyle; })[0] || new ASPx.ParagraphStyle(style, existedStyles);
        };
        ApiUtils.createCharacterStyle = function (style, existedStyles) {
            return existedStyles.filter(function (s) { return s.name === style.styleName && s instanceof ASPx.CharacterStyle; })[0] || new ASPx.CharacterStyle(style, existedStyles);
        };
        ApiUtils.createTableStyle = function (style, existedStyles) {
            return existedStyles.filter(function (s) { return s.name === style.styleName && s instanceof ASPx.TableStyle; })[0] || new ASPx.TableStyle(style, existedStyles);
        };
        return ApiUtils;
    }());
    ASPx.ApiUtils = ApiUtils;
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var OpenInsertBookmarkDialogCommand = (function (_super) {
        __extends(OpenInsertBookmarkDialogCommand, _super);
        function OpenInsertBookmarkDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowBookmarkForm;
            return _this;
        }
        OpenInsertBookmarkDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        OpenInsertBookmarkDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return OpenInsertBookmarkDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.OpenInsertBookmarkDialogCommand = OpenInsertBookmarkDialogCommand;
    var InsertBookmarkCommand = (function (_super) {
        __extends(InsertBookmarkCommand, _super);
        function InsertBookmarkCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.CreateBookmark;
            return _this;
        }
        InsertBookmarkCommand.prototype.execute = function (name, start, length) {
            name = ASPx.ApiParametersChecker.check(name, 1, false, [
                ASPx.ApiParametersChecker.stringDescriptor("name", function (v) { return v; }, false)
            ]);
            start = ASPx.ApiParametersChecker.check(start, 2, false, [
                ASPx.ApiParametersChecker.numberDescriptor("start", function (v) { return v; }, 0, this._core.model.activeSubDocument.getDocumentEndPosition())
            ]);
            length = ASPx.ApiParametersChecker.check(length, 3, false, [
                ASPx.ApiParametersChecker.numberDescriptor("length", function (v) { return v; }, 0, this._core.model.activeSubDocument.getDocumentEndPosition() - start)
            ]);
            return this.coreCommand.execute(true, new __aspxRichEdit.CommandSimpleOptions(this._core, new __aspxRichEdit.ConstBookmark(new __aspxRichEdit.FixedInterval(start, length), name)));
        };
        InsertBookmarkCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertBookmarkCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertBookmarkCommand = InsertBookmarkCommand;
    var DeleteBookmarkCommand = (function (_super) {
        __extends(DeleteBookmarkCommand, _super);
        function DeleteBookmarkCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.DeleteBookmarks;
            return _this;
        }
        DeleteBookmarkCommand.prototype.execute = function (name) {
            name = ASPx.ApiParametersChecker.check(name, 1, false, [
                ASPx.ApiParametersChecker.stringDescriptor("name", function (v) { return v; }, false)
            ]);
            return this.coreCommand.execute(true, [name]);
        };
        DeleteBookmarkCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return DeleteBookmarkCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.DeleteBookmarkCommand = DeleteBookmarkCommand;
    var GoToBookmarkCommand = (function (_super) {
        __extends(GoToBookmarkCommand, _super);
        function GoToBookmarkCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.GoToBookmark;
            return _this;
        }
        GoToBookmarkCommand.prototype.execute = function (name) {
            name = ASPx.ApiParametersChecker.check(name, 1, false, [
                ASPx.ApiParametersChecker.stringDescriptor("name", function (v) { return v; }, false)
            ]);
            return this.coreCommand.execute(true, name);
        };
        GoToBookmarkCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return GoToBookmarkCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.GoToBookmarkCommand = GoToBookmarkCommand;
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var PasteCommand = (function (_super) {
        __extends(PasteCommand, _super);
        function PasteCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.PasteSelection;
            return _this;
        }
        PasteCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        PasteCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return PasteCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.PasteCommand = PasteCommand;
    var CopyCommand = (function (_super) {
        __extends(CopyCommand, _super);
        function CopyCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.CopySelection;
            return _this;
        }
        CopyCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        CopyCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return CopyCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.CopyCommand = CopyCommand;
    var CutCommand = (function (_super) {
        __extends(CutCommand, _super);
        function CutCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.CutSelection;
            return _this;
        }
        CutCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        CutCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return CutCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.CutCommand = CutCommand;
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var CreateFieldCommand = (function (_super) {
        __extends(CreateFieldCommand, _super);
        function CreateFieldCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.CreateField;
            return _this;
        }
        CreateFieldCommand.prototype.execute = function (code) {
            code = ASPx.ApiParametersChecker.check(code, 1, true, [
                ASPx.ApiParametersChecker.stringDescriptor("code", function (val) { return val; }, true)
            ]);
            return code ?
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.CreateFieldWithCode).execute(true, code) :
                this.coreCommand.execute(true);
        };
        CreateFieldCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return CreateFieldCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.CreateFieldCommand = CreateFieldCommand;
    var UpdateFieldCommand = (function (_super) {
        __extends(UpdateFieldCommand, _super);
        function UpdateFieldCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.UpdateField;
            return _this;
        }
        UpdateFieldCommand.prototype.execute = function (callback) {
            callback = ASPx.ApiParametersChecker.check(callback, 1, true, [
                ASPx.ApiParametersChecker.functionDescriptor("callback", function (val) { return val; })
            ]);
            return this.coreCommand.execute(true, new __aspxRichEdit.UpdateFieldCommandParameters(this._core.model.activeSubDocument, this._core.selection.intervals, callback));
        };
        UpdateFieldCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return UpdateFieldCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.UpdateFieldCommand = UpdateFieldCommand;
    var ShowFieldCodesCommand = (function (_super) {
        __extends(ShowFieldCodesCommand, _super);
        function ShowFieldCodesCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleFieldCodes;
            return _this;
        }
        ShowFieldCodesCommand.prototype.execute = function (showFieldCodes) {
            var arg = ASPx.ApiParametersChecker.check(showFieldCodes, 1, true, [
                ASPx.ApiParametersChecker.booleanDescriptor("showFieldCodes", function (val) { return val; })
            ]);
            return this.coreCommand.execute(true, arg);
        };
        ShowFieldCodesCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return ShowFieldCodesCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.ShowFieldCodesCommand = ShowFieldCodesCommand;
    var ShowAllFieldCodesCommand = (function (_super) {
        __extends(ShowAllFieldCodesCommand, _super);
        function ShowAllFieldCodesCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleAllFields;
            return _this;
        }
        ShowAllFieldCodesCommand.prototype.execute = function (showFieldCodes) {
            showFieldCodes = ASPx.ApiParametersChecker.check(showFieldCodes, 1, true, [
                ASPx.ApiParametersChecker.booleanDescriptor("showFieldCodes", function (val) { return val; })
            ]);
            if (showFieldCodes === undefined)
                return this.coreCommand.execute(true);
            return this._core.commandManager.getCommand(showFieldCodes ?
                __aspxRichEdit.RichEditClientCommand.ShowAllFieldCodes :
                __aspxRichEdit.RichEditClientCommand.ShowAllFieldResults).execute(true);
        };
        ShowAllFieldCodesCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return ShowAllFieldCodesCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.ShowAllFieldCodesCommand = ShowAllFieldCodesCommand;
    var UpdateAllFieldsCommand = (function (_super) {
        __extends(UpdateAllFieldsCommand, _super);
        function UpdateAllFieldsCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.UpdateAllFields;
            return _this;
        }
        UpdateAllFieldsCommand.prototype.execute = function (callback) {
            callback = ASPx.ApiParametersChecker.check(callback, 1, true, [
                ASPx.ApiParametersChecker.functionDescriptor("callback", function (val) { return val; })
            ]);
            var options = new __aspxRichEdit.CommandSimpleOptions(this._core, new __aspxRichEdit.UpdateAllFieldsCommandOptions());
            options.param.callback = callback;
            options.param.updateOptions.updateToc = true;
            return this.coreCommand.execute(true, options);
        };
        UpdateAllFieldsCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return UpdateAllFieldsCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.UpdateAllFieldsCommand = UpdateAllFieldsCommand;
    var CreateDateFieldCommand = (function (_super) {
        __extends(CreateDateFieldCommand, _super);
        function CreateDateFieldCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.CreateDateField;
            return _this;
        }
        CreateDateFieldCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        CreateDateFieldCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return CreateDateFieldCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.CreateDateFieldCommand = CreateDateFieldCommand;
    var CreateTimeFieldCommand = (function (_super) {
        __extends(CreateTimeFieldCommand, _super);
        function CreateTimeFieldCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.CreateTimeField;
            return _this;
        }
        CreateTimeFieldCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        CreateTimeFieldCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return CreateTimeFieldCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.CreateTimeFieldCommand = CreateTimeFieldCommand;
    var CreatePageFieldCommand = (function (_super) {
        __extends(CreatePageFieldCommand, _super);
        function CreatePageFieldCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.CreatePageField;
            return _this;
        }
        CreatePageFieldCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        CreatePageFieldCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return CreatePageFieldCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.CreatePageFieldCommand = CreatePageFieldCommand;
    var InsertFiguresCaptionCommand = (function (_super) {
        __extends(InsertFiguresCaptionCommand, _super);
        function InsertFiguresCaptionCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.CreateFigureCaptionField;
            return _this;
        }
        InsertFiguresCaptionCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertFiguresCaptionCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertFiguresCaptionCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertFiguresCaptionCommand = InsertFiguresCaptionCommand;
    var InsertTablesCaptionCommand = (function (_super) {
        __extends(InsertTablesCaptionCommand, _super);
        function InsertTablesCaptionCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.CreateTableCaptionField;
            return _this;
        }
        InsertTablesCaptionCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertTablesCaptionCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertTablesCaptionCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertTablesCaptionCommand = InsertTablesCaptionCommand;
    var InsertEquationsCaptionCommand = (function (_super) {
        __extends(InsertEquationsCaptionCommand, _super);
        function InsertEquationsCaptionCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.CreateEquationCaptionField;
            return _this;
        }
        InsertEquationsCaptionCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertEquationsCaptionCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertEquationsCaptionCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertEquationsCaptionCommand = InsertEquationsCaptionCommand;
    var InsertTableOfFiguresCommand = (function (_super) {
        __extends(InsertTableOfFiguresCommand, _super);
        function InsertTableOfFiguresCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.CreateTableOfFiguresField;
            return _this;
        }
        InsertTableOfFiguresCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertTableOfFiguresCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertTableOfFiguresCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertTableOfFiguresCommand = InsertTableOfFiguresCommand;
    var InsertTableOfTablesCommand = (function (_super) {
        __extends(InsertTableOfTablesCommand, _super);
        function InsertTableOfTablesCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.CreateTableOfTablesField;
            return _this;
        }
        InsertTableOfTablesCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertTableOfTablesCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertTableOfTablesCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertTableOfTablesCommand = InsertTableOfTablesCommand;
    var InsertTableOfEquationsCommand = (function (_super) {
        __extends(InsertTableOfEquationsCommand, _super);
        function InsertTableOfEquationsCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.CreateTableOfEquationsField;
            return _this;
        }
        InsertTableOfEquationsCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertTableOfEquationsCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertTableOfEquationsCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertTableOfEquationsCommand = InsertTableOfEquationsCommand;
    var InsertTableOfContentsCommand = (function (_super) {
        __extends(InsertTableOfContentsCommand, _super);
        function InsertTableOfContentsCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.CreateTocField;
            return _this;
        }
        InsertTableOfContentsCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertTableOfContentsCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertTableOfContentsCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertTableOfContentsCommand = InsertTableOfContentsCommand;
    var UpdateTableOfContentsCommand = (function (_super) {
        __extends(UpdateTableOfContentsCommand, _super);
        function UpdateTableOfContentsCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.UpdateTableOfContents;
            return _this;
        }
        UpdateTableOfContentsCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        UpdateTableOfContentsCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return UpdateTableOfContentsCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.UpdateTableOfContentsCommand = UpdateTableOfContentsCommand;
    var GoToDataRecordCommand = (function (_super) {
        __extends(GoToDataRecordCommand, _super);
        function GoToDataRecordCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.GoToDataRecord;
            return _this;
        }
        GoToDataRecordCommand.prototype.execute = function (activeRecordIndex) {
            activeRecordIndex = ASPx.ApiParametersChecker.check(activeRecordIndex, 1, true, [
                ASPx.ApiParametersChecker.numberDescriptor("activeRecordIndex", function (val) { return val; }, 0)
            ]);
            return this.coreCommand.execute(true, activeRecordIndex);
        };
        GoToDataRecordCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createStateWithValue(this.coreState, {
                activeRecordIndex: this._core.mailMergeOptions.activeRecordIndex,
                recordCount: this._core.mailMergeOptions.recordCount
            });
        };
        return GoToDataRecordCommand;
    }(ASPx.CommandBase));
    ASPx.GoToDataRecordCommand = GoToDataRecordCommand;
    var DataRecordOptions = (function () {
        function DataRecordOptions() {
        }
        return DataRecordOptions;
    }());
    ASPx.DataRecordOptions = DataRecordOptions;
    var GoToFirstDataRecordCommand = (function (_super) {
        __extends(GoToFirstDataRecordCommand, _super);
        function GoToFirstDataRecordCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.GoToFirstDataRecord;
            return _this;
        }
        GoToFirstDataRecordCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        GoToFirstDataRecordCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return GoToFirstDataRecordCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.GoToFirstDataRecordCommand = GoToFirstDataRecordCommand;
    var GoToPreviousDataRecordCommand = (function (_super) {
        __extends(GoToPreviousDataRecordCommand, _super);
        function GoToPreviousDataRecordCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.GoToPreviousDataRecord;
            return _this;
        }
        GoToPreviousDataRecordCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        GoToPreviousDataRecordCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return GoToPreviousDataRecordCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.GoToPreviousDataRecordCommand = GoToPreviousDataRecordCommand;
    var GoToNextDataRecordCommand = (function (_super) {
        __extends(GoToNextDataRecordCommand, _super);
        function GoToNextDataRecordCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.GoToNextDataRecord;
            return _this;
        }
        GoToNextDataRecordCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        GoToNextDataRecordCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return GoToNextDataRecordCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.GoToNextDataRecordCommand = GoToNextDataRecordCommand;
    var GoToLastDataRecordCommand = (function (_super) {
        __extends(GoToLastDataRecordCommand, _super);
        function GoToLastDataRecordCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.GoToLastDataRecord;
            return _this;
        }
        GoToLastDataRecordCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        GoToLastDataRecordCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return GoToLastDataRecordCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.GoToLastDataRecordCommand = GoToLastDataRecordCommand;
    var ShowMergedDataCommand = (function (_super) {
        __extends(ShowMergedDataCommand, _super);
        function ShowMergedDataCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleViewMergedData;
            return _this;
        }
        ShowMergedDataCommand.prototype.execute = function (showMergedData) {
            showMergedData = ASPx.ApiParametersChecker.check(showMergedData, 1, true, [
                ASPx.ApiParametersChecker.booleanDescriptor("showMergedData", function (val) { return val; })
            ]);
            return this.coreCommand.execute(true, showMergedData);
        };
        ShowMergedDataCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ShowMergedDataCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ShowMergedDataCommand = ShowMergedDataCommand;
    var MergeFieldDialogCommand = (function (_super) {
        __extends(MergeFieldDialogCommand, _super);
        function MergeFieldDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowInsertMergeFieldForm;
            return _this;
        }
        MergeFieldDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        MergeFieldDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return MergeFieldDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.MergeFieldDialogCommand = MergeFieldDialogCommand;
    var CreateMergeFieldCommand = (function (_super) {
        __extends(CreateMergeFieldCommand, _super);
        function CreateMergeFieldCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.CreateMergeField;
            return _this;
        }
        CreateMergeFieldCommand.prototype.execute = function (fieldName) {
            fieldName = ASPx.ApiParametersChecker.check(fieldName, 1, false, [
                ASPx.ApiParametersChecker.stringDescriptor("fieldName", function (val) { return val; }, false)
            ]);
            return this.coreCommand.execute(true, fieldName);
        };
        CreateMergeFieldCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return CreateMergeFieldCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.CreateMergeFieldCommand = CreateMergeFieldCommand;
    var MailMergeDialogCommand = (function (_super) {
        __extends(MailMergeDialogCommand, _super);
        function MailMergeDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowFinishAndMergeForm;
            return _this;
        }
        MailMergeDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        MailMergeDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return MailMergeDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.MailMergeDialogCommand = MailMergeDialogCommand;
    var MailMergeAndDownloadCommand = (function (_super) {
        __extends(MailMergeAndDownloadCommand, _super);
        function MailMergeAndDownloadCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowFinishAndMergeForm;
            return _this;
        }
        MailMergeAndDownloadCommand.prototype.execute = function (fileExtension, settings) {
            var documentFormat = ASPx.ApiParametersChecker.check(fileExtension, 1, false, [
                ASPx.ApiParametersChecker.stringDescriptor("fileExtension", function (val) { return __aspxRichEdit.FileNameHelper.convertExtensionToDocumentFormat(val); }, false),
                ASPx.ApiParametersChecker.enumDescriptor("documentFormat", function (val) { return val; }, ASPx.DocumentFormat, "ASPx.DocumentFormat"),
            ]);
            if (documentFormat == ASPx.DocumentFormat.Undefined)
                throw new Error("Unsupported document format");
            settings = ASPx.ApiParametersChecker.check(settings, 2, true, [
                new ASPx.ApiParameterDescriptor("settings", "MailMergeSettings", function (value) { return value instanceof MailMergeSettings; }, function (s) { return s; })
            ]);
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return false;
            var mergeParameters = getMailMergeParameters(this._core, this.coreCommand, settings);
            var downloadCommand = this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowSaveMergedDocumentForm);
            var initDownloadParameters = downloadCommand.createParameters(new __aspxRichEdit.CommandSimpleOptions(this._core, mergeParameters));
            var downloadParameters = initDownloadParameters.clone();
            downloadParameters.documentFormat = documentFormat;
            downloadParameters.fileSavedToServer = false;
            return this.applyParameters(initDownloadParameters, downloadParameters, downloadCommand);
        };
        MailMergeAndDownloadCommand.prototype.getState = function () {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return ASPx.ApiUtils.createStateWithValue(state, null);
            var value = getMailMergeSettings(this._core, this.coreCommand);
            return ASPx.ApiUtils.createStateWithValue(state, value);
        };
        return MailMergeAndDownloadCommand;
    }(ASPx.CommandDialogBase));
    ASPx.MailMergeAndDownloadCommand = MailMergeAndDownloadCommand;
    var MailMergeAndSaveAsCommand = (function (_super) {
        __extends(MailMergeAndSaveAsCommand, _super);
        function MailMergeAndSaveAsCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowFinishAndMergeForm;
            return _this;
        }
        MailMergeAndSaveAsCommand.prototype.execute = function (filePath, settings) {
            var fileInfo = ASPx.ApiParametersChecker.check(filePath, 1, false, [
                ASPx.ApiParametersChecker.stringDescriptor("filePath", function (filePath) {
                    var pathInfo = new __aspxRichEdit.FileNameHelper(filePath, false);
                    pathInfo.checkExtension();
                    pathInfo.checkFileName();
                    return new ASPx.RichEditFileInfo(pathInfo.folderPath, pathInfo.name, pathInfo.documentFormat);
                }, false),
                new ASPx.ApiParameterDescriptor("fileInfo", "RichEditFileInfo", function (val) { return val instanceof ASPx.RichEditFileInfo; }, function (fileInfo) {
                    fileInfo.folderPath = __aspxRichEdit.FileNameHelper.normalizeVirtualFolderPath(fileInfo.folderPath, true);
                    return fileInfo;
                })
            ]);
            settings = ASPx.ApiParametersChecker.check(settings, 2, true, [
                new ASPx.ApiParameterDescriptor("settings", "MailMergeSettings", function (value) { return value instanceof MailMergeSettings; }, function (s) { return s; })
            ]);
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return false;
            var mergeParameters = getMailMergeParameters(this._core, this.coreCommand, settings);
            var saveCommand = this._core.commandManager
                .getCommand(__aspxRichEdit.RichEditClientCommand.ShowSaveMergedDocumentForm);
            var initSaveParameters = saveCommand.createParameters(new __aspxRichEdit.CommandSimpleOptions(this._core, mergeParameters));
            var saveParameters = initSaveParameters.clone();
            saveParameters.fileSavedToServer = true;
            saveParameters.folderPath = fileInfo.folderPath;
            saveParameters.fileName = fileInfo.fileName;
            saveParameters.documentFormat = fileInfo.documentFormat;
            return this.applyParameters(initSaveParameters, saveParameters, saveCommand);
        };
        MailMergeAndSaveAsCommand.prototype.getState = function () {
            var value = getMailMergeSettings(this._core, this.coreCommand);
            return ASPx.ApiUtils.createStateWithValue(this.coreState, value);
        };
        return MailMergeAndSaveAsCommand;
    }(ASPx.CommandDialogBase));
    ASPx.MailMergeAndSaveAsCommand = MailMergeAndSaveAsCommand;
    var CreatePageCountFieldCommand = (function (_super) {
        __extends(CreatePageCountFieldCommand, _super);
        function CreatePageCountFieldCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertPageCountField;
            return _this;
        }
        CreatePageCountFieldCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        CreatePageCountFieldCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return CreatePageCountFieldCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.CreatePageCountFieldCommand = CreatePageCountFieldCommand;
    function getMailMergeParameters(core, mergeCommand, settings) {
        var mergeParameters = mergeCommand.createParameters(new __aspxRichEdit.CommandOptions(core));
        if (!settings)
            return mergeParameters;
        if (settings.range !== undefined) {
            ASPx.ApiUtils.assertEnum(settings.range, MailMergeExportRange, "MailMergeExportRange", "settings.range");
            mergeParameters.range = settings.range;
        }
        if (settings.mergeMode !== undefined) {
            ASPx.ApiUtils.assertEnum(settings.mergeMode, MergeMode, "MergeMode", "settings.mergeMode");
            mergeParameters.mergeMode = settings.mergeMode;
        }
        if (settings.exportFrom !== undefined) {
            ASPx.ApiUtils.assertNonNegativeNumber(settings.exportFrom, "settings.exportFrom");
            mergeParameters.exportFrom = settings.exportFrom;
        }
        if (settings.exportRecordsCount !== undefined) {
            ASPx.ApiUtils.assertPositiveNumber(settings.exportRecordsCount, "settings.exportRecordsCount");
            mergeParameters.exportRecordsCount = settings.exportRecordsCount;
        }
        return mergeParameters;
    }
    function getMailMergeSettings(core, mergeCommand) {
        var mergeParameters = mergeCommand.createParameters(new __aspxRichEdit.CommandOptions(core));
        var value = new MailMergeSettings();
        value.exportFrom = mergeParameters.exportFrom;
        value.exportRecordsCount = mergeParameters.exportRecordsCount;
        value.mergeMode = mergeParameters.mergeMode;
        value.range = mergeParameters.range;
        return value;
    }
    var MailMergeSettings = (function () {
        function MailMergeSettings() {
        }
        return MailMergeSettings;
    }());
    ASPx.MailMergeSettings = MailMergeSettings;
    var MergeMode;
    (function (MergeMode) {
        MergeMode[MergeMode["NewParagraph"] = 0] = "NewParagraph";
        MergeMode[MergeMode["NewSection"] = 1] = "NewSection";
        MergeMode[MergeMode["JoinTables"] = 2] = "JoinTables";
    })(MergeMode = ASPx.MergeMode || (ASPx.MergeMode = {}));
    var MailMergeExportRange;
    (function (MailMergeExportRange) {
        MailMergeExportRange[MailMergeExportRange["AllRecords"] = 0] = "AllRecords";
        MailMergeExportRange[MailMergeExportRange["CurrentRecord"] = 1] = "CurrentRecord";
        MailMergeExportRange[MailMergeExportRange["Range"] = 2] = "Range";
    })(MailMergeExportRange = ASPx.MailMergeExportRange || (ASPx.MailMergeExportRange = {}));
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var FileNewCommand = (function (_super) {
        __extends(FileNewCommand, _super);
        function FileNewCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.FileNew;
            return _this;
        }
        FileNewCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        FileNewCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return FileNewCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.FileNewCommand = FileNewCommand;
    var FileOpenCommand = (function (_super) {
        __extends(FileOpenCommand, _super);
        function FileOpenCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.FileOpen;
            return _this;
        }
        FileOpenCommand.prototype.execute = function (path) {
            ASPx.ApiUtils.assertString(path, true, "path");
            var initParameters = new __aspxRichEdit.OpenFileDialogParameters();
            var parameters = initParameters.clone();
            parameters.src = path;
            return this.applyParameters(initParameters, parameters);
        };
        FileOpenCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return FileOpenCommand;
    }(ASPx.CommandWithSimpleStateDialogBase));
    ASPx.FileOpenCommand = FileOpenCommand;
    var FileOpenDialogCommand = (function (_super) {
        __extends(FileOpenDialogCommand, _super);
        function FileOpenDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.FileOpen;
            return _this;
        }
        FileOpenDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        FileOpenDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return FileOpenDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.FileOpenDialogCommand = FileOpenDialogCommand;
    var FileSaveCommand = (function (_super) {
        __extends(FileSaveCommand, _super);
        function FileSaveCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.FileSave;
            return _this;
        }
        FileSaveCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        FileSaveCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return FileSaveCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.FileSaveCommand = FileSaveCommand;
    var FileSaveAsCommand = (function (_super) {
        __extends(FileSaveAsCommand, _super);
        function FileSaveAsCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.FileSaveAs;
            return _this;
        }
        FileSaveAsCommand.prototype.execute = function (path) {
            var initParameters = new __aspxRichEdit.SaveFileDialogParameters();
            var parameters = (initParameters.clone());
            parameters.fileSavedToServer = true;
            if (typeof path == "string") {
                ASPx.ApiUtils.assertString(path, true, "path");
                var fileInfo = new __aspxRichEdit.FileNameHelper(path, false);
                parameters.folderPath = fileInfo.folderPath;
                parameters.fileName = fileInfo.name;
                parameters.documentFormat = fileInfo.documentFormat;
            }
            else {
                var fileInfo = path;
                ASPx.ApiUtils.assertString(fileInfo.folderPath, true, "fileInfo.folderPath");
                ASPx.ApiUtils.assertString(fileInfo.fileName, true, "fileInfo.fileName");
                ASPx.ApiUtils.assertEnum(fileInfo.documentFormat, ASPx.DocumentFormat, "DocumentFormat", "fileInfo.documentFormat");
                parameters.folderPath = __aspxRichEdit.FileNameHelper.normalizeVirtualFolderPath(fileInfo.folderPath, true);
                parameters.fileName = fileInfo.fileName;
                parameters.documentFormat = fileInfo.documentFormat;
            }
            return this.applyParameters(initParameters, parameters);
        };
        FileSaveAsCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return FileSaveAsCommand;
    }(ASPx.CommandWithSimpleStateDialogBase));
    ASPx.FileSaveAsCommand = FileSaveAsCommand;
    var FileDownloadCommand = (function (_super) {
        __extends(FileDownloadCommand, _super);
        function FileDownloadCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.Download;
            return _this;
        }
        FileDownloadCommand.prototype.execute = function (fileExtension) {
            var documentFormat = ASPx.ApiParametersChecker.check(fileExtension, 1, false, [
                ASPx.ApiParametersChecker.stringDescriptor("fileExtension", function (fileExtension) { return __aspxRichEdit.FileNameHelper.convertExtensionToDocumentFormat(fileExtension); }, false),
                ASPx.ApiParametersChecker.enumDescriptor("documentFormat", function (docFormat) { return docFormat; }, ASPx.DocumentFormat, "ASPx.DocumentFormat")
            ]);
            if (documentFormat === ASPx.DocumentFormat.Undefined)
                throw new Error("Unsupported document format");
            return this.coreCommand.execute(true, documentFormat);
        };
        FileDownloadCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return FileDownloadCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.FileDownloadCommand = FileDownloadCommand;
    var FileSaveAsDialogCommand = (function (_super) {
        __extends(FileSaveAsDialogCommand, _super);
        function FileSaveAsDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.FileSaveAs;
            return _this;
        }
        FileSaveAsDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        FileSaveAsDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return FileSaveAsDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.FileSaveAsDialogCommand = FileSaveAsDialogCommand;
    var FilePrintCommand = (function (_super) {
        __extends(FilePrintCommand, _super);
        function FilePrintCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.FilePrint;
            return _this;
        }
        FilePrintCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        FilePrintCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return FilePrintCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.FilePrintCommand = FilePrintCommand;
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var OpenFindPanelCommand = (function (_super) {
        __extends(OpenFindPanelCommand, _super);
        function OpenFindPanelCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.Find;
            return _this;
        }
        OpenFindPanelCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        OpenFindPanelCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return OpenFindPanelCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.OpenFindPanelCommand = OpenFindPanelCommand;
    var OpenFindAndReplaceDialogCommand = (function (_super) {
        __extends(OpenFindAndReplaceDialogCommand, _super);
        function OpenFindAndReplaceDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.Replace;
            return _this;
        }
        OpenFindAndReplaceDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        OpenFindAndReplaceDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return OpenFindAndReplaceDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.OpenFindAndReplaceDialogCommand = OpenFindAndReplaceDialogCommand;
    var FindAllCommand = (function (_super) {
        __extends(FindAllCommand, _super);
        function FindAllCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.FindAll;
            return _this;
        }
        FindAllCommand.prototype.execute = function (text, matchCase, highlightResults, results) {
            ASPx.ApiUtils.assertString(text, true, "text");
            ASPx.ApiUtils.assertBoolean(matchCase, "matchCase");
            ASPx.ApiUtils.assertBoolean(highlightResults, "highlightResults");
            if (arguments.length === 4)
                ASPx.ApiUtils.assertArray(results, "results");
            return this.coreCommand.execute(true, new __aspxRichEdit.FindAllCommandOptions(this._core, text, matchCase, highlightResults, results));
        };
        FindAllCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return FindAllCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.FindAllCommand = FindAllCommand;
    var HideFindResultsCommand = (function (_super) {
        __extends(HideFindResultsCommand, _super);
        function HideFindResultsCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.HideFindResults;
            return _this;
        }
        HideFindResultsCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        HideFindResultsCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return HideFindResultsCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.HideFindResultsCommand = HideFindResultsCommand;
    var ReplaceAllCommand = (function (_super) {
        __extends(ReplaceAllCommand, _super);
        function ReplaceAllCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ReplaceAll;
            return _this;
        }
        ReplaceAllCommand.prototype.execute = function (text, replaceText, matchCase) {
            ASPx.ApiUtils.assertString(text, true, "text");
            ASPx.ApiUtils.assertString(replaceText, true, "replaceText");
            ASPx.ApiUtils.assertBoolean(matchCase, "matchCase");
            return this.coreCommand.execute(true, new __aspxRichEdit.ReplaceAllCommandOptions(this._core, text, replaceText, matchCase));
        };
        ReplaceAllCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return ReplaceAllCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.ReplaceAllCommand = ReplaceAllCommand;
    var ReplaceNextCommand = (function (_super) {
        __extends(ReplaceNextCommand, _super);
        function ReplaceNextCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ReplaceNext;
            return _this;
        }
        ReplaceNextCommand.prototype.execute = function (text, replaceText, matchCase) {
            ASPx.ApiUtils.assertString(text, true, "text");
            ASPx.ApiUtils.assertString(replaceText, true, "replaceText");
            ASPx.ApiUtils.assertBoolean(matchCase, "matchCase");
            return this.coreCommand.execute(true, new __aspxRichEdit.ReplaceNextCommandOptions(this._core, text, replaceText, matchCase));
        };
        ReplaceNextCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return ReplaceNextCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.ReplaceNextCommand = ReplaceNextCommand;
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var OpenLayoutOptionsDialogCommand = (function (_super) {
        __extends(OpenLayoutOptionsDialogCommand, _super);
        function OpenLayoutOptionsDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowLayoutOptionsForm;
            return _this;
        }
        OpenLayoutOptionsDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        OpenLayoutOptionsDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return OpenLayoutOptionsDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.OpenLayoutOptionsDialogCommand = OpenLayoutOptionsDialogCommand;
    var InsertFloatingTextBoxCommand = (function (_super) {
        __extends(InsertFloatingTextBoxCommand, _super);
        function InsertFloatingTextBoxCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertAnchoredTextBox;
            return _this;
        }
        InsertFloatingTextBoxCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertFloatingTextBoxCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertFloatingTextBoxCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertFloatingTextBoxCommand = InsertFloatingTextBoxCommand;
    var ChangeFloatingObjectPropertyCommandBase = (function (_super) {
        __extends(ChangeFloatingObjectPropertyCommandBase, _super);
        function ChangeFloatingObjectPropertyCommandBase() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowLayoutOptionsForm;
            return _this;
        }
        ChangeFloatingObjectPropertyCommandBase.prototype.execute = function (settings) {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return false;
            var command = this.coreCommand;
            var parameters = command.createParameters(new __aspxRichEdit.CommandOptions(this._core));
            var initParameters = parameters.clone();
            this.fillParameters(parameters, settings);
            return this.applyParameters(initParameters, parameters);
        };
        ChangeFloatingObjectPropertyCommandBase.prototype.fillParameters = function (_parameters, _settings) {
            return null;
        };
        ChangeFloatingObjectPropertyCommandBase.prototype.getState = function () {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return ASPx.ApiUtils.createStateWithValue(state, null);
            var command = this.coreCommand;
            var parameters = command.createParameters(new __aspxRichEdit.CommandOptions(this._core));
            var value = this.getStateValue(parameters);
            return ASPx.ApiUtils.createStateWithValue(this.coreState, value);
        };
        ChangeFloatingObjectPropertyCommandBase.prototype.getStateValue = function (_parameters) {
            return null;
        };
        return ChangeFloatingObjectPropertyCommandBase;
    }(ASPx.CommandDialogBase));
    ASPx.ChangeFloatingObjectPropertyCommandBase = ChangeFloatingObjectPropertyCommandBase;
    var ChangeFloatingObjectLockAnchorCommand = (function (_super) {
        __extends(ChangeFloatingObjectLockAnchorCommand, _super);
        function ChangeFloatingObjectLockAnchorCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeFloatingObjectLockAnchorCommand.prototype.execute = function (lockAnchor) {
            return _super.prototype.execute.call(this, lockAnchor);
        };
        ChangeFloatingObjectLockAnchorCommand.prototype.fillParameters = function (parameters, settings) {
            if (settings !== undefined) {
                ASPx.ApiUtils.assertBoolean(settings, "lockAnchort");
                parameters.locked = settings;
            }
        };
        ChangeFloatingObjectLockAnchorCommand.prototype.getState = function () {
            return _super.prototype.getState.call(this);
        };
        ChangeFloatingObjectLockAnchorCommand.prototype.getStateValue = function (parameters) {
            return parameters.locked;
        };
        return ChangeFloatingObjectLockAnchorCommand;
    }(ChangeFloatingObjectPropertyCommandBase));
    ASPx.ChangeFloatingObjectLockAnchorCommand = ChangeFloatingObjectLockAnchorCommand;
    var ChangeFloatingObjectAlignmentPositionCommand = (function (_super) {
        __extends(ChangeFloatingObjectAlignmentPositionCommand, _super);
        function ChangeFloatingObjectAlignmentPositionCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeFloatingObjectAlignmentPositionCommand.prototype.execute = function (settings) {
            return _super.prototype.execute.call(this, settings);
        };
        ChangeFloatingObjectAlignmentPositionCommand.prototype.fillParameters = function (parameters, settings) {
            if (settings.horizontalPositionAlignment !== undefined) {
                ASPx.ApiUtils.assertEnum(settings.horizontalPositionAlignment, FloatingObjectHorizontalPositionAlignment, "FloatingObjectHorizontalPositionAlignment", "settings.horizontalPositionAlignment");
                parameters.horizontalPositionAlignment = settings.horizontalPositionAlignment;
            }
            if (settings.horizontalPositionType !== undefined) {
                ASPx.ApiUtils.assertEnum(settings.horizontalPositionType, FloatingObjectHorizontalPositionType, "FloatingObjectHorizontalPositionType", "settings.horizontalPositionType");
                parameters.horizontalPositionType = settings.horizontalPositionType;
            }
            if (settings.verticalPositionAlignment !== undefined) {
                ASPx.ApiUtils.assertEnum(settings.verticalPositionAlignment, FloatingObjectVerticalPositionAlignment, "FloatingObjectVerticalPositionAlignment", "settings.verticalPositionAlignment");
                parameters.verticalPositionAlignment = settings.verticalPositionAlignment;
            }
            if (settings.verticalPositionType !== undefined) {
                ASPx.ApiUtils.assertEnum(settings.verticalPositionType, FloatingObjectVerticalPositionType, "FloatingObjectVerticalPositionType", "settings.verticalPositionType");
                parameters.verticalPositionType = settings.verticalPositionType;
            }
        };
        ChangeFloatingObjectAlignmentPositionCommand.prototype.getState = function () {
            return _super.prototype.getState.call(this);
        };
        ChangeFloatingObjectAlignmentPositionCommand.prototype.getStateValue = function (parameters) {
            var value = new FloatingObjectAlignmentPositionSettings();
            value.horizontalPositionAlignment = parameters.horizontalPositionAlignment;
            value.horizontalPositionType = parameters.horizontalPositionType;
            value.verticalPositionAlignment = parameters.verticalPositionAlignment;
            value.verticalPositionType = parameters.verticalPositionType;
            return value;
        };
        return ChangeFloatingObjectAlignmentPositionCommand;
    }(ChangeFloatingObjectPropertyCommandBase));
    ASPx.ChangeFloatingObjectAlignmentPositionCommand = ChangeFloatingObjectAlignmentPositionCommand;
    var ChangeFloatingObjectAbsolutePositionCommand = (function (_super) {
        __extends(ChangeFloatingObjectAbsolutePositionCommand, _super);
        function ChangeFloatingObjectAbsolutePositionCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeFloatingObjectAbsolutePositionCommand.prototype.execute = function (settings) {
            return _super.prototype.execute.call(this, settings);
        };
        ChangeFloatingObjectAbsolutePositionCommand.prototype.fillParameters = function (parameters, settings) {
            if (settings.horizontalAbsolutePosition !== undefined) {
                ASPx.ApiUtils.assertNumber(settings.horizontalAbsolutePosition, "settings.horizontalAbsolutePosition");
                parameters.offsetX = settings.horizontalAbsolutePosition;
            }
            if (settings.horizontalPositionType !== undefined) {
                ASPx.ApiUtils.assertEnum(settings.horizontalPositionType, FloatingObjectHorizontalPositionType, "FloatingObjectHorizontalPositionType", "settings.horizontalPositionType");
                parameters.horizontalPositionType = settings.horizontalPositionType;
            }
            if (settings.verticalAbsolutePosition !== undefined) {
                ASPx.ApiUtils.assertNumber(settings.verticalAbsolutePosition, "settings.verticalAbsolutePosition");
                parameters.offsetY = settings.verticalAbsolutePosition;
            }
            if (settings.verticalPositionType !== undefined) {
                ASPx.ApiUtils.assertEnum(settings.verticalPositionType, FloatingObjectVerticalPositionType, "FloatingObjectVerticalPositionType", "settings.verticalPositionType");
                parameters.verticalPositionType = settings.verticalPositionType;
            }
            parameters.horizontalPositionAlignment = __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.None;
            parameters.verticalPositionAlignment = __aspxRichEdit.AnchorObjectVerticalPositionAlignment.None;
            parameters.percentOffsetX = 0;
            parameters.percentOffsetY = 0;
        };
        ChangeFloatingObjectAbsolutePositionCommand.prototype.getState = function () {
            return _super.prototype.getState.call(this);
        };
        ChangeFloatingObjectAbsolutePositionCommand.prototype.getStateValue = function (parameters) {
            var value = new FloatingObjectAbsolutePositionSettings();
            value.horizontalAbsolutePosition = parameters.offsetX ? parameters.offsetX : 0;
            value.horizontalPositionType = parameters.horizontalPositionType;
            value.verticalAbsolutePosition = parameters.offsetY ? parameters.offsetY : 0;
            value.verticalPositionType = parameters.verticalPositionType;
            return value;
        };
        return ChangeFloatingObjectAbsolutePositionCommand;
    }(ChangeFloatingObjectPropertyCommandBase));
    ASPx.ChangeFloatingObjectAbsolutePositionCommand = ChangeFloatingObjectAbsolutePositionCommand;
    var ChangeFloatingObjectRelativePositionCommand = (function (_super) {
        __extends(ChangeFloatingObjectRelativePositionCommand, _super);
        function ChangeFloatingObjectRelativePositionCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeFloatingObjectRelativePositionCommand.prototype.execute = function (settings) {
            return _super.prototype.execute.call(this, settings);
        };
        ChangeFloatingObjectRelativePositionCommand.prototype.fillParameters = function (parameters, settings) {
            var RELATIVE_COEFF = 1000;
            if (settings.horizontalPositionType == FloatingObjectHorizontalPositionType.Column || settings.horizontalPositionType == FloatingObjectHorizontalPositionType.Character)
                throw new Error("Incorrect Horizontal Position Type");
            if (settings.verticalPositionType == FloatingObjectVerticalPositionType.Line || settings.verticalPositionType == FloatingObjectVerticalPositionType.Paragraph)
                throw new Error("Incorrect Vertical Position Type");
            if (settings.horizontalRelativePosition !== undefined) {
                ASPx.ApiUtils.assertNumber(settings.horizontalRelativePosition, "settings.horizontalRelativePosition");
                parameters.percentOffsetX = settings.horizontalRelativePosition * RELATIVE_COEFF;
            }
            if (settings.horizontalPositionType !== undefined) {
                ASPx.ApiUtils.assertEnum(settings.horizontalPositionType, FloatingObjectHorizontalPositionType, "FloatingObjectHorizontalPositionType", "settings.horizontalPositionType");
                parameters.horizontalPositionType = settings.horizontalPositionType;
            }
            if (settings.verticalRelativePosition !== undefined) {
                ASPx.ApiUtils.assertNumber(settings.verticalRelativePosition, "settings.verticalRelativePosition");
                parameters.percentOffsetY = settings.verticalRelativePosition * RELATIVE_COEFF;
            }
            if (settings.verticalPositionType !== undefined) {
                ASPx.ApiUtils.assertEnum(settings.verticalPositionType, FloatingObjectVerticalPositionType, "FloatingObjectVerticalPositionType", "settings.verticalPositionType");
                parameters.verticalPositionType = settings.verticalPositionType;
            }
            parameters.horizontalPositionAlignment = __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.None;
            parameters.verticalPositionAlignment = __aspxRichEdit.AnchorObjectVerticalPositionAlignment.None;
        };
        ChangeFloatingObjectRelativePositionCommand.prototype.getState = function () {
            return _super.prototype.getState.call(this);
        };
        ChangeFloatingObjectRelativePositionCommand.prototype.getStateValue = function (parameters) {
            var value = new FloatingObjectRelativePositionSettings();
            value.horizontalRelativePosition = parameters.percentOffsetX ? parameters.percentOffsetX : 0;
            value.horizontalPositionType = parameters.horizontalPositionType;
            value.verticalRelativePosition = parameters.percentOffsetY ? parameters.percentOffsetY : 0;
            value.verticalPositionType = parameters.verticalPositionType;
            return value;
        };
        return ChangeFloatingObjectRelativePositionCommand;
    }(ChangeFloatingObjectPropertyCommandBase));
    ASPx.ChangeFloatingObjectRelativePositionCommand = ChangeFloatingObjectRelativePositionCommand;
    var ChangeFloatingObjectTextWrappingCommand = (function (_super) {
        __extends(ChangeFloatingObjectTextWrappingCommand, _super);
        function ChangeFloatingObjectTextWrappingCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowLayoutOptionsForm;
            return _this;
        }
        ChangeFloatingObjectTextWrappingCommand.prototype.execute = function (settings) {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return false;
            var command = this.coreCommand;
            var parameters = command.createParameters(new __aspxRichEdit.CommandOptions(this._core));
            var initParameters = parameters.clone();
            if (settings.floatingObjectTextWrapType !== undefined) {
                ASPx.ApiUtils.assertEnum(settings.floatingObjectTextWrapType, FloatingObjectTextWrapType, "FloatingObjectTextWrapType", "settings.floatingObjectTextWrapType");
                parameters.wrapType = settings.floatingObjectTextWrapType;
            }
            if (settings.floatingObjectTextWrapSide !== undefined) {
                ASPx.ApiUtils.assertEnum(settings.floatingObjectTextWrapSide, FloatingObjectTextWrapSide, "FloatingObjectTextWrapSide", "settings.floatingObjectTextWrapSide");
                parameters.wrapSide = settings.floatingObjectTextWrapSide;
            }
            if (settings.leftDistance !== undefined) {
                ASPx.ApiUtils.assertNonNegativeNumber(settings.leftDistance, "settings.leftDistance");
                parameters.leftDistance = settings.leftDistance;
            }
            if (settings.rightDistance !== undefined) {
                ASPx.ApiUtils.assertNonNegativeNumber(settings.rightDistance, "settings.rightDistance");
                parameters.rightDistance = settings.rightDistance;
            }
            if (settings.topDistance !== undefined) {
                ASPx.ApiUtils.assertNonNegativeNumber(settings.leftDistance, "settings.topDistance");
                parameters.topDistance = settings.topDistance;
            }
            if (settings.bottomDistance !== undefined) {
                ASPx.ApiUtils.assertNonNegativeNumber(settings.bottomDistance, "settings.bottomDistance");
                parameters.bottomDistance = settings.bottomDistance;
            }
            return this.applyParameters(initParameters, parameters);
        };
        ChangeFloatingObjectTextWrappingCommand.prototype.getState = function () {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return ASPx.ApiUtils.createStateWithValue(state, null);
            var command = this.coreCommand;
            var parameters = command.createParameters(new __aspxRichEdit.CommandOptions(this._core));
            var value = new FloatingObjectTextWrappingSettings();
            value.floatingObjectTextWrapType = parameters.wrapType;
            value.floatingObjectTextWrapSide = parameters.wrapSide;
            value.leftDistance = parameters.leftDistance ? parameters.leftDistance : 0;
            value.rightDistance = parameters.rightDistance ? parameters.rightDistance : 0;
            value.topDistance = parameters.topDistance ? parameters.topDistance : 0;
            value.bottomDistance = parameters.bottomDistance ? parameters.bottomDistance : 0;
            return ASPx.ApiUtils.createStateWithValue(this.coreState, value);
        };
        return ChangeFloatingObjectTextWrappingCommand;
    }(ASPx.CommandDialogBase));
    ASPx.ChangeFloatingObjectTextWrappingCommand = ChangeFloatingObjectTextWrappingCommand;
    var ChangeFloatingObjectAbsoluteSizeCommand = (function (_super) {
        __extends(ChangeFloatingObjectAbsoluteSizeCommand, _super);
        function ChangeFloatingObjectAbsoluteSizeCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeFloatingObjectAbsoluteSizeCommand.prototype.execute = function (settings) {
            return _super.prototype.execute.call(this, settings);
        };
        ChangeFloatingObjectAbsoluteSizeCommand.prototype.fillParameters = function (parameters, settings) {
            if (settings.absoluteWidth !== undefined) {
                ASPx.ApiUtils.assertNonNegativeNumber(settings.absoluteWidth, "settings.absoluteWidth");
                parameters.absoluteWidth = settings.absoluteWidth;
            }
            if (settings.absoluteHeight !== undefined) {
                ASPx.ApiUtils.assertNonNegativeNumber(settings.absoluteHeight, "settings.absoluteHeight");
                parameters.absoluteHeight = settings.absoluteHeight;
            }
            parameters.useAbsoluteWidth = true;
            parameters.useAbsoluteHeight = true;
        };
        ChangeFloatingObjectAbsoluteSizeCommand.prototype.getState = function () {
            return _super.prototype.getState.call(this);
        };
        ChangeFloatingObjectAbsoluteSizeCommand.prototype.getStateValue = function (parameters) {
            var value = new FloatingObjectAbsoluteSizeSettings();
            value.absoluteWidth = parameters.absoluteWidth;
            value.absoluteHeight = parameters.absoluteHeight;
            return value;
        };
        return ChangeFloatingObjectAbsoluteSizeCommand;
    }(ChangeFloatingObjectPropertyCommandBase));
    ASPx.ChangeFloatingObjectAbsoluteSizeCommand = ChangeFloatingObjectAbsoluteSizeCommand;
    var ChangeTextBoxRelativeSizeCommand = (function (_super) {
        __extends(ChangeTextBoxRelativeSizeCommand, _super);
        function ChangeTextBoxRelativeSizeCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeTextBoxRelativeSizeCommand.prototype.execute = function (settings) {
            return _super.prototype.execute.call(this, settings);
        };
        ChangeTextBoxRelativeSizeCommand.prototype.fillParameters = function (parameters, settings) {
            var RELATIVE_COEFF = 1000;
            if (settings.relativeWidth !== undefined) {
                ASPx.ApiUtils.assertNonNegativeNumber(settings.relativeWidth, "settings.relativeWidth");
                parameters.relativeWidth = settings.relativeWidth * RELATIVE_COEFF;
            }
            if (settings.relativeWidthType !== undefined) {
                ASPx.ApiUtils.assertEnum(settings.relativeWidthType, FloatingObjectRelativeWidthType, "FloatingObjectRelativeWidthType", "settings.relativeWidthType");
                parameters.relativeWidthType = settings.relativeWidthType;
            }
            if (settings.relativeHeight !== undefined) {
                ASPx.ApiUtils.assertNonNegativeNumber(settings.relativeHeight, "settings.relativeHeight");
                parameters.relativeHeight = settings.relativeHeight * RELATIVE_COEFF;
            }
            if (settings.relativeHeightType !== undefined) {
                ASPx.ApiUtils.assertEnum(settings.relativeHeightType, FloatingObjectRelativeHeightType, "FloatingObjectRelativeHeightType", "settings.relativeHeightType");
                parameters.relativeHeightType = settings.relativeHeightType;
            }
            parameters.useAbsoluteWidth = false;
            parameters.useAbsoluteHeight = false;
        };
        ChangeTextBoxRelativeSizeCommand.prototype.getState = function () {
            return _super.prototype.getState.call(this);
        };
        ChangeTextBoxRelativeSizeCommand.prototype.getStateValue = function (parameters) {
            var value = new TextBoxRelativeSizeSettings();
            value.relativeWidth = parameters.relativeWidth;
            value.relativeWidthType = parameters.relativeWidthType;
            value.relativeHeight = parameters.relativeHeight;
            value.relativeHeightType = parameters.relativeHeightType;
            return value;
        };
        return ChangeTextBoxRelativeSizeCommand;
    }(ChangeFloatingObjectPropertyCommandBase));
    ASPx.ChangeTextBoxRelativeSizeCommand = ChangeTextBoxRelativeSizeCommand;
    var ChangeFloatingObjectRotationCommand = (function (_super) {
        __extends(ChangeFloatingObjectRotationCommand, _super);
        function ChangeFloatingObjectRotationCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeFloatingObjectRotationCommand.prototype.execute = function (rotation) {
            return _super.prototype.execute.call(this, rotation);
        };
        ChangeFloatingObjectRotationCommand.prototype.fillParameters = function (parameters, settings) {
            if (settings !== undefined) {
                ASPx.ApiUtils.assertNonNegativeNumber(settings, "rotation");
                parameters.rotation = settings;
            }
        };
        ChangeFloatingObjectRotationCommand.prototype.getState = function () {
            return _super.prototype.getState.call(this);
        };
        ChangeFloatingObjectRotationCommand.prototype.getStateValue = function (parameters) {
            return parameters.rotation;
        };
        return ChangeFloatingObjectRotationCommand;
    }(ChangeFloatingObjectPropertyCommandBase));
    ASPx.ChangeFloatingObjectRotationCommand = ChangeFloatingObjectRotationCommand;
    var ChangeFloatingObjectLockAspectRatioCommand = (function (_super) {
        __extends(ChangeFloatingObjectLockAspectRatioCommand, _super);
        function ChangeFloatingObjectLockAspectRatioCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeFloatingObjectLockAspectRatioCommand.prototype.execute = function (lockAspectRatio) {
            return _super.prototype.execute.call(this, lockAspectRatio);
        };
        ChangeFloatingObjectLockAspectRatioCommand.prototype.fillParameters = function (parameters, settings) {
            if (settings !== undefined) {
                ASPx.ApiUtils.assertBoolean(settings, "lockAspectRatio");
                parameters.lockAspectRatio = settings;
            }
        };
        ChangeFloatingObjectLockAspectRatioCommand.prototype.getState = function () {
            return _super.prototype.getState.call(this);
        };
        ChangeFloatingObjectLockAspectRatioCommand.prototype.getStateValue = function (parameters) {
            return parameters.lockAspectRatio;
        };
        return ChangeFloatingObjectLockAspectRatioCommand;
    }(ChangeFloatingObjectPropertyCommandBase));
    ASPx.ChangeFloatingObjectLockAspectRatioCommand = ChangeFloatingObjectLockAspectRatioCommand;
    var ChangeFloatingObjectFillColorCommand = (function (_super) {
        __extends(ChangeFloatingObjectFillColorCommand, _super);
        function ChangeFloatingObjectFillColorCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ChangeFloatingObjectFillColor;
            return _this;
        }
        ChangeFloatingObjectFillColorCommand.prototype.execute = function (color) {
            var coreColor = ASPx.ApiParametersChecker.check(color, 1, false, ASPx.ApiParametersChecker.colorDescriptors("color"));
            return this.coreCommand.execute(true, coreColor);
        };
        ChangeFloatingObjectFillColorCommand.prototype.getState = function () {
            var state = ASPx.ApiUtils.createState(this.coreState);
            state.value = ASPx.ApiUtils.internalColorToApiColor(this.coreState.value);
            return state;
        };
        return ChangeFloatingObjectFillColorCommand;
    }(ASPx.CommandBase));
    ASPx.ChangeFloatingObjectFillColorCommand = ChangeFloatingObjectFillColorCommand;
    var ChangeFloatingObjectOutlineColorCommand = (function (_super) {
        __extends(ChangeFloatingObjectOutlineColorCommand, _super);
        function ChangeFloatingObjectOutlineColorCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ChangeFloatingObjectOutlineColor;
            return _this;
        }
        ChangeFloatingObjectOutlineColorCommand.prototype.execute = function (color) {
            var coreColor = ASPx.ApiParametersChecker.check(color, 1, false, ASPx.ApiParametersChecker.colorDescriptors("color"));
            return this.coreCommand.execute(true, coreColor);
        };
        ChangeFloatingObjectOutlineColorCommand.prototype.getState = function () {
            var state = ASPx.ApiUtils.createState(this.coreState);
            state.value = ASPx.ApiUtils.internalColorToApiColor(this.coreState.value);
            return state;
        };
        return ChangeFloatingObjectOutlineColorCommand;
    }(ASPx.CommandBase));
    ASPx.ChangeFloatingObjectOutlineColorCommand = ChangeFloatingObjectOutlineColorCommand;
    var ChangeFloatingObjectOutlineWidthCommand = (function (_super) {
        __extends(ChangeFloatingObjectOutlineWidthCommand, _super);
        function ChangeFloatingObjectOutlineWidthCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ChangeFloatingObjectOutlineWidth;
            return _this;
        }
        ChangeFloatingObjectOutlineWidthCommand.prototype.execute = function (width) {
            ASPx.ApiUtils.assertNonNegativeNumber(width, "width");
            return this.coreCommand.execute(true, width);
        };
        ChangeFloatingObjectOutlineWidthCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ChangeFloatingObjectOutlineWidthCommand;
    }(ASPx.CommandBase));
    ASPx.ChangeFloatingObjectOutlineWidthCommand = ChangeFloatingObjectOutlineWidthCommand;
    var ChangeTextBoxContentMarginsCommand = (function (_super) {
        __extends(ChangeTextBoxContentMarginsCommand, _super);
        function ChangeTextBoxContentMarginsCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ChangeTextBoxProperties;
            return _this;
        }
        ChangeTextBoxContentMarginsCommand.prototype.execute = function (settings) {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return false;
            var command = this.coreCommand;
            var parameters = command.getValue();
            if (settings.left !== undefined) {
                ASPx.ApiUtils.assertNonNegativeNumber(settings.left, "settings.left");
                parameters.leftMargin = settings.left;
            }
            if (settings.right !== undefined) {
                ASPx.ApiUtils.assertNonNegativeNumber(settings.right, "settings.right");
                parameters.rightMargin = settings.right;
            }
            if (settings.top !== undefined) {
                ASPx.ApiUtils.assertNonNegativeNumber(settings.top, "settings.top");
                parameters.topMargin = settings.top;
            }
            if (settings.bottom !== undefined) {
                ASPx.ApiUtils.assertNonNegativeNumber(settings.bottom, "settings.bottom");
                parameters.bottomMargin = settings.bottom;
            }
            return command.execute(true, parameters);
        };
        ChangeTextBoxContentMarginsCommand.prototype.getState = function () {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return ASPx.ApiUtils.createStateWithValue(state, null);
            return ASPx.ApiUtils.createState(state);
        };
        return ChangeTextBoxContentMarginsCommand;
    }(ASPx.CommandBase));
    ASPx.ChangeTextBoxContentMarginsCommand = ChangeTextBoxContentMarginsCommand;
    var ChangeTextBoxResizeShapeToFitTextCommand = (function (_super) {
        __extends(ChangeTextBoxResizeShapeToFitTextCommand, _super);
        function ChangeTextBoxResizeShapeToFitTextCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ChangeTextBoxProperties;
            return _this;
        }
        ChangeTextBoxResizeShapeToFitTextCommand.prototype.execute = function (resizeShapeToFitText) {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return false;
            var command = this.coreCommand;
            var parameters = command.getValue();
            if (resizeShapeToFitText !== undefined) {
                ASPx.ApiUtils.assertBoolean(resizeShapeToFitText, "resizeShapeToFitText");
                parameters.resizeShapeToFitText = resizeShapeToFitText;
            }
            return command.execute(true, parameters);
        };
        ChangeTextBoxResizeShapeToFitTextCommand.prototype.getState = function () {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return ASPx.ApiUtils.createStateWithValue(state, null);
            var value = state.value.resizeShapeToFitText;
            return ASPx.ApiUtils.createStateWithValue(this.coreState, value);
        };
        return ChangeTextBoxResizeShapeToFitTextCommand;
    }(ASPx.CommandBase));
    ASPx.ChangeTextBoxResizeShapeToFitTextCommand = ChangeTextBoxResizeShapeToFitTextCommand;
    var FloatingObjectAlignmentPositionSettings = (function () {
        function FloatingObjectAlignmentPositionSettings() {
        }
        return FloatingObjectAlignmentPositionSettings;
    }());
    ASPx.FloatingObjectAlignmentPositionSettings = FloatingObjectAlignmentPositionSettings;
    var FloatingObjectAbsolutePositionSettings = (function () {
        function FloatingObjectAbsolutePositionSettings() {
        }
        return FloatingObjectAbsolutePositionSettings;
    }());
    ASPx.FloatingObjectAbsolutePositionSettings = FloatingObjectAbsolutePositionSettings;
    var FloatingObjectRelativePositionSettings = (function () {
        function FloatingObjectRelativePositionSettings() {
        }
        return FloatingObjectRelativePositionSettings;
    }());
    ASPx.FloatingObjectRelativePositionSettings = FloatingObjectRelativePositionSettings;
    var FloatingObjectTextWrappingSettings = (function () {
        function FloatingObjectTextWrappingSettings() {
        }
        return FloatingObjectTextWrappingSettings;
    }());
    ASPx.FloatingObjectTextWrappingSettings = FloatingObjectTextWrappingSettings;
    var FloatingObjectAbsoluteSizeSettings = (function () {
        function FloatingObjectAbsoluteSizeSettings() {
        }
        return FloatingObjectAbsoluteSizeSettings;
    }());
    ASPx.FloatingObjectAbsoluteSizeSettings = FloatingObjectAbsoluteSizeSettings;
    var TextBoxRelativeSizeSettings = (function () {
        function TextBoxRelativeSizeSettings() {
        }
        return TextBoxRelativeSizeSettings;
    }());
    ASPx.TextBoxRelativeSizeSettings = TextBoxRelativeSizeSettings;
    var FloatingObjectRelativeWidthType;
    (function (FloatingObjectRelativeWidthType) {
        FloatingObjectRelativeWidthType[FloatingObjectRelativeWidthType["Margin"] = 0] = "Margin";
        FloatingObjectRelativeWidthType[FloatingObjectRelativeWidthType["Page"] = 1] = "Page";
        FloatingObjectRelativeWidthType[FloatingObjectRelativeWidthType["LeftMargin"] = 2] = "LeftMargin";
        FloatingObjectRelativeWidthType[FloatingObjectRelativeWidthType["RightMargin"] = 3] = "RightMargin";
        FloatingObjectRelativeWidthType[FloatingObjectRelativeWidthType["InsideMargin"] = 4] = "InsideMargin";
        FloatingObjectRelativeWidthType[FloatingObjectRelativeWidthType["OutsideMargin"] = 5] = "OutsideMargin";
    })(FloatingObjectRelativeWidthType = ASPx.FloatingObjectRelativeWidthType || (ASPx.FloatingObjectRelativeWidthType = {}));
    var FloatingObjectRelativeHeightType;
    (function (FloatingObjectRelativeHeightType) {
        FloatingObjectRelativeHeightType[FloatingObjectRelativeHeightType["Margin"] = 0] = "Margin";
        FloatingObjectRelativeHeightType[FloatingObjectRelativeHeightType["Page"] = 1] = "Page";
        FloatingObjectRelativeHeightType[FloatingObjectRelativeHeightType["TopMargin"] = 2] = "TopMargin";
        FloatingObjectRelativeHeightType[FloatingObjectRelativeHeightType["BottomMargin"] = 3] = "BottomMargin";
        FloatingObjectRelativeHeightType[FloatingObjectRelativeHeightType["InsideMargin"] = 4] = "InsideMargin";
        FloatingObjectRelativeHeightType[FloatingObjectRelativeHeightType["OutsideMargin"] = 5] = "OutsideMargin";
    })(FloatingObjectRelativeHeightType = ASPx.FloatingObjectRelativeHeightType || (ASPx.FloatingObjectRelativeHeightType = {}));
    var FloatingObjectTextWrapType;
    (function (FloatingObjectTextWrapType) {
        FloatingObjectTextWrapType[FloatingObjectTextWrapType["None"] = 0] = "None";
        FloatingObjectTextWrapType[FloatingObjectTextWrapType["TopAndBottom"] = 1] = "TopAndBottom";
        FloatingObjectTextWrapType[FloatingObjectTextWrapType["Tight"] = 2] = "Tight";
        FloatingObjectTextWrapType[FloatingObjectTextWrapType["Through"] = 3] = "Through";
        FloatingObjectTextWrapType[FloatingObjectTextWrapType["Square"] = 4] = "Square";
    })(FloatingObjectTextWrapType = ASPx.FloatingObjectTextWrapType || (ASPx.FloatingObjectTextWrapType = {}));
    var FloatingObjectTextWrapSide;
    (function (FloatingObjectTextWrapSide) {
        FloatingObjectTextWrapSide[FloatingObjectTextWrapSide["Both"] = 0] = "Both";
        FloatingObjectTextWrapSide[FloatingObjectTextWrapSide["Left"] = 1] = "Left";
        FloatingObjectTextWrapSide[FloatingObjectTextWrapSide["Right"] = 2] = "Right";
        FloatingObjectTextWrapSide[FloatingObjectTextWrapSide["Largest"] = 3] = "Largest";
    })(FloatingObjectTextWrapSide = ASPx.FloatingObjectTextWrapSide || (ASPx.FloatingObjectTextWrapSide = {}));
    var FloatingObjectHorizontalPositionType;
    (function (FloatingObjectHorizontalPositionType) {
        FloatingObjectHorizontalPositionType[FloatingObjectHorizontalPositionType["Page"] = 0] = "Page";
        FloatingObjectHorizontalPositionType[FloatingObjectHorizontalPositionType["Character"] = 1] = "Character";
        FloatingObjectHorizontalPositionType[FloatingObjectHorizontalPositionType["Column"] = 2] = "Column";
        FloatingObjectHorizontalPositionType[FloatingObjectHorizontalPositionType["Margin"] = 3] = "Margin";
        FloatingObjectHorizontalPositionType[FloatingObjectHorizontalPositionType["LeftMargin"] = 4] = "LeftMargin";
        FloatingObjectHorizontalPositionType[FloatingObjectHorizontalPositionType["RightMargin"] = 5] = "RightMargin";
        FloatingObjectHorizontalPositionType[FloatingObjectHorizontalPositionType["InsideMargin"] = 6] = "InsideMargin";
        FloatingObjectHorizontalPositionType[FloatingObjectHorizontalPositionType["OutsideMargin"] = 7] = "OutsideMargin";
    })(FloatingObjectHorizontalPositionType = ASPx.FloatingObjectHorizontalPositionType || (ASPx.FloatingObjectHorizontalPositionType = {}));
    var FloatingObjectHorizontalPositionAlignment;
    (function (FloatingObjectHorizontalPositionAlignment) {
        FloatingObjectHorizontalPositionAlignment[FloatingObjectHorizontalPositionAlignment["None"] = 0] = "None";
        FloatingObjectHorizontalPositionAlignment[FloatingObjectHorizontalPositionAlignment["Left"] = 1] = "Left";
        FloatingObjectHorizontalPositionAlignment[FloatingObjectHorizontalPositionAlignment["Center"] = 2] = "Center";
        FloatingObjectHorizontalPositionAlignment[FloatingObjectHorizontalPositionAlignment["Right"] = 3] = "Right";
        FloatingObjectHorizontalPositionAlignment[FloatingObjectHorizontalPositionAlignment["Inside"] = 4] = "Inside";
        FloatingObjectHorizontalPositionAlignment[FloatingObjectHorizontalPositionAlignment["Outside"] = 5] = "Outside";
    })(FloatingObjectHorizontalPositionAlignment = ASPx.FloatingObjectHorizontalPositionAlignment || (ASPx.FloatingObjectHorizontalPositionAlignment = {}));
    var FloatingObjectVerticalPositionType;
    (function (FloatingObjectVerticalPositionType) {
        FloatingObjectVerticalPositionType[FloatingObjectVerticalPositionType["Page"] = 0] = "Page";
        FloatingObjectVerticalPositionType[FloatingObjectVerticalPositionType["Line"] = 1] = "Line";
        FloatingObjectVerticalPositionType[FloatingObjectVerticalPositionType["Paragraph"] = 2] = "Paragraph";
        FloatingObjectVerticalPositionType[FloatingObjectVerticalPositionType["Margin"] = 3] = "Margin";
        FloatingObjectVerticalPositionType[FloatingObjectVerticalPositionType["TopMargin"] = 4] = "TopMargin";
        FloatingObjectVerticalPositionType[FloatingObjectVerticalPositionType["BottomMargin"] = 5] = "BottomMargin";
        FloatingObjectVerticalPositionType[FloatingObjectVerticalPositionType["InsideMargin"] = 6] = "InsideMargin";
        FloatingObjectVerticalPositionType[FloatingObjectVerticalPositionType["OutsideMargin"] = 7] = "OutsideMargin";
    })(FloatingObjectVerticalPositionType = ASPx.FloatingObjectVerticalPositionType || (ASPx.FloatingObjectVerticalPositionType = {}));
    var FloatingObjectVerticalPositionAlignment;
    (function (FloatingObjectVerticalPositionAlignment) {
        FloatingObjectVerticalPositionAlignment[FloatingObjectVerticalPositionAlignment["None"] = 0] = "None";
        FloatingObjectVerticalPositionAlignment[FloatingObjectVerticalPositionAlignment["Top"] = 1] = "Top";
        FloatingObjectVerticalPositionAlignment[FloatingObjectVerticalPositionAlignment["Center"] = 2] = "Center";
        FloatingObjectVerticalPositionAlignment[FloatingObjectVerticalPositionAlignment["Bottom"] = 3] = "Bottom";
        FloatingObjectVerticalPositionAlignment[FloatingObjectVerticalPositionAlignment["Inside"] = 4] = "Inside";
        FloatingObjectVerticalPositionAlignment[FloatingObjectVerticalPositionAlignment["Outside"] = 5] = "Outside";
    })(FloatingObjectVerticalPositionAlignment = ASPx.FloatingObjectVerticalPositionAlignment || (ASPx.FloatingObjectVerticalPositionAlignment = {}));
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var UndoCommand = (function (_super) {
        __extends(UndoCommand, _super);
        function UndoCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.Undo;
            return _this;
        }
        UndoCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        UndoCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return UndoCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.UndoCommand = UndoCommand;
    var RedoCommand = (function (_super) {
        __extends(RedoCommand, _super);
        function RedoCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.Redo;
            return _this;
        }
        RedoCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        RedoCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return RedoCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.RedoCommand = RedoCommand;
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var InsertHtmlCommand = (function (_super) {
        __extends(InsertHtmlCommand, _super);
        function InsertHtmlCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertHtml;
            return _this;
        }
        InsertHtmlCommand.prototype.execute = function (html) {
            html = ASPx.ApiParametersChecker.check(html, 1, false, [
                ASPx.ApiParametersChecker.stringDescriptor("html", function (val) { return val; }, false)
            ]);
            return this.coreCommand.execute(true, html);
        };
        InsertHtmlCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertHtmlCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertHtmlCommand = InsertHtmlCommand;
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var OpenInsertHyperlinkDialogCommand = (function (_super) {
        __extends(OpenInsertHyperlinkDialogCommand, _super);
        function OpenInsertHyperlinkDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowHyperlinkForm;
            return _this;
        }
        OpenInsertHyperlinkDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        OpenInsertHyperlinkDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return OpenInsertHyperlinkDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.OpenInsertHyperlinkDialogCommand = OpenInsertHyperlinkDialogCommand;
    var InsertHyperlinkCommand = (function (_super) {
        __extends(InsertHyperlinkCommand, _super);
        function InsertHyperlinkCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowHyperlinkForm;
            return _this;
        }
        InsertHyperlinkCommand.prototype.execute = function (settings) {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return false;
            var command = this.coreCommand;
            if (settings.tooltip === undefined)
                settings.tooltip = "";
            if (settings.text === undefined)
                settings.text = "";
            if (settings.bookmark === undefined)
                settings.bookmark = "";
            if (settings.url === undefined)
                settings.url = "";
            ASPx.ApiUtils.assertString(settings.text, false, "settings.text");
            ASPx.ApiUtils.assertString(settings.tooltip, false, "settings.tooltip");
            ASPx.ApiUtils.assertString(settings.bookmark, false, "settings.bookmark");
            ASPx.ApiUtils.assertString(settings.url, false, "settings.url");
            if (!settings.url && settings.bookmark)
                return false;
            var parameters = command.createParameters(new __aspxRichEdit.CommandOptions(this._core));
            var initParameters = parameters.clone();
            parameters.text = settings.text;
            parameters.tooltip = settings.tooltip;
            parameters.url = settings.url;
            parameters.anchor = settings.bookmark;
            return this.applyParameters(initParameters, parameters);
        };
        InsertHyperlinkCommand.prototype.getState = function () {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return ASPx.ApiUtils.createStateWithValue(state, null);
            var parameters = this.coreCommand.createParameters(new __aspxRichEdit.CommandOptions(this._core));
            var settings = new HyperlinkSettings();
            settings.bookmark = parameters.anchor;
            settings.text = parameters.text;
            settings.tooltip = parameters.tooltip;
            settings.url = parameters.url;
            return new ASPx.CommandState(state.visible, state.enabled, settings);
        };
        return InsertHyperlinkCommand;
    }(ASPx.CommandDialogBase));
    ASPx.InsertHyperlinkCommand = InsertHyperlinkCommand;
    var DeleteHyperlinkCommand = (function (_super) {
        __extends(DeleteHyperlinkCommand, _super);
        function DeleteHyperlinkCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.RemoveHyperlink;
            return _this;
        }
        DeleteHyperlinkCommand.prototype.execute = function () {
            if (!this.getState().visible)
                return false;
            return this.coreCommand.execute(true);
        };
        DeleteHyperlinkCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return DeleteHyperlinkCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.DeleteHyperlinkCommand = DeleteHyperlinkCommand;
    var DeleteHyperlinksCommand = (function (_super) {
        __extends(DeleteHyperlinksCommand, _super);
        function DeleteHyperlinksCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.RemoveHyperlinks;
            return _this;
        }
        DeleteHyperlinksCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        DeleteHyperlinksCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return DeleteHyperlinksCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.DeleteHyperlinksCommand = DeleteHyperlinksCommand;
    var OpenHyperlinkCommand = (function (_super) {
        __extends(OpenHyperlinkCommand, _super);
        function OpenHyperlinkCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.OpenHyperlink;
            return _this;
        }
        OpenHyperlinkCommand.prototype.execute = function () {
            if (!this.getState().visible)
                return false;
            return this.coreCommand.execute(true);
        };
        OpenHyperlinkCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return OpenHyperlinkCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.OpenHyperlinkCommand = OpenHyperlinkCommand;
    var ChangeHyperlinkCommand = (function (_super) {
        __extends(ChangeHyperlinkCommand, _super);
        function ChangeHyperlinkCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ChangeHyperlink;
            return _this;
        }
        ChangeHyperlinkCommand.prototype.execute = function (fieldIndex, hyperlinkSettings, subDocumentId) {
            var _this = this;
            fieldIndex = ASPx.ApiParametersChecker.check(fieldIndex, 1, false, [
                ASPx.ApiParametersChecker.numberDescriptor("fieldIndex", function (v) { return v; }, 0)
            ]);
            hyperlinkSettings = ASPx.ApiParametersChecker.check(hyperlinkSettings, 2, false, [
                ASPx.ApiParametersChecker.objectDescriptor("hyperlinkSettings", "ASPx.HyperlinkInfo", function (v) { return v; })
            ]);
            var subDocument = ASPx.ApiParametersChecker.check(subDocumentId, 3, true, [
                ASPx.ApiParametersChecker.numberDescriptor("subDocumentId", function (id) { return _this._core.model.subDocuments[id]; })
            ]);
            var uri = ASPx.ApiParametersChecker.check(hyperlinkSettings.url, 2, true, [
                ASPx.ApiParametersChecker.stringDescriptor("hyperlinkInfo.url", function (v) { return v ? v : ""; }, true)
            ]);
            var tip = ASPx.ApiParametersChecker.check(hyperlinkSettings.tooltip, 2, true, [
                ASPx.ApiParametersChecker.stringDescriptor("hyperlinkInfo.tooltip", function (v) { return v ? v : ""; }, true)
            ]);
            var anchor = ASPx.ApiParametersChecker.check(hyperlinkSettings.bookmark, 2, true, [
                ASPx.ApiParametersChecker.stringDescriptor("hyperlinkInfo.bookmark", function (v) { return v ? v : ""; }, true)
            ]);
            var shownText = ASPx.ApiParametersChecker.check(hyperlinkSettings.text, 2, true, [
                ASPx.ApiParametersChecker.stringDescriptor("hyperlinkInfo.text", function (v) { return v ? v : ""; }, true)
            ]);
            var hyperlinkInfo = new __aspxRichEdit.HyperlinkInfo(uri, anchor, tip, false);
            var options = new __aspxRichEdit.ChangeHyperlinkCommandOptions(this._core, fieldIndex, hyperlinkInfo, shownText).setAllowChangeSelection(false);
            if (subDocument)
                options.setSubDocument(subDocument);
            return this.coreCommand.execute(true, options);
        };
        ChangeHyperlinkCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return ChangeHyperlinkCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.ChangeHyperlinkCommand = ChangeHyperlinkCommand;
    var HyperlinkSettings = (function () {
        function HyperlinkSettings(url, bookmark, tooltip, text) {
            if (url === void 0) { url = null; }
            if (bookmark === void 0) { bookmark = null; }
            if (tooltip === void 0) { tooltip = null; }
            if (text === void 0) { text = null; }
            this.url = url;
            this.bookmark = bookmark;
            this.tooltip = tooltip;
            this.text = text;
        }
        return HyperlinkSettings;
    }());
    ASPx.HyperlinkSettings = HyperlinkSettings;
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var InsertPageBreakCommand = (function (_super) {
        __extends(InsertPageBreakCommand, _super);
        function InsertPageBreakCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertPageBreak;
            return _this;
        }
        InsertPageBreakCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertPageBreakCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertPageBreakCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertPageBreakCommand = InsertPageBreakCommand;
    var InsertColumnBreakCommand = (function (_super) {
        __extends(InsertColumnBreakCommand, _super);
        function InsertColumnBreakCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertColumnBreak;
            return _this;
        }
        InsertColumnBreakCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertColumnBreakCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertColumnBreakCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertColumnBreakCommand = InsertColumnBreakCommand;
    var InsertSectionBreakNextPageCommand = (function (_super) {
        __extends(InsertSectionBreakNextPageCommand, _super);
        function InsertSectionBreakNextPageCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertSectionBreakNextPage;
            return _this;
        }
        InsertSectionBreakNextPageCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertSectionBreakNextPageCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertSectionBreakNextPageCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertSectionBreakNextPageCommand = InsertSectionBreakNextPageCommand;
    var InsertSectionBreakEvenPageCommand = (function (_super) {
        __extends(InsertSectionBreakEvenPageCommand, _super);
        function InsertSectionBreakEvenPageCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertSectionBreakEvenPage;
            return _this;
        }
        InsertSectionBreakEvenPageCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertSectionBreakEvenPageCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertSectionBreakEvenPageCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertSectionBreakEvenPageCommand = InsertSectionBreakEvenPageCommand;
    var InsertSectionBreakOddPageCommand = (function (_super) {
        __extends(InsertSectionBreakOddPageCommand, _super);
        function InsertSectionBreakOddPageCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertSectionBreakOddPage;
            return _this;
        }
        InsertSectionBreakOddPageCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertSectionBreakOddPageCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertSectionBreakOddPageCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertSectionBreakOddPageCommand = InsertSectionBreakOddPageCommand;
    var InsertLineBreakCommand = (function (_super) {
        __extends(InsertLineBreakCommand, _super);
        function InsertLineBreakCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertLineBreak;
            return _this;
        }
        InsertLineBreakCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertLineBreakCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertLineBreakCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertLineBreakCommand = InsertLineBreakCommand;
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var ToggleBulletedListCommand = (function (_super) {
        __extends(ToggleBulletedListCommand, _super);
        function ToggleBulletedListCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleBulletedListItem;
            return _this;
        }
        ToggleBulletedListCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleBulletedListCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleBulletedListCommand;
    }(ASPx.CommandBase));
    ASPx.ToggleBulletedListCommand = ToggleBulletedListCommand;
    var ToggleNumberingListCommand = (function (_super) {
        __extends(ToggleNumberingListCommand, _super);
        function ToggleNumberingListCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleNumberingListItem;
            return _this;
        }
        ToggleNumberingListCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleNumberingListCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleNumberingListCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleNumberingListCommand = ToggleNumberingListCommand;
    var ToggleMultilevelListCommand = (function (_super) {
        __extends(ToggleMultilevelListCommand, _super);
        function ToggleMultilevelListCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleMultilevelListItem;
            return _this;
        }
        ToggleMultilevelListCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleMultilevelListCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleMultilevelListCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleMultilevelListCommand = ToggleMultilevelListCommand;
    var OpenNumberingListDialogCommand = (function (_super) {
        __extends(OpenNumberingListDialogCommand, _super);
        function OpenNumberingListDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowNumberingListForm;
            return _this;
        }
        OpenNumberingListDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        OpenNumberingListDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return OpenNumberingListDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.OpenNumberingListDialogCommand = OpenNumberingListDialogCommand;
    var OpenCustomNumberingListDialogCommand = (function (_super) {
        __extends(OpenCustomNumberingListDialogCommand, _super);
        function OpenCustomNumberingListDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowCustomNumberingListForm;
            return _this;
        }
        OpenCustomNumberingListDialogCommand.prototype.execute = function (abstractNumberingListIndex) {
            var parameters = new __aspxRichEdit.DialogCustomNumberingListParameters();
            var numberingList = this._core.model.abstractNumberingLists[abstractNumberingListIndex];
            if (!numberingList)
                throw new Error("AbstractNumbering list doesn't exist");
            parameters.init(this._core.model.colorProvider, numberingList, 0);
            return this.coreCommand.execute(true, parameters);
        };
        OpenCustomNumberingListDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return OpenCustomNumberingListDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.OpenCustomNumberingListDialogCommand = OpenCustomNumberingListDialogCommand;
    var ChangeCustomNumberingListCommand = (function (_super) {
        __extends(ChangeCustomNumberingListCommand, _super);
        function ChangeCustomNumberingListCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowCustomNumberingListForm;
            return _this;
        }
        ChangeCustomNumberingListCommand.prototype.execute = function (abstractNumberingListIndex, listLevelSettings) {
            var parameters = new __aspxRichEdit.DialogCustomNumberingListParameters();
            var initParameters = parameters.clone();
            ASPx.ApiUtils.assertNonNegativeNumber(abstractNumberingListIndex, "abstractNumberingListIndex");
            var numberingList = this._core.model.abstractNumberingLists[abstractNumberingListIndex];
            if (!numberingList)
                throw new Error("AbstractNumbering " + abstractNumberingListIndex + " list doesn't exist");
            if (listLevelSettings.length !== 9)
                throw new Error("listLevelSettings must have 9 elements");
            parameters.init(this._core.model.colorProvider, numberingList, 0);
            for (var i = 0, listLevel = void 0; listLevel = listLevelSettings[i]; i++) {
                var coreLevel = parameters.levels[i];
                if (listLevel.alignment !== undefined) {
                    ASPx.ApiUtils.assertEnum(listLevel.alignment, ListLevelNumberAlignment, "ListLevelNumberAlignment", "listLevelSettings[" + i + "].alignment");
                    coreLevel.alignment = listLevel.alignment;
                }
                if (listLevel.displayFormatString !== undefined) {
                    ASPx.ApiUtils.assertString(listLevel.displayFormatString, false, "listLevelSettings[" + i + "].alignment");
                    coreLevel.displayFormatString = listLevel.displayFormatString;
                }
                if (listLevel.firstLineIndent !== undefined) {
                    ASPx.ApiUtils.assertNumber(listLevel.firstLineIndent, "listLevelSettings[" + i + "].firstLineIndent");
                    coreLevel.firstLineIndent = listLevel.firstLineIndent;
                }
                if (listLevel.firstLineIndentType !== undefined) {
                    ASPx.ApiUtils.assertEnum(listLevel.firstLineIndentType, ASPx.ParagraphFirstLineIndent, "ParagraphFirstLineIndent", "listLevelSettings[" + i + "].firstLineIndentType");
                    coreLevel.firstLineIndentType = listLevel.firstLineIndentType;
                }
                if (listLevel.fontBold !== undefined) {
                    ASPx.ApiUtils.assertBoolean(listLevel.fontBold, "listLevelSettings[" + i + "].fontBold");
                    if (listLevel.fontBold)
                        coreLevel.fontStyle |= 1;
                    else
                        coreLevel.fontStyle &= ~1;
                }
                if (listLevel.fontColor !== undefined) {
                    var coreColor = ASPx.ApiParametersChecker.check(listLevel.fontColor, 2, false, ASPx.ApiParametersChecker.colorDescriptors("listLevelSettings[" + i + "].fontColor"));
                    coreLevel.fontColor = __aspxRichEdit.ColorHelper.colorToHash(coreColor);
                }
                if (listLevel.fontItalic !== undefined) {
                    ASPx.ApiUtils.assertBoolean(listLevel.fontItalic, "listLevelSettings[" + i + "].fontItalic");
                    if (listLevel.fontItalic)
                        coreLevel.fontStyle |= 2;
                    else
                        coreLevel.fontStyle &= ~2;
                }
                if (listLevel.fontName !== undefined) {
                    ASPx.ApiUtils.assertString(listLevel.fontName, true, "listLevelSettings[" + i + "].fontName");
                    coreLevel.fontName = listLevel.fontName;
                }
                if (listLevel.fontSize !== undefined) {
                    ASPx.ApiUtils.assertPositiveNumber(listLevel.fontSize, "listLevelSettings[" + i + "].fontSize");
                    coreLevel.fontSize = listLevel.fontSize;
                }
                if (listLevel.format !== undefined) {
                    ASPx.ApiUtils.assertEnum(listLevel.format, ListLevelFormat, "ListLevelFormat", "listLevelSettings[" + i + "].format");
                    coreLevel.format = listLevel.format;
                }
                if (listLevel.leftIndent !== undefined) {
                    ASPx.ApiUtils.assertNonNegativeNumber(listLevel.leftIndent, "listLevelSettings[" + i + "].leftIndent");
                    coreLevel.leftIndent = listLevel.leftIndent;
                }
                if (listLevel.separator !== undefined) {
                    ASPx.ApiUtils.assertString(listLevel.separator, false, "listLevelSettings[" + i + "].separator");
                    coreLevel.separator = listLevel.separator;
                }
                if (listLevel.start !== undefined) {
                    ASPx.ApiUtils.assertNumber(listLevel.start, "listLevelSettings[" + i + "].start");
                    coreLevel.start = listLevel.start;
                }
            }
            parameters.applyToParagraph = false;
            return this.applyParameters(initParameters, parameters);
        };
        ChangeCustomNumberingListCommand.prototype.getState = function (abstractNumberingListIndex) {
            var parameters = new __aspxRichEdit.DialogCustomNumberingListParameters();
            var numberingList = this._core.model.abstractNumberingLists[abstractNumberingListIndex];
            if (!numberingList)
                throw new Error("AbstractNumbering list doesn't exist");
            parameters.init(this._core.model.colorProvider, numberingList, 0);
            var value = [];
            for (var i = 0, level = void 0; level = parameters.levels[i]; i++) {
                var levelSettings = new ListLevelSettings();
                levelSettings.alignment = level.alignment;
                levelSettings.displayFormatString = level.displayFormatString;
                levelSettings.firstLineIndent = level.firstLineIndent;
                levelSettings.firstLineIndentType = level.firstLineIndentType;
                levelSettings.fontBold = !!(level.fontStyle & 1);
                levelSettings.fontColor = ASPx.ApiUtils.internalColorToApiColor(parameters.coreInitialFontColors[i]);
                levelSettings.fontItalic = !!(level.fontStyle & 2);
                levelSettings.fontName = level.fontName;
                levelSettings.fontSize = level.fontSize;
                levelSettings.format = level.format;
                levelSettings.leftIndent = level.leftIndent;
                levelSettings.separator = level.separator;
                levelSettings.start = level.start;
                value.push(levelSettings);
            }
            return ASPx.ApiUtils.createStateWithValue(this.coreState, value);
        };
        return ChangeCustomNumberingListCommand;
    }(ASPx.CommandDialogBase));
    ASPx.ChangeCustomNumberingListCommand = ChangeCustomNumberingListCommand;
    var RestartNumberingListCommand = (function (_super) {
        __extends(RestartNumberingListCommand, _super);
        function RestartNumberingListCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.RestartNumberingList;
            return _this;
        }
        RestartNumberingListCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        RestartNumberingListCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return RestartNumberingListCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.RestartNumberingListCommand = RestartNumberingListCommand;
    var IncrementNumberingIndentCommand = (function (_super) {
        __extends(IncrementNumberingIndentCommand, _super);
        function IncrementNumberingIndentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.IncrementNumberingIndent;
            return _this;
        }
        IncrementNumberingIndentCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        IncrementNumberingIndentCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return IncrementNumberingIndentCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.IncrementNumberingIndentCommand = IncrementNumberingIndentCommand;
    var DecrementNumberingIndentCommand = (function (_super) {
        __extends(DecrementNumberingIndentCommand, _super);
        function DecrementNumberingIndentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.DecrementNumberingIndent;
            return _this;
        }
        DecrementNumberingIndentCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        DecrementNumberingIndentCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return DecrementNumberingIndentCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.DecrementNumberingIndentCommand = DecrementNumberingIndentCommand;
    var ContinueNumberingListCommand = (function (_super) {
        __extends(ContinueNumberingListCommand, _super);
        function ContinueNumberingListCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ContinueNumberingList;
            return _this;
        }
        ContinueNumberingListCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ContinueNumberingListCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return ContinueNumberingListCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.ContinueNumberingListCommand = ContinueNumberingListCommand;
    var InsertNumerationCommand = (function (_super) {
        __extends(InsertNumerationCommand, _super);
        function InsertNumerationCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertNumerationToParagraphs;
            return _this;
        }
        InsertNumerationCommand.prototype.execute = function (numberingListIndex, isAbstractNumberingList) {
            if (arguments.length === 1)
                isAbstractNumberingList = true;
            if (arguments.length === 2)
                ASPx.ApiUtils.assertBoolean(isAbstractNumberingList, "isAbstractNumberingList");
            if (isAbstractNumberingList) {
                ASPx.ApiUtils.assertNonNegativeNumber(numberingListIndex, "abstractNumberingListIndex");
                var abstractNumberingList = this._core.model.abstractNumberingLists[numberingListIndex];
                if (!abstractNumberingList)
                    throw new Error("abstract numbering list doesn't exist");
                return this.coreCommand.execute(true, abstractNumberingList);
            }
            else {
                ASPx.ApiUtils.assertNonNegativeNumber(numberingListIndex, "numberingListIndex");
                var numberingList = this._core.model.numberingLists[numberingListIndex];
                if (!numberingList)
                    throw new Error("numbering list doesn't exist");
                return this.coreCommand.execute(true, numberingList);
            }
        };
        InsertNumerationCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertNumerationCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertNumerationCommand = InsertNumerationCommand;
    var RemoveNumerationCommand = (function (_super) {
        __extends(RemoveNumerationCommand, _super);
        function RemoveNumerationCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.DeleteNumerationFromParagraphs;
            return _this;
        }
        RemoveNumerationCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        RemoveNumerationCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return RemoveNumerationCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.RemoveNumerationCommand = RemoveNumerationCommand;
    var ListLevelSettings = (function () {
        function ListLevelSettings() {
        }
        return ListLevelSettings;
    }());
    ASPx.ListLevelSettings = ListLevelSettings;
    var ListLevelFormat;
    (function (ListLevelFormat) {
        ListLevelFormat[ListLevelFormat["Decimal"] = 0] = "Decimal";
        ListLevelFormat[ListLevelFormat["AIUEOHiragana"] = 1] = "AIUEOHiragana";
        ListLevelFormat[ListLevelFormat["AIUEOFullWidthHiragana"] = 2] = "AIUEOFullWidthHiragana";
        ListLevelFormat[ListLevelFormat["ArabicAbjad"] = 3] = "ArabicAbjad";
        ListLevelFormat[ListLevelFormat["ArabicAlpha"] = 4] = "ArabicAlpha";
        ListLevelFormat[ListLevelFormat["Bullet"] = 5] = "Bullet";
        ListLevelFormat[ListLevelFormat["CardinalText"] = 6] = "CardinalText";
        ListLevelFormat[ListLevelFormat["Chicago"] = 7] = "Chicago";
        ListLevelFormat[ListLevelFormat["ChineseCounting"] = 8] = "ChineseCounting";
        ListLevelFormat[ListLevelFormat["ChineseCountingThousand"] = 9] = "ChineseCountingThousand";
        ListLevelFormat[ListLevelFormat["ChineseLegalSimplified"] = 10] = "ChineseLegalSimplified";
        ListLevelFormat[ListLevelFormat["Chosung"] = 11] = "Chosung";
        ListLevelFormat[ListLevelFormat["DecimalEnclosedCircle"] = 12] = "DecimalEnclosedCircle";
        ListLevelFormat[ListLevelFormat["DecimalEnclosedCircleChinese"] = 13] = "DecimalEnclosedCircleChinese";
        ListLevelFormat[ListLevelFormat["DecimalEnclosedFullstop"] = 14] = "DecimalEnclosedFullstop";
        ListLevelFormat[ListLevelFormat["DecimalEnclosedParentheses"] = 15] = "DecimalEnclosedParentheses";
        ListLevelFormat[ListLevelFormat["DecimalFullWidth"] = 16] = "DecimalFullWidth";
        ListLevelFormat[ListLevelFormat["DecimalFullWidth2"] = 17] = "DecimalFullWidth2";
        ListLevelFormat[ListLevelFormat["DecimalHalfWidth"] = 18] = "DecimalHalfWidth";
        ListLevelFormat[ListLevelFormat["DecimalZero"] = 19] = "DecimalZero";
        ListLevelFormat[ListLevelFormat["Ganada"] = 20] = "Ganada";
        ListLevelFormat[ListLevelFormat["Hebrew1"] = 21] = "Hebrew1";
        ListLevelFormat[ListLevelFormat["Hebrew2"] = 22] = "Hebrew2";
        ListLevelFormat[ListLevelFormat["Hex"] = 23] = "Hex";
        ListLevelFormat[ListLevelFormat["HindiConsonants"] = 24] = "HindiConsonants";
        ListLevelFormat[ListLevelFormat["HindiDescriptive"] = 25] = "HindiDescriptive";
        ListLevelFormat[ListLevelFormat["HindiNumbers"] = 26] = "HindiNumbers";
        ListLevelFormat[ListLevelFormat["HindiVowels"] = 27] = "HindiVowels";
        ListLevelFormat[ListLevelFormat["IdeographDigital"] = 28] = "IdeographDigital";
        ListLevelFormat[ListLevelFormat["IdeographEnclosedCircle"] = 29] = "IdeographEnclosedCircle";
        ListLevelFormat[ListLevelFormat["IdeographLegalTraditional"] = 30] = "IdeographLegalTraditional";
        ListLevelFormat[ListLevelFormat["IdeographTraditional"] = 31] = "IdeographTraditional";
        ListLevelFormat[ListLevelFormat["IdeographZodiac"] = 32] = "IdeographZodiac";
        ListLevelFormat[ListLevelFormat["IdeographZodiacTraditional"] = 33] = "IdeographZodiacTraditional";
        ListLevelFormat[ListLevelFormat["Iroha"] = 34] = "Iroha";
        ListLevelFormat[ListLevelFormat["IrohaFullWidth"] = 35] = "IrohaFullWidth";
        ListLevelFormat[ListLevelFormat["JapaneseCounting"] = 36] = "JapaneseCounting";
        ListLevelFormat[ListLevelFormat["JapaneseDigitalTenThousand"] = 37] = "JapaneseDigitalTenThousand";
        ListLevelFormat[ListLevelFormat["JapaneseLegal"] = 38] = "JapaneseLegal";
        ListLevelFormat[ListLevelFormat["KoreanCounting"] = 39] = "KoreanCounting";
        ListLevelFormat[ListLevelFormat["KoreanDigital"] = 40] = "KoreanDigital";
        ListLevelFormat[ListLevelFormat["KoreanDigital2"] = 41] = "KoreanDigital2";
        ListLevelFormat[ListLevelFormat["KoreanLegal"] = 42] = "KoreanLegal";
        ListLevelFormat[ListLevelFormat["LowerLetter"] = 43] = "LowerLetter";
        ListLevelFormat[ListLevelFormat["LowerRoman"] = 44] = "LowerRoman";
        ListLevelFormat[ListLevelFormat["None"] = 45] = "None";
        ListLevelFormat[ListLevelFormat["NumberInDash"] = 46] = "NumberInDash";
        ListLevelFormat[ListLevelFormat["Ordinal"] = 47] = "Ordinal";
        ListLevelFormat[ListLevelFormat["OrdinalText"] = 48] = "OrdinalText";
        ListLevelFormat[ListLevelFormat["RussianLower"] = 49] = "RussianLower";
        ListLevelFormat[ListLevelFormat["RussianUpper"] = 50] = "RussianUpper";
        ListLevelFormat[ListLevelFormat["TaiwaneseCounting"] = 51] = "TaiwaneseCounting";
        ListLevelFormat[ListLevelFormat["TaiwaneseCountingThousand"] = 52] = "TaiwaneseCountingThousand";
        ListLevelFormat[ListLevelFormat["TaiwaneseDigital"] = 53] = "TaiwaneseDigital";
        ListLevelFormat[ListLevelFormat["ThaiDescriptive"] = 54] = "ThaiDescriptive";
        ListLevelFormat[ListLevelFormat["ThaiLetters"] = 55] = "ThaiLetters";
        ListLevelFormat[ListLevelFormat["ThaiNumbers"] = 56] = "ThaiNumbers";
        ListLevelFormat[ListLevelFormat["UpperLetter"] = 57] = "UpperLetter";
        ListLevelFormat[ListLevelFormat["UpperRoman"] = 58] = "UpperRoman";
        ListLevelFormat[ListLevelFormat["VietnameseDescriptive"] = 59] = "VietnameseDescriptive";
    })(ListLevelFormat = ASPx.ListLevelFormat || (ASPx.ListLevelFormat = {}));
    var ListLevelNumberAlignment;
    (function (ListLevelNumberAlignment) {
        ListLevelNumberAlignment[ListLevelNumberAlignment["Left"] = 0] = "Left";
        ListLevelNumberAlignment[ListLevelNumberAlignment["Center"] = 1] = "Center";
        ListLevelNumberAlignment[ListLevelNumberAlignment["Right"] = 2] = "Right";
    })(ListLevelNumberAlignment = ASPx.ListLevelNumberAlignment || (ASPx.ListLevelNumberAlignment = {}));
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var OpenInsertPictureDialogCommand = (function (_super) {
        __extends(OpenInsertPictureDialogCommand, _super);
        function OpenInsertPictureDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertPicture;
            return _this;
        }
        OpenInsertPictureDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        OpenInsertPictureDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return OpenInsertPictureDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.OpenInsertPictureDialogCommand = OpenInsertPictureDialogCommand;
    var InsertPictureCommand = (function (_super) {
        __extends(InsertPictureCommand, _super);
        function InsertPictureCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertPicture;
            return _this;
        }
        InsertPictureCommand.prototype.execute = function (imageUrl) {
            ASPx.ApiUtils.assertFile(imageUrl, "imageUrl");
            var size = __aspxRichEdit.UnitConverter.pixelsToTwips(32);
            var runInfo = new __aspxRichEdit.HtmlImport.ImportedInlinePictureRunInfo(this._core.viewManager.emptyImageCacheId, new __aspxRichEdit.Size(size, size), new __aspxRichEdit.Size(100, 100), false, imageUrl, -1);
            this._core.history.beginTransaction();
            var interval = this._core.selection.getLastSelectedInterval().clone();
            if (interval.length > 0) {
                __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this._core, this._core.model.activeSubDocument, new __aspxRichEdit.FixedInterval(interval.start, 0), __aspxRichEdit.UpdateInputPositionProperties.No, this._core.selection.endOfLine);
                __aspxRichEdit.ModelManipulator.removeInterval(this._core, this._core.model.activeSubDocument, interval, false, true);
                interval.length = 0;
            }
            __aspxRichEdit.ModelManipulator.pasteHtmlData(this._core, this._core.model.activeSubDocument, interval, new __aspxRichEdit.HtmlImport.HtmlImportData([runInfo], []));
            this._core.history.endTransaction();
            return true;
        };
        InsertPictureCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertPictureCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertPictureCommand = InsertPictureCommand;
    var OpenInsertSymbolDialogCommand = (function (_super) {
        __extends(OpenInsertSymbolDialogCommand, _super);
        function OpenInsertSymbolDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowSymbolForm;
            return _this;
        }
        OpenInsertSymbolDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        OpenInsertSymbolDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return OpenInsertSymbolDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.OpenInsertSymbolDialogCommand = OpenInsertSymbolDialogCommand;
    var InsertSymbolCommand = (function (_super) {
        __extends(InsertSymbolCommand, _super);
        function InsertSymbolCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowSymbolForm;
            return _this;
        }
        InsertSymbolCommand.prototype.execute = function (symbol, fontName) {
            ASPx.ApiUtils.assertString(symbol, true, "symbol");
            ASPx.ApiUtils.assertString(fontName, true, "fontName");
            var parameters = new __aspxRichEdit.DialogSymbolsParameters();
            var initParameters = parameters.clone();
            parameters.fontName = fontName;
            parameters.symbol = symbol;
            return this.applyParameters(initParameters, parameters);
        };
        InsertSymbolCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertSymbolCommand;
    }(ASPx.CommandWithSimpleStateDialogBase));
    ASPx.InsertSymbolCommand = InsertSymbolCommand;
    var InsertParagraphCommand = (function (_super) {
        __extends(InsertParagraphCommand, _super);
        function InsertParagraphCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertParagraph;
            return _this;
        }
        InsertParagraphCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertParagraphCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertParagraphCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertParagraphCommand = InsertParagraphCommand;
    var InsertTextCommand = (function (_super) {
        __extends(InsertTextCommand, _super);
        function InsertTextCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertText;
            return _this;
        }
        InsertTextCommand.prototype.execute = function (text, interval, subDocumentId) {
            var insertedText = ASPx.ApiParametersChecker.check(text, 1, false, [
                ASPx.ApiParametersChecker.stringDescriptor("text", function (v) { return v.replace(/\r\n/g, "\n").replace(/\r/g, "\n"); }, false)
            ]);
            var subDocument = ASPx.ApiParametersChecker.subDocumentById(subDocumentId, 3, true, this._core, true);
            var subDocEndPos = subDocument.getDocumentEndPosition();
            var coreInterval = ASPx.ApiParametersChecker.check(interval, 2, true, [
                ASPx.ApiParametersChecker.objectDescriptor("interval", "ASPx.Interval", function (v) { return new __aspxRichEdit.FixedInterval(v.start, v.length); }),
                ASPx.ApiParametersChecker.numberDescriptor("position", function (pos) { return new __aspxRichEdit.FixedInterval(pos, 0); }, 0, subDocEndPos - 1)
            ]);
            var allowChangeSelection = coreInterval === undefined;
            if (!coreInterval)
                coreInterval = this._core.selection.getLastSelectedInterval();
            if (coreInterval.end > subDocEndPos || coreInterval.start > subDocEndPos - 1)
                coreInterval = CoreFixedInterval.fromPositions(Math.min(subDocEndPos - 1, coreInterval.start), Math.min(subDocEndPos, coreInterval.end));
            var currPosition = 0;
            var stringLength = insertedText.length;
            var paragraphSymbolPostion = insertedText.indexOf("\n", currPosition);
            var result = false;
            this._core.history.beginTransaction();
            while (currPosition < stringLength) {
                if (paragraphSymbolPostion == currPosition) {
                    var options = new __aspxRichEdit.CommandOptions(this._core)
                        .setIntervals([coreInterval])
                        .setAllowChangeSelection(allowChangeSelection)
                        .setSubDocument(subDocument);
                    result = this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.InsertParagraph)
                        .execute(true, options) || result;
                    currPosition++;
                    paragraphSymbolPostion = insertedText.indexOf("\n", currPosition);
                    coreInterval.start++;
                }
                else {
                    var paragraphEndPos = paragraphSymbolPostion == -1 ? stringLength : paragraphSymbolPostion;
                    var paragraphText = insertedText.substring(currPosition, paragraphEndPos);
                    var options = new __aspxRichEdit.CommandSimpleOptions(this._core, paragraphText)
                        .setIntervals([coreInterval])
                        .setAllowChangeSelection(allowChangeSelection)
                        .setSubDocument(subDocument);
                    result = this.coreCommand.execute(true, options) || result;
                    currPosition = paragraphEndPos;
                    coreInterval.start += paragraphText.length;
                }
                coreInterval.length = 0;
            }
            this._core.history.endTransaction();
            return result;
        };
        InsertTextCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertTextCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertTextCommand = InsertTextCommand;
    var DeleteCommand = (function (_super) {
        __extends(DeleteCommand, _super);
        function DeleteCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleDeleteKey;
            return _this;
        }
        DeleteCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        DeleteCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return DeleteCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.DeleteCommand = DeleteCommand;
    var RemovePrevWordCommand = (function (_super) {
        __extends(RemovePrevWordCommand, _super);
        function RemovePrevWordCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.RemovePrevWord;
            return _this;
        }
        RemovePrevWordCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        RemovePrevWordCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return RemovePrevWordCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.RemovePrevWordCommand = RemovePrevWordCommand;
    var RemoveNextWordCommand = (function (_super) {
        __extends(RemoveNextWordCommand, _super);
        function RemoveNextWordCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.RemoveNextWord;
            return _this;
        }
        RemoveNextWordCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        RemoveNextWordCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return RemoveNextWordCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.RemoveNextWordCommand = RemoveNextWordCommand;
    var BackspaceCommand = (function (_super) {
        __extends(BackspaceCommand, _super);
        function BackspaceCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleBackspaceKey;
            return _this;
        }
        BackspaceCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        BackspaceCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return BackspaceCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.BackspaceCommand = BackspaceCommand;
    var ChangePictureScaleCommand = (function (_super) {
        __extends(ChangePictureScaleCommand, _super);
        function ChangePictureScaleCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ChangeInlinePictureScale;
            return _this;
        }
        ChangePictureScaleCommand.prototype.execute = function () {
            if (arguments.length === 2) {
                ASPx.ApiUtils.assertPositiveNumber(arguments[0], "x");
                ASPx.ApiUtils.assertPositiveNumber(arguments[1], "y");
                return this.coreCommand.execute(true, [arguments[0], arguments[1]]);
            }
            else if (arguments.length === 1) {
                ASPx.ApiUtils.assertPositiveNumber(arguments[0].x, "scale.x");
                ASPx.ApiUtils.assertPositiveNumber(arguments[0].y, "scale.y");
                return this.coreCommand.execute(true, [arguments[0].x, arguments[0].y]);
            }
            return this.coreCommand.execute(true);
        };
        ChangePictureScaleCommand.prototype.getState = function () {
            var state = this.coreState;
            var value;
            if (state.enabled && state.value) {
                value = new Scale();
                value.x = state.value[0];
                value.y = state.value[1];
            }
            return new ASPx.CommandState(state.visible, state.enabled, value);
        };
        return ChangePictureScaleCommand;
    }(ASPx.CommandBase));
    ASPx.ChangePictureScaleCommand = ChangePictureScaleCommand;
    var MoveContentCommand = (function (_super) {
        __extends(MoveContentCommand, _super);
        function MoveContentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.DragMoveContent;
            return _this;
        }
        MoveContentCommand.prototype.execute = function (position) {
            return this.coreCommand.execute(true, position);
        };
        MoveContentCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return MoveContentCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.MoveContentCommand = MoveContentCommand;
    var CopyContentCommand = (function (_super) {
        __extends(CopyContentCommand, _super);
        function CopyContentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.DragCopyContent;
            return _this;
        }
        CopyContentCommand.prototype.execute = function (position) {
            return this.coreCommand.execute(true, position);
        };
        CopyContentCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return CopyContentCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.CopyContentCommand = CopyContentCommand;
    var InsertTabCommand = (function (_super) {
        __extends(InsertTabCommand, _super);
        function InsertTabCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertTabMark;
            return _this;
        }
        InsertTabCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertTabCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertTabCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertTabCommand = InsertTabCommand;
    var InsertNonBreakingSpaceCommand = (function (_super) {
        __extends(InsertNonBreakingSpaceCommand, _super);
        function InsertNonBreakingSpaceCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertNonBreakingSpace;
            return _this;
        }
        InsertNonBreakingSpaceCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertNonBreakingSpaceCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertNonBreakingSpaceCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertNonBreakingSpaceCommand = InsertNonBreakingSpaceCommand;
    var Scale = (function () {
        function Scale() {
        }
        return Scale;
    }());
    ASPx.Scale = Scale;
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var ChangePageMarginsCommand = (function (_super) {
        __extends(ChangePageMarginsCommand, _super);
        function ChangePageMarginsCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.SetSectionPageMargins;
            return _this;
        }
        ChangePageMarginsCommand.prototype.execute = function () {
            switch (arguments.length) {
                case 4:
                    var _22_inches = __aspxRichEdit.UnitConverter.inchesToTwips(22);
                    ASPx.ApiUtils.assertNumberByBounds(arguments[0], 0, _22_inches, "left");
                    ASPx.ApiUtils.assertNumberByBounds(arguments[1], -_22_inches, _22_inches, "top");
                    ASPx.ApiUtils.assertNumberByBounds(arguments[2], 0, _22_inches, "right");
                    ASPx.ApiUtils.assertNumberByBounds(arguments[3], -_22_inches, _22_inches, "bottom");
                    return this.coreCommand.execute(true, new __aspxRichEdit.CommandSimpleOptions(this._core, new __aspxRichEdit.Margins(arguments[0], arguments[2], arguments[1], arguments[3])));
                case 1:
                    var margins = arguments[0];
                    ASPx.ApiUtils.assertObject(margins, "margins");
                    ASPx.ApiUtils.assertNumber(margins.left, "margins.left");
                    ASPx.ApiUtils.assertNumber(margins.right, "margins.right");
                    ASPx.ApiUtils.assertNumber(margins.top, "margins.top");
                    ASPx.ApiUtils.assertNumber(margins.bottom, "margins.bottom");
                    return this.coreCommand.execute(true, new __aspxRichEdit.CommandSimpleOptions(this._core, new __aspxRichEdit.Margins(margins.left, margins.right, margins.top, margins.bottom)));
                default: throw new Error("arguments must be a Margins object, or a list of margin of each side: left, top, right, bottom");
            }
        };
        ChangePageMarginsCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ChangePageMarginsCommand;
    }(ASPx.CommandBase));
    ASPx.ChangePageMarginsCommand = ChangePageMarginsCommand;
    var OpenPageMarginsDialogCommand = (function (_super) {
        __extends(OpenPageMarginsDialogCommand, _super);
        function OpenPageMarginsDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowPageMarginsSetupForm;
            return _this;
        }
        OpenPageMarginsDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        OpenPageMarginsDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return OpenPageMarginsDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.OpenPageMarginsDialogCommand = OpenPageMarginsDialogCommand;
    var ChangePageOrientationCommand = (function (_super) {
        __extends(ChangePageOrientationCommand, _super);
        function ChangePageOrientationCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.SetLandscapePageOrientation;
            return _this;
        }
        ChangePageOrientationCommand.prototype.execute = function (orientation) {
            ASPx.ApiUtils.assertEnum(orientation, Orientation, "Orientation", "orientation");
            if (orientation === Orientation.Portrait)
                return this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.SetPortraitPageOrientation).execute(true);
            return this.coreCommand.execute(true);
        };
        ChangePageOrientationCommand.prototype.getState = function () {
            var state = this.coreState;
            if (state.value)
                return new ASPx.CommandState(state.visible, state.enabled, Orientation.Landscape);
            else if (this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.SetPortraitPageOrientation).getState())
                return new ASPx.CommandState(state.visible, state.enabled, Orientation.Portrait);
            return new ASPx.CommandState(state.visible, state.enabled, undefined);
        };
        return ChangePageOrientationCommand;
    }(ASPx.CommandBase));
    ASPx.ChangePageOrientationCommand = ChangePageOrientationCommand;
    var OpenPagePaperSizeDialogCommand = (function (_super) {
        __extends(OpenPagePaperSizeDialogCommand, _super);
        function OpenPagePaperSizeDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowPagePaperSetupForm;
            return _this;
        }
        OpenPagePaperSizeDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        OpenPagePaperSizeDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return OpenPagePaperSizeDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.OpenPagePaperSizeDialogCommand = OpenPagePaperSizeDialogCommand;
    var SetPageSizeDialogCommand = (function (_super) {
        __extends(SetPageSizeDialogCommand, _super);
        function SetPageSizeDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowPagePaperSetupForm;
            return _this;
        }
        SetPageSizeDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        SetPageSizeDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return SetPageSizeDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.SetPageSizeDialogCommand = SetPageSizeDialogCommand;
    var ChangePageSizeCommand = (function (_super) {
        __extends(ChangePageSizeCommand, _super);
        function ChangePageSizeCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.SetSectionPageSize;
            return _this;
        }
        ChangePageSizeCommand.prototype.execute = function () {
            switch (arguments.length) {
                case 2:
                    ASPx.ApiUtils.assertNonNegativeNumber(arguments[0], "width");
                    ASPx.ApiUtils.assertNonNegativeNumber(arguments[1], "height");
                    return this.coreCommand.execute(true, { size: new __aspxRichEdit.Size(arguments[0], arguments[1]), updateOrientation: true });
                case 1:
                    var size = arguments[0];
                    ASPx.ApiUtils.assertObject(size, "size");
                    ASPx.ApiUtils.assertNumber(size.width, "size.width");
                    ASPx.ApiUtils.assertNumber(size.height, "size.height");
                    return this.coreCommand.execute(true, { size: new __aspxRichEdit.Size(size.width, size.height), updateOrientation: true });
                default:
                    throw new Error("Arguments must be Size or list of width and height");
            }
        };
        ChangePageSizeCommand.prototype.getState = function () {
            var state = this.coreState;
            var stateSize = state.value;
            var size = new Size();
            size.width = stateSize.width;
            size.height = stateSize.height;
            return new ASPx.CommandState(state.visible, state.enabled, size);
        };
        return ChangePageSizeCommand;
    }(ASPx.CommandBase));
    ASPx.ChangePageSizeCommand = ChangePageSizeCommand;
    var ChangeSectionEqualColumnCountCommand = (function (_super) {
        __extends(ChangeSectionEqualColumnCountCommand, _super);
        function ChangeSectionEqualColumnCountCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.SetSectionColumnCount;
            return _this;
        }
        ChangeSectionEqualColumnCountCommand.prototype.execute = function (columnCount) {
            ASPx.ApiUtils.assertPositiveNumber(columnCount, "columnCount");
            return this.coreCommand.execute(true, columnCount);
        };
        ChangeSectionEqualColumnCountCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ChangeSectionEqualColumnCountCommand;
    }(ASPx.CommandBase));
    ASPx.ChangeSectionEqualColumnCountCommand = ChangeSectionEqualColumnCountCommand;
    var OpenSectionColumnsDialogCommand = (function (_super) {
        __extends(OpenSectionColumnsDialogCommand, _super);
        function OpenSectionColumnsDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowColumnsSetupForm;
            return _this;
        }
        OpenSectionColumnsDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        OpenSectionColumnsDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return OpenSectionColumnsDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.OpenSectionColumnsDialogCommand = OpenSectionColumnsDialogCommand;
    var ChangeSectionColumnsCommand = (function (_super) {
        __extends(ChangeSectionColumnsCommand, _super);
        function ChangeSectionColumnsCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowColumnsSetupForm;
            return _this;
        }
        ChangeSectionColumnsCommand.prototype.execute = function (columns) {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return false;
            ASPx.ApiUtils.assertArray(columns, "columns");
            var command = this.coreCommand;
            var parameters = command.createParameters(new __aspxRichEdit.CommandOptions(this._core));
            var initParameters = parameters.clone();
            parameters.columnsInfo.columns = [];
            for (var i = 0, column = void 0; column = columns[i]; i++) {
                ASPx.ApiUtils.assertObject(column, "column");
                var columnUI = new __aspxRichEdit.ColumnInfoUI(0);
                columnUI.width = column.width;
                columnUI.spacing = column.spacing;
                parameters.columnsInfo.columns.push(columnUI);
            }
            parameters.columnsInfo.columnCount = parameters.columnsInfo.columns.length;
            parameters.columnsInfo.equalColumnWidth = false;
            parameters.columnsInfo.applyType = __aspxRichEdit.SectionPropertiesApplyType.SelectedSections;
            return this.applyParameters(initParameters, parameters);
        };
        ChangeSectionColumnsCommand.prototype.getState = function () {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return ASPx.ApiUtils.createStateWithValue(state, null);
            var command = this.coreCommand;
            var parameters = command.createParameters(new __aspxRichEdit.CommandOptions(this._core));
            var value = [];
            for (var i = 0, columnUI = void 0; columnUI = parameters.columnsInfo.columns[i]; i++) {
                var column = new SectionColumn();
                column.spacing = columnUI.spacing;
                column.width = columnUI.width;
                value.push(column);
            }
            return ASPx.ApiUtils.createStateWithValue(state, value);
        };
        return ChangeSectionColumnsCommand;
    }(ASPx.CommandDialogBase));
    ASPx.ChangeSectionColumnsCommand = ChangeSectionColumnsCommand;
    var ChangePageColorCommand = (function (_super) {
        __extends(ChangePageColorCommand, _super);
        function ChangePageColorCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ChangePageColor;
            return _this;
        }
        ChangePageColorCommand.prototype.execute = function (color) {
            var coreColor = ASPx.ApiParametersChecker.check(color, 1, false, ASPx.ApiParametersChecker.colorDescriptors("color"));
            return this.coreCommand.execute(true, coreColor);
        };
        ChangePageColorCommand.prototype.getState = function () {
            var state = ASPx.ApiUtils.createState(this.coreState);
            state.value = ASPx.ApiUtils.internalColorToApiColor(this.coreState.value);
            return state;
        };
        return ChangePageColorCommand;
    }(ASPx.CommandBase));
    ASPx.ChangePageColorCommand = ChangePageColorCommand;
    var InsertHeaderCommand = (function (_super) {
        __extends(InsertHeaderCommand, _super);
        function InsertHeaderCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertHeader;
            return _this;
        }
        InsertHeaderCommand.prototype.execute = function () {
            return this.coreCommand.execute(true, null);
        };
        InsertHeaderCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertHeaderCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertHeaderCommand = InsertHeaderCommand;
    var InsertFooterCommand = (function (_super) {
        __extends(InsertFooterCommand, _super);
        function InsertFooterCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertFooter;
            return _this;
        }
        InsertFooterCommand.prototype.execute = function () {
            return this.coreCommand.execute(true, null);
        };
        InsertFooterCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertFooterCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertFooterCommand = InsertFooterCommand;
    var LinkHeaderFooterToPreviousCommand = (function (_super) {
        __extends(LinkHeaderFooterToPreviousCommand, _super);
        function LinkHeaderFooterToPreviousCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.LinkHeaderFooterToPrevious;
            return _this;
        }
        LinkHeaderFooterToPreviousCommand.prototype.execute = function () {
            return this.coreCommand.execute(true, null);
        };
        LinkHeaderFooterToPreviousCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return LinkHeaderFooterToPreviousCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.LinkHeaderFooterToPreviousCommand = LinkHeaderFooterToPreviousCommand;
    var GoToFooterCommand = (function (_super) {
        __extends(GoToFooterCommand, _super);
        function GoToFooterCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.GoToPageFooter;
            return _this;
        }
        GoToFooterCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        GoToFooterCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return GoToFooterCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.GoToFooterCommand = GoToFooterCommand;
    var GoToHeaderCommand = (function (_super) {
        __extends(GoToHeaderCommand, _super);
        function GoToHeaderCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.GoToPageHeader;
            return _this;
        }
        GoToHeaderCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        GoToHeaderCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return GoToHeaderCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.GoToHeaderCommand = GoToHeaderCommand;
    var GoToNextHeaderFooterCommand = (function (_super) {
        __extends(GoToNextHeaderFooterCommand, _super);
        function GoToNextHeaderFooterCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.GoToNextPageHeaderFooter;
            return _this;
        }
        GoToNextHeaderFooterCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        GoToNextHeaderFooterCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return GoToNextHeaderFooterCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.GoToNextHeaderFooterCommand = GoToNextHeaderFooterCommand;
    var GoToPreviousHeaderFooterCommand = (function (_super) {
        __extends(GoToPreviousHeaderFooterCommand, _super);
        function GoToPreviousHeaderFooterCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.GoToPreviousPageHeaderFooter;
            return _this;
        }
        GoToPreviousHeaderFooterCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        GoToPreviousHeaderFooterCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return GoToPreviousHeaderFooterCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.GoToPreviousHeaderFooterCommand = GoToPreviousHeaderFooterCommand;
    var SetDifferentFirstPageHeaderFooterCommand = (function (_super) {
        __extends(SetDifferentFirstPageHeaderFooterCommand, _super);
        function SetDifferentFirstPageHeaderFooterCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleDifferentFirstPage;
            return _this;
        }
        SetDifferentFirstPageHeaderFooterCommand.prototype.execute = function (differentFirstPage) {
            if (differentFirstPage !== undefined)
                ASPx.ApiUtils.assertBoolean(differentFirstPage, "differentFirstPage");
            return this.coreCommand.execute(true, differentFirstPage);
        };
        SetDifferentFirstPageHeaderFooterCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return SetDifferentFirstPageHeaderFooterCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.SetDifferentFirstPageHeaderFooterCommand = SetDifferentFirstPageHeaderFooterCommand;
    var SetDifferentOddAndEvenPagesHeaderFooterCommand = (function (_super) {
        __extends(SetDifferentOddAndEvenPagesHeaderFooterCommand, _super);
        function SetDifferentOddAndEvenPagesHeaderFooterCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleDifferentOddAndEvenPages;
            return _this;
        }
        SetDifferentOddAndEvenPagesHeaderFooterCommand.prototype.execute = function (differentOddAndEvenPages) {
            if (differentOddAndEvenPages !== undefined)
                ASPx.ApiUtils.assertBoolean(differentOddAndEvenPages, "differentFirstPage");
            return this.coreCommand.execute(true, differentOddAndEvenPages);
        };
        SetDifferentOddAndEvenPagesHeaderFooterCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return SetDifferentOddAndEvenPagesHeaderFooterCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.SetDifferentOddAndEvenPagesHeaderFooterCommand = SetDifferentOddAndEvenPagesHeaderFooterCommand;
    var CloseHeaderFooterCommand = (function (_super) {
        __extends(CloseHeaderFooterCommand, _super);
        function CloseHeaderFooterCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ClosePageHeaderFooter;
            return _this;
        }
        CloseHeaderFooterCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        CloseHeaderFooterCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return CloseHeaderFooterCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.CloseHeaderFooterCommand = CloseHeaderFooterCommand;
    var SectionColumn = (function () {
        function SectionColumn() {
        }
        return SectionColumn;
    }());
    ASPx.SectionColumn = SectionColumn;
    var Size = (function () {
        function Size() {
        }
        return Size;
    }());
    ASPx.Size = Size;
    var Margins = (function () {
        function Margins() {
        }
        return Margins;
    }());
    ASPx.Margins = Margins;
    var Orientation;
    (function (Orientation) {
        Orientation[Orientation["Landscape"] = 0] = "Landscape";
        Orientation[Orientation["Portrait"] = 1] = "Portrait";
    })(Orientation = ASPx.Orientation || (ASPx.Orientation = {}));
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var IncreaseIndentCommand = (function (_super) {
        __extends(IncreaseIndentCommand, _super);
        function IncreaseIndentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.IncreaseIndent;
            return _this;
        }
        IncreaseIndentCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        IncreaseIndentCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return IncreaseIndentCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.IncreaseIndentCommand = IncreaseIndentCommand;
    var DecreaseIndentCommand = (function (_super) {
        __extends(DecreaseIndentCommand, _super);
        function DecreaseIndentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.DecreaseIndent;
            return _this;
        }
        DecreaseIndentCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        DecreaseIndentCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return DecreaseIndentCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.DecreaseIndentCommand = DecreaseIndentCommand;
    var ShowHiddenSymbolsCommand = (function (_super) {
        __extends(ShowHiddenSymbolsCommand, _super);
        function ShowHiddenSymbolsCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleShowWhitespace;
            return _this;
        }
        ShowHiddenSymbolsCommand.prototype.execute = function (show) {
            return this.coreCommand.execute(true, show);
        };
        ShowHiddenSymbolsCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ShowHiddenSymbolsCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ShowHiddenSymbolsCommand = ShowHiddenSymbolsCommand;
    var ToggleParagraphAlignmentLeftCommand = (function (_super) {
        __extends(ToggleParagraphAlignmentLeftCommand, _super);
        function ToggleParagraphAlignmentLeftCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleParagraphAlignmentLeft;
            return _this;
        }
        ToggleParagraphAlignmentLeftCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleParagraphAlignmentLeftCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleParagraphAlignmentLeftCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleParagraphAlignmentLeftCommand = ToggleParagraphAlignmentLeftCommand;
    var ToggleParagraphAlignmentCenterCommand = (function (_super) {
        __extends(ToggleParagraphAlignmentCenterCommand, _super);
        function ToggleParagraphAlignmentCenterCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleParagraphAlignmentCenter;
            return _this;
        }
        ToggleParagraphAlignmentCenterCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleParagraphAlignmentCenterCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleParagraphAlignmentCenterCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleParagraphAlignmentCenterCommand = ToggleParagraphAlignmentCenterCommand;
    var ToggleParagraphAlignmentRightCommand = (function (_super) {
        __extends(ToggleParagraphAlignmentRightCommand, _super);
        function ToggleParagraphAlignmentRightCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleParagraphAlignmentRight;
            return _this;
        }
        ToggleParagraphAlignmentRightCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleParagraphAlignmentRightCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleParagraphAlignmentRightCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleParagraphAlignmentRightCommand = ToggleParagraphAlignmentRightCommand;
    var ToggleParagraphAlignmentJustifyCommand = (function (_super) {
        __extends(ToggleParagraphAlignmentJustifyCommand, _super);
        function ToggleParagraphAlignmentJustifyCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleParagraphAlignmentJustify;
            return _this;
        }
        ToggleParagraphAlignmentJustifyCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleParagraphAlignmentJustifyCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleParagraphAlignmentJustifyCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleParagraphAlignmentJustifyCommand = ToggleParagraphAlignmentJustifyCommand;
    var SetSingleParagraphSpacingCommand = (function (_super) {
        __extends(SetSingleParagraphSpacingCommand, _super);
        function SetSingleParagraphSpacingCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.SetSingleParagraphSpacing;
            return _this;
        }
        SetSingleParagraphSpacingCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        SetSingleParagraphSpacingCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return SetSingleParagraphSpacingCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.SetSingleParagraphSpacingCommand = SetSingleParagraphSpacingCommand;
    var SetSesquialteralParagraphSpacingCommand = (function (_super) {
        __extends(SetSesquialteralParagraphSpacingCommand, _super);
        function SetSesquialteralParagraphSpacingCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.SetSesquialteralParagraphSpacing;
            return _this;
        }
        SetSesquialteralParagraphSpacingCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        SetSesquialteralParagraphSpacingCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return SetSesquialteralParagraphSpacingCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.SetSesquialteralParagraphSpacingCommand = SetSesquialteralParagraphSpacingCommand;
    var SetDoubleParagraphSpacingCommand = (function (_super) {
        __extends(SetDoubleParagraphSpacingCommand, _super);
        function SetDoubleParagraphSpacingCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.SetDoubleParagraphSpacing;
            return _this;
        }
        SetDoubleParagraphSpacingCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        SetDoubleParagraphSpacingCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return SetDoubleParagraphSpacingCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.SetDoubleParagraphSpacingCommand = SetDoubleParagraphSpacingCommand;
    var AddSpacingBeforeParagraphCommand = (function (_super) {
        __extends(AddSpacingBeforeParagraphCommand, _super);
        function AddSpacingBeforeParagraphCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.AddSpacingBeforeParagraph;
            return _this;
        }
        AddSpacingBeforeParagraphCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        AddSpacingBeforeParagraphCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return AddSpacingBeforeParagraphCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.AddSpacingBeforeParagraphCommand = AddSpacingBeforeParagraphCommand;
    var AddSpacingAfterParagraphCommand = (function (_super) {
        __extends(AddSpacingAfterParagraphCommand, _super);
        function AddSpacingAfterParagraphCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.AddSpacingAfterParagraph;
            return _this;
        }
        AddSpacingAfterParagraphCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        AddSpacingAfterParagraphCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return AddSpacingAfterParagraphCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.AddSpacingAfterParagraphCommand = AddSpacingAfterParagraphCommand;
    var RemoveSpacingBeforeParagraphCommand = (function (_super) {
        __extends(RemoveSpacingBeforeParagraphCommand, _super);
        function RemoveSpacingBeforeParagraphCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.RemoveSpacingBeforeParagraph;
            return _this;
        }
        RemoveSpacingBeforeParagraphCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        RemoveSpacingBeforeParagraphCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return RemoveSpacingBeforeParagraphCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.RemoveSpacingBeforeParagraphCommand = RemoveSpacingBeforeParagraphCommand;
    var RemoveSpacingAfterParagraphCommand = (function (_super) {
        __extends(RemoveSpacingAfterParagraphCommand, _super);
        function RemoveSpacingAfterParagraphCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.RemoveSpacingAfterParagraph;
            return _this;
        }
        RemoveSpacingAfterParagraphCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        RemoveSpacingAfterParagraphCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return RemoveSpacingAfterParagraphCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.RemoveSpacingAfterParagraphCommand = RemoveSpacingAfterParagraphCommand;
    var ChangeParagraphBackColorCommand = (function (_super) {
        __extends(ChangeParagraphBackColorCommand, _super);
        function ChangeParagraphBackColorCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ChangeParagraphBackColor;
            return _this;
        }
        ChangeParagraphBackColorCommand.prototype.execute = function (color) {
            var coreColor = ASPx.ApiParametersChecker.check(color, 1, false, ASPx.ApiParametersChecker.colorDescriptors("color"));
            return this.coreCommand.execute(true, coreColor);
        };
        ChangeParagraphBackColorCommand.prototype.getState = function () {
            var state = ASPx.ApiUtils.createState(this.coreState);
            state.value = ASPx.ApiUtils.internalColorToApiColor(this.coreState.value);
            return state;
        };
        return ChangeParagraphBackColorCommand;
    }(ASPx.CommandBase));
    ASPx.ChangeParagraphBackColorCommand = ChangeParagraphBackColorCommand;
    var OpenParagraphFormattingDialogCommand = (function (_super) {
        __extends(OpenParagraphFormattingDialogCommand, _super);
        function OpenParagraphFormattingDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowParagraphForm;
            return _this;
        }
        OpenParagraphFormattingDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        OpenParagraphFormattingDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return OpenParagraphFormattingDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.OpenParagraphFormattingDialogCommand = OpenParagraphFormattingDialogCommand;
    var ChangeParagraphFormattingCommand = (function (_super) {
        __extends(ChangeParagraphFormattingCommand, _super);
        function ChangeParagraphFormattingCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowParagraphForm;
            return _this;
        }
        ChangeParagraphFormattingCommand.prototype.execute = function (settings) {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return false;
            settings = ASPx.ApiParametersChecker.check(settings, 1, false, [
                ASPx.ApiParametersChecker.objectDescriptor("settings", "ParagraphFormattingSettings", function (val) { return val; })
            ]);
            var props = new __aspxRichEdit.ParagraphProperties();
            props.alignment = ASPx.ApiParametersChecker.check(settings.alignment, 1, true, [
                ASPx.ApiParametersChecker.enumDescriptor("settings.alignment", function (val) { return val; }, ParagraphAlignment, "ASPx.ParagraphAlignment")
            ]);
            props.contextualSpacing = ASPx.ApiParametersChecker.check(settings.contextualSpacing, 1, true, [
                ASPx.ApiParametersChecker.booleanDescriptor("settings.contextualSpacing", function (val) { return val; })
            ]);
            props.firstLineIndent = ASPx.ApiParametersChecker.check(settings.firstLineIndent, 1, true, [
                ASPx.ApiParametersChecker.numberDescriptor("settings.firstLineIndent", function (val) { return val; })
            ]);
            props.firstLineIndentType = ASPx.ApiParametersChecker.check(settings.firstLineIndentType, 1, true, [
                ASPx.ApiParametersChecker.enumDescriptor("settings.firstLineIndentType", function (val) { return val; }, ParagraphFirstLineIndent, "ASPx.ParagraphFirstLineIndent")
            ]);
            props.keepLinesTogether = ASPx.ApiParametersChecker.check(settings.keepLinesTogether, 1, true, [
                ASPx.ApiParametersChecker.booleanDescriptor("settings.keepLinesTogether", function (val) { return val; })
            ]);
            props.leftIndent = ASPx.ApiParametersChecker.check(settings.leftIndent, 1, true, [
                ASPx.ApiParametersChecker.numberDescriptor("settings.leftIndent", function (val) { return val; })
            ]);
            props.outlineLevel = ASPx.ApiParametersChecker.check(settings.outlineLevel, 1, true, [
                ASPx.ApiParametersChecker.numberDescriptor("settings.outlineLevel", function (val) { return val; })
            ]);
            props.pageBreakBefore = ASPx.ApiParametersChecker.check(settings.pageBreakBefore, 1, true, [
                ASPx.ApiParametersChecker.booleanDescriptor("settings.pageBreakBefore", function (val) { return val; })
            ]);
            props.rightIndent = ASPx.ApiParametersChecker.check(settings.rightIndent, 1, true, [
                ASPx.ApiParametersChecker.numberDescriptor("settings.rightIndent", function (val) { return val; })
            ]);
            props.spacingAfter = ASPx.ApiParametersChecker.check(settings.spacingAfter, 1, true, [
                ASPx.ApiParametersChecker.numberDescriptor("settings.spacingAfter", function (val) { return val; })
            ]);
            props.spacingBefore = ASPx.ApiParametersChecker.check(settings.spacingBefore, 1, true, [
                ASPx.ApiParametersChecker.numberDescriptor("settings.spacingBefore", function (val) { return val; })
            ]);
            var backColor = ASPx.ApiParametersChecker.check(settings.backColor, 1, true, ASPx.ApiParametersChecker.colorDescriptors("settings.backColor"));
            props.shadingInfo = backColor === undefined ? undefined : __aspxRichEdit.ShadingInfo.createByColor(__aspxRichEdit.ColorModelInfo.makeByColor(backColor));
            props.lineSpacingType = ASPx.ApiParametersChecker.check(settings.lineSpacingType, 1, true, [
                ASPx.ApiParametersChecker.enumDescriptor("settings.lineSpacingType", function (val) { return val; }, ParagraphLineSpacingType, "ASPx.ParagraphLineSpacingType")
            ]);
            props.lineSpacing = ASPx.ApiParametersChecker.check(settings.lineSpacing, 1, true, [
                ASPx.ApiParametersChecker.numberDescriptor("settings.lineSpacing", function (val) { return val; })
            ]);
            return new __aspxRichEdit.ParagraphPropertiesApplier(this._core, props).apply();
        };
        ChangeParagraphFormattingCommand.prototype.getState = function () {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return ASPx.ApiUtils.createStateWithValue(state, null);
            var rawParProps = this._core.inputPosition.getMergedParagraphPropertiesRaw();
            var value = new ParagraphFormattingSettings();
            value.alignment = rawParProps.alignment === undefined ?
                undefined :
                rawParProps.alignment;
            value.contextualSpacing = rawParProps.contextualSpacing;
            value.firstLineIndent = rawParProps.firstLineIndent;
            value.firstLineIndentType = rawParProps.firstLineIndentType === undefined ?
                undefined :
                rawParProps.firstLineIndentType;
            value.keepLinesTogether = rawParProps.keepLinesTogether;
            value.leftIndent = rawParProps.leftIndent;
            value.lineSpacingType = rawParProps.lineSpacingType === undefined ?
                undefined :
                rawParProps.lineSpacingType;
            value.lineSpacing = rawParProps.lineSpacing;
            value.outlineLevel = rawParProps.outlineLevel;
            value.pageBreakBefore = rawParProps.pageBreakBefore;
            value.rightIndent = rawParProps.rightIndent;
            value.spacingAfter = rawParProps.spacingAfter;
            value.spacingBefore = rawParProps.spacingBefore;
            value.backColor = ASPx.ApiUtils.internalColorToApiColor(rawParProps.shadingInfo.getActualColor(this._core.model.colorProvider));
            return new ASPx.CommandState(state.visible, state.enabled, value);
        };
        return ChangeParagraphFormattingCommand;
    }(ASPx.CommandBase));
    ASPx.ChangeParagraphFormattingCommand = ChangeParagraphFormattingCommand;
    var IncrementParagraphLeftIndentCommand = (function (_super) {
        __extends(IncrementParagraphLeftIndentCommand, _super);
        function IncrementParagraphLeftIndentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.IncrementParagraphLeftIndent;
            return _this;
        }
        IncrementParagraphLeftIndentCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        IncrementParagraphLeftIndentCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return IncrementParagraphLeftIndentCommand;
    }(ASPx.CommandBase));
    ASPx.IncrementParagraphLeftIndentCommand = IncrementParagraphLeftIndentCommand;
    var DecrementParagraphLeftIndentCommand = (function (_super) {
        __extends(DecrementParagraphLeftIndentCommand, _super);
        function DecrementParagraphLeftIndentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.DecrementParagraphLeftIndent;
            return _this;
        }
        DecrementParagraphLeftIndentCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        DecrementParagraphLeftIndentCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return DecrementParagraphLeftIndentCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.DecrementParagraphLeftIndentCommand = DecrementParagraphLeftIndentCommand;
    var OpenTabsDialogCommand = (function (_super) {
        __extends(OpenTabsDialogCommand, _super);
        function OpenTabsDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowTabsForm;
            return _this;
        }
        OpenTabsDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        OpenTabsDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return OpenTabsDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.OpenTabsDialogCommand = OpenTabsDialogCommand;
    var ChangeTabsCommand = (function (_super) {
        __extends(ChangeTabsCommand, _super);
        function ChangeTabsCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowTabsForm;
            return _this;
        }
        ChangeTabsCommand.prototype.execute = function (settings) {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return false;
            var command = this.coreCommand;
            var parameters = command.createParameters(new __aspxRichEdit.CommandOptions(this._core));
            var initParameters = parameters.clone();
            if (settings.defaultTabStop !== undefined) {
                ASPx.ApiUtils.assertNonNegativeNumber(settings.defaultTabStop, "settings.defaultTabStop");
                parameters.defaultTabStop = settings.defaultTabStop;
            }
            if (settings.tabs) {
                parameters.tabProperties.tabsInfo = [];
                for (var i = 0, tab = void 0; tab = settings.tabs[i]; i++) {
                    ASPx.ApiUtils.assertEnum(tab.alignment, TabAlign, "TabAlign", "tabs[" + i + "].alignment");
                    ASPx.ApiUtils.assertEnum(tab.leader, TabLeaderType, "TabLeaderType", "tabs[" + i + "].leader");
                    ASPx.ApiUtils.assertNonNegativeNumber(tab.position, "tabs[" + i + "].position");
                    ASPx.ApiUtils.assertBoolean(tab.deleted, "tabs[" + i + "].deleted");
                    var tabInfo = new __aspxRichEdit.TabInfo(tab.position, tab.alignment, tab.leader, tab.deleted, false);
                    parameters.tabProperties.tabsInfo.push(tabInfo);
                }
            }
            return this.applyParameters(initParameters, parameters);
        };
        ChangeTabsCommand.prototype.getState = function () {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return ASPx.ApiUtils.createStateWithValue(state, null);
            var command = this.coreCommand;
            var parameters = command.createParameters(new __aspxRichEdit.CommandOptions(this._core));
            var settings = new TabsSettings();
            settings.defaultTabStop = parameters.defaultTabStop;
            for (var i = 0, tabInfo = void 0; tabInfo = parameters.tabProperties.tabsInfo[i]; i++) {
                var tabSettings = new TabSettings();
                tabSettings.alignment = tabInfo.alignment;
                tabSettings.leader = tabInfo.leader;
                tabSettings.position = tabInfo.position;
                tabSettings.deleted = tabInfo.deleted;
                settings.tabs.push(tabSettings);
            }
            return ASPx.ApiUtils.createStateWithValue(state, settings);
        };
        return ChangeTabsCommand;
    }(ASPx.CommandDialogBase));
    ASPx.ChangeTabsCommand = ChangeTabsCommand;
    var SetParagraphLevelCommand = (function (_super) {
        __extends(SetParagraphLevelCommand, _super);
        function SetParagraphLevelCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.SetParagraphLevel;
            return _this;
        }
        SetParagraphLevelCommand.prototype.execute = function (level) {
            ASPx.ApiUtils.assertNonNegativeNumber(level, "level");
            ASPx.ApiUtils.assertNumberByBounds(level, 0, 9, "level");
            return this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.SetParagraphLevel).execute(true, level);
        };
        SetParagraphLevelCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return SetParagraphLevelCommand;
    }(ASPx.CommandBase));
    ASPx.SetParagraphLevelCommand = SetParagraphLevelCommand;
    var TabsSettings = (function () {
        function TabsSettings() {
            this.tabs = [];
        }
        return TabsSettings;
    }());
    ASPx.TabsSettings = TabsSettings;
    var TabSettings = (function () {
        function TabSettings() {
        }
        return TabSettings;
    }());
    ASPx.TabSettings = TabSettings;
    var TabAlign;
    (function (TabAlign) {
        TabAlign[TabAlign["Left"] = 0] = "Left";
        TabAlign[TabAlign["Center"] = 1] = "Center";
        TabAlign[TabAlign["Right"] = 2] = "Right";
        TabAlign[TabAlign["Decimal"] = 3] = "Decimal";
        TabAlign[TabAlign["Numbering"] = 4] = "Numbering";
    })(TabAlign = ASPx.TabAlign || (ASPx.TabAlign = {}));
    var TabLeaderType;
    (function (TabLeaderType) {
        TabLeaderType[TabLeaderType["None"] = 0] = "None";
        TabLeaderType[TabLeaderType["Dots"] = 1] = "Dots";
        TabLeaderType[TabLeaderType["MiddleDots"] = 2] = "MiddleDots";
        TabLeaderType[TabLeaderType["Hyphens"] = 3] = "Hyphens";
        TabLeaderType[TabLeaderType["Underline"] = 4] = "Underline";
        TabLeaderType[TabLeaderType["ThickLine"] = 5] = "ThickLine";
        TabLeaderType[TabLeaderType["EqualSign"] = 6] = "EqualSign";
    })(TabLeaderType = ASPx.TabLeaderType || (ASPx.TabLeaderType = {}));
    var ParagraphFormattingSettings = (function () {
        function ParagraphFormattingSettings() {
        }
        return ParagraphFormattingSettings;
    }());
    ASPx.ParagraphFormattingSettings = ParagraphFormattingSettings;
    var ParagraphAlignment;
    (function (ParagraphAlignment) {
        ParagraphAlignment[ParagraphAlignment["Left"] = 0] = "Left";
        ParagraphAlignment[ParagraphAlignment["Right"] = 1] = "Right";
        ParagraphAlignment[ParagraphAlignment["Center"] = 2] = "Center";
        ParagraphAlignment[ParagraphAlignment["Justify"] = 3] = "Justify";
    })(ParagraphAlignment = ASPx.ParagraphAlignment || (ASPx.ParagraphAlignment = {}));
    var ParagraphLineSpacingType;
    (function (ParagraphLineSpacingType) {
        ParagraphLineSpacingType[ParagraphLineSpacingType["Single"] = 0] = "Single";
        ParagraphLineSpacingType[ParagraphLineSpacingType["Sesquialteral"] = 1] = "Sesquialteral";
        ParagraphLineSpacingType[ParagraphLineSpacingType["Double"] = 2] = "Double";
        ParagraphLineSpacingType[ParagraphLineSpacingType["Multiple"] = 3] = "Multiple";
        ParagraphLineSpacingType[ParagraphLineSpacingType["Exactly"] = 4] = "Exactly";
        ParagraphLineSpacingType[ParagraphLineSpacingType["AtLeast"] = 5] = "AtLeast";
    })(ParagraphLineSpacingType = ASPx.ParagraphLineSpacingType || (ASPx.ParagraphLineSpacingType = {}));
    var ParagraphFirstLineIndent;
    (function (ParagraphFirstLineIndent) {
        ParagraphFirstLineIndent[ParagraphFirstLineIndent["None"] = 0] = "None";
        ParagraphFirstLineIndent[ParagraphFirstLineIndent["Indented"] = 1] = "Indented";
        ParagraphFirstLineIndent[ParagraphFirstLineIndent["Hanging"] = 2] = "Hanging";
    })(ParagraphFirstLineIndent = ASPx.ParagraphFirstLineIndent || (ASPx.ParagraphFirstLineIndent = {}));
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var InsertRtfCommand = (function (_super) {
        __extends(InsertRtfCommand, _super);
        function InsertRtfCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertRtf;
            return _this;
        }
        InsertRtfCommand.prototype.execute = function (rtfText, position, subDocumentId, callback) {
            rtfText = ASPx.ApiParametersChecker.check(rtfText, 1, false, [
                ASPx.ApiParametersChecker.stringDescriptor("rtfText", function (val) { return val; }, false)
            ]);
            position = ASPx.ApiParametersChecker.check(position, 2, false, [
                ASPx.ApiParametersChecker.numberDescriptor("position", function (val) { return val; })
            ]);
            var subDocument = ASPx.ApiParametersChecker.subDocumentById(subDocumentId, 3, true, this._core, true);
            callback = ASPx.ApiParametersChecker.check(callback, 4, true, [
                ASPx.ApiParametersChecker.functionDescriptor("callback", function (val) { return val; })
            ]);
            if (!callback)
                callback = function () { };
            return this.coreCommand.execute(true, new __aspxRichEdit.InsertRtfCommandOptions(rtfText, position, subDocument, callback));
        };
        InsertRtfCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertRtfCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertRtfCommand = InsertRtfCommand;
    var GetRtfCommand = (function (_super) {
        __extends(GetRtfCommand, _super);
        function GetRtfCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.GetRtf;
            return _this;
        }
        GetRtfCommand.prototype.execute = function (interval, callback, subDocumentId) {
            var coreInterval = ASPx.ApiParametersChecker.check(interval, 1, false, [
                ASPx.ApiParametersChecker.objectDescriptor("interval", "ASPx.Interval", function (v) { return new CoreFixedInterval(v.start, v.length); })
            ]);
            callback = ASPx.ApiParametersChecker.check(callback, 2, false, [
                ASPx.ApiParametersChecker.functionDescriptor("callback", function (val) { return val; })
            ]);
            var subDocument = ASPx.ApiParametersChecker.subDocumentById(subDocumentId, 3, true, this._core, true);
            return this.coreCommand.execute(true, new __aspxRichEdit.GetRtfCommandOptions(coreInterval, callback, subDocument));
        };
        GetRtfCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return GetRtfCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.GetRtfCommand = GetRtfCommand;
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var AssignShortcutCommand = (function (_super) {
        __extends(AssignShortcutCommand, _super);
        function AssignShortcutCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.AssignShortcut;
            return _this;
        }
        AssignShortcutCommand.prototype.execute = function (keyCode, callback) {
            ASPx.ApiUtils.assertNumber(keyCode, "keyCode");
            ASPx.ApiUtils.assertFunction(callback, "callback");
            return this.coreCommand.execute(true, new __aspxRichEdit.AssignShortcutCommandOptions(this._core, keyCode, callback));
        };
        AssignShortcutCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return AssignShortcutCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.AssignShortcutCommand = AssignShortcutCommand;
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var OpenSpellingDialogCommand = (function (_super) {
        __extends(OpenSpellingDialogCommand, _super);
        function OpenSpellingDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowSpellCheckerForm;
            return _this;
        }
        OpenSpellingDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        OpenSpellingDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return OpenSpellingDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.OpenSpellingDialogCommand = OpenSpellingDialogCommand;
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var OpenInsertTableDialogCommand = (function (_super) {
        __extends(OpenInsertTableDialogCommand, _super);
        function OpenInsertTableDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowInsertTableForm;
            return _this;
        }
        OpenInsertTableDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        OpenInsertTableDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return OpenInsertTableDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.OpenInsertTableDialogCommand = OpenInsertTableDialogCommand;
    var InsertTableCommand = (function (_super) {
        __extends(InsertTableCommand, _super);
        function InsertTableCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowInsertTableForm;
            return _this;
        }
        InsertTableCommand.prototype.execute = function (columnCount, rowCount) {
            ASPx.ApiUtils.assertPositiveNumber(columnCount, "columnCount");
            ASPx.ApiUtils.assertNumberByBounds(columnCount, 1, 63, "columnCount");
            ASPx.ApiUtils.assertPositiveNumber(rowCount, "rowCount");
            return this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.InsertTableCore).execute(true, { rowCount: rowCount, cellCount: columnCount });
        };
        InsertTableCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertTableCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertTableCommand = InsertTableCommand;
    var OpenTableFormattingDialogCommand = (function (_super) {
        __extends(OpenTableFormattingDialogCommand, _super);
        function OpenTableFormattingDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowTablePropertiesForm;
            return _this;
        }
        OpenTableFormattingDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        OpenTableFormattingDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return OpenTableFormattingDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.OpenTableFormattingDialogCommand = OpenTableFormattingDialogCommand;
    var ChangeTableFormattingCommand = (function (_super) {
        __extends(ChangeTableFormattingCommand, _super);
        function ChangeTableFormattingCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowTablePropertiesForm;
            return _this;
        }
        ChangeTableFormattingCommand.prototype.execute = function (settings) {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return false;
            var command = this.coreCommand;
            var parameters = command.createParameters(new __aspxRichEdit.CommandOptions(this._core));
            var initParameters = parameters.clone();
            if (settings.alignment !== undefined) {
                ASPx.ApiUtils.assertEnum(settings.alignment, TableRowAlignment, "TableRowAlignment", "settings.alignment");
                parameters.tableRowAlignment = settings.alignment;
            }
            if (settings.allowSpacingBetweenCells !== undefined) {
                ASPx.ApiUtils.assertBoolean(settings.allowSpacingBetweenCells, "settings.allowSpacingBetweenCells");
                parameters.allowCellSpacing = settings.allowSpacingBetweenCells;
            }
            if (settings.defaultCellMarginBottom !== undefined) {
                ASPx.ApiUtils.assertNumber(settings.defaultCellMarginBottom, "settings.defaultCellMarginBottom");
                parameters.defaultCellMarginBottom = settings.defaultCellMarginBottom;
            }
            if (settings.defaultCellMarginLeft !== undefined) {
                ASPx.ApiUtils.assertNumber(settings.defaultCellMarginLeft, "settings.defaultCellMarginLeft");
                parameters.defaultCellMarginLeft = settings.defaultCellMarginLeft;
            }
            if (settings.defaultCellMarginRight !== undefined) {
                ASPx.ApiUtils.assertNumber(settings.defaultCellMarginRight, "settings.defaultCellMarginRight");
                parameters.defaultCellMarginRight = settings.defaultCellMarginRight;
            }
            if (settings.defaultCellMarginTop !== undefined) {
                ASPx.ApiUtils.assertNumber(settings.defaultCellMarginTop, "settings.defaultCellMarginTop");
                parameters.defaultCellMarginTop = settings.defaultCellMarginTop;
            }
            if (settings.indent !== undefined) {
                ASPx.ApiUtils.assertNumber(settings.indent, "settings.indent");
                parameters.tableIndent = settings.indent;
            }
            if (settings.preferredWidth !== undefined) {
                if (settings.preferredWidth == null) {
                    parameters.useDefaultTableWidth = true;
                }
                else {
                    ASPx.ApiUtils.assertNonNegativeNumber(settings.preferredWidth.value, "settings.preferredWidth.value");
                    ASPx.ApiUtils.assertEnum(settings.preferredWidth.type, TableWidthUnitType, "TableWidthUnitType", "settings.preferredWidth.type");
                    parameters.useDefaultTableWidth = false;
                    parameters.tablePreferredWidth = __aspxRichEdit.TableWidthUnit.create(settings.preferredWidth.value, settings.preferredWidth.type);
                }
            }
            if (settings.resizeToFitContent !== undefined) {
                ASPx.ApiUtils.assertBoolean(settings.resizeToFitContent, "settings.resizeToFitContent");
                parameters.resizeToFitContent = settings.resizeToFitContent;
            }
            if (settings.spacingBetweenCells !== undefined) {
                ASPx.ApiUtils.assertNonNegativeNumber(settings.spacingBetweenCells, "settings.spacingBetweenCells");
                parameters.cellSpacing = settings.spacingBetweenCells;
            }
            return this.applyParameters(initParameters, parameters);
        };
        ChangeTableFormattingCommand.prototype.getState = function () {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return ASPx.ApiUtils.createStateWithValue(state, null);
            var command = this.coreCommand;
            var parameters = command.createParameters(new __aspxRichEdit.CommandOptions(this._core));
            var value = new TableFormattingSettings();
            value.alignment = parameters.tableRowAlignment;
            value.allowSpacingBetweenCells = parameters.allowCellSpacing;
            value.defaultCellMarginBottom = parameters.defaultCellMarginBottom;
            value.defaultCellMarginLeft = parameters.defaultCellMarginLeft;
            value.defaultCellMarginRight = parameters.defaultCellMarginRight;
            value.defaultCellMarginTop = parameters.defaultCellMarginTop;
            value.indent = parameters.tableIndent;
            value.preferredWidth = new TableWidthUnit();
            value.preferredWidth.type = parameters.tablePreferredWidth.type;
            value.preferredWidth.value = parameters.tablePreferredWidth.value;
            value.resizeToFitContent = parameters.resizeToFitContent;
            value.spacingBetweenCells = parameters.cellSpacing;
            return ASPx.ApiUtils.createStateWithValue(this.coreState, value);
        };
        return ChangeTableFormattingCommand;
    }(ASPx.CommandDialogBase));
    ASPx.ChangeTableFormattingCommand = ChangeTableFormattingCommand;
    var ChangeTableRowPreferredHeightCommand = (function (_super) {
        __extends(ChangeTableRowPreferredHeightCommand, _super);
        function ChangeTableRowPreferredHeightCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ChangeTableRowHeight;
            return _this;
        }
        ChangeTableRowPreferredHeightCommand.prototype.execute = function (preferredHeight) {
            ASPx.ApiUtils.assertEnum(preferredHeight.type, TableHeightUnitType, "TableHeightUnitType", "height.type");
            ASPx.ApiUtils.assertNonNegativeNumber(preferredHeight.value, "height.value");
            return this.coreCommand.execute(true, __aspxRichEdit.TableHeightUnit.create(preferredHeight.value, preferredHeight.type));
        };
        ChangeTableRowPreferredHeightCommand.prototype.getState = function () {
            var state = this.coreState;
            if (!state.enabled || !state.visible || !state.value)
                return ASPx.ApiUtils.createStateWithValue(state, state.value);
            var coreValue = state.value;
            var value = new TableHeightUnit();
            value.type = coreValue.type;
            value.value = coreValue.value;
            return ASPx.ApiUtils.createStateWithValue(this.coreState, value);
        };
        return ChangeTableRowPreferredHeightCommand;
    }(ASPx.CommandBase));
    ASPx.ChangeTableRowPreferredHeightCommand = ChangeTableRowPreferredHeightCommand;
    var ChangeTableCellPreferredWidthCommand = (function (_super) {
        __extends(ChangeTableCellPreferredWidthCommand, _super);
        function ChangeTableCellPreferredWidthCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ChangeTableCellWidth;
            return _this;
        }
        ChangeTableCellPreferredWidthCommand.prototype.execute = function (preferredWidth) {
            ASPx.ApiUtils.assertEnum(preferredWidth.type, TableWidthUnitType, "TableWidthUnitType", "width.type");
            ASPx.ApiUtils.assertNonNegativeNumber(preferredWidth.value, "width.value");
            return this.coreCommand.execute(true, __aspxRichEdit.TableWidthUnit.create(preferredWidth.value, preferredWidth.type));
        };
        ChangeTableCellPreferredWidthCommand.prototype.getState = function () {
            var state = this.coreState;
            if (!state.enabled || !state.visible || !state.value)
                return ASPx.ApiUtils.createStateWithValue(state, state.value);
            var coreValue = state.value;
            var value = new TableWidthUnit();
            value.type = coreValue.type;
            value.value = coreValue.value;
            return ASPx.ApiUtils.createStateWithValue(this.coreState, value);
        };
        return ChangeTableCellPreferredWidthCommand;
    }(ASPx.CommandBase));
    ASPx.ChangeTableCellPreferredWidthCommand = ChangeTableCellPreferredWidthCommand;
    var ChangeTableColumnPreferredWidthCommand = (function (_super) {
        __extends(ChangeTableColumnPreferredWidthCommand, _super);
        function ChangeTableColumnPreferredWidthCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ChangeTableCellWidth;
            return _this;
        }
        ChangeTableColumnPreferredWidthCommand.prototype.execute = function (preferredWidth) {
            ASPx.ApiUtils.assertEnum(preferredWidth.type, TableWidthUnitType, "TableWidthUnitType", "width.type");
            ASPx.ApiUtils.assertNonNegativeNumber(preferredWidth.value, "width.value");
            return this.coreCommand.execute(true, __aspxRichEdit.TableWidthUnit.create(preferredWidth.value, preferredWidth.type));
        };
        ChangeTableColumnPreferredWidthCommand.prototype.getState = function () {
            var state = this.coreState;
            if (!state.enabled || !state.visible || !state.value)
                return ASPx.ApiUtils.createStateWithValue(state, state.value);
            var coreValue = state.value;
            var value = new TableWidthUnit();
            value.type = coreValue.type;
            value.value = coreValue.value;
            return ASPx.ApiUtils.createStateWithValue(this.coreState, value);
        };
        return ChangeTableColumnPreferredWidthCommand;
    }(ASPx.CommandBase));
    ASPx.ChangeTableColumnPreferredWidthCommand = ChangeTableColumnPreferredWidthCommand;
    var ChangeTableCellFormattingCommand = (function (_super) {
        __extends(ChangeTableCellFormattingCommand, _super);
        function ChangeTableCellFormattingCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowTablePropertiesForm;
            return _this;
        }
        ChangeTableCellFormattingCommand.prototype.execute = function (settings) {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return false;
            var command = this.coreCommand;
            var parameters = command.createParameters(new __aspxRichEdit.CommandOptions(this._core));
            var initParameters = parameters.clone();
            if (settings.marginBottom !== undefined) {
                ASPx.ApiUtils.assertNumber(settings.marginBottom, "settings.marginBottom");
                parameters.cellMarginBottom = settings.marginBottom;
            }
            if (settings.marginLeft !== undefined) {
                ASPx.ApiUtils.assertNumber(settings.marginLeft, "settings.marginLeft");
                parameters.cellMarginLeft = settings.marginLeft;
            }
            if (settings.marginRight !== undefined) {
                ASPx.ApiUtils.assertNumber(settings.marginRight, "settings.marginRight");
                parameters.cellMarginRight = settings.marginRight;
            }
            if (settings.marginsSameAsTable !== undefined) {
                ASPx.ApiUtils.assertBoolean(settings.marginsSameAsTable, "settings.marginsSameAsTable");
                parameters.cellMarginsSameAsTable = settings.marginsSameAsTable;
            }
            if (settings.marginTop !== undefined) {
                ASPx.ApiUtils.assertNumber(settings.marginTop, "settings.marginTop");
                parameters.cellMarginTop = settings.marginTop;
            }
            if (settings.noWrap !== undefined) {
                ASPx.ApiUtils.assertBoolean(settings.noWrap, "settings.noWrap");
                parameters.cellNoWrap = settings.noWrap;
            }
            if (settings.preferredWidth !== undefined) {
                if (settings.preferredWidth == null) {
                    parameters.useDefaultCellWidth = true;
                }
                else {
                    ASPx.ApiUtils.assertNumber(settings.preferredWidth.value, "settings.preferredWidth.value");
                    ASPx.ApiUtils.assertEnum(settings.preferredWidth.type, TableWidthUnitType, "TableWidthUnitType", "settings.preferredWidth.type");
                    parameters.cellPreferredWidth = __aspxRichEdit.TableWidthUnit.create(settings.preferredWidth.value, settings.preferredWidth.type);
                    parameters.useDefaultCellWidth = false;
                }
            }
            if (settings.verticalAlignment !== undefined) {
                ASPx.ApiUtils.assertEnum(settings.verticalAlignment, TableCellVerticalAlignment, "TableCellVerticalAlignment", "settings.verticalAlignment");
                parameters.cellVerticalAlignment = settings.verticalAlignment;
            }
            return this.applyParameters(initParameters, parameters);
        };
        ChangeTableCellFormattingCommand.prototype.getState = function () {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return ASPx.ApiUtils.createStateWithValue(state, null);
            var command = this.coreCommand;
            var parameters = command.createParameters(new __aspxRichEdit.CommandOptions(this._core));
            var value = new TableCellFormattingSettings();
            value.marginBottom = parameters.cellMarginBottom;
            value.marginLeft = parameters.cellMarginLeft;
            value.marginRight = parameters.cellMarginRight;
            value.marginsSameAsTable = parameters.cellMarginsSameAsTable;
            value.marginTop = parameters.cellMarginTop;
            value.noWrap = parameters.cellNoWrap;
            value.preferredWidth = new TableWidthUnit();
            value.preferredWidth.type = parameters.cellPreferredWidth.type;
            value.preferredWidth.value = parameters.cellPreferredWidth.value;
            value.verticalAlignment = parameters.cellVerticalAlignment;
            return ASPx.ApiUtils.createStateWithValue(this.coreState, value);
        };
        return ChangeTableCellFormattingCommand;
    }(ASPx.CommandDialogBase));
    ASPx.ChangeTableCellFormattingCommand = ChangeTableCellFormattingCommand;
    var InsertTableColumnToTheLeftCommand = (function (_super) {
        __extends(InsertTableColumnToTheLeftCommand, _super);
        function InsertTableColumnToTheLeftCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertTableColumnToTheLeft;
            return _this;
        }
        InsertTableColumnToTheLeftCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertTableColumnToTheLeftCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertTableColumnToTheLeftCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertTableColumnToTheLeftCommand = InsertTableColumnToTheLeftCommand;
    var InsertTableColumnToTheRightCommand = (function (_super) {
        __extends(InsertTableColumnToTheRightCommand, _super);
        function InsertTableColumnToTheRightCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertTableColumnToTheRight;
            return _this;
        }
        InsertTableColumnToTheRightCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertTableColumnToTheRightCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertTableColumnToTheRightCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertTableColumnToTheRightCommand = InsertTableColumnToTheRightCommand;
    var InsertTableRowBelowCommand = (function (_super) {
        __extends(InsertTableRowBelowCommand, _super);
        function InsertTableRowBelowCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertTableRowBelow;
            return _this;
        }
        InsertTableRowBelowCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertTableRowBelowCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertTableRowBelowCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertTableRowBelowCommand = InsertTableRowBelowCommand;
    var InsertTableRowAboveCommand = (function (_super) {
        __extends(InsertTableRowAboveCommand, _super);
        function InsertTableRowAboveCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertTableRowAbove;
            return _this;
        }
        InsertTableRowAboveCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertTableRowAboveCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertTableRowAboveCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertTableRowAboveCommand = InsertTableRowAboveCommand;
    var DeleteTableRowsCommand = (function (_super) {
        __extends(DeleteTableRowsCommand, _super);
        function DeleteTableRowsCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.DeleteTableRows;
            return _this;
        }
        DeleteTableRowsCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        DeleteTableRowsCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return DeleteTableRowsCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.DeleteTableRowsCommand = DeleteTableRowsCommand;
    var DeleteTableColumnsCommand = (function (_super) {
        __extends(DeleteTableColumnsCommand, _super);
        function DeleteTableColumnsCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.DeleteTableColumns;
            return _this;
        }
        DeleteTableColumnsCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        DeleteTableColumnsCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return DeleteTableColumnsCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.DeleteTableColumnsCommand = DeleteTableColumnsCommand;
    var InsertTableCellWithShiftToTheLeftCommand = (function (_super) {
        __extends(InsertTableCellWithShiftToTheLeftCommand, _super);
        function InsertTableCellWithShiftToTheLeftCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertTableCellWithShiftToTheLeft;
            return _this;
        }
        InsertTableCellWithShiftToTheLeftCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertTableCellWithShiftToTheLeftCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertTableCellWithShiftToTheLeftCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertTableCellWithShiftToTheLeftCommand = InsertTableCellWithShiftToTheLeftCommand;
    var DeleteTableCellsWithShiftHorizontallyCommand = (function (_super) {
        __extends(DeleteTableCellsWithShiftHorizontallyCommand, _super);
        function DeleteTableCellsWithShiftHorizontallyCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.DeleteTableCellsWithShiftToTheHorizontally;
            return _this;
        }
        DeleteTableCellsWithShiftHorizontallyCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        DeleteTableCellsWithShiftHorizontallyCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return DeleteTableCellsWithShiftHorizontallyCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.DeleteTableCellsWithShiftHorizontallyCommand = DeleteTableCellsWithShiftHorizontallyCommand;
    var DeleteTableCellsWithShiftVerticallyCommand = (function (_super) {
        __extends(DeleteTableCellsWithShiftVerticallyCommand, _super);
        function DeleteTableCellsWithShiftVerticallyCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.DeleteTableCellsWithShiftToTheVertically;
            return _this;
        }
        DeleteTableCellsWithShiftVerticallyCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        DeleteTableCellsWithShiftVerticallyCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return DeleteTableCellsWithShiftVerticallyCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.DeleteTableCellsWithShiftVerticallyCommand = DeleteTableCellsWithShiftVerticallyCommand;
    var DeleteTableCommand = (function (_super) {
        __extends(DeleteTableCommand, _super);
        function DeleteTableCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.DeleteTable;
            return _this;
        }
        DeleteTableCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        DeleteTableCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return DeleteTableCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.DeleteTableCommand = DeleteTableCommand;
    var InsertTableCellsDialogCommand = (function (_super) {
        __extends(InsertTableCellsDialogCommand, _super);
        function InsertTableCellsDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowInsertTableCellsForm;
            return _this;
        }
        InsertTableCellsDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertTableCellsDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertTableCellsDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertTableCellsDialogCommand = InsertTableCellsDialogCommand;
    var DeleteTableCellsDialogCommand = (function (_super) {
        __extends(DeleteTableCellsDialogCommand, _super);
        function DeleteTableCellsDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowDeleteTableCellsForm;
            return _this;
        }
        DeleteTableCellsDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        DeleteTableCellsDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return DeleteTableCellsDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.DeleteTableCellsDialogCommand = DeleteTableCellsDialogCommand;
    var MergeTableCellsCommand = (function (_super) {
        __extends(MergeTableCellsCommand, _super);
        function MergeTableCellsCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.MergeTableCells;
            return _this;
        }
        MergeTableCellsCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        MergeTableCellsCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return MergeTableCellsCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.MergeTableCellsCommand = MergeTableCellsCommand;
    var SplitTableCellsDialogCommand = (function (_super) {
        __extends(SplitTableCellsDialogCommand, _super);
        function SplitTableCellsDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowSplitTableCellsForm;
            return _this;
        }
        SplitTableCellsDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        SplitTableCellsDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return SplitTableCellsDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.SplitTableCellsDialogCommand = SplitTableCellsDialogCommand;
    var SplitTableCellsCommand = (function (_super) {
        __extends(SplitTableCellsCommand, _super);
        function SplitTableCellsCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowSplitTableCellsForm;
            return _this;
        }
        SplitTableCellsCommand.prototype.execute = function (rowCount, columnCount, mergeBeforeSplit) {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return false;
            var command = this.coreCommand;
            var parameters = command.createParameters(new __aspxRichEdit.CommandOptions(this._core));
            var initParameters = parameters.clone();
            ASPx.ApiUtils.assertPositiveNumber(rowCount, "rowCount");
            ASPx.ApiUtils.assertPositiveNumber(columnCount, "columnCount");
            ASPx.ApiUtils.assertBoolean(mergeBeforeSplit, "mergeBeforeSplit");
            if (!parameters.disableRowsSelector) {
                if (parameters.availableRowNumber > 1)
                    parameters.rowCount = rowCount > 1 ? parameters.availableRowNumber : 1;
                else
                    parameters.rowCount = rowCount;
            }
            parameters.columnCount = columnCount;
            parameters.isMergeBeforeSplit = mergeBeforeSplit;
            return this.applyParameters(initParameters, parameters);
        };
        SplitTableCellsCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return SplitTableCellsCommand;
    }(ASPx.CommandWithSimpleStateDialogBase));
    ASPx.SplitTableCellsCommand = SplitTableCellsCommand;
    var InsertTableCellsWithShiftToTheVerticallyCommand = (function (_super) {
        __extends(InsertTableCellsWithShiftToTheVerticallyCommand, _super);
        function InsertTableCellsWithShiftToTheVerticallyCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertTableCellsWithShiftToTheVertically;
            return _this;
        }
        InsertTableCellsWithShiftToTheVerticallyCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        InsertTableCellsWithShiftToTheVerticallyCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertTableCellsWithShiftToTheVerticallyCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.InsertTableCellsWithShiftToTheVerticallyCommand = InsertTableCellsWithShiftToTheVerticallyCommand;
    var OpenTableBordersAndShadingDialogCommand = (function (_super) {
        __extends(OpenTableBordersAndShadingDialogCommand, _super);
        function OpenTableBordersAndShadingDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowBorderShadingForm;
            return _this;
        }
        OpenTableBordersAndShadingDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true, new __aspxRichEdit.CommandSimpleOptions(this._core, false));
        };
        OpenTableBordersAndShadingDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return OpenTableBordersAndShadingDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.OpenTableBordersAndShadingDialogCommand = OpenTableBordersAndShadingDialogCommand;
    var ChangeTableBordersAndShadingCommand = (function (_super) {
        __extends(ChangeTableBordersAndShadingCommand, _super);
        function ChangeTableBordersAndShadingCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowBorderShadingForm;
            return _this;
        }
        ChangeTableBordersAndShadingCommand.prototype.execute = function (settings, applyToWholeTable) {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return false;
            if (!settings)
                throw new Error("settings is required");
            ASPx.ApiUtils.assertBoolean(applyToWholeTable, "applyToWholeTable");
            var command = this.coreCommand;
            var parameters = command.createParameters(new __aspxRichEdit.CommandSimpleOptions(this._core, applyToWholeTable));
            var initParameters = parameters.clone();
            if (settings.backgroundColor !== undefined) {
                var coreBackgroundColor = ASPx.ApiUtils.assertAndConvertColor(settings.backgroundColor, true, "settings.backgroundColor");
                if (coreBackgroundColor === null)
                    parameters.backgroundColor = __aspxRichEdit.ColorHelper.NO_COLOR.toString();
                else
                    parameters.backgroundColor = __aspxRichEdit.ColorHelper.colorToHash(coreBackgroundColor);
            }
            parameters.applyToWholeTable = applyToWholeTable;
            if (!applyBorderSettingsToDialogParameters(settings.bottom, parameters.bottom, "bottom"))
                parameters.bottom = undefined;
            if (!applyBorderSettingsToDialogParameters(settings.insideHorizontal, parameters.insideHorizontal, "insideHorizontal"))
                parameters.insideHorizontal = undefined;
            if (!applyBorderSettingsToDialogParameters(settings.insideVertical, parameters.insideVertical, "insideVertical"))
                parameters.insideVertical = undefined;
            if (!applyBorderSettingsToDialogParameters(settings.left, parameters.left, "left"))
                parameters.left = undefined;
            if (!applyBorderSettingsToDialogParameters(settings.right, parameters.right, "right"))
                parameters.right = undefined;
            if (!applyBorderSettingsToDialogParameters(settings.top, parameters.top, "top"))
                parameters.top = undefined;
            return this.applyParameters(initParameters, parameters);
        };
        ChangeTableBordersAndShadingCommand.prototype.getState = function () {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return ASPx.ApiUtils.createStateWithValue(this.coreState, null);
            var value = new TableBordersSettings();
            var command = this.coreCommand;
            var parameters = command.createParameters(new __aspxRichEdit.CommandSimpleOptions(this._core, true));
            value.backgroundColor = parameters.backgroundColor;
            value.bottom = createBorderSettings(parameters.bottom);
            value.insideHorizontal = createBorderSettings(parameters.insideHorizontal);
            value.insideVertical = createBorderSettings(parameters.insideVertical);
            value.left = createBorderSettings(parameters.left);
            value.right = createBorderSettings(parameters.right);
            value.top = createBorderSettings(parameters.top);
            return ASPx.ApiUtils.createStateWithValue(state, value);
        };
        return ChangeTableBordersAndShadingCommand;
    }(ASPx.CommandDialogBase));
    ASPx.ChangeTableBordersAndShadingCommand = ChangeTableBordersAndShadingCommand;
    var ToggleTableCellAlignTopLeftCommand = (function (_super) {
        __extends(ToggleTableCellAlignTopLeftCommand, _super);
        function ToggleTableCellAlignTopLeftCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.TableCellAlignTopLeft;
            return _this;
        }
        ToggleTableCellAlignTopLeftCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleTableCellAlignTopLeftCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleTableCellAlignTopLeftCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleTableCellAlignTopLeftCommand = ToggleTableCellAlignTopLeftCommand;
    var ToggleTableCellAlignTopCenterCommand = (function (_super) {
        __extends(ToggleTableCellAlignTopCenterCommand, _super);
        function ToggleTableCellAlignTopCenterCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.TableCellAlignTopCenter;
            return _this;
        }
        ToggleTableCellAlignTopCenterCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleTableCellAlignTopCenterCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleTableCellAlignTopCenterCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleTableCellAlignTopCenterCommand = ToggleTableCellAlignTopCenterCommand;
    var ToggleTableCellAlignTopRightCommand = (function (_super) {
        __extends(ToggleTableCellAlignTopRightCommand, _super);
        function ToggleTableCellAlignTopRightCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.TableCellAlignTopRight;
            return _this;
        }
        ToggleTableCellAlignTopRightCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleTableCellAlignTopRightCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleTableCellAlignTopRightCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleTableCellAlignTopRightCommand = ToggleTableCellAlignTopRightCommand;
    var ToggleTableCellAlignMiddleLeftCommand = (function (_super) {
        __extends(ToggleTableCellAlignMiddleLeftCommand, _super);
        function ToggleTableCellAlignMiddleLeftCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.TableCellAlignMiddleLeft;
            return _this;
        }
        ToggleTableCellAlignMiddleLeftCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleTableCellAlignMiddleLeftCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleTableCellAlignMiddleLeftCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleTableCellAlignMiddleLeftCommand = ToggleTableCellAlignMiddleLeftCommand;
    var ToggleTableCellAlignMiddleCenterCommand = (function (_super) {
        __extends(ToggleTableCellAlignMiddleCenterCommand, _super);
        function ToggleTableCellAlignMiddleCenterCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.TableCellAlignMiddleCenter;
            return _this;
        }
        ToggleTableCellAlignMiddleCenterCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleTableCellAlignMiddleCenterCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleTableCellAlignMiddleCenterCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleTableCellAlignMiddleCenterCommand = ToggleTableCellAlignMiddleCenterCommand;
    var ToggleTableCellAlignMiddleRightCommand = (function (_super) {
        __extends(ToggleTableCellAlignMiddleRightCommand, _super);
        function ToggleTableCellAlignMiddleRightCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.TableCellAlignMiddleRight;
            return _this;
        }
        ToggleTableCellAlignMiddleRightCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleTableCellAlignMiddleRightCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleTableCellAlignMiddleRightCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleTableCellAlignMiddleRightCommand = ToggleTableCellAlignMiddleRightCommand;
    var ToggleTableCellAlignBottomLeftCommand = (function (_super) {
        __extends(ToggleTableCellAlignBottomLeftCommand, _super);
        function ToggleTableCellAlignBottomLeftCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.TableCellAlignBottomLeft;
            return _this;
        }
        ToggleTableCellAlignBottomLeftCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleTableCellAlignBottomLeftCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleTableCellAlignBottomLeftCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleTableCellAlignBottomLeftCommand = ToggleTableCellAlignBottomLeftCommand;
    var ToggleTableCellAlignBottomCenterCommand = (function (_super) {
        __extends(ToggleTableCellAlignBottomCenterCommand, _super);
        function ToggleTableCellAlignBottomCenterCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.TableCellAlignBottomCenter;
            return _this;
        }
        ToggleTableCellAlignBottomCenterCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleTableCellAlignBottomCenterCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleTableCellAlignBottomCenterCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleTableCellAlignBottomCenterCommand = ToggleTableCellAlignBottomCenterCommand;
    var ToggleTableCellAlignBottomRightCommand = (function (_super) {
        __extends(ToggleTableCellAlignBottomRightCommand, _super);
        function ToggleTableCellAlignBottomRightCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.TableCellAlignBottomRight;
            return _this;
        }
        ToggleTableCellAlignBottomRightCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleTableCellAlignBottomRightCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleTableCellAlignBottomRightCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleTableCellAlignBottomRightCommand = ToggleTableCellAlignBottomRightCommand;
    var ChangeTableStyleCommand = (function (_super) {
        __extends(ChangeTableStyleCommand, _super);
        function ChangeTableStyleCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ApplyTableStyle;
            return _this;
        }
        ChangeTableStyleCommand.prototype.execute = function (style) {
            if (!style)
                throw new Error("Value is mandatory");
            if (style instanceof ASPx.TableStyle)
                return this.coreCommand.execute(true, style.name);
            ASPx.ApiUtils.assertString(style, true, "styleName");
            return this.coreCommand.execute(true, style);
        };
        ChangeTableStyleCommand.prototype.getState = function () {
            var state = this.coreState;
            var styleName = state.value;
            return new ASPx.CommandState(state.visible, state.enabled, styleName ? new ASPx.TableStyle(this._core.model.getTableStyleByName(styleName), []) : null);
        };
        return ChangeTableStyleCommand;
    }(ASPx.CommandBase));
    ASPx.ChangeTableStyleCommand = ChangeTableStyleCommand;
    var ToggleTableCellTopBorderCommand = (function (_super) {
        __extends(ToggleTableCellTopBorderCommand, _super);
        function ToggleTableCellTopBorderCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleTableCellsTopBorder;
            return _this;
        }
        ToggleTableCellTopBorderCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleTableCellTopBorderCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleTableCellTopBorderCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleTableCellTopBorderCommand = ToggleTableCellTopBorderCommand;
    var ToggleTableCellRightBorderCommand = (function (_super) {
        __extends(ToggleTableCellRightBorderCommand, _super);
        function ToggleTableCellRightBorderCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleTableCellsRightBorder;
            return _this;
        }
        ToggleTableCellRightBorderCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleTableCellRightBorderCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleTableCellRightBorderCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleTableCellRightBorderCommand = ToggleTableCellRightBorderCommand;
    var ToggleTableCellBottomBorderCommand = (function (_super) {
        __extends(ToggleTableCellBottomBorderCommand, _super);
        function ToggleTableCellBottomBorderCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleTableCellsBottomBorder;
            return _this;
        }
        ToggleTableCellBottomBorderCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleTableCellBottomBorderCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleTableCellBottomBorderCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleTableCellBottomBorderCommand = ToggleTableCellBottomBorderCommand;
    var ToggleTableCellLeftBorderCommand = (function (_super) {
        __extends(ToggleTableCellLeftBorderCommand, _super);
        function ToggleTableCellLeftBorderCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleTableCellsLeftBorder;
            return _this;
        }
        ToggleTableCellLeftBorderCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleTableCellLeftBorderCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleTableCellLeftBorderCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleTableCellLeftBorderCommand = ToggleTableCellLeftBorderCommand;
    var RemoveTableCellBordersCommand = (function (_super) {
        __extends(RemoveTableCellBordersCommand, _super);
        function RemoveTableCellBordersCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleTableCellNoBorder;
            return _this;
        }
        RemoveTableCellBordersCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        RemoveTableCellBordersCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return RemoveTableCellBordersCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.RemoveTableCellBordersCommand = RemoveTableCellBordersCommand;
    var ToggleTableCellAllBordersCommand = (function (_super) {
        __extends(ToggleTableCellAllBordersCommand, _super);
        function ToggleTableCellAllBordersCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleTableCellAllBorders;
            return _this;
        }
        ToggleTableCellAllBordersCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleTableCellAllBordersCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleTableCellAllBordersCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleTableCellAllBordersCommand = ToggleTableCellAllBordersCommand;
    var ToggleTableCellInsideBordersCommand = (function (_super) {
        __extends(ToggleTableCellInsideBordersCommand, _super);
        function ToggleTableCellInsideBordersCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleTableCellInsideBorders;
            return _this;
        }
        ToggleTableCellInsideBordersCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleTableCellInsideBordersCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleTableCellInsideBordersCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleTableCellInsideBordersCommand = ToggleTableCellInsideBordersCommand;
    var ToggleTableCellInsideHorizontalBordersCommand = (function (_super) {
        __extends(ToggleTableCellInsideHorizontalBordersCommand, _super);
        function ToggleTableCellInsideHorizontalBordersCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleTableCellInsideHorizontalBorders;
            return _this;
        }
        ToggleTableCellInsideHorizontalBordersCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleTableCellInsideHorizontalBordersCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleTableCellInsideHorizontalBordersCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleTableCellInsideHorizontalBordersCommand = ToggleTableCellInsideHorizontalBordersCommand;
    var ToggleTableCellInsideVerticalBordersCommand = (function (_super) {
        __extends(ToggleTableCellInsideVerticalBordersCommand, _super);
        function ToggleTableCellInsideVerticalBordersCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleTableCellInsideVerticalBorders;
            return _this;
        }
        ToggleTableCellInsideVerticalBordersCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleTableCellInsideVerticalBordersCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleTableCellInsideVerticalBordersCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleTableCellInsideVerticalBordersCommand = ToggleTableCellInsideVerticalBordersCommand;
    var ToggleTableCellOutsideBordersCommand = (function (_super) {
        __extends(ToggleTableCellOutsideBordersCommand, _super);
        function ToggleTableCellOutsideBordersCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleTableCellOutsideBorders;
            return _this;
        }
        ToggleTableCellOutsideBordersCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleTableCellOutsideBordersCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ToggleTableCellOutsideBordersCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ToggleTableCellOutsideBordersCommand = ToggleTableCellOutsideBordersCommand;
    var ChangeTableLookCommand = (function (_super) {
        __extends(ChangeTableLookCommand, _super);
        function ChangeTableLookCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ChangeTableLook;
            return _this;
        }
        ChangeTableLookCommand.prototype.execute = function (settings) {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return false;
            var value = state.value;
            if (!settings)
                throw new Error("settings is mandatory parameter");
            value = applyTableLook(settings.applyFirstColumn, value, "settings.applyFirstColumn", __aspxRichEdit.TableLookTypes.ApplyFirstColumn);
            value = applyTableLook(settings.applyFirstRow, value, "settings.applyFirstRow", __aspxRichEdit.TableLookTypes.ApplyFirstRow);
            value = applyTableLook(settings.applyLastColumn, value, "settings.applyLastColumn", __aspxRichEdit.TableLookTypes.ApplyLastColumn);
            value = applyTableLook(settings.applyLastRow, value, "settings.applyLastRow", __aspxRichEdit.TableLookTypes.ApplyLastRow);
            value = applyTableLook(settings.doNotApplyColumnBanding, value, "settings.doNotApplyColumnBanding", __aspxRichEdit.TableLookTypes.DoNotApplyColumnBanding);
            value = applyTableLook(settings.doNotApplyRowBanding, value, "settings.doNotApplyRowBanding", __aspxRichEdit.TableLookTypes.DoNotApplyRowBanding);
            return this.coreCommand.execute(true, value);
        };
        ChangeTableLookCommand.prototype.getState = function () {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return ASPx.ApiUtils.createStateWithValue(this.coreState, null);
            var value = new TableLookSettings();
            value.applyFirstColumn = !!(state.value & __aspxRichEdit.TableLookTypes.ApplyFirstColumn);
            value.applyFirstRow = !!(state.value & __aspxRichEdit.TableLookTypes.ApplyFirstRow);
            value.applyLastColumn = !!(state.value & __aspxRichEdit.TableLookTypes.ApplyLastColumn);
            value.applyLastRow = !!(state.value & __aspxRichEdit.TableLookTypes.ApplyLastRow);
            value.doNotApplyColumnBanding = !!(state.value & __aspxRichEdit.TableLookTypes.DoNotApplyColumnBanding);
            value.doNotApplyRowBanding = !!(state.value & __aspxRichEdit.TableLookTypes.DoNotApplyRowBanding);
            return ASPx.ApiUtils.createStateWithValue(this.coreState, value);
        };
        return ChangeTableLookCommand;
    }(ASPx.CommandBase));
    ASPx.ChangeTableLookCommand = ChangeTableLookCommand;
    var ChangeTableBorderRepositoryItemCommand = (function (_super) {
        __extends(ChangeTableBorderRepositoryItemCommand, _super);
        function ChangeTableBorderRepositoryItemCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ChangeTableBorderColorRepositoryItem;
            return _this;
        }
        ChangeTableBorderRepositoryItemCommand.prototype.execute = function (settings) {
            var changed = false;
            if (settings.color !== undefined) {
                var coreColor = ASPx.ApiUtils.assertAndConvertColor(settings.color, true, "settings.color");
                changed = this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeTableBorderColorRepositoryItem)
                    .execute(true, new __aspxRichEdit.CommandSimpleOptions(this._core, coreColor === null ? null : __aspxRichEdit.ColorHelper.colorToHash(coreColor)));
            }
            if (settings.style !== undefined) {
                ASPx.ApiUtils.assertEnum(settings.style, BorderLineStyle, "BorderLineStyle", "settings.style");
                changed = this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeTableBorderStyleRepositoryItem).execute(true, settings.style);
            }
            if (settings.width !== undefined) {
                ASPx.ApiUtils.assertNonNegativeNumber(settings.width, "settings.width");
                changed = this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeTableBorderWidthRepositoryItem).execute(true, settings.width);
            }
            return changed;
        };
        ChangeTableBorderRepositoryItemCommand.prototype.getState = function () {
            var coreBorder = this._core.model.repositoryBorderItem;
            var settings = new TableBorderSettings();
            settings.color = coreBorder.color ? __aspxRichEdit.ColorHelper.colorToHash(coreBorder.color.toRgb(this._core.model.colorProvider)) : undefined;
            settings.style = coreBorder.style;
            settings.width = coreBorder.width;
            return ASPx.ApiUtils.createStateWithValue(this.coreState, settings);
        };
        return ChangeTableBorderRepositoryItemCommand;
    }(ASPx.CommandBase));
    ASPx.ChangeTableBorderRepositoryItemCommand = ChangeTableBorderRepositoryItemCommand;
    var ChangeTableCellShadingCommand = (function (_super) {
        __extends(ChangeTableCellShadingCommand, _super);
        function ChangeTableCellShadingCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ChangeTableCellShading;
            return _this;
        }
        ChangeTableCellShadingCommand.prototype.execute = function (color) {
            return this.coreCommand.execute(true, color);
        };
        ChangeTableCellShadingCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ChangeTableCellShadingCommand;
    }(ASPx.CommandBase));
    ASPx.ChangeTableCellShadingCommand = ChangeTableCellShadingCommand;
    var ShowTableGridLinesCommand = (function (_super) {
        __extends(ShowTableGridLinesCommand, _super);
        function ShowTableGridLinesCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleShowTableGridLines;
            return _this;
        }
        ShowTableGridLinesCommand.prototype.execute = function (showTableGridLines) {
            return this.coreCommand.execute(true, showTableGridLines);
        };
        ShowTableGridLinesCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ShowTableGridLinesCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ShowTableGridLinesCommand = ShowTableGridLinesCommand;
    var ToggleTableAutoFitContentsCommand = (function (_super) {
        __extends(ToggleTableAutoFitContentsCommand, _super);
        function ToggleTableAutoFitContentsCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.SetAutoFitContents;
            return _this;
        }
        ToggleTableAutoFitContentsCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleTableAutoFitContentsCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return ToggleTableAutoFitContentsCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.ToggleTableAutoFitContentsCommand = ToggleTableAutoFitContentsCommand;
    var ToggleTableAutoFitWindowCommand = (function (_super) {
        __extends(ToggleTableAutoFitWindowCommand, _super);
        function ToggleTableAutoFitWindowCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.SetAutoFitWindow;
            return _this;
        }
        ToggleTableAutoFitWindowCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleTableAutoFitWindowCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return ToggleTableAutoFitWindowCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.ToggleTableAutoFitWindowCommand = ToggleTableAutoFitWindowCommand;
    var ToggleTableFixedColumnWidthCommand = (function (_super) {
        __extends(ToggleTableFixedColumnWidthCommand, _super);
        function ToggleTableFixedColumnWidthCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.SetFixedColumnWidth;
            return _this;
        }
        ToggleTableFixedColumnWidthCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleTableFixedColumnWidthCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return ToggleTableFixedColumnWidthCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.ToggleTableFixedColumnWidthCommand = ToggleTableFixedColumnWidthCommand;
    function applyTableLook(settingValue, currentValue, fieldName, option) {
        if (settingValue !== undefined) {
            ASPx.ApiUtils.assertBoolean(settingValue, "settings." + fieldName);
            if (settingValue)
                currentValue |= option;
            else
                currentValue &= ~option;
        }
        return currentValue;
    }
    var TableLookSettings = (function () {
        function TableLookSettings() {
        }
        return TableLookSettings;
    }());
    ASPx.TableLookSettings = TableLookSettings;
    function createBorderSettings(parameters) {
        if (parameters === null)
            return undefined;
        var settings = new TableBorderSettings();
        settings.color = parameters.color;
        settings.style = parameters.style;
        settings.width = parameters.width;
        return settings;
    }
    function applyBorderSettingsToDialogParameters(settings, parameters, fieldName) {
        if (settings !== undefined) {
            if (!settings) {
                parameters.color = "#000000";
                parameters.style = BorderLineStyle.None;
                parameters.width = 0;
            }
            else {
                var coreColor = ASPx.ApiUtils.assertAndConvertColor(settings.color, true, "settings." + fieldName + ".color");
                ASPx.ApiUtils.assertNonNegativeNumber(settings.width, "settings." + fieldName + ".width");
                ASPx.ApiUtils.assertEnum(settings.style, BorderLineStyle, "BorderLineStyle", "settings." + fieldName + ".style");
                parameters.color = coreColor === null ? null : __aspxRichEdit.ColorHelper.colorToHash(coreColor);
                parameters.style = settings.style;
                parameters.width = settings.width;
            }
            return true;
        }
        return false;
    }
    var TableBordersSettings = (function () {
        function TableBordersSettings() {
        }
        return TableBordersSettings;
    }());
    ASPx.TableBordersSettings = TableBordersSettings;
    var TableBorderSettings = (function () {
        function TableBorderSettings() {
        }
        return TableBorderSettings;
    }());
    ASPx.TableBorderSettings = TableBorderSettings;
    var BorderLineStyle;
    (function (BorderLineStyle) {
        BorderLineStyle[BorderLineStyle["Nil"] = -1] = "Nil";
        BorderLineStyle[BorderLineStyle["None"] = 0] = "None";
        BorderLineStyle[BorderLineStyle["Single"] = 1] = "Single";
        BorderLineStyle[BorderLineStyle["Thick"] = 2] = "Thick";
        BorderLineStyle[BorderLineStyle["Double"] = 3] = "Double";
        BorderLineStyle[BorderLineStyle["Dotted"] = 4] = "Dotted";
        BorderLineStyle[BorderLineStyle["Dashed"] = 5] = "Dashed";
        BorderLineStyle[BorderLineStyle["DotDash"] = 6] = "DotDash";
        BorderLineStyle[BorderLineStyle["DotDotDash"] = 7] = "DotDotDash";
        BorderLineStyle[BorderLineStyle["Triple"] = 8] = "Triple";
        BorderLineStyle[BorderLineStyle["ThinThickSmallGap"] = 9] = "ThinThickSmallGap";
        BorderLineStyle[BorderLineStyle["ThickThinSmallGap"] = 10] = "ThickThinSmallGap";
        BorderLineStyle[BorderLineStyle["ThinThickThinSmallGap"] = 11] = "ThinThickThinSmallGap";
        BorderLineStyle[BorderLineStyle["ThinThickMediumGap"] = 12] = "ThinThickMediumGap";
        BorderLineStyle[BorderLineStyle["ThickThinMediumGap"] = 13] = "ThickThinMediumGap";
        BorderLineStyle[BorderLineStyle["ThinThickThinMediumGap"] = 14] = "ThinThickThinMediumGap";
        BorderLineStyle[BorderLineStyle["ThinThickLargeGap"] = 15] = "ThinThickLargeGap";
        BorderLineStyle[BorderLineStyle["ThickThinLargeGap"] = 16] = "ThickThinLargeGap";
        BorderLineStyle[BorderLineStyle["ThinThickThinLargeGap"] = 17] = "ThinThickThinLargeGap";
        BorderLineStyle[BorderLineStyle["Wave"] = 18] = "Wave";
        BorderLineStyle[BorderLineStyle["DoubleWave"] = 19] = "DoubleWave";
        BorderLineStyle[BorderLineStyle["DashSmallGap"] = 20] = "DashSmallGap";
        BorderLineStyle[BorderLineStyle["DashDotStroked"] = 21] = "DashDotStroked";
        BorderLineStyle[BorderLineStyle["ThreeDEmboss"] = 22] = "ThreeDEmboss";
        BorderLineStyle[BorderLineStyle["ThreeDEngrave"] = 23] = "ThreeDEngrave";
        BorderLineStyle[BorderLineStyle["Outset"] = 24] = "Outset";
        BorderLineStyle[BorderLineStyle["Inset"] = 25] = "Inset";
        BorderLineStyle[BorderLineStyle["Apples"] = 26] = "Apples";
        BorderLineStyle[BorderLineStyle["ArchedScallops"] = 27] = "ArchedScallops";
        BorderLineStyle[BorderLineStyle["BabyPacifier"] = 28] = "BabyPacifier";
        BorderLineStyle[BorderLineStyle["BabyRattle"] = 29] = "BabyRattle";
        BorderLineStyle[BorderLineStyle["Balloons3Colors"] = 30] = "Balloons3Colors";
        BorderLineStyle[BorderLineStyle["BalloonsHotAir"] = 31] = "BalloonsHotAir";
        BorderLineStyle[BorderLineStyle["BasicBlackDashes"] = 32] = "BasicBlackDashes";
        BorderLineStyle[BorderLineStyle["BasicBlackDots"] = 33] = "BasicBlackDots";
        BorderLineStyle[BorderLineStyle["BasicBlackSquares"] = 34] = "BasicBlackSquares";
        BorderLineStyle[BorderLineStyle["BasicThinLines"] = 35] = "BasicThinLines";
        BorderLineStyle[BorderLineStyle["BasicWhiteDashes"] = 36] = "BasicWhiteDashes";
        BorderLineStyle[BorderLineStyle["BasicWhiteDots"] = 37] = "BasicWhiteDots";
        BorderLineStyle[BorderLineStyle["BasicWhiteSquares"] = 38] = "BasicWhiteSquares";
        BorderLineStyle[BorderLineStyle["BasicWideInline"] = 39] = "BasicWideInline";
        BorderLineStyle[BorderLineStyle["BasicWideMidline"] = 40] = "BasicWideMidline";
        BorderLineStyle[BorderLineStyle["BasicWideOutline"] = 41] = "BasicWideOutline";
        BorderLineStyle[BorderLineStyle["Bats"] = 42] = "Bats";
        BorderLineStyle[BorderLineStyle["Birds"] = 43] = "Birds";
        BorderLineStyle[BorderLineStyle["BirdsFlight"] = 44] = "BirdsFlight";
        BorderLineStyle[BorderLineStyle["Cabins"] = 45] = "Cabins";
        BorderLineStyle[BorderLineStyle["CakeSlice"] = 46] = "CakeSlice";
        BorderLineStyle[BorderLineStyle["CandyCorn"] = 47] = "CandyCorn";
        BorderLineStyle[BorderLineStyle["CelticKnotwork"] = 48] = "CelticKnotwork";
        BorderLineStyle[BorderLineStyle["CertificateBanner"] = 49] = "CertificateBanner";
        BorderLineStyle[BorderLineStyle["ChainLink"] = 50] = "ChainLink";
        BorderLineStyle[BorderLineStyle["ChampagneBottle"] = 51] = "ChampagneBottle";
        BorderLineStyle[BorderLineStyle["CheckedBarBlack"] = 52] = "CheckedBarBlack";
        BorderLineStyle[BorderLineStyle["CheckedBarColor"] = 53] = "CheckedBarColor";
        BorderLineStyle[BorderLineStyle["Checkered"] = 54] = "Checkered";
        BorderLineStyle[BorderLineStyle["ChristmasTree"] = 55] = "ChristmasTree";
        BorderLineStyle[BorderLineStyle["CirclesLines"] = 56] = "CirclesLines";
        BorderLineStyle[BorderLineStyle["CirclesRectangles"] = 57] = "CirclesRectangles";
        BorderLineStyle[BorderLineStyle["ClassicalWave"] = 58] = "ClassicalWave";
        BorderLineStyle[BorderLineStyle["Clocks"] = 59] = "Clocks";
        BorderLineStyle[BorderLineStyle["Compass"] = 60] = "Compass";
        BorderLineStyle[BorderLineStyle["Confetti"] = 61] = "Confetti";
        BorderLineStyle[BorderLineStyle["ConfettiGrays"] = 62] = "ConfettiGrays";
        BorderLineStyle[BorderLineStyle["ConfettiOutline"] = 63] = "ConfettiOutline";
        BorderLineStyle[BorderLineStyle["ConfettiStreamers"] = 64] = "ConfettiStreamers";
        BorderLineStyle[BorderLineStyle["ConfettiWhite"] = 65] = "ConfettiWhite";
        BorderLineStyle[BorderLineStyle["CornerTriangles"] = 66] = "CornerTriangles";
        BorderLineStyle[BorderLineStyle["CouponCutoutDashes"] = 67] = "CouponCutoutDashes";
        BorderLineStyle[BorderLineStyle["CouponCutoutDots"] = 68] = "CouponCutoutDots";
        BorderLineStyle[BorderLineStyle["CrazyMaze"] = 69] = "CrazyMaze";
        BorderLineStyle[BorderLineStyle["CreaturesButterfly"] = 70] = "CreaturesButterfly";
        BorderLineStyle[BorderLineStyle["CreaturesFish"] = 71] = "CreaturesFish";
        BorderLineStyle[BorderLineStyle["CreaturesInsects"] = 72] = "CreaturesInsects";
        BorderLineStyle[BorderLineStyle["CreaturesLadyBug"] = 73] = "CreaturesLadyBug";
        BorderLineStyle[BorderLineStyle["CrossStitch"] = 74] = "CrossStitch";
        BorderLineStyle[BorderLineStyle["Cup"] = 75] = "Cup";
        BorderLineStyle[BorderLineStyle["DecoArch"] = 76] = "DecoArch";
        BorderLineStyle[BorderLineStyle["DecoArchColor"] = 77] = "DecoArchColor";
        BorderLineStyle[BorderLineStyle["DecoBlocks"] = 78] = "DecoBlocks";
        BorderLineStyle[BorderLineStyle["DiamondsGray"] = 79] = "DiamondsGray";
        BorderLineStyle[BorderLineStyle["DoubleD"] = 80] = "DoubleD";
        BorderLineStyle[BorderLineStyle["DoubleDiamonds"] = 81] = "DoubleDiamonds";
        BorderLineStyle[BorderLineStyle["Earth1"] = 82] = "Earth1";
        BorderLineStyle[BorderLineStyle["Earth2"] = 83] = "Earth2";
        BorderLineStyle[BorderLineStyle["EclipsingSquares1"] = 84] = "EclipsingSquares1";
        BorderLineStyle[BorderLineStyle["EclipsingSquares2"] = 85] = "EclipsingSquares2";
        BorderLineStyle[BorderLineStyle["EggsBlack"] = 86] = "EggsBlack";
        BorderLineStyle[BorderLineStyle["Fans"] = 87] = "Fans";
        BorderLineStyle[BorderLineStyle["Film"] = 88] = "Film";
        BorderLineStyle[BorderLineStyle["Firecrackers"] = 89] = "Firecrackers";
        BorderLineStyle[BorderLineStyle["FlowersBlockPrint"] = 90] = "FlowersBlockPrint";
        BorderLineStyle[BorderLineStyle["FlowersDaisies"] = 91] = "FlowersDaisies";
        BorderLineStyle[BorderLineStyle["FlowersModern1"] = 92] = "FlowersModern1";
        BorderLineStyle[BorderLineStyle["FlowersModern2"] = 93] = "FlowersModern2";
        BorderLineStyle[BorderLineStyle["FlowersPansy"] = 94] = "FlowersPansy";
        BorderLineStyle[BorderLineStyle["FlowersRedRose"] = 95] = "FlowersRedRose";
        BorderLineStyle[BorderLineStyle["FlowersRoses"] = 96] = "FlowersRoses";
        BorderLineStyle[BorderLineStyle["FlowersTeacup"] = 97] = "FlowersTeacup";
        BorderLineStyle[BorderLineStyle["FlowersTiny"] = 98] = "FlowersTiny";
        BorderLineStyle[BorderLineStyle["Gems"] = 99] = "Gems";
        BorderLineStyle[BorderLineStyle["GingerbreadMan"] = 100] = "GingerbreadMan";
        BorderLineStyle[BorderLineStyle["Gradient"] = 101] = "Gradient";
        BorderLineStyle[BorderLineStyle["Handmade1"] = 102] = "Handmade1";
        BorderLineStyle[BorderLineStyle["Handmade2"] = 103] = "Handmade2";
        BorderLineStyle[BorderLineStyle["HeartBalloon"] = 104] = "HeartBalloon";
        BorderLineStyle[BorderLineStyle["HeartGray"] = 105] = "HeartGray";
        BorderLineStyle[BorderLineStyle["Hearts"] = 106] = "Hearts";
        BorderLineStyle[BorderLineStyle["HeebieJeebies"] = 107] = "HeebieJeebies";
        BorderLineStyle[BorderLineStyle["Holly"] = 108] = "Holly";
        BorderLineStyle[BorderLineStyle["HouseFunky"] = 109] = "HouseFunky";
        BorderLineStyle[BorderLineStyle["Hypnotic"] = 110] = "Hypnotic";
        BorderLineStyle[BorderLineStyle["IceCreamCones"] = 111] = "IceCreamCones";
        BorderLineStyle[BorderLineStyle["LightBulb"] = 112] = "LightBulb";
        BorderLineStyle[BorderLineStyle["Lightning1"] = 113] = "Lightning1";
        BorderLineStyle[BorderLineStyle["Lightning2"] = 114] = "Lightning2";
        BorderLineStyle[BorderLineStyle["MapleLeaf"] = 115] = "MapleLeaf";
        BorderLineStyle[BorderLineStyle["MapleMuffins"] = 116] = "MapleMuffins";
        BorderLineStyle[BorderLineStyle["MapPins"] = 117] = "MapPins";
        BorderLineStyle[BorderLineStyle["Marquee"] = 118] = "Marquee";
        BorderLineStyle[BorderLineStyle["MarqueeToothed"] = 119] = "MarqueeToothed";
        BorderLineStyle[BorderLineStyle["Moons"] = 120] = "Moons";
        BorderLineStyle[BorderLineStyle["Mosaic"] = 121] = "Mosaic";
        BorderLineStyle[BorderLineStyle["MusicNotes"] = 122] = "MusicNotes";
        BorderLineStyle[BorderLineStyle["Northwest"] = 123] = "Northwest";
        BorderLineStyle[BorderLineStyle["Ovals"] = 124] = "Ovals";
        BorderLineStyle[BorderLineStyle["Packages"] = 125] = "Packages";
        BorderLineStyle[BorderLineStyle["PalmsBlack"] = 126] = "PalmsBlack";
        BorderLineStyle[BorderLineStyle["PalmsColor"] = 127] = "PalmsColor";
        BorderLineStyle[BorderLineStyle["PaperClips"] = 128] = "PaperClips";
        BorderLineStyle[BorderLineStyle["Papyrus"] = 129] = "Papyrus";
        BorderLineStyle[BorderLineStyle["PartyFavor"] = 130] = "PartyFavor";
        BorderLineStyle[BorderLineStyle["PartyGlass"] = 131] = "PartyGlass";
        BorderLineStyle[BorderLineStyle["Pencils"] = 132] = "Pencils";
        BorderLineStyle[BorderLineStyle["People"] = 133] = "People";
        BorderLineStyle[BorderLineStyle["PeopleHats"] = 134] = "PeopleHats";
        BorderLineStyle[BorderLineStyle["PeopleWaving"] = 135] = "PeopleWaving";
        BorderLineStyle[BorderLineStyle["Poinsettias"] = 136] = "Poinsettias";
        BorderLineStyle[BorderLineStyle["PostageStamp"] = 137] = "PostageStamp";
        BorderLineStyle[BorderLineStyle["Pumpkin1"] = 138] = "Pumpkin1";
        BorderLineStyle[BorderLineStyle["PushPinNote1"] = 139] = "PushPinNote1";
        BorderLineStyle[BorderLineStyle["PushPinNote2"] = 140] = "PushPinNote2";
        BorderLineStyle[BorderLineStyle["Pyramids"] = 141] = "Pyramids";
        BorderLineStyle[BorderLineStyle["PyramidsAbove"] = 142] = "PyramidsAbove";
        BorderLineStyle[BorderLineStyle["Quadrants"] = 143] = "Quadrants";
        BorderLineStyle[BorderLineStyle["Rings"] = 144] = "Rings";
        BorderLineStyle[BorderLineStyle["Safari"] = 145] = "Safari";
        BorderLineStyle[BorderLineStyle["Sawtooth"] = 146] = "Sawtooth";
        BorderLineStyle[BorderLineStyle["SawtoothGray"] = 147] = "SawtoothGray";
        BorderLineStyle[BorderLineStyle["ScaredCat"] = 148] = "ScaredCat";
        BorderLineStyle[BorderLineStyle["Seattle"] = 149] = "Seattle";
        BorderLineStyle[BorderLineStyle["ShadowedSquares"] = 150] = "ShadowedSquares";
        BorderLineStyle[BorderLineStyle["SharksTeeth"] = 151] = "SharksTeeth";
        BorderLineStyle[BorderLineStyle["ShorebirdTracks"] = 152] = "ShorebirdTracks";
        BorderLineStyle[BorderLineStyle["Skyrocket"] = 153] = "Skyrocket";
        BorderLineStyle[BorderLineStyle["SnowflakeFancy"] = 154] = "SnowflakeFancy";
        BorderLineStyle[BorderLineStyle["Snowflakes"] = 155] = "Snowflakes";
        BorderLineStyle[BorderLineStyle["Sombrero"] = 156] = "Sombrero";
        BorderLineStyle[BorderLineStyle["Southwest"] = 157] = "Southwest";
        BorderLineStyle[BorderLineStyle["Stars"] = 158] = "Stars";
        BorderLineStyle[BorderLineStyle["Stars3d"] = 159] = "Stars3d";
        BorderLineStyle[BorderLineStyle["StarsBlack"] = 160] = "StarsBlack";
        BorderLineStyle[BorderLineStyle["StarsShadowed"] = 161] = "StarsShadowed";
        BorderLineStyle[BorderLineStyle["StarsTop"] = 162] = "StarsTop";
        BorderLineStyle[BorderLineStyle["Sun"] = 163] = "Sun";
        BorderLineStyle[BorderLineStyle["Swirligig"] = 164] = "Swirligig";
        BorderLineStyle[BorderLineStyle["TornPaper"] = 165] = "TornPaper";
        BorderLineStyle[BorderLineStyle["TornPaperBlack"] = 166] = "TornPaperBlack";
        BorderLineStyle[BorderLineStyle["Trees"] = 167] = "Trees";
        BorderLineStyle[BorderLineStyle["TriangleParty"] = 168] = "TriangleParty";
        BorderLineStyle[BorderLineStyle["Triangles"] = 169] = "Triangles";
        BorderLineStyle[BorderLineStyle["Tribal1"] = 170] = "Tribal1";
        BorderLineStyle[BorderLineStyle["Tribal2"] = 171] = "Tribal2";
        BorderLineStyle[BorderLineStyle["Tribal3"] = 172] = "Tribal3";
        BorderLineStyle[BorderLineStyle["Tribal4"] = 173] = "Tribal4";
        BorderLineStyle[BorderLineStyle["Tribal5"] = 174] = "Tribal5";
        BorderLineStyle[BorderLineStyle["Tribal6"] = 175] = "Tribal6";
        BorderLineStyle[BorderLineStyle["TwistedLines1"] = 176] = "TwistedLines1";
        BorderLineStyle[BorderLineStyle["TwistedLines2"] = 177] = "TwistedLines2";
        BorderLineStyle[BorderLineStyle["Vine"] = 178] = "Vine";
        BorderLineStyle[BorderLineStyle["Waveline"] = 179] = "Waveline";
        BorderLineStyle[BorderLineStyle["WeavingAngles"] = 180] = "WeavingAngles";
        BorderLineStyle[BorderLineStyle["WeavingBraid"] = 181] = "WeavingBraid";
        BorderLineStyle[BorderLineStyle["WeavingRibbon"] = 182] = "WeavingRibbon";
        BorderLineStyle[BorderLineStyle["WeavingStrips"] = 183] = "WeavingStrips";
        BorderLineStyle[BorderLineStyle["WhiteFlowers"] = 184] = "WhiteFlowers";
        BorderLineStyle[BorderLineStyle["Woodwork"] = 185] = "Woodwork";
        BorderLineStyle[BorderLineStyle["XIllusions"] = 186] = "XIllusions";
        BorderLineStyle[BorderLineStyle["ZanyTriangles"] = 187] = "ZanyTriangles";
        BorderLineStyle[BorderLineStyle["ZigZag"] = 188] = "ZigZag";
        BorderLineStyle[BorderLineStyle["ZigZagStitch"] = 189] = "ZigZagStitch";
    })(BorderLineStyle = ASPx.BorderLineStyle || (ASPx.BorderLineStyle = {}));
    var TableCellFormattingSettings = (function () {
        function TableCellFormattingSettings() {
        }
        return TableCellFormattingSettings;
    }());
    ASPx.TableCellFormattingSettings = TableCellFormattingSettings;
    var TableCellVerticalAlignment;
    (function (TableCellVerticalAlignment) {
        TableCellVerticalAlignment[TableCellVerticalAlignment["Top"] = 0] = "Top";
        TableCellVerticalAlignment[TableCellVerticalAlignment["Both"] = 1] = "Both";
        TableCellVerticalAlignment[TableCellVerticalAlignment["Center"] = 2] = "Center";
        TableCellVerticalAlignment[TableCellVerticalAlignment["Bottom"] = 3] = "Bottom";
    })(TableCellVerticalAlignment = ASPx.TableCellVerticalAlignment || (ASPx.TableCellVerticalAlignment = {}));
    var TableFormattingSettings = (function () {
        function TableFormattingSettings() {
        }
        return TableFormattingSettings;
    }());
    ASPx.TableFormattingSettings = TableFormattingSettings;
    var TableWidthUnit = (function () {
        function TableWidthUnit() {
        }
        return TableWidthUnit;
    }());
    ASPx.TableWidthUnit = TableWidthUnit;
    var TableHeightUnit = (function () {
        function TableHeightUnit() {
        }
        return TableHeightUnit;
    }());
    ASPx.TableHeightUnit = TableHeightUnit;
    var TableHeightUnitType;
    (function (TableHeightUnitType) {
        TableHeightUnitType[TableHeightUnitType["Minimum"] = 0] = "Minimum";
        TableHeightUnitType[TableHeightUnitType["Auto"] = 1] = "Auto";
        TableHeightUnitType[TableHeightUnitType["Exact"] = 2] = "Exact";
    })(TableHeightUnitType = ASPx.TableHeightUnitType || (ASPx.TableHeightUnitType = {}));
    var TableRowAlignment;
    (function (TableRowAlignment) {
        TableRowAlignment[TableRowAlignment["Both"] = 0] = "Both";
        TableRowAlignment[TableRowAlignment["Center"] = 1] = "Center";
        TableRowAlignment[TableRowAlignment["Distribute"] = 2] = "Distribute";
        TableRowAlignment[TableRowAlignment["Left"] = 3] = "Left";
        TableRowAlignment[TableRowAlignment["NumTab"] = 4] = "NumTab";
        TableRowAlignment[TableRowAlignment["Right"] = 5] = "Right";
    })(TableRowAlignment = ASPx.TableRowAlignment || (ASPx.TableRowAlignment = {}));
    var TableWidthUnitType;
    (function (TableWidthUnitType) {
        TableWidthUnitType[TableWidthUnitType["Nil"] = 0] = "Nil";
        TableWidthUnitType[TableWidthUnitType["Auto"] = 1] = "Auto";
        TableWidthUnitType[TableWidthUnitType["FiftiethsOfPercent"] = 2] = "FiftiethsOfPercent";
        TableWidthUnitType[TableWidthUnitType["ModelUnits"] = 3] = "ModelUnits";
    })(TableWidthUnitType = ASPx.TableWidthUnitType || (ASPx.TableWidthUnitType = {}));
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var ChangeFontNameCommand = (function (_super) {
        __extends(ChangeFontNameCommand, _super);
        function ChangeFontNameCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ChangeFontName;
            return _this;
        }
        ChangeFontNameCommand.prototype.execute = function (fontName) {
            return this.coreCommand.execute(true, fontName);
        };
        Object.defineProperty(ChangeFontNameCommand.prototype, "fontNames", {
            get: function () {
                return this._core.model.cache.fontInfoCache.getFontNames();
            },
            enumerable: true,
            configurable: true
        });
        ChangeFontNameCommand.prototype.getState = function () {
            var coreState = this.coreState;
            var coreStateValue = coreState.value ? coreState.value.name : undefined;
            return new ASPx.CommandState(coreState.visible, coreState.enabled, coreStateValue);
        };
        return ChangeFontNameCommand;
    }(ASPx.CommandBase));
    ASPx.ChangeFontNameCommand = ChangeFontNameCommand;
    var ChangeFontSizeCommand = (function (_super) {
        __extends(ChangeFontSizeCommand, _super);
        function ChangeFontSizeCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ChangeFontSize;
            return _this;
        }
        ChangeFontSizeCommand.prototype.execute = function (fontSize) {
            return this.coreCommand.execute(true, fontSize);
        };
        ChangeFontSizeCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ChangeFontSizeCommand;
    }(ASPx.CommandBase));
    ASPx.ChangeFontSizeCommand = ChangeFontSizeCommand;
    var IncreaseFontSizeCommand = (function (_super) {
        __extends(IncreaseFontSizeCommand, _super);
        function IncreaseFontSizeCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.IncreaseFontSize;
            return _this;
        }
        IncreaseFontSizeCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        IncreaseFontSizeCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return IncreaseFontSizeCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.IncreaseFontSizeCommand = IncreaseFontSizeCommand;
    var DecreaseFontSizeCommand = (function (_super) {
        __extends(DecreaseFontSizeCommand, _super);
        function DecreaseFontSizeCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.DecreaseFontSize;
            return _this;
        }
        DecreaseFontSizeCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        DecreaseFontSizeCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return DecreaseFontSizeCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.DecreaseFontSizeCommand = DecreaseFontSizeCommand;
    var MakeTextUpperCaseCommand = (function (_super) {
        __extends(MakeTextUpperCaseCommand, _super);
        function MakeTextUpperCaseCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.MakeTextUpperCase;
            return _this;
        }
        MakeTextUpperCaseCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        MakeTextUpperCaseCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return MakeTextUpperCaseCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.MakeTextUpperCaseCommand = MakeTextUpperCaseCommand;
    var MakeTextLowerCaseCommand = (function (_super) {
        __extends(MakeTextLowerCaseCommand, _super);
        function MakeTextLowerCaseCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.MakeTextLowerCase;
            return _this;
        }
        MakeTextLowerCaseCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        MakeTextLowerCaseCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return MakeTextLowerCaseCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.MakeTextLowerCaseCommand = MakeTextLowerCaseCommand;
    var CapitalizeEachWordTextCaseCommand = (function (_super) {
        __extends(CapitalizeEachWordTextCaseCommand, _super);
        function CapitalizeEachWordTextCaseCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.CapitalizeEachWordTextCase;
            return _this;
        }
        CapitalizeEachWordTextCaseCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        CapitalizeEachWordTextCaseCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return CapitalizeEachWordTextCaseCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.CapitalizeEachWordTextCaseCommand = CapitalizeEachWordTextCaseCommand;
    var ToggleTextCaseCommand = (function (_super) {
        __extends(ToggleTextCaseCommand, _super);
        function ToggleTextCaseCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleTextCase;
            return _this;
        }
        ToggleTextCaseCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ToggleTextCaseCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return ToggleTextCaseCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.ToggleTextCaseCommand = ToggleTextCaseCommand;
    var ChangeFontBoldCommand = (function (_super) {
        __extends(ChangeFontBoldCommand, _super);
        function ChangeFontBoldCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleFontBold;
            return _this;
        }
        ChangeFontBoldCommand.prototype.execute = function (fontBold) {
            if (fontBold !== undefined)
                ASPx.ApiUtils.assertBoolean(fontBold, "fontBold");
            return this.coreCommand.execute(true, fontBold);
        };
        ChangeFontBoldCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ChangeFontBoldCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ChangeFontBoldCommand = ChangeFontBoldCommand;
    var ChangeFontItalicCommand = (function (_super) {
        __extends(ChangeFontItalicCommand, _super);
        function ChangeFontItalicCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleFontItalic;
            return _this;
        }
        ChangeFontItalicCommand.prototype.execute = function (fontItalic) {
            if (fontItalic !== undefined)
                ASPx.ApiUtils.assertBoolean(fontItalic, "fontItalic");
            return this.coreCommand.execute(true, fontItalic);
        };
        ChangeFontItalicCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ChangeFontItalicCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ChangeFontItalicCommand = ChangeFontItalicCommand;
    var ChangeFontUnderlineCommand = (function (_super) {
        __extends(ChangeFontUnderlineCommand, _super);
        function ChangeFontUnderlineCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleFontUnderline;
            return _this;
        }
        ChangeFontUnderlineCommand.prototype.execute = function (fontUnderline) {
            if (fontUnderline !== undefined)
                ASPx.ApiUtils.assertBoolean(fontUnderline, "fontUnderline");
            return this.coreCommand.execute(true, fontUnderline);
        };
        ChangeFontUnderlineCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ChangeFontUnderlineCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ChangeFontUnderlineCommand = ChangeFontUnderlineCommand;
    var ChangeFontStrikeoutCommand = (function (_super) {
        __extends(ChangeFontStrikeoutCommand, _super);
        function ChangeFontStrikeoutCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleFontStrikeout;
            return _this;
        }
        ChangeFontStrikeoutCommand.prototype.execute = function (fontStrikeout) {
            if (fontStrikeout !== undefined)
                ASPx.ApiUtils.assertBoolean(fontStrikeout, "fontStrikeout");
            return this.coreCommand.execute(true, fontStrikeout);
        };
        ChangeFontStrikeoutCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ChangeFontStrikeoutCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ChangeFontStrikeoutCommand = ChangeFontStrikeoutCommand;
    var ChangeFontSuperscriptCommand = (function (_super) {
        __extends(ChangeFontSuperscriptCommand, _super);
        function ChangeFontSuperscriptCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleFontSuperscript;
            return _this;
        }
        ChangeFontSuperscriptCommand.prototype.execute = function (fontSuperscript) {
            if (fontSuperscript !== undefined)
                ASPx.ApiUtils.assertBoolean(fontSuperscript, "fontSuperscript");
            return this.coreCommand.execute(true, fontSuperscript);
        };
        ChangeFontSuperscriptCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ChangeFontSuperscriptCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ChangeFontSuperscriptCommand = ChangeFontSuperscriptCommand;
    var ChangeFontSubscriptCommand = (function (_super) {
        __extends(ChangeFontSubscriptCommand, _super);
        function ChangeFontSubscriptCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleFontSubscript;
            return _this;
        }
        ChangeFontSubscriptCommand.prototype.execute = function (fontSubscript) {
            if (fontSubscript !== undefined)
                ASPx.ApiUtils.assertBoolean(fontSubscript, "fontSubscript");
            return this.coreCommand.execute(true, fontSubscript);
        };
        ChangeFontSubscriptCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ChangeFontSubscriptCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ChangeFontSubscriptCommand = ChangeFontSubscriptCommand;
    var ChangeFontForeColorCommand = (function (_super) {
        __extends(ChangeFontForeColorCommand, _super);
        function ChangeFontForeColorCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ChangeFontForeColor;
            return _this;
        }
        ChangeFontForeColorCommand.prototype.execute = function (color) {
            var coreColor = ASPx.ApiParametersChecker.check(color, 1, false, ASPx.ApiParametersChecker.colorDescriptors("color"));
            return this.coreCommand.execute(true, coreColor);
        };
        ChangeFontForeColorCommand.prototype.getState = function () {
            var state = ASPx.ApiUtils.createState(this.coreState);
            state.value = ASPx.ApiUtils.internalColorToApiColor(this.coreState.value);
            return state;
        };
        return ChangeFontForeColorCommand;
    }(ASPx.CommandBase));
    ASPx.ChangeFontForeColorCommand = ChangeFontForeColorCommand;
    var ChangeFontBackColorCommand = (function (_super) {
        __extends(ChangeFontBackColorCommand, _super);
        function ChangeFontBackColorCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ChangeFontBackColor;
            return _this;
        }
        ChangeFontBackColorCommand.prototype.execute = function (color) {
            var coreColor = ASPx.ApiParametersChecker.check(color, 1, false, ASPx.ApiParametersChecker.colorDescriptors("color"));
            return this.coreCommand.execute(true, coreColor);
        };
        ChangeFontBackColorCommand.prototype.getState = function () {
            var state = ASPx.ApiUtils.createState(this.coreState);
            var characterProperties = this._core.inputPosition.getMergedCharacterPropertiesRaw();
            state.value = ASPx.ApiUtils.getBackApiColor(characterProperties, this._core.model.colorProvider);
            return state;
        };
        return ChangeFontBackColorCommand;
    }(ASPx.CommandBase));
    ASPx.ChangeFontBackColorCommand = ChangeFontBackColorCommand;
    var ClearFormattingCommand = (function (_super) {
        __extends(ClearFormattingCommand, _super);
        function ClearFormattingCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ClearFormatting;
            return _this;
        }
        ClearFormattingCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        ClearFormattingCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return ClearFormattingCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.ClearFormattingCommand = ClearFormattingCommand;
    var ChangeStyleCommand = (function (_super) {
        __extends(ChangeStyleCommand, _super);
        function ChangeStyleCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ChangeStyle;
            return _this;
        }
        ChangeStyleCommand.prototype.execute = function (style, isParagraphStyle) {
            if (!style)
                throw new Error("Value is mandatory");
            if (style instanceof ASPx.StyleBase) {
                if (style instanceof ASPx.CharacterStyle)
                    return this.coreCommand.execute(true, "CS-" + style.name);
                else if (style instanceof ASPx.ParagraphStyle)
                    return this.coreCommand.execute(true, "PS-" + style.name);
            }
            else if (typeof style === "string") {
                if (isParagraphStyle) {
                    if (!this._core.model.getParagraphStyleByName(style))
                        throw new Error("Unknown paragraph Style");
                    return this.coreCommand.execute(true, "PS-" + style);
                }
                if (!this._core.model.getCharacterStyleByName(style))
                    throw new Error("Unknown character style");
                return this.coreCommand.execute(true, "CS-" + style);
            }
            throw new Error("Value must be CharacterStyle or ParagraphStyle or string");
        };
        ChangeStyleCommand.prototype.getState = function () {
            var state = this.coreState;
            var stateValue = state.value;
            var style = null;
            if (stateValue && stateValue.length > 3) {
                var styleName = stateValue.substr(3);
                var prefix = stateValue.substr(0, 3);
                switch (prefix) {
                    case "PS-":
                        style = new ASPx.ParagraphStyle(this._core.model.getParagraphStyleByName(styleName), []);
                        break;
                    case "CS-":
                        style = new ASPx.CharacterStyle(this._core.model.getCharacterStyleByName(styleName), []);
                        break;
                }
            }
            return new ASPx.CommandState(state.visible, state.enabled, style);
        };
        return ChangeStyleCommand;
    }(ASPx.CommandBase));
    ASPx.ChangeStyleCommand = ChangeStyleCommand;
    var OpenFontFormattingDialogCommand = (function (_super) {
        __extends(OpenFontFormattingDialogCommand, _super);
        function OpenFontFormattingDialogCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowFontForm;
            return _this;
        }
        OpenFontFormattingDialogCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        OpenFontFormattingDialogCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return OpenFontFormattingDialogCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.OpenFontFormattingDialogCommand = OpenFontFormattingDialogCommand;
    var MakeTextSentenceCaseCommand = (function (_super) {
        __extends(MakeTextSentenceCaseCommand, _super);
        function MakeTextSentenceCaseCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.SentenceCase;
            return _this;
        }
        MakeTextSentenceCaseCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        MakeTextSentenceCaseCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return MakeTextSentenceCaseCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.MakeTextSentenceCaseCommand = MakeTextSentenceCaseCommand;
    var SwitchTextCaseCommand = (function (_super) {
        __extends(SwitchTextCaseCommand, _super);
        function SwitchTextCaseCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.SwitchTextCase;
            return _this;
        }
        SwitchTextCaseCommand.prototype.execute = function () {
            return this.coreCommand.execute(true);
        };
        SwitchTextCaseCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return SwitchTextCaseCommand;
    }(ASPx.CommandWithSimpleStateBase));
    ASPx.SwitchTextCaseCommand = SwitchTextCaseCommand;
    var ChangeFontFormattingCommand = (function (_super) {
        __extends(ChangeFontFormattingCommand, _super);
        function ChangeFontFormattingCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ShowFontForm;
            return _this;
        }
        ChangeFontFormattingCommand.prototype.execute = function (settings) {
            var _this = this;
            var state = this.coreState;
            if (!state.enabled || !state.visible || this._core.selection.isCollapsed())
                return false;
            settings = ASPx.ApiParametersChecker.check(settings, 1, false, [
                ASPx.ApiParametersChecker.objectDescriptor("settings", "FontFormattingSettings", function (val) { return val; })
            ]);
            var props = new __aspxRichEdit.CharacterProperties();
            props.allCaps = ASPx.ApiParametersChecker.check(settings.allCaps, 1, true, [
                ASPx.ApiParametersChecker.booleanDescriptor("settings.allCaps", function (val) { return val; })
            ]);
            props.fontBold = ASPx.ApiParametersChecker.check(settings.bold, 1, true, [
                ASPx.ApiParametersChecker.booleanDescriptor("settings.bold", function (val) { return val; })
            ]);
            var textColor = ASPx.ApiParametersChecker.check(settings.foreColor, 1, true, ASPx.ApiParametersChecker.colorDescriptors("settings.foreColor"));
            props.textColor = textColor === undefined ? undefined : __aspxRichEdit.ColorModelInfo.makeByColor(textColor);
            props.fontItalic = ASPx.ApiParametersChecker.check(settings.italic, 1, true, [
                ASPx.ApiParametersChecker.booleanDescriptor("settings.italic", function (val) { return val; })
            ]);
            props.fontInfo = ASPx.ApiParametersChecker.check(settings.fontName, 1, true, [
                ASPx.ApiParametersChecker.stringDescriptor("settings.fontName", function (val) {
                    var fontInfo = _this._core.model.cache.fontInfoCache.getItemByName(val);
                    if (!fontInfo)
                        throw Error("Inknown font name");
                    return fontInfo;
                }, false)
            ]);
            props.fontSize = ASPx.ApiParametersChecker.check(settings.size, 1, true, [
                ASPx.ApiParametersChecker.numberDescriptor("settings.size", function (val) { return val; }, 0, 601)
            ]);
            props.hidden = ASPx.ApiParametersChecker.check(settings.hidden, 1, true, [
                ASPx.ApiParametersChecker.booleanDescriptor("settings.hidden", function (val) { return val; })
            ]);
            var shadigInfoColor = ASPx.ApiParametersChecker.check(settings.backColor, 1, true, ASPx.ApiParametersChecker.colorDescriptors("settings.backColor"));
            props.shadingInfo = shadigInfoColor === undefined ? undefined :
                __aspxRichEdit.ShadingInfo.createByColor(__aspxRichEdit.ColorModelInfo.makeByColor(shadigInfoColor));
            props.script = ASPx.ApiParametersChecker.check(settings.script, 1, true, [
                ASPx.ApiParametersChecker.enumDescriptor("settings.script", function (val) { return val; }, CharacterFormattingScript, "ASPx.CharacterFormattingScript")
            ]);
            var underlineColor = ASPx.ApiParametersChecker.check(settings.underlineColor, 1, true, ASPx.ApiParametersChecker.colorDescriptors("settings.underlineColor"));
            props.underlineColor = underlineColor === undefined ? undefined : __aspxRichEdit.ColorModelInfo.makeByColor(underlineColor);
            props.underlineWordsOnly = ASPx.ApiParametersChecker.check(settings.underlineWordsOnly, 1, true, [
                ASPx.ApiParametersChecker.booleanDescriptor("settings.underlineWordsOnly", function (val) { return val; })
            ]);
            var strikeout = ASPx.ApiParametersChecker.check(settings.strikeout, 1, true, [
                ASPx.ApiParametersChecker.booleanDescriptor("settings.strikeout", function (val) { return val; })
            ]);
            props.fontStrikeoutType = strikeout === true ? __aspxRichEdit.StrikeoutType.Single : (strikeout === false ? __aspxRichEdit.StrikeoutType.None : undefined);
            var underline = ASPx.ApiParametersChecker.check(settings.underline, 1, true, [
                ASPx.ApiParametersChecker.booleanDescriptor("settings.underline", function (val) { return val; })
            ]);
            props.fontUnderlineType = underline === true ? __aspxRichEdit.UnderlineType.Single : (underline === false ? __aspxRichEdit.UnderlineType.None : undefined);
            props.langInfo = undefined;
            props.strikeoutColor = undefined;
            props.noProof = undefined;
            props.compositeFontInfo = undefined;
            return new __aspxRichEdit.CharacterPropertiesApplier(this._core, props).apply();
        };
        ChangeFontFormattingCommand.prototype.getState = function () {
            var state = this.coreState;
            if (!state.enabled || !state.visible)
                return ASPx.ApiUtils.createStateWithValue(state, null);
            var rawCharProps = this._core.inputPosition.getMergedCharacterPropertiesRaw();
            var value = new FontFormattingSettings();
            value.allCaps = rawCharProps.allCaps;
            value.foreColor = rawCharProps.textColor ? ASPx.ApiUtils.internalColorToApiColor(rawCharProps.textColor.toRgb(this._core.model.colorProvider)) : undefined;
            value.fontName = rawCharProps.fontInfo ? rawCharProps.fontInfo.name : undefined;
            value.size = rawCharProps.fontSize;
            value.strikeout = rawCharProps.fontStrikeoutType === undefined ?
                undefined :
                rawCharProps.fontStrikeoutType !== __aspxRichEdit.StrikeoutType.None;
            value.bold = rawCharProps.fontBold;
            value.italic = rawCharProps.fontItalic;
            value.underline = rawCharProps.fontUnderlineType === undefined ?
                undefined :
                rawCharProps.fontUnderlineType !== __aspxRichEdit.UnderlineType.None;
            value.underlineColor = rawCharProps.underlineColor ? ASPx.ApiUtils.internalColorToApiColor(rawCharProps.underlineColor.toRgb(this._core.model.colorProvider)) : undefined;
            value.hidden = rawCharProps.hidden;
            value.script = rawCharProps.script;
            value.underlineWordsOnly = rawCharProps.underlineWordsOnly;
            value.backColor = ASPx.ApiUtils.getBackApiColor(rawCharProps, this._core.model.colorProvider);
            return new ASPx.CommandState(state.visible, state.enabled, value);
        };
        return ChangeFontFormattingCommand;
    }(ASPx.CommandBase));
    ASPx.ChangeFontFormattingCommand = ChangeFontFormattingCommand;
    var FontFormattingSettings = (function () {
        function FontFormattingSettings() {
        }
        return FontFormattingSettings;
    }());
    ASPx.FontFormattingSettings = FontFormattingSettings;
    var CharacterFormattingScript;
    (function (CharacterFormattingScript) {
        CharacterFormattingScript[CharacterFormattingScript["Normal"] = 0] = "Normal";
        CharacterFormattingScript[CharacterFormattingScript["Subscript"] = 1] = "Subscript";
        CharacterFormattingScript[CharacterFormattingScript["Superscript"] = 2] = "Superscript";
    })(CharacterFormattingScript = ASPx.CharacterFormattingScript || (ASPx.CharacterFormattingScript = {}));
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var ShowHorizontalRulerCommand = (function (_super) {
        __extends(ShowHorizontalRulerCommand, _super);
        function ShowHorizontalRulerCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ToggleShowHorizontalRuler;
            return _this;
        }
        ShowHorizontalRulerCommand.prototype.execute = function () {
            if (arguments.length === 1) {
                ASPx.ApiUtils.assertBoolean(arguments[0], "show");
                return this.coreCommand.execute(true, arguments[0]);
            }
            return this.coreCommand.execute(true, !this.coreState.value);
        };
        ShowHorizontalRulerCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ShowHorizontalRulerCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ShowHorizontalRulerCommand = ShowHorizontalRulerCommand;
    var SetFullscreenCommand = (function (_super) {
        __extends(SetFullscreenCommand, _super);
        function SetFullscreenCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.FullScreen;
            return _this;
        }
        SetFullscreenCommand.prototype.execute = function () {
            if (arguments.length === 1) {
                ASPx.ApiUtils.assertBoolean(arguments[0], "show");
                return this.coreCommand.execute(true, arguments[0]);
            }
            return this.coreCommand.execute(true, !this._core.owner.isInFullScreenMode);
        };
        SetFullscreenCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return SetFullscreenCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.SetFullscreenCommand = SetFullscreenCommand;
    var ChangeViewTypeCommand = (function (_super) {
        __extends(ChangeViewTypeCommand, _super);
        function ChangeViewTypeCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ChangeViewType;
            return _this;
        }
        ChangeViewTypeCommand.prototype.execute = function (viewType) {
            var coreViewType = ASPx.ApiParametersChecker.check(viewType, 1, false, [
                ASPx.ApiParametersChecker.enumDescriptor("viewType", function (val) { return val; }, ViewType, "ViewType"),
                ASPx.ApiParametersChecker.stringDescriptorPredefined("viewType", new __aspxRichEdit.MapCreatorStringAsKey()
                    .add("simple", __aspxRichEdit.ViewType.Simple)
                    .add("printlayout", __aspxRichEdit.ViewType.PrintLayout)
                    .get(), false)
            ]);
            return this.coreCommand.execute(true, new __aspxRichEdit.CommandSimpleOptions(this._core, coreViewType));
        };
        ChangeViewTypeCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createState(this.coreState);
        };
        return ChangeViewTypeCommand;
    }(ASPx.CommandWithBooleanStateBase));
    ASPx.ChangeViewTypeCommand = ChangeViewTypeCommand;
    var ForceSyncWithServerCommand = (function (_super) {
        __extends(ForceSyncWithServerCommand, _super);
        function ForceSyncWithServerCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.ForceSyncWithServer;
            return _this;
        }
        ForceSyncWithServerCommand.prototype.execute = function (callback) {
            callback = ASPx.ApiParametersChecker.check(callback, 1, true, [
                ASPx.ApiParametersChecker.functionDescriptor("callback", function (val) { return val; })
            ]);
            if (!callback)
                callback = function () { };
            return this.coreCommand.execute(true, callback);
        };
        ForceSyncWithServerCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return ForceSyncWithServerCommand;
    }(ASPx.CommandBase));
    ASPx.ForceSyncWithServerCommand = ForceSyncWithServerCommand;
    var ViewType;
    (function (ViewType) {
        ViewType[ViewType["Simple"] = 0] = "Simple";
        ViewType[ViewType["PrintLayout"] = 1] = "PrintLayout";
    })(ViewType = ASPx.ViewType || (ASPx.ViewType = {}));
    var InsertContentFromServerCommand = (function (_super) {
        __extends(InsertContentFromServerCommand, _super);
        function InsertContentFromServerCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this._coreCommandId = __aspxRichEdit.RichEditClientCommand.InsertContentFromServer;
            return _this;
        }
        InsertContentFromServerCommand.prototype.execute = function (requestId, position, subDocumentId) {
            var _this = this;
            requestId = ASPx.ApiParametersChecker.check(requestId, 1, false, [
                ASPx.ApiParametersChecker.stringDescriptor("requestId", function (val) { return val; }, false)
            ]);
            var subDocument = ASPx.ApiParametersChecker.subDocumentById(subDocumentId, 3, true, this._core, true);
            position = ASPx.ApiParametersChecker.check(position, 2, true, [
                ASPx.ApiParametersChecker.numberDescriptor("position", function (val) { return val; }, 0, subDocument.getDocumentEndPosition()),
                ASPx.ApiParametersChecker.defaultDescriptor(function () {
                    return __aspxRichEdit.Utils.restrictValue(_this._core.selection.collapsedPostion, 0, subDocument.getDocumentEndPosition() - 1);
                })
            ]);
            return this.coreCommand.execute(true, new __aspxRichEdit.CommandSimpleOptions(this._core, requestId)
                .setSubDocument(subDocument)
                .setIntervals([new __aspxRichEdit.BoundaryInterval(position, 0)]));
        };
        InsertContentFromServerCommand.prototype.getState = function () {
            return ASPx.ApiUtils.createSimpleState(this.coreState);
        };
        return InsertContentFromServerCommand;
    }(ASPx.CommandBase));
    ASPx.InsertContentFromServerCommand = InsertContentFromServerCommand;
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var RichEditDocument = (function () {
        function RichEditDocument(native) {
            this._native = native;
        }
        Object.defineProperty(RichEditDocument.prototype, "activeSubDocument", {
            get: function () {
                return new ASPx.SubDocument(this._native.model.activeSubDocument);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditDocument.prototype, "mainSubDocument", {
            get: function () {
                return new ASPx.SubDocument(this._native.model.mainSubDocument);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditDocument.prototype, "subDocuments", {
            get: function () {
                return __aspxRichEdit.MapUtilsKeyAsNumber.toListBy(this._native.model.subDocuments, function (sd) { return new ASPx.SubDocument(sd); });
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditDocument.prototype, "sectionsInfo", {
            get: function () {
                var results = [];
                for (var i = 0, section = void 0; section = this._native.model.sections[i]; i++)
                    results.push(new Section(section));
                return results;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditDocument.prototype, "paragraphStylesInfo", {
            get: function () {
                var results = [];
                var existedStyles = [];
                for (var i = 0, style = void 0; style = this._native.model.paragraphStyles[i]; i++)
                    results.push(new ASPx.ParagraphStyle(style, existedStyles));
                return results;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditDocument.prototype, "characterStylesInfo", {
            get: function () {
                var results = [];
                var existedStyles = [];
                for (var i = 0, style = void 0; style = this._native.model.characterStyles[i]; i++)
                    results.push(new ASPx.CharacterStyle(style, existedStyles));
                return results;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditDocument.prototype, "abstractNumberingListsInfo", {
            get: function () {
                var results = [];
                for (var i = 0, list = void 0; list = this._native.model.abstractNumberingLists[i]; i++)
                    results.push(new AbstractNumberingList(list));
                return results;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditDocument.prototype, "tableStylesInfo", {
            get: function () {
                var results = [];
                var existedStyles = [];
                for (var i = 0, style = void 0; style = this._native.model.tableStyles[i]; i++)
                    results.push(new ASPx.TableStyle(style, existedStyles));
                return results;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditDocument.prototype, "spellingInfo", {
            get: function () {
                return new ASPx.SpellingInfo(this._native.spellChecker);
            },
            enumerable: true,
            configurable: true
        });
        RichEditDocument.prototype.getSubDocumentById = function (subDocumentId) {
            subDocumentId = ASPx.ApiParametersChecker.check(subDocumentId, 1, false, [
                ASPx.ApiParametersChecker.numberDescriptor("subDocumentId", function (val) { return val; }, 0, __aspxRichEdit.Constants.MAX_SAFE_INTEGER)
            ]);
            var sd = this._native.model.subDocuments[subDocumentId];
            return sd ? new ASPx.SubDocument(sd) : null;
        };
        return RichEditDocument;
    }());
    ASPx.RichEditDocument = RichEditDocument;
    var AbstractNumberingList = (function () {
        function AbstractNumberingList(list) {
            this.deleted = list.deleted;
        }
        return AbstractNumberingList;
    }());
    ASPx.AbstractNumberingList = AbstractNumberingList;
    var Paragraph = (function () {
        function Paragraph(paragraph, index) {
            this._length = paragraph.length;
            this._start = paragraph.startLogPosition.value;
            this._styleName = paragraph.paragraphStyle ? paragraph.paragraphStyle.styleName : null;
            this._listIndex = paragraph.numberingListIndex;
            this._listLevelIndex = paragraph.listLevelIndex;
            this._index = index;
        }
        Object.defineProperty(Paragraph.prototype, "index", {
            get: function () {
                return this._index;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Paragraph.prototype, "length", {
            get: function () {
                return this._length;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Paragraph.prototype, "start", {
            get: function () {
                return this._start;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Paragraph.prototype, "interval", {
            get: function () {
                return new ASPx.Interval(this._start, this._length);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Paragraph.prototype, "styleName", {
            get: function () {
                return this._styleName;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Paragraph.prototype, "listIndex", {
            get: function () {
                return this._listIndex;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Paragraph.prototype, "listLevelIndex", {
            get: function () {
                return this._listLevelIndex;
            },
            enumerable: true,
            configurable: true
        });
        return Paragraph;
    }());
    ASPx.Paragraph = Paragraph;
    var Field = (function () {
        function Field(field) {
            var start = field.getFieldStartPosition();
            this._interval = new ASPx.Interval(start, field.getFieldEndPosition() - start);
            var codeInterval = field.getCodeInterval();
            this._codeInterval = new ASPx.Interval(codeInterval.start, codeInterval.length);
            var resultInterval = field.getResultInterval();
            this._resultInterval = new ASPx.Interval(resultInterval.start, resultInterval.length);
            this._showCode = field.showCode;
            this._index = field.index;
            var hyperlinkInfo = field.getHyperlinkInfo();
            this._isHyperlink = !!hyperlinkInfo;
            if (hyperlinkInfo) {
                this._hyperlinkUri = hyperlinkInfo.uri;
                this._hyperlinkTip = hyperlinkInfo.tip;
                this._hyperlinkAnchor = hyperlinkInfo.anchor;
            }
        }
        Object.defineProperty(Field.prototype, "start", {
            get: function () {
                return this._interval.start;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Field.prototype, "length", {
            get: function () {
                return this._interval.length;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Field.prototype, "codeInterval", {
            get: function () {
                return new ASPx.Interval(this._codeInterval.start, this._codeInterval.length);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Field.prototype, "resultInterval", {
            get: function () {
                return new ASPx.Interval(this._resultInterval.start, this._resultInterval.length);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Field.prototype, "interval", {
            get: function () {
                return new ASPx.Interval(this._interval.start, this._interval.length);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Field.prototype, "hyperlinkUri", {
            get: function () {
                return this._hyperlinkUri;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Field.prototype, "isHyperlink", {
            get: function () {
                return this._isHyperlink;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Field.prototype, "hyperlinkTip", {
            get: function () {
                return this._hyperlinkTip;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Field.prototype, "hyperlinkAnchor", {
            get: function () {
                return this._hyperlinkAnchor;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Field.prototype, "showCode", {
            get: function () {
                return this._showCode;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Field.prototype, "index", {
            get: function () {
                return this._index;
            },
            enumerable: true,
            configurable: true
        });
        return Field;
    }());
    ASPx.Field = Field;
    var Bookmark = (function () {
        function Bookmark(bookmark) {
            this._bookmark = bookmark.constBookmark;
        }
        Object.defineProperty(Bookmark.prototype, "start", {
            get: function () {
                return this._bookmark.start;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Bookmark.prototype, "length", {
            get: function () {
                return this._bookmark.length;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Bookmark.prototype, "interval", {
            get: function () {
                return new ASPx.Interval(this._bookmark.start, this._bookmark.length);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Bookmark.prototype, "name", {
            get: function () {
                return this._bookmark.name;
            },
            enumerable: true,
            configurable: true
        });
        return Bookmark;
    }());
    ASPx.Bookmark = Bookmark;
    var Section = (function () {
        function Section(section) {
            this._headers = [];
            this._footers = [];
            this._start = section.startLogPosition.value;
            this._length = section.getLength();
            var types = [__aspxRichEdit.HeaderFooterType.Odd];
            if (section.sectionProperties.differentFirstPage)
                types.push(__aspxRichEdit.HeaderFooterType.First);
            if (section.documentModel.differentOddAndEvenPages)
                types.push(__aspxRichEdit.HeaderFooterType.Even);
            for (var i = 0; i <= types.length; i++) {
                var header = section.headers.getObject(types[i]);
                var footer = section.footers.getObject(types[i]);
                if (header)
                    this._headers.push(new HeaderFooter(section.documentModel, header));
                if (footer)
                    this._footers.push(new HeaderFooter(section.documentModel, footer));
            }
        }
        Object.defineProperty(Section.prototype, "start", {
            get: function () {
                return this._start;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Section.prototype, "length", {
            get: function () {
                return this._length;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Section.prototype, "interval", {
            get: function () {
                return new ASPx.Interval(this._start, this._length);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Section.prototype, "headers", {
            get: function () {
                return this._headers.slice(0);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Section.prototype, "footers", {
            get: function () {
                return this._footers.slice(0);
            },
            enumerable: true,
            configurable: true
        });
        return Section;
    }());
    ASPx.Section = Section;
    var HeaderFooter = (function () {
        function HeaderFooter(model, headerFooter) {
            this._type = headerFooter.headerFooterType;
            this._subDocument = new ASPx.SubDocument(headerFooter.getSubDocument(model));
        }
        Object.defineProperty(HeaderFooter.prototype, "type", {
            get: function () {
                return this._type;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(HeaderFooter.prototype, "subDocument", {
            get: function () {
                return this._subDocument;
            },
            enumerable: true,
            configurable: true
        });
        return HeaderFooter;
    }());
    ASPx.HeaderFooter = HeaderFooter;
    var InlinePictureInfo = (function () {
        function InlinePictureInfo(run, position) {
            this._id = run.publicAPIId;
            this._position = position;
            this._initialSize = run.size.originalSize.clone();
            this._scale = run.size.scale.clone();
        }
        InlinePictureInfo.collectPictures = function (subDocument) {
            var pics = [];
            for (var _i = 0, _a = subDocument.chunks; _i < _a.length; _i++) {
                var chunk = _a[_i];
                for (var _b = 0, _c = chunk.textRuns; _b < _c.length; _b++) {
                    var run = _c[_b];
                    if (run.getType() == __aspxRichEdit.RunType.InlinePictureRun)
                        pics.push(new InlinePictureInfo(run, chunk.startLogPosition.value + run.startOffset));
                }
            }
            return pics;
        };
        Object.defineProperty(InlinePictureInfo.prototype, "id", {
            get: function () {
                return this._id;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(InlinePictureInfo.prototype, "position", {
            get: function () {
                return this._position;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(InlinePictureInfo.prototype, "initialWidth", {
            get: function () {
                return this._initialSize.width;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(InlinePictureInfo.prototype, "initialHeight", {
            get: function () {
                return this._initialSize.height;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(InlinePictureInfo.prototype, "scaleX", {
            get: function () {
                return this._scale.width;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(InlinePictureInfo.prototype, "scaleY", {
            get: function () {
                return this._scale.height;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(InlinePictureInfo.prototype, "actualWidth", {
            get: function () {
                return Math.floor(this.initialWidth * this.scaleX / 100.0);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(InlinePictureInfo.prototype, "actualHeigth", {
            get: function () {
                return Math.floor(this.initialHeight * this.scaleY / 100.0);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(InlinePictureInfo.prototype, "actualHeight", {
            get: function () {
                return Math.floor(this.initialHeight * this.scaleY / 100.0);
            },
            enumerable: true,
            configurable: true
        });
        return InlinePictureInfo;
    }());
    ASPx.InlinePictureInfo = InlinePictureInfo;
    var HeaderFooterType;
    (function (HeaderFooterType) {
        HeaderFooterType[HeaderFooterType["First"] = 0] = "First";
        HeaderFooterType[HeaderFooterType["Odd"] = 1] = "Odd";
        HeaderFooterType[HeaderFooterType["Even"] = 2] = "Even";
        HeaderFooterType[HeaderFooterType["Primary"] = 1] = "Primary";
    })(HeaderFooterType = ASPx.HeaderFooterType || (ASPx.HeaderFooterType = {}));
    var RichEditFileInfo = (function () {
        function RichEditFileInfo(folderPath, fileName, documentFormat) {
            this.folderPath = folderPath;
            this.fileName = fileName;
            this.documentFormat = documentFormat;
        }
        return RichEditFileInfo;
    }());
    ASPx.RichEditFileInfo = RichEditFileInfo;
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var DocumentFormat;
    (function (DocumentFormat) {
        DocumentFormat[DocumentFormat["Undefined"] = 0] = "Undefined";
        DocumentFormat[DocumentFormat["PlainText"] = 1] = "PlainText";
        DocumentFormat[DocumentFormat["Rtf"] = 2] = "Rtf";
        DocumentFormat[DocumentFormat["Html"] = 3] = "Html";
        DocumentFormat[DocumentFormat["OpenXml"] = 4] = "OpenXml";
        DocumentFormat[DocumentFormat["Mht"] = 5] = "Mht";
        DocumentFormat[DocumentFormat["WordML"] = 6] = "WordML";
        DocumentFormat[DocumentFormat["OpenDocument"] = 7] = "OpenDocument";
        DocumentFormat[DocumentFormat["ePub"] = 9] = "ePub";
        DocumentFormat[DocumentFormat["Doc"] = 10] = "Doc";
    })(DocumentFormat = ASPx.DocumentFormat || (ASPx.DocumentFormat = {}));
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var FloatingObjectInfo = (function () {
        function FloatingObjectInfo(parentSubDocument, objectId) {
            this._parentSubDocument = parentSubDocument;
            this._objectId = objectId;
        }
        FloatingObjectInfo.prototype._getIteratorState = function () {
            var _this = this;
            return ASPx.ApiUtils.getAllRunsByFullSearch(this._parentSubDocument, function (it) {
                return __aspxRichEdit.EnumUtils.isAnyOf(it.run.getType(), __aspxRichEdit.RunType.AnchoredTextBoxRun, __aspxRichEdit.RunType.AnchoredPictureRun) &&
                    it.run.anchoredObjectID == _this._objectId;
            });
        };
        Object.defineProperty(FloatingObjectInfo.prototype, "position", {
            get: function () {
                var it = this._getIteratorState();
                return it ? it.getAbsolutePosition() : null;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(FloatingObjectInfo.prototype, "parentSubDocument", {
            get: function () {
                return new ASPx.SubDocument(this._parentSubDocument);
            },
            enumerable: true,
            configurable: true
        });
        return FloatingObjectInfo;
    }());
    ASPx.FloatingObjectInfo = FloatingObjectInfo;
    var FloatingTextBoxInfo = (function (_super) {
        __extends(FloatingTextBoxInfo, _super);
        function FloatingTextBoxInfo(parentSubDocument, objectId) {
            return _super.call(this, parentSubDocument, objectId) || this;
        }
        Object.defineProperty(FloatingTextBoxInfo.prototype, "contentSubDocument", {
            get: function () {
                var it = this._getIteratorState();
                if (!it || it.run.getType() != __aspxRichEdit.RunType.AnchoredTextBoxRun)
                    return null;
                var run = it.run;
                var sd = this._parentSubDocument.documentModel.subDocuments[run.subDocId];
                return sd ? new ASPx.SubDocument(sd) : null;
            },
            enumerable: true,
            configurable: true
        });
        return FloatingTextBoxInfo;
    }(FloatingObjectInfo));
    ASPx.FloatingTextBoxInfo = FloatingTextBoxInfo;
    var FloatingPictureInfo = (function (_super) {
        __extends(FloatingPictureInfo, _super);
        function FloatingPictureInfo(parentSubDocument, objectId) {
            return _super.call(this, parentSubDocument, objectId) || this;
        }
        return FloatingPictureInfo;
    }(FloatingObjectInfo));
    ASPx.FloatingPictureInfo = FloatingPictureInfo;
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var RichEditSelection = (function () {
        function RichEditSelection(native) {
            this._core = native;
        }
        Object.defineProperty(RichEditSelection.prototype, "intervals", {
            get: function () {
                var result = [];
                for (var i = 0, int = void 0; int = this._core.selection.intervals[i]; i++) {
                    var interval = new Interval();
                    interval.start = int.start;
                    interval.length = int.length;
                    result.push(interval);
                }
                return result;
            },
            set: function (value) {
                if (!value || !value.length)
                    throw new Error("intervals must be array of Interval objects");
                var intervalMaxPosition = this.getIntervalMaxPosition();
                for (var i = 0; i < value.length; i++) {
                    var int = value[i];
                    ASPx.ApiUtils.assertNonNegativeNumber(int.start, "intervals[" + i + "].start");
                    ASPx.ApiUtils.assertNonNegativeNumber(int.length, "intervals[" + i + "].length");
                    if (int.start + int.length > intervalMaxPosition)
                        throw new Error("intervals[" + i + "] must be inside of the document boundaries");
                }
                var isPublicApiCallPrevValue = this._core.commandManager.isPublicApiCall;
                this._core.commandManager.isPublicApiCall = true;
                for (var i = 0, int = void 0; int = value[i]; i++) {
                    if (i === 0)
                        this._core.selection.setSelection(new __aspxRichEdit.SetSelectionParams()
                            .setInterval(new __aspxRichEdit.FixedInterval(int.start, int.length))
                            .setEndOfLine(this._core.selection.endOfLine)
                            .setUseFieldUiChecks(false));
                    else
                        this._core.selection.addSelection(int.start, int.start + int.length, false, -1, true, __aspxRichEdit.ModelScrollManager.StandartScrollPosition, false);
                }
                this._core.commandManager.isPublicApiCall = isPublicApiCallPrevValue;
            },
            enumerable: true,
            configurable: true
        });
        RichEditSelection.prototype.setSelection = function (arg) {
            var sd = this._core.model.activeSubDocument;
            var subDocEndPos = sd.getDocumentEndPosition();
            var intervals = ASPx.ApiParametersChecker.check(arg, 1, false, [
                ASPx.ApiParametersChecker.numberDescriptor("position", function (n) { return [new Interval(n, 0)]; }, 0, subDocEndPos),
                ASPx.ApiParametersChecker.intervalDescriptor("interval", function (interval) { return [interval]; }, 0, subDocEndPos),
                ASPx.ApiParametersChecker.intervalsDescriptor("intervals", function (apiIntervals) {
                    return __aspxRichEdit.ListUtils.map(apiIntervals, function (interval) { return interval; });
                }, 0, subDocEndPos)
            ]);
            if (__aspxRichEdit.ListUtils.anyOf(intervals, function (curr) { return curr.start >= subDocEndPos; }))
                throw new Error("End of interval is incorrect");
            this.intervals = intervals;
        };
        Object.defineProperty(RichEditSelection.prototype, "isFloatingObjectSelected", {
            get: function () { return this._core.selection.specialRunInfo.isSelectedAnchorObject; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditSelection.prototype, "isTextBoxSelected", {
            get: function () { return this._core.selection.specialRunInfo.isTextBoxSelected(); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditSelection.prototype, "isPictureSelected", {
            get: function () { return this._core.selection.specialRunInfo.isPictureSelected(); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RichEditSelection.prototype, "collapsed", {
            get: function () {
                return this._core.selection.isCollapsed();
            },
            set: function (value) {
                ASPx.ApiUtils.assertBoolean(value, "collapsed");
                this._core.selection.setSelection(new __aspxRichEdit.SetSelectionParams()
                    .setPosition(this._core.selection.intervals[0].start)
                    .setEndOfLine(this._core.selection.endOfLine));
            },
            enumerable: true,
            configurable: true
        });
        RichEditSelection.prototype.getIntervalMaxPosition = function () {
            return this._core.model.activeSubDocument.getDocumentEndPosition();
        };
        RichEditSelection.prototype.goToNextLine = function (extendSelection) {
            if (extendSelection)
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ExtendLineDown).execute(true);
            else
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.LineDown).execute(true);
        };
        RichEditSelection.prototype.goToLineEnd = function (extendSelection) {
            if (extendSelection)
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ExtendLineEnd).execute(true);
            else
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.LineEnd).execute(true);
        };
        RichEditSelection.prototype.goToLineStart = function (extendSelection) {
            if (extendSelection)
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ExtendLineStart).execute(true);
            else
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.LineStart).execute(true);
        };
        RichEditSelection.prototype.goToPreviousLine = function (extendSelection) {
            if (extendSelection)
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ExtendLineUp).execute(true);
            else
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.LineUp).execute(true);
        };
        RichEditSelection.prototype.goToNextCharacter = function (extendSelection) {
            if (extendSelection)
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ExtendNextCharacter).execute(true);
            else
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.NextCharacter).execute(true);
        };
        RichEditSelection.prototype.goToPreviousCharacter = function (extendSelection) {
            if (extendSelection)
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ExtendPreviousCharacter).execute(true);
            else
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.PreviousCharacter).execute(true);
        };
        RichEditSelection.prototype.selectLine = function (extendSelection) {
            var linePosition = this._core.selection.getLastSelectedInterval().end;
            if (extendSelection)
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.AddSelectedLineCommandNoUpdateControlState).execute(true, linePosition);
            else
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.SelectLine).execute(true, linePosition);
        };
        RichEditSelection.prototype.goToNextPage = function (extendSelection) {
            if (extendSelection)
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ExtendNextPage).execute(true);
            else
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.NextPage).execute(true);
        };
        RichEditSelection.prototype.goToPreviousPage = function (extendSelection) {
            if (extendSelection)
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ExtendPreviousPage).execute(true);
            else
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.PreviousPage).execute(true);
        };
        RichEditSelection.prototype.goToDocumentStart = function (extendSelection) {
            if (extendSelection)
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ExtendDocumentStart).execute(true);
            else
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.DocumentStart).execute(true);
        };
        RichEditSelection.prototype.goToDocumentEnd = function (extendSelection) {
            if (extendSelection)
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ExtendDocumentEnd).execute(true);
            else
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.DocumentEnd).execute(true);
        };
        RichEditSelection.prototype.goToNextWord = function (extendSelection) {
            if (extendSelection)
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ExtendGoToNextWord).execute(true);
            else
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.GoToNextWord).execute(true);
        };
        RichEditSelection.prototype.goToPrevWord = function (extendSelection) {
            if (extendSelection)
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ExtendGoToPrevWord).execute(true);
            else
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.GoToPrevWord).execute(true);
        };
        RichEditSelection.prototype.goToParagraphStart = function (extendSelection) {
            if (extendSelection)
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ExtendGoToStartParagraph).execute(true);
            else
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.GoToStartParagraph).execute(true);
        };
        RichEditSelection.prototype.goToParagraphEnd = function (extendSelection) {
            if (extendSelection)
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ExtendGoToEndParagraph).execute(true);
            else
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.GoToEndParagraph).execute(true);
        };
        RichEditSelection.prototype.selectParagraph = function () {
            var linePosition = this._core.selection.getLastSelectedInterval().start;
            this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.SelectParagraph).execute(true, linePosition);
        };
        RichEditSelection.prototype.goToStartNextPageCommand = function (extendSelection) {
            if (extendSelection)
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ExtendGoToStartNextPage).execute(true);
            else
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.GoToStartNextPage).execute(true);
        };
        RichEditSelection.prototype.goToStartPrevPageCommand = function (extendSelection) {
            if (extendSelection)
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ExtendGoToStartPrevPage).execute(true);
            else
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.GoToStartPrevPage).execute(true);
        };
        RichEditSelection.prototype.selectTableCell = function (extendSelection) {
            if (extendSelection)
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ExtendSelectTableCell).execute(true);
            else
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.SelectTableCell).execute(true);
        };
        RichEditSelection.prototype.selectTableRow = function (extendSelection) {
            if (extendSelection)
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ExtendSelectTableRow).execute(true);
            else
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.SelectTableRow).execute(true);
        };
        RichEditSelection.prototype.selectTable = function (extendSelection) {
            if (extendSelection)
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ExtendSelectTable).execute(true);
            else
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.SelectTable).execute(true);
        };
        RichEditSelection.prototype.selectAll = function () {
            this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.SelectAll).execute(true);
        };
        RichEditSelection.prototype.setMainSubDocumentAsActive = function () {
            this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToMain).execute(true);
        };
        RichEditSelection.prototype.setFooterSubDocumentAsActiveByPageIndex = function (pageIndex) {
            ASPx.ApiUtils.assertNonNegativeNumber(pageIndex, "pageIndex");
            this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToHeaderFooterByPageIndex).execute(true, new __aspxRichEdit.ChangeActiveSubDocumentToHeaderFooterByPageIndexCommandParameters(this._core, pageIndex, false));
        };
        RichEditSelection.prototype.setHeaderSubDocumentAsActiveByPageIndex = function (pageIndex) {
            ASPx.ApiUtils.assertNonNegativeNumber(pageIndex, "pageIndex");
            this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToHeaderFooterByPageIndex).execute(true, new __aspxRichEdit.ChangeActiveSubDocumentToHeaderFooterByPageIndexCommandParameters(this._core, pageIndex, true));
        };
        RichEditSelection.prototype.setTextBoxSubDocumentAsActive = function (arg) {
            if (arg) {
                var textBoxes_1 = new ASPx.SubDocument(this._core.model.mainSubDocument).floatingTextBoxesInfo;
                var textBox = ASPx.ApiParametersChecker.check(arg, 1, false, [
                    ASPx.ApiParametersChecker.numberDescriptor("position", function (p) { return __aspxRichEdit.ListUtils.elementBy(textBoxes_1, function (textBox) { return textBox.position == p; }); }, 0, __aspxRichEdit.Constants.MAX_SAFE_INTEGER),
                    ASPx.ApiParametersChecker.objectDescriptor("textBoxInfo", "ASPx.FloatingTextBoxInfo", function (ti) { return __aspxRichEdit.ListUtils.elementBy(textBoxes_1, function (t) { return t._objectId == ti._objectId; }); })
                ]);
                if (textBox)
                    this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToHeaderFooterBySubDocument)
                        .execute(true, textBox.contentSubDocument._subDocument);
            }
            else
                this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToTextBox).execute(true);
        };
        RichEditSelection.prototype.setActiveSubDocumentById = function (id) {
            ASPx.ApiUtils.assertNonNegativeNumber(id, "id");
            var subDocument = this._core.model.subDocuments[id];
            return this._core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToHeaderFooterBySubDocument).execute(true, subDocument);
        };
        return RichEditSelection;
    }());
    ASPx.RichEditSelection = RichEditSelection;
    var Interval = (function () {
        function Interval(start, length) {
            if (start === void 0) { start = 0; }
            if (length === void 0) { length = 0; }
            this.start = start;
            this.length = length;
        }
        return Interval;
    }());
    ASPx.Interval = Interval;
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var SpellingInfo = (function () {
        function SpellingInfo(spellChecker) {
            this._spellChecker = spellChecker;
        }
        Object.defineProperty(SpellingInfo.prototype, "spellCheckerState", {
            get: function () {
                var result;
                if (!this._spellChecker.settings.isEnabled)
                    result = SpellCheckerState.Disabled;
                else if (this._spellChecker.isInProgress())
                    result = SpellCheckerState.InProgress;
                else
                    result = SpellCheckerState.Done;
                return result;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(SpellingInfo.prototype, "misspelledIntervals", {
            get: function () {
                var result = [];
                var misspelledIntervals = this._spellChecker.getMisspelledIntervals();
                for (var i = 0, misspelledInterval = void 0; misspelledInterval = misspelledIntervals[i]; i++)
                    result.push(new MisspelledInterval(misspelledInterval));
                return result;
            },
            enumerable: true,
            configurable: true
        });
        return SpellingInfo;
    }());
    ASPx.SpellingInfo = SpellingInfo;
    var SpellCheckerState;
    (function (SpellCheckerState) {
        SpellCheckerState[SpellCheckerState["Disabled"] = 0] = "Disabled";
        SpellCheckerState[SpellCheckerState["InProgress"] = 1] = "InProgress";
        SpellCheckerState[SpellCheckerState["Done"] = 2] = "Done";
    })(SpellCheckerState = ASPx.SpellCheckerState || (ASPx.SpellCheckerState = {}));
    var MisspelledInterval = (function () {
        function MisspelledInterval(misspelledInterval) {
            this._misspelledInterval = misspelledInterval;
        }
        Object.defineProperty(MisspelledInterval.prototype, "start", {
            get: function () {
                return this._misspelledInterval.start;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(MisspelledInterval.prototype, "length", {
            get: function () {
                return this._misspelledInterval.length;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(MisspelledInterval.prototype, "interval", {
            get: function () {
                return new ASPx.Interval(this.start, this.length);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(MisspelledInterval.prototype, "errorType", {
            get: function () {
                return this._misspelledInterval.errorInfo.errorType == __aspxRichEdit.SpellingErrorType.Repeating ? SpellingErrorType.Repeating : SpellingErrorType.Misspelling;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(MisspelledInterval.prototype, "word", {
            get: function () {
                return this._misspelledInterval.errorInfo.word;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(MisspelledInterval.prototype, "suggestions", {
            get: function () {
                return this._misspelledInterval.errorInfo.suggestions;
            },
            enumerable: true,
            configurable: true
        });
        return MisspelledInterval;
    }());
    ASPx.MisspelledInterval = MisspelledInterval;
    var SpellingErrorType;
    (function (SpellingErrorType) {
        SpellingErrorType[SpellingErrorType["Misspelling"] = 0] = "Misspelling";
        SpellingErrorType[SpellingErrorType["Repeating"] = 1] = "Repeating";
    })(SpellingErrorType = ASPx.SpellingErrorType || (ASPx.SpellingErrorType = {}));
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var StyleBase = (function () {
        function StyleBase(style) {
            this._name = style.styleName;
            this._isDeleted = style.deleted;
        }
        Object.defineProperty(StyleBase.prototype, "name", {
            get: function () {
                return this._name;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(StyleBase.prototype, "isDeleted", {
            get: function () {
                return this._isDeleted;
            },
            enumerable: true,
            configurable: true
        });
        return StyleBase;
    }());
    ASPx.StyleBase = StyleBase;
    var ParagraphStyle = (function (_super) {
        __extends(ParagraphStyle, _super);
        function ParagraphStyle(style, existedStyles) {
            var _this = _super.call(this, style) || this;
            existedStyles.push(_this);
            _this._linkedStyle = style.linkedStyle ? ASPx.ApiUtils.createCharacterStyle(style.linkedStyle, existedStyles) : null;
            _this._nextStyle = style.nextParagraphStyle ? ASPx.ApiUtils.createParagraphStyle(style, existedStyles) : null;
            _this._listIndex = style.numberingListIndex;
            _this._listLevelIndex = style.listLevelIndex;
            _this._parent = style.parent ? ASPx.ApiUtils.createParagraphStyle(style.parent, existedStyles) : null;
            return _this;
        }
        Object.defineProperty(ParagraphStyle.prototype, "linkedStyle", {
            get: function () {
                return this._linkedStyle;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ParagraphStyle.prototype, "nextStyle", {
            get: function () {
                return this._nextStyle;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ParagraphStyle.prototype, "listIndex", {
            get: function () {
                return this._listIndex;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ParagraphStyle.prototype, "listLevelIndex", {
            get: function () {
                return this._listLevelIndex;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ParagraphStyle.prototype, "parent", {
            get: function () {
                return this._parent;
            },
            enumerable: true,
            configurable: true
        });
        return ParagraphStyle;
    }(StyleBase));
    ASPx.ParagraphStyle = ParagraphStyle;
    var CharacterStyle = (function (_super) {
        __extends(CharacterStyle, _super);
        function CharacterStyle(style, existedStyles) {
            var _this = _super.call(this, style) || this;
            _this._linkedStyle = style.linkedStyle ? ASPx.ApiUtils.createParagraphStyle(style.linkedStyle, existedStyles) : null;
            _this._parent = style.parent ? ASPx.ApiUtils.createCharacterStyle(style.parent, existedStyles) : null;
            return _this;
        }
        Object.defineProperty(CharacterStyle.prototype, "linkedStyle", {
            get: function () {
                return this._linkedStyle;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(CharacterStyle.prototype, "parent", {
            get: function () {
                return this._parent;
            },
            enumerable: true,
            configurable: true
        });
        return CharacterStyle;
    }(StyleBase));
    ASPx.CharacterStyle = CharacterStyle;
    var TableStyle = (function (_super) {
        __extends(TableStyle, _super);
        function TableStyle(style, existedStyles) {
            var _this = _super.call(this, style) || this;
            _this._parent = style.parent ? ASPx.ApiUtils.createTableStyle(style.parent, existedStyles) : null;
            return _this;
        }
        Object.defineProperty(TableStyle.prototype, "parent", {
            get: function () {
                return this._parent;
            },
            enumerable: true,
            configurable: true
        });
        return TableStyle;
    }(StyleBase));
    ASPx.TableStyle = TableStyle;
})(ASPx || (ASPx = {}));
var CoreField = __aspxRichEdit.Field;
var CoreTable = __aspxRichEdit.Table;
var CoreFixedInterval = __aspxRichEdit.FixedInterval;
var ASPx;
(function (ASPx) {
    var SubDocument = (function () {
        function SubDocument(subDocument) {
            this._subDocument = subDocument;
        }
        Object.defineProperty(SubDocument.prototype, "id", {
            get: function () {
                return this._subDocument.id;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(SubDocument.prototype, "type", {
            get: function () {
                return this._subDocument.info.getType();
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(SubDocument.prototype, "paragraphsInfo", {
            get: function () {
                var result = [];
                for (var i = 0, paragraph = void 0; paragraph = this._subDocument.paragraphs[i]; i++)
                    result.push(new ASPx.Paragraph(paragraph, i));
                return result;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(SubDocument.prototype, "fieldsInfo", {
            get: function () {
                return __aspxRichEdit.ListUtils.map(this._subDocument.fields, function (field) { return new ASPx.Field(field); });
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(SubDocument.prototype, "tablesInfo", {
            get: function () {
                var result = [];
                for (var i = 0, table = void 0; table = this._subDocument.tables[i]; i++)
                    result.push(new ASPx.Table(table));
                return result;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(SubDocument.prototype, "bookmarksInfo", {
            get: function () {
                var result = [];
                for (var i = 0, bookmark = void 0; bookmark = this._subDocument.bookmarks[i]; i++)
                    result.push(new ASPx.Bookmark(bookmark));
                return result;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(SubDocument.prototype, "inlinePicturesInfo", {
            get: function () {
                return ASPx.InlinePictureInfo.collectPictures(this._subDocument);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(SubDocument.prototype, "text", {
            get: function () {
                return this._subDocument.getText(new __aspxRichEdit.FixedInterval(0, this.length));
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(SubDocument.prototype, "length", {
            get: function () {
                return this._subDocument.getLastChunk().getEndPosition();
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(SubDocument.prototype, "floatingTextBoxesInfo", {
            get: function () {
                var _this = this;
                var textBoxes = [];
                ASPx.ApiUtils.getAllRunsByFullSearch(this._subDocument, function (it) {
                    if (it.run.getType() == __aspxRichEdit.RunType.AnchoredTextBoxRun)
                        textBoxes.push(new ASPx.FloatingTextBoxInfo(_this._subDocument, it.run.anchoredObjectID));
                    return false;
                });
                return textBoxes;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(SubDocument.prototype, "floatingPicturesInfo", {
            get: function () {
                var _this = this;
                var pictures = [];
                ASPx.ApiUtils.getAllRunsByFullSearch(this._subDocument, function (it) {
                    if (it.run.getType() == __aspxRichEdit.RunType.AnchoredPictureRun)
                        pictures.push(new ASPx.FloatingPictureInfo(_this._subDocument, it.run.anchoredObjectID));
                    return false;
                });
                return pictures;
            },
            enumerable: true,
            configurable: true
        });
        SubDocument.prototype.getTextByInterval = function (interval) {
            var coreInterval = ASPx.ApiParametersChecker.check(interval, 1, false, [
                ASPx.ApiParametersChecker.intervalDescriptor("interval", function (interval) { return new CoreFixedInterval(interval.start, interval.length); }, 0, this._subDocument.getDocumentEndPosition())
            ]);
            return this._subDocument.getText(coreInterval);
        };
        SubDocument.prototype.getFloatingTextBoxInfo = function () {
            var _this = this;
            if (!this._subDocument.isTextBox())
                return null;
            var sdInfo = this._subDocument.info;
            var parentSubDoc = this._subDocument.documentModel.subDocuments[sdInfo.parentSubDocumentId];
            var it = ASPx.ApiUtils.getAllRunsByFullSearch(parentSubDoc, function (it) {
                return it.run.getType() == __aspxRichEdit.RunType.AnchoredTextBoxRun &&
                    it.run.subDocId == _this._subDocument.id;
            });
            return new ASPx.FloatingTextBoxInfo(parentSubDoc, it.run.anchoredObjectID);
        };
        SubDocument.prototype.findFields = function (arg) {
            var interval = ASPx.ApiParametersChecker.check(arg, 1, false, [
                ASPx.ApiParametersChecker.numberDescriptor("position", function (n) { return new CoreFixedInterval(n, 0); }),
                ASPx.ApiParametersChecker.intervalDescriptor("interval", function (interval) { return new CoreFixedInterval(interval.start, interval.length); })
            ]);
            var fields = this._subDocument.fields;
            if (fields.length == 0)
                return [];
            var fieldIndex = fields[Math.max(0, __aspxRichEdit.Field.normedBinaryIndexOf(fields, interval.start))]
                .getAbsolutelyTopLevelField().index;
            var resultFields = [];
            for (var field = void 0; field = fields[fieldIndex]; fieldIndex++) {
                var fieldInterval = field.getAllFieldInterval();
                var intersection = __aspxRichEdit.IntervalAlgorithms.getIntersection(fieldInterval, interval);
                if (intersection && (!!intersection.length || fieldInterval.contains(intersection.start)))
                    resultFields.push(new ASPx.Field(field));
                else if (!field.parent && field.getFieldStartPosition() >= interval.end)
                    break;
            }
            return resultFields;
        };
        SubDocument.prototype.findTables = function (arg) {
            var interval = ASPx.ApiParametersChecker.check(arg, 1, false, [
                ASPx.ApiParametersChecker.numberDescriptor("position", function (n) { return new CoreFixedInterval(n, 0); }),
                ASPx.ApiParametersChecker.intervalDescriptor("interval", function (interval) { return new CoreFixedInterval(interval.start, interval.length); })
            ]);
            var tables = this._subDocument.tables;
            if (tables.length == 0)
                return [];
            var tableIndex = tables[Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(tables, function (t) { return t.getStartPosition(); }, interval.start))]
                .getTopLevelParent().index;
            var resultTables = [];
            for (var table = void 0; table = tables[tableIndex]; tableIndex++) {
                var tableInterval = table.interval;
                var intersection = __aspxRichEdit.IntervalAlgorithms.getIntersection(tableInterval, interval);
                if (intersection && (!!intersection.length || tableInterval.contains(intersection.start)))
                    resultTables.push(new ASPx.Table(table));
                else if (!table.nestedLevel && table.getStartPosition() >= interval.end)
                    break;
            }
            return resultTables;
        };
        SubDocument.prototype.findParagraphs = function (arg) {
            var sd = this._subDocument;
            var intervals = ASPx.ApiParametersChecker.check(arg, 1, false, [
                ASPx.ApiParametersChecker.numberDescriptor("position", function (n) { return [new CoreFixedInterval(n, 0)]; }, 0, sd.getDocumentEndPosition() + 1),
                ASPx.ApiParametersChecker.intervalDescriptor("interval", function (interval) { return [new CoreFixedInterval(interval.start, interval.length)]; }, 0, sd.getDocumentEndPosition()),
                ASPx.ApiParametersChecker.intervalsDescriptor("intervals", function (apiIntervals) {
                    return __aspxRichEdit.ListUtils.map(apiIntervals, function (interval) { return new CoreFixedInterval(interval.start, interval.length); });
                }, 0, sd.getDocumentEndPosition())
            ]);
            var result = [];
            __aspxRichEdit.ListUtils.foreach(__aspxRichEdit.IntervalAlgorithms.getMergedIntervals(intervals, true), function (interval) {
                var intervalEnd = interval.end;
                var paragraphIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(sd.paragraphs, function (p) {
                    return p.startLogPosition.value;
                }, interval.start);
                result.push(new ASPx.Paragraph(sd.paragraphs[paragraphIndex], paragraphIndex));
                paragraphIndex++;
                for (var paragraph = void 0; paragraph = sd.paragraphs[paragraphIndex]; paragraphIndex++) {
                    if (paragraph.startLogPosition.value < intervalEnd)
                        result.push(new ASPx.Paragraph(paragraph, paragraphIndex));
                    else
                        break;
                }
            });
            return result;
        };
        SubDocument.prototype.findBookmarks = function (arg) {
            var findByInterval = function (sd, intervals) {
                var bkms = [];
                __aspxRichEdit.IntervalAlgorithms.handleAffectedObjects(sd.bookmarks, __aspxRichEdit.IntervalAlgorithms.getMergedIntervals(intervals, true), function (bkm, _index, interval, intersection) {
                    if (intersection.length || bkm.length == 0 || intersection.start == bkm.start ||
                        (interval.length == 0 && interval.start < bkm.end))
                        bkms.push(bkm);
                }, __aspxRichEdit.BookmarksManipulator.findBookmarkStartIndex);
                return bkms;
            };
            var sd = this._subDocument;
            return __aspxRichEdit.ListUtils.map(ASPx.ApiParametersChecker.check(arg, 1, false, [
                ASPx.ApiParametersChecker.numberDescriptor("position", function (pos) { return findByInterval(sd, [new CoreFixedInterval(pos, 0)]); }, 0, __aspxRichEdit.Constants.MAX_SAFE_INTEGER),
                ASPx.ApiParametersChecker.intervalDescriptor("interval", function (interval) { return findByInterval(sd, [new CoreFixedInterval(interval.start, interval.length)]); }, 0, __aspxRichEdit.Constants.MAX_SAFE_INTEGER),
                ASPx.ApiParametersChecker.intervalsDescriptor("intervals", function (apiIntervals) {
                    return findByInterval(sd, __aspxRichEdit.ListUtils.map(apiIntervals, function (interval) { return new CoreFixedInterval(interval.start, interval.length); }));
                }, 0, __aspxRichEdit.Constants.MAX_SAFE_INTEGER),
                ASPx.ApiParametersChecker.stringDescriptor("name", function (name) {
                    var bkm = __aspxRichEdit.ListUtils.elementBy(sd.bookmarks, function (b) { return b.name == name; });
                    return bkm ? [bkm] : [];
                }, false),
                ASPx.ApiParametersChecker.regExpDescriptor("regexp", function (regexp) {
                    return __aspxRichEdit.ListUtils.reducedMap(sd.bookmarks, function (b) { return regexp.test(b.name) ? b : null; });
                })
            ]), function (b) { return new ASPx.Bookmark(b); });
        };
        return SubDocument;
    }());
    ASPx.SubDocument = SubDocument;
    var SubDocumentType;
    (function (SubDocumentType) {
        SubDocumentType[SubDocumentType["Main"] = 0] = "Main";
        SubDocumentType[SubDocumentType["Header"] = 1] = "Header";
        SubDocumentType[SubDocumentType["Footer"] = 2] = "Footer";
        SubDocumentType[SubDocumentType["TextBox"] = 3] = "TextBox";
    })(SubDocumentType = ASPx.SubDocumentType || (ASPx.SubDocumentType = {}));
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var Table = (function () {
        function Table(table) {
            this._rows = [];
            this._start = table.getStartPosition();
            this._length = table.getEndPosition() - this._start;
            this._styleName = table.style ? table.style.styleName : null;
            this._index = table.index;
            for (var i = 0, row = void 0; row = table.rows[i]; i++)
                this._rows.push(new TableRow(row));
        }
        Object.defineProperty(Table.prototype, "start", {
            get: function () {
                return this._start;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Table.prototype, "length", {
            get: function () {
                return this._length;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Table.prototype, "index", {
            get: function () {
                return this._index;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Table.prototype, "interval", {
            get: function () {
                return new ASPx.Interval(this._start, this._length);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Table.prototype, "rows", {
            get: function () {
                return this._rows.slice(0);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Table.prototype, "styleName", {
            get: function () {
                return this._styleName;
            },
            enumerable: true,
            configurable: true
        });
        return Table;
    }());
    ASPx.Table = Table;
    var TableRow = (function () {
        function TableRow(row) {
            this._cells = [];
            this._start = row.getStartPosition();
            this._length = row.getEndPosition() - this._start;
            for (var i = 0, cell = void 0; cell = row.cells[i]; i++)
                this._cells.push(new TableCell(cell));
        }
        Object.defineProperty(TableRow.prototype, "start", {
            get: function () {
                return this._start;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(TableRow.prototype, "length", {
            get: function () {
                return this._length;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(TableRow.prototype, "interval", {
            get: function () {
                return new ASPx.Interval(this._start, this._length);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(TableRow.prototype, "cells", {
            get: function () {
                return this._cells.slice(0);
            },
            enumerable: true,
            configurable: true
        });
        return TableRow;
    }());
    ASPx.TableRow = TableRow;
    var TableCell = (function () {
        function TableCell(cell) {
            this._start = cell.startParagraphPosition.value;
            this._length = cell.endParagrapPosition.value - this._start;
        }
        Object.defineProperty(TableCell.prototype, "start", {
            get: function () {
                return this._start;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(TableCell.prototype, "length", {
            get: function () {
                return this._length;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(TableCell.prototype, "interval", {
            get: function () {
                return new ASPx.Interval(this._start, this._length);
            },
            enumerable: true,
            configurable: true
        });
        return TableCell;
    }());
    ASPx.TableCell = TableCell;
})(ASPx || (ASPx = {}));
var ASPx;
(function (ASPx) {
    var RichEditUnitConverter = (function () {
        function RichEditUnitConverter() {
        }
        RichEditUnitConverter.prototype.pixelsToTwips = function (value) {
            return __aspxRichEdit.UnitConverter.pixelsToTwips(value);
        };
        RichEditUnitConverter.prototype.inchesToTwips = function (value) {
            return __aspxRichEdit.UnitConverter.inchesToTwips(value);
        };
        RichEditUnitConverter.prototype.pointsToTwips = function (value) {
            return __aspxRichEdit.UnitConverter.pointsToTwips(value);
        };
        RichEditUnitConverter.prototype.centimetersToTwips = function (value) {
            return __aspxRichEdit.UnitConverter.centimetersToTwips(value);
        };
        RichEditUnitConverter.prototype.twipsToCentimeters = function (value) {
            return __aspxRichEdit.UnitConverter.twipsToCentimeters(value);
        };
        RichEditUnitConverter.prototype.pixelsToCentimeters = function (value) {
            return __aspxRichEdit.UnitConverter.pixelToCentimeters(value);
        };
        RichEditUnitConverter.prototype.twipsToInches = function (value) {
            return __aspxRichEdit.UnitConverter.twipsToInches(value);
        };
        RichEditUnitConverter.prototype.pixelsToInches = function (value) {
            return __aspxRichEdit.UnitConverter.pixelsToInches(value);
        };
        RichEditUnitConverter.prototype.pixelsToPoints = function (value) {
            return __aspxRichEdit.UnitConverter.pixelsToPoints(value);
        };
        RichEditUnitConverter.prototype.twipsToPoints = function (value) {
            return __aspxRichEdit.UnitConverter.twipsToPoints(value);
        };
        return RichEditUnitConverter;
    }());
    ASPx.RichEditUnitConverter = RichEditUnitConverter;
})(ASPx || (ASPx = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AspxShortcutManager = (function (_super) {
        __extends(AspxShortcutManager, _super);
        function AspxShortcutManager(commandManager, control) {
            var _this = _super.call(this, commandManager, control) || this;
            _this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ActivateRibbon, [REWebUtils.KeyCode.F10], []);
            _this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.FileNew, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_n], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_n]);
            _this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.FileOpen, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_o, REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.F12], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_o]);
            _this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.FilePrint, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_p, REWebUtils.ModifierKey.Ctrl | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.F12], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_p]);
            _this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.FileSave, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_s], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_s]);
            _this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.FileSaveAs, [], [REWebUtils.ModifierKey.Meta | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Key_s]);
            return _this;
        }
        return AspxShortcutManager;
    }(__aspxRichEdit.ShortcutManager));
    __aspxRichEdit.AspxShortcutManager = AspxShortcutManager;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AspxRichEditCore = (function (_super) {
        __extends(AspxRichEditCore, _super);
        function AspxRichEditCore() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        AspxRichEditCore.prototype.createCommandManager = function () {
            return new __aspxRichEdit.AspxCommandManager(this);
        };
        AspxRichEditCore.prototype.createShortcutManager = function () {
            return new __aspxRichEdit.AspxShortcutManager(this.commandManager, this);
        };
        AspxRichEditCore.prototype.createStringResources = function () {
            return new __aspxRichEdit.StringResources();
        };
        return AspxRichEditCore;
    }(__aspxRichEdit.RichEditCore));
    __aspxRichEdit.AspxRichEditCore = AspxRichEditCore;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ActivateRibbonCommand = (function (_super) {
        __extends(ActivateRibbonCommand, _super);
        function ActivateRibbonCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ActivateRibbonCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(true);
        };
        ActivateRibbonCommand.prototype.executeCore = function (_state, _options) {
            this.control.barManager.activateRibbon();
            return true;
        };
        return ActivateRibbonCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ActivateRibbonCommand = ActivateRibbonCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AspxCommandManager = (function (_super) {
        __extends(AspxCommandManager, _super);
        function AspxCommandManager(control) {
            var _this = _super.call(this, control) || this;
            _this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ActivateRibbon, __aspxRichEdit.ActivateRibbonCommand);
            return _this;
        }
        return AspxCommandManager;
    }(__aspxRichEdit.CommandManager));
    __aspxRichEdit.AspxCommandManager = AspxCommandManager;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GremlinUtils = (function () {
        function GremlinUtils() {
        }
        GremlinUtils.randomPosition = function (outElement, innerElement) {
            var a = outElement.x === undefined ?
                new __aspxRichEdit.Rectangle().init(outElement.left, outElement.top, outElement.width, outElement.height) :
                outElement;
            var b = innerElement.x === undefined ?
                new __aspxRichEdit.Rectangle().init(innerElement.left, innerElement.top, innerElement.width, innerElement.height) :
                innerElement;
            var bounds = __aspxRichEdit.Rectangle.getIntersection(a, b);
            return bounds ? [
                Math.round(Math.random() * bounds.width + bounds.x),
                Math.round(Math.random() * bounds.height + bounds.y)
            ] :
                null;
        };
        GremlinUtils.showClickPoint = function (p) {
            var clickSignal = document.createElement('div');
            clickSignal.style.zIndex = "200000";
            clickSignal.style.border = "3px solid red";
            clickSignal.style['border-radius'] = '50%';
            clickSignal.style.borderRadius = '50%';
            clickSignal.style.width = "10px";
            clickSignal.style.height = "10px";
            clickSignal.style['box-sizing'] = 'border-box';
            clickSignal.style.position = "absolute";
            clickSignal.style.webkitTransition = 'opacity 1s ease-out';
            clickSignal.style.transition = 'opacity 1s ease-out';
            clickSignal.style.left = (p.x - 5) + 'px';
            clickSignal.style.top = (p.y - 5) + 'px';
            var element = document.body.appendChild(clickSignal);
            setTimeout(function () {
                document.body.removeChild(element);
            }, 1000);
            setTimeout(function () {
                element.style.opacity = "0";
            }, 50);
        };
        GremlinUtils.getRandomChar = function (chance) {
            return String.fromCharCode(chance.natural({ min: 32, max: 126 }));
        };
        GremlinUtils.getRandomEngSymbol = function (chance) {
            if (!chance.natural({ min: 0, max: 6 }))
                return " ";
            return GremlinUtils.engSymbols.charAt(chance.natural({ min: 0, max: GremlinUtils.engSymbols.length }));
        };
        GremlinUtils.engSymbols = "abcdefghijklmnopqrstuvwxyz";
        return GremlinUtils;
    }());
    __aspxRichEdit.GremlinUtils = GremlinUtils;
    var RGremlin = (function () {
        function RGremlin(rich) {
            if (!rich)
                throw new Error("Need rich control");
            this.rich = rich;
            this.richCore = rich.core;
            if (!this.richCore)
                throw new Error("Need rich core");
            this.horde = gremlins.createHorde();
        }
        Object.defineProperty(RGremlin.prototype, "chance", {
            get: function () { return this._c ? this._c : (this._c = new Chance()); },
            enumerable: true,
            configurable: true
        });
        ;
        Object.defineProperty(RGremlin.prototype, "canvas", {
            get: function () { return this.richCore.canvasManager.renderer.canvas; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RGremlin.prototype, "actSubDocLen", {
            get: function () { return this.richCore.model.activeSubDocument.getDocumentEndPosition(); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RGremlin.prototype, "canvasManager", {
            get: function () { return this.richCore.canvasManager; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RGremlin.prototype, "scroll", {
            get: function () { return this.canvasManager.scroll; },
            enumerable: true,
            configurable: true
        });
        RGremlin.prototype.seed = function (s) {
            this.horde.seed(s);
            this._c = new Chance(s);
            return this;
        };
        RGremlin.prototype.defaultRun = function () {
            var equalDistribution = false;
            var data = [
                [this.gTableTextInserter(), 0.7],
                [this.gTableCellsMerger(), 0.1],
                [this.gTableColumnInserter(), 0.1],
                [this.gTableRowInserter(), 0.1],
            ];
            for (var _i = 0, data_1 = data; _i < data_1.length; _i++) {
                var d = data_1[_i];
                this.horde.gremlin(d[0]);
            }
            this.horde.mogwai(gremlins.mogwais.gizmo()
                .maxErrors(1));
            this.horde.strategy(gremlins.strategies.distribution()
                .delay(10)
                .distribution(equalDistribution ? __aspxRichEdit.ListUtils.initByValue(data.length, 1 / data.length) : __aspxRichEdit.ListUtils.map(data, function (d) { return d[1]; })));
            this.run();
            return this;
        };
        RGremlin.prototype.runTableModifier = function () {
            var equalDistribution = false;
            var data = [
                [this.gTableCellsMerger(), 0.1],
                [this.gTableColumnInserter(), 0.1],
                [this.gTableRowInserter(), 0.1],
            ];
            for (var _i = 0, data_2 = data; _i < data_2.length; _i++) {
                var d = data_2[_i];
                this.horde.gremlin(d[0]);
            }
            this.horde.mogwai(gremlins.mogwais.gizmo()
                .maxErrors(1));
            this.horde.strategy(gremlins.strategies.distribution()
                .delay(10)
                .distribution(equalDistribution ? __aspxRichEdit.ListUtils.initByValue(data.length, 1 / data.length) : __aspxRichEdit.ListUtils.map(data, function (d) { return d[1]; }))
                .randomizer(this.chance));
            this.run();
            return this;
        };
        RGremlin.prototype.run = function () {
            this.horde.unleash();
            return this;
        };
        RGremlin.prototype.stop = function () {
            this.horde.stop();
            return this;
        };
        RGremlin.prototype.gClicker = function () {
            var t = this;
            return gremlins.species.clicker()
                .clickTypes(['click', 'mousemove', 'dblclick', 'mousedown', 'mouseup', 'contextmenu'])
                .showAction(function (x, y) {
                GremlinUtils.showClickPoint(new __aspxRichEdit.Point(x, y));
            })
                .positionSelector(function () {
                return GremlinUtils.randomPosition(t.canvas.getBoundingClientRect(), t.canvas.firstChild.getBoundingClientRect());
            });
        };
        RGremlin.prototype.gTyper = function () {
            var _this = this;
            return function () {
                var str = _this.insertRandomChars();
                console.log("gremlin typer enter \"" + str + "\" to position " + _this.richCore.selection.collapsedPostion + "; actSubDocId: " + _this.richCore.model.activeSubDocument.id);
            };
        };
        RGremlin.prototype.gSelector = function () {
            var _this = this;
            return function () {
                var isInterval = _this.chance.bool();
                var docLen = _this.actSubDocLen;
                var firstPos = _this.randomInt(new __aspxRichEdit.BoundaryInterval(0, docLen));
                var secondPos = isInterval ?
                    _this.randomInt(new __aspxRichEdit.BoundaryInterval(firstPos, docLen)) :
                    firstPos;
                var selLen = __aspxRichEdit.Utils.restrictValue(secondPos - firstPos, 0, Math.min(50, Math.floor(docLen / 1000)));
                var newSelection = new __aspxRichEdit.FixedInterval(firstPos, selLen);
                _this.richCore.selection.setSelection(new __aspxRichEdit.SetSelectionParams().setInterval(newSelection));
                console.log("gremlin selector change selection to \"" + __aspxRichEdit.LogObjToStr.fixedInterval(newSelection) + "\"; actSubDocId: " + _this.richCore.model.activeSubDocument.id);
            };
        };
        RGremlin.prototype.gScroller = function () {
            var _this = this;
            return function () {
                var from = _this.canvas.scrollTop;
                _this.canvas.scrollTop += (_this.chance.bool() ? 1 : -1) * _this.randomInt(new __aspxRichEdit.BoundaryInterval(10, 80));
                console.log("gremlin scroller change scroll from " + from + " to \"" + _this.canvas.scrollTop);
            };
        };
        RGremlin.prototype.gTableCellsMerger = function () {
            var _this = this;
            return function () {
                var tables = _this.richCore.model.activeSubDocument.tables;
                if (tables.length == 0)
                    return;
                var table = tables[_this.randomInt(new __aspxRichEdit.BoundaryInterval(0, tables.length))];
                while (table.rows.length > 1 || table.rows[0].cells.length > 1) {
                    var tPosA = void 0;
                    var tPosB = void 0;
                    do {
                        tPosA = _this.generateTablePosition(table);
                        tPosB = _this.generateTablePosition(table);
                    } while (Math.abs(tPosA.rowIndex - tPosB.rowIndex) < 1 && Math.abs(tPosA.cellIndex - tPosB.cellIndex) < 1);
                    var minMax = _this.selectTableCellsByTablePositions(tPosA, tPosB);
                    if (_this.rich.commands.mergeTableCells.getState().enabled) {
                        console.log("gremlin tableCellsMerger isSelectedSquare " + _this.richCore.selection.tableInfo.extendedData.isSquare);
                        _this.rich.commands.mergeTableCells.execute();
                        console.log("gremlin tableCellsMerger merge [" + minMax.min.rowIndex + "][" + minMax.min.cellIndex + "] to pos [" + minMax.max.rowIndex + "][" + minMax.max.cellIndex + "]");
                        break;
                    }
                }
            };
        };
        RGremlin.prototype.gTableTextInserter = function () {
            var _this = this;
            return function () {
                var tables = _this.richCore.model.activeSubDocument.tables;
                if (tables.length == 0)
                    return;
                var table = tables[_this.randomInt(new __aspxRichEdit.BoundaryInterval(0, tables.length))];
                var tPos = _this.generateTablePosition(table);
                var pos = _this.randomInt(tPos.cell.interval);
                _this.richCore.selection.setSelection(new __aspxRichEdit.SetSelectionParams().setPosition(pos));
                var str = _this.insertRandomChars();
                console.log("gremlin tableTextInserter insert \"" + str + "\" to pos " + pos);
            };
        };
        RGremlin.prototype.gTableColumnInserter = function () {
            var _this = this;
            return function () {
                var tables = _this.richCore.model.activeSubDocument.tables;
                if (tables.length == 0)
                    return;
                var table = tables[_this.randomInt(new __aspxRichEdit.BoundaryInterval(0, tables.length))];
                if (__aspxRichEdit.TableCellUtils.getColumnCount(table) > 7)
                    return;
                var tPos = _this.generateTablePosition(table);
                _this.richCore.selection.setSelection(new __aspxRichEdit.SetSelectionParams().setPosition(tPos.cell.startParagraphPosition.value));
                var toRight = _this.chance.bool();
                if (toRight)
                    _this.rich.commands.insertTableColumnToTheRight.execute();
                else
                    _this.rich.commands.insertTableColumnToTheLeft.execute();
                console.log("gremlin tableRowInserter insert to " + (toRight ? "right" : "left") + " from [" + tPos.rowIndex + "][" + tPos.cellIndex + "]");
            };
        };
        RGremlin.prototype.gTableRowInserter = function () {
            var _this = this;
            return function () {
                var tables = _this.richCore.model.activeSubDocument.tables;
                if (tables.length == 0)
                    return;
                var table = tables[_this.randomInt(new __aspxRichEdit.BoundaryInterval(0, tables.length))];
                if (table.rows.length > 7)
                    return;
                var tPos = _this.generateTablePosition(table);
                _this.richCore.selection.setSelection(new __aspxRichEdit.SetSelectionParams().setPosition(tPos.cell.startParagraphPosition.value));
                var toAbove = _this.chance.bool();
                if (toAbove)
                    _this.rich.commands.insertTableRowAbove.execute();
                else
                    _this.rich.commands.insertTableRowBelow.execute();
                console.log("gremlin tableRowInserter insert to " + (toAbove ? "above" : "below") + " from [" + tPos.rowIndex + "][" + tPos.cellIndex + "]");
            };
        };
        RGremlin.prototype.selectTableCellsByTablePositions = function (tPosA, tPosB) {
            var table = tPosA.table;
            var minMax = __aspxRichEdit.ListUtils.minMax([tPosA, tPosB], function (a, b) {
                var diff = a.rowIndex - b.rowIndex;
                return diff != 0 ? diff : a.cellIndex - b.cellIndex;
            });
            var columnInterval = __aspxRichEdit.BoundaryInterval.normalized(__aspxRichEdit.TableCellUtils.getStartColumnIndex(minMax.min.cell), __aspxRichEdit.TableCellUtils.getStartColumnIndex(minMax.max.cell));
            columnInterval.end += 1;
            var tableCellGridInfos = [];
            var tableCellInfos = [];
            __aspxRichEdit.LayoutFormatter.Table.Grid.fillGridInfo(table, tableCellGridInfos, tableCellInfos);
            var apiIntervals = [];
            __aspxRichEdit.ListUtils.foreachOnInterval(new __aspxRichEdit.BoundaryInterval(minMax.min.rowIndex, minMax.max.rowIndex + 1), function (rowInd) {
                __aspxRichEdit.ListUtils.foreach(tableCellGridInfos[rowInd], function (cellInfo) {
                    apiIntervals.push(ASPx.ApiUtils.makeInterval(table.rows[rowInd].cells[cellInfo.getCellIndexAbs(rowInd)].interval));
                }, columnInterval.start, columnInterval.end);
            });
            this.rich.selection.intervals = apiIntervals;
            return minMax;
        };
        RGremlin.prototype.generateTablePosition = function (table) {
            var rowIndex = this.randomInt(new __aspxRichEdit.BoundaryInterval(0, table.rows.length));
            return new __aspxRichEdit.TablePosition(table, rowIndex, this.randomInt(new __aspxRichEdit.BoundaryInterval(0, table.rows[rowIndex].cells.length)))
                .init();
        };
        RGremlin.prototype.insertRandomChars = function () {
            var str = "";
            var maxC = this.randomInt(new __aspxRichEdit.BoundaryInterval(1, 60));
            for (var i = 0; i < maxC; i++)
                str += GremlinUtils.getRandomEngSymbol(this.chance);
            this.richCore.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.InsertText).execute(this.richCore.commandManager.isPublicApiCall, str);
            return str;
        };
        RGremlin.prototype.randomInt = function (interval) {
            return this.chance.natural({ min: interval.start, max: interval.end - 1 });
        };
        return RGremlin;
    }());
    __aspxRichEdit.RGremlin = RGremlin;
})(__aspxRichEdit || (__aspxRichEdit = {}));
    W var __extends = (this && this.__extends) || (function () {
    var extendStatics = Object.setPrototypeOf ||
        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Constants = (function () {
        function Constants() {
        }
        Constants.MIN_SAFE_INTEGER = -(Math.pow(2, 53) - 1);
        Constants.MAX_SAFE_INTEGER = (Math.pow(2, 53) - 1);
        Constants.MAX_BYTE = Math.pow(2, 8) - 1;
        Constants.MAX_SAFE_INT32 = (Math.pow(2, 31) - 1);
        return Constants;
    }());
    __aspxRichEdit.Constants = Constants;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Point = (function () {
        function Point(x, y) {
            this.x = x;
            this.y = y;
        }
        Point.prototype.isZero = function () {
            return this.x == 0 && this.y == 0;
        };
        Point.plus = function (a, b) {
            return new Point(a.x + b.x, a.y + b.y);
        };
        Point.minus = function (a, b) {
            return new Point(a.x - b.x, a.y - b.y);
        };
        Point.prototype.copyFrom = function (obj) {
            this.x = obj.x;
            this.y = obj.y;
        };
        Point.prototype.clone = function () {
            return new Point(this.x, this.y);
        };
        Point.prototype.equals = function (obj) {
            if (!obj)
                return false;
            return this.x == obj.x &&
                this.y == obj.y;
        };
        Point.prototype.applyOffset = function (p) {
            this.x += p.x;
            this.y += p.y;
            return this;
        };
        Point.prototype.applyMultiplier = function (x, y) {
            this.x *= x;
            this.y *= y;
            return this;
        };
        Point.prototype.plus = function (obj) {
            this.x += obj.x;
            this.y += obj.y;
            return this;
        };
        Point.prototype.rotate = function (angle, center) {
            var x = center.x + (this.x - center.x) * Math.cos(angle) - (this.y - center.y) * Math.sin(angle);
            this.y = center.y + (this.y - center.y) * Math.cos(angle) + (this.x - center.x) * Math.sin(angle);
            this.x = x;
            return this;
        };
        Object.defineProperty(Point.prototype, "vector", {
            get: function () { return new __aspxRichEdit.Vector(this.x, this.y); },
            enumerable: true,
            configurable: true
        });
        return Point;
    }());
    __aspxRichEdit.Point = Point;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Size = (function () {
        function Size(width, height) {
            this.width = width;
            this.height = height;
        }
        Size.initByCommonAction = function (f) {
            var widthAdp = function (s) { return s.width; };
            var heightAdp = function (s) { return s.height; };
            return new Size(f(widthAdp, heightAdp), f(heightAdp, widthAdp));
        };
        Size.prototype.equals = function (obj) {
            return this.width == obj.width && this.height == obj.height;
        };
        Size.prototype.clone = function () {
            return new Size(this.width, this.height);
        };
        Size.prototype.copyFrom = function (obj) {
            this.width = obj.width;
            this.height = obj.height;
        };
        Size.prototype.applyConverter = function (conv) {
            this.width = conv(this.width);
            this.height = conv(this.height);
            return this;
        };
        return Size;
    }());
    __aspxRichEdit.Size = Size;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Rectangle = (function () {
        function Rectangle() {
        }
        Rectangle.prototype.init = function (x, y, width, height) {
            this.x = x;
            this.y = y;
            this.width = width;
            this.height = height;
            return this;
        };
        Object.defineProperty(Rectangle.prototype, "vertivalInterval", {
            get: function () {
                return new __aspxRichEdit.FixedInterval(this.y, this.height);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Rectangle.prototype, "horizontalInterval", {
            get: function () {
                return new __aspxRichEdit.FixedInterval(this.x, this.width);
            },
            enumerable: true,
            configurable: true
        });
        Rectangle.prototype.initByCenter = function (center, minRadius) {
            this.x = center.x - minRadius;
            this.y = center.y - minRadius;
            this.width = minRadius * 2;
            this.height = minRadius * 2;
            return this;
        };
        Rectangle.prototype.degenerate = function () {
            return !this.width || !this.height;
        };
        Object.defineProperty(Rectangle.prototype, "size", {
            get: function () {
                return new __aspxRichEdit.Size(this.width, this.height);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Rectangle.prototype, "polygon", {
            get: function () {
                return new __aspxRichEdit.Polygon().init([
                    new __aspxRichEdit.Point(this.x, this.y),
                    new __aspxRichEdit.Point(this.getRightBoundPosition(), this.y),
                    new __aspxRichEdit.Point(this.getRightBoundPosition(), this.getBottomBoundPosition()),
                    new __aspxRichEdit.Point(this.x, this.getBottomBoundPosition())
                ], this.center);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Rectangle.prototype, "parallelogram", {
            get: function () {
                return new __aspxRichEdit.Parallelogram().init([
                    new __aspxRichEdit.Point(this.x, this.y),
                    new __aspxRichEdit.Point(this.getRightBoundPosition(), this.y),
                    new __aspxRichEdit.Point(this.getRightBoundPosition(), this.getBottomBoundPosition()),
                    new __aspxRichEdit.Point(this.x, this.getBottomBoundPosition())
                ]);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Rectangle.prototype, "rectangle", {
            get: function () {
                return new Rectangle().init(this.x, this.y, this.width, this.height);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Rectangle.prototype, "center", {
            get: function () {
                return new __aspxRichEdit.Point(this.x + this.width / 2, this.y + this.height / 2);
            },
            enumerable: true,
            configurable: true
        });
        Rectangle.prototype.initByAnotherRectangle = function (obj) {
            this.x = obj.x;
            this.y = obj.y;
            this.width = obj.width;
            this.height = obj.height;
            return this;
        };
        Rectangle.prototype.equals = function (obj) {
            return obj &&
                Rectangle.equalsBinary(this, obj);
        };
        Rectangle.prototype.setHorizontalBounds = function (interval) {
            this.x = interval.start;
            this.width = interval.length;
        };
        Rectangle.prototype.setSize = function (size) {
            this.width = size.width;
            this.height = size.height;
        };
        Rectangle.equalsBinary = function (A, B) {
            return A.x === B.x &&
                A.y === B.y &&
                A.width === B.width &&
                A.height === B.height;
        };
        Rectangle.prototype.isEqualsWidthAndHeight = function (width, height) {
            return this.width == width && this.height == height;
        };
        Rectangle.prototype.clone = function () {
            var rect = new Rectangle();
            rect.copyFrom(this);
            return rect;
        };
        Rectangle.prototype.copyFrom = function (obj) {
            this.x = obj.x;
            this.y = obj.y;
            this.width = obj.width;
            this.height = obj.height;
        };
        Rectangle.prototype.containsPointByHeight = function (y) {
            return y >= this.y && this.getBottomBoundPosition() >= y;
        };
        Rectangle.prototype.containsPointByWidth = function (x) {
            return x >= this.x && this.getRightBoundPosition() >= x;
        };
        Rectangle.prototype.containsPoint = function (x, y) {
            return this.containsPointByWidth(x) && this.containsPointByHeight(y);
        };
        Rectangle.prototype.getRightBoundPosition = function () {
            return this.x + this.width;
        };
        Rectangle.prototype.getBottomBoundPosition = function () {
            return this.y + this.height;
        };
        Rectangle.prototype.applyLeftInternalOffset = function (offset) {
            offset = Math.min(offset, this.width);
            this.x += offset;
            this.width -= offset;
            return this;
        };
        Rectangle.prototype.applyRightInternalOffset = function (offset) {
            this.width -= Math.min(offset, this.width);
            return this;
        };
        Rectangle.prototype.applyLeftOuterOffset = function (offset) {
            this.x -= offset;
            this.width += offset;
            return this;
        };
        Rectangle.prototype.applyRightOuterOffset = function (offset) {
            this.width += offset;
            return this;
        };
        Rectangle.prototype.applyBottomOuterOffset = function (offset) {
            this.height += offset;
            return this;
        };
        Rectangle.prototype.applyBottomInternalOffset = function (offset) {
            this.height -= Math.min(offset, this.height);
            return this;
        };
        Rectangle.prototype.applyXOffset = function (offset) {
            this.x += offset;
            return this;
        };
        Rectangle.prototype.applyYOffset = function (offset) {
            this.y += offset;
            return this;
        };
        Rectangle.prototype.applyOffset = function (offset) {
            this.x += offset.x;
            this.y += offset.y;
            return this;
        };
        Rectangle.getIntersection = function (objA, objB) {
            var horInters = __aspxRichEdit.IntervalAlgorithms.getIntersection(new __aspxRichEdit.FixedInterval(objA.x, objA.width), new __aspxRichEdit.FixedInterval(objB.x, objB.width));
            if (!horInters)
                return null;
            var vertInters = __aspxRichEdit.IntervalAlgorithms.getIntersection(new __aspxRichEdit.FixedInterval(objA.y, objA.height), new __aspxRichEdit.FixedInterval(objB.y, objB.height));
            if (!vertInters)
                return null;
            return new Rectangle().init(horInters.start, vertInters.start, horInters.length, vertInters.length);
        };
        Rectangle.getNonDegenerateIntersection = function (objA, objB) {
            var inters = Rectangle.getIntersection(objA, objB);
            return inters && !inters.degenerate() ? inters : null;
        };
        Rectangle.prototype.applyMarginsInside = function (margins) {
            return this.applyMargins(margins, 1);
        };
        Rectangle.prototype.applyMarginsOutside = function (margins) {
            return this.applyMargins(margins, -1);
        };
        Rectangle.prototype.applyMargins = function (margins, multiplier) {
            this.x = this.x + multiplier * margins.left;
            this.y = this.y + multiplier * margins.top;
            this.width = this.width - multiplier * margins.getHorizontalMargins();
            this.height = this.height - multiplier * margins.getVerticalMargins();
            return this;
        };
        Rectangle.prototype.plus = function (obj) {
            this.x += obj.x;
            this.y += obj.y;
            return this;
        };
        return Rectangle;
    }());
    __aspxRichEdit.Rectangle = Rectangle;
    var RelativeRect = (function () {
        function RelativeRect(top, right, bottom, left) {
            if (top === void 0) { top = 0; }
            if (right === void 0) { right = 0; }
            if (bottom === void 0) { bottom = 0; }
            if (left === void 0) { left = 0; }
            this.top = top;
            this.right = right;
            this.bottom = bottom;
            this.left = left;
        }
        Object.defineProperty(RelativeRect.prototype, "isEmpty", {
            get: function () { return this.left == 0 && this.right == 0 && this.top == 0 && this.bottom == 0; },
            enumerable: true,
            configurable: true
        });
        return RelativeRect;
    }());
    __aspxRichEdit.RelativeRect = RelativeRect;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SpecialCharacters = (function () {
        function SpecialCharacters() {
            this.Dot = '.';
            this.Colon = ':';
            this.Underscore = '_';
            this.EqualSign = '=';
            this.MiddleDot = '\u00B7';
            this.Dash = '-';
            this.ParagraphMark = String.fromCharCode(0xD);
            this.SectionMark = String.fromCharCode(0x1D);
            this.Hyphen = '\u2010';
            this.TabMark = String.fromCharCode(0x09);
            this.NonBreakingSpace = '\u00A0';
            this.Space = ' ';
            this.EmSpace = '\u2003';
            this.EnSpace = '\u2002';
            this.QmSpace = '\u2005';
            this.LineBreak = '\u000B';
            this.PageBreak = '\u000C';
            this.ColumnBreak = '\u000E';
            this.ObjectMark = '\uFFFC';
            this.FloatingObjectMark = '\u0008';
            this.NumberingListMark = '\uFFFB';
            this.EmDash = '\u2014';
            this.EnDash = '\u2013';
            this.Bullet = '\u2022';
            this.LeftSingleQuote = '\u2018';
            this.RightSingleQuote = '\u2019';
            this.LeftDoubleQuote = '\u201C';
            this.RightDoubleQuote = '\u201D';
            this.PilcrowSign = '\u00B6';
            this.CurrencySign = '\u00A4';
            this.CopyrightSymbol = '\u00A9';
            this.TrademarkSymbol = '\u2122';
            this.OptionalHyphen = '\u00AD';
            this.RegisteredTrademarkSymbol = '\u00AE';
            this.Ellipsis = '\u2026';
            this.OpeningSingleQuotationMark = '\u2018';
            this.ClosingSingleQuotationMark = '\u2019';
            this.OpeningDoubleQuotationMark = '\u201C';
            this.ClosingDoubleQuotationMark = '\u201D';
            this.SeparatorMark = '|';
            this.HiddenLineBreak = String.fromCharCode(0x21B2);
            this.HiddenParagraphMark = String.fromCharCode(0x00B6);
            this.HiddenSpace = String.fromCharCode(0x00B7);
            this.HiddenTabSpace = String.fromCharCode(0x2192);
            this.FieldCodeStartRun = "{";
            this.FieldCodeEndRun = "}";
            this.FieldResultEndRun = ">";
            this.LayoutDependentText = "#";
        }
        SpecialCharacters.prototype.DEBUG_CONVERTER = function (str) {
            var result = [];
            var len = str.length;
            for (var i = 0; i < len; i++) {
                var char = str[i];
                switch (char) {
                    case this.Bullet:
                        result.push("[Bullet]");
                        break;
                    case this.TabMark:
                        result.push("[TabMark]");
                        break;
                    case this.NonBreakingSpace:
                        result.push("[NonBreakingSpace]");
                        break;
                    case this.Space:
                        result.push("[Space]");
                        break;
                    case this.ParagraphMark:
                        result.push("¶");
                        break;
                    default: result.push(char);
                }
            }
            return result.join("");
        };
        return SpecialCharacters;
    }());
    __aspxRichEdit.SpecialCharacters = SpecialCharacters;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ConstInterval = (function () {
        function ConstInterval() {
        }
        Object.defineProperty(ConstInterval.prototype, "center", {
            get: function () { return this.start + (this.length / 2); },
            enumerable: true,
            configurable: true
        });
        ConstInterval.prototype.isNormalized = function () {
            return this.end >= this.start;
        };
        ConstInterval.prototype.isCollapsed = function () {
            return this.length == 0;
        };
        ConstInterval.prototype.equals = function (obj) {
            return this.start == obj.start && this.end == obj.end;
        };
        ConstInterval.isCollapsed = function (intervals) {
            return !intervals[1] && intervals[0].isCollapsed();
        };
        ConstInterval.prototype.getFixedInterval = function () {
            return new __aspxRichEdit.FixedInterval(this.start, this.length);
        };
        ConstInterval.prototype.getBoundaryInterval = function () {
            return new __aspxRichEdit.BoundaryInterval(this.start, this.end);
        };
        ConstInterval.prototype.getLinkedInterval = function (positionManager) {
            return new __aspxRichEdit.LinkedInterval(positionManager, this);
        };
        ConstInterval.prototype.containsInterval = function (interval) {
            return this.start <= interval.start && this.end >= interval.end;
        };
        ConstInterval.prototype.contains = function (pos) {
            return this.start <= pos && pos < this.end;
        };
        ConstInterval.prototype.containsWithIntervalEnd = function (val) {
            return this.start <= val && val <= this.end;
        };
        ConstInterval.prototype.containsWithoutIntervalEndAndStart = function (pos) {
            return this.start < pos && pos < this.end;
        };
        return ConstInterval;
    }());
    __aspxRichEdit.ConstInterval = ConstInterval;
    var MutableInterval = (function (_super) {
        __extends(MutableInterval, _super);
        function MutableInterval() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        MutableInterval.prototype.normalizeLength = function () {
            if (this.length < 0)
                this.length = 0;
            return this;
        };
        return MutableInterval;
    }(ConstInterval));
    __aspxRichEdit.MutableInterval = MutableInterval;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FixedInterval = (function (_super) {
        __extends(FixedInterval, _super);
        function FixedInterval(start, length) {
            var _this = _super.call(this) || this;
            _this.start = start;
            _this.length = length;
            return _this;
        }
        Object.defineProperty(FixedInterval.prototype, "end", {
            get: function () { return this.start + this.length; },
            set: function (newEnd) { this.length = newEnd - this.start; },
            enumerable: true,
            configurable: true
        });
        ;
        ;
        Object.defineProperty(FixedInterval.prototype, "center", {
            get: function () { return this.start + this.length / 2; },
            enumerable: true,
            configurable: true
        });
        FixedInterval.prototype.copyFrom = function (obj) {
            this.start = obj.start;
            this.length = obj.length;
        };
        FixedInterval.prototype.equals = function (obj) {
            return obj && this.start === obj.start && this.length === obj.length;
        };
        FixedInterval.prototype.clone = function () {
            return new FixedInterval(this.start, this.length);
        };
        FixedInterval.prototype.makeByStartEnd = function (start, end) {
            return new FixedInterval(start, end - start);
        };
        FixedInterval.prototype.makeByStartLength = function (start, length) {
            return new FixedInterval(start, length);
        };
        FixedInterval.prototype.makeByLengthEnd = function (length, end) {
            return new FixedInterval(end - length, length);
        };
        FixedInterval.fromPositions = function (start, end) {
            return new FixedInterval(start, end - start);
        };
        FixedInterval.prototype.expand = function (interval) {
            var end = Math.max(interval.end, this.end);
            this.start = Math.min(interval.start, this.start);
            this.end = end;
            return this;
        };
        return FixedInterval;
    }(__aspxRichEdit.MutableInterval));
    __aspxRichEdit.FixedInterval = FixedInterval;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var BoundaryInterval = (function (_super) {
        __extends(BoundaryInterval, _super);
        function BoundaryInterval(start, end) {
            var _this = _super.call(this) || this;
            _this.start = start;
            _this.end = end;
            return _this;
        }
        Object.defineProperty(BoundaryInterval.prototype, "length", {
            get: function () { return this.end - this.start; },
            set: function (newLength) { this.end = this.start + newLength; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(BoundaryInterval.prototype, "center", {
            get: function () { return (this.start + this.end) / 2; },
            enumerable: true,
            configurable: true
        });
        BoundaryInterval.normalized = function (pointA, pointB) {
            return pointA > pointB ?
                new BoundaryInterval(pointB, pointA) :
                new BoundaryInterval(pointA, pointB);
        };
        BoundaryInterval.prototype.copyFrom = function (obj) {
            this.start = obj.start;
            this.end = obj.end;
        };
        BoundaryInterval.prototype.equals = function (obj) {
            return obj && this.start === obj.start && this.end === obj.end;
        };
        BoundaryInterval.prototype.clone = function () {
            return new BoundaryInterval(this.start, this.length);
        };
        BoundaryInterval.prototype.makeByStartEnd = function (start, end) {
            return new BoundaryInterval(start, end);
        };
        BoundaryInterval.prototype.makeByStartLength = function (start, length) {
            return new BoundaryInterval(start, start + length);
        };
        BoundaryInterval.prototype.makeByLengthEnd = function (length, end) {
            return new BoundaryInterval(end - length, end);
        };
        BoundaryInterval.prototype.expand = function (interval) {
            this.start = Math.min(interval.start, this.start);
            this.end = Math.max(interval.end, this.end);
            return this;
        };
        return BoundaryInterval;
    }(__aspxRichEdit.MutableInterval));
    __aspxRichEdit.BoundaryInterval = BoundaryInterval;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var MapCreatorNumberAsKey = (function () {
        function MapCreatorNumberAsKey(result) {
            if (result === void 0) { result = {}; }
            this.result = result;
        }
        MapCreatorNumberAsKey.prototype.add = function (key, value) {
            this.result[key] = value;
            return this;
        };
        MapCreatorNumberAsKey.prototype.get = function () {
            return this.result;
        };
        return MapCreatorNumberAsKey;
    }());
    __aspxRichEdit.MapCreatorNumberAsKey = MapCreatorNumberAsKey;
    var MapCreatorStringAsKey = (function () {
        function MapCreatorStringAsKey(result) {
            if (result === void 0) { result = {}; }
            this.result = {};
            this.result = result;
        }
        MapCreatorStringAsKey.prototype.add = function (key, value) {
            this.result[key] = value;
            return this;
        };
        MapCreatorStringAsKey.prototype.get = function () {
            return this.result;
        };
        return MapCreatorStringAsKey;
    }());
    __aspxRichEdit.MapCreatorStringAsKey = MapCreatorStringAsKey;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Flag = (function () {
        function Flag(initValue) {
            if (initValue === void 0) { initValue = 0; }
            this.value = initValue;
        }
        Flag.prototype.set = function (enumVal, newValue) {
            var currVal = (this.value & enumVal) == enumVal;
            if (currVal != newValue) {
                if (newValue)
                    this.value |= enumVal;
                else
                    this.value ^= enumVal;
            }
            return this;
        };
        Flag.prototype.anyOf = function () {
            var _this = this;
            var flags = [];
            for (var _i = 0; _i < arguments.length; _i++) {
                flags[_i] = arguments[_i];
            }
            return !!__aspxRichEdit.ListUtils.anyOf(flags, function (flag) { return _this.value & flag; });
        };
        Flag.prototype.get = function (enumVal) {
            return (this.value & enumVal) == enumVal;
        };
        Flag.prototype.getValue = function () {
            return this.value;
        };
        Flag.prototype.clone = function () {
            return new Flag(this.value);
        };
        return Flag;
    }());
    __aspxRichEdit.Flag = Flag;
    var CommonCompareFunctions = (function () {
        function CommonCompareFunctions() {
        }
        CommonCompareFunctions.exactlyEqual = function (a, b) {
            return a === b;
        };
        CommonCompareFunctions.binaryEqualsCommon = function (a, b) {
            return a && b && (a === b || a.equals(b));
        };
        return CommonCompareFunctions;
    }());
    __aspxRichEdit.CommonCompareFunctions = CommonCompareFunctions;
    var CompareUtils = (function () {
        function CompareUtils() {
        }
        CompareUtils.numberCmpFunc = function (a, b) {
            return a - b;
        };
        CompareUtils.stringCompare = function (a, b) {
            return ((a == b) ? 0 : ((a > b) ? 1 : -1));
        };
        CompareUtils.bookmarksComparer = function (a, b) {
            var diff = a.start - b.start;
            return diff == 0 ? __aspxRichEdit.StringUtils.strCompare(a.name, b.name) : diff;
        };
        CompareUtils.getLayoutAnchoredObjectBoxComparer = function (anchorObjectsPositionInfo) {
            var getPos = anchorObjectsPositionInfo ?
                function (obj) { return anchorObjectsPositionInfo.getPosition(obj.objectId); } :
                function (obj) { return obj.position; };
            return function (a, b) {
                var aAncInfo = a.anchorInfo;
                var bAncInfo = b.anchorInfo;
                switch (aAncInfo.levelType) {
                    case __aspxRichEdit.AnchoredObjectLevelType.BehindText:
                        if (bAncInfo.levelType != __aspxRichEdit.AnchoredObjectLevelType.BehindText)
                            return -1;
                        break;
                    case __aspxRichEdit.AnchoredObjectLevelType.BeforeText:
                    case __aspxRichEdit.AnchoredObjectLevelType.InText:
                        if (bAncInfo.levelType == __aspxRichEdit.AnchoredObjectLevelType.BehindText)
                            return 1;
                        break;
                }
                var cmpZOrder = aAncInfo.zOrder - bAncInfo.zOrder;
                return cmpZOrder ? cmpZOrder : getPos(b) - getPos(a);
            };
        };
        CompareUtils.tableComparer = function (a, b) {
            var cmpPos = a.getStartPosition() - b.getStartPosition();
            return cmpPos == 0 ? a.nestedLevel - b.nestedLevel : cmpPos;
        };
        CompareUtils.pointXComparer = function (a, b) {
            return a.x - b.x;
        };
        CompareUtils.pointYComparer = function (a, b) {
            return a.y - b.y;
        };
        CompareUtils.equalsColumnsInfoBinary = function (a, b) {
            return a && b && (a === b || a.length == b.length && __aspxRichEdit.ListUtils.allOf2(a, b, function (valA, valB) { return valA.equals(valB); }));
        };
        return CompareUtils;
    }());
    __aspxRichEdit.CompareUtils = CompareUtils;
    var OrderedList = (function () {
        function OrderedList(comparer) {
            this.list = [];
            this.comparer = comparer;
        }
        OrderedList.prototype.add = function (elem) {
            var _this = this;
            this.list.splice(__aspxRichEdit.Utils.normedBinaryIndexOf(this.list, function (currElem) { return _this.comparer(currElem, elem); }) + 1, 0, elem);
            return this;
        };
        OrderedList.prototype.sort = function () {
            this.list.sort(this.comparer);
        };
        OrderedList.prototype.findIndex = function (elem) {
            var _this = this;
            var ind = __aspxRichEdit.Utils.binaryIndexOf(this.list, function (currElem) { return _this.comparer(currElem, elem); });
            if (ind < 0)
                return -1;
            for (var prevElem = void 0; (prevElem = this.list[ind - 1]) && this.comparer(elem, prevElem) == 0; ind--)
                ;
            return ind;
        };
        OrderedList.prototype.findElement = function (elem) {
            return this.list[this.findIndex(elem)];
        };
        return OrderedList;
    }());
    __aspxRichEdit.OrderedList = OrderedList;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var EnumUtils = (function () {
        function EnumUtils() {
        }
        EnumUtils.foreach = function (enumObject, callback) {
            for (var key in enumObject) {
                if (!enumObject.hasOwnProperty(key))
                    continue;
                var keyNum = parseInt(key);
                if (!isNaN(keyNum))
                    if (callback(keyNum))
                        break;
            }
        };
        EnumUtils.isAnyOf = function (value) {
            var params = [];
            for (var _i = 1; _i < arguments.length; _i++) {
                params[_i - 1] = arguments[_i];
            }
            return !!__aspxRichEdit.ListUtils.anyOf(params, function (v) { return value === v; });
        };
        return EnumUtils;
    }());
    __aspxRichEdit.EnumUtils = EnumUtils;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HTMLUtils = (function () {
        function HTMLUtils() {
        }
        HTMLUtils.clearInnerHtml = function (element) {
            while (element.firstChild)
                element.removeChild(element.firstChild);
        };
        HTMLUtils.setStylePosition = function (style, point) {
            style.left = __aspxRichEdit.MathUtils.round(point.x, 3) + "px";
            style.top = __aspxRichEdit.MathUtils.round(point.y, 3) + "px";
        };
        HTMLUtils.setStyleSize = function (style, size) {
            style.width = __aspxRichEdit.MathUtils.round(size.width, 3) + "px";
            style.height = __aspxRichEdit.MathUtils.round(size.height, 3) + "px";
        };
        HTMLUtils.setStyleSizeAndPosition = function (style, rectangle) {
            HTMLUtils.setStylePosition(style, rectangle);
            HTMLUtils.setStyleSize(style, rectangle);
        };
        HTMLUtils.hideNode = function (node) {
            var parentNode = node.parentNode;
            if (parentNode)
                parentNode.removeChild(node);
        };
        HTMLUtils.isHTMLElementNode = function (node) {
            return node.nodeType == Node.ELEMENT_NODE;
        };
        HTMLUtils.isTextNode = function (node) {
            return node.nodeType == Node.TEXT_NODE;
        };
        HTMLUtils.encodeHtml = function (text) {
            return text
                .replace(/&/g, '&amp;')
                .replace(/</g, '&lt;')
                .replace(/>/g, '&gt;');
        };
        HTMLUtils.prepareTextForRequest = function (text) {
            return text
                .replace(/%/g, '%25')
                .replace(/&/g, '%26amp;')
                .replace(/\+/g, '%2B')
                .replace(/</g, '%26lt;')
                .replace(/>/g, '%26gt;')
                .replace(/"/g, '%26quot;');
        };
        HTMLUtils.prepareTextForCallBackRequest = function (text) {
            return text
                .replace(/&/g, '&amp;')
                .replace(/</g, '&lt;')
                .replace(/>/g, '&gt;')
                .replace(/"/g, '&quot;');
        };
        HTMLUtils.displayPropertyIsBlock = function (style) {
            if (!style)
                return false;
            switch (style.display.toLowerCase()) {
                case "inline":
                case "":
                    return false;
            }
            return true;
        };
        return HTMLUtils;
    }());
    __aspxRichEdit.HTMLUtils = HTMLUtils;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var MinMax = (function () {
        function MinMax(min, max) {
            this.min = min;
            this.max = max;
        }
        return MinMax;
    }());
    __aspxRichEdit.MinMax = MinMax;
    var MinMaxNumber = (function (_super) {
        __extends(MinMaxNumber, _super);
        function MinMaxNumber() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        MinMaxNumber.prototype.updateBounds = function (obj) {
            if (!obj)
                return;
            if (obj.min > this.min)
                this.min = obj.min;
            if (obj.max > this.max)
                this.max = obj.max;
            return this;
        };
        Object.defineProperty(MinMaxNumber.prototype, "length", {
            get: function () {
                return this.max - this.min;
            },
            enumerable: true,
            configurable: true
        });
        return MinMaxNumber;
    }(MinMax));
    __aspxRichEdit.MinMaxNumber = MinMaxNumber;
    var ExtendedMinMax = (function () {
        function ExtendedMinMax(minElement, minValue, maxElement, maxValue) {
            this.minElement = minElement;
            this.minValue = minValue;
            this.maxElement = maxElement;
            this.maxValue = maxValue;
        }
        return ExtendedMinMax;
    }());
    __aspxRichEdit.ExtendedMinMax = ExtendedMinMax;
    var ListUtils = (function () {
        function ListUtils() {
        }
        ListUtils.isList = function (list) {
            return Array.isArray(list);
        };
        ListUtils.shallowCopy = function (list) {
            return list.slice();
        };
        ListUtils.deepCopy = function (list) {
            return ListUtils.map(list, function (val) { return val.clone(); });
        };
        ListUtils.initByValue = function (numElements, initValue) {
            var result = [];
            for (; numElements > 0; numElements--)
                result.push(initValue);
            return result;
        };
        ListUtils.foreachOnInterval = function (interval, callback) {
            var end = interval.end;
            for (var index = interval.start; index < end; index++)
                callback(index);
        };
        ListUtils.reverseForeachOnInterval = function (interval, callback) {
            var start = interval.start;
            for (var index = interval.end - 1; index >= start; index--)
                callback(index);
        };
        ListUtils.reducedMap = function (list, callback, startIndex, endIndex) {
            if (startIndex === void 0) { startIndex = 0; }
            if (endIndex === void 0) { endIndex = list.length; }
            var result = [];
            for (var index = startIndex; index < endIndex; index++) {
                var newItem = callback(list[index], index);
                if (newItem !== null && newItem !== undefined)
                    result.push(newItem);
            }
            return result;
        };
        ListUtils.initByCallback = function (numElements, initCallback) {
            var result = [];
            for (var index = 0; index < numElements; index++)
                result.push(initCallback(index));
            return result;
        };
        ListUtils.map = function (list, callback, startIndex, endIndex) {
            if (startIndex === void 0) { startIndex = 0; }
            if (endIndex === void 0) { endIndex = list.length; }
            var result = [];
            for (var index = startIndex; index < endIndex; index++)
                result.push(callback(list[index], index));
            return result;
        };
        ListUtils.indexBy = function (list, callback, startIndex, endIndex) {
            if (startIndex === void 0) { startIndex = 0; }
            if (endIndex === void 0) { endIndex = list.length; }
            for (var ind = startIndex; ind < endIndex; ind++)
                if (callback(list[ind], ind))
                    return ind;
            return -1;
        };
        ListUtils.reverseIndexBy = function (list, callback, startIndex, endIndex) {
            if (startIndex === void 0) { startIndex = list.length - 1; }
            if (endIndex === void 0) { endIndex = 0; }
            for (var ind = startIndex; ind >= endIndex; ind--)
                if (callback(list[ind], ind))
                    return ind;
            return -1;
        };
        ListUtils.elementBy = function (list, callback, startIndex, endIndex) {
            if (startIndex === void 0) { startIndex = 0; }
            if (endIndex === void 0) { endIndex = list.length; }
            var ind = ListUtils.indexBy(list, callback, startIndex, endIndex);
            return ind < 0 ? null : list[ind];
        };
        ListUtils.reverseElementBy = function (list, callback, startIndex, endIndex) {
            if (startIndex === void 0) { startIndex = list.length - 1; }
            if (endIndex === void 0) { endIndex = 0; }
            var ind = ListUtils.reverseIndexBy(list, callback, startIndex, endIndex);
            return ind < 0 ? null : list[ind];
        };
        ListUtils.last = function (list) {
            return list[list.length - 1];
        };
        ListUtils.setLast = function (list, newVal) {
            return list[list.length - 1] = newVal;
        };
        ListUtils.incLast = function (list) {
            return ++list[list.length - 1];
        };
        ListUtils.equals = function (a, b) {
            return a.length == b.length && ListUtils.allOf2(a, b, function (a, b) { return a.equals(b); });
        };
        ListUtils.unique = function (list, cmp, equal, finalizeObj) {
            if (equal === void 0) { equal = cmp; }
            if (finalizeObj === void 0) { finalizeObj = function () { }; }
            var len = list.length;
            if (len == 0)
                return [];
            list = list.sort(cmp);
            var prevValue = list[0];
            var result = ListUtils.reducedMap(list, function (v) {
                if (equal(prevValue, v) != 0) {
                    prevValue = v;
                    return v;
                }
                finalizeObj(v);
                return null;
            }, 1, len);
            result.unshift(list[0]);
            return result;
        };
        ListUtils.uniqueNumber = function (list) {
            list = list.sort(__aspxRichEdit.CompareUtils.numberCmpFunc);
            var prevValue = Number.NaN;
            for (var i = list.length - 1; i >= 0; i--)
                if (prevValue === list[i])
                    list.splice(i, 1);
                else
                    prevValue = list[i];
            return list;
        };
        ListUtils.foreach = function (list, callback, startIndex, endIndex) {
            if (startIndex === void 0) { startIndex = 0; }
            if (endIndex === void 0) { endIndex = list.length; }
            for (var index = startIndex; index < endIndex; index++)
                callback(list[index], index);
        };
        ListUtils.foreach2 = function (listA, listB, callback, startIndex, endIndex) {
            if (startIndex === void 0) { startIndex = 0; }
            if (endIndex === void 0) { endIndex = listA.length; }
            for (var index = startIndex; index < endIndex; index++)
                callback(listA[index], listB[index], index);
        };
        ListUtils.reverseForeach = function (list, callback, startIndex, endIndex) {
            if (startIndex === void 0) { startIndex = list.length - 1; }
            if (endIndex === void 0) { endIndex = 0; }
            for (var index = startIndex; index >= endIndex; index--)
                callback(list[index], index);
        };
        ListUtils.indexOf = function (list, element) {
            if (Array.prototype.indexOf)
                return list.indexOf(element);
            else {
                for (var i = 0, el = void 0; el = list[i]; i++)
                    if (el === element)
                        return i;
                return -1;
            }
        };
        ListUtils.reverseIndexOf = function (list, element, startIndex, endIndex) {
            if (startIndex === void 0) { startIndex = list.length - 1; }
            if (endIndex === void 0) { endIndex = 0; }
            for (var index = startIndex; index >= endIndex; index--)
                if (list[index] === element)
                    return index;
            return -1;
        };
        ListUtils.accumulate = function (list, initAccValue, callback, startIndex, endIndex) {
            if (startIndex === void 0) { startIndex = 0; }
            if (endIndex === void 0) { endIndex = list.length; }
            var acc = initAccValue;
            for (var ind = startIndex; ind < endIndex; ind++)
                acc = callback(acc, list[ind], ind);
            return acc;
        };
        ListUtils.accumulateNumber = function (list, initAccValue, callback, startIndex, endIndex) {
            if (startIndex === void 0) { startIndex = 0; }
            if (endIndex === void 0) { endIndex = list.length; }
            var acc = initAccValue;
            for (var ind = startIndex; ind < endIndex; ind++)
                acc += callback(list[ind], ind);
            return acc;
        };
        ListUtils.anyOf = function (list, callback, startIndex, endIndex) {
            if (startIndex === void 0) { startIndex = 0; }
            if (endIndex === void 0) { endIndex = list.length; }
            var currResult;
            for (var index = startIndex; index < endIndex; index++)
                if (currResult = callback(list[index], index))
                    return currResult;
            return null;
        };
        ListUtils.anyOf2 = function (listA, listB, callback, startIndex, endIndex) {
            if (startIndex === void 0) { startIndex = 0; }
            if (endIndex === void 0) { endIndex = listA.length; }
            var currResult;
            for (var index = startIndex; index < endIndex; index++)
                if (currResult = callback(listA[index], listB[index], index))
                    return currResult;
            return null;
        };
        ListUtils.reverseAnyOf = function (list, callback, startIndex, endIndex) {
            if (startIndex === void 0) { startIndex = list.length - 1; }
            if (endIndex === void 0) { endIndex = 0; }
            var currResult;
            for (var index = startIndex; index >= endIndex; index--)
                if (currResult = callback(list[index], index))
                    return currResult;
            return null;
        };
        ListUtils.allOf = function (list, callback, startIndex, endIndex) {
            if (startIndex === void 0) { startIndex = 0; }
            if (endIndex === void 0) { endIndex = list.length; }
            for (var index = startIndex; index < endIndex; index++)
                if (!callback(list[index], index))
                    return false;
            return true;
        };
        ListUtils.allOf2 = function (listA, listB, callback, startIndex, endIndex) {
            if (startIndex === void 0) { startIndex = 0; }
            if (endIndex === void 0) { endIndex = listA.length; }
            for (var index = startIndex; index < endIndex; index++)
                if (!callback(listA[index], listB[index], index))
                    return false;
            return true;
        };
        ListUtils.allOfOnInterval = function (interval, callback) {
            var endIndex = interval.end;
            for (var index = interval.start; index < endIndex; index++)
                if (!callback(index))
                    return false;
            return true;
        };
        ListUtils.minMaxExtended = function (list, calcValue, startIndex, endIndex) {
            if (startIndex === void 0) { startIndex = 0; }
            if (endIndex === void 0) { endIndex = list.length; }
            var minElement = list[startIndex];
            var maxElement = minElement;
            var minValue = calcValue(minElement);
            var maxValue = minValue;
            for (var index = startIndex + 1; index < endIndex; index++) {
                var elem = list[index];
                var elemValue = calcValue(elem);
                if (elemValue < minValue) {
                    minValue = elemValue;
                    minElement = elem;
                }
                else if (elemValue > maxValue) {
                    maxValue = elemValue;
                    minElement = elem;
                }
            }
            return new ExtendedMinMax(minElement, minValue, maxElement, maxValue);
        };
        ListUtils.max = function (list, cmp, startIndex, endIndex) {
            if (startIndex === void 0) { startIndex = 0; }
            if (endIndex === void 0) { endIndex = list.length; }
            return ListUtils.maxMinTemplate(list, cmp, startIndex, endIndex, function (cmpResult) { return cmpResult > 0; });
        };
        ListUtils.min = function (list, cmp, startIndex, endIndex) {
            if (startIndex === void 0) { startIndex = 0; }
            if (endIndex === void 0) { endIndex = list.length; }
            return ListUtils.maxMinTemplate(list, cmp, startIndex, endIndex, function (cmpResult) { return cmpResult < 0; });
        };
        ListUtils.maxMinTemplate = function (list, cmp, startIndex, endIndex, isReplace) {
            var found = list[startIndex];
            for (var index = startIndex + 1; index < endIndex; index++) {
                var elem = list[index];
                if (isReplace(cmp(elem, found)))
                    found = elem;
            }
            return found;
        };
        ListUtils.minMax = function (list, cmp, startIndex, endIndex) {
            if (startIndex === void 0) { startIndex = 0; }
            if (endIndex === void 0) { endIndex = list.length; }
            var min = list[startIndex];
            var max = min;
            for (var index = startIndex + 1; index < endIndex; index++) {
                var elem = list[index];
                var res = cmp(elem, min);
                if (res > 0)
                    max = elem;
                else if (res < 0)
                    min = elem;
            }
            return new MinMax(min, max);
        };
        ListUtils.addListOnTail = function (resultList, addedList) {
            for (var i = 0, elem = void 0; elem = addedList[i]; i++)
                resultList.push(elem);
            return resultList;
        };
        ListUtils.joinLists = function (converter) {
            var lists = [];
            for (var _i = 1; _i < arguments.length; _i++) {
                lists[_i - 1] = arguments[_i];
            }
            return ListUtils.accumulate(lists, [], function (accList, list) {
                ListUtils.addListOnTail(accList, converter(list));
                return accList;
            });
        };
        ListUtils.push = function (list, element) {
            list.push(element);
            return list;
        };
        ListUtils.countIf = function (list, callback) {
            return ListUtils.accumulate(list, 0, function (acc, elem, ind) { return acc + (callback(elem, ind) ? 1 : 0); });
        };
        ListUtils.clear = function (list) {
            list.splice(0);
        };
        ListUtils.merge = function (list, cmp, shouldMerge, merge, startIndex, endIndex) {
            if (startIndex === void 0) { startIndex = 0; }
            if (endIndex === void 0) { endIndex = list.length; }
            list = list.slice(startIndex, endIndex);
            if (endIndex - startIndex < 2)
                return list;
            list = list.sort(cmp);
            var prevObj = list[startIndex];
            var result = [prevObj];
            for (var ind = startIndex + 1; ind < endIndex; ind++) {
                var obj = list[ind];
                if (shouldMerge(prevObj, obj))
                    merge(prevObj, obj);
                else {
                    prevObj = obj;
                    result.push(prevObj);
                }
            }
            return result;
        };
        return ListUtils;
    }());
    __aspxRichEdit.ListUtils = ListUtils;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var StringUtils = (function () {
        function StringUtils() {
        }
        StringUtils.stringHashCode = function (str) {
            var hash = 0;
            if (str.length === 0)
                return hash;
            var strLen = str.length;
            for (var i = 0; i < strLen; i++) {
                hash = ((hash << 5) - hash) + str.charCodeAt(i);
                hash |= 0;
            }
            return hash;
        };
        ;
        StringUtils.endsAt = function (str, template) {
            var strInd = str.length - 1;
            var tmplInd = template.length - 1;
            var strStartInd = strInd - tmplInd;
            if (strStartInd < 0)
                return false;
            for (; strInd >= strStartInd; strInd--, tmplInd--)
                if (str[strInd] != template[tmplInd])
                    return false;
            return true;
        };
        StringUtils.startsAt = function (str, template) {
            return str.substr(0, template.length) == template;
        };
        StringUtils.stringInLowerCase = function (str) {
            return str.toLowerCase() == str;
        };
        StringUtils.stringInUpperCase = function (str) {
            return str.toUpperCase() == str;
        };
        StringUtils.inStringAtLeastOneSymbolInUpperCase = function (str) {
            for (var i = 0, char; char = str[i]; i++)
                if (StringUtils.stringInUpperCase(char) && !StringUtils.stringInLowerCase(char))
                    return true;
            return false;
        };
        StringUtils.getSymbolFromEnd = function (text, posFromEnd) {
            return text[text.length - posFromEnd];
        };
        StringUtils.stringTrim = function (str) {
            return str.replace(/(^\s*)|(\s*)$/g, '');
        };
        StringUtils.stringTrimStart = function (str) {
            return str.replace(/(^\s*)/g, '');
        };
        StringUtils.stringCustomTrim = function (str, trimChars) {
            for (var _i = 0, trimChars_1 = trimChars; _i < trimChars_1.length; _i++) {
                var template = trimChars_1[_i];
                str = str.replace(new RegExp("(^" + template + "*)|(" + template + "*)$", "g"), '');
            }
            return str;
        };
        StringUtils.mergeStringNTimes = function (str, times) {
            return new Array(times <= 0 ? 0 : times + 1).join(str);
        };
        StringUtils.getDecimalSeparator = function () {
            return (1.1).toLocaleString().substr(1, 1);
        };
        StringUtils.strCompare = function (a, b, ignoreCase) {
            if (ignoreCase === void 0) { ignoreCase = false; }
            if (ignoreCase) {
                a = a.toLowerCase();
                b = b.toLowerCase();
            }
            return ((a == b) ? 0 : ((a > b) ? 1 : -1));
        };
        StringUtils.repeat = function (str, count) {
            var result = "";
            for (var i = 1; i <= count; i++)
                result += str;
            return result;
        };
        StringUtils.isNullOrEmpty = function (str) {
            return !str || !str.length;
        };
        StringUtils.padLeft = function (str, totalWidth, paddingChar) {
            return StringUtils.mergeStringNTimes(paddingChar, Math.max(0, totalWidth - str.length)) + str;
        };
        return StringUtils;
    }());
    __aspxRichEdit.StringUtils = StringUtils;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var MapUtilsKeyAsNumber = (function () {
        function MapUtilsKeyAsNumber() {
        }
        MapUtilsKeyAsNumber.shallowCopy = function (map) {
            return MapUtilsKeyAsNumber.map(map, function (val) { return val; });
        };
        MapUtilsKeyAsNumber.deepCopy = function (map) {
            return MapUtilsKeyAsNumber.map(map, function (val) { return val.clone(); });
        };
        MapUtilsKeyAsNumber.clear = function (map) {
            for (var key in map)
                if (map.hasOwnProperty(key))
                    delete map[key];
        };
        MapUtilsKeyAsNumber.foreach = function (map, callback) {
            for (var key in map)
                if (map.hasOwnProperty(key))
                    callback(map[key], parseInt(key));
        };
        MapUtilsKeyAsNumber.accumulate = function (map, initAccValue, callback) {
            var acc = initAccValue;
            for (var key in map)
                if (map.hasOwnProperty(key))
                    acc = callback(acc, map[key], parseInt(key));
            return acc;
        };
        MapUtilsKeyAsNumber.isEmpty = function (map) {
            for (var key in map)
                if (map.hasOwnProperty(key))
                    return false;
            return true;
        };
        MapUtilsKeyAsNumber.map = function (map, callback) {
            var result = {};
            for (var key in map)
                if (map.hasOwnProperty(key))
                    result[key] = callback(map[key], parseInt(key));
            return result;
        };
        MapUtilsKeyAsNumber.reducedMap = function (map, callback) {
            var result = {};
            MapUtilsKeyAsNumber.foreach(map, function (obj, key) {
                var newItem = callback(obj, key);
                if (newItem !== null && newItem !== undefined)
                    result[key] = newItem;
            });
            return result;
        };
        MapUtilsKeyAsNumber.indexBy = function (map, callback) {
            for (var key in map) {
                if (map.hasOwnProperty(key)) {
                    var keyInt = parseInt(key);
                    if (callback(map[key], keyInt))
                        return keyInt;
                }
            }
            return null;
        };
        MapUtilsKeyAsNumber.elementBy = function (map, callback) {
            return map[MapUtilsKeyAsNumber.indexBy(map, callback)];
        };
        MapUtilsKeyAsNumber.toList = function (map) {
            return MapUtilsKeyAsNumber.toListBy(map, function (elem) { return elem; });
        };
        MapUtilsKeyAsNumber.toListBy = function (map, callback, maxElements) {
            if (maxElements === void 0) { maxElements = __aspxRichEdit.Constants.MAX_SAFE_INTEGER; }
            var result = [];
            for (var key in map)
                if (map.hasOwnProperty(key)) {
                    result.push(callback(map[key], parseInt(key)));
                    if (!--maxElements)
                        break;
                }
            return result;
        };
        MapUtilsKeyAsNumber.anyOf = function (map, callback) {
            for (var key in map) {
                if (map.hasOwnProperty(key)) {
                    var keyInt = parseInt(key);
                    var res = callback(map[keyInt], keyInt);
                    if (res)
                        return res;
                }
            }
            return null;
        };
        MapUtilsKeyAsNumber.allOf = function (map, callback) {
            for (var key in map) {
                if (map.hasOwnProperty(key)) {
                    var keyInt = parseInt(key);
                    var currElement = map[keyInt];
                    if (!callback(currElement, keyInt))
                        return false;
                }
            }
            return true;
        };
        MapUtilsKeyAsNumber.mapLength = function (map) {
            var length = 0;
            for (var key in map)
                if (map.hasOwnProperty(key))
                    length++;
            return length;
        };
        MapUtilsKeyAsNumber.max = function (map, cmp) {
            return MapUtilsKeyAsNumber.maxMinTemplate(map, cmp, function (cmpResult) { return cmpResult > 0; });
        };
        MapUtilsKeyAsNumber.min = function (map, cmp) {
            return MapUtilsKeyAsNumber.maxMinTemplate(map, cmp, function (cmpResult) { return cmpResult < 0; });
        };
        MapUtilsKeyAsNumber.maxMinTemplate = function (map, cmp, isReplace) {
            var found;
            for (var key in map) {
                if (map.hasOwnProperty(key)) {
                    if (found) {
                        var elem = map[key];
                        if (isReplace(cmp(elem, found)))
                            found = elem;
                    }
                    else {
                        found = map[key];
                    }
                }
            }
            return found;
        };
        return MapUtilsKeyAsNumber;
    }());
    __aspxRichEdit.MapUtilsKeyAsNumber = MapUtilsKeyAsNumber;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var MapUtilsKeyAsString = (function () {
        function MapUtilsKeyAsString() {
        }
        MapUtilsKeyAsString.foreach = function (map, callback) {
            for (var key in map)
                if (map.hasOwnProperty(key))
                    callback(map[key], key);
        };
        MapUtilsKeyAsString.shallowCopy = function (map) {
            var result = {};
            for (var key in map)
                if (map.hasOwnProperty(key))
                    result[key] = map[key];
            return result;
        };
        MapUtilsKeyAsString.keyBy = function (map, callback) {
            for (var key in map) {
                if (map.hasOwnProperty(key)) {
                    if (callback(map[key], key))
                        return key;
                }
            }
            return null;
        };
        MapUtilsKeyAsString.clear = function (map) {
            for (var key in map)
                if (map.hasOwnProperty(key))
                    delete map[key];
        };
        MapUtilsKeyAsString.anyOf = function (map, callback) {
            for (var key in map) {
                if (map.hasOwnProperty(key)) {
                    var res = callback(map[key], key);
                    if (res)
                        return res;
                }
            }
            return null;
        };
        MapUtilsKeyAsString.elementBy = function (map, callback) {
            return map[MapUtilsKeyAsString.keyBy(map, callback)];
        };
        MapUtilsKeyAsString.toList = function (map) {
            return MapUtilsKeyAsString.toListBy(map, function (elem) { return elem; });
        };
        MapUtilsKeyAsString.isEmpty = function (map) {
            for (var key in map)
                if (map.hasOwnProperty(key))
                    return false;
            return true;
        };
        MapUtilsKeyAsString.toListBy = function (map, callback) {
            if (callback === void 0) { callback = function (elem) { return elem; }; }
            var result = [];
            MapUtilsKeyAsString.foreach(map, function (elem, key) { return result.push(callback(elem, key)); });
            return result;
        };
        MapUtilsKeyAsString.map = function (map, callback) {
            var result = {};
            for (var key in map)
                if (map.hasOwnProperty(key))
                    result[key] = callback(map[key], key);
            return result;
        };
        MapUtilsKeyAsString.mapLength = function (map) {
            var length = 0;
            for (var key in map)
                if (map.hasOwnProperty(key))
                    length++;
            return length;
        };
        return MapUtilsKeyAsString;
    }());
    __aspxRichEdit.MapUtilsKeyAsString = MapUtilsKeyAsString;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Utils = (function () {
        function Utils() {
        }
        Utils.isNumber = function (obj) {
            return typeof obj === "number";
        };
        Utils.isString = function (obj) {
            return typeof obj === "string";
        };
        Utils.isArray = function (list) {
            return Array.isArray(list);
        };
        Utils.dumbConverter = function (value) {
            return value;
        };
        Utils.reflectionOfPointOnInterval = function (value, valInterval, targetInterval) {
            return (value - valInterval.start) / valInterval.length * targetInterval.length + targetInterval.start;
        };
        Utils.restrictValue = function (val, minVal, maxVal) {
            if (maxVal < minVal)
                maxVal = minVal;
            if (val > maxVal)
                return maxVal;
            else if (val < minVal)
                return minVal;
            return val;
        };
        Utils.boolToInt = function (value) {
            return value ? 1 : 0;
        };
        Utils.isEven = function (num) {
            return (num % 2) != 0;
        };
        Utils.isOdd = function (num) {
            return !Utils.isEven(num);
        };
        Utils.getHashCode = function (str) {
            var strLength = str.length;
            var hash = 0;
            for (var charIndex = 0; charIndex < strLength; charIndex++) {
                var unicodeValue = str.charCodeAt(charIndex);
                hash = ((hash << 5) - hash) + unicodeValue;
                hash |= 0;
            }
            return hash;
        };
        Utils.getRandomInt = function (min, max) {
            return Math.floor(Math.random() * (max - min + 1)) + min;
        };
        Utils.binaryIndexOf = function (array, comparer, minIndex, maxIndex) {
            if (minIndex === void 0) { minIndex = 0; }
            if (maxIndex === void 0) { maxIndex = -2; }
            var findFromZeroPosition = minIndex == 0;
            if (maxIndex == -2)
                maxIndex = array.length - 1;
            while (minIndex <= maxIndex) {
                var currentIndex = (minIndex + ((maxIndex - minIndex) >> 1));
                var compare = comparer(array[currentIndex]);
                if (compare < 0)
                    minIndex = currentIndex + 1;
                else if (compare > 0)
                    maxIndex = currentIndex - 1;
                else
                    return currentIndex;
            }
            return findFromZeroPosition ? ~minIndex : -1;
        };
        Utils.normedBinaryIndexOf = function (array, comparer, minIndex, maxIndex) {
            if (minIndex === void 0) { minIndex = 0; }
            if (maxIndex === void 0) { maxIndex = -2; }
            var index = Utils.binaryIndexOf(array, comparer, minIndex, maxIndex);
            return Utils.binaryIndexNormalizator(index);
        };
        Utils.binaryIndexNormalizator = function (index) {
            return index < 0 ? ~index - 1 : index;
        };
        Utils.numberCloseTo = function (num, to, accuracy) {
            if (accuracy === void 0) { accuracy = 0.00001; }
            return Math.abs(num - to) < accuracy;
        };
        Utils.minimumConvexHull = function (_points) {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        Utils.hitTestRectangles = function (point, rectangles) {
            var perfectHit = [];
            var hit = __aspxRichEdit.ListUtils.map(rectangles, function (r) {
                var dev = new __aspxRichEdit.RectangleDeviation(r, point).calcDeviation().calcAdditionalParams();
                if (dev.deviation.getValue() == __aspxRichEdit.HitTestDeviation.None)
                    perfectHit.push(new HitTestOfRectanglesResult(r, dev));
                return new HitTestOfRectanglesResult(r, dev);
            });
            return perfectHit.length ? perfectHit :
                [__aspxRichEdit.ListUtils.min(hit, function (a, b) { return a.deviation.offsetToInside.vector.length - b.deviation.offsetToInside.vector.length; })];
        };
        Utils.normedInterpolationIndexOf = function (array, getValue, toFind, lowIndex, highIndex) {
            if (lowIndex === void 0) { lowIndex = 0; }
            if (highIndex === void 0) { highIndex = -2; }
            if (highIndex == -2)
                highIndex = array.length - 1;
            var firstObject = array[Math.min(lowIndex, highIndex)];
            if (firstObject === undefined || toFind < getValue(firstObject))
                return -1;
            var lowValue = getValue(array[lowIndex]);
            var highValue = getValue(array[highIndex]);
            while (true) {
                if (toFind > lowValue && toFind < highValue) {
                    var midIndex = lowIndex + Math.floor(((toFind - lowValue) * (highIndex - lowIndex)) / (highValue - lowValue));
                    var midValue = getValue(array[midIndex]);
                    if (toFind > midValue) {
                        lowIndex = midIndex + 1;
                        lowValue = getValue(array[lowIndex]);
                        if (toFind < lowValue)
                            return midIndex;
                    }
                    else if (toFind < midValue) {
                        highIndex = midIndex - 1;
                        highValue = getValue(array[highIndex]);
                    }
                    else
                        return midIndex;
                }
                else
                    return toFind == lowValue ? lowIndex : highIndex;
            }
        };
        Utils.numberToBinary = function (num) {
            return (num >>> 0).toString(2);
        };
        return Utils;
    }());
    __aspxRichEdit.Utils = Utils;
    var HitTestOfRectanglesResult = (function () {
        function HitTestOfRectanglesResult(obj, deviation) {
            this.obj = obj;
            this.deviation = deviation;
        }
        return HitTestOfRectanglesResult;
    }());
    __aspxRichEdit.HitTestOfRectanglesResult = HitTestOfRectanglesResult;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RichEditUnit;
    (function (RichEditUnit) {
        RichEditUnit[RichEditUnit["Centimeter"] = 0] = "Centimeter";
        RichEditUnit[RichEditUnit["Inch"] = 1] = "Inch";
    })(RichEditUnit = __aspxRichEdit.RichEditUnit || (__aspxRichEdit.RichEditUnit = {}));
    var UnitConverter = (function () {
        function UnitConverter() {
        }
        UnitConverter.getConverter = function (unit) {
            switch (unit) {
                case RichEditUnit.Centimeter: return new UIUnitConverterCentimeter();
                case RichEditUnit.Inch: return new UIUnitConverterInch();
                default: throw new Error(__aspxRichEdit.Errors.InternalException);
            }
        };
        UnitConverter.pixelsToTwips = function (value) {
            return Math.round(UnitConverter.pixelsToTwipsF(value));
        };
        UnitConverter.inchesToTwips = function (value) {
            return Math.round(UnitConverter.inchesToTwipsF(value));
        };
        UnitConverter.pointsToTwips = function (value) {
            return Math.round(UnitConverter.pointsToTwipsF(value));
        };
        UnitConverter.picasToTwips = function (value) {
            return Math.round(value * 1440 / UnitConverter.PICAS_PER_INCH);
        };
        UnitConverter.centimetersToTwips = function (value) {
            return Math.round(UnitConverter.centimetersToTwipsF(value));
        };
        UnitConverter.pixelsToTwipsF = function (value) {
            return value * 1440 / UnitConverter.DPI;
        };
        UnitConverter.inchesToTwipsF = function (value) {
            return value * 1440;
        };
        UnitConverter.pointsToTwipsF = function (value) {
            return value * 20;
        };
        UnitConverter.centimetersToTwipsF = function (value) {
            return value * 1440 / UnitConverter.CENTIMETERS_PER_INCH;
        };
        UnitConverter.modelUnitsToDegrees = function (value) {
            return value / 60000;
        };
        UnitConverter.modelUnitsToRadians = function (value) {
            return value / 60000 * Math.PI / 180;
        };
        UnitConverter.degreesToModelUnits = function (value) {
            return value * 60000;
        };
        UnitConverter.radiansToModelUnits = function (value) {
            return value * 60000 / Math.PI * 180;
        };
        UnitConverter.radiansToDegrees = function (value) {
            return value / Math.PI * 180;
        };
        UnitConverter.fdToModelUnits = function (value) {
            return Math.round(value * 1875 / 2048);
        };
        UnitConverter.emuToTwips = function (val) {
            return val / 635;
        };
        UnitConverter.twipsToPixels = function (value) {
            return Math.round(UnitConverter.twipsToPixelsF(value));
        };
        UnitConverter.inchesToPixels = function (value) {
            return Math.round(UnitConverter.DPI * value);
        };
        UnitConverter.centimeterToPixel = function (value) {
            return Math.round(value / (UnitConverter.CENTIMETERS_PER_INCH / UnitConverter.DPI));
        };
        UnitConverter.pointsToPixels = function (value) {
            return Math.round(value * UnitConverter.DPI / 72);
        };
        UnitConverter.pointsToPixelsF = function (value) {
            return value * UnitConverter.DPI / 72;
        };
        UnitConverter.twipsToPixelsF = function (value) {
            return value * UnitConverter.DPI / 1440;
        };
        UnitConverter.pixelsToPoints = function (value) {
            return Math.round(value * 72 / UnitConverter.DPI);
        };
        UnitConverter.twipsToPoints = function (value) {
            return Math.round(this.twipsToPointsF(value));
        };
        UnitConverter.twipsToPointsF = function (value) {
            return value / 20;
        };
        UnitConverter.twipsToInches = function (value) {
            return value / 1440;
        };
        UnitConverter.pixelsToInches = function (value) {
            return value / UnitConverter.DPI;
        };
        UnitConverter.twipsToCentimeters = function (value) {
            return value * UnitConverter.CENTIMETERS_PER_INCH / 1440;
        };
        UnitConverter.pixelToCentimeters = function (value) {
            return value * UnitConverter.CENTIMETERS_PER_INCH / UnitConverter.DPI;
        };
        UnitConverter.hundredthsOfMillimeterToModelUnits = function (value) {
            return 15 * value / 127;
        };
        UnitConverter.twipsToEmu = function (val) {
            return val * 635;
        };
        UnitConverter.twipsToDegree = function (value) {
            return value / 60000;
        };
        UnitConverter.DPI = 96;
        UnitConverter.CENTIMETERS_PER_INCH = 2.54;
        UnitConverter.PICAS_PER_INCH = 6;
        return UnitConverter;
    }());
    __aspxRichEdit.UnitConverter = UnitConverter;
    var UIUnitConverterCentimeter = (function (_super) {
        __extends(UIUnitConverterCentimeter, _super);
        function UIUnitConverterCentimeter() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        UIUnitConverterCentimeter.prototype.getUnits = function () {
            return RichEditUnit.Centimeter;
        };
        UIUnitConverterCentimeter.prototype.twipsToUI = function (value) {
            return UnitConverter.twipsToCentimeters(value);
        };
        UIUnitConverterCentimeter.prototype.UIToTwips = function (value) {
            return UnitConverter.centimetersToTwips(value);
        };
        return UIUnitConverterCentimeter;
    }(UnitConverter));
    __aspxRichEdit.UIUnitConverterCentimeter = UIUnitConverterCentimeter;
    var UIUnitConverterInch = (function (_super) {
        __extends(UIUnitConverterInch, _super);
        function UIUnitConverterInch() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        UIUnitConverterInch.prototype.getUnits = function () {
            return RichEditUnit.Inch;
        };
        UIUnitConverterInch.prototype.twipsToUI = function (value) {
            return UnitConverter.twipsToInches(value);
        };
        UIUnitConverterInch.prototype.UIToTwips = function (value) {
            return UnitConverter.inchesToTwips(value);
        };
        return UIUnitConverterInch;
    }(UnitConverter));
    __aspxRichEdit.UIUnitConverterInch = UIUnitConverterInch;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RichUtils = (function () {
        function RichUtils() {
        }
        RichUtils.getSelectedParagraphs = function (intervals, activeSubDocument) {
            intervals = __aspxRichEdit.IntervalAlgorithms.getMergedIntervals(intervals, true);
            var selectedParagraphs = [];
            for (var i = 0, interval; interval = intervals[i]; i++)
                selectedParagraphs = selectedParagraphs.concat(activeSubDocument.getParagraphsByInterval(interval));
            selectedParagraphs = selectedParagraphs.sort(function (a, b) { return a.startLogPosition.value < b.startLogPosition.value ? -1 : 1; });
            var newSelectedParagraphs = [selectedParagraphs[0]];
            var prevLogPos = newSelectedParagraphs[0].startLogPosition.value;
            for (var i = 1, paragraph; paragraph = selectedParagraphs[i]; i++)
                if (paragraph.startLogPosition.value != prevLogPos) {
                    newSelectedParagraphs.push(paragraph);
                    prevLogPos = paragraph.startLogPosition.value;
                }
            return { paragraphs: newSelectedParagraphs, intervals: intervals };
        };
        RichUtils.getIntervalsOfSelectedParagraphs = function (intervals, subDocument) {
            var result = [];
            var paragraphs = this.getSelectedParagraphs(intervals, subDocument).paragraphs;
            __aspxRichEdit.ListUtils.foreach(paragraphs, function (p) {
                result.push(__aspxRichEdit.FixedInterval.fromPositions(p.startLogPosition.value, p.getEndPosition()));
            });
            return result;
        };
        RichUtils.getCopyPasteGuid = function (guids) {
            return "re-rangecopy&" + guids.sguid + "&" + guids.cguid;
        };
        RichUtils.getKeyModifiers = function (evt) {
            var result = 0;
            if (evt.altKey)
                result |= REWebUtils.ModifierKey.Alt;
            if (evt.ctrlKey)
                result |= REWebUtils.ModifierKey.Ctrl;
            if (evt.shiftKey)
                result |= REWebUtils.ModifierKey.Shift;
            return result;
        };
        RichUtils.getNextPredefinedFontSize = function (current) {
            var index = __aspxRichEdit.Utils.normedInterpolationIndexOf(RichUtils.predefinedFontSizes, function (a) { return a; }, current);
            return RichUtils.predefinedFontSizes[index + 1] !== undefined ? RichUtils.predefinedFontSizes[index + 1] : (Math.floor(current / 10) * 10 + 10);
        };
        RichUtils.getPreviousPredefinedFontSize = function (current) {
            var index = __aspxRichEdit.Utils.binaryIndexOf(RichUtils.predefinedFontSizes, function (a) { return a - current; });
            if (index > 0)
                return RichUtils.predefinedFontSizes[index - 1];
            if (index < 0)
                index = ~index;
            if (index === 0)
                return Math.max(1, current - 1);
            var predefinedFontsCount = RichUtils.predefinedFontSizes.length;
            if (index < predefinedFontsCount)
                return RichUtils.predefinedFontSizes[index - 1];
            var newValue = current % 10 > 0 ? (Math.floor(current / 10) * 10) : (Math.floor(current / 10) * 10 - 10);
            if (newValue >= RichUtils.predefinedFontSizes[predefinedFontsCount - 1])
                return newValue;
            return RichUtils.predefinedFontSizes[predefinedFontsCount - 1];
        };
        RichUtils.getAllowedSizeForImage = function (control) {
            var subDocument = control.model.activeSubDocument;
            var logPosition = control.selection.intervals[0].start;
            var layoutPosition = __aspxRichEdit.LayoutPosition.ensure(control, subDocument, logPosition, __aspxRichEdit.DocumentLayoutDetailsLevel.Row, new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true));
            var allowedHeight = __aspxRichEdit.UnitConverter.pixelsToTwips(layoutPosition.column.height);
            var allowedWidth = __aspxRichEdit.UnitConverter.pixelsToTwips(layoutPosition.column.width);
            if (layoutPosition.row.tableCellInfo)
                allowedWidth = Math.min(__aspxRichEdit.UnitConverter.pixelsToTwips(layoutPosition.row.tableCellInfo.avaliableContentWidth), allowedWidth);
            return new __aspxRichEdit.Size(allowedWidth, allowedHeight);
        };
        RichUtils.isLatinLetter = /\w/;
        RichUtils.isWhitespace = /\s/;
        RichUtils.isAlphanumeric = /^[\u00C0-\u1FFF\u2C00-\uD7FF\w]+$/;
        RichUtils.predefinedFontSizes = [8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72];
        RichUtils.minFontSize = 1;
        RichUtils.maxFontSize = 600;
        RichUtils.specialCharacters = new __aspxRichEdit.SpecialCharacters();
        return RichUtils;
    }());
    __aspxRichEdit.RichUtils = RichUtils;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LogSource;
    (function (LogSource) {
        LogSource[LogSource["Main"] = 1] = "Main";
        LogSource[LogSource["RowFormatter"] = 2] = "RowFormatter";
        LogSource[LogSource["LayoutFormatter"] = 3] = "LayoutFormatter";
        LogSource[LogSource["LayoutFormatterNotifier"] = 4] = "LayoutFormatterNotifier";
        LogSource[LogSource["LayoutFormatterInvalidator"] = 5] = "LayoutFormatterInvalidator";
        LogSource[LogSource["CanvasManager"] = 6] = "CanvasManager";
        LogSource[LogSource["DocumentRenderer"] = 7] = "DocumentRenderer";
        LogSource[LogSource["SelectionRenderer"] = 8] = "SelectionRenderer";
        LogSource[LogSource["SelectionFormatter"] = 9] = "SelectionFormatter";
        LogSource[LogSource["DiplayPageInfo"] = 10] = "DiplayPageInfo";
        LogSource[LogSource["DiplayTableBoundsInfo"] = 11] = "DiplayTableBoundsInfo";
        LogSource[LogSource["DiplayLayoutBoundsInfo"] = 12] = "DiplayLayoutBoundsInfo";
        LogSource[LogSource["RestartManager"] = 13] = "RestartManager";
        LogSource[LogSource["BoxWrapHolder"] = 14] = "BoxWrapHolder";
        LogSource[LogSource["PositionSaver"] = 15] = "PositionSaver";
        LogSource[LogSource["EventManager"] = 16] = "EventManager";
        LogSource[LogSource["TableFormatter"] = 17] = "TableFormatter";
        LogSource[LogSource["HtmlImporter"] = 18] = "HtmlImporter";
        LogSource[LogSource["SimpleViewRenderer"] = 19] = "SimpleViewRenderer";
        LogSource[LogSource["DocxImporter"] = 20] = "DocxImporter";
    })(LogSource = __aspxRichEdit.LogSource || (__aspxRichEdit.LogSource = {}));
    var LogSourceParams = (function () {
        function LogSourceParams(enabled, logSource) {
            this.enabled = enabled;
            this.logSource = logSource;
            this.name = LogSource[logSource];
        }
        LogSourceParams.prototype.getName = function () {
            return this.name;
        };
        LogSourceParams.prototype.isEnabled = function (_functionInfo) {
            return this.enabled;
        };
        LogSourceParams.prototype.setEnabled = function (isEnable) {
            this.enabled = isEnable;
        };
        LogSourceParams.prototype.handle = function (_functionInfo, _valOrFunc) {
            return false;
        };
        return LogSourceParams;
    }());
    __aspxRichEdit.LogSourceParams = LogSourceParams;
    var LogSourceParamsFuncHandler = (function (_super) {
        __extends(LogSourceParamsFuncHandler, _super);
        function LogSourceParamsFuncHandler() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LogSourceParamsFuncHandler.prototype.handle = function (_functionInfo, valOrFunc) {
            valOrFunc();
            return true;
        };
        return LogSourceParamsFuncHandler;
    }(LogSourceParams));
    __aspxRichEdit.LogSourceParamsFuncHandler = LogSourceParamsFuncHandler;
    var DiplayTableBoundsInfoSourceParam = (function (_super) {
        __extends(DiplayTableBoundsInfoSourceParam, _super);
        function DiplayTableBoundsInfoSourceParam() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DiplayTableBoundsInfoSourceParam.prototype.setEnabled = function (isEnable) {
            this.enabled = isEnable;
            if (!isEnable)
                Log.visualizerManager.hideAll(__aspxRichEdit.DebugVisualizerType.TableBounds);
        };
        return DiplayTableBoundsInfoSourceParam;
    }(LogSourceParamsFuncHandler));
    __aspxRichEdit.DiplayTableBoundsInfoSourceParam = DiplayTableBoundsInfoSourceParam;
    var Log = (function () {
        function Log() {
        }
        Log.createMap = function () {
            var map = {};
            for (var key in LogSource) {
                if (LogSource.hasOwnProperty(key)) {
                    var keyNum = parseInt(key);
                    if (!isNaN(keyNum)) {
                        switch (keyNum) {
                            case LogSource.DiplayPageInfo:
                                map[keyNum] = new LogSourceParamsFuncHandler(false, keyNum);
                                break;
                            case LogSource.DiplayTableBoundsInfo:
                                map[keyNum] = new DiplayTableBoundsInfoSourceParam(false, keyNum);
                                break;
                            default: map[keyNum] = new LogSourceParams(false, keyNum);
                        }
                    }
                }
            }
            return map;
        };
        Object.defineProperty(Log, "isEnabled", {
            get: function () { return Log._isEnabled; },
            set: function (val) {
                if (!Log.visualizerManager)
                    Log.visualizerManager = new __aspxRichEdit.DebugVisualizerManager(__aspxRichEdit.ChromeCustomFormatters.BaseFormatter.rich.viewManager.cache);
                if (!Log.isChromeFormattersAdded && val) {
                    Log.isChromeFormattersAdded = true;
                    var w_1 = window;
                    Object.defineProperty(w_1, "m", {
                        get: function () {
                            return {
                                get asd() { return w_1.rich.core.model.activeSubDocument; },
                                get main() { return w_1.rich.core.model.mainSubDocument; },
                                get tables() { return w_1.rich.core.model.activeSubDocument.tables; },
                                get table() { return w_1.rich.core.model.activeSubDocument.tables[0]; },
                                get fields() { return w_1.rich.core.model.activeSubDocument.fields; },
                                get field() { return w_1.rich.core.model.activeSubDocument.fields[0]; },
                                get runs() { return w_1.rich.core.model.activeSubDocument.chunks[0].textRuns; },
                                get run() { return w_1.rich.core.model.activeSubDocument.chunks[0].textRuns[0]; },
                                get bookmarks() { return w_1.rich.core.model.activeSubDocument.bookmarks; },
                                get bookmark() { return w_1.rich.core.model.activeSubDocument.bookmarks[0]; },
                            };
                        }
                    });
                    Object.defineProperty(w_1, "f", {
                        get: function () {
                            return {
                                get manager() { return w_1.rich.core.layoutFormatterManager; },
                                get lp() { return w_1.rich.core.layoutFormatterManager.mainFormatter.layoutPosition; },
                                get main() { return w_1.rich.core.layoutFormatterManager.mainFormatter; },
                                get active() { return w_1.rich.core.layoutFormatterManager.activeFormatter; }
                            };
                        }
                    });
                    Object.defineProperty(w_1, "l", {
                        get: function () {
                            return {
                                get l() { return w_1.rich.core.layoutFormatterManager.layout; },
                                get reset() { return w_1.rich.commands.showHiddenSymbols.execute(); },
                                get c() { return w_1.rich.core.layoutFormatterManager.layout.pages[0].mainSubDocumentPageAreas[0].columns[0]; }
                            };
                        }
                    });
                    var formatters = window.devtoolsFormatters;
                    if (!formatters)
                        formatters = window.devtoolsFormatters = [];
                    __aspxRichEdit.ListUtils.addListOnTail(formatters, __aspxRichEdit.ChromeCustomFormatters.BaseFormatter.formattersList);
                }
                Log._isEnabled = val;
            },
            enumerable: true,
            configurable: true
        });
        ;
        ;
        Log.clearCustomBounds = function (pageIndex) {
            if (pageIndex === void 0) { pageIndex = -1; }
            if (pageIndex == -1) {
                __aspxRichEdit.MapUtilsKeyAsNumber.foreach(Log.listOfCustomBounds, function (pageList) {
                    return __aspxRichEdit.ListUtils.foreach(pageList, function (elem) { return __aspxRichEdit.HTMLUtils.hideNode(elem); });
                });
                Log.listOfCustomBounds = {};
            }
            else {
                var pageList = Log.listOfCustomBounds[pageIndex];
                if (pageList) {
                    __aspxRichEdit.ListUtils.foreach(pageList, function (elem) { return __aspxRichEdit.HTMLUtils.hideNode(elem); });
                }
                delete Log.listOfCustomBounds[pageIndex];
            }
        };
        Log.disableAll = function () {
            Log.isEnabled = false;
            for (var key in Log.logSourceParams)
                if (Log.logSourceParams.hasOwnProperty(key))
                    Log.logSourceParams[key].setEnabled(false);
        };
        Log.print = function (logSource, functionInfo, valOrFunc) {
            if (!Log.isEnabled)
                return false;
            var logSourceParams = Log.logSourceParams[logSource];
            if (logSourceParams) {
                if (logSourceParams.isEnabled(functionInfo)) {
                    if (!logSourceParams.handle(functionInfo, valOrFunc))
                        console.log(Log.SOLID_BLOCK + " " + logSourceParams.getName() + " " + functionInfo + " " + (typeof valOrFunc == "function" ? valOrFunc() : valOrFunc));
                }
            }
            else
                console.log("Log.print " + LogSource[logSource] + " not defined");
        };
        Log.flip = function (func, aArgPos, bArgPos) {
            return function () {
                var params = [];
                for (var _i = 0; _i < arguments.length; _i++) {
                    params[_i] = arguments[_i];
                }
                params.splice(bArgPos, 1, params.splice(aArgPos, 1, params[bArgPos])[0]);
                return func.apply(func, params);
            };
        };
        Log.w = function (numFuncParams, func, currParamsStack) {
            if (currParamsStack === void 0) { currParamsStack = []; }
            return function () {
                var params = [];
                for (var _i = 0; _i < arguments.length; _i++) {
                    params[_i] = arguments[_i];
                }
                var newStack = currParamsStack.concat(params.length == 0 ? undefined : params);
                if (newStack.length >= numFuncParams)
                    return func.apply(func, currParamsStack.concat(params));
                return Log.w(numFuncParams, func, newStack);
            };
        };
        Log.join = function (sep, list) {
            return list.join(sep);
        };
        Log.map = function (func, list) {
            return __aspxRichEdit.ListUtils.map(list, func);
        };
        Log.mask = function (objEnum, mask, excessNullValue) {
            if (excessNullValue === void 0) { excessNullValue = Number.MAX_VALUE; }
            var res = [];
            var isFoundNullValue = false;
            for (var key in objEnum) {
                if (!objEnum.hasOwnProperty(key))
                    continue;
                var keyNum = parseInt(key);
                if (!isNaN(keyNum) && (keyNum & mask) == keyNum) {
                    if (excessNullValue != keyNum)
                        res.push(objEnum[key]);
                    else
                        isFoundNullValue = true;
                }
            }
            if (isFoundNullValue && !res.length)
                res.push(objEnum[excessNullValue]);
            return res.join(Log.splitBy);
        };
        Log.isDebug = false;
        Log.splitBy = ", ";
        Log.SOLID_BLOCK = String.fromCharCode(0x2588);
        Log.DOUBLE_SOLID_BLOCK = Log.SOLID_BLOCK + Log.SOLID_BLOCK;
        Log.TRIPLE_SOLID_BLOCK = Log.DOUBLE_SOLID_BLOCK + Log.SOLID_BLOCK;
        Log.logSourceParams = Log.createMap();
        Log.listOfCustomBounds = {};
        Log._isEnabled = false;
        Log.isChromeFormattersAdded = false;
        return Log;
    }());
    __aspxRichEdit.Log = Log;
    var LogObjToStr = (function () {
        function LogObjToStr() {
        }
        LogObjToStr.point = function (p) {
            return p ? "[x: " + p.x + ", y:" + p.y + "]" : "null";
        };
        LogObjToStr.layoutPoint = function (p) {
            return p ? "[pageIndex: " + p.pageIndex + ", x: " + p.x + ", y:" + p.y + "]" : "null";
        };
        LogObjToStr.richMouseEvent = function (evt) {
            var result = [];
            result.push("absPoint: " + LogObjToStr.point(evt.absolutePoint));
            result.push("scroll: " + LogObjToStr.point(evt.scroll));
            result.push("layoutPoint: " + LogObjToStr.layoutPoint(evt.layoutPoint));
            result.push("modifiers: " + Log.mask(REWebUtils.ModifierKey, evt.modifiers, REWebUtils.ModifierKey.None));
            result.push("button: " + Log.mask(__aspxRichEdit.MouseButton, evt.button, __aspxRichEdit.MouseButton.None));
            result.push("middleButtonPressed: " + evt.middleButtonPressed);
            result.push("mouseEvent: " + evt.mouseEvent);
            result.push("source: " + __aspxRichEdit.MouseEventSource[evt.source]);
            return result.join("\n");
        };
        LogObjToStr.layoutPosition = function (lp) {
            return LogObjToStr.layoutPositionShort(lp) + (", boxInd: " + lp.boxIndex + ", charOffset:" + lp.charOffset);
        };
        LogObjToStr.layoutPositionShort = function (lp) {
            return "DetLevel: " + __aspxRichEdit.DocumentLayoutDetailsLevel[lp.detailsLevel] + ", pageIndex: " + lp.pageIndex + ", pageAreaInd: " + lp.pageAreaIndex + ", columnInd: " + lp.columnIndex + ", rowInd: " + lp.rowIndex;
        };
        LogObjToStr.fixedInterval = function (interval) {
            return "[" + interval.start + ", " + interval.end + "]";
        };
        LogObjToStr.tableWidthUnit = function (unit) {
            return "type: " + __aspxRichEdit.TableWidthUnitType[unit.type] + ", val: " + unit.value;
        };
        LogObjToStr.tableHeightUnit = function (unit) {
            return "type: " + __aspxRichEdit.TableHeightUnitType[unit.type] + ", val: " + unit.value;
        };
        LogObjToStr.tableMembers = function (table, prefix) {
            if (prefix === void 0) { prefix = ""; }
            var result = [];
            result.push(prefix + "index: " + table.index);
            result.push(prefix + "nestedLevel: " + table.nestedLevel);
            result.push(prefix + "lookTypes: " + Log.mask(__aspxRichEdit.TableLookTypes, table.lookTypes));
            result.push(prefix + "preferredWidth: " + LogObjToStr.tableWidthUnit(table.preferredWidth));
            return result.join("\n");
        };
        LogObjToStr.tableProperties = function (props, prefix) {
            if (prefix === void 0) { prefix = ""; }
            var result = [];
            result.push(prefix + "mask: " + Log.mask(__aspxRichEdit.TablePropertiesMask, props.mask));
            if (props.mask & __aspxRichEdit.TablePropertiesMask.UseTopMargin)
                result.push(prefix + "cellMargins.top: " + LogObjToStr.tableWidthUnit(props.cellMargins.top));
            if (props.mask & __aspxRichEdit.TablePropertiesMask.UseRightMargin)
                result.push(prefix + "cellMargins.right: " + LogObjToStr.tableWidthUnit(props.cellMargins.right));
            if (props.mask & __aspxRichEdit.TablePropertiesMask.UseBottomMargin)
                result.push(prefix + "cellMargins.bottom: " + LogObjToStr.tableWidthUnit(props.cellMargins.bottom));
            if (props.mask & __aspxRichEdit.TablePropertiesMask.UseLeftMargin)
                result.push(prefix + "cellMargins.left: " + LogObjToStr.tableWidthUnit(props.cellMargins.left));
            if (props.mask & __aspxRichEdit.TablePropertiesMask.UseCellSpacing)
                result.push(prefix + "cellSpacing: " + LogObjToStr.tableWidthUnit(props.cellSpacing));
            if (props.mask & __aspxRichEdit.TablePropertiesMask.UseTableIndent)
                result.push(prefix + "indent: " + LogObjToStr.tableWidthUnit(props.indent));
            if (props.mask & __aspxRichEdit.TablePropertiesMask.UseTopBorder)
                result.push(prefix + "borders.topBorder: " + LogObjToStr.borderInfo(props.borders.topBorder));
            if (props.mask & __aspxRichEdit.TablePropertiesMask.UseRightBorder)
                result.push(prefix + "borders.rightBorder: " + LogObjToStr.borderInfo(props.borders.rightBorder));
            if (props.mask & __aspxRichEdit.TablePropertiesMask.UseBottomBorder)
                result.push(prefix + "borders.bottomBorder: " + LogObjToStr.borderInfo(props.borders.bottomBorder));
            if (props.mask & __aspxRichEdit.TablePropertiesMask.UseLeftBorder)
                result.push(prefix + "borders.leftBorder: " + LogObjToStr.borderInfo(props.borders.leftBorder));
            if (props.mask & __aspxRichEdit.TablePropertiesMask.UseInsideHorizontalBorder)
                result.push(prefix + "borders.insideHorizontalBorder: " + LogObjToStr.borderInfo(props.borders.insideHorizontalBorder));
            if (props.mask & __aspxRichEdit.TablePropertiesMask.UseInsideVerticalBorder)
                result.push(prefix + "borders.insideVerticalBorder: " + LogObjToStr.borderInfo(props.borders.insideVerticalBorder));
            if (props.mask & __aspxRichEdit.TablePropertiesMask.UseTableStyleColBandSize)
                result.push(prefix + "tableStyleColumnBandSize: " + props.tableStyleColumnBandSize);
            if (props.mask & __aspxRichEdit.TablePropertiesMask.UseTableStyleRowBandSize)
                result.push(prefix + "tableStyleRowBandSize: " + props.tableStyleRowBandSize);
            if (props.mask & __aspxRichEdit.TablePropertiesMask.UseAvoidDoubleBorders)
                result.push(prefix + "avoidDoubleBorders: " + props.avoidDoubleBorders);
            if (props.mask & __aspxRichEdit.TablePropertiesMask.UseShadingInfoIndex)
                result.push(prefix + "shadingInfo: " + LogObjToStr.shadingInfo(props.shadingInfo) + " \n");
            if (props.mask & __aspxRichEdit.TablePropertiesMask.UseTableAlignment)
                result.push(prefix + "tableRowAlignment: " + props.tableRowAlignment + "\n");
            result.push(prefix + "layoutType: " + __aspxRichEdit.TableLayoutType[props.layoutType]);
            return result.join("\n");
        };
        LogObjToStr.borderInfo = function (brd) {
            return "color: [" + LogObjToStr.colorModelInfo(brd.color) + "], width: " + brd.width + ", style: " + __aspxRichEdit.BorderLineStyle[brd.style];
        };
        LogObjToStr.colorModelInfo = function (color) {
            return color.toDebugString();
        };
        LogObjToStr.shadingInfo = function (shadingInfo) {
            return "backColor: " + shadingInfo.backColor + ", foreColor: " + shadingInfo.foreColor + ", shadingPattern: " + __aspxRichEdit.ShadingPattern[shadingInfo.shadingPattern];
        };
        LogObjToStr.tableCellMembers = function (cell, prefix) {
            if (prefix === void 0) { prefix = ""; }
            var result = [];
            result.push(prefix + "columnSpan: " + cell.columnSpan);
            result.push(prefix + "conditionalFormatting: " + Log.mask(__aspxRichEdit.ConditionalTableStyleFormatting, cell.conditionalFormatting));
            result.push(prefix + "startParagraphPosition: " + cell.startParagraphPosition.value);
            result.push(prefix + "endParagrapPosition: " + cell.endParagrapPosition.value);
            result.push(prefix + "verticalMerging: " + __aspxRichEdit.TableCellMergingState[cell.verticalMerging]);
            result.push(prefix + "preferredWidth: " + LogObjToStr.tableWidthUnit(cell.preferredWidth));
            return result.join("\n");
        };
        LogObjToStr.tableCellProperties = function (props, prefix) {
            if (prefix === void 0) { prefix = ""; }
            var result = [];
            result.push(prefix + "mask: " + Log.mask(__aspxRichEdit.TableCellPropertiesMask, props.mask));
            if (props.mask & __aspxRichEdit.TableCellPropertiesMask.UseTopBorder)
                result.push(prefix + "borders.topBorder: " + props.borders.topBorder);
            if (props.mask & __aspxRichEdit.TableCellPropertiesMask.UseRightBorder)
                result.push(prefix + "borders.rightBorder: " + props.borders.rightBorder);
            if (props.mask & __aspxRichEdit.TableCellPropertiesMask.UseBottomBorder)
                result.push(prefix + "borders.bottomBorder: " + props.borders.bottomBorder);
            if (props.mask & __aspxRichEdit.TableCellPropertiesMask.UseLeftBorder)
                result.push(prefix + "borders.leftBorder: " + props.borders.leftBorder);
            if (props.mask & __aspxRichEdit.TableCellPropertiesMask.UseTopLeftDiagonalBorder)
                result.push(prefix + "borders.topLeftDiagonalBorder: " + props.borders.topLeftDiagonalBorder);
            if (props.mask & __aspxRichEdit.TableCellPropertiesMask.UseTopRightDiagonalBorder)
                result.push(prefix + "borders.topRightDiagonalBorder: " + props.borders.topRightDiagonalBorder);
            if (props.mask & __aspxRichEdit.TableCellPropertiesMask.UseTopMargin)
                result.push(prefix + "cellMargins.top: " + LogObjToStr.tableWidthUnit(props.cellMargins.top));
            if (props.mask & __aspxRichEdit.TableCellPropertiesMask.UseRightMargin)
                result.push(prefix + "cellMargins.right: " + LogObjToStr.tableWidthUnit(props.cellMargins.right));
            if (props.mask & __aspxRichEdit.TableCellPropertiesMask.UseBottomMargin)
                result.push(prefix + "cellMargins.bottom: " + LogObjToStr.tableWidthUnit(props.cellMargins.bottom));
            if (props.mask & __aspxRichEdit.TableCellPropertiesMask.UseLeftMargin)
                result.push(prefix + "cellMargins.left: " + LogObjToStr.tableWidthUnit(props.cellMargins.left));
            if (props.mask & __aspxRichEdit.TableCellPropertiesMask.UseFitText)
                result.push(prefix + "fitText: " + props.fitText);
            if (props.mask & __aspxRichEdit.TableCellPropertiesMask.UseHideCellMark)
                result.push(prefix + "hideCellMark: " + props.hideCellMark);
            if (props.mask & __aspxRichEdit.TableCellPropertiesMask.UseNoWrap)
                result.push(prefix + "noWrap: " + props.noWrap);
            if (props.mask & __aspxRichEdit.TableCellPropertiesMask.UseShadingInfoIndex)
                result.push(prefix + "shadingInfo: " + LogObjToStr.shadingInfo(props.shadingInfo));
            if (props.mask & __aspxRichEdit.TableCellPropertiesMask.UseTextDirection)
                result.push(prefix + "textDirection: " + __aspxRichEdit.TextDirection[props.textDirection]);
            if (props.mask & __aspxRichEdit.TableCellPropertiesMask.UseVerticalAlignment)
                result.push(prefix + "verticalAlignment: " + __aspxRichEdit.TableCellVerticalAlignment[props.verticalAlignment]);
            return result.join("\n");
        };
        LogObjToStr.tableRowMembers = function (row, prefix) {
            if (prefix === void 0) { prefix = ""; }
            var result = [];
            result.push(prefix + "conditionalFormatting: " + Log.mask(__aspxRichEdit.ConditionalTableStyleFormatting, row.conditionalFormatting));
            result.push(prefix + "height: " + LogObjToStr.tableHeightUnit(row.height));
            result.push(prefix + "gridAfter: " + row.gridAfter);
            result.push(prefix + "gridBefore: " + row.gridBefore);
            result.push(prefix + "widthAfter: " + LogObjToStr.tableWidthUnit(row.widthAfter));
            result.push(prefix + "widthBefore: " + LogObjToStr.tableWidthUnit(row.widthBefore));
            return result.join("\n");
        };
        LogObjToStr.tableRowProperties = function (props, prefix) {
            if (prefix === void 0) { prefix = ""; }
            var result = [];
            result.push(prefix + "mask: " + Log.mask(__aspxRichEdit.TableRowPropertiesMask, props.mask));
            if (props.mask & __aspxRichEdit.TableRowPropertiesMask.UseCantSplit)
                result.push(prefix + "cantSplit: " + props.cantSplit);
            if (props.mask & __aspxRichEdit.TableRowPropertiesMask.UseCellSpacing)
                result.push(prefix + "cellSpacing: " + LogObjToStr.tableWidthUnit(props.cellSpacing));
            if (props.mask & __aspxRichEdit.TableRowPropertiesMask.UseHeader)
                result.push(prefix + "header: " + props.header);
            if (props.mask & __aspxRichEdit.TableRowPropertiesMask.UseHideCellMark)
                result.push(prefix + "hideCellMark: " + props.hideCellMark);
            if (props.mask & __aspxRichEdit.TableRowPropertiesMask.UseTableRowAlignment)
                result.push(prefix + "tableRowAlignment: " + __aspxRichEdit.TableRowAlignment[props.tableRowAlignment]);
            return result.join("\n");
        };
        LogObjToStr.tableConditionalStyle = function (style, prefix) {
            if (prefix === void 0) { prefix = ""; }
            var prefixNext = prefix + "\t";
            var result = [];
            result.push(prefix + "tableProperties:\n" + LogObjToStr.tableProperties(style.tableProperties, prefixNext));
            result.push(prefix + "tableRowProperties:\n" + LogObjToStr.tableRowProperties(style.tableRowProperties, prefixNext));
            result.push(prefix + "tableCellProperties:\n" + LogObjToStr.tableCellProperties(style.tableCellProperties, prefixNext));
            return result.join("\n");
        };
        LogObjToStr.tableStyle = function (style, prefix) {
            if (prefix === void 0) { prefix = ""; }
            var prefixNext = prefix + "\t";
            var listOfActualCondStyles = [];
            for (var _i = 0, _a = __aspxRichEdit.TableCellPropertiesMerger.conditionalTableStyleFormattingPriority; _i < _a.length; _i++) {
                var styleFlag = _a[_i];
                if (style.conditionalStyles[styleFlag])
                    listOfActualCondStyles.push(styleFlag);
            }
            var condStylesHandler = function (styleFlag) {
                return "" + prefix + __aspxRichEdit.ConditionalTableStyleFormatting[styleFlag] + ":\n" + LogObjToStr.tableConditionalStyle(style.conditionalStyles[styleFlag], prefixNext);
            };
            var result = [];
            result.push(prefix + "name: " + style.styleName);
            result.push(prefix + "isDefault: " + style.isDefault);
            result.push(prefix + "hidden: " + style.hidden);
            result.push("" + Log.map(condStylesHandler, listOfActualCondStyles).join("\n"));
            if (style.parent)
                result.push("" + LogObjToStr.tableStyle(style.parent, prefix));
            return result.join("\n");
        };
        LogObjToStr.layoutChangeBase = function (obj, prefix, sep) {
            if (prefix === void 0) { prefix = ""; }
            if (sep === void 0) { sep = "\t"; }
            var result = [];
            result.push(prefix + "index: " + obj.index);
            result.push("type: " + __aspxRichEdit.LayoutChangeType[obj.changeType]);
            return result.join(sep);
        };
        LogObjToStr.pageSelectionChange = function (change, prefix) {
            if (prefix === void 0) { prefix = ""; }
            var prefix_1 = prefix + "\t";
            var prefix_2 = prefix_1 + "\t";
            var changeHandler = function (change, index) { return prefix_1 + "areaSelectionChange[" + index + "]:\n" + LogObjToStr.areaSelectionChange(change, prefix_2); };
            var result = [];
            result.push(LogObjToStr.layoutChangeBase(change, prefix));
            result.push(prefix + "pageSelectionChange:\n" + Log.join("\n", Log.map(changeHandler, change.areaChanges)));
            return result.join("\n");
        };
        LogObjToStr.areaSelectionChange = function (change, prefix) {
            if (prefix === void 0) { prefix = ""; }
            var result = [];
            result.push(LogObjToStr.layoutChangeBase(change, prefix, ",\t"));
            result.push(LogObjToStr.rectangle(change.selection, prefix, ",\t"));
            return result.join(",\t");
        };
        LogObjToStr.rectangle = function (r, prefix, sep) {
            if (prefix === void 0) { prefix = ""; }
            if (sep === void 0) { sep = "\t"; }
            var result = [];
            result.push(prefix + "x: " + r.x);
            result.push(prefix + "y: " + r.y);
            result.push(prefix + "width: " + r.width);
            result.push(prefix + "height: " + r.height);
            return result.join(sep);
        };
        LogObjToStr.pageChange = function (pageChange, prefix) {
            if (prefix === void 0) { prefix = ""; }
            var prefix_1 = prefix + "\t";
            var prefix_2 = prefix_1 + "\t";
            var pageAreaChangeHandler = function (change, index) { return prefix_1 + "pageAreaChange[" + index + "]:\n" + LogObjToStr.pageAreaChange(change, prefix_2); };
            var ancPicChangeHandler = function (change, index) { return prefix_1 + "pictureFloatingChange[" + index + "]:\n" + LogObjToStr.anchoredPictureChange(change, prefix_2); };
            var result = [];
            result.push(LogObjToStr.layoutChangeBase(pageChange, prefix));
            result.push(prefix + "mainPageAreaChanges:\n" + Log.join("\n", Log.map(pageAreaChangeHandler, pageChange.mainPageAreaChanges)));
            result.push(prefix + "otherPageAreaChanges:\n" + Log.join("\n", Log.map(pageAreaChangeHandler, pageChange.otherPageAreaChanges)));
            result.push(prefix + "floatingPictureChanges:\n" + Log.join("\n", Log.map(ancPicChangeHandler, pageChange.anchoredPictureChanges)));
            return result.join("\n");
        };
        LogObjToStr.pageAreaChange = function (pageAreaChange, prefix) {
            if (prefix === void 0) { prefix = ""; }
            var prefix_1 = prefix + "\t";
            var prefix_2 = prefix_1 + "\t";
            var columnChangeHandler = function (change, index) { return prefix_1 + "columnChange[" + index + "]:\n" + LogObjToStr.columnChange(change, prefix_2); };
            var result = [];
            result.push(LogObjToStr.layoutChangeBase(pageAreaChange, prefix));
            result.push(prefix + "columnChanges:\n" + Log.join("\n", Log.map(columnChangeHandler, pageAreaChange.columnChanges)));
            return result.join("\n");
        };
        LogObjToStr.anchoredPictureChange = function (change, prefix) {
            if (prefix === void 0) { prefix = ""; }
            var result = [];
            result.push(LogObjToStr.layoutChangeBase(change, prefix));
            result.push(prefix + "objectId: " + change.index);
            return result.join("\n");
        };
        LogObjToStr.columnChange = function (columnChange, prefix) {
            if (prefix === void 0) { prefix = ""; }
            var prefix_1 = prefix + "\t";
            var customChangeHandler = function (_name, handler, change, index) { return prefix_1 + "[" + index + "]:\t" + handler(change, ""); };
            var changesData = [
                { name: "rowChange", getChange: function (cc) { return cc.rowChanges; }, handler: LogObjToStr.rowChange },
                { name: "paragraphFrameChange", getChange: function (cc) { return cc.paragraphFrameChanges; }, handler: LogObjToStr.paragraphFrameChange },
                { name: "tableChange", getChange: function (cc) { return cc.tableChanges; }, handler: LogObjToStr.tableChange }
            ];
            var result = [];
            result.push(LogObjToStr.layoutChangeBase(columnChange, prefix));
            for (var _i = 0, changesData_1 = changesData; _i < changesData_1.length; _i++) {
                var data = changesData_1[_i];
                result.push("" + prefix + data.name + "s:\n" + Log.join("\n", Log.map(Log.w(4, customChangeHandler)(data.name)(data.handler), data.getChange(columnChange))));
            }
            return result.join("\n");
        };
        LogObjToStr.rowChange = function (rowChange, prefix) {
            if (prefix === void 0) { prefix = ""; }
            return LogObjToStr.layoutChangeBase(rowChange, prefix);
        };
        LogObjToStr.paragraphFrameChange = function (paragraphFrameChange, prefix) {
            if (prefix === void 0) { prefix = ""; }
            var result = [];
            result.push(LogObjToStr.layoutChangeBase(paragraphFrameChange, prefix));
            return result.join("\t");
        };
        LogObjToStr.tableChange = function (tableChange, prefix) {
            if (prefix === void 0) { prefix = ""; }
            return LogObjToStr.layoutChangeBase(tableChange, prefix);
        };
        LogObjToStr.historyItemListLevelStateObject = function (obj, prefix, sep) {
            if (prefix === void 0) { prefix = ""; }
            if (sep === void 0) { sep = "\t"; }
            var result = [];
            result.push(prefix + "value: " + obj.value);
            result.push(prefix + "listLevelIndex: " + obj.listLevelIndex);
            result.push(prefix + "numberingListIndex: " + obj.numberingListIndex);
            result.push(prefix + "isAbstractNumberingList: " + obj.isAbstractNumberingList);
            return result.join(sep);
        };
        LogObjToStr.historyItemTableStateObject = function (obj, prefix, sep) {
            if (prefix === void 0) { prefix = ""; }
            if (sep === void 0) { sep = "\t"; }
            var result = [];
            result.push(prefix + "value: " + obj.value);
            result.push(prefix + "value: " + obj.tableIndex);
            result.push(prefix + "value: " + obj.tableNestedLevel);
            result.push(prefix + "value: " + obj.tableStartPosition);
            return result.join(sep);
        };
        LogObjToStr.historyItemTableRowStateObject = function (obj, prefix, sep) {
            if (prefix === void 0) { prefix = ""; }
            if (sep === void 0) { sep = "\t"; }
            var result = [];
            result.push(prefix + "value: " + obj.value);
            result.push(prefix + "value: " + obj.tableIndex);
            result.push(prefix + "value: " + obj.tableNestedLevel);
            result.push(prefix + "value: " + obj.tableStartPosition);
            result.push(prefix + "value: " + obj.rowIndex);
            return result.join(sep);
        };
        LogObjToStr.historyItemTableCellStateObject = function (obj, prefix, sep) {
            if (prefix === void 0) { prefix = ""; }
            if (sep === void 0) { sep = "\t"; }
            var result = [];
            result.push(prefix + "value: " + obj.value);
            result.push(prefix + "value: " + obj.tableIndex);
            result.push(prefix + "value: " + obj.tableNestedLevel);
            result.push(prefix + "value: " + obj.tableStartPosition);
            result.push(prefix + "value: " + obj.rowIndex);
            result.push(prefix + "value: " + obj.cellIndex);
            return result.join(sep);
        };
        LogObjToStr.historyItemIntervalStateObject = function (obj, prefix, sep) {
            if (prefix === void 0) { prefix = ""; }
            if (sep === void 0) { sep = "\t"; }
            var result = [];
            result.push(prefix + "value: " + obj.value);
            result.push(prefix + "interval: " + LogObjToStr.fixedInterval(obj.interval));
            return result.join(sep);
        };
        LogObjToStr.updatedImagesInfo = function (info, prefix, sep) {
            if (prefix === void 0) { prefix = ""; }
            if (sep === void 0) { sep = "\t"; }
            var result = [];
            result.push(prefix + "id: " + info.id);
            result.push(prefix + "position: " + info.position);
            result.push(prefix + "scaleX: " + info.scaleX);
            result.push(prefix + "scaleY: " + info.scaleY);
            return result.join(sep);
        };
        LogObjToStr.imagesInfo = function (info, prefix, sep) {
            if (prefix === void 0) { prefix = ""; }
            if (sep === void 0) { sep = "\t"; }
            var result = [];
            result.push(prefix + "guid: " + info.guid);
            result.push(prefix + "position: " + info.position);
            result.push(prefix + "scaleX: " + info.scaleX);
            result.push(prefix + "scaleY: " + info.scaleY);
            result.push(prefix + "sourceUrl: " + info.sourceUrl);
            return result.join(sep);
        };
        LogObjToStr.historyItemBookmarkStateObject = function (obj, prefix, sep) {
            if (prefix === void 0) { prefix = ""; }
            if (sep === void 0) { sep = "\t"; }
            var result = [];
            result.push(prefix + "value: " + obj.value);
            result.push(prefix + "name: " + obj.bkmTempate.name);
            result.push(prefix + "start: " + obj.bkmTempate.start);
            result.push(prefix + "end: " + obj.bkmTempate.end);
            result.push(prefix + "deleted: " + obj.deleted);
            return result.join(sep);
        };
        LogObjToStr.historyItemSectionStateObject = function (obj, prefix, sep) {
            if (prefix === void 0) { prefix = ""; }
            if (sep === void 0) { sep = "\t"; }
            var result = [];
            result.push(prefix + "value: " + obj.value);
            result.push(prefix + "sectionIndex: " + obj.sectionIndex);
            return result.join(sep);
        };
        LogObjToStr.historyItemState = function (handler, obj, prefix, sep) {
            if (prefix === void 0) { prefix = "\t"; }
            if (sep === void 0) { sep = "\n"; }
            return LogListHelper.level_1(Log.w(3, Log.flip(Log.flip(handler, 0, 1), 1, 2))("", ", "), obj.objects, prefix, sep);
        };
        LogObjToStr.hyperlinkInfo = function (info, prefix, sep) {
            if (prefix === void 0) { prefix = ""; }
            if (sep === void 0) { sep = "\t"; }
            var result = [];
            if (info) {
                result.push(prefix + "uri: " + info.uri);
                result.push(prefix + "tip: " + info.tip);
                result.push(prefix + "anchor: " + info.anchor);
                result.push(prefix + "visited: " + info.visited);
            }
            return result.join(sep);
        };
        LogObjToStr.subDocumentInfoBase = function (info, prefix, sep) {
            if (prefix === void 0) { prefix = ""; }
            if (sep === void 0) { sep = "\t"; }
            var result = [];
            result.push(prefix + "subDocumentId: " + info.subDocumentId);
            result.push(prefix + "getType(): " + __aspxRichEdit.SubDocumentInfoType[info.getType()]);
            return result.join(sep);
        };
        LogObjToStr.headerFooterSubDocumentInfoBase = function (info, prefix, sep) {
            if (prefix === void 0) { prefix = ""; }
            if (sep === void 0) { sep = "\t"; }
            var result = [];
            result.push(LogObjToStr.subDocumentInfoBase(info, prefix, sep));
            result.push(prefix + "headerFooterType: " + __aspxRichEdit.HeaderFooterType[info.headerFooterType]);
            return result.join(sep);
        };
        LogObjToStr.historyItemListLevelUseStateObject = function (obj, prefix, sep) {
            if (prefix === void 0) { prefix = ""; }
            if (sep === void 0) { sep = "\t"; }
            var result = [];
            result.push(LogObjToStr.historyItemListLevelStateObject(obj, prefix, sep));
            result.push(prefix + "use: " + obj.use);
            return result.join(sep);
        };
        LogObjToStr.historyItemIntervalState = function (handler, obj, prefix, sep) {
            if (prefix === void 0) { prefix = "\t"; }
            if (sep === void 0) { sep = "\n"; }
            var result = [];
            result.push(LogObjToStr.historyItemState(handler, obj, prefix, sep)());
            result.push(prefix + "interval: " + LogObjToStr.fixedInterval(obj.interval));
            return function () { return result.join(sep); };
        };
        LogObjToStr.layoutTableColumnInfo = function (obj, prefix, sep) {
            if (prefix === void 0) { prefix = ""; }
            if (sep === void 0) { sep = "\t"; }
            var prefix_1 = prefix + "\t";
            var result = [];
            result.push(prefix + "TableIndex: " + obj.logicInfo.grid.table.index);
            result.push(prefix + "NestedLevel: " + obj.logicInfo.grid.table.nestedLevel);
            result.push(prefix + "ParentTableIndex: " + (obj.parentCell ? obj.parentCell.parentRow.parentTable.logicInfo.grid.table.index : ""));
            result.push(prefix + "NumRows: " + obj.tableRows.length);
            result.push(prefix + "Rows:\n" + __aspxRichEdit.ListUtils.map(obj.tableRows, function (row) { return LogObjToStr.layoutTableRowInfo(row, prefix_1, sep); }).join("\n"));
            return result.join(sep);
        };
        LogObjToStr.layoutTableRowInfo = function (obj, prefix, sep) {
            if (prefix === void 0) { prefix = ""; }
            if (sep === void 0) { sep = "\t"; }
            var prefix_1 = prefix + "\t";
            var result = [];
            result.push(prefix + "RowIndex: " + obj.rowIndex);
            result.push(prefix + "NumCells: " + obj.rowCells.length);
            result.push(prefix + "Cells:\n" + __aspxRichEdit.ListUtils.map(obj.rowCells, function (cell) { return LogObjToStr.layoutTableCellInfo(cell, prefix_1, sep); }).join("\n\n"));
            return result.join(sep);
        };
        LogObjToStr.layoutTableCellInfo = function (obj, prefix, sep) {
            if (prefix === void 0) { prefix = ""; }
            if (sep === void 0) { sep = "\t"; }
            var result = [];
            result.push(prefix + "CellGridIndex: " + obj.cellGridIndex);
            result.push(prefix + "Flags: " + Log.mask(__aspxRichEdit.TableCellBoundFlags, obj.boundFlags.getValue(), __aspxRichEdit.TableCellBoundFlags.StartAndEndOnOtherColumns));
            result.push(prefix + "InternalTablesIndexes: " + __aspxRichEdit.MapUtilsKeyAsNumber.toListBy(obj.internalTables, function (tbl) { return tbl.logicInfo.grid.table.index.toString(); }).join(" "));
            result.push(prefix + "NumLayoutRows: " + obj.layoutRows.length);
            result.push(prefix + "CellText: " + __aspxRichEdit.ListUtils.map(obj.layoutRows, function (layoutRow) {
                return __aspxRichEdit.ListUtils.reducedMap(layoutRow.boxes, function (box) { return box.getType() == __aspxRichEdit.LayoutBoxType.Text ? box.text : "¶"; }).join("");
            }).join(""));
            return result.join(sep);
        };
        return LogObjToStr;
    }());
    __aspxRichEdit.LogObjToStr = LogObjToStr;
    var LogListHelper = (function () {
        function LogListHelper() {
        }
        LogListHelper.level_1 = function (handler, list, prefix, sep) {
            if (prefix === void 0) { prefix = ""; }
            if (sep === void 0) { sep = "\n"; }
            var addSuffix = function (val, index) { return prefix + "[" + index + "]=" + handler(val); };
            return Log.w(3, Log.join)(sep)(Log.map(addSuffix, list));
        };
        LogListHelper.level_2 = function (handlerLevel_1, handlerLevel_2, list, prefix) {
            if (prefix === void 0) { prefix = ""; }
            var addSuffix = function (index_1, val, index_2) { return "[" + index_1 + "][" + index_2 + "]=" + handlerLevel_2(val); };
            var levelOneHandler = function (el, ind) { return "" + prefix + Log.join(Log.splitBy, Log.map(Log.w(3, addSuffix)(ind), handlerLevel_1(el))); };
            return Log.w(3, Log.join)("\n")(Log.map(levelOneHandler, list));
        };
        return LogListHelper;
    }());
    __aspxRichEdit.LogListHelper = LogListHelper;
    var PageVisibleInfoHelper = (function () {
        function PageVisibleInfoHelper() {
        }
        PageVisibleInfoHelper.showPageVisibleInfoElement = function (cache, getText, pageIndex) {
            PageVisibleInfoHelper.createAtLeast(pageIndex);
            var currElement = PageVisibleInfoHelper.pageVisibleInfoElements[pageIndex];
            currElement.innerHTML = getText();
            __aspxRichEdit.HTMLUtils.hideNode(currElement);
            __aspxRichEdit.DocumentRenderer.getServiceContainerCore(cache[pageIndex].page).appendChild(currElement);
        };
        PageVisibleInfoHelper.hidePageVisibleInfoElement = function (pageIndex) {
            var element = PageVisibleInfoHelper.pageVisibleInfoElements[pageIndex];
            if (element) {
                PageVisibleInfoHelper.pageVisibleInfoElements.splice(pageIndex, 1);
                __aspxRichEdit.HTMLUtils.hideNode(element);
            }
        };
        PageVisibleInfoHelper.createAtLeast = function (n) {
            while (PageVisibleInfoHelper.pageVisibleInfoElements.length <= n)
                PageVisibleInfoHelper.pageVisibleInfoElements.push(PageVisibleInfoHelper.createPageVisibleInfoElement());
        };
        PageVisibleInfoHelper.createPageVisibleInfoElement = function () {
            var element = __aspxRichEdit.DocumentRenderer.renderContainer("dxre-debug-page-visible-info-element");
            element.style.left = "5px";
            element.style.top = "5px";
            element.style.width = "150px";
            element.style.height = "50px";
            element.style.zIndex = "100";
            return element;
        };
        PageVisibleInfoHelper.pageVisibleInfoElements = [];
        return PageVisibleInfoHelper;
    }());
    __aspxRichEdit.PageVisibleInfoHelper = PageVisibleInfoHelper;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var BatchUpdatableObject = (function () {
        function BatchUpdatableObject() {
            this.suspendUpdateCount = 0;
            this.occurredEvents = 0;
        }
        BatchUpdatableObject.prototype.beginUpdate = function () {
            if (this.suspendUpdateCount === 0)
                this.onUpdateLocked();
            if (this.suspendUpdateCount < 0)
                this.suspendUpdateCount--;
            else
                this.suspendUpdateCount++;
        };
        BatchUpdatableObject.prototype.endUpdate = function () {
            if (this.suspendUpdateCount < 0)
                this.suspendUpdateCount++;
            else if (this.suspendUpdateCount > 0)
                this.suspendUpdateCount--;
            if (!this.isUpdateLocked()) {
                var occurredEvents = this.occurredEvents;
                this.occurredEvents = 0;
                this.onUpdateUnlocked(occurredEvents);
            }
        };
        BatchUpdatableObject.prototype.suspendUpdate = function () {
            if (this.suspendUpdateCount > 0) {
                this.suspendUpdateCount *= -1;
                var occurredEvents = this.occurredEvents;
                this.occurredEvents = 0;
                this.onUpdateUnlocked(occurredEvents);
            }
        };
        BatchUpdatableObject.prototype.continueUpdate = function () {
            if (this.suspendUpdateCount < 0)
                this.suspendUpdateCount *= -1;
        };
        BatchUpdatableObject.prototype.isUpdateLocked = function () {
            return this.suspendUpdateCount > 0;
        };
        BatchUpdatableObject.prototype.onUpdateLocked = function () { };
        BatchUpdatableObject.prototype.registerOccurredEvent = function (eventMask) {
            this.occurredEvents |= eventMask;
        };
        BatchUpdatableObject.prototype.isLocked = function () {
            return this.suspendUpdateCount != 0;
        };
        return BatchUpdatableObject;
    }());
    __aspxRichEdit.BatchUpdatableObject = BatchUpdatableObject;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var BaseFormatter = (function () {
            function BaseFormatter() {
            }
            BaseFormatter.addToFormattersList = function (formatter) {
                BaseFormatter.formattersList.push(formatter);
            };
            BaseFormatter.prototype.availableFullDescription = function (_config) {
                return false;
            };
            BaseFormatter.prototype.getFullDescription = function (_config) {
                return null;
            };
            BaseFormatter.prototype.header = function (obj, config) {
                if (!this.isHandleObject(obj) || config && !config.useCustomFormatter)
                    return null;
                this.curr = obj;
                return this.getShortDescription(config).toList();
            };
            BaseFormatter.prototype.hasBody = function (obj, config) {
                this.curr = obj;
                return this.availableFullDescription(config);
            };
            BaseFormatter.prototype.body = function (obj, config) {
                this.curr = obj;
                var domObj = this.getFullDescription(config);
                return domObj ? domObj.toList() : null;
            };
            BaseFormatter.prototype.toFixed = function (val, numDigitsAfterPoint) {
                if (numDigitsAfterPoint === void 0) { numDigitsAfterPoint = 2; }
                if (val === null)
                    return "null";
                if (val === undefined)
                    return "undefined";
                var str = val.toFixed(numDigitsAfterPoint);
                var len = str.length;
                return str.substr(len - 2) == "00" ? str.substring(0, len - 3) : str;
            };
            BaseFormatter.prototype.stdShow = function (props) {
                var rowElement = new ChromeCustomFormatters.DivElement();
                if (props._onLine && props._openChar.length)
                    rowElement.setNode(new ChromeCustomFormatters.SpanElement().setText(props._openChar));
                __aspxRichEdit.ListUtils.foreach(props._list, function (prop) {
                    var node = new ChromeCustomFormatters.DivElement()
                        .setStyle("margin: 0px 5px")
                        .setStyle("padding: 0px 2px");
                    if (prop.first.length)
                        node.setNode(new ChromeCustomFormatters.SpanElement().setText(prop.first + ": ")
                            .setStyle("font-weight: bold")
                            .setStyle("color: " + BaseFormatter.paramNameColor));
                    if (props._onLine)
                        node.setStyle("display: inline-block");
                    if (typeof prop.second == "object") {
                        if (prop.second instanceof ChromeCustomFormatters.BaseElement)
                            node.setNode(prop.second);
                        else
                            node.setNode(new ChromeCustomFormatters.ObjectElement().setObjectData(prop.second, null));
                    }
                    else {
                        node.setNode(new ChromeCustomFormatters.SpanElement().setText("" + (prop.second === null || prop.second === undefined ? "null" : prop.second))
                            .setStyle("color: " + BaseFormatter.valueColor));
                    }
                    rowElement.setNode(node);
                }, 0, props._numElements);
                if (props.isShowNotAllElements())
                    rowElement.setNode(new ChromeCustomFormatters.SpanElement().setText("..."));
                if (props._onLine && props._closeChar.length)
                    rowElement.setNode(new ChromeCustomFormatters.SpanElement().setText(props._closeChar));
                return rowElement;
            };
            BaseFormatter.prototype.mapNumberAsKeyToListOfPairs = function (map, getSortVal, makePair) {
                return __aspxRichEdit.ListUtils.map(__aspxRichEdit.MapUtilsKeyAsNumber.toListBy(map, function (obj, key) { return [key, obj]; })
                    .sort(function (a, b) { return getSortVal(a[0], a[1]) - getSortVal(b[0], b[1]); }), function (obj) { return makePair(obj[0], obj[1]); });
            };
            BaseFormatter.getColorBoxNode = function (color) {
                return new ChromeCustomFormatters.DivElement()
                    .setStyle("display: inline-block")
                    .setStyle("background-color:" + __aspxRichEdit.ColorHelper.getCssString(color, false))
                    .setStyle("width: 10px")
                    .setStyle("height: 10px")
                    .setStyle("border: 1px solid black");
            };
            BaseFormatter.prototype.getPictureNode = function (picId, obj) {
                var url = this.handlerURI + "&img=" + picId;
                var elem = new ChromeCustomFormatters.DivElement().setStyle("background-image:url(" + url + ")");
                if (obj)
                    elem.setStyle("width:" + obj.width + "px").setStyle("height:" + obj.height + "px");
                return elem;
            };
            BaseFormatter.prototype.makeTableCellNode = function (propName, val) {
                return new ChromeCustomFormatters.TrElement()
                    .setNode(new ChromeCustomFormatters.TdElement().setText(propName + ":"))
                    .setNode(new ChromeCustomFormatters.TdElement().setText("" + val));
            };
            Object.defineProperty(BaseFormatter.prototype, "handlerURI", {
                get: function () {
                    return (BaseFormatter.rich.viewManager).handlerURI;
                },
                enumerable: true,
                configurable: true
            });
            Object.defineProperty(BaseFormatter.prototype, "model", {
                get: function () {
                    return BaseFormatter.rich.model;
                },
                enumerable: true,
                configurable: true
            });
            BaseFormatter.prototype.getSubDocumentText = function (subDocId, interval) {
                if (interval === void 0) { interval = null; }
                var subDoc = this.model.subDocuments[subDocId];
                if (!interval)
                    interval = new __aspxRichEdit.FixedInterval(0, subDoc.getDocumentEndPosition());
                var text = subDoc.getText(interval);
                return this.getRawText(text);
            };
            BaseFormatter.prototype.getRawText = function (text) {
                text = text.replace(new RegExp(__aspxRichEdit.RichUtils.specialCharacters.ParagraphMark, "g"), "¶");
                return new ChromeCustomFormatters.ShortString(text);
            };
            BaseFormatter.stringColor = "rgb(196,26,22)";
            BaseFormatter.paramNameColor = "rgb(176,98,182)";
            BaseFormatter.valueColor = "rgb(70,47,216)";
            BaseFormatter.blackColor = "rgb(0,0,0)";
            BaseFormatter.formattersList = [];
            return BaseFormatter;
        }());
        ChromeCustomFormatters.BaseFormatter = BaseFormatter;
        var StdProps = (function () {
            function StdProps(list) {
                this._onLine = true;
                this._list = list;
                this._numElements = list.length;
                this._openChar = "{";
                this._closeChar = "}";
            }
            StdProps.prototype.setNumElements = function (val) {
                this._numElements = val;
                return this;
            };
            StdProps.prototype.setStdNumElements = function () {
                return this.setNumElements(Math.min(this._list.length, StdProps.STD_NUM_ELEMENTS));
            };
            StdProps.prototype.showAsLine = function () {
                this._onLine = true;
                return this;
            };
            StdProps.prototype.showAsColumn = function () {
                this._onLine = false;
                return this;
            };
            StdProps.prototype.setBoundChars = function (openChar, closeChar) {
                this._openChar = openChar;
                this._closeChar = closeChar;
                return this;
            };
            StdProps.prototype.isShowNotAllElements = function () {
                return this._numElements < this._list.length;
            };
            StdProps.STD_NUM_ELEMENTS = 3;
            return StdProps;
        }());
        ChromeCustomFormatters.StdProps = StdProps;
        var Config = (function () {
            function Config() {
            }
            Config.prototype.getProp = function (getter, defaultVal) {
                var val = getter();
                if (val === undefined)
                    return defaultVal;
                return val;
            };
            Object.defineProperty(Config.prototype, "useCustomFormatter", {
                get: function () {
                    var _this = this;
                    return this.getProp(function () { return _this.aspxRichEditConfig_useCustomFormatter; }, true);
                },
                set: function (val) { this.aspxRichEditConfig_useCustomFormatter = val; },
                enumerable: true,
                configurable: true
            });
            Config.useCustomFormatter = function (val, config) {
                if (config === void 0) { config = new Config; }
                config.useCustomFormatter = val;
                return config;
            };
            return Config;
        }());
        ChromeCustomFormatters.Config = Config;
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ColorType;
    (function (ColorType) {
        ColorType[ColorType["Rgb"] = 0] = "Rgb";
        ColorType[ColorType["Theme"] = 1] = "Theme";
        ColorType[ColorType["Index"] = 2] = "Index";
        ColorType[ColorType["Auto"] = 3] = "Auto";
    })(ColorType = __aspxRichEdit.ColorType || (__aspxRichEdit.ColorType = {}));
    var ThemeColorIndexConstants = (function () {
        function ThemeColorIndexConstants() {
        }
        ThemeColorIndexConstants.None = -1;
        ThemeColorIndexConstants.Light1 = 0;
        ThemeColorIndexConstants.Dark1 = 1;
        ThemeColorIndexConstants.Light2 = 2;
        ThemeColorIndexConstants.Dark2 = 3;
        ThemeColorIndexConstants.Accent1 = 4;
        ThemeColorIndexConstants.Accent2 = 5;
        ThemeColorIndexConstants.Accent3 = 6;
        ThemeColorIndexConstants.Accent4 = 7;
        ThemeColorIndexConstants.Accent5 = 8;
        ThemeColorIndexConstants.Accent6 = 9;
        ThemeColorIndexConstants.Hyperlink = 10;
        ThemeColorIndexConstants.FollowedHyperlink = 11;
        return ThemeColorIndexConstants;
    }());
    __aspxRichEdit.ThemeColorIndexConstants = ThemeColorIndexConstants;
    var DrawingColorType;
    (function (DrawingColorType) {
        DrawingColorType[DrawingColorType["Rgb"] = 0] = "Rgb";
        DrawingColorType[DrawingColorType["System"] = 1] = "System";
        DrawingColorType[DrawingColorType["Scheme"] = 2] = "Scheme";
        DrawingColorType[DrawingColorType["Preset"] = 3] = "Preset";
        DrawingColorType[DrawingColorType["ScRgb"] = 4] = "ScRgb";
        DrawingColorType[DrawingColorType["Hsl"] = 5] = "Hsl";
    })(DrawingColorType = __aspxRichEdit.DrawingColorType || (__aspxRichEdit.DrawingColorType = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SchemeColorValues;
    (function (SchemeColorValues) {
        SchemeColorValues[SchemeColorValues["Accent1"] = 0] = "Accent1";
        SchemeColorValues[SchemeColorValues["Accent2"] = 1] = "Accent2";
        SchemeColorValues[SchemeColorValues["Accent3"] = 2] = "Accent3";
        SchemeColorValues[SchemeColorValues["Accent4"] = 3] = "Accent4";
        SchemeColorValues[SchemeColorValues["Accent5"] = 4] = "Accent5";
        SchemeColorValues[SchemeColorValues["Accent6"] = 5] = "Accent6";
        SchemeColorValues[SchemeColorValues["Background1"] = 6] = "Background1";
        SchemeColorValues[SchemeColorValues["Background2"] = 7] = "Background2";
        SchemeColorValues[SchemeColorValues["Dark1"] = 8] = "Dark1";
        SchemeColorValues[SchemeColorValues["Dark2"] = 9] = "Dark2";
        SchemeColorValues[SchemeColorValues["FollowedHyperlink"] = 10] = "FollowedHyperlink";
        SchemeColorValues[SchemeColorValues["Hyperlink"] = 11] = "Hyperlink";
        SchemeColorValues[SchemeColorValues["Light1"] = 12] = "Light1";
        SchemeColorValues[SchemeColorValues["Light2"] = 13] = "Light2";
        SchemeColorValues[SchemeColorValues["Style"] = 14] = "Style";
        SchemeColorValues[SchemeColorValues["Text1"] = 15] = "Text1";
        SchemeColorValues[SchemeColorValues["Text2"] = 16] = "Text2";
        SchemeColorValues[SchemeColorValues["Empty"] = 17] = "Empty";
    })(SchemeColorValues = __aspxRichEdit.SchemeColorValues || (__aspxRichEdit.SchemeColorValues = {}));
    var SystemColorValues;
    (function (SystemColorValues) {
        SystemColorValues[SystemColorValues["Sc3dDkShadow"] = 20] = "Sc3dDkShadow";
        SystemColorValues[SystemColorValues["Sc3dLight"] = 19] = "Sc3dLight";
        SystemColorValues[SystemColorValues["ScActiveBorder"] = 21] = "ScActiveBorder";
        SystemColorValues[SystemColorValues["ScActiveCaption"] = 6] = "ScActiveCaption";
        SystemColorValues[SystemColorValues["ScAppWorkspace"] = 24] = "ScAppWorkspace";
        SystemColorValues[SystemColorValues["ScBackground"] = 23] = "ScBackground";
        SystemColorValues[SystemColorValues["ScBtnFace"] = 0] = "ScBtnFace";
        SystemColorValues[SystemColorValues["ScBtnHighlight"] = 7] = "ScBtnHighlight";
        SystemColorValues[SystemColorValues["ScBtnShadow"] = 8] = "ScBtnShadow";
        SystemColorValues[SystemColorValues["ScBtnText"] = 9] = "ScBtnText";
        SystemColorValues[SystemColorValues["ScCaptionText"] = 5] = "ScCaptionText";
        SystemColorValues[SystemColorValues["ScGradientActiveCaption"] = -2] = "ScGradientActiveCaption";
        SystemColorValues[SystemColorValues["ScGradientInactiveCaption"] = -3] = "ScGradientInactiveCaption";
        SystemColorValues[SystemColorValues["ScGrayText"] = 10] = "ScGrayText";
        SystemColorValues[SystemColorValues["ScHighlight"] = 3] = "ScHighlight";
        SystemColorValues[SystemColorValues["ScHighlightText"] = 4] = "ScHighlightText";
        SystemColorValues[SystemColorValues["ScHotLight"] = -4] = "ScHotLight";
        SystemColorValues[SystemColorValues["ScInactiveBorder"] = 22] = "ScInactiveBorder";
        SystemColorValues[SystemColorValues["ScInactiveCaption"] = 11] = "ScInactiveCaption";
        SystemColorValues[SystemColorValues["ScInactiveCaptionText"] = 12] = "ScInactiveCaptionText";
        SystemColorValues[SystemColorValues["ScInfoBk"] = 13] = "ScInfoBk";
        SystemColorValues[SystemColorValues["ScInfoText"] = 14] = "ScInfoText";
        SystemColorValues[SystemColorValues["ScMenu"] = 2] = "ScMenu";
        SystemColorValues[SystemColorValues["ScMenuBar"] = -5] = "ScMenuBar";
        SystemColorValues[SystemColorValues["ScMenuHighlight"] = -6] = "ScMenuHighlight";
        SystemColorValues[SystemColorValues["ScMenuText"] = 15] = "ScMenuText";
        SystemColorValues[SystemColorValues["ScScrollBar"] = 16] = "ScScrollBar";
        SystemColorValues[SystemColorValues["ScWindow"] = 17] = "ScWindow";
        SystemColorValues[SystemColorValues["ScWindowFrame"] = 18] = "ScWindowFrame";
        SystemColorValues[SystemColorValues["ScWindowText"] = 1] = "ScWindowText";
        SystemColorValues[SystemColorValues["Empty"] = -1] = "Empty";
    })(SystemColorValues = __aspxRichEdit.SystemColorValues || (__aspxRichEdit.SystemColorValues = {}));
    var XlFontSchemeStyles;
    (function (XlFontSchemeStyles) {
        XlFontSchemeStyles[XlFontSchemeStyles["None"] = 0] = "None";
        XlFontSchemeStyles[XlFontSchemeStyles["Minor"] = 1] = "Minor";
        XlFontSchemeStyles[XlFontSchemeStyles["Major"] = 2] = "Major";
    })(XlFontSchemeStyles = __aspxRichEdit.XlFontSchemeStyles || (__aspxRichEdit.XlFontSchemeStyles = {}));
    var StyleMatrixElementType;
    (function (StyleMatrixElementType) {
        StyleMatrixElementType[StyleMatrixElementType["None"] = 0] = "None";
        StyleMatrixElementType[StyleMatrixElementType["Subtle"] = 1] = "Subtle";
        StyleMatrixElementType[StyleMatrixElementType["Moderate"] = 2] = "Moderate";
        StyleMatrixElementType[StyleMatrixElementType["Intense"] = 3] = "Intense";
    })(StyleMatrixElementType = __aspxRichEdit.StyleMatrixElementType || (__aspxRichEdit.StyleMatrixElementType = {}));
    var ThemeColorValues;
    (function (ThemeColorValues) {
        ThemeColorValues[ThemeColorValues["None"] = -1] = "None";
        ThemeColorValues[ThemeColorValues["Light1"] = 0] = "Light1";
        ThemeColorValues[ThemeColorValues["Dark1"] = 1] = "Dark1";
        ThemeColorValues[ThemeColorValues["Light2"] = 2] = "Light2";
        ThemeColorValues[ThemeColorValues["Dark2"] = 3] = "Dark2";
        ThemeColorValues[ThemeColorValues["Accent1"] = 4] = "Accent1";
        ThemeColorValues[ThemeColorValues["Accent2"] = 5] = "Accent2";
        ThemeColorValues[ThemeColorValues["Accent3"] = 6] = "Accent3";
        ThemeColorValues[ThemeColorValues["Accent4"] = 7] = "Accent4";
        ThemeColorValues[ThemeColorValues["Accent5"] = 8] = "Accent5";
        ThemeColorValues[ThemeColorValues["Accent6"] = 9] = "Accent6";
        ThemeColorValues[ThemeColorValues["Hyperlink"] = 10] = "Hyperlink";
        ThemeColorValues[ThemeColorValues["FollowedHyperlink"] = 11] = "FollowedHyperlink";
        ThemeColorValues[ThemeColorValues["Background1"] = 12] = "Background1";
        ThemeColorValues[ThemeColorValues["Background2"] = 13] = "Background2";
        ThemeColorValues[ThemeColorValues["Text1"] = 14] = "Text1";
        ThemeColorValues[ThemeColorValues["Text2"] = 15] = "Text2";
    })(ThemeColorValues = __aspxRichEdit.ThemeColorValues || (__aspxRichEdit.ThemeColorValues = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DrawingEffectContainerType;
    (function (DrawingEffectContainerType) {
        DrawingEffectContainerType[DrawingEffectContainerType["Sibling"] = 0] = "Sibling";
        DrawingEffectContainerType[DrawingEffectContainerType["Tree"] = 1] = "Tree";
    })(DrawingEffectContainerType = __aspxRichEdit.DrawingEffectContainerType || (__aspxRichEdit.DrawingEffectContainerType = {}));
    var DrawingUnderlineFillType;
    (function (DrawingUnderlineFillType) {
        DrawingUnderlineFillType[DrawingUnderlineFillType["Fill"] = 0] = "Fill";
        DrawingUnderlineFillType[DrawingUnderlineFillType["FollowsText"] = 1] = "FollowsText";
    })(DrawingUnderlineFillType = __aspxRichEdit.DrawingUnderlineFillType || (__aspxRichEdit.DrawingUnderlineFillType = {}));
    var DrawingFillType;
    (function (DrawingFillType) {
        DrawingFillType[DrawingFillType["Automatic"] = 0] = "Automatic";
        DrawingFillType[DrawingFillType["None"] = 1] = "None";
        DrawingFillType[DrawingFillType["Solid"] = 2] = "Solid";
        DrawingFillType[DrawingFillType["Gradient"] = 3] = "Gradient";
        DrawingFillType[DrawingFillType["Group"] = 4] = "Group";
        DrawingFillType[DrawingFillType["Pattern"] = 5] = "Pattern";
        DrawingFillType[DrawingFillType["Picture"] = 6] = "Picture";
    })(DrawingFillType = __aspxRichEdit.DrawingFillType || (__aspxRichEdit.DrawingFillType = {}));
    var DrawingBulletType;
    (function (DrawingBulletType) {
        DrawingBulletType[DrawingBulletType["Automatic"] = 0] = "Automatic";
        DrawingBulletType[DrawingBulletType["Color"] = 1] = "Color";
        DrawingBulletType[DrawingBulletType["Size"] = 2] = "Size";
        DrawingBulletType[DrawingBulletType["Typeface"] = 3] = "Typeface";
        DrawingBulletType[DrawingBulletType["Common"] = 4] = "Common";
    })(DrawingBulletType = __aspxRichEdit.DrawingBulletType || (__aspxRichEdit.DrawingBulletType = {}));
    var DrawingStrokeUnderlineType;
    (function (DrawingStrokeUnderlineType) {
        DrawingStrokeUnderlineType[DrawingStrokeUnderlineType["Automatic"] = 0] = "Automatic";
        DrawingStrokeUnderlineType[DrawingStrokeUnderlineType["Outline"] = 1] = "Outline";
        DrawingStrokeUnderlineType[DrawingStrokeUnderlineType["FollowsText"] = 2] = "FollowsText";
    })(DrawingStrokeUnderlineType = __aspxRichEdit.DrawingStrokeUnderlineType || (__aspxRichEdit.DrawingStrokeUnderlineType = {}));
    var PresetCameraType;
    (function (PresetCameraType) {
        PresetCameraType[PresetCameraType["None"] = 0] = "None";
        PresetCameraType[PresetCameraType["LegacyObliqueTopLeft"] = 1] = "LegacyObliqueTopLeft";
        PresetCameraType[PresetCameraType["LegacyObliqueTop"] = 2] = "LegacyObliqueTop";
        PresetCameraType[PresetCameraType["LegacyObliqueTopRight"] = 3] = "LegacyObliqueTopRight";
        PresetCameraType[PresetCameraType["LegacyObliqueLeft"] = 4] = "LegacyObliqueLeft";
        PresetCameraType[PresetCameraType["LegacyObliqueFront"] = 5] = "LegacyObliqueFront";
        PresetCameraType[PresetCameraType["LegacyObliqueRight"] = 6] = "LegacyObliqueRight";
        PresetCameraType[PresetCameraType["LegacyObliqueBottomLeft"] = 7] = "LegacyObliqueBottomLeft";
        PresetCameraType[PresetCameraType["LegacyObliqueBottom"] = 8] = "LegacyObliqueBottom";
        PresetCameraType[PresetCameraType["LegacyObliqueBottomRight"] = 9] = "LegacyObliqueBottomRight";
        PresetCameraType[PresetCameraType["LegacyPerspectiveTopLeft"] = 10] = "LegacyPerspectiveTopLeft";
        PresetCameraType[PresetCameraType["LegacyPerspectiveTop"] = 11] = "LegacyPerspectiveTop";
        PresetCameraType[PresetCameraType["LegacyPerspectiveTopRight"] = 12] = "LegacyPerspectiveTopRight";
        PresetCameraType[PresetCameraType["LegacyPerspectiveLeft"] = 13] = "LegacyPerspectiveLeft";
        PresetCameraType[PresetCameraType["LegacyPerspectiveFront"] = 14] = "LegacyPerspectiveFront";
        PresetCameraType[PresetCameraType["LegacyPerspectiveRight"] = 15] = "LegacyPerspectiveRight";
        PresetCameraType[PresetCameraType["LegacyPerspectiveBottomLeft"] = 16] = "LegacyPerspectiveBottomLeft";
        PresetCameraType[PresetCameraType["LegacyPerspectiveBottom"] = 17] = "LegacyPerspectiveBottom";
        PresetCameraType[PresetCameraType["LegacyPerspectiveBottomRight"] = 18] = "LegacyPerspectiveBottomRight";
        PresetCameraType[PresetCameraType["OrthographicFront"] = 19] = "OrthographicFront";
        PresetCameraType[PresetCameraType["IsometricTopUp"] = 20] = "IsometricTopUp";
        PresetCameraType[PresetCameraType["IsometricTopDown"] = 21] = "IsometricTopDown";
        PresetCameraType[PresetCameraType["IsometricBottomUp"] = 22] = "IsometricBottomUp";
        PresetCameraType[PresetCameraType["IsometricBottomDown"] = 23] = "IsometricBottomDown";
        PresetCameraType[PresetCameraType["IsometricLeftUp"] = 24] = "IsometricLeftUp";
        PresetCameraType[PresetCameraType["IsometricLeftDown"] = 25] = "IsometricLeftDown";
        PresetCameraType[PresetCameraType["IsometricRightUp"] = 26] = "IsometricRightUp";
        PresetCameraType[PresetCameraType["IsometricRightDown"] = 27] = "IsometricRightDown";
        PresetCameraType[PresetCameraType["IsometricOffAxis1Left"] = 28] = "IsometricOffAxis1Left";
        PresetCameraType[PresetCameraType["IsometricOffAxis1Right"] = 29] = "IsometricOffAxis1Right";
        PresetCameraType[PresetCameraType["IsometricOffAxis1Top"] = 30] = "IsometricOffAxis1Top";
        PresetCameraType[PresetCameraType["IsometricOffAxis2Left"] = 31] = "IsometricOffAxis2Left";
        PresetCameraType[PresetCameraType["IsometricOffAxis2Right"] = 32] = "IsometricOffAxis2Right";
        PresetCameraType[PresetCameraType["IsometricOffAxis2Top"] = 33] = "IsometricOffAxis2Top";
        PresetCameraType[PresetCameraType["IsometricOffAxis3Left"] = 34] = "IsometricOffAxis3Left";
        PresetCameraType[PresetCameraType["IsometricOffAxis3Right"] = 35] = "IsometricOffAxis3Right";
        PresetCameraType[PresetCameraType["IsometricOffAxis3Bottom"] = 36] = "IsometricOffAxis3Bottom";
        PresetCameraType[PresetCameraType["IsometricOffAxis4Left"] = 37] = "IsometricOffAxis4Left";
        PresetCameraType[PresetCameraType["IsometricOffAxis4Right"] = 38] = "IsometricOffAxis4Right";
        PresetCameraType[PresetCameraType["IsometricOffAxis4Bottom"] = 39] = "IsometricOffAxis4Bottom";
        PresetCameraType[PresetCameraType["ObliqueTopLeft"] = 40] = "ObliqueTopLeft";
        PresetCameraType[PresetCameraType["ObliqueTop"] = 41] = "ObliqueTop";
        PresetCameraType[PresetCameraType["ObliqueTopRight"] = 42] = "ObliqueTopRight";
        PresetCameraType[PresetCameraType["ObliqueLeft"] = 43] = "ObliqueLeft";
        PresetCameraType[PresetCameraType["ObliqueRight"] = 44] = "ObliqueRight";
        PresetCameraType[PresetCameraType["ObliqueBottomLeft"] = 45] = "ObliqueBottomLeft";
        PresetCameraType[PresetCameraType["ObliqueBottom"] = 46] = "ObliqueBottom";
        PresetCameraType[PresetCameraType["ObliqueBottomRight"] = 47] = "ObliqueBottomRight";
        PresetCameraType[PresetCameraType["PerspectiveFront"] = 48] = "PerspectiveFront";
        PresetCameraType[PresetCameraType["PerspectiveLeft"] = 49] = "PerspectiveLeft";
        PresetCameraType[PresetCameraType["PerspectiveRight"] = 50] = "PerspectiveRight";
        PresetCameraType[PresetCameraType["PerspectiveAbove"] = 51] = "PerspectiveAbove";
        PresetCameraType[PresetCameraType["PerspectiveBelow"] = 52] = "PerspectiveBelow";
        PresetCameraType[PresetCameraType["PerspectiveAboveLeftFacing"] = 53] = "PerspectiveAboveLeftFacing";
        PresetCameraType[PresetCameraType["PerspectiveAboveRightFacing"] = 54] = "PerspectiveAboveRightFacing";
        PresetCameraType[PresetCameraType["PerspectiveContrastingLeftFacing"] = 55] = "PerspectiveContrastingLeftFacing";
        PresetCameraType[PresetCameraType["PerspectiveContrastingRightFacing"] = 56] = "PerspectiveContrastingRightFacing";
        PresetCameraType[PresetCameraType["PerspectiveHeroicLeftFacing"] = 57] = "PerspectiveHeroicLeftFacing";
        PresetCameraType[PresetCameraType["PerspectiveHeroicRightFacing"] = 58] = "PerspectiveHeroicRightFacing";
        PresetCameraType[PresetCameraType["PerspectiveHeroicExtremeLeftFacing"] = 59] = "PerspectiveHeroicExtremeLeftFacing";
        PresetCameraType[PresetCameraType["PerspectiveHeroicExtremeRightFacing"] = 60] = "PerspectiveHeroicExtremeRightFacing";
        PresetCameraType[PresetCameraType["PerspectiveRelaxed"] = 61] = "PerspectiveRelaxed";
        PresetCameraType[PresetCameraType["PerspectiveRelaxedModerately"] = 62] = "PerspectiveRelaxedModerately";
    })(PresetCameraType = __aspxRichEdit.PresetCameraType || (__aspxRichEdit.PresetCameraType = {}));
    var LightRigDirection;
    (function (LightRigDirection) {
        LightRigDirection[LightRigDirection["None"] = 0] = "None";
        LightRigDirection[LightRigDirection["Bottom"] = 1] = "Bottom";
        LightRigDirection[LightRigDirection["BottomLeft"] = 2] = "BottomLeft";
        LightRigDirection[LightRigDirection["BottomRight"] = 3] = "BottomRight";
        LightRigDirection[LightRigDirection["Left"] = 4] = "Left";
        LightRigDirection[LightRigDirection["Right"] = 5] = "Right";
        LightRigDirection[LightRigDirection["Top"] = 6] = "Top";
        LightRigDirection[LightRigDirection["TopLeft"] = 7] = "TopLeft";
        LightRigDirection[LightRigDirection["TopRight"] = 8] = "TopRight";
    })(LightRigDirection = __aspxRichEdit.LightRigDirection || (__aspxRichEdit.LightRigDirection = {}));
    var LightRigPreset;
    (function (LightRigPreset) {
        LightRigPreset[LightRigPreset["None"] = 0] = "None";
        LightRigPreset[LightRigPreset["LegacyFlat1"] = 1] = "LegacyFlat1";
        LightRigPreset[LightRigPreset["LegacyFlat2"] = 2] = "LegacyFlat2";
        LightRigPreset[LightRigPreset["LegacyFlat3"] = 3] = "LegacyFlat3";
        LightRigPreset[LightRigPreset["LegacyFlat4"] = 4] = "LegacyFlat4";
        LightRigPreset[LightRigPreset["LegacyNormal1"] = 5] = "LegacyNormal1";
        LightRigPreset[LightRigPreset["LegacyNormal2"] = 6] = "LegacyNormal2";
        LightRigPreset[LightRigPreset["LegacyNormal3"] = 7] = "LegacyNormal3";
        LightRigPreset[LightRigPreset["LegacyNormal4"] = 8] = "LegacyNormal4";
        LightRigPreset[LightRigPreset["LegacyHarsh1"] = 9] = "LegacyHarsh1";
        LightRigPreset[LightRigPreset["LegacyHarsh2"] = 10] = "LegacyHarsh2";
        LightRigPreset[LightRigPreset["LegacyHarsh3"] = 11] = "LegacyHarsh3";
        LightRigPreset[LightRigPreset["LegacyHarsh4"] = 12] = "LegacyHarsh4";
        LightRigPreset[LightRigPreset["ThreePt"] = 13] = "ThreePt";
        LightRigPreset[LightRigPreset["Balanced"] = 14] = "Balanced";
        LightRigPreset[LightRigPreset["Soft"] = 15] = "Soft";
        LightRigPreset[LightRigPreset["Harsh"] = 16] = "Harsh";
        LightRigPreset[LightRigPreset["Flood"] = 17] = "Flood";
        LightRigPreset[LightRigPreset["Contrasting"] = 18] = "Contrasting";
        LightRigPreset[LightRigPreset["Morning"] = 19] = "Morning";
        LightRigPreset[LightRigPreset["Sunrise"] = 20] = "Sunrise";
        LightRigPreset[LightRigPreset["Sunset"] = 21] = "Sunset";
        LightRigPreset[LightRigPreset["Chilly"] = 22] = "Chilly";
        LightRigPreset[LightRigPreset["Freezing"] = 23] = "Freezing";
        LightRigPreset[LightRigPreset["Flat"] = 24] = "Flat";
        LightRigPreset[LightRigPreset["TwoPt"] = 25] = "TwoPt";
        LightRigPreset[LightRigPreset["Glow"] = 26] = "Glow";
        LightRigPreset[LightRigPreset["BrightRoom"] = 27] = "BrightRoom";
    })(LightRigPreset = __aspxRichEdit.LightRigPreset || (__aspxRichEdit.LightRigPreset = {}));
    var PresetMaterialType;
    (function (PresetMaterialType) {
        PresetMaterialType[PresetMaterialType["None"] = 0] = "None";
        PresetMaterialType[PresetMaterialType["LegacyMatte"] = 1] = "LegacyMatte";
        PresetMaterialType[PresetMaterialType["LegacyPlastic"] = 2] = "LegacyPlastic";
        PresetMaterialType[PresetMaterialType["LegacyMetal"] = 3] = "LegacyMetal";
        PresetMaterialType[PresetMaterialType["LegacyWireframe"] = 4] = "LegacyWireframe";
        PresetMaterialType[PresetMaterialType["Matte"] = 5] = "Matte";
        PresetMaterialType[PresetMaterialType["Plastic"] = 6] = "Plastic";
        PresetMaterialType[PresetMaterialType["Metal"] = 7] = "Metal";
        PresetMaterialType[PresetMaterialType["WarmMatte"] = 8] = "WarmMatte";
        PresetMaterialType[PresetMaterialType["TranslucentPowder"] = 9] = "TranslucentPowder";
        PresetMaterialType[PresetMaterialType["Powder"] = 10] = "Powder";
        PresetMaterialType[PresetMaterialType["DarkEdge"] = 11] = "DarkEdge";
        PresetMaterialType[PresetMaterialType["SoftEdge"] = 12] = "SoftEdge";
        PresetMaterialType[PresetMaterialType["Clear"] = 13] = "Clear";
        PresetMaterialType[PresetMaterialType["Flat"] = 14] = "Flat";
        PresetMaterialType[PresetMaterialType["SoftMetal"] = 15] = "SoftMetal";
    })(PresetMaterialType = __aspxRichEdit.PresetMaterialType || (__aspxRichEdit.PresetMaterialType = {}));
    var DrawingText3DType;
    (function (DrawingText3DType) {
        DrawingText3DType[DrawingText3DType["Automatic"] = 0] = "Automatic";
        DrawingText3DType[DrawingText3DType["Shape3D"] = 1] = "Shape3D";
        DrawingText3DType[DrawingText3DType["FlatText"] = 2] = "FlatText";
    })(DrawingText3DType = __aspxRichEdit.DrawingText3DType || (__aspxRichEdit.DrawingText3DType = {}));
    var PresetBevelType;
    (function (PresetBevelType) {
        PresetBevelType[PresetBevelType["None"] = 0] = "None";
        PresetBevelType[PresetBevelType["RelaxedInset"] = 1] = "RelaxedInset";
        PresetBevelType[PresetBevelType["Circle"] = 2] = "Circle";
        PresetBevelType[PresetBevelType["Slope"] = 3] = "Slope";
        PresetBevelType[PresetBevelType["Cross"] = 4] = "Cross";
        PresetBevelType[PresetBevelType["Angle"] = 5] = "Angle";
        PresetBevelType[PresetBevelType["SoftRound"] = 6] = "SoftRound";
        PresetBevelType[PresetBevelType["Convex"] = 7] = "Convex";
        PresetBevelType[PresetBevelType["CoolSlant"] = 8] = "CoolSlant";
        PresetBevelType[PresetBevelType["Divot"] = 9] = "Divot";
        PresetBevelType[PresetBevelType["Riblet"] = 10] = "Riblet";
        PresetBevelType[PresetBevelType["HardEdge"] = 11] = "HardEdge";
        PresetBevelType[PresetBevelType["ArtDeco"] = 12] = "ArtDeco";
    })(PresetBevelType = __aspxRichEdit.PresetBevelType || (__aspxRichEdit.PresetBevelType = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ColorHelper = (function () {
        function ColorHelper() {
        }
        ColorHelper.constructFromArgbNumber = function (alpha, red, green, blue) {
            return (alpha << 24) | (red << 16) | (green << 8) | blue;
        };
        ColorHelper.getPredefinedColor = function (color) {
            return ColorHelper.hashToColor(color, 0);
        };
        ColorHelper.isGray = function (color) {
            var red = ColorHelper.getRed(color);
            return red == ColorHelper.getGreen(color) && red == ColorHelper.getBlue(color);
        };
        ColorHelper.getAlpha = function (color) {
            return (color >> 24) & 255;
        };
        ColorHelper.getRed = function (color) {
            return (color >> 16) & 255;
        };
        ColorHelper.getGreen = function (color) {
            return (color >> 8) & 255;
        };
        ColorHelper.getBlue = function (color) {
            return color & 255;
        };
        ColorHelper.redPartToString = function (color) {
            var redStr = ColorHelper.getRed(color).toString(16);
            return redStr.length > 1 ? redStr : "0" + redStr;
        };
        ColorHelper.greenPartToString = function (color) {
            var greenStr = ColorHelper.getGreen(color).toString(16);
            return greenStr.length > 1 ? greenStr : "0" + greenStr;
        };
        ColorHelper.bluePartToString = function (color) {
            var blueStr = ColorHelper.getBlue(color).toString(16);
            return blueStr.length > 1 ? blueStr : "0" + blueStr;
        };
        ColorHelper.colorToHash = function (color) {
            return "#" + ColorHelper.redPartToString(color) + ColorHelper.greenPartToString(color) + ColorHelper.bluePartToString(color);
        };
        ColorHelper.anyToColor = function (value, defaultValue) {
            if (__aspxRichEdit.Utils.isNumber(value) && !isNaN(value))
                return value;
            if (typeof value === "string") {
                var intValue = parseInt(value);
                return !isNaN(intValue) && value == intValue ? intValue : ColorHelper.hashToColor(value);
            }
            return defaultValue;
        };
        ColorHelper.hashToColor = function (hash, alpha) {
            if (alpha === void 0) { alpha = 255; }
            hash = hash.charAt(0) == "#" ? hash.substr(1) : hash;
            if (hash.length === 3)
                hash = __aspxRichEdit.StringUtils.repeat(hash.charAt(0), 2) + __aspxRichEdit.StringUtils.repeat(hash.charAt(1), 2) + __aspxRichEdit.StringUtils.repeat(hash.charAt(2), 2);
            return parseInt(hash, 16) | (alpha << 24);
        };
        ColorHelper.getActualForeColor = function (foreColor, backColor) {
            if (foreColor == ColorHelper.AUTOMATIC_COLOR) {
                var backColorIsLight = backColor == ColorHelper.AUTOMATIC_COLOR ||
                    backColor == ColorHelper.NO_COLOR ||
                    ColorHelper.calculateLumaY(backColor) >= ColorHelper.DEFAULT_BOUNDARY_LUMA;
                foreColor = backColorIsLight ? ColorHelper.DARK_COLOR : ColorHelper.LIGHT_COLOR;
            }
            return ColorHelper.getCssString(foreColor, true);
        };
        ColorHelper.getCssString = function (color, isAutoColorTranslateToDark) {
            if (color == ColorHelper.AUTOMATIC_COLOR)
                return ColorHelper.colorToHash(isAutoColorTranslateToDark ? ColorHelper.DARK_COLOR : ColorHelper.LIGHT_COLOR);
            return ColorHelper.getCssStringInternal(color);
        };
        ColorHelper.stringToHash = function (color) {
            return this.colorToHash(this.stringToColor(color));
        };
        ColorHelper.stringToColor = function (color) {
            var foreColorMatchesRGB = this.getRGBAByString(color);
            var hashColor = "";
            if (foreColorMatchesRGB) {
                return ((foreColorMatchesRGB[0] & 255) << 16) | ((foreColorMatchesRGB[1] & 255) << 8) | (foreColorMatchesRGB[2] & 255) |
                    (((foreColorMatchesRGB.length > 3 ? foreColorMatchesRGB[3] : 255) & 255) << 24);
            }
            else {
                if (/^#([0-9a-f]{6})$/i.test(color) || /^#([0-9a-f]{3})$/i.test(color))
                    hashColor = color;
                else if (/^[a-z]+$/i.test(color))
                    hashColor = ColorHelper.colorNames[color.toLowerCase()];
            }
            if (hashColor)
                return ColorHelper.hashToColor(hashColor);
            return null;
        };
        ColorHelper.getRGBAByString = function (color) {
            var matchesRGBA = color.replace(/ +/g, '').match(/(rgba?)|(\d+(\.\d+)?%?)|(\.\d+)/g);
            if (matchesRGBA && matchesRGBA.length > 3) {
                var i = 0, itm;
                var result = [];
                while (i < matchesRGBA.length - 1) {
                    itm = matchesRGBA[++i];
                    if (itm.indexOf('%') != -1)
                        itm = Math.round(parseFloat(itm) * 2.55);
                    else
                        itm = parseInt(itm);
                    if (itm < 0 || itm > 255)
                        return null;
                    result.push(itm);
                }
                if (color.indexOf('rgba') === 0) {
                    if (isNaN(result[3]) || result[3] < 0 || result[3] > 1)
                        return null;
                }
                else if (result[3])
                    return null;
                return result;
            }
            return null;
        };
        ColorHelper.IsDarkColor = function (color) {
            return ColorHelper.calculateLumaY(color) < ColorHelper.DEFAULT_BOUNDARY_LUMA;
        };
        ColorHelper.getCssStringInternal = function (color) {
            var alpfa = ColorHelper.getAlpha(color);
            switch (alpfa) {
                case 0: return "transparent";
                case 255: return ColorHelper.colorToHash(color);
                default: return "rgba(" + ColorHelper.getRed(color) + "," + ColorHelper.getGreen(color) + "," + ColorHelper.getBlue(color) + "," + (alpfa / 255) + ")";
            }
        };
        ColorHelper.isEmptyBgColor = function (color) {
            return color === this.AUTOMATIC_COLOR || color === this.NO_COLOR;
        };
        ColorHelper.calculateLumaY = function (color) {
            return ColorHelper.DEFAULT_BOUNDARY_LUMA_RED * ColorHelper.getRed(color) +
                ColorHelper.DEFAULT_BOUNDARY_LUMA_GREEN * ColorHelper.getGreen(color) +
                ColorHelper.DEFAULT_BOUNDARY_LUMA_BLUE * ColorHelper.getBlue(color);
        };
        ColorHelper.colorNames = {
            aliceblue: '#f0f8ff', antiquewhite: '#faebd7', aqua: '#00ffff',
            aquamarine: '#7fffd4', azure: '#f0ffff', beige: '#f5f5dc',
            bisque: '#ffe4c4', black: '#000000', blanchedalmond: '#ffebcd',
            blue: '#0000ff', blueviolet: '#8a2be2', brown: '#a52a2a',
            burlywood: '#deb887', cadetblue: '#5f9ea0', chartreuse: '#7fff00',
            chocolate: '#d2691e', coral: '#ff7f50', cornflowerblue: '#6495ed',
            cornsilk: '#fff8dc', crimson: '#dc143c', cyan: '#00ffff',
            darkblue: '#00008b', darkcyan: '#008b8b', darkgoldenrod: '#b8860b',
            darkgray: '#a9a9a9', darkgreen: '#006400', darkkhaki: '#bdb76b',
            darkmagenta: '#8b008b', darkolivegreen: '#556b2f', darkorange: '#ff8c00',
            darkorchid: '#9932cc', darkred: '#8b0000', darksalmon: '#e9967a',
            darkseagreen: '#8fbc8f', darkslateblue: '#483d8b', darkslategray: '#2f4f4f',
            darkturquoise: '#00ced1', darkviolet: '#9400d3', deeppink: '#ff1493',
            deepskyblue: '#00bfff', dimgray: '#696969', dodgerblue: '#1e90ff',
            feldspar: '#d19275', firebrick: '#b22222', floralwhite: '#fffaf0',
            forestgreen: '#228b22', fuchsia: '#ff00ff', gainsboro: '#dcdcdc',
            ghostwhite: '#f8f8ff', gold: '#ffd700', goldenrod: '#daa520', gray: '#808080',
            green: '#00ff00', greenyellow: '#adff2f', honeydew: '#f0fff0', hotpink: '#ff69b4',
            indianred: '#cd5c5c', indigo: '#4b0082', ivory: '#fffff0', khaki: '#f0e68c',
            lavender: '#e6e6fa', lavenderblush: '#fff0f5', lawngreen: '#7cfc00',
            lemonchiffon: '#fffacd', lightblue: '#add8e6', lightcoral: '#f08080',
            lightcyan: '#e0ffff', lightgoldenrodyellow: '#fafad2', lightgray: '#d3d3d3',
            lightgreen: '#90ee90', lightpink: '#ffb6c1', lightsalmon: '#ffa07a',
            lightseagreen: '#20b2aa', lightskyblue: '#87cefa', lightslateblue: '#8470ff',
            lightslategray: '#778899', lightsteelblue: '#b0c4de', lightyellow: '#ffffe0',
            lime: '#00ff00', limegreen: '#32cd32', linen: '#faf0e6', magenta: '#ff00ff',
            maroon: '#800000', mediumaquamarine: '#66cdaa', mediumblue: '#0000cd',
            mediumorchid: '#ba55d3', mediumpurple: '#9370d8', mediumseagreen: '#3cb371',
            mediumslateblue: '#7b68ee', mediumspringgreen: '#00fa9a', mediumturquoise: '#48d1cc',
            mediumvioletred: '#c71585', midnightblue: '#191970', mintcream: '#f5fffa',
            mistyrose: '#ffe4e1', moccasin: '#ffe4b5', navajowhite: '#ffdead', navy: '#000080',
            oldlace: '#fdf5e6', olive: '#808000', olivedrab: '#6b8e23', orange: '#ffa500',
            orangered: '#ff4500', orchid: '#da70d6', palegoldenrod: '#eee8aa', palegreen: '#98fb98',
            paleturquoise: '#afeeee', palevioletred: '#d87093', papayawhip: '#ffefd5',
            peachpuff: '#ffdab9', peru: '#cd853f', pink: '#ffc0cb', plum: '#dda0dd',
            powderblue: '#b0e0e6', purple: '#800080', red: '#ff0000', rosybrown: '#bc8f8f',
            royalblue: '#4169e1', saddlebrown: '#8b4513', salmon: '#fa8072', sandybrown: '#f4a460',
            seagreen: '#2e8b57', seashell: '#fff5ee', sienna: '#a0522d', silver: '#c0c0c0',
            skyblue: '#87ceeb', slateblue: '#6a5acd', slategray: '#708090', snow: '#fffafa',
            springgreen: '#00ff7f', steelblue: '#4682b4', tan: '#d2b48c', teal: '#008080',
            thistle: '#d8bfd8', tomato: '#ff6347', turquoise: '#40e0d0', violet: '#ee82ee',
            violetred: '#d02090', wheat: '#f5deb3', white: '#ffffff', whitesmoke: '#f5f5f5',
            yellow: '#ffff00', yellowgreen: '#9acd32', windowtext: '#000000'
        };
        ColorHelper.DEFAULT_BOUNDARY_LUMA = 60.762 * 65536;
        ColorHelper.DEFAULT_BOUNDARY_LUMA_RED = 0.299 * 65536;
        ColorHelper.DEFAULT_BOUNDARY_LUMA_BLUE = 0.114 * 65536;
        ColorHelper.DEFAULT_BOUNDARY_LUMA_GREEN = 0.587 * 65536;
        ColorHelper.DARK_COLOR = -16777216;
        ColorHelper.LIGHT_COLOR = -1;
        ColorHelper.BLACK_COLOR = -16777216;
        ColorHelper.AUTOMATIC_COLOR = 0;
        ColorHelper.NO_COLOR = 16777215;
        return ColorHelper;
    }());
    __aspxRichEdit.ColorHelper = ColorHelper;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DXColor = (function () {
        function DXColor() {
        }
        DXColor.isTransparentOrEmpty = function (color) {
            return color == DXColor.empty || color == DXColor.transparent;
        };
        DXColor.isTransparentColor = function (color) {
            return __aspxRichEdit.ColorHelper.getAlpha(color) == 0;
        };
        DXColor.isEmpty = function (color) {
            return color == null || color == undefined;
        };
        DXColor.isSemitransparentColor = function (color) {
            var alpha = __aspxRichEdit.ColorHelper.getAlpha(color);
            return alpha > 0 && alpha < 255;
        };
        DXColor.fromArgb = function (alpha, rgbColor) {
            return (alpha << 24) | (__aspxRichEdit.ColorHelper.getRed(rgbColor) << 16) | (__aspxRichEdit.ColorHelper.getGreen(rgbColor) << 8) | (__aspxRichEdit.ColorHelper.getBlue(rgbColor));
        };
        DXColor.fromRgb = function (red, green, blue) {
            return (255 << 24) | (red << 16) | (green << 8) | (blue);
        };
        DXColor.fromName = function (name) {
            var hash = __aspxRichEdit.ColorHelper.colorNames[name.toLowerCase()];
            return hash ? __aspxRichEdit.ColorHelper.hashToColor(hash) : __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR;
        };
        DXColor.blend = function (color, backgroundColor) {
            if (__aspxRichEdit.ColorHelper.getAlpha(color) >= 255)
                return color;
            var alpha = __aspxRichEdit.ColorHelper.getAlpha(color) / 255.0;
            var one_alpha = 1.0 - alpha;
            return DXColor.fromRgb(Math.floor(__aspxRichEdit.ColorHelper.getRed(color) * alpha + __aspxRichEdit.ColorHelper.getRed(backgroundColor) * one_alpha), Math.floor(__aspxRichEdit.ColorHelper.getGreen(color) * alpha + __aspxRichEdit.ColorHelper.getGreen(backgroundColor) * one_alpha), Math.floor(__aspxRichEdit.ColorHelper.getBlue(color) * alpha + __aspxRichEdit.ColorHelper.getBlue(backgroundColor) * one_alpha));
        };
        DXColor.calculateNearestColor = function (colorsToChooseFrom, startColor) {
            var startHslColor = __aspxRichEdit.ColorHSL.fromColorRGB(startColor);
            return !colorsToChooseFrom.length ?
                DXColor.empty :
                __aspxRichEdit.ListUtils.minMaxExtended(colorsToChooseFrom, function (color) {
                    var hslColor = __aspxRichEdit.ColorHSL.fromColorRGB(color);
                    var hue = Math.abs(hslColor.floatHue - startHslColor.floatHue);
                    if (hue > 1.0)
                        hue = 1.0 - hue;
                    return Math.pow(hue, 2) +
                        Math.pow(hslColor.floatSaturation - startHslColor.floatSaturation, 2) +
                        Math.pow(hslColor.luminance - startHslColor.luminance, 2);
                }).minElement;
        };
        DXColor.empty = __aspxRichEdit.ColorHelper.getPredefinedColor("#000000");
        DXColor.transparent = __aspxRichEdit.ColorHelper.hashToColor("#FFFFFF", 255);
        return DXColor;
    }());
    __aspxRichEdit.DXColor = DXColor;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ColorModelInfo = (function () {
        function ColorModelInfo() {
            this._themeColorIndex = __aspxRichEdit.ThemeColorIndexConstants.None;
            this._themeValue = __aspxRichEdit.ThemeColorValues.None;
            this._colorIndex = ColorModelInfo.defaultColorIndex;
            this.restoreDefaultValues();
        }
        Object.defineProperty(ColorModelInfo, "nullColor", {
            get: function () { return ColorModelInfo.makeByColor(__aspxRichEdit.ColorHelper.AUTOMATIC_COLOR); },
            enumerable: true,
            configurable: true
        });
        ;
        ColorModelInfo.makeByThemeColorIndex = function (themeColorIndex, tint) {
            if (tint === void 0) { tint = 0; }
            var result = new ColorModelInfo();
            result.themeColorIndex = themeColorIndex;
            result.tint = tint;
            return result;
        };
        ColorModelInfo.makeByColor = function (color, tint) {
            if (tint === void 0) { tint = 0; }
            var result = new ColorModelInfo();
            result.rgb = color;
            result.tint = tint;
            return result;
        };
        ColorModelInfo.makeByColorIndex = function (colorIndex, tint) {
            if (tint === void 0) { tint = 0; }
            var result = new ColorModelInfo();
            result.colorIndex = colorIndex;
            result.tint = tint;
            return result;
        };
        Object.defineProperty(ColorModelInfo.prototype, "colorType", {
            get: function () { return this._colorType; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ColorModelInfo.prototype, "rgb", {
            get: function () { return this._rgb; },
            set: function (value) {
                this.setColorType(__aspxRichEdit.ColorType.Rgb);
                if (this._rgb != value)
                    this._rgb = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ColorModelInfo.prototype, "themeColorIndex", {
            get: function () { return this._themeColorIndex; },
            set: function (value) {
                this.setColorType(__aspxRichEdit.ColorType.Theme);
                if (this._themeColorIndex != value)
                    this._themeColorIndex = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ColorModelInfo.prototype, "themeValue", {
            get: function () { return this._themeValue; },
            set: function (value) {
                this.setColorType(__aspxRichEdit.ColorType.Theme);
                if (this._themeValue != value)
                    this._themeValue = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ColorModelInfo.prototype, "colorIndex", {
            get: function () { return this._colorIndex; },
            set: function (value) {
                this.setColorType(__aspxRichEdit.ColorType.Index);
                if (this._colorIndex != value)
                    this._colorIndex = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ColorModelInfo.prototype, "tint", {
            get: function () { return this._tint; },
            set: function (value) {
                if (Math.abs(value) > 1)
                    throw new Error(__aspxRichEdit.Errors.InternalException);
                this._tint = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ColorModelInfo.prototype, "isEmpty", {
            get: function () { return this.colorType == __aspxRichEdit.ColorType.Rgb && __aspxRichEdit.DXColor.isTransparentOrEmpty(this.rgb); },
            enumerable: true,
            configurable: true
        });
        ColorModelInfo.prototype.restoreDefaultValues = function () {
            this._themeColorIndex = __aspxRichEdit.ThemeColorIndexConstants.None;
            this._themeValue = __aspxRichEdit.ThemeColorValues.None;
            this._colorIndex = ColorModelInfo.defaultColorIndex;
            this._rgb = __aspxRichEdit.DXColor.empty;
            this._colorType = __aspxRichEdit.ColorType.Rgb;
            this._tint = 0;
        };
        ColorModelInfo.prototype.setColorType = function (colorType) {
            if (this._colorType != colorType) {
                this.restoreDefaultValues();
                this._colorType = colorType;
            }
        };
        ColorModelInfo.makeAuto = function () {
            var result = new ColorModelInfo();
            result.setColorType(__aspxRichEdit.ColorType.Auto);
            return result;
        };
        ColorModelInfo.prototype.toRgb = function (colorProvider) {
            var color = __aspxRichEdit.DXColor.empty;
            switch (this.colorType) {
                case __aspxRichEdit.ColorType.Index:
                    if (this.colorIndex != ColorModelInfo.defaultColorIndex) {
                        color = colorProvider.palette.getColorByIndex(this.colorIndex);
                        if (__aspxRichEdit.ColorHelper.getAlpha(color) == 0)
                            color = __aspxRichEdit.DXColor.fromArgb(255, color);
                    }
                    break;
                case __aspxRichEdit.ColorType.Theme:
                    if (this.themeColorIndex != __aspxRichEdit.ThemeColorIndexConstants.None)
                        color = colorProvider.officeTheme.colors.getColorByThemeColorIndex(colorProvider, this.themeColorIndex);
                    break;
                case __aspxRichEdit.ColorType.Rgb:
                    color = this.rgb;
                    break;
            }
            return __aspxRichEdit.ColorHSL.calculateColorRGB(color, this.tint);
        };
        ColorModelInfo.prototype.clone = function () {
            var result = new ColorModelInfo();
            result.copyFrom(this);
            return result;
        };
        ColorModelInfo.prototype.copyFrom = function (value) {
            this._themeColorIndex = value.themeColorIndex;
            this._themeValue = value.themeValue;
            this._colorIndex = value.colorIndex;
            this._rgb = value.rgb;
            this._colorType = value.colorType;
            this.tint = value.tint;
        };
        ColorModelInfo.prototype.equals = function (info) {
            return info &&
                this._colorType == info.colorType &&
                this.rgb == info.rgb &&
                this.themeColorIndex == info.themeColorIndex &&
                this.colorIndex == info.colorIndex &&
                this.tint == info.tint &&
                this.themeValue == info.themeValue;
        };
        ColorModelInfo.equalsBinary = function (a, b) {
            return a && b && (a === b ||
                a._colorType == b._colorType &&
                    a._rgb == b._rgb &&
                    a._colorIndex == b._colorIndex &&
                    a._themeColorIndex == b._themeColorIndex &&
                    a._tint == b._tint &&
                    a._themeValue == b._themeValue);
        };
        ColorModelInfo.prototype.calculateHash = function () {
            var hash = __aspxRichEdit.MathUtils.somePrimes[0] * this._colorType;
            if (this._rgb !== undefined)
                hash ^= __aspxRichEdit.MathUtils.somePrimes[1] * this._rgb;
            if (this._tint !== undefined)
                hash ^= __aspxRichEdit.MathUtils.somePrimes[2] * this._tint;
            if (this._colorIndex !== undefined)
                hash ^= __aspxRichEdit.MathUtils.somePrimes[3] * this._colorIndex;
            if (this._themeColorIndex !== undefined)
                hash ^= __aspxRichEdit.MathUtils.somePrimes[4] * this._themeColorIndex;
            return hash;
        };
        ColorModelInfo.prototype.getHashCode = function () {
            return this.hash === undefined ? this.hash = this.calculateHash() : this.hash;
        };
        ColorModelInfo.prototype.toJSON = function () {
            var result = {};
            result[__aspxRichEdit.JSONColorModelInfoProperty.ColorType] = this.colorType;
            result[__aspxRichEdit.JSONColorModelInfoProperty.Tint] = this.tint;
            result[__aspxRichEdit.JSONColorModelInfoProperty.ColorIndex] = this.colorIndex;
            result[__aspxRichEdit.JSONColorModelInfoProperty.ThemeColorIndex] = this.themeColorIndex;
            result[__aspxRichEdit.JSONColorModelInfoProperty.Rgb] = this.rgb;
            return result;
        };
        ColorModelInfo.prototype.toDebugString = function () {
            return "type: " + __aspxRichEdit.ColorType[this.colorType] + ", rgb " + this.rgb + ", themeColorIndex: " + this.themeColorIndex + ", themeValue: " + this.themeValue;
        };
        ColorModelInfo.defaultColorIndex = -1;
        ColorModelInfo.empty = new ColorModelInfo();
        ColorModelInfo.auto = ColorModelInfo.makeAuto();
        ColorModelInfo.autoColor = ColorModelInfo.makeByColor(__aspxRichEdit.ColorHelper.AUTOMATIC_COLOR);
        ColorModelInfo.noColor = ColorModelInfo.makeByColor(__aspxRichEdit.ColorHelper.NO_COLOR);
        return ColorModelInfo;
    }());
    __aspxRichEdit.ColorModelInfo = ColorModelInfo;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DXSystemColors = (function () {
        function DXSystemColors() {
        }
        DXSystemColors.control = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 240, 240, 240);
        DXSystemColors.controlDark = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 160, 160, 160);
        DXSystemColors.window = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 255, 255, 255);
        DXSystemColors.activeBorder = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 180, 180, 180);
        DXSystemColors.activeCaption = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 153, 180, 209);
        DXSystemColors.activeCaptionText = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 0, 0, 0);
        DXSystemColors.appWorkspace = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 171, 171, 171);
        DXSystemColors.controlDarkDark = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 105, 105, 105);
        DXSystemColors.controlLight = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 227, 227, 227);
        DXSystemColors.controlLightLight = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 255, 255, 255);
        DXSystemColors.controlText = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 0, 0, 0);
        DXSystemColors.desktop = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 0, 0, 0);
        DXSystemColors.grayText = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 109, 109, 109);
        DXSystemColors.highlight = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 0, 120, 215);
        DXSystemColors.highlightText = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 255, 255, 255);
        DXSystemColors.hotTrack = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 0, 102, 204);
        DXSystemColors.inactiveBorder = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 244, 247, 252);
        DXSystemColors.inactiveCaption = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 191, 205, 219);
        DXSystemColors.inactiveCaptionText = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 0, 0, 0);
        DXSystemColors.info = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 255, 255, 225);
        DXSystemColors.infoText = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 0, 0, 0);
        DXSystemColors.menu = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 240, 240, 240);
        DXSystemColors.menuText = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 0, 0, 0);
        DXSystemColors.scrollBar = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 200, 200, 200);
        DXSystemColors.windowFrame = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 100, 100, 100);
        DXSystemColors.windowText = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 0, 0, 0);
        DXSystemColors.gradientActiveCaption = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 185, 209, 234);
        DXSystemColors.gradientInactiveCaption = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 215, 228, 242);
        DXSystemColors.menuBar = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 240, 240, 240);
        DXSystemColors.menuHighlight = __aspxRichEdit.ColorHelper.constructFromArgbNumber(255, 51, 153, 255);
        return DXSystemColors;
    }());
    __aspxRichEdit.DXSystemColors = DXSystemColors;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ScRGBColor = (function () {
        function ScRGBColor(scR, scG, scB) {
            this._scR = scR;
            this._scG = scG;
            this._scB = scB;
        }
        Object.defineProperty(ScRGBColor.prototype, "scR", {
            get: function () { return this._scR; },
            set: function (value) { this._scR = this.getValidValue(value); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ScRGBColor.prototype, "scG", {
            get: function () { return this._scG; },
            set: function (value) { this._scG = this.getValidValue(value); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ScRGBColor.prototype, "scB", {
            get: function () { return this._scB; },
            set: function (value) { this._scB = this.getValidValue(value); },
            enumerable: true,
            configurable: true
        });
        ScRGBColor.prototype.calculateHash = function () {
            return __aspxRichEdit.MathUtils.somePrimes[0] * this._scR ^
                __aspxRichEdit.MathUtils.somePrimes[1] * this._scG ^
                __aspxRichEdit.MathUtils.somePrimes[2] * this._scB;
        };
        ScRGBColor.prototype.toRgb = function () {
            var r = this._scR * 1.0 / __aspxRichEdit.DrawingValueConstants.ThousandthOfPercentage;
            var g = this._scG * 1.0 / __aspxRichEdit.DrawingValueConstants.ThousandthOfPercentage;
            var b = this._scB * 1.0 / __aspxRichEdit.DrawingValueConstants.ThousandthOfPercentage;
            var a = 0.055;
            r = (r <= 0.0031308) ? 12.92 * r : (1 + a) * Math.pow(r, 1 / 2.4) - a;
            g = (g <= 0.0031308) ? 12.92 * g : (1 + a) * Math.pow(g, 1 / 2.4) - a;
            b = (b <= 0.0031308) ? 12.92 * b : (1 + a) * Math.pow(b, 1 / 2.4) - a;
            r *= 255;
            g *= 255;
            b *= 255;
            return __aspxRichEdit.DXColor.fromRgb(Math.round(r), Math.round(g), Math.round(b));
        };
        ScRGBColor.prototype.getValidValue = function (value) {
            return (value < 0) ? 0 : value;
        };
        ScRGBColor.prototype.equals = function (obj) {
            return obj &&
                this._scR == obj._scR &&
                this._scG == obj._scG &&
                this._scB == obj._scB;
        };
        ScRGBColor.defaultValue = new ScRGBColor(0, 0, 0);
        return ScRGBColor;
    }());
    __aspxRichEdit.ScRGBColor = ScRGBColor;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DrawingValueConstants = (function () {
        function DrawingValueConstants() {
        }
        DrawingValueConstants.ThousandthOfPercentage = 100000;
        DrawingValueConstants.MinCoordinate = -27273042329600;
        DrawingValueConstants.MaxCoordinate = 27273042316900;
        DrawingValueConstants.OnePositiveFixedAngle = 60000;
        DrawingValueConstants.MaxPositiveFixedAngle = 21600000;
        DrawingValueConstants.MaxFixedAngle = 5400000;
        DrawingValueConstants.MaxFOVAngle = 10800000;
        DrawingValueConstants.MaxOutlineWidth = 20116800;
        DrawingValueConstants.MaxPositiveCoordinate32 = 51206400;
        DrawingValueConstants.MinTextIndentLevel = -2;
        DrawingValueConstants.MaxTextIndentLevel = 8;
        DrawingValueConstants.MaxTextSpacingPercent = 13200000;
        DrawingValueConstants.MaxTextSpacingPoints = 158400;
        DrawingValueConstants.MaxStartAtNumValue = 32767;
        DrawingValueConstants.MinTextBulletSizePercent = 25000;
        DrawingValueConstants.MaxTextBulletSizePercent = 400000;
        DrawingValueConstants.MinTextBulletSizePoints = 100;
        DrawingValueConstants.MaxTextBulletSizePoints = 400000;
        DrawingValueConstants.MaxWidthInPoints = 1584;
        DrawingValueConstants.EmusInPoint = 12700;
        return DrawingValueConstants;
    }());
    __aspxRichEdit.DrawingValueConstants = DrawingValueConstants;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ColorHSL = (function () {
        function ColorHSL(hue, saturation, luminance) {
            if (__aspxRichEdit.Log.isEnabled && !(hue <= 1 && hue >= 0 && saturation <= 1 && saturation >= 0 && luminance <= 1 && luminance >= 0))
                throw new Error(__aspxRichEdit.Errors.InternalException);
            this._hue = hue;
            this._saturation = saturation;
            this._luminance = luminance;
        }
        ColorHSL.prototype.calculateHash = function () {
            return __aspxRichEdit.MathUtils.somePrimes[0] * this._hue ^
                __aspxRichEdit.MathUtils.somePrimes[0] * this._luminance ^
                __aspxRichEdit.MathUtils.somePrimes[0] * this._saturation;
        };
        ColorHSL.makeFromHSL = function (hue, saturation, luminance) {
            return new ColorHSL(hue / ColorHSL.MaxAngle, saturation / ColorHSL.MaxThousandthOfPercentage, luminance / ColorHSL.MaxThousandthOfPercentage);
        };
        ColorHSL.rgbToHsl = function (r, g, b) {
            r /= 255, g /= 255, b /= 255;
            var max = Math.max(r, g, b), min = Math.min(r, g, b);
            var h, s, l = (max + min) / 2;
            if (max == min) {
                h = s = 0;
            }
            else {
                var d = max - min;
                s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
                switch (max) {
                    case r:
                        h = (g - b) / d + (g < b ? 6 : 0);
                        break;
                    case g:
                        h = (b - r) / d + 2;
                        break;
                    case b:
                        h = (r - g) / d + 4;
                        break;
                }
                h /= 6;
            }
            return [h, s, l];
        };
        ColorHSL.fromColorRGB = function (color) {
            var r = __aspxRichEdit.ColorHelper.getRed(color) / 255;
            var g = __aspxRichEdit.ColorHelper.getGreen(color) / 255;
            var b = __aspxRichEdit.ColorHelper.getBlue(color) / 255;
            var max = Math.max(r, g, b);
            var min = Math.min(r, g, b);
            var h;
            var s;
            var l = (max + min) / 2;
            if (max == min) {
                s = 0;
                h = 4.0 / 6.0;
            }
            else {
                var d = max - min;
                s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
                switch (max) {
                    case r:
                        h = (g - b) / d + (g < b ? 6 : 0);
                        break;
                    case g:
                        h = (b - r) / d + 2;
                        break;
                    case b:
                        h = (r - g) / d + 4;
                        break;
                }
                h /= 6;
            }
            return new ColorHSL(h, s, l);
        };
        ColorHSL.calculateColorRGB = function (color, tint) {
            if (color == __aspxRichEdit.DXColor.empty || tint == 0)
                return color;
            return ColorHSL.fromColorRGB(color).applyTint(tint).toRgb();
        };
        ColorHSL.prototype.toRgb = function () {
            var _this = this;
            var value1 = (this._luminance < 0.5) ?
                this._luminance * (1 + this._saturation) :
                this._luminance + this._saturation - this._luminance * this._saturation;
            var value2 = 2 * this._luminance - value1;
            var rgb = __aspxRichEdit.ListUtils.map([this._hue + 1.0 / 3.0, this._hue, this._hue - 1.0 / 3.0], function (value) {
                if (value < 0)
                    value += 1;
                if (value > 1)
                    value -= 1;
                if (6 * value < 1)
                    value = value2 + ((value1 - value2) * 6 * value);
                else if (6 * value >= 1 && 6 * value < 3)
                    value = value1;
                else if (6 * value >= 3 && 6 * value < 4)
                    value = value2 + ((value1 - value2) * (4 - 6 * value));
                else
                    value = value2;
                return _this.toIntValue(value);
            });
            return __aspxRichEdit.DXColor.fromRgb(rgb[0], rgb[1], rgb[2]);
        };
        Object.defineProperty(ColorHSL.prototype, "hue", {
            get: function () { return this.getIntValue(this._hue, ColorHSL.MaxAngle); },
            set: function (value) { this._hue = this.getFloatValue(this.getValidValue(value), ColorHSL.MaxAngle); },
            enumerable: true,
            configurable: true
        });
        ;
        Object.defineProperty(ColorHSL.prototype, "saturation", {
            get: function () { return this.getIntValue(this._saturation, ColorHSL.MaxThousandthOfPercentage); },
            set: function (value) { this._saturation = this.getFloatValue(this.getValidValue(value), ColorHSL.MaxThousandthOfPercentage); },
            enumerable: true,
            configurable: true
        });
        ;
        Object.defineProperty(ColorHSL.prototype, "luminance", {
            get: function () { return this.getIntValue(this._luminance, ColorHSL.MaxThousandthOfPercentage); },
            set: function (value) { this._luminance = this.getFloatValue(this.getValidValue(value), ColorHSL.MaxThousandthOfPercentage); },
            enumerable: true,
            configurable: true
        });
        ;
        Object.defineProperty(ColorHSL.prototype, "floatHue", {
            get: function () { return this._hue; },
            set: function (value) { this._hue = this.getValidValue(value); },
            enumerable: true,
            configurable: true
        });
        ;
        Object.defineProperty(ColorHSL.prototype, "floatSaturation", {
            get: function () { return this._saturation; },
            set: function (value) { this._saturation = this.getValidValue(value); },
            enumerable: true,
            configurable: true
        });
        ;
        Object.defineProperty(ColorHSL.prototype, "floatLuminance", {
            get: function () { return this._luminance; },
            set: function (value) { this._luminance = this.getValidValue(value); },
            enumerable: true,
            configurable: true
        });
        ;
        ColorHSL.prototype.getComplementColor = function () {
            this._hue += this._hue > 0.5 ? -0.5 : 0.5;
            return this;
        };
        ColorHSL.prototype.applyHue = function (value) {
            this.floatHue = value / ColorHSL.MaxAngle;
            return this;
        };
        ColorHSL.prototype.applyHueMod = function (value) {
            this._hue = this._hue * value / ColorHSL.MaxThousandthOfPercentage;
            this.fixHue();
            return this;
        };
        ColorHSL.prototype.applyHueOffset = function (value) {
            this._hue += value / ColorHSL.MaxAngle;
            this.fixHue();
            return this;
        };
        ColorHSL.prototype.applySaturation = function (value) {
            this.floatSaturation = value / ColorHSL.MaxThousandthOfPercentage;
            return this;
        };
        ColorHSL.prototype.applySaturationMod = function (value) {
            this._saturation = this._saturation * value / ColorHSL.MaxThousandthOfPercentage;
            return this;
        };
        ColorHSL.prototype.applySaturationOffset = function (value) {
            this._saturation += value / ColorHSL.MaxThousandthOfPercentage;
            return this;
        };
        ColorHSL.prototype.applyLuminance = function (value) {
            this.floatLuminance = value / ColorHSL.MaxThousandthOfPercentage;
            return this;
        };
        ColorHSL.prototype.applyLuminanceMod = function (value) {
            this._luminance = this._luminance * value / ColorHSL.MaxThousandthOfPercentage;
            return this;
        };
        ColorHSL.prototype.applyLuminanceOffset = function (value) {
            this._luminance += value / ColorHSL.MaxThousandthOfPercentage;
            return this;
        };
        ColorHSL.prototype.fixHue = function () {
            if (this._hue > 1)
                this._hue -= Math.floor(this._hue);
        };
        ColorHSL.prototype.toIntValue = function (value) {
            return this.fixIntValue(Math.round(255 * value));
        };
        ColorHSL.prototype.fixIntValue = function (value) {
            return __aspxRichEdit.Utils.restrictValue(value, 0, 255);
        };
        ColorHSL.prototype.getIntValue = function (value, maxValue) {
            return Math.round(value * maxValue);
        };
        ColorHSL.prototype.getFloatValue = function (value, maxValue) {
            return value / maxValue;
        };
        ColorHSL.prototype.getValidValue = function (value) {
            return __aspxRichEdit.Utils.restrictValue(value, 0, 1);
        };
        ColorHSL.prototype.applyTint = function (tint) {
            if (tint < 0)
                this._luminance *= (1 + tint);
            else if (tint > 0)
                this._luminance = this._luminance * (1 - tint) + tint;
            return this;
        };
        ColorHSL.prototype.equals = function (obj) {
            return obj &&
                this._hue == obj._hue &&
                this._saturation == obj._saturation &&
                this._luminance == obj._luminance;
        };
        ColorHSL.MaxAngle = __aspxRichEdit.DrawingValueConstants.MaxPositiveFixedAngle;
        ColorHSL.MaxThousandthOfPercentage = __aspxRichEdit.DrawingValueConstants.ThousandthOfPercentage;
        ColorHSL.defaultValue = new ColorHSL(0, 0, 0);
        return ColorHSL;
    }());
    __aspxRichEdit.ColorHSL = ColorHSL;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DrawingColorModelInfo = (function () {
        function DrawingColorModelInfo() {
            this.restoreDefaultValues();
        }
        DrawingColorModelInfo.prototype.calculateHash = function () {
            var hash = __aspxRichEdit.MathUtils.somePrimes[10] * this._colorType;
            switch (this._colorType) {
                case __aspxRichEdit.DrawingColorType.Hsl:
                    hash ^= __aspxRichEdit.MathUtils.somePrimes[0] * this._hsl.calculateHash();
                    break;
                case __aspxRichEdit.DrawingColorType.Preset:
                    hash ^= __aspxRichEdit.MathUtils.somePrimes[1] * __aspxRichEdit.StringUtils.stringHashCode(this._preset);
                    break;
                case __aspxRichEdit.DrawingColorType.Rgb:
                    hash ^= __aspxRichEdit.MathUtils.somePrimes[2] * this._rgb;
                    break;
                case __aspxRichEdit.DrawingColorType.Scheme:
                    hash ^= __aspxRichEdit.MathUtils.somePrimes[3] * this._schemeColor;
                    break;
                case __aspxRichEdit.DrawingColorType.ScRgb:
                    hash ^= __aspxRichEdit.MathUtils.somePrimes[4] * this._scRgb.calculateHash();
                    break;
                case __aspxRichEdit.DrawingColorType.System:
                    hash ^= __aspxRichEdit.MathUtils.somePrimes[5] * this._systemColor;
                    break;
            }
            return hash;
        };
        DrawingColorModelInfo.prototype.getHashCode = function () {
            return this.hash === undefined ? this.hash = this.calculateHash() : this.hash;
        };
        DrawingColorModelInfo.prototype.setColorType = function (colorType) {
            this.restoreDefaultValues();
            this._colorType = colorType;
        };
        Object.defineProperty(DrawingColorModelInfo.prototype, "colorType", {
            get: function () { return this._colorType; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(DrawingColorModelInfo.prototype, "rgb", {
            get: function () {
                return this._rgb;
            },
            set: function (value) {
                if (this._colorType != __aspxRichEdit.DrawingColorType.Rgb)
                    this.setColorType(__aspxRichEdit.DrawingColorType.Rgb);
                if (this._rgb != value)
                    this._rgb = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(DrawingColorModelInfo.prototype, "systemColor", {
            get: function () {
                return this._systemColor;
            },
            set: function (value) {
                if (this._colorType != __aspxRichEdit.DrawingColorType.System)
                    this.setColorType(__aspxRichEdit.DrawingColorType.System);
                if (this._systemColor != value)
                    this._systemColor = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(DrawingColorModelInfo.prototype, "schemeColor", {
            get: function () {
                return this._schemeColor;
            },
            set: function (value) {
                if (this._colorType != __aspxRichEdit.DrawingColorType.Scheme)
                    this.setColorType(__aspxRichEdit.DrawingColorType.Scheme);
                if (this._schemeColor != value)
                    this._schemeColor = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(DrawingColorModelInfo.prototype, "hsl", {
            get: function () {
                return this._hsl;
            },
            set: function (value) {
                if (this._colorType != __aspxRichEdit.DrawingColorType.Hsl)
                    this.setColorType(__aspxRichEdit.DrawingColorType.Hsl);
                if (!this._hsl.equals(value))
                    this._hsl = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(DrawingColorModelInfo.prototype, "preset", {
            get: function () {
                return this._preset;
            },
            set: function (value) {
                if (this._colorType != __aspxRichEdit.DrawingColorType.Preset)
                    this.setColorType(__aspxRichEdit.DrawingColorType.Preset);
                if (this._preset != value && !__aspxRichEdit.StringUtils.isNullOrEmpty(value))
                    this._preset = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(DrawingColorModelInfo.prototype, "scRgb", {
            get: function () {
                return this._scRgb;
            },
            set: function (value) {
                if (this._colorType != __aspxRichEdit.DrawingColorType.ScRgb)
                    this.setColorType(__aspxRichEdit.DrawingColorType.ScRgb);
                if (!this._scRgb.equals(value))
                    this._scRgb = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(DrawingColorModelInfo.prototype, "isEmpty", {
            get: function () {
                return __aspxRichEdit.DXColor.isTransparentOrEmpty(this._rgb) && this._colorType == __aspxRichEdit.DrawingColorType.Rgb;
            },
            enumerable: true,
            configurable: true
        });
        DrawingColorModelInfo.createRGB = function (rgb) {
            var result = new DrawingColorModelInfo();
            result.rgb = __aspxRichEdit.DXColor.fromArgb(255, rgb);
            return result;
        };
        DrawingColorModelInfo.createARGB = function (argb) {
            var result = new DrawingColorModelInfo();
            result.rgb = argb;
            return result;
        };
        DrawingColorModelInfo.createSystem = function (systemColor) {
            var result = new DrawingColorModelInfo();
            result.systemColor = systemColor;
            return result;
        };
        DrawingColorModelInfo.createScheme = function (schemeColor) {
            var result = new DrawingColorModelInfo();
            result.schemeColor = schemeColor;
            return result;
        };
        DrawingColorModelInfo.createPreset = function (preset) {
            var result = new DrawingColorModelInfo();
            result.preset = preset;
            return result;
        };
        DrawingColorModelInfo.createScRgb = function (scColor) {
            var result = new DrawingColorModelInfo();
            result.scRgb = scColor;
            return result;
        };
        DrawingColorModelInfo.createHSL = function (hsl) {
            var result = new DrawingColorModelInfo();
            result.hsl = hsl;
            return result;
        };
        DrawingColorModelInfo.sRgbToRgb = function (hexColor) {
            return __aspxRichEdit.ColorHelper.hashToColor(hexColor);
        };
        DrawingColorModelInfo.prototype.toRgb = function (colorProvider, styleColor) {
            if (styleColor === void 0) { styleColor = __aspxRichEdit.DXColor.empty; }
            switch (this._colorType) {
                case __aspxRichEdit.DrawingColorType.System:
                    return this.getRgbFromSystemColor();
                case __aspxRichEdit.DrawingColorType.Scheme:
                    return this.getRgbFromSchemeColor(colorProvider, styleColor);
                case __aspxRichEdit.DrawingColorType.Hsl:
                    return this._hsl.toRgb();
                case __aspxRichEdit.DrawingColorType.Preset:
                    return this.getRgbFromPreset();
                case __aspxRichEdit.DrawingColorType.ScRgb:
                    return this._scRgb.toRgb();
                default:
                    return this._rgb;
            }
        };
        DrawingColorModelInfo.prototype.getRgbFromPreset = function () {
            var predefColor = __aspxRichEdit.ColorHelper.colorNames[this._preset];
            return predefColor === undefined ? __aspxRichEdit.DXColor.empty : predefColor;
        };
        DrawingColorModelInfo.prototype.getRgbFromSystemColor = function () {
            return this._systemColor == __aspxRichEdit.SystemColorValues.Empty ? __aspxRichEdit.DXColor.empty : DrawingColorModelInfo.systemColorTable[this._systemColor];
        };
        DrawingColorModelInfo.prototype.getRgbFromSchemeColor = function (colorProvider, styleColor) {
            if (this._schemeColor == __aspxRichEdit.SchemeColorValues.Style)
                return styleColor;
            return this._schemeColor == __aspxRichEdit.SchemeColorValues.Empty ? __aspxRichEdit.DXColor.empty : colorProvider.officeTheme.colors.getColorBySchemeColorValues(colorProvider, this._schemeColor);
        };
        DrawingColorModelInfo.prototype.restoreDefaultValues = function () {
            this._rgb = __aspxRichEdit.DXColor.empty;
            this._schemeColor = __aspxRichEdit.SchemeColorValues.Empty;
            this._systemColor = __aspxRichEdit.SystemColorValues.Empty;
            this._preset = "";
            this._scRgb = __aspxRichEdit.ScRGBColor.defaultValue;
            this._hsl = __aspxRichEdit.ColorHSL.defaultValue;
        };
        DrawingColorModelInfo.prototype.clone = function () {
            var result = new DrawingColorModelInfo();
            result.copyFrom(this);
            return result;
        };
        DrawingColorModelInfo.prototype.copyFrom = function (value) {
            this._colorType = value._colorType;
            this._rgb = value._rgb;
            this._schemeColor = value._schemeColor;
            this._systemColor = value._systemColor;
            this._preset = value._preset;
            this._scRgb = value._scRgb;
            this._hsl = value._hsl;
        };
        DrawingColorModelInfo.prototype.equals = function (obj) {
            return obj &&
                this._colorType == obj._colorType &&
                this._rgb == obj._rgb &&
                this._schemeColor == obj._schemeColor &&
                this._systemColor == obj._systemColor &&
                this._preset == obj._preset &&
                this._scRgb.equals(obj._scRgb) &&
                this._hsl.equals(obj._hsl);
        };
        DrawingColorModelInfo.empty = new DrawingColorModelInfo();
        DrawingColorModelInfo.systemColorTable = new __aspxRichEdit.MapCreatorNumberAsKey()
            .add(__aspxRichEdit.SystemColorValues.Sc3dDkShadow, __aspxRichEdit.DXSystemColors.controlDarkDark)
            .add(__aspxRichEdit.SystemColorValues.Sc3dLight, __aspxRichEdit.DXSystemColors.controlLightLight)
            .add(__aspxRichEdit.SystemColorValues.ScActiveBorder, __aspxRichEdit.DXSystemColors.activeBorder)
            .add(__aspxRichEdit.SystemColorValues.ScActiveCaption, __aspxRichEdit.DXSystemColors.activeCaption)
            .add(__aspxRichEdit.SystemColorValues.ScAppWorkspace, __aspxRichEdit.DXSystemColors.appWorkspace)
            .add(__aspxRichEdit.SystemColorValues.ScBackground, __aspxRichEdit.DXSystemColors.desktop)
            .add(__aspxRichEdit.SystemColorValues.ScBtnFace, __aspxRichEdit.DXSystemColors.control)
            .add(__aspxRichEdit.SystemColorValues.ScBtnHighlight, __aspxRichEdit.DXSystemColors.controlLight)
            .add(__aspxRichEdit.SystemColorValues.ScBtnShadow, __aspxRichEdit.DXSystemColors.controlDark)
            .add(__aspxRichEdit.SystemColorValues.ScBtnText, __aspxRichEdit.DXSystemColors.controlText)
            .add(__aspxRichEdit.SystemColorValues.ScCaptionText, __aspxRichEdit.DXSystemColors.activeCaptionText)
            .add(__aspxRichEdit.SystemColorValues.ScGradientActiveCaption, __aspxRichEdit.DXSystemColors.gradientActiveCaption)
            .add(__aspxRichEdit.SystemColorValues.ScGradientInactiveCaption, __aspxRichEdit.DXSystemColors.gradientInactiveCaption)
            .add(__aspxRichEdit.SystemColorValues.ScGrayText, __aspxRichEdit.DXSystemColors.grayText)
            .add(__aspxRichEdit.SystemColorValues.ScHighlight, __aspxRichEdit.DXSystemColors.highlight)
            .add(__aspxRichEdit.SystemColorValues.ScHighlightText, __aspxRichEdit.DXSystemColors.highlightText)
            .add(__aspxRichEdit.SystemColorValues.ScHotLight, __aspxRichEdit.DXSystemColors.hotTrack)
            .add(__aspxRichEdit.SystemColorValues.ScInactiveBorder, __aspxRichEdit.DXSystemColors.inactiveBorder)
            .add(__aspxRichEdit.SystemColorValues.ScInactiveCaption, __aspxRichEdit.DXSystemColors.inactiveCaption)
            .add(__aspxRichEdit.SystemColorValues.ScInactiveCaptionText, __aspxRichEdit.DXSystemColors.inactiveCaptionText)
            .add(__aspxRichEdit.SystemColorValues.ScInfoBk, __aspxRichEdit.DXSystemColors.info)
            .add(__aspxRichEdit.SystemColorValues.ScInfoText, __aspxRichEdit.DXSystemColors.infoText)
            .add(__aspxRichEdit.SystemColorValues.ScMenu, __aspxRichEdit.DXSystemColors.menu)
            .add(__aspxRichEdit.SystemColorValues.ScMenuBar, __aspxRichEdit.DXSystemColors.menuBar)
            .add(__aspxRichEdit.SystemColorValues.ScMenuHighlight, __aspxRichEdit.DXSystemColors.menuHighlight)
            .add(__aspxRichEdit.SystemColorValues.ScMenuText, __aspxRichEdit.DXSystemColors.menuText)
            .add(__aspxRichEdit.SystemColorValues.ScScrollBar, __aspxRichEdit.DXSystemColors.scrollBar)
            .add(__aspxRichEdit.SystemColorValues.ScWindow, __aspxRichEdit.DXSystemColors.window)
            .add(__aspxRichEdit.SystemColorValues.ScWindowFrame, __aspxRichEdit.DXSystemColors.windowFrame)
            .add(__aspxRichEdit.SystemColorValues.ScWindowText, __aspxRichEdit.DXSystemColors.windowText)
            .get();
        return DrawingColorModelInfo;
    }());
    __aspxRichEdit.DrawingColorModelInfo = DrawingColorModelInfo;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ColorTransformBase = (function () {
        function ColorTransformBase() {
        }
        ColorTransformBase.prototype.applyInverseDefaultGamma = function (normalRgb) {
            if (normalRgb < 0)
                return 0;
            if (normalRgb <= 0.04045)
                return normalRgb / 12.92;
            if (normalRgb < 1)
                return Math.pow((normalRgb + 0.055) / 1.055, 2.4);
            return 1;
        };
        ColorTransformBase.prototype.applyInverseDefaultGammaByColor = function (color) {
            return __aspxRichEdit.DXColor.fromRgb(this.toIntValue(this.applyInverseDefaultGamma(this.toDoubleValue(__aspxRichEdit.ColorHelper.getRed(color)))), this.toIntValue(this.applyInverseDefaultGamma(this.toDoubleValue(__aspxRichEdit.ColorHelper.getGreen(color)))), this.toIntValue(this.applyInverseDefaultGamma(this.toDoubleValue(__aspxRichEdit.ColorHelper.getBlue(color)))));
        };
        ColorTransformBase.prototype.applyDefaultGamma = function (normalRgb) {
            if (normalRgb < 0)
                return 0;
            if (normalRgb <= 0.0031308)
                return normalRgb * 12.92;
            if (normalRgb < 1)
                return 1.055 * Math.pow(normalRgb, 1.0 / 2.4) - 0.055;
            return 1;
        };
        ColorTransformBase.prototype.applyDefaultGammaByColor = function (color) {
            return __aspxRichEdit.DXColor.fromRgb(this.toIntValue(this.applyDefaultGamma(this.toDoubleValue(__aspxRichEdit.ColorHelper.getRed(color)))), this.toIntValue(this.applyDefaultGamma(this.toDoubleValue(__aspxRichEdit.ColorHelper.getGreen(color)))), this.toIntValue(this.applyDefaultGamma(this.toDoubleValue(__aspxRichEdit.ColorHelper.getBlue(color)))));
        };
        ColorTransformBase.prototype.toDoubleValue = function (value) {
            return value / 255.0;
        };
        ColorTransformBase.prototype.toIntValue = function (value) {
            return this.getFixRGBValue(Math.round(255 * value));
        };
        ColorTransformBase.prototype.getFixRGBValue = function (rgb) {
            return __aspxRichEdit.Utils.restrictValue(rgb, 0, 255);
        };
        return ColorTransformBase;
    }());
    __aspxRichEdit.ColorTransformBase = ColorTransformBase;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ColorTransformValueBase = (function (_super) {
        __extends(ColorTransformValueBase, _super);
        function ColorTransformValueBase(value) {
            var _this = _super.call(this) || this;
            _this.value = value;
            return _this;
        }
        ColorTransformValueBase.prototype.equals = function (obj) {
            return obj &&
                obj instanceof ColorTransformValueBase &&
                this.value == obj.value;
        };
        ColorTransformValueBase.prototype.getRGBFromValue = function () {
            var rgb = this.value / __aspxRichEdit.DrawingValueConstants.ThousandthOfPercentage;
            return this.toIntValue(this.applyDefaultGamma(rgb));
        };
        ColorTransformValueBase.prototype.applyRGBOffsetNormalized = function (normalRgb, offset) {
            return this.getFixRGBNormalValue(normalRgb + offset);
        };
        ColorTransformValueBase.prototype.applyRGBOffset = function (rgb) {
            var offset = this.value / __aspxRichEdit.DrawingValueConstants.ThousandthOfPercentage;
            return this.toIntValue(this.applyDefaultGamma(this.applyRGBOffsetNormalized(this.applyInverseDefaultGamma(this.toDoubleValue(rgb)), offset)));
        };
        ColorTransformValueBase.prototype.applyRGBModulationNormalized = function (normalRgb, modulation) {
            return this.getFixRGBNormalValue(normalRgb * modulation);
        };
        ColorTransformValueBase.prototype.applyRGBModulation = function (rgb) {
            var modulation = this.value / __aspxRichEdit.DrawingValueConstants.ThousandthOfPercentage;
            return this.applyRGBModulationCore(rgb, modulation);
        };
        ColorTransformValueBase.prototype.getFixRGBNormalValue = function (rgb) {
            return __aspxRichEdit.Utils.restrictValue(rgb, 0, 1);
        };
        ColorTransformValueBase.prototype.applyRGBModulationCore = function (rgb, modulation) {
            return this.toIntValue(this.applyDefaultGamma(this.applyRGBModulationNormalized(this.applyInverseDefaultGamma(this.toDoubleValue(rgb)), modulation)));
        };
        return ColorTransformValueBase;
    }(__aspxRichEdit.ColorTransformBase));
    __aspxRichEdit.ColorTransformValueBase = ColorTransformValueBase;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Scene3DPropertiesInfo = (function () {
        function Scene3DPropertiesInfo() {
            this.packedValues = 0x00000000;
            this.zoom = __aspxRichEdit.DrawingValueConstants.ThousandthOfPercentage;
        }
        Object.defineProperty(Scene3DPropertiesInfo.prototype, "cameraType", {
            get: function () { return this.getUIntValue(Scene3DPropertiesInfo.maskPresetCameraType, 0); },
            set: function (value) { this.setUIntValue(Scene3DPropertiesInfo.maskPresetCameraType, 0, value); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Scene3DPropertiesInfo.prototype, "lightRigDirection", {
            get: function () { return this.getUIntValue(Scene3DPropertiesInfo.maskLightRigDirection, 6); },
            set: function (value) { this.setUIntValue(Scene3DPropertiesInfo.maskLightRigDirection, 6, value); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Scene3DPropertiesInfo.prototype, "lightRigPreset", {
            get: function () { return this.getUIntValue(Scene3DPropertiesInfo.maskLightRigPreset, 10); },
            set: function (value) { this.setUIntValue(Scene3DPropertiesInfo.maskLightRigPreset, 10, value); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Scene3DPropertiesInfo.prototype, "hasCameraRotation", {
            get: function () { return this.getBooleanValue(Scene3DPropertiesInfo.maskHasCameraRotation); },
            set: function (value) { this.setBooleanValue(Scene3DPropertiesInfo.maskHasCameraRotation, value); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Scene3DPropertiesInfo.prototype, "hasLightRigRotation", {
            get: function () { return this.getBooleanValue(Scene3DPropertiesInfo.maskHasLightRigRotation); },
            set: function (value) { this.setBooleanValue(Scene3DPropertiesInfo.maskHasLightRigRotation, value); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Scene3DPropertiesInfo.prototype, "isDefault", {
            get: function () { return this.equals(Scene3DPropertiesInfo.defaultInfo); },
            enumerable: true,
            configurable: true
        });
        Scene3DPropertiesInfo.prototype.calculateHash = function () {
            return __aspxRichEdit.MathUtils.somePrimes[0] * this.packedValues ^
                __aspxRichEdit.MathUtils.somePrimes[1] * this.fov ^
                __aspxRichEdit.MathUtils.somePrimes[2] * this.zoom;
        };
        Scene3DPropertiesInfo.prototype.getHashCode = function () {
            return this.hash === undefined ? this.hash = this.calculateHash() : this.hash;
        };
        Scene3DPropertiesInfo.prototype.getUIntValue = function (mask, offsetBits) {
            return (this.packedValues & mask) >> offsetBits;
        };
        Scene3DPropertiesInfo.prototype.setUIntValue = function (mask, offsetBits, value) {
            this.packedValues = ~mask;
            this.packedValues |= (value << offsetBits) & mask;
        };
        Scene3DPropertiesInfo.prototype.setBooleanValue = function (mask, bitVal) {
            this.packedValues = bitVal ? (this.packedValues || mask) : (this.packedValues && ~mask);
        };
        Scene3DPropertiesInfo.prototype.getBooleanValue = function (mask) {
            return (this.packedValues & mask) != 0;
        };
        Scene3DPropertiesInfo.prototype.equals = function (obj) {
            return obj &&
                this.packedValues == obj.packedValues &&
                this.fov == obj.fov &&
                this.zoom == obj.zoom;
        };
        Scene3DPropertiesInfo.prototype.clone = function () {
            var obj = new Scene3DPropertiesInfo();
            obj.packedValues = this.packedValues;
            obj.fov = this.fov;
            obj.zoom = this.zoom;
            return obj;
        };
        Scene3DPropertiesInfo.defaultInfo = new Scene3DPropertiesInfo();
        Scene3DPropertiesInfo.maskPresetCameraType = 0x0000003F;
        Scene3DPropertiesInfo.maskLightRigDirection = 0x000003C0;
        Scene3DPropertiesInfo.maskLightRigPreset = 0x00007C00;
        Scene3DPropertiesInfo.maskHasCameraRotation = 0x00008000;
        Scene3DPropertiesInfo.maskHasLightRigRotation = 0x00010000;
        return Scene3DPropertiesInfo;
    }());
    __aspxRichEdit.Scene3DPropertiesInfo = Scene3DPropertiesInfo;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Scene3DRotationInfo = (function () {
        function Scene3DRotationInfo(latitude, longitude, revolution) {
            if (latitude === void 0) { latitude = 0; }
            if (longitude === void 0) { longitude = 0; }
            if (revolution === void 0) { revolution = 0; }
            this.latitude = latitude;
            this.longitude = longitude;
            this.revolution = revolution;
        }
        Scene3DRotationInfo.prototype.calculateHash = function () {
            return __aspxRichEdit.MathUtils.somePrimes[0] * this.latitude ^
                __aspxRichEdit.MathUtils.somePrimes[1] * this.longitude ^
                __aspxRichEdit.MathUtils.somePrimes[2] * this.revolution;
        };
        Scene3DRotationInfo.prototype.getHashCode = function () {
            return this.hash === undefined ? this.hash = this.calculateHash() : this.hash;
        };
        Scene3DRotationInfo.prototype.equals = function (obj) {
            return obj &&
                this.latitude == obj.latitude &&
                this.longitude == obj.longitude &&
                this.revolution == obj.revolution;
        };
        Scene3DRotationInfo.prototype.clone = function () {
            var obj = new Scene3DRotationInfo();
            obj.latitude = this.latitude;
            obj.longitude = this.longitude;
            obj.revolution = this.revolution;
            return obj;
        };
        Scene3DRotationInfo.defaultInfo = new Scene3DRotationInfo();
        return Scene3DRotationInfo;
    }());
    __aspxRichEdit.Scene3DRotationInfo = Scene3DRotationInfo;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ShadingPattern;
    (function (ShadingPattern) {
        ShadingPattern[ShadingPattern["Clear"] = 0] = "Clear";
        ShadingPattern[ShadingPattern["DiagCross"] = 1] = "DiagCross";
        ShadingPattern[ShadingPattern["DiagStripe"] = 2] = "DiagStripe";
        ShadingPattern[ShadingPattern["HorzCross"] = 3] = "HorzCross";
        ShadingPattern[ShadingPattern["HorzStripe"] = 4] = "HorzStripe";
        ShadingPattern[ShadingPattern["Nil"] = 5] = "Nil";
        ShadingPattern[ShadingPattern["Pct5"] = 6] = "Pct5";
        ShadingPattern[ShadingPattern["Pct10"] = 7] = "Pct10";
        ShadingPattern[ShadingPattern["Pct12"] = 8] = "Pct12";
        ShadingPattern[ShadingPattern["Pct15"] = 9] = "Pct15";
        ShadingPattern[ShadingPattern["Pct20"] = 10] = "Pct20";
        ShadingPattern[ShadingPattern["Pct25"] = 11] = "Pct25";
        ShadingPattern[ShadingPattern["Pct30"] = 12] = "Pct30";
        ShadingPattern[ShadingPattern["Pct35"] = 13] = "Pct35";
        ShadingPattern[ShadingPattern["Pct37"] = 14] = "Pct37";
        ShadingPattern[ShadingPattern["Pct40"] = 15] = "Pct40";
        ShadingPattern[ShadingPattern["Pct45"] = 16] = "Pct45";
        ShadingPattern[ShadingPattern["Pct50"] = 17] = "Pct50";
        ShadingPattern[ShadingPattern["Pct55"] = 18] = "Pct55";
        ShadingPattern[ShadingPattern["Pct60"] = 19] = "Pct60";
        ShadingPattern[ShadingPattern["Pct62"] = 20] = "Pct62";
        ShadingPattern[ShadingPattern["Pct65"] = 21] = "Pct65";
        ShadingPattern[ShadingPattern["Pct70"] = 22] = "Pct70";
        ShadingPattern[ShadingPattern["Pct75"] = 23] = "Pct75";
        ShadingPattern[ShadingPattern["Pct80"] = 24] = "Pct80";
        ShadingPattern[ShadingPattern["Pct85"] = 25] = "Pct85";
        ShadingPattern[ShadingPattern["Pct87"] = 26] = "Pct87";
        ShadingPattern[ShadingPattern["Pct90"] = 27] = "Pct90";
        ShadingPattern[ShadingPattern["Pct95"] = 28] = "Pct95";
        ShadingPattern[ShadingPattern["ReverseDiagStripe"] = 29] = "ReverseDiagStripe";
        ShadingPattern[ShadingPattern["Solid"] = 30] = "Solid";
        ShadingPattern[ShadingPattern["ThinDiagCross"] = 31] = "ThinDiagCross";
        ShadingPattern[ShadingPattern["ThinDiagStripe"] = 32] = "ThinDiagStripe";
        ShadingPattern[ShadingPattern["ThinHorzCross"] = 33] = "ThinHorzCross";
        ShadingPattern[ShadingPattern["ThinHorzStripe"] = 34] = "ThinHorzStripe";
        ShadingPattern[ShadingPattern["ThinReverseDiagStripe"] = 35] = "ThinReverseDiagStripe";
        ShadingPattern[ShadingPattern["ThinVertStripe"] = 36] = "ThinVertStripe";
        ShadingPattern[ShadingPattern["VertStripe"] = 37] = "VertStripe";
        ShadingPattern[ShadingPattern["Pct2"] = 38] = "Pct2";
        ShadingPattern[ShadingPattern["Pct7"] = 39] = "Pct7";
        ShadingPattern[ShadingPattern["Pct17"] = 40] = "Pct17";
        ShadingPattern[ShadingPattern["Pct22"] = 41] = "Pct22";
        ShadingPattern[ShadingPattern["Pct27"] = 42] = "Pct27";
        ShadingPattern[ShadingPattern["Pct32"] = 43] = "Pct32";
        ShadingPattern[ShadingPattern["Pct42"] = 44] = "Pct42";
        ShadingPattern[ShadingPattern["Pct47"] = 45] = "Pct47";
        ShadingPattern[ShadingPattern["Pct52"] = 46] = "Pct52";
        ShadingPattern[ShadingPattern["Pct57"] = 47] = "Pct57";
        ShadingPattern[ShadingPattern["Pct67"] = 48] = "Pct67";
        ShadingPattern[ShadingPattern["Pct72"] = 49] = "Pct72";
        ShadingPattern[ShadingPattern["Pct77"] = 50] = "Pct77";
        ShadingPattern[ShadingPattern["Pct82"] = 51] = "Pct82";
        ShadingPattern[ShadingPattern["Pct92"] = 52] = "Pct92";
        ShadingPattern[ShadingPattern["Pct97"] = 53] = "Pct97";
    })(ShadingPattern = __aspxRichEdit.ShadingPattern || (__aspxRichEdit.ShadingPattern = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ShadingPatternInfo = (function () {
        function ShadingPatternInfo(shadingPatternValue, shadingPattern) {
            this.shadingPatternValue = shadingPatternValue;
            this.shadingPattern = shadingPattern;
        }
        return ShadingPatternInfo;
    }());
    var ShadingHelper = (function () {
        function ShadingHelper() {
        }
        ShadingHelper.initStatics = function () {
            ShadingHelper.infos = [
                new ShadingPatternInfo(0, __aspxRichEdit.ShadingPattern.Clear),
                new ShadingPatternInfo(25, __aspxRichEdit.ShadingPattern.Pct2),
                new ShadingPatternInfo(50, __aspxRichEdit.ShadingPattern.Pct5),
                new ShadingPatternInfo(75, __aspxRichEdit.ShadingPattern.Pct7),
                new ShadingPatternInfo(100, __aspxRichEdit.ShadingPattern.Pct10),
                new ShadingPatternInfo(125, __aspxRichEdit.ShadingPattern.Pct12),
                new ShadingPatternInfo(150, __aspxRichEdit.ShadingPattern.Pct15),
                new ShadingPatternInfo(175, __aspxRichEdit.ShadingPattern.Pct17),
                new ShadingPatternInfo(200, __aspxRichEdit.ShadingPattern.Pct20),
                new ShadingPatternInfo(225, __aspxRichEdit.ShadingPattern.Pct22),
                new ShadingPatternInfo(250, __aspxRichEdit.ShadingPattern.Pct25),
                new ShadingPatternInfo(275, __aspxRichEdit.ShadingPattern.Pct27),
                new ShadingPatternInfo(300, __aspxRichEdit.ShadingPattern.Pct30),
                new ShadingPatternInfo(325, __aspxRichEdit.ShadingPattern.Pct32),
                new ShadingPatternInfo(350, __aspxRichEdit.ShadingPattern.Pct35),
                new ShadingPatternInfo(375, __aspxRichEdit.ShadingPattern.Pct37),
                new ShadingPatternInfo(400, __aspxRichEdit.ShadingPattern.Pct40),
                new ShadingPatternInfo(425, __aspxRichEdit.ShadingPattern.Pct42),
                new ShadingPatternInfo(450, __aspxRichEdit.ShadingPattern.Pct45),
                new ShadingPatternInfo(475, __aspxRichEdit.ShadingPattern.Pct47),
                new ShadingPatternInfo(500, __aspxRichEdit.ShadingPattern.Pct50),
                new ShadingPatternInfo(525, __aspxRichEdit.ShadingPattern.Pct52),
                new ShadingPatternInfo(550, __aspxRichEdit.ShadingPattern.Pct55),
                new ShadingPatternInfo(575, __aspxRichEdit.ShadingPattern.Pct57),
                new ShadingPatternInfo(600, __aspxRichEdit.ShadingPattern.Pct60),
                new ShadingPatternInfo(625, __aspxRichEdit.ShadingPattern.Pct62),
                new ShadingPatternInfo(650, __aspxRichEdit.ShadingPattern.Pct65),
                new ShadingPatternInfo(675, __aspxRichEdit.ShadingPattern.Pct67),
                new ShadingPatternInfo(700, __aspxRichEdit.ShadingPattern.Pct70),
                new ShadingPatternInfo(725, __aspxRichEdit.ShadingPattern.Pct72),
                new ShadingPatternInfo(750, __aspxRichEdit.ShadingPattern.Pct75),
                new ShadingPatternInfo(775, __aspxRichEdit.ShadingPattern.Pct77),
                new ShadingPatternInfo(800, __aspxRichEdit.ShadingPattern.Pct80),
                new ShadingPatternInfo(825, __aspxRichEdit.ShadingPattern.Pct82),
                new ShadingPatternInfo(850, __aspxRichEdit.ShadingPattern.Pct85),
                new ShadingPatternInfo(875, __aspxRichEdit.ShadingPattern.Pct87),
                new ShadingPatternInfo(900, __aspxRichEdit.ShadingPattern.Pct90),
                new ShadingPatternInfo(925, __aspxRichEdit.ShadingPattern.Pct92),
                new ShadingPatternInfo(950, __aspxRichEdit.ShadingPattern.Pct95),
                new ShadingPatternInfo(975, __aspxRichEdit.ShadingPattern.Pct97),
                new ShadingPatternInfo(1000, __aspxRichEdit.ShadingPattern.Solid),
            ];
            ShadingHelper.shadingPatterns = {};
            ShadingHelper.patternMultipliers = {};
            for (var _i = 0, _a = ShadingHelper.infos; _i < _a.length; _i++) {
                var info = _a[_i];
                ShadingHelper.shadingPatterns[info.shadingPatternValue] = info.shadingPattern;
                ShadingHelper.patternMultipliers[info.shadingPattern] = info.shadingPatternValue;
            }
            return ShadingHelper.infos;
        };
        ShadingHelper.calculateShadingPattern = function (shadingPatternValue) {
            var value = ShadingHelper.shadingPatterns[shadingPatternValue];
            return value === undefined ? __aspxRichEdit.ShadingPattern.Clear : value;
        };
        ShadingHelper.getShadingPattern = function (index) {
            return ShadingHelper.infos[index].shadingPattern;
        };
        ShadingHelper.calculateShadingPatternValue = function (shadingPattern) {
            var value = ShadingHelper.patternMultipliers[shadingPattern];
            return value === undefined ? -1 : value;
        };
        ShadingHelper.getActualBackColor = function (fill, patternColor, pattern) {
            if (pattern == __aspxRichEdit.ShadingPattern.Clear || pattern == __aspxRichEdit.ShadingPattern.Nil)
                return fill;
            var white = __aspxRichEdit.ColorHelper.getPredefinedColor(__aspxRichEdit.ColorHelper.colorNames.white);
            if ((__aspxRichEdit.DXColor.isTransparentOrEmpty(fill) || fill == white) && __aspxRichEdit.DXColor.isTransparentOrEmpty(patternColor)) {
                var multiplier = ShadingHelper.patternMultipliers[pattern];
                if (multiplier !== undefined) {
                    var intensity = 255 * (1000 - multiplier) / 1000;
                    return __aspxRichEdit.DXColor.fromRgb(intensity, intensity, intensity);
                }
            }
            return pattern != __aspxRichEdit.ShadingPattern.Solid && !__aspxRichEdit.DXColor.isTransparentOrEmpty(fill) ? fill : patternColor;
        };
        ShadingHelper.getActualBackColorByMultiplier = function (fill, patternColor, multiplier) {
            var white = __aspxRichEdit.ColorHelper.getPredefinedColor(__aspxRichEdit.ColorHelper.colorNames.white);
            if ((__aspxRichEdit.DXColor.isTransparentOrEmpty(fill) || fill == white) && __aspxRichEdit.DXColor.isTransparentOrEmpty(patternColor)) {
                var intensity = 255 * (1000 - multiplier) / 1000;
                return __aspxRichEdit.DXColor.fromRgb(intensity, intensity, intensity);
            }
            return multiplier == 1000 ? fill : patternColor;
        };
        ShadingHelper.infos = ShadingHelper.initStatics();
        return ShadingHelper;
    }());
    __aspxRichEdit.ShadingHelper = ShadingHelper;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ShadingInfo = (function () {
        function ShadingInfo(shadingPattern, backColor, foreColor) {
            this.shadingPattern = shadingPattern;
            this.backColor = backColor;
            this.foreColor = foreColor;
        }
        Object.defineProperty(ShadingInfo, "noColor", {
            get: function () { return ShadingInfo.createByColor(__aspxRichEdit.ColorModelInfo.noColor); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ShadingInfo, "nullColor", {
            get: function () { return ShadingInfo.createByColor(__aspxRichEdit.ColorModelInfo.makeByColor(0)); },
            enumerable: true,
            configurable: true
        });
        ShadingInfo.createByColor = function (backColor) {
            return new ShadingInfo(__aspxRichEdit.ShadingPattern.Clear, backColor, __aspxRichEdit.ColorModelInfo.nullColor);
        };
        ShadingInfo.createByFullData = function (cache, pattern, fill, patternColor) {
            return new ShadingInfo(pattern, cache.getItem(__aspxRichEdit.ColorModelInfo.makeByColor(fill)), cache.getItem(__aspxRichEdit.ColorModelInfo.makeByColor(patternColor)));
        };
        ShadingInfo.prototype.getActualColor = function (colorProvider) {
            var fill = this.backColor.toRgb(colorProvider);
            var patternColor = this.foreColor.toRgb(colorProvider);
            return __aspxRichEdit.ShadingHelper.getActualBackColor(fill, patternColor, this.shadingPattern);
        };
        ShadingInfo.prototype.equals = function (obj) {
            return obj &&
                this.shadingPattern == obj.shadingPattern &&
                this.backColor.equals(obj.backColor) &&
                this.foreColor.equals(obj.foreColor);
        };
        ShadingInfo.equalsBinary = function (a, b) {
            return a && b && (a === b ||
                a.shadingPattern == b.shadingPattern &&
                    a.backColor.equals(b.backColor) &&
                    a.foreColor.equals(b.foreColor));
        };
        ShadingInfo.prototype.clone = function () {
            return new ShadingInfo(this.shadingPattern, this.backColor, this.foreColor);
        };
        ShadingInfo.prototype.calculateHash = function () {
            return __aspxRichEdit.MathUtils.somePrimes[0] * this.shadingPattern ^
                __aspxRichEdit.MathUtils.somePrimes[1] * this.backColor.getHashCode() ^
                __aspxRichEdit.MathUtils.somePrimes[2] * this.foreColor.getHashCode();
        };
        ShadingInfo.prototype.getHashCode = function () {
            return this.hash === undefined ? this.hash = this.calculateHash() : this.hash;
        };
        ShadingInfo.prototype.toJSON = function () {
            return __aspxRichEdit.JSONShadingInfoConverter.convertToJSON(this);
        };
        return ShadingInfo;
    }());
    __aspxRichEdit.ShadingInfo = ShadingInfo;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HashBasedCache = (function () {
        function HashBasedCache() {
            this.clear();
        }
        HashBasedCache.prototype.clearTemporaryCache = function () {
            this.tempCacheForMerge = {};
        };
        HashBasedCache.prototype.clear = function () {
            this.hashtable = {};
            this.numElements = 0;
            this.clearTemporaryCache();
        };
        Object.defineProperty(HashBasedCache.prototype, "count", {
            get: function () { return this.numElements; },
            enumerable: true,
            configurable: true
        });
        ;
        HashBasedCache.prototype.merge = function (jsonObjs, convertFromJSON) {
            var _this = this;
            __aspxRichEdit.MapUtilsKeyAsNumber.foreach(jsonObjs, function (property, index) {
                return _this.addItemForMerge(convertFromJSON(property), index);
            });
        };
        HashBasedCache.prototype.getItemByJsonKey = function (jsonKey) {
            return this.tempCacheForMerge[jsonKey];
        };
        HashBasedCache.prototype.addItemForMerge = function (item, jsonKey) {
            return this.tempCacheForMerge[jsonKey] = this.getItem(item);
        };
        HashBasedCache.prototype.getItem = function (item) {
            var hash = item.getHashCode();
            var listOfElements = this.hashtable[hash];
            if (listOfElements) {
                for (var i = 0, elem = void 0; elem = listOfElements[i]; i++) {
                    if (elem === item || elem.equals(item))
                        return elem;
                }
            }
            else
                this.hashtable[hash] = listOfElements = [];
            listOfElements.push(item);
            this.processNewItem(item, this.numElements);
            this.numElements++;
            return item;
        };
        HashBasedCache.prototype.findItemByPredicate = function (predicate) {
            return __aspxRichEdit.MapUtilsKeyAsNumber.anyOf(this.hashtable, function (items) {
                return __aspxRichEdit.ListUtils.elementBy(items, function (item) { return predicate(item); });
            });
        };
        HashBasedCache.prototype.processNewItem = function (_item, _itemIndex) { };
        HashBasedCache.prototype.convertToJSON = function (convertToJSON) {
            var result = [];
            __aspxRichEdit.MapUtilsKeyAsNumber.foreach(this.hashtable, function (items) {
                return __aspxRichEdit.ListUtils.foreach(items, function (item) { return result.push(convertToJSON(item)); });
            });
            return result;
        };
        HashBasedCache.prototype.indexOf = function (_item) {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        HashBasedCache.prototype.isExist = function (item) {
            var hash = item.getHashCode();
            var listOfElements = this.hashtable[hash];
            if (listOfElements) {
                for (var i = 0, elem = void 0; elem = listOfElements[i]; i++) {
                    if (elem === item || elem.equals(item))
                        return true;
                }
            }
            return false;
        };
        HashBasedCache.prototype.DEBUG_MAX_CELL_LENGTH = function () {
            return __aspxRichEdit.MapUtilsKeyAsNumber.max(this.hashtable, function (a, b) { return a.length - b.length; }).length;
        };
        return HashBasedCache;
    }());
    __aspxRichEdit.HashBasedCache = HashBasedCache;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FontInfoCache = (function (_super) {
        __extends(FontInfoCache, _super);
        function FontInfoCache(fontMeasurer) {
            var _this = _super.call(this) || this;
            _this.tempCacheForMerge = {};
            if (!fontMeasurer) {
                _this.fontMeasurer = new __aspxRichEdit.FontMeasurer();
                __aspxRichEdit.ListUtils.foreach(FontInfoCache.defaultFonts, function (defaultFont, index) {
                    return _this.addItemForMerge(defaultFont.clone(), index);
                });
            }
            else
                _this.fontMeasurer = fontMeasurer;
            return _this;
        }
        FontInfoCache.prototype.clearTemporaryCache = function () {
        };
        FontInfoCache.prototype.processNewItem = function (property, key) {
            property.index = key;
            property.measurer = this.fontMeasurer;
        };
        FontInfoCache.prototype.getItemByName = function (name) {
            var items = this.hashtable[__aspxRichEdit.FontInfo.calculateHashByName(name)];
            return items && items[0] ? items[0] : null;
        };
        FontInfoCache.prototype.getFontNames = function () {
            var result = [];
            __aspxRichEdit.MapUtilsKeyAsNumber.foreach(this.hashtable, function (items) {
                return __aspxRichEdit.ListUtils.foreach(items, function (item) { return result.push(item.name); });
            });
            return result;
        };
        FontInfoCache.fillDefaultFonts = function (fontInfoCache) {
            if (FontInfoCache.defaultFonts.length == 0)
                FontInfoCache.defaultFonts = __aspxRichEdit.ListUtils.initByCallback(fontInfoCache.count, function (ind) { return fontInfoCache.getItemByJsonKey(ind); });
        };
        FontInfoCache.defaultFonts = [];
        FontInfoCache.defaultFontName = "Calibri";
        return FontInfoCache;
    }(__aspxRichEdit.HashBasedCache));
    __aspxRichEdit.FontInfoCache = FontInfoCache;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ColorModelInfoCache = (function (_super) {
        __extends(ColorModelInfoCache, _super);
        function ColorModelInfoCache() {
            var _this = _super.call(this) || this;
            _this.getItem(__aspxRichEdit.ColorModelInfo.empty);
            return _this;
        }
        ColorModelInfoCache.defaultItem = __aspxRichEdit.ColorModelInfo.empty;
        return ColorModelInfoCache;
    }(__aspxRichEdit.HashBasedCache));
    __aspxRichEdit.ColorModelInfoCache = ColorModelInfoCache;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ShadingInfoCache = (function (_super) {
        __extends(ShadingInfoCache, _super);
        function ShadingInfoCache() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        return ShadingInfoCache;
    }(__aspxRichEdit.HashBasedCache));
    __aspxRichEdit.ShadingInfoCache = ShadingInfoCache;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FontInfo = (function () {
        function FontInfo(name) {
            this.name = name;
            this.cssString = name;
            this.isLoad = true;
        }
        FontInfo.calculateHashByName = function (name) {
            return __aspxRichEdit.StringUtils.stringHashCode(name);
        };
        FontInfo.prototype.calculateHash = function () {
            return FontInfo.calculateHashByName(this.name);
        };
        FontInfo.prototype.getHashCode = function () {
            return this.hash === undefined ? this.hash = this.calculateHash() : this.hash;
        };
        FontInfo.prototype.copyFrom = function (obj) {
            this.name = obj.name;
            this.scriptMultiplier = obj.scriptMultiplier;
            this.canBeSet = obj.canBeSet;
            this.cssString = obj.cssString;
            this.subScriptOffset = obj.subScriptOffset;
        };
        FontInfo.prototype.equals = function (obj) {
            return obj && this.name == obj.name &&
                this.scriptMultiplier == obj.scriptMultiplier;
        };
        FontInfo.equalsBinary = function (fontInfoA, fontInfoB) {
            return fontInfoA && fontInfoB &&
                fontInfoA.name == fontInfoB.name &&
                fontInfoA.scriptMultiplier == fontInfoB.scriptMultiplier;
        };
        FontInfo.prototype.clone = function () {
            var obj = new FontInfo(null);
            obj.copyFrom(this);
            return obj;
        };
        FontInfo.prototype.getBaseLine = function () {
            if (this.baseLine === undefined)
                this.baseLine = this.measurer.getBaseLine(this);
            return this.baseLine;
        };
        FontInfo.prototype.resetBaseLine = function () {
            this.baseLine = undefined;
        };
        FontInfo.prototype.getAscent = function (boxHeight) {
            return this.getBaseLine() * boxHeight;
        };
        FontInfo.prototype.getDescent = function (boxHeight) {
            return boxHeight - this.getAscent(boxHeight);
        };
        return FontInfo;
    }());
    __aspxRichEdit.FontInfo = FontInfo;
    var FontMeasurer = (function () {
        function FontMeasurer() {
        }
        FontMeasurer.prototype.getBaseLine = function (font) {
            this.beginMeasuring(font);
            var baseLine = this.container.firstChild.offsetTop / this.container.lastChild.offsetHeight;
            this.endMeasuring();
            return baseLine;
        };
        FontMeasurer.prototype.beginMeasuring = function (font) {
            if (!this.container) {
                this.container = document.createElement("div");
                this.container.style.position = "absolute";
                this.container.style.top = "-10000px";
                this.container.style.left = "-10000px";
                this.container.style.opacity = "0";
                this.container.style.fontSize = "0px";
                this.container.style.lineHeight = "normal";
            }
            var fontCssString = __aspxRichEdit.HtmlConverter.buildFontFamilyRule(font.cssString);
            this.container.innerHTML = '<span style="font-size:0; font-family: ' + fontCssString + '; display: inline-block;">A</span><span style="font-size:288pt; font-family: ' + fontCssString + '; display: inline-block;">A</span>';
            document.body.appendChild(this.container);
            return this.container;
        };
        FontMeasurer.prototype.endMeasuring = function () {
            if (this.container && this.container.parentNode)
                this.container.parentNode.removeChild(this.container);
        };
        return FontMeasurer;
    }());
    __aspxRichEdit.FontMeasurer = FontMeasurer;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var BorderLineStyle;
    (function (BorderLineStyle) {
        BorderLineStyle[BorderLineStyle["Nil"] = -1] = "Nil";
        BorderLineStyle[BorderLineStyle["None"] = 0] = "None";
        BorderLineStyle[BorderLineStyle["Single"] = 1] = "Single";
        BorderLineStyle[BorderLineStyle["Thick"] = 2] = "Thick";
        BorderLineStyle[BorderLineStyle["Double"] = 3] = "Double";
        BorderLineStyle[BorderLineStyle["Dotted"] = 4] = "Dotted";
        BorderLineStyle[BorderLineStyle["Dashed"] = 5] = "Dashed";
        BorderLineStyle[BorderLineStyle["DotDash"] = 6] = "DotDash";
        BorderLineStyle[BorderLineStyle["DotDotDash"] = 7] = "DotDotDash";
        BorderLineStyle[BorderLineStyle["Triple"] = 8] = "Triple";
        BorderLineStyle[BorderLineStyle["ThinThickSmallGap"] = 9] = "ThinThickSmallGap";
        BorderLineStyle[BorderLineStyle["ThickThinSmallGap"] = 10] = "ThickThinSmallGap";
        BorderLineStyle[BorderLineStyle["ThinThickThinSmallGap"] = 11] = "ThinThickThinSmallGap";
        BorderLineStyle[BorderLineStyle["ThinThickMediumGap"] = 12] = "ThinThickMediumGap";
        BorderLineStyle[BorderLineStyle["ThickThinMediumGap"] = 13] = "ThickThinMediumGap";
        BorderLineStyle[BorderLineStyle["ThinThickThinMediumGap"] = 14] = "ThinThickThinMediumGap";
        BorderLineStyle[BorderLineStyle["ThinThickLargeGap"] = 15] = "ThinThickLargeGap";
        BorderLineStyle[BorderLineStyle["ThickThinLargeGap"] = 16] = "ThickThinLargeGap";
        BorderLineStyle[BorderLineStyle["ThinThickThinLargeGap"] = 17] = "ThinThickThinLargeGap";
        BorderLineStyle[BorderLineStyle["Wave"] = 18] = "Wave";
        BorderLineStyle[BorderLineStyle["DoubleWave"] = 19] = "DoubleWave";
        BorderLineStyle[BorderLineStyle["DashSmallGap"] = 20] = "DashSmallGap";
        BorderLineStyle[BorderLineStyle["DashDotStroked"] = 21] = "DashDotStroked";
        BorderLineStyle[BorderLineStyle["ThreeDEmboss"] = 22] = "ThreeDEmboss";
        BorderLineStyle[BorderLineStyle["ThreeDEngrave"] = 23] = "ThreeDEngrave";
        BorderLineStyle[BorderLineStyle["Outset"] = 24] = "Outset";
        BorderLineStyle[BorderLineStyle["Inset"] = 25] = "Inset";
        BorderLineStyle[BorderLineStyle["Apples"] = 26] = "Apples";
        BorderLineStyle[BorderLineStyle["ArchedScallops"] = 27] = "ArchedScallops";
        BorderLineStyle[BorderLineStyle["BabyPacifier"] = 28] = "BabyPacifier";
        BorderLineStyle[BorderLineStyle["BabyRattle"] = 29] = "BabyRattle";
        BorderLineStyle[BorderLineStyle["Balloons3Colors"] = 30] = "Balloons3Colors";
        BorderLineStyle[BorderLineStyle["BalloonsHotAir"] = 31] = "BalloonsHotAir";
        BorderLineStyle[BorderLineStyle["BasicBlackDashes"] = 32] = "BasicBlackDashes";
        BorderLineStyle[BorderLineStyle["BasicBlackDots"] = 33] = "BasicBlackDots";
        BorderLineStyle[BorderLineStyle["BasicBlackSquares"] = 34] = "BasicBlackSquares";
        BorderLineStyle[BorderLineStyle["BasicThinLines"] = 35] = "BasicThinLines";
        BorderLineStyle[BorderLineStyle["BasicWhiteDashes"] = 36] = "BasicWhiteDashes";
        BorderLineStyle[BorderLineStyle["BasicWhiteDots"] = 37] = "BasicWhiteDots";
        BorderLineStyle[BorderLineStyle["BasicWhiteSquares"] = 38] = "BasicWhiteSquares";
        BorderLineStyle[BorderLineStyle["BasicWideInline"] = 39] = "BasicWideInline";
        BorderLineStyle[BorderLineStyle["BasicWideMidline"] = 40] = "BasicWideMidline";
        BorderLineStyle[BorderLineStyle["BasicWideOutline"] = 41] = "BasicWideOutline";
        BorderLineStyle[BorderLineStyle["Bats"] = 42] = "Bats";
        BorderLineStyle[BorderLineStyle["Birds"] = 43] = "Birds";
        BorderLineStyle[BorderLineStyle["BirdsFlight"] = 44] = "BirdsFlight";
        BorderLineStyle[BorderLineStyle["Cabins"] = 45] = "Cabins";
        BorderLineStyle[BorderLineStyle["CakeSlice"] = 46] = "CakeSlice";
        BorderLineStyle[BorderLineStyle["CandyCorn"] = 47] = "CandyCorn";
        BorderLineStyle[BorderLineStyle["CelticKnotwork"] = 48] = "CelticKnotwork";
        BorderLineStyle[BorderLineStyle["CertificateBanner"] = 49] = "CertificateBanner";
        BorderLineStyle[BorderLineStyle["ChainLink"] = 50] = "ChainLink";
        BorderLineStyle[BorderLineStyle["ChampagneBottle"] = 51] = "ChampagneBottle";
        BorderLineStyle[BorderLineStyle["CheckedBarBlack"] = 52] = "CheckedBarBlack";
        BorderLineStyle[BorderLineStyle["CheckedBarColor"] = 53] = "CheckedBarColor";
        BorderLineStyle[BorderLineStyle["Checkered"] = 54] = "Checkered";
        BorderLineStyle[BorderLineStyle["ChristmasTree"] = 55] = "ChristmasTree";
        BorderLineStyle[BorderLineStyle["CirclesLines"] = 56] = "CirclesLines";
        BorderLineStyle[BorderLineStyle["CirclesRectangles"] = 57] = "CirclesRectangles";
        BorderLineStyle[BorderLineStyle["ClassicalWave"] = 58] = "ClassicalWave";
        BorderLineStyle[BorderLineStyle["Clocks"] = 59] = "Clocks";
        BorderLineStyle[BorderLineStyle["Compass"] = 60] = "Compass";
        BorderLineStyle[BorderLineStyle["Confetti"] = 61] = "Confetti";
        BorderLineStyle[BorderLineStyle["ConfettiGrays"] = 62] = "ConfettiGrays";
        BorderLineStyle[BorderLineStyle["ConfettiOutline"] = 63] = "ConfettiOutline";
        BorderLineStyle[BorderLineStyle["ConfettiStreamers"] = 64] = "ConfettiStreamers";
        BorderLineStyle[BorderLineStyle["ConfettiWhite"] = 65] = "ConfettiWhite";
        BorderLineStyle[BorderLineStyle["CornerTriangles"] = 66] = "CornerTriangles";
        BorderLineStyle[BorderLineStyle["CouponCutoutDashes"] = 67] = "CouponCutoutDashes";
        BorderLineStyle[BorderLineStyle["CouponCutoutDots"] = 68] = "CouponCutoutDots";
        BorderLineStyle[BorderLineStyle["CrazyMaze"] = 69] = "CrazyMaze";
        BorderLineStyle[BorderLineStyle["CreaturesButterfly"] = 70] = "CreaturesButterfly";
        BorderLineStyle[BorderLineStyle["CreaturesFish"] = 71] = "CreaturesFish";
        BorderLineStyle[BorderLineStyle["CreaturesInsects"] = 72] = "CreaturesInsects";
        BorderLineStyle[BorderLineStyle["CreaturesLadyBug"] = 73] = "CreaturesLadyBug";
        BorderLineStyle[BorderLineStyle["CrossStitch"] = 74] = "CrossStitch";
        BorderLineStyle[BorderLineStyle["Cup"] = 75] = "Cup";
        BorderLineStyle[BorderLineStyle["DecoArch"] = 76] = "DecoArch";
        BorderLineStyle[BorderLineStyle["DecoArchColor"] = 77] = "DecoArchColor";
        BorderLineStyle[BorderLineStyle["DecoBlocks"] = 78] = "DecoBlocks";
        BorderLineStyle[BorderLineStyle["DiamondsGray"] = 79] = "DiamondsGray";
        BorderLineStyle[BorderLineStyle["DoubleD"] = 80] = "DoubleD";
        BorderLineStyle[BorderLineStyle["DoubleDiamonds"] = 81] = "DoubleDiamonds";
        BorderLineStyle[BorderLineStyle["Earth1"] = 82] = "Earth1";
        BorderLineStyle[BorderLineStyle["Earth2"] = 83] = "Earth2";
        BorderLineStyle[BorderLineStyle["EclipsingSquares1"] = 84] = "EclipsingSquares1";
        BorderLineStyle[BorderLineStyle["EclipsingSquares2"] = 85] = "EclipsingSquares2";
        BorderLineStyle[BorderLineStyle["EggsBlack"] = 86] = "EggsBlack";
        BorderLineStyle[BorderLineStyle["Fans"] = 87] = "Fans";
        BorderLineStyle[BorderLineStyle["Film"] = 88] = "Film";
        BorderLineStyle[BorderLineStyle["Firecrackers"] = 89] = "Firecrackers";
        BorderLineStyle[BorderLineStyle["FlowersBlockPrint"] = 90] = "FlowersBlockPrint";
        BorderLineStyle[BorderLineStyle["FlowersDaisies"] = 91] = "FlowersDaisies";
        BorderLineStyle[BorderLineStyle["FlowersModern1"] = 92] = "FlowersModern1";
        BorderLineStyle[BorderLineStyle["FlowersModern2"] = 93] = "FlowersModern2";
        BorderLineStyle[BorderLineStyle["FlowersPansy"] = 94] = "FlowersPansy";
        BorderLineStyle[BorderLineStyle["FlowersRedRose"] = 95] = "FlowersRedRose";
        BorderLineStyle[BorderLineStyle["FlowersRoses"] = 96] = "FlowersRoses";
        BorderLineStyle[BorderLineStyle["FlowersTeacup"] = 97] = "FlowersTeacup";
        BorderLineStyle[BorderLineStyle["FlowersTiny"] = 98] = "FlowersTiny";
        BorderLineStyle[BorderLineStyle["Gems"] = 99] = "Gems";
        BorderLineStyle[BorderLineStyle["GingerbreadMan"] = 100] = "GingerbreadMan";
        BorderLineStyle[BorderLineStyle["Gradient"] = 101] = "Gradient";
        BorderLineStyle[BorderLineStyle["Handmade1"] = 102] = "Handmade1";
        BorderLineStyle[BorderLineStyle["Handmade2"] = 103] = "Handmade2";
        BorderLineStyle[BorderLineStyle["HeartBalloon"] = 104] = "HeartBalloon";
        BorderLineStyle[BorderLineStyle["HeartGray"] = 105] = "HeartGray";
        BorderLineStyle[BorderLineStyle["Hearts"] = 106] = "Hearts";
        BorderLineStyle[BorderLineStyle["HeebieJeebies"] = 107] = "HeebieJeebies";
        BorderLineStyle[BorderLineStyle["Holly"] = 108] = "Holly";
        BorderLineStyle[BorderLineStyle["HouseFunky"] = 109] = "HouseFunky";
        BorderLineStyle[BorderLineStyle["Hypnotic"] = 110] = "Hypnotic";
        BorderLineStyle[BorderLineStyle["IceCreamCones"] = 111] = "IceCreamCones";
        BorderLineStyle[BorderLineStyle["LightBulb"] = 112] = "LightBulb";
        BorderLineStyle[BorderLineStyle["Lightning1"] = 113] = "Lightning1";
        BorderLineStyle[BorderLineStyle["Lightning2"] = 114] = "Lightning2";
        BorderLineStyle[BorderLineStyle["MapleLeaf"] = 115] = "MapleLeaf";
        BorderLineStyle[BorderLineStyle["MapleMuffins"] = 116] = "MapleMuffins";
        BorderLineStyle[BorderLineStyle["MapPins"] = 117] = "MapPins";
        BorderLineStyle[BorderLineStyle["Marquee"] = 118] = "Marquee";
        BorderLineStyle[BorderLineStyle["MarqueeToothed"] = 119] = "MarqueeToothed";
        BorderLineStyle[BorderLineStyle["Moons"] = 120] = "Moons";
        BorderLineStyle[BorderLineStyle["Mosaic"] = 121] = "Mosaic";
        BorderLineStyle[BorderLineStyle["MusicNotes"] = 122] = "MusicNotes";
        BorderLineStyle[BorderLineStyle["Northwest"] = 123] = "Northwest";
        BorderLineStyle[BorderLineStyle["Ovals"] = 124] = "Ovals";
        BorderLineStyle[BorderLineStyle["Packages"] = 125] = "Packages";
        BorderLineStyle[BorderLineStyle["PalmsBlack"] = 126] = "PalmsBlack";
        BorderLineStyle[BorderLineStyle["PalmsColor"] = 127] = "PalmsColor";
        BorderLineStyle[BorderLineStyle["PaperClips"] = 128] = "PaperClips";
        BorderLineStyle[BorderLineStyle["Papyrus"] = 129] = "Papyrus";
        BorderLineStyle[BorderLineStyle["PartyFavor"] = 130] = "PartyFavor";
        BorderLineStyle[BorderLineStyle["PartyGlass"] = 131] = "PartyGlass";
        BorderLineStyle[BorderLineStyle["Pencils"] = 132] = "Pencils";
        BorderLineStyle[BorderLineStyle["People"] = 133] = "People";
        BorderLineStyle[BorderLineStyle["PeopleHats"] = 134] = "PeopleHats";
        BorderLineStyle[BorderLineStyle["PeopleWaving"] = 135] = "PeopleWaving";
        BorderLineStyle[BorderLineStyle["Poinsettias"] = 136] = "Poinsettias";
        BorderLineStyle[BorderLineStyle["PostageStamp"] = 137] = "PostageStamp";
        BorderLineStyle[BorderLineStyle["Pumpkin1"] = 138] = "Pumpkin1";
        BorderLineStyle[BorderLineStyle["PushPinNote1"] = 139] = "PushPinNote1";
        BorderLineStyle[BorderLineStyle["PushPinNote2"] = 140] = "PushPinNote2";
        BorderLineStyle[BorderLineStyle["Pyramids"] = 141] = "Pyramids";
        BorderLineStyle[BorderLineStyle["PyramidsAbove"] = 142] = "PyramidsAbove";
        BorderLineStyle[BorderLineStyle["Quadrants"] = 143] = "Quadrants";
        BorderLineStyle[BorderLineStyle["Rings"] = 144] = "Rings";
        BorderLineStyle[BorderLineStyle["Safari"] = 145] = "Safari";
        BorderLineStyle[BorderLineStyle["Sawtooth"] = 146] = "Sawtooth";
        BorderLineStyle[BorderLineStyle["SawtoothGray"] = 147] = "SawtoothGray";
        BorderLineStyle[BorderLineStyle["ScaredCat"] = 148] = "ScaredCat";
        BorderLineStyle[BorderLineStyle["Seattle"] = 149] = "Seattle";
        BorderLineStyle[BorderLineStyle["ShadowedSquares"] = 150] = "ShadowedSquares";
        BorderLineStyle[BorderLineStyle["SharksTeeth"] = 151] = "SharksTeeth";
        BorderLineStyle[BorderLineStyle["ShorebirdTracks"] = 152] = "ShorebirdTracks";
        BorderLineStyle[BorderLineStyle["Skyrocket"] = 153] = "Skyrocket";
        BorderLineStyle[BorderLineStyle["SnowflakeFancy"] = 154] = "SnowflakeFancy";
        BorderLineStyle[BorderLineStyle["Snowflakes"] = 155] = "Snowflakes";
        BorderLineStyle[BorderLineStyle["Sombrero"] = 156] = "Sombrero";
        BorderLineStyle[BorderLineStyle["Southwest"] = 157] = "Southwest";
        BorderLineStyle[BorderLineStyle["Stars"] = 158] = "Stars";
        BorderLineStyle[BorderLineStyle["Stars3d"] = 159] = "Stars3d";
        BorderLineStyle[BorderLineStyle["StarsBlack"] = 160] = "StarsBlack";
        BorderLineStyle[BorderLineStyle["StarsShadowed"] = 161] = "StarsShadowed";
        BorderLineStyle[BorderLineStyle["StarsTop"] = 162] = "StarsTop";
        BorderLineStyle[BorderLineStyle["Sun"] = 163] = "Sun";
        BorderLineStyle[BorderLineStyle["Swirligig"] = 164] = "Swirligig";
        BorderLineStyle[BorderLineStyle["TornPaper"] = 165] = "TornPaper";
        BorderLineStyle[BorderLineStyle["TornPaperBlack"] = 166] = "TornPaperBlack";
        BorderLineStyle[BorderLineStyle["Trees"] = 167] = "Trees";
        BorderLineStyle[BorderLineStyle["TriangleParty"] = 168] = "TriangleParty";
        BorderLineStyle[BorderLineStyle["Triangles"] = 169] = "Triangles";
        BorderLineStyle[BorderLineStyle["Tribal1"] = 170] = "Tribal1";
        BorderLineStyle[BorderLineStyle["Tribal2"] = 171] = "Tribal2";
        BorderLineStyle[BorderLineStyle["Tribal3"] = 172] = "Tribal3";
        BorderLineStyle[BorderLineStyle["Tribal4"] = 173] = "Tribal4";
        BorderLineStyle[BorderLineStyle["Tribal5"] = 174] = "Tribal5";
        BorderLineStyle[BorderLineStyle["Tribal6"] = 175] = "Tribal6";
        BorderLineStyle[BorderLineStyle["TwistedLines1"] = 176] = "TwistedLines1";
        BorderLineStyle[BorderLineStyle["TwistedLines2"] = 177] = "TwistedLines2";
        BorderLineStyle[BorderLineStyle["Vine"] = 178] = "Vine";
        BorderLineStyle[BorderLineStyle["Waveline"] = 179] = "Waveline";
        BorderLineStyle[BorderLineStyle["WeavingAngles"] = 180] = "WeavingAngles";
        BorderLineStyle[BorderLineStyle["WeavingBraid"] = 181] = "WeavingBraid";
        BorderLineStyle[BorderLineStyle["WeavingRibbon"] = 182] = "WeavingRibbon";
        BorderLineStyle[BorderLineStyle["WeavingStrips"] = 183] = "WeavingStrips";
        BorderLineStyle[BorderLineStyle["WhiteFlowers"] = 184] = "WhiteFlowers";
        BorderLineStyle[BorderLineStyle["Woodwork"] = 185] = "Woodwork";
        BorderLineStyle[BorderLineStyle["XIllusions"] = 186] = "XIllusions";
        BorderLineStyle[BorderLineStyle["ZanyTriangles"] = 187] = "ZanyTriangles";
        BorderLineStyle[BorderLineStyle["ZigZag"] = 188] = "ZigZag";
        BorderLineStyle[BorderLineStyle["ZigZagStitch"] = 189] = "ZigZagStitch";
        BorderLineStyle[BorderLineStyle["Disabled"] = 2147483647] = "Disabled";
    })(BorderLineStyle = __aspxRichEdit.BorderLineStyle || (__aspxRichEdit.BorderLineStyle = {}));
    var BorderBase = (function () {
        function BorderBase(style, width, color) {
            this.style = style;
            this.width = width;
            this.color = color;
        }
        BorderBase.getEmpty = function () {
            return BorderBase.empty.clone();
        };
        BorderBase.prototype.clone = function () {
            return new LayoutBorder(this.style, this.width, this.color);
        };
        BorderBase.prototype.equals = function (obj) {
            return obj &&
                this.style == obj.style &&
                this.width == obj.width &&
                this.color == obj.color;
        };
        BorderBase.empty = new BorderBase(BorderLineStyle.None, 0, __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR);
        return BorderBase;
    }());
    __aspxRichEdit.BorderBase = BorderBase;
    var LayoutBorder = (function (_super) {
        __extends(LayoutBorder, _super);
        function LayoutBorder() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        return LayoutBorder;
    }(BorderBase));
    __aspxRichEdit.LayoutBorder = LayoutBorder;
    var BorderInfo = (function () {
        function BorderInfo() {
            this.style = BorderLineStyle.None;
            this.color = __aspxRichEdit.ColorModelInfoCache.defaultItem;
            this.width = 0;
            this.offset = 0;
            this.frame = false;
            this.shadow = false;
        }
        BorderInfo.prototype.getHashCode = function () {
            return __aspxRichEdit.MathUtils.somePrimes[0] * this.style ^
                __aspxRichEdit.MathUtils.somePrimes[1] * this.color.getHashCode() ^
                __aspxRichEdit.MathUtils.somePrimes[2] * this.width;
        };
        BorderInfo.prototype.getBorderBase = function (colorProvider) {
            return new BorderBase(this.style, this.width, this.color.toRgb(colorProvider));
        };
        BorderInfo.prototype.getLayoutBorder = function (colorProvider) {
            return new LayoutBorder(this.style, this.width, this.color.toRgb(colorProvider));
        };
        BorderInfo.prototype.equals = function (obj) {
            return obj && this.style == obj.style &&
                this.color.equals(obj.color) &&
                this.width == obj.width &&
                this.offset == obj.offset &&
                this.frame == obj.frame &&
                this.shadow == obj.shadow;
        };
        BorderInfo.equalsBinary = function (borderInfoA, borderInfoB) {
            return borderInfoA && borderInfoB &&
                borderInfoA.style == borderInfoB.style &&
                borderInfoA.color.equals(borderInfoB.color) &&
                borderInfoA.width == borderInfoB.width &&
                borderInfoA.offset == borderInfoB.offset &&
                borderInfoA.frame == borderInfoB.frame &&
                borderInfoA.shadow == borderInfoB.shadow;
        };
        BorderInfo.prototype.copyFrom = function (obj) {
            this.style = obj.style;
            this.color = obj.color.clone();
            this.width = obj.width;
            this.offset = obj.offset;
            this.frame = obj.frame;
            this.shadow = obj.shadow;
        };
        BorderInfo.prototype.clone = function () {
            var result = new BorderInfo();
            result.copyFrom(this);
            return result;
        };
        return BorderInfo;
    }());
    __aspxRichEdit.BorderInfo = BorderInfo;
    var TableBordersBase = (function () {
        function TableBordersBase() {
        }
        TableBordersBase.prototype.getHashCode = function () {
            return __aspxRichEdit.MathUtils.somePrimes[10] * this.topBorder.getHashCode() ^
                __aspxRichEdit.MathUtils.somePrimes[11] * this.rightBorder.getHashCode() ^
                __aspxRichEdit.MathUtils.somePrimes[12] * this.bottomBorder.getHashCode() ^
                __aspxRichEdit.MathUtils.somePrimes[13] * this.leftBorder.getHashCode();
        };
        TableBordersBase.prototype.equals = function (obj) {
            if (!obj)
                return false;
            return this.bottomBorder.equals(obj.bottomBorder) &&
                this.leftBorder.equals(obj.leftBorder) &&
                this.rightBorder.equals(obj.rightBorder) &&
                this.topBorder.equals(obj.topBorder);
        };
        TableBordersBase.prototype.copyFrom = function (obj) {
            this.bottomBorder = obj.bottomBorder.clone();
            this.leftBorder = obj.leftBorder.clone();
            this.rightBorder = obj.rightBorder.clone();
            this.topBorder = obj.topBorder.clone();
        };
        return TableBordersBase;
    }());
    __aspxRichEdit.TableBordersBase = TableBordersBase;
    var TableBorders = (function (_super) {
        __extends(TableBorders, _super);
        function TableBorders() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableBorders.prototype.getHashCode = function () {
            return _super.prototype.getHashCode.call(this) ^
                __aspxRichEdit.MathUtils.somePrimes[14] * this.insideHorizontalBorder.getHashCode() ^
                __aspxRichEdit.MathUtils.somePrimes[15] * this.insideVerticalBorder.getHashCode();
        };
        TableBorders.prototype.equals = function (obj) {
            return _super.prototype.equals.call(this, obj) &&
                this.insideHorizontalBorder.equals(obj.insideHorizontalBorder) &&
                this.insideVerticalBorder.equals(obj.insideVerticalBorder);
        };
        TableBorders.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.insideHorizontalBorder = obj.insideHorizontalBorder.clone();
            this.insideVerticalBorder = obj.insideVerticalBorder.clone();
        };
        TableBorders.prototype.clone = function () {
            var result = new TableBorders();
            result.copyFrom(this);
            return result;
        };
        TableBorders.create = function (top, right, bottom, left, insideHorizontal, insideVertical) {
            var result = new TableBorders();
            result.topBorder = top;
            result.rightBorder = right;
            result.bottomBorder = bottom;
            result.leftBorder = left;
            result.insideHorizontalBorder = insideHorizontal;
            result.insideVerticalBorder = insideVertical;
            return result;
        };
        return TableBorders;
    }(TableBordersBase));
    __aspxRichEdit.TableBorders = TableBorders;
    var TableCellBorders = (function (_super) {
        __extends(TableCellBorders, _super);
        function TableCellBorders() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellBorders.prototype.equals = function (obj) {
            return _super.prototype.equals.call(this, obj) &&
                this.topLeftDiagonalBorder.equals(obj.topLeftDiagonalBorder) &&
                this.topRightDiagonalBorder.equals(obj.topRightDiagonalBorder);
        };
        TableCellBorders.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.topLeftDiagonalBorder = obj.topLeftDiagonalBorder.clone();
            this.topRightDiagonalBorder = obj.topRightDiagonalBorder.clone();
        };
        TableCellBorders.prototype.clone = function () {
            var result = new TableCellBorders();
            result.copyFrom(this);
            return result;
        };
        TableCellBorders.create = function (top, right, bottom, left, topLeftDiagonal, topRightDiagonal) {
            var result = new TableCellBorders();
            result.topBorder = top;
            result.rightBorder = right;
            result.bottomBorder = bottom;
            result.leftBorder = left;
            result.topLeftDiagonalBorder = topLeftDiagonal;
            result.topRightDiagonalBorder = topRightDiagonal;
            return result;
        };
        return TableCellBorders;
    }(TableBordersBase));
    __aspxRichEdit.TableCellBorders = TableCellBorders;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SubDocumentInfoBase = (function () {
        function SubDocumentInfoBase(subDocumentId) {
            this.isMain = true;
            this.isHeaderFooter = false;
            this.isFooter = false;
            this.isHeader = false;
            this.isNote = false;
            this.isFootNote = false;
            this.isEndNote = false;
            this.isTextBox = false;
            this.isComment = false;
            this.isReferenced = true;
            this.subDocumentId = subDocumentId;
        }
        SubDocumentInfoBase.prototype.getEndPosition = function (documentModel) {
            return documentModel.subDocuments[this.subDocumentId].getLastChunk().getEndPosition();
        };
        SubDocumentInfoBase.prototype.getSubDocument = function (documentModel) {
            return documentModel.subDocuments[this.subDocumentId];
        };
        SubDocumentInfoBase.create = function (type, subDocumentId, parentSubDocumentId) {
            switch (type) {
                case SubDocumentInfoType.Main:
                    return new MainSubDocumentInfo();
                case SubDocumentInfoType.Header:
                    return new HeaderSubDocumentInfo(subDocumentId);
                case SubDocumentInfoType.Footer:
                    return new FooterSubDocumentInfo(subDocumentId);
                case SubDocumentInfoType.TextBox:
                    return new TextBoxSubDocumentInfoBase(subDocumentId, parentSubDocumentId);
            }
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return SubDocumentInfoBase;
    }());
    __aspxRichEdit.SubDocumentInfoBase = SubDocumentInfoBase;
    var TextBoxSubDocumentInfoBase = (function (_super) {
        __extends(TextBoxSubDocumentInfoBase, _super);
        function TextBoxSubDocumentInfoBase(subDocumentId, parentSubDocumentId) {
            var _this = _super.call(this, subDocumentId) || this;
            _this.isMain = false;
            _this.isTextBox = true;
            _this.parentSubDocumentId = parentSubDocumentId;
            return _this;
        }
        TextBoxSubDocumentInfoBase.prototype.getType = function () {
            return SubDocumentInfoType.TextBox;
        };
        return TextBoxSubDocumentInfoBase;
    }(SubDocumentInfoBase));
    __aspxRichEdit.TextBoxSubDocumentInfoBase = TextBoxSubDocumentInfoBase;
    var MainSubDocumentInfo = (function (_super) {
        __extends(MainSubDocumentInfo, _super);
        function MainSubDocumentInfo() {
            return _super.call(this, 0) || this;
        }
        MainSubDocumentInfo.prototype.getType = function () {
            return SubDocumentInfoType.Main;
        };
        MainSubDocumentInfo.prototype.getEndPosition = function (documentModel) {
            var sections = documentModel.sections;
            var lastSection = sections[sections.length - 1];
            return lastSection.startLogPosition.value + lastSection.getLength();
        };
        return MainSubDocumentInfo;
    }(SubDocumentInfoBase));
    __aspxRichEdit.MainSubDocumentInfo = MainSubDocumentInfo;
    var HeaderFooterSubDocumentInfoBase = (function (_super) {
        __extends(HeaderFooterSubDocumentInfoBase, _super);
        function HeaderFooterSubDocumentInfoBase() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.headerFooterType = __aspxRichEdit.HeaderFooterType.Odd;
            _this.isMain = false;
            _this.isHeaderFooter = true;
            return _this;
        }
        return HeaderFooterSubDocumentInfoBase;
    }(SubDocumentInfoBase));
    __aspxRichEdit.HeaderFooterSubDocumentInfoBase = HeaderFooterSubDocumentInfoBase;
    var HeaderSubDocumentInfo = (function (_super) {
        __extends(HeaderSubDocumentInfo, _super);
        function HeaderSubDocumentInfo() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.isHeader = true;
            return _this;
        }
        HeaderSubDocumentInfo.prototype.getType = function () {
            return SubDocumentInfoType.Header;
        };
        return HeaderSubDocumentInfo;
    }(HeaderFooterSubDocumentInfoBase));
    __aspxRichEdit.HeaderSubDocumentInfo = HeaderSubDocumentInfo;
    var FooterSubDocumentInfo = (function (_super) {
        __extends(FooterSubDocumentInfo, _super);
        function FooterSubDocumentInfo() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.isFooter = true;
            return _this;
        }
        FooterSubDocumentInfo.prototype.getType = function () {
            return SubDocumentInfoType.Footer;
        };
        return FooterSubDocumentInfo;
    }(HeaderFooterSubDocumentInfoBase));
    __aspxRichEdit.FooterSubDocumentInfo = FooterSubDocumentInfo;
    var FullChunkAndRunInfo = (function () {
        function FullChunkAndRunInfo(chunkIndex, chunk, runIndex, run, charOffset) {
            if (charOffset === void 0) { charOffset = 0; }
            this.chunkIndex = chunkIndex;
            this.chunk = chunk;
            this.runIndex = runIndex;
            this.run = run;
            this.charOffset = charOffset;
        }
        FullChunkAndRunInfo.prototype.getAbsoluteRunPosition = function () {
            return this.chunk.startLogPosition.value + this.run.startOffset;
        };
        FullChunkAndRunInfo.prototype.getAbsolutePosition = function () {
            return this.getAbsoluteRunPosition() + this.charOffset;
        };
        FullChunkAndRunInfo.prototype.getAbsoluteEndRunPosition = function () {
            return this.getAbsoluteRunPosition() + this.run.getLength();
        };
        FullChunkAndRunInfo.prototype.getCurrentChar = function () {
            return this.chunk.textBuffer[this.run.startOffset + this.charOffset];
        };
        FullChunkAndRunInfo.prototype.getRunText = function (from, length) {
            if (from === void 0) { from = 0; }
            if (length === void 0) { length = this.run.getLength(); }
            return this.chunk.textBuffer.substr(this.run.startOffset + from, length);
        };
        return FullChunkAndRunInfo;
    }());
    __aspxRichEdit.FullChunkAndRunInfo = FullChunkAndRunInfo;
    var SubDocumentInfoType;
    (function (SubDocumentInfoType) {
        SubDocumentInfoType[SubDocumentInfoType["Main"] = 0] = "Main";
        SubDocumentInfoType[SubDocumentInfoType["Header"] = 1] = "Header";
        SubDocumentInfoType[SubDocumentInfoType["Footer"] = 2] = "Footer";
        SubDocumentInfoType[SubDocumentInfoType["TextBox"] = 3] = "TextBox";
    })(SubDocumentInfoType = __aspxRichEdit.SubDocumentInfoType || (__aspxRichEdit.SubDocumentInfoType = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RunType;
    (function (RunType) {
        RunType[RunType["Undefined"] = -1] = "Undefined";
        RunType[RunType["TextRun"] = 1] = "TextRun";
        RunType[RunType["ParagraphRun"] = 2] = "ParagraphRun";
        RunType[RunType["SectionRun"] = 3] = "SectionRun";
        RunType[RunType["FieldCodeStartRun"] = 4] = "FieldCodeStartRun";
        RunType[RunType["FieldCodeEndRun"] = 5] = "FieldCodeEndRun";
        RunType[RunType["FieldResultEndRun"] = 6] = "FieldResultEndRun";
        RunType[RunType["AnchoredPictureRun"] = 7] = "AnchoredPictureRun";
        RunType[RunType["AnchoredTextBoxRun"] = 8] = "AnchoredTextBoxRun";
        RunType[RunType["InlinePictureRun"] = 9] = "InlinePictureRun";
        RunType[RunType["InlineTextBoxRun"] = 10] = "InlineTextBoxRun";
        RunType[RunType["LayoutDependentRun"] = 11] = "LayoutDependentRun";
        RunType[RunType["FootNoteRun"] = 12] = "FootNoteRun";
        RunType[RunType["EndNoteRun"] = 13] = "EndNoteRun";
    })(RunType = __aspxRichEdit.RunType || (__aspxRichEdit.RunType = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RunBase = (function () {
        function RunBase(startOffset, paragraph, characterStyle, maskedCharacterProperties) {
            this.startOffset = startOffset;
            this.paragraph = paragraph;
            this.characterStyle = characterStyle;
            this.setCharacterProperties(maskedCharacterProperties);
            this.mergedCharacterProperties = null;
        }
        RunBase.prototype.isParagraphOrSectionRun = function () {
            return false;
        };
        RunBase.prototype.setCharacterProperties = function (properties) {
            this.maskedCharacterProperties = this.paragraph.subDocument.documentModel.cache.maskedCharacterPropertiesCache.getItem(properties);
        };
        RunBase.prototype.onCharacterPropertiesChanged = function () {
            this.resetCharacterMergedProperties();
        };
        RunBase.prototype.hasCharacterMergedProperies = function () {
            return !!this.mergedCharacterProperties;
        };
        RunBase.prototype.resetCharacterMergedProperties = function () {
            this.mergedCharacterProperties = null;
        };
        RunBase.prototype.getCharacterMergedProperies = function () {
            if (!this.mergedCharacterProperties) {
                var merger = new __aspxRichEdit.CharacterPropertiesMerger();
                merger.mergeCharacterProperties(this.maskedCharacterProperties);
                merger.mergeCharacterStyle(this.characterStyle);
                merger.mergeParagraphStyle(this.paragraph.paragraphStyle);
                var tableCell = this.paragraph.getTableCell();
                if (tableCell)
                    merger.mergeTableStyles(tableCell);
                merger.mergeCharacterProperties(this.paragraph.subDocument.documentModel.defaultCharacterProperties);
                this.mergedCharacterProperties = this.paragraph.subDocument.documentModel.cache.mergedCharacterPropertiesCache.getItem(merger.getMergedProperties());
            }
            return this.mergedCharacterProperties;
        };
        RunBase.prototype.setCharacterMergedProperies = function (properties) {
            this.mergedCharacterProperties = this.paragraph.subDocument.documentModel.cache.mergedCharacterPropertiesCache.getItem(properties);
        };
        RunBase.prototype.clone = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        RunBase.prototype.copyFrom = function (obj) {
            this.startOffset = obj.startOffset;
            this.paragraph = obj.paragraph;
            this.characterStyle = obj.characterStyle;
            this.maskedCharacterProperties = obj.maskedCharacterProperties;
            this.mergedCharacterProperties = obj.mergedCharacterProperties;
        };
        RunBase.prototype.createSimularity = function (startOffset, length, paragraph, characterStyle, maskedCharacterProperties) {
            var simularity = this.clone();
            simularity.startOffset = startOffset;
            simularity.paragraph = paragraph;
            simularity.characterStyle = characterStyle;
            simularity.maskedCharacterProperties = maskedCharacterProperties;
            simularity.setLength(length);
            return simularity;
        };
        RunBase.anchoredObjectIdCounter = 0;
        return RunBase;
    }());
    __aspxRichEdit.RunBase = RunBase;
    var OneCharRun = (function (_super) {
        __extends(OneCharRun, _super);
        function OneCharRun() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        OneCharRun.prototype.getLength = function () {
            return 1;
        };
        OneCharRun.prototype.setLength = function (newLength) {
            if (newLength != 1)
                throw new Error(__aspxRichEdit.Errors.InternalException);
        };
        OneCharRun.prototype.incLength = function (_additionalLength) {
            throw new Error(__aspxRichEdit.Errors.InternalException);
        };
        return OneCharRun;
    }(RunBase));
    __aspxRichEdit.OneCharRun = OneCharRun;
    var PictureRun = (function (_super) {
        __extends(PictureRun, _super);
        function PictureRun(startOffset, paragraph, characterStyle, maskedCharacterProperties, shape, pictureId, size, isLoaded) {
            var _this = _super.call(this, startOffset, paragraph, characterStyle, maskedCharacterProperties) || this;
            _this.shape = shape;
            _this.id = pictureId;
            _this.size = size;
            _this.isLoaded = isLoaded;
            return _this;
        }
        PictureRun.prototype.getActualWidth = function () {
            return this.size.getActualWidth();
        };
        PictureRun.prototype.getActualHeight = function () {
            return this.size.getActualHeight();
        };
        PictureRun.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.shape = obj.shape.clone();
            this.size = obj.size.clone();
            this.id = obj.id;
            this.isLoaded = obj.isLoaded;
        };
        return PictureRun;
    }(OneCharRun));
    __aspxRichEdit.PictureRun = PictureRun;
    var TextBoxRun = (function (_super) {
        __extends(TextBoxRun, _super);
        function TextBoxRun(startOffset, paragraph, characterStyle, maskedCharacterProperties, shape, subDocId, textBoxProperties) {
            var _this = _super.call(this, startOffset, paragraph, characterStyle, maskedCharacterProperties) || this;
            _this.shape = shape;
            _this.subDocId = subDocId;
            _this.textBoxProperties = textBoxProperties;
            return _this;
        }
        TextBoxRun.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.shape = obj.shape.clone();
            this.subDocId = obj.subDocId;
        };
        return TextBoxRun;
    }(OneCharRun));
    __aspxRichEdit.TextBoxRun = TextBoxRun;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SectionRun = (function (_super) {
        __extends(SectionRun, _super);
        function SectionRun() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SectionRun.prototype.getType = function () {
            return __aspxRichEdit.RunType.SectionRun;
        };
        SectionRun.prototype.isParagraphOrSectionRun = function () {
            return true;
        };
        SectionRun.prototype.clone = function () {
            return new SectionRun(this.startOffset, this.paragraph, this.characterStyle, this.maskedCharacterProperties);
        };
        return SectionRun;
    }(__aspxRichEdit.OneCharRun));
    __aspxRichEdit.SectionRun = SectionRun;
    var ParagraphRun = (function (_super) {
        __extends(ParagraphRun, _super);
        function ParagraphRun() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphRun.prototype.getType = function () {
            return __aspxRichEdit.RunType.ParagraphRun;
        };
        ParagraphRun.prototype.isParagraphOrSectionRun = function () {
            return true;
        };
        ParagraphRun.prototype.clone = function () {
            return new ParagraphRun(this.startOffset, this.paragraph, this.characterStyle, this.maskedCharacterProperties);
        };
        return ParagraphRun;
    }(__aspxRichEdit.OneCharRun));
    __aspxRichEdit.ParagraphRun = ParagraphRun;
    var FieldCodeStartRun = (function (_super) {
        __extends(FieldCodeStartRun, _super);
        function FieldCodeStartRun() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FieldCodeStartRun.prototype.getType = function () {
            return __aspxRichEdit.RunType.FieldCodeStartRun;
        };
        FieldCodeStartRun.prototype.clone = function () {
            return new FieldCodeStartRun(this.startOffset, this.paragraph, this.characterStyle, this.maskedCharacterProperties);
        };
        return FieldCodeStartRun;
    }(__aspxRichEdit.OneCharRun));
    __aspxRichEdit.FieldCodeStartRun = FieldCodeStartRun;
    var FieldCodeEndRun = (function (_super) {
        __extends(FieldCodeEndRun, _super);
        function FieldCodeEndRun() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FieldCodeEndRun.prototype.getType = function () {
            return __aspxRichEdit.RunType.FieldCodeEndRun;
        };
        FieldCodeEndRun.prototype.clone = function () {
            return new FieldCodeEndRun(this.startOffset, this.paragraph, this.characterStyle, this.maskedCharacterProperties);
        };
        return FieldCodeEndRun;
    }(__aspxRichEdit.OneCharRun));
    __aspxRichEdit.FieldCodeEndRun = FieldCodeEndRun;
    var FieldResultEndRun = (function (_super) {
        __extends(FieldResultEndRun, _super);
        function FieldResultEndRun() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FieldResultEndRun.prototype.getType = function () {
            return __aspxRichEdit.RunType.FieldResultEndRun;
        };
        FieldResultEndRun.prototype.clone = function () {
            return new FieldResultEndRun(this.startOffset, this.paragraph, this.characterStyle, this.maskedCharacterProperties);
        };
        return FieldResultEndRun;
    }(__aspxRichEdit.OneCharRun));
    __aspxRichEdit.FieldResultEndRun = FieldResultEndRun;
    var LayoutDependentRun = (function (_super) {
        __extends(LayoutDependentRun, _super);
        function LayoutDependentRun() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutDependentRun.prototype.getType = function () {
            return __aspxRichEdit.RunType.LayoutDependentRun;
        };
        LayoutDependentRun.prototype.clone = function () {
            return new LayoutDependentRun(this.startOffset, this.paragraph, this.characterStyle, this.maskedCharacterProperties);
        };
        return LayoutDependentRun;
    }(__aspxRichEdit.OneCharRun));
    __aspxRichEdit.LayoutDependentRun = LayoutDependentRun;
    var FootNoteRun = (function (_super) {
        __extends(FootNoteRun, _super);
        function FootNoteRun() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FootNoteRun.prototype.getType = function () {
            return __aspxRichEdit.RunType.FootNoteRun;
        };
        FootNoteRun.prototype.clone = function () {
            return new FootNoteRun(this.startOffset, this.paragraph, this.characterStyle, this.maskedCharacterProperties);
        };
        return FootNoteRun;
    }(__aspxRichEdit.OneCharRun));
    __aspxRichEdit.FootNoteRun = FootNoteRun;
    var EndNoteRun = (function (_super) {
        __extends(EndNoteRun, _super);
        function EndNoteRun() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        EndNoteRun.prototype.getType = function () {
            return __aspxRichEdit.RunType.EndNoteRun;
        };
        EndNoteRun.prototype.clone = function () {
            return new EndNoteRun(this.startOffset, this.paragraph, this.characterStyle, this.maskedCharacterProperties);
        };
        return EndNoteRun;
    }(__aspxRichEdit.OneCharRun));
    __aspxRichEdit.EndNoteRun = EndNoteRun;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TextRun = (function (_super) {
        __extends(TextRun, _super);
        function TextRun(startOffset, length, paragraph, characterStyle, maskedCharacterProperties) {
            var _this = _super.call(this, startOffset, paragraph, characterStyle, maskedCharacterProperties) || this;
            _this.length = length;
            return _this;
        }
        TextRun.prototype.getLength = function () {
            return this.length;
        };
        TextRun.prototype.setLength = function (newLength) {
            this.length = newLength;
        };
        TextRun.prototype.getType = function () {
            return __aspxRichEdit.RunType.TextRun;
        };
        TextRun.prototype.incLength = function (additionalLength) {
            this.length += additionalLength;
        };
        TextRun.prototype.clone = function () {
            return new TextRun(this.startOffset, this.length, this.paragraph, this.characterStyle, this.maskedCharacterProperties);
        };
        TextRun.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.length = obj.length;
        };
        return TextRun;
    }(__aspxRichEdit.RunBase));
    __aspxRichEdit.TextRun = TextRun;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AnchoredPictureRun = (function (_super) {
        __extends(AnchoredPictureRun, _super);
        function AnchoredPictureRun(startOffset, paragraph, characterStyle, maskedCharacterProperties, shape, pictureId, size, anchorInfo, isLoaded, objectId) {
            var _this = _super.call(this, startOffset, paragraph, characterStyle, maskedCharacterProperties, shape, pictureId, size, isLoaded) || this;
            _this.anchorInfo = anchorInfo;
            _this.anchoredObjectID = objectId < 0 ? __aspxRichEdit.RunBase.anchoredObjectIdCounter++ : objectId;
            return _this;
        }
        AnchoredPictureRun.prototype.getType = function () {
            return __aspxRichEdit.RunType.AnchoredPictureRun;
        };
        AnchoredPictureRun.prototype.clone = function () {
            return new AnchoredPictureRun(this.startOffset, this.paragraph, this.characterStyle, this.maskedCharacterProperties, this.shape.clone(), this.id, this.size.clone(), this.anchorInfo.clone(), this.isLoaded, -1);
        };
        AnchoredPictureRun.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.anchorInfo = obj.anchorInfo.clone();
        };
        return AnchoredPictureRun;
    }(__aspxRichEdit.PictureRun));
    __aspxRichEdit.AnchoredPictureRun = AnchoredPictureRun;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InlinePictureRun = (function (_super) {
        __extends(InlinePictureRun, _super);
        function InlinePictureRun(startOffset, paragraph, characterStyle, maskedCharacterProperties, shape, pictureId, size, isLoaded, nextPublicAPIId) {
            var _this = _super.call(this, startOffset, paragraph, characterStyle, maskedCharacterProperties, shape, pictureId, size, isLoaded) || this;
            _this.publicAPIId = nextPublicAPIId >= 0 ? nextPublicAPIId : _this.getNextPublicAPIId();
            return _this;
        }
        InlinePictureRun.prototype.getType = function () {
            return __aspxRichEdit.RunType.InlinePictureRun;
        };
        InlinePictureRun.prototype.clone = function () {
            return new InlinePictureRun(this.startOffset, this.paragraph, this.characterStyle, this.maskedCharacterProperties, this.shape.clone(), this.id, this.size.clone(), this.isLoaded, -1);
        };
        InlinePictureRun.prototype.getNextPublicAPIId = function () {
            return InlinePictureRun.nextPublicAPIId++;
        };
        InlinePictureRun.nextPublicAPIId = 0;
        return InlinePictureRun;
    }(__aspxRichEdit.PictureRun));
    __aspxRichEdit.InlinePictureRun = InlinePictureRun;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AnchoredTextBoxRun = (function (_super) {
        __extends(AnchoredTextBoxRun, _super);
        function AnchoredTextBoxRun(startOffset, paragraph, characterStyle, maskedCharacterProperties, shape, subDocId, size, anchorInfo, objectId, textBoxProperties) {
            var _this = _super.call(this, startOffset, paragraph, characterStyle, maskedCharacterProperties, shape, subDocId, textBoxProperties) || this;
            _this.size = size;
            _this.anchorInfo = anchorInfo;
            _this.anchoredObjectID = objectId < 0 ? __aspxRichEdit.RunBase.anchoredObjectIdCounter++ : objectId;
            return _this;
        }
        AnchoredTextBoxRun.prototype.getType = function () {
            return __aspxRichEdit.RunType.AnchoredTextBoxRun;
        };
        AnchoredTextBoxRun.prototype.clone = function () {
            return new AnchoredTextBoxRun(this.startOffset, this.paragraph, this.characterStyle, this.maskedCharacterProperties, this.shape.clone(), this.subDocId, this.size.clone(), this.anchorInfo.clone(), -1, this.textBoxProperties.clone());
        };
        AnchoredTextBoxRun.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.anchorInfo = obj.anchorInfo.clone();
            this.size = obj.size.clone();
        };
        return AnchoredTextBoxRun;
    }(__aspxRichEdit.TextBoxRun));
    __aspxRichEdit.AnchoredTextBoxRun = AnchoredTextBoxRun;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InlineTextBoxRun = (function (_super) {
        __extends(InlineTextBoxRun, _super);
        function InlineTextBoxRun(startOffset, paragraph, characterStyle, maskedCharacterProperties, shape, subDocId, size, textBoxProperties) {
            var _this = _super.call(this, startOffset, paragraph, characterStyle, maskedCharacterProperties, shape, subDocId, textBoxProperties) || this;
            _this.size = size;
            return _this;
        }
        InlineTextBoxRun.prototype.getType = function () {
            return __aspxRichEdit.RunType.InlineTextBoxRun;
        };
        InlineTextBoxRun.prototype.clone = function () {
            return new InlineTextBoxRun(this.startOffset, this.paragraph, this.characterStyle, this.maskedCharacterProperties, this.shape.clone(), this.subDocId, this.size.clone(), this.textBoxProperties.clone());
        };
        InlineTextBoxRun.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.size = obj.size.clone();
        };
        return InlineTextBoxRun;
    }(__aspxRichEdit.TextBoxRun));
    __aspxRichEdit.InlineTextBoxRun = InlineTextBoxRun;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var StyleBase = (function () {
        function StyleBase(styleName, localizedName, deleted, hidden, semihidden, isDefault, base64EncodedImage) {
            this.styleName = styleName;
            this.deleted = deleted;
            this.localizedName = localizedName;
            this.hidden = hidden;
            this.semihidden = semihidden;
            this.isDefault = isDefault;
            this.base64EncodedImage = base64EncodedImage ? base64EncodedImage : null;
        }
        StyleBase.prototype.equalsByName = function (obj) {
            return this.styleName == obj.styleName;
        };
        return StyleBase;
    }());
    __aspxRichEdit.StyleBase = StyleBase;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LangInfo = (function () {
        function LangInfo(bidi, eastAsia, latin) {
            this.bidi = bidi || "";
            this.eastAsia = eastAsia || "";
            this.latin = latin || "";
        }
        LangInfo.prototype.copyFrom = function (obj) {
            this.bidi = obj.bidi;
            this.eastAsia = obj.eastAsia;
            this.latin = obj.latin;
        };
        LangInfo.prototype.equals = function (obj) {
            return obj && this.bidi == obj.bidi &&
                this.eastAsia == obj.eastAsia &&
                this.latin == obj.latin;
        };
        LangInfo.equalsBinary = function (langInfoA, langInfoB) {
            return langInfoA && langInfoB &&
                langInfoA.bidi == langInfoB.bidi &&
                langInfoA.eastAsia == langInfoB.eastAsia &&
                langInfoA.latin == langInfoB.latin;
        };
        LangInfo.prototype.clone = function () {
            var obj = new LangInfo(null, null, null);
            obj.copyFrom(this);
            return obj;
        };
        LangInfo.prototype.isEmpty = function () {
            if (this.bidi == "" && this.eastAsia == "" && this.latin == "")
                return true;
            return false;
        };
        return LangInfo;
    }());
    __aspxRichEdit.LangInfo = LangInfo;
    ;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var CharacterPropertiesAllCapsDescriptor = (function () {
        function CharacterPropertiesAllCapsDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = false;
        }
        CharacterPropertiesAllCapsDescriptor.prototype.setProp = function (props, newValue) {
            props.allCaps = newValue;
        };
        CharacterPropertiesAllCapsDescriptor.prototype.getProp = function (props) {
            return props.allCaps;
        };
        CharacterPropertiesAllCapsDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseAllCaps;
        };
        CharacterPropertiesAllCapsDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.FontCapsHistoryItem;
        };
        CharacterPropertiesAllCapsDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONCharacterFormattingProperty.AllCaps;
        };
        return CharacterPropertiesAllCapsDescriptor;
    }());
    __aspxRichEdit.CharacterPropertiesAllCapsDescriptor = CharacterPropertiesAllCapsDescriptor;
    var CharacterPropertiesFontSizeDescriptor = (function () {
        function CharacterPropertiesFontSizeDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = 11;
        }
        CharacterPropertiesFontSizeDescriptor.prototype.setProp = function (props, newValue) {
            props.fontSize = newValue;
        };
        CharacterPropertiesFontSizeDescriptor.prototype.getProp = function (props) {
            return props.fontSize;
        };
        CharacterPropertiesFontSizeDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseDoubleFontSize;
        };
        CharacterPropertiesFontSizeDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.FontSizeHistoryItem;
        };
        CharacterPropertiesFontSizeDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONCharacterFormattingProperty.Size;
        };
        return CharacterPropertiesFontSizeDescriptor;
    }());
    __aspxRichEdit.CharacterPropertiesFontSizeDescriptor = CharacterPropertiesFontSizeDescriptor;
    var CharacterPropertiesFontBoldDescriptor = (function () {
        function CharacterPropertiesFontBoldDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = false;
        }
        CharacterPropertiesFontBoldDescriptor.prototype.setProp = function (props, newValue) {
            props.fontBold = newValue;
        };
        CharacterPropertiesFontBoldDescriptor.prototype.getProp = function (props) {
            return props.fontBold;
        };
        CharacterPropertiesFontBoldDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseFontBold;
        };
        CharacterPropertiesFontBoldDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.FontBoldHistoryItem;
        };
        CharacterPropertiesFontBoldDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONCharacterFormattingProperty.Bold;
        };
        return CharacterPropertiesFontBoldDescriptor;
    }());
    __aspxRichEdit.CharacterPropertiesFontBoldDescriptor = CharacterPropertiesFontBoldDescriptor;
    var CharacterPropertiesFontItalicDescriptor = (function () {
        function CharacterPropertiesFontItalicDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = false;
        }
        CharacterPropertiesFontItalicDescriptor.prototype.setProp = function (props, newValue) {
            props.fontItalic = newValue;
        };
        CharacterPropertiesFontItalicDescriptor.prototype.getProp = function (props) {
            return props.fontItalic;
        };
        CharacterPropertiesFontItalicDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseFontItalic;
        };
        CharacterPropertiesFontItalicDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.FontItalicHistoryItem;
        };
        CharacterPropertiesFontItalicDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONCharacterFormattingProperty.Italic;
        };
        return CharacterPropertiesFontItalicDescriptor;
    }());
    __aspxRichEdit.CharacterPropertiesFontItalicDescriptor = CharacterPropertiesFontItalicDescriptor;
    var CharacterPropertiesFontInfoDescriptor = (function () {
        function CharacterPropertiesFontInfoDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.binaryEqualsCommon;
            this.defaultValue = undefined;
        }
        CharacterPropertiesFontInfoDescriptor.prototype.setProp = function (props, newValue) {
            props.fontInfo = newValue;
        };
        CharacterPropertiesFontInfoDescriptor.prototype.getProp = function (props) {
            return props.fontInfo;
        };
        CharacterPropertiesFontInfoDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseFontName;
        };
        CharacterPropertiesFontInfoDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.FontNameHistoryItem;
        };
        CharacterPropertiesFontInfoDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONCharacterFormattingProperty.FontInfoIndex;
        };
        return CharacterPropertiesFontInfoDescriptor;
    }());
    __aspxRichEdit.CharacterPropertiesFontInfoDescriptor = CharacterPropertiesFontInfoDescriptor;
    var CharacterPropertiesScriptDescriptor = (function () {
        function CharacterPropertiesScriptDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = __aspxRichEdit.CharacterFormattingScript.Normal;
        }
        CharacterPropertiesScriptDescriptor.prototype.setProp = function (props, newValue) {
            props.script = newValue;
        };
        CharacterPropertiesScriptDescriptor.prototype.getProp = function (props) {
            return props.script;
        };
        CharacterPropertiesScriptDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseScript;
        };
        CharacterPropertiesScriptDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.FontScriptHistoryItem;
        };
        CharacterPropertiesScriptDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONCharacterFormattingProperty.Script;
        };
        return CharacterPropertiesScriptDescriptor;
    }());
    __aspxRichEdit.CharacterPropertiesScriptDescriptor = CharacterPropertiesScriptDescriptor;
    var CharacterPropertiesStrikeoutTypeDescriptor = (function () {
        function CharacterPropertiesStrikeoutTypeDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = __aspxRichEdit.StrikeoutType.None;
        }
        CharacterPropertiesStrikeoutTypeDescriptor.prototype.setProp = function (props, newValue) {
            props.fontStrikeoutType = newValue;
        };
        CharacterPropertiesStrikeoutTypeDescriptor.prototype.getProp = function (props) {
            return props.fontStrikeoutType;
        };
        CharacterPropertiesStrikeoutTypeDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseFontStrikeoutType;
        };
        CharacterPropertiesStrikeoutTypeDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.FontStrikeoutTypeHistoryItem;
        };
        CharacterPropertiesStrikeoutTypeDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONCharacterFormattingProperty.StrikeoutType;
        };
        return CharacterPropertiesStrikeoutTypeDescriptor;
    }());
    __aspxRichEdit.CharacterPropertiesStrikeoutTypeDescriptor = CharacterPropertiesStrikeoutTypeDescriptor;
    var CharacterPropertiesUnderlineTypeDescriptor = (function () {
        function CharacterPropertiesUnderlineTypeDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = __aspxRichEdit.UnderlineType.None;
        }
        CharacterPropertiesUnderlineTypeDescriptor.prototype.setProp = function (props, newValue) {
            props.fontUnderlineType = newValue;
        };
        CharacterPropertiesUnderlineTypeDescriptor.prototype.getProp = function (props) {
            return props.fontUnderlineType;
        };
        CharacterPropertiesUnderlineTypeDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseFontUnderlineType;
        };
        CharacterPropertiesUnderlineTypeDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.FontUnderlineTypeHistoryItem;
        };
        CharacterPropertiesUnderlineTypeDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONCharacterFormattingProperty.UnderlineType;
        };
        return CharacterPropertiesUnderlineTypeDescriptor;
    }());
    __aspxRichEdit.CharacterPropertiesUnderlineTypeDescriptor = CharacterPropertiesUnderlineTypeDescriptor;
    var CharacterPropertiesUnderlineWordsOnlyDescriptor = (function () {
        function CharacterPropertiesUnderlineWordsOnlyDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = false;
        }
        CharacterPropertiesUnderlineWordsOnlyDescriptor.prototype.setProp = function (props, newValue) {
            props.underlineWordsOnly = newValue;
        };
        CharacterPropertiesUnderlineWordsOnlyDescriptor.prototype.getProp = function (props) {
            return props.underlineWordsOnly;
        };
        CharacterPropertiesUnderlineWordsOnlyDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseUnderlineWordsOnly;
        };
        CharacterPropertiesUnderlineWordsOnlyDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.FontUnderlineWordsOnlyHistoryItem;
        };
        CharacterPropertiesUnderlineWordsOnlyDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONCharacterFormattingProperty.UnderlineWordsOnly;
        };
        return CharacterPropertiesUnderlineWordsOnlyDescriptor;
    }());
    __aspxRichEdit.CharacterPropertiesUnderlineWordsOnlyDescriptor = CharacterPropertiesUnderlineWordsOnlyDescriptor;
    var CharacterPropertiesStrikeoutWordsOnlyDescriptor = (function () {
        function CharacterPropertiesStrikeoutWordsOnlyDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = false;
        }
        CharacterPropertiesStrikeoutWordsOnlyDescriptor.prototype.setProp = function (props, newValue) {
            props.strikeoutWordsOnly = newValue;
        };
        CharacterPropertiesStrikeoutWordsOnlyDescriptor.prototype.getProp = function (props) {
            return props.strikeoutWordsOnly;
        };
        CharacterPropertiesStrikeoutWordsOnlyDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseStrikeoutWordsOnly;
        };
        CharacterPropertiesStrikeoutWordsOnlyDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.FontStrikeoutWordsOnlyHistoryItem;
        };
        CharacterPropertiesStrikeoutWordsOnlyDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONCharacterFormattingProperty.StrikeoutWordsOnly;
        };
        return CharacterPropertiesStrikeoutWordsOnlyDescriptor;
    }());
    __aspxRichEdit.CharacterPropertiesStrikeoutWordsOnlyDescriptor = CharacterPropertiesStrikeoutWordsOnlyDescriptor;
    var CharacterPropertiesNoProofDescriptor = (function () {
        function CharacterPropertiesNoProofDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = false;
        }
        CharacterPropertiesNoProofDescriptor.prototype.setProp = function (props, newValue) {
            props.noProof = newValue;
        };
        CharacterPropertiesNoProofDescriptor.prototype.getProp = function (props) {
            return props.noProof;
        };
        CharacterPropertiesNoProofDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseNoProof;
        };
        CharacterPropertiesNoProofDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.FontNoProofHistoryItem;
        };
        CharacterPropertiesNoProofDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONCharacterFormattingProperty.NoProof;
        };
        return CharacterPropertiesNoProofDescriptor;
    }());
    __aspxRichEdit.CharacterPropertiesNoProofDescriptor = CharacterPropertiesNoProofDescriptor;
    var CharacterPropertiesHiddenDescriptor = (function () {
        function CharacterPropertiesHiddenDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = false;
        }
        CharacterPropertiesHiddenDescriptor.prototype.setProp = function (props, newValue) {
            props.hidden = newValue;
        };
        CharacterPropertiesHiddenDescriptor.prototype.getProp = function (props) {
            return props.hidden;
        };
        CharacterPropertiesHiddenDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseHidden;
        };
        CharacterPropertiesHiddenDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.FontHiddenHistoryItem;
        };
        CharacterPropertiesHiddenDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONCharacterFormattingProperty.Hidden;
        };
        return CharacterPropertiesHiddenDescriptor;
    }());
    __aspxRichEdit.CharacterPropertiesHiddenDescriptor = CharacterPropertiesHiddenDescriptor;
    var CharacterPropertiesTextColorDescriptor = (function () {
        function CharacterPropertiesTextColorDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.binaryEqualsCommon;
            this.defaultValue = __aspxRichEdit.ColorModelInfo.autoColor;
        }
        CharacterPropertiesTextColorDescriptor.prototype.setProp = function (props, newValue) {
            props.textColor = newValue;
        };
        CharacterPropertiesTextColorDescriptor.prototype.getProp = function (props) {
            return props.textColor;
        };
        CharacterPropertiesTextColorDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseForeColorIndex;
        };
        CharacterPropertiesTextColorDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.FontTextColorHistoryItem;
        };
        CharacterPropertiesTextColorDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONCharacterFormattingProperty.TextColor;
        };
        return CharacterPropertiesTextColorDescriptor;
    }());
    __aspxRichEdit.CharacterPropertiesTextColorDescriptor = CharacterPropertiesTextColorDescriptor;
    var CharacterPropertiesShadingInfoColorDescriptor = (function () {
        function CharacterPropertiesShadingInfoColorDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.binaryEqualsCommon;
            this.defaultValue = __aspxRichEdit.ShadingInfo.noColor;
        }
        CharacterPropertiesShadingInfoColorDescriptor.prototype.setProp = function (props, newValue) {
            props.shadingInfo = newValue;
        };
        CharacterPropertiesShadingInfoColorDescriptor.prototype.getProp = function (props) {
            return props.shadingInfo;
        };
        CharacterPropertiesShadingInfoColorDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseShadingInfoIndex;
        };
        CharacterPropertiesShadingInfoColorDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.FontShadingInfoHistoryItem;
        };
        CharacterPropertiesShadingInfoColorDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONCharacterFormattingProperty.ShadingInfo;
        };
        return CharacterPropertiesShadingInfoColorDescriptor;
    }());
    __aspxRichEdit.CharacterPropertiesShadingInfoColorDescriptor = CharacterPropertiesShadingInfoColorDescriptor;
    var CharacterPropertiesStrikeoutColorDescriptor = (function () {
        function CharacterPropertiesStrikeoutColorDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.binaryEqualsCommon;
            this.defaultValue = __aspxRichEdit.ColorModelInfo.noColor;
        }
        CharacterPropertiesStrikeoutColorDescriptor.prototype.setProp = function (props, newValue) {
            props.strikeoutColor = newValue;
        };
        CharacterPropertiesStrikeoutColorDescriptor.prototype.getProp = function (props) {
            return props.strikeoutColor;
        };
        CharacterPropertiesStrikeoutColorDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseStrikeoutColorIndex;
        };
        CharacterPropertiesStrikeoutColorDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.FontStrikeoutColorHistoryItem;
        };
        CharacterPropertiesStrikeoutColorDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONCharacterFormattingProperty.StrikeoutColor;
        };
        return CharacterPropertiesStrikeoutColorDescriptor;
    }());
    __aspxRichEdit.CharacterPropertiesStrikeoutColorDescriptor = CharacterPropertiesStrikeoutColorDescriptor;
    var CharacterPropertiesUnderlineColorDescriptor = (function () {
        function CharacterPropertiesUnderlineColorDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.binaryEqualsCommon;
            this.defaultValue = __aspxRichEdit.ColorModelInfo.noColor;
        }
        CharacterPropertiesUnderlineColorDescriptor.prototype.setProp = function (props, newValue) {
            props.underlineColor = newValue;
        };
        CharacterPropertiesUnderlineColorDescriptor.prototype.getProp = function (props) {
            return props.underlineColor;
        };
        CharacterPropertiesUnderlineColorDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseUnderlineColorIndex;
        };
        CharacterPropertiesUnderlineColorDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.FontUnderlineColorHistoryItem;
        };
        CharacterPropertiesUnderlineColorDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONCharacterFormattingProperty.UnderlineColor;
        };
        return CharacterPropertiesUnderlineColorDescriptor;
    }());
    __aspxRichEdit.CharacterPropertiesUnderlineColorDescriptor = CharacterPropertiesUnderlineColorDescriptor;
    var CharacterPropertiesHighlightColorDescriptor = (function () {
        function CharacterPropertiesHighlightColorDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.binaryEqualsCommon;
            this.defaultValue = __aspxRichEdit.ColorModelInfo.noColor;
        }
        CharacterPropertiesHighlightColorDescriptor.prototype.setProp = function (props, newValue) {
            props.highlightColor = newValue;
        };
        CharacterPropertiesHighlightColorDescriptor.prototype.getProp = function (props) {
            return props.highlightColor;
        };
        CharacterPropertiesHighlightColorDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseHighlightColorIndex;
        };
        CharacterPropertiesHighlightColorDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.FontHighlightColorHistoryItem;
        };
        CharacterPropertiesHighlightColorDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONCharacterFormattingProperty.HighlightColor;
        };
        return CharacterPropertiesHighlightColorDescriptor;
    }());
    __aspxRichEdit.CharacterPropertiesHighlightColorDescriptor = CharacterPropertiesHighlightColorDescriptor;
    var CharacterPropertiesLangInfoDescriptor = (function () {
        function CharacterPropertiesLangInfoDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.binaryEqualsCommon;
            this.defaultValue = new __aspxRichEdit.LangInfo();
        }
        CharacterPropertiesLangInfoDescriptor.prototype.setProp = function (props, newValue) {
            props.langInfo = newValue;
        };
        CharacterPropertiesLangInfoDescriptor.prototype.getProp = function (props) {
            return props.langInfo;
        };
        CharacterPropertiesLangInfoDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseLangInfo;
        };
        CharacterPropertiesLangInfoDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.FontLangInfoHistoryItem;
        };
        CharacterPropertiesLangInfoDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONCharacterFormattingProperty.LangInfo;
        };
        return CharacterPropertiesLangInfoDescriptor;
    }());
    __aspxRichEdit.CharacterPropertiesLangInfoDescriptor = CharacterPropertiesLangInfoDescriptor;
    var CharacterPropertiesCompositeFontInfoDescriptor = (function () {
        function CharacterPropertiesCompositeFontInfoDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.binaryEqualsCommon;
            this.defaultValue = new __aspxRichEdit.CompositeFontInfo();
        }
        CharacterPropertiesCompositeFontInfoDescriptor.prototype.setProp = function (props, newValue) {
            props.compositeFontInfo = newValue;
        };
        CharacterPropertiesCompositeFontInfoDescriptor.prototype.getProp = function (props) {
            return props.compositeFontInfo;
        };
        CharacterPropertiesCompositeFontInfoDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseCompositeFontInfo;
        };
        CharacterPropertiesCompositeFontInfoDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.FontCompositeFontInfoHistoryItem;
        };
        CharacterPropertiesCompositeFontInfoDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONCharacterFormattingProperty.CompositeFontInfo;
        };
        return CharacterPropertiesCompositeFontInfoDescriptor;
    }());
    __aspxRichEdit.CharacterPropertiesCompositeFontInfoDescriptor = CharacterPropertiesCompositeFontInfoDescriptor;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var CharacterFormattingScript;
    (function (CharacterFormattingScript) {
        CharacterFormattingScript[CharacterFormattingScript["Normal"] = 0] = "Normal";
        CharacterFormattingScript[CharacterFormattingScript["Subscript"] = 1] = "Subscript";
        CharacterFormattingScript[CharacterFormattingScript["Superscript"] = 2] = "Superscript";
    })(CharacterFormattingScript = __aspxRichEdit.CharacterFormattingScript || (__aspxRichEdit.CharacterFormattingScript = {}));
    var ThemeFontType;
    (function (ThemeFontType) {
        ThemeFontType[ThemeFontType["None"] = 0] = "None";
        ThemeFontType[ThemeFontType["MajorEastAsia"] = 1] = "MajorEastAsia";
        ThemeFontType[ThemeFontType["MajorBidi"] = 2] = "MajorBidi";
        ThemeFontType[ThemeFontType["MajorAscii"] = 3] = "MajorAscii";
        ThemeFontType[ThemeFontType["MajorHAnsi"] = 4] = "MajorHAnsi";
        ThemeFontType[ThemeFontType["MinorEastAsia"] = 5] = "MinorEastAsia";
        ThemeFontType[ThemeFontType["MinorBidi"] = 6] = "MinorBidi";
        ThemeFontType[ThemeFontType["MinorAscii"] = 7] = "MinorAscii";
        ThemeFontType[ThemeFontType["MinorHAnsi"] = 8] = "MinorHAnsi";
    })(ThemeFontType = __aspxRichEdit.ThemeFontType || (__aspxRichEdit.ThemeFontType = {}));
    var FontTypeHint;
    (function (FontTypeHint) {
        FontTypeHint[FontTypeHint["Cs"] = 0] = "Cs";
        FontTypeHint[FontTypeHint["EastAsia"] = 1] = "EastAsia";
        FontTypeHint[FontTypeHint["Default"] = 2] = "Default";
        FontTypeHint[FontTypeHint["None"] = 3] = "None";
    })(FontTypeHint = __aspxRichEdit.FontTypeHint || (__aspxRichEdit.FontTypeHint = {}));
    var CompositeFontInfo = (function () {
        function CompositeFontInfo() {
            this.asciiFontName = "";
            this.hightAnsiFontName = "";
            this.complexScriptFontName = "";
            this.eastAsiaFontName = "";
            this.asciiThemeFont = ThemeFontType.None;
            this.hightAnsiThemeFont = ThemeFontType.None;
            this.complexScriptThemeFont = ThemeFontType.None;
            this.eastAsiaThemeFont = ThemeFontType.None;
            this.hintFont = FontTypeHint.Default;
        }
        CompositeFontInfo.prototype.equals = function (obj) {
            return obj &&
                this.asciiFontName == this.asciiFontName &&
                this.hightAnsiFontName == this.hightAnsiFontName &&
                this.complexScriptFontName == this.complexScriptFontName &&
                this.eastAsiaFontName == this.eastAsiaFontName &&
                this.asciiThemeFont == this.asciiThemeFont &&
                this.hightAnsiThemeFont == this.hightAnsiThemeFont &&
                this.complexScriptThemeFont == this.complexScriptThemeFont &&
                this.eastAsiaThemeFont == this.eastAsiaThemeFont &&
                this.hintFont == this.hintFont;
        };
        CompositeFontInfo.prototype.clone = function () {
            var result = new CompositeFontInfo();
            result.asciiFontName = this.asciiFontName;
            result.hightAnsiFontName = this.hightAnsiFontName;
            result.complexScriptFontName = this.complexScriptFontName;
            result.eastAsiaFontName = this.eastAsiaFontName;
            result.asciiThemeFont = this.asciiThemeFont;
            result.hightAnsiThemeFont = this.hightAnsiThemeFont;
            result.complexScriptThemeFont = this.complexScriptThemeFont;
            result.eastAsiaThemeFont = this.eastAsiaThemeFont;
            result.hintFont = this.hintFont;
            return result;
        };
        return CompositeFontInfo;
    }());
    __aspxRichEdit.CompositeFontInfo = CompositeFontInfo;
    var CharacterPropertiesMask;
    (function (CharacterPropertiesMask) {
        CharacterPropertiesMask[CharacterPropertiesMask["UseNone"] = 0] = "UseNone";
        CharacterPropertiesMask[CharacterPropertiesMask["UseFontName"] = 1] = "UseFontName";
        CharacterPropertiesMask[CharacterPropertiesMask["UseDoubleFontSize"] = 2] = "UseDoubleFontSize";
        CharacterPropertiesMask[CharacterPropertiesMask["UseFontBold"] = 4] = "UseFontBold";
        CharacterPropertiesMask[CharacterPropertiesMask["UseFontItalic"] = 8] = "UseFontItalic";
        CharacterPropertiesMask[CharacterPropertiesMask["UseFontStrikeoutType"] = 16] = "UseFontStrikeoutType";
        CharacterPropertiesMask[CharacterPropertiesMask["UseFontUnderlineType"] = 32] = "UseFontUnderlineType";
        CharacterPropertiesMask[CharacterPropertiesMask["UseAllCaps"] = 64] = "UseAllCaps";
        CharacterPropertiesMask[CharacterPropertiesMask["UseForeColorIndex"] = 128] = "UseForeColorIndex";
        CharacterPropertiesMask[CharacterPropertiesMask["UseShadingInfoIndex"] = 256] = "UseShadingInfoIndex";
        CharacterPropertiesMask[CharacterPropertiesMask["UseUnderlineColorIndex"] = 512] = "UseUnderlineColorIndex";
        CharacterPropertiesMask[CharacterPropertiesMask["UseStrikeoutColorIndex"] = 1024] = "UseStrikeoutColorIndex";
        CharacterPropertiesMask[CharacterPropertiesMask["UseUnderlineWordsOnly"] = 2048] = "UseUnderlineWordsOnly";
        CharacterPropertiesMask[CharacterPropertiesMask["UseStrikeoutWordsOnly"] = 4096] = "UseStrikeoutWordsOnly";
        CharacterPropertiesMask[CharacterPropertiesMask["UseScript"] = 8192] = "UseScript";
        CharacterPropertiesMask[CharacterPropertiesMask["UseHidden"] = 16384] = "UseHidden";
        CharacterPropertiesMask[CharacterPropertiesMask["UseLangInfo"] = 32768] = "UseLangInfo";
        CharacterPropertiesMask[CharacterPropertiesMask["UseNoProof"] = 65536] = "UseNoProof";
        CharacterPropertiesMask[CharacterPropertiesMask["UseFontInfo"] = 131072] = "UseFontInfo";
        CharacterPropertiesMask[CharacterPropertiesMask["UseHighlightColorIndex"] = 262144] = "UseHighlightColorIndex";
        CharacterPropertiesMask[CharacterPropertiesMask["UseRightToLeft"] = 524288] = "UseRightToLeft";
        CharacterPropertiesMask[CharacterPropertiesMask["UseCompositeFontInfo"] = 1048576] = "UseCompositeFontInfo";
        CharacterPropertiesMask[CharacterPropertiesMask["UseAll"] = 2147483647] = "UseAll";
    })(CharacterPropertiesMask = __aspxRichEdit.CharacterPropertiesMask || (__aspxRichEdit.CharacterPropertiesMask = {}));
    var StrikeoutType;
    (function (StrikeoutType) {
        StrikeoutType[StrikeoutType["None"] = 0] = "None";
        StrikeoutType[StrikeoutType["Single"] = 1] = "Single";
        StrikeoutType[StrikeoutType["Double"] = 2] = "Double";
    })(StrikeoutType = __aspxRichEdit.StrikeoutType || (__aspxRichEdit.StrikeoutType = {}));
    var UnderlineType;
    (function (UnderlineType) {
        UnderlineType[UnderlineType["None"] = 0] = "None";
        UnderlineType[UnderlineType["Single"] = 1] = "Single";
        UnderlineType[UnderlineType["Dotted"] = 2] = "Dotted";
        UnderlineType[UnderlineType["Dashed"] = 3] = "Dashed";
        UnderlineType[UnderlineType["DashDotted"] = 4] = "DashDotted";
        UnderlineType[UnderlineType["DashDotDotted"] = 5] = "DashDotDotted";
        UnderlineType[UnderlineType["Double"] = 6] = "Double";
        UnderlineType[UnderlineType["HeavyWave"] = 7] = "HeavyWave";
        UnderlineType[UnderlineType["LongDashed"] = 8] = "LongDashed";
        UnderlineType[UnderlineType["ThickSingle"] = 9] = "ThickSingle";
        UnderlineType[UnderlineType["ThickDotted"] = 10] = "ThickDotted";
        UnderlineType[UnderlineType["ThickDashed"] = 11] = "ThickDashed";
        UnderlineType[UnderlineType["ThickDashDotted"] = 12] = "ThickDashDotted";
        UnderlineType[UnderlineType["ThickDashDotDotted"] = 13] = "ThickDashDotDotted";
        UnderlineType[UnderlineType["ThickLongDashed"] = 14] = "ThickLongDashed";
        UnderlineType[UnderlineType["DoubleWave"] = 15] = "DoubleWave";
        UnderlineType[UnderlineType["Wave"] = 16] = "Wave";
        UnderlineType[UnderlineType["DashSmallGap"] = 17] = "DashSmallGap";
    })(UnderlineType = __aspxRichEdit.UnderlineType || (__aspxRichEdit.UnderlineType = {}));
    var CharacterPropertyDescriptor = (function () {
        function CharacterPropertyDescriptor() {
        }
        CharacterPropertyDescriptor.allCaps = new __aspxRichEdit.CharacterPropertiesAllCapsDescriptor();
        CharacterPropertyDescriptor.size = new __aspxRichEdit.CharacterPropertiesFontSizeDescriptor();
        CharacterPropertyDescriptor.bold = new __aspxRichEdit.CharacterPropertiesFontBoldDescriptor();
        CharacterPropertyDescriptor.italic = new __aspxRichEdit.CharacterPropertiesFontItalicDescriptor();
        CharacterPropertyDescriptor.fontInfo = new __aspxRichEdit.CharacterPropertiesFontInfoDescriptor();
        CharacterPropertyDescriptor.script = new __aspxRichEdit.CharacterPropertiesScriptDescriptor();
        CharacterPropertyDescriptor.strikeoutType = new __aspxRichEdit.CharacterPropertiesStrikeoutTypeDescriptor();
        CharacterPropertyDescriptor.underlineType = new __aspxRichEdit.CharacterPropertiesUnderlineTypeDescriptor();
        CharacterPropertyDescriptor.underlineWordsOnly = new __aspxRichEdit.CharacterPropertiesUnderlineWordsOnlyDescriptor();
        CharacterPropertyDescriptor.strikeoutWordsOnly = new __aspxRichEdit.CharacterPropertiesStrikeoutWordsOnlyDescriptor();
        CharacterPropertyDescriptor.noProof = new __aspxRichEdit.CharacterPropertiesNoProofDescriptor();
        CharacterPropertyDescriptor.hidden = new __aspxRichEdit.CharacterPropertiesHiddenDescriptor();
        CharacterPropertyDescriptor.langInfo = new __aspxRichEdit.CharacterPropertiesLangInfoDescriptor();
        CharacterPropertyDescriptor.compositeFontInfo = new __aspxRichEdit.CharacterPropertiesCompositeFontInfoDescriptor();
        CharacterPropertyDescriptor.textColor = new __aspxRichEdit.CharacterPropertiesTextColorDescriptor();
        CharacterPropertyDescriptor.shadingInfo = new __aspxRichEdit.CharacterPropertiesShadingInfoColorDescriptor();
        CharacterPropertyDescriptor.highlightColor = new __aspxRichEdit.CharacterPropertiesHighlightColorDescriptor();
        CharacterPropertyDescriptor.strikeoutColor = new __aspxRichEdit.CharacterPropertiesStrikeoutColorDescriptor();
        CharacterPropertyDescriptor.underlineColor = new __aspxRichEdit.CharacterPropertiesUnderlineColorDescriptor();
        CharacterPropertyDescriptor.ALL_FIELDS = [
            CharacterPropertyDescriptor.allCaps,
            CharacterPropertyDescriptor.size,
            CharacterPropertyDescriptor.bold,
            CharacterPropertyDescriptor.italic,
            CharacterPropertyDescriptor.fontInfo,
            CharacterPropertyDescriptor.script,
            CharacterPropertyDescriptor.strikeoutType,
            CharacterPropertyDescriptor.underlineType,
            CharacterPropertyDescriptor.underlineWordsOnly,
            CharacterPropertyDescriptor.strikeoutWordsOnly,
            CharacterPropertyDescriptor.noProof,
            CharacterPropertyDescriptor.hidden,
            CharacterPropertyDescriptor.langInfo,
            CharacterPropertyDescriptor.compositeFontInfo,
            CharacterPropertyDescriptor.textColor,
            CharacterPropertyDescriptor.shadingInfo,
            CharacterPropertyDescriptor.highlightColor,
            CharacterPropertyDescriptor.strikeoutColor,
            CharacterPropertyDescriptor.underlineColor,
        ];
        return CharacterPropertyDescriptor;
    }());
    __aspxRichEdit.CharacterPropertyDescriptor = CharacterPropertyDescriptor;
    var CharacterProperties = (function () {
        function CharacterProperties() {
            this.measurerSizes = {};
            this.fontSize = 11;
            this.fontBold = false;
            this.fontItalic = false;
            this.fontInfo = null;
            this.script = CharacterFormattingScript.Normal;
            this.fontStrikeoutType = StrikeoutType.None;
            this.fontUnderlineType = UnderlineType.None;
            this.allCaps = false;
            this.underlineWordsOnly = false;
            this.strikeoutWordsOnly = false;
            this.noProof = false;
            this.hidden = false;
            this.langInfo = new __aspxRichEdit.LangInfo();
            this.compositeFontInfo = new CompositeFontInfo();
            this.textColor = __aspxRichEdit.ColorModelInfo.nullColor;
            this.shadingInfo = __aspxRichEdit.ShadingInfo.nullColor;
            this.highlightColor = __aspxRichEdit.ColorModelInfo.nullColor;
            this.strikeoutColor = __aspxRichEdit.ColorModelInfo.nullColor;
            this.underlineColor = __aspxRichEdit.ColorModelInfo.nullColor;
        }
        CharacterProperties.prototype.calculateHash = function () {
            return this.fontSize ^
                __aspxRichEdit.MathUtils.somePrimes[0] * __aspxRichEdit.Utils.boolToInt(this.fontBold) ^
                __aspxRichEdit.MathUtils.somePrimes[1] * __aspxRichEdit.Utils.boolToInt(this.fontItalic) ^
                __aspxRichEdit.MathUtils.somePrimes[2] * this.shadingInfo.getHashCode() ^
                __aspxRichEdit.MathUtils.somePrimes[3] * this.textColor.getHashCode() ^
                __aspxRichEdit.MathUtils.somePrimes[4] * this.highlightColor.getHashCode();
        };
        CharacterProperties.prototype.getHashCode = function () {
            return this.hash === undefined ? this.hash = this.calculateHash() : this.hash;
        };
        CharacterProperties.prototype.equals = function (obj) {
            if (!obj)
                return false;
            return this.fontBold == obj.fontBold &&
                this.fontItalic == obj.fontItalic &&
                (this.fontInfo && obj.fontInfo && this.fontInfo.equals(obj.fontInfo)) &&
                this.fontSize == obj.fontSize &&
                this.script == obj.script &&
                this.fontStrikeoutType == obj.fontStrikeoutType &&
                this.fontUnderlineType == obj.fontUnderlineType &&
                this.allCaps == obj.allCaps &&
                this.underlineWordsOnly == obj.underlineWordsOnly &&
                this.strikeoutWordsOnly == obj.strikeoutWordsOnly &&
                this.noProof == obj.noProof &&
                this.hidden == obj.hidden &&
                this.shadingInfo.equals(obj.shadingInfo) &&
                this.textColor.equals(obj.textColor) &&
                this.highlightColor.equals(obj.highlightColor) &&
                this.strikeoutColor.equals(obj.strikeoutColor) &&
                this.underlineColor.equals(obj.underlineColor) &&
                (this.langInfo && obj.langInfo && this.langInfo.equals(obj.langInfo)) &&
                (this.compositeFontInfo && this.compositeFontInfo.equals(obj.compositeFontInfo));
        };
        CharacterProperties.prototype.clone = function () {
            var result = new CharacterProperties();
            result.copyFrom(this);
            return result;
        };
        CharacterProperties.prototype.copyFrom = function (obj) {
            this.fontInfo = obj.fontInfo;
            this.fontSize = obj.fontSize;
            this.fontBold = obj.fontBold;
            this.fontItalic = obj.fontItalic;
            this.script = obj.script;
            this.fontStrikeoutType = obj.fontStrikeoutType;
            this.fontUnderlineType = obj.fontUnderlineType;
            this.allCaps = obj.allCaps;
            this.underlineWordsOnly = obj.underlineWordsOnly;
            this.strikeoutWordsOnly = obj.strikeoutWordsOnly;
            this.noProof = obj.noProof;
            this.hidden = obj.hidden;
            this.shadingInfo = obj.shadingInfo ? obj.shadingInfo.clone() : new __aspxRichEdit.ShadingInfo(__aspxRichEdit.ShadingPattern.Clear, __aspxRichEdit.ColorModelInfo.noColor, __aspxRichEdit.ColorModelInfo.noColor);
            this.textColor = obj.textColor ? obj.textColor.clone() : __aspxRichEdit.ColorModelInfo.noColor;
            this.highlightColor = obj.highlightColor ? obj.highlightColor.clone() : __aspxRichEdit.ColorModelInfo.noColor;
            this.strikeoutColor = obj.strikeoutColor ? obj.strikeoutColor.clone() : __aspxRichEdit.ColorModelInfo.noColor;
            this.underlineColor = obj.underlineColor ? obj.underlineColor.clone() : __aspxRichEdit.ColorModelInfo.noColor;
            this.langInfo = obj.langInfo ? obj.langInfo.clone() : new __aspxRichEdit.LangInfo();
            this.compositeFontInfo = obj.compositeFontInfo ? obj.compositeFontInfo.clone() : new CompositeFontInfo();
            this.clearSizes();
        };
        CharacterProperties.prototype.getSize = function (text) {
            return this.measurerSizes.hasOwnProperty(text) ? this.measurerSizes[text] : undefined;
        };
        CharacterProperties.prototype.setSize = function (text, size) {
            if (typeof (this.measurerSizes[text]) !== "function")
                this.measurerSizes[text] = size;
        };
        CharacterProperties.prototype.clearSizes = function () {
            this.measurerSizes = {};
        };
        CharacterProperties.prototype.getLayoutColorInfo = function (colorProvider) {
            return new LayoutCharacterPropertiesColorInfo(this.textColor.toRgb(colorProvider), CharacterProperties.getActualBackgroundColor(this, colorProvider), this.strikeoutColor.toRgb(colorProvider), this.underlineColor.toRgb(colorProvider));
        };
        CharacterProperties.getActualBackgroundColor = function (charProps, colorProvider) {
            var backColor = charProps.shadingInfo.getActualColor(colorProvider);
            var highlightColor = charProps.highlightColor.toRgb(colorProvider);
            return __aspxRichEdit.EnumUtils.isAnyOf(highlightColor, __aspxRichEdit.ColorHelper.NO_COLOR, __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR) ? backColor : highlightColor;
        };
        return CharacterProperties;
    }());
    __aspxRichEdit.CharacterProperties = CharacterProperties;
    var MaskedCharacterProperties = (function (_super) {
        __extends(MaskedCharacterProperties, _super);
        function MaskedCharacterProperties() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.useValue = CharacterPropertiesMask.UseNone;
            return _this;
        }
        MaskedCharacterProperties.prototype.calculateHash = function () {
            return _super.prototype.calculateHash.call(this) +
                __aspxRichEdit.MathUtils.somePrimes[15] * this.useValue;
        };
        MaskedCharacterProperties.prototype.getUseValue = function (value) {
            return (this.useValue & value) != 0;
        };
        MaskedCharacterProperties.prototype.setUseValue = function (mask, value) {
            if (value)
                this.useValue |= mask;
            else
                this.useValue &= ~mask;
        };
        MaskedCharacterProperties.prototype.clone = function () {
            var result = new MaskedCharacterProperties();
            result.copyFrom(this);
            return result;
        };
        MaskedCharacterProperties.prototype.copyFrom = function (obj) {
            CharacterProperties.prototype.copyFrom.call(this, obj);
            this.useValue = obj.useValue;
        };
        MaskedCharacterProperties.prototype.equals = function (obj) {
            return CharacterProperties.prototype.equals.call(this, obj)
                && this.useValue == obj.useValue;
        };
        MaskedCharacterProperties.createDefault = function (model) {
            var prop = model.defaultCharacterProperties.clone();
            prop.useValue = 0;
            return prop;
        };
        MaskedCharacterProperties.prototype.setValue = function (desc, value) {
            desc.setProp(this, value);
            this.setUseValue(desc.maskValue(), true);
        };
        return MaskedCharacterProperties;
    }(CharacterProperties));
    __aspxRichEdit.MaskedCharacterProperties = MaskedCharacterProperties;
    var LayoutCharacterPropertiesColorInfo = (function () {
        function LayoutCharacterPropertiesColorInfo(textColor, foregroundColor, strikeoutColor, underlineColor) {
            this.textColor = textColor;
            this.foregroundColor = foregroundColor;
            this.strikeoutColor = strikeoutColor;
            this.underlineColor = underlineColor;
        }
        LayoutCharacterPropertiesColorInfo.prototype.equals = function (obj) {
            return obj &&
                this.textColor == obj.textColor &&
                this.foregroundColor == obj.foregroundColor &&
                this.strikeoutColor == obj.strikeoutColor &&
                this.underlineColor == obj.underlineColor;
        };
        LayoutCharacterPropertiesColorInfo.prototype.clone = function () {
            return new LayoutCharacterPropertiesColorInfo(this.textColor, this.foregroundColor, this.strikeoutColor, this.underlineColor);
        };
        return LayoutCharacterPropertiesColorInfo;
    }());
    __aspxRichEdit.LayoutCharacterPropertiesColorInfo = LayoutCharacterPropertiesColorInfo;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var CharacterStyle = (function (_super) {
        __extends(CharacterStyle, _super);
        function CharacterStyle(styleName, localizedName, deleted, hidden, semihidden, isDefault, maskedCharacterProperties, base64EncodedImage) {
            var _this = _super.call(this, styleName, localizedName, deleted, hidden, semihidden, isDefault, base64EncodedImage ? base64EncodedImage : null) || this;
            _this.maskedCharacterProperties = maskedCharacterProperties;
            return _this;
        }
        CharacterStyle.prototype.clone = function () {
            var style = new CharacterStyle(this.styleName, this.localizedName, this.deleted, this.hidden, this.semihidden, this.isDefault, this.maskedCharacterProperties, this.base64EncodedImage);
            style.parent = this.parent;
            style.linkedStyle = this.linkedStyle;
            style.primary = this.primary;
            return style;
        };
        CharacterStyle.defaultParagraphCharacterStyleName = "Default Paragraph Font";
        CharacterStyle.hyperlinkStyleName = "Hyperlink";
        return CharacterStyle;
    }(__aspxRichEdit.StyleBase));
    __aspxRichEdit.CharacterStyle = CharacterStyle;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ParagraphPropertiesFirstLineIndentDescriptor = (function () {
        function ParagraphPropertiesFirstLineIndentDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = 0;
        }
        ParagraphPropertiesFirstLineIndentDescriptor.prototype.setProp = function (props, newValue) {
            props.firstLineIndent = newValue;
        };
        ParagraphPropertiesFirstLineIndentDescriptor.prototype.getProp = function (props) {
            return props.firstLineIndent;
        };
        ParagraphPropertiesFirstLineIndentDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseFirstLineIndent;
        };
        ParagraphPropertiesFirstLineIndentDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.ParagraphFirstLineIndentHistoryItem;
        };
        ParagraphPropertiesFirstLineIndentDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONParagraphFormattingProperty.FirstLineIndent;
        };
        return ParagraphPropertiesFirstLineIndentDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesFirstLineIndentDescriptor = ParagraphPropertiesFirstLineIndentDescriptor;
    var ParagraphPropertiesWidowOrphanControlDescriptor = (function () {
        function ParagraphPropertiesWidowOrphanControlDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = true;
        }
        ParagraphPropertiesWidowOrphanControlDescriptor.prototype.setProp = function (props, newValue) {
            props.widowOrphanControl = newValue;
        };
        ParagraphPropertiesWidowOrphanControlDescriptor.prototype.getProp = function (props) {
            return props.widowOrphanControl;
        };
        ParagraphPropertiesWidowOrphanControlDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseWidowOrphanControl;
        };
        ParagraphPropertiesWidowOrphanControlDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.ParagraphWidowOrphanControlHistoryItem;
        };
        ParagraphPropertiesWidowOrphanControlDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONParagraphFormattingProperty.WidowOrphanControl;
        };
        return ParagraphPropertiesWidowOrphanControlDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesWidowOrphanControlDescriptor = ParagraphPropertiesWidowOrphanControlDescriptor;
    var ParagraphPropertiesFirstLineIndentTypeDescriptor = (function () {
        function ParagraphPropertiesFirstLineIndentTypeDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = __aspxRichEdit.ParagraphFirstLineIndent.None;
        }
        ParagraphPropertiesFirstLineIndentTypeDescriptor.prototype.setProp = function (props, newValue) {
            props.firstLineIndentType = newValue;
        };
        ParagraphPropertiesFirstLineIndentTypeDescriptor.prototype.getProp = function (props) {
            return props.firstLineIndentType;
        };
        ParagraphPropertiesFirstLineIndentTypeDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseFirstLineIndent;
        };
        ParagraphPropertiesFirstLineIndentTypeDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.ParagraphFirstLineIndentTypeHistoryItem;
        };
        ParagraphPropertiesFirstLineIndentTypeDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONParagraphFormattingProperty.FirstLineIndentType;
        };
        return ParagraphPropertiesFirstLineIndentTypeDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesFirstLineIndentTypeDescriptor = ParagraphPropertiesFirstLineIndentTypeDescriptor;
    var ParagraphPropertiesAfterAutoSpacingDescriptor = (function () {
        function ParagraphPropertiesAfterAutoSpacingDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = false;
        }
        ParagraphPropertiesAfterAutoSpacingDescriptor.prototype.setProp = function (props, newValue) {
            props.afterAutoSpacing = newValue;
        };
        ParagraphPropertiesAfterAutoSpacingDescriptor.prototype.getProp = function (props) {
            return props.afterAutoSpacing;
        };
        ParagraphPropertiesAfterAutoSpacingDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseAfterAutoSpacing;
        };
        ParagraphPropertiesAfterAutoSpacingDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.ParagraphAfterAutoSpacingHistoryItem;
        };
        ParagraphPropertiesAfterAutoSpacingDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONParagraphFormattingProperty.AfterAutoSpacing;
        };
        return ParagraphPropertiesAfterAutoSpacingDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesAfterAutoSpacingDescriptor = ParagraphPropertiesAfterAutoSpacingDescriptor;
    var ParagraphPropertiesOutlineLevelDescriptor = (function () {
        function ParagraphPropertiesOutlineLevelDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = 0;
        }
        ParagraphPropertiesOutlineLevelDescriptor.prototype.setProp = function (props, newValue) {
            props.outlineLevel = newValue;
        };
        ParagraphPropertiesOutlineLevelDescriptor.prototype.getProp = function (props) {
            return props.outlineLevel;
        };
        ParagraphPropertiesOutlineLevelDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseOutlineLevel;
        };
        ParagraphPropertiesOutlineLevelDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.ParagraphOutlineLevelHistoryItem;
        };
        ParagraphPropertiesOutlineLevelDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONParagraphFormattingProperty.OutlineLevel;
        };
        return ParagraphPropertiesOutlineLevelDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesOutlineLevelDescriptor = ParagraphPropertiesOutlineLevelDescriptor;
    var ParagraphPropertiesBeforeAutoSpacingDescriptor = (function () {
        function ParagraphPropertiesBeforeAutoSpacingDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = false;
        }
        ParagraphPropertiesBeforeAutoSpacingDescriptor.prototype.setProp = function (props, newValue) {
            props.beforeAutoSpacing = newValue;
        };
        ParagraphPropertiesBeforeAutoSpacingDescriptor.prototype.getProp = function (props) {
            return props.beforeAutoSpacing;
        };
        ParagraphPropertiesBeforeAutoSpacingDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseBeforeAutoSpacing;
        };
        ParagraphPropertiesBeforeAutoSpacingDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.ParagraphBeforeAutoSpacingHistoryItem;
        };
        ParagraphPropertiesBeforeAutoSpacingDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONParagraphFormattingProperty.BeforeAutoSpacing;
        };
        return ParagraphPropertiesBeforeAutoSpacingDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesBeforeAutoSpacingDescriptor = ParagraphPropertiesBeforeAutoSpacingDescriptor;
    var ParagraphPropertiesPageBreakBeforeDescriptor = (function () {
        function ParagraphPropertiesPageBreakBeforeDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = false;
        }
        ParagraphPropertiesPageBreakBeforeDescriptor.prototype.setProp = function (props, newValue) {
            props.pageBreakBefore = newValue;
        };
        ParagraphPropertiesPageBreakBeforeDescriptor.prototype.getProp = function (props) {
            return props.pageBreakBefore;
        };
        ParagraphPropertiesPageBreakBeforeDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UsePageBreakBefore;
        };
        ParagraphPropertiesPageBreakBeforeDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.ParagraphPageBreakBeforeHistoryItem;
        };
        ParagraphPropertiesPageBreakBeforeDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONParagraphFormattingProperty.PageBreakBefore;
        };
        return ParagraphPropertiesPageBreakBeforeDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesPageBreakBeforeDescriptor = ParagraphPropertiesPageBreakBeforeDescriptor;
    var ParagraphPropertiesRightIndentDescriptor = (function () {
        function ParagraphPropertiesRightIndentDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = 0;
        }
        ParagraphPropertiesRightIndentDescriptor.prototype.setProp = function (props, newValue) {
            props.rightIndent = newValue;
        };
        ParagraphPropertiesRightIndentDescriptor.prototype.getProp = function (props) {
            return props.rightIndent;
        };
        ParagraphPropertiesRightIndentDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseRightIndent;
        };
        ParagraphPropertiesRightIndentDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.ParagraphRightIndentHistoryItem;
        };
        ParagraphPropertiesRightIndentDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONParagraphFormattingProperty.RightIndent;
        };
        return ParagraphPropertiesRightIndentDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesRightIndentDescriptor = ParagraphPropertiesRightIndentDescriptor;
    var ParagraphPropertiesSuppressHyphenationDescriptor = (function () {
        function ParagraphPropertiesSuppressHyphenationDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = false;
        }
        ParagraphPropertiesSuppressHyphenationDescriptor.prototype.setProp = function (props, newValue) {
            props.suppressHyphenation = newValue;
        };
        ParagraphPropertiesSuppressHyphenationDescriptor.prototype.getProp = function (props) {
            return props.suppressHyphenation;
        };
        ParagraphPropertiesSuppressHyphenationDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseSuppressHyphenation;
        };
        ParagraphPropertiesSuppressHyphenationDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.ParagraphSuppressHyphenationHistoryItem;
        };
        ParagraphPropertiesSuppressHyphenationDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONParagraphFormattingProperty.SuppressHyphenation;
        };
        return ParagraphPropertiesSuppressHyphenationDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesSuppressHyphenationDescriptor = ParagraphPropertiesSuppressHyphenationDescriptor;
    var ParagraphPropertiesLineSpacingDescriptor = (function () {
        function ParagraphPropertiesLineSpacingDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = 0;
        }
        ParagraphPropertiesLineSpacingDescriptor.prototype.setProp = function (props, newValue) {
            props.lineSpacing = newValue;
        };
        ParagraphPropertiesLineSpacingDescriptor.prototype.getProp = function (props) {
            return props.lineSpacing;
        };
        ParagraphPropertiesLineSpacingDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseLineSpacing;
        };
        ParagraphPropertiesLineSpacingDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.ParagraphLineSpacingHistoryItem;
        };
        ParagraphPropertiesLineSpacingDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONParagraphFormattingProperty.LineSpacing;
        };
        return ParagraphPropertiesLineSpacingDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesLineSpacingDescriptor = ParagraphPropertiesLineSpacingDescriptor;
    var ParagraphPropertiesSuppressLineNumbersDescriptor = (function () {
        function ParagraphPropertiesSuppressLineNumbersDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = false;
        }
        ParagraphPropertiesSuppressLineNumbersDescriptor.prototype.setProp = function (props, newValue) {
            props.suppressLineNumbers = newValue;
        };
        ParagraphPropertiesSuppressLineNumbersDescriptor.prototype.getProp = function (props) {
            return props.suppressLineNumbers;
        };
        ParagraphPropertiesSuppressLineNumbersDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseSuppressLineNumbers;
        };
        ParagraphPropertiesSuppressLineNumbersDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.ParagraphSuppressLineNumbersHistoryItem;
        };
        ParagraphPropertiesSuppressLineNumbersDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONParagraphFormattingProperty.SuppressLineNumbers;
        };
        return ParagraphPropertiesSuppressLineNumbersDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesSuppressLineNumbersDescriptor = ParagraphPropertiesSuppressLineNumbersDescriptor;
    var ParagraphPropertiesKeepLinesTogetherDescriptor = (function () {
        function ParagraphPropertiesKeepLinesTogetherDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = false;
        }
        ParagraphPropertiesKeepLinesTogetherDescriptor.prototype.setProp = function (props, newValue) {
            props.keepLinesTogether = newValue;
        };
        ParagraphPropertiesKeepLinesTogetherDescriptor.prototype.getProp = function (props) {
            return props.keepLinesTogether;
        };
        ParagraphPropertiesKeepLinesTogetherDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseKeepLinesTogether;
        };
        ParagraphPropertiesKeepLinesTogetherDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.ParagraphKeepLinesTogetherHistoryItem;
        };
        ParagraphPropertiesKeepLinesTogetherDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONParagraphFormattingProperty.KeepLinesTogether;
        };
        return ParagraphPropertiesKeepLinesTogetherDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesKeepLinesTogetherDescriptor = ParagraphPropertiesKeepLinesTogetherDescriptor;
    var ParagraphPropertiesKeepWithNextDescriptor = (function () {
        function ParagraphPropertiesKeepWithNextDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = false;
        }
        ParagraphPropertiesKeepWithNextDescriptor.prototype.setProp = function (props, newValue) {
            props.keepWithNext = newValue;
        };
        ParagraphPropertiesKeepWithNextDescriptor.prototype.getProp = function (props) {
            return props.keepWithNext;
        };
        ParagraphPropertiesKeepWithNextDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseKeepWithNext;
        };
        ParagraphPropertiesKeepWithNextDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.ParagraphKeepWithNextHistoryItem;
        };
        ParagraphPropertiesKeepWithNextDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONParagraphFormattingProperty.KeepWithNext;
        };
        return ParagraphPropertiesKeepWithNextDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesKeepWithNextDescriptor = ParagraphPropertiesKeepWithNextDescriptor;
    var ParagraphPropertiesShadingInfoIndexDescriptor = (function () {
        function ParagraphPropertiesShadingInfoIndexDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.binaryEqualsCommon;
            this.defaultValue = __aspxRichEdit.ShadingInfo.noColor;
        }
        ParagraphPropertiesShadingInfoIndexDescriptor.prototype.setProp = function (props, newValue) {
            props.shadingInfo = newValue;
        };
        ParagraphPropertiesShadingInfoIndexDescriptor.prototype.getProp = function (props) {
            return props.shadingInfo;
        };
        ParagraphPropertiesShadingInfoIndexDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseShadingInfoIndex;
        };
        ParagraphPropertiesShadingInfoIndexDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.ParagraphShadingInfoIndexHistoryItem;
        };
        ParagraphPropertiesShadingInfoIndexDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONParagraphFormattingProperty.ShadingInfo;
        };
        return ParagraphPropertiesShadingInfoIndexDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesShadingInfoIndexDescriptor = ParagraphPropertiesShadingInfoIndexDescriptor;
    var ParagraphPropertiesLeftIndentDescriptor = (function () {
        function ParagraphPropertiesLeftIndentDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = 0;
        }
        ParagraphPropertiesLeftIndentDescriptor.prototype.setProp = function (props, newValue) {
            props.leftIndent = newValue;
        };
        ParagraphPropertiesLeftIndentDescriptor.prototype.getProp = function (props) {
            return props.leftIndent;
        };
        ParagraphPropertiesLeftIndentDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseLeftIndent;
        };
        ParagraphPropertiesLeftIndentDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.ParagraphLeftIndentHistoryItem;
        };
        ParagraphPropertiesLeftIndentDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONParagraphFormattingProperty.LeftIndent;
        };
        return ParagraphPropertiesLeftIndentDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesLeftIndentDescriptor = ParagraphPropertiesLeftIndentDescriptor;
    var ParagraphPropertiesLineSpacingTypeDescriptor = (function () {
        function ParagraphPropertiesLineSpacingTypeDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = __aspxRichEdit.ParagraphLineSpacingType.Single;
        }
        ParagraphPropertiesLineSpacingTypeDescriptor.prototype.setProp = function (props, newValue) {
            props.lineSpacingType = newValue;
        };
        ParagraphPropertiesLineSpacingTypeDescriptor.prototype.getProp = function (props) {
            return props.lineSpacingType;
        };
        ParagraphPropertiesLineSpacingTypeDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseLineSpacing;
        };
        ParagraphPropertiesLineSpacingTypeDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.ParagraphLineSpacingTypeHistoryItem;
        };
        ParagraphPropertiesLineSpacingTypeDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONParagraphFormattingProperty.LineSpacingType;
        };
        return ParagraphPropertiesLineSpacingTypeDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesLineSpacingTypeDescriptor = ParagraphPropertiesLineSpacingTypeDescriptor;
    var ParagraphPropertiesAlignmentDescriptor = (function () {
        function ParagraphPropertiesAlignmentDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = __aspxRichEdit.ParagraphAlignment.Left;
        }
        ParagraphPropertiesAlignmentDescriptor.prototype.setProp = function (props, newValue) {
            props.alignment = newValue;
        };
        ParagraphPropertiesAlignmentDescriptor.prototype.getProp = function (props) {
            return props.alignment;
        };
        ParagraphPropertiesAlignmentDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseAlignment;
        };
        ParagraphPropertiesAlignmentDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.ParagraphAlignmentHistoryItem;
        };
        ParagraphPropertiesAlignmentDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONParagraphFormattingProperty.Alignment;
        };
        return ParagraphPropertiesAlignmentDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesAlignmentDescriptor = ParagraphPropertiesAlignmentDescriptor;
    var ParagraphPropertiesContextualSpacingDescriptor = (function () {
        function ParagraphPropertiesContextualSpacingDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = false;
        }
        ParagraphPropertiesContextualSpacingDescriptor.prototype.setProp = function (props, newValue) {
            props.contextualSpacing = newValue;
        };
        ParagraphPropertiesContextualSpacingDescriptor.prototype.getProp = function (props) {
            return props.contextualSpacing;
        };
        ParagraphPropertiesContextualSpacingDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseContextualSpacing;
        };
        ParagraphPropertiesContextualSpacingDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.ParagraphContextualSpacingHistoryItem;
        };
        ParagraphPropertiesContextualSpacingDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONParagraphFormattingProperty.ContextualSpacing;
        };
        return ParagraphPropertiesContextualSpacingDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesContextualSpacingDescriptor = ParagraphPropertiesContextualSpacingDescriptor;
    var ParagraphPropertiesSpacingBeforeDescriptor = (function () {
        function ParagraphPropertiesSpacingBeforeDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = 0;
        }
        ParagraphPropertiesSpacingBeforeDescriptor.prototype.setProp = function (props, newValue) {
            props.spacingBefore = newValue;
        };
        ParagraphPropertiesSpacingBeforeDescriptor.prototype.getProp = function (props) {
            return props.spacingBefore;
        };
        ParagraphPropertiesSpacingBeforeDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseSpacingBefore;
        };
        ParagraphPropertiesSpacingBeforeDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.ParagraphSpacingBeforeHistoryItem;
        };
        ParagraphPropertiesSpacingBeforeDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONParagraphFormattingProperty.SpacingBefore;
        };
        return ParagraphPropertiesSpacingBeforeDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesSpacingBeforeDescriptor = ParagraphPropertiesSpacingBeforeDescriptor;
    var ParagraphPropertiesSpacingAfterDescriptor = (function () {
        function ParagraphPropertiesSpacingAfterDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = 0;
        }
        ParagraphPropertiesSpacingAfterDescriptor.prototype.setProp = function (props, newValue) {
            props.spacingAfter = newValue;
        };
        ParagraphPropertiesSpacingAfterDescriptor.prototype.getProp = function (props) {
            return props.spacingAfter;
        };
        ParagraphPropertiesSpacingAfterDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseSpacingAfter;
        };
        ParagraphPropertiesSpacingAfterDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.ParagraphSpacingAfterHistoryItem;
        };
        ParagraphPropertiesSpacingAfterDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONParagraphFormattingProperty.SpacingAfter;
        };
        return ParagraphPropertiesSpacingAfterDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesSpacingAfterDescriptor = ParagraphPropertiesSpacingAfterDescriptor;
    var ParagraphPropertiesRightToLeftDescriptor = (function () {
        function ParagraphPropertiesRightToLeftDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = false;
        }
        ParagraphPropertiesRightToLeftDescriptor.prototype.setProp = function (props, newValue) {
            props.rightToLeft = newValue;
        };
        ParagraphPropertiesRightToLeftDescriptor.prototype.getProp = function (props) {
            return props.rightToLeft;
        };
        ParagraphPropertiesRightToLeftDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseRightToLeft;
        };
        ParagraphPropertiesRightToLeftDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.ParagraphRightToLeftHistoryItem;
        };
        ParagraphPropertiesRightToLeftDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONParagraphFormattingProperty.RightToLeft;
        };
        return ParagraphPropertiesRightToLeftDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesRightToLeftDescriptor = ParagraphPropertiesRightToLeftDescriptor;
    var ParagraphPropertiesLeftBorderDescriptor = (function () {
        function ParagraphPropertiesLeftBorderDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.binaryEqualsCommon;
            this.defaultValue = new __aspxRichEdit.BorderInfo();
        }
        ParagraphPropertiesLeftBorderDescriptor.prototype.setProp = function (props, newValue) {
            props.leftBorder = newValue;
        };
        ParagraphPropertiesLeftBorderDescriptor.prototype.getProp = function (props) {
            return props.leftBorder;
        };
        ParagraphPropertiesLeftBorderDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseLeftBorder;
        };
        ParagraphPropertiesLeftBorderDescriptor.prototype.getHistoryItemConstructor = function () {
            throw Error(__aspxRichEdit.Errors.NotImplemented);
        };
        ParagraphPropertiesLeftBorderDescriptor.prototype.getJSONProperty = function () {
            throw Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return ParagraphPropertiesLeftBorderDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesLeftBorderDescriptor = ParagraphPropertiesLeftBorderDescriptor;
    var ParagraphPropertiesRightBorderDescriptor = (function () {
        function ParagraphPropertiesRightBorderDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.binaryEqualsCommon;
            this.defaultValue = new __aspxRichEdit.BorderInfo();
        }
        ParagraphPropertiesRightBorderDescriptor.prototype.setProp = function (props, newValue) {
            props.rightBorder = newValue;
        };
        ParagraphPropertiesRightBorderDescriptor.prototype.getProp = function (props) {
            return props.rightBorder;
        };
        ParagraphPropertiesRightBorderDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseRightBorder;
        };
        ParagraphPropertiesRightBorderDescriptor.prototype.getHistoryItemConstructor = function () {
            throw Error(__aspxRichEdit.Errors.NotImplemented);
        };
        ParagraphPropertiesRightBorderDescriptor.prototype.getJSONProperty = function () {
            throw Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return ParagraphPropertiesRightBorderDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesRightBorderDescriptor = ParagraphPropertiesRightBorderDescriptor;
    var ParagraphPropertiesTopBorderDescriptor = (function () {
        function ParagraphPropertiesTopBorderDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.binaryEqualsCommon;
            this.defaultValue = new __aspxRichEdit.BorderInfo();
        }
        ParagraphPropertiesTopBorderDescriptor.prototype.setProp = function (props, newValue) {
            props.topBorder = newValue;
        };
        ParagraphPropertiesTopBorderDescriptor.prototype.getProp = function (props) {
            return props.topBorder;
        };
        ParagraphPropertiesTopBorderDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseTopBorder;
        };
        ParagraphPropertiesTopBorderDescriptor.prototype.getHistoryItemConstructor = function () {
            throw Error(__aspxRichEdit.Errors.NotImplemented);
        };
        ParagraphPropertiesTopBorderDescriptor.prototype.getJSONProperty = function () {
            throw Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return ParagraphPropertiesTopBorderDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesTopBorderDescriptor = ParagraphPropertiesTopBorderDescriptor;
    var ParagraphPropertiesBottomBorderDescriptor = (function () {
        function ParagraphPropertiesBottomBorderDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.binaryEqualsCommon;
            this.defaultValue = new __aspxRichEdit.BorderInfo();
        }
        ParagraphPropertiesBottomBorderDescriptor.prototype.setProp = function (props, newValue) {
            props.bottomBorder = newValue;
        };
        ParagraphPropertiesBottomBorderDescriptor.prototype.getProp = function (props) {
            return props.bottomBorder;
        };
        ParagraphPropertiesBottomBorderDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseBottomBorder;
        };
        ParagraphPropertiesBottomBorderDescriptor.prototype.getHistoryItemConstructor = function () {
            throw Error(__aspxRichEdit.Errors.NotImplemented);
        };
        ParagraphPropertiesBottomBorderDescriptor.prototype.getJSONProperty = function () {
            throw Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return ParagraphPropertiesBottomBorderDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesBottomBorderDescriptor = ParagraphPropertiesBottomBorderDescriptor;
    var ParagraphPropertiesBetweenBorderDescriptor = (function () {
        function ParagraphPropertiesBetweenBorderDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.binaryEqualsCommon;
            this.defaultValue = new __aspxRichEdit.BorderInfo();
        }
        ParagraphPropertiesBetweenBorderDescriptor.prototype.setProp = function (props, newValue) {
            props.betweenBorder = newValue;
        };
        ParagraphPropertiesBetweenBorderDescriptor.prototype.getProp = function (props) {
            return props.betweenBorder;
        };
        ParagraphPropertiesBetweenBorderDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseBetweenBorder;
        };
        ParagraphPropertiesBetweenBorderDescriptor.prototype.getHistoryItemConstructor = function () {
            throw Error(__aspxRichEdit.Errors.NotImplemented);
        };
        ParagraphPropertiesBetweenBorderDescriptor.prototype.getJSONProperty = function () {
            throw Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return ParagraphPropertiesBetweenBorderDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesBetweenBorderDescriptor = ParagraphPropertiesBetweenBorderDescriptor;
    var ParagraphPropertiesDivIdDescriptor = (function () {
        function ParagraphPropertiesDivIdDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = 0;
        }
        ParagraphPropertiesDivIdDescriptor.prototype.setProp = function (props, newValue) {
            props.divId = newValue;
        };
        ParagraphPropertiesDivIdDescriptor.prototype.getProp = function (props) {
            return props.divId;
        };
        ParagraphPropertiesDivIdDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseDivId;
        };
        ParagraphPropertiesDivIdDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.ParagraphDivIdHistoryItem;
        };
        ParagraphPropertiesDivIdDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONParagraphFormattingProperty.DivId;
        };
        return ParagraphPropertiesDivIdDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertiesDivIdDescriptor = ParagraphPropertiesDivIdDescriptor;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ParagraphPropertiesMask;
    (function (ParagraphPropertiesMask) {
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseNone"] = 0] = "UseNone";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseAlignment"] = 1] = "UseAlignment";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseLeftIndent"] = 2] = "UseLeftIndent";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseRightIndent"] = 4] = "UseRightIndent";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseSpacingBefore"] = 8] = "UseSpacingBefore";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseSpacingAfter"] = 16] = "UseSpacingAfter";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseLineSpacing"] = 32] = "UseLineSpacing";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseFirstLineIndent"] = 64] = "UseFirstLineIndent";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseSuppressHyphenation"] = 128] = "UseSuppressHyphenation";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseSuppressLineNumbers"] = 256] = "UseSuppressLineNumbers";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseContextualSpacing"] = 512] = "UseContextualSpacing";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UsePageBreakBefore"] = 1024] = "UsePageBreakBefore";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseBeforeAutoSpacing"] = 2048] = "UseBeforeAutoSpacing";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseAfterAutoSpacing"] = 4096] = "UseAfterAutoSpacing";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseKeepWithNext"] = 8192] = "UseKeepWithNext";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseKeepLinesTogether"] = 16384] = "UseKeepLinesTogether";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseWidowOrphanControl"] = 32768] = "UseWidowOrphanControl";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseOutlineLevel"] = 65536] = "UseOutlineLevel";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseShadingInfoIndex"] = 131072] = "UseShadingInfoIndex";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseLeftBorder"] = 262144] = "UseLeftBorder";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseRightBorder"] = 524288] = "UseRightBorder";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseTopBorder"] = 1048576] = "UseTopBorder";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseBottomBorder"] = 2097152] = "UseBottomBorder";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseDivId"] = 4194304] = "UseDivId";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseBorders"] = 20709376] = "UseBorders";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseRightToLeft"] = 8388608] = "UseRightToLeft";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseBetweenBorder"] = 16777216] = "UseBetweenBorder";
        ParagraphPropertiesMask[ParagraphPropertiesMask["UseAll"] = 2147483647] = "UseAll";
    })(ParagraphPropertiesMask = __aspxRichEdit.ParagraphPropertiesMask || (__aspxRichEdit.ParagraphPropertiesMask = {}));
    var ParagraphAlignment;
    (function (ParagraphAlignment) {
        ParagraphAlignment[ParagraphAlignment["Left"] = 0] = "Left";
        ParagraphAlignment[ParagraphAlignment["Right"] = 1] = "Right";
        ParagraphAlignment[ParagraphAlignment["Center"] = 2] = "Center";
        ParagraphAlignment[ParagraphAlignment["Justify"] = 3] = "Justify";
        ParagraphAlignment[ParagraphAlignment["Unspecified"] = 4] = "Unspecified";
    })(ParagraphAlignment = __aspxRichEdit.ParagraphAlignment || (__aspxRichEdit.ParagraphAlignment = {}));
    var ParagraphLineSpacingType;
    (function (ParagraphLineSpacingType) {
        ParagraphLineSpacingType[ParagraphLineSpacingType["Single"] = 0] = "Single";
        ParagraphLineSpacingType[ParagraphLineSpacingType["Sesquialteral"] = 1] = "Sesquialteral";
        ParagraphLineSpacingType[ParagraphLineSpacingType["Double"] = 2] = "Double";
        ParagraphLineSpacingType[ParagraphLineSpacingType["Multiple"] = 3] = "Multiple";
        ParagraphLineSpacingType[ParagraphLineSpacingType["Exactly"] = 4] = "Exactly";
        ParagraphLineSpacingType[ParagraphLineSpacingType["AtLeast"] = 5] = "AtLeast";
    })(ParagraphLineSpacingType = __aspxRichEdit.ParagraphLineSpacingType || (__aspxRichEdit.ParagraphLineSpacingType = {}));
    var ParagraphFirstLineIndent;
    (function (ParagraphFirstLineIndent) {
        ParagraphFirstLineIndent[ParagraphFirstLineIndent["None"] = 0] = "None";
        ParagraphFirstLineIndent[ParagraphFirstLineIndent["Indented"] = 1] = "Indented";
        ParagraphFirstLineIndent[ParagraphFirstLineIndent["Hanging"] = 2] = "Hanging";
    })(ParagraphFirstLineIndent = __aspxRichEdit.ParagraphFirstLineIndent || (__aspxRichEdit.ParagraphFirstLineIndent = {}));
    var ParagraphPropertyDescriptor = (function () {
        function ParagraphPropertyDescriptor() {
        }
        ParagraphPropertyDescriptor.firstLineIndent = new __aspxRichEdit.ParagraphPropertiesFirstLineIndentDescriptor();
        ParagraphPropertyDescriptor.widowOrphanControl = new __aspxRichEdit.ParagraphPropertiesWidowOrphanControlDescriptor();
        ParagraphPropertyDescriptor.firstLineIndentType = new __aspxRichEdit.ParagraphPropertiesFirstLineIndentTypeDescriptor();
        ParagraphPropertyDescriptor.afterAutoSpacing = new __aspxRichEdit.ParagraphPropertiesAfterAutoSpacingDescriptor();
        ParagraphPropertyDescriptor.outlineLevel = new __aspxRichEdit.ParagraphPropertiesOutlineLevelDescriptor();
        ParagraphPropertyDescriptor.beforeAutoSpacing = new __aspxRichEdit.ParagraphPropertiesBeforeAutoSpacingDescriptor();
        ParagraphPropertyDescriptor.pageBreakBefore = new __aspxRichEdit.ParagraphPropertiesPageBreakBeforeDescriptor();
        ParagraphPropertyDescriptor.rightIndent = new __aspxRichEdit.ParagraphPropertiesRightIndentDescriptor();
        ParagraphPropertyDescriptor.suppressHyphenation = new __aspxRichEdit.ParagraphPropertiesSuppressHyphenationDescriptor();
        ParagraphPropertyDescriptor.lineSpacing = new __aspxRichEdit.ParagraphPropertiesLineSpacingDescriptor();
        ParagraphPropertyDescriptor.suppressLineNumbers = new __aspxRichEdit.ParagraphPropertiesSuppressLineNumbersDescriptor();
        ParagraphPropertyDescriptor.keepLinesTogether = new __aspxRichEdit.ParagraphPropertiesKeepLinesTogetherDescriptor();
        ParagraphPropertyDescriptor.keepWithNext = new __aspxRichEdit.ParagraphPropertiesKeepWithNextDescriptor();
        ParagraphPropertyDescriptor.shadingInfo = new __aspxRichEdit.ParagraphPropertiesShadingInfoIndexDescriptor();
        ParagraphPropertyDescriptor.leftIndent = new __aspxRichEdit.ParagraphPropertiesLeftIndentDescriptor();
        ParagraphPropertyDescriptor.lineSpacingType = new __aspxRichEdit.ParagraphPropertiesLineSpacingTypeDescriptor();
        ParagraphPropertyDescriptor.alignment = new __aspxRichEdit.ParagraphPropertiesAlignmentDescriptor();
        ParagraphPropertyDescriptor.contextualSpacing = new __aspxRichEdit.ParagraphPropertiesContextualSpacingDescriptor();
        ParagraphPropertyDescriptor.spacingBefore = new __aspxRichEdit.ParagraphPropertiesSpacingBeforeDescriptor();
        ParagraphPropertyDescriptor.spacingAfter = new __aspxRichEdit.ParagraphPropertiesSpacingAfterDescriptor();
        ParagraphPropertyDescriptor.rightToLeft = new __aspxRichEdit.ParagraphPropertiesRightToLeftDescriptor();
        ParagraphPropertyDescriptor.leftBorder = new __aspxRichEdit.ParagraphPropertiesLeftBorderDescriptor();
        ParagraphPropertyDescriptor.rightBorder = new __aspxRichEdit.ParagraphPropertiesRightBorderDescriptor();
        ParagraphPropertyDescriptor.topBorder = new __aspxRichEdit.ParagraphPropertiesTopBorderDescriptor();
        ParagraphPropertyDescriptor.bottomBorder = new __aspxRichEdit.ParagraphPropertiesBottomBorderDescriptor();
        ParagraphPropertyDescriptor.betweenBorder = new __aspxRichEdit.ParagraphPropertiesBetweenBorderDescriptor();
        ParagraphPropertyDescriptor.divId = new __aspxRichEdit.ParagraphPropertiesDivIdDescriptor();
        ParagraphPropertyDescriptor.ALL_FIELDS = [
            ParagraphPropertyDescriptor.firstLineIndent,
            ParagraphPropertyDescriptor.widowOrphanControl,
            ParagraphPropertyDescriptor.firstLineIndentType,
            ParagraphPropertyDescriptor.afterAutoSpacing,
            ParagraphPropertyDescriptor.outlineLevel,
            ParagraphPropertyDescriptor.beforeAutoSpacing,
            ParagraphPropertyDescriptor.pageBreakBefore,
            ParagraphPropertyDescriptor.rightIndent,
            ParagraphPropertyDescriptor.suppressHyphenation,
            ParagraphPropertyDescriptor.lineSpacing,
            ParagraphPropertyDescriptor.suppressLineNumbers,
            ParagraphPropertyDescriptor.keepLinesTogether,
            ParagraphPropertyDescriptor.keepWithNext,
            ParagraphPropertyDescriptor.shadingInfo,
            ParagraphPropertyDescriptor.leftIndent,
            ParagraphPropertyDescriptor.lineSpacingType,
            ParagraphPropertyDescriptor.alignment,
            ParagraphPropertyDescriptor.contextualSpacing,
            ParagraphPropertyDescriptor.spacingBefore,
            ParagraphPropertyDescriptor.spacingAfter,
            ParagraphPropertyDescriptor.rightToLeft,
            ParagraphPropertyDescriptor.leftBorder,
            ParagraphPropertyDescriptor.rightBorder,
            ParagraphPropertyDescriptor.topBorder,
            ParagraphPropertyDescriptor.bottomBorder,
            ParagraphPropertyDescriptor.betweenBorder,
            ParagraphPropertyDescriptor.divId
        ];
        return ParagraphPropertyDescriptor;
    }());
    __aspxRichEdit.ParagraphPropertyDescriptor = ParagraphPropertyDescriptor;
    var ParagraphProperties = (function () {
        function ParagraphProperties() {
            this.firstLineIndent = 0;
            this.widowOrphanControl = true;
            this.firstLineIndentType = ParagraphFirstLineIndent.None;
            this.afterAutoSpacing = false;
            this.outlineLevel = 0;
            this.beforeAutoSpacing = false;
            this.pageBreakBefore = false;
            this.rightIndent = 0;
            this.suppressHyphenation = false;
            this.lineSpacing = 0;
            this.suppressLineNumbers = false;
            this.keepLinesTogether = false;
            this.keepWithNext = false;
            this.shadingInfo = __aspxRichEdit.ShadingInfo.nullColor;
            this.rightToLeft = false;
            this.leftIndent = 0;
            this.lineSpacingType = ParagraphLineSpacingType.Single;
            this.alignment = ParagraphAlignment.Left;
            this.contextualSpacing = false;
            this.spacingBefore = 0;
            this.spacingAfter = 0;
            this.leftBorder = new __aspxRichEdit.BorderInfo();
            this.rightBorder = new __aspxRichEdit.BorderInfo();
            this.topBorder = new __aspxRichEdit.BorderInfo();
            this.bottomBorder = new __aspxRichEdit.BorderInfo();
            this.betweenBorder = new __aspxRichEdit.BorderInfo();
            this.divId = 0;
        }
        ParagraphProperties.prototype.calculateHash = function () {
            return __aspxRichEdit.MathUtils.somePrimes[0] * this.leftIndent ^
                __aspxRichEdit.MathUtils.somePrimes[1] * this.rightIndent ^
                __aspxRichEdit.MathUtils.somePrimes[2] * this.firstLineIndent ^
                __aspxRichEdit.MathUtils.somePrimes[3] * this.spacingBefore ^
                __aspxRichEdit.MathUtils.somePrimes[4] * this.spacingAfter;
        };
        ParagraphProperties.prototype.getHashCode = function () {
            return this.hash === undefined ? this.hash = this.calculateHash() : this.hash;
        };
        ParagraphProperties.prototype.copyFrom = function (obj) {
            this.alignment = obj.alignment;
            this.leftIndent = obj.leftIndent;
            this.rightIndent = obj.rightIndent;
            this.spacingBefore = obj.spacingBefore;
            this.spacingAfter = obj.spacingAfter;
            this.lineSpacing = obj.lineSpacing;
            this.firstLineIndent = obj.firstLineIndent;
            this.suppressHyphenation = obj.suppressHyphenation;
            this.suppressLineNumbers = obj.suppressLineNumbers;
            this.contextualSpacing = obj.contextualSpacing;
            this.pageBreakBefore = obj.pageBreakBefore;
            this.beforeAutoSpacing = obj.beforeAutoSpacing;
            this.afterAutoSpacing = obj.afterAutoSpacing;
            this.keepWithNext = obj.keepWithNext;
            this.keepLinesTogether = obj.keepLinesTogether;
            this.widowOrphanControl = obj.widowOrphanControl;
            this.outlineLevel = obj.outlineLevel;
            this.firstLineIndentType = obj.firstLineIndentType;
            this.lineSpacingType = obj.lineSpacingType;
            this.rightToLeft = obj.rightToLeft;
            this.shadingInfo = obj.shadingInfo ? obj.shadingInfo.clone() : obj.shadingInfo;
            if (obj.leftBorder)
                this.leftBorder.copyFrom(obj.leftBorder);
            else
                this.leftBorder = obj.leftBorder;
            if (obj.rightBorder)
                this.rightBorder.copyFrom(obj.rightBorder);
            else
                this.rightBorder = obj.rightBorder;
            if (obj.topBorder)
                this.topBorder.copyFrom(obj.topBorder);
            else
                this.topBorder = obj.topBorder;
            if (obj.bottomBorder)
                this.bottomBorder.copyFrom(obj.bottomBorder);
            else
                this.bottomBorder = obj.bottomBorder;
            if (obj.betweenBorder)
                this.betweenBorder.copyFrom(obj.betweenBorder);
            else
                this.betweenBorder = obj.betweenBorder;
            this.divId = obj.divId;
        };
        ParagraphProperties.prototype.clone = function () {
            var result = new ParagraphProperties();
            result.copyFrom(this);
            return result;
        };
        ParagraphProperties.prototype.equals = function (obj) {
            if (!obj)
                return false;
            return this.firstLineIndent == obj.firstLineIndent &&
                this.firstLineIndentType == obj.firstLineIndentType &&
                this.afterAutoSpacing == obj.afterAutoSpacing &&
                this.outlineLevel == obj.outlineLevel &&
                this.beforeAutoSpacing == obj.beforeAutoSpacing &&
                this.pageBreakBefore == obj.pageBreakBefore &&
                this.rightIndent == obj.rightIndent &&
                this.suppressHyphenation == obj.suppressHyphenation &&
                this.lineSpacing == obj.lineSpacing &&
                this.suppressLineNumbers == obj.suppressLineNumbers &&
                this.keepLinesTogether == obj.keepLinesTogether &&
                this.keepWithNext == obj.keepWithNext &&
                this.shadingInfo.equals(obj.shadingInfo) &&
                this.leftIndent == obj.leftIndent &&
                this.lineSpacingType == obj.lineSpacingType &&
                this.alignment == obj.alignment &&
                this.contextualSpacing == obj.contextualSpacing &&
                this.rightToLeft == obj.rightToLeft &&
                this.spacingBefore == obj.spacingBefore &&
                this.spacingAfter == obj.spacingAfter &&
                this.leftBorder.equals(obj.leftBorder) &&
                this.rightBorder.equals(obj.rightBorder) &&
                this.topBorder.equals(obj.topBorder) &&
                this.bottomBorder.equals(obj.bottomBorder) &&
                this.betweenBorder.equals(obj.betweenBorder) &&
                this.divId == obj.divId;
        };
        ParagraphProperties.prototype.getLeftIndentForFirstRow = function () {
            var indent = this.leftIndent;
            switch (this.firstLineIndentType) {
                case ParagraphFirstLineIndent.None:
                case ParagraphFirstLineIndent.Indented:
                    indent += this.firstLineIndent;
                    break;
                case ParagraphFirstLineIndent.Hanging:
                    indent -= this.firstLineIndent;
            }
            return indent;
        };
        ParagraphProperties.prototype.getLeftIndentForOtherRow = function () {
            return this.leftIndent;
        };
        ParagraphProperties.prototype.getLeftIndentForParagraphFrame = function () {
            var indent = this.leftIndent;
            if (this.firstLineIndentType == ParagraphFirstLineIndent.Hanging)
                indent -= this.firstLineIndent;
            return __aspxRichEdit.UnitConverter.twipsToPixels(indent);
        };
        return ParagraphProperties;
    }());
    __aspxRichEdit.ParagraphProperties = ParagraphProperties;
    var MaskedParagraphProperties = (function (_super) {
        __extends(MaskedParagraphProperties, _super);
        function MaskedParagraphProperties() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.useValue = ParagraphPropertiesMask.UseNone;
            return _this;
        }
        MaskedParagraphProperties.prototype.getUseValue = function (value) {
            return (this.useValue & value) != 0;
        };
        MaskedParagraphProperties.prototype.calculateHash = function () {
            return _super.prototype.calculateHash.call(this) +
                __aspxRichEdit.MathUtils.somePrimes[15] * this.useValue;
        };
        MaskedParagraphProperties.prototype.setUseValue = function (mask, value) {
            if (value)
                this.useValue |= mask;
            else
                this.useValue &= ~mask;
        };
        MaskedParagraphProperties.prototype.copyFrom = function (obj) {
            ParagraphProperties.prototype.copyFrom.call(this, obj);
            this.useValue = obj.useValue;
        };
        MaskedParagraphProperties.prototype.equals = function (obj) {
            return ParagraphProperties.prototype.equals.call(this, obj)
                && this.useValue == obj.useValue;
        };
        MaskedParagraphProperties.prototype.clone = function () {
            var result = new MaskedParagraphProperties();
            result.copyFrom(this);
            return result;
        };
        MaskedParagraphProperties.createDefault = function (model) {
            var prop = model.defaultParagraphProperties.clone();
            prop.useValue = ParagraphPropertiesMask.UseNone;
            return prop;
        };
        MaskedParagraphProperties.prototype.setValue = function (desc, value) {
            desc.setProp(this, value);
            this.setUseValue(desc.maskValue(), true);
        };
        return MaskedParagraphProperties;
    }(ParagraphProperties));
    __aspxRichEdit.MaskedParagraphProperties = MaskedParagraphProperties;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SectionPropertiesMarginLeftDescriptor = (function () {
        function SectionPropertiesMarginLeftDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = 1440;
        }
        SectionPropertiesMarginLeftDescriptor.prototype.setProp = function (props, newValue) {
            props.marginLeft = newValue;
        };
        SectionPropertiesMarginLeftDescriptor.prototype.getProp = function (props) {
            return props.marginLeft;
        };
        SectionPropertiesMarginLeftDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.SectionMarginLeftHistoryItem;
        };
        SectionPropertiesMarginLeftDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONSectionProperty.MarginLeft;
        };
        return SectionPropertiesMarginLeftDescriptor;
    }());
    __aspxRichEdit.SectionPropertiesMarginLeftDescriptor = SectionPropertiesMarginLeftDescriptor;
    var SectionPropertiesMarginTopDescriptor = (function () {
        function SectionPropertiesMarginTopDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = 1440;
        }
        SectionPropertiesMarginTopDescriptor.prototype.setProp = function (props, newValue) {
            props.marginTop = newValue;
        };
        SectionPropertiesMarginTopDescriptor.prototype.getProp = function (props) {
            return props.marginTop;
        };
        SectionPropertiesMarginTopDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.SectionMarginTopHistoryItem;
        };
        SectionPropertiesMarginTopDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONSectionProperty.MarginTop;
        };
        return SectionPropertiesMarginTopDescriptor;
    }());
    __aspxRichEdit.SectionPropertiesMarginTopDescriptor = SectionPropertiesMarginTopDescriptor;
    var SectionPropertiesMarginRightDescriptor = (function () {
        function SectionPropertiesMarginRightDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = 1440;
        }
        SectionPropertiesMarginRightDescriptor.prototype.setProp = function (props, newValue) {
            props.marginRight = newValue;
        };
        SectionPropertiesMarginRightDescriptor.prototype.getProp = function (props) {
            return props.marginRight;
        };
        SectionPropertiesMarginRightDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.SectionMarginRightHistoryItem;
        };
        SectionPropertiesMarginRightDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONSectionProperty.MarginRight;
        };
        return SectionPropertiesMarginRightDescriptor;
    }());
    __aspxRichEdit.SectionPropertiesMarginRightDescriptor = SectionPropertiesMarginRightDescriptor;
    var SectionPropertiesMarginBottomDescriptor = (function () {
        function SectionPropertiesMarginBottomDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = 1440;
        }
        SectionPropertiesMarginBottomDescriptor.prototype.setProp = function (props, newValue) {
            props.marginBottom = newValue;
        };
        SectionPropertiesMarginBottomDescriptor.prototype.getProp = function (props) {
            return props.marginBottom;
        };
        SectionPropertiesMarginBottomDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.SectionMarginBottomHistoryItem;
        };
        SectionPropertiesMarginBottomDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONSectionProperty.MarginBottom;
        };
        return SectionPropertiesMarginBottomDescriptor;
    }());
    __aspxRichEdit.SectionPropertiesMarginBottomDescriptor = SectionPropertiesMarginBottomDescriptor;
    var SectionPropertiesFooterOffsetDescriptor = (function () {
        function SectionPropertiesFooterOffsetDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = 720;
        }
        SectionPropertiesFooterOffsetDescriptor.prototype.setProp = function (props, newValue) {
            props.footerOffset = newValue;
        };
        SectionPropertiesFooterOffsetDescriptor.prototype.getProp = function (props) {
            return props.footerOffset;
        };
        SectionPropertiesFooterOffsetDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.SectionFooterOffsetHistoryItem;
        };
        SectionPropertiesFooterOffsetDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONSectionProperty.FooterOffset;
        };
        return SectionPropertiesFooterOffsetDescriptor;
    }());
    __aspxRichEdit.SectionPropertiesFooterOffsetDescriptor = SectionPropertiesFooterOffsetDescriptor;
    var SectionPropertiesHeaderOffsetDescriptor = (function () {
        function SectionPropertiesHeaderOffsetDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = 720;
        }
        SectionPropertiesHeaderOffsetDescriptor.prototype.setProp = function (props, newValue) {
            props.headerOffset = newValue;
        };
        SectionPropertiesHeaderOffsetDescriptor.prototype.getProp = function (props) {
            return props.headerOffset;
        };
        SectionPropertiesHeaderOffsetDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.SectionHeaderOffsetHistoryItem;
        };
        SectionPropertiesHeaderOffsetDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONSectionProperty.HeaderOffset;
        };
        return SectionPropertiesHeaderOffsetDescriptor;
    }());
    __aspxRichEdit.SectionPropertiesHeaderOffsetDescriptor = SectionPropertiesHeaderOffsetDescriptor;
    var SectionPropertiesColumnCountDescriptor = (function () {
        function SectionPropertiesColumnCountDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = 1;
        }
        SectionPropertiesColumnCountDescriptor.prototype.setProp = function (props, newValue) {
            props.columnCount = newValue;
        };
        SectionPropertiesColumnCountDescriptor.prototype.getProp = function (props) {
            return props.columnCount;
        };
        SectionPropertiesColumnCountDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.SectionColumnCountHistoryItem;
        };
        SectionPropertiesColumnCountDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONSectionProperty.ColumnCount;
        };
        return SectionPropertiesColumnCountDescriptor;
    }());
    __aspxRichEdit.SectionPropertiesColumnCountDescriptor = SectionPropertiesColumnCountDescriptor;
    var SectionPropertiesSpaceDescriptor = (function () {
        function SectionPropertiesSpaceDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = 720;
        }
        SectionPropertiesSpaceDescriptor.prototype.setProp = function (props, newValue) {
            props.space = newValue;
        };
        SectionPropertiesSpaceDescriptor.prototype.getProp = function (props) {
            return props.space;
        };
        SectionPropertiesSpaceDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.SectionSpaceHistoryItem;
        };
        SectionPropertiesSpaceDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONSectionProperty.Space;
        };
        return SectionPropertiesSpaceDescriptor;
    }());
    __aspxRichEdit.SectionPropertiesSpaceDescriptor = SectionPropertiesSpaceDescriptor;
    var SectionPropertiesEqualWidthColumnsDescriptor = (function () {
        function SectionPropertiesEqualWidthColumnsDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = true;
        }
        SectionPropertiesEqualWidthColumnsDescriptor.prototype.setProp = function (props, newValue) {
            props.equalWidthColumns = newValue;
        };
        SectionPropertiesEqualWidthColumnsDescriptor.prototype.getProp = function (props) {
            return props.equalWidthColumns;
        };
        SectionPropertiesEqualWidthColumnsDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.SectionEqualWidthColumnsHistoryItem;
        };
        SectionPropertiesEqualWidthColumnsDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONSectionProperty.EqualWidthColumns;
        };
        return SectionPropertiesEqualWidthColumnsDescriptor;
    }());
    __aspxRichEdit.SectionPropertiesEqualWidthColumnsDescriptor = SectionPropertiesEqualWidthColumnsDescriptor;
    var SectionPropertiesColumnsInfoDescriptor = (function () {
        function SectionPropertiesColumnsInfoDescriptor() {
            this.binaryEquals = __aspxRichEdit.CompareUtils.equalsColumnsInfoBinary;
            this.defaultValue = [];
        }
        SectionPropertiesColumnsInfoDescriptor.prototype.setProp = function (props, newValue) {
            props.columnsInfo = newValue;
        };
        SectionPropertiesColumnsInfoDescriptor.prototype.getProp = function (props) {
            return props.columnsInfo;
        };
        SectionPropertiesColumnsInfoDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.SectionColumnsInfoHistoryItem;
        };
        SectionPropertiesColumnsInfoDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONSectionProperty.ColumnsInfo;
        };
        return SectionPropertiesColumnsInfoDescriptor;
    }());
    __aspxRichEdit.SectionPropertiesColumnsInfoDescriptor = SectionPropertiesColumnsInfoDescriptor;
    var SectionPropertiesPageWidthDescriptor = (function () {
        function SectionPropertiesPageWidthDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = 11906;
        }
        SectionPropertiesPageWidthDescriptor.prototype.setProp = function (props, newValue) {
            props.pageWidth = newValue;
        };
        SectionPropertiesPageWidthDescriptor.prototype.getProp = function (props) {
            return props.pageWidth;
        };
        SectionPropertiesPageWidthDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.SectionPageWidthHistoryItem;
        };
        SectionPropertiesPageWidthDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONSectionProperty.PageWidth;
        };
        return SectionPropertiesPageWidthDescriptor;
    }());
    __aspxRichEdit.SectionPropertiesPageWidthDescriptor = SectionPropertiesPageWidthDescriptor;
    var SectionPropertiesPageHeightDescriptor = (function () {
        function SectionPropertiesPageHeightDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = 16838;
        }
        SectionPropertiesPageHeightDescriptor.prototype.setProp = function (props, newValue) {
            props.pageHeight = newValue;
        };
        SectionPropertiesPageHeightDescriptor.prototype.getProp = function (props) {
            return props.pageHeight;
        };
        SectionPropertiesPageHeightDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.SectionPageHeightHistoryItem;
        };
        SectionPropertiesPageHeightDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONSectionProperty.PageHeight;
        };
        return SectionPropertiesPageHeightDescriptor;
    }());
    __aspxRichEdit.SectionPropertiesPageHeightDescriptor = SectionPropertiesPageHeightDescriptor;
    var SectionPropertiesStartTypeDescriptor = (function () {
        function SectionPropertiesStartTypeDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = __aspxRichEdit.SectionStartType.NextPage;
        }
        SectionPropertiesStartTypeDescriptor.prototype.setProp = function (props, newValue) {
            props.startType = newValue;
        };
        SectionPropertiesStartTypeDescriptor.prototype.getProp = function (props) {
            return props.startType;
        };
        SectionPropertiesStartTypeDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.SectionStartTypeHistoryItem;
        };
        SectionPropertiesStartTypeDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONSectionProperty.StartType;
        };
        return SectionPropertiesStartTypeDescriptor;
    }());
    __aspxRichEdit.SectionPropertiesStartTypeDescriptor = SectionPropertiesStartTypeDescriptor;
    var SectionPropertiesLandscapeDescriptor = (function () {
        function SectionPropertiesLandscapeDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = false;
        }
        SectionPropertiesLandscapeDescriptor.prototype.setProp = function (props, newValue) {
            props.landscape = newValue;
        };
        SectionPropertiesLandscapeDescriptor.prototype.getProp = function (props) {
            return props.landscape;
        };
        SectionPropertiesLandscapeDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.SectionLandscapeHistoryItem;
        };
        SectionPropertiesLandscapeDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONSectionProperty.Landscape;
        };
        return SectionPropertiesLandscapeDescriptor;
    }());
    __aspxRichEdit.SectionPropertiesLandscapeDescriptor = SectionPropertiesLandscapeDescriptor;
    var SectionPropertiesDifferentFirstPageDescriptor = (function () {
        function SectionPropertiesDifferentFirstPageDescriptor() {
            this.binaryEquals = __aspxRichEdit.CommonCompareFunctions.exactlyEqual;
            this.defaultValue = false;
        }
        SectionPropertiesDifferentFirstPageDescriptor.prototype.setProp = function (props, newValue) {
            props.differentFirstPage = newValue;
        };
        SectionPropertiesDifferentFirstPageDescriptor.prototype.getProp = function (props) {
            return props.differentFirstPage;
        };
        SectionPropertiesDifferentFirstPageDescriptor.prototype.getHistoryItemConstructor = function () {
            return __aspxRichEdit.SectionDifferentFirstPageHistoryItem;
        };
        SectionPropertiesDifferentFirstPageDescriptor.prototype.getJSONProperty = function () {
            return __aspxRichEdit.JSONSectionProperty.DifferentFirstPage;
        };
        return SectionPropertiesDifferentFirstPageDescriptor;
    }());
    __aspxRichEdit.SectionPropertiesDifferentFirstPageDescriptor = SectionPropertiesDifferentFirstPageDescriptor;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SectionStartType;
    (function (SectionStartType) {
        SectionStartType[SectionStartType["NextPage"] = 0] = "NextPage";
        SectionStartType[SectionStartType["OddPage"] = 1] = "OddPage";
        SectionStartType[SectionStartType["EvenPage"] = 2] = "EvenPage";
        SectionStartType[SectionStartType["Continuous"] = 3] = "Continuous";
        SectionStartType[SectionStartType["Column"] = 4] = "Column";
    })(SectionStartType = __aspxRichEdit.SectionStartType || (__aspxRichEdit.SectionStartType = {}));
    var HeaderFooterType;
    (function (HeaderFooterType) {
        HeaderFooterType[HeaderFooterType["First"] = 0] = "First";
        HeaderFooterType[HeaderFooterType["Odd"] = 1] = "Odd";
        HeaderFooterType[HeaderFooterType["Even"] = 2] = "Even";
    })(HeaderFooterType = __aspxRichEdit.HeaderFooterType || (__aspxRichEdit.HeaderFooterType = {}));
    var SectionPropertyDescriptor = (function () {
        function SectionPropertyDescriptor() {
        }
        SectionPropertyDescriptor.marginLeft = new __aspxRichEdit.SectionPropertiesMarginLeftDescriptor();
        SectionPropertyDescriptor.marginTop = new __aspxRichEdit.SectionPropertiesMarginTopDescriptor();
        SectionPropertyDescriptor.marginRight = new __aspxRichEdit.SectionPropertiesMarginRightDescriptor();
        SectionPropertyDescriptor.marginBottom = new __aspxRichEdit.SectionPropertiesMarginBottomDescriptor();
        SectionPropertyDescriptor.footerOffset = new __aspxRichEdit.SectionPropertiesFooterOffsetDescriptor();
        SectionPropertyDescriptor.headerOffset = new __aspxRichEdit.SectionPropertiesHeaderOffsetDescriptor();
        SectionPropertyDescriptor.columnCount = new __aspxRichEdit.SectionPropertiesColumnCountDescriptor();
        SectionPropertyDescriptor.space = new __aspxRichEdit.SectionPropertiesSpaceDescriptor();
        SectionPropertyDescriptor.equalWidthColumns = new __aspxRichEdit.SectionPropertiesEqualWidthColumnsDescriptor();
        SectionPropertyDescriptor.columnsInfo = new __aspxRichEdit.SectionPropertiesColumnsInfoDescriptor();
        SectionPropertyDescriptor.pageWidth = new __aspxRichEdit.SectionPropertiesPageWidthDescriptor();
        SectionPropertyDescriptor.pageHeight = new __aspxRichEdit.SectionPropertiesPageHeightDescriptor();
        SectionPropertyDescriptor.startType = new __aspxRichEdit.SectionPropertiesStartTypeDescriptor();
        SectionPropertyDescriptor.landscape = new __aspxRichEdit.SectionPropertiesLandscapeDescriptor();
        SectionPropertyDescriptor.differentFirstPage = new __aspxRichEdit.SectionPropertiesDifferentFirstPageDescriptor();
        SectionPropertyDescriptor.ALL_FIELDS = [
            SectionPropertyDescriptor.marginLeft,
            SectionPropertyDescriptor.marginTop,
            SectionPropertyDescriptor.marginRight,
            SectionPropertyDescriptor.marginBottom,
            SectionPropertyDescriptor.footerOffset,
            SectionPropertyDescriptor.headerOffset,
            SectionPropertyDescriptor.columnCount,
            SectionPropertyDescriptor.space,
            SectionPropertyDescriptor.equalWidthColumns,
            SectionPropertyDescriptor.columnsInfo,
            SectionPropertyDescriptor.pageWidth,
            SectionPropertyDescriptor.pageHeight,
            SectionPropertyDescriptor.startType,
            SectionPropertyDescriptor.landscape,
            SectionPropertyDescriptor.differentFirstPage
        ];
        return SectionPropertyDescriptor;
    }());
    __aspxRichEdit.SectionPropertyDescriptor = SectionPropertyDescriptor;
    var SectionProperties = (function () {
        function SectionProperties() {
            this.margins = new __aspxRichEdit.Margins(1440, 1440, 1440, 1440);
            this.headerOffset = 720;
            this.footerOffset = 720;
            this.columnCount = 1;
            this.space = 720;
            this.equalWidthColumns = true;
            this.columnsInfo = [];
            this.pageSize = new __aspxRichEdit.Size(11906, 16838);
            this.startType = SectionStartType.NextPage;
            this.landscape = false;
            this.differentFirstPage = false;
        }
        SectionProperties.createSimpleSectionProperties = function (width, height) {
            var simpleSectionProperties = new SectionProperties();
            simpleSectionProperties.margins = new __aspxRichEdit.Margins(0, 0, 0, 0);
            simpleSectionProperties.pageWidth = __aspxRichEdit.UnitConverter.pixelsToTwips(width);
            simpleSectionProperties.pageHeight = __aspxRichEdit.UnitConverter.pixelsToTwips(height);
            return simpleSectionProperties;
        };
        Object.defineProperty(SectionProperties.prototype, "marginLeft", {
            get: function () { return this.margins.left; },
            set: function (val) { this.margins.left = val; },
            enumerable: true,
            configurable: true
        });
        ;
        Object.defineProperty(SectionProperties.prototype, "marginTop", {
            get: function () { return this.margins.top; },
            set: function (val) { this.margins.top = val; },
            enumerable: true,
            configurable: true
        });
        ;
        Object.defineProperty(SectionProperties.prototype, "marginRight", {
            get: function () { return this.margins.right; },
            set: function (val) { this.margins.right = val; },
            enumerable: true,
            configurable: true
        });
        ;
        Object.defineProperty(SectionProperties.prototype, "marginBottom", {
            get: function () { return this.margins.bottom; },
            set: function (val) { this.margins.bottom = val; },
            enumerable: true,
            configurable: true
        });
        ;
        Object.defineProperty(SectionProperties.prototype, "pageWidth", {
            get: function () { return this.pageSize.width; },
            set: function (val) { this.pageSize.width = val; },
            enumerable: true,
            configurable: true
        });
        ;
        Object.defineProperty(SectionProperties.prototype, "pageHeight", {
            get: function () { return this.pageSize.height; },
            set: function (val) { this.pageSize.height = val; },
            enumerable: true,
            configurable: true
        });
        ;
        ;
        ;
        ;
        ;
        ;
        ;
        SectionProperties.prototype.copyFrom = function (obj) {
            this.columnCount = obj.columnCount;
            if (obj.columnsInfo) {
                this.columnsInfo = [];
                for (var i = 0; i < obj.columnsInfo.length; i++)
                    this.columnsInfo.push(new SectionColumnProperties(obj.columnsInfo[i].width, obj.columnsInfo[i].space));
            }
            else
                this.columnsInfo = obj.columnsInfo;
            this.equalWidthColumns = obj.equalWidthColumns;
            this.marginBottom = obj.marginBottom;
            this.marginLeft = obj.marginLeft;
            this.marginRight = obj.marginRight;
            this.marginTop = obj.marginTop;
            this.pageHeight = obj.pageHeight;
            this.pageWidth = obj.pageWidth;
            this.space = obj.space;
            this.startType = obj.startType;
            this.landscape = obj.landscape;
            this.differentFirstPage = obj.differentFirstPage;
            this.headerOffset = obj.headerOffset;
            this.footerOffset = obj.footerOffset;
        };
        SectionProperties.prototype.clone = function () {
            var obj = new SectionProperties();
            obj.copyFrom(this);
            return obj;
        };
        SectionProperties.prototype.equals = function (obj) {
            if (!obj)
                return false;
            return this.margins.equals(obj.margins) &&
                this.headerOffset == obj.headerOffset &&
                this.footerOffset == obj.footerOffset &&
                this.columnCount == obj.columnCount &&
                this.space == obj.space &&
                this.equalWidthColumns == obj.equalWidthColumns &&
                this.pageSize.equals(obj.pageSize) &&
                this.startType == obj.startType &&
                this.landscape == obj.landscape &&
                this.differentFirstPage == obj.differentFirstPage &&
                __aspxRichEdit.CompareUtils.equalsColumnsInfoBinary(this.columnsInfo, obj.columnsInfo);
        };
        return SectionProperties;
    }());
    __aspxRichEdit.SectionProperties = SectionProperties;
    var SectionColumnProperties = (function () {
        function SectionColumnProperties(width, space) {
            this.width = 0;
            this.space = 0;
            this.width = width;
            this.space = space;
        }
        SectionColumnProperties.prototype.equals = function (obj) {
            if (!obj)
                return false;
            return this.width == obj.width &&
                this.space == obj.space;
        };
        SectionColumnProperties.prototype.copyFrom = function (obj) {
            this.width = obj.width;
            this.space = obj.space;
        };
        SectionColumnProperties.prototype.clone = function () {
            return new SectionColumnProperties(this.width, this.space);
        };
        SectionColumnProperties.prototype.applyConverter = function (converter) {
            this.width = converter(this.width);
            this.space = converter(this.space);
            return this;
        };
        return SectionColumnProperties;
    }());
    __aspxRichEdit.SectionColumnProperties = SectionColumnProperties;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var PropertiesMergerBase = (function () {
        function PropertiesMergerBase(initialialProperties, descriptors) {
            this.innerProperties = initialialProperties;
            this.descriptors = descriptors;
        }
        PropertiesMergerBase.prototype.mergeInternal = function (properties, mask, setValue) {
            if (!this.innerProperties.getUseValue(mask) && properties.getUseValue(mask)) {
                setValue();
                this.innerProperties.setUseValue(mask, true);
            }
        };
        PropertiesMergerBase.prototype.mergeTableProperties = function (descriptor, getValue) {
            var mask = descriptor.maskValue();
            if (this.innerProperties.getUseValue(mask))
                return;
            var prop = getValue();
            if (prop === null)
                return;
            descriptor.setProp(this.innerProperties, prop);
            this.innerProperties.setUseValue(mask, true);
        };
        PropertiesMergerBase.prototype.mergeAll = function (from) {
            if (from) {
                var to = this.innerProperties;
                for (var _i = 0, _a = this.descriptors; _i < _a.length; _i++) {
                    var desc = _a[_i];
                    var mask = desc.maskValue();
                    if (!to.getUseValue(mask) && from.getUseValue(mask)) {
                        desc.setProp(to, desc.getProp(from));
                        to.setUseValue(mask, true);
                    }
                }
            }
        };
        return PropertiesMergerBase;
    }());
    __aspxRichEdit.PropertiesMergerBase = PropertiesMergerBase;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FindFieldNameResult = (function () {
        function FindFieldNameResult() {
        }
        return FindFieldNameResult;
    }());
    __aspxRichEdit.FindFieldNameResult = FindFieldNameResult;
    var ParserCreatorByFieldName = (function () {
        function ParserCreatorByFieldName(name, getFieldParser) {
            this.name = name;
            this.getFieldParser = getFieldParser;
        }
        return ParserCreatorByFieldName;
    }());
    __aspxRichEdit.ParserCreatorByFieldName = ParserCreatorByFieldName;
    var FieldParserFabric = (function () {
        function FieldParserFabric() {
        }
        FieldParserFabric.getParser = function (control, subDocument, field) {
            var modelIterator = new __aspxRichEdit.ModelIterator(subDocument, false);
            modelIterator.setPosition(field.getCodeStartPosition());
            var findFieldNameResult = this.findName(modelIterator);
            if (findFieldNameResult)
                return findFieldNameResult.fieldNameToParser.getFieldParser(control, subDocument, field, modelIterator, findFieldNameResult.fieldNameFirstLetterPosition);
            else
                return null;
        };
        FieldParserFabric.findName = function (iterator) {
            while (iterator.run.getType() == __aspxRichEdit.RunType.TextRun && __aspxRichEdit.RichUtils.isWhitespace.test(iterator.getCurrentChar()) ||
                iterator.run.getType() == __aspxRichEdit.RunType.ParagraphRun ||
                iterator.run.getType() == __aspxRichEdit.RunType.SectionRun)
                iterator.moveToNextChar();
            var result = new FindFieldNameResult();
            result.fieldNameFirstLetterPosition = iterator.getAbsolutePosition();
            var fieldName = "";
            do {
                fieldName += iterator.getCurrentChar();
                iterator.moveToNextChar();
            } while (iterator.run.getType() == __aspxRichEdit.RunType.TextRun && !__aspxRichEdit.RichUtils.isWhitespace.test(iterator.getCurrentChar()) &&
                iterator.run.getType() != __aspxRichEdit.RunType.ParagraphRun && iterator.run.getType() != __aspxRichEdit.RunType.SectionRun);
            for (var i = 0, parser = void 0; parser = FieldParserFabric.fieldNamesMap[i]; i++)
                if (parser.name == fieldName.toUpperCase()) {
                    result.fieldNameToParser = parser;
                    return result;
                }
            return null;
        };
        FieldParserFabric.TOC_NAME = "TOC";
        FieldParserFabric.fieldNamesMap = [
            new ParserCreatorByFieldName("DATE", function (control, subDocument, field, modelIterator, fieldNameFirstLetterPosition) { return new __aspxRichEdit.FieldCodeParserDate(control, subDocument, field, modelIterator, fieldNameFirstLetterPosition); }),
            new ParserCreatorByFieldName("TIME", function (control, subDocument, field, modelIterator, fieldNameFirstLetterPosition) { return new __aspxRichEdit.FieldCodeParserTime(control, subDocument, field, modelIterator, fieldNameFirstLetterPosition); }),
            new ParserCreatorByFieldName("DOCVARIABLE", function (control, subDocument, field, modelIterator, fieldNameFirstLetterPosition) { return new __aspxRichEdit.FieldCodeParserDocVariable(control, subDocument, field, modelIterator, fieldNameFirstLetterPosition); }),
            new ParserCreatorByFieldName("HYPERLINK", function (control, subDocument, field, modelIterator, fieldNameFirstLetterPosition) { return new __aspxRichEdit.FieldCodeParserHyperlink(control, subDocument, field, modelIterator, fieldNameFirstLetterPosition); }),
            new ParserCreatorByFieldName("MERGEFIELD", function (control, subDocument, field, modelIterator, fieldNameFirstLetterPosition) { return new __aspxRichEdit.FieldCodeParserMailMerge(control, subDocument, field, modelIterator, fieldNameFirstLetterPosition); }),
            new ParserCreatorByFieldName("NUMPAGES", function (control, subDocument, field, modelIterator, fieldNameFirstLetterPosition) { return new __aspxRichEdit.FieldCodeParserNumPages(control, subDocument, field, modelIterator, fieldNameFirstLetterPosition); }),
            new ParserCreatorByFieldName("PAGE", function (control, subDocument, field, modelIterator, fieldNameFirstLetterPosition) { return new __aspxRichEdit.FieldCodeParserPage(control, subDocument, field, modelIterator, fieldNameFirstLetterPosition); }),
            new ParserCreatorByFieldName("SEQ", function (control, subDocument, field, modelIterator, fieldNameFirstLetterPosition) { return new __aspxRichEdit.FieldCodeParserSeq(control, subDocument, field, modelIterator, fieldNameFirstLetterPosition); }),
            new ParserCreatorByFieldName("TC", function (control, subDocument, field, modelIterator, fieldNameFirstLetterPosition) { return new __aspxRichEdit.FieldCodeParserTc(control, subDocument, field, modelIterator, fieldNameFirstLetterPosition); }),
            new ParserCreatorByFieldName(FieldParserFabric.TOC_NAME, function (control, subDocument, field, modelIterator, fieldNameFirstLetterPosition) { return new __aspxRichEdit.FieldCodeParserToc(control, subDocument, field, modelIterator, fieldNameFirstLetterPosition); }),
            new ParserCreatorByFieldName("PAGEREF", function (control, subDocument, field, modelIterator, fieldNameFirstLetterPosition) { return new __aspxRichEdit.FieldCodeParserPageRef(control, subDocument, field, modelIterator, fieldNameFirstLetterPosition); }),
        ];
        return FieldParserFabric;
    }());
    __aspxRichEdit.FieldParserFabric = FieldParserFabric;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FieldCodeParserState;
    (function (FieldCodeParserState) {
        FieldCodeParserState[FieldCodeParserState["start"] = 0] = "start";
        FieldCodeParserState[FieldCodeParserState["addedParsersCodePart"] = 1] = "addedParsersCodePart";
        FieldCodeParserState[FieldCodeParserState["updatedParsersCodePart"] = 2] = "updatedParsersCodePart";
        FieldCodeParserState[FieldCodeParserState["resultPartCreated"] = 3] = "resultPartCreated";
        FieldCodeParserState[FieldCodeParserState["addedParsersResultPart"] = 4] = "addedParsersResultPart";
        FieldCodeParserState[FieldCodeParserState["end"] = 5] = "end";
    })(FieldCodeParserState = __aspxRichEdit.FieldCodeParserState || (__aspxRichEdit.FieldCodeParserState = {}));
    var FieldSwitchType;
    (function (FieldSwitchType) {
        FieldSwitchType[FieldSwitchType["Error"] = 0] = "Error";
        FieldSwitchType[FieldSwitchType["DateAndTime"] = 1] = "DateAndTime";
        FieldSwitchType[FieldSwitchType["Numeric"] = 2] = "Numeric";
        FieldSwitchType[FieldSwitchType["General"] = 3] = "General";
        FieldSwitchType[FieldSwitchType["FieldSpecific"] = 4] = "FieldSpecific";
    })(FieldSwitchType = __aspxRichEdit.FieldSwitchType || (__aspxRichEdit.FieldSwitchType = {}));
    var FieldMailMergeType;
    (function (FieldMailMergeType) {
        FieldMailMergeType[FieldMailMergeType["NonMailMerge"] = 1] = "NonMailMerge";
        FieldMailMergeType[FieldMailMergeType["MailMerge"] = 2] = "MailMerge";
        FieldMailMergeType[FieldMailMergeType["Mixed"] = 3] = "Mixed";
    })(FieldMailMergeType = __aspxRichEdit.FieldMailMergeType || (__aspxRichEdit.FieldMailMergeType = {}));
    var FieldSwitch = (function () {
        function FieldSwitch(type, name, arg) {
            this.name = name;
            this.type = type;
            this.arg = arg;
        }
        return FieldSwitch;
    }());
    __aspxRichEdit.FieldSwitch = FieldSwitch;
    var FieldParameter = (function () {
        function FieldParameter(interval, textRepresentation) {
            this.text = textRepresentation;
            this.interval = interval;
        }
        return FieldParameter;
    }());
    __aspxRichEdit.FieldParameter = FieldParameter;
    var FieldCodeParserHelper = (function () {
        function FieldCodeParserHelper() {
        }
        FieldCodeParserHelper.deleteFieldResultFromModel = function (control, subDocument, field) {
            var resultInterval = field.getResultInterval();
            if (resultInterval.length > 0) {
                control.history.beginTransaction();
                __aspxRichEdit.ModelManipulator.removeInterval(control, subDocument, resultInterval, true, false);
                control.history.endTransaction();
            }
        };
        FieldCodeParserHelper.isWhitespaceAndTextRunType = function (char, type) {
            return __aspxRichEdit.RichUtils.isWhitespace.test(char) && type == __aspxRichEdit.RunType.TextRun;
        };
        FieldCodeParserHelper.isBackslesh = function (char) {
            return char == "\\";
        };
        FieldCodeParserHelper.isQuote = function (char) {
            return char == "\"";
        };
        return FieldCodeParserHelper;
    }());
    __aspxRichEdit.FieldCodeParserHelper = FieldCodeParserHelper;
    var FieldCodeParser = (function () {
        function FieldCodeParser(control, subDocument, field, modelIterator, fieldNameFirstLetterPosition) {
            this.control = control;
            this.subDocument = subDocument;
            this.fieldsStack = [field];
            this.modelIterator = modelIterator;
            this.lowLevelParsers = [];
            this.parserState = FieldCodeParserState.start;
            this.fieldNameFirstLetterPosition = subDocument.positionManager.registerPosition(fieldNameFirstLetterPosition);
        }
        FieldCodeParser.finalAction = function (field, control, subDocument) {
            field.showCode = false;
            control.layoutFormatterManager.invalidator.onIntervalChanged(subDocument, field.getAllFieldInterval());
        };
        FieldCodeParser.prototype.destructor = function () {
            this.subDocument.positionManager.unregisterPosition(this.fieldNameFirstLetterPosition);
            this.fieldNameFirstLetterPosition = null;
            FieldCodeParser.finalAction(this.getTopField(), this.control, this.subDocument);
        };
        FieldCodeParser.prototype.getMailMergeType = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        FieldCodeParser.prototype.setInputPositionState = function () {
            this.control.inputPosition.setPropertiesFromPosition(this.subDocument, this.fieldNameFirstLetterPosition.value);
        };
        FieldCodeParser.prototype.getTopField = function () {
            return this.fieldsStack[0];
        };
        FieldCodeParser.prototype.update = function (responce) {
            if (this.parserState == FieldCodeParserState.end)
                throw new Error("Excess call updated field");
            switch (this.parserState) {
                case FieldCodeParserState.start:
                    var field = this.getTopField();
                    if (this.collectAndUpdateLowLevelFields(field.index + 1, field.getCodeStartPosition(), field.getSeparatorPosition())) {
                        this.parserState = FieldCodeParserState.updatedParsersCodePart;
                        return this.parseCodeCurrentField(null);
                    }
                    this.parserState = FieldCodeParserState.addedParsersCodePart;
                    return false;
                case FieldCodeParserState.addedParsersCodePart:
                    if (this.updateLowLevelFields(responce)) {
                        this.parserState = FieldCodeParserState.updatedParsersCodePart;
                        return this.parseCodeCurrentField(responce);
                    }
                    return false;
                case FieldCodeParserState.updatedParsersCodePart:
                    return this.parseCodeCurrentField(responce);
                case FieldCodeParserState.addedParsersResultPart:
                    return this.updateFieldsInResult(responce);
            }
        };
        FieldCodeParser.prototype.collectAndUpdateLowLevelFields = function (fieldIndex, startPosition, endPosition) {
            var fields = this.subDocument.fields;
            for (var field; field = fields[fieldIndex]; fieldIndex++) {
                if (field.getFieldStartPosition() > endPosition)
                    break;
                if (field.parent != this.getTopField() || field.getFieldEndPosition() <= startPosition) {
                    fieldIndex++;
                    continue;
                }
                var fieldParser = __aspxRichEdit.FieldParserFabric.getParser(this.control, this.subDocument, field);
                if (fieldParser) {
                    if (!fieldParser.update(null))
                        this.lowLevelParsers.push(fieldParser);
                    else
                        fieldParser.destructor();
                }
                else
                    FieldCodeParserHelper.deleteFieldResultFromModel(this.control, this.subDocument, field);
            }
            return this.lowLevelParsers.length == 0;
        };
        FieldCodeParser.prototype.updateLowLevelFields = function (responce) {
            for (var parserIndex = 0, parser; parser = this.lowLevelParsers[parserIndex]; parserIndex++) {
                if (parser.update(responce)) {
                    parser.destructor();
                    this.lowLevelParsers.splice(parserIndex, 1);
                    parserIndex--;
                }
            }
            return this.lowLevelParsers.length == 0;
        };
        FieldCodeParser.prototype.parseCodeCurrentField = function (responce) {
            if (this.parseCodeCurrentFieldInternal(responce)) {
                switch (this.parserState) {
                    case FieldCodeParserState.resultPartCreated:
                        return this.updateFieldsInResult(responce);
                    case FieldCodeParserState.end:
                        return true;
                    default:
                        throw new Error("wrong way");
                }
            }
            else {
                if (this.parserState == FieldCodeParserState.updatedParsersCodePart)
                    return false;
                else
                    throw new Error("wrong way");
            }
        };
        FieldCodeParser.prototype.updateFieldsInResult = function (responce) {
            switch (this.parserState) {
                case FieldCodeParserState.resultPartCreated:
                    var fieldIndex = __aspxRichEdit.Field.normedBinaryIndexOf(this.subDocument.fields, this.getTopField().getResultStartPosition() + 1);
                    var field = this.getTopField();
                    if (this.collectAndUpdateLowLevelFields(fieldIndex, field.getResultStartPosition(), field.getResultEndPosition())) {
                        this.parserState = FieldCodeParserState.end;
                        return true;
                    }
                    this.parserState = FieldCodeParserState.addedParsersResultPart;
                    return false;
                case FieldCodeParserState.addedParsersResultPart:
                    if (this.updateLowLevelFields(responce)) {
                        this.parserState = FieldCodeParserState.end;
                        return true;
                    }
                    return false;
            }
        };
        FieldCodeParser.prototype.moveIteratorToNextChar = function () {
            if (this.modelIterator.run.getType() == __aspxRichEdit.RunType.FieldCodeEndRun)
                return false;
            if (!this.modelIterator.moveToNextChar())
                throw new Error("wrong way");
            while (true) {
                switch (this.modelIterator.run.getType()) {
                    case __aspxRichEdit.RunType.FieldCodeStartRun:
                        var fieldIndex = __aspxRichEdit.Field.normedBinaryIndexOf(this.subDocument.fields, this.modelIterator.getAbsolutePosition() + 1);
                        var lowLevelField = this.subDocument.fields[fieldIndex];
                        this.fieldsStack.push(lowLevelField);
                        this.modelIterator.setPosition(lowLevelField.getResultStartPosition());
                        break;
                    case __aspxRichEdit.RunType.FieldResultEndRun:
                    case __aspxRichEdit.RunType.FieldCodeEndRun:
                        var lowLevelField = this.fieldsStack.pop();
                        if (this.fieldsStack.length == 0) {
                            this.fieldsStack.push(lowLevelField);
                            return false;
                        }
                        this.modelIterator.setPosition(lowLevelField.getFieldEndPosition());
                        break;
                    default:
                        return true;
                }
            }
        };
        FieldCodeParser.prototype.updateInfo = function () {
            if (!this.needUpdateInfo())
                return false;
            this.parseSwitchesAndArgs(true);
            this.updateInfoCore();
            return true;
        };
        FieldCodeParser.prototype.needUpdateInfo = function () {
            return false;
        };
        FieldCodeParser.prototype.updateInfoCore = function () { };
        FieldCodeParser.prototype.parseSwitchesAndArgs = function (needAtLestOneSpaceAfterFieldName) {
            if (needAtLestOneSpaceAfterFieldName) {
                var prevPos = this.modelIterator.getAbsolutePosition();
                if (this.skipWhitespaces())
                    this.modelIterator.setPosition(prevPos);
                else
                    return this.modelIterator.run.getType() == __aspxRichEdit.RunType.FieldCodeEndRun;
            }
            while (this.skipWhitespaces() && this.modelIterator.run.getType() != __aspxRichEdit.RunType.FieldCodeEndRun) {
                var currChar = this.modelIterator.getCurrentChar();
                if (FieldCodeParserHelper.isBackslesh(currChar)) {
                    var switchInfo = this.getSwitchInfo();
                    if (switchInfo.type == FieldSwitchType.Error || !this.handleSwitch(switchInfo))
                        return false;
                }
                else {
                    var paramInfo = this.getFieldParameterInfo();
                    if (!paramInfo || !this.handleParameter(paramInfo))
                        return false;
                }
            }
            return this.modelIterator.run.getType() == __aspxRichEdit.RunType.FieldCodeEndRun;
        };
        FieldCodeParser.prototype.skipWhitespaces = function () {
            var isFindWhitespace = false;
            do {
                if (FieldCodeParserHelper.isWhitespaceAndTextRunType(this.modelIterator.getCurrentChar(), this.modelIterator.run.getType()) ||
                    this.modelIterator.run.getType() == __aspxRichEdit.RunType.ParagraphRun ||
                    this.modelIterator.run.getType() == __aspxRichEdit.RunType.SectionRun)
                    isFindWhitespace = true;
                else
                    break;
            } while (this.moveIteratorToNextChar());
            return isFindWhitespace;
        };
        FieldCodeParser.prototype.getFieldParameterInfo = function () {
            var startPosition = this.modelIterator.getAbsolutePosition();
            var parseResult = this.parseSwitchOrFieldArgument();
            if (!parseResult)
                return null;
            var argInterval = parseResult.quoted ?
                __aspxRichEdit.FixedInterval.fromPositions(startPosition + 1, this.modelIterator.getAbsolutePosition() - 1) :
                __aspxRichEdit.FixedInterval.fromPositions(startPosition, this.modelIterator.getAbsolutePosition());
            return new FieldParameter(argInterval, parseResult.argListChars.join(""));
        };
        FieldCodeParser.prototype.getSwitchInfo = function () {
            if (!this.moveIteratorToNextChar() || this.modelIterator.run.getType() != __aspxRichEdit.RunType.TextRun)
                return new FieldSwitch(FieldSwitchType.Error, "", "");
            var currChar = this.modelIterator.getCurrentChar();
            switch (currChar) {
                case "*": return this.makeSwitchInfo(FieldSwitchType.General, currChar, true);
                case "@": return this.makeSwitchInfo(FieldSwitchType.DateAndTime, currChar, true);
                case "#": return this.makeSwitchInfo(FieldSwitchType.Numeric, currChar, true);
                default:
                    if (currChar == "!")
                        return this.makeSwitchInfo(FieldSwitchType.FieldSpecific, currChar, true);
                    if (!__aspxRichEdit.RichUtils.isLatinLetter.test(currChar))
                        return new FieldSwitch(FieldSwitchType.Error, "", "");
                    var switchName = currChar;
                    var lastPos = this.modelIterator.getAbsolutePosition();
                    if (this.moveIteratorToNextChar()) {
                        currChar = this.modelIterator.getCurrentChar();
                        if (__aspxRichEdit.RichUtils.isLatinLetter.test(currChar))
                            switchName += currChar;
                        else
                            this.modelIterator.setPosition(lastPos);
                    }
                    else
                        this.modelIterator.setPosition(lastPos);
                    return this.makeSwitchInfo(FieldSwitchType.FieldSpecific, switchName, false);
            }
        };
        FieldCodeParser.prototype.makeSwitchInfo = function (switchType, switchName, needArgument) {
            var switchArg = this.getSwitchArgument(needArgument);
            if (switchArg === null || needArgument && switchArg.length == 0)
                return new FieldSwitch(FieldSwitchType.Error, "", "");
            return new FieldSwitch(switchType, switchName, switchArg);
        };
        FieldCodeParser.prototype.getSwitchArgument = function (needArgument) {
            if (!this.moveIteratorToNextChar())
                return needArgument ? null : "";
            if (!this.skipWhitespaces())
                return null;
            var parseResult = this.parseSwitchOrFieldArgument();
            if (!parseResult)
                return needArgument ? null : "";
            var resArg = parseResult.argListChars.join("");
            if (resArg.length == 0)
                return null;
            return resArg;
        };
        FieldCodeParser.prototype.parseSwitchOrFieldArgument = function () {
            if (this.modelIterator.run.getType() == __aspxRichEdit.RunType.FieldCodeEndRun)
                return null;
            var currChar = this.modelIterator.getCurrentChar();
            if (FieldCodeParserHelper.isBackslesh(currChar)) {
                this.modelIterator.moveToPrevChar();
                return null;
            }
            var resList = [];
            var startFieldStackSize = this.fieldsStack.length;
            var lastFieldStackLength = startFieldStackSize;
            var needSearchNextQuote = FieldCodeParserHelper.isQuote(currChar);
            if (needSearchNextQuote)
                if (!this.moveIteratorToNextChar())
                    return null;
            var lastSymbolIsQuote = !needSearchNextQuote;
            do {
                currChar = this.modelIterator.getCurrentChar();
                if (needSearchNextQuote) {
                    if (FieldCodeParserHelper.isQuote(currChar)) {
                        var prevChar = resList[resList.length - 1];
                        if (!(prevChar && FieldCodeParserHelper.isBackslesh(prevChar))) {
                            lastSymbolIsQuote = true;
                            lastFieldStackLength = this.fieldsStack.length;
                            this.moveIteratorToNextChar();
                            break;
                        }
                    }
                }
                else if (FieldCodeParserHelper.isWhitespaceAndTextRunType(currChar, this.modelIterator.run.getType()))
                    break;
                resList.push(currChar);
                lastFieldStackLength = this.fieldsStack.length;
            } while (this.moveIteratorToNextChar());
            if (startFieldStackSize != lastFieldStackLength || !lastSymbolIsQuote)
                return null;
            return { argListChars: resList, quoted: needSearchNextQuote };
        };
        return FieldCodeParser;
    }());
    __aspxRichEdit.FieldCodeParser = FieldCodeParser;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FieldCodeParserClientUpdatingBase = (function (_super) {
        __extends(FieldCodeParserClientUpdatingBase, _super);
        function FieldCodeParserClientUpdatingBase() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.switchInfoList = [];
            _this.parameterInfoList = [];
            return _this;
        }
        FieldCodeParserClientUpdatingBase.prototype.getMailMergeType = function () {
            return __aspxRichEdit.FieldMailMergeType.NonMailMerge;
        };
        FieldCodeParserClientUpdatingBase.prototype.handleSwitch = function (newSwitch) {
            this.switchInfoList.push(newSwitch);
            return true;
        };
        FieldCodeParserClientUpdatingBase.prototype.handleParameter = function (newParameter) {
            this.parameterInfoList.push(newParameter);
            return true;
        };
        FieldCodeParserClientUpdatingBase.prototype.parseCodeCurrentFieldInternal = function (_responce) {
            __aspxRichEdit.FieldCodeParserHelper.deleteFieldResultFromModel(this.control, this.subDocument, this.getTopField());
            if (this.parseSwitchesAndArgs(true))
                this.fillResult();
            this.parserState = __aspxRichEdit.FieldCodeParserState.end;
            return true;
        };
        FieldCodeParserClientUpdatingBase.prototype.getFormattedResult = function (value) {
            var typeName = "";
            for (var i = 0, switchInfo = void 0; switchInfo = this.switchInfoList[i]; i++)
                if (switchInfo.type == __aspxRichEdit.FieldSwitchType.General)
                    typeName = switchInfo.arg;
            var converter = __aspxRichEdit.OrdinalBasedNumberConverter.createConverterByTypeName(typeName);
            return converter.convertNumber(value);
        };
        FieldCodeParserClientUpdatingBase.prototype.createLocalHyperLink = function (interval, bookmarkName) {
            this.control.history.addAndRedo(new __aspxRichEdit.FieldInsertHistoryItem(this.control, this.control.modelManipulator, this.subDocument, interval.start, 0, interval.length, false));
            var fieldIndex = __aspxRichEdit.Field.normedBinaryIndexOf(this.subDocument.fields, interval.start + 1);
            var field = this.subDocument.fields[fieldIndex];
            var hyperlinkInfo = new __aspxRichEdit.HyperlinkInfo("", bookmarkName, "", false);
            this.control.history.addAndRedo(new __aspxRichEdit.ChangeFieldHyperlinkInfoHistoryItem(this.control.modelManipulator, this.subDocument, field.index, hyperlinkInfo));
            var selection = this.control.selection;
            selection.deprecatedSetSelection(field.getCodeStartPosition(), field.getSeparatorPosition(), false, selection.keepX, __aspxRichEdit.UpdateInputPositionProperties.No, false);
            var hyperlinkCode = REWebUtils.Formatter.Format("HYPERLINK \\l \"{0}\"", bookmarkName);
            this.control.modelManipulator.insertText(this.control, this.subDocument, field.getCodeInterval(), hyperlinkCode, true);
        };
        FieldCodeParserClientUpdatingBase.prototype.fillResult = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return FieldCodeParserClientUpdatingBase;
    }(__aspxRichEdit.FieldCodeParser));
    __aspxRichEdit.FieldCodeParserClientUpdatingBase = FieldCodeParserClientUpdatingBase;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var OrdinalBasedNumberConverter = (function () {
        function OrdinalBasedNumberConverter() {
            this.maxValue = __aspxRichEdit.Constants.MAX_SAFE_INTEGER;
            this.minValue = __aspxRichEdit.Constants.MIN_SAFE_INTEGER;
        }
        OrdinalBasedNumberConverter.prototype.convertNumber = function (value) {
            if (value < this.minValue || value > this.maxValue) {
                throw new Error("InvalidNumberConverterValue");
            }
            return this.convertNumberCore(value);
        };
        OrdinalBasedNumberConverter.createConverter = function (type) {
            switch (type) {
                case __aspxRichEdit.NumberingFormat.UpperRoman:
                    return new __aspxRichEdit.UpperRomanNumberConverterClassic();
                case __aspxRichEdit.NumberingFormat.LowerRoman:
                    return new __aspxRichEdit.LowerRomanNumberConverterClassic();
                case __aspxRichEdit.NumberingFormat.Ordinal:
                    return new OrdinalEnglishNumberConverter();
                case __aspxRichEdit.NumberingFormat.OrdinalText:
                    return new __aspxRichEdit.DescriptiveOrdinalEnglishNumberConverter();
                case __aspxRichEdit.NumberingFormat.CardinalText:
                    return new __aspxRichEdit.DescriptiveCardinalEnglishNumberConverter();
                case __aspxRichEdit.NumberingFormat.UpperLetter:
                    return new __aspxRichEdit.UpperLatinLetterNumberConverter();
                case __aspxRichEdit.NumberingFormat.LowerLetter:
                    return new __aspxRichEdit.LowerLatinLetterNumberConverter();
                case __aspxRichEdit.NumberingFormat.NumberInDash:
                    return new __aspxRichEdit.NumberInDashNumberConverter();
                case __aspxRichEdit.NumberingFormat.Bullet:
                    return new __aspxRichEdit.BulletNumberConverter();
                case __aspxRichEdit.NumberingFormat.DecimalZero:
                    return new __aspxRichEdit.DecimalZeroNumberConverter();
                case __aspxRichEdit.NumberingFormat.DecimalEnclosedParentheses:
                    return new __aspxRichEdit.DecimalEnclosedParenthesesNumberConverter();
                case __aspxRichEdit.NumberingFormat.Hex:
                    return new __aspxRichEdit.HexNumberConverter();
                case __aspxRichEdit.NumberingFormat.Decimal:
                    return new __aspxRichEdit.DecimalNumberConverter();
                default:
                    return new __aspxRichEdit.DecimalNumberConverter();
            }
        };
        OrdinalBasedNumberConverter.createConverterByTypeName = function (typeName) {
            var uppercaseTypeName = typeName.toUpperCase();
            var firstChar = typeName[0];
            switch (uppercaseTypeName) {
                case "ALPHABETIC":
                    return firstChar.toUpperCase() == firstChar ? new __aspxRichEdit.UpperLatinLetterNumberConverter() : new __aspxRichEdit.LowerLatinLetterNumberConverter();
                case "ROMAN":
                    return firstChar.toUpperCase() == firstChar ? new __aspxRichEdit.UpperRomanNumberConverterClassic() : new __aspxRichEdit.LowerRomanNumberConverterClassic();
                case "ARABIC":
                    return new __aspxRichEdit.DecimalNumberConverter();
                case "ARABICDASH":
                    return new __aspxRichEdit.NumberInDashNumberConverter();
                case "CARDTEXT":
                    return new __aspxRichEdit.DescriptiveCardinalEnglishNumberConverter();
                case "CIRCLENUM":
                    return new __aspxRichEdit.DecimalEnclosedParenthesesNumberConverter();
                case "HEX":
                    return new __aspxRichEdit.HexNumberConverter();
                case "ORDINAL":
                    return new OrdinalEnglishNumberConverter();
                case "ORDTEXT":
                    return new __aspxRichEdit.DescriptiveOrdinalEnglishNumberConverter();
                default:
                    return new __aspxRichEdit.DecimalNumberConverter();
            }
        };
        return OrdinalBasedNumberConverter;
    }());
    __aspxRichEdit.OrdinalBasedNumberConverter = OrdinalBasedNumberConverter;
    var OrdinalEnglishNumberConverter = (function (_super) {
        __extends(OrdinalEnglishNumberConverter, _super);
        function OrdinalEnglishNumberConverter() {
            var _this = _super.call(this) || this;
            _this.ending = ["st", "nd", "rd", "th"];
            _this.type = __aspxRichEdit.NumberingFormat.Ordinal;
            return _this;
        }
        OrdinalEnglishNumberConverter.prototype.convertNumberCore = function (value) {
            var temp = value % 100;
            if (temp < 21) {
                switch (temp) {
                    case 1:
                        return REWebUtils.Formatter.Format("{0}{1}", value, this.ending[0]);
                    case 2:
                        return REWebUtils.Formatter.Format("{0}{1}", value, this.ending[1]);
                    case 3:
                        return REWebUtils.Formatter.Format("{0}{1}", value, this.ending[2]);
                    default:
                        return REWebUtils.Formatter.Format("{0}{1}", value, this.ending[3]);
                }
            }
            value--;
            temp = value % 10;
            if (temp < 3)
                return REWebUtils.Formatter.Format("{0}{1}", value + 1, this.ending[temp % 3]);
            return REWebUtils.Formatter.Format("{0}{1}", value + 1, this.ending[3]);
        };
        return OrdinalEnglishNumberConverter;
    }(OrdinalBasedNumberConverter));
    __aspxRichEdit.OrdinalEnglishNumberConverter = OrdinalEnglishNumberConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HistoryItem = (function () {
        function HistoryItem(modelManipulator, boundSubDocument) {
            this.uniqueId = -1;
            this.modelManipulator = modelManipulator;
            this.boundSubDocument = boundSubDocument;
        }
        HistoryItem.prototype.changeModified = function () {
            return true;
        };
        HistoryItem.prototype.redo = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        HistoryItem.prototype.undo = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return HistoryItem;
    }());
    __aspxRichEdit.HistoryItem = HistoryItem;
    var CompositionHistoryItem = (function (_super) {
        __extends(CompositionHistoryItem, _super);
        function CompositionHistoryItem(modelManipulator, boundSubDocument) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.historyItems = [];
            return _this;
        }
        CompositionHistoryItem.prototype.changeModified = function () {
            var item;
            for (var i = 0; item = this.historyItems[i]; i++) {
                if (item.changeModified())
                    return true;
            }
            return false;
        };
        CompositionHistoryItem.prototype.redo = function () {
            var item;
            for (var i = 0; item = this.historyItems[i]; i++)
                item.redo();
        };
        CompositionHistoryItem.prototype.undo = function () {
            var item;
            for (var i = this.historyItems.length - 1; item = this.historyItems[i]; i--)
                item.undo();
        };
        CompositionHistoryItem.prototype.add = function (historyItem) {
            if (historyItem == null)
                throw new Error(__aspxRichEdit.Errors.ValueCannotBeNull);
            this.historyItems.push(historyItem);
        };
        return CompositionHistoryItem;
    }(HistoryItem));
    __aspxRichEdit.CompositionHistoryItem = CompositionHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var IntervalBasedHistoryItem = (function (_super) {
        __extends(IntervalBasedHistoryItem, _super);
        function IntervalBasedHistoryItem(modelManipulator, boundSubDocument, interval) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.interval = interval;
            return _this;
        }
        return IntervalBasedHistoryItem;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.IntervalBasedHistoryItem = IntervalBasedHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableBasedHistoryItem = (function (_super) {
        __extends(TableBasedHistoryItem, _super);
        function TableBasedHistoryItem(modelManipulator, boundSubDocument, tableIndex) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.tableIndex = tableIndex;
            return _this;
        }
        TableBasedHistoryItem.prototype.getTable = function () {
            return this.boundSubDocument.tables[this.tableIndex];
        };
        TableBasedHistoryItem.getRowCellsRanges = function (tableRow) {
            return __aspxRichEdit.ListUtils.map(tableRow.cells, function (cell) { return cell.interval; });
        };
        TableBasedHistoryItem.getTableCellsRanges = function (table) {
            return __aspxRichEdit.ListUtils.map(table.rows, function (row) { return TableBasedHistoryItem.getRowCellsRanges(row); });
        };
        return TableBasedHistoryItem;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.TableBasedHistoryItem = TableBasedHistoryItem;
    var CreateTableHistoryItem = (function (_super) {
        __extends(CreateTableHistoryItem, _super);
        function CreateTableHistoryItem(modelManipulator, subDocument, firstParagraphIndex, rowCount, cellCount) {
            var _this = _super.call(this, modelManipulator, subDocument, -1) || this;
            _this.firstParagraphIndex = firstParagraphIndex;
            _this.rowCount = rowCount;
            _this.cellCount = cellCount;
            return _this;
        }
        CreateTableHistoryItem.prototype.redo = function () {
            this.tableIndex = this.modelManipulator.tables.createTable(this.boundSubDocument, this.firstParagraphIndex, this.rowCount, this.cellCount).index;
        };
        CreateTableHistoryItem.prototype.undo = function () {
            this.modelManipulator.tables.removeTable(this.boundSubDocument, this.getTable());
        };
        return CreateTableHistoryItem;
    }(TableBasedHistoryItem));
    __aspxRichEdit.CreateTableHistoryItem = CreateTableHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableCellMargins = (function () {
        function TableCellMargins() {
        }
        TableCellMargins.prototype.equals = function (obj) {
            if (!obj)
                return false;
            return this.top.equals(obj.top) &&
                this.right.equals(obj.right) &&
                this.left.equals(obj.left) &&
                this.bottom.equals(obj.bottom);
        };
        TableCellMargins.prototype.copyFrom = function (obj) {
            this.top = obj.top.clone();
            this.right = obj.right.clone();
            this.left = obj.left.clone();
            this.bottom = obj.bottom.clone();
        };
        TableCellMargins.prototype.clone = function () {
            var result = new TableCellMargins();
            result.copyFrom(this);
            return result;
        };
        TableCellMargins.create = function (top, right, bottom, left) {
            var result = new TableCellMargins();
            result.top = top;
            result.right = right;
            result.bottom = bottom;
            result.left = left;
            return result;
        };
        return TableCellMargins;
    }());
    __aspxRichEdit.TableCellMargins = TableCellMargins;
    var TableLayoutType;
    (function (TableLayoutType) {
        TableLayoutType[TableLayoutType["Fixed"] = 0] = "Fixed";
        TableLayoutType[TableLayoutType["Autofit"] = 1] = "Autofit";
    })(TableLayoutType = __aspxRichEdit.TableLayoutType || (__aspxRichEdit.TableLayoutType = {}));
    var TableLookTypes;
    (function (TableLookTypes) {
        TableLookTypes[TableLookTypes["None"] = 0] = "None";
        TableLookTypes[TableLookTypes["ApplyFirstRow"] = 32] = "ApplyFirstRow";
        TableLookTypes[TableLookTypes["ApplyLastRow"] = 64] = "ApplyLastRow";
        TableLookTypes[TableLookTypes["ApplyFirstColumn"] = 128] = "ApplyFirstColumn";
        TableLookTypes[TableLookTypes["ApplyLastColumn"] = 256] = "ApplyLastColumn";
        TableLookTypes[TableLookTypes["DoNotApplyRowBanding"] = 512] = "DoNotApplyRowBanding";
        TableLookTypes[TableLookTypes["DoNotApplyColumnBanding"] = 1024] = "DoNotApplyColumnBanding";
    })(TableLookTypes = __aspxRichEdit.TableLookTypes || (__aspxRichEdit.TableLookTypes = {}));
    var HorizontalAlignMode;
    (function (HorizontalAlignMode) {
        HorizontalAlignMode[HorizontalAlignMode["None"] = 0] = "None";
        HorizontalAlignMode[HorizontalAlignMode["Center"] = 1] = "Center";
        HorizontalAlignMode[HorizontalAlignMode["Inside"] = 2] = "Inside";
        HorizontalAlignMode[HorizontalAlignMode["Left"] = 3] = "Left";
        HorizontalAlignMode[HorizontalAlignMode["Outside"] = 4] = "Outside";
        HorizontalAlignMode[HorizontalAlignMode["Right"] = 5] = "Right";
    })(HorizontalAlignMode = __aspxRichEdit.HorizontalAlignMode || (__aspxRichEdit.HorizontalAlignMode = {}));
    var VerticalAlignMode;
    (function (VerticalAlignMode) {
        VerticalAlignMode[VerticalAlignMode["None"] = 0] = "None";
        VerticalAlignMode[VerticalAlignMode["Bottom"] = 1] = "Bottom";
        VerticalAlignMode[VerticalAlignMode["Center"] = 2] = "Center";
        VerticalAlignMode[VerticalAlignMode["Inline"] = 3] = "Inline";
        VerticalAlignMode[VerticalAlignMode["Inside"] = 4] = "Inside";
        VerticalAlignMode[VerticalAlignMode["Outside"] = 5] = "Outside";
        VerticalAlignMode[VerticalAlignMode["Top"] = 6] = "Top";
    })(VerticalAlignMode = __aspxRichEdit.VerticalAlignMode || (__aspxRichEdit.VerticalAlignMode = {}));
    var HorizontalAnchorTypes;
    (function (HorizontalAnchorTypes) {
        HorizontalAnchorTypes[HorizontalAnchorTypes["Margin"] = 0] = "Margin";
        HorizontalAnchorTypes[HorizontalAnchorTypes["Page"] = 1] = "Page";
        HorizontalAnchorTypes[HorizontalAnchorTypes["Column"] = 2] = "Column";
    })(HorizontalAnchorTypes = __aspxRichEdit.HorizontalAnchorTypes || (__aspxRichEdit.HorizontalAnchorTypes = {}));
    var VerticalAnchorTypes;
    (function (VerticalAnchorTypes) {
        VerticalAnchorTypes[VerticalAnchorTypes["Margin"] = 0] = "Margin";
        VerticalAnchorTypes[VerticalAnchorTypes["Page"] = 1] = "Page";
        VerticalAnchorTypes[VerticalAnchorTypes["Paragraph"] = 2] = "Paragraph";
    })(VerticalAnchorTypes = __aspxRichEdit.VerticalAnchorTypes || (__aspxRichEdit.VerticalAnchorTypes = {}));
    var TextWrapping;
    (function (TextWrapping) {
        TextWrapping[TextWrapping["Never"] = 0] = "Never";
        TextWrapping[TextWrapping["Around"] = 1] = "Around";
    })(TextWrapping = __aspxRichEdit.TextWrapping || (__aspxRichEdit.TextWrapping = {}));
    var TableRowAlignment;
    (function (TableRowAlignment) {
        TableRowAlignment[TableRowAlignment["Both"] = 0] = "Both";
        TableRowAlignment[TableRowAlignment["Center"] = 1] = "Center";
        TableRowAlignment[TableRowAlignment["Distribute"] = 2] = "Distribute";
        TableRowAlignment[TableRowAlignment["Left"] = 3] = "Left";
        TableRowAlignment[TableRowAlignment["NumTab"] = 4] = "NumTab";
        TableRowAlignment[TableRowAlignment["Right"] = 5] = "Right";
    })(TableRowAlignment = __aspxRichEdit.TableRowAlignment || (__aspxRichEdit.TableRowAlignment = {}));
    var TableCellMergingState;
    (function (TableCellMergingState) {
        TableCellMergingState[TableCellMergingState["None"] = 0] = "None";
        TableCellMergingState[TableCellMergingState["Continue"] = 1] = "Continue";
        TableCellMergingState[TableCellMergingState["Restart"] = 2] = "Restart";
    })(TableCellMergingState = __aspxRichEdit.TableCellMergingState || (__aspxRichEdit.TableCellMergingState = {}));
    var TextDirection;
    (function (TextDirection) {
        TextDirection[TextDirection["LeftToRightTopToBottom"] = 0] = "LeftToRightTopToBottom";
        TextDirection[TextDirection["TopToBottomRightToLeft"] = 1] = "TopToBottomRightToLeft";
        TextDirection[TextDirection["TopToBottomLeftToRightRotated"] = 2] = "TopToBottomLeftToRightRotated";
        TextDirection[TextDirection["BottomToTopLeftToRight"] = 3] = "BottomToTopLeftToRight";
        TextDirection[TextDirection["LeftToRightTopToBottomRotated"] = 4] = "LeftToRightTopToBottomRotated";
        TextDirection[TextDirection["TopToBottomRightToLeftRotated"] = 5] = "TopToBottomRightToLeftRotated";
    })(TextDirection = __aspxRichEdit.TextDirection || (__aspxRichEdit.TextDirection = {}));
    var TableCellVerticalAlignment;
    (function (TableCellVerticalAlignment) {
        TableCellVerticalAlignment[TableCellVerticalAlignment["Top"] = 0] = "Top";
        TableCellVerticalAlignment[TableCellVerticalAlignment["Both"] = 1] = "Both";
        TableCellVerticalAlignment[TableCellVerticalAlignment["Center"] = 2] = "Center";
        TableCellVerticalAlignment[TableCellVerticalAlignment["Bottom"] = 3] = "Bottom";
    })(TableCellVerticalAlignment = __aspxRichEdit.TableCellVerticalAlignment || (__aspxRichEdit.TableCellVerticalAlignment = {}));
    var ConditionalTableStyleFormatting;
    (function (ConditionalTableStyleFormatting) {
        ConditionalTableStyleFormatting[ConditionalTableStyleFormatting["WholeTable"] = 4096] = "WholeTable";
        ConditionalTableStyleFormatting[ConditionalTableStyleFormatting["FirstRow"] = 2048] = "FirstRow";
        ConditionalTableStyleFormatting[ConditionalTableStyleFormatting["LastRow"] = 1024] = "LastRow";
        ConditionalTableStyleFormatting[ConditionalTableStyleFormatting["FirstColumn"] = 512] = "FirstColumn";
        ConditionalTableStyleFormatting[ConditionalTableStyleFormatting["LastColumn"] = 256] = "LastColumn";
        ConditionalTableStyleFormatting[ConditionalTableStyleFormatting["OddColumnBanding"] = 128] = "OddColumnBanding";
        ConditionalTableStyleFormatting[ConditionalTableStyleFormatting["EvenColumnBanding"] = 64] = "EvenColumnBanding";
        ConditionalTableStyleFormatting[ConditionalTableStyleFormatting["OddRowBanding"] = 32] = "OddRowBanding";
        ConditionalTableStyleFormatting[ConditionalTableStyleFormatting["EvenRowBanding"] = 16] = "EvenRowBanding";
        ConditionalTableStyleFormatting[ConditionalTableStyleFormatting["TopRightCell"] = 8] = "TopRightCell";
        ConditionalTableStyleFormatting[ConditionalTableStyleFormatting["TopLeftCell"] = 4] = "TopLeftCell";
        ConditionalTableStyleFormatting[ConditionalTableStyleFormatting["BottomRightCell"] = 2] = "BottomRightCell";
        ConditionalTableStyleFormatting[ConditionalTableStyleFormatting["BottomLeftCell"] = 1] = "BottomLeftCell";
    })(ConditionalTableStyleFormatting = __aspxRichEdit.ConditionalTableStyleFormatting || (__aspxRichEdit.ConditionalTableStyleFormatting = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TablePropertiesMergerBase = (function () {
        function TablePropertiesMergerBase() {
        }
        TablePropertiesMergerBase.prototype.getProperty = function (container, style, condStyleFormattingFlags, defaultContainer) {
            if (this.getPropertyInternal(container))
                return this.result;
            if (this.processTablePropertiesException())
                return this.result;
            while (style) {
                var condStyleList = this.getCondTableStyleFormattingListForThisContainer();
                for (var _i = 0, condStyleList_1 = condStyleList; _i < condStyleList_1.length; _i++) {
                    var cond = condStyleList_1[_i];
                    if (condStyleFormattingFlags & cond) {
                        var condStyle = style.conditionalStyles[cond];
                        if (condStyle && this.getPropertyInternal(this.getContainerFromConditionalStyle(condStyle)))
                            return this.result;
                    }
                }
                var baseConditionalStyleContainer = this.getContainerFromConditionalStyle(style.baseConditionalStyle);
                if (baseConditionalStyleContainer && this.getPropertyInternal(baseConditionalStyleContainer))
                    return this.result;
                style = style.parent;
            }
            if (this.actionBeforeDefaultValue())
                return this.result;
            return this.getPropertyFromContainer(defaultContainer);
        };
        TablePropertiesMergerBase.prototype.processTablePropertiesException = function () {
            if (!this.tablePropertiesException)
                return false;
            var res = this.getNotMergedProperty();
            if (!res.isFound)
                return false;
            this.result = res.result;
            return true;
        };
        TablePropertiesMergerBase.prototype.getPropertyInternal = function (container) {
            if (!this.canUseValue(container))
                return false;
            this.result = this.getPropertyFromContainer(container);
            return true;
        };
        TablePropertiesMergerBase.prototype.actionBeforeDefaultValue = function () {
            return false;
        };
        return TablePropertiesMergerBase;
    }());
    __aspxRichEdit.TablePropertiesMergerBase = TablePropertiesMergerBase;
    var TableMergerNotMergedPropertyResult = (function () {
        function TableMergerNotMergedPropertyResult(isFound, result) {
            this.isFound = isFound;
            this.result = result;
        }
        return TableMergerNotMergedPropertyResult;
    }());
    __aspxRichEdit.TableMergerNotMergedPropertyResult = TableMergerNotMergedPropertyResult;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TablePropertiesAvoidDoubleBordersDescriptor = (function () {
        function TablePropertiesAvoidDoubleBordersDescriptor() {
        }
        TablePropertiesAvoidDoubleBordersDescriptor.prototype.setProp = function (props, newValue) {
            props.avoidDoubleBorders = newValue;
        };
        TablePropertiesAvoidDoubleBordersDescriptor.prototype.getProp = function (props) {
            return props.avoidDoubleBorders;
        };
        TablePropertiesAvoidDoubleBordersDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TablePropertiesMask.UseAvoidDoubleBorders;
        };
        return TablePropertiesAvoidDoubleBordersDescriptor;
    }());
    __aspxRichEdit.TablePropertiesAvoidDoubleBordersDescriptor = TablePropertiesAvoidDoubleBordersDescriptor;
    var TablePropertiesTopBorderDescriptor = (function () {
        function TablePropertiesTopBorderDescriptor() {
        }
        TablePropertiesTopBorderDescriptor.prototype.setProp = function (props, newValue) {
            props.borders.topBorder = newValue;
        };
        TablePropertiesTopBorderDescriptor.prototype.getProp = function (props) {
            return props.borders.topBorder;
        };
        TablePropertiesTopBorderDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TablePropertiesMask.UseTopBorder;
        };
        return TablePropertiesTopBorderDescriptor;
    }());
    __aspxRichEdit.TablePropertiesTopBorderDescriptor = TablePropertiesTopBorderDescriptor;
    var TablePropertiesRightBorderDescriptor = (function () {
        function TablePropertiesRightBorderDescriptor() {
        }
        TablePropertiesRightBorderDescriptor.prototype.setProp = function (props, newValue) {
            props.borders.rightBorder = newValue;
        };
        TablePropertiesRightBorderDescriptor.prototype.getProp = function (props) {
            return props.borders.rightBorder;
        };
        TablePropertiesRightBorderDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TablePropertiesMask.UseRightBorder;
        };
        return TablePropertiesRightBorderDescriptor;
    }());
    __aspxRichEdit.TablePropertiesRightBorderDescriptor = TablePropertiesRightBorderDescriptor;
    var TablePropertiesBottomBorderDescriptor = (function () {
        function TablePropertiesBottomBorderDescriptor() {
        }
        TablePropertiesBottomBorderDescriptor.prototype.setProp = function (props, newValue) {
            props.borders.bottomBorder = newValue;
        };
        TablePropertiesBottomBorderDescriptor.prototype.getProp = function (props) {
            return props.borders.bottomBorder;
        };
        TablePropertiesBottomBorderDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TablePropertiesMask.UseBottomBorder;
        };
        return TablePropertiesBottomBorderDescriptor;
    }());
    __aspxRichEdit.TablePropertiesBottomBorderDescriptor = TablePropertiesBottomBorderDescriptor;
    var TablePropertiesLeftBorderDescriptor = (function () {
        function TablePropertiesLeftBorderDescriptor() {
        }
        TablePropertiesLeftBorderDescriptor.prototype.setProp = function (props, newValue) {
            props.borders.leftBorder = newValue;
        };
        TablePropertiesLeftBorderDescriptor.prototype.getProp = function (props) {
            return props.borders.leftBorder;
        };
        TablePropertiesLeftBorderDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TablePropertiesMask.UseLeftBorder;
        };
        return TablePropertiesLeftBorderDescriptor;
    }());
    __aspxRichEdit.TablePropertiesLeftBorderDescriptor = TablePropertiesLeftBorderDescriptor;
    var TablePropertiesInsideHorizontalBorderDescriptor = (function () {
        function TablePropertiesInsideHorizontalBorderDescriptor() {
        }
        TablePropertiesInsideHorizontalBorderDescriptor.prototype.setProp = function (props, newValue) {
            props.borders.insideHorizontalBorder = newValue;
        };
        TablePropertiesInsideHorizontalBorderDescriptor.prototype.getProp = function (props) {
            return props.borders.insideHorizontalBorder;
        };
        TablePropertiesInsideHorizontalBorderDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TablePropertiesMask.UseInsideHorizontalBorder;
        };
        return TablePropertiesInsideHorizontalBorderDescriptor;
    }());
    __aspxRichEdit.TablePropertiesInsideHorizontalBorderDescriptor = TablePropertiesInsideHorizontalBorderDescriptor;
    var TablePropertiesInsideVerticalBorderDescriptor = (function () {
        function TablePropertiesInsideVerticalBorderDescriptor() {
        }
        TablePropertiesInsideVerticalBorderDescriptor.prototype.setProp = function (props, newValue) {
            props.borders.insideVerticalBorder = newValue;
        };
        TablePropertiesInsideVerticalBorderDescriptor.prototype.getProp = function (props) {
            return props.borders.insideVerticalBorder;
        };
        TablePropertiesInsideVerticalBorderDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TablePropertiesMask.UseInsideVerticalBorder;
        };
        return TablePropertiesInsideVerticalBorderDescriptor;
    }());
    __aspxRichEdit.TablePropertiesInsideVerticalBorderDescriptor = TablePropertiesInsideVerticalBorderDescriptor;
    var TablePropertiesTopMarginDescriptor = (function () {
        function TablePropertiesTopMarginDescriptor() {
        }
        TablePropertiesTopMarginDescriptor.prototype.setProp = function (props, newValue) {
            props.cellMargins.top = newValue;
        };
        TablePropertiesTopMarginDescriptor.prototype.getProp = function (props) {
            return props.cellMargins.top;
        };
        TablePropertiesTopMarginDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TablePropertiesMask.UseTopMargin;
        };
        return TablePropertiesTopMarginDescriptor;
    }());
    __aspxRichEdit.TablePropertiesTopMarginDescriptor = TablePropertiesTopMarginDescriptor;
    var TablePropertiesRightMarginDescriptor = (function () {
        function TablePropertiesRightMarginDescriptor() {
        }
        TablePropertiesRightMarginDescriptor.prototype.setProp = function (props, newValue) {
            props.cellMargins.right = newValue;
        };
        TablePropertiesRightMarginDescriptor.prototype.getProp = function (props) {
            return props.cellMargins.right;
        };
        TablePropertiesRightMarginDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TablePropertiesMask.UseRightMargin;
        };
        return TablePropertiesRightMarginDescriptor;
    }());
    __aspxRichEdit.TablePropertiesRightMarginDescriptor = TablePropertiesRightMarginDescriptor;
    var TablePropertiesBottomMarginDescriptor = (function () {
        function TablePropertiesBottomMarginDescriptor() {
        }
        TablePropertiesBottomMarginDescriptor.prototype.setProp = function (props, newValue) {
            props.cellMargins.bottom = newValue;
        };
        TablePropertiesBottomMarginDescriptor.prototype.getProp = function (props) {
            return props.cellMargins.bottom;
        };
        TablePropertiesBottomMarginDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TablePropertiesMask.UseBottomMargin;
        };
        return TablePropertiesBottomMarginDescriptor;
    }());
    __aspxRichEdit.TablePropertiesBottomMarginDescriptor = TablePropertiesBottomMarginDescriptor;
    var TablePropertiesLeftMarginDescriptor = (function () {
        function TablePropertiesLeftMarginDescriptor() {
        }
        TablePropertiesLeftMarginDescriptor.prototype.setProp = function (props, newValue) {
            props.cellMargins.left = newValue;
        };
        TablePropertiesLeftMarginDescriptor.prototype.getProp = function (props) {
            return props.cellMargins.left;
        };
        TablePropertiesLeftMarginDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TablePropertiesMask.UseLeftMargin;
        };
        return TablePropertiesLeftMarginDescriptor;
    }());
    __aspxRichEdit.TablePropertiesLeftMarginDescriptor = TablePropertiesLeftMarginDescriptor;
    var TablePropertiesCellSpacingDescriptor = (function () {
        function TablePropertiesCellSpacingDescriptor() {
        }
        TablePropertiesCellSpacingDescriptor.prototype.setProp = function (props, newValue) {
            props.cellSpacing = newValue;
        };
        TablePropertiesCellSpacingDescriptor.prototype.getProp = function (props) {
            return props.cellSpacing;
        };
        TablePropertiesCellSpacingDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TablePropertiesMask.UseCellSpacing;
        };
        return TablePropertiesCellSpacingDescriptor;
    }());
    __aspxRichEdit.TablePropertiesCellSpacingDescriptor = TablePropertiesCellSpacingDescriptor;
    var TablePropertiesIndentDescriptor = (function () {
        function TablePropertiesIndentDescriptor() {
        }
        TablePropertiesIndentDescriptor.prototype.setProp = function (props, newValue) {
            props.indent = newValue;
        };
        TablePropertiesIndentDescriptor.prototype.getProp = function (props) {
            return props.indent;
        };
        TablePropertiesIndentDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TablePropertiesMask.UseTableIndent;
        };
        return TablePropertiesIndentDescriptor;
    }());
    __aspxRichEdit.TablePropertiesIndentDescriptor = TablePropertiesIndentDescriptor;
    var TablePropertiesLayoutTypeDescriptor = (function () {
        function TablePropertiesLayoutTypeDescriptor() {
        }
        TablePropertiesLayoutTypeDescriptor.prototype.setProp = function (props, newValue) {
            props.layoutType = newValue;
        };
        TablePropertiesLayoutTypeDescriptor.prototype.getProp = function (props) {
            return props.layoutType;
        };
        TablePropertiesLayoutTypeDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TablePropertiesMask.UseTableLayout;
        };
        return TablePropertiesLayoutTypeDescriptor;
    }());
    __aspxRichEdit.TablePropertiesLayoutTypeDescriptor = TablePropertiesLayoutTypeDescriptor;
    var TablePropertiesShadingInfoDescriptor = (function () {
        function TablePropertiesShadingInfoDescriptor() {
        }
        TablePropertiesShadingInfoDescriptor.prototype.setProp = function (props, newValue) {
            props.shadingInfo = newValue;
        };
        TablePropertiesShadingInfoDescriptor.prototype.getProp = function (props) {
            return props.shadingInfo;
        };
        TablePropertiesShadingInfoDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TablePropertiesMask.UseShadingInfoIndex;
        };
        return TablePropertiesShadingInfoDescriptor;
    }());
    __aspxRichEdit.TablePropertiesShadingInfoDescriptor = TablePropertiesShadingInfoDescriptor;
    var TablePropertiesRowAlignmentDescriptor = (function () {
        function TablePropertiesRowAlignmentDescriptor() {
        }
        TablePropertiesRowAlignmentDescriptor.prototype.setProp = function (props, newValue) {
            props.tableRowAlignment = newValue;
        };
        TablePropertiesRowAlignmentDescriptor.prototype.getProp = function (props) {
            return props.tableRowAlignment;
        };
        TablePropertiesRowAlignmentDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TablePropertiesMask.UseTableAlignment;
        };
        return TablePropertiesRowAlignmentDescriptor;
    }());
    __aspxRichEdit.TablePropertiesRowAlignmentDescriptor = TablePropertiesRowAlignmentDescriptor;
    var TablePropertiesStyleColumnBandSizeDescriptor = (function () {
        function TablePropertiesStyleColumnBandSizeDescriptor() {
        }
        TablePropertiesStyleColumnBandSizeDescriptor.prototype.setProp = function (props, newValue) {
            props.tableStyleColumnBandSize = newValue;
        };
        TablePropertiesStyleColumnBandSizeDescriptor.prototype.getProp = function (props) {
            return props.tableStyleColumnBandSize;
        };
        TablePropertiesStyleColumnBandSizeDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TablePropertiesMask.UseTableStyleColBandSize;
        };
        return TablePropertiesStyleColumnBandSizeDescriptor;
    }());
    __aspxRichEdit.TablePropertiesStyleColumnBandSizeDescriptor = TablePropertiesStyleColumnBandSizeDescriptor;
    var TablePropertiesStyleRowBandSizeDescriptor = (function () {
        function TablePropertiesStyleRowBandSizeDescriptor() {
        }
        TablePropertiesStyleRowBandSizeDescriptor.prototype.setProp = function (props, newValue) {
            props.tableStyleRowBandSize = newValue;
        };
        TablePropertiesStyleRowBandSizeDescriptor.prototype.getProp = function (props) {
            return props.tableStyleRowBandSize;
        };
        TablePropertiesStyleRowBandSizeDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TablePropertiesMask.UseTableStyleRowBandSize;
        };
        return TablePropertiesStyleRowBandSizeDescriptor;
    }());
    __aspxRichEdit.TablePropertiesStyleRowBandSizeDescriptor = TablePropertiesStyleRowBandSizeDescriptor;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableRowPropertiesCantSplitDescriptor = (function () {
        function TableRowPropertiesCantSplitDescriptor() {
        }
        TableRowPropertiesCantSplitDescriptor.prototype.setProp = function (props, newValue) {
            props.cantSplit = newValue;
        };
        TableRowPropertiesCantSplitDescriptor.prototype.getProp = function (props) {
            return props.cantSplit;
        };
        TableRowPropertiesCantSplitDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TableRowPropertiesMask.UseCantSplit;
        };
        return TableRowPropertiesCantSplitDescriptor;
    }());
    __aspxRichEdit.TableRowPropertiesCantSplitDescriptor = TableRowPropertiesCantSplitDescriptor;
    var TableRowPropertiesCellSpacingDescriptor = (function () {
        function TableRowPropertiesCellSpacingDescriptor() {
        }
        TableRowPropertiesCellSpacingDescriptor.prototype.setProp = function (props, newValue) {
            props.cellSpacing = newValue;
        };
        TableRowPropertiesCellSpacingDescriptor.prototype.getProp = function (props) {
            return props.cellSpacing;
        };
        TableRowPropertiesCellSpacingDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TableRowPropertiesMask.UseCellSpacing;
        };
        return TableRowPropertiesCellSpacingDescriptor;
    }());
    __aspxRichEdit.TableRowPropertiesCellSpacingDescriptor = TableRowPropertiesCellSpacingDescriptor;
    var TableRowPropertiesDivIdDescriptor = (function () {
        function TableRowPropertiesDivIdDescriptor() {
        }
        TableRowPropertiesDivIdDescriptor.prototype.setProp = function (props, newValue) {
            props.divId = newValue;
        };
        TableRowPropertiesDivIdDescriptor.prototype.getProp = function (props) {
            return props.divId;
        };
        TableRowPropertiesDivIdDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TableRowPropertiesMask.UseDivId;
        };
        return TableRowPropertiesDivIdDescriptor;
    }());
    __aspxRichEdit.TableRowPropertiesDivIdDescriptor = TableRowPropertiesDivIdDescriptor;
    var TableRowPropertiesHeaderDescriptor = (function () {
        function TableRowPropertiesHeaderDescriptor() {
        }
        TableRowPropertiesHeaderDescriptor.prototype.setProp = function (props, newValue) {
            props.header = newValue;
        };
        TableRowPropertiesHeaderDescriptor.prototype.getProp = function (props) {
            return props.header;
        };
        TableRowPropertiesHeaderDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TableRowPropertiesMask.UseHeader;
        };
        return TableRowPropertiesHeaderDescriptor;
    }());
    __aspxRichEdit.TableRowPropertiesHeaderDescriptor = TableRowPropertiesHeaderDescriptor;
    var TableRowPropertiesHideCellMarkDescriptor = (function () {
        function TableRowPropertiesHideCellMarkDescriptor() {
        }
        TableRowPropertiesHideCellMarkDescriptor.prototype.setProp = function (props, newValue) {
            props.hideCellMark = newValue;
        };
        TableRowPropertiesHideCellMarkDescriptor.prototype.getProp = function (props) {
            return props.hideCellMark;
        };
        TableRowPropertiesHideCellMarkDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TableRowPropertiesMask.UseHideCellMark;
        };
        return TableRowPropertiesHideCellMarkDescriptor;
    }());
    __aspxRichEdit.TableRowPropertiesHideCellMarkDescriptor = TableRowPropertiesHideCellMarkDescriptor;
    var TableRowPropertiesRowAlignmentDescriptor = (function () {
        function TableRowPropertiesRowAlignmentDescriptor() {
        }
        TableRowPropertiesRowAlignmentDescriptor.prototype.setProp = function (props, newValue) {
            props.tableRowAlignment = newValue;
        };
        TableRowPropertiesRowAlignmentDescriptor.prototype.getProp = function (props) {
            return props.tableRowAlignment;
        };
        TableRowPropertiesRowAlignmentDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TableRowPropertiesMask.UseTableRowAlignment;
        };
        return TableRowPropertiesRowAlignmentDescriptor;
    }());
    __aspxRichEdit.TableRowPropertiesRowAlignmentDescriptor = TableRowPropertiesRowAlignmentDescriptor;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableCellPropertiesTopBorderDescriptor = (function () {
        function TableCellPropertiesTopBorderDescriptor() {
        }
        TableCellPropertiesTopBorderDescriptor.prototype.setProp = function (props, newValue) {
            props.borders.topBorder = newValue;
        };
        TableCellPropertiesTopBorderDescriptor.prototype.getProp = function (props) {
            return props.borders.topBorder;
        };
        TableCellPropertiesTopBorderDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseTopBorder;
        };
        return TableCellPropertiesTopBorderDescriptor;
    }());
    __aspxRichEdit.TableCellPropertiesTopBorderDescriptor = TableCellPropertiesTopBorderDescriptor;
    var TableCellPropertiesRightBorderDescriptor = (function () {
        function TableCellPropertiesRightBorderDescriptor() {
        }
        TableCellPropertiesRightBorderDescriptor.prototype.setProp = function (props, newValue) {
            props.borders.rightBorder = newValue;
        };
        TableCellPropertiesRightBorderDescriptor.prototype.getProp = function (props) {
            return props.borders.rightBorder;
        };
        TableCellPropertiesRightBorderDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseRightBorder;
        };
        return TableCellPropertiesRightBorderDescriptor;
    }());
    __aspxRichEdit.TableCellPropertiesRightBorderDescriptor = TableCellPropertiesRightBorderDescriptor;
    var TableCellPropertiesBottomBorderDescriptor = (function () {
        function TableCellPropertiesBottomBorderDescriptor() {
        }
        TableCellPropertiesBottomBorderDescriptor.prototype.setProp = function (props, newValue) {
            props.borders.bottomBorder = newValue;
        };
        TableCellPropertiesBottomBorderDescriptor.prototype.getProp = function (props) {
            return props.borders.bottomBorder;
        };
        TableCellPropertiesBottomBorderDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseBottomBorder;
        };
        return TableCellPropertiesBottomBorderDescriptor;
    }());
    __aspxRichEdit.TableCellPropertiesBottomBorderDescriptor = TableCellPropertiesBottomBorderDescriptor;
    var TableCellPropertiesLeftBorderDescriptor = (function () {
        function TableCellPropertiesLeftBorderDescriptor() {
        }
        TableCellPropertiesLeftBorderDescriptor.prototype.setProp = function (props, newValue) {
            props.borders.leftBorder = newValue;
        };
        TableCellPropertiesLeftBorderDescriptor.prototype.getProp = function (props) {
            return props.borders.leftBorder;
        };
        TableCellPropertiesLeftBorderDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseLeftBorder;
        };
        return TableCellPropertiesLeftBorderDescriptor;
    }());
    __aspxRichEdit.TableCellPropertiesLeftBorderDescriptor = TableCellPropertiesLeftBorderDescriptor;
    var TableCellPropertiesTopLeftDiagonalBorderDescriptor = (function () {
        function TableCellPropertiesTopLeftDiagonalBorderDescriptor() {
        }
        TableCellPropertiesTopLeftDiagonalBorderDescriptor.prototype.setProp = function (props, newValue) {
            props.borders.topLeftDiagonalBorder = newValue;
        };
        TableCellPropertiesTopLeftDiagonalBorderDescriptor.prototype.getProp = function (props) {
            return props.borders.topLeftDiagonalBorder;
        };
        TableCellPropertiesTopLeftDiagonalBorderDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseTopLeftDiagonalBorder;
        };
        return TableCellPropertiesTopLeftDiagonalBorderDescriptor;
    }());
    __aspxRichEdit.TableCellPropertiesTopLeftDiagonalBorderDescriptor = TableCellPropertiesTopLeftDiagonalBorderDescriptor;
    var TableCellPropertiesTopRightDiagonalBorderDescriptor = (function () {
        function TableCellPropertiesTopRightDiagonalBorderDescriptor() {
        }
        TableCellPropertiesTopRightDiagonalBorderDescriptor.prototype.setProp = function (props, newValue) {
            props.borders.topRightDiagonalBorder = newValue;
        };
        TableCellPropertiesTopRightDiagonalBorderDescriptor.prototype.getProp = function (props) {
            return props.borders.topRightDiagonalBorder;
        };
        TableCellPropertiesTopRightDiagonalBorderDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseTopRightDiagonalBorder;
        };
        return TableCellPropertiesTopRightDiagonalBorderDescriptor;
    }());
    __aspxRichEdit.TableCellPropertiesTopRightDiagonalBorderDescriptor = TableCellPropertiesTopRightDiagonalBorderDescriptor;
    var TableCellPropertiesTopMarginDescriptor = (function () {
        function TableCellPropertiesTopMarginDescriptor() {
        }
        TableCellPropertiesTopMarginDescriptor.prototype.setProp = function (props, newValue) {
            props.cellMargins.top = newValue;
        };
        TableCellPropertiesTopMarginDescriptor.prototype.getProp = function (props) {
            return props.cellMargins.top;
        };
        TableCellPropertiesTopMarginDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseTopMargin;
        };
        return TableCellPropertiesTopMarginDescriptor;
    }());
    __aspxRichEdit.TableCellPropertiesTopMarginDescriptor = TableCellPropertiesTopMarginDescriptor;
    var TableCellPropertiesRightMarginDescriptor = (function () {
        function TableCellPropertiesRightMarginDescriptor() {
        }
        TableCellPropertiesRightMarginDescriptor.prototype.setProp = function (props, newValue) {
            props.cellMargins.right = newValue;
        };
        TableCellPropertiesRightMarginDescriptor.prototype.getProp = function (props) {
            return props.cellMargins.right;
        };
        TableCellPropertiesRightMarginDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseRightMargin;
        };
        return TableCellPropertiesRightMarginDescriptor;
    }());
    __aspxRichEdit.TableCellPropertiesRightMarginDescriptor = TableCellPropertiesRightMarginDescriptor;
    var TableCellPropertiesBottomMarginDescriptor = (function () {
        function TableCellPropertiesBottomMarginDescriptor() {
        }
        TableCellPropertiesBottomMarginDescriptor.prototype.setProp = function (props, newValue) {
            props.cellMargins.bottom = newValue;
        };
        TableCellPropertiesBottomMarginDescriptor.prototype.getProp = function (props) {
            return props.cellMargins.bottom;
        };
        TableCellPropertiesBottomMarginDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseBottomMargin;
        };
        return TableCellPropertiesBottomMarginDescriptor;
    }());
    __aspxRichEdit.TableCellPropertiesBottomMarginDescriptor = TableCellPropertiesBottomMarginDescriptor;
    var TableCellPropertiesLeftMarginDescriptor = (function () {
        function TableCellPropertiesLeftMarginDescriptor() {
        }
        TableCellPropertiesLeftMarginDescriptor.prototype.setProp = function (props, newValue) {
            props.cellMargins.left = newValue;
        };
        TableCellPropertiesLeftMarginDescriptor.prototype.getProp = function (props) {
            return props.cellMargins.left;
        };
        TableCellPropertiesLeftMarginDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseLeftMargin;
        };
        return TableCellPropertiesLeftMarginDescriptor;
    }());
    __aspxRichEdit.TableCellPropertiesLeftMarginDescriptor = TableCellPropertiesLeftMarginDescriptor;
    var TableCellPropertiesFitTextDescriptor = (function () {
        function TableCellPropertiesFitTextDescriptor() {
        }
        TableCellPropertiesFitTextDescriptor.prototype.setProp = function (props, newValue) {
            props.fitText = newValue;
        };
        TableCellPropertiesFitTextDescriptor.prototype.getProp = function (props) {
            return props.fitText;
        };
        TableCellPropertiesFitTextDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseFitText;
        };
        return TableCellPropertiesFitTextDescriptor;
    }());
    __aspxRichEdit.TableCellPropertiesFitTextDescriptor = TableCellPropertiesFitTextDescriptor;
    var TableCellPropertiesHideCellMarkDescriptor = (function () {
        function TableCellPropertiesHideCellMarkDescriptor() {
        }
        TableCellPropertiesHideCellMarkDescriptor.prototype.setProp = function (props, newValue) {
            props.hideCellMark = newValue;
        };
        TableCellPropertiesHideCellMarkDescriptor.prototype.getProp = function (props) {
            return props.hideCellMark;
        };
        TableCellPropertiesHideCellMarkDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseHideCellMark;
        };
        return TableCellPropertiesHideCellMarkDescriptor;
    }());
    __aspxRichEdit.TableCellPropertiesHideCellMarkDescriptor = TableCellPropertiesHideCellMarkDescriptor;
    var TableCellPropertiesNoWrapDescriptor = (function () {
        function TableCellPropertiesNoWrapDescriptor() {
        }
        TableCellPropertiesNoWrapDescriptor.prototype.setProp = function (props, newValue) {
            props.noWrap = newValue;
        };
        TableCellPropertiesNoWrapDescriptor.prototype.getProp = function (props) {
            return props.noWrap;
        };
        TableCellPropertiesNoWrapDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseNoWrap;
        };
        return TableCellPropertiesNoWrapDescriptor;
    }());
    __aspxRichEdit.TableCellPropertiesNoWrapDescriptor = TableCellPropertiesNoWrapDescriptor;
    var TableCellPropertiesShadingInfoDescriptor = (function () {
        function TableCellPropertiesShadingInfoDescriptor() {
        }
        TableCellPropertiesShadingInfoDescriptor.prototype.setProp = function (props, newValue) {
            props.shadingInfo = newValue;
        };
        TableCellPropertiesShadingInfoDescriptor.prototype.getProp = function (props) {
            return props.shadingInfo;
        };
        TableCellPropertiesShadingInfoDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseShadingInfoIndex;
        };
        return TableCellPropertiesShadingInfoDescriptor;
    }());
    __aspxRichEdit.TableCellPropertiesShadingInfoDescriptor = TableCellPropertiesShadingInfoDescriptor;
    var TableCellPropertiesTextDirectionDescriptor = (function () {
        function TableCellPropertiesTextDirectionDescriptor() {
        }
        TableCellPropertiesTextDirectionDescriptor.prototype.setProp = function (props, newValue) {
            props.textDirection = newValue;
        };
        TableCellPropertiesTextDirectionDescriptor.prototype.getProp = function (props) {
            return props.textDirection;
        };
        TableCellPropertiesTextDirectionDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseTextDirection;
        };
        return TableCellPropertiesTextDirectionDescriptor;
    }());
    __aspxRichEdit.TableCellPropertiesTextDirectionDescriptor = TableCellPropertiesTextDirectionDescriptor;
    var TableCellPropertiesVerticalAlignmentDescriptor = (function () {
        function TableCellPropertiesVerticalAlignmentDescriptor() {
        }
        TableCellPropertiesVerticalAlignmentDescriptor.prototype.setProp = function (props, newValue) {
            props.verticalAlignment = newValue;
        };
        TableCellPropertiesVerticalAlignmentDescriptor.prototype.getProp = function (props) {
            return props.verticalAlignment;
        };
        TableCellPropertiesVerticalAlignmentDescriptor.prototype.maskValue = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseVerticalAlignment;
        };
        return TableCellPropertiesVerticalAlignmentDescriptor;
    }());
    __aspxRichEdit.TableCellPropertiesVerticalAlignmentDescriptor = TableCellPropertiesVerticalAlignmentDescriptor;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ModelIterator = (function (_super) {
        __extends(ModelIterator, _super);
        function ModelIterator(subDocument, ignoreHiddenRuns) {
            var _this = _super.call(this, -1, null, -1, null, 0) || this;
            _this.subDocument = subDocument;
            _this.chunks = subDocument.chunks;
            _this.ignoreHiddenRuns = ignoreHiddenRuns;
            return _this;
        }
        ModelIterator.prototype.setPositionByFullRunInfo = function (runInfo) {
            if (this.run && this.getAbsolutePosition() == runInfo.getAbsolutePosition())
                return;
            this.chunkIndex = runInfo.chunkIndex;
            this.chunk = runInfo.chunk;
            this.runs = this.chunk.textRuns;
            this.runIndex = runInfo.runIndex;
            this.run = runInfo.run;
            this.charOffset = runInfo.charOffset;
            if (this.ignoreHiddenRuns && this.run.getCharacterMergedProperies().hidden)
                this.moveToNextRun();
        };
        ModelIterator.prototype.setPosition = function (pos) {
            if (this.run && this.getAbsolutePosition() == pos)
                return;
            this.chunkIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.chunks, function (c) { return c.startLogPosition.value; }, pos);
            this.chunk = this.chunks[this.chunkIndex];
            var runOffset = pos - this.chunk.startLogPosition.value;
            this.runs = this.chunk.textRuns;
            this.runIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.runs, function (r) { return r.startOffset; }, runOffset);
            this.run = this.runs[this.runIndex];
            this.charOffset = runOffset - this.run.startOffset;
            if (this.ignoreHiddenRuns && this.run.getCharacterMergedProperies().hidden)
                this.moveToNextRun();
        };
        ModelIterator.prototype.moveToNextChar = function () {
            if (this.charOffset + 1 < this.run.getLength()) {
                this.charOffset++;
                return true;
            }
            return this.moveToNextRun();
        };
        ModelIterator.prototype.moveToPrevChar = function () {
            if (this.charOffset > 0) {
                this.charOffset--;
                return true;
            }
            return this.moveToPrevRun();
        };
        ModelIterator.prototype.moveToNextRun = function () {
            if (this.runIndex + 1 < this.runs.length) {
                this.charOffset = 0;
                this.runIndex++;
                this.run = this.runs[this.runIndex];
                if (this.ignoreHiddenRuns && this.run.getCharacterMergedProperies().hidden)
                    return this.moveToNextRun();
                return true;
            }
            if (this.chunkIndex + 1 < this.chunks.length) {
                this.charOffset = 0;
                this.runIndex = 0;
                this.chunkIndex++;
                this.chunk = this.chunks[this.chunkIndex];
                this.runs = this.chunk.textRuns;
                this.run = this.runs[this.runIndex];
                if (this.ignoreHiddenRuns && this.run.getCharacterMergedProperies().hidden)
                    return this.moveToNextRun();
                return true;
            }
            return false;
        };
        ModelIterator.prototype.moveToPrevRun = function () {
            if (this.runIndex > 0) {
                this.runIndex--;
                this.run = this.runs[this.runIndex];
                this.charOffset = this.run.getLength() - 1;
                if (this.ignoreHiddenRuns && this.run.getCharacterMergedProperies().hidden)
                    return this.moveToPrevRun();
                return true;
            }
            if (this.chunkIndex > 0) {
                this.chunkIndex--;
                this.chunk = this.chunks[this.chunkIndex];
                this.runs = this.chunk.textRuns;
                this.runIndex = this.runs.length - 1;
                this.run = this.runs[this.runIndex];
                this.charOffset = this.run.getLength() - 1;
                if (this.ignoreHiddenRuns && this.run.getCharacterMergedProperies().hidden)
                    return this.moveToPrevRun();
                return true;
            }
            return false;
        };
        ModelIterator.prototype.clone = function () {
            var newIterator = new ModelIterator(this.subDocument, this.ignoreHiddenRuns);
            newIterator.chunks = this.chunks;
            newIterator.chunk = this.chunk;
            newIterator.chunkIndex = this.chunkIndex;
            newIterator.runs = this.runs;
            newIterator.run = this.run;
            newIterator.runIndex = this.runIndex;
            newIterator.charOffset = this.charOffset;
            return newIterator;
        };
        return ModelIterator;
    }(__aspxRichEdit.FullChunkAndRunInfo));
    __aspxRichEdit.ModelIterator = ModelIterator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RelativeWidthType;
    (function (RelativeWidthType) {
        RelativeWidthType[RelativeWidthType["Margin"] = 0] = "Margin";
        RelativeWidthType[RelativeWidthType["Page"] = 1] = "Page";
        RelativeWidthType[RelativeWidthType["LeftMargin"] = 2] = "LeftMargin";
        RelativeWidthType[RelativeWidthType["RightMargin"] = 3] = "RightMargin";
        RelativeWidthType[RelativeWidthType["InsideMargin"] = 4] = "InsideMargin";
        RelativeWidthType[RelativeWidthType["OutsideMargin"] = 5] = "OutsideMargin";
    })(RelativeWidthType = __aspxRichEdit.RelativeWidthType || (__aspxRichEdit.RelativeWidthType = {}));
    var RelativeHeightType;
    (function (RelativeHeightType) {
        RelativeHeightType[RelativeHeightType["Margin"] = 0] = "Margin";
        RelativeHeightType[RelativeHeightType["Page"] = 1] = "Page";
        RelativeHeightType[RelativeHeightType["TopMargin"] = 2] = "TopMargin";
        RelativeHeightType[RelativeHeightType["BottomMargin"] = 3] = "BottomMargin";
        RelativeHeightType[RelativeHeightType["InsideMargin"] = 4] = "InsideMargin";
        RelativeHeightType[RelativeHeightType["OutsideMargin"] = 5] = "OutsideMargin";
    })(RelativeHeightType = __aspxRichEdit.RelativeHeightType || (__aspxRichEdit.RelativeHeightType = {}));
    var AnchorObjectTextWrapType;
    (function (AnchorObjectTextWrapType) {
        AnchorObjectTextWrapType[AnchorObjectTextWrapType["None"] = 0] = "None";
        AnchorObjectTextWrapType[AnchorObjectTextWrapType["TopAndBottom"] = 1] = "TopAndBottom";
        AnchorObjectTextWrapType[AnchorObjectTextWrapType["Tight"] = 2] = "Tight";
        AnchorObjectTextWrapType[AnchorObjectTextWrapType["Through"] = 3] = "Through";
        AnchorObjectTextWrapType[AnchorObjectTextWrapType["Square"] = 4] = "Square";
    })(AnchorObjectTextWrapType = __aspxRichEdit.AnchorObjectTextWrapType || (__aspxRichEdit.AnchorObjectTextWrapType = {}));
    var AnchorObjectTextWrapSide;
    (function (AnchorObjectTextWrapSide) {
        AnchorObjectTextWrapSide[AnchorObjectTextWrapSide["Both"] = 0] = "Both";
        AnchorObjectTextWrapSide[AnchorObjectTextWrapSide["Left"] = 1] = "Left";
        AnchorObjectTextWrapSide[AnchorObjectTextWrapSide["Right"] = 2] = "Right";
        AnchorObjectTextWrapSide[AnchorObjectTextWrapSide["Largest"] = 3] = "Largest";
    })(AnchorObjectTextWrapSide = __aspxRichEdit.AnchorObjectTextWrapSide || (__aspxRichEdit.AnchorObjectTextWrapSide = {}));
    var AnchorObjectHorizontalPositionType;
    (function (AnchorObjectHorizontalPositionType) {
        AnchorObjectHorizontalPositionType[AnchorObjectHorizontalPositionType["Page"] = 0] = "Page";
        AnchorObjectHorizontalPositionType[AnchorObjectHorizontalPositionType["Character"] = 1] = "Character";
        AnchorObjectHorizontalPositionType[AnchorObjectHorizontalPositionType["Column"] = 2] = "Column";
        AnchorObjectHorizontalPositionType[AnchorObjectHorizontalPositionType["Margin"] = 3] = "Margin";
        AnchorObjectHorizontalPositionType[AnchorObjectHorizontalPositionType["LeftMargin"] = 4] = "LeftMargin";
        AnchorObjectHorizontalPositionType[AnchorObjectHorizontalPositionType["RightMargin"] = 5] = "RightMargin";
        AnchorObjectHorizontalPositionType[AnchorObjectHorizontalPositionType["InsideMargin"] = 6] = "InsideMargin";
        AnchorObjectHorizontalPositionType[AnchorObjectHorizontalPositionType["OutsideMargin"] = 7] = "OutsideMargin";
    })(AnchorObjectHorizontalPositionType = __aspxRichEdit.AnchorObjectHorizontalPositionType || (__aspxRichEdit.AnchorObjectHorizontalPositionType = {}));
    var AnchorObjectHorizontalPositionAlignment;
    (function (AnchorObjectHorizontalPositionAlignment) {
        AnchorObjectHorizontalPositionAlignment[AnchorObjectHorizontalPositionAlignment["None"] = 0] = "None";
        AnchorObjectHorizontalPositionAlignment[AnchorObjectHorizontalPositionAlignment["Left"] = 1] = "Left";
        AnchorObjectHorizontalPositionAlignment[AnchorObjectHorizontalPositionAlignment["Center"] = 2] = "Center";
        AnchorObjectHorizontalPositionAlignment[AnchorObjectHorizontalPositionAlignment["Right"] = 3] = "Right";
        AnchorObjectHorizontalPositionAlignment[AnchorObjectHorizontalPositionAlignment["Inside"] = 4] = "Inside";
        AnchorObjectHorizontalPositionAlignment[AnchorObjectHorizontalPositionAlignment["Outside"] = 5] = "Outside";
    })(AnchorObjectHorizontalPositionAlignment = __aspxRichEdit.AnchorObjectHorizontalPositionAlignment || (__aspxRichEdit.AnchorObjectHorizontalPositionAlignment = {}));
    var AnchorObjectVerticalPositionType;
    (function (AnchorObjectVerticalPositionType) {
        AnchorObjectVerticalPositionType[AnchorObjectVerticalPositionType["Page"] = 0] = "Page";
        AnchorObjectVerticalPositionType[AnchorObjectVerticalPositionType["Line"] = 1] = "Line";
        AnchorObjectVerticalPositionType[AnchorObjectVerticalPositionType["Paragraph"] = 2] = "Paragraph";
        AnchorObjectVerticalPositionType[AnchorObjectVerticalPositionType["Margin"] = 3] = "Margin";
        AnchorObjectVerticalPositionType[AnchorObjectVerticalPositionType["TopMargin"] = 4] = "TopMargin";
        AnchorObjectVerticalPositionType[AnchorObjectVerticalPositionType["BottomMargin"] = 5] = "BottomMargin";
        AnchorObjectVerticalPositionType[AnchorObjectVerticalPositionType["InsideMargin"] = 6] = "InsideMargin";
        AnchorObjectVerticalPositionType[AnchorObjectVerticalPositionType["OutsideMargin"] = 7] = "OutsideMargin";
    })(AnchorObjectVerticalPositionType = __aspxRichEdit.AnchorObjectVerticalPositionType || (__aspxRichEdit.AnchorObjectVerticalPositionType = {}));
    var AnchorObjectVerticalPositionAlignment;
    (function (AnchorObjectVerticalPositionAlignment) {
        AnchorObjectVerticalPositionAlignment[AnchorObjectVerticalPositionAlignment["None"] = 0] = "None";
        AnchorObjectVerticalPositionAlignment[AnchorObjectVerticalPositionAlignment["Top"] = 1] = "Top";
        AnchorObjectVerticalPositionAlignment[AnchorObjectVerticalPositionAlignment["Center"] = 2] = "Center";
        AnchorObjectVerticalPositionAlignment[AnchorObjectVerticalPositionAlignment["Bottom"] = 3] = "Bottom";
        AnchorObjectVerticalPositionAlignment[AnchorObjectVerticalPositionAlignment["Inside"] = 4] = "Inside";
        AnchorObjectVerticalPositionAlignment[AnchorObjectVerticalPositionAlignment["Outside"] = 5] = "Outside";
    })(AnchorObjectVerticalPositionAlignment = __aspxRichEdit.AnchorObjectVerticalPositionAlignment || (__aspxRichEdit.AnchorObjectVerticalPositionAlignment = {}));
    var TextBoxVerticalAlignment;
    (function (TextBoxVerticalAlignment) {
        TextBoxVerticalAlignment[TextBoxVerticalAlignment["Top"] = 0] = "Top";
        TextBoxVerticalAlignment[TextBoxVerticalAlignment["Both"] = 1] = "Both";
        TextBoxVerticalAlignment[TextBoxVerticalAlignment["Center"] = 2] = "Center";
        TextBoxVerticalAlignment[TextBoxVerticalAlignment["Bottom"] = 3] = "Bottom";
    })(TextBoxVerticalAlignment = __aspxRichEdit.TextBoxVerticalAlignment || (__aspxRichEdit.TextBoxVerticalAlignment = {}));
    var DrawingTextAnchoringType;
    (function (DrawingTextAnchoringType) {
        DrawingTextAnchoringType[DrawingTextAnchoringType["Bottom"] = 1] = "Bottom";
        DrawingTextAnchoringType[DrawingTextAnchoringType["Center"] = 2] = "Center";
        DrawingTextAnchoringType[DrawingTextAnchoringType["Distributed"] = 3] = "Distributed";
        DrawingTextAnchoringType[DrawingTextAnchoringType["Justified"] = 4] = "Justified";
        DrawingTextAnchoringType[DrawingTextAnchoringType["Top"] = 5] = "Top";
    })(DrawingTextAnchoringType = __aspxRichEdit.DrawingTextAnchoringType || (__aspxRichEdit.DrawingTextAnchoringType = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var BookmarkBase = (function (_super) {
        __extends(BookmarkBase, _super);
        function BookmarkBase(positionManager, interval) {
            var _this = _super.call(this) || this;
            _this._interval = interval.getLinkedInterval(positionManager);
            return _this;
        }
        Object.defineProperty(BookmarkBase.prototype, "start", {
            get: function () { return this._interval.start; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(BookmarkBase.prototype, "length", {
            get: function () { return this._interval.length; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(BookmarkBase.prototype, "end", {
            get: function () { return this._interval.end; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(BookmarkBase.prototype, "interval", {
            get: function () { return this._interval.getFixedInterval(); },
            enumerable: true,
            configurable: true
        });
        BookmarkBase.prototype.equals = function (obj) {
            return obj && this._interval.equals(obj._interval);
        };
        BookmarkBase.prototype.destructor = function (positionManager) {
            this._interval.destructor(positionManager);
        };
        return BookmarkBase;
    }(__aspxRichEdit.ConstInterval));
    __aspxRichEdit.BookmarkBase = BookmarkBase;
    var Bookmark = (function (_super) {
        __extends(Bookmark, _super);
        function Bookmark(positionManager, interval, name) {
            var _this = _super.call(this, positionManager, interval) || this;
            _this.name = "";
            _this.name = name;
            return _this;
        }
        Bookmark.isValidName = function (name, allowHiddenBookmarks) {
            return name && name.length && !/\d/.test(name[0]) && (allowHiddenBookmarks || name[0] != "_") &&
                !Bookmark.prohibitedSymbolsForName.test(name);
        };
        Bookmark.prototype.isHidden = function () {
            return this.name.length > 0 && this.name[0] == "_";
        };
        Bookmark.prototype.isToc = function () {
            return this.name.toUpperCase().indexOf("_TOC") == 0;
        };
        Bookmark.prototype.equals = function (obj) {
            return _super.prototype.equals.call(this, obj) && this.name == obj.name;
        };
        Object.defineProperty(Bookmark.prototype, "constBookmark", {
            get: function () {
                return new ConstBookmark(this, this.name);
            },
            enumerable: true,
            configurable: true
        });
        Bookmark.prohibitedSymbolsForName = /.*[\`\~\!\@\#\$\%\^\&\*\(\)\+\{\}\|\:\"\<\>\?\-\=\[\]\.\,\;\'\/\\ ].*/;
        return Bookmark;
    }(BookmarkBase));
    __aspxRichEdit.Bookmark = Bookmark;
    var ConstBookmark = (function (_super) {
        __extends(ConstBookmark, _super);
        function ConstBookmark(interval, name) {
            var _this = _super.call(this) || this;
            _this.interval = new __aspxRichEdit.BoundaryInterval(interval.start, interval.end);
            _this.name = name;
            return _this;
        }
        Object.defineProperty(ConstBookmark.prototype, "start", {
            get: function () { return this.interval.start; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ConstBookmark.prototype, "length", {
            get: function () { return this.interval.length; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ConstBookmark.prototype, "end", {
            get: function () { return this.interval.end; },
            enumerable: true,
            configurable: true
        });
        ConstBookmark.prototype.equals = function (obj) {
            return obj && this.name == obj.name && this.interval.equals(obj.interval);
        };
        ConstBookmark.prototype.createBookmark = function (positionManager) {
            return new Bookmark(positionManager, this.interval, this.name);
        };
        return ConstBookmark;
    }(__aspxRichEdit.ConstInterval));
    __aspxRichEdit.ConstBookmark = ConstBookmark;
    var BookmarkAndSubDocument = (function () {
        function BookmarkAndSubDocument(bookmark, subDocument) {
            this.bookmark = bookmark;
            this.subDocument = subDocument;
        }
        return BookmarkAndSubDocument;
    }());
    __aspxRichEdit.BookmarkAndSubDocument = BookmarkAndSubDocument;
    var BookmarksSettings = (function () {
        function BookmarksSettings() {
            this.conflictNameResolution = ConflictNameAction.Rename;
            this.visibility = __aspxRichEdit.BookmarksVisibility.Auto;
            this.color = "rgb(127, 127, 127)";
        }
        return BookmarksSettings;
    }());
    __aspxRichEdit.BookmarksSettings = BookmarksSettings;
    var ConflictNameAction;
    (function (ConflictNameAction) {
        ConflictNameAction[ConflictNameAction["Keep"] = 0] = "Keep";
        ConflictNameAction[ConflictNameAction["Rename"] = 1] = "Rename";
        ConflictNameAction[ConflictNameAction["Skip"] = 2] = "Skip";
    })(ConflictNameAction = __aspxRichEdit.ConflictNameAction || (__aspxRichEdit.ConflictNameAction = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutAndModelPositions = (function () {
        function LayoutAndModelPositions(layoutPosition, modelPosition) {
            this.layoutPosition = layoutPosition;
            this.modelPosition = modelPosition;
        }
        return LayoutAndModelPositions;
    }());
    __aspxRichEdit.LayoutAndModelPositions = LayoutAndModelPositions;
    var LayoutRowPosition = (function () {
        function LayoutRowPosition() {
            this.row = null;
            this.box = null;
            this.boxIndex = -1;
            this.charOffset = -1;
        }
        return LayoutRowPosition;
    }());
    __aspxRichEdit.LayoutRowPosition = LayoutRowPosition;
    var LayoutPositionBase = (function (_super) {
        __extends(LayoutPositionBase, _super);
        function LayoutPositionBase() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.detailsLevel = __aspxRichEdit.DocumentLayoutDetailsLevel.None;
            _this.rowIndex = -1;
            _this.column = null;
            _this.columnIndex = -1;
            _this.pageArea = null;
            _this.pageAreaIndex = -1;
            _this.page = null;
            _this.pageIndex = -1;
            return _this;
        }
        LayoutPositionBase.prototype.getRelatedSubDocumentPagePosition = function () {
            return this.pageArea.subDocument.isMain() ? this.page.getPosition() : 0;
        };
        LayoutPositionBase.prototype.equals = function (obj) {
            if (this.detailsLevel != obj.detailsLevel)
                return false;
            switch (this.detailsLevel) {
                case __aspxRichEdit.DocumentLayoutDetailsLevel.Character: if (this.charOffset != obj.charOffset)
                    return false;
                case __aspxRichEdit.DocumentLayoutDetailsLevel.Box: if (this.boxIndex != obj.boxIndex)
                    return false;
                case __aspxRichEdit.DocumentLayoutDetailsLevel.Row: if (this.rowIndex != obj.rowIndex)
                    return false;
                case __aspxRichEdit.DocumentLayoutDetailsLevel.Column: if (this.columnIndex != obj.columnIndex)
                    return false;
                case __aspxRichEdit.DocumentLayoutDetailsLevel.PageArea: if (this.pageAreaIndex != obj.pageAreaIndex || this.pageArea.subDocument.id != obj.pageArea.subDocument.id)
                    return false;
                case __aspxRichEdit.DocumentLayoutDetailsLevel.Page: if (this.pageIndex != obj.pageIndex)
                    return false;
            }
            return true;
        };
        LayoutPositionBase.prototype.stepBackRow = function () {
            if (this.rowIndex == 0)
                return false;
            this.row = this.column.rows[--this.rowIndex];
            return true;
        };
        LayoutPositionBase.prototype.stepForwardRow = function () {
            var newRow = this.column.rows[++this.rowIndex];
            if (newRow) {
                this.row = newRow;
                return true;
            }
            this.rowIndex--;
            return false;
        };
        LayoutPositionBase.prototype.getPositionRelativePage = function (measurer) {
            return new __aspxRichEdit.LayoutPoint(this.page.index, this.getLayoutX(measurer), this.getLayoutY());
        };
        LayoutPositionBase.prototype.getLayoutX = function (measurer, detailsLevel) {
            if (!detailsLevel)
                detailsLevel = this.detailsLevel;
            var xPos = 0;
            switch (detailsLevel) {
                case __aspxRichEdit.DocumentLayoutDetailsLevel.Max:
                case __aspxRichEdit.DocumentLayoutDetailsLevel.Character: xPos += this.box.getCharOffsetXInPixels(measurer, this.charOffset);
                case __aspxRichEdit.DocumentLayoutDetailsLevel.Box: xPos += this.box.x;
                case __aspxRichEdit.DocumentLayoutDetailsLevel.Row: xPos += this.row.x;
                case __aspxRichEdit.DocumentLayoutDetailsLevel.Column: xPos += this.column.x;
                case __aspxRichEdit.DocumentLayoutDetailsLevel.PageArea: xPos += this.pageArea.x;
            }
            return xPos;
        };
        LayoutPositionBase.prototype.getLayoutY = function (detailsLevel) {
            if (!detailsLevel)
                detailsLevel = this.detailsLevel;
            var yPos = 0;
            switch (detailsLevel) {
                case __aspxRichEdit.DocumentLayoutDetailsLevel.Max:
                case __aspxRichEdit.DocumentLayoutDetailsLevel.Character:
                case __aspxRichEdit.DocumentLayoutDetailsLevel.Box: yPos += this.row.baseLine - this.box.getAscent() - this.row.getSpacingBefore();
                case __aspxRichEdit.DocumentLayoutDetailsLevel.Row: yPos += this.row.y;
                case __aspxRichEdit.DocumentLayoutDetailsLevel.Column: yPos += this.column.y;
                case __aspxRichEdit.DocumentLayoutDetailsLevel.PageArea: yPos += this.pageArea.y;
            }
            return yPos;
        };
        LayoutPositionBase.prototype.getPageAreaBySubDocument = function (subDocument) {
            return subDocument.isMain() ? this.page.mainSubDocumentPageAreas[this.pageAreaIndex] : this.page.otherPageAreas[subDocument.id];
        };
        LayoutPositionBase.prototype.advanceToPrevRow = function (layout) {
            this.rowIndex--;
            if (this.rowIndex < 0) {
                if (!this.pageArea.subDocument.isMain()) {
                    this.rowIndex = 0;
                    return false;
                }
                this.columnIndex--;
                if (this.columnIndex < 0) {
                    this.pageAreaIndex--;
                    if (this.pageAreaIndex < 0) {
                        this.pageIndex--;
                        if (this.pageIndex < 0) {
                            this.pageIndex = 0;
                            this.pageAreaIndex = 0;
                            this.columnIndex = 0;
                            this.rowIndex = 0;
                            return false;
                        }
                        this.page = layout.pages[this.pageIndex];
                        this.pageAreaIndex = this.page.mainSubDocumentPageAreas.length - 1;
                    }
                    this.pageArea = this.page.mainSubDocumentPageAreas[this.pageAreaIndex];
                    this.columnIndex = this.pageArea.columns.length - 1;
                }
                this.column = this.pageArea.columns[this.columnIndex];
                this.rowIndex = this.column.rows.length - 1;
            }
            this.row = this.column.rows[this.rowIndex];
            return true;
        };
        LayoutPositionBase.prototype.advanceToNextBoxInRow = function () {
            if (this.boxIndex + 1 < this.row.boxes.length) {
                this.boxIndex++;
                this.box = this.row.boxes[this.boxIndex];
                this.charOffset = 0;
                return true;
            }
            return false;
        };
        LayoutPositionBase.prototype.advanceToPrevBoxInRow = function () {
            if (this.boxIndex > 0) {
                this.boxIndex--;
                this.box = this.row.boxes[this.boxIndex];
                this.charOffset = this.box.getLength() - 1;
                return true;
            }
            return false;
        };
        LayoutPositionBase.prototype.advanceToNextRow = function (layout) {
            this.rowIndex++;
            if (this.rowIndex >= this.column.rows.length) {
                if (!this.pageArea.subDocument.isMain()) {
                    this.rowIndex--;
                    return false;
                }
                this.rowIndex = 0;
                this.columnIndex++;
                if (this.columnIndex >= this.pageArea.columns.length) {
                    this.columnIndex = 0;
                    this.pageAreaIndex++;
                    if (this.pageAreaIndex >= this.page.mainSubDocumentPageAreas.length) {
                        this.pageAreaIndex = 0;
                        this.pageIndex++;
                        if (this.pageIndex >= layout.validPageCount) {
                            this.pageIndex--;
                            this.pageAreaIndex = this.page.mainSubDocumentPageAreas.length - 1;
                            this.columnIndex = this.pageArea.columns.length - 1;
                            this.rowIndex = this.column.rows.length - 1;
                            return false;
                        }
                        this.page = layout.pages[this.pageIndex];
                    }
                    this.pageArea = this.page.mainSubDocumentPageAreas[this.pageAreaIndex];
                }
                this.column = this.pageArea.columns[this.columnIndex];
            }
            this.row = this.column.rows[this.rowIndex];
            return true;
        };
        return LayoutPositionBase;
    }(LayoutRowPosition));
    __aspxRichEdit.LayoutPositionBase = LayoutPositionBase;
    var LayoutPosition = (function (_super) {
        __extends(LayoutPosition, _super);
        function LayoutPosition(detailsLevel) {
            var _this = _super.call(this) || this;
            _this.detailsLevel = detailsLevel;
            return _this;
        }
        LayoutPosition.ensure = function (formatterController, subDocument, logPosition, detailsLevel, endRowConflictFlags, middleRowConflictFlags) {
            var layout = formatterController.layout;
            if (subDocument.isMain())
                return __aspxRichEdit.LayoutPositionMainSubDocumentCreator.ensureLayoutPosition(formatterController, layout, subDocument, logPosition, detailsLevel, endRowConflictFlags, middleRowConflictFlags);
            while (true) {
                var lp = new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(layout, subDocument, logPosition, formatterController.selection.pageIndex, detailsLevel)
                    .create(endRowConflictFlags, middleRowConflictFlags);
                if (lp)
                    return lp;
                if (!formatterController.layoutFormatterManager.forceFormatPage(layout.validPageCount))
                    return null;
            }
        };
        LayoutPosition.prototype.getLogPosition = function (detailsLevel) {
            if (detailsLevel === void 0) { detailsLevel = null; }
            if (!detailsLevel)
                detailsLevel = this.detailsLevel;
            var position = 0;
            switch (detailsLevel) {
                case __aspxRichEdit.DocumentLayoutDetailsLevel.Max:
                case __aspxRichEdit.DocumentLayoutDetailsLevel.Character: position += this.charOffset;
                case __aspxRichEdit.DocumentLayoutDetailsLevel.Box: position += this.box.rowOffset;
                case __aspxRichEdit.DocumentLayoutDetailsLevel.Row: position += this.row.columnOffset;
                case __aspxRichEdit.DocumentLayoutDetailsLevel.Column: position += this.column.pageAreaOffset;
                case __aspxRichEdit.DocumentLayoutDetailsLevel.PageArea: position += this.pageArea.pageOffset;
            }
            if (detailsLevel >= __aspxRichEdit.DocumentLayoutDetailsLevel.PageArea && this.pageArea.subDocument.isMain())
                position += this.page.getPosition();
            return position;
        };
        LayoutPosition.prototype.isPositionBoxEnd = function () {
            return this.charOffset == this.box.getLength();
        };
        LayoutPosition.prototype.isLastBoxInRow = function () {
            return this.boxIndex == this.row.boxes.length - 1;
        };
        LayoutPosition.prototype.isPositionAfterLastBoxInRow = function () {
            return this.isLastBoxInRow() && this.isPositionBoxEnd();
        };
        LayoutPosition.prototype.isPositionBeforeFirstBoxInRow = function () {
            return this.boxIndex == 0 && this.charOffset == 0;
        };
        LayoutPosition.prototype.switchToEndPrevBoxInRow = function () {
            if (this.charOffset == 0 && this.boxIndex > 0) {
                this.boxIndex--;
                this.box = this.row.boxes[this.boxIndex];
                this.charOffset = this.box.getLength();
                return true;
            }
            return false;
        };
        LayoutPosition.prototype.switchToStartNextBoxInRow = function () {
            if (this.charOffset == this.box.getLength() && this.boxIndex + 1 < this.row.boxes.length) {
                this.boxIndex++;
                this.box = this.row.boxes[this.boxIndex];
                this.charOffset = 0;
            }
        };
        LayoutPosition.prototype.copyFrom = function (source) {
            this.detailsLevel = source.detailsLevel;
            this.pageIndex = source.pageIndex;
            this.page = source.page;
            this.pageArea = source.pageArea;
            this.pageAreaIndex = source.pageAreaIndex;
            this.column = source.column;
            this.columnIndex = source.columnIndex;
            this.row = source.row;
            this.rowIndex = source.rowIndex;
            this.box = source.box;
            this.boxIndex = source.boxIndex;
            this.charOffset = source.charOffset;
        };
        LayoutPosition.prototype.clone = function () {
            var clone = new LayoutPosition(this.detailsLevel);
            clone.copyFrom(this);
            return clone;
        };
        LayoutPosition.prototype.initByIndexes = function (pageIndex, pageAreaIndex, columnIndex, rowIndex, boxIndex, charOffset) {
            if (pageAreaIndex === void 0) { pageAreaIndex = -1; }
            if (columnIndex === void 0) { columnIndex = -1; }
            if (rowIndex === void 0) { rowIndex = -1; }
            if (boxIndex === void 0) { boxIndex = -1; }
            if (charOffset === void 0) { charOffset = -1; }
            this.pageIndex = pageIndex;
            this.pageAreaIndex = pageAreaIndex;
            this.columnIndex = columnIndex;
            this.rowIndex = rowIndex;
            this.boxIndex = boxIndex;
            this.charOffset = charOffset;
            return this;
        };
        LayoutPosition.prototype.applyObjectsAsMainSubDocument = function (layout, idOtherSubDoc) {
            this.page = layout.pages[this.pageIndex];
            if (idOtherSubDoc < 0) {
                if (this.pageAreaIndex < 0)
                    return this;
                this.pageArea = this.page.mainSubDocumentPageAreas[this.pageAreaIndex];
            }
            else
                this.pageArea = this.page.otherPageAreas[idOtherSubDoc];
            if (this.columnIndex < 0)
                return this;
            this.column = this.pageArea.columns[this.columnIndex];
            if (this.rowIndex < 0)
                return this;
            this.row = this.column.rows[this.rowIndex];
            if (this.boxIndex < 0)
                return this;
            this.box = this.row.boxes[this.boxIndex];
            return this;
        };
        LayoutPosition.prototype.posIsStartPage = function () {
            return this.rowIndex == 0 && this.columnIndex == 0 && this.pageAreaIndex == 0;
        };
        LayoutPosition.prototype.isFirstRowOnPage = function () {
            return this.pageAreaIndex == 0 && this.columnIndex == 0 && this.rowIndex == 0;
        };
        return LayoutPosition;
    }(LayoutPositionBase));
    __aspxRichEdit.LayoutPosition = LayoutPosition;
    var LayoutPositionDiscardHelper = (function () {
        function LayoutPositionDiscardHelper() {
        }
        LayoutPositionDiscardHelper.onStartCharLevel = function (lp) {
            lp.charOffset = 0;
        };
        LayoutPositionDiscardHelper.onStartBoxLevel = function (lp) {
            lp.boxIndex = 0;
            lp.box = lp.row.boxes[0];
            LayoutPositionDiscardHelper.onStartCharLevel(lp);
        };
        LayoutPositionDiscardHelper.onStartRowLevel = function (lp) {
            lp.rowIndex = 0;
            lp.row = lp.column.rows[0];
            LayoutPositionDiscardHelper.onStartBoxLevel(lp);
        };
        LayoutPositionDiscardHelper.onStartColumnLevel = function (lp) {
            lp.columnIndex = 0;
            lp.column = lp.pageArea.columns[0];
            LayoutPositionDiscardHelper.onStartRowLevel(lp);
        };
        LayoutPositionDiscardHelper.onStartPageAreaLevel = function (lp) {
            lp.pageAreaIndex = 0;
            lp.pageArea = lp.page.mainSubDocumentPageAreas[0];
            LayoutPositionDiscardHelper.onStartColumnLevel(lp);
        };
        LayoutPositionDiscardHelper.onStartPageLevel = function (pages, lp) {
            lp.pageIndex = 0;
            lp.page = pages[0];
            LayoutPositionDiscardHelper.onStartPageAreaLevel(lp);
        };
        LayoutPositionDiscardHelper.onEndCharLevel = function (lp) {
            lp.charOffset = 0;
        };
        LayoutPositionDiscardHelper.onEndBoxLevel = function (lp) {
            lp.boxIndex = lp.row.boxes.length - 1;
            lp.box = lp.row.boxes[lp.boxIndex];
            LayoutPositionDiscardHelper.onEndCharLevel(lp);
        };
        LayoutPositionDiscardHelper.onEndRowLevel = function (lp) {
            lp.rowIndex = lp.column.rows.length - 1;
            lp.row = lp.column.rows[lp.rowIndex];
            LayoutPositionDiscardHelper.onEndBoxLevel(lp);
        };
        LayoutPositionDiscardHelper.onEndColumnLevel = function (lp) {
            lp.columnIndex = lp.pageArea.columns.length - 1;
            lp.column = lp.pageArea.columns[lp.columnIndex];
            LayoutPositionDiscardHelper.onEndRowLevel(lp);
        };
        LayoutPositionDiscardHelper.onEndPageAreaLevel = function (lp) {
            lp.pageAreaIndex = lp.page.mainSubDocumentPageAreas.length - 1;
            lp.pageArea = lp.page.mainSubDocumentPageAreas[lp.pageAreaIndex];
            LayoutPositionDiscardHelper.onEndColumnLevel(lp);
        };
        LayoutPositionDiscardHelper.onEndPageLevel = function (layout, lp) {
            lp.pageIndex = layout.pages.length - 1;
            lp.page = layout.pages[lp.pageIndex];
            LayoutPositionDiscardHelper.onEndPageAreaLevel(lp);
        };
        return LayoutPositionDiscardHelper;
    }());
    __aspxRichEdit.LayoutPositionDiscardHelper = LayoutPositionDiscardHelper;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutBoxType;
    (function (LayoutBoxType) {
        LayoutBoxType[LayoutBoxType["Text"] = 0] = "Text";
        LayoutBoxType[LayoutBoxType["Space"] = 1] = "Space";
        LayoutBoxType[LayoutBoxType["Dash"] = 2] = "Dash";
        LayoutBoxType[LayoutBoxType["TabSpace"] = 3] = "TabSpace";
        LayoutBoxType[LayoutBoxType["LineBreak"] = 4] = "LineBreak";
        LayoutBoxType[LayoutBoxType["PageBreak"] = 5] = "PageBreak";
        LayoutBoxType[LayoutBoxType["ColumnBreak"] = 6] = "ColumnBreak";
        LayoutBoxType[LayoutBoxType["SectionMark"] = 7] = "SectionMark";
        LayoutBoxType[LayoutBoxType["ParagraphMark"] = 8] = "ParagraphMark";
        LayoutBoxType[LayoutBoxType["Picture"] = 9] = "Picture";
        LayoutBoxType[LayoutBoxType["NumberingList"] = 10] = "NumberingList";
        LayoutBoxType[LayoutBoxType["FieldCodeStart"] = 11] = "FieldCodeStart";
        LayoutBoxType[LayoutBoxType["FieldCodeEnd"] = 12] = "FieldCodeEnd";
        LayoutBoxType[LayoutBoxType["FieldResultEnd"] = 13] = "FieldResultEnd";
        LayoutBoxType[LayoutBoxType["LayoutDependent"] = 14] = "LayoutDependent";
        LayoutBoxType[LayoutBoxType["NonBreakingSpace"] = 15] = "NonBreakingSpace";
        LayoutBoxType[LayoutBoxType["AnchorPicture"] = 16] = "AnchorPicture";
        LayoutBoxType[LayoutBoxType["AnchorTextBox"] = 17] = "AnchorTextBox";
    })(LayoutBoxType = __aspxRichEdit.LayoutBoxType || (__aspxRichEdit.LayoutBoxType = {}));
    var LayoutRenderCharacterProperties = (function () {
        function LayoutRenderCharacterProperties(initProps, colorInfo) {
            this.initProps = initProps;
            this.colorInfo = colorInfo;
        }
        return LayoutRenderCharacterProperties;
    }());
    __aspxRichEdit.LayoutRenderCharacterProperties = LayoutRenderCharacterProperties;
    var LayoutBox = (function (_super) {
        __extends(LayoutBox, _super);
        function LayoutBox(characterProperties, colorInfo) {
            var _this = _super.call(this) || this;
            _this.characterProperties = characterProperties;
            _this.colorInfo = colorInfo;
            return _this;
        }
        LayoutBox.prototype.equals = function (obj) {
            return _super.prototype.equals.call(this, obj) &&
                this.getType() == obj.getType() &&
                this.characterProperties == obj.characterProperties &&
                this.colorInfo.equals(obj.colorInfo) &&
                this.rowOffset == obj.rowOffset &&
                this.hyperlinkTip == obj.hyperlinkTip &&
                this.fieldLevel == this.fieldLevel;
        };
        LayoutBox.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.rowOffset = obj.rowOffset;
            if (obj.hyperlinkTip)
                this.hyperlinkTip = obj.hyperlinkTip;
            if (obj.fieldLevel)
                this.fieldLevel = obj.fieldLevel;
        };
        LayoutBox.initializeWithMeasurer = function (wrappers, measurer, showHiddenSymbols) {
            var widthHeightInfo = [];
            for (var _i = 0, wrappers_1 = wrappers; _i < wrappers_1.length; _i++) {
                var w = wrappers_1[_i];
                w.box.pushInfoForMeasure(widthHeightInfo, showHiddenSymbols);
            }
            measurer.measure(widthHeightInfo);
            __aspxRichEdit.ListUtils.reverseForeach(wrappers, function (w) { return w.box.popInfoForMeasure(widthHeightInfo, showHiddenSymbols); });
            if (widthHeightInfo.length != 0)
                throw new Error("In initializeWithMeasurer widthHeightInfo.length != 0" + widthHeightInfo.length);
        };
        LayoutBox.prototype.getEndPosition = function () {
            return this.rowOffset + this.getLength();
        };
        LayoutBox.prototype.getAscent = function () {
            return this.characterProperties.fontInfo.getAscent(this.height);
        };
        LayoutBox.prototype.getDescent = function () {
            return this.characterProperties.fontInfo.getDescent(this.height);
        };
        LayoutBox.prototype.isVisibleForRowAlign = function () {
            return false;
        };
        LayoutBox.prototype.isVisible = function () {
            return false;
        };
        LayoutBox.prototype.getCharOffsetXInPixels = function (_measurer, charOffset) {
            return charOffset <= 0 ? 0 : this.width;
        };
        LayoutBox.prototype.getLength = function () {
            return 1;
        };
        LayoutBox.prototype.calculateCharOffsetByPointX = function (_measurer, pointX) {
            return pointX / this.width > 0.6 ? 1 : 0;
        };
        LayoutBox.prototype.splitByWidth = function (_measurer, maxWidth, leaveAtLeastOneChar) {
            if (this.width <= maxWidth || leaveAtLeastOneChar)
                return this;
            return null;
        };
        LayoutBox.prototype.getCharIndex = function (_char) {
            return -1;
        };
        LayoutBox.prototype.splitBoxByPosition = function (_measurer, _offsetAtStartBox) {
            return null;
        };
        LayoutBox.prototype.renderNoStrikeoutAndNoUnderlineIfBoxInEndRow = function () {
            return false;
        };
        LayoutBox.prototype.renderIsWordBox = function () {
            return false;
        };
        LayoutBox.prototype.renderGetCharacterProperties = function () {
            return new LayoutRenderCharacterProperties(this.characterProperties, this.colorInfo);
        };
        return LayoutBox;
    }(__aspxRichEdit.Rectangle));
    __aspxRichEdit.LayoutBox = LayoutBox;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AnchoredObjectLevelType;
    (function (AnchoredObjectLevelType) {
        AnchoredObjectLevelType[AnchoredObjectLevelType["BehindText"] = 0] = "BehindText";
        AnchoredObjectLevelType[AnchoredObjectLevelType["InText"] = 1] = "InText";
        AnchoredObjectLevelType[AnchoredObjectLevelType["BeforeText"] = 2] = "BeforeText";
    })(AnchoredObjectLevelType = __aspxRichEdit.AnchoredObjectLevelType || (__aspxRichEdit.AnchoredObjectLevelType = {}));
    var LayoutAnchoredObjectBox = (function (_super) {
        __extends(LayoutAnchoredObjectBox, _super);
        function LayoutAnchoredObjectBox(characterProperties, colorInfo, belongsToSubDocId, anchorInfo, shape, objectId, rotationInRadians) {
            var _this = _super.call(this, characterProperties, colorInfo) || this;
            _this.yShift = 0;
            _this.belongsToSubDocId = belongsToSubDocId;
            _this.anchorInfo = anchorInfo;
            _this.shape = shape;
            _this.objectId = objectId;
            _this.rotationInRadians = rotationInRadians;
            return _this;
        }
        LayoutAnchoredObjectBox.prototype.equals = function (obj) {
            return _super.prototype.equals.call(this, obj) &&
                this.anchorInfo.equals(obj.anchorInfo) &&
                this.shape.equals(obj.shape) &&
                this.rotationInRadians == obj.rotationInRadians &&
                this.belongsToSubDocId == obj.belongsToSubDocId &&
                this.objectId == obj.objectId;
        };
        LayoutAnchoredObjectBox.prototype.isInText = function () {
            return this.levelType == AnchoredObjectLevelType.InText;
        };
        Object.defineProperty(LayoutAnchoredObjectBox.prototype, "levelType", {
            get: function () {
                return this.anchorInfo.levelType;
            },
            enumerable: true,
            configurable: true
        });
        LayoutAnchoredObjectBox.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.belongsToSubDocId = obj.belongsToSubDocId;
            this.rotationInRadians = obj.rotationInRadians;
            this.anchorInfo = obj.anchorInfo;
            this.shape = obj.shape;
            this.objectId = obj.objectId;
        };
        LayoutAnchoredObjectBox.prototype.pushInfoForMeasure = function (_info, _showHiddenSymbols) { };
        LayoutAnchoredObjectBox.prototype.popInfoForMeasure = function (_info, _showHiddenSymbols) { };
        LayoutAnchoredObjectBox.prototype.isWhitespace = function () {
            return true;
        };
        LayoutAnchoredObjectBox.prototype.isLineBreak = function () {
            return false;
        };
        LayoutAnchoredObjectBox.prototype.getRotatedPolygon = function () {
            var polygon = this.polygon;
            return this.rotationInRadians != 0 ? polygon.rotateAround(polygon.center, this.rotationInRadians, false, true) : polygon;
        };
        LayoutAnchoredObjectBox.prototype.getOuterBounds = function (applyMargins) {
            var polygon = this.getRotatedPolygon();
            return applyMargins ? polygon.bounds.applyMarginsOutside(this.anchorInfo.getDistanceMargins()) : polygon.bounds;
        };
        return LayoutAnchoredObjectBox;
    }(__aspxRichEdit.LayoutBox));
    __aspxRichEdit.LayoutAnchoredObjectBox = LayoutAnchoredObjectBox;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutTextBox = (function (_super) {
        __extends(LayoutTextBox, _super);
        function LayoutTextBox(characterProperties, colorInfo, text) {
            var _this = _super.call(this, characterProperties, colorInfo) || this;
            _this.text = text;
            return _this;
        }
        LayoutTextBox.prototype.equals = function (obj) {
            return _super.prototype.equals.call(this, obj) &&
                this.text == obj.text;
        };
        LayoutTextBox.prototype.clone = function () {
            var newObj = new LayoutTextBox(this.characterProperties, this.colorInfo, this.text);
            newObj.copyFrom(this);
            return newObj;
        };
        LayoutTextBox.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.text = obj.text;
        };
        LayoutTextBox.prototype.getType = function () {
            return __aspxRichEdit.LayoutBoxType.Text;
        };
        LayoutTextBox.prototype.pushInfoForMeasure = function (info, _showHiddenSymbols) {
            info.push(new __aspxRichEdit.MeasureInfoText(this.text, this.characterProperties));
        };
        LayoutTextBox.prototype.popInfoForMeasure = function (info, _showHiddenSymbols) {
            this.setSize(info.pop().resultSize);
        };
        LayoutTextBox.prototype.isVisible = function () {
            return true;
        };
        LayoutTextBox.prototype.isVisibleForRowAlign = function () {
            return true;
        };
        LayoutTextBox.prototype.getLength = function () {
            return this.text.length;
        };
        LayoutTextBox.prototype.getCharOffsetXInPixels = function (measurer, charOffset) {
            if (charOffset == 0)
                return 0;
            else if (charOffset === this.getLength())
                return this.width;
            else {
                var info = new __aspxRichEdit.MeasureInfoText(this.text.substr(0, charOffset), this.characterProperties);
                measurer.measure([info]);
                return info.resultSize.width;
            }
        };
        LayoutTextBox.prototype.calculateCharOffsetByPointX = function (measurer, pointX) {
            var boxRanges = this.getBoxRanges(measurer);
            var boxRangesLength = boxRanges.length;
            for (var i = 0; i < boxRangesLength; i++) {
                if (boxRanges[i].resultSize.width > pointX) {
                    var letterWidth = i > 0 ?
                        boxRanges[i].resultSize.width - boxRanges[i - 1].resultSize.width :
                        boxRanges[0].resultSize.width;
                    var clickPointOffset = pointX - (i > 0 ? boxRanges[i - 1].resultSize.width : 0);
                    if (clickPointOffset / letterWidth > 0.6)
                        i++;
                    break;
                }
            }
            return i;
        };
        LayoutTextBox.prototype.splitByWidth = function (measurer, maxWidth, leaveAtLeastOneChar) {
            if (this.getLength() == 1)
                return _super.prototype.splitByWidth.call(this, measurer, maxWidth, leaveAtLeastOneChar);
            var boxRanges = this.getBoxRanges(measurer);
            for (var i = boxRanges.length - 1, info = void 0; info = boxRanges[i]; i--)
                if (info.resultSize.width <= maxWidth || i == 0 && leaveAtLeastOneChar) {
                    var newBox = this.clone();
                    newBox.text = newBox.text.substr(0, info.text.length);
                    __aspxRichEdit.LayoutBox.initializeWithMeasurer([new __aspxRichEdit.LayoutFormatter.Row.Box.BoxWrap(newBox, null)], measurer, false);
                    return newBox;
                }
            return null;
        };
        LayoutTextBox.prototype.splitBoxByPosition = function (measurer, offsetAtStartBox) {
            var nextBox = this.clone();
            nextBox.text = nextBox.text.substr(offsetAtStartBox);
            this.text = this.text.substr(0, offsetAtStartBox);
            nextBox.rowOffset = this.getEndPosition();
            __aspxRichEdit.LayoutBox.initializeWithMeasurer([new __aspxRichEdit.LayoutFormatter.Row.Box.BoxWrap(this, null), new __aspxRichEdit.LayoutFormatter.Row.Box.BoxWrap(nextBox, null)], measurer, false);
            return nextBox;
        };
        LayoutTextBox.prototype.getCharIndex = function (char) {
            return this.text.indexOf(char);
        };
        LayoutTextBox.prototype.renderGetContent = function (_renderer) {
            return __aspxRichEdit.HTMLUtils.encodeHtml(this.text);
        };
        LayoutTextBox.prototype.renderIsWordBox = function () {
            return true;
        };
        LayoutTextBox.prototype.isWhitespace = function () {
            return false;
        };
        LayoutTextBox.prototype.isLineBreak = function () {
            return false;
        };
        LayoutTextBox.prototype.getBoxRanges = function (measurer) {
            var measureInfos = [];
            var textLength = this.text.length;
            for (var i = 1; i <= textLength; i++)
                measureInfos.push(new __aspxRichEdit.MeasureInfoText(this.text.substr(0, i), this.characterProperties));
            measurer.measure(measureInfos);
            return measureInfos;
        };
        return LayoutTextBox;
    }(__aspxRichEdit.LayoutBox));
    __aspxRichEdit.LayoutTextBox = LayoutTextBox;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutPageBreakBox = (function (_super) {
        __extends(LayoutPageBreakBox, _super);
        function LayoutPageBreakBox(characterProperties, colorInfo) {
            var _this = _super.call(this, characterProperties, colorInfo) || this;
            if (!LayoutPageBreakBox.renderCharacterProperties && characterProperties) {
                LayoutPageBreakBox.renderCharacterProperties = new __aspxRichEdit.CharacterProperties();
                LayoutPageBreakBox.renderCharacterProperties.fontSize = 10;
                LayoutPageBreakBox.renderCharacterProperties.fontInfo = _this.characterProperties.fontInfo.clone();
                LayoutPageBreakBox.renderCharacterProperties.fontInfo.measurer = _this.characterProperties.fontInfo.measurer;
                LayoutPageBreakBox.renderCharacterProperties.fontInfo.name = "Arial";
                LayoutPageBreakBox.renderCharacterProperties.fontInfo.cssString = "Arial";
                LayoutPageBreakBox.renderCharacterProperties.fontInfo.scriptMultiplier = 0.65;
            }
            return _this;
        }
        LayoutPageBreakBox.prototype.equals = function (obj) {
            return _super.prototype.equals.call(this, obj) &&
                this.text == obj.text;
        };
        LayoutPageBreakBox.prototype.clone = function () {
            var newObj = new LayoutPageBreakBox(this.characterProperties, this.colorInfo);
            newObj.copyFrom(this);
            return newObj;
        };
        LayoutPageBreakBox.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.text = obj.text;
        };
        LayoutPageBreakBox.prototype.getType = function () {
            return __aspxRichEdit.LayoutBoxType.PageBreak;
        };
        LayoutPageBreakBox.prototype.pushInfoForMeasure = function (info, _showHiddenSymbols) {
            info.push(new __aspxRichEdit.MeasureInfoText(this.getHiddenText(), this.renderGetCharacterProperties().initProps));
        };
        LayoutPageBreakBox.prototype.popInfoForMeasure = function (info, showHiddenSymbols) {
            var elem = info.pop();
            this.text = showHiddenSymbols ? elem.text : "&nbsp;";
            this.setSize(elem.resultSize);
        };
        LayoutPageBreakBox.prototype.renderGetContent = function (_renderer) {
            return this.text;
        };
        LayoutPageBreakBox.prototype.renderNoStrikeoutAndNoUnderlineIfBoxInEndRow = function () {
            return true;
        };
        LayoutPageBreakBox.prototype.renderGetCharacterProperties = function () {
            LayoutPageBreakBox.renderCharacterProperties.hidden = this.characterProperties.hidden;
            return new __aspxRichEdit.LayoutRenderCharacterProperties(LayoutPageBreakBox.renderCharacterProperties, this.colorInfo);
        };
        LayoutPageBreakBox.prototype.isWhitespace = function () {
            return false;
        };
        LayoutPageBreakBox.prototype.isLineBreak = function () {
            return true;
        };
        LayoutPageBreakBox.prototype.getHiddenText = function () {
            return "........Page Break........";
        };
        return LayoutPageBreakBox;
    }(__aspxRichEdit.LayoutBox));
    __aspxRichEdit.LayoutPageBreakBox = LayoutPageBreakBox;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFieldCodeStartBox = (function (_super) {
        __extends(LayoutFieldCodeStartBox, _super);
        function LayoutFieldCodeStartBox() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutFieldCodeStartBox.prototype.clone = function () {
            var newObj = new LayoutFieldCodeStartBox(this.characterProperties, this.colorInfo);
            newObj.copyFrom(this);
            return newObj;
        };
        LayoutFieldCodeStartBox.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
        };
        LayoutFieldCodeStartBox.prototype.getType = function () {
            return __aspxRichEdit.LayoutBoxType.FieldCodeStart;
        };
        LayoutFieldCodeStartBox.prototype.getBoxChar = function () {
            return "{";
        };
        LayoutFieldCodeStartBox.prototype.pushInfoForMeasure = function (info, _showHiddenSymbols) {
            info.push(new __aspxRichEdit.MeasureInfoNonText(this.getBoxChar(), this.characterProperties));
        };
        LayoutFieldCodeStartBox.prototype.popInfoForMeasure = function (info, _showHiddenSymbols) {
            this.setSize(info.pop().resultSize);
        };
        LayoutFieldCodeStartBox.prototype.isVisibleForRowAlign = function () {
            return true;
        };
        LayoutFieldCodeStartBox.prototype.isVisible = function () {
            return true;
        };
        LayoutFieldCodeStartBox.prototype.renderGetContent = function (_renderer) {
            return __aspxRichEdit.HTMLUtils.encodeHtml(this.getBoxChar());
        };
        LayoutFieldCodeStartBox.prototype.isWhitespace = function () {
            return false;
        };
        LayoutFieldCodeStartBox.prototype.isLineBreak = function () {
            return false;
        };
        return LayoutFieldCodeStartBox;
    }(__aspxRichEdit.LayoutBox));
    __aspxRichEdit.LayoutFieldCodeStartBox = LayoutFieldCodeStartBox;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutDependentBoxType;
    (function (LayoutDependentBoxType) {
        LayoutDependentBoxType[LayoutDependentBoxType["Page"] = 0] = "Page";
        LayoutDependentBoxType[LayoutDependentBoxType["Numpages"] = 1] = "Numpages";
    })(LayoutDependentBoxType = __aspxRichEdit.LayoutDependentBoxType || (__aspxRichEdit.LayoutDependentBoxType = {}));
    var LayoutDependentTextBox = (function (_super) {
        __extends(LayoutDependentTextBox, _super);
        function LayoutDependentTextBox() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutDependentTextBox.prototype.clone = function () {
            var newObj = new LayoutDependentTextBox(this.characterProperties, this.colorInfo, this.text);
            newObj.copyFrom(this);
            return newObj;
        };
        LayoutDependentTextBox.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.type = obj.type;
        };
        LayoutDependentTextBox.prototype.getType = function () {
            return __aspxRichEdit.LayoutBoxType.LayoutDependent;
        };
        LayoutDependentTextBox.prototype.setType = function (type) {
            this.type = type;
        };
        LayoutDependentTextBox.prototype.calculateText = function (manager) {
            switch (this.type) {
                case LayoutDependentBoxType.Numpages:
                    this.text = (manager.layout.lastMaxNumPages).toString();
                    if (!manager.activeFormatter.subDocument.isMain())
                        manager.layoutDependentRunCache.add(manager.activeFormatter.layoutPosition.pageIndex, manager.activeFormatter.subDocument.id);
                    break;
                case LayoutDependentBoxType.Page:
                    this.text = (manager.activeFormatter.layoutPosition.page.layoutPageIndex + 1).toString();
                    break;
            }
        };
        LayoutDependentTextBox.prototype.isLineBreak = function () {
            return false;
        };
        return LayoutDependentTextBox;
    }(__aspxRichEdit.LayoutTextBox));
    __aspxRichEdit.LayoutDependentTextBox = LayoutDependentTextBox;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutSelectionItem = (function (_super) {
        __extends(LayoutSelectionItem, _super);
        function LayoutSelectionItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutSelectionItem.prototype.isCursor = function () {
            return false;
        };
        Object.defineProperty(LayoutSelectionItem.prototype, "zIndexClassType", {
            get: function () {
                return __aspxRichEdit.zIndexCssClassType.SelRow;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(LayoutSelectionItem.prototype, "baseClassName", {
            get: function () {
                return __aspxRichEdit.DocumentRenderer.CLASSNAMES.SELECTION_ROW;
            },
            enumerable: true,
            configurable: true
        });
        LayoutSelectionItem.create = function (pos, size, floatingObjectId, constr) {
            var item = new constr();
            item.floatingObjectId = floatingObjectId;
            return item.init(pos.pageArea.x + pos.column.x + pos.row.x, pos.pageArea.y + pos.column.y + pos.row.y, size.width, size.height);
        };
        LayoutSelectionItem.mainPageAreaSelection = -1;
        return LayoutSelectionItem;
    }(__aspxRichEdit.Rectangle));
    __aspxRichEdit.LayoutSelectionItem = LayoutSelectionItem;
    var LayoutSelectionCursorItem = (function (_super) {
        __extends(LayoutSelectionCursorItem, _super);
        function LayoutSelectionCursorItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutSelectionCursorItem.prototype.isCursor = function () {
            return true;
        };
        Object.defineProperty(LayoutSelectionCursorItem.prototype, "zIndexClassType", {
            get: function () {
                return __aspxRichEdit.zIndexCssClassType.SelCursor;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(LayoutSelectionCursorItem.prototype, "baseClassName", {
            get: function () {
                return [__aspxRichEdit.DocumentRenderer.CLASSNAMES.SELECTION_CURSOR, __aspxRichEdit.DocumentRenderer.CLASSNAMES.CURSOR_NO_BLINK_CLASS_NAME].join(" ");
            },
            enumerable: true,
            configurable: true
        });
        return LayoutSelectionCursorItem;
    }(LayoutSelectionItem));
    __aspxRichEdit.LayoutSelectionCursorItem = LayoutSelectionCursorItem;
    var LayoutSelectionMisspelledItem = (function (_super) {
        __extends(LayoutSelectionMisspelledItem, _super);
        function LayoutSelectionMisspelledItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(LayoutSelectionMisspelledItem.prototype, "zIndexClassType", {
            get: function () {
                return __aspxRichEdit.zIndexCssClassType.SelMissp;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(LayoutSelectionMisspelledItem.prototype, "baseClassName", {
            get: function () {
                return __aspxRichEdit.DocumentRenderer.CLASSNAMES.SELECTION_MISSPELLED;
            },
            enumerable: true,
            configurable: true
        });
        return LayoutSelectionMisspelledItem;
    }(LayoutSelectionItem));
    __aspxRichEdit.LayoutSelectionMisspelledItem = LayoutSelectionMisspelledItem;
    var LayoutSelectionSearchItem = (function (_super) {
        __extends(LayoutSelectionSearchItem, _super);
        function LayoutSelectionSearchItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(LayoutSelectionSearchItem.prototype, "zIndexClassType", {
            get: function () {
                return __aspxRichEdit.zIndexCssClassType.SelSearch;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(LayoutSelectionSearchItem.prototype, "baseClassName", {
            get: function () {
                return [__aspxRichEdit.DocumentRenderer.CLASSNAMES.SELECTION_ROW, __aspxRichEdit.DocumentRenderer.CLASSNAMES.SELECTION_SEARCH].join(" ");
            },
            enumerable: true,
            configurable: true
        });
        return LayoutSelectionSearchItem;
    }(LayoutSelectionItem));
    __aspxRichEdit.LayoutSelectionSearchItem = LayoutSelectionSearchItem;
    var LayoutRangePermissionItem = (function (_super) {
        __extends(LayoutRangePermissionItem, _super);
        function LayoutRangePermissionItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(LayoutRangePermissionItem.prototype, "zIndexClassType", {
            get: function () {
                return __aspxRichEdit.zIndexCssClassType.SelRange;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(LayoutRangePermissionItem.prototype, "baseClassName", {
            get: function () {
                return __aspxRichEdit.DocumentRenderer.CLASSNAMES.SELECTION_RANGE_PERMISSION;
            },
            enumerable: true,
            configurable: true
        });
        return LayoutRangePermissionItem;
    }(LayoutSelectionItem));
    __aspxRichEdit.LayoutRangePermissionItem = LayoutRangePermissionItem;
    var LayoutSelectionFloatingObjectItem = (function (_super) {
        __extends(LayoutSelectionFloatingObjectItem, _super);
        function LayoutSelectionFloatingObjectItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(LayoutSelectionFloatingObjectItem.prototype, "zIndexClassType", {
            get: function () {
                return __aspxRichEdit.zIndexCssClassType.SelRow;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(LayoutSelectionFloatingObjectItem.prototype, "baseClassName", {
            get: function () {
                return [__aspxRichEdit.DocumentRenderer.CLASSNAMES.SELECTION_ROW, __aspxRichEdit.DocumentRenderer.CLASSNAMES.SELECTION_FLOATING_OBJECTS].join(" ");
            },
            enumerable: true,
            configurable: true
        });
        return LayoutSelectionFloatingObjectItem;
    }(LayoutSelectionItem));
    __aspxRichEdit.LayoutSelectionFloatingObjectItem = LayoutSelectionFloatingObjectItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutBoxIteratorBase = (function () {
        function LayoutBoxIteratorBase(subDocument, layout, intervalStart, intervalEnd) {
            this.layout = layout;
            this.subDocument = subDocument;
            this.intervalStart = intervalStart;
            this.intervalEnd = intervalEnd;
            this.lastModelPosition = -1;
        }
        LayoutBoxIteratorBase.prototype.isInitialized = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        LayoutBoxIteratorBase.prototype.resetToInterval = function (intervalStart, intervalEnd) {
            this.intervalStart = intervalStart;
            this.intervalEnd = intervalEnd;
            this.lastModelPosition = -1;
            return this.isInitialized();
        };
        LayoutBoxIteratorBase.prototype.moveNext = function (endRowConflictFlags, middleRowConflictFlags) {
            var _this = this;
            this.endRowConflictFlags = endRowConflictFlags.clone();
            this.middleRowConflictFlags = middleRowConflictFlags.clone();
            if (this.lastModelPosition < 0) {
                this.position = this.getNewLayoutPosition(this.intervalStart, this.endRowConflictFlags, this.middleRowConflictFlags);
                if (!this.position && this.endRowConflictFlags.atLeastOneIsFalse())
                    this.position = this.getNewLayoutPosition(this.intervalStart, this.endRowConflictFlags.setDefault(true), this.middleRowConflictFlags);
                if (this.position) {
                    this.lastModelPosition = this.position.getLogPosition();
                    return true;
                }
            }
            if (this.lastModelPosition > this.intervalEnd || this.lastModelPosition < 0)
                return false;
            if (this.lastModelPosition == this.intervalEnd)
                return this.setBoundPosition(this.intervalEnd, this.position, function (boundPos) { return boundPos < _this.lastModelPosition; });
            var prevPosition = this.position.clone();
            if (!this.advancePosition())
                return this.position.charOffset != this.position.box.getLength() ?
                    this.setBoundPosition(this.intervalEnd, prevPosition, function (boundPos) { return boundPos < _this.lastModelPosition; }) :
                    false;
            var currModelPos = this.position.getLogPosition();
            if (currModelPos >= this.intervalEnd)
                return this.setBoundPosition(this.intervalEnd, prevPosition, function (boundPos) { return boundPos < _this.lastModelPosition; });
            this.lastModelPosition = currModelPos;
            return true;
        };
        LayoutBoxIteratorBase.prototype.movePrev = function (endRowConflictFlags, middleRowConflictFlags) {
            var _this = this;
            this.endRowConflictFlags = endRowConflictFlags.clone();
            this.middleRowConflictFlags = middleRowConflictFlags.clone();
            if (this.lastModelPosition < 0) {
                this.position = this.getNewLayoutPosition(this.intervalEnd, this.endRowConflictFlags, this.middleRowConflictFlags);
                if (!this.position && this.endRowConflictFlags.atLeastOneIsFalse())
                    this.position = this.getNewLayoutPosition(this.intervalEnd, this.endRowConflictFlags.setDefault(true), this.middleRowConflictFlags);
                if (this.position) {
                    this.lastModelPosition = this.position.getLogPosition();
                    return true;
                }
            }
            if (this.lastModelPosition < this.intervalStart || this.lastModelPosition < 0)
                return false;
            if (this.lastModelPosition == this.intervalStart)
                return this.setBoundPosition(this.intervalStart, this.position, function (boundPos) { return boundPos > _this.lastModelPosition; });
            var prevPosition = this.position.clone();
            if (!this.advancePositionBack())
                return false;
            var currModelPos = this.position.getLogPosition();
            if (currModelPos <= this.intervalStart)
                return this.setBoundPosition(this.intervalStart, prevPosition, function (boundPos) { return boundPos > _this.lastModelPosition; });
            this.lastModelPosition = currModelPos;
            return true;
        };
        LayoutBoxIteratorBase.prototype.setBoundPosition = function (logPosition, prevPosition, boundFunc) {
            var layoutPosition = this.getNewLayoutPosition(logPosition, this.endRowConflictFlags, this.middleRowConflictFlags);
            if (!layoutPosition)
                layoutPosition = this.getNewLayoutPosition(logPosition, this.endRowConflictFlags.setDefault(true), this.middleRowConflictFlags);
            var modelPos = layoutPosition.getLogPosition();
            if (layoutPosition.equals(prevPosition) || boundFunc(modelPos)) {
                this.position = prevPosition;
                return false;
            }
            this.position = layoutPosition;
            this.lastModelPosition = modelPos;
            return true;
        };
        LayoutBoxIteratorBase.prototype.advancePosition = function () {
            if (this.position.boxIndex + 1 < this.position.row.boxes.length) {
                this.position.boxIndex++;
                this.position.box = this.position.row.boxes[this.position.boxIndex];
                this.position.charOffset = 0;
                return true;
            }
            if (this.position.advanceToNextRow(this.layout)) {
                this.position.boxIndex = 0;
                this.position.box = this.position.row.boxes[0];
                this.position.charOffset = 0;
                return true;
            }
            return false;
        };
        LayoutBoxIteratorBase.prototype.advancePositionBack = function () {
            if (this.position.charOffset != 0) {
                this.position.charOffset = 0;
                return true;
            }
            if (this.position.boxIndex > 0) {
                this.position.boxIndex--;
                this.position.box = this.position.row.boxes[this.position.boxIndex];
                this.position.charOffset = 0;
                return true;
            }
            if (this.position.advanceToPrevRow(this.layout)) {
                this.position.boxIndex = this.position.row.boxes.length - 1;
                this.position.box = this.position.row.boxes[this.position.boxIndex];
                this.position.charOffset = 0;
                return true;
            }
            return false;
        };
        return LayoutBoxIteratorBase;
    }());
    __aspxRichEdit.LayoutBoxIteratorBase = LayoutBoxIteratorBase;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutPositionBaseAdvanceHelper = (function () {
        function LayoutPositionBaseAdvanceHelper(lp, layout) {
            this.lp = lp;
            this.layout = layout;
            this.oldLp = lp.clone();
        }
        LayoutPositionBaseAdvanceHelper.prototype.finalHandle = function (result) {
            if (result && !this.lp.page)
                throw new Error("Likely model is incorrect. See last table actions");
            if (result && this.lp.page.isValid)
                return true;
            this.lp.copyFrom(this.oldLp);
            return false;
        };
        LayoutPositionBaseAdvanceHelper.prototype.setLayoutRowInCell = function (cell, onStart) {
            var getInternalTableIndex = onStart ?
                function (_cell) { return 0; } :
                function (cell) { return cell.layoutRows.length; };
            var getInternalTableCell = onStart ?
                function (internalTable) { return internalTable.tableRows[0].rowCells[0]; } :
                function (internalTable) { return __aspxRichEdit.ListUtils.last(__aspxRichEdit.ListUtils.last(internalTable.tableRows).rowCells); };
            var internalTable;
            while (internalTable = cell.internalTables[getInternalTableIndex(cell)])
                cell = getInternalTableCell(internalTable);
            this.setLayoutRow((onStart ? cell.layoutRows[0] : __aspxRichEdit.ListUtils.last(cell.layoutRows)).indexInColumn, onStart);
        };
        LayoutPositionBaseAdvanceHelper.prototype.setLayoutRow = function (rowIndex, onStart) {
            this.lp.rowIndex = rowIndex;
            this.lp.row = this.lp.column.rows[this.lp.rowIndex];
            if (this.lp.row) {
                (onStart ? __aspxRichEdit.LayoutPositionDiscardHelper.onStartBoxLevel : __aspxRichEdit.LayoutPositionDiscardHelper.onEndBoxLevel)(this.lp);
                return true;
            }
            return false;
        };
        LayoutPositionBaseAdvanceHelper.prototype.advanceBoxSimple = function (allowChangeHighLevels, toNext) {
            toNext ? this.lp.boxIndex++ : this.lp.boxIndex--;
            this.lp.box = this.lp.row.boxes[this.lp.boxIndex];
            if (this.lp.box) {
                toNext ? __aspxRichEdit.LayoutPositionDiscardHelper.onStartCharLevel(this.lp) : __aspxRichEdit.LayoutPositionDiscardHelper.onEndCharLevel(this.lp);
                return true;
            }
            return allowChangeHighLevels ? this.advanceRowSimple(true, toNext) : false;
        };
        LayoutPositionBaseAdvanceHelper.prototype.advanceRowSimple = function (allowChangeHighLevels, toNext) {
            toNext ? this.lp.rowIndex++ : this.lp.rowIndex--;
            if (this.setLayoutRow(this.lp.rowIndex, toNext))
                return true;
            return allowChangeHighLevels ? this.advanceColumnSimple(true, toNext) : false;
        };
        LayoutPositionBaseAdvanceHelper.prototype.advanceColumnSimple = function (allowChangeHighLevels, toNext) {
            toNext ? this.lp.columnIndex++ : this.lp.columnIndex--;
            this.lp.column = this.lp.pageArea.columns[this.lp.columnIndex];
            if (this.lp.column) {
                toNext ? __aspxRichEdit.LayoutPositionDiscardHelper.onStartRowLevel(this.lp) : __aspxRichEdit.LayoutPositionDiscardHelper.onEndRowLevel(this.lp);
                return true;
            }
            return allowChangeHighLevels ? this.advancePageAreaSimple(true, toNext) : false;
        };
        LayoutPositionBaseAdvanceHelper.prototype.advancePageAreaSimple = function (allowChangeHighLevels, toNext) {
            toNext ? this.lp.pageAreaIndex++ : this.lp.pageAreaIndex--;
            this.lp.pageArea = this.lp.page.mainSubDocumentPageAreas[this.lp.pageAreaIndex];
            if (this.lp.pageArea) {
                toNext ? __aspxRichEdit.LayoutPositionDiscardHelper.onStartColumnLevel(this.lp) : __aspxRichEdit.LayoutPositionDiscardHelper.onEndColumnLevel(this.lp);
                return true;
            }
            return allowChangeHighLevels ? this.advancePageSimple(toNext) : false;
        };
        LayoutPositionBaseAdvanceHelper.prototype.advancePageSimple = function (toNext) {
            toNext ? this.lp.pageIndex++ : this.lp.pageIndex--;
            this.lp.page = this.layout.pages[this.lp.pageIndex];
            if (!this.lp.page)
                return false;
            toNext ? __aspxRichEdit.LayoutPositionDiscardHelper.onStartPageAreaLevel(this.lp) : __aspxRichEdit.LayoutPositionDiscardHelper.onEndPageAreaLevel(this.lp);
            return true;
        };
        LayoutPositionBaseAdvanceHelper.prototype.setRowByGridInfo = function (isStartFindWithStartTable, logicInfo, cellGridInfo, isAdvanceToNextColumn, isNeedColumnAdvance) {
            if (isNeedColumnAdvance)
                if (!this.advanceColumnSimple(true, isAdvanceToNextColumn))
                    return false;
            var sameTable = __aspxRichEdit.ListUtils.elementBy(this.lp.column.tablesInfo, function (tbl) { return tbl.logicInfo == logicInfo; });
            if (!sameTable)
                return false;
            var iteratorFunc = isStartFindWithStartTable ? __aspxRichEdit.ListUtils.anyOf : __aspxRichEdit.ListUtils.reverseAnyOf;
            var tblRowGridInfos = logicInfo.grid.tableCellGridInfos;
            var cell = iteratorFunc(sameTable.tableRows, function (row) {
                var tblRowGridInfo = tblRowGridInfos[row.rowIndex];
                return iteratorFunc(row.rowCells, function (cell) {
                    var info = tblRowGridInfo[cell.cellGridIndex];
                    return info == cellGridInfo ? cell : null;
                });
            });
            if (cell && (isStartFindWithStartTable ?
                (isAdvanceToNextColumn || cell.boundFlags.get(__aspxRichEdit.TableCellBoundFlags.StartOnThisColumn)) :
                ((!isAdvanceToNextColumn || cell.boundFlags.get(__aspxRichEdit.TableCellBoundFlags.EndOnThisColumn))))) {
                this.setLayoutRowInCell(cell, isStartFindWithStartTable);
                return true;
            }
            else
                return this.setRowByGridInfo(isStartFindWithStartTable, logicInfo, cellGridInfo, isAdvanceToNextColumn, true);
        };
        LayoutPositionBaseAdvanceHelper.getNextTableCellGridInfo = function (isStartFindWithStartTable, grid, startCellInfo, startRowIndex, cellIndex) {
            var result;
            var iteratorFunc = isStartFindWithStartTable ? __aspxRichEdit.ListUtils.anyOf : __aspxRichEdit.ListUtils.reverseAnyOf;
            if (iteratorFunc(grid.table.rows, function (row, rowIndex) {
                if (cellIndex == -2)
                    cellIndex = row.cells.length - 1;
                result = iteratorFunc(row.cells, function (cell, cellInd) {
                    if (cell.verticalMerging != __aspxRichEdit.TableCellMergingState.Continue) {
                        var currCell = grid.tableCellInfos[rowIndex][cellInd];
                        return currCell == startCellInfo ? null : currCell;
                    }
                    return null;
                }, cellIndex);
                if (result)
                    return result;
                cellIndex = isStartFindWithStartTable ? 0 : -2;
                return null;
            }, startRowIndex))
                return result;
            return null;
        };
        return LayoutPositionBaseAdvanceHelper;
    }());
    __aspxRichEdit.LayoutPositionBaseAdvanceHelper = LayoutPositionBaseAdvanceHelper;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var BaseFormatter = (function () {
            function BaseFormatter(manager, subDocId) {
                this.layoutRowBoundsCalculator = new LayoutFormatter.LayoutRowBoundsCalculator();
                this.manager = manager;
                this.rowFormatter = new LayoutFormatter.Row.RowFormatter(manager, subDocId);
                this.state = LayoutFormatter.LayoutFormatterState.PageAreaStart;
                this.stateMap = {};
                this.stateMap[LayoutFormatter.LayoutFormatterState.PageAreaStart] = this.processStatePageAreaStart;
                this.stateMap[LayoutFormatter.LayoutFormatterState.ColumnStart] = this.processStateColumnStart;
                this.stateMap[LayoutFormatter.LayoutFormatterState.RowFormatting] = this.processStateRowFormatting;
                this.stateMap[LayoutFormatter.LayoutFormatterState.ColumnEnd] = this.processStateColumnEnd;
            }
            BaseFormatter.prototype.initDocumentStart = function () {
                this.rowFormatter.documentStart();
                this.lastRowInfo = new LayoutFormatter.LastRowInfo(this.subDocument.paragraphs);
                this.lastRowInfo.reset(this.rowFormatter);
            };
            Object.defineProperty(BaseFormatter.prototype, "subDocument", {
                get: function () {
                    return this.rowFormatter.subDocument;
                },
                enumerable: true,
                configurable: true
            });
            Object.defineProperty(BaseFormatter.prototype, "currColumnHeight", {
                get: function () {
                    return this.layoutPosition.rowIndex == 0 ? 0 : this.layoutPosition.column.rows[this.layoutPosition.rowIndex - 1].getBottomBoundPosition();
                },
                enumerable: true,
                configurable: true
            });
            BaseFormatter.prototype.formatPageArea = function (pageAreaBounds, columnBounds, page) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatter, "formatPageArea", "pageIndex: " + page.index);
                this.pageAreaBounds = pageAreaBounds;
                this.columnBounds = columnBounds;
                if (!this.layoutPosition) {
                    this.layoutPosition = new __aspxRichEdit.LayoutPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.None);
                    this.layoutPosition.page = page;
                    this.layoutPosition.pageIndex = page.index;
                }
                while (this.stateMap[this.state].call(this) && this.state != LayoutFormatter.LayoutFormatterState.PageAreaEnd)
                    ;
            };
            BaseFormatter.prototype.processStatePageAreaStart = function () {
                var _this = this;
                this.manager.activeFormatter = this;
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatter, "processStatePageAreaStart", function () { return " SubDocId: " + _this.subDocument.id + ", LayPos: " + __aspxRichEdit.LogObjToStr.layoutPositionShort(_this.layoutPosition); });
                this.createNextPageArea();
                if (this.subDocument.isMain())
                    this.layoutPosition.page.mainSubDocumentPageAreas.push(this.layoutPosition.pageArea);
                else
                    this.layoutPosition.page.otherPageAreas[this.subDocument.id] = this.layoutPosition.pageArea;
                return true;
            };
            BaseFormatter.prototype.processStateColumnStart = function () {
                var _this = this;
                this.manager.activeFormatter = this;
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatter, "processStateColumnStart", function () { return " SubDocId: " + _this.subDocument.id + ", LayPos: " + __aspxRichEdit.LogObjToStr.layoutPositionShort(_this.layoutPosition); });
                var columnBounds = this.columnBounds[this.layoutPosition.columnIndex];
                this.createNextColumn(columnBounds);
                this.layoutPosition.pageArea.columns.push(this.layoutPosition.column);
                if (this.tableFormatter)
                    this.tableFormatter.columnStart(this.layoutPosition.column);
                var bounds = new __aspxRichEdit.FixedInterval(this.layoutPosition.pageArea.x + columnBounds.x, columnBounds.width);
                this.layoutRowBoundsCalculator.resetByColumn(this.layoutPosition.page.anchoredObjectHolder.objects, bounds, this.subDocument.isTextBox());
                return true;
            };
            BaseFormatter.prototype.initializeTextBoxSizeForAutoFitTables = function () {
                var _this = this;
                var tblPos = this.rowFormatter.getNextBoxWrapInfo().info.tablePosition[0];
                if (tblPos.rowIndex == 0 && tblPos.cellIndex == 0) {
                    __aspxRichEdit.MapUtilsKeyAsNumber.foreach(this.manager.anchoredObjectsManager.textBoxContextSizeCalculators, function (obj) {
                        var currTblPoss = obj.wrap.info.tablePosition;
                        if (currTblPoss && currTblPoss[0].table.index == tblPos.table.index)
                            obj.calculateSize(_this.manager.boundsCalculator);
                    });
                }
            };
            BaseFormatter.prototype.processStateRowFormatting = function () {
                var _this = this;
                this.manager.activeFormatter = this;
                var wrap = this.rowFormatter.getNextBoxWrapInfo();
                var startRowOffset = wrap.box.rowOffset;
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatter, "processStateRowFormatting", function () { return "pos:" + startRowOffset + ", SubDocId: " + _this.subDocument.id + ", LayPos: " + __aspxRichEdit.LogObjToStr.layoutPositionShort(_this.layoutPosition); });
                if (!this.tableFormatter && this.applyPageBreakBefore())
                    return true;
                if (!this.tableFormatter && wrap.info.tablePosition) {
                    this.initializeTextBoxSizeForAutoFitTables();
                    this.tableFormatter = new LayoutFormatter.Table.Formatter(this.rowFormatter, wrap.info.tablePosition, this.layoutPosition.column, __aspxRichEdit.LayoutColumn.findSectionColumnWithMinimumWidth(this.columnBounds), new __aspxRichEdit.Point(0, this.lastRowInfo.row && this.layoutPosition.column.rows.length ? this.lastRowInfo.row.getBottomBoundPosition() : 0), null, 0, null, null);
                    this.tableFormatter.tableInfo.currLayoutTableColumnInfo.logicInfo.isEditable = this.tableIsEditable(this.tableFormatter.tableInfo.table);
                }
                var rowResult = this.createRow();
                if (rowResult.flags.get(LayoutFormatter.Row.RowFormatterResultFlag.NotEnoughChunks))
                    return false;
                var addRowInTableResult = this.tableFormatter ?
                    this.tableFormatter.addLayoutRow(rowResult, wrap.info) :
                    new __aspxRichEdit.Flag(LayoutFormatter.Table.AddRowToTableResult.RowAdded);
                if (addRowInTableResult.get(LayoutFormatter.Table.AddRowToTableResult.RowAdded)) {
                    var row = rowResult.row;
                    if (this.subDocument.isMain() && !this.tableFormatter && this.cantPlaceRowOnThisColumn(row, startRowOffset))
                        return true;
                    this.pushRow(row, startRowOffset, rowResult.paragraphIndex);
                    if (this.placeAnchorObjects(rowResult)) {
                        if (this.tableFormatter) {
                            var bounds = new __aspxRichEdit.FixedInterval(this.layoutPosition.pageArea.x + this.layoutPosition.column.x +
                                this.layoutPosition.row.tableCellInfo.x, this.layoutPosition.row.tableCellInfo.width);
                            var obj = __aspxRichEdit.ListUtils.elementBy(rowResult.newAnchoredObjects, function (obj) { return obj.levelType == __aspxRichEdit.AnchoredObjectLevelType.InText; });
                            this.layoutRowBoundsCalculator.addTableInTextObject(obj, bounds);
                            if (this.tableFormatter.resetCaseInTextAnchorObject(wrap.info, obj)) {
                                if (!this.layoutPosition.column.rows[0]) {
                                    this.manager.floatingRestartInfoHolder.storeInfo(this.layoutPosition);
                                    new LayoutFormatter.RestartPreparer(this.manager).restartFromPage(this.layoutPosition.pageIndex, false, false);
                                }
                                else
                                    this.state = LayoutFormatter.LayoutFormatterState.ColumnEnd;
                            }
                        }
                        else {
                            this.manager.floatingRestartInfoHolder.storeInfo(this.layoutPosition);
                            new LayoutFormatter.RestartPreparer(this.manager).restartByAnchoredObject(this.layoutPosition.page);
                            if (!this.subDocument.isMain())
                                this.state = LayoutFormatter.LayoutFormatterState.PageAreaEnd;
                        }
                        this.isColumnOk();
                        return true;
                    }
                    if (this.tableFormatter) {
                        this.tableFormatter.actualFormatter.findNextCell(addRowInTableResult, wrap.info);
                    }
                }
                if (this.tableFormatter)
                    this.tableFormatter.applyResultOfTopLevelFormatters(addRowInTableResult, wrap.info);
                if (addRowInTableResult.get(LayoutFormatter.Table.AddRowToTableResult.TableFinished))
                    this.tableFormatter = null;
                if (addRowInTableResult.get(LayoutFormatter.Table.AddRowToTableResult.GoToNextColumn) || this.layoutPosition.row.flags.anyOf(__aspxRichEdit.LayoutRowStateFlags.ColumnEnd, __aspxRichEdit.LayoutRowStateFlags.DocumentEnd, __aspxRichEdit.LayoutRowStateFlags.SectionEnd, __aspxRichEdit.LayoutRowStateFlags.PageEnd)) {
                    this.isColumnOk();
                    this.state = LayoutFormatter.LayoutFormatterState.ColumnEnd;
                }
                return true;
            };
            BaseFormatter.prototype.processStateColumnEnd = function () {
                var _this = this;
                this.manager.activeFormatter = this;
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatter, "processStateColumnEnd", function () { return " SubDocId: " + _this.subDocument.id + ", LayPos: " + __aspxRichEdit.LogObjToStr.layoutPositionShort(_this.layoutPosition); });
                var createdColumn = this.layoutPosition.column;
                createdColumn.rows.sort(function (a, b) { return a.columnOffset - b.columnOffset; });
                BaseFormatter.correctRowOffsets(createdColumn);
                if (this.tableFormatter)
                    this.tableFormatter.columnEnd();
                createdColumn.tablesInfo.sort(function (a, b) { return a.logicInfo.grid.table.index - b.logicInfo.grid.table.index; });
                __aspxRichEdit.ListUtils.foreach(createdColumn.rows, function (row, index) {
                    if (row.tableCellInfo)
                        row.indexInColumn = index;
                });
                var lastRow = createdColumn.getLastRow();
                lastRow.flags.set(__aspxRichEdit.LayoutRowStateFlags.ColumnEnd, true);
                if (this.manager.innerClientProperties.viewsSettings.isSimpleView) {
                    var lastAnchorBox = __aspxRichEdit.MapUtilsKeyAsNumber.max(this.layoutPosition.page.anchoredObjectHolder.objects, function (a, b) { return a.getBottomBoundPosition() - b.getBottomBoundPosition(); });
                    var margins = this.manager.innerClientProperties.viewsSettings.paddings;
                    var bottomPosition = lastAnchorBox ? Math.max(lastAnchorBox.getBottomBoundPosition(), lastRow.getBottomBoundPosition()) : lastRow.getBottomBoundPosition();
                    var height = Math.max(bottomPosition + margins.top + margins.bottom, this.manager.controlHeightProvider.getVisibleAreaHeight(false));
                    this.layoutPosition.column.height = height;
                    this.layoutPosition.pageArea.height = height;
                    this.layoutPosition.page.height = height;
                }
                createdColumn.paragraphFrames = LayoutFormatter.ParagraphFrameCollector.collect(this.manager.model.colorProvider, createdColumn, this.subDocument.isMain() ?
                    this.layoutPosition.page.getPosition() + this.layoutPosition.pageArea.pageOffset : 0, this.subDocument.paragraphs);
                if (lastRow.flags.anyOf(__aspxRichEdit.LayoutRowStateFlags.DocumentEnd, __aspxRichEdit.LayoutRowStateFlags.PageEnd, __aspxRichEdit.LayoutRowStateFlags.SectionEnd)) {
                    this.layoutPosition.detailsLevel = __aspxRichEdit.DocumentLayoutDetailsLevel.PageArea;
                    this.state = LayoutFormatter.LayoutFormatterState.PageAreaEnd;
                }
                else {
                    if (this.layoutPosition.columnIndex + 1 < this.columnBounds.length) {
                        this.state = LayoutFormatter.LayoutFormatterState.ColumnStart;
                        this.layoutPosition.columnIndex++;
                        this.layoutPosition.column = null;
                    }
                    else
                        this.state = LayoutFormatter.LayoutFormatterState.PageAreaEnd;
                }
                return true;
            };
            BaseFormatter.prototype.createNextPageArea = function () {
                var newPageArea = new __aspxRichEdit.LayoutPageArea(this.subDocument);
                newPageArea.initByAnotherRectangle(this.pageAreaBounds);
                newPageArea.pageOffset = this.subDocument.isMain() ? 0 : this.rowFormatter.getPosition();
                this.state = LayoutFormatter.LayoutFormatterState.ColumnStart;
                this.layoutPosition.pageArea = newPageArea;
                this.layoutPosition.columnIndex = 0;
                this.layoutPosition.column = null;
                this.layoutPosition.detailsLevel = __aspxRichEdit.DocumentLayoutDetailsLevel.PageArea;
            };
            BaseFormatter.prototype.createNextColumn = function (columnBounds) {
                var newColumn = new __aspxRichEdit.LayoutColumn();
                newColumn.initByAnotherRectangle(columnBounds);
                newColumn.pageAreaOffset = this.layoutPosition.columnIndex == 0 || !this.subDocument.isMain() ?
                    0 :
                    this.rowFormatter.getPosition() - this.layoutPosition.pageArea.pageOffset - this.layoutPosition.page.getPosition();
                this.state = LayoutFormatter.LayoutFormatterState.RowFormatting;
                this.layoutPosition.column = newColumn;
                this.layoutPosition.rowIndex = 0;
                this.layoutPosition.detailsLevel = __aspxRichEdit.DocumentLayoutDetailsLevel.Column;
            };
            BaseFormatter.prototype.pushRow = function (row, rowAbsStartPos, parIndex) {
                this.layoutPosition.row = row;
                this.layoutPosition.column.rows.push(row);
                this.layoutPosition.rowIndex++;
                this.lastRowInfo.setFullRowInfo(row, rowAbsStartPos, parIndex);
                BaseFormatter.correctBoxOffsets(row);
            };
            BaseFormatter.prototype.createRow = function () {
                var rowSpacingBeforeApplier = this.tableFormatter ?
                    new LayoutFormatter.Row.TableRowSpacingBeforeApplier(this.lastRowInfo.row, this.subDocument.paragraphs, this.tableFormatter.isCurrLayoutRowIsFirstInCell, this.tableFormatter.isCurrTableCellFirstInRow, this.tableFormatter.isCurrTableRowIsFirstInTable) :
                    new LayoutFormatter.Row.RowSpacingBeforeApplier(this.lastRowInfo.row, this.subDocument.paragraphs, this.layoutPosition.rowIndex == 0, this.lastRowInfo.paragraphIndex);
                var offsetRelativeColumn = new __aspxRichEdit.Point(this.layoutPosition.pageArea.x + this.layoutPosition.column.x, this.layoutPosition.pageArea.y + this.layoutPosition.column.y);
                var absOffset = this.tableFormatter ?
                    offsetRelativeColumn.clone().applyOffset(this.tableFormatter.currLayoutRowOffset) :
                    this.getCurrOffsetForRow(offsetRelativeColumn);
                var minimumOfY = __aspxRichEdit.Constants.MIN_SAFE_INTEGER;
                if (!this.tableFormatter && this.lastRowInfo.row && this.manager.innerClientProperties.viewsSettings.isSimpleView &&
                    __aspxRichEdit.ListUtils.anyOf(this.lastRowInfo.row.boxes, function (b) {
                        return __aspxRichEdit.EnumUtils.isAnyOf(b.getType(), __aspxRichEdit.LayoutBoxType.ColumnBreak, __aspxRichEdit.LayoutBoxType.PageBreak, __aspxRichEdit.LayoutBoxType.SectionMark);
                    })) {
                    var lastRowBottomPos_1 = this.lastRowInfo.row.getBottomBoundPosition();
                    var ancObj_1 = null;
                    __aspxRichEdit.MapUtilsKeyAsNumber.foreach(this.layoutPosition.page.anchoredObjectHolder.objects, function (obj) {
                        if (!obj.isInText() && (obj.getBottomBoundPosition() > lastRowBottomPos_1) &&
                            (!ancObj_1 || obj.getBottomBoundPosition() > ancObj_1.getBottomBoundPosition()))
                            ancObj_1 = obj;
                    });
                    if (ancObj_1)
                        minimumOfY = ancObj_1.getBottomBoundPosition() + 1;
                }
                var maxLayoutRowWidth = this.tableFormatter ? this.tableFormatter.currLayoutRowContentWidth : this.layoutPosition.column.width;
                this.rowFormatter.formatRow(Math.max(minimumOfY, absOffset.y), new __aspxRichEdit.FixedInterval(absOffset.x, maxLayoutRowWidth), rowSpacingBeforeApplier);
                var rowResult = this.rowFormatter.result;
                if (rowResult.row)
                    rowResult.row.applyOffset(offsetRelativeColumn.applyMultiplier(-1, -1));
                return rowResult;
            };
            BaseFormatter.prototype.getCurrOffsetForRow = function (offsetRelativeColumn) {
                var prevRow = __aspxRichEdit.ListUtils.last(this.layoutPosition.column.rows);
                if (!prevRow)
                    return offsetRelativeColumn;
                var offset = offsetRelativeColumn.clone();
                offset.y += prevRow.tableCellInfo ?
                    prevRow.tableCellInfo.parentRow.parentTable.getTopLevelColumn().getBottomBoundPosition() :
                    prevRow.getBottomBoundPosition();
                return offset;
            };
            BaseFormatter.prototype.applyPageBreakBefore = function () {
                var wrapInfo = this.rowFormatter.getNextBoxWrapInfo();
                if (wrapInfo && this.lastRowInfo.isNextRowFirstInParagraph() &&
                    this.subDocument.paragraphs[wrapInfo.info.paragraphIndex].getParagraphMergedProperies().pageBreakBefore &&
                    this.layoutPosition.rowIndex !== 0 && this.manager.innerClientProperties.viewsSettings.isPrintLayoutView) {
                    this.lastRowInfo.row.flags.set(__aspxRichEdit.LayoutRowStateFlags.PageEnd, true);
                    this.state = LayoutFormatter.LayoutFormatterState.ColumnEnd;
                    return true;
                }
                return false;
            };
            BaseFormatter.prototype.cantPlaceRowOnThisColumn = function (row, startRowPosition) {
                if (this.layoutPosition.rowIndex != 0 && row.getBottomBoundPosition() > this.layoutPosition.column.height) {
                    this.rowFormatter.setPosition(startRowPosition, false, !this.tableFormatter);
                    this.state = LayoutFormatter.LayoutFormatterState.ColumnEnd;
                    return true;
                }
                return false;
            };
            BaseFormatter.prototype.placeAnchorObjects = function (rowResult) {
                var _this = this;
                if (!rowResult.newAnchoredObjects.length)
                    return false;
                var needRestartFromPageStart = false;
                __aspxRichEdit.ListUtils.foreach(rowResult.newAnchoredObjects, function (obj) {
                    _this.manager.layout.anchorObjectsPositionInfo.add(obj, obj.rowOffset);
                    switch (obj.getType()) {
                        case __aspxRichEdit.LayoutBoxType.AnchorTextBox: {
                            var textBox = obj;
                            if (textBox.internalSubDocId >= 0) {
                                _this.manager.otherPageAreaFormatter.setTextBoxContent(_this.layoutPosition.page, textBox);
                                _this.layoutPosition.page.anchoredObjectHolder.addObject(_this.manager, textBox);
                                var pageArea = _this.layoutPosition.page.otherPageAreas[textBox.internalSubDocId];
                                pageArea.x = textBox.x;
                                pageArea.y = textBox.y;
                            }
                            break;
                        }
                        case __aspxRichEdit.LayoutBoxType.AnchorPicture: {
                            _this.layoutPosition.page.anchoredObjectHolder.addObject(_this.manager, obj);
                            break;
                        }
                        default: throw new Error(__aspxRichEdit.Errors.InternalException);
                    }
                    if (obj.levelType == __aspxRichEdit.AnchoredObjectLevelType.InText)
                        needRestartFromPageStart = true;
                });
                return needRestartFromPageStart;
            };
            BaseFormatter.prototype.tableIsEditable = function (table) {
                var tableInterval = __aspxRichEdit.FixedInterval.fromPositions(table.getStartPosition(), table.getEndPosition());
                return this.subDocument.isEditable([tableInterval]);
            };
            BaseFormatter.correctColumnOffsets = function (pageArea) {
                var columns = pageArea.columns;
                if (!columns.length)
                    return;
                var offsetFirstColumnFromPageArea = columns[0].pageAreaOffset;
                if (offsetFirstColumnFromPageArea != 0) {
                    pageArea.pageOffset += offsetFirstColumnFromPageArea;
                    for (var _i = 0, columns_1 = columns; _i < columns_1.length; _i++) {
                        var column = columns_1[_i];
                        column.pageAreaOffset -= offsetFirstColumnFromPageArea;
                    }
                }
            };
            BaseFormatter.correctRowOffsets = function (column) {
                var rows = column.rows;
                if (!rows.length)
                    return;
                var offsetFirstRowFromColumn = rows[0].columnOffset;
                if (offsetFirstRowFromColumn != 0) {
                    column.pageAreaOffset += offsetFirstRowFromColumn;
                    for (var _i = 0, rows_1 = rows; _i < rows_1.length; _i++) {
                        var row = rows_1[_i];
                        row.columnOffset -= offsetFirstRowFromColumn;
                    }
                }
            };
            BaseFormatter.correctBoxOffsets = function (row) {
                var boxes = row.boxes;
                if (!boxes)
                    return;
                var offsetFirstBoxFromRow = boxes[0].rowOffset;
                if (offsetFirstBoxFromRow != 0) {
                    row.columnOffset += offsetFirstBoxFromRow;
                    for (var _i = 0, boxes_1 = boxes; _i < boxes_1.length; _i++) {
                        var box = boxes_1[_i];
                        box.rowOffset -= offsetFirstBoxFromRow;
                    }
                }
            };
            BaseFormatter.prototype.isColumnOk = function () {
                if (this.state == LayoutFormatter.LayoutFormatterState.ColumnEnd && !this.layoutPosition.column.rows[0])
                    throw new Error(__aspxRichEdit.Errors.InternalException);
            };
            return BaseFormatter;
        }());
        LayoutFormatter.BaseFormatter = BaseFormatter;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutChangeType;
    (function (LayoutChangeType) {
        LayoutChangeType[LayoutChangeType["Deleted"] = 0] = "Deleted";
        LayoutChangeType[LayoutChangeType["Replaced"] = 1] = "Replaced";
        LayoutChangeType[LayoutChangeType["Updated"] = 2] = "Updated";
        LayoutChangeType[LayoutChangeType["Inserted"] = 3] = "Inserted";
    })(LayoutChangeType = __aspxRichEdit.LayoutChangeType || (__aspxRichEdit.LayoutChangeType = {}));
    var LayoutChangeBase = (function () {
        function LayoutChangeBase(index, changeType) {
            if (changeType === void 0) { changeType = LayoutChangeType.Updated; }
            this.index = index;
            this.changeType = changeType;
        }
        Object.defineProperty(LayoutChangeBase.prototype, "layoutIndex", {
            get: function () { return this.index; },
            enumerable: true,
            configurable: true
        });
        ;
        Object.defineProperty(LayoutChangeBase.prototype, "canvasIndex", {
            get: function () { return this.index; },
            enumerable: true,
            configurable: true
        });
        ;
        LayoutChangeBase.prototype.summarizeChanges = function (_change) {
        };
        return LayoutChangeBase;
    }());
    __aspxRichEdit.LayoutChangeBase = LayoutChangeBase;
    var AnchoredPictureChange = (function (_super) {
        __extends(AnchoredPictureChange, _super);
        function AnchoredPictureChange() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        AnchoredPictureChange.prototype.reduceChanges = function () {
            return this.changeType == LayoutChangeType.Updated ? null : this;
        };
        return AnchoredPictureChange;
    }(LayoutChangeBase));
    __aspxRichEdit.AnchoredPictureChange = AnchoredPictureChange;
    var ParagraphFrameChange = (function (_super) {
        __extends(ParagraphFrameChange, _super);
        function ParagraphFrameChange() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphFrameChange.prototype.reduceChanges = function () {
            return this.changeType == LayoutChangeType.Updated ? null : this;
        };
        return ParagraphFrameChange;
    }(LayoutChangeBase));
    __aspxRichEdit.ParagraphFrameChange = ParagraphFrameChange;
    var RowChange = (function (_super) {
        __extends(RowChange, _super);
        function RowChange() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RowChange.prototype.reduceChanges = function () {
            return this.changeType == LayoutChangeType.Updated ? null : this;
        };
        return RowChange;
    }(LayoutChangeBase));
    __aspxRichEdit.RowChange = RowChange;
    var TableChange = (function (_super) {
        __extends(TableChange, _super);
        function TableChange() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableChange.prototype.reduceChanges = function () {
            return this.changeType == LayoutChangeType.Updated ? null : this;
        };
        return TableChange;
    }(LayoutChangeBase));
    __aspxRichEdit.TableChange = TableChange;
    var RowChangeSV = (function (_super) {
        __extends(RowChangeSV, _super);
        function RowChangeSV(layoutIndex, canvasIndex, changeType) {
            var _this = _super.call(this, canvasIndex, changeType) || this;
            _this._layoutIndex = layoutIndex;
            return _this;
        }
        Object.defineProperty(RowChangeSV.prototype, "layoutIndex", {
            get: function () { return this._layoutIndex; },
            enumerable: true,
            configurable: true
        });
        ;
        Object.defineProperty(RowChangeSV.prototype, "canvasIndex", {
            get: function () { return this.index; },
            enumerable: true,
            configurable: true
        });
        ;
        return RowChangeSV;
    }(RowChange));
    __aspxRichEdit.RowChangeSV = RowChangeSV;
    var TableChangeSV = (function (_super) {
        __extends(TableChangeSV, _super);
        function TableChangeSV(layoutIndex, canvasIndex, changeType) {
            var _this = _super.call(this, canvasIndex, changeType) || this;
            _this._layoutIndex = layoutIndex;
            return _this;
        }
        Object.defineProperty(TableChangeSV.prototype, "layoutIndex", {
            get: function () { return this._layoutIndex; },
            enumerable: true,
            configurable: true
        });
        ;
        Object.defineProperty(TableChangeSV.prototype, "canvasIndex", {
            get: function () { return this.index; },
            enumerable: true,
            configurable: true
        });
        ;
        return TableChangeSV;
    }(TableChange));
    __aspxRichEdit.TableChangeSV = TableChangeSV;
    var ParagraphFrameChangeSV = (function (_super) {
        __extends(ParagraphFrameChangeSV, _super);
        function ParagraphFrameChangeSV(layoutIndex, canvasIndex, changeType) {
            var _this = _super.call(this, canvasIndex, changeType) || this;
            _this._layoutIndex = layoutIndex;
            return _this;
        }
        Object.defineProperty(ParagraphFrameChangeSV.prototype, "layoutIndex", {
            get: function () { return this._layoutIndex; },
            enumerable: true,
            configurable: true
        });
        ;
        Object.defineProperty(ParagraphFrameChangeSV.prototype, "canvasIndex", {
            get: function () { return this.index; },
            enumerable: true,
            configurable: true
        });
        ;
        return ParagraphFrameChangeSV;
    }(ParagraphFrameChange));
    __aspxRichEdit.ParagraphFrameChangeSV = ParagraphFrameChangeSV;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var GridCalculator = (function () {
                function GridCalculator(grid, cache, boxIterator, avaliableSpacing) {
                    this.grid = grid;
                    this.cache = cache;
                    this.boxIterator = boxIterator;
                    this.maxTableWidth = avaliableSpacing;
                    this.percentBaseWidth = Math.max(0, avaliableSpacing - this.currCache.indent.asNumberNoPercentType(__aspxRichEdit.UnitConverter.twipsToPixels));
                    var intervals = Table.ColumnWidthEngine.Calculator.getIntervals(this.table);
                    if (__aspxRichEdit.ListUtils.anyOf(intervals, function (c) { return c.colSpan != 1; }))
                        throw new Error(__aspxRichEdit.Errors.InternalException);
                    this.columns = __aspxRichEdit.ListUtils.map(intervals, this.makeInterval);
                    this.fillMembers();
                    this.flex = this.numIntervalsInModelUnits == 0;
                    this.calculateIntervals();
                }
                Object.defineProperty(GridCalculator.prototype, "table", {
                    get: function () { return this.grid.table; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(GridCalculator.prototype, "currCache", {
                    get: function () { return this.cache[this.table.index]; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(GridCalculator.prototype, "subDocument", {
                    get: function () { return this.boxIterator.subDocument; },
                    enumerable: true,
                    configurable: true
                });
                GridCalculator.prototype.getColumns = function () {
                    return new Table.Columns(this.columns);
                };
                GridCalculator.prototype.fillMembers = function () {
                    this.numIntervalsInModelUnits = 0;
                    this.numIntervalsInPercents = 0;
                    this.numIntervalsAsAuto = 0;
                    this.numIntervalsAsNil = 0;
                    this.widthInModelUnits = 0;
                    this.widthInPercents = 0;
                    for (var _i = 0, _a = this.columns; _i < _a.length; _i++) {
                        var col = _a[_i];
                        switch (col.type) {
                            case __aspxRichEdit.TableWidthUnitType.ModelUnits:
                                this.numIntervalsInModelUnits++;
                                this.widthInModelUnits += col.width;
                                break;
                            case __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent:
                                this.numIntervalsInPercents++;
                                this.widthInPercents += col.width;
                                break;
                            case __aspxRichEdit.TableWidthUnitType.Auto:
                                this.numIntervalsAsAuto++;
                                break;
                            case __aspxRichEdit.TableWidthUnitType.Nil:
                                this.numIntervalsAsNil++;
                                break;
                        }
                    }
                };
                return GridCalculator;
            }());
            Table.GridCalculator = GridCalculator;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SimpleViewCanvasSizeManager = (function () {
        function SimpleViewCanvasSizeManager(canvasManager, action) {
            this.id = null;
            this.size = new __aspxRichEdit.Size(0, 0);
            this.action = action;
            this.canvasManager = canvasManager;
        }
        SimpleViewCanvasSizeManager.prototype.changeSize = function (force) {
            var curr = new __aspxRichEdit.Size(this.canvasManager.getCanvasWidth(), this.canvasManager.controlHeightProvider.getVisibleAreaHeight(false));
            if (force || !curr.equals(this.size)) {
                this.size = curr;
                this.action();
            }
        };
        SimpleViewCanvasSizeManager.prototype.setViewMode = function (val) {
            var _this = this;
            if (val) {
                this.changeSize(true);
                if (this.id != null)
                    return;
                this.id = setInterval(function () { return _this.changeSize(false); }, SimpleViewCanvasSizeManager.DELAY);
            }
            else {
                if (this.id != null) {
                    clearInterval(this.id);
                    this.id = null;
                }
                this.action();
            }
        };
        SimpleViewCanvasSizeManager.DELAY = 1000;
        return SimpleViewCanvasSizeManager;
    }());
    __aspxRichEdit.SimpleViewCanvasSizeManager = SimpleViewCanvasSizeManager;
    var DocumentRenderer = (function () {
        function DocumentRenderer(viewManager) {
            this.viewManager = viewManager;
            if (this.viewManager.innerClientProperties.viewsSettings.isSimpleView)
                REWebUtils.AddClassNameToElement(this.viewManager.canvas, DocumentRenderer.CLASSNAMES.SIMPLE_VIEW);
        }
        Object.defineProperty(DocumentRenderer.prototype, "cache", {
            get: function () { return this.viewManager.cache; },
            enumerable: true,
            configurable: true
        });
        DocumentRenderer.prototype.onViewTypeChanged = function () {
            switch (this.viewManager.innerClientProperties.viewsSettings.viewType) {
                case __aspxRichEdit.ViewType.Simple:
                    REWebUtils.AddClassNameToElement(this.viewManager.canvas, DocumentRenderer.CLASSNAMES.SIMPLE_VIEW);
                    break;
                case __aspxRichEdit.ViewType.PrintLayout:
                    REWebUtils.RemoveClassNameFromElement(this.viewManager.canvas, DocumentRenderer.CLASSNAMES.SIMPLE_VIEW);
                    break;
            }
        };
        DocumentRenderer.prototype.applyPageChange = function (layoutPage, pageChange) {
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.DocumentRenderer, "applyPageChanges", "pageIndex " + pageChange.index);
            var pageFromCache = this.cache[pageChange.index];
            for (var _i = 0, _a = pageChange.mainPageAreaChanges; _i < _a.length; _i++) {
                var pageAreaChange = _a[_i];
                this.applyMainPageAreaChange(pageFromCache, layoutPage, pageAreaChange);
            }
            for (var _b = 0, _c = pageChange.otherPageAreaChanges; _b < _c.length; _b++) {
                var pageAreaChange = _c[_b];
                this.applyOtherPageAreaChange(pageFromCache, layoutPage, pageAreaChange);
            }
            for (var _d = 0, _e = pageChange.anchoredPictureChanges; _d < _e.length; _d++) {
                var anchoredPictureChange = _e[_d];
                this.applyAnchorPictureChange(pageFromCache, layoutPage, anchoredPictureChange);
            }
        };
        DocumentRenderer.prototype.applyAnchorPictureChange = function (cache, layoutPage, ancPicChange) {
            var objId = ancPicChange.index;
            switch (ancPicChange.changeType) {
                case __aspxRichEdit.LayoutChangeType.Deleted: {
                    DocumentRenderer.removeFromContainerByObject(objId, DocumentRenderer.getAnchoredObjectsContainer(cache.page), cache.anchoredPicture);
                    break;
                }
                case __aspxRichEdit.LayoutChangeType.Replaced: {
                    var obj = layoutPage.anchoredObjectHolder.getObjById(objId);
                    DocumentRenderer.replaceFromContainerByObject(objId, DocumentRenderer.getAnchoredObjectsContainer(cache.page), cache.anchoredPicture, this.renderFloatingPicture(obj));
                    break;
                }
                case __aspxRichEdit.LayoutChangeType.Updated: {
                    break;
                }
                case __aspxRichEdit.LayoutChangeType.Inserted: {
                    var obj = layoutPage.anchoredObjectHolder.getObjById(objId);
                    DocumentRenderer.insertToContainerByObject(objId, DocumentRenderer.getAnchoredObjectsContainer(cache.page), cache.anchoredPicture, this.renderFloatingPicture(obj));
                    break;
                }
                default: throw new Error(__aspxRichEdit.Errors.InternalException);
            }
        };
        DocumentRenderer.prototype.applyMainPageAreaChange = function (pageCache, layoutPage, pageAreaChange) {
            switch (pageAreaChange.changeType) {
                case __aspxRichEdit.LayoutChangeType.Deleted:
                    DocumentRenderer.removeFromContainerByIndex(pageCache.page, pageAreaChange.canvasIndex, DocumentRenderer.getMainPageAreaContainerCore);
                    break;
                case __aspxRichEdit.LayoutChangeType.Replaced:
                    DocumentRenderer.replaceInContainer(pageCache.page, pageAreaChange.canvasIndex, this.renderPageArea(pageCache, layoutPage.mainSubDocumentPageAreas[pageAreaChange.layoutIndex], null), DocumentRenderer.getMainPageAreaContainerCore);
                    break;
                case __aspxRichEdit.LayoutChangeType.Updated: {
                    var layoutPageArea = layoutPage.mainSubDocumentPageAreas[pageAreaChange.layoutIndex];
                    var pageAreaElement = DocumentRenderer.getMainPageAreaContainerCore(pageCache.page).childNodes[pageAreaChange.canvasIndex];
                    for (var _i = 0, _a = pageAreaChange.columnChanges; _i < _a.length; _i++) {
                        var columnChange = _a[_i];
                        this.applyColumnChange(pageAreaElement, layoutPageArea, columnChange, __aspxRichEdit.ZIndexHelper.mainHeaderFooterPageAreaLevel);
                    }
                    break;
                }
                default: throw new Error(__aspxRichEdit.Errors.InternalException);
            }
        };
        DocumentRenderer.prototype.applyOtherPageAreaChange = function (cache, layoutPage, pageAreaChange) {
            var subDocId = pageAreaChange.index;
            var pageArea = layoutPage.otherPageAreas[subDocId];
            switch (pageAreaChange.changeType) {
                case __aspxRichEdit.LayoutChangeType.Deleted: {
                    DocumentRenderer.removeFromContainerByObject(subDocId, DocumentRenderer.getOtherPageAreaContainerCore(cache.page), cache.otherAreas);
                    DocumentRenderer.removeFromContainerByObject(subDocId, DocumentRenderer.getTextBoxBackgroundContainer(cache.page), cache.textBoxBgElements);
                    break;
                }
                case __aspxRichEdit.LayoutChangeType.Replaced: {
                    DocumentRenderer.replaceFromContainerByObject(subDocId, DocumentRenderer.getOtherPageAreaContainerCore(cache.page), cache.otherAreas, this.renderPageArea(cache, pageArea, pageArea.subDocument.isTextBox() ? layoutPage.anchoredObjectHolder.getTextBoxByInternalSubDocId(subDocId) : null));
                    break;
                }
                case __aspxRichEdit.LayoutChangeType.Updated: {
                    var pageAreaElement = cache.otherAreas[subDocId];
                    var level = pageArea.subDocument.isTextBox() ?
                        layoutPage.anchoredObjectHolder.getTextBoxByInternalSubDocId(subDocId).rendererLevel :
                        __aspxRichEdit.ZIndexHelper.mainHeaderFooterPageAreaLevel;
                    for (var _i = 0, _a = pageAreaChange.columnChanges; _i < _a.length; _i++) {
                        var columnChange = _a[_i];
                        this.applyColumnChange(pageAreaElement, pageArea, columnChange, level);
                    }
                    break;
                }
                case __aspxRichEdit.LayoutChangeType.Inserted: {
                    DocumentRenderer.insertToContainerByObject(subDocId, DocumentRenderer.getOtherPageAreaContainerCore(cache.page), cache.otherAreas, this.renderPageArea(cache, pageArea, pageArea.subDocument.isTextBox() ? layoutPage.anchoredObjectHolder.getTextBoxByInternalSubDocId(subDocId) : null));
                    break;
                }
                default: throw new Error(__aspxRichEdit.Errors.InternalException);
            }
        };
        DocumentRenderer.prototype.applyColumnChange = function (pageAreaElement, layoutPageArea, columnChange, level) {
            var _this = this;
            switch (columnChange.changeType) {
                case __aspxRichEdit.LayoutChangeType.Deleted:
                    DocumentRenderer.removeFromContainerByIndex(pageAreaElement, columnChange.canvasIndex, DocumentRenderer.getColumnsContainerCore);
                    break;
                case __aspxRichEdit.LayoutChangeType.Replaced: {
                    var renderedColumn = this.renderColumn(layoutPageArea.columns[columnChange.layoutIndex], level, layoutPageArea.subDocument.isMain());
                    DocumentRenderer.replaceInContainer(pageAreaElement, columnChange.canvasIndex, renderedColumn, DocumentRenderer.getColumnsContainerCore);
                    break;
                }
                case __aspxRichEdit.LayoutChangeType.Updated: {
                    var layoutColumn_1 = layoutPageArea.columns[columnChange.layoutIndex];
                    var columnElement = DocumentRenderer.getColumnsContainerCore(pageAreaElement).childNodes[columnChange.canvasIndex];
                    for (var _i = 0, _a = columnChange.rowChanges; _i < _a.length; _i++) {
                        var rowChange = _a[_i];
                        DocumentRenderer.applyChange(columnElement, rowChange, DocumentRenderer.getRowsContainerCore, function () { return _this.renderRow(layoutColumn_1.rows[rowChange.layoutIndex], level); });
                    }
                    for (var _b = 0, _c = columnChange.tableChanges; _b < _c.length; _b++) {
                        var tableChange = _c[_b];
                        DocumentRenderer.applyChange(columnElement, tableChange, DocumentRenderer.getTablesContainerCore, function () { return DocumentRenderer.renderTable(layoutColumn_1.tablesInfo[tableChange.layoutIndex], level, _this.viewManager.innerClientProperties.showTableGridLines); });
                    }
                    for (var _d = 0, _e = columnChange.paragraphFrameChanges; _d < _e.length; _d++) {
                        var paragraphFrameChange = _e[_d];
                        DocumentRenderer.applyChange(columnElement, paragraphFrameChange, DocumentRenderer.getParagraphFramesContainerCore, function () { return DocumentRenderer.renderParagraphFrame(layoutColumn_1.paragraphFrames[paragraphFrameChange.layoutIndex], level); });
                    }
                    break;
                }
                case __aspxRichEdit.LayoutChangeType.Inserted: {
                    var renderedColumn = this.renderColumn(layoutPageArea.columns[columnChange.layoutIndex], level, layoutPageArea.subDocument.isMain());
                    DocumentRenderer.insertInContainer(pageAreaElement, columnChange.canvasIndex, renderedColumn, DocumentRenderer.getColumnsContainerCore);
                    break;
                }
                default: throw new Error(__aspxRichEdit.Errors.InternalException);
            }
        };
        DocumentRenderer.applyChange = function (topLevelNode, change, getContainer, getRenderedElement) {
            switch (change.changeType) {
                case __aspxRichEdit.LayoutChangeType.Deleted:
                    DocumentRenderer.removeFromContainerByIndex(topLevelNode, change.canvasIndex, getContainer);
                    break;
                case __aspxRichEdit.LayoutChangeType.Replaced:
                    DocumentRenderer.replaceInContainer(topLevelNode, change.canvasIndex, getRenderedElement(), getContainer);
                    break;
                case __aspxRichEdit.LayoutChangeType.Inserted:
                    DocumentRenderer.insertInContainer(topLevelNode, change.canvasIndex, getRenderedElement(), getContainer);
                    break;
                case __aspxRichEdit.LayoutChangeType.Updated:
                    break;
                default: throw new Error(__aspxRichEdit.Errors.InternalException);
            }
        };
        DocumentRenderer.prototype.renderPage = function (layoutPage, layoutPageIndex, renderInnerContent) {
            layoutPage.flags.set(__aspxRichEdit.LayoutPageFlags.IsSelectionRendered, false);
            layoutPage.flags.set(__aspxRichEdit.LayoutPageFlags.IsMisspelledSelectionRendered, false);
            layoutPage.flags.set(__aspxRichEdit.LayoutPageFlags.IsRangePermissionsRendered, false);
            var pageCache = this.cache[layoutPageIndex];
            if (pageCache) {
                var pageElement = pageCache.page;
                this.updatePageClasses(pageElement);
                this.updatePageSize(layoutPage, pageElement);
                DocumentRenderer.updatePageColor(pageElement, this.viewManager.layout.pageColor);
                if (pageElement.childNodes.length > 1)
                    this.removePageContent(layoutPageIndex);
            }
            else {
                var pageElement = DocumentRenderer.renderContainer("");
                pageElement.appendChild(DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.SERVICE_CONTAINER));
                DocumentRenderer.updatePageColor(pageElement, this.viewManager.layout.pageColor);
                this.updatePageClasses(pageElement);
                this.updatePageSize(layoutPage, pageElement);
                DocumentRenderer.insertInContainer(this.viewManager.pagesContainer, layoutPageIndex, pageElement, function (node) { return node; });
                this.cache.splice(layoutPageIndex, 0, new DocumentRendererPageCache(pageElement));
            }
            if (renderInnerContent)
                this.renderPageContent(layoutPage, layoutPageIndex);
        };
        DocumentRenderer.prototype.removePage = function (pageIndex) {
            var pageCache = this.cache[pageIndex];
            if (pageCache) {
                pageCache.page.parentNode.removeChild(pageCache.page);
                this.cache.splice(pageIndex, 1);
            }
        };
        DocumentRenderer.prototype.updatePageSize = function (page, pageElement) {
            if (pageElement.offsetHeight != page.height || pageElement.offsetWidth != page.width)
                __aspxRichEdit.HTMLUtils.setStyleSize(pageElement.style, page);
        };
        DocumentRenderer.prototype.updatePageClasses = function (pageElement) {
            pageElement.className = DocumentRenderer.CLASSNAMES.PAGE;
            if (this.viewManager.innerClientProperties.viewsSettings.isSimpleView)
                pageElement.classList.add(DocumentRenderer.CLASSNAMES.SIMPLE_PAGE);
        };
        DocumentRenderer.prototype.removePageContent = function (pageIndex) {
            var pageCache = this.cache[pageIndex];
            if (pageCache)
                pageCache.removeContent();
        };
        DocumentRenderer.prototype.renderPageContainers = function (pageCache) {
            pageCache.page.appendChild(DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.SELECTION_CONTAINER));
            pageCache.page.appendChild(DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.SEARCH_SELECTION_CONTAINER));
            pageCache.page.appendChild(DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.MISSPELLED_SELECTION_CONTAINER));
            pageCache.page.appendChild(DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.RANGE_PERMISSIONS_CONTAINER));
            var result = [
                pageCache.page.appendChild(DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.MAIN_PAGE_AREA_CONTAINER)),
                pageCache.page.appendChild(DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.OTHER_PAGE_AREA_CONTAINER)),
                pageCache.page.appendChild(DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.FLOATING_OBJECTS_CONTAINER))
            ];
            pageCache.page.appendChild(DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.SHAPE_BG_CONTAINER));
            return result;
        };
        DocumentRenderer.prototype.renderPageContent = function (page, pageIndex) {
            var _this = this;
            var pageCache = this.cache[pageIndex];
            var _a = this.renderPageContainers(pageCache), mainPageAreasContainer = _a[0], otherPageAreasContainer = _a[1], floatingObjectsContainer = _a[2];
            __aspxRichEdit.ListUtils.foreach(page.mainSubDocumentPageAreas, function (area) {
                return mainPageAreasContainer.appendChild(_this.renderPageArea(pageCache, area, null));
            });
            if (!this.viewManager.innerClientProperties.viewsSettings.isSimpleView)
                __aspxRichEdit.MapUtilsKeyAsNumber.foreach(page.otherPageAreas, function (pageArea, subDocId) {
                    if (!pageArea.subDocument.isTextBox())
                        DocumentRenderer.insertToContainerByObject(subDocId, otherPageAreasContainer, pageCache.otherAreas, _this.renderPageArea(pageCache, pageArea, null));
                });
            ;
            for (var _i = 0, _b = this.renderPageContentGetFloatingObjects(page); _i < _b.length; _i++) {
                var ancObjProps = _b[_i];
                switch (ancObjProps.getType()) {
                    case __aspxRichEdit.LayoutBoxType.AnchorTextBox:
                        var internalSubDocId = ancObjProps.internalSubDocId;
                        DocumentRenderer.insertToContainerByObject(internalSubDocId, otherPageAreasContainer, pageCache.otherAreas, this.renderPageArea(pageCache, page.otherPageAreas[internalSubDocId], ancObjProps));
                        break;
                    case __aspxRichEdit.LayoutBoxType.AnchorPicture:
                        DocumentRenderer.insertToContainerByObject(ancObjProps.objectId, floatingObjectsContainer, pageCache.anchoredPicture, this.renderFloatingPicture(ancObjProps));
                        break;
                }
            }
        };
        DocumentRenderer.updatePageColor = function (pageElement, newColor) {
            var newStringColor = __aspxRichEdit.ColorHelper.colorToHash(newColor);
            if (pageElement.style.backgroundColor != newStringColor)
                pageElement.style.backgroundColor = __aspxRichEdit.ColorHelper.isEmptyBgColor(newColor) ? "" : newStringColor;
        };
        DocumentRenderer.getPageAreaClassname = function (area) {
            switch (area.subDocument.info.getType()) {
                case __aspxRichEdit.SubDocumentInfoType.Main:
                case __aspxRichEdit.SubDocumentInfoType.Header:
                case __aspxRichEdit.SubDocumentInfoType.Footer:
                    return DocumentRenderer.CLASSNAMES.PAGE_AREA;
                case __aspxRichEdit.SubDocumentInfoType.TextBox:
                    return DocumentRenderer.CLASSNAMES.PAGE_AREA + " " + DocumentRenderer.CLASSNAMES.FLOATING_OBJECT_TEXT_BOX_AREA;
            }
            throw new Error(__aspxRichEdit.Errors.InternalException);
        };
        DocumentRenderer.prototype.renderPageArea = function (pageCache, area, textBox, renderContent) {
            if (renderContent === void 0) { renderContent = true; }
            var element = DocumentRenderer.renderContainer(DocumentRenderer.getPageAreaClassname(area));
            if (area.subDocument.isTextBox())
                element.style.overflow = "hidden";
            __aspxRichEdit.HTMLUtils.setStyleSizeAndPosition(element.style, area);
            var level = area.subDocument.isTextBox() ? textBox.rendererLevel : __aspxRichEdit.ZIndexHelper.mainHeaderFooterPageAreaLevel;
            if (area.subDocument.isTextBox()) {
                var textBoxShapeInfo = DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.TEXT_BOX_BG + " " + __aspxRichEdit.ZIndexHelper.getClassName(level, __aspxRichEdit.zIndexCssClassType.TextBoxBg));
                var oldBgElem = pageCache.textBoxBgElements[area.subDocument.id];
                if (oldBgElem)
                    __aspxRichEdit.HTMLUtils.hideNode(oldBgElem);
                pageCache.textBoxBgElements[area.subDocument.id] = textBoxShapeInfo;
                DocumentRenderer.setShapePropertiesToElement(textBoxShapeInfo, textBox.shape);
                __aspxRichEdit.HTMLUtils.setStyleSize(textBoxShapeInfo.style, area);
                __aspxRichEdit.HTMLUtils.setStylePosition(textBoxShapeInfo.style, new __aspxRichEdit.Point(textBox.x - textBox.shape.outlineWidth, textBox.y - textBox.shape.outlineWidth));
                DocumentRenderer.setRotationInRadians(textBoxShapeInfo, textBox.rotationInRadians);
                DocumentRenderer.getTextBoxBackgroundContainer(pageCache.page).appendChild(textBoxShapeInfo);
                __aspxRichEdit.HTMLUtils.setStylePosition(element.style, new __aspxRichEdit.Point(textBox.x - textBox.shape.outlineWidth, textBox.y - textBox.shape.outlineWidth));
                if (DocumentRenderer.setRotationInRadians(element, textBox.rotationInRadians))
                    REWebUtils.AddClassNameToElement(element, __aspxRichEdit.ZIndexHelper.getClassName(level, __aspxRichEdit.zIndexCssClassType.TextBox));
            }
            if (renderContent)
                for (var _i = 0, _a = area.columns; _i < _a.length; _i++) {
                    var column = _a[_i];
                    element.appendChild(this.renderColumn(column, level, area.subDocument.isMain()));
                }
            return element;
        };
        DocumentRenderer.prototype.renderColumn = function (column, level, _isMainPageArea) {
            var columnElement = DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.COLUMN);
            __aspxRichEdit.HTMLUtils.setStyleSizeAndPosition(columnElement.style, column);
            var rowsContainer = columnElement.appendChild(DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.ROWS_CONTAINER));
            var paragraphFramesContainer = columnElement.appendChild(DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.PARAGRAPHFRAMES_CONTAINER));
            var tablesContainer = columnElement.appendChild(DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.TABLES_CONTAINER));
            for (var _i = 0, _a = column.rows; _i < _a.length; _i++) {
                var row = _a[_i];
                rowsContainer.appendChild(this.renderRow(row, level));
            }
            for (var _b = 0, _c = column.paragraphFrames; _b < _c.length; _b++) {
                var frame = _c[_b];
                paragraphFramesContainer.appendChild(DocumentRenderer.renderParagraphFrame(frame, level));
            }
            for (var _d = 0, _e = column.tablesInfo; _d < _e.length; _d++) {
                var tableColumn = _e[_d];
                tablesContainer.appendChild(DocumentRenderer.renderTable(tableColumn, level, this.viewManager.innerClientProperties.showTableGridLines));
            }
            return columnElement;
        };
        DocumentRenderer.prototype.renderRow = function (row, level) {
            var lastBoxIndexWhatCanStrikeoutAndUnderline = row.boxes.length - 1;
            for (var box = void 0; box = row.boxes[lastBoxIndexWhatCanStrikeoutAndUnderline]; lastBoxIndexWhatCanStrikeoutAndUnderline--)
                if (!box.renderNoStrikeoutAndNoUnderlineIfBoxInEndRow())
                    break;
            var content = "";
            if (row.numberingListBox) {
                content += this.renderBox(row, row.numberingListBox.textBox, 0 > lastBoxIndexWhatCanStrikeoutAndUnderline, level).html;
                if (row.numberingListBox.separatorBox)
                    content += this.renderBox(row, row.numberingListBox.separatorBox, 0 > lastBoxIndexWhatCanStrikeoutAndUnderline, level).html;
            }
            var increaseRowHeight = false;
            for (var boxIndex = 0, box = void 0; box = row.boxes[boxIndex]; boxIndex++) {
                if (box.getType() == __aspxRichEdit.LayoutBoxType.AnchorTextBox || box.getType() == __aspxRichEdit.LayoutBoxType.AnchorPicture)
                    continue;
                var boxRenderResult = this.renderBox(row, box, boxIndex > lastBoxIndexWhatCanStrikeoutAndUnderline, level);
                content += boxRenderResult.html;
                increaseRowHeight = increaseRowHeight || boxRenderResult.increaseRowHeight;
            }
            for (var _i = 0, _a = row.bookmarkBoxes; _i < _a.length; _i++) {
                var bookmarkBox = _a[_i];
                content += DocumentRenderer.renderBookmark(bookmarkBox, level);
            }
            var rowElement = DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.ROW);
            __aspxRichEdit.HTMLUtils.setStyleSizeAndPosition(rowElement.style, new __aspxRichEdit.Rectangle()
                .init(row.x, row.y + row.getSpacingBefore(), row.width, (row.height - row.getSpacingBefore()) + (increaseRowHeight ? 1 : 0)));
            rowElement.innerHTML = content;
            return rowElement;
        };
        DocumentRenderer.prototype.renderBox = function (row, box, noNeedUnderlineAndStrikeout, level) {
            var content = box.renderGetContent(this);
            var top = row.baseLine - box.getAscent() - row.getSpacingBefore();
            var left = box.x;
            if (box.characterProperties.script === __aspxRichEdit.CharacterFormattingScript.Subscript) {
                var multiplier = box.characterProperties.fontInfo.scriptMultiplier;
                top += __aspxRichEdit.UnitConverter.pointsToPixelsF(box.characterProperties.fontSize) * (box.characterProperties.fontInfo.subScriptOffset * multiplier - multiplier + 1);
            }
            var boxStyles = [];
            boxStyles.push("left: " + __aspxRichEdit.MathUtils.round(left, 3) + "px");
            boxStyles.push("top: " + __aspxRichEdit.MathUtils.round(top, 3) + "px");
            boxStyles.push("width: " + __aspxRichEdit.MathUtils.round(box.width, 3) + "px");
            boxStyles.push("height: " + __aspxRichEdit.MathUtils.round(box.height, 3) + "px");
            var props = box.renderGetCharacterProperties();
            var charProps = props.initProps;
            var colorProps = props.colorInfo;
            var underlineColor = colorProps.underlineColor;
            var strikeoutColor = colorProps.strikeoutColor;
            var textColor = colorProps.textColor;
            var needUnderline = !noNeedUnderlineAndStrikeout && (charProps.fontUnderlineType != __aspxRichEdit.UnderlineType.None) && (box.getType() != __aspxRichEdit.LayoutBoxType.Space || !charProps.underlineWordsOnly);
            var needStrikeout = !noNeedUnderlineAndStrikeout && (charProps.fontStrikeoutType != __aspxRichEdit.StrikeoutType.None) && (box.getType() != __aspxRichEdit.LayoutBoxType.Space || !charProps.strikeoutWordsOnly);
            if ((needStrikeout && needUnderline) || (needStrikeout && strikeoutColor != __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR) || (needUnderline && underlineColor != __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR)) {
                boxStyles = boxStyles.concat(__aspxRichEdit.HtmlConverter.getSizeSignificantRules(charProps));
                if (textColor != __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR && strikeoutColor == __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR && underlineColor == __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR)
                    boxStyles.push("color: " + __aspxRichEdit.ColorHelper.getCssStringInternal(textColor));
                var needColor = strikeoutColor != __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR ||
                    underlineColor != __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR;
                if (needColor && (!needStrikeout || strikeoutColor != __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR))
                    content = '<span style="color: ' + __aspxRichEdit.ColorHelper.getCssString(textColor, true) + ';">' + content + '</span>';
                if (needStrikeout) {
                    var strikeoutColorStyle = needColor ? ("color: " + __aspxRichEdit.ColorHelper.getCssString(strikeoutColor == __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR ? textColor : strikeoutColor, true)) : "";
                    content = '<span style="text-decoration: line-through;' + strikeoutColorStyle + '">' + content + '</span>';
                }
                if (needUnderline) {
                    var underlineColorStyle = needColor ? ("color: " + __aspxRichEdit.ColorHelper.getCssString(underlineColor == __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR ? textColor : underlineColor, true)) : "";
                    content = '<span style="text-decoration: underline;' + underlineColorStyle + '">' + content + '</span>';
                }
            }
            else
                boxStyles = boxStyles.concat(__aspxRichEdit.HtmlConverter.getCssRules(charProps, textColor, box.renderIsWordBox(), noNeedUnderlineAndStrikeout));
            var boxClass = "";
            switch (box.getType()) {
                case __aspxRichEdit.LayoutBoxType.Text:
                case __aspxRichEdit.LayoutBoxType.LayoutDependent:
                case __aspxRichEdit.LayoutBoxType.FieldCodeEnd:
                case __aspxRichEdit.LayoutBoxType.FieldCodeStart:
                case __aspxRichEdit.LayoutBoxType.ColumnBreak:
                case __aspxRichEdit.LayoutBoxType.LineBreak:
                case __aspxRichEdit.LayoutBoxType.PageBreak:
                case __aspxRichEdit.LayoutBoxType.ParagraphMark:
                case __aspxRichEdit.LayoutBoxType.SectionMark:
                    boxClass = DocumentRenderer.CLASSNAMES.BOX + " " + __aspxRichEdit.ZIndexHelper.getClassName(level, __aspxRichEdit.zIndexCssClassType.Box);
                    break;
                default:
                    boxClass = DocumentRenderer.CLASSNAMES.BOX_SPACE + " " + __aspxRichEdit.ZIndexHelper.getClassName(level, __aspxRichEdit.zIndexCssClassType.BoxSpace);
            }
            if (charProps.hidden && this.viewManager.innerClientProperties.showHiddenSymbols)
                boxClass += ' ' + DocumentRenderer.CLASSNAMES.HIDDEN_BOX;
            var html = '<span style="' + boxStyles.join(";") + '" class="' + boxClass + '">' + content + '</span>';
            var backColor = colorProps.foregroundColor;
            if (box.fieldLevel && (backColor == __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR || backColor == __aspxRichEdit.ColorHelper.NO_COLOR)) {
                var fieldBgClass = DocumentRenderer.CLASSNAMES.FIELD_BG + " " + __aspxRichEdit.ZIndexHelper.getClassName(level, __aspxRichEdit.zIndexCssClassType.FieldBg);
                switch (box.fieldLevel) {
                    case 1:
                        fieldBgClass += ' ' + DocumentRenderer.CLASSNAMES.FIELD_BOX_LEVEL1;
                        break;
                    case 2:
                        fieldBgClass += ' ' + DocumentRenderer.CLASSNAMES.FIELD_BOX_LEVEL2;
                        break;
                    default: fieldBgClass += ' ' + DocumentRenderer.CLASSNAMES.FIELD_BOX_LEVEL3;
                }
                html += '<span class="' + fieldBgClass + '" style="top: ' + top + 'px; left: ' + left + 'px; width: ' + box.width + 'px; height: ' + box.height + 'px"></span>';
            }
            if (__aspxRichEdit.ColorHelper.getAlpha(backColor) > 0 && !noNeedUnderlineAndStrikeout) {
                var height = row.height - row.getSpacingAfter();
                var bgBoxStyle = "top: 0px; left: " + Math.floor(box.x) + "px; width: " + Math.ceil(box.width) + "px; height: " + height + "px; background: " +
                    __aspxRichEdit.ColorHelper.getCssStringInternal(backColor) + ";";
                html += '<span class="' + DocumentRenderer.CLASSNAMES.BOX_BG + " " + __aspxRichEdit.ZIndexHelper.getClassName(level, __aspxRichEdit.zIndexCssClassType.BoxBg) +
                    '" style="' + bgBoxStyle + '"></span>';
            }
            if (box.hyperlinkTip)
                html = '<span title="' + __aspxRichEdit.HtmlConverter.buildHyperlinkTipString(box.hyperlinkTip) + '">' + html + "</span>";
            return new BoxRenderResult(html, charProps.hidden);
        };
        DocumentRenderer.renderBookmark = function (box, level) {
            var className = (box.boxType == __aspxRichEdit.LayoutBookmarkBoxType.StartBox ?
                DocumentRenderer.CLASSNAMES.START_BOOKMARK :
                DocumentRenderer.CLASSNAMES.END_BOOKMARK) + " " + __aspxRichEdit.ZIndexHelper.getClassName(level, __aspxRichEdit.zIndexCssClassType.Bookmark);
            return "<div class=\"" + className + "\" style=\"width: " + box.width + "px; height: " + box.height + "px; left: " + box.x + "px; top: " + box.y + "px; border-color: " + box.color + "\"></div>";
        };
        DocumentRenderer.prototype.renderPicture = function (box) {
            return DocumentRenderer.renderPictureBoxContent(box.height, box.width, box.id, box.isLoaded, this, box.hyperlinkTip);
        };
        DocumentRenderer.prototype.renderFloatingPicture = function (box) {
            var element = DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.ANCHORED_PICTURE + " " + __aspxRichEdit.ZIndexHelper.getClassName(box.rendererLevel, __aspxRichEdit.zIndexCssClassType.AnchoredPicture));
            __aspxRichEdit.HTMLUtils.setStyleSize(element.style, box);
            __aspxRichEdit.HTMLUtils.setStylePosition(element.style, new __aspxRichEdit.Point(box.x - box.shape.outlineWidth, box.y - box.shape.outlineWidth));
            DocumentRenderer.setShapePropertiesToElement(element, box.shape);
            DocumentRenderer.setRotationInRadians(element, box.rotationInRadians);
            element.innerHTML = box.renderGetContent(this);
            return element;
        };
        DocumentRenderer.setShapePropertiesToElement = function (element, shape) {
            element.style.backgroundColor = __aspxRichEdit.ColorHelper.getCssString(shape.fillColor, false);
            element.style.borderStyle = DocumentRenderer.borderTypeToString(__aspxRichEdit.BorderLineStyle.Single);
            element.style.borderColor = __aspxRichEdit.ColorHelper.getCssString(shape.outlineColor, false);
            element.style.borderWidth = shape.outlineWidth.toString() + "px";
        };
        DocumentRenderer.setRotationInRadians = function (element, rotation) {
            var isSetRotation = rotation != 0;
            element.style.transform = isSetRotation ? "rotate(" + rotation + "rad)" : "none";
            return isSetRotation;
        };
        DocumentRenderer.renderParagraphFrame = function (paragraphFrame, level) {
            var element = DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.PARAGRAPH_FRAME + " " + __aspxRichEdit.ZIndexHelper.getClassName(level, __aspxRichEdit.zIndexCssClassType.ParBg));
            DocumentRenderer.updateParagraphFrame(paragraphFrame, element);
            return element;
        };
        DocumentRenderer.updateParagraphFrame = function (frame, frameElement) {
            __aspxRichEdit.HTMLUtils.setStyleSizeAndPosition(frameElement.style, frame);
            frameElement.style.background = __aspxRichEdit.ColorHelper.getCssStringInternal(frame.paragraphColor);
        };
        DocumentRenderer.renderTable = function (tableColumnInfo, level, showTableGridLines) {
            var tblXPos = tableColumnInfo.x;
            var tblYPos = tableColumnInfo.y;
            var tblBgColor = tableColumnInfo.logicInfo.backgroundColor;
            var tableElement = DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.TABLE_ELEMENTS_CONTAINER);
            __aspxRichEdit.HTMLUtils.setStylePosition(tableElement.style, tableColumnInfo);
            var tblBordersContainer = tableElement.appendChild(DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.TABLE_BORDERS_CONTAINER));
            var tblRowsBgContainer = tableElement.appendChild(DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.TABLE_ROW_BACKGROUND_CONTAINER));
            var tblCellsBgContainer = tableElement.appendChild(DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.TABLE_CELL_BACKGROUND_CONTAINER));
            var tblCursorsContainer = DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.TABLE_CURSORS_CONTAINER);
            tblCursorsContainer.style.width = tableColumnInfo.width + "px";
            tblCursorsContainer.style.height = tableColumnInfo.height + "px";
            tableElement.appendChild(tblCursorsContainer);
            tblCursorsContainer["dxTableIndex"] = tableColumnInfo.logicInfo.grid.table.index;
            for (var i = 0, border = void 0; border = tableColumnInfo.horizontalBorders[i]; i++)
                DocumentRenderer.renderHorizontalBorder(tblBordersContainer, border, level, showTableGridLines);
            for (var i = 0, border = void 0; border = tableColumnInfo.verticalBorders[i]; i++)
                DocumentRenderer.renderVerticalBorder(tblBordersContainer, border, level, showTableGridLines);
            if (tableColumnInfo.logicInfo.isEditable) {
                for (var _i = 0, _a = tableColumnInfo.verticalCursorBorders; _i < _a.length; _i++) {
                    var border = _a[_i];
                    var element = DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.TABLE_COLUMN_CURSOR + " " +
                        __aspxRichEdit.ZIndexHelper.getClassName(level, __aspxRichEdit.zIndexCssClassType.TblCursor));
                    __aspxRichEdit.HTMLUtils.setStylePosition(element.style, new __aspxRichEdit.Point(border.xPos, border.yPos));
                    element.style.height = border.length + "px";
                    tblCursorsContainer.appendChild(element);
                }
                for (var _b = 0, _c = tableColumnInfo.horizontalCursorBorders; _b < _c.length; _b++) {
                    var border = _c[_b];
                    var element = DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.TABLE_ROW_CURSOR + " " +
                        __aspxRichEdit.ZIndexHelper.getClassName(level, __aspxRichEdit.zIndexCssClassType.TblCursor));
                    __aspxRichEdit.HTMLUtils.setStylePosition(element.style, new __aspxRichEdit.Point(border.xPos, border.yPos));
                    element.style.width = border.length + "px";
                    element["dxLayoutRowIndex"] = border.layoutRowIndex;
                    tblCursorsContainer.appendChild(element);
                }
            }
            for (var _d = 0, _e = tableColumnInfo.tableRows; _d < _e.length; _d++) {
                var tblRow = _e[_d];
                DocumentRenderer.renderTableBackgroundElement(DocumentRenderer.CLASSNAMES.TABLE_ROW_BG + " " + __aspxRichEdit.ZIndexHelper.getClassName(level, __aspxRichEdit.zIndexCssClassType.TblRowBg), tblRowsBgContainer, tblRow, tblXPos, tblYPos, tblBgColor);
                for (var _f = 0, _g = tblRow.backgroundInfos; _f < _g.length; _f++) {
                    var cellBgInfo = _g[_f];
                    DocumentRenderer.renderTableBackgroundElement(DocumentRenderer.CLASSNAMES.TABLE_CELL_BG + " " + __aspxRichEdit.ZIndexHelper.getClassName(level, __aspxRichEdit.zIndexCssClassType.TblCellBg), tblCellsBgContainer, cellBgInfo, 0, 0, cellBgInfo.color);
                }
            }
            return tableElement;
        };
        DocumentRenderer.renderTableBackgroundElement = function (className, container, bound, tblXPos, tblYPos, color) {
            if (__aspxRichEdit.ColorHelper.isEmptyBgColor(color))
                return;
            var elem = DocumentRenderer.renderContainer(className);
            __aspxRichEdit.HTMLUtils.setStylePosition(elem.style, new __aspxRichEdit.Point(bound.x - tblXPos, bound.y - tblYPos));
            __aspxRichEdit.HTMLUtils.setStyleSize(elem.style, bound);
            elem.style.backgroundColor = __aspxRichEdit.ColorHelper.colorToHash(color);
            container.appendChild(elem);
        };
        DocumentRenderer.renderVerticalBorder = function (tableBordersContainer, border, level, showTableGridLines) {
            var borderInfo = border.borderInfo;
            if (DocumentRenderer.isNotRenderTableBorder(borderInfo)) {
                if (showTableGridLines) {
                    var element = DocumentRenderer.createBorderElement(__aspxRichEdit.ColorHelper.LIGHT_COLOR, level);
                    __aspxRichEdit.HTMLUtils.setStyleSizeAndPosition(element.style, new __aspxRichEdit.Rectangle().init(border.xPos, border.yPos, 0, border.length));
                    element.style.borderStyle = "None";
                    element.style.borderRightWidth = "1px";
                    element.style.borderRightStyle = "dashed";
                    tableBordersContainer.appendChild(element);
                }
            }
            else {
                var element = DocumentRenderer.createBorderElement(borderInfo.color, level);
                __aspxRichEdit.HTMLUtils.setStyleSizeAndPosition(element.style, new __aspxRichEdit.Rectangle().init(border.xPos, border.yPos, 0, border.length));
                element.style.backgroundColor = "";
                element.style.borderStyle = "None";
                element.style.borderRightColor = __aspxRichEdit.ColorHelper.colorToHash(borderInfo.color);
                element.style.borderRightWidth = Math.max(1, borderInfo.width) + "px";
                element.style.borderRightStyle = DocumentRenderer.borderTypeToString(borderInfo.style);
                tableBordersContainer.appendChild(element);
            }
        };
        DocumentRenderer.renderHorizontalBorder = function (tableBordersContainer, border, level, showTableGridLines) {
            var borderInfo = border.borderInfo;
            if (DocumentRenderer.isNotRenderTableBorder(borderInfo)) {
                if (!showTableGridLines)
                    return;
                var element = DocumentRenderer.createBorderElement(__aspxRichEdit.ColorHelper.LIGHT_COLOR, level);
                __aspxRichEdit.HTMLUtils.setStyleSizeAndPosition(element.style, new __aspxRichEdit.Rectangle().init(border.xPos, border.yPos, border.length, 0));
                element.style.borderStyle = "None";
                element.style.borderBottomWidth = "1px";
                element.style.borderBottomStyle = "dashed";
                tableBordersContainer.appendChild(element);
            }
            else {
                var element = DocumentRenderer.createBorderElement(borderInfo.color, level);
                __aspxRichEdit.HTMLUtils.setStyleSizeAndPosition(element.style, new __aspxRichEdit.Rectangle().init(border.xPos, border.yPos, border.length, 0));
                element.style.backgroundColor = "";
                element.style.borderStyle = "None";
                element.style.borderBottomColor = __aspxRichEdit.ColorHelper.colorToHash(borderInfo.color);
                element.style.borderBottomWidth = Math.max(1, borderInfo.width) + "px";
                element.style.borderBottomStyle = DocumentRenderer.borderTypeToString(borderInfo.style);
                tableBordersContainer.appendChild(element);
            }
        };
        DocumentRenderer.createBorderElement = function (color, level) {
            var element = DocumentRenderer.renderContainer(DocumentRenderer.CLASSNAMES.TABLE_BORDER + " " + __aspxRichEdit.ZIndexHelper.getClassName(level, __aspxRichEdit.zIndexCssClassType.TableBorder));
            element.style.backgroundColor = __aspxRichEdit.ColorHelper.colorToHash(color);
            return element;
        };
        DocumentRenderer.isNotRenderTableBorder = function (borderInfo) {
            return !borderInfo || borderInfo.style == __aspxRichEdit.BorderLineStyle.None || borderInfo.style == __aspxRichEdit.BorderLineStyle.Nil;
        };
        DocumentRenderer.borderTypeToString = function (style) {
            var str = DocumentRenderer.mapBorderTypeToString[style];
            return str ? str : "solid";
        };
        DocumentRenderer.getServiceContainerCore = function (pageElement) {
            return pageElement.firstChild;
        };
        DocumentRenderer.getSelectionContainerCore = function (pageElement) {
            return pageElement.childNodes[1];
        };
        DocumentRenderer.getSearchSelectionContainerCore = function (pageElement) {
            return pageElement.childNodes[2];
        };
        DocumentRenderer.getMisspelledSelectionContainerCore = function (pageElement) {
            return pageElement.childNodes[3];
        };
        DocumentRenderer.getRangePermissionsContainerCore = function (pageElement) {
            return pageElement.childNodes[4];
        };
        DocumentRenderer.isPageElementConsiderAllContainers = function (pageElement) {
            return pageElement.childNodes.length > 1;
        };
        DocumentRenderer.getMainPageAreaContainerCore = function (pageElement) {
            return pageElement.childNodes[5];
        };
        DocumentRenderer.getOtherPageAreaContainerCore = function (pageElement) {
            return pageElement.childNodes[6];
        };
        DocumentRenderer.getAnchoredObjectsContainer = function (pageElement) {
            return pageElement.childNodes[7];
        };
        DocumentRenderer.getTextBoxBackgroundContainer = function (pageElement) {
            return pageElement.childNodes[8];
        };
        DocumentRenderer.getRowsContainerCore = function (columnElement) {
            return columnElement.firstChild;
        };
        DocumentRenderer.getParagraphFramesContainerCore = function (columnElement) {
            return REWebUtils.Browser.Chrome ? columnElement.firstChild.nextSibling : columnElement.childNodes[1];
        };
        DocumentRenderer.getTablesContainerCore = function (columnElement) {
            return columnElement.lastChild;
        };
        DocumentRenderer.getColumnsContainerCore = function (pageAreaElement) {
            return pageAreaElement;
        };
        DocumentRenderer.renderContainer = function (className) {
            var element = document.createElement("DIV");
            element.className = className;
            return element;
        };
        DocumentRenderer.removeFromContainerByIndex = function (node, index, getContainer) {
            var container = getContainer(node);
            var child = container.childNodes[index];
            if (child)
                container.removeChild(child);
        };
        DocumentRenderer.replaceInContainer = function (node, index, newRenderedElement, getContainer) {
            var container = getContainer(node);
            container.replaceChild(newRenderedElement, container.childNodes[index]);
        };
        DocumentRenderer.insertInContainer = function (node, index, newRenderedElement, getContainer) {
            var container = getContainer(node);
            if (index < container.childNodes.length)
                container.insertBefore(newRenderedElement, container.childNodes[index]);
            else
                container.appendChild(newRenderedElement);
        };
        DocumentRenderer.removeFromContainerByObject = function (id, container, cache) {
            var obj = cache[id];
            if (obj) {
                container.removeChild(obj);
                delete cache[id];
            }
        };
        DocumentRenderer.replaceFromContainerByObject = function (id, container, cache, newNode) {
            container.replaceChild(newNode, cache[id]);
            cache[id] = newNode;
        };
        DocumentRenderer.insertToContainerByObject = function (id, container, cache, newNode) {
            cache[id] = newNode;
            container.appendChild(newNode);
        };
        DocumentRenderer.renderPictureBoxContent = function (height, width, pictureId, isLoaded, renderer, tip) {
            var base64img = renderer.viewManager.imageCache.getBase64(pictureId);
            var src = base64img ? "" + base64img : renderer.viewManager.handlerURI + "&img=" + pictureId;
            var style = "height: " + height + "px; width: " + width + "px;";
            if (pictureId == renderer.viewManager.emptyImageCacheId && !base64img) {
                var innerContent = "";
                style += "display: inline-block; box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; border: 1px dashed";
                if (isLoaded) {
                    style += " red; font: 10px Arial; color: red; text-align: center; line-height: " + height + "px;";
                    innerContent = "Error";
                }
                else
                    style += " gray; background: url('" + DocumentRenderer.CONSTANTS.IMAGE_LOADING_URL + "') no-repeat center;";
                return "<span style=\"" + style + "\">" + innerContent + "</span>";
            }
            style += " vertical-align: baseline";
            return "<img src=\"" + src + "\"" + (tip ? "title=\"" + __aspxRichEdit.HtmlConverter.buildHyperlinkTipString(tip) + "\"" : "") + " style=\"" + style + "\" class=\"" + DocumentRenderer.CLASSNAMES.PICTURE + "\" />";
        };
        DocumentRenderer.CONSTANTS = {
            IMAGE_LOADING_URL: '<%=WebResource("custom:ImageLoadingUrl")%>'
        };
        DocumentRenderer.CLASSNAMES = {
            TOP_LEVEL_SERVICE_CONTAINER: "dxre-servicecontainer",
            SERVICE_CONTAINER: "dxrePageService",
            SELECTION_CONTAINER: "dxreSelection",
            SEARCH_SELECTION_CONTAINER: "dxreSearchSelection",
            MISSPELLED_SELECTION_CONTAINER: "dxreMisspelledSelection",
            RANGE_PERMISSIONS_CONTAINER: "dxreRangePermissions",
            MAIN_PAGE_AREA_CONTAINER: "dxreMainPa",
            OTHER_PAGE_AREA_CONTAINER: "dxreOtherPa",
            FLOATING_OBJECTS_CONTAINER: "dxreFloatingPic",
            SHAPE_BG_CONTAINER: "dxreShapeBgContainer",
            PAGES: "dxrePages",
            PAGE_AREA: "dxrePageArea",
            TEXT_BOX_BG: "dxreTextBoxBg",
            ROWS_CONTAINER: "dxreRows",
            PARAGRAPHFRAMES_CONTAINER: "dxreParFrames",
            TABLES_CONTAINER: "dxreTables",
            TABLE_ELEMENTS_CONTAINER: "dxreTable",
            TABLE_BORDERS_CONTAINER: "dxreTableBrds",
            TABLE_ROW_BACKGROUND_CONTAINER: "dxreTableRowBgds",
            TABLE_CELL_BACKGROUND_CONTAINER: "dxreTableCellBgds",
            TABLE_CURSORS_CONTAINER: "dxreTableCursors",
            ANCHORED_PICTURE: "dxreAncPic",
            SIMPLE_VIEW: "dxreSimpleView",
            PAGE: "dxrePage",
            SIMPLE_PAGE: "dxreSimplePage",
            COLUMN: "dxreColumn",
            ROW: "dxreRow",
            BLACKOUT: "dxreBlackout",
            TABLE_CELL_BG: "dxreTableCellBg",
            TABLE_ROW_BG: "dxreTableRowBg",
            PARAGRAPH_FRAME: "dxreParFrame",
            BOX_BG: "dxreBoxBg",
            FIELD_BG: "dxreFieldBg",
            FIELD_BOX_LEVEL1: "dxreFieldBoxLevel1",
            FIELD_BOX_LEVEL2: "dxreFieldBoxLevel2",
            FIELD_BOX_LEVEL3: "dxreFieldBoxLevel3",
            BOX_SPACE: "dxreBoxSpace",
            BOX: "dxreBox",
            HIDDEN_BOX: "dxreHiddenBox",
            PICTURE: "dxrePic",
            START_BOOKMARK: "dxreStartBookmark",
            END_BOOKMARK: "dxreEndBookmark",
            TABLE_BORDER: "dxreTableBrd",
            SELECTION_RANGE_PERMISSION: "dxreSelRangePerm",
            SELECTION_MISSPELLED: "dxreSelMisspelled",
            SELECTION_SEARCH: "dxreSelSearch",
            SELECTION_ROW: "dxreSelRow",
            SELECTION_CURSOR: "dxreSelCursor",
            SELECTION_FLOATING_OBJECTS: "dxreSelFloatingObjects",
            ANCHOR: "dxreAnchor",
            TABLE_ROW_CURSOR: "dxreTableRowCursor",
            TABLE_BORDER_LINE: "dxreTableBorderLine",
            DRAG_CARET: "dxreDragCaret",
            HEADER_INFO: "dxreHeaderInfo",
            FOOTER_INFO: "dxreFooterInfo",
            FULL_TABLE_SELECTOR: "dxreTblSelector",
            AUTO_SCROLL: "dxreAutoScroll",
            AUTO_SCROLL_CURSOR: "dxreAutoScrollCursor",
            AUTO_SCROLL_CURSOR_N: "dxreAutoScrollCursorN",
            AUTO_SCROLL_CURSOR_NS: "dxreAutoScrollCursorNS",
            AUTO_SCROLL_CURSOR_S: "dxreAutoScrollCursorS",
            FLOATING_OBJECT_TEXT_BOX_AREA: "dxreTextBoxArea",
            TABLE_COLUMN_CURSOR: "dxreTableColumnCursor",
            SELECTED_TEXTBOX: "dxreSelectedTextBox",
            CURSOR_NO_BLINK_CLASS_NAME: "dxreSelNoblink",
        };
        DocumentRenderer.mapBorderTypeToString = new __aspxRichEdit.MapCreatorNumberAsKey()
            .add(__aspxRichEdit.BorderLineStyle.Single, "solid")
            .add(__aspxRichEdit.BorderLineStyle.Dotted, "dotted")
            .add(__aspxRichEdit.BorderLineStyle.Dashed, "dashed")
            .add(__aspxRichEdit.BorderLineStyle.Double, "double")
            .add(__aspxRichEdit.BorderLineStyle.DashSmallGap, "dashed")
            .add(__aspxRichEdit.BorderLineStyle.DotDash, "dashed")
            .add(__aspxRichEdit.BorderLineStyle.DotDotDash, "dashed")
            .get();
        return DocumentRenderer;
    }());
    __aspxRichEdit.DocumentRenderer = DocumentRenderer;
    var DocumentRendererPageCache = (function () {
        function DocumentRendererPageCache(page) {
            this.page = page;
            this.init();
        }
        DocumentRendererPageCache.prototype.removeContent = function () {
            var serviceContainer = DocumentRenderer.getServiceContainerCore(this.page);
            __aspxRichEdit.HTMLUtils.clearInnerHtml(this.page);
            this.page.appendChild(serviceContainer);
            this.init();
        };
        DocumentRendererPageCache.prototype.init = function () {
            this.otherAreas = {};
            this.anchoredPicture = {};
            this.textBoxBgElements = {};
        };
        return DocumentRendererPageCache;
    }());
    __aspxRichEdit.DocumentRendererPageCache = DocumentRendererPageCache;
    var BoxRenderResult = (function () {
        function BoxRenderResult(html, increaseRowHeight) {
            this.html = html;
            this.increaseRowHeight = increaseRowHeight;
        }
        return BoxRenderResult;
    }());
    __aspxRichEdit.BoxRenderResult = BoxRenderResult;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var CanvasListener = (function () {
        function CanvasListener(viewManager, renderer) {
            this.viewManager = viewManager;
            this.renderer = renderer;
        }
        Object.defineProperty(CanvasListener.prototype, "layout", {
            get: function () { return this.viewManager.layout; },
            enumerable: true,
            configurable: true
        });
        CanvasListener.prototype.closeDocument = function () {
        };
        CanvasListener.mergeInnerPageChanges = function (pageChange) {
            pageChange.mainPageAreaChanges = new __aspxRichEdit.LayoutPageAreaChangesMerger().merge(pageChange.mainPageAreaChanges);
            for (var _i = 0, _a = pageChange.mainPageAreaChanges; _i < _a.length; _i++) {
                var pageAreaChange = _a[_i];
                pageAreaChange.columnChanges = new __aspxRichEdit.LayoutColumnChangesMerger().merge(pageAreaChange.columnChanges);
                for (var _b = 0, _c = pageAreaChange.columnChanges; _b < _c.length; _b++) {
                    var columnChanges = _c[_b];
                    columnChanges.rowChanges = new __aspxRichEdit.LayoutRowChangesMerger().merge(columnChanges.rowChanges);
                    columnChanges.tableChanges = new __aspxRichEdit.LayoutTableChangesMerger().merge(columnChanges.tableChanges);
                    columnChanges.paragraphFrameChanges = new __aspxRichEdit.LayoutParagraphFrameChangesMerger().merge(columnChanges.paragraphFrameChanges);
                }
            }
        };
        return CanvasListener;
    }());
    __aspxRichEdit.CanvasListener = CanvasListener;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ManipulatorHandlerBase = (function () {
        function ManipulatorHandlerBase(control, defaultStateConstructor, boxVisualizerManager) {
            this.mouseWheelEvent = false;
            this.control = control;
            this.boxVisualizerManager = boxVisualizerManager;
            this.defaultState = new defaultStateConstructor(this);
            this.switchToDefaultState();
        }
        ManipulatorHandlerBase.prototype.switchToDefaultState = function () {
            this.switchState(this.defaultState);
        };
        ManipulatorHandlerBase.prototype.switchState = function (state) {
            if (this.state)
                this.state.finish();
            this.state = state;
            this.state.start();
        };
        ManipulatorHandlerBase.prototype.getHyperlinkFieldResult = function (evt) {
            var subDocument = this.control.model.activeSubDocument;
            var htr = this.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.Max, subDocument);
            if (htr.exactlyDetailLevel == __aspxRichEdit.DocumentLayoutDetailsLevel.None)
                return null;
            var position = htr.getPosition();
            var fieldInfos = __aspxRichEdit.FieldVisabilityInfo.getRelativeVisabilityInfo(position, subDocument.fields);
            var fieldVisabilityInfo = __aspxRichEdit.ListUtils.reverseElementBy(fieldInfos, function (info) {
                return info.showResult && info.field.getResultInterval().containsWithIntervalEnd(position) && info.field.isHyperlinkField();
            });
            return fieldVisabilityInfo ? fieldVisabilityInfo.field : null;
        };
        return ManipulatorHandlerBase;
    }());
    __aspxRichEdit.ManipulatorHandlerBase = ManipulatorHandlerBase;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ManipulatorHandlerStateBase = (function () {
        function ManipulatorHandlerStateBase(handler) {
            this.handler = handler;
        }
        ManipulatorHandlerStateBase.prototype.start = function () { };
        ManipulatorHandlerStateBase.prototype.finish = function () { };
        ManipulatorHandlerStateBase.prototype.resizeRotationChecker = function (action) {
            var activeSubDocument = this.handler.control.model.activeSubDocument;
            var specRunInfo = this.handler.control.selection.specialRunInfo;
            var subDoc = activeSubDocument.isTextBox() ?
                specRunInfo.getParentSubDocument() :
                activeSubDocument;
            var intervals = activeSubDocument.isTextBox() ?
                [new __aspxRichEdit.FixedInterval(specRunInfo.getTextBoxPosition(), 1)] :
                this.handler.control.selection.intervals;
            if (subDoc.isEditable(intervals)) {
                action();
                return true;
            }
            return false;
        };
        return ManipulatorHandlerStateBase;
    }());
    __aspxRichEdit.ManipulatorHandlerStateBase = ManipulatorHandlerStateBase;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var MouseHandlerStateBase = (function (_super) {
        __extends(MouseHandlerStateBase, _super);
        function MouseHandlerStateBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        MouseHandlerStateBase.prototype.onMouseDoubleClick = function (_evt) { };
        MouseHandlerStateBase.prototype.onMouseDown = function (_evt) { };
        MouseHandlerStateBase.prototype.onMouseUp = function (_evt) { };
        MouseHandlerStateBase.prototype.onMouseMove = function (_evt) { };
        MouseHandlerStateBase.prototype.onMouseWheel = function (_evt) { };
        MouseHandlerStateBase.prototype.onShortcut = function (_shortcutCode) { };
        return MouseHandlerStateBase;
    }(__aspxRichEdit.ManipulatorHandlerStateBase));
    __aspxRichEdit.MouseHandlerStateBase = MouseHandlerStateBase;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var MouseHandlerBeginDragHelperState = (function (_super) {
        __extends(MouseHandlerBeginDragHelperState, _super);
        function MouseHandlerBeginDragHelperState(lp, handler, dragState) {
            var _this = _super.call(this, handler) || this;
            _this.dragState = dragState;
            _this.startPoint = lp.clone();
            return _this;
        }
        MouseHandlerBeginDragHelperState.prototype.start = function () {
            this.handler.control.barManager.beginUpdate();
            this.handler.control.horizontalRulerControl.beginUpdate();
        };
        MouseHandlerBeginDragHelperState.prototype.finish = function () {
            this.handler.control.barManager.endUpdate();
            this.handler.control.horizontalRulerControl.endUpdate();
            this.handler.control.barManager.updateItemsState([]);
            this.handler.control.horizontalRulerControl.update();
        };
        MouseHandlerBeginDragHelperState.prototype.cancelOnRightMouseUp = function () { return true; };
        MouseHandlerBeginDragHelperState.prototype.onMouseWheel = function (evt) {
            this.handler.switchState(this.dragState);
            this.dragState.onMouseWheel(evt);
        };
        MouseHandlerBeginDragHelperState.prototype.onMouseMove = function (evt) {
            if (!evt.layoutPoint.equals(this.startPoint)) {
                this.handler.switchState(this.dragState);
                this.dragState.onMouseMove(evt);
            }
        };
        MouseHandlerBeginDragHelperState.prototype.onMouseUp = function (evt) {
            if (evt.button == __aspxRichEdit.MouseButton.Left || (this.cancelOnRightMouseUp() && evt.button & __aspxRichEdit.MouseButton.Right)) {
                this.handler.switchToDefaultState();
                this.handler.onMouseUp(evt);
            }
        };
        return MouseHandlerBeginDragHelperState;
    }(__aspxRichEdit.MouseHandlerStateBase));
    __aspxRichEdit.MouseHandlerBeginDragHelperState = MouseHandlerBeginDragHelperState;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var MouseHandlerBeginContentDragHelperState = (function (_super) {
        __extends(MouseHandlerBeginContentDragHelperState, _super);
        function MouseHandlerBeginContentDragHelperState(lp, handler, dragState) {
            var _this = _super.call(this, lp, handler, dragState) || this;
            _this.resetSelectionOnMouseUp = true;
            return _this;
        }
        MouseHandlerBeginContentDragHelperState.prototype.onMouseUp = function (evt) {
            _super.prototype.onMouseUp.call(this, evt);
            if (this.cancelOnRightMouseUp() && evt.button & __aspxRichEdit.MouseButton.Right)
                return;
            if (this.resetSelectionOnMouseUp) {
                var htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.Character, this.handler.control.model.activeSubDocument);
                htr.correctAsVisibleBox();
                if (htr.exactlyDetailLevel > __aspxRichEdit.DocumentLayoutDetailsLevel.None) {
                    var selection = this.handler.control.selection;
                    var position = htr.getPosition();
                    selection.deprecatedSetSelection(position, position, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
                }
            }
        };
        return MouseHandlerBeginContentDragHelperState;
    }(__aspxRichEdit.MouseHandlerBeginDragHelperState));
    __aspxRichEdit.MouseHandlerBeginContentDragHelperState = MouseHandlerBeginContentDragHelperState;
    var MouseHandlerCancellableDragStateBase = (function (_super) {
        __extends(MouseHandlerCancellableDragStateBase, _super);
        function MouseHandlerCancellableDragStateBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        MouseHandlerCancellableDragStateBase.prototype.onShortcut = function (shortcutCode) {
            if (shortcutCode === REWebUtils.KeyCode.Esc)
                this.handler.switchToDefaultState();
        };
        MouseHandlerCancellableDragStateBase.prototype.calculateHitTest = function (evt) {
            var htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.Character, this.handler.control.model.activeSubDocument);
            htr.correctAsVisibleBox();
            return htr;
        };
        MouseHandlerCancellableDragStateBase.prototype.onMouseMove = function (evt) {
            this.continueDrag(evt);
        };
        MouseHandlerCancellableDragStateBase.prototype.onMouseWheel = function (evt) {
            this.continueDrag(evt);
        };
        MouseHandlerCancellableDragStateBase.prototype.onMouseUp = function (evt) {
            this.commitDrag(evt);
            this.handler.switchToDefaultState();
        };
        MouseHandlerCancellableDragStateBase.prototype.continueDrag = function (_evt) { };
        MouseHandlerCancellableDragStateBase.prototype.commitDrag = function (_evt) { };
        return MouseHandlerCancellableDragStateBase;
    }(__aspxRichEdit.MouseHandlerStateBase));
    __aspxRichEdit.MouseHandlerCancellableDragStateBase = MouseHandlerCancellableDragStateBase;
    var MouseHandlerDragContentState = (function (_super) {
        __extends(MouseHandlerDragContentState, _super);
        function MouseHandlerDragContentState(handler) {
            var _this = _super.call(this, handler) || this;
            _this.allowedToDrag = _this.handler.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.DragMoveContent).getState().enabled;
            return _this;
        }
        MouseHandlerDragContentState.prototype.start = function () {
            var cursorPointer = this.allowedToDrag ? __aspxRichEdit.CursorPointer.Default : __aspxRichEdit.CursorPointer.NoDrop;
            this.handler.setCursorPointer(cursorPointer);
        };
        MouseHandlerDragContentState.prototype.finish = function () {
            this.handler.restoreCursorPointer();
            this.handler.boxVisualizerManager.dragCaretVisualizer.hide();
        };
        MouseHandlerDragContentState.prototype.continueDrag = function (evt) {
            if (this.allowedToDrag) {
                var htr = this.calculateHitTest(evt);
                this.handler.boxVisualizerManager.dragCaretVisualizer.show(htr);
            }
        };
        MouseHandlerDragContentState.prototype.commitDrag = function (evt) {
            if (this.allowedToDrag) {
                var htr = this.calculateHitTest(evt);
                if (htr.exactlyDetailLevel > __aspxRichEdit.DocumentLayoutDetailsLevel.None) {
                    var subDocument = this.handler.control.model.activeSubDocument;
                    var interval = new __aspxRichEdit.FixedInterval(htr.getPosition(), 0);
                    __aspxRichEdit.Field.correctIntervalDueToFields(subDocument, interval);
                    var commandId = evt.modifiers & REWebUtils.ModifierKey.Ctrl ? __aspxRichEdit.RichEditClientCommand.DragCopyContent : __aspxRichEdit.RichEditClientCommand.DragMoveContent;
                    this.handler.control.commandManager.getCommand(commandId).execute(this.handler.control.commandManager.isPublicApiCall, interval.start);
                }
            }
        };
        return MouseHandlerDragContentState;
    }(MouseHandlerCancellableDragStateBase));
    __aspxRichEdit.MouseHandlerDragContentState = MouseHandlerDragContentState;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TouchHandlerStateBase = (function (_super) {
        __extends(TouchHandlerStateBase, _super);
        function TouchHandlerStateBase() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.TOUCH_SCROLL_SENSITIVITY_IN_ROWS = 2;
            return _this;
        }
        TouchHandlerStateBase.prototype.onTouchStart = function (_evt) { };
        TouchHandlerStateBase.prototype.onDoubleTap = function (_evt) { };
        TouchHandlerStateBase.prototype.onTouchEnd = function (_evt) { };
        TouchHandlerStateBase.prototype.onTouchMove = function (_evt) { return true; };
        TouchHandlerStateBase.prototype.captureInputFocus = function (_evt) {
            this.handler.control.focusManager.captureFocus();
        };
        TouchHandlerStateBase.prototype.showPopupMenu = function () {
            var _this = this;
            window.setTimeout(function () { return _this.handler.control.popupMenuManager.showByTouchClick(); }, 20);
        };
        TouchHandlerStateBase.prototype.setEditableDocumentContent = function () {
            if (!REWebUtils.Browser.IE && !REWebUtils.Browser.Edge) {
                var subDocument = this.handler.control.model.activeSubDocument;
                var position = this.handler.control.selection.getLastSelectedInterval().start;
                var startInterval = __aspxRichEdit.LayoutWordBounds.getLayoutWordStartBound(this.handler.control.layout, this.handler.control.model.activeSubDocument, this.handler.control.selection, position);
                var startIntervalLayoutPosition = (subDocument.isMain()
                    ? new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.handler.control.layout, subDocument, startInterval, __aspxRichEdit.DocumentLayoutDetailsLevel.Box)
                    : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.handler.control.layout, subDocument, startInterval, this.handler.control.selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Box))
                    .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(this.handler.control.selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
                if (startIntervalLayoutPosition.isLastBoxInRow())
                    startInterval = __aspxRichEdit.LayoutWordBounds.getLayoutWordStartBound(this.handler.control.layout, this.handler.control.model.activeSubDocument, this.handler.control.selection, position - 1);
                var endInterval = __aspxRichEdit.LayoutWordBounds.getLayoutWordEndBound(this.handler.control.layout, this.handler.control.model.activeSubDocument, this.handler.control.selection, startInterval, false);
                var textUnderCursor = position >= startInterval && position <= endInterval ? this.handler.control.model.activeSubDocument.getText(new __aspxRichEdit.FixedInterval(startInterval, endInterval - startInterval)) : "";
                this.handler.control.inputController.setEditableDocumentContent(textUnderCursor);
                if (textUnderCursor.length)
                    this.handler.control.inputController.setEditableDocumentCursorPosition(position - startInterval);
            }
        };
        TouchHandlerStateBase.prototype.setLastLayoutPosition = function () {
            var subDocument = this.handler.control.model.activeSubDocument;
            var logPosition = this.handler.control.selection.getLastSelectedInterval().start;
            this.lastLayoutPosition = (subDocument.isMain()
                ? new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.handler.control.layout, subDocument, logPosition, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.handler.control.layout, subDocument, logPosition, this.handler.control.selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character))
                .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(this.handler.control.selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true));
        };
        return TouchHandlerStateBase;
    }(__aspxRichEdit.ManipulatorHandlerStateBase));
    __aspxRichEdit.TouchHandlerStateBase = TouchHandlerStateBase;
    var TouchHandlerBeginDragHelperState = (function (_super) {
        __extends(TouchHandlerBeginDragHelperState, _super);
        function TouchHandlerBeginDragHelperState(handler, dragState) {
            var _this = _super.call(this, handler) || this;
            _this.dragState = dragState;
            return _this;
        }
        TouchHandlerBeginDragHelperState.prototype.start = function () {
            this.handler.control.barManager.beginUpdate();
            this.handler.control.horizontalRulerControl.beginUpdate();
        };
        TouchHandlerBeginDragHelperState.prototype.finish = function () {
            this.handler.control.barManager.endUpdate();
            this.handler.control.horizontalRulerControl.endUpdate();
            this.handler.control.barManager.updateItemsState([]);
            this.handler.control.horizontalRulerControl.update();
        };
        TouchHandlerBeginDragHelperState.prototype.onTouchMove = function (evt) {
            this.handler.switchState(this.dragState);
            this.dragState.onTouchMove(evt);
            return false;
        };
        TouchHandlerBeginDragHelperState.prototype.onTouchEnd = function (evt) {
            this.handler.switchToDefaultState();
            this.handler.onTouchEnd(evt);
        };
        return TouchHandlerBeginDragHelperState;
    }(TouchHandlerStateBase));
    __aspxRichEdit.TouchHandlerBeginDragHelperState = TouchHandlerBeginDragHelperState;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var CommandOptions = (function () {
        function CommandOptions(control) {
            this.control = control;
            this._changeSelection = true;
            this.isSetManually = true;
            this.allowChangeSelection = true;
            if (control) {
                this._subDocument = this.control.model.activeSubDocument;
                this._intervals = __aspxRichEdit.ListUtils.deepCopy(this.control.selection.intervals);
            }
        }
        CommandOptions.prototype.setSubDocument = function (sd) {
            this._subDocument = sd;
            return this;
        };
        Object.defineProperty(CommandOptions.prototype, "subDocument", {
            get: function () { return this._subDocument; },
            set: function (val) { this._subDocument = val; },
            enumerable: true,
            configurable: true
        });
        CommandOptions.prototype.setAllowChangeSelection = function (val) {
            this.allowChangeSelection = val;
            return this;
        };
        CommandOptions.prototype.setIntervals = function (intervals) {
            this._intervals = intervals;
            return this;
        };
        Object.defineProperty(CommandOptions.prototype, "intervals", {
            get: function () { return this._intervals; },
            set: function (val) { this._intervals = val; },
            enumerable: true,
            configurable: true
        });
        CommandOptions.prototype.setChangeSelection = function (changeSelection) {
            this._changeSelection = changeSelection;
            return this;
        };
        Object.defineProperty(CommandOptions.prototype, "changeSelection", {
            get: function () { return this._changeSelection; },
            set: function (val) { this._changeSelection = val; },
            enumerable: true,
            configurable: true
        });
        return CommandOptions;
    }());
    __aspxRichEdit.CommandOptions = CommandOptions;
    var CommandSimpleOptions = (function (_super) {
        __extends(CommandSimpleOptions, _super);
        function CommandSimpleOptions(control, parameter) {
            var _this = _super.call(this, control) || this;
            _this.param = parameter;
            return _this;
        }
        return CommandSimpleOptions;
    }(CommandOptions));
    __aspxRichEdit.CommandSimpleOptions = CommandSimpleOptions;
    var CommandBase = (function () {
        function CommandBase(control) {
            this.control = control;
        }
        Object.defineProperty(CommandBase.prototype, "colorProvider", {
            get: function () { return this.control.model.colorProvider; },
            enumerable: true,
            configurable: true
        });
        CommandBase.prototype.execute = function (isPublicApiCall, parameter) {
            var isPublicApiCallPrevValue = this.control.commandManager.isPublicApiCall;
            this.control.commandManager.isPublicApiCall = isPublicApiCall;
            if (this.control.isClosed() && !this.isEnabledInClosedDocument()) {
                this.control.commandManager.isPublicApiCall = isPublicApiCallPrevValue;
                return false;
            }
            var options = this.convertToCommandOptions(parameter);
            var state = this.getState(options);
            var modifiedState = this.control.getModifiedState();
            if (!state.enabled) {
                this.control.commandManager.isPublicApiCall = isPublicApiCallPrevValue;
                return false;
            }
            this.control.beginUpdate();
            this.control.commandManager.beforeExecuting(this);
            var executed = this.executeCore(state, options);
            this.control.commandManager.afterExecuting();
            this.control.endUpdate();
            if (executed)
                this.updateControlState(modifiedState);
            this.control.commandManager.isPublicApiCall = isPublicApiCallPrevValue;
            return executed;
        };
        CommandBase.prototype.convertToCommandOptions = function (parameter) {
            if (parameter instanceof CommandOptions)
                return parameter;
            var options;
            options = new CommandSimpleOptions(this.control, this.DEPRECATEDConvertOptionsParameter(parameter));
            this.DEPRECATEDCorrectlMainCommandOptions(options);
            options.isSetManually = false;
            options.allowChangeSelection = true;
            return options;
        };
        CommandBase.prototype.executeCore = function (_state, _options) {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        CommandBase.prototype.isEnabled = function (_options) {
            return this.isEnabledInReadOnlyMode() || this.control.readOnly != __aspxRichEdit.ReadOnlyMode.Persistent && this.canModify();
        };
        CommandBase.prototype.updateControlState = function (prevModifiedState) {
            if (!this.lockInputPositionUpdating(prevModifiedState))
                this.control.inputPosition.reset();
            if (!this.lockUIUpdating(prevModifiedState)) {
                this.control.barManager.updateItemsState([]);
                this.control.horizontalRulerControl.update();
            }
        };
        CommandBase.prototype.lockInputPositionUpdating = function (_prevModifiedState) {
            return false;
        };
        CommandBase.prototype.lockUIUpdating = function (_prevModifiedState) {
            return false;
        };
        CommandBase.prototype.isEnabledInReadOnlyMode = function () {
            return false;
        };
        CommandBase.prototype.isEnabledInClosedDocument = function () {
            return false;
        };
        CommandBase.prototype.canModify = function () {
            return this.control.model.activeSubDocument.isEditable(this.getIntervalsForModifying());
        };
        CommandBase.prototype.getIntervalsForModifying = function () {
            return this.control.selection.intervals;
        };
        CommandBase.prototype.getFloatingObjectParentSubDocument = function () {
            var specialRunInfo = this.control.selection.specialRunInfo;
            return specialRunInfo.isPictureSelected() ?
                this.control.model.activeSubDocument :
                specialRunInfo.getParentSubDocument();
        };
        CommandBase.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return parameter;
        };
        CommandBase.prototype.DEPRECATEDCorrectlMainCommandOptions = function (_options) {
        };
        return CommandBase;
    }());
    __aspxRichEdit.CommandBase = CommandBase;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SimpleCommandState = (function () {
        function SimpleCommandState(enabled, value) {
            this.visible = true;
            this.denyUpdateValue = false;
            this.enabled = enabled;
            this.value = value;
        }
        return SimpleCommandState;
    }());
    __aspxRichEdit.SimpleCommandState = SimpleCommandState;
    var IntervalCommandState = (function (_super) {
        __extends(IntervalCommandState, _super);
        function IntervalCommandState(enabled, interval, value) {
            var _this = _super.call(this, enabled, value) || this;
            _this.interval = interval;
            return _this;
        }
        return IntervalCommandState;
    }(SimpleCommandState));
    __aspxRichEdit.IntervalCommandState = IntervalCommandState;
    var IntervalCommandStateEx = (function (_super) {
        __extends(IntervalCommandStateEx, _super);
        function IntervalCommandStateEx(enabled, intervals, value) {
            var _this = _super.call(this, enabled, value) || this;
            _this.intervals = intervals;
            return _this;
        }
        return IntervalCommandStateEx;
    }(SimpleCommandState));
    __aspxRichEdit.IntervalCommandStateEx = IntervalCommandStateEx;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableCommandBase = (function (_super) {
        __extends(TableCommandBase, _super);
        function TableCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCommandBase.prototype.isEnabled = function () {
            var table = this.control.selection.tableInfo.table;
            return _super.prototype.isEnabled.call(this) && table != null &&
                this.control.model.activeSubDocument.isEditable([__aspxRichEdit.FixedInterval.fromPositions(table.getStartPosition(), table.getEndPosition())]);
        };
        return TableCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.TableCommandBase = TableCommandBase;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SpellingCommandBase = (function (_super) {
        __extends(SpellingCommandBase, _super);
        function SpellingCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SpellingCommandBase.prototype.getState = function () {
            var selectedMisspelledInterval = this.control.spellChecker.getSelectedMisspelledInterval(this.control.selection.intervals);
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.value = selectedMisspelledInterval;
            state.visible = this.isVisible(selectedMisspelledInterval);
            return state;
        };
        SpellingCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && this.control.spellChecker.settings.isEnabled;
        };
        SpellingCommandBase.prototype.isVisible = function (selectedMisspelledInterval) {
            return selectedMisspelledInterval != null;
        };
        return SpellingCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.SpellingCommandBase = SpellingCommandBase;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SelectionCommandBase = (function (_super) {
        __extends(SelectionCommandBase, _super);
        function SelectionCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SelectionCommandBase.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        SelectionCommandBase.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return SelectionCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.SelectionCommandBase = SelectionCommandBase;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeCharacterPropertiesCommandBase = (function (_super) {
        __extends(ChangeCharacterPropertiesCommandBase, _super);
        function ChangeCharacterPropertiesCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeCharacterPropertiesCommandBase.prototype.getState = function (options) {
            if (options === void 0) { options = this.convertToCommandOptions(undefined); }
            var state = new __aspxRichEdit.IntervalCommandStateEx(this.isEnabled(), __aspxRichEdit.ListUtils.deepCopy(options.intervals), this.getValueForState(this.getCurrentValue()));
            state.denyUpdateValue = this.isLockUpdateValue();
            return state;
        };
        ChangeCharacterPropertiesCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.characterFormatting);
        };
        ChangeCharacterPropertiesCommandBase.prototype.DEPRECATEDCorrectlMainCommandOptions = function (options) {
            options.intervals = this.control.selection.isCollapsed() ?
                [options.subDocument.getWholeWordInterval(this.control.selection.intervals[0].start)] :
                this.control.selection.getIntervalsClone();
        };
        ChangeCharacterPropertiesCommandBase.prototype.getApplyToIntervals = function (options) {
            if (!__aspxRichEdit.ConstInterval.isCollapsed(options.intervals))
                return options.intervals;
            var pos = options.intervals[0].start;
            var paragraph = options.subDocument.getParagraphByPosition(pos);
            return pos + 1 == paragraph.getEndPosition() ? [new __aspxRichEdit.FixedInterval(paragraph.getEndPosition() - 1, 1)] : options.intervals;
        };
        ChangeCharacterPropertiesCommandBase.prototype.executeCore = function (_state, options) {
            var desc = this.getDescriptor();
            var newValue = options.param;
            var applyToIntervals = this.getApplyToIntervals(options);
            if (this.getCurrentValue() !== newValue) {
                var history_1 = this.control.history;
                history_1.beginTransaction();
                desc.setProp(this.control.inputPosition.getMaskedCharacterProperties(), newValue);
                desc.setProp(this.control.inputPosition.getMergedCharacterPropertiesFull(), newValue);
                desc.setProp(this.control.inputPosition.getMergedCharacterPropertiesRaw(), newValue);
                this.control.inputPosition.getMaskedCharacterProperties().setUseValue(desc.maskValue(), true);
                for (var _i = 0, applyToIntervals_1 = applyToIntervals; _i < applyToIntervals_1.length; _i++) {
                    var interval = applyToIntervals_1[_i];
                    if (interval.length > 0)
                        history_1.addAndRedo(new (desc.getHistoryItemConstructor())(this.control.modelManipulator, options.subDocument, interval, newValue, true));
                }
                history_1.endTransaction();
            }
            return true;
        };
        ChangeCharacterPropertiesCommandBase.prototype.isLockUpdateValue = function () {
            return false;
        };
        ChangeCharacterPropertiesCommandBase.prototype.lockInputPositionUpdating = function (_prevModifiedState) {
            return true;
        };
        ChangeCharacterPropertiesCommandBase.prototype.getCurrentValue = function () {
            return this.getDescriptor().getProp(this.control.inputPosition.getMergedCharacterPropertiesRaw());
        };
        ChangeCharacterPropertiesCommandBase.prototype.getValueForState = function (val) {
            return val;
        };
        ChangeCharacterPropertiesCommandBase.prototype.convertBooleanParameterToEnumType = function (parameter, ifTrue, ifFalse) {
            if (typeof parameter === 'boolean')
                return parameter ? ifTrue : ifFalse;
            return this.getCurrentValue() == ifTrue ? ifFalse : ifTrue;
        };
        return ChangeCharacterPropertiesCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ChangeCharacterPropertiesCommandBase = ChangeCharacterPropertiesCommandBase;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeParagraphPropertiesCommandBase = (function (_super) {
        __extends(ChangeParagraphPropertiesCommandBase, _super);
        function ChangeParagraphPropertiesCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeParagraphPropertiesCommandBase.prototype.getState = function (options) {
            if (options === void 0) { options = this.convertToCommandOptions(undefined); }
            var state = new __aspxRichEdit.IntervalCommandStateEx(this.isEnabled(), __aspxRichEdit.ListUtils.deepCopy(options.intervals), this.getValueForState(this.getCurrentValue()));
            state.denyUpdateValue = this.isLockUpdateValue();
            return state;
        };
        ChangeParagraphPropertiesCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.paragraphFormatting);
        };
        ChangeParagraphPropertiesCommandBase.prototype.executeCore = function (_state, options) {
            var desc = this.getDescriptor();
            var newValue = this.convertValue(options.param);
            if (this.getActualValue() !== newValue) {
                var history_2 = this.control.history;
                history_2.beginTransaction();
                desc.setProp(this.control.inputPosition.getMergedParagraphPropertiesFull(), newValue);
                desc.setProp(this.control.inputPosition.getMergedParagraphPropertiesRaw(), newValue);
                for (var _i = 0, _a = options.intervals; _i < _a.length; _i++) {
                    var interval = _a[_i];
                    history_2.addAndRedo(new (desc.getHistoryItemConstructor())(this.control.modelManipulator, options.subDocument, interval, newValue, true));
                }
                history_2.endTransaction();
            }
            return true;
        };
        ChangeParagraphPropertiesCommandBase.prototype.isLockUpdateValue = function () {
            return false;
        };
        ChangeParagraphPropertiesCommandBase.prototype.lockInputPositionUpdating = function (_prevModifiedState) {
            return true;
        };
        ChangeParagraphPropertiesCommandBase.prototype.getCurrentValue = function () {
            return this.getDescriptor().getProp(this.control.inputPosition.getMergedParagraphPropertiesRaw());
        };
        ChangeParagraphPropertiesCommandBase.prototype.getValueForState = function (val) {
            return val;
        };
        ChangeParagraphPropertiesCommandBase.prototype.getIntervalsForModifying = function () {
            return __aspxRichEdit.RichUtils.getIntervalsOfSelectedParagraphs(this.control.selection.intervals, this.control.model.activeSubDocument);
        };
        ChangeParagraphPropertiesCommandBase.prototype.convertValue = function (val) {
            return val;
        };
        ChangeParagraphPropertiesCommandBase.prototype.getActualValue = function () {
            return this.getCurrentValue();
        };
        ChangeParagraphPropertiesCommandBase.prototype.convertBooleanParameterToEnumType = function (parameter, ifTrue, ifFalse) {
            if (typeof parameter === 'boolean')
                return parameter ? ifTrue : ifFalse;
            return this.getCurrentValue() == ifTrue ? ifFalse : ifTrue;
        };
        return ChangeParagraphPropertiesCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ChangeParagraphPropertiesCommandBase = ChangeParagraphPropertiesCommandBase;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SectionPropertiesCommandBase = (function (_super) {
        __extends(SectionPropertiesCommandBase, _super);
        function SectionPropertiesCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SectionPropertiesCommandBase.prototype.DEPRECATEDCorrectlMainCommandOptions = function (options) {
            options.intervals = SectionPropertiesCommandBase.getIntervals(this.control, options.subDocument);
        };
        SectionPropertiesCommandBase.prototype.getState = function (options) {
            if (options === void 0) { options = this.convertToCommandOptions(null); }
            return new __aspxRichEdit.IntervalCommandStateEx(this.isEnabled(options), options.intervals, this.getStateValue(options));
        };
        SectionPropertiesCommandBase.prototype.isEnabled = function (options) {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.sections) &&
                (!this.control.model.isDocumentProtectionEnabled ||
                    SectionPropertiesCommandBase.rangePermissionIncludeFullSection(this.control, options.subDocument, options.intervals));
        };
        SectionPropertiesCommandBase.prototype.getAffectedSectionsIterator = function (intervals) {
            var sections = this.control.model.sections;
            return __aspxRichEdit.IntervalAlgorithms.getAffectedObjects(sections, intervals, undefined, function (objectInterval, touchingIntervalLength, touchPoint) {
                return touchingIntervalLength == 0 && objectInterval.contains(touchPoint);
            })
                .getObjectsIterator(sections);
        };
        SectionPropertiesCommandBase.rangePermissionIncludeFullSection = function (control, subDoc, intervals) {
            if (subDoc.isMain()) {
                var secIndexes_1 = [];
                var currInts = __aspxRichEdit.ListUtils.map(intervals, function (curr) {
                    var c = curr.clone();
                    if (!c.length)
                        c.length++;
                    return c;
                });
                __aspxRichEdit.ListUtils.foreach(currInts, function (currInt) {
                    __aspxRichEdit.ListUtils.foreach(control.model.sections, function (sec, secInd) {
                        if (__aspxRichEdit.IntervalAlgorithms.getIntersectionNonNullLength(sec.interval, currInt))
                            secIndexes_1.push(secInd);
                    });
                });
                return control.model.mainSubDocument.isEditable(__aspxRichEdit.ListUtils.map(__aspxRichEdit.ListUtils.uniqueNumber(secIndexes_1), function (ind) { return control.model.sections[ind].interval; }));
            }
            if (subDoc.isHeaderFooter()) {
                var section = control.model.mainSubDocument.getSectionByPosition(control.layoutFormatterManager.forceFormatPage(control.selection.pageIndex).getPosition());
                return control.model.mainSubDocument.isEditable([section.interval]);
            }
            if (subDoc.isTextBox()) {
                var selection = control.selection;
                return SectionPropertiesCommandBase.rangePermissionIncludeFullSection(control, selection.specialRunInfo.getParentSubDocument(), [new __aspxRichEdit.FixedInterval(selection.specialRunInfo.getPosition(), 1)]);
            }
        };
        SectionPropertiesCommandBase.getIntervals = function (control, subDocument) {
            if (subDocument.isMain() || subDocument.isTextBox())
                return control.selection.getIntervalsClone();
            else if (subDocument.isHeaderFooter()) {
                var layoutPage = control.layoutFormatterManager.forceFormatPage(control.selection.pageIndex);
                var sectionIndex = __aspxRichEdit.Section.getPageSectionIndex(layoutPage, control.model.sections);
                var section = control.model.sections[sectionIndex];
                return [new __aspxRichEdit.FixedInterval(section.startLogPosition.value, section.getLength())];
            }
            else
                throw new Error("Unknown subDocument type");
        };
        return SectionPropertiesCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.SectionPropertiesCommandBase = SectionPropertiesCommandBase;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeSectionPropertiesCommandBase = (function (_super) {
        __extends(ChangeSectionPropertiesCommandBase, _super);
        function ChangeSectionPropertiesCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeSectionPropertiesCommandBase.prototype.getStateValue = function (_options) {
            return this.getCurrentValue();
        };
        ChangeSectionPropertiesCommandBase.prototype.executeCore = function (_state, options) {
            var newValue = options.param;
            if (this.getCurrentValue() != newValue) {
                this.getDescriptor().setProp(this.control.inputPosition.getMergedSectionPropertiesRaw(), newValue);
                var iter = this.getAffectedSectionsIterator(options.intervals);
                while (iter.moveNext())
                    this.control.history.addAndRedo(new (this.getDescriptor().getHistoryItemConstructor())(this.control.modelManipulator, options.subDocument, iter.obj.interval, newValue));
                return true;
            }
            return false;
        };
        ChangeSectionPropertiesCommandBase.prototype.getCurrentValue = function () {
            return this.getDescriptor().getProp(this.control.inputPosition.getMergedSectionPropertiesRaw());
        };
        return ChangeSectionPropertiesCommandBase;
    }(__aspxRichEdit.SectionPropertiesCommandBase));
    __aspxRichEdit.ChangeSectionPropertiesCommandBase = ChangeSectionPropertiesCommandBase;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GoToLineVerticallyCommandBase = (function (_super) {
        __extends(GoToLineVerticallyCommandBase, _super);
        function GoToLineVerticallyCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToLineVerticallyCommandBase.prototype.extendTableCellsSelection = function () {
            var selectedCells = this.getSelectedCells();
            var isForward = this.control.selection.forwardDirection;
            var isOneSelectedCell = selectedCells.length == 1 && selectedCells[0].length == 1;
            if (isOneSelectedCell && !selectedCells[0][0].interval.equals(this.control.selection.getLastSelectedInterval()))
                return false;
            if (this.control.selection.tableInfo.extendedData.areCellsSelectedInSeries) {
                var table = selectedCells[0][0].parentRow.parentTable;
                var currentRow_1 = this.getCurrentTableRow(selectedCells);
                var currentRowIndex = __aspxRichEdit.Utils.binaryIndexOf(table.rows, function (row) { return row.getStartPosition() - currentRow_1.getStartPosition(); });
                if (this.checkTableRowIndex(currentRowIndex, table.rows.length)) {
                    var nextRow = this.getNextTableRow(table, currentRowIndex);
                    var firstSelectedCell = selectedCells[0][0];
                    var lastSelectedCell = selectedCells[selectedCells.length - 1][selectedCells[selectedCells.length - 1].length - 1];
                    return this.performTableCellsSelection(isForward, selectedCells, nextRow, firstSelectedCell, lastSelectedCell);
                }
                this.performSelectionOnTheLastTableRow(isForward, selectedCells);
            }
            return false;
        };
        GoToLineVerticallyCommandBase.prototype.getSelectedCells = function () {
            var selectedCells = __aspxRichEdit.ListUtils.map(this.control.selection.tableInfo.rawData.rows, function (rowInfo) { return __aspxRichEdit.ListUtils.map(rowInfo.cells, function (cellInfo) { return cellInfo.cell; }); });
            var position = __aspxRichEdit.LayoutPositionMainSubDocumentCreator.createLightLayoutPosition(this.control.layout, this.control.model.activeSubDocument, this.getInitialSelectionEndPosition(), this.control.selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character, true, false);
            if (!selectedCells.length && position.row.tableCellInfo) {
                var modelTable = position.row.tableCellInfo.parentRow.parentTable.logicInfo.grid.table;
                var modelRowIndex = position.row.tableCellInfo.parentRow.rowIndex;
                selectedCells = [];
                for (var i = 0; i <= modelRowIndex; i++)
                    selectedCells.push(modelTable.rows[i].cells);
            }
            return selectedCells;
        };
        GoToLineVerticallyCommandBase.prototype.getLogPositionByX = function (layoutPosition, x) {
            var newLayoutPosition = layoutPosition.clone();
            var xOffsetBoxLevel = Math.max(0, x - (newLayoutPosition.page.x + newLayoutPosition.pageArea.x + newLayoutPosition.column.x + newLayoutPosition.row.x));
            var boxIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(newLayoutPosition.row.boxes, function (b) { return b.x; }, xOffsetBoxLevel);
            if (boxIndex < 0)
                boxIndex = 0;
            newLayoutPosition.box = newLayoutPosition.row.boxes[boxIndex];
            var isNoVisibleBoxesInRow = false;
            if (!newLayoutPosition.box.isVisible()) {
                var lastVisibleBoxIndexInRow = newLayoutPosition.row.getLastVisibleBoxIndex();
                if (lastVisibleBoxIndexInRow < 0) {
                    lastVisibleBoxIndexInRow = 0;
                    isNoVisibleBoxesInRow = true;
                }
                newLayoutPosition.boxIndex = lastVisibleBoxIndexInRow;
                newLayoutPosition.box = newLayoutPosition.row.boxes[lastVisibleBoxIndexInRow];
            }
            var xOffsetCharLevel = isNoVisibleBoxesInRow ? 0 : xOffsetBoxLevel - newLayoutPosition.box.x;
            return newLayoutPosition.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Box) + newLayoutPosition.box.calculateCharOffsetByPointX(this.control.measurer, xOffsetCharLevel);
        };
        GoToLineVerticallyCommandBase.prototype.isEndOfLine = function (layoutPosition, position) {
            return position === layoutPosition.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Row) + layoutPosition.row.getLastBoxEndPositionInRow();
        };
        GoToLineVerticallyCommandBase.prototype.selectTableCellsRange = function (parameters) {
            return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.SelectTableCellsRange).execute(this.control.commandManager.isPublicApiCall, parameters);
        };
        GoToLineVerticallyCommandBase.prototype.executeCore = function (_state, _options) {
            if (this.canGoToNextTableRow() && this.extendTableCellsSelection())
                return true;
            var selection = this.control.selection;
            var layout = this.control.layout;
            var initialSelectionEndPosition = this.getInitialSelectionEndPosition();
            var subDocument = this.control.model.activeSubDocument;
            var initialLayoutPosition = (subDocument.isMain()
                ? new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.control.layout, subDocument, initialSelectionEndPosition, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.layout, subDocument, initialSelectionEndPosition, selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character))
                .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(selection.isCollapsed() ? selection.endOfLine : !this.control.selection.forwardDirection), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
            if (!initialLayoutPosition)
                return false;
            var keepX = selection.keepX;
            if (keepX < 0)
                keepX = initialLayoutPosition.page.x + initialLayoutPosition.pageArea.x + initialLayoutPosition.column.x + initialLayoutPosition.row.x + initialLayoutPosition.box.x +
                    initialLayoutPosition.box.getCharOffsetXInPixels(this.control.measurer, initialLayoutPosition.charOffset);
            var newLayoutPosition;
            var cellIterator = new __aspxRichEdit.TableCellIterator(initialLayoutPosition, layout, this.control.measurer);
            if (this.canAdvanceToNextRow(cellIterator))
                newLayoutPosition = cellIterator.getModifyPosition();
            else {
                var currentPosition = initialLayoutPosition.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Character);
                newLayoutPosition = this.getNewLayoutPositionRowLevel(initialLayoutPosition);
                if (newLayoutPosition && this.extendSelection()) {
                    var isEdgeDocumentPosition = currentPosition == 0 || currentPosition == subDocument.getDocumentEndPosition();
                    var needKeepCurrentLine = isEdgeDocumentPosition && currentPosition != this.getLogPositionByX(initialLayoutPosition, keepX);
                    if (needKeepCurrentLine)
                        newLayoutPosition = initialLayoutPosition.clone();
                }
                else if (!newLayoutPosition) {
                    var edgeLinePosition = this.getPositionForEdgeLine(initialLayoutPosition);
                    if (this.extendSelection() && currentPosition != edgeLinePosition) {
                        selection.extendLastSelection(edgeLinePosition, this.isEndOfLine(initialLayoutPosition, edgeLinePosition), keepX, __aspxRichEdit.UpdateInputPositionProperties.Yes);
                        return true;
                    }
                    else if (!this.extendSelection()) {
                        var lastInterval = selection.getLastSelectedInterval();
                        if (lastInterval && lastInterval.length > 0)
                            selection.deprecatedSetSelection(edgeLinePosition, edgeLinePosition, this.isEndOfLine(initialLayoutPosition, edgeLinePosition), keepX, __aspxRichEdit.UpdateInputPositionProperties.Yes);
                    }
                    return false;
                }
            }
            var newLogPosition = this.getLogPositionByX(newLayoutPosition, keepX);
            if (newLogPosition == initialLayoutPosition.getLogPosition())
                return false;
            var endOfLine = this.isEndOfLine(newLayoutPosition, newLogPosition);
            if (this.extendSelection())
                selection.extendLastSelection(newLogPosition, endOfLine, keepX, __aspxRichEdit.UpdateInputPositionProperties.Yes);
            else
                selection.deprecatedSetSelection(newLogPosition, newLogPosition, endOfLine, keepX, __aspxRichEdit.UpdateInputPositionProperties.Yes);
            return true;
        };
        GoToLineVerticallyCommandBase.prototype.canGoToNextTableRow = function () {
            return false;
        };
        GoToLineVerticallyCommandBase.prototype.checkTableRowIndex = function (_rowIndex, _length) {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        GoToLineVerticallyCommandBase.prototype.getCurrentTableRow = function (_selectedCells) {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        GoToLineVerticallyCommandBase.prototype.getNextTableRow = function (_table, _rowIndex) {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        GoToLineVerticallyCommandBase.prototype.performTableCellsSelection = function (_isForward, _selectedCells, _nextRow, _firstCell, _lastCell) {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        GoToLineVerticallyCommandBase.prototype.performSelectionOnTheLastTableRow = function (_isForward, _selectedCells) {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return GoToLineVerticallyCommandBase;
    }(__aspxRichEdit.SelectionCommandBase));
    __aspxRichEdit.GoToLineVerticallyCommandBase = GoToLineVerticallyCommandBase;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ShowDialogCommandBase = (function (_super) {
        __extends(ShowDialogCommandBase, _super);
        function ShowDialogCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ShowDialogCommandBase.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        ShowDialogCommandBase.prototype.executeCore = function (state, options) {
            var _this = this;
            var params = this.createParameters(options);
            var initParams = params.clone();
            params.toAnotherMeasuringSystem(this.control.uiUnitConverter.twipsToUI);
            var prevModifiedState = this.control.getModifiedState();
            this.control.owner.showDialog(this.getDialogName(), params, function (result) {
                if (result) {
                    result.toAnotherMeasuringSystem(_this.control.uiUnitConverter.UIToTwips);
                    _this.control.beginUpdate();
                    _this.applyParameters(state, result, initParams);
                    _this.control.endUpdate();
                }
                if (result)
                    _this.updateControlState(prevModifiedState);
                if (!REWebUtils.Browser.TouchUI && _this.isModal())
                    _this.control.focusManager.captureFocus();
            }, function () {
                if (!REWebUtils.Browser.TouchUI)
                    _this.control.focusManager.captureFocus();
                _this.afterClosing(options);
            }, this.isModal());
            return true;
        };
        ShowDialogCommandBase.prototype.applyParameters = function (_state, _newParameters, _oldParameters) {
            return false;
        };
        ShowDialogCommandBase.prototype.afterClosing = function (_options) { };
        ShowDialogCommandBase.prototype.lockInputPositionUpdating = function (_prevModifiedState) {
            return true;
        };
        ShowDialogCommandBase.prototype.isModal = function () {
            return true;
        };
        return ShowDialogCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ShowDialogCommandBase = ShowDialogCommandBase;
    var DialogParametersBase = (function () {
        function DialogParametersBase() {
        }
        DialogParametersBase.prototype.copyFrom = function (_obj) { };
        return DialogParametersBase;
    }());
    __aspxRichEdit.DialogParametersBase = DialogParametersBase;
    var DialogTitleText;
    (function (DialogTitleText) {
        DialogTitleText[DialogTitleText["SaveAsFile"] = 0] = "SaveAsFile";
        DialogTitleText[DialogTitleText["OpenFile"] = 1] = "OpenFile";
        DialogTitleText[DialogTitleText["Font"] = 2] = "Font";
        DialogTitleText[DialogTitleText["Paragraph"] = 3] = "Paragraph";
        DialogTitleText[DialogTitleText["PageSetup"] = 4] = "PageSetup";
        DialogTitleText[DialogTitleText["Columns"] = 5] = "Columns";
        DialogTitleText[DialogTitleText["InsertImage"] = 6] = "InsertImage";
        DialogTitleText[DialogTitleText["Error"] = 7] = "Error";
    })(DialogTitleText = __aspxRichEdit.DialogTitleText || (__aspxRichEdit.DialogTitleText = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var NumberingListCommandBaseBase = (function (_super) {
        __extends(NumberingListCommandBaseBase, _super);
        function NumberingListCommandBaseBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        NumberingListCommandBaseBase.prototype.getState = function (options) {
            if (options === void 0) { options = this.convertToCommandOptions(undefined); }
            var intervals = __aspxRichEdit.ListUtils.deepCopy(options.intervals);
            return new __aspxRichEdit.IntervalCommandStateEx(this.isEnabled(), intervals, this.getValue(intervals, options.subDocument));
        };
        NumberingListCommandBaseBase.prototype.getValue = function (intervals, subDocument) {
            return this.areAllParagraphsHasValidNumberingListType(intervals, subDocument);
        };
        NumberingListCommandBaseBase.prototype.getIntervalsForModifying = function () {
            return __aspxRichEdit.RichUtils.getIntervalsOfSelectedParagraphs(this.control.selection.intervals, this.control.model.activeSubDocument);
        };
        NumberingListCommandBaseBase.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return __aspxRichEdit.Utils.isNumber(parameter) ? parameter : -1;
        };
        NumberingListCommandBaseBase.prototype.deleteNumberingList = function (paragraphIndices, subDocument) {
            for (var i = paragraphIndices.length - 1; i >= 0; i--) {
                var paragraphIndex = paragraphIndices[i];
                var paragraph = subDocument.paragraphs[paragraphIndex];
                if (paragraph.isInList()) {
                    this.resetParagraphLeftIndent(paragraphIndex, subDocument);
                    this.deleteNumberingListCore(paragraphIndex, subDocument);
                }
            }
        };
        NumberingListCommandBaseBase.prototype.resetParagraphLeftIndent = function (paragraphIndex, subDocument) {
            var paragraph = subDocument.paragraphs[paragraphIndex];
            var numberingList = paragraph.getNumberingList();
            var level = numberingList.levels[paragraph.getListLevelIndex()];
            var paragraphMergedProperties = paragraph.getParagraphMergedProperies();
            var interval = paragraph.interval;
            var levelIndent = level.getListLevelProperties().originalLeftIndent ? level.getListLevelProperties().originalLeftIndent : level.getParagraphProperties().firstLineIndent;
            var leftIndent = paragraphMergedProperties.leftIndent - levelIndent;
            this.control.history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentTypeHistoryItem(this.control.modelManipulator, subDocument, interval, __aspxRichEdit.ParagraphFirstLineIndent.None, true));
            this.control.history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentHistoryItem(this.control.modelManipulator, subDocument, interval, 0, true));
            this.control.history.addAndRedo(new __aspxRichEdit.ParagraphLeftIndentHistoryItem(this.control.modelManipulator, subDocument, interval, Math.max(0, leftIndent), true));
        };
        NumberingListCommandBaseBase.prototype.deleteNumberingListCore = function (paragraphIndex, subDocument) {
            var paragraph = subDocument.paragraphs[paragraphIndex];
            if (paragraph.numberingListIndex >= 0) {
                this.control.history.addAndRedo(new __aspxRichEdit.RemoveParagraphFromListHistoryItem(this.control.modelManipulator, subDocument, paragraphIndex));
            }
            else {
                if (paragraph.numberingListIndex === __aspxRichEdit.NumberingList.NumberingListNotSettedIndex)
                    this.control.history.addAndRedo(new __aspxRichEdit.ParagraphLeftIndentHistoryItem(this.control.modelManipulator, subDocument, new __aspxRichEdit.FixedInterval(paragraph.startLogPosition.value, 0), paragraph.getParagraphMergedProperies().leftIndent, true));
                this.control.history.addAndRedo(new __aspxRichEdit.AddParagraphToListHistoryItem(this.control.modelManipulator, subDocument, paragraphIndex, __aspxRichEdit.NumberingList.NoNumberingListIndex, 0));
            }
        };
        NumberingListCommandBaseBase.prototype.insertNumberingList = function (paragraphIndices, startIndex, subDocument) {
            var calculator = new __aspxRichEdit.NumberingListIndexCalculator(subDocument, this.getNumberingListType(), startIndex === undefined ? -1 : startIndex);
            var targetListInfo = calculator.getTargetListInfo(paragraphIndices);
            var targetListIndex = targetListInfo ? targetListInfo.listIndex : this.createNewList(this.getAbstractNumberingList(), subDocument);
            var targetListLevelIndex = targetListInfo ? targetListInfo.listlevelIndex : -1;
            var paragraphsLayoutPositions = this.getParagraphsLayoutPositions(paragraphIndices, subDocument);
            var paragraphsLevelIndices = this.getParagraphsLevelIndices(paragraphIndices, paragraphsLayoutPositions, !!targetListInfo, targetListIndex, targetListLevelIndex, subDocument);
            this.insertNumberingListCore(paragraphIndices, targetListIndex, paragraphsLevelIndices, paragraphsLayoutPositions, subDocument);
        };
        NumberingListCommandBaseBase.prototype.changeNumberingList = function (paragraphIndices, subDocument) {
            var paragraph = subDocument.paragraphs[paragraphIndices[0]];
            var numberingListIndex = paragraph.getNumberingListIndex();
            var targetListIndex = this.createNewList(this.getAbstractNumberingList(), subDocument);
            this.assignLevelsIndents(paragraphIndices[0], targetListIndex, subDocument);
            for (var i = 0, paragraph_1; paragraph_1 = subDocument.paragraphs[i]; i++) {
                if (paragraph_1.getNumberingListIndex() === numberingListIndex)
                    this.control.history.addAndRedo(new __aspxRichEdit.AddParagraphToListHistoryItem(this.control.modelManipulator, subDocument, i, targetListIndex, paragraph_1.getListLevelIndex()));
            }
        };
        NumberingListCommandBaseBase.prototype.modifyLevels = function (paragraphIndices, subDocument) {
            var _this = this;
            var paragraph = subDocument.paragraphs[paragraphIndices[0]];
            var numberingListIndex = paragraph.getNumberingListIndex();
            var targetListIndex = this.createNewList(this.getAbstractNumberingList(), subDocument);
            var targetList = this.control.model.numberingLists[targetListIndex];
            var abstractNumberingListIndex = this.control.model.numberingLists[numberingListIndex].abstractNumberingListIndex;
            __aspxRichEdit.ListUtils.foreach(paragraphIndices, function (index) {
                var paragraph = subDocument.paragraphs[index];
                if (paragraph.getNumberingListIndex() === numberingListIndex) {
                    var levelIndex = paragraph.getListLevelIndex();
                    var targetListLevel = targetList.levels[levelIndex];
                    _this.control.history.addAndRedo(new __aspxRichEdit.ListLevelDisplayFormatStringHistoryItem(_this.control.modelManipulator, subDocument, true, abstractNumberingListIndex, levelIndex, targetListLevel.getListLevelProperties().displayFormatString));
                    _this.control.history.addAndRedo(new __aspxRichEdit.ListLevelFormatHistoryItem(_this.control.modelManipulator, subDocument, true, abstractNumberingListIndex, levelIndex, targetListLevel.getListLevelProperties().format));
                    _this.control.history.addAndRedo(new __aspxRichEdit.ListLevelFontNameHistoryItem(_this.control.modelManipulator, subDocument, true, abstractNumberingListIndex, levelIndex, targetListLevel.getCharacterMergedProperies().fontInfo, true));
                    _this.control.history.addAndRedo(new __aspxRichEdit.ListLevelFontSizeHistoryItem(_this.control.modelManipulator, subDocument, true, abstractNumberingListIndex, levelIndex, targetListLevel.getCharacterMergedProperies().fontSize, true));
                }
            });
        };
        NumberingListCommandBaseBase.prototype.getAbstractNumberingList = function () {
            return this.control.model.abstractNumberingListTemplates[this.getNumberingListTemplateIndex(this.getNumberingListType())];
        };
        NumberingListCommandBaseBase.prototype.insertNumberingListCore = function (paragraphIndices, targetListIndex, paragraphsLevelIndices, paragraphsLayoutPositions, subDocument) {
            var paragraphIndicesLength = paragraphIndices.length;
            for (var i = 0; i < paragraphIndicesLength; i++) {
                var paragraphIndex = paragraphIndices[i];
                var paragraph = subDocument.paragraphs[paragraphIndex];
                this.processOldNumberingList(paragraph, subDocument);
                var targetListLevel = paragraphsLevelIndices[i];
                if (!paragraph.isInList())
                    this.deleteLeadingWhiteSpaces(paragraph, paragraphsLayoutPositions[i].row.boxes, targetListLevel < 0, subDocument);
                if (targetListLevel >= 0) {
                    this.control.history.addAndRedo(new __aspxRichEdit.AddParagraphToListHistoryItem(this.control.modelManipulator, subDocument, paragraphIndex, targetListIndex, targetListLevel));
                    this.control.history.addAndRedo(new __aspxRichEdit.ParagraphLeftIndentHistoryItem(this.control.modelManipulator, subDocument, new __aspxRichEdit.FixedInterval(paragraph.startLogPosition.value, 1), paragraph.maskedParagraphProperties.leftIndent, false));
                    this.control.history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentHistoryItem(this.control.modelManipulator, subDocument, new __aspxRichEdit.FixedInterval(paragraph.startLogPosition.value, 1), paragraph.maskedParagraphProperties.firstLineIndent, false));
                }
            }
        };
        NumberingListCommandBaseBase.prototype.processOldNumberingList = function (paragraph, subDocument) {
            if (paragraph.isInList()) {
                if (paragraph.numberingListIndex == __aspxRichEdit.NumberingList.NumberingListNotSettedIndex) {
                    var leftIndent = paragraph.getParagraphMergedProperies().leftIndent;
                    this.control.history.addAndRedo(new __aspxRichEdit.ParagraphLeftIndentHistoryItem(this.control.modelManipulator, subDocument, new __aspxRichEdit.FixedInterval(paragraph.startLogPosition.value, 1), leftIndent, true));
                }
            }
        };
        NumberingListCommandBaseBase.prototype.deleteLeadingWhiteSpaces = function (paragraph, boxes, replaceOnIndent, subDocument) {
            var length = 0;
            var leftIndent = 0;
            var manipulator = this.control.modelManipulator;
            for (var i = 0, box; box = boxes[i]; i++) {
                if (box.isWhitespace() && this.notInsideField(paragraph.startLogPosition.value + length + box.getLength(), subDocument)) {
                    length += box.getLength();
                    leftIndent += box.width;
                }
                else
                    break;
            }
            if (length > 0) {
                this.correctSelectionIntervals(new __aspxRichEdit.FixedInterval(paragraph.startLogPosition.value, length), subDocument);
                this.control.history.addAndRedo(new __aspxRichEdit.RemoveIntervalHistoryItem(manipulator, subDocument, new __aspxRichEdit.FixedInterval(paragraph.startLogPosition.value, length), false));
            }
            if (replaceOnIndent && leftIndent > 0) {
                leftIndent = __aspxRichEdit.UnitConverter.pixelsToTwips(leftIndent);
                var properties = paragraph.getParagraphMergedProperies();
                var interval = paragraph.interval;
                if (properties.firstLineIndentType === __aspxRichEdit.ParagraphFirstLineIndent.Hanging) {
                    if (leftIndent < properties.firstLineIndent)
                        this.control.history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentHistoryItem(manipulator, subDocument, interval, properties.firstLineIndent - leftIndent, true));
                    else if (properties.firstLineIndent === leftIndent) {
                        this.control.history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentHistoryItem(manipulator, subDocument, interval, 0, true));
                        this.control.history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentTypeHistoryItem(manipulator, subDocument, interval, __aspxRichEdit.ParagraphFirstLineIndent.None, true));
                    }
                    else {
                        this.control.history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentHistoryItem(manipulator, subDocument, interval, leftIndent - properties.firstLineIndent, true));
                        this.control.history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentTypeHistoryItem(manipulator, subDocument, interval, __aspxRichEdit.ParagraphFirstLineIndent.Indented, true));
                    }
                }
                else {
                    this.control.history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentHistoryItem(manipulator, subDocument, interval, properties.firstLineIndent + leftIndent, true));
                    if (properties.firstLineIndentType === __aspxRichEdit.ParagraphFirstLineIndent.None)
                        this.control.history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentTypeHistoryItem(manipulator, subDocument, interval, __aspxRichEdit.ParagraphFirstLineIndent.Indented, true));
                }
            }
        };
        NumberingListCommandBaseBase.prototype.notInsideField = function (position, subDocument) {
            return __aspxRichEdit.Field.binaryIndexOf(subDocument.fields, position) < 0;
        };
        NumberingListCommandBaseBase.prototype.correctSelectionIntervals = function (removingInterval, subDocument) {
            var intervals = this.control.selection.getIntervalsClone();
            for (var i = 0, interval = void 0; interval = intervals[i]; i++) {
                if (interval.start > removingInterval.start) {
                    var newSelectionEnd = Math.max(removingInterval.start, interval.end - removingInterval.length);
                    var newSelectionStart = Math.max(removingInterval.start, interval.start - removingInterval.length);
                    intervals[i] = __aspxRichEdit.FixedInterval.fromPositions(newSelectionStart, newSelectionEnd);
                }
            }
            this.control.history.addAndRedo(new __aspxRichEdit.SetSelectionHistoryItem(this.control.modelManipulator, subDocument, intervals, this.control.selection, __aspxRichEdit.UpdateInputPositionProperties.Yes, this.control.selection.endOfLine));
        };
        NumberingListCommandBaseBase.prototype.getParagraphsLayoutPositions = function (paragraphIndices, subDocument) {
            var result = [];
            var paragraphIndicesLength = paragraphIndices.length;
            for (var i = 0; i < paragraphIndicesLength; i++) {
                var paragraphIndex = paragraphIndices[i];
                var paragraph = subDocument.paragraphs[paragraphIndex];
                var logPosition = paragraph.startLogPosition.value;
                var endRowConflictTags = new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false);
                var middleRowConflictTags = new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false);
                result.push(subDocument.isMain()
                    ? __aspxRichEdit.LayoutPositionMainSubDocumentCreator.ensureLayoutPosition(this.control, this.control.layout, subDocument, logPosition, __aspxRichEdit.DocumentLayoutDetailsLevel.Box, endRowConflictTags, middleRowConflictTags)
                    : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.layout, subDocument, logPosition, this.control.selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Box).create(endRowConflictTags, middleRowConflictTags));
            }
            return result;
        };
        NumberingListCommandBaseBase.prototype.getParagraphsLevelIndices = function (paragraphIndices, layoutPositions, _continueNumberingList, listIndex, listLevelIndex, subDocument) {
            var result = [];
            var numberingList = this.control.model.numberingLists[listIndex];
            var paragraphIndicesLength = paragraphIndices.length;
            for (var i = 0; i < paragraphIndicesLength; i++) {
                var paragraphIndex = paragraphIndices[i];
                if (listLevelIndex < 0) {
                    var paragraph = subDocument.paragraphs[paragraphIndex];
                    var layoutPosition = layoutPositions[i];
                    var box = layoutPosition.row.numberingListBox ? layoutPosition.row.numberingListBox : this.getStartBox(layoutPosition.row.boxes);
                    var boxX = box instanceof __aspxRichEdit.LayoutNumberingListBox ? box.textBox.x : box.x;
                    boxX += layoutPosition.row.x;
                    if (box instanceof __aspxRichEdit.LayoutParagraphMarkBox && (paragraphIndicesLength > 1 && (paragraph.length <= 1 || i !== 0)))
                        result.push(-1);
                    else
                        result.push(this.calculateParagraphListLevel(boxX, paragraph, numberingList));
                }
                else
                    result.push(listLevelIndex);
            }
            this.assignLevelsIndents(paragraphIndices[0], listIndex, subDocument);
            return result;
        };
        NumberingListCommandBaseBase.prototype.calculateParagraphListLevel = function (layoutLeftIndent, _paragraph, numberingList) {
            var modelLeftIndent = __aspxRichEdit.UnitConverter.pixelsToTwips(layoutLeftIndent);
            for (var i = 0, level; level = numberingList.levels[i]; i++) {
                var levelParagraphProperties = level.getParagraphMergedProperies();
                var actualNumberingPosition = levelParagraphProperties.firstLineIndentType == __aspxRichEdit.ParagraphFirstLineIndent.Hanging ?
                    (levelParagraphProperties.leftIndent - levelParagraphProperties.firstLineIndent) : levelParagraphProperties.leftIndent;
                if (modelLeftIndent <= actualNumberingPosition)
                    return i;
            }
            return numberingList.levels.length - 1;
        };
        NumberingListCommandBaseBase.prototype.getStartBox = function (boxes) {
            for (var i = 0, box; box = boxes[i]; i++) {
                if (!box.isWhitespace())
                    return box;
            }
            return boxes[0];
        };
        NumberingListCommandBaseBase.prototype.createNewList = function (template, subDocument) {
            var abstractNumberingList = new __aspxRichEdit.AbstractNumberingList(this.control.model);
            abstractNumberingList.copyFrom(template);
            abstractNumberingList.innerId = abstractNumberingList.generateNewId();
            this.control.history.addAndRedo(new __aspxRichEdit.AddAbstractNumberingListHistoryItem(this.control.modelManipulator, subDocument, abstractNumberingList));
            var abstractNumberingListIndex = this.control.model.abstractNumberingLists.length - 1;
            var numberingList = new __aspxRichEdit.NumberingList(this.control.model, abstractNumberingListIndex);
            this.control.history.addAndRedo(new __aspxRichEdit.AddNumberingListHistoryItem(this.control.modelManipulator, subDocument, numberingList));
            return this.control.model.numberingLists.length - 1;
        };
        NumberingListCommandBaseBase.prototype.processParagraphByIndex = function (_paragraphIndex) {
            return true;
        };
        NumberingListCommandBaseBase.prototype.getNumberingListTemplateIndex = function (type) {
            for (var i = 0, abstractNumberingList; abstractNumberingList = this.control.model.abstractNumberingListTemplates[i]; i++) {
                if (abstractNumberingList.getListType() === type)
                    return i;
            }
            return -1;
        };
        NumberingListCommandBaseBase.prototype.areAllParagraphsHasValidNumberingListType = function (intervals, subDocument) {
            var levelType = this.getNumberingListType();
            var paragraphIndices = subDocument.getParagraphIndicesByIntervals(intervals);
            for (var i = paragraphIndices.length - 1; i >= 0; i--) {
                var paragraphIndex = paragraphIndices[i];
                var paragraph = subDocument.paragraphs[paragraphIndex];
                if (!paragraph.isInList() || paragraph.getNumberingList().getLevelType(paragraph.getListLevelIndex()) !== levelType)
                    return false;
            }
            return true;
        };
        NumberingListCommandBaseBase.prototype.getNumberingListType = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        NumberingListCommandBaseBase.prototype.assignLevelsIndents = function (paragraphIndex, listIndex, subDocument) {
            var numberingList = this.control.model.numberingLists[listIndex];
            this.assignLevelsIndentsCore(paragraphIndex, listIndex, numberingList.levels, subDocument);
        };
        NumberingListCommandBaseBase.prototype.assignLevelsIndentsCore = function (paragraphIndex, listIndex, listLevels, subDocument) {
            var paragraph = subDocument.paragraphs[paragraphIndex];
            if (!paragraph.isInList())
                return;
            var originNumberingList = paragraph.getNumberingList();
            for (var i = 0, listLevel; listLevel = listLevels[i]; i++) {
                var originListLevelProperties = originNumberingList.levels[0].getListLevelProperties();
                var listLevelProperties = listLevel.getListLevelProperties();
                if (originListLevelProperties.originalLeftIndent !== listLevelProperties.originalLeftIndent)
                    this.control.history.addAndRedo(new __aspxRichEdit.ListLevelOriginalLeftIndentHistoryItem(this.control.modelManipulator, subDocument, false, listIndex, i, originListLevelProperties.originalLeftIndent));
            }
        };
        return NumberingListCommandBaseBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.NumberingListCommandBaseBase = NumberingListCommandBaseBase;
    var NumberingListCommandBase = (function (_super) {
        __extends(NumberingListCommandBase, _super);
        function NumberingListCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        NumberingListCommandBase.prototype.executeCore = function (state, options) {
            var _this = this;
            this.control.history.beginTransaction();
            var subDocument = options.subDocument;
            var paragraphIndices = subDocument.getParagraphIndicesByIntervals(state.intervals);
            var targetStartIndex = options.param;
            if (state.value)
                this.deleteNumberingList(paragraphIndices, subDocument);
            else if (this.control.selection.isCollapsed() && options.subDocument.paragraphs[paragraphIndices[0]].isInList() && targetStartIndex < 0) {
                var firstLevelSelected = __aspxRichEdit.ListUtils.anyOf(paragraphIndices, function (index) {
                    var paragraph = _this.control.model.activeSubDocument.paragraphs[index];
                    return paragraph.getListLevelIndex() == 0;
                });
                if (firstLevelSelected)
                    this.changeNumberingList(paragraphIndices, subDocument);
                else
                    this.modifyLevels(paragraphIndices, subDocument);
            }
            else
                this.insertNumberingList(paragraphIndices, targetStartIndex, subDocument);
            this.control.history.endTransaction();
            return true;
        };
        return NumberingListCommandBase;
    }(NumberingListCommandBaseBase));
    __aspxRichEdit.NumberingListCommandBase = NumberingListCommandBase;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ToggleNumberingListCommand = (function (_super) {
        __extends(ToggleNumberingListCommand, _super);
        function ToggleNumberingListCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleNumberingListCommand.prototype.getNumberingListType = function () {
            return __aspxRichEdit.NumberingType.Simple;
        };
        ToggleNumberingListCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.numberingSimple);
        };
        ToggleNumberingListCommand.prototype.getParagraphsLevelIndices = function (paragraphIndices, layoutPositions, continueNumberingList, listIndex, listLevelIndex, subDocument) {
            if (listLevelIndex >= 0 || !this.equalLeftIndent(paragraphIndices, layoutPositions, listIndex))
                return _super.prototype.getParagraphsLevelIndices.call(this, paragraphIndices, layoutPositions, continueNumberingList, listIndex, listLevelIndex, subDocument);
            else {
                var result = [];
                for (var i = 0; i < paragraphIndices.length; i++) {
                    var paragraph = subDocument.paragraphs[paragraphIndices[i]];
                    result.push(paragraph.isInList() ? paragraph.getListLevelIndex() : 0);
                }
                if (!continueNumberingList)
                    this.assignLevelsIndents(paragraphIndices[0], listIndex, subDocument);
                return result;
            }
        };
        ToggleNumberingListCommand.prototype.equalLeftIndent = function (paragraphIndices, layoutPositions, listIndex) {
            if (paragraphIndices.length === 1)
                return true;
            var minLeftIndent = Number.MAX_VALUE;
            var maxLeftIndent = -Number.MAX_VALUE;
            var paragraphIndicesLength = paragraphIndices.length;
            for (var i = 0; i < paragraphIndicesLength; i++) {
                var layoutPosition = layoutPositions[i];
                var startBoxPosX = layoutPosition.row.numberingListBox ? layoutPosition.row.numberingListBox.textBox.x : this.getStartBox(layoutPosition.row.boxes).x;
                var boxLeft = layoutPosition.row.x + startBoxPosX;
                minLeftIndent = Math.min(boxLeft, minLeftIndent);
                maxLeftIndent = Math.max(boxLeft, maxLeftIndent);
            }
            var numberingList = this.control.model.numberingLists[listIndex];
            var leftIndent = numberingList.levels[1].getParagraphMergedProperies().leftIndent -
                numberingList.levels[0].getParagraphMergedProperies().leftIndent;
            return maxLeftIndent - minLeftIndent < leftIndent;
        };
        ToggleNumberingListCommand.prototype.assignLevelsIndentsCore = function (paragraphIndex, listIndex, listLevels, subDocument) {
            _super.prototype.assignLevelsIndentsCore.call(this, paragraphIndex, listIndex, listLevels, subDocument);
            var isEmptyList = __aspxRichEdit.ListUtils.anyOf(subDocument.paragraphs, function (p) { return p.numberingListIndex == listIndex; }) == null;
            if (isEmptyList) {
                var paragraph = subDocument.paragraphs[paragraphIndex];
                if (paragraph.isInList())
                    return;
                for (var i = 0, listLevel; listLevel = listLevels[i]; i++) {
                    var listLevelMergedParagraphProperties = listLevel.getParagraphMergedProperies();
                    this.control.history.addAndRedo(new __aspxRichEdit.ListLevelOriginalLeftIndentHistoryItem(this.control.modelManipulator, subDocument, false, listIndex, i, listLevelMergedParagraphProperties.leftIndent));
                    this.control.history.addAndRedo(new __aspxRichEdit.ListLevelParagraphLeftIndentHistoryItem(this.control.modelManipulator, subDocument, false, listIndex, i, listLevelMergedParagraphProperties.leftIndent + paragraph.getParagraphMergedProperies().leftIndent, true));
                }
            }
        };
        return ToggleNumberingListCommand;
    }(__aspxRichEdit.NumberingListCommandBase));
    __aspxRichEdit.ToggleNumberingListCommand = ToggleNumberingListCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ParagraphIndentCommandBase = (function (_super) {
        __extends(ParagraphIndentCommandBase, _super);
        function ParagraphIndentCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphIndentCommandBase.prototype.getState = function (options) {
            if (options === void 0) { options = this.convertToCommandOptions(undefined); }
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled(options));
        };
        ParagraphIndentCommandBase.prototype.isEnabled = function (_options) {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.paragraphFormatting);
        };
        ParagraphIndentCommandBase.prototype.getIntervalsForModifying = function () {
            return __aspxRichEdit.RichUtils.getIntervalsOfSelectedParagraphs(this.control.selection.intervals, this.control.model.activeSubDocument);
        };
        ParagraphIndentCommandBase.prototype.getTabs = function (paragraphIndices, subDocument) {
            var endParagraphIndex = paragraphIndices[paragraphIndices.length - 1];
            var startParagraphIndex = paragraphIndices[0];
            var firstParagraph = subDocument.paragraphs[startParagraphIndex];
            var tabInfos = firstParagraph.getTabs();
            var result = [];
            for (var i = 0, tabInfo; tabInfo = tabInfos[i]; i++) {
                result.push(tabInfo.position);
            }
            if (paragraphIndices[0] === 0 && paragraphIndices.length === 1)
                result = result.concat(this.getParagraphTabs(firstParagraph));
            else {
                if (paragraphIndices[0] > 0)
                    result = result.concat(this.getParagraphTabs(subDocument.paragraphs[startParagraphIndex - 1]));
                if (endParagraphIndex < subDocument.paragraphs.length - 1)
                    result = result.concat(this.getParagraphTabs(subDocument.paragraphs[endParagraphIndex + 1]));
            }
            result.sort(__aspxRichEdit.CompareUtils.numberCmpFunc);
            return result;
        };
        ParagraphIndentCommandBase.prototype.getNearRightDefaultTab = function (leftIndent) {
            var defTabWidth = this.control.model.defaultTabWidth;
            return Math.floor((leftIndent / defTabWidth) + 1) * defTabWidth;
        };
        ParagraphIndentCommandBase.prototype.getNearLeftDefaultTab = function (leftIndent) {
            var defTabWidth = this.control.model.defaultTabWidth;
            var nearestLeftDefaultTab = Math.floor(leftIndent / defTabWidth);
            if (nearestLeftDefaultTab > 0) {
                if (leftIndent % defTabWidth != 0)
                    return nearestLeftDefaultTab * defTabWidth;
                else
                    return (nearestLeftDefaultTab - 1) * defTabWidth;
            }
            return nearestLeftDefaultTab;
        };
        ParagraphIndentCommandBase.prototype.getNearRightTab = function (leftIndent, tabs) {
            for (var i = 0; i < tabs.length; i++) {
                if (leftIndent < tabs[i])
                    return tabs[i];
            }
            return leftIndent;
        };
        ParagraphIndentCommandBase.prototype.getNearLeftTab = function (leftIndent, tabs) {
            for (var i = tabs.length - 1; i >= 0; i--) {
                if (leftIndent > tabs[i])
                    return tabs[i];
            }
            return leftIndent;
        };
        ParagraphIndentCommandBase.prototype.getParagraphTabs = function (paragraph) {
            var result = [];
            var mergedProperties = paragraph.getParagraphMergedProperies();
            result.push(mergedProperties.leftIndent);
            if (mergedProperties.firstLineIndentType === __aspxRichEdit.ParagraphFirstLineIndent.Hanging)
                result.push(mergedProperties.leftIndent - mergedProperties.firstLineIndent);
            else if (mergedProperties.firstLineIndentType === __aspxRichEdit.ParagraphFirstLineIndent.Indented)
                result.push(mergedProperties.leftIndent + mergedProperties.firstLineIndent);
            return result;
        };
        return ParagraphIndentCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ParagraphIndentCommandBase = ParagraphIndentCommandBase;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HeaderFooterCommandBase = (function (_super) {
        __extends(HeaderFooterCommandBase, _super);
        function HeaderFooterCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        HeaderFooterCommandBase.prototype.getState = function () {
            var isEnabled = this.isEnabled();
            return new __aspxRichEdit.SimpleCommandState(isEnabled, isEnabled ? this.getValue() : false);
        };
        HeaderFooterCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) &&
                __aspxRichEdit.ControlOptions.isEnabled(this.control.options.sections) &&
                __aspxRichEdit.ControlOptions.isEnabled(this.control.options.headersFooters) &&
                this.control.innerClientProperties.viewsSettings.isPrintLayoutView &&
                this.control.model.activeSubDocument.isHeaderFooter();
        };
        HeaderFooterCommandBase.prototype.getValue = function () {
            return null;
        };
        HeaderFooterCommandBase.prototype.getSectionIndex = function (pageIndex) {
            var layoutPage = this.control.layoutFormatterManager.forceFormatPage(pageIndex);
            var lp = layoutPage ? layoutPage : this.control.layout.getLastValidPage();
            return lp ? __aspxRichEdit.Section.getPageSectionIndex(lp, this.control.model.sections) : 0;
        };
        HeaderFooterCommandBase.getManipulator = function (isHeader, control) {
            return isHeader ? control.modelManipulator.headerManipulator : control.modelManipulator.footerManipulator;
        };
        HeaderFooterCommandBase.getObjectsCache = function (isHeader, control) {
            return isHeader ? control.model.headers : control.model.footers;
        };
        HeaderFooterCommandBase.getSectionHeadersFooters = function (isHeader, section) {
            return isHeader ? section.headers : section.footers;
        };
        return HeaderFooterCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.HeaderFooterCommandBase = HeaderFooterCommandBase;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var BaseRunImporter = (function () {
        function BaseRunImporter() {
        }
        BaseRunImporter.prototype.getRun = function (paragraph, startOffset, jsonRun) {
            return this.makeRun(jsonRun, startOffset, paragraph, this.charStyles[jsonRun[__aspxRichEdit.JSONRunBaseProperty.CharacterStyleIndex]], this.maskedCharacterPropertiesCache.getItemByJsonKey(jsonRun[__aspxRichEdit.JSONRunBaseProperty.MaskedCharacterPropertiesCacheIndex]));
        };
        BaseRunImporter.prototype.init = function (maskedCharacterPropertiesCache, charStyles, customRunAction) {
            this.customRunAction = customRunAction;
            this.charStyles = charStyles;
            this.maskedCharacterPropertiesCache = maskedCharacterPropertiesCache;
        };
        return BaseRunImporter;
    }());
    __aspxRichEdit.BaseRunImporter = BaseRunImporter;
    var SimpleRunImporter = (function (_super) {
        __extends(SimpleRunImporter, _super);
        function SimpleRunImporter(runConstructor) {
            var _this = _super.call(this) || this;
            _this.runConstructor = runConstructor;
            return _this;
        }
        SimpleRunImporter.prototype.makeRun = function (_jsonRun, startOffset, paragraph, characterStyle, maskedCharacterProperties) {
            return new this.runConstructor(startOffset, paragraph, characterStyle, maskedCharacterProperties);
        };
        return SimpleRunImporter;
    }(BaseRunImporter));
    __aspxRichEdit.SimpleRunImporter = SimpleRunImporter;
    var TextRunImporter = (function (_super) {
        __extends(TextRunImporter, _super);
        function TextRunImporter() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TextRunImporter.prototype.makeRun = function (jsonRun, startOffset, paragraph, characterStyle, maskedCharacterProperties) {
            return new __aspxRichEdit.TextRun(startOffset, jsonRun[__aspxRichEdit.JSONRunBaseProperty.Length], paragraph, characterStyle, maskedCharacterProperties);
        };
        return TextRunImporter;
    }(BaseRunImporter));
    __aspxRichEdit.TextRunImporter = TextRunImporter;
    var AnchoredPictureRunImporter = (function (_super) {
        __extends(AnchoredPictureRunImporter, _super);
        function AnchoredPictureRunImporter() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        AnchoredPictureRunImporter.prototype.makeRun = function (jsonRun, startOffset, paragraph, characterStyle, maskedCharacterProperties) {
            var run = new __aspxRichEdit.AnchoredPictureRun(startOffset, paragraph, characterStyle, maskedCharacterProperties, __aspxRichEdit.JSONShapeConverter.convertFromJSON(jsonRun[__aspxRichEdit.JSONAnchoredPictureRunProperty.Shape]), jsonRun[__aspxRichEdit.JSONAnchoredPictureRunProperty.PictureId], __aspxRichEdit.JSONInlinePictureSizeConverterConverter.convertFromJSON(jsonRun[__aspxRichEdit.JSONAnchoredPictureRunProperty.Size]), __aspxRichEdit.JSONAnchorInfoConverter.convertFromJSON(jsonRun[__aspxRichEdit.JSONAnchoredPictureRunProperty.AnchorInfo]), true, -1);
            if (this.customRunAction)
                this.customRunAction(run);
            return run;
        };
        return AnchoredPictureRunImporter;
    }(BaseRunImporter));
    __aspxRichEdit.AnchoredPictureRunImporter = AnchoredPictureRunImporter;
    var AnchoredTextBoxRunImporter = (function (_super) {
        __extends(AnchoredTextBoxRunImporter, _super);
        function AnchoredTextBoxRunImporter() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        AnchoredTextBoxRunImporter.prototype.makeRun = function (jsonRun, startOffset, paragraph, characterStyle, maskedCharacterProperties) {
            return new __aspxRichEdit.AnchoredTextBoxRun(startOffset, paragraph, characterStyle, maskedCharacterProperties, __aspxRichEdit.JSONShapeConverter.convertFromJSON(jsonRun[__aspxRichEdit.JSONAnchoredTextBoxRunProperty.Shape]), jsonRun[__aspxRichEdit.JSONAnchoredTextBoxRunProperty.SubDocId], __aspxRichEdit.JSONAnchorTextBoxSizeConverterConverter.convertFromJSON(jsonRun[__aspxRichEdit.JSONAnchoredTextBoxRunProperty.Size]), __aspxRichEdit.JSONAnchorInfoConverter.convertFromJSON(jsonRun[__aspxRichEdit.JSONAnchoredTextBoxRunProperty.AnchorInfo]), -1, __aspxRichEdit.JSONTextBoxPropertiesConverter.convertFromJSON(jsonRun[__aspxRichEdit.JSONAnchoredTextBoxRunProperty.TextBoxProperties]));
        };
        return AnchoredTextBoxRunImporter;
    }(BaseRunImporter));
    __aspxRichEdit.AnchoredTextBoxRunImporter = AnchoredTextBoxRunImporter;
    var InlinePictureRunImporter = (function (_super) {
        __extends(InlinePictureRunImporter, _super);
        function InlinePictureRunImporter() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InlinePictureRunImporter.prototype.makeRun = function (jsonRun, startOffset, paragraph, characterStyle, maskedCharacterProperties) {
            var run = new __aspxRichEdit.InlinePictureRun(startOffset, paragraph, characterStyle, maskedCharacterProperties, __aspxRichEdit.JSONShapeConverter.convertFromJSON(jsonRun[__aspxRichEdit.JSONInlinePictureRunProperty.Shape]), jsonRun[__aspxRichEdit.JSONInlinePictureRunProperty.PictureId], __aspxRichEdit.JSONInlinePictureSizeConverterConverter.convertFromJSON(jsonRun[__aspxRichEdit.JSONInlinePictureRunProperty.Size]), true, -1);
            if (this.customRunAction)
                this.customRunAction(run);
            return run;
        };
        return InlinePictureRunImporter;
    }(BaseRunImporter));
    __aspxRichEdit.InlinePictureRunImporter = InlinePictureRunImporter;
    var InlineTextBoxRunImporter = (function (_super) {
        __extends(InlineTextBoxRunImporter, _super);
        function InlineTextBoxRunImporter() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InlineTextBoxRunImporter.prototype.makeRun = function (jsonRun, startOffset, paragraph, characterStyle, maskedCharacterProperties) {
            return new __aspxRichEdit.InlineTextBoxRun(startOffset, paragraph, characterStyle, maskedCharacterProperties, __aspxRichEdit.JSONShapeConverter.convertFromJSON(jsonRun[__aspxRichEdit.JSONInlineTextBoxRunProperty.Shape]), jsonRun[__aspxRichEdit.JSONInlineTextBoxRunProperty.SubDocId], __aspxRichEdit.JSONInlineTextBoxSizeConverterConverter.convertFromJSON(jsonRun[__aspxRichEdit.JSONInlineTextBoxRunProperty.Size]), __aspxRichEdit.JSONTextBoxPropertiesConverter.convertFromJSON(jsonRun[__aspxRichEdit.JSONInlineTextBoxRunProperty.TextBoxProperties]));
        };
        return InlineTextBoxRunImporter;
    }(BaseRunImporter));
    __aspxRichEdit.InlineTextBoxRunImporter = InlineTextBoxRunImporter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutWordBoundsIterator = (function () {
        function LayoutWordBoundsIterator(layout, subDocument, selection, startPosition, endPosition) {
            this.isInitOk = true;
            this.isFirstCallNextSymbol = true;
            if (layout.validPageCount < 1) {
                this.startResultPosition = -1;
                this.isInitOk = false;
                return;
            }
            this.boxIterator = subDocument.isMain() ?
                new __aspxRichEdit.LayoutBoxIteratorMainSubDocument(subDocument, layout, startPosition, endPosition) :
                new __aspxRichEdit.LayoutBoxIteratorOtherSubDocument(subDocument, layout, startPosition, endPosition, selection.pageIndex);
        }
        LayoutWordBoundsIterator.prototype.isSet = function () {
            if (!this.isInitOk)
                return false;
            if (this.boxIterator.isInitialized())
                return true;
            this.startResultPosition = -1;
            return false;
        };
        LayoutWordBoundsIterator.prototype.currSymbolStartPosition = function () {
            return this.boxIterator.position.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Box) + this.charOffset;
        };
        LayoutWordBoundsIterator.prototype.getNextSymbolGroup = function () {
            if (!this.getNextSymbol())
                return false;
            this.groupMask = this.getGroupMask();
            return true;
        };
        LayoutWordBoundsIterator.prototype.getNextSymbol = function () {
            if (this.isFirstCallNextSymbol) {
                this.isFirstCallNextSymbol = false;
                if (!this.moveIterator())
                    return false;
                this.charOffset = this.boxIterator.position.charOffset;
                if (this.needExcessMoveBoxIterator())
                    this.moveIterator();
                return true;
            }
            if (this.nextCallsSetCharOffset())
                return true;
            if (!this.moveIterator())
                return false;
            this.setCharacterOffsetOnNextCalls();
            return true;
        };
        LayoutWordBoundsIterator.prototype.needExcessMoveBoxIterator = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        LayoutWordBoundsIterator.prototype.nextCallsSetCharOffset = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        LayoutWordBoundsIterator.prototype.setCharacterOffsetOnNextCalls = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        LayoutWordBoundsIterator.prototype.moveIterator = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        LayoutWordBoundsIterator.prototype.getGroupMask = function () {
            switch (this.boxIterator.position.box.getType()) {
                case __aspxRichEdit.LayoutBoxType.Text:
                    return this.getTextGroupMask();
                case __aspxRichEdit.LayoutBoxType.Space:
                    return __aspxRichEdit.WordGroupMask.Space;
                case __aspxRichEdit.LayoutBoxType.Dash:
                    return __aspxRichEdit.WordGroupMask.PunctuationMark;
                case __aspxRichEdit.LayoutBoxType.Picture:
                case __aspxRichEdit.LayoutBoxType.ParagraphMark:
                case __aspxRichEdit.LayoutBoxType.PageBreak:
                case __aspxRichEdit.LayoutBoxType.ColumnBreak:
                case __aspxRichEdit.LayoutBoxType.SectionMark:
                case __aspxRichEdit.LayoutBoxType.TabSpace:
                case __aspxRichEdit.LayoutBoxType.LineBreak:
                case __aspxRichEdit.LayoutBoxType.NumberingList:
                case __aspxRichEdit.LayoutBoxType.FieldCodeStart:
                case __aspxRichEdit.LayoutBoxType.FieldCodeEnd:
                case __aspxRichEdit.LayoutBoxType.LayoutDependent:
                case __aspxRichEdit.LayoutBoxType.AnchorPicture:
                case __aspxRichEdit.LayoutBoxType.AnchorTextBox:
                default:
                    return __aspxRichEdit.WordGroupMask.DiffersFromAll;
            }
        };
        LayoutWordBoundsIterator.prototype.getTextGroupMask = function () {
            switch (this.boxIterator.position.box.renderGetContent(null)[this.charOffset]) {
                case __aspxRichEdit.RichUtils.specialCharacters.QmSpace:
                case __aspxRichEdit.RichUtils.specialCharacters.EmSpace:
                case __aspxRichEdit.RichUtils.specialCharacters.EnSpace:
                case __aspxRichEdit.RichUtils.specialCharacters.NonBreakingSpace:
                    return __aspxRichEdit.WordGroupMask.Space;
                case __aspxRichEdit.RichUtils.specialCharacters.LeftSingleQuote:
                    return __aspxRichEdit.WordGroupMask.LeftSingleQuote;
                case __aspxRichEdit.RichUtils.specialCharacters.LeftDoubleQuote:
                    return __aspxRichEdit.WordGroupMask.LeftDoubleQuote;
                case __aspxRichEdit.RichUtils.specialCharacters.RightDoubleQuote:
                    return __aspxRichEdit.WordGroupMask.RightDoubleQuote;
                case '"':
                    return __aspxRichEdit.WordGroupMask.DoubleQuote;
                case "(":
                case ")":
                case "«":
                case "»":
                case "<":
                case ">":
                case "/":
                case "№":
                case "%":
                case "!":
                case ":":
                case "?":
                case ";":
                case "|":
                case "+":
                case ",":
                case ".":
                case "*":
                case "=":
                case "\\":
                    return __aspxRichEdit.WordGroupMask.PunctuationMark;
                default:
                    return __aspxRichEdit.WordGroupMask.Others;
            }
        };
        return LayoutWordBoundsIterator;
    }());
    __aspxRichEdit.LayoutWordBoundsIterator = LayoutWordBoundsIterator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SelectionRendererBase = (function () {
        function SelectionRendererBase(cache, layoutSelection) {
            this.cache = cache;
            this.layoutSelection = layoutSelection;
        }
        SelectionRendererBase.prototype.closeDocument = function () { };
        SelectionRendererBase.prototype.applySelectionChanges = function (layout) {
            var _this = this;
            var _loop_1 = function (pageChange) {
                var layoutPage = layout.pages[pageChange.index];
                if (!layoutPage || !layoutPage.flags.get(__aspxRichEdit.LayoutPageFlags.ContentRendered))
                    return "continue";
                layoutPage.flags.set(this_1.layoutPageFlag, true);
                var ancObjHolder = layoutPage.anchoredObjectHolder;
                for (var _i = 0, _a = pageChange.areaChanges; _i < _a.length; _i++) {
                    var areaChange = _a[_i];
                    __aspxRichEdit.DocumentRenderer.applyChange(this_1.cache[pageChange.index].page, areaChange, this_1.getContainer, function () { return _this.renderItem(areaChange.selection, ancObjHolder); });
                }
            };
            var this_1 = this;
            for (var _i = 0, _a = this.getLayoutSelectionInfo().changes; _i < _a.length; _i++) {
                var pageChange = _a[_i];
                _loop_1(pageChange);
            }
            this.getLayoutSelectionInfo().changesApplied();
        };
        SelectionRendererBase.prototype.renderAllPageSelection = function (layout, pageIndex, force) {
            var pageCache = this.cache[pageIndex];
            if (!pageCache)
                return;
            var container = this.getContainer(pageCache.page);
            var pageInfo = this.getLayoutSelectionInfo().pageInfos[pageIndex];
            var layoutPage = layout.pages[pageIndex];
            if (!container || (!force && container.childNodes.length != 0) || !pageInfo || !layoutPage)
                return;
            layoutPage.flags.set(this.layoutPageFlag, true);
            var ancObjHolder = layoutPage.anchoredObjectHolder;
            if (force)
                __aspxRichEdit.HTMLUtils.clearInnerHtml(container);
            for (var _i = 0, _a = pageInfo.oldItems; _i < _a.length; _i++) {
                var item = _a[_i];
                container.appendChild(this.renderItem(item, ancObjHolder));
            }
        };
        SelectionRendererBase.prototype.renderItem = function (item, ancObjHolder) {
            var level = item.floatingObjectId == __aspxRichEdit.LayoutSelectionItem.mainPageAreaSelection ?
                __aspxRichEdit.ZIndexHelper.mainHeaderFooterPageAreaLevel : ancObjHolder.getObjById(item.floatingObjectId).rendererLevel;
            var selectionElement = __aspxRichEdit.DocumentRenderer.renderContainer(item.baseClassName + " " + __aspxRichEdit.ZIndexHelper.getClassName(level, item.zIndexClassType));
            __aspxRichEdit.HTMLUtils.setStyleSizeAndPosition(selectionElement.style, item);
            return selectionElement;
        };
        return SelectionRendererBase;
    }());
    __aspxRichEdit.SelectionRendererBase = SelectionRendererBase;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var MouseEventSource;
    (function (MouseEventSource) {
        MouseEventSource[MouseEventSource["Undefined"] = 0] = "Undefined";
        MouseEventSource[MouseEventSource["ResizeBox_NW"] = 1] = "ResizeBox_NW";
        MouseEventSource[MouseEventSource["ResizeBox_NE"] = 2] = "ResizeBox_NE";
        MouseEventSource[MouseEventSource["ResizeBox_SE"] = 3] = "ResizeBox_SE";
        MouseEventSource[MouseEventSource["ResizeBox_SW"] = 4] = "ResizeBox_SW";
        MouseEventSource[MouseEventSource["ResizeBox_N"] = 5] = "ResizeBox_N";
        MouseEventSource[MouseEventSource["ResizeBox_E"] = 6] = "ResizeBox_E";
        MouseEventSource[MouseEventSource["ResizeBox_S"] = 7] = "ResizeBox_S";
        MouseEventSource[MouseEventSource["ResizeBox_W"] = 8] = "ResizeBox_W";
    })(MouseEventSource = __aspxRichEdit.MouseEventSource || (__aspxRichEdit.MouseEventSource = {}));
    var MouseButton;
    (function (MouseButton) {
        MouseButton[MouseButton["None"] = 0] = "None";
        MouseButton[MouseButton["Left"] = 1] = "Left";
        MouseButton[MouseButton["Right"] = 2] = "Right";
        MouseButton[MouseButton["Middle"] = 4] = "Middle";
    })(MouseButton = __aspxRichEdit.MouseButton || (__aspxRichEdit.MouseButton = {}));
    var EventManager = (function () {
        function EventManager(control, boxVisualizerManager) {
            this.moveLocked = false;
            this.accumulatedText = "";
            this.accumulatedTextInsertId = -1;
            this.accumulatedTextMaxLength = REWebUtils.Browser.Chrome ? 3 : 9;
            this.control = control;
            this.mouseHandler = new __aspxRichEdit.MouseHandler(control, boxVisualizerManager);
            this.touchHandler = new __aspxRichEdit.TouchHandler(control, boxVisualizerManager);
        }
        Object.defineProperty(EventManager.prototype, "mouseWheelEvent", {
            set: function (val) {
                this.mouseHandler.mouseWheelEvent = val;
                this.touchHandler.mouseWheelEvent = val;
            },
            enumerable: true,
            configurable: true
        });
        EventManager.prototype.onShortcut = function (shortcutCode) {
            if (this.accumulatedText.length)
                this.insertFunc();
            this.control.shortcutManager.processShortcut(shortcutCode);
            this.mouseHandler.onShortcut(shortcutCode);
            if (__aspxRichEdit.EnumUtils.isAnyOf(shortcutCode, REWebUtils.KeyCode.Enter, REWebUtils.KeyCode.Tab, REWebUtils.KeyCode.Space) && this.control.selection.getLastSelectedInterval().start > 0)
                this.control.autoCorrectService.performAutoCorrect();
        };
        EventManager.prototype.onMouseDown = function (evt) {
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.EventManager, "onMouseDown", __aspxRichEdit.LogObjToStr.richMouseEvent(evt));
            if (!this.control.clientSideEvents.raisePointerDown(evt.mouseEvent)) {
                this.lockMouseMove();
                this.mouseHandler.onMouseDown(evt);
            }
        };
        EventManager.prototype.onMouseMove = function (evt) {
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.EventManager, "onMouseMove", __aspxRichEdit.LogObjToStr.richMouseEvent(evt));
            if (this.moveLocked)
                return;
            this.mouseHandler.onMouseMove(evt);
        };
        EventManager.prototype.onMouseUp = function (evt) {
            var _this = this;
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.EventManager, "onMouseUp", __aspxRichEdit.LogObjToStr.richMouseEvent(evt));
            var handled = false;
            if (evt.layoutPoint)
                handled = this.control.clientSideEvents.raisePointerUp(evt.mouseEvent);
            if (!handled) {
                this.lockMouseMove();
                this.mouseHandler.onMouseUp(evt);
                if (evt.layoutPoint) {
                    if (REWebUtils.Browser.TouchUI)
                        this.control.inputController.setPosition(evt.absolutePoint.x + 2, evt.absolutePoint.y + 2);
                    setTimeout(function () { return _this.control.focusManager.captureFocus(); }, 0);
                }
            }
        };
        EventManager.prototype.onTouchStart = function (evt) {
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.EventManager, "onTouchStart", __aspxRichEdit.LogObjToStr.richMouseEvent(evt));
            if (!this.control.clientSideEvents.raisePointerDown(evt.mouseEvent))
                this.touchHandler.onTouchStart(evt);
        };
        EventManager.prototype.onTouchEnd = function (evt) {
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.EventManager, "onTouchEnd", __aspxRichEdit.LogObjToStr.richMouseEvent(evt));
            var handled = false;
            if (evt.layoutPoint)
                handled = this.control.clientSideEvents.raisePointerUp(evt.mouseEvent);
            if (!handled)
                this.touchHandler.onTouchEnd(evt);
        };
        EventManager.prototype.onTouchMove = function (evt) {
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.EventManager, "onTouchMove", __aspxRichEdit.LogObjToStr.richMouseEvent(evt));
            return this.touchHandler.onTouchMove(evt);
        };
        EventManager.prototype.onDoubleTap = function (evt) {
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.EventManager, "onDoubleTap", __aspxRichEdit.LogObjToStr.richMouseEvent(evt));
            this.touchHandler.onDoubleTap(evt);
        };
        EventManager.prototype.onGestureStart = function (evt) {
            this.touchHandler.onGestureStart(evt);
        };
        EventManager.prototype.onMouseDblClick = function (evt) {
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.EventManager, "onMouseDoubleClick", __aspxRichEdit.LogObjToStr.richMouseEvent(evt));
            this.mouseHandler.onMouseDoubleClick(evt);
            this.control.inputController.setPosition(evt.absolutePoint.x, evt.absolutePoint.y);
        };
        EventManager.prototype.onMouseWheel = function (evt) {
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.EventManager, "onMouseWheel", __aspxRichEdit.LogObjToStr.richMouseEvent(evt));
            this.mouseHandler.onMouseWheel(evt);
        };
        EventManager.prototype.onText = function (text, isUpdated) {
            var _this = this;
            if (isUpdated)
                __aspxRichEdit.ModelManipulator.modifyLastInsertedSymbol(this.control, text);
            else {
                this.accumulatedText += text;
                if (this.accumulatedTextInsertId != -1)
                    clearTimeout(this.accumulatedTextInsertId);
                if (this.accumulatedText.length > this.accumulatedTextMaxLength)
                    this.insertFunc();
                else
                    this.accumulatedTextInsertId = setTimeout(function () { return _this.insertFunc.apply(_this); }, 1);
            }
        };
        EventManager.prototype.onTextReplace = function (text, length) {
            length != undefined ? __aspxRichEdit.ModelManipulator.modifyLastText(this.control, text, length) : __aspxRichEdit.ModelManipulator.modifyTextUnderCursor(this.control, text);
        };
        EventManager.prototype.insertFunc = function () {
            var insertCommand = this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.InsertText);
            var textWasInserted = insertCommand.execute(this.control.commandManager.isPublicApiCall, this.accumulatedText);
            this.accumulatedText = "";
            this.accumulatedTextInsertId = -1;
            if (textWasInserted)
                this.control.autoCorrectService.performAutoCorrect();
        };
        EventManager.prototype.onFocusIn = function () {
            if (this.control.readOnly === __aspxRichEdit.ReadOnlyMode.None) {
                if (!this.isFocused())
                    this.control.clientSideEvents.raiseGotFocus();
                this.control.focusManager.isInFocus = true;
            }
        };
        EventManager.prototype.onFocusOut = function () {
            if (this.isFocused())
                this.control.clientSideEvents.raiseLostFocus();
            this.control.focusManager.isInFocus = false;
        };
        EventManager.prototype.isFocused = function () {
            return this.control.focusManager.isInFocus;
        };
        EventManager.prototype.lockMouseMove = function () {
            var _this = this;
            this.moveLocked = true;
            setTimeout(function () { return _this.moveLocked = false; }, 0);
        };
        return EventManager;
    }());
    __aspxRichEdit.EventManager = EventManager;
    var RichMouseEvent = (function () {
        function RichMouseEvent(evt, layoutPoint, source, scrollTop, scrollLeft) {
            this.layoutPoint = layoutPoint;
            this.absolutePoint = new __aspxRichEdit.Point(REWebUtils.Evt.GetEventX(evt), REWebUtils.Evt.GetEventY(evt));
            this.scroll = new __aspxRichEdit.Point(scrollLeft, scrollTop);
            this.modifiers = __aspxRichEdit.RichUtils.getKeyModifiers(evt);
            this.button = this.isLeftButtonPressed(evt) ? MouseButton.Left : MouseButton.Right;
            this.middleButtonPressed = !!(evt.buttons & MouseButton.Middle);
            this.source = source;
            this.mouseEvent = evt;
        }
        RichMouseEvent.prototype.isLeftButtonPressed = function (evt) {
            return !REWebUtils.Browser.MSTouchUI ? REWebUtils.Evt.IsLeftButtonPressed(evt) : evt.button != 2;
        };
        return RichMouseEvent;
    }());
    __aspxRichEdit.RichMouseEvent = RichMouseEvent;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FrameBaseListener = (function () {
        function FrameBaseListener(rendererCache) {
            this.rendererCache = rendererCache;
            this.baseFrame = __aspxRichEdit.DocumentRenderer.renderContainer(this.baseFrameClassName());
        }
        FrameBaseListener.prototype.NotifyHide = function () {
            __aspxRichEdit.HTMLUtils.hideNode(this.baseFrame);
        };
        FrameBaseListener.prototype.NotifyShow = function (pageIndex, bounds, tip, isTextBox, isAnchoredObject, rotation) {
            __aspxRichEdit.HTMLUtils.setStyleSizeAndPosition(this.baseFrame.style, bounds);
            if (tip)
                this.baseFrame.title = __aspxRichEdit.HtmlConverter.buildHyperlinkTipString(tip);
            this.toggleClass(__aspxRichEdit.DocumentRenderer.setRotationInRadians(this.baseFrame, rotation), FrameBaseListener.CLASSNAMES.IS_BOX_ROTATED);
            this.toggleClass(isTextBox, FrameBaseListener.CLASSNAMES.TEXTBOX_AREA);
            this.toggleClass(isAnchoredObject, FrameBaseListener.CLASSNAMES.ANCHORED_OBJECT);
            __aspxRichEdit.DocumentRenderer.getServiceContainerCore(this.rendererCache[pageIndex].page).appendChild(this.baseFrame);
        };
        FrameBaseListener.prototype.toggleClass = function (shouldBeEnabled, className) {
            if (shouldBeEnabled)
                this.baseFrame.classList.add(className);
            else
                this.baseFrame.classList.remove(className);
        };
        FrameBaseListener.CLASSNAMES = {
            CONTAINER: "dxreResBox",
            CORNER_ELEM_PREFIX: "dxreResBoxCornerElem",
            CORNER_LINE_PREFIX: "dxreResBoxCornerLine",
            CORNER_TOUCH_POSTFIX: "Touch",
            ROTATION_BOX: "dxreResBoxRotation",
            ROTATION_LINE: "dxreResBoxRotationLine",
            ANCHORED_OBJECT: "dxreResBoxAnchored",
            TEXTBOX_AREA: "dxreResBoxTextBoxArea",
            IS_BOX_ROTATED: "dxreResBoxRotated",
        };
        return FrameBaseListener;
    }());
    __aspxRichEdit.FrameBaseListener = FrameBaseListener;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Renderer;
    (function (Renderer) {
        var ChangeActiveSubDocument;
        (function (ChangeActiveSubDocument) {
            var BaseRenderer = (function () {
                function BaseRenderer(renderer) {
                    this.renderer = renderer;
                    this.init();
                }
                BaseRenderer.prototype.init = function () {
                    this.pageIndex = -2;
                    this.subDocumentInfo = null;
                    this.handledPages = {};
                };
                BaseRenderer.prototype.update = function (newSubDocumentInfo, newPageIndex) {
                    var _this = this;
                    this.innerUpdate(newSubDocumentInfo, newPageIndex, function () {
                        var renderedPages = _this.renderer.scroll.renderPageIndexInterval();
                        var useCache = _this.pageIndex == _this.newPageIndex &&
                            _this.subDocumentInfo.subDocumentId == _this.newSubDocumentInfo.subDocumentId;
                        var handledPages = useCache ? _this.handledPages : {};
                        _this.handledPages = {};
                        __aspxRichEdit.MapUtilsKeyAsNumber.foreach(handledPages, function (handledPageIndex) {
                            if (!renderedPages.contains(handledPageIndex))
                                if (!_this.handlePageHide(handledPageIndex))
                                    _this.handledPages[handledPageIndex] = handledPageIndex;
                        });
                        __aspxRichEdit.ListUtils.foreachOnInterval(renderedPages, function (renderedPageIndex) {
                            if (handledPages[renderedPageIndex] === undefined)
                                if (_this.handlePageRender(renderedPageIndex, false))
                                    _this.handledPages[renderedPageIndex] = renderedPageIndex;
                        });
                    });
                };
                BaseRenderer.prototype.updatePage = function (pageIndex, newSubDocumentInfo, newPageIndex) {
                    var _this = this;
                    this.innerUpdate(newSubDocumentInfo, newPageIndex, function () {
                        if (_this.handlePageRender(pageIndex, true))
                            _this.handledPages[pageIndex] = pageIndex;
                    });
                };
                BaseRenderer.prototype.innerUpdate = function (newSubDocumentInfo, newPageIndex, action) {
                    if (newSubDocumentInfo) {
                        this.newSubDocumentInfo = newSubDocumentInfo;
                        this.newPageIndex = newPageIndex;
                        action();
                        this.subDocumentInfo = newSubDocumentInfo;
                        this.pageIndex = newPageIndex;
                    }
                };
                BaseRenderer.prototype.isHeaderFooterActive = function (layoutPage) {
                    if (this.newSubDocumentInfo.isHeaderFooter)
                        return true;
                    if (!this.newSubDocumentInfo.isTextBox)
                        return false;
                    var paSdId = this.newSubDocumentInfo.parentSubDocumentId;
                    var pa = layoutPage.otherPageAreas[paSdId];
                    return pa && pa.subDocument.isHeaderFooter();
                };
                return BaseRenderer;
            }());
            ChangeActiveSubDocument.BaseRenderer = BaseRenderer;
        })(ChangeActiveSubDocument = Renderer.ChangeActiveSubDocument || (Renderer.ChangeActiveSubDocument = {}));
    })(Renderer = __aspxRichEdit.Renderer || (__aspxRichEdit.Renderer = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var BaseVisualizer = (function () {
        function BaseVisualizer(control) {
            this.onChanged = new __aspxRichEdit.EventDispatcher();
            this.control = control;
            this.reset();
        }
        BaseVisualizer.prototype.closeDocument = function () {
            this.reset();
            this.raiseHide();
        };
        BaseVisualizer.prototype.reset = function () {
            this.pageIndex = -1;
            this.bounds = null;
            this.tip = null;
        };
        BaseVisualizer.prototype.hide = function () {
            this.reset();
            this.raiseHide();
        };
        BaseVisualizer.prototype.raiseShow = function () {
            this.onChanged.raise("NotifyShow", this.pageIndex, this.bounds, this.tip, this.isTextBox, this.isAnchoredObject, this.rotation);
        };
        BaseVisualizer.prototype.raiseHide = function () {
            this.onChanged.raise("NotifyHide");
        };
        return BaseVisualizer;
    }());
    __aspxRichEdit.BaseVisualizer = BaseVisualizer;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlTagImporterBase = (function () {
            function HtmlTagImporterBase(importer) {
                this.importer = importer;
            }
            Object.defineProperty(HtmlTagImporterBase.prototype, "colorProvider", {
                get: function () { return this.importer.control.model.colorProvider; },
                enumerable: true,
                configurable: true
            });
            HtmlTagImporterBase.prototype.getClosestImporterByTagName = function (tagName) {
                return __aspxRichEdit.ListUtils.reverseElementBy(this.importer.levelInfo, function (levelInfo) { return levelInfo.tagImporter.elementTag() == tagName; }).tagImporter;
            };
            HtmlTagImporterBase.prototype.isAllowed = function () {
                return true;
            };
            HtmlTagImporterBase.prototype.addRun = function (run) {
                this.importer.addRun(run);
            };
            Object.defineProperty(HtmlTagImporterBase.prototype, "element", {
                get: function () {
                    return this.importer.currElement;
                },
                enumerable: true,
                configurable: true
            });
            return HtmlTagImporterBase;
        }());
        HtmlImport.HtmlTagImporterBase = HtmlTagImporterBase;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LineNumberingRestart;
    (function (LineNumberingRestart) {
        LineNumberingRestart[LineNumberingRestart["NewPage"] = 0] = "NewPage";
        LineNumberingRestart[LineNumberingRestart["NewSection"] = 1] = "NewSection";
        LineNumberingRestart[LineNumberingRestart["Continuous"] = 2] = "Continuous";
    })(LineNumberingRestart = __aspxRichEdit.LineNumberingRestart || (__aspxRichEdit.LineNumberingRestart = {}));
    var ListLevelProperties = (function () {
        function ListLevelProperties() {
            this.start = 1;
            this.format = NumberingFormat.Decimal;
            this.alignment = ListNumberAlignment.Left;
            this.convertPreviousLevelNumberingToDecimal = false;
            this.separator = __aspxRichEdit.RichUtils.specialCharacters.TabMark;
            this.suppressRestart = false;
            this.suppressBulletResize = false;
            this.displayFormatString = "{0}.";
            this.relativeRestartLevel = 0;
            this.templateCode = 0;
            this.originalLeftIndent = 0;
            this.legacy = false;
            this.legacySpace = 0;
            this.legacyIndent = 0;
        }
        ListLevelProperties.prototype.calculateHash = function () {
            return __aspxRichEdit.MathUtils.somePrimes[0] * this.start ^
                __aspxRichEdit.MathUtils.somePrimes[1] * this.format ^
                __aspxRichEdit.MathUtils.somePrimes[2] * this.alignment ^
                __aspxRichEdit.MathUtils.somePrimes[3] * __aspxRichEdit.StringUtils.stringHashCode(this.separator) ^
                __aspxRichEdit.MathUtils.somePrimes[4] * __aspxRichEdit.Utils.boolToInt(this.suppressRestart) ^
                __aspxRichEdit.MathUtils.somePrimes[5] * this.originalLeftIndent ^
                __aspxRichEdit.MathUtils.somePrimes[6] * this.templateCode ^
                __aspxRichEdit.MathUtils.somePrimes[7] * __aspxRichEdit.StringUtils.stringHashCode(this.displayFormatString);
        };
        ListLevelProperties.prototype.getHashCode = function () {
            return this.hash === undefined ? this.hash = this.calculateHash() : this.hash;
        };
        ListLevelProperties.prototype.equals = function (obj) {
            return this.alignment === obj.alignment &&
                this.convertPreviousLevelNumberingToDecimal === obj.convertPreviousLevelNumberingToDecimal &&
                this.displayFormatString === obj.displayFormatString &&
                this.format === obj.format &&
                this.legacy === obj.legacy &&
                this.legacyIndent === obj.legacyIndent &&
                this.legacySpace === obj.legacySpace &&
                this.originalLeftIndent === obj.originalLeftIndent &&
                this.relativeRestartLevel === obj.relativeRestartLevel &&
                this.separator === obj.separator &&
                this.start === obj.start &&
                this.suppressBulletResize === obj.suppressBulletResize &&
                this.suppressRestart === obj.suppressRestart &&
                this.templateCode === obj.templateCode;
        };
        ListLevelProperties.prototype.copyFrom = function (obj) {
            this.alignment = obj.alignment;
            this.convertPreviousLevelNumberingToDecimal = obj.convertPreviousLevelNumberingToDecimal;
            this.displayFormatString = obj.displayFormatString;
            this.format = obj.format;
            this.legacy = obj.legacy;
            this.legacyIndent = obj.legacyIndent;
            this.legacySpace = obj.legacySpace;
            this.originalLeftIndent = obj.originalLeftIndent;
            this.relativeRestartLevel = obj.relativeRestartLevel;
            this.separator = obj.separator;
            this.start = obj.start;
            this.suppressBulletResize = obj.suppressBulletResize;
            this.suppressRestart = obj.suppressRestart;
            this.templateCode = obj.templateCode;
        };
        ListLevelProperties.prototype.clone = function () {
            var clone = new ListLevelProperties();
            clone.copyFrom(this);
            return clone;
        };
        return ListLevelProperties;
    }());
    __aspxRichEdit.ListLevelProperties = ListLevelProperties;
    var NumberingFormat;
    (function (NumberingFormat) {
        NumberingFormat[NumberingFormat["Decimal"] = 0] = "Decimal";
        NumberingFormat[NumberingFormat["AIUEOHiragana"] = 1] = "AIUEOHiragana";
        NumberingFormat[NumberingFormat["AIUEOFullWidthHiragana"] = 2] = "AIUEOFullWidthHiragana";
        NumberingFormat[NumberingFormat["ArabicAbjad"] = 3] = "ArabicAbjad";
        NumberingFormat[NumberingFormat["ArabicAlpha"] = 4] = "ArabicAlpha";
        NumberingFormat[NumberingFormat["Bullet"] = 5] = "Bullet";
        NumberingFormat[NumberingFormat["CardinalText"] = 6] = "CardinalText";
        NumberingFormat[NumberingFormat["Chicago"] = 7] = "Chicago";
        NumberingFormat[NumberingFormat["ChineseCounting"] = 8] = "ChineseCounting";
        NumberingFormat[NumberingFormat["ChineseCountingThousand"] = 9] = "ChineseCountingThousand";
        NumberingFormat[NumberingFormat["ChineseLegalSimplified"] = 10] = "ChineseLegalSimplified";
        NumberingFormat[NumberingFormat["Chosung"] = 11] = "Chosung";
        NumberingFormat[NumberingFormat["DecimalEnclosedCircle"] = 12] = "DecimalEnclosedCircle";
        NumberingFormat[NumberingFormat["DecimalEnclosedCircleChinese"] = 13] = "DecimalEnclosedCircleChinese";
        NumberingFormat[NumberingFormat["DecimalEnclosedFullstop"] = 14] = "DecimalEnclosedFullstop";
        NumberingFormat[NumberingFormat["DecimalEnclosedParentheses"] = 15] = "DecimalEnclosedParentheses";
        NumberingFormat[NumberingFormat["DecimalFullWidth"] = 16] = "DecimalFullWidth";
        NumberingFormat[NumberingFormat["DecimalFullWidth2"] = 17] = "DecimalFullWidth2";
        NumberingFormat[NumberingFormat["DecimalHalfWidth"] = 18] = "DecimalHalfWidth";
        NumberingFormat[NumberingFormat["DecimalZero"] = 19] = "DecimalZero";
        NumberingFormat[NumberingFormat["Ganada"] = 20] = "Ganada";
        NumberingFormat[NumberingFormat["Hebrew1"] = 21] = "Hebrew1";
        NumberingFormat[NumberingFormat["Hebrew2"] = 22] = "Hebrew2";
        NumberingFormat[NumberingFormat["Hex"] = 23] = "Hex";
        NumberingFormat[NumberingFormat["HindiConsonants"] = 24] = "HindiConsonants";
        NumberingFormat[NumberingFormat["HindiDescriptive"] = 25] = "HindiDescriptive";
        NumberingFormat[NumberingFormat["HindiNumbers"] = 26] = "HindiNumbers";
        NumberingFormat[NumberingFormat["HindiVowels"] = 27] = "HindiVowels";
        NumberingFormat[NumberingFormat["IdeographDigital"] = 28] = "IdeographDigital";
        NumberingFormat[NumberingFormat["IdeographEnclosedCircle"] = 29] = "IdeographEnclosedCircle";
        NumberingFormat[NumberingFormat["IdeographLegalTraditional"] = 30] = "IdeographLegalTraditional";
        NumberingFormat[NumberingFormat["IdeographTraditional"] = 31] = "IdeographTraditional";
        NumberingFormat[NumberingFormat["IdeographZodiac"] = 32] = "IdeographZodiac";
        NumberingFormat[NumberingFormat["IdeographZodiacTraditional"] = 33] = "IdeographZodiacTraditional";
        NumberingFormat[NumberingFormat["Iroha"] = 34] = "Iroha";
        NumberingFormat[NumberingFormat["IrohaFullWidth"] = 35] = "IrohaFullWidth";
        NumberingFormat[NumberingFormat["JapaneseCounting"] = 36] = "JapaneseCounting";
        NumberingFormat[NumberingFormat["JapaneseDigitalTenThousand"] = 37] = "JapaneseDigitalTenThousand";
        NumberingFormat[NumberingFormat["JapaneseLegal"] = 38] = "JapaneseLegal";
        NumberingFormat[NumberingFormat["KoreanCounting"] = 39] = "KoreanCounting";
        NumberingFormat[NumberingFormat["KoreanDigital"] = 40] = "KoreanDigital";
        NumberingFormat[NumberingFormat["KoreanDigital2"] = 41] = "KoreanDigital2";
        NumberingFormat[NumberingFormat["KoreanLegal"] = 42] = "KoreanLegal";
        NumberingFormat[NumberingFormat["LowerLetter"] = 43] = "LowerLetter";
        NumberingFormat[NumberingFormat["LowerRoman"] = 44] = "LowerRoman";
        NumberingFormat[NumberingFormat["None"] = 45] = "None";
        NumberingFormat[NumberingFormat["NumberInDash"] = 46] = "NumberInDash";
        NumberingFormat[NumberingFormat["Ordinal"] = 47] = "Ordinal";
        NumberingFormat[NumberingFormat["OrdinalText"] = 48] = "OrdinalText";
        NumberingFormat[NumberingFormat["RussianLower"] = 49] = "RussianLower";
        NumberingFormat[NumberingFormat["RussianUpper"] = 50] = "RussianUpper";
        NumberingFormat[NumberingFormat["TaiwaneseCounting"] = 51] = "TaiwaneseCounting";
        NumberingFormat[NumberingFormat["TaiwaneseCountingThousand"] = 52] = "TaiwaneseCountingThousand";
        NumberingFormat[NumberingFormat["TaiwaneseDigital"] = 53] = "TaiwaneseDigital";
        NumberingFormat[NumberingFormat["ThaiDescriptive"] = 54] = "ThaiDescriptive";
        NumberingFormat[NumberingFormat["ThaiLetters"] = 55] = "ThaiLetters";
        NumberingFormat[NumberingFormat["ThaiNumbers"] = 56] = "ThaiNumbers";
        NumberingFormat[NumberingFormat["UpperLetter"] = 57] = "UpperLetter";
        NumberingFormat[NumberingFormat["UpperRoman"] = 58] = "UpperRoman";
        NumberingFormat[NumberingFormat["VietnameseDescriptive"] = 59] = "VietnameseDescriptive";
    })(NumberingFormat = __aspxRichEdit.NumberingFormat || (__aspxRichEdit.NumberingFormat = {}));
    var ListNumberAlignment;
    (function (ListNumberAlignment) {
        ListNumberAlignment[ListNumberAlignment["Left"] = 0] = "Left";
        ListNumberAlignment[ListNumberAlignment["Center"] = 1] = "Center";
        ListNumberAlignment[ListNumberAlignment["Right"] = 2] = "Right";
    })(ListNumberAlignment = __aspxRichEdit.ListNumberAlignment || (__aspxRichEdit.ListNumberAlignment = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SubDocument = (function () {
        function SubDocument(documentModel, subDocumentInfo) {
            this.chunks = [];
            this.paragraphs = [];
            this.fields = [];
            this.tables = [];
            this.tablesByLevels = [];
            this.positionManager = new __aspxRichEdit.PositionManager();
            this.fieldsWaitingForUpdate = null;
            this.bookmarks = [];
            this.rangePermissions = [];
            this.documentModel = documentModel;
            this.id = subDocumentInfo.subDocumentId;
            this.info = subDocumentInfo;
            documentModel.subDocuments[this.id] = this;
            this.spellCheckerIntervalsManager = new __aspxRichEdit.SpellCheckerIntervalsManager(this);
        }
        Object.defineProperty(SubDocument.prototype, "interval", {
            get: function () { return new __aspxRichEdit.FixedInterval(0, this.getDocumentEndPosition()); },
            enumerable: true,
            configurable: true
        });
        SubDocument.prototype.getLastChunk = function () {
            return this.chunks[this.chunks.length - 1];
        };
        SubDocument.prototype.getFirstChunk = function () {
            return this.chunks[0];
        };
        SubDocument.prototype.getText = function (interval) {
            var buffer = "";
            var chunkIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.chunks, function (c) { return c.startLogPosition.value; }, interval.start);
            var chunk = this.chunks[chunkIndex];
            var remainLength = interval.length;
            var offset = interval.start - chunk.startLogPosition.value;
            while (chunk) {
                var length = Math.min(chunk.textBuffer.length - offset, remainLength);
                buffer += chunk.textBuffer.substr(offset, length);
                remainLength -= length;
                if (remainLength === 0)
                    break;
                chunk = this.chunks[++chunkIndex];
                offset = 0;
            }
            return buffer;
        };
        SubDocument.prototype.getSimpleText = function (interval) {
            var result = "";
            var pos = interval.start;
            var nested = 0;
            var fieldIndex = __aspxRichEdit.Field.normedBinaryIndexOf(this.fields, pos);
            if (fieldIndex > -1) {
                var field = this.fields[fieldIndex];
                while (field.parent)
                    field = field.parent;
                pos = field.getFieldStartPosition();
            }
            var iterator = new __aspxRichEdit.ModelIterator(this, true);
            iterator.setPosition(pos);
            while (pos < interval.end) {
                switch (iterator.run.getType()) {
                    case __aspxRichEdit.RunType.FieldCodeStartRun:
                        nested++;
                        break;
                    case __aspxRichEdit.RunType.FieldCodeEndRun:
                        nested--;
                        break;
                    case __aspxRichEdit.RunType.TextRun:
                        if (pos >= interval.start && nested == 0)
                            result += iterator.getCurrentChar();
                        break;
                }
                if (!iterator.moveToNextChar())
                    break;
                pos = iterator.getAbsolutePosition();
            }
            return result.replace(__aspxRichEdit.RichUtils.specialCharacters.LineBreak, " ");
        };
        SubDocument.prototype.splitRun = function (position) {
            var info = this.getRunAndIndexesByPosition(position);
            var offset = position - (info.chunk.startLogPosition.value + info.run.startOffset);
            if (offset > 0)
                info.chunk.splitRun(info.runIndex, offset);
        };
        SubDocument.prototype.getLastRun = function () {
            var lastChunk = this.getLastChunk();
            return lastChunk.textRuns[lastChunk.textRuns.length - 1];
        };
        SubDocument.prototype.getFirstRun = function () {
            return this.chunks[0].textRuns[0];
        };
        SubDocument.prototype.getRunIterator = function (interval) {
            return this.getRunIteratorInternal(interval, false);
        };
        SubDocument.prototype.getConstRunIterator = function (interval) {
            return this.getRunIteratorInternal(interval, true);
        };
        SubDocument.prototype.getRunIteratorInternal = function (interval, isConstRunIterator) {
            if (interval.length == 0)
                return new __aspxRichEdit.RunIterator([], [], [], [1], [1]);
            var runs = [], chunks = [], sections = [], indexForChunks = [], indexForSections = [];
            var currentChunkIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.chunks, function (c) { return c.startLogPosition.value; }, interval.start), currentChunk = this.chunks[currentChunkIndex];
            chunks.push(currentChunk);
            var currentRunIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(currentChunk.textRuns, function (r) { return currentChunk.startLogPosition.value + r.startOffset; }, interval.start), currentRun = currentChunk.textRuns[currentRunIndex], remainIntervalLength = interval.length;
            if (currentChunk.startLogPosition.value + currentRun.startOffset < interval.start) {
                if (isConstRunIterator)
                    remainIntervalLength += interval.start - (currentChunk.startLogPosition.value + currentRun.startOffset);
                else {
                    currentChunk.splitRun(currentRunIndex, interval.start - (currentChunk.startLogPosition.value + currentRun.startOffset));
                    currentRunIndex++;
                }
            }
            var currentSectionIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.documentModel.sections, function (s) { return s.startLogPosition.value; }, interval.start);
            var currentSection = this.documentModel.sections[currentSectionIndex];
            sections.push(currentSection);
            var runIndex = 0;
            var sectionIndex = 0;
            var remainSectionLength = currentSection.startLogPosition.value + currentSection.getLength() - interval.start;
            while (currentRun = currentChunk.textRuns[currentRunIndex]) {
                if (remainSectionLength === 0 && this.isMain()) {
                    currentSectionIndex++;
                    currentSection = this.documentModel.sections[currentSectionIndex];
                    sections.push(currentSection);
                    indexForSections.push(sectionIndex - 1);
                    remainSectionLength = currentSection.getLength();
                }
                if (currentRun.getLength() > remainIntervalLength) {
                    if (isConstRunIterator) {
                        runs.push(currentRun.createSimularity(Math.max(currentRun.startOffset, interval.start - currentChunk.startLogPosition.value), Math.min(remainIntervalLength, interval.length), currentRun.paragraph, currentRun.characterStyle, currentRun.maskedCharacterProperties));
                    }
                    else {
                        currentChunk.splitRun(currentRunIndex, remainIntervalLength);
                        runs.push(currentRun);
                    }
                    break;
                }
                if (runIndex == 0 && isConstRunIterator && currentRun.startOffset + currentChunk.startLogPosition.value < interval.start) {
                    var runEndPosition = currentChunk.startLogPosition.value + currentRun.startOffset + currentRun.getLength(), newRunLength = runEndPosition - interval.start;
                    runs.push(currentRun.createSimularity(interval.start - currentChunk.startLogPosition.value, newRunLength, currentRun.paragraph, currentRun.characterStyle, currentRun.maskedCharacterProperties));
                    remainSectionLength -= newRunLength;
                }
                else {
                    runs.push(currentRun);
                    remainSectionLength -= currentRun.getLength();
                }
                remainIntervalLength -= currentRun.getLength();
                currentRunIndex++;
                if (!remainIntervalLength)
                    break;
                if (currentRunIndex == currentChunk.textRuns.length) {
                    currentChunkIndex++;
                    indexForChunks.push(runIndex);
                    currentChunk = this.chunks[currentChunkIndex];
                    chunks.push(currentChunk);
                    currentRunIndex = 0;
                }
                sectionIndex++;
                runIndex++;
            }
            indexForChunks.push(runIndex + 1);
            indexForSections.push(sectionIndex + 1);
            return new __aspxRichEdit.RunIterator(runs, chunks, sections, indexForChunks, indexForSections);
        };
        SubDocument.prototype.getRunsByInterval = function (interval) {
            var runs = [];
            var chunkIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.chunks, function (c) { return c.startLogPosition.value; }, interval.start);
            var chunk = this.chunks[chunkIndex];
            var runIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(chunk.textRuns, function (r) { return chunk.startLogPosition.value + r.startOffset; }, interval.start);
            var run;
            var length = interval.length;
            var runOffset = interval.start - chunk.textRuns[runIndex].startOffset - chunk.startLogPosition.value;
            while (chunk && (run = chunk.textRuns[runIndex])) {
                runs.push(run);
                length -= (run.getLength() - runOffset);
                if (length <= 0)
                    break;
                runIndex++;
                if (runIndex >= chunk.textRuns.length) {
                    runIndex = 0;
                    chunkIndex++;
                    chunk = this.chunks[chunkIndex];
                }
                runOffset = 0;
            }
            return runs;
        };
        SubDocument.prototype.getRunByPosition = function (position) {
            var chunkIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.chunks, function (c) { return c.startLogPosition.value; }, position);
            var chunk = this.chunks[chunkIndex];
            var runIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(chunk.textRuns, function (r) { return chunk.startLogPosition.value + r.startOffset; }, position);
            return chunk.textRuns[runIndex];
        };
        SubDocument.prototype.getRunAndIndexesByPosition = function (position) {
            var chunkIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.chunks, function (c) { return c.startLogPosition.value; }, position);
            var chunk = this.chunks[chunkIndex];
            var runOffset = position - chunk.startLogPosition.value;
            var runIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(chunk.textRuns, function (r) { return r.startOffset; }, runOffset);
            var run = chunk.textRuns[runIndex];
            return new __aspxRichEdit.FullChunkAndRunInfo(chunkIndex, chunk, runIndex, run, runOffset - run.startOffset);
        };
        SubDocument.prototype.getInlinePictureRunById = function (id) {
            for (var i = 0, chunk; chunk = this.chunks[i]; i++) {
                for (var j = 0, run; run = chunk.textRuns[j]; j++) {
                    var pictureRun = run;
                    if (pictureRun instanceof __aspxRichEdit.InlinePictureRun && pictureRun.id == id)
                        return pictureRun;
                }
            }
            return null;
        };
        SubDocument.prototype.getSectionByPosition = function (position) {
            return this.documentModel.sections[__aspxRichEdit.Utils.normedInterpolationIndexOf(this.documentModel.sections, function (s) { return s.startLogPosition.value; }, position)];
        };
        SubDocument.prototype.getParagraphByPosition = function (position) {
            return this.paragraphs[__aspxRichEdit.Utils.normedInterpolationIndexOf(this.paragraphs, function (p) { return p.startLogPosition.value; }, position)];
        };
        SubDocument.prototype.getParagraphIndexByPosition = function (position) {
            return __aspxRichEdit.Utils.normedInterpolationIndexOf(this.paragraphs, function (p) { return p.startLogPosition.value; }, position);
        };
        SubDocument.prototype.getParagraphsIndices = function (interval) {
            var endPosition = interval.end;
            var result = __aspxRichEdit.FixedInterval.fromPositions(__aspxRichEdit.Utils.normedInterpolationIndexOf(this.paragraphs, function (paragraph) { return paragraph.startLogPosition.value; }, interval.start), __aspxRichEdit.Utils.normedInterpolationIndexOf(this.paragraphs, function (paragraph) { return paragraph.startLogPosition.value; }, endPosition));
            if (endPosition > this.paragraphs[result.end].startLogPosition.value)
                result.length++;
            return result;
        };
        SubDocument.prototype.getParagraphsByInterval = function (interval) {
            var paragraphs = [], intervalEnd = interval.end, paragraphIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.paragraphs, function (p) { return p.startLogPosition.value; }, interval.start);
            paragraphs.push(this.paragraphs[paragraphIndex++]);
            for (var paragraph; paragraph = this.paragraphs[paragraphIndex]; paragraphIndex++) {
                if (paragraph.startLogPosition.value < intervalEnd)
                    paragraphs.push(paragraph);
                else
                    break;
            }
            return paragraphs;
        };
        SubDocument.prototype.getParagraphIndicesByIntervals = function (intervals) {
            var result = [];
            for (var i = 0, interval; interval = intervals[i]; i++) {
                var paragraphIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.paragraphs, function (p) { return p.startLogPosition.value; }, interval.start);
                var intervalEnd = interval.end;
                result.push(paragraphIndex++);
                for (var paragraph = void 0; paragraph = this.paragraphs[paragraphIndex]; paragraphIndex++) {
                    if (paragraph.startLogPosition.value < intervalEnd)
                        result.push(paragraphIndex);
                    else
                        break;
                }
            }
            return __aspxRichEdit.ListUtils.uniqueNumber(result);
        };
        SubDocument.prototype.getDocumentEndPosition = function () {
            return this.info.getEndPosition(this.documentModel);
        };
        SubDocument.prototype.getWholeWordInterval = function (position, checkRunProperties, includeBounds) {
            if (checkRunProperties === void 0) { checkRunProperties = false; }
            if (includeBounds === void 0) { includeBounds = false; }
            var interval = new __aspxRichEdit.FixedInterval(position, 0);
            if (!includeBounds && (position == this.getDocumentEndPosition() || position == 0))
                return interval;
            var chunkIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.chunks, function (c) { return c.startLogPosition.value; }, position);
            var runOffset = position - this.chunks[chunkIndex].startLogPosition.value;
            var runIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.chunks[chunkIndex].textRuns, function (r) { return r.startOffset; }, runOffset);
            var end = this.getWordEnd(position, checkRunProperties, chunkIndex, runIndex);
            if (end == position && !includeBounds)
                return interval;
            var start = this.getWordStart(position, checkRunProperties, this.chunks[chunkIndex].textRuns[runIndex]);
            if (start == position && !includeBounds)
                return interval;
            interval.start = start;
            interval.length = end - start;
            return interval;
        };
        SubDocument.prototype.getWordStart = function (position, checkRunProperties, prevRun) {
            if (position <= 0)
                return position;
            var start = position;
            position--;
            var chunkIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.chunks, function (c) { return c.startLogPosition.value; }, position);
            var chunk = this.chunks[chunkIndex];
            var runIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(chunk.textRuns, function (r) { return r.startOffset; }, (position - chunk.startLogPosition.value));
            var run = chunk.textRuns[runIndex];
            while (chunk && run && run.getType() === __aspxRichEdit.RunType.TextRun && chunk.textBuffer[position - chunk.startLogPosition.value].match(__aspxRichEdit.RichUtils.isAlphanumeric) &&
                (!checkRunProperties || prevRun === run || prevRun.maskedCharacterProperties.equals(run.maskedCharacterProperties))) {
                start = position;
                position--;
                if (position - chunk.startLogPosition.value - run.startOffset < 0) {
                    prevRun = run;
                    runIndex--;
                    if (runIndex >= 0)
                        run = chunk.textRuns[runIndex];
                    else {
                        chunk = this.chunks[--chunkIndex];
                        if (!chunk)
                            break;
                        runIndex = chunk.textRuns.length - 1;
                        run = chunk.textRuns[runIndex];
                    }
                }
            }
            return start;
        };
        SubDocument.prototype.getWordEnd = function (position, checkRunProperties, chunkIndex, runIndex) {
            if (position == this.getDocumentEndPosition())
                return position;
            var chunk = this.chunks[chunkIndex];
            var run = chunk.textRuns[runIndex];
            var end = position;
            var prevRun = run;
            while (chunk && run && run.getType() === __aspxRichEdit.RunType.TextRun && chunk.textBuffer[position - chunk.startLogPosition.value].match(__aspxRichEdit.RichUtils.isAlphanumeric) &&
                (!checkRunProperties || prevRun === run || prevRun.maskedCharacterProperties.equals(run.maskedCharacterProperties))) {
                position++;
                end = position;
                if (position === chunk.startLogPosition.value + run.startOffset + run.getLength()) {
                    prevRun = run;
                    run = chunk.textRuns[++runIndex];
                    if (!run) {
                        chunk = this.chunks[++chunkIndex];
                        if (chunk) {
                            runIndex = 0;
                            run = chunk.textRuns[runIndex];
                        }
                        else
                            break;
                    }
                }
            }
            return end;
        };
        SubDocument.prototype.resetMergedFormattingCache = function (type, interval) {
            if (interval === void 0) { interval = new __aspxRichEdit.FixedInterval(0, this.getDocumentEndPosition()); }
            var parInd = this.getParagraphsIndices(interval);
            if (type & __aspxRichEdit.ResetFormattingCacheType.Paragraph)
                __aspxRichEdit.ListUtils.foreach(this.paragraphs, function (paragraph) { return paragraph.resetParagraphMergedProperties(); }, parInd.start, parInd.end);
            var startInfo = this.getRunAndIndexesByPosition(interval.start);
            var endInfo = this.getRunAndIndexesByPosition(interval.end);
            if (type & __aspxRichEdit.ResetFormattingCacheType.Character) {
                var runIndex_1 = startInfo.runIndex;
                __aspxRichEdit.ListUtils.foreach(this.chunks, function (chunk) {
                    __aspxRichEdit.ListUtils.allOf(chunk.textRuns, function (run) {
                        run.resetCharacterMergedProperties();
                        return endInfo.run != run;
                    }, runIndex_1);
                    runIndex_1 = 0;
                }, startInfo.chunkIndex, endInfo.chunkIndex + 1);
            }
            return __aspxRichEdit.FixedInterval.fromPositions(this.paragraphs[parInd.start].startLogPosition.value, this.paragraphs[Math.max(parInd.start, parInd.end - 1)].getEndPosition());
        };
        SubDocument.prototype.isEditable = function (intervals) {
            var _this = this;
            return !this.documentModel.isDocumentProtectionEnabled || __aspxRichEdit.ListUtils.allOf(intervals, function (interval) {
                if (interval.end == _this.getDocumentEndPosition())
                    interval = interval.makeByStartLength(interval.start, interval.length - 1);
                return __aspxRichEdit.ListUtils.anyOf(_this.rangePermissions, function (rangePermission) {
                    return rangePermission.interval.containsInterval(interval);
                });
            });
        };
        SubDocument.prototype.getParagraphProperties = function (paragraph) {
            return paragraph.getParagraphMergedProperies();
        };
        SubDocument.prototype.isMain = function () { return this.info.isMain; };
        SubDocument.prototype.isHeaderFooter = function () { return this.info.isHeaderFooter; };
        SubDocument.prototype.isFooter = function () { return this.info.isFooter; };
        SubDocument.prototype.isHeader = function () { return this.info.isHeader; };
        SubDocument.prototype.isNote = function () { return this.info.isNote; };
        SubDocument.prototype.isFootNote = function () { return this.info.isFootNote; };
        SubDocument.prototype.isEndNote = function () { return this.info.isEndNote; };
        SubDocument.prototype.isTextBox = function () { return this.info.isTextBox; };
        SubDocument.prototype.isComment = function () { return this.info.isComment; };
        SubDocument.prototype.isReferenced = function () { return this.info.isReferenced; };
        SubDocument.AUTOGENERATE_ID = -1;
        SubDocument.MAIN_SUBDOCUMENT_ID = 0;
        return SubDocument;
    }());
    __aspxRichEdit.SubDocument = SubDocument;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SCROLL_INTERVAL_MS = 50;
    var CSSCLASS_FOCUSED = "dxreInFocus";
    var AUTOSCROLL_AREA_SIZE = 10;
    var AUTOSCROLL_STEP = 10;
    var MSTOUCH_MOVE_SENSITIVITY = 5;
    var CanvasManager = (function (_super) {
        __extends(CanvasManager, _super);
        function CanvasManager(viewManager, eventManager) {
            var _this = _super.call(this) || this;
            _this.scrollIntervalID = 0;
            _this.lastMousePosition = { x: -1, y: -1 };
            _this.canvasPosition = { x: -1, y: -1 };
            _this.pointer = __aspxRichEdit.CursorPointer.Auto;
            _this.blockNotPointerEvents = false;
            _this.lastPointerPosition = { x: -1, y: -1 };
            _this.viewManager = viewManager;
            _this.eventManager = eventManager;
            _this.initCommonEvents();
            if (!REWebUtils.Browser.WebKitTouchUI)
                _this.initMouseEvents();
            if (REWebUtils.Browser.TouchUI)
                _this.initTouchEvents();
            if (REWebUtils.Browser.MSTouchUI)
                if (REWebUtils.Browser.MajorVersion > 10)
                    _this.initPointerEvents();
                else
                    _this.initMSPointerEvents();
            return _this;
        }
        Object.defineProperty(CanvasManager.prototype, "sizes", {
            get: function () { return this.viewManager.sizes; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(CanvasManager.prototype, "scroll", {
            get: function () { return this.viewManager.scroll; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(CanvasManager.prototype, "controlHeightProvider", {
            get: function () { return this.sizes; },
            enumerable: true,
            configurable: true
        });
        CanvasManager.prototype.onUpdateUnlocked = function (_occurredEvents) {
            this.viewManager.canvasListener.updateVisibleParts();
        };
        CanvasManager.prototype.setCursorPointer = function (pointer) {
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.CanvasManager, "setCursorPointer", function () { return "pointer: " + __aspxRichEdit.CursorPointer[pointer]; });
            if (this.pointer === pointer)
                return;
            if (this.pointer !== __aspxRichEdit.CursorPointer.Auto)
                REWebUtils.RemoveClassNameFromElement(this.viewManager.canvas, CanvasManager.getCursorClassName(this.pointer));
            var newClassName = CanvasManager.getCursorClassName(pointer);
            if (newClassName)
                REWebUtils.AddClassNameToElement(this.viewManager.canvas, newClassName);
            this.pointer = pointer;
        };
        CanvasManager.prototype.closeDocument = function () {
            this.scroll.init(this.viewManager.canvas, this.sizes);
        };
        CanvasManager.prototype.focusChanged = function (inFocus) {
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.CanvasManager, "focusChanged", "to: " + inFocus);
            if (inFocus)
                REWebUtils.AddClassNameToElement(this.viewManager.canvas, CSSCLASS_FOCUSED);
            else
                REWebUtils.RemoveClassNameFromElement(this.viewManager.canvas, CSSCLASS_FOCUSED);
        };
        CanvasManager.prototype.getCanvasWidth = function () {
            return this.viewManager.canvas.clientWidth;
        };
        CanvasManager.prototype.onCanvasMouseWheel = function (evt) {
            if (!this.viewManager.layout)
                return;
            var point = this.getLayoutPoint(evt, false);
            point.y += evt.deltaY;
            this.eventManager.mouseWheelEvent = true;
            this.eventManager.onMouseMove(new __aspxRichEdit.RichMouseEvent(evt, point, CanvasManager.getMouseEventSource(REWebUtils.Evt.GetEventSource(evt)), this.scroll.lastScrollTop, this.scroll.lastScrollLeft));
            this.eventManager.mouseWheelEvent = false;
            this.viewManager.canvasListener.updateVisibleParts();
        };
        CanvasManager.prototype.onCanvasMouseDown = function (evt) {
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.CanvasManager, "onCanvasMouseDown", "evt.button: " + evt.button + ", evt.buttons: " + evt.buttons);
            if (!this.blockNotPointerEvents)
                this.onCanvasMouseDownInternal(evt);
            return REWebUtils.Evt.PreventEventAndBubble(evt);
        };
        CanvasManager.prototype.onCanvasMouseDownInternal = function (evt) {
            var _this = this;
            var point = this.getLayoutPoint(evt, true);
            this.eventManager.onMouseDown(new __aspxRichEdit.RichMouseEvent(evt, point, CanvasManager.getMouseEventSource(REWebUtils.Evt.GetEventSource(evt)), this.scroll.lastScrollTop, this.scroll.lastScrollLeft));
            this.saveMousePosition(evt);
            this.resetScrollInterval();
            this.canvasPosition.x = REWebUtils.GetAbsolutePositionX(this.viewManager.canvas);
            this.canvasPosition.y = REWebUtils.GetAbsolutePositionY(this.viewManager.canvas);
            if (!point.isEmpty()) {
                this.scrollIntervalID = setInterval(function () {
                    _this.onScrollIntervalTick();
                }, SCROLL_INTERVAL_MS);
            }
        };
        CanvasManager.prototype.onCanvasMouseUp = function (evt) {
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.CanvasManager, "onCanvasMouseUp", "");
            if (!this.blockNotPointerEvents)
                this.onCanvasMouseUpInternal(evt);
        };
        CanvasManager.prototype.onCanvasMouseUpInternal = function (evt) {
            this.eventManager.onMouseUp(new __aspxRichEdit.RichMouseEvent(evt, this.getLayoutPoint(evt, false), CanvasManager.getMouseEventSource(REWebUtils.Evt.GetEventSource(evt)), this.scroll.lastScrollTop, this.scroll.lastScrollLeft));
            this.resetScrollInterval();
        };
        CanvasManager.prototype.onCanvasMouseMove = function (evt) {
            if (!this.blockNotPointerEvents)
                this.onCanvasMouseMoveInternal(evt);
        };
        CanvasManager.prototype.onCanvasMouseMoveInternal = function (evt) {
            this.eventManager.onMouseMove(new __aspxRichEdit.RichMouseEvent(evt, this.getLayoutPoint(evt, false), CanvasManager.getMouseEventSource(REWebUtils.Evt.GetEventSource(evt)), this.scroll.lastScrollTop, this.scroll.lastScrollLeft));
        };
        CanvasManager.prototype.onCanvasMouseDblClick = function (evt) {
            this.eventManager.onMouseDblClick(new __aspxRichEdit.RichMouseEvent(evt, this.getLayoutPoint(evt, true), CanvasManager.getMouseEventSource(REWebUtils.Evt.GetEventSource(evt)), this.scroll.lastScrollTop, this.scroll.lastScrollLeft));
            return REWebUtils.Evt.PreventEventAndBubble(evt);
        };
        CanvasManager.prototype.onCanvasTouchStart = function (evt) {
            if (!this.blockNotPointerEvents)
                this.onCanvasTouchStartInternal(evt);
            return true;
        };
        CanvasManager.prototype.onCanvasTouchStartInternal = function (evt) {
            this.saveMousePosition(evt);
            var richMouseEvent = new __aspxRichEdit.RichMouseEvent(evt, this.getLayoutPoint(evt, true), CanvasManager.getMouseEventSource(REWebUtils.Evt.GetEventSource(evt)), this.scroll.lastScrollTop, this.scroll.lastScrollLeft);
            if (this.doubleTapStartDate && ((new Date()) - this.doubleTapStartDate) < 600) {
                this.doubleTapStartDate = null;
                this.onCanvasDoubleTap(richMouseEvent);
            }
            else {
                this.doubleTapStartDate = new Date();
                this.eventManager.onTouchStart(richMouseEvent);
            }
        };
        CanvasManager.prototype.onCanvasDoubleTap = function (evt) {
            this.eventManager.onDoubleTap(evt);
        };
        CanvasManager.prototype.onCanvasTouchEnd = function (evt) {
            if (!this.blockNotPointerEvents)
                this.onCanvasTouchEndInternal(evt);
            return REWebUtils.Evt.PreventEventAndBubble(evt);
        };
        CanvasManager.prototype.onCanvasTouchEndInternal = function (evt) {
            return this.eventManager.onTouchEnd(new __aspxRichEdit.RichMouseEvent(evt, this.getLayoutPoint(evt, false), CanvasManager.getMouseEventSource(REWebUtils.Evt.GetEventSource(evt)), this.scroll.lastScrollTop, this.scroll.lastScrollLeft));
        };
        CanvasManager.prototype.onCanvasTouchMove = function (evt) {
            if (!this.blockNotPointerEvents)
                return this.onCanvasTouchMoveInternal(evt);
            return true;
        };
        CanvasManager.prototype.onCanvasTouchMoveInternal = function (evt) {
            if (!this.eventManager.onTouchMove(new __aspxRichEdit.RichMouseEvent(evt, this.getLayoutPoint(evt, false), CanvasManager.getMouseEventSource(REWebUtils.Evt.GetEventSource(evt)), this.scroll.lastScrollTop, this.scroll.lastScrollLeft)))
                return REWebUtils.Evt.PreventEventAndBubble(evt);
            return true;
        };
        CanvasManager.prototype.onCanvasPointerDown = function (evt) {
            if (evt.pointerType == "mouse")
                this.onCanvasMouseDownInternal(evt);
            else if (evt.pointerType == "touch")
                this.onCanvasTouchStartInternal(evt);
            this.blockNotPointerEvents = true;
            this.lastPointerPosition.x = evt.x;
            this.lastPointerPosition.y = evt.y;
        };
        CanvasManager.prototype.onCanvasPointerMove = function (evt) {
            if (Math.abs(evt.x - this.lastPointerPosition.x) > MSTOUCH_MOVE_SENSITIVITY || Math.abs(evt.y - this.lastPointerPosition.y) > MSTOUCH_MOVE_SENSITIVITY) {
                if (evt.pointerType == "mouse")
                    this.onCanvasMouseMoveInternal(evt);
                else if (evt.pointerType == "touch")
                    return this.onCanvasTouchMoveInternal(evt);
                return REWebUtils.Evt.PreventEventAndBubble(evt);
            }
        };
        CanvasManager.prototype.onCanvasPointerUp = function (evt) {
            var _this = this;
            if (evt.pointerType == "mouse")
                this.onCanvasMouseUpInternal(evt);
            else if (evt.pointerType == "touch")
                this.onCanvasTouchEndInternal(evt);
            setTimeout(function () { _this.blockNotPointerEvents = false; }, 0);
            return REWebUtils.Evt.PreventEventAndBubble(evt);
        };
        CanvasManager.prototype.onCanvasGestureStart = function (evt) {
            this.eventManager.onGestureStart(evt);
        };
        CanvasManager.prototype.onDocumentMouseUp = function (evt) {
            if (REWebUtils.GetIsParent(this.viewManager.canvas, REWebUtils.Evt.GetEventSource(evt))) {
                if (!REWebUtils.Evt.IsLeftButtonPressed(evt))
                    REWebUtils.PopupUtils.PreventContextMenu(evt);
                this.onCanvasMouseUp(evt);
            }
            else {
                this.eventManager.onMouseUp(new __aspxRichEdit.RichMouseEvent(evt, null, __aspxRichEdit.MouseEventSource.Undefined, this.scroll.lastScrollTop, this.scroll.lastScrollLeft));
                this.resetScrollInterval();
            }
        };
        CanvasManager.prototype.onDocumentContextMenu = function (evt) {
            if (REWebUtils.GetIsParent(this.viewManager.canvas.parentNode.parentNode, REWebUtils.Evt.GetEventSource(evt))) {
                REWebUtils.PopupUtils.PreventContextMenu(evt);
                return REWebUtils.Evt.CancelBubble(evt);
            }
        };
        CanvasManager.prototype.onDocumentMouseMove = function (evt) {
            this.saveMousePosition(evt);
        };
        CanvasManager.prototype.onDocumentTouchEnd = function (evt) {
            if (REWebUtils.GetIsParent(this.viewManager.canvas, REWebUtils.Evt.GetEventSource(evt)))
                return;
            this.eventManager.onTouchEnd(new __aspxRichEdit.RichMouseEvent(evt, null, __aspxRichEdit.MouseEventSource.Undefined, this.scroll.lastScrollTop, this.scroll.lastScrollLeft));
            this.resetScrollInterval();
        };
        CanvasManager.prototype.onDocumentTouchMove = function (evt) {
            this.saveMousePosition(evt);
        };
        CanvasManager.prototype.getLayoutPoint = function (evt, checkScroll) {
            if (!this.viewManager.layout)
                return __aspxRichEdit.LayoutPoint.Empty();
            var clientX = REWebUtils.Evt.GetEventX(evt);
            var clientY = REWebUtils.Evt.GetEventY(evt);
            var canvasX = REWebUtils.GetAbsolutePositionX(this.viewManager.canvas);
            var canvasY = REWebUtils.GetAbsolutePositionY(this.viewManager.canvas);
            var offsetY = this.viewManager.canvas.scrollTop + clientY - canvasY;
            var pageIndex = this.sizes.findPageIndexByOffsetY(this.viewManager.layout.pages, offsetY);
            if (checkScroll) {
                if (this.sizes.scrollYVisible && canvasX + this.sizes.getVisibleAreaWidth(false) - clientX < 0)
                    return __aspxRichEdit.LayoutPoint.Empty();
                if (this.sizes.scrollXVisible && canvasY + this.sizes.getVisibleAreaHeight(false) - clientY < 0)
                    return __aspxRichEdit.LayoutPoint.Empty();
            }
            var layoutPage = this.viewManager.layout.pages[pageIndex];
            var renderPageCacheElem = this.viewManager.cache[pageIndex];
            if (!layoutPage || !renderPageCacheElem)
                return __aspxRichEdit.LayoutPoint.Empty();
            return new __aspxRichEdit.LayoutPoint(pageIndex, this.viewManager.canvas.scrollLeft + clientX - (canvasX + renderPageCacheElem.page.offsetLeft), offsetY - this.sizes.getPageOffsetY(layoutPage));
        };
        CanvasManager.prototype.isVisiblePosition = function (layoutPoint) {
            var pages = this.viewManager.layout.pages;
            this.scroll.updatePageIndexesInfo(pages);
            if (layoutPoint.pageIndex < this.scroll.startVisiblePageIndex || layoutPoint.pageIndex > this.scroll.endVisiblePageIndex)
                return false;
            var pageY = this.sizes.getPageOffsetY(pages[layoutPoint.pageIndex]);
            var pageX = this.viewManager.cache[layoutPoint.pageIndex].page.offsetLeft;
            var x = pageX + layoutPoint.x;
            var y = pageY + layoutPoint.y;
            return x >= this.scroll.lastScrollLeft && x <= this.sizes.getVisibleAreaWidth(false) + this.scroll.lastScrollLeft &&
                y >= this.scroll.lastScrollTop && y <= this.sizes.getVisibleAreaHeight(false) + this.scroll.lastScrollTop;
        };
        CanvasManager.prototype.initCommonEvents = function () {
            var _this = this;
            REWebUtils.Evt.AttachEventToElement(this.viewManager.canvas, "scroll", function () { return _this.viewManager.canvasListener.onCanvasScroll(); });
        };
        CanvasManager.prototype.initMouseEvents = function () {
            var _this = this;
            REWebUtils.Evt.AttachEventToElement(this.viewManager.canvas, "mousedown", function (evt) { return _this.onCanvasMouseDown(evt); });
            REWebUtils.Evt.AttachEventToElement(this.viewManager.canvas, "mousemove", function (evt) { return _this.onCanvasMouseMove(evt); });
            REWebUtils.Evt.AttachEventToElement(this.viewManager.canvas, "dblclick", function (evt) { return _this.onCanvasMouseDblClick(evt); });
            REWebUtils.Evt.AttachEventToElement(this.viewManager.canvas, REWebUtils.Evt.GetMouseWheelEventName(), function (evt) { return _this.onCanvasMouseWheel(evt); });
            REWebUtils.Evt.AttachEventToDocument("mouseup", function (evt) { return _this.onDocumentMouseUp(evt); });
            REWebUtils.Evt.AttachEventToDocument("mousemove", function (evt) { return _this.onDocumentMouseMove(evt); });
            REWebUtils.Evt.AttachEventToDocument("contextmenu", function (evt) { return _this.onDocumentContextMenu(evt); });
        };
        CanvasManager.prototype.initTouchEvents = function () {
            var _this = this;
            REWebUtils.Evt.AttachEventToElement(this.viewManager.canvas, "touchstart", function (evt) { return _this.onCanvasTouchStart(evt); });
            REWebUtils.Evt.AttachEventToElement(this.viewManager.canvas, "touchend", function (evt) { return _this.onCanvasTouchEnd(evt); });
            REWebUtils.Evt.AttachEventToElement(this.viewManager.canvas, "touchmove", function (evt) { return _this.onCanvasTouchMove(evt); });
            REWebUtils.Evt.AttachEventToElement(this.viewManager.canvas, "gesturestart", function (evt) { return _this.onCanvasGestureStart(evt); });
            REWebUtils.Evt.AttachEventToDocument("touchend", function (evt) { return _this.onDocumentTouchEnd(evt); });
            REWebUtils.Evt.AttachEventToDocument("touchmove", function (evt) { return _this.onDocumentTouchMove(evt); });
        };
        CanvasManager.prototype.initPointerEvents = function () {
            var _this = this;
            REWebUtils.Evt.AttachEventToElement(this.viewManager.canvas, "pointerdown", function (evt) { return _this.onCanvasPointerDown(evt); });
            REWebUtils.Evt.AttachEventToElement(this.viewManager.canvas, "pointermove", function (evt) { return _this.onCanvasPointerMove(evt); });
            REWebUtils.Evt.AttachEventToElement(this.viewManager.canvas, "pointerup", function (evt) { return _this.onCanvasPointerUp(evt); });
        };
        CanvasManager.prototype.initMSPointerEvents = function () {
            var _this = this;
            REWebUtils.Evt.AttachEventToElement(this.viewManager.canvas, "mspointerdown", function (evt) { return _this.onCanvasPointerDown(evt); });
            REWebUtils.Evt.AttachEventToElement(this.viewManager.canvas, "mspointermove", function (evt) { return _this.onCanvasPointerMove(evt); });
            REWebUtils.Evt.AttachEventToElement(this.viewManager.canvas, "mspointerup", function (evt) { return _this.onCanvasPointerUp(evt); });
        };
        CanvasManager.prototype.resetScrollInterval = function () {
            if (this.scrollIntervalID) {
                clearInterval(this.scrollIntervalID);
                this.scrollIntervalID = 0;
            }
        };
        CanvasManager.prototype.saveMousePosition = function (evt) {
            this.lastMousePosition.x = REWebUtils.Evt.GetEventX(evt);
            this.lastMousePosition.y = REWebUtils.Evt.GetEventY(evt);
        };
        CanvasManager.prototype.onScrollIntervalTick = function () {
            var evtX = this.lastMousePosition.x;
            var evtY = this.lastMousePosition.y;
            var inHorizontalArea = evtX >= this.canvasPosition.x && evtX <= this.canvasPosition.x + this.sizes.getVisibleAreaWidth(true);
            var inVerticalArea = evtY >= this.canvasPosition.y && evtY <= this.canvasPosition.y + this.sizes.getVisibleAreaHeight(true);
            if (!inHorizontalArea && !inVerticalArea)
                return;
            if (inHorizontalArea && evtY - this.canvasPosition.y <= AUTOSCROLL_AREA_SIZE)
                this.viewManager.canvas.scrollTop -= AUTOSCROLL_STEP;
            else if (inHorizontalArea && this.canvasPosition.y + this.sizes.getVisibleAreaHeight(true) - evtY <= AUTOSCROLL_AREA_SIZE)
                this.viewManager.canvas.scrollTop += AUTOSCROLL_STEP;
            if (inVerticalArea && evtX - this.canvasPosition.x <= AUTOSCROLL_AREA_SIZE)
                this.viewManager.canvas.scrollLeft -= AUTOSCROLL_STEP;
            else if (inVerticalArea && this.canvasPosition.x + this.sizes.getVisibleAreaWidth(true) - evtX <= AUTOSCROLL_AREA_SIZE)
                this.viewManager.canvas.scrollLeft += AUTOSCROLL_STEP;
        };
        CanvasManager.getCursorClassName = function (pointer) {
            switch (pointer) {
                case __aspxRichEdit.CursorPointer.Copy:
                    return "dxreCursorCopy";
                case __aspxRichEdit.CursorPointer.NoDrop:
                    return "dxreCursorNoDrop";
                case __aspxRichEdit.CursorPointer.EResize:
                    return "dxreCursorEResize";
                case __aspxRichEdit.CursorPointer.NResize:
                    return "dxreCursorNResize";
                case __aspxRichEdit.CursorPointer.SResize:
                    return "dxreCursorSResize";
                case __aspxRichEdit.CursorPointer.WResize:
                    return "dxreCursorWResize";
                case __aspxRichEdit.CursorPointer.SEResize:
                    return "dxreCursorSEResize";
                case __aspxRichEdit.CursorPointer.SWResize:
                    return "dxreCursorSWResize";
                case __aspxRichEdit.CursorPointer.NWResize:
                    return "dxreCursorNWResize";
                case __aspxRichEdit.CursorPointer.NEResize:
                    return "dxreCursorNEResize";
                case __aspxRichEdit.CursorPointer.NSResize:
                    return "dxreCursorNSResize";
                case __aspxRichEdit.CursorPointer.EWResize:
                    return "dxreCursorEWResize";
                case __aspxRichEdit.CursorPointer.Move:
                case __aspxRichEdit.CursorPointer.Default:
                    return "dxreCursorDefault";
            }
        };
        CanvasManager.getMouseEventSource = function (initSource) {
            var source = initSource.nodeType === Node.ELEMENT_NODE ? initSource : initSource.parentNode;
            var className = source.className;
            var cornerPrefix = __aspxRichEdit.ResizeBoxListener.getCornerPrefix();
            var ind = className.indexOf(cornerPrefix);
            if (ind != 0)
                return __aspxRichEdit.MouseEventSource.Undefined;
            return __aspxRichEdit.ResizeBoxListener.directionToSource[className.substr(ind + cornerPrefix.length, 2).trim()];
        };
        CanvasManager.prototype.getScrollTopInfo = function () {
            var pages = this.viewManager.layout.pages;
            var scrollTop = this.viewManager.canvas.scrollTop;
            var pageIndex = this.sizes.findPageIndexByOffsetY(pages, scrollTop);
            return new ScrollTopInfo(pageIndex, scrollTop - this.sizes.getPageOffsetY(pages[pageIndex]));
        };
        return CanvasManager;
    }(__aspxRichEdit.BatchUpdatableObject));
    __aspxRichEdit.CanvasManager = CanvasManager;
    var ScrollTopInfo = (function () {
        function ScrollTopInfo(pageIndex, topPositionRelativePage) {
            this.pageIndex = pageIndex;
            this.topPositionRelativePage = topPositionRelativePage;
        }
        return ScrollTopInfo;
    }());
    __aspxRichEdit.ScrollTopInfo = ScrollTopInfo;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ViewManager = (function () {
        function ViewManager(canvas, eventManager, stringResources, horizontalRuler, inputController, innerClientProperties) {
            this.cache = [];
            this.sizes = new __aspxRichEdit.CanvasSizeInfo();
            this.canvas = canvas;
            this.inputController = inputController;
            this.innerClientProperties = innerClientProperties;
            this.addTopLevelContainers();
            this.canvasManager = new __aspxRichEdit.CanvasManager(this, eventManager);
            this.scroll = new __aspxRichEdit.CanvasScrollInfo(canvas, this.sizes);
            this.canvasScrollManager = new __aspxRichEdit.CanvasScrollManager(this, horizontalRuler);
            this.renderers = new __aspxRichEdit.MapCreatorNumberAsKey()
                .add(__aspxRichEdit.ViewType.PrintLayout, new __aspxRichEdit.PrintLayoutRenderer(this))
                .add(__aspxRichEdit.ViewType.Simple, new __aspxRichEdit.SimpleViewRenderer(this))
                .get();
            this.canvasListeners = new __aspxRichEdit.MapCreatorNumberAsKey()
                .add(__aspxRichEdit.ViewType.PrintLayout, new __aspxRichEdit.PrintLayoutViewCanvasListener(this, this.renderers[__aspxRichEdit.ViewType.PrintLayout]))
                .add(__aspxRichEdit.ViewType.Simple, new __aspxRichEdit.SimpleViewCanvasListener(this, this.renderers[__aspxRichEdit.ViewType.Simple]))
                .get();
            var layoutSelection = null;
            this.selection = new __aspxRichEdit.SelectionRenderer(this.cache, layoutSelection);
            this.searchSelection = new __aspxRichEdit.SearchSelectionRenderer(this.cache, layoutSelection);
            this.misspelledSelection = new __aspxRichEdit.MisspelledSelectionRenderer(this.cache, layoutSelection);
            this.rangePermission = new __aspxRichEdit.RangePermissionRenderer(this.cache, layoutSelection);
            this.changeActiveSubDocumentRenderer = new __aspxRichEdit.Renderer.ChangeActiveSubDocument.RendererManager(this, stringResources);
        }
        Object.defineProperty(ViewManager.prototype, "renderer", {
            get: function () { return this.renderers[this.innerClientProperties.viewsSettings.viewType]; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ViewManager.prototype, "canvasListener", {
            get: function () { return this.canvasListeners[this.innerClientProperties.viewsSettings.viewType]; },
            enumerable: true,
            configurable: true
        });
        ViewManager.prototype.adjust = function (force) {
            if ((force || !this.sizes.isInitialized()) && this.cache.length > 0) {
                this.sizes.initialize(this.cache[0].page, this.canvas);
                if (force) {
                    this.canvasScrollManager.updateScrollVisibility();
                    this.canvasListener.onCanvasScroll();
                }
            }
        };
        ViewManager.prototype.NotifyPagesReady = function (pageChanges) {
            this.canvasListener.onPagesReady(pageChanges);
        };
        ViewManager.prototype.NotifyFullyFormatted = function () { };
        ;
        ViewManager.prototype.NotifySelectionLayoutChanged = function () {
            var layoutSelection = this.selection.layoutSelection;
            this.changeActiveSubDocumentRenderer.update(layoutSelection);
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.CanvasManager, "onSelectionLayoutChanged\n", __aspxRichEdit.LogListHelper.level_1(__aspxRichEdit.Log.w(2, __aspxRichEdit.Log.flip(__aspxRichEdit.LogObjToStr.pageSelectionChange, 0, 1))(""), this.selection.layoutSelection.selectionInfo.changes, "", "\n"));
            if (this.innerClientProperties.viewsSettings.isSimpleView)
                this.selection.renderAllPageSelection(this.layout, 0, true);
            else
                this.selection.applySelectionChanges(this.layout);
            if (REWebUtils.Browser.WebKitTouchUI)
                for (var i = 0, pageInfo = void 0; pageInfo = layoutSelection.selectionInfo.pageInfos[i]; i++) {
                    if (pageInfo.oldItems.length) {
                        var item = pageInfo.oldItems[0];
                        var pageElement = this.layout.pages[i];
                        this.inputController.setPosition(pageElement.x + this.cache[i].page.offsetLeft + item.x, this.sizes.getPageOffsetY(pageElement) + item.y);
                    }
                }
        };
        ViewManager.prototype.NotifySearchSelectionLayoutChanged = function () {
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.CanvasManager, "onSearchSelectionLayoutChanged\n", __aspxRichEdit.LogListHelper.level_1(__aspxRichEdit.Log.w(2, __aspxRichEdit.Log.flip(__aspxRichEdit.LogObjToStr.pageSelectionChange, 0, 1))(""), this.selection.layoutSelection.searchInfo.changes, "", "\n"));
            if (this.innerClientProperties.viewsSettings.isSimpleView)
                this.searchSelection.renderAllPageSelection(this.layout, 0, true);
            else
                this.searchSelection.applySelectionChanges(this.layout);
        };
        ViewManager.prototype.NotifyMisspelledSelectionLayoutChanged = function () {
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.CanvasManager, "onMisspelledSelectionLayoutChanged\n", __aspxRichEdit.LogListHelper.level_1(__aspxRichEdit.Log.w(2, __aspxRichEdit.Log.flip(__aspxRichEdit.LogObjToStr.pageSelectionChange, 0, 1))(""), this.selection.layoutSelection.misspelledInfo.changes, "", "\n"));
            if (this.innerClientProperties.viewsSettings.isSimpleView)
                this.misspelledSelection.renderAllPageSelection(this.layout, 0, true);
            else
                this.misspelledSelection.applySelectionChanges(this.layout);
        };
        ViewManager.prototype.NotifyRangePermissionLayoutChanged = function () {
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.CanvasManager, "onRangePermissionsLayoutChanged\n", __aspxRichEdit.LogListHelper.level_1(__aspxRichEdit.Log.w(2, __aspxRichEdit.Log.flip(__aspxRichEdit.LogObjToStr.pageSelectionChange, 0, 1))(""), this.selection.layoutSelection.rangePermissionInfo.changes, "", "\n"));
            if (this.innerClientProperties.viewsSettings.isSimpleView)
                this.rangePermission.renderAllPageSelection(this.layout, 0, true);
            else
                this.rangePermission.applySelectionChanges(this.layout);
        };
        ViewManager.prototype.addTopLevelContainers = function () {
            this.pagesContainer = __aspxRichEdit.DocumentRenderer.renderContainer(__aspxRichEdit.DocumentRenderer.CLASSNAMES.PAGES);
            this.serviceContainer = __aspxRichEdit.DocumentRenderer.renderContainer(__aspxRichEdit.DocumentRenderer.CLASSNAMES.TOP_LEVEL_SERVICE_CONTAINER);
            __aspxRichEdit.DocumentRenderer.insertInContainer(this.canvas, 0, this.pagesContainer, function (node) { return node; });
            this.canvas.appendChild(this.serviceContainer);
        };
        ViewManager.prototype.setWorkSession = function (layout, layoutSelection, imageCache, handlerUri, emptyImageCacheId) {
            this.layout = layout;
            this.imageCache = imageCache;
            this.handlerURI = handlerUri;
            this.emptyImageCacheId = emptyImageCacheId;
            this.changeActiveSubDocumentRenderer.init();
            this.selection.layoutSelection = layoutSelection;
            this.searchSelection.layoutSelection = layoutSelection;
            this.misspelledSelection.layoutSelection = layoutSelection;
            this.rangePermission.layoutSelection = layoutSelection;
            this.selection.touchSelectionCircleElementsManager.layoutSelection = layoutSelection;
        };
        ViewManager.prototype.closeDocument = function () {
            this.handlerURI = undefined;
            this.emptyImageCacheId = undefined;
            __aspxRichEdit.HTMLUtils.clearInnerHtml(this.pagesContainer);
            this.cache.splice(0);
            this.canvasManager.closeDocument();
            this.selection.closeDocument();
            this.searchSelection.closeDocument();
            this.misspelledSelection.closeDocument();
            this.rangePermission.closeDocument();
            __aspxRichEdit.MapUtilsKeyAsNumber.foreach(this.canvasListeners, function (r) { return r.closeDocument(); });
            this.layout.setEmptyLayout(__aspxRichEdit.ColorHelper.NO_COLOR);
        };
        return ViewManager;
    }());
    __aspxRichEdit.ViewManager = ViewManager;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var PrintLayoutRenderer = (function (_super) {
        __extends(PrintLayoutRenderer, _super);
        function PrintLayoutRenderer() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        PrintLayoutRenderer.prototype.renderPageContentGetFloatingObjects = function (page) {
            return page.anchoredObjectHolder.getObjectsForRenderer(this.viewManager.layout.anchorObjectsPositionInfo);
        };
        return PrintLayoutRenderer;
    }(__aspxRichEdit.DocumentRenderer));
    __aspxRichEdit.PrintLayoutRenderer = PrintLayoutRenderer;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Row;
        (function (Row) {
            var Box;
            (function (Box) {
                var BoxWrap = (function () {
                    function BoxWrap(box, info) {
                        this.box = box;
                        this.info = info;
                    }
                    BoxWrap.prototype.splitByPosition = function (measurer, pos) {
                        return new BoxWrap(this.box.splitBoxByPosition(measurer, pos), this.info);
                    };
                    return BoxWrap;
                }());
                Box.BoxWrap = BoxWrap;
                var BoxWrapInfo = (function () {
                    function BoxWrapInfo(paragraphIndex, sectionIndex, tablePosition, fieldsInfo) {
                        this.paragraphIndex = paragraphIndex;
                        this.sectionIndex = sectionIndex;
                        this.tablePosition = tablePosition;
                        this.fieldsInfo = fieldsInfo;
                    }
                    BoxWrapInfo.prototype.equalsTablePositions = function (tablePos) {
                        if (!this.tablePosition)
                            return !tablePos;
                        if (!tablePos || this.tablePosition.length != tablePos.length)
                            return false;
                        return __aspxRichEdit.ListUtils.allOf2(this.tablePosition, tablePos, function (a, b) { return a.equals(b); });
                    };
                    return BoxWrapInfo;
                }());
                Box.BoxWrapInfo = BoxWrapInfo;
                var BoxWrapFieldInfo = (function () {
                    function BoxWrapFieldInfo(field, isInCodePart) {
                        this.field = field;
                        this.isInCodePart = isInCodePart;
                    }
                    BoxWrapFieldInfo.make = function (field, pos) {
                        return new BoxWrapFieldInfo(field, field.getCodeIntervalWithBorders().contains(pos));
                    };
                    return BoxWrapFieldInfo;
                }());
                Box.BoxWrapFieldInfo = BoxWrapFieldInfo;
            })(Box = Row.Box || (Row.Box = {}));
        })(Row = LayoutFormatter.Row || (LayoutFormatter.Row = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var FormatterManager = (function (_super) {
            __extends(FormatterManager, _super);
            function FormatterManager(measurer, innerClientProperties, model, layout, selection, bookmarksSettings, documentProtectionSettings, controlHeightProvider, layoutChangesListeners) {
                var _this = _super.call(this) || this;
                _this.formatterProcessID = null;
                _this.isDocumentOpened = false;
                _this.onLayoutChangedDispatcher = new __aspxRichEdit.EventDispatcher();
                _this.measurer = measurer;
                _this.innerClientProperties = innerClientProperties;
                _this.model = model;
                _this.layout = layout;
                _this.bookmarksSettings = bookmarksSettings;
                _this.documentProtectionSettings = documentProtectionSettings;
                _this.controlHeightProvider = controlHeightProvider;
                __aspxRichEdit.ListUtils.foreach(layoutChangesListeners, function (l) { return _this.onLayoutChangedDispatcher.add(l); });
                _this.floatingRestartInfoHolder = new LayoutFormatter.FloatingRestartInfoHolder();
                _this.mainFormatter = new LayoutFormatter.MainFormatter(_this);
                _this.activeFormatter = _this.mainFormatter;
                _this.formatters = {};
                _this.changesManager = new LayoutFormatter.ChangesManager();
                _this.boundsCalculator = new LayoutFormatter.BoundsCalculator();
                _this.invalidator = new LayoutFormatter.LayoutInvalidator(_this, selection);
                _this.modelChangesListener = new LayoutFormatter.ModelChangesListener(_this.invalidator);
                _this.removeRedundantHelper = new LayoutFormatter.RemoveRedundantHelper(_this.changesManager);
                _this.otherPageAreaFormatter = new LayoutFormatter.OtherPageAreaFormatter(_this);
                _this.layoutDependentRunCache = new LayoutFormatter.LayoutDependentRunCache(_this);
                _this.restartManager = new LayoutFormatter.RestartManager(_this);
                _this.anchoredObjectsManager = new LayoutFormatter.AnchoredObjectsManager(_this);
                if (document.fonts && document.fonts.ready && document.fonts.ready.then)
                    document.fonts.ready.then(function (_fontFaceSet) {
                        setTimeout(function () {
                            if (_this.measurer && _this.invalidator) {
                                _this.measurer.clearCache();
                                _this.invalidator.onChangedAllLayout();
                            }
                        }, 1000);
                    });
                return _this;
            }
            FormatterManager.prototype.onUpdateUnlocked = function (_occurredEvents) {
                if (this.isDocumentOpened)
                    this.restartManager.startFormatting();
            };
            FormatterManager.prototype.getLayoutFormatter = function (subDocumentId) {
                var formatter = this.formatters[subDocumentId];
                return formatter ? formatter : this.formatters[subDocumentId] = new LayoutFormatter.BaseFormatter(this, subDocumentId);
            };
            FormatterManager.prototype.openDocument = function () {
                this.isDocumentOpened = true;
                this.activeFormatter = this.mainFormatter;
            };
            FormatterManager.prototype.closeDocument = function () {
                this.isDocumentOpened = false;
                this.stopFormatting();
                this.formatters = {};
                this.changesManager.reset();
                this.layoutDependentRunCache.reset();
                this.restartManager.reset();
            };
            FormatterManager.prototype.runFormatting = function (pageIndex) {
                if (!this.isDocumentOpened)
                    return;
                if (this.isUpdateLocked())
                    throw new Error(__aspxRichEdit.Errors.InternalException);
                this.formatPage(pageIndex);
                this.runFormattingAsync();
            };
            FormatterManager.prototype.runFormattingAsync = function () {
                var _this = this;
                if (this.formatterProcessID || this.isUpdateLocked() || !this.isDocumentOpened)
                    return;
                var asyncCalculating = function () {
                    if (_this.isUpdateLocked())
                        throw new Error("isUpdateLocked(). You can't call formatNext");
                    for (var numRowsFormatAtTime = 10; numRowsFormatAtTime > 0; numRowsFormatAtTime--) {
                        if (!_this.mainFormatter.formatNext()) {
                            _this.formatterProcessID = null;
                            break;
                        }
                    }
                    if (_this.formatterProcessID !== null)
                        _this.formatterProcessID = setTimeout(asyncCalculating, 0);
                };
                this.formatterProcessID = setTimeout(asyncCalculating, 0);
            };
            FormatterManager.prototype.forceFormatPage = function (pageIndex) {
                if (!this.isDocumentOpened)
                    return;
                this.suspendUpdate();
                var page = this.formatPage(pageIndex);
                this.continueUpdate();
                return page;
            };
            FormatterManager.prototype.formatSyncAllDocument = function () {
                this.suspendUpdate();
                while (this.mainFormatter.formatNext())
                    ;
                this.continueUpdate();
            };
            FormatterManager.prototype.onPagesReady = function () {
                var mergedPageChanges = this.changesManager.getMergedPageChanges();
                this.changesManager.reset();
                this.onLayoutChangedDispatcher.raise("NotifyPagesReady", mergedPageChanges);
                if (this.layout.isFullyFormatted)
                    this.onLayoutChangedDispatcher.raise("NotifyFullyFormatted");
            };
            FormatterManager.prototype.formatPage = function (index) {
                if (this.isUpdateLocked())
                    throw new Error("isUpdateLocked(). You can't call formatNext");
                while (index >= this.layout.validPageCount && this.mainFormatter.formatNext())
                    ;
                return this.layout.pages[index];
            };
            FormatterManager.prototype.stopFormatting = function () {
                if (this.formatterProcessID) {
                    clearTimeout(this.formatterProcessID);
                    this.formatterProcessID = null;
                }
            };
            return FormatterManager;
        }(__aspxRichEdit.BatchUpdatableObject));
        LayoutFormatter.FormatterManager = FormatterManager;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var LayoutInvalidator = (function () {
            function LayoutInvalidator(manager, _selection) {
                this.manager = manager;
            }
            Object.defineProperty(LayoutInvalidator.prototype, "model", {
                get: function () { return this.manager.model; },
                enumerable: true,
                configurable: true
            });
            Object.defineProperty(LayoutInvalidator.prototype, "layout", {
                get: function () { return this.manager.layout; },
                enumerable: true,
                configurable: true
            });
            Object.defineProperty(LayoutInvalidator.prototype, "mainSubDoc", {
                get: function () { return this.model.mainSubDocument; },
                enumerable: true,
                configurable: true
            });
            LayoutInvalidator.prototype.onContentInserted = function (subDocument, logPosition, length, restartFromParagraphStart) {
                var _this = this;
                var pages = this.layout.pages;
                if (pages.length == 0)
                    return;
                if (!subDocument.isMain()) {
                    __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterInvalidator, "onContentInserted(header\\footer\\textBox)", "subDocument.id:" + subDocument.id + ", logPosition:" + logPosition + ", length:" + length + ", restartFromParagraphStart:" + restartFromParagraphStart);
                    this.otherSubDocChanged();
                    return;
                }
                var interval = new __aspxRichEdit.FixedInterval(logPosition, length);
                if (length > 0)
                    this.contentOfMainSubDocumentInsertedOrDeleted(interval, restartFromParagraphStart, function (lp) { return _this.advanceForward(lp, length); });
                else if (length < 0)
                    this.contentOfMainSubDocumentInsertedOrDeleted(interval, restartFromParagraphStart, function (lp) { return LayoutFormatter.RemoveContentHelper.deleteInterval(_this.layout, lp, interval, _this.manager.changesManager.getPageChanges()); });
                else
                    throw new Error(__aspxRichEdit.Errors.InternalException);
            };
            LayoutInvalidator.prototype.contentOfMainSubDocumentInsertedOrDeleted = function (interval, restartFromParagraphStart, changeLayout) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterInvalidator, "contentInserted", "subDocument.id:" + 0 + ", logPosition:" + interval.start + ", length:" + interval.length + ", restartFromParagraphStart:" + restartFromParagraphStart);
                var positions = [];
                if (restartFromParagraphStart)
                    this.addRestartFromParagraph(positions, interval.start);
                var lp = this.findLayoutPositionInAllLayout(this.mainSubDoc, interval.start, __aspxRichEdit.DocumentLayoutDetailsLevel.Row, false, true);
                var isValid = lp.page.isValid;
                lp.page.invalidate();
                positions.push(this.prevRowPositions(lp));
                changeLayout(lp);
                if (!isValid) {
                    var poss = __aspxRichEdit.ListUtils.last(positions);
                    poss.modelPosition = poss.layoutPosition.page.getPosition();
                    poss.layoutPosition.initByIndexes(poss.layoutPosition.pageIndex, 0, 0, 0);
                    poss.layoutPosition.applyObjectsAsMainSubDocument(this.layout, -1);
                }
                this.callRestart(positions);
            };
            LayoutInvalidator.prototype.onIntervalChanged = function (subDocument, interval) {
                if (interval.length == 0 || !this.layout.pages.length)
                    return;
                if (!subDocument.isMain()) {
                    __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterInvalidator, "onIntervalChanged(header\\footer)", "subDocument.id:" + subDocument.id + ", interval:" + __aspxRichEdit.LogObjToStr.fixedInterval(interval));
                    this.otherSubDocChanged();
                    return;
                }
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterInvalidator, "onIntervalChanged", "subDocument.id:" + subDocument.id + ", interval:" + __aspxRichEdit.LogObjToStr.fixedInterval(interval));
                var lp = this.findLayoutPositionInAllLayout(subDocument, interval.start, __aspxRichEdit.DocumentLayoutDetailsLevel.Row, false, true);
                this.invalidatePagesByEndPosition(lp.pageIndex, interval.end);
                this.manager.restartManager.restartFromPage(lp.pageIndex, interval.start, false);
            };
            LayoutInvalidator.prototype.onChangedSection = function (section, sectionIndex) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterInvalidator, "onChangedSection", "sectionIndex:" + sectionIndex);
                var pages = this.layout.pages;
                var sectionStartPos = section.startLogPosition.value;
                var pageIndexStart = LayoutInvalidator.getSectionFirstPageIndex(pages, this.layout.validPageCount, section.startLogPosition.value);
                var secEndPos = section.getEndPosition();
                for (var pageIndex = pageIndexStart, page = void 0; (page = pages[pageIndex]) && page.getPosition() <= secEndPos; pageIndex++)
                    page.invalidate();
                this.manager.restartManager.restartFromPage(pageIndexStart, sectionStartPos, true);
            };
            LayoutInvalidator.prototype.onListLevelChanged = function (newState) {
                var _this = this;
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterInvalidator, "onListLevelChanged newState\n", __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemListLevelStateObject, newState, "\t", "\n"));
                var _loop_2 = function (obj) {
                    __aspxRichEdit.MapUtilsKeyAsNumber.foreach(this_2.model.subDocuments, function (subDocument) {
                        var abstractNumberingListIndex = obj.isAbstractNumberingList ?
                            obj.numberingListIndex :
                            subDocument.documentModel.numberingLists[obj.numberingListIndex].abstractNumberingListIndex;
                        var listLevelIndex = obj.listLevelIndex;
                        var intervals = [];
                        for (var _i = 0, _a = subDocument.paragraphs; _i < _a.length; _i++) {
                            var paragraph = _a[_i];
                            if (paragraph.getAbstractNumberingListIndex() === abstractNumberingListIndex &&
                                paragraph.getListLevelIndex() === listLevelIndex)
                                intervals.push(paragraph.interval);
                        }
                        if (intervals.length > 0) {
                            var mergedIntervals = __aspxRichEdit.IntervalAlgorithms.getMergedIntervals(intervals, true);
                            for (var _b = 0, mergedIntervals_1 = mergedIntervals; _b < mergedIntervals_1.length; _b++) {
                                var interval = mergedIntervals_1[_b];
                                _this.onIntervalChanged(subDocument, interval);
                            }
                        }
                    });
                };
                var this_2 = this;
                for (var _i = 0, _a = newState.objects; _i < _a.length; _i++) {
                    var obj = _a[_i];
                    _loop_2(obj);
                }
            };
            LayoutInvalidator.prototype.onHeaderFooterIndexChanged = function (sectionIndex, type, model) {
                var headerFooterInvalidatorHelper = new LayoutFormatter.HeaderFooterInvalidatorHelper(model, this.layout, type);
                headerFooterInvalidatorHelper.initBySectionIndex(sectionIndex);
                var firstPage = this.layout.pages[headerFooterInvalidatorHelper.startPageIndex];
                if (!firstPage)
                    return;
                __aspxRichEdit.ListUtils.foreach(this.layout.pages, function (page) { return page.invalidate(); }, headerFooterInvalidatorHelper.startPageIndex, headerFooterInvalidatorHelper.endPageIndex);
                this.manager.restartManager.restartFromPage(headerFooterInvalidatorHelper.startPageIndex, firstPage.getPosition(), true);
            };
            LayoutInvalidator.prototype.onPagesChanged = function (startPageIndex, endPageIndex) {
                var firstPage = this.layout.pages[startPageIndex];
                if (!firstPage)
                    return;
                __aspxRichEdit.ListUtils.foreach(this.layout.pages, function (page) { return page.invalidate(); }, startPageIndex, endPageIndex);
                this.manager.restartManager.restartFromPage(startPageIndex, firstPage.getPosition(), true);
            };
            LayoutInvalidator.prototype.onChangedAllLayout = function () {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterInvalidator, "onChangedAllLayout", "");
                this.manager.restartManager.restartAllLayout();
            };
            LayoutInvalidator.prototype.prevRowPositions = function (layoutPos) {
                var prevLP = layoutPos.clone();
                prevLP.advanceToPrevRow(this.layout);
                var lp = prevLP.row.tableCellInfo && (!layoutPos.row.tableCellInfo ||
                    layoutPos.row.tableCellInfo.parentRow.parentTable.getTopLevelColumn() !=
                        prevLP.row.tableCellInfo.parentRow.parentTable.getTopLevelColumn()) ?
                    layoutPos :
                    prevLP;
                return new __aspxRichEdit.LayoutAndModelPositions(lp, this.getStartModelPositionOfRow(lp));
            };
            LayoutInvalidator.prototype.callRestart = function (positions) {
                var minMax = __aspxRichEdit.ListUtils.minMax(positions, function (a, b) { return a.modelPosition - b.modelPosition; });
                var minPageIndex = minMax.min.layoutPosition.pageIndex;
                __aspxRichEdit.ListUtils.foreach(this.layout.pages, function (page) { return page.invalidate(); }, minPageIndex, minMax.max.layoutPosition.pageIndex + 1);
                if (!this.layout.pages[minPageIndex])
                    return;
                this.manager.restartManager.restartFromPage(minPageIndex, minMax.min.modelPosition, false);
            };
            LayoutInvalidator.prototype.advanceForward = function (layoutPos, length) {
                __aspxRichEdit.ListUtils.foreach(this.layout.pages, function (page) { return page.setPosition(page.getPosition() + length); }, layoutPos.pageIndex + 1);
                this.moveRowsToRight(layoutPos, length);
                this.moveColumnsToRight(layoutPos, length);
                this.movePageAreasToRight(layoutPos, length);
            };
            LayoutInvalidator.prototype.moveRowsToRight = function (layoutPosition, offset) {
                var rows = layoutPosition.column.rows;
                for (var rowIndex = layoutPosition.rowIndex + 1, row = void 0; row = rows[rowIndex]; rowIndex++)
                    row.columnOffset += offset;
            };
            LayoutInvalidator.prototype.moveColumnsToRight = function (layoutPosition, offset) {
                var columns = layoutPosition.pageArea.columns;
                for (var columnIndex = layoutPosition.columnIndex + 1, column = void 0; column = columns[columnIndex]; columnIndex++)
                    column.pageAreaOffset += offset;
            };
            LayoutInvalidator.prototype.movePageAreasToRight = function (layoutPosition, offset) {
                var pageAreas = layoutPosition.page.mainSubDocumentPageAreas;
                __aspxRichEdit.ListUtils.foreach(pageAreas, function (pa) { return pa.pageOffset += offset; }, layoutPosition.pageAreaIndex + 1);
            };
            LayoutInvalidator.prototype.otherSubDocChanged = function () {
                __aspxRichEdit.ListUtils.foreach(this.layout.pages, function (p) { return p.invalidate(); });
                this.manager.restartManager.restartFromPage(0, 0, true);
            };
            LayoutInvalidator.getSectionFirstPageIndex = function (pages, validPageCount, startSectionPos) {
                if (!validPageCount)
                    return 0;
                var firstPageIndex = Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(pages, function (p) { return p.getPosition(); }, startSectionPos, 0, validPageCount - 1));
                return pages[firstPageIndex].getPosition() < startSectionPos ? Math.min(firstPageIndex + 1, validPageCount) : firstPageIndex;
            };
            LayoutInvalidator.prototype.invalidatePagesByEndPosition = function (startPageIndex, intervalEndPos) {
                this.invalidatePages(startPageIndex, function (page) { return intervalEndPos < page.getEndPosition(); });
            };
            LayoutInvalidator.prototype.invalidatePages = function (startPageIndex, endCondition) {
                var pages = this.layout.pages;
                for (var pageIndex = startPageIndex, page = void 0; page = pages[pageIndex]; pageIndex++) {
                    page.invalidate();
                    if (endCondition(page))
                        break;
                }
            };
            LayoutInvalidator.prototype.findLayoutPositionInAllLayout = function (subDocument, pos, detailsLevel, endRowConflictFlags, middleRowConflictFlags) {
                var layout = this.layout;
                var realValidPageCount = layout.validPageCount;
                var realIsFullyFormatted = layout.isFullyFormatted;
                layout.validPageCount = layout.pages.length;
                layout.isFullyFormatted = true;
                var res = new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(layout, subDocument, pos, detailsLevel, true)
                    .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(endRowConflictFlags), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(middleRowConflictFlags));
                layout.validPageCount = realValidPageCount;
                layout.isFullyFormatted = realIsFullyFormatted;
                return res;
            };
            LayoutInvalidator.prototype.getStartModelPositionOfRow = function (lp) {
                var prevLP = lp.clone();
                if (prevLP.advanceToPrevRow(this.layout)) {
                    var prevLPTblCellInfo = prevLP.row.tableCellInfo;
                    if (prevLPTblCellInfo && (!lp.row || lp.row.tableCellInfo))
                        return prevLPTblCellInfo.parentRow.parentTable.getTopLevelColumn().logicInfo.grid.table.getStartPosition();
                    return prevLPTblCellInfo &&
                        (!lp.row.tableCellInfo || lp.row.tableCellInfo.parentRow.parentTable.getTopLevelColumn().logicInfo !=
                            prevLPTblCellInfo.parentRow.parentTable.getTopLevelColumn().logicInfo) ?
                        prevLPTblCellInfo.parentRow.parentTable.getTopLevelColumn().logicInfo.grid.table.getEndPosition() :
                        prevLP.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Row) + prevLP.row.getLastBox().getEndPosition();
                }
                return 0;
            };
            LayoutInvalidator.prototype.extendByMultipageTables = function (pageIndex, minPosition, forceRestartFullPage) {
                var subDocument = this.model.mainSubDocument;
                if (!subDocument.tables.length)
                    return -1;
                var page = this.layout.pages[pageIndex];
                if (!page)
                    return -1;
                var table = this.isPageStartWithMultipageTable(page);
                if (!table)
                    return -1;
                return minPosition < table.getEndPosition() || forceRestartFullPage ? table.getStartPosition() : table.getEndPosition();
            };
            LayoutInvalidator.prototype.isPageStartWithMultipageTable = function (page) {
                if (!page)
                    return null;
                var fstPa = page.mainSubDocumentPageAreas[0];
                if (!fstPa)
                    return null;
                var fstColumn = fstPa.columns[0];
                if (!fstColumn)
                    return null;
                var fstRow = fstColumn.rows[0];
                if (!fstRow)
                    return null;
                var tableCellInfo = fstRow.tableCellInfo;
                return LayoutInvalidator.isLayoutRowRowStartWithMultipageTable(fstRow) ?
                    tableCellInfo.parentRow.parentTable.getTopLevelColumn().logicInfo.grid.table :
                    null;
            };
            LayoutInvalidator.isLayoutRowRowStartWithMultipageTable = function (layoutRow) {
                var tableCellInfo = layoutRow.tableCellInfo;
                return tableCellInfo && (tableCellInfo.parentRow.rowIndex != 0 || tableCellInfo.parentRow.parentTable.isBoundWithPrev());
            };
            LayoutInvalidator.prototype.addRestartFromParagraph = function (positions, logPosition) {
                var parStartPos = this.mainSubDoc.getParagraphByPosition(logPosition).startLogPosition.value;
                var layPosParStart = this.findLayoutPositionInAllLayout(this.mainSubDoc, parStartPos, __aspxRichEdit.DocumentLayoutDetailsLevel.Row, false, true);
                layPosParStart.page.invalidate();
                positions.push(this.prevRowPositions(layPosParStart));
            };
            return LayoutInvalidator;
        }());
        LayoutFormatter.LayoutInvalidator = LayoutInvalidator;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ClientSideEvents = (function () {
        function ClientSideEvents(owner) {
            this.owner = owner;
        }
        ClientSideEvents.prototype.raiseHyperlinkClick = function (evt, hyperlinkInfo) {
            return this.owner.raiseHyperlinkClick(evt, hyperlinkInfo);
        };
        ClientSideEvents.prototype.raiseKeyDown = function (evt) {
            return this.owner.raiseKeyDown(evt);
        };
        ClientSideEvents.prototype.raiseKeyUp = function (evt) {
            this.owner.raiseKeyUp(evt);
        };
        ClientSideEvents.prototype.raisePointerDown = function (evt) {
            return this.owner.raisePointerDown(evt);
        };
        ClientSideEvents.prototype.raisePointerUp = function (evt) {
            return this.owner.raisePointerUp(evt);
        };
        ClientSideEvents.prototype.raiseContentInserted = function (subDocumentId, interval) {
            this.owner.raiseContentInserted(subDocumentId, interval);
        };
        ClientSideEvents.prototype.raiseContentRemoved = function (subDocumentId, interval) {
            this.owner.raiseContentRemoved(subDocumentId, interval);
        };
        ClientSideEvents.prototype.raiseCharacterPropertiesChanged = function (subDocumentId, interval) {
            this.owner.raiseCharacterPropertiesChanged(subDocumentId, interval);
        };
        ClientSideEvents.prototype.raiseParagraphPropertiesChanged = function (subDocumentId, paragraphIndex) {
            this.owner.raiseParagraphPropertiesChanged(subDocumentId, paragraphIndex);
        };
        ClientSideEvents.prototype.raiseAutoCorrect = function (text, interval) {
            return this.owner.raiseAutoCorrect(text, interval);
        };
        ClientSideEvents.prototype.raiseDocumentChanged = function () {
            this.owner.raiseDocumentChanged();
        };
        ClientSideEvents.prototype.raiseActiveSubDocumentChanged = function () {
            this.owner.raiseActiveSubDocumentChanged();
        };
        ClientSideEvents.prototype.raiseSelectionChanged = function () {
            this.owner.raiseSelectionChanged();
        };
        ClientSideEvents.prototype.raiseDocumentLoaded = function () {
            this.owner.raiseDocumentLoaded();
        };
        ClientSideEvents.prototype.raiseGotFocus = function () {
            this.owner.raiseGotFocus();
        };
        ClientSideEvents.prototype.raiseLostFocus = function () {
            this.owner.raiseLostFocus();
        };
        return ClientSideEvents;
    }());
    __aspxRichEdit.ClientSideEvents = ClientSideEvents;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RichEditCore = (function () {
        function RichEditCore(owner, name, element, clientGuid, readOnly, bars, unitsType, rulerSettings, bookmarksSettings, fieldsSettings, mailMergeOptions, spellCheckerSettings, autoCorrectSettings, documentProtectionSettings, viewsSettings) {
            var _this = this;
            this.isNeedLoadPictureFromServer = true;
            this.readOnly = __aspxRichEdit.ReadOnlyMode.None;
            __aspxRichEdit.CharacterPropertyDescriptor.fontInfo.defaultValue = __aspxRichEdit.ListUtils.elementBy(__aspxRichEdit.FontInfoCache.defaultFonts, function (f) { return f.name == __aspxRichEdit.FontInfoCache.defaultFontName; });
            this.owner = owner;
            this.clientGuid = clientGuid;
            this.readOnly = readOnly ? __aspxRichEdit.ReadOnlyMode.Persistent : __aspxRichEdit.ReadOnlyMode.None;
            this.options = new __aspxRichEdit.ControlOptions();
            this.mailMergeOptions = mailMergeOptions;
            this.bookmarksSettings = bookmarksSettings;
            this.fieldsSettings = fieldsSettings;
            this.documentProtectionSettings = documentProtectionSettings;
            this.measurer = new __aspxRichEdit.Measurer(name);
            this.boxVisualizerManager = new __aspxRichEdit.BoxVisualizerManager(this);
            this.eventManager = new __aspxRichEdit.EventManager(this, this.boxVisualizerManager);
            this.uiUnitConverter = __aspxRichEdit.UnitConverter.getConverter(unitsType);
            var viewElement = this.createViewElement(name, element);
            this.horizontalRulerControl = new __aspxRichEdit.Ruler.HorizontalRulerControl(this, rulerSettings, element, viewElement);
            this.inputController = new __aspxRichEdit.InputController(this, this.eventManager, viewElement);
            this.innerClientProperties = new __aspxRichEdit.InnerClientProperties(viewsSettings);
            this.stringResources = this.createStringResources();
            this.viewManager = new __aspxRichEdit.ViewManager(viewElement, this.eventManager, this.stringResources, this.horizontalRulerControl, this.inputController, this.innerClientProperties);
            this.popupMenuManager = new __aspxRichEdit.PopupMenuManager(this.owner, this.viewManager, this.measurer, null);
            this.focusManager = new __aspxRichEdit.FocusManager(this.viewManager.canvasManager, this.owner, this.inputController, this.eventManager);
            this.commandManager = this.createCommandManager();
            this.shortcutManager = this.createShortcutManager();
            this.barManager = new __aspxRichEdit.BarManager(bars);
            this.barManager.initialize(this);
            this.serverDispatcher = new __aspxRichEdit.ServerDispatcher(this);
            this.searchManager = new __aspxRichEdit.SearchManager(this);
            this.boxVisualizerManager.initListeners(this.viewManager);
            this.spellChecker = new __aspxRichEdit.SpellChecker(this, spellCheckerSettings);
            this.autoCorrectService = new __aspxRichEdit.AutoCorrectService(this, autoCorrectSettings);
            this.clientSideEvents = new __aspxRichEdit.ClientSideEvents(this.owner);
            this.globalEventDispatcher = new __aspxRichEdit.GlobalEventDispatcher(this, function () {
                _this.searchManager.raiseSearchReset();
                _this.clientSideEvents.raiseDocumentChanged();
            });
            this.simpleViewCanvasSizeManager = new __aspxRichEdit.SimpleViewCanvasSizeManager(this.viewManager.canvasManager, function () {
                __aspxRichEdit.ListUtils.foreach(_this.viewManager.cache, function (_val) { return _this.viewManager.renderer.removePage(1); }, 1);
                _this.innerClientProperties.viewsSettings.widthOfPage = _this.viewManager.canvasManager.getCanvasWidth();
                if (_this.layoutFormatterManager) {
                    _this.layoutFormatterManager.invalidator.onChangedAllLayout();
                    _this.selection.scrollManager.setScroll(new __aspxRichEdit.Scroll.State().byModelPosition
                        .setModelPosition(_this.selection.getLastSelectedInterval().start).useStdRelativePosition().useStdOffset());
                }
                _this.owner.adjustControl();
                _this.horizontalRulerControl.update();
            });
            if (this.innerClientProperties.viewsSettings.isSimpleView)
                this.simpleViewCanvasSizeManager.setViewMode(true);
            __aspxRichEdit.ChromeCustomFormatters.BaseFormatter.rich = this;
        }
        RichEditCore.prototype.initialize = function (sessionGuid, documentInfo, emptyImageCacheId, subDocumentsCounter, documentModel, testMode) {
            if (testMode === void 0) { testMode = false; }
            this.closed = false;
            if (!documentModel)
                documentModel = new __aspxRichEdit.DocumentModel(this.options, subDocumentsCounter);
            this.setWorkSession(sessionGuid, documentInfo);
            this.model = documentModel;
            this.measurer.setCharacterPropertiesCache(this.model.cache.mergedCharacterPropertiesCache);
            this.layout = new __aspxRichEdit.DocumentLayout(new __aspxRichEdit.AnchorObjectsPositionInfo(documentModel));
            this.selection = new __aspxRichEdit.Selection(this.model, this.layout);
            this.popupMenuManager.setSelection(this.selection);
            var layoutSelection = new __aspxRichEdit.LayoutSelection(this.model.activeSubDocument.info, -1, this.innerClientProperties);
            this.viewManager.setWorkSession(this.layout, layoutSelection, this.model.cache.imageCache, REWebUtils.OfficeHandlerUtils.getHandlerResourceUrl() + "DXS.ashx?dxwsid=" + this.sessionGuid + "&c=" + this.clientGuid, emptyImageCacheId);
            this.hitTestManager = new __aspxRichEdit.HitTestManager(this.layout, this.measurer);
            this.serverDispatcher.initialize(testMode);
            this.selectionFormatter = new __aspxRichEdit.SelectionFormatter(this.selection, this.measurer, layoutSelection, this.documentProtectionSettings);
            this.selectionFormatter.onSelectionLayoutChanged.add(this.viewManager);
            this.selection.onChanged.add(this.selectionFormatter);
            this.selection.onChanged.add(this.boxVisualizerManager.fullTableSelectorVisualizer);
            this.selection.onSearchChanged.add(this.selectionFormatter);
            this.selection.onMisspelledSelectionChanged.add(this.selectionFormatter);
            this.scrollFormatter = new __aspxRichEdit.ScrollFormatter(this.selection);
            this.selection.scrollManager.onChanged.add(this.scrollFormatter);
            this.scrollFormatter.onScrollLayoutChanged.add(this.viewManager.canvasScrollManager);
            this.layoutFormatterManager = new __aspxRichEdit.LayoutFormatter.FormatterManager(this.measurer, this.innerClientProperties, this.model, this.layout, this.selection, this.bookmarksSettings, this.documentProtectionSettings, this.viewManager.canvasManager.controlHeightProvider, [
                this.viewManager,
                this.selectionFormatter,
                this.scrollFormatter,
                this.boxVisualizerManager.resizeBoxVisualizer,
                this.boxVisualizerManager.anchorVisualizer,
                this.boxVisualizerManager.fullTableSelectorVisualizer,
                new __aspxRichEdit.SpellCheckerLayoutChangesListener(this.spellChecker)
            ]);
            this.modelManipulator = new __aspxRichEdit.ModelManipulator(this.model);
            this.history = new __aspxRichEdit.History(this.modelManipulator, this.options);
            this.modelManipulator.dispatcher.onModelChanged.add(this.layoutFormatterManager.modelChangesListener);
            this.modelManipulator.dispatcher.onModelChanged.add(new __aspxRichEdit.ServerDispatcherModelChangesListener(this.serverDispatcher));
            this.modelManipulator.dispatcher.onModelChanged.add(new __aspxRichEdit.SpellCheckerModelChangesListener(this.spellChecker));
            this.inputPosition = new __aspxRichEdit.InputPosition(this.selection, this.modelManipulator.model);
            this.selection.inputPosition = this.inputPosition;
            this.selection.onChanged.add(this.barManager);
            this.selection.onChanged.add(this.boxVisualizerManager.resizeBoxVisualizer);
            this.selection.onChanged.add(this.boxVisualizerManager.anchorVisualizer);
            this.barManager.setEnabled(false);
            this.horizontalRulerControl.initialize(testMode);
            this.horizontalRulerControl.setEnable(false);
            this.selection.onChanged.add(this.horizontalRulerControl);
            this.spellChecker.initialize(this.model.activeSubDocument);
            this.selection.onChanged.add(new __aspxRichEdit.SpellCheckerSelectionChangesListener(this, this.spellChecker));
            this.selection.onChanged.add(this.globalEventDispatcher);
            this.modelManipulator.dispatcher.onModelChanged.add(this.globalEventDispatcher);
        };
        RichEditCore.prototype.beginUpdate = function () {
            this.layoutFormatterManager.beginUpdate();
            this.barManager.beginUpdate();
            this.horizontalRulerControl.beginUpdate();
            this.selectionFormatter.beginUpdate();
            this.scrollFormatter.beginUpdate();
            this.viewManager.canvasManager.beginUpdate();
            this.selection.beginUpdate();
            this.globalEventDispatcher.beginUpdate();
        };
        RichEditCore.prototype.endUpdate = function () {
            this.layoutFormatterManager.endUpdate();
            this.barManager.endUpdate();
            this.horizontalRulerControl.endUpdate();
            this.selectionFormatter.endUpdate();
            this.scrollFormatter.endUpdate();
            this.viewManager.canvasManager.endUpdate();
            this.layoutFormatterManager.runFormattingAsync();
            this.selection.endUpdate();
            this.globalEventDispatcher.endUpdate();
        };
        RichEditCore.prototype.setPersistentReadOnly = function (readOnly) {
            if (readOnly)
                this.readOnly = __aspxRichEdit.ReadOnlyMode.Persistent;
            else if (!readOnly && this.readOnly === __aspxRichEdit.ReadOnlyMode.Persistent) {
                this.readOnly = __aspxRichEdit.ReadOnlyMode.None;
                this.inputController.inputEditor.initializeIfNotReadOnly();
            }
        };
        RichEditCore.prototype.setWorkSession = function (sessionGuid, documentInfo) {
            this.sessionGuid = sessionGuid;
            this.documentInfo = documentInfo;
            if (this.owner)
                this.owner.syncSessionGuid(sessionGuid);
        };
        RichEditCore.prototype.sendRequest = function (requestQueryString, viaInternalCallback) {
            this.owner.raiseBeginSynchronization();
            this.owner.sendRequest(requestQueryString, viaInternalCallback);
        };
        RichEditCore.prototype.beginLoading = function () {
            if (this.readOnly === __aspxRichEdit.ReadOnlyMode.None) {
                this.readOnly = __aspxRichEdit.ReadOnlyMode.Temporary;
                this.barManager.suspendUpdate();
                this.barManager.updateItemsState([]);
                this.barManager.continueUpdate();
                this.owner.setLoadingPanelVisible(true);
            }
        };
        RichEditCore.prototype.endLoading = function () {
            if (this.readOnly === __aspxRichEdit.ReadOnlyMode.Temporary) {
                this.readOnly = __aspxRichEdit.ReadOnlyMode.None;
                this.barManager.suspendUpdate();
                this.barManager.updateItemsState([]);
                this.barManager.continueUpdate();
                this.owner.setLoadingPanelVisible(false);
            }
        };
        RichEditCore.prototype.closeDocument = function () {
            this.selection.onChanged.remove(this.globalEventDispatcher);
            this.modelManipulator.dispatcher.onModelChanged.remove(this.globalEventDispatcher);
            this.barManager.setEnabled(false);
            if (this.horizontalRulerControl)
                this.horizontalRulerControl.setEnable(false);
            this.layoutFormatterManager.closeDocument();
            this.viewManager.closeDocument();
            this.boxVisualizerManager.closeDocument();
            this.serverDispatcher.reset();
            this.closed = true;
        };
        RichEditCore.prototype.importHtml = function (elements, interval) {
            this.beginUpdate();
            var exportedRangeCopy = this.inputController.getExportedRangeCopy();
            if (exportedRangeCopy && this.isUsedInnerClipboard(elements))
                __aspxRichEdit.ModelManipulator.pasteRangeCopy(this, this.model.activeSubDocument, interval, exportedRangeCopy);
            else
                new __aspxRichEdit.HtmlImport.HtmlImporter(this, this.viewManager.emptyImageCacheId, interval, elements).import();
            this.endUpdate();
        };
        RichEditCore.prototype.onViewTypeChanged = function () {
            this.viewManager.renderer.onViewTypeChanged();
            this.horizontalRulerControl.onViewTypeChanged();
            this.simpleViewCanvasSizeManager.setViewMode(this.innerClientProperties.viewsSettings.isSimpleView);
        };
        RichEditCore.prototype.getModifiedState = function () {
            if (this.serverDispatcher.saveInProgress())
                return __aspxRichEdit.IsModified.SaveInProgress;
            else if (this.serverDispatcher.wasModifiedOnServer)
                return __aspxRichEdit.IsModified.True;
            else if (this.serverDispatcher.lastSavedHistoryItemId != this.history.getCurrentItemId())
                return __aspxRichEdit.IsModified.True;
            return __aspxRichEdit.IsModified.False;
        };
        RichEditCore.prototype.getGuidParams = function () {
            return { sguid: this.sessionGuid, cguid: this.clientGuid };
        };
        RichEditCore.prototype.isTouchMode = function () {
            return REWebUtils.Browser.TouchUI && !REWebUtils.Browser.MSTouchUI;
        };
        RichEditCore.prototype.dispose = function () {
            this.serverDispatcher.reset();
        };
        RichEditCore.prototype.isRibbon = function (element) {
            return this.owner.isRibbon(element);
        };
        RichEditCore.prototype.isClosed = function () {
            return this.closed;
        };
        RichEditCore.prototype.createViewElement = function (id, element) {
            var viewElement = document.createElement("DIV");
            viewElement.id = id + "_View";
            viewElement.className = "dxreView";
            element.appendChild(viewElement);
            return viewElement;
        };
        RichEditCore.prototype.isUsedInnerClipboard = function (elements) {
            var elem = elements[0];
            return elem && __aspxRichEdit.HTMLUtils.isHTMLElementNode(elem) && elem.id == __aspxRichEdit.RichUtils.getCopyPasteGuid(this.getGuidParams());
        };
        return RichEditCore;
    }());
    __aspxRichEdit.RichEditCore = RichEditCore;
    var DocumentInfo = (function () {
        function DocumentInfo(fileName, documentHasSource) {
            this.fileName = fileName;
            this.documentHasSource = documentHasSource;
        }
        DocumentInfo.prototype.getFileName = function () {
            return this.fileName;
        };
        DocumentInfo.prototype.hasSource = function () {
            return this.documentHasSource;
        };
        return DocumentInfo;
    }());
    __aspxRichEdit.DocumentInfo = DocumentInfo;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var WAITING_TIMER = 30000;
    var PENDING_TIMER = 5000;
    var MAX_COMMAND_REQUESTS = 250;
    var ServerDispatcher = (function () {
        function ServerDispatcher(control) {
            this.lastSavedHistoryItemId = -1;
            this.wasModifiedOnServer = false;
            this.requestID = 0;
            this.editRequestID = 0;
            this.waitingTimerID = -1;
            this.pendingTimerID = -1;
            this.numActiveSaveRequests = 0;
            this.isWaiting = false;
            this.lockQueue = false;
            this.queue = {};
            this.sendedRequests = {};
            this.control = control;
        }
        ServerDispatcher.prototype.initialize = function (testMode) {
            this.testMode = testMode;
        };
        ServerDispatcher.prototype.saveInProgress = function () {
            return this.numActiveSaveRequests > 0;
        };
        ServerDispatcher.prototype.pushRequest = function (request, requestParams) {
            var _this = this;
            request.id = ++this.requestID;
            request.processOnCallback = requestParams.processOnCallback;
            request.fontInfoCacheLength = request.isOpenDocumentRequest() ? 0 : this.control.model.cache.fontInfoCache.count;
            this.lastRequestInQueue = request;
            if (this.lockQueue)
                return;
            if (this.testMode)
                this.queue = {};
            this.lockQueue = requestParams.lockQueue;
            if (__aspxRichEdit.ServerCommandRequest.isEditRequest(request)) {
                request.editIncId = ++this.editRequestID;
                this.removeModelRequests();
            }
            if (request.isSaveDocumentRequest())
                this.numActiveSaveRequests++;
            this.queue[request.id] = request;
            if (this.testMode)
                this.sendRequestCore();
            else if (requestParams.immediateSend && !this.isWaiting)
                this.forceSendingRequest();
            else if (!this.isWaiting && this.pendingTimerID < 0)
                this.pendingTimerID = setTimeout(function () { return _this.onPendingTimerExpired(); }, PENDING_TIMER);
        };
        ServerDispatcher.prototype.pushLoadNextChunksRequest = function (subDocument, startPosition) {
            var commandParams = {};
            commandParams[__aspxRichEdit.JSONEnumLoadPieceTableCommandParameters.StartPosition] = startPosition;
            this.pushRequest(new __aspxRichEdit.LoadCommandRequest(__aspxRichEdit.CommandType.LoadPieceTable, subDocument.id, commandParams), new RequestParams(false, true, false));
        };
        ServerDispatcher.prototype.processSaveResponse = function (historyId) {
            this.numActiveSaveRequests--;
            if (this.numActiveSaveRequests < 0)
                throw new Error(__aspxRichEdit.Errors.InternalException);
            this.lastSavedHistoryItemId = historyId;
            this.wasModifiedOnServer = false;
            this.control.barManager.updateItemsState([]);
        };
        ServerDispatcher.prototype.getRequestJSON = function () {
            this.lastRequestInQueue = undefined;
            var request = this.getRequestList(true);
            if (request.length && !this.lockQueue)
                return JSON.stringify(request);
            return "";
        };
        ServerDispatcher.prototype.reset = function () {
            this.clearTimers();
            this.numActiveSaveRequests = 0;
            this.isWaiting = false;
            this.lockQueue = false;
            this.queue = {};
            this.lastSavedHistoryItemId = -1;
        };
        ServerDispatcher.prototype.forceSendingRequest = function () {
            this.clearTimers();
            this.sendRequestCore();
        };
        ServerDispatcher.prototype.hasQueue = function () {
            return !!this.queue[this.requestID];
        };
        ServerDispatcher.prototype.onGetResponse = function (responce, testMode) {
            if (testMode === void 0) { testMode = false; }
            var coreResponce;
            try {
                if (testMode)
                    coreResponce = eval(responce);
                else
                    coreResponce = JSON.parse(responce);
            }
            catch (e) {
                if (testMode)
                    throw new Error("InvalidResponce=" + responce.toString());
                return false;
            }
            this.onGetResponseCore(coreResponce);
            return true;
        };
        ServerDispatcher.prototype.onGetResponseCore = function (responce) {
            this.clearWaitingTimer();
            this.isWaiting = false;
            this.processCommandsResponce(responce[__aspxRichEdit.JSONResponceLevelProperty.CommandsResults]);
            this.control.owner.hideLoadingElements();
            var errorCode = responce[__aspxRichEdit.JSONResponceLevelProperty.ErrorCode];
            if (errorCode == __aspxRichEdit.JSONResponseError.NoErrors) {
                if (!this.isWaiting) {
                    if (!this.sendRequestCore())
                        this.lockQueue = false;
                }
                if (!this.control.model.isLoaded())
                    this.pushLoadNextChunksRequest(this.control.model.mainSubDocument, this.control.model.getCurrentLength());
                return;
            }
            this.reset();
            switch (errorCode) {
                case __aspxRichEdit.JSONResponseError.SessionHasExpired:
                    this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowErrorSessionHasExpiredMessageCommand).execute(this.control.commandManager.isPublicApiCall);
                    break;
                case __aspxRichEdit.JSONResponseError.ModelIsChanged:
                    this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowErrorModelIsChangedMessageCommand).execute(this.control.commandManager.isPublicApiCall);
                    break;
                case __aspxRichEdit.JSONResponseError.AuthException:
                    this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowErrorAuthExceptionMessageCommand).execute(this.control.commandManager.isPublicApiCall);
                    break;
                case __aspxRichEdit.JSONResponseError.InnerException:
                    this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowErrorInnerExceptionMessageCommand).execute(this.control.commandManager.isPublicApiCall);
                    break;
                case __aspxRichEdit.JSONResponseError.CantSaveToAlreadyOpenedFile:
                    this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowErrorOpeningAndOverstoreImpossibleMessageCommand).execute(this.control.commandManager.isPublicApiCall);
                    break;
                case __aspxRichEdit.JSONResponseError.CantSaveToEmptyPath:
                    this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowErrorCantSaveToEmptyPathMessageCommand).execute(this.control.commandManager.isPublicApiCall);
                    break;
                case __aspxRichEdit.JSONResponseError.CantSaveDocument:
                    this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowErrorSavingMessageCommand).execute(this.control.commandManager.isPublicApiCall);
                    break;
                case __aspxRichEdit.JSONResponseError.CantOpenDocument:
                    this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowErrorOpeningMessageCommand).execute(this.control.commandManager.isPublicApiCall);
                    break;
                case __aspxRichEdit.JSONResponseError.PathTooLongException:
                    this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowErrorPathTooLongCommand).execute(this.control.commandManager.isPublicApiCall);
                    break;
                case __aspxRichEdit.JSONResponseError.CalculateDocumentVariableException:
                    this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowErrorDocVariableErrorCommand).execute(this.control.commandManager.isPublicApiCall);
                    if (this.control.model.activeSubDocument.fieldsWaitingForUpdate)
                        this.control.model.activeSubDocument.fieldsWaitingForUpdate.endAction();
                    break;
                case __aspxRichEdit.JSONResponseError.InsertContentFromServerException:
                    this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowInsertContentFromServerErrorDialogCommand).execute(this.control.commandManager.isPublicApiCall);
                    this.control.model.insertContentFromServerRequestManager.reset();
                    break;
                case __aspxRichEdit.JSONResponseError.LoadPictureException:
                    this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowErrorLoadPictureMessage).execute(this.control.commandManager.isPublicApiCall);
                    console.error('Could not load the image. See also: https://stackoverflow.com/questions/28286086/default-securityprotocol-in-net-4-5');
                    break;
                default:
                    throw new Error("Undefined server error");
            }
        };
        ServerDispatcher.prototype.clearTimers = function () {
            this.clearWaitingTimer();
            if (this.pendingTimerID > -1) {
                clearTimeout(this.pendingTimerID);
                this.pendingTimerID = -1;
            }
        };
        ServerDispatcher.prototype.clearWaitingTimer = function () {
            if (this.waitingTimerID > -1) {
                clearTimeout(this.waitingTimerID);
                this.waitingTimerID = -1;
            }
        };
        ServerDispatcher.prototype.sendRequestCore = function () {
            var _this = this;
            if (!this.hasQueue())
                return false;
            this.isWaiting = true;
            this.lastRequestInQueue = undefined;
            var sendRequestsViaCallback = this.shouldSendRequestsWithCallback();
            var request = this.getRequestList(sendRequestsViaCallback);
            this.showLoadingPanelIfNeeded(request);
            this.control.sendRequest(JSON.stringify(request), sendRequestsViaCallback);
            if (!this.lockQueue)
                this.waitingTimerID = setTimeout(function () { return _this.onWaitingTimerExpired(); }, WAITING_TIMER);
            return true;
        };
        ServerDispatcher.prototype.showLoadingPanelIfNeeded = function (requestList) {
            for (var key in requestList) {
                if (!requestList.hasOwnProperty(key))
                    continue;
                var commandType = requestList[key][__aspxRichEdit.JSONCommandParametersProperty.CommandType];
                if (__aspxRichEdit.ServerCommandRequest.isUIBlockingCommandType(commandType)) {
                    this.control.owner.showLoadingElements();
                    return;
                }
            }
        };
        ServerDispatcher.prototype.shouldSendRequestsWithCallback = function () {
            return !!__aspxRichEdit.MapUtilsKeyAsString.anyOf(this.queue, function (val) { return val.processOnCallback; });
        };
        ServerDispatcher.prototype.getRequestList = function (withPostData) {
            return __aspxRichEdit.MapUtilsKeyAsNumber.toListBy(this.queue, function (val) { return val.getJsonObject(withPostData); }, MAX_COMMAND_REQUESTS);
        };
        ServerDispatcher.prototype.removeModelRequests = function () {
            var keysForDeleting = [];
            __aspxRichEdit.MapUtilsKeyAsNumber.foreach(this.queue, function (request, key) {
                if (!__aspxRichEdit.ServerCommandRequest.isEditRequest(request) &&
                    !request.isSpellCheckerRequest() &&
                    !request.isSaveDocumentRequest() &&
                    !request.isGetSetRtfRequest() &&
                    !request.isForcePushRerquest())
                    keysForDeleting.push(key);
            });
            for (var i = keysForDeleting.length - 1; i >= 0; i--)
                delete this.queue[keysForDeleting[i]];
        };
        ServerDispatcher.prototype.processCommandsResponce = function (commandResults) {
            if (!commandResults)
                return;
            for (var _i = 0, commandResults_1 = commandResults; _i < commandResults_1.length; _i++) {
                var jsonCommandResponce = commandResults_1[_i];
                var commandId = jsonCommandResponce[__aspxRichEdit.JSONCommandParametersProperty.IncId];
                if (commandId > 0 && !this.queue.hasOwnProperty(commandId.toString()))
                    continue;
                delete this.queue[commandId];
                var commandType = jsonCommandResponce[__aspxRichEdit.JSONCommandParametersProperty.CommandType];
                if (__aspxRichEdit.ServerCommandRequest.isUIBlockingCommandType(commandType))
                    this.control.owner.showLoadingElements();
                var isNewWorkSession = !!jsonCommandResponce[__aspxRichEdit.JSONCommandParametersProperty.IsNewWorkSession];
                var jsonServerParams = jsonCommandResponce[__aspxRichEdit.JSONCommandParametersProperty.ServerParams];
                var jsonCacheData = jsonCommandResponce[__aspxRichEdit.JSONCommandParametersProperty.Caches];
                __aspxRichEdit.ServerDispatcherResponseProcessor.processCommandResponce(this, commandType, isNewWorkSession, jsonServerParams, jsonCacheData);
            }
        };
        ServerDispatcher.prototype.onPendingTimerExpired = function () {
            this.sendRequestCore();
            this.pendingTimerID = -1;
        };
        ServerDispatcher.prototype.onWaitingTimerExpired = function () {
            this.sendRequestCore();
            this.waitingTimerID = -1;
        };
        return ServerDispatcher;
    }());
    __aspxRichEdit.ServerDispatcher = ServerDispatcher;
    var RequestParams = (function () {
        function RequestParams(lockQueue, immediateSend, processOnCallback) {
            if (lockQueue === void 0) { lockQueue = false; }
            if (immediateSend === void 0) { immediateSend = false; }
            if (processOnCallback === void 0) { processOnCallback = false; }
            this.lockQueue = false;
            this.immediateSend = false;
            this.processOnCallback = false;
            this.lockQueue = lockQueue;
            this.immediateSend = immediateSend;
            this.processOnCallback = processOnCallback;
        }
        return RequestParams;
    }());
    __aspxRichEdit.RequestParams = RequestParams;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var CommandManager = (function () {
        function CommandManager(control) {
            this.lastCommandsChain = [];
            this.executingCommandsChain = [];
            this.executingCommandCounter = 0;
            this.isPublicApiCall = false;
            this.commands = {};
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.AddSpacingAfterParagraph, __aspxRichEdit.AddSpacingAfterParagraphCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.AddSpacingBeforeParagraph, __aspxRichEdit.AddSpacingBeforeParagraphCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.CapitalizeEachWordTextCase, __aspxRichEdit.CapitalizeEachWordCaseCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeFontBackColor, __aspxRichEdit.ChangeFontHighlightColorCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeFontForeColor, __aspxRichEdit.ChangeFontColorCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeFontName, __aspxRichEdit.ChangeFontNameCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeFontSize, __aspxRichEdit.ChangeFontSizeCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeInlinePictureScale, __aspxRichEdit.ChangeInlinePictureScaleCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangePageColor, __aspxRichEdit.ChangePageColorCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeParagraphBackColor, __aspxRichEdit.ChangeParagraphBackColorCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeStyle, __aspxRichEdit.ApplyStyleCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ClearFormatting, __aspxRichEdit.ClearFormattingCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ContinueNumberingList, __aspxRichEdit.ContinueNumberingListCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.CopySelection, __aspxRichEdit.CopySelectionCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.CreateField, __aspxRichEdit.CreateFieldCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.CutSelection, __aspxRichEdit.CutSelectionCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.DecreaseFontSize, __aspxRichEdit.DecreaseFontSizeCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.DecreaseIndent, __aspxRichEdit.DecrementIndentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.DecrementNumberingIndent, __aspxRichEdit.DecrementNumberingIndentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.DecrementParagraphIndentFromFirstRow, __aspxRichEdit.DecrementParagraphIndentFromFirstRowCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.DecrementParagraphLeftIndent, __aspxRichEdit.DecrementParagraphLeftIndentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.DeleteNumerationFromParagraphs, __aspxRichEdit.DeleteNumerationFromParagraphsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.DeleteTabRuler, __aspxRichEdit.DeleteTabAtParagraphCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.DocumentEnd, __aspxRichEdit.GoToDocumentEndCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.DocumentStart, __aspxRichEdit.GoToDocumentStartCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.DragCopyContent, __aspxRichEdit.DragCopyContentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.DragMoveContent, __aspxRichEdit.DragMoveContentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ExtendDocumentEnd, __aspxRichEdit.ExtendGoToDocumentEndCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ExtendDocumentStart, __aspxRichEdit.ExtendGoToDocumentStartCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ExtendGoToEndParagraph, __aspxRichEdit.ExtendGoToParagraphEndCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ExtendGoToNextWord, __aspxRichEdit.ExtendGoToNextWordCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ExtendGoToPrevWord, __aspxRichEdit.ExtendGoToPrevWordCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ExtendGoToStartParagraph, __aspxRichEdit.ExtendGoToParagraphStartCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ExtendLineDown, __aspxRichEdit.ExtendLineDownCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ExtendLineEnd, __aspxRichEdit.ExtendGoToLineEndCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ExtendLineStart, __aspxRichEdit.ExtendGoToLineStartCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ExtendLineUp, __aspxRichEdit.ExtendGoToLineAboveCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ExtendNextCharacter, __aspxRichEdit.ExtendGoToNextCharacterCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ExtendNextPage, __aspxRichEdit.ExtendGoToNextPageCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ExtendPreviousCharacter, __aspxRichEdit.ExtendGoToPrevCharacterCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ExtendPreviousPage, __aspxRichEdit.ExtendGoToPrevPageCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ExtendSelectLine, __aspxRichEdit.ExtendSelectLineCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ExtendSelectLineNoUpdateControlState, __aspxRichEdit.ExtendSelectLineCommandNoUpdateControlState);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.FileNew, __aspxRichEdit.NewDocumentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.FileOpen, __aspxRichEdit.DialogOpenFileCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.FilePrint, __aspxRichEdit.PrintDocumentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.FileSave, __aspxRichEdit.SaveDocumentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.FileSaveAs, __aspxRichEdit.DialogSaveFileCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.FullScreen, __aspxRichEdit.ToggleFullScreenCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ForceSyncWithServer, __aspxRichEdit.ForceSyncWithServerCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.GoToEndParagraph, __aspxRichEdit.GoToParagraphEndCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.GoToNextWord, __aspxRichEdit.GoToNextWordCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.GoToPrevWord, __aspxRichEdit.GoToPrevWordCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.GoToFirstDataRecord, __aspxRichEdit.GoToFirstDataRecordCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.GoToPreviousDataRecord, __aspxRichEdit.GoToPreviousDataRecordCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.GoToNextDataRecord, __aspxRichEdit.GoToNextDataRecordCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.GoToLastDataRecord, __aspxRichEdit.GoToLastDataRecordCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.GoToStartParagraph, __aspxRichEdit.GoToParagraphStartCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.IncreaseFontSize, __aspxRichEdit.IncreaseFontSizeCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.IncreaseIndent, __aspxRichEdit.IncrementIndentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.IncrementNumberingIndent, __aspxRichEdit.IncrementNumberingIndentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.IncrementParagraphIndentFromFirstRow, __aspxRichEdit.IncrementParagraphIndentFromFirstRowCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.IncrementParagraphLeftIndent, __aspxRichEdit.IncrementParagraphLeftIndentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertColumnBreak, __aspxRichEdit.InsertColumnBreakCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertLineBreak, __aspxRichEdit.InsertLineBreakCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertNumerationToParagraphs, __aspxRichEdit.InsertNumerationToParagraphsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertPageBreak, __aspxRichEdit.InsertPageBreakCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertParagraph, __aspxRichEdit.InsertParagraphCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertPicture, __aspxRichEdit.DialogInsertImageCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertSectionBreakEvenPage, __aspxRichEdit.InsertSectionBreakEvenPageCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertSectionBreakNextPage, __aspxRichEdit.InsertSectionBreakNextPageCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertSectionBreakOddPage, __aspxRichEdit.InsertSectionBreakOddPageCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertShiftTabMark, __aspxRichEdit.InsertShiftTabCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertSpace, __aspxRichEdit.InsertSpaceCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertTabMark, __aspxRichEdit.InsertTabCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertTabRuler, __aspxRichEdit.InsertTabToParagraphCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertText, __aspxRichEdit.InsertTextCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.LineDown, __aspxRichEdit.LineDownCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.LineEnd, __aspxRichEdit.GoToLineEndCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.LineStart, __aspxRichEdit.GoToLineStartCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.LineUp, __aspxRichEdit.GoToLineAboveCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.MakeTextLowerCase, __aspxRichEdit.MakeTextLowerCaseCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.MakeTextUpperCase, __aspxRichEdit.MakeTextUpperCaseCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.MoveTabRuler, __aspxRichEdit.MoveTabRulerInParagraphCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.NextCharacter, __aspxRichEdit.GoToNextCharacterCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.NextPage, __aspxRichEdit.GoToNextPageCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.OpenHyperlink, __aspxRichEdit.OpenHyperlinkCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.PasteSelection, __aspxRichEdit.PasteSelectionCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.PreviousCharacter, __aspxRichEdit.GoToPrevCharacterCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.PreviousPage, __aspxRichEdit.GoToPrevPageCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.Redo, __aspxRichEdit.RedoCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ReloadDocument, __aspxRichEdit.ReloadDocumentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.RemoveHyperlink, __aspxRichEdit.RemoveHyperlinkCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.RemoveSpacingAfterParagraph, __aspxRichEdit.RemoveSpacingAfterParagraphCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.RemoveSpacingBeforeParagraph, __aspxRichEdit.RemoveSpacingBeforeParagraphCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.RestartNumberingList, __aspxRichEdit.RestartNumberingListCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.RulerParagraphLeftIndents, __aspxRichEdit.RulerParagraphLeftIndentsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.RulerParagraphRightIndent, __aspxRichEdit.RulerParagraphRightIndentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.RulerSectionColumnsSettings, __aspxRichEdit.RulerSectionColumnsSettingsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.RulerSectionMarginLeft, __aspxRichEdit.RulerSectionMarginLeftCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.RulerSectionMarginRight, __aspxRichEdit.RulerSectionMarginRightCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.RulerChangeTableColumnWidth, __aspxRichEdit.RulerChangeTableColumnWidthCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.RulerChangeTableRowHeight, __aspxRichEdit.RulerChangeTableRowHeightCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.RulerTableColumnSeparators, __aspxRichEdit.RulerTableColumnSeparatorsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SelectAll, __aspxRichEdit.SelectAllDocumentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SelectLine, __aspxRichEdit.SelectLineCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SelectLineNoUpdateControlState, __aspxRichEdit.SelectLineCommandNoUpdateControlState);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.AddSelectedLineCommandNoUpdateControlState, __aspxRichEdit.AddSelectedLineCommandNoUpdateControlState);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SelectParagraph, __aspxRichEdit.SelectParagraphCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetDoubleParagraphSpacing, __aspxRichEdit.SetDoubleParagraphSpacingCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetLandscapePageOrientation, __aspxRichEdit.SetLandscapePageOrientationCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetModerateSectionPageMargins, __aspxRichEdit.SetModerateSectionPageMarginsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetNarrowSectionPageMargins, __aspxRichEdit.SetNarrowSectionPageMarginsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetNormalSectionPageMargins, __aspxRichEdit.SetNormalSectionPageMarginsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetPortraitPageOrientation, __aspxRichEdit.SetPortraitPageOrientationCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetSectionA4PaperKind, __aspxRichEdit.SetSectionA4PaperKindCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetSectionA5PaperKind, __aspxRichEdit.SetSectionA5PaperKindCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetSectionA6PaperKind, __aspxRichEdit.SetSectionA6PaperKindCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetSectionB5PaperKind, __aspxRichEdit.SetSectionB5PaperKindCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetSectionExecutivePaperKind, __aspxRichEdit.SetSectionExecutivePaperKindCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetSectionFolioPaperKind, __aspxRichEdit.SetSectionFolioPaperKindCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetSectionLegalPaperKind, __aspxRichEdit.SetSectionLegalPaperKindCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetSectionLetterPaperKind, __aspxRichEdit.SetSectionLetterPaperKindCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetSectionOneColumn, __aspxRichEdit.SetSectionOneColumnCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetSectionThreeColumns, __aspxRichEdit.SetSectionThreeColumnsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetSectionTwoColumns, __aspxRichEdit.SetSectionTwoColumnsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetSesquialteralParagraphSpacing, __aspxRichEdit.SetSesquialteralParagraphSpacingCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetSingleParagraphSpacing, __aspxRichEdit.SetSingleParagraphSpacingCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetWideSectionPageMargins, __aspxRichEdit.SetWideSectionPageMarginsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowAllFieldCodes, __aspxRichEdit.ShowAllFieldCodesCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowAllFieldResults, __aspxRichEdit.ShowAllFieldResultCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowBookmarkForm, __aspxRichEdit.DialogBookmarksCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowColumnsSetupForm, __aspxRichEdit.DialogColumnsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowCustomNumberingListForm, __aspxRichEdit.DialogCustomNumberingListCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowEditHyperlinkForm, __aspxRichEdit.DialogEditHyperlinkCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowErrorAuthExceptionMessageCommand, __aspxRichEdit.ShowErrorAuthExceptionMessageCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowErrorClipboardAccessDeniedMessageCommand, __aspxRichEdit.ShowWarningClipboardAccessDeniedMessageCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowErrorDocVariableErrorCommand, __aspxRichEdit.ShowErrorDocVariableExceptionCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowInsertContentFromServerErrorDialogCommand, __aspxRichEdit.ShowInsertContentFromServerErrorDialogCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowErrorInnerExceptionMessageCommand, __aspxRichEdit.ShowErrorInnerExceptionMessageCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowErrorModelIsChangedMessageCommand, __aspxRichEdit.ShowErrorModelIsChangedMessageCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowErrorOpeningAndOverstoreImpossibleMessageCommand, __aspxRichEdit.ShowErrorOpeningAndOverstoreImpossibleMessageCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowErrorCantSaveToEmptyPathMessageCommand, __aspxRichEdit.ShowErrorCantSaveToEmptyPathMessageCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowErrorOpeningMessageCommand, __aspxRichEdit.ShowErrorCantOpenDocument);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowErrorSavingMessageCommand, __aspxRichEdit.ShowErrorCantSaveDocument);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowErrorPathTooLongCommand, __aspxRichEdit.ShowErrorPathTooLong);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowErrorSessionHasExpiredMessageCommand, __aspxRichEdit.ShowErrorSessionHasExpiredMessageCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowErrorInvalidDocumentFormat, __aspxRichEdit.ShowErrorInvalidDocumentMessageCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowFinishAndMergeForm, __aspxRichEdit.DialogFinishAndMergeCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowFontForm, __aspxRichEdit.DialogFontCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowHyperlinkForm, __aspxRichEdit.DialogCreateOrEditHyperlinkCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowInsertMergeFieldForm, __aspxRichEdit.DialogInsertMergeFieldCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowInsertTableForm, __aspxRichEdit.DialogInsertTableCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowNumberingListForm, __aspxRichEdit.DialogNumberingListCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowPageMarginsSetupForm, __aspxRichEdit.DialogPageSetupCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowPagePaperSetupForm, __aspxRichEdit.ShowPagePaperSetupFormCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowPageSetupForm, __aspxRichEdit.DialogPageSetupCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowParagraphForm, __aspxRichEdit.DialogParagraphPropertiesCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.Find, __aspxRichEdit.ShowQuickSearchPanelCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.Replace, __aspxRichEdit.DialogFindReplaceCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowSaveMergedDocumentForm, __aspxRichEdit.DialogSaveMergedDocumentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowServiceFontForm, __aspxRichEdit.DialogServiceFontCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowServiceSymbolsForm, __aspxRichEdit.DialogServiceSymbolsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowSymbolForm, __aspxRichEdit.DialogSymbolsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowTablePropertiesForm, __aspxRichEdit.DialogTablePropertiesCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowCellOptionsForm, __aspxRichEdit.DialogCellPropertiesCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowBorderShadingForm, __aspxRichEdit.DialogBorderShadingCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowServiceBorderShadingForm, __aspxRichEdit.DialogServiceBorderShadingCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowTabsForm, __aspxRichEdit.DialogTabsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleAllFields, __aspxRichEdit.ToggleAllFieldsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleBackspaceKey, __aspxRichEdit.BackspaceCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleBulletedListItem, __aspxRichEdit.ToggleBulletedListCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleDeleteKey, __aspxRichEdit.DeleteCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleFieldCodes, __aspxRichEdit.ToggleFieldCodesCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleFontDoubleUnderline, __aspxRichEdit.ToggleFontDoubleUnderlineCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleFontItalic, __aspxRichEdit.ToggleFontItalicCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleFontStrikeout, __aspxRichEdit.ToggleFontStrikeoutCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleFontSubscript, __aspxRichEdit.ToggleFontSubscriptCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleFontSuperscript, __aspxRichEdit.ToggleFontSuperscriptCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleFontUnderline, __aspxRichEdit.ToggleFontSingleUnderlineCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleMultilevelListItem, __aspxRichEdit.ToggleMultiLevelListCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleNumberingListItem, __aspxRichEdit.ToggleNumberingListCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleParagraphAlignmentCenter, __aspxRichEdit.ToggleParagraphAlignmentCenterCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleParagraphAlignmentJustify, __aspxRichEdit.ToggleParagraphAlignmentJustifyCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleParagraphAlignmentLeft, __aspxRichEdit.ToggleParagraphAlignmentLeftCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleParagraphAlignmentRight, __aspxRichEdit.ToggleParagraphAlignmentRightCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleShowHorizontalRuler, __aspxRichEdit.ToggleShowHorizontalRulerCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleShowWhitespace, __aspxRichEdit.ToggleShowHiddenSymbolsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleTextCase, __aspxRichEdit.ToggleTextCaseCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleViewMergedData, __aspxRichEdit.ToggleViewMergedDataCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.Undo, __aspxRichEdit.UndoCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.UpdateAllFields, __aspxRichEdit.UpdateAllFieldsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.UpdateField, __aspxRichEdit.UpdateFieldCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleFontBold, __aspxRichEdit.ToggleFontBoldCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertNonBreakingSpace, __aspxRichEdit.InsertNonBreakingSpaceCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.RemoveHyperlinks, __aspxRichEdit.RemoveHyperlinksCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.CreateDateField, __aspxRichEdit.CreateDateFieldCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.CreatePageField, __aspxRichEdit.CreatePageFieldCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.CreateTimeField, __aspxRichEdit.CreateTimeFieldCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.CreateMergeField, __aspxRichEdit.CreateMergeFieldCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowCreateHyperlinkForm, __aspxRichEdit.DialogCreateHyperlinkCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SentenceCase, __aspxRichEdit.SentenceCaseCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SwitchTextCase, __aspxRichEdit.SwitchTextCaseCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertHeader, __aspxRichEdit.InsertHeaderCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertFooter, __aspxRichEdit.InsertFooterCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.LinkHeaderFooterToPrevious, __aspxRichEdit.LinkHeaderFooterToPreviousCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.CreateBookmark, __aspxRichEdit.CreateBookmarkCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.DeleteBookmarks, __aspxRichEdit.DeleteBookmarksCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.GoToBookmark, __aspxRichEdit.GoToBookmarkCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ContextItem_HeadersFooters, __aspxRichEdit.ContextItemHeadersFooters);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ClosePageHeaderFooter, __aspxRichEdit.CloseHeaderFooterCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.GoToPageHeader, __aspxRichEdit.GoToHeaderCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.GoToPageFooter, __aspxRichEdit.GoToFooterCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.GoToNextPageHeaderFooter, __aspxRichEdit.GoToNextHeaderFooterCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.GoToPreviousPageHeaderFooter, __aspxRichEdit.GoToPreviousHeaderFooterCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleDifferentFirstPage, __aspxRichEdit.DifferentFirstPageHeaderFooterCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleDifferentOddAndEvenPages, __aspxRichEdit.DifferentOddEvenHeaderFooterCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeHeaderOffset, __aspxRichEdit.ChangeHeaderOffsetRibbonCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeFooterOffset, __aspxRichEdit.ChangeFooterOffsetRibbonCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertPageNumberField, __aspxRichEdit.CreatePageFieldCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertPageCountField, __aspxRichEdit.CreatePageCountFieldCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertTableCore, __aspxRichEdit.InsertTableCoreCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ContextItem_Tables, __aspxRichEdit.ContextItemTables);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertTableColumnToTheLeft, __aspxRichEdit.InsertTableColumnToTheLeftCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertTableColumnToTheRight, __aspxRichEdit.InsertTableColumnToTheRightCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertTableRowAbove, __aspxRichEdit.InsertTableRowAboveCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertTableRowBelow, __aspxRichEdit.InsertTableRowBelowCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.DeleteTableRows, __aspxRichEdit.DeleteTableRowsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.DeleteTableColumns, __aspxRichEdit.DeleteTableColumnsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertTableCellWithShiftToTheLeft, __aspxRichEdit.InsertTableCellWithShiftToTheLeftCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.DeleteTableCellsWithShiftToTheHorizontally, __aspxRichEdit.DeleteTableCellsWithShiftToTheHorizontallyCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.DeleteTable, __aspxRichEdit.DeleteTableCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.DeleteTableCellsByBackspace, __aspxRichEdit.DeleteTableCellsByBackspaceCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowInsertTableCellsForm, __aspxRichEdit.DialogInsertTableCellsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowDeleteTableCellsForm, __aspxRichEdit.DialogDeleteTableCellsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.MergeTableCells, __aspxRichEdit.MergeTableCellsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowSplitTableCellsForm, __aspxRichEdit.DialogSplitTableCellsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SplitTableCellsCommand, __aspxRichEdit.SplitTableCellsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertTableCellsWithShiftToTheVertically, __aspxRichEdit.InsertTableCellsWithShiftToTheVerticallyCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.DeleteTableCellsWithShiftToTheVertically, __aspxRichEdit.DeleteTableCellsWithShiftToTheVerticallyCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.TableCellAlignBottomCenter, __aspxRichEdit.ChangeTableCellBottomCenterAlignmentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.TableCellAlignBottomLeft, __aspxRichEdit.ChangeTableCellBottomLeftAlignmentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.TableCellAlignBottomRight, __aspxRichEdit.ChangeTableCellBottomRightAlignmentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.TableCellAlignMiddleCenter, __aspxRichEdit.ChangeTableCellMiddleCenterAlignmentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.TableCellAlignMiddleLeft, __aspxRichEdit.ChangeTableCellMiddleLeftAlignmentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.TableCellAlignMiddleRight, __aspxRichEdit.ChangeTableCellMiddleRightAlignmentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.TableCellAlignTopCenter, __aspxRichEdit.ChangeTableCellTopCenterAlignmentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.TableCellAlignTopLeft, __aspxRichEdit.ChangeTableCellTopLeftAlignmentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.TableCellAlignTopRight, __aspxRichEdit.ChangeTableCellTopRightAlignmentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ApplyTableStyle, __aspxRichEdit.ApplyTableStyleCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleTableCellAllBorders, __aspxRichEdit.ToggleTableCellAllBordersCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleTableCellInsideBorders, __aspxRichEdit.ToggleTableCellInsideBordersCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleTableCellInsideHorizontalBorders, __aspxRichEdit.ToggleTableCellInsideHorizontalBordersCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleTableCellInsideVerticalBorders, __aspxRichEdit.ToggleTableCellInsideVerticalBordersCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleTableCellNoBorder, __aspxRichEdit.ToggleTableCellNoBorderCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleTableCellOutsideBorders, __aspxRichEdit.ToggleTableCellOutsideBordersCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleTableCellsBottomBorder, __aspxRichEdit.ToggleTableCellsBottomBorderCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleTableCellsLeftBorder, __aspxRichEdit.ToggleTableCellsLeftBorderCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleTableCellsRightBorder, __aspxRichEdit.ToggleTableCellsRightBorderCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleTableCellsTopBorder, __aspxRichEdit.ToggleTableCellsTopBorderCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleFirstRow, __aspxRichEdit.ToggleFirstRowCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleLastRow, __aspxRichEdit.ToggleLastRowCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleFirstColumn, __aspxRichEdit.ToggleFirstColumnCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleLastColumn, __aspxRichEdit.ToggleLastColumnCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleBandedRows, __aspxRichEdit.ToggleBandedRowsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleBandedColumn, __aspxRichEdit.ToggleBandedColumnCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SelectTableCell, __aspxRichEdit.SelectTableCellCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SelectTableColumn, __aspxRichEdit.SelectTableColumnCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SelectTableRow, __aspxRichEdit.SelectTableRowCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SelectTable, __aspxRichEdit.SelectTableCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeTableBorderColorRepositoryItem, __aspxRichEdit.ChangeTableBorderColorRepositoryItemCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeTableBorderStyleRepositoryItem, __aspxRichEdit.ChangeTableBorderStyleRepositoryItemCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeTableBorderWidthRepositoryItem, __aspxRichEdit.ChangeTableBorderWidthRepositoryItemCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeTableCellShading, __aspxRichEdit.ChangeTableCellShadingCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ToggleShowTableGridLines, __aspxRichEdit.ToggleShowTableGridLinesCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ExtendSelectTableCell, __aspxRichEdit.ExtendSelectTableCellCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ExtendSelectTableColumn, __aspxRichEdit.ExtendSelectTableColumnCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ExtendSelectTableRow, __aspxRichEdit.ExtendSelectTableRowCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SelectTableCellsRange, __aspxRichEdit.SelectTableCellsRangeCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToMain, __aspxRichEdit.ChangeActiveSubDocumentToMainCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToHeaderFooterByPageIndex, __aspxRichEdit.ChangeActiveSubDocumentToHeaderFooterByPageIndexCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToHeaderFooterBySubDocument, __aspxRichEdit.ChangeActiveSubDocumentToHeaderFooterBySubDocumentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToTextBox, __aspxRichEdit.ChangeActiveSubDocumentToTextBoxCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetSectionPageSize, __aspxRichEdit.SetSectionPageSizeCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetSectionColumnCount, __aspxRichEdit.SetSectionColumnCountCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeTableRowHeight, __aspxRichEdit.ChangeTableRowHeightCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeTableCellWidth, __aspxRichEdit.ChangeTableCellWidthCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeTableColumnWidth, __aspxRichEdit.ChangeTableColumnWidthCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeTableLook, __aspxRichEdit.ChangeTableLookCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowSpellCheckerForm, __aspxRichEdit.DialogSpellCheckerCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.IgnoreSpellingError, __aspxRichEdit.IgnoreSpellingErrorCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.IgnoreAllSpellingErrors, __aspxRichEdit.IgnoreAllSpellingErrorsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.DeleteRepeatedWord, __aspxRichEdit.DeleteRepeatedWordCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.AddWordToDictionary, __aspxRichEdit.AddWordToDictionary);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeSpellingError, __aspxRichEdit.ChangeSpellingErrorCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeAllSpellingErrors, __aspxRichEdit.ChangeAllSpellingErrorsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowSpellingCheckCompletedMessage, __aspxRichEdit.ShowSpellingCheckCompletedCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.GoToDataRecord, __aspxRichEdit.GoToRecordCommandBase);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.FindAll, __aspxRichEdit.FindAllCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ReplaceNext, __aspxRichEdit.ReplaceNextCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ReplaceAll, __aspxRichEdit.ReplaceAllCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.HideFindResults, __aspxRichEdit.HideFindResultsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.Download, __aspxRichEdit.DownloadDocumentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.RemoveNextWord, __aspxRichEdit.RemoveNextWordCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.RemovePrevWord, __aspxRichEdit.RemovePrevWordCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.GoToStartNextPage, __aspxRichEdit.GoToStartNextPageCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.GoToStartPrevPage, __aspxRichEdit.GoToStartPrevPageCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ExtendGoToStartNextPage, __aspxRichEdit.ExtendGoToStartNextPageCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ExtendGoToStartPrevPage, __aspxRichEdit.ExtendGoToStartPrevPageCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.AssignShortcut, __aspxRichEdit.AssignShortcutCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetSectionPageMargins, __aspxRichEdit.SetSectionPageMarginsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowLayoutOptionsForm, __aspxRichEdit.DialogLayoutOptionsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetFloatingObjectSquareTextWrapType, __aspxRichEdit.SetFloatingObjectSquareTextWrapTypeCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetFloatingObjectTightTextWrapType, __aspxRichEdit.SetFloatingObjectTightTextWrapTypeCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetFloatingObjectThroughTextWrapType, __aspxRichEdit.SetFloatingObjectThroughTextWrapTypeCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetFloatingObjectTopAndBottomTextWrapType, __aspxRichEdit.SetFloatingObjectTopAndBottomTextWrapTypeCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetFloatingObjectBehindTextWrapType, __aspxRichEdit.SetFloatingObjectBehindTextWrapTypeCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetFloatingObjectInFrontOfTextWrapType, __aspxRichEdit.SetFloatingObjectInFrontOfTextWrapTypeCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetFloatingObjectInlineTextWrapType, __aspxRichEdit.SetFloatingObjectInlineTextWrapTypeCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetFloatingObjectTopLeftAlignment, __aspxRichEdit.SetFloatingObjectTopLeftAlignmentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetFloatingObjectTopCenterAlignment, __aspxRichEdit.SetFloatingObjectTopCenterAlignmentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetFloatingObjectTopRightAlignment, __aspxRichEdit.SetFloatingObjectTopRightAlignmentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetFloatingObjectMiddleLeftAlignment, __aspxRichEdit.SetFloatingObjectMiddleLeftAlignmentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetFloatingObjectMiddleCenterAlignment, __aspxRichEdit.SetFloatingObjectMiddleCenterAlignmentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetFloatingObjectMiddleRightAlignment, __aspxRichEdit.SetFloatingObjectMiddleRightAlignmentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetFloatingObjectBottomLeftAlignment, __aspxRichEdit.SetFloatingObjectBottomLeftAlignmentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetFloatingObjectBottomCenterAlignment, __aspxRichEdit.SetFloatingObjectBottomCenterAlignmentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetFloatingObjectBottomRightAlignment, __aspxRichEdit.SetFloatingObjectBottomRightAlignmentCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ContextItem_FloatingObjects, __aspxRichEdit.ContextItemFloatingObjects);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertAnchoredTextBox, __aspxRichEdit.InsertAnchoredTextBoxCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.FloatingObjectBringForward, __aspxRichEdit.FloatingObjectBringForwardCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.FloatingObjectBringToFront, __aspxRichEdit.FloatingObjectBringToFrontCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.FloatingObjectBringInFrontOfText, __aspxRichEdit.FloatingObjectBringInFrontOfTextCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.FloatingObjectSendBackward, __aspxRichEdit.FloatingObjectSendBackwardCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.FloatingObjectSendToBack, __aspxRichEdit.FloatingObjectSendToBackCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.FloatingObjectSendBehindText, __aspxRichEdit.FloatingObjectSendBehindTextCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeFloatingObjectFillColor, __aspxRichEdit.ChangeShapeFillColorCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeFloatingObjectOutlineColor, __aspxRichEdit.ChangeShapeOutlineColorCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeFloatingObjectOutlineWidth, __aspxRichEdit.ChangeShapeOutlineWidthCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeFloatingObjectShape, __aspxRichEdit.ChangeFloatingObjectShapeCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeTextBoxProperties, __aspxRichEdit.ChangeTextBoxPropertiesCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.CreateEmptyMergeField, __aspxRichEdit.CreateEmptyMergeFieldCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.CreateEmptyDocVariableField, __aspxRichEdit.CreateEmptyDocVariableFieldCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.FloatingObjectDragDropChangePosition, __aspxRichEdit.FloatingObjectDragDropChangePositionCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertHtml, __aspxRichEdit.InsertHtmlCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.CreateTocField, __aspxRichEdit.CreateTocFieldCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.CreateTableOfEquationsField, __aspxRichEdit.CreateTableOfEquationsFieldCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.CreateTableOfFiguresField, __aspxRichEdit.CreateTableOfFiguresFieldCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.CreateTableOfTablesField, __aspxRichEdit.CreateTableOfTablesFieldCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.CreateEquationCaptionField, __aspxRichEdit.CreateEquationCaptionFieldCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.CreateFigureCaptionField, __aspxRichEdit.CreateFigureCaptionFieldCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.CreateTableCaptionField, __aspxRichEdit.CreateTableCaptionFieldCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.UpdateTableOfContents, __aspxRichEdit.UpdateTableOfContentsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetParagraphBodyTextLevel, __aspxRichEdit.SetParagraphBodyTextLevelCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetParagraphHeading1Level, __aspxRichEdit.SetParagraphHeading1LevelCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetParagraphHeading2Level, __aspxRichEdit.SetParagraphHeading2LevelCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetParagraphHeading3Level, __aspxRichEdit.SetParagraphHeading3LevelCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetParagraphHeading4Level, __aspxRichEdit.SetParagraphHeading4LevelCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetParagraphHeading5Level, __aspxRichEdit.SetParagraphHeading5LevelCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetParagraphHeading6Level, __aspxRichEdit.SetParagraphHeading6LevelCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetParagraphHeading7Level, __aspxRichEdit.SetParagraphHeading7LevelCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetParagraphHeading8Level, __aspxRichEdit.SetParagraphHeading8LevelCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetParagraphHeading9Level, __aspxRichEdit.SetParagraphHeading9LevelCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeHeadingLevel, __aspxRichEdit.ChangeHeadingLevelCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetParagraphLevel, __aspxRichEdit.SetParagraphLevelCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.CreateFieldWithCode, __aspxRichEdit.CreateFieldWithCodeCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeHyperlink, __aspxRichEdit.ChangeHyperlinkCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetAutoFitContents, __aspxRichEdit.AutoFitContentsCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetAutoFitWindow, __aspxRichEdit.AutoFitWindowCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SetFixedColumnWidth, __aspxRichEdit.FixedColumnWidthCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertRtf, __aspxRichEdit.InsertRtfCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.GetRtf, __aspxRichEdit.GetRtfCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.InsertContentFromServer, __aspxRichEdit.InsertContentFromServerCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ChangeViewType, __aspxRichEdit.ChangeViewTypeCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SwitchToSimpleView, __aspxRichEdit.SwitchToSimpleViewCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.SwitchToPrintLayoutView, __aspxRichEdit.SwitchToPrintLayoutViewCommand);
            this.createCommand(control, __aspxRichEdit.RichEditClientCommand.ShowErrorLoadPictureMessage, __aspxRichEdit.ShowLoadPictureErrorDialogCommand);
        }
        CommandManager.prototype.getCommand = function (key) {
            return this.commands[key];
        };
        CommandManager.prototype.beforeExecuting = function (command) {
            this.executingCommandsChain.push(command);
            this.executingCommandCounter++;
        };
        CommandManager.prototype.afterExecuting = function () {
            this.executingCommandCounter--;
            if (this.executingCommandCounter === 0) {
                this.lastCommandsChain = this.executingCommandsChain;
                this.executingCommandsChain = [];
            }
        };
        CommandManager.prototype.assertLastExecutedCommandsChain = function (checkLength) {
            var types = [];
            for (var _i = 1; _i < arguments.length; _i++) {
                types[_i - 1] = arguments[_i];
            }
            if (checkLength && this.lastCommandsChain.length !== types.length)
                return false;
            for (var i = 0, type; type = types[i]; i++) {
                if (!this.lastCommandsChain[i] || !(this.lastCommandsChain[i] instanceof type))
                    return false;
            }
            return true;
        };
        CommandManager.prototype.NotifySelectionChanged = function (_selection) {
            this.lastCommandsChain = [];
        };
        CommandManager.prototype.NotifyScrollPositionChanged = function () { };
        CommandManager.prototype.createCommand = function (control, commandId, commandType) {
            this.commands[commandId] = new commandType(control);
        };
        return CommandManager;
    }());
    __aspxRichEdit.CommandManager = CommandManager;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var REWebUtils;
(function (REWebUtils) {
    var Str = (function () {
        function Str() {
        }
        Str.TrimStart = function (str) {
            return Str.trimInternal(str, true, false);
        };
        Str.TrimEnd = function (str) {
            return Str.trimInternal(str, false, true);
        };
        Str.Trim = function (str) {
            return Str.trimInternal(str, true, true);
        };
        Str.EncodeHtml = function (html) {
            return Str.ApplyReplacement(html, [
                [/&amp;/g, '&ampx;'], [/&/g, '&amp;'],
                [/&quot;/g, '&quotx;'], [/"/g, '&quot;'],
                [/&lt;/g, '&ltx;'], [/</g, '&lt;'],
                [/&gt;/g, '&gtx;'], [/>/g, '&gt;']
            ]);
        };
        Str.trimInternal = function (source, trimStart, trimEnd) {
            var len = source.length;
            if (!len)
                return source;
            if (len < 0xBABA1) {
                var result = source;
                if (trimStart) {
                    result = result.replace(/^\s+/, "");
                }
                if (trimEnd) {
                    result = result.replace(/\s+$/, "");
                }
                return result;
            }
            else {
                var start = 0;
                if (trimEnd) {
                    while (len > 0 && Str.whiteSpaces[source.charCodeAt(len - 1)]) {
                        len--;
                    }
                }
                if (trimStart && len > 0) {
                    while (start < len && Str.whiteSpaces[source.charCodeAt(start)]) {
                        start++;
                    }
                }
                return source.substring(start, len);
            }
        };
        Str.ApplyReplacement = function (text, replecementTable) {
            for (var i = 0; i < replecementTable.length; i++) {
                var replacement = replecementTable[i];
                text = text.replace(replacement[0], replacement[1]);
            }
            return text;
        };
        Str.DecodeHtmlViaTextArea = function (html) {
            var textArea = document.createElement("TEXTAREA");
            REWebUtils.setInnerHtmlInternal(textArea, html);
            return textArea.value;
        };
        Str.whiteSpaces = {
            0x0009: 1, 0x000a: 1, 0x000b: 1, 0x000c: 1, 0x000d: 1, 0x0020: 1, 0x0085: 1,
            0x00a0: 1, 0x1680: 1, 0x180e: 1, 0x2000: 1, 0x2001: 1, 0x2002: 1, 0x2003: 1,
            0x2004: 1, 0x2005: 1, 0x2006: 1, 0x2007: 1, 0x2008: 1, 0x2009: 1, 0x200a: 1,
            0x200b: 1, 0x2028: 1, 0x2029: 1, 0x202f: 1, 0x205f: 1, 0x3000: 1
        };
        return Str;
    }());
    REWebUtils.Str = Str;
})(REWebUtils || (REWebUtils = {}));
var REWebUtils;
(function (REWebUtils) {
    var Evt = (function () {
        function Evt() {
        }
        Evt.GetEvent = function (evt) {
            return (typeof (event) != "undefined" && event != null && REWebUtils.Browser.IE) ? event : evt;
        };
        Evt.AttachEventToElement = function (element, eventName, handler, onlyBubbling) {
            if (onlyBubbling === void 0) { onlyBubbling = false; }
            if (element.addEventListener)
                element.addEventListener(eventName, handler, !onlyBubbling);
            else
                element.attachEvent("on" + eventName, handler);
        };
        Evt.AttachEventToDocument = function (eventName, handler) {
            var attachingAllowed = REWebUtils.TouchUIHelper.onEventAttachingToDocument(eventName, handler);
            if (attachingAllowed)
                Evt.AttachEventToElement(document, eventName, handler);
        };
        Evt.PreventEvent = function (evt) {
            if (evt.preventDefault)
                evt.preventDefault();
            else
                evt.returnValue = false;
            return false;
        };
        Evt.GetKeyCode = function (evt) {
            return REWebUtils.Browser.NetscapeFamily || REWebUtils.Browser.Opera ? evt.which : evt.keyCode;
        };
        Evt.GetEventSource = function (evt) {
            if (!REWebUtils.IsExists(evt))
                return null;
            return evt.srcElement ? evt.srcElement : evt.target;
        };
        Evt.GetMouseWheelEventName = function () {
            if (REWebUtils.Browser.Safari)
                return "mousewheel";
            if (REWebUtils.Browser.NetscapeFamily && REWebUtils.Browser.MajorVersion < 17)
                return "DOMMouseScroll";
            return "wheel";
        };
        Evt.IsLeftButtonPressed = function (evt) {
            if (REWebUtils.TouchUIHelper.isTouchEvent(evt))
                return true;
            evt = Evt.GetEvent(evt);
            if (!evt)
                return false;
            if (REWebUtils.Browser.IE && REWebUtils.Browser.Version < 11) {
                if (REWebUtils.Browser.MSTouchUI)
                    return true;
                return evt.button % 2 == 1;
            }
            else if (REWebUtils.Browser.WebKitFamily) {
                if (evt.type === "pointermove")
                    return evt.buttons === 1;
                return evt.which == 1;
            }
            else if (REWebUtils.Browser.NetscapeFamily || REWebUtils.Browser.Edge || (REWebUtils.Browser.IE && REWebUtils.Browser.Version >= 11)) {
                if (evt.type === REWebUtils.TouchUIHelper.touchMouseMoveEventName)
                    return evt.buttons === 1;
                return evt.which == 1;
            }
            else if (REWebUtils.Browser.Opera)
                return evt.button == 0;
            return true;
        };
        Evt.PreventEventAndBubble = function (evt) {
            Evt.PreventEvent(evt);
            if (evt.stopPropagation)
                evt.stopPropagation();
            evt.cancelBubble = true;
            return false;
        };
        Evt.clientEventRequiresDocScrollCorrection = function () {
            var isSafariVerLess3 = REWebUtils.Browser.Safari && REWebUtils.Browser.Version < 3, isMacOSMobileVerLess51 = REWebUtils.Browser.MacOSMobilePlatform && REWebUtils.Browser.Version < 5.1;
            return REWebUtils.Browser.AndroidDefaultBrowser || REWebUtils.Browser.AndroidChromeBrowser || !(isSafariVerLess3 || isMacOSMobileVerLess51);
        };
        Evt.GetEventX = function (evt) {
            if (REWebUtils.TouchUIHelper.isTouchEvent(evt))
                return REWebUtils.TouchUIHelper.getEventX(evt);
            return evt.clientX + (Evt.clientEventRequiresDocScrollCorrection() ? REWebUtils.GetDocumentScrollLeft() : 0);
        };
        Evt.GetEventY = function (evt) {
            if (REWebUtils.TouchUIHelper.isTouchEvent(evt))
                return REWebUtils.TouchUIHelper.getEventY(evt);
            return evt.clientY + (Evt.clientEventRequiresDocScrollCorrection() ? REWebUtils.GetDocumentScrollTop() : 0);
        };
        Evt.CancelBubble = function (evt) {
            evt.cancelBubble = true;
            return false;
        };
        return Evt;
    }());
    REWebUtils.Evt = Evt;
})(REWebUtils || (REWebUtils = {}));
var REWebUtils;
(function (REWebUtils) {
    var Browser = (function () {
        function Browser() {
        }
        Browser.IdentUserAgent = function (userAgent, ignoreDocumentMode) {
            if (ignoreDocumentMode === void 0) { ignoreDocumentMode = false; }
            var browserTypesOrderedList = ["Mozilla", "IE", "Firefox", "Netscape", "Safari", "Chrome", "Opera", "Opera10", "Edge"];
            var defaultBrowserType = "IE";
            var defaultPlatform = "Win";
            var defaultVersions = { Safari: 2, Chrome: 0.1, Mozilla: 1.9, Netscape: 8, Firefox: 2, Opera: 9, IE: 6, Edge: 12 };
            if (!userAgent || userAgent.length == 0) {
                Browser.fillUserAgentInfo(browserTypesOrderedList, defaultBrowserType, defaultVersions[defaultBrowserType], defaultPlatform);
                return;
            }
            userAgent = userAgent.toLowerCase();
            Browser.indentPlatformMajorVersion(userAgent);
            try {
                var platformIdentStrings = {
                    "Windows": "Win",
                    "Macintosh": "Mac",
                    "Mac OS": "Mac",
                    "Mac_PowerPC": "Mac",
                    "cpu os": "MacMobile",
                    "cpu iphone os": "MacMobile",
                    "Android": "Android",
                    "!Windows Phone": "WinPhone",
                    "!WPDesktop": "WinPhone",
                    "!ZuneWP": "WinPhone"
                };
                var optSlashOrSpace = "(?:/|\\s*)?";
                var versionString = "(\\d+)(?:\\.((?:\\d+?[1-9])|\\d)0*?)?";
                var optVersion = "(?:" + versionString + ")?";
                var patterns = {
                    Safari: "applewebkit(?:.*?(?:version/" + versionString + "[\\.\\w\\d]*?(?:\\s+mobile\/\\S*)?\\s+safari))?",
                    Chrome: "(?:chrome|crios)(?!frame)" + optSlashOrSpace + optVersion,
                    Mozilla: "mozilla(?:.*rv:" + optVersion + ".*Gecko)?",
                    Netscape: "(?:netscape|navigator)\\d*/?\\s*" + optVersion,
                    Firefox: "firefox" + optSlashOrSpace + optVersion,
                    Opera: "(?:opera|\sopr)" + optSlashOrSpace + optVersion,
                    Opera10: "opera.*\\s*version" + optSlashOrSpace + optVersion,
                    IE: "msie\\s*" + optVersion,
                    Edge: "edge" + optSlashOrSpace + optVersion
                };
                var browserType;
                var version = -1;
                for (var i = 0; i < browserTypesOrderedList.length; i++) {
                    var browserTypeCandidate = browserTypesOrderedList[i];
                    var regExp = new RegExp(patterns[browserTypeCandidate], "i");
                    if (regExp.compile)
                        regExp.compile(patterns[browserTypeCandidate], "i");
                    var matches = regExp.exec(userAgent);
                    if (matches && matches.index >= 0) {
                        if (browserType == "IE" && version >= 11 && browserTypeCandidate == "Safari")
                            continue;
                        browserType = browserTypeCandidate;
                        if (browserType == "Opera10")
                            browserType = "Opera";
                        var tridentPattern = "trident" + optSlashOrSpace + optVersion;
                        version = Browser.GetBrowserVersion(userAgent, matches, tridentPattern, Browser.getIECompatibleVersionString());
                        if (browserType == "Mozilla" && version >= 11)
                            browserType = "IE";
                    }
                }
                if (!browserType)
                    browserType = defaultBrowserType;
                var browserVersionDetected = version != -1;
                if (!browserVersionDetected)
                    version = defaultVersions[browserType];
                var platform;
                var minOccurenceIndex = Number.MAX_VALUE;
                for (var identStr in platformIdentStrings) {
                    if (!platformIdentStrings.hasOwnProperty(identStr))
                        continue;
                    var importantIdent = identStr.substr(0, 1) == "!";
                    var occurenceIndex = userAgent.indexOf((importantIdent ? identStr.substr(1) : identStr).toLowerCase());
                    if (occurenceIndex >= 0 && (occurenceIndex < minOccurenceIndex || importantIdent)) {
                        minOccurenceIndex = importantIdent ? 0 : occurenceIndex;
                        platform = platformIdentStrings[identStr];
                    }
                }
                var samsungPattern = "SM-[A-Z]";
                var m = userAgent.toUpperCase().match(samsungPattern);
                var isSamsungAndroidDevice = m && m.length > 0;
                if (platform == "WinPhone" && version < 9)
                    version = Math.floor(Browser.getVersionFromTrident(userAgent, "trident" + optSlashOrSpace + optVersion));
                if (!ignoreDocumentMode && browserType == "IE" && version > 7 && document.documentMode < version)
                    version = document.documentMode;
                if (platform == "WinPhone")
                    version = Math.max(9, version);
                if (!platform)
                    platform = defaultPlatform;
                if (platform == platformIdentStrings["cpu os"] && !browserVersionDetected)
                    version = 4;
                Browser.fillUserAgentInfo(browserTypesOrderedList, browserType, version, platform, isSamsungAndroidDevice);
            }
            catch (e) {
                Browser.fillUserAgentInfo(browserTypesOrderedList, defaultBrowserType, defaultVersions[defaultBrowserType], defaultPlatform);
            }
        };
        Browser.GetBrowserVersion = function (userAgent, matches, tridentPattern, ieCompatibleVersionString) {
            var version = Browser.getVersionFromMatches(matches);
            if (ieCompatibleVersionString) {
                var versionFromTrident = Browser.getVersionFromTrident(userAgent, tridentPattern);
                if (ieCompatibleVersionString === "edge" || parseInt(ieCompatibleVersionString) === versionFromTrident)
                    return versionFromTrident;
            }
            return version;
        };
        Browser.getIECompatibleVersionString = function () {
            if (document.compatible) {
                for (var i = 0; i < document.compatible.length; i++)
                    if (document.compatible[i].userAgent === "IE" && document.compatible[i].version)
                        return document.compatible[i].version.toLowerCase();
            }
            return "";
        };
        Browser.fillUserAgentInfo = function (browserTypesOrderedList, browserType, version, platform, isSamsungAndroidDevice) {
            if (isSamsungAndroidDevice === void 0) { isSamsungAndroidDevice = false; }
            for (var i = 0; i < browserTypesOrderedList.length; i++) {
                var type = browserTypesOrderedList[i];
                Browser[type] = type == browserType;
            }
            Browser.Version = Math.floor(10.0 * version) / 10.0;
            Browser.MajorVersion = Math.floor(Browser.Version);
            Browser.WindowsPlatform = platform == "Win" || platform == "WinPhone";
            Browser.MacOSPlatform = platform == "Mac";
            Browser.MacOSMobilePlatform = platform == "MacMobile";
            Browser.AndroidMobilePlatform = platform == "Android";
            Browser.WindowsPhonePlatform = platform == "WinPhone";
            Browser.WebKitFamily = Browser.Safari || Browser.Chrome || Browser.Opera && Browser.MajorVersion >= 15;
            Browser.NetscapeFamily = Browser.Netscape || Browser.Mozilla || Browser.Firefox;
            Browser.HardwareAcceleration = (Browser.IE && Browser.MajorVersion >= 9) || (Browser.Firefox && Browser.MajorVersion >= 4) ||
                (Browser.AndroidMobilePlatform && Browser.Chrome) || (Browser.Chrome && Browser.MajorVersion >= 37) ||
                (Browser.Safari && !Browser.WindowsPlatform) || Browser.Edge || (Browser.Opera && Browser.MajorVersion >= 46);
            Browser.WebKitTouchUI = Browser.MacOSMobilePlatform || Browser.AndroidMobilePlatform;
            var isIETouchUI = Browser.IE && Browser.MajorVersion > 9 && Browser.WindowsPlatform && Browser.UserAgent.toLowerCase().indexOf("touch") >= 0;
            Browser.MSTouchUI = isIETouchUI || (Browser.Edge && !!window.navigator.maxTouchPoints);
            Browser.TouchUI = Browser.WebKitTouchUI || Browser.MSTouchUI;
            Browser.MobileUI = Browser.WebKitTouchUI || Browser.WindowsPhonePlatform;
            Browser.AndroidDefaultBrowser = Browser.AndroidMobilePlatform && !Browser.Chrome;
            Browser.AndroidChromeBrowser = Browser.AndroidMobilePlatform && Browser.Chrome;
            if (isSamsungAndroidDevice)
                Browser.SamsungAndroidDevice = isSamsungAndroidDevice;
            if (Browser.MSTouchUI) {
                var isARMArchitecture = Browser.UserAgent.toLowerCase().indexOf("arm;") > -1;
                Browser.VirtualKeyboardSupported = isARMArchitecture || Browser.WindowsPhonePlatform;
            }
            else {
                Browser.VirtualKeyboardSupported = Browser.WebKitTouchUI;
            }
            Browser.fillDocumentElementBrowserTypeClassNames(browserTypesOrderedList);
        };
        Browser.indentPlatformMajorVersion = function (userAgent) {
            var regex = /(?:(?:windows nt|macintosh|mac os|cpu os|cpu iphone os|android|windows phone|linux) )(\d+)(?:[-0-9_.])*/;
            var matches = regex.exec(userAgent);
            if (matches)
                Browser.PlaformMajorVersion = matches[1];
        };
        Browser.prototype.GetBrowserVersion = function (userAgent, matches, tridentPattern, ieCompatibleVersionString) {
            var version = Browser.getVersionFromMatches(matches);
            if (ieCompatibleVersionString) {
                var versionFromTrident = Browser.getVersionFromTrident(userAgent, tridentPattern);
                if (ieCompatibleVersionString === "edge" || parseInt(ieCompatibleVersionString) === versionFromTrident)
                    return versionFromTrident;
            }
            return version;
        };
        Browser.getVersionFromMatches = function (matches) {
            var result = -1;
            var versionStr = "";
            if (matches[1]) {
                versionStr += matches[1];
                if (matches[2])
                    versionStr += "." + matches[2];
            }
            if (versionStr != "") {
                result = parseFloat(versionStr);
                if (isNaN(result))
                    result = -1;
            }
            return result;
        };
        Browser.getVersionFromTrident = function (userAgent, tridentPattern) {
            var tridentDiffFromVersion = 4;
            var matches = new RegExp(tridentPattern, "i").exec(userAgent);
            return Browser.getVersionFromMatches(matches) + tridentDiffFromVersion;
        };
        Browser.fillDocumentElementBrowserTypeClassNames = function (browserTypesOrderedList) {
            var documentElementClassName = "";
            var browserTypeslist = browserTypesOrderedList.concat(["WindowsPlatform", "MacOSPlatform", "MacOSMobilePlatform", "AndroidMobilePlatform",
                "WindowsPhonePlatform", "WebKitFamily", "WebKitTouchUI", "MSTouchUI", "TouchUI", "AndroidDefaultBrowser"]);
            for (var i = 0; i < browserTypeslist.length; i++) {
                var type = browserTypeslist[i];
                if (Browser[type])
                    documentElementClassName += "dx" + type + " ";
            }
            documentElementClassName += "dxBrowserVersion-" + Browser.MajorVersion;
            if (document && document.documentElement) {
                if (document.documentElement.className != "")
                    documentElementClassName = " " + documentElementClassName;
                document.documentElement.className += documentElementClassName;
                Browser.Info = documentElementClassName;
            }
        };
        Browser.UserAgent = navigator.userAgent.toLowerCase();
        Browser._foo = Browser.IdentUserAgent(Browser.UserAgent);
        return Browser;
    }());
    REWebUtils.Browser = Browser;
})(REWebUtils || (REWebUtils = {}));
var REWebUtils;
(function (REWebUtils) {
    var TouchUIHelper = (function () {
        function TouchUIHelper() {
        }
        TouchUIHelper.onEventAttachingToDocument = function (eventName, func) {
            if (REWebUtils.Browser.MacOSMobilePlatform && TouchUIHelper.isTouchEventName(eventName)) {
                if (!TouchUIHelper.documentTouchHandlers[eventName])
                    TouchUIHelper.documentTouchHandlers[eventName] = [];
                TouchUIHelper.documentTouchHandlers[eventName].push(func);
                return TouchUIHelper.documentEventAttachingAllowed;
            }
            return true;
        };
        TouchUIHelper.isTouchEventName = function (eventName) {
            return REWebUtils.Browser.WebKitTouchUI && (eventName.indexOf("touch") > -1 || eventName.indexOf("gesture") > -1);
        };
        TouchUIHelper.isTouchEvent = function (evt) {
            if (!evt)
                return false;
            return REWebUtils.Browser.WebKitTouchUI && REWebUtils.IsExists(evt.changedTouches);
        };
        TouchUIHelper.getEventX = function (evt) {
            return REWebUtils.Browser.IE ? evt.pageX : evt.changedTouches[0].pageX;
        };
        TouchUIHelper.getEventY = function (evt) {
            return REWebUtils.Browser.IE ? evt.pageY : evt.changedTouches[0].pageY;
        };
        TouchUIHelper.touchMouseDownEventName = REWebUtils.Browser.WebKitTouchUI ? "touchstart" : (REWebUtils.Browser.Edge && REWebUtils.Browser.MSTouchUI && window.PointerEvent ? "pointerdown" : "mousedown");
        TouchUIHelper.touchMouseUpEventName = REWebUtils.Browser.WebKitTouchUI ? "touchend" : (REWebUtils.Browser.Edge && REWebUtils.Browser.MSTouchUI && window.PointerEvent ? "pointerup" : "mouseup");
        TouchUIHelper.touchMouseMoveEventName = REWebUtils.Browser.WebKitTouchUI ? "touchmove" : (REWebUtils.Browser.Edge && REWebUtils.Browser.MSTouchUI && window.PointerEvent ? "pointermove" : "mousemove");
        TouchUIHelper.msTouchDraggableClassName = "dxMSTouchDraggable";
        TouchUIHelper.documentTouchHandlers = {};
        TouchUIHelper.documentEventAttachingAllowed = true;
        return TouchUIHelper;
    }());
    REWebUtils.TouchUIHelper = TouchUIHelper;
})(REWebUtils || (REWebUtils = {}));
var REWebUtils;
(function (REWebUtils) {
    var ModifierKey;
    (function (ModifierKey) {
        ModifierKey[ModifierKey["None"] = 0] = "None";
        ModifierKey[ModifierKey["Ctrl"] = 65536] = "Ctrl";
        ModifierKey[ModifierKey["Shift"] = 262144] = "Shift";
        ModifierKey[ModifierKey["Alt"] = 1048576] = "Alt";
        ModifierKey[ModifierKey["Meta"] = 16777216] = "Meta";
    })(ModifierKey = REWebUtils.ModifierKey || (REWebUtils.ModifierKey = {}));
    var KeyCode;
    (function (KeyCode) {
        KeyCode[KeyCode["Backspace"] = 8] = "Backspace";
        KeyCode[KeyCode["Tab"] = 9] = "Tab";
        KeyCode[KeyCode["Enter"] = 13] = "Enter";
        KeyCode[KeyCode["Pause"] = 19] = "Pause";
        KeyCode[KeyCode["CapsLock"] = 20] = "CapsLock";
        KeyCode[KeyCode["Esc"] = 27] = "Esc";
        KeyCode[KeyCode["Space"] = 32] = "Space";
        KeyCode[KeyCode["PageUp"] = 33] = "PageUp";
        KeyCode[KeyCode["PageDown"] = 34] = "PageDown";
        KeyCode[KeyCode["End"] = 35] = "End";
        KeyCode[KeyCode["Home"] = 36] = "Home";
        KeyCode[KeyCode["Left"] = 37] = "Left";
        KeyCode[KeyCode["Up"] = 38] = "Up";
        KeyCode[KeyCode["Right"] = 39] = "Right";
        KeyCode[KeyCode["Down"] = 40] = "Down";
        KeyCode[KeyCode["Insert"] = 45] = "Insert";
        KeyCode[KeyCode["Delete"] = 46] = "Delete";
        KeyCode[KeyCode["Key_0"] = 48] = "Key_0";
        KeyCode[KeyCode["Key_1"] = 49] = "Key_1";
        KeyCode[KeyCode["Key_2"] = 50] = "Key_2";
        KeyCode[KeyCode["Key_3"] = 51] = "Key_3";
        KeyCode[KeyCode["Key_4"] = 52] = "Key_4";
        KeyCode[KeyCode["Key_5"] = 53] = "Key_5";
        KeyCode[KeyCode["Key_6"] = 54] = "Key_6";
        KeyCode[KeyCode["Key_7"] = 55] = "Key_7";
        KeyCode[KeyCode["Key_8"] = 56] = "Key_8";
        KeyCode[KeyCode["Key_9"] = 57] = "Key_9";
        KeyCode[KeyCode["Key_a"] = 65] = "Key_a";
        KeyCode[KeyCode["Key_b"] = 66] = "Key_b";
        KeyCode[KeyCode["Key_c"] = 67] = "Key_c";
        KeyCode[KeyCode["Key_d"] = 68] = "Key_d";
        KeyCode[KeyCode["Key_e"] = 69] = "Key_e";
        KeyCode[KeyCode["Key_f"] = 70] = "Key_f";
        KeyCode[KeyCode["Key_g"] = 71] = "Key_g";
        KeyCode[KeyCode["Key_h"] = 72] = "Key_h";
        KeyCode[KeyCode["Key_i"] = 73] = "Key_i";
        KeyCode[KeyCode["Key_j"] = 74] = "Key_j";
        KeyCode[KeyCode["Key_k"] = 75] = "Key_k";
        KeyCode[KeyCode["Key_l"] = 76] = "Key_l";
        KeyCode[KeyCode["Key_m"] = 77] = "Key_m";
        KeyCode[KeyCode["Key_n"] = 78] = "Key_n";
        KeyCode[KeyCode["Key_o"] = 79] = "Key_o";
        KeyCode[KeyCode["Key_p"] = 80] = "Key_p";
        KeyCode[KeyCode["Key_q"] = 81] = "Key_q";
        KeyCode[KeyCode["Key_r"] = 82] = "Key_r";
        KeyCode[KeyCode["Key_s"] = 83] = "Key_s";
        KeyCode[KeyCode["Key_t"] = 84] = "Key_t";
        KeyCode[KeyCode["Key_u"] = 85] = "Key_u";
        KeyCode[KeyCode["Key_v"] = 86] = "Key_v";
        KeyCode[KeyCode["Key_w"] = 87] = "Key_w";
        KeyCode[KeyCode["Key_x"] = 88] = "Key_x";
        KeyCode[KeyCode["Key_y"] = 89] = "Key_y";
        KeyCode[KeyCode["Key_z"] = 90] = "Key_z";
        KeyCode[KeyCode["Windows"] = 91] = "Windows";
        KeyCode[KeyCode["ContextMenu"] = 93] = "ContextMenu";
        KeyCode[KeyCode["Numpad_0"] = 96] = "Numpad_0";
        KeyCode[KeyCode["Numpad_1"] = 97] = "Numpad_1";
        KeyCode[KeyCode["Numpad_2"] = 98] = "Numpad_2";
        KeyCode[KeyCode["Numpad_3"] = 99] = "Numpad_3";
        KeyCode[KeyCode["Numpad_4"] = 100] = "Numpad_4";
        KeyCode[KeyCode["Numpad_5"] = 101] = "Numpad_5";
        KeyCode[KeyCode["Numpad_6"] = 102] = "Numpad_6";
        KeyCode[KeyCode["Numpad_7"] = 103] = "Numpad_7";
        KeyCode[KeyCode["Numpad_8"] = 104] = "Numpad_8";
        KeyCode[KeyCode["Numpad_9"] = 105] = "Numpad_9";
        KeyCode[KeyCode["Multiply"] = 106] = "Multiply";
        KeyCode[KeyCode["Add"] = 107] = "Add";
        KeyCode[KeyCode["Subtract"] = 109] = "Subtract";
        KeyCode[KeyCode["Decimal"] = 110] = "Decimal";
        KeyCode[KeyCode["Divide"] = 111] = "Divide";
        KeyCode[KeyCode["F1"] = 112] = "F1";
        KeyCode[KeyCode["F2"] = 113] = "F2";
        KeyCode[KeyCode["F3"] = 114] = "F3";
        KeyCode[KeyCode["F4"] = 115] = "F4";
        KeyCode[KeyCode["F5"] = 116] = "F5";
        KeyCode[KeyCode["F6"] = 117] = "F6";
        KeyCode[KeyCode["F7"] = 118] = "F7";
        KeyCode[KeyCode["F8"] = 119] = "F8";
        KeyCode[KeyCode["F9"] = 120] = "F9";
        KeyCode[KeyCode["F10"] = 121] = "F10";
        KeyCode[KeyCode["F11"] = 122] = "F11";
        KeyCode[KeyCode["F12"] = 123] = "F12";
        KeyCode[KeyCode["NumLock"] = 144] = "NumLock";
        KeyCode[KeyCode["ScrollLock"] = 145] = "ScrollLock";
        KeyCode[KeyCode["NonBreakingSpace"] = 160] = "NonBreakingSpace";
        KeyCode[KeyCode["Semicolon"] = 186] = "Semicolon";
        KeyCode[KeyCode["Equals"] = 187] = "Equals";
        KeyCode[KeyCode["Comma"] = 188] = "Comma";
        KeyCode[KeyCode["Dash"] = 189] = "Dash";
        KeyCode[KeyCode["Period"] = 190] = "Period";
        KeyCode[KeyCode["ForwardSlash"] = 191] = "ForwardSlash";
        KeyCode[KeyCode["GraveAccent"] = 192] = "GraveAccent";
        KeyCode[KeyCode["OpenBracket"] = 219] = "OpenBracket";
        KeyCode[KeyCode["BackSlash"] = 220] = "BackSlash";
        KeyCode[KeyCode["CloseBracket"] = 221] = "CloseBracket";
        KeyCode[KeyCode["SingleQuote"] = 222] = "SingleQuote";
    })(KeyCode = REWebUtils.KeyCode || (REWebUtils.KeyCode = {}));
})(REWebUtils || (REWebUtils = {}));
var REWebUtils;
(function (REWebUtils) {
    function IsExists(obj) {
        return (typeof (obj) != "undefined") && (obj != null);
    }
    REWebUtils.IsExists = IsExists;
    function IsNumber(str) {
        return !isNaN(parseFloat(str)) && isFinite(str);
    }
    REWebUtils.IsNumber = IsNumber;
    ;
    function SetStyles(element, styles, makeImportant) {
        if (REWebUtils.IsExists(styles.cssText))
            element.style.cssText = styles.cssText;
        if (REWebUtils.IsExists(styles.className))
            element.className = styles.className;
        for (var property in styles) {
            if (!styles.hasOwnProperty(property))
                continue;
            var value = styles[property];
            switch (property) {
                case "cssText":
                case "className":
                    break;
                case "float":
                    REWebUtils.SetElementFloat(element, value);
                    break;
                case "opacity":
                    REWebUtils.SetElementOpacity(element, value);
                    break;
                case "zIndex":
                    REWebUtils.SetStylesCore(element, property, value, makeImportant);
                    break;
                case "fontWeight":
                    if (REWebUtils.Browser.IE && REWebUtils.Browser.Version < 9 && typeof (styles[property]) == "number")
                        value = styles[property].toString();
                default:
                    REWebUtils.SetStylesCore(element, property, value + (typeof (value) == "number" ? "px" : ""), makeImportant);
            }
        }
    }
    REWebUtils.SetStyles = SetStyles;
    ;
    function SetStylesCore(element, property, value, makeImportant) {
        if (makeImportant) {
            var index = property.search("[A-Z]");
            if (index != -1)
                property = property.replace(property.charAt(index), "-" + property.charAt(index).toLowerCase());
            if (element.style.setProperty)
                element.style.setProperty(property, value, "important");
            else
                element.style.cssText += ";" + property + ":" + value + "!important";
        }
        else
            element.style[property] = value;
    }
    REWebUtils.SetStylesCore = SetStylesCore;
    function GetDocumentScrollTop() {
        var isScrollBodyIE = REWebUtils.Browser.IE && REWebUtils.GetCurrentStyle(document.body).overflow == "hidden" && document.body.scrollTop > 0;
        if (REWebUtils.Browser.WebKitFamily || REWebUtils.Browser.Edge || isScrollBodyIE) {
            if (REWebUtils.Browser.MacOSMobilePlatform)
                return window.pageYOffset;
            if (REWebUtils.Browser.WebKitFamily)
                return document.documentElement.scrollTop || document.body.scrollTop;
            return document.body.scrollTop;
        }
        else
            return document.documentElement.scrollTop;
    }
    REWebUtils.GetDocumentScrollTop = GetDocumentScrollTop;
    function CloneObject(srcObject) {
        if (typeof (srcObject) != 'object' || srcObject == null)
            return srcObject;
        var newObject = {};
        for (var i in srcObject)
            newObject[i] = srcObject[i];
        return newObject;
    }
    REWebUtils.CloneObject = CloneObject;
    function GetCurrentStyle(element) {
        if (element.currentStyle)
            return element.currentStyle;
        else if (document.defaultView && document.defaultView.getComputedStyle) {
            var result = document.defaultView.getComputedStyle(element, null);
            if (!result && REWebUtils.Browser.Firefox && window.frameElement) {
                var changes = [];
                var curElement = window.frameElement;
                while (!(result = document.defaultView.getComputedStyle(element, null))) {
                    changes.push([curElement, curElement.style.display]);
                    REWebUtils.SetStylesCore(curElement, "display", "block", true);
                    curElement = curElement.tagName == "BODY" ? curElement.ownerDocument.defaultView.frameElement : curElement.parentNode;
                }
                result = REWebUtils.CloneObject(result);
                for (var ch, i = 0; ch = changes[i]; i++)
                    REWebUtils.SetStylesCore(ch[0], "display", ch[1], false);
                document.body.offsetWidth;
            }
            return result;
        }
        return window.getComputedStyle(element, null);
    }
    REWebUtils.GetCurrentStyle = GetCurrentStyle;
    function GetDocumentScrollLeft() {
        var isScrollBodyIE = REWebUtils.Browser.IE && REWebUtils.GetCurrentStyle(document.body).overflow == "hidden" && document.body.scrollLeft > 0;
        if (REWebUtils.Browser.Edge || isScrollBodyIE)
            return document.body ? document.body.scrollLeft : document.documentElement.scrollLeft;
        if (REWebUtils.Browser.WebKitFamily)
            return document.documentElement.scrollLeft || document.body.scrollLeft;
        return document.documentElement.scrollLeft;
    }
    REWebUtils.GetDocumentScrollLeft = GetDocumentScrollLeft;
    REWebUtils.focusedElement = null;
    function GetFocusedElement() {
        var activeElement = REWebUtils.GetActiveElement();
        return activeElement ? activeElement : REWebUtils.focusedElement;
    }
    REWebUtils.GetFocusedElement = GetFocusedElement;
    function GetActiveElement() {
        try {
            return document.activeElement;
        }
        catch (e) {
            return null;
        }
    }
    REWebUtils.GetActiveElement = GetActiveElement;
    ;
    function focusCore(element, selectAction) {
        try {
            element.focus();
            if (REWebUtils.Browser.IE && document.activeElement != element)
                element.focus();
            if (selectAction) {
                var currentSelection = Selection.GetInfo(element);
                if (currentSelection.startPos == currentSelection.endPos) {
                    switch (selectAction) {
                        case "start":
                            Selection.SetCaretPosition(element, 0);
                            break;
                        case "all":
                            Selection.Set(element);
                            break;
                    }
                }
            }
        }
        catch (e) {
        }
    }
    function SetFocus(element, selectAction) {
        if (REWebUtils.Browser.MacOSMobilePlatform)
            focusCore(element, selectAction);
        else {
            window.setTimeout(function () {
                focusCore(element, selectAction);
            }, 100);
        }
    }
    REWebUtils.SetFocus = SetFocus;
    function GetIsParent(parentElement, element) {
        if (!parentElement || !element)
            return false;
        while (element) {
            if (element === parentElement)
                return true;
            if (element.tagName === "BODY")
                return false;
            element = element.parentNode;
        }
        return false;
    }
    REWebUtils.GetIsParent = GetIsParent;
    function ElementContainsCssClass(element, className) {
        try {
            if (!element.className)
                return false;
            return element.className.indexOf(className) != -1;
        }
        catch (e) {
            return false;
        }
    }
    REWebUtils.ElementContainsCssClass = ElementContainsCssClass;
    function AddClassNameToElement(element, className) {
        if (!element || typeof (className) !== "string")
            return;
        className = className.trim();
        if (!REWebUtils.ElementHasCssClass(element, className) && className !== "")
            element.className = (element.className === "") ? className : element.className + " " + className;
    }
    REWebUtils.AddClassNameToElement = AddClassNameToElement;
    function ElementHasCssClass(element, className) {
        try {
            var elementClasses;
            var classList = element.classList;
            if (!classList) {
                if (!element.className)
                    return false;
                elementClasses = element.className.split(" ");
            }
            var classNames = className.split(" ");
            for (var i = classNames.length - 1; i >= 0; i--) {
                if (classList) {
                    if (!classList.contains(classNames[i]))
                        return false;
                    continue;
                }
                if (REWebUtils.Data.ArrayIndexOf(elementClasses, classNames[i]) < 0)
                    return false;
            }
            return true;
        }
        catch (e) {
            return false;
        }
    }
    REWebUtils.ElementHasCssClass = ElementHasCssClass;
    function RemoveClassNameFromElement(element, className) {
        if (!element)
            return;
        var updClassName = " " + element.className + " ";
        var newClassName = updClassName.replace(" " + className + " ", " ");
        if (updClassName.length != newClassName.length)
            element.className = REWebUtils.Str.Trim(newClassName);
    }
    REWebUtils.RemoveClassNameFromElement = RemoveClassNameFromElement;
    function GetAbsolutePositionY(element) {
        if (REWebUtils.Browser.IE)
            return getAbsolutePositionY_IE(element);
        else if (REWebUtils.Browser.Firefox && REWebUtils.Browser.Version >= 3)
            return getAbsolutePositionY_FF3(element);
        else if (REWebUtils.Browser.Opera)
            return getAbsolutePositionY_Opera(element);
        else if (REWebUtils.Browser.NetscapeFamily && (!REWebUtils.Browser.Firefox || REWebUtils.Browser.Version < 3))
            return getAbsolutePositionY_NS(element);
        else if (REWebUtils.Browser.WebKitFamily || REWebUtils.Browser.Edge)
            return getAbsolutePositionY_FF3(element);
        else
            return getAbsolutePositionY_Other(element);
    }
    REWebUtils.GetAbsolutePositionY = GetAbsolutePositionY;
    function getAbsolutePositionY_Opera(curEl) {
        var isFirstCycle = true;
        if (curEl && curEl.tagName == "TR" && curEl.cells.length > 0)
            curEl = curEl.cells[0];
        var pos = getAbsoluteScrollOffset_OperaFF(curEl, false);
        while (curEl != null) {
            pos += curEl.offsetTop;
            if (!isFirstCycle)
                pos -= curEl.scrollTop;
            curEl = curEl.offsetParent;
            isFirstCycle = false;
        }
        pos += document.body.scrollTop;
        return pos;
    }
    function getAbsolutePositionY_IE(element) {
        if (element == null || REWebUtils.Browser.IE && element.parentNode == null)
            return 0;
        return element.getBoundingClientRect().top + REWebUtils.GetDocumentScrollTop();
    }
    function getAbsolutePositionY_FF3(element) {
        if (element == null)
            return 0;
        var y = element.getBoundingClientRect().top + REWebUtils.GetDocumentScrollTop();
        return Math.round(y);
    }
    function getAbsolutePositionY_NS(curEl) {
        var pos = getAbsoluteScrollOffset_OperaFF(curEl, false);
        var isFirstCycle = true;
        while (curEl != null) {
            pos += curEl.offsetTop;
            if (!isFirstCycle && curEl.offsetParent != null)
                pos -= curEl.scrollTop;
            if (!isFirstCycle && REWebUtils.Browser.Firefox) {
                var style = REWebUtils.GetCurrentStyle(curEl);
                if (curEl.tagName == "DIV" && style.overflow != "visible")
                    pos += PxToInt(style.borderTopWidth);
            }
            isFirstCycle = false;
            curEl = curEl.offsetParent;
        }
        return pos;
    }
    function getAbsolutePositionY_Other(curEl) {
        var pos = 0;
        var isFirstCycle = true;
        while (curEl != null) {
            pos += curEl.offsetTop;
            if (!isFirstCycle && curEl.offsetParent != null)
                pos -= curEl.scrollTop;
            isFirstCycle = false;
            curEl = curEl.offsetParent;
        }
        return pos;
    }
    function getAbsoluteScrollOffset_OperaFF(curEl, isX) {
        var pos = 0;
        var isFirstCycle = true;
        while (curEl != null) {
            if (curEl.tagName == "BODY")
                break;
            var style = REWebUtils.GetCurrentStyle(curEl);
            if (style.position == "absolute")
                break;
            if (!isFirstCycle && curEl.tagName == "DIV" && (style.position == "" || style.position == "static"))
                pos -= isX ? curEl.scrollLeft : curEl.scrollTop;
            curEl = curEl.parentNode;
            isFirstCycle = false;
        }
        return pos;
    }
    function PxToInt(px) {
        return pxToNumber(px, parseInt);
    }
    REWebUtils.PxToInt = PxToInt;
    ;
    function PxToFloat(px) {
        return pxToNumber(px, parseFloat);
    }
    REWebUtils.PxToFloat = PxToFloat;
    ;
    function pxToNumber(px, parseFunction) {
        var result = 0;
        if (px != null && px != "") {
            try {
                var indexOfPx = px.indexOf("px");
                if (indexOfPx > -1)
                    result = parseFunction(px.substr(0, indexOfPx));
            }
            catch (e) { }
        }
        return result;
    }
    function GetAbsolutePositionX(element) {
        if (REWebUtils.Browser.IE)
            return getAbsolutePositionX_IE(element);
        else if (REWebUtils.Browser.Firefox && REWebUtils.Browser.Version >= 3)
            return getAbsolutePositionX_FF3(element);
        else if (REWebUtils.Browser.Opera)
            return getAbsolutePositionX_Opera(element);
        else if (REWebUtils.Browser.NetscapeFamily && (!REWebUtils.Browser.Firefox || REWebUtils.Browser.Version < 3))
            return getAbsolutePositionX_NS(element);
        else if (REWebUtils.Browser.WebKitFamily || REWebUtils.Browser.Edge)
            return getAbsolutePositionX_FF3(element);
        else
            return getAbsolutePositionX_Other(element);
    }
    REWebUtils.GetAbsolutePositionX = GetAbsolutePositionX;
    function getAbsolutePositionX_Opera(curEl) {
        var isFirstCycle = true;
        var pos = getAbsoluteScrollOffset_OperaFF(curEl, true);
        while (curEl != null) {
            pos += curEl.offsetLeft;
            if (!isFirstCycle)
                pos -= curEl.scrollLeft;
            curEl = curEl.offsetParent;
            isFirstCycle = false;
        }
        pos += document.body.scrollLeft;
        return pos;
    }
    function getAbsolutePositionX_IE(element) {
        if (element == null || REWebUtils.Browser.IE && element.parentNode == null)
            return 0;
        return element.getBoundingClientRect().left + REWebUtils.GetDocumentScrollLeft();
    }
    function getAbsolutePositionX_FF3(element) {
        if (element == null)
            return 0;
        var x = element.getBoundingClientRect().left + REWebUtils.GetDocumentScrollLeft();
        return Math.round(x);
    }
    function getAbsolutePositionX_NS(curEl) {
        var pos = getAbsoluteScrollOffset_OperaFF(curEl, true);
        var isFirstCycle = true;
        while (curEl != null) {
            pos += curEl.offsetLeft;
            if (!isFirstCycle && curEl.offsetParent != null)
                pos -= curEl.scrollLeft;
            if (!isFirstCycle && REWebUtils.Browser.Firefox) {
                var style = REWebUtils.GetCurrentStyle(curEl);
                if (curEl.tagName == "DIV" && style.overflow != "visible")
                    pos += PxToInt(style.borderLeftWidth);
            }
            isFirstCycle = false;
            curEl = curEl.offsetParent;
        }
        return pos;
    }
    function getAbsolutePositionX_Other(curEl) {
        var pos = 0;
        var isFirstCycle = true;
        while (curEl != null) {
            pos += curEl.offsetLeft;
            if (!isFirstCycle && curEl.offsetParent != null)
                pos -= curEl.scrollLeft;
            isFirstCycle = false;
            curEl = curEl.offsetParent;
        }
        return pos;
    }
    function IsPercentageSize(size) {
        return size && size.indexOf('%') != -1;
    }
    REWebUtils.IsPercentageSize = IsPercentageSize;
    ;
    function GetChildNodes(parent, predicate) {
        return REWebUtils.RetrieveByPredicate(parent.childNodes, predicate);
    }
    REWebUtils.GetChildNodes = GetChildNodes;
    ;
    function GetNodes(parent, predicate) {
        var c = parent.all || parent.getElementsByTagName('*');
        return REWebUtils.RetrieveByPredicate(c, predicate);
    }
    REWebUtils.GetNodes = GetNodes;
    ;
    function RetrieveByPredicate(scourceCollection, predicate) {
        var result = [];
        for (var i = 0; i < scourceCollection.length; i++) {
            var element = scourceCollection[i];
            if (!predicate || predicate(element))
                result.push(element);
        }
        return result;
    }
    REWebUtils.RetrieveByPredicate = RetrieveByPredicate;
    ;
    function GetChildNodesByClassName(parent, className) {
        if (!parent)
            return [];
        if (parent.querySelectorAll) {
            var children = parent.querySelectorAll('.' + className);
            return nodeListToArray(children, function (element) {
                return element.parentNode === parent;
            });
        }
        return REWebUtils.GetChildNodes(parent, function (elem) { return elem.className && REWebUtils.ElementHasCssClass(elem, className); });
    }
    REWebUtils.GetChildNodesByClassName = GetChildNodesByClassName;
    function nodeListToArray(nodeList, filter) {
        var result = [];
        for (var i = 0, element; element = nodeList[i]; i++) {
            if (filter && !filter(element))
                continue;
            result.push(element);
        }
        return result;
    }
    function GetNodesByClassName(parent, className) {
        if (parent.querySelectorAll) {
            var children = parent.querySelectorAll('.' + className);
            return nodeListToArray(children, null);
        }
        return REWebUtils.GetNodes(parent, function (elem) { return elem.className && REWebUtils.ElementHasCssClass(elem, className); });
    }
    REWebUtils.GetNodesByClassName = GetNodesByClassName;
    function GetParentByClassName(element, className) {
        while (element != null) {
            if (element.tagName == "BODY" || element.nodeName == "#document")
                return null;
            if (REWebUtils.ElementContainsCssClass(element, className))
                return element;
            element = element.parentNode;
        }
        return null;
    }
    REWebUtils.GetParentByClassName = GetParentByClassName;
    function GetParentByTagName(element, tagName) {
        tagName = tagName.toUpperCase();
        while (element) {
            if (element.tagName === "BODY")
                return null;
            if (element.tagName === tagName)
                return element;
            element = element.parentNode;
        }
        return null;
    }
    REWebUtils.GetParentByTagName = GetParentByTagName;
    var html2PlainTextFilter = null;
    function setInnerHtmlInternal(el, trustedHtmlString) {
        el.innerHTML = trustedHtmlString;
    }
    REWebUtils.setInnerHtmlInternal = setInnerHtmlInternal;
    function SetElementDisplay(element, value, checkCurrentStyle, makeInline) {
        if (!element)
            return;
        if (typeof (value) === "string")
            element.style.display = value;
        else if (!value)
            element.style.display = "none";
        else {
            element.style.display = "";
            if (checkCurrentStyle && REWebUtils.GetCurrentStyle(element).display === "none") {
                var displayAddon = makeInline ? "inline-" : "";
                switch (element.tagName) {
                    case "TABLE": {
                        element.style.display = displayAddon + "table";
                        break;
                    }
                    default: {
                        element.style.display = displayAddon + "block";
                        break;
                    }
                }
            }
        }
    }
    REWebUtils.SetElementDisplay = SetElementDisplay;
    function GetInnerText(container) {
        if (REWebUtils.Browser.Safari && REWebUtils.Browser.MajorVersion <= 5) {
            var filter = getHtml2PlainTextFilter();
            setInnerHtmlInternal(filter, container.innerHTML);
            REWebUtils.SetElementDisplay(filter, true, false, false);
            var innerText = filter.innerText;
            REWebUtils.SetElementDisplay(filter, false, false, false);
            return innerText;
        }
        else if (REWebUtils.Browser.NetscapeFamily || REWebUtils.Browser.WebKitFamily || (REWebUtils.Browser.IE && REWebUtils.Browser.Version >= 9) || REWebUtils.Browser.Edge) {
            return container.textContent;
        }
        else
            return container.innerText;
    }
    REWebUtils.GetInnerText = GetInnerText;
    function getHtml2PlainTextFilter() {
        if (html2PlainTextFilter == null) {
            html2PlainTextFilter = document.createElement("DIV");
            html2PlainTextFilter.style.width = "0";
            html2PlainTextFilter.style.height = "0";
            html2PlainTextFilter.style.overflow = "visible";
            REWebUtils.SetElementDisplay(html2PlainTextFilter, false, false, false);
            document.body.appendChild(html2PlainTextFilter);
        }
        return html2PlainTextFilter;
    }
    var verticalScrollBarWidth;
    function GetVerticalScrollBarWidth() {
        if (typeof (verticalScrollBarWidth) == "undefined") {
            var container = document.createElement("DIV");
            container.style.cssText = "position: absolute; top: 0px; left: 0px; visibility: hidden; width: 200px; height: 150px; overflow: hidden; box-sizing: content-box";
            document.body.appendChild(container);
            var child = document.createElement("P");
            container.appendChild(child);
            child.style.cssText = "width: 100%; height: 200px;";
            var widthWithoutScrollBar = child.offsetWidth;
            container.style.overflow = "scroll";
            var widthWithScrollBar = child.offsetWidth;
            if (widthWithoutScrollBar == widthWithScrollBar)
                widthWithScrollBar = container.clientWidth;
            verticalScrollBarWidth = widthWithoutScrollBar - widthWithScrollBar;
            document.body.removeChild(container);
        }
        return verticalScrollBarWidth;
    }
    REWebUtils.GetVerticalScrollBarWidth = GetVerticalScrollBarWidth;
    function GetHorizontalBordersWidth(element, style) {
        if (!REWebUtils.IsExists(style))
            style = (REWebUtils.Browser.IE && window.getComputedStyle) ? window.getComputedStyle(element) : REWebUtils.GetCurrentStyle(element);
        var res = 0;
        if (style.borderLeftStyle != "none")
            res += REWebUtils.PxToFloat(style.borderLeftWidth);
        if (style.borderRightStyle != "none")
            res += REWebUtils.PxToFloat(style.borderRightWidth);
        return res;
    }
    REWebUtils.GetHorizontalBordersWidth = GetHorizontalBordersWidth;
    function GetVerticalBordersWidth(element, style) {
        if (!REWebUtils.IsExists(style))
            style = (REWebUtils.Browser.IE && REWebUtils.Browser.MajorVersion != 9 && window.getComputedStyle) ? window.getComputedStyle(element) : REWebUtils.GetCurrentStyle(element);
        var res = 0;
        if (style.borderTopStyle != "none")
            res += REWebUtils.PxToFloat(style.borderTopWidth);
        if (style.borderBottomStyle != "none")
            res += REWebUtils.PxToFloat(style.borderBottomWidth);
        return res;
    }
    REWebUtils.GetVerticalBordersWidth = GetVerticalBordersWidth;
    function SetElementVisibility(element, value) {
        if (!element)
            return;
        if (typeof (value) === "string")
            element.style.visibility = value;
        else
            element.style.visibility = value ? "visible" : "hidden";
    }
    REWebUtils.SetElementVisibility = SetElementVisibility;
    ;
    function SetElementFloat(element, value) {
        if (REWebUtils.IsExists(element.style.cssFloat))
            element.style.cssFloat = value;
        else if (REWebUtils.IsExists(element.style.styleFloat))
            element.style.styleFloat = value;
        else
            REWebUtils.Attr.SetAttribute(element.style, "float", value);
    }
    REWebUtils.SetElementFloat = SetElementFloat;
    ;
    function SetElementOpacity(element, value) {
        var useOpacityStyle = !REWebUtils.Browser.IE || REWebUtils.Browser.Version > 8;
        if (useOpacityStyle) {
            element.style.opacity = value;
        }
        else {
            if (typeof (element.filters) === "object" && element.filters["DXImageTransform.Microsoft.Alpha"])
                element.filters.item("DXImageTransform.Microsoft.Alpha").Opacity = value * 100;
            else
                element.style.filter = "alpha(opacity=" + (value * 100) + ")";
        }
    }
    REWebUtils.SetElementOpacity = SetElementOpacity;
    function CreateGuid() {
        return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
            var r = Math.random() * 16 | 0;
            var v = c == 'x' ? r : r & 0x3 | 0x8;
            return v.toString(16);
        });
    }
    REWebUtils.CreateGuid = CreateGuid;
    function IsUrlContainsClientScript(url) {
        return url.toLowerCase().indexOf("javascript:") !== -1;
    }
    REWebUtils.IsUrlContainsClientScript = IsUrlContainsClientScript;
    function IsExistsElement(element) {
        return element && REWebUtils.IsValidElement(element);
    }
    REWebUtils.IsExistsElement = IsExistsElement;
    function IsValidElement(element) {
        if (!element)
            return false;
        if (!(REWebUtils.Browser.Firefox && REWebUtils.Browser.Version < 4)) {
            if (element.ownerDocument && element.ownerDocument.body && element.ownerDocument.body.compareDocumentPosition)
                return element.ownerDocument.body.compareDocumentPosition(element) % 2 === 0;
        }
        if (!REWebUtils.Browser.Opera && !(REWebUtils.Browser.IE && REWebUtils.Browser.Version < 9) && element.offsetParent && element.parentNode.tagName)
            return true;
        while (element != null) {
            if (element.tagName == "BODY")
                return true;
            element = element.parentNode;
        }
        return false;
    }
    REWebUtils.IsValidElement = IsValidElement;
    function IsInteractiveControl(element) {
        return REWebUtils.Data.ArrayIndexOf(["A", "INPUT", "SELECT", "OPTION", "TEXTAREA", "BUTTON", "IFRAME"], element.tagName) > -1;
    }
    REWebUtils.IsInteractiveControl = IsInteractiveControl;
    function IsActionElement(element) {
        if (!REWebUtils.IsExistsElement(element))
            return false;
        var tabIndex = parseInt(REWebUtils.Attr.GetAttribute(element, REWebUtils.Attr.GetTabIndexAttributeName()));
        var hasTabIndex = !isNaN(tabIndex);
        var hasNonNegativeTabIndex = hasTabIndex && tabIndex > -1;
        var hasNegativeTabIndex = hasTabIndex && tabIndex < 0;
        var tagName = element.tagName;
        var focusableElementTags = ["BUTTON", "SELECT", "TEXTAREA", "OPTION", "IFRAME"];
        var isFocusableCore = REWebUtils.IsFocusable(element);
        var isFocusableTag = focusableElementTags.indexOf(tagName) !== -1;
        var isFocusableLink = tagName === "A" && (!!element.href || hasNonNegativeTabIndex);
        var isFocusableInput = tagName === "INPUT" && element.type.toLowerCase() !== "hidden";
        var isFocusableByTabIndex = tagName !== "INPUT" && hasNonNegativeTabIndex;
        var isEditableDiv = tagName == "DIV" && element.contentEditable === "true";
        return isFocusableCore && !hasNegativeTabIndex && (isFocusableTag || isFocusableLink || isFocusableInput || isFocusableByTabIndex || isEditableDiv);
    }
    REWebUtils.IsActionElement = IsActionElement;
    function IsFocusable(element, skipContainerVisibilityCheck) {
        if (skipContainerVisibilityCheck === void 0) { skipContainerVisibilityCheck = function () { return false; }; }
        var current = element;
        while (current && current.nodeType == 1) {
            if (current == element || !skipContainerVisibilityCheck(current)) {
                var tagName = current.tagName.toUpperCase();
                if (tagName == "BODY")
                    return true;
                var disabledElementTags = ["INPUT", "BUTTON", "TEXTAREA", "SELECT", "OPTION"];
                if (disabledElementTags.indexOf(tagName) !== -1 && current.disabled || !REWebUtils.GetElementDisplay(current, false) || !REWebUtils.GetElementVisibility(current, false))
                    return false;
            }
            current = current.parentNode;
        }
        return true;
    }
    REWebUtils.IsFocusable = IsFocusable;
    function GetElementDisplay(element, isCurrentStyle) {
        if (isCurrentStyle)
            return REWebUtils.GetCurrentStyle(element).display != "none";
        return element.style.display != "none";
    }
    REWebUtils.GetElementDisplay = GetElementDisplay;
    function GetElementVisibility(element, isCurrentStyle) {
        if (isCurrentStyle)
            return REWebUtils.GetCurrentStyle(element).visibility != "hidden";
        return element.style.visibility != "hidden";
    }
    REWebUtils.GetElementVisibility = GetElementVisibility;
    function GetClearClientHeight(element) {
        return element.offsetHeight - REWebUtils.GetTopBottomBordersAndPaddingsSummaryValue(element);
    }
    REWebUtils.GetClearClientHeight = GetClearClientHeight;
    function GetTopBottomBordersAndPaddingsSummaryValue(element, currentStyle) {
        return REWebUtils.GetTopBottomPaddings(element, currentStyle) + REWebUtils.GetVerticalBordersWidth(element, currentStyle);
    }
    REWebUtils.GetTopBottomBordersAndPaddingsSummaryValue = GetTopBottomBordersAndPaddingsSummaryValue;
    ;
    function GetTopBottomPaddings(element, style) {
        var currentStyle = style ? style : REWebUtils.GetCurrentStyle(element);
        return REWebUtils.PxToInt(currentStyle.paddingTop) + REWebUtils.PxToInt(currentStyle.paddingBottom);
    }
    REWebUtils.GetTopBottomPaddings = GetTopBottomPaddings;
    ;
    function ParseShortcutString(shortcutString) {
        if (!shortcutString)
            return 0;
        var isCtrlKey = false;
        var isShiftKey = false;
        var isAltKey = false;
        var isMetaKey = false;
        var keyCode = null;
        var shcKeys = shortcutString.toString().split("+");
        if (shcKeys.length > 0) {
            for (var i = 0; i < shcKeys.length; i++) {
                var key = REWebUtils.Str.Trim(shcKeys[i].toUpperCase());
                switch (key) {
                    case "CONTROL":
                    case "CONTROLKEY":
                    case "CTRL":
                        isCtrlKey = true;
                        break;
                    case "SHIFT":
                    case "SHIFTKEY":
                        isShiftKey = true;
                        break;
                    case "ALT":
                        isAltKey = true;
                        break;
                    case "CMD":
                        isMetaKey = true;
                        break;
                    case "F1":
                        keyCode = REWebUtils.KeyCode.F1;
                        break;
                    case "F2":
                        keyCode = REWebUtils.KeyCode.F2;
                        break;
                    case "F3":
                        keyCode = REWebUtils.KeyCode.F3;
                        break;
                    case "F4":
                        keyCode = REWebUtils.KeyCode.F4;
                        break;
                    case "F5":
                        keyCode = REWebUtils.KeyCode.F5;
                        break;
                    case "F6":
                        keyCode = REWebUtils.KeyCode.F6;
                        break;
                    case "F7":
                        keyCode = REWebUtils.KeyCode.F7;
                        break;
                    case "F8":
                        keyCode = REWebUtils.KeyCode.F8;
                        break;
                    case "F9":
                        keyCode = REWebUtils.KeyCode.F9;
                        break;
                    case "F10":
                        keyCode = REWebUtils.KeyCode.F10;
                        break;
                    case "F11":
                        keyCode = REWebUtils.KeyCode.F11;
                        break;
                    case "F12":
                        keyCode = REWebUtils.KeyCode.F12;
                        break;
                    case "RETURN":
                    case "ENTER":
                        keyCode = REWebUtils.KeyCode.Enter;
                        break;
                    case "HOME":
                        keyCode = REWebUtils.KeyCode.Home;
                        break;
                    case "END":
                        keyCode = REWebUtils.KeyCode.End;
                        break;
                    case "LEFT":
                        keyCode = REWebUtils.KeyCode.Left;
                        break;
                    case "RIGHT":
                        keyCode = REWebUtils.KeyCode.Right;
                        break;
                    case "UP":
                        keyCode = REWebUtils.KeyCode.Up;
                        break;
                    case "DOWN":
                        keyCode = REWebUtils.KeyCode.Down;
                        break;
                    case "PAGEUP":
                        keyCode = REWebUtils.KeyCode.PageUp;
                        break;
                    case "PAGEDOWN":
                        keyCode = REWebUtils.KeyCode.PageDown;
                        break;
                    case "SPACE":
                        keyCode = REWebUtils.KeyCode.Space;
                        break;
                    case "TAB":
                        keyCode = REWebUtils.KeyCode.Tab;
                        break;
                    case "BACKSPACE":
                    case "BACK":
                        keyCode = REWebUtils.KeyCode.Backspace;
                        break;
                    case "CONTEXT":
                        keyCode = REWebUtils.KeyCode.ContextMenu;
                        break;
                    case "ESCAPE":
                    case "ESC":
                        keyCode = REWebUtils.KeyCode.Esc;
                        break;
                    case "DELETE":
                    case "DEL":
                        keyCode = REWebUtils.KeyCode.Delete;
                        break;
                    case "INSERT":
                    case "INS":
                        keyCode = REWebUtils.KeyCode.Insert;
                        break;
                    case "PLUS":
                        keyCode = "+".charCodeAt(0);
                        break;
                    default:
                        keyCode = key.charCodeAt(0);
                        break;
                }
            }
        }
        else
            REWebUtils.ShowErrorAlert("Invalid shortcut");
        return REWebUtils.GetShortcutCode(keyCode, isCtrlKey, isShiftKey, isAltKey, isMetaKey);
    }
    REWebUtils.ParseShortcutString = ParseShortcutString;
    function ShowErrorAlert(message) {
        message = REWebUtils.Str.DecodeHtmlViaTextArea(message);
        if (REWebUtils.IsExists(message) && message !== "")
            alert(message);
    }
    REWebUtils.ShowErrorAlert = ShowErrorAlert;
    ;
    function GetShortcutCode(keyCode, isCtrlKey, isShiftKey, isAltKey, isMetaKey) {
        var value = keyCode;
        value |= isCtrlKey ? REWebUtils.ModifierKey.Ctrl : 0;
        value |= isShiftKey ? REWebUtils.ModifierKey.Shift : 0;
        value |= isAltKey ? REWebUtils.ModifierKey.Alt : 0;
        value |= isMetaKey ? REWebUtils.ModifierKey.Meta : 0;
        return value;
    }
    REWebUtils.GetShortcutCode = GetShortcutCode;
    ;
    function GetShortcutCodeByEvent(evt) {
        return REWebUtils.GetShortcutCode(REWebUtils.Evt.GetKeyCode(evt), evt.ctrlKey, evt.shiftKey, evt.altKey, REWebUtils.Browser.MacOSPlatform ? evt.metaKey : false);
    }
    REWebUtils.GetShortcutCodeByEvent = GetShortcutCodeByEvent;
    ;
})(REWebUtils || (REWebUtils = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TabLeaderType;
    (function (TabLeaderType) {
        TabLeaderType[TabLeaderType["None"] = 0] = "None";
        TabLeaderType[TabLeaderType["Dots"] = 1] = "Dots";
        TabLeaderType[TabLeaderType["MiddleDots"] = 2] = "MiddleDots";
        TabLeaderType[TabLeaderType["Hyphens"] = 3] = "Hyphens";
        TabLeaderType[TabLeaderType["Underline"] = 4] = "Underline";
        TabLeaderType[TabLeaderType["ThickLine"] = 5] = "ThickLine";
        TabLeaderType[TabLeaderType["EqualSign"] = 6] = "EqualSign";
    })(TabLeaderType = __aspxRichEdit.TabLeaderType || (__aspxRichEdit.TabLeaderType = {}));
    var LayoutTabSpaceBox = (function (_super) {
        __extends(LayoutTabSpaceBox, _super);
        function LayoutTabSpaceBox() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutTabSpaceBox.prototype.equals = function (obj) {
            return _super.prototype.equals.call(this, obj) &&
                this.spaceWidth == obj.spaceWidth &&
                this.hiddenTabWidth == obj.hiddenTabWidth &&
                this.tabLeaderSymbol == obj.tabLeaderSymbol;
        };
        LayoutTabSpaceBox.prototype.clone = function () {
            var newObj = new LayoutTabSpaceBox(this.characterProperties, this.colorInfo);
            newObj.copyFrom(this);
            return newObj;
        };
        LayoutTabSpaceBox.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.spaceWidth = obj.spaceWidth;
            this.hiddenTabWidth = obj.hiddenTabWidth;
            this.tabLeaderSymbol = obj.tabLeaderSymbol;
        };
        LayoutTabSpaceBox.prototype.setTabParams = function (tabLeaderSymbol, spaceWidth, hiddenTabWidth) {
            this.tabLeaderSymbol = tabLeaderSymbol;
            this.spaceWidth = spaceWidth;
            this.hiddenTabWidth = hiddenTabWidth;
        };
        LayoutTabSpaceBox.prototype.getType = function () {
            return __aspxRichEdit.LayoutBoxType.TabSpace;
        };
        LayoutTabSpaceBox.prototype.pushInfoForMeasure = function (_info, _showHiddenSymbols) {
            throw new Error(__aspxRichEdit.Errors.InternalException);
        };
        LayoutTabSpaceBox.prototype.popInfoForMeasure = function (_info, _showHiddenSymbols) {
            throw new Error(__aspxRichEdit.Errors.InternalException);
        };
        LayoutTabSpaceBox.prototype.isVisible = function () {
            return true;
        };
        LayoutTabSpaceBox.prototype.renderGetContent = function (_renderer) {
            if (this.hiddenTabWidth == 0) {
                var numNbsps = Math.ceil(this.width / Math.max(1, this.spaceWidth));
                return __aspxRichEdit.StringUtils.mergeStringNTimes(this.tabLeaderSymbol, numNbsps);
            }
            var nbspsSpace = this.width - this.hiddenTabWidth;
            var nbspsSpaceLeftPart = nbspsSpace < 0 ? 0 : nbspsSpace / 2;
            var numNbspsLeftPart = Math.floor(nbspsSpaceLeftPart / Math.max(1, this.spaceWidth));
            var nbspsSpaceRightPart = this.width - (numNbspsLeftPart * this.spaceWidth + this.hiddenTabWidth);
            var numNbspsRightPart = nbspsSpaceRightPart < 0 ? 0 : Math.ceil(nbspsSpaceRightPart / Math.max(1, this.spaceWidth));
            return __aspxRichEdit.StringUtils.mergeStringNTimes(this.tabLeaderSymbol, numNbspsLeftPart) + __aspxRichEdit.RichUtils.specialCharacters.HiddenTabSpace +
                __aspxRichEdit.StringUtils.mergeStringNTimes(this.tabLeaderSymbol, numNbspsRightPart);
        };
        LayoutTabSpaceBox.prototype.renderGetCharacterProperties = function () {
            if (this.characterProperties.fontBold || this.characterProperties.fontItalic || this.colorInfo.textColor) {
                var renderCharProps = this.characterProperties.clone();
                renderCharProps.fontBold = false;
                renderCharProps.fontItalic = false;
                var colorInfo = new __aspxRichEdit.LayoutCharacterPropertiesColorInfo(this.colorInfo.textColor ? 0 : this.colorInfo.textColor, this.colorInfo.foregroundColor, this.colorInfo.textColor && !this.colorInfo.strikeoutColor ? this.colorInfo.textColor : this.colorInfo.strikeoutColor, this.colorInfo.textColor && !this.colorInfo.underlineColor ? this.colorInfo.textColor : this.colorInfo.underlineColor);
                return new __aspxRichEdit.LayoutRenderCharacterProperties(renderCharProps, colorInfo);
            }
            else
                return new __aspxRichEdit.LayoutRenderCharacterProperties(this.characterProperties, this.colorInfo);
        };
        LayoutTabSpaceBox.prototype.isWhitespace = function () {
            return true;
        };
        LayoutTabSpaceBox.prototype.isLineBreak = function () {
            return false;
        };
        return LayoutTabSpaceBox;
    }(__aspxRichEdit.LayoutBox));
    __aspxRichEdit.LayoutTabSpaceBox = LayoutTabSpaceBox;
    var LayoutTabSpaceBoxJustForBoxIterator = (function (_super) {
        __extends(LayoutTabSpaceBoxJustForBoxIterator, _super);
        function LayoutTabSpaceBoxJustForBoxIterator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutTabSpaceBoxJustForBoxIterator.getTabLeaderMap = function () {
            var tabLeaderMap = {};
            tabLeaderMap[TabLeaderType.None] = "&nbsp;";
            tabLeaderMap[TabLeaderType.Dots] = __aspxRichEdit.RichUtils.specialCharacters.Dot;
            tabLeaderMap[TabLeaderType.EqualSign] = __aspxRichEdit.RichUtils.specialCharacters.EqualSign;
            tabLeaderMap[TabLeaderType.Hyphens] = __aspxRichEdit.RichUtils.specialCharacters.Hyphen;
            tabLeaderMap[TabLeaderType.MiddleDots] = __aspxRichEdit.RichUtils.specialCharacters.MiddleDot;
            tabLeaderMap[TabLeaderType.ThickLine] = __aspxRichEdit.RichUtils.specialCharacters.Underscore;
            tabLeaderMap[TabLeaderType.Underline] = __aspxRichEdit.RichUtils.specialCharacters.Underscore;
            LayoutTabSpaceBoxJustForBoxIterator.tabLeaderSymbolList = [];
            LayoutTabSpaceBoxJustForBoxIterator.tabLeaderTypeList = [];
            __aspxRichEdit.MapUtilsKeyAsNumber.foreach(tabLeaderMap, function (symbol, type) {
                LayoutTabSpaceBoxJustForBoxIterator.tabLeaderSymbolList.push(symbol);
                LayoutTabSpaceBoxJustForBoxIterator.tabLeaderTypeList.push(type);
            });
            return tabLeaderMap;
        };
        LayoutTabSpaceBoxJustForBoxIterator.prototype.getLayoutTabBox = function (tabLeaderType) {
            var leaderMeasureInfo = this.leadersMeasureInfo[tabLeaderType];
            var newTabBox = this.clone();
            newTabBox.setTabParams(LayoutTabSpaceBoxJustForBoxIterator.tabLeaderMap[tabLeaderType], leaderMeasureInfo.resultSize.width, this.showHiddenSymbols ? this.hiddenTabMeasureInfo.resultSize.width : 0);
            newTabBox.height = leaderMeasureInfo.resultSize.height;
            return newTabBox;
        };
        LayoutTabSpaceBoxJustForBoxIterator.prototype.pushInfoForMeasure = function (info, _showHiddenSymbols) {
            var props = this.renderGetCharacterProperties();
            var charProps = props.initProps;
            __aspxRichEdit.ListUtils.foreach(LayoutTabSpaceBoxJustForBoxIterator.tabLeaderSymbolList, function (symbol) { return info.push(new __aspxRichEdit.MeasureInfoNonText(symbol, charProps)); });
            info.push(new __aspxRichEdit.MeasureInfoNonText(__aspxRichEdit.RichUtils.specialCharacters.HiddenTabSpace, charProps));
        };
        LayoutTabSpaceBoxJustForBoxIterator.prototype.popInfoForMeasure = function (info, showHiddenSymbols) {
            var _this = this;
            this.leadersMeasureInfo = {};
            this.hiddenTabMeasureInfo = info.pop();
            __aspxRichEdit.ListUtils.reverseForeach(LayoutTabSpaceBoxJustForBoxIterator.tabLeaderTypeList, function (type) { return _this.leadersMeasureInfo[type] = info.pop(); });
            this.showHiddenSymbols = showHiddenSymbols;
        };
        LayoutTabSpaceBoxJustForBoxIterator.tabLeaderMap = LayoutTabSpaceBoxJustForBoxIterator.getTabLeaderMap();
        return LayoutTabSpaceBoxJustForBoxIterator;
    }(LayoutTabSpaceBox));
    __aspxRichEdit.LayoutTabSpaceBoxJustForBoxIterator = LayoutTabSpaceBoxJustForBoxIterator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TabsInfo = (function () {
        function TabsInfo() {
        }
        return TabsInfo;
    }());
    __aspxRichEdit.TabsInfo = TabsInfo;
    var TabAlign;
    (function (TabAlign) {
        TabAlign[TabAlign["Left"] = 0] = "Left";
        TabAlign[TabAlign["Center"] = 1] = "Center";
        TabAlign[TabAlign["Right"] = 2] = "Right";
        TabAlign[TabAlign["Decimal"] = 3] = "Decimal";
        TabAlign[TabAlign["Numbering"] = 4] = "Numbering";
    })(TabAlign = __aspxRichEdit.TabAlign || (__aspxRichEdit.TabAlign = {}));
    var Paragraph = (function () {
        function Paragraph(subDocument, startLogPosition, length, paragraphStyle, maskedParagraphProperties, indexInMaskedParagraphProperitesCache) {
            if (indexInMaskedParagraphProperitesCache === void 0) { indexInMaskedParagraphProperitesCache = undefined; }
            this.numberingListIndex = __aspxRichEdit.NumberingList.NumberingListNotSettedIndex;
            this.listLevelIndex = -1;
            this.subDocument = subDocument;
            this.startLogPosition = startLogPosition;
            this.length = length;
            this.paragraphStyle = paragraphStyle;
            if (indexInMaskedParagraphProperitesCache === undefined) {
                if (maskedParagraphProperties)
                    this.setParagraphProperties(maskedParagraphProperties);
                else
                    this.maskedParagraphProperties = null;
            }
            else
                this.maskedParagraphProperties = this.subDocument.documentModel.cache.maskedParagraphPropertiesCache.getItemByJsonKey(indexInMaskedParagraphProperitesCache);
            this.mergedParagraphFormatting = null;
            this.tabs = new __aspxRichEdit.TabProperties();
        }
        Object.defineProperty(Paragraph.prototype, "isEmpty", {
            get: function () { return this.length <= 1; },
            enumerable: true,
            configurable: true
        });
        Paragraph.prototype.getTableCell = function () {
            var parPos = this.startLogPosition.value;
            var tables = this.subDocument.tables;
            var table = __aspxRichEdit.Table.getTableByPosition(tables, parPos, false);
            if (!table)
                return null;
            var rowIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(table.rows, function (r) { return r.getStartPosition(); }, parPos);
            var row = table.rows[rowIndex];
            var cellIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(row.cells, function (c) { return c.startParagraphPosition.value; }, parPos);
            var cell = row.cells[cellIndex];
            return cell;
        };
        Paragraph.prototype.isInList = function () {
            return this.getNumberingListIndex() >= 0;
        };
        Paragraph.prototype.isInStyleList = function () {
            return this.paragraphStyle && this.paragraphStyle.numberingListIndex >= 0;
        };
        Paragraph.prototype.getListLevelIndex = function () {
            if (this.listLevelIndex >= 0)
                return this.listLevelIndex;
            return this.paragraphStyle ? this.paragraphStyle.getListLevelIndex() : -1;
        };
        Paragraph.prototype.getListLevel = function () {
            return this.getNumberingList().levels[this.getListLevelIndex()];
        };
        Paragraph.prototype.getNumberingListIndex = function () {
            if (this.numberingListIndex >= 0 || this.numberingListIndex === __aspxRichEdit.NumberingList.NoNumberingListIndex)
                return this.numberingListIndex;
            return this.paragraphStyle ? this.paragraphStyle.getNumberingListIndex() : -1;
        };
        Paragraph.prototype.getNumberingList = function () {
            return this.subDocument.documentModel.numberingLists[this.getNumberingListIndex()];
        };
        Paragraph.prototype.getAbstractNumberingList = function () {
            var numberingList = this.getNumberingList();
            return numberingList ? numberingList.getAbstractNumberingList() : null;
        };
        Paragraph.prototype.getAbstractNumberingListIndex = function () {
            var numberingList = this.getNumberingList();
            return numberingList ? numberingList.abstractNumberingListIndex : -1;
        };
        Paragraph.prototype.getNumberingListText = function () {
            var counters = this.subDocument.documentModel.getRangeListCounters(this);
            return this.getNumberingListTextCore(counters);
        };
        Paragraph.prototype.getNumberingListTextCore = function (counters) {
            var levels = this.getNumberingList().levels;
            var formatString = levels[this.getListLevelIndex()].getListLevelProperties().displayFormatString;
            return this.formatNumberingListText(formatString, counters, levels);
        };
        Paragraph.prototype.getNumberingListSeparatorChar = function () {
            var levels = this.getNumberingList().levels;
            return levels[this.getListLevelIndex()].getListLevelProperties().separator;
        };
        Paragraph.prototype.getNumerationCharacterProperties = function () {
            var merger = new __aspxRichEdit.CharacterPropertiesMerger();
            merger.mergeCharacterProperties(this.getNumberingList().levels[this.getListLevelIndex()].getCharacterProperties());
            merger.mergeMergedCharacterProperties(this.subDocument.getRunByPosition(this.getEndPosition() - 1).getCharacterMergedProperies());
            return this.subDocument.documentModel.cache.mergedCharacterPropertiesCache.getItem(merger.getMergedProperties());
        };
        Paragraph.prototype.formatNumberingListText = function (formatString, args, levels) {
            var _a;
            var objArgs = new Array(args.length);
            for (var i = 0; i < args.length; i++) {
                var converter = __aspxRichEdit.OrdinalBasedNumberConverter.createConverter(levels[i].getListLevelProperties().format);
                objArgs[i] = converter.convertNumber(args[i]);
            }
            try {
                return (_a = REWebUtils.Formatter).Format.apply(_a, [formatString].concat(objArgs));
            }
            catch (e) {
                try {
                    return objArgs[0];
                }
                catch (e) {
                    return "";
                }
            }
        };
        Object.defineProperty(Paragraph.prototype, "interval", {
            get: function () { return new __aspxRichEdit.FixedInterval(this.startLogPosition.value, this.length); },
            enumerable: true,
            configurable: true
        });
        Paragraph.prototype.getEndPosition = function () {
            return this.startLogPosition.value + this.length;
        };
        Paragraph.prototype.setParagraphProperties = function (properties) {
            this.maskedParagraphProperties = this.subDocument.documentModel.cache.maskedParagraphPropertiesCache.getItem(properties);
        };
        Paragraph.prototype.onParagraphPropertiesChanged = function () {
            this.resetParagraphMergedProperties();
        };
        Paragraph.prototype.resetParagraphMergedProperties = function () {
            this.mergedParagraphFormatting = null;
        };
        Paragraph.prototype.getParagraphMergedProperies = function () {
            if (!this.mergedParagraphFormatting) {
                var merger = new __aspxRichEdit.ParagraphPropertiesMerger();
                merger.mergeMaskedParagraphProperties(this.maskedParagraphProperties);
                if (this.isInList())
                    merger.mergeMaskedParagraphProperties(this.getListLevel().getParagraphProperties());
                merger.mergeParagraphStyle(this.paragraphStyle);
                var tableCell = this.getTableCell();
                if (tableCell)
                    merger.mergeTableStyle(tableCell);
                merger.mergeMaskedParagraphProperties(this.subDocument.documentModel.defaultParagraphProperties);
                this.mergedParagraphFormatting =
                    this.subDocument.documentModel.cache.mergedParagraphPropertiesCache.getItem(merger.getMergedProperties());
            }
            return this.mergedParagraphFormatting;
        };
        Paragraph.prototype.setParagraphMergedProperies = function (properties) {
            this.mergedParagraphFormatting = this.subDocument.documentModel.cache.mergedParagraphPropertiesCache.getItem(properties);
        };
        Paragraph.prototype.hasParagraphMergedProperies = function () {
            return !!this.mergedParagraphFormatting;
        };
        Paragraph.prototype.getTabs = function () {
            var result = new TabsInfo();
            result.defaultTabStop = this.subDocument.documentModel.defaultTabWidth;
            result.positions = [];
            if (this.paragraphStyle) {
                var styleTabs = this.paragraphStyle.tabs.tabsInfo;
                for (var i = 0; i < styleTabs.length; i++)
                    if (!styleTabs[i].deleted) {
                        var tabPosition = styleTabs[i].clone();
                        var index = __aspxRichEdit.Utils.binaryIndexOf(result.positions, function (t) { return t.position - styleTabs[i].position; });
                        if (index < 0)
                            result.positions.splice(~index, 0, tabPosition);
                        else
                            result.positions[index] = tabPosition;
                    }
            }
            var paragraphTabs = this.tabs.tabsInfo;
            for (var i = 0; i < paragraphTabs.length; i++) {
                var index = __aspxRichEdit.Utils.binaryIndexOf(result.positions, function (t) { return t.position - paragraphTabs[i].position; });
                if (index < 0) {
                    index = ~index;
                    if (!paragraphTabs[i].deleted)
                        result.positions.splice(index, 0, paragraphTabs[i].clone());
                }
                else {
                    if (paragraphTabs[i].deleted)
                        result.positions.splice(index, 1);
                    else
                        result.positions[index] = paragraphTabs[i].clone();
                }
            }
            return result;
        };
        return Paragraph;
    }());
    __aspxRichEdit.Paragraph = Paragraph;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableCustomUnit = (function () {
        function TableCustomUnit() {
        }
        TableCustomUnit.prototype.getHashCode = function () {
            return __aspxRichEdit.MathUtils.somePrimes[0] * this.value ^
                __aspxRichEdit.MathUtils.somePrimes[1] * this.type;
        };
        TableCustomUnit.prototype.equals = function (obj) {
            if (!obj)
                return false;
            return this.value == obj.value && this.type == obj.type;
        };
        TableCustomUnit.prototype.copyFrom = function (obj) {
            this.value = obj.value;
            this.type = obj.type;
        };
        return TableCustomUnit;
    }());
    __aspxRichEdit.TableCustomUnit = TableCustomUnit;
    var TableWidthUnit = (function (_super) {
        __extends(TableWidthUnit, _super);
        function TableWidthUnit() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableWidthUnit.createDefault = function () {
            return new TableWidthUnit().init(0, TableWidthUnitType.Nil);
        };
        TableWidthUnit.create = function (value, type) {
            return new TableWidthUnit().init(value, type);
        };
        TableWidthUnit.prototype.init = function (value, type) {
            this.value = Math.floor(value);
            this.type = type;
            return this;
        };
        TableWidthUnit.prototype.clone = function () {
            return new TableWidthUnit().init(this.value, this.type);
        };
        TableWidthUnit.prototype.asNumberNoPercentType = function (converter) {
            switch (this.type) {
                case TableWidthUnitType.Nil:
                case TableWidthUnitType.Auto:
                    return 0;
                case TableWidthUnitType.ModelUnits:
                    return converter(this.value);
                case TableWidthUnitType.FiftiethsOfPercent:
                    return 0;
            }
        };
        TableWidthUnit.prototype.asNumber = function (avaliableWidth, converter) {
            switch (this.type) {
                case TableWidthUnitType.Nil:
                case TableWidthUnitType.Auto:
                    return 0;
                case TableWidthUnitType.ModelUnits:
                    return converter(this.value);
                case TableWidthUnitType.FiftiethsOfPercent:
                    return avaliableWidth * this.value / TableWidthUnit.MAX_PERCENT_WIDTH;
            }
        };
        TableWidthUnit.prototype.divide = function (n) {
            if (n > 1)
                this.value = Math.floor(this.value / n);
        };
        TableWidthUnit.MAX_PERCENT_WIDTH = 5000;
        TableWidthUnit.MUTLIPLIER_FOR_PERCENTS = 50;
        return TableWidthUnit;
    }(TableCustomUnit));
    __aspxRichEdit.TableWidthUnit = TableWidthUnit;
    var TableHeightUnit = (function (_super) {
        __extends(TableHeightUnit, _super);
        function TableHeightUnit() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableHeightUnit.prototype.init = function (value, type) {
            this.value = Math.floor(value);
            this.type = type;
            return this;
        };
        TableHeightUnit.prototype.clone = function () {
            return new TableHeightUnit().init(this.value, this.type);
        };
        TableHeightUnit.create = function (value, type) {
            return new TableHeightUnit().init(value, type);
        };
        TableHeightUnit.createDefault = function () {
            return new TableHeightUnit().init(0, TableHeightUnitType.Auto);
        };
        return TableHeightUnit;
    }(TableCustomUnit));
    __aspxRichEdit.TableHeightUnit = TableHeightUnit;
    var TableHeightUnitType;
    (function (TableHeightUnitType) {
        TableHeightUnitType[TableHeightUnitType["Minimum"] = 0] = "Minimum";
        TableHeightUnitType[TableHeightUnitType["Auto"] = 1] = "Auto";
        TableHeightUnitType[TableHeightUnitType["Exact"] = 2] = "Exact";
    })(TableHeightUnitType = __aspxRichEdit.TableHeightUnitType || (__aspxRichEdit.TableHeightUnitType = {}));
    var TableWidthUnitType;
    (function (TableWidthUnitType) {
        TableWidthUnitType[TableWidthUnitType["Nil"] = 0] = "Nil";
        TableWidthUnitType[TableWidthUnitType["Auto"] = 1] = "Auto";
        TableWidthUnitType[TableWidthUnitType["FiftiethsOfPercent"] = 2] = "FiftiethsOfPercent";
        TableWidthUnitType[TableWidthUnitType["ModelUnits"] = 3] = "ModelUnits";
    })(TableWidthUnitType = __aspxRichEdit.TableWidthUnitType || (__aspxRichEdit.TableWidthUnitType = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FocusManager = (function () {
        function FocusManager(canvasManager, owner, inputController, eventManager) {
            this.canvasManager = canvasManager;
            this.owner = owner;
            this.inputController = inputController;
            this.eventManager = eventManager;
        }
        Object.defineProperty(FocusManager.prototype, "isInFocus", {
            get: function () {
                return this.isFocus;
            },
            set: function (focused) {
                if (this.isFocus !== focused) {
                    this.isFocus = focused;
                    this.canvasManager.focusChanged(focused);
                }
            },
            enumerable: true,
            configurable: true
        });
        FocusManager.prototype.captureFocus = function () {
            if (this.owner.canCaptureFocus()) {
                if (!REWebUtils.Browser.MacOSMobilePlatform || this.owner.isInitialized)
                    this.inputController.captureFocus();
                this.eventManager.onFocusIn();
            }
        };
        return FocusManager;
    }());
    __aspxRichEdit.FocusManager = FocusManager;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var PublicApiEventType;
    (function (PublicApiEventType) {
        PublicApiEventType[PublicApiEventType["None"] = 0] = "None";
        PublicApiEventType[PublicApiEventType["ModelChanged"] = 1] = "ModelChanged";
        PublicApiEventType[PublicApiEventType["SelectionChanged"] = 2] = "SelectionChanged";
    })(PublicApiEventType || (PublicApiEventType = {}));
    var PublicEvent = (function () {
        function PublicEvent(type, action) {
            this.type = type;
            this.action = action;
        }
        return PublicEvent;
    }());
    var GlobalEventDispatcher = (function (_super) {
        __extends(GlobalEventDispatcher, _super);
        function GlobalEventDispatcher(rich, onModelChanged) {
            var _this = _super.call(this) || this;
            _this.deferredEvents = [];
            _this.rich = rich;
            _this.onModelChanged = onModelChanged;
            return _this;
        }
        GlobalEventDispatcher.prototype.addDeferredEvent = function (e, type) {
            if (type === void 0) { type = PublicApiEventType.None; }
            if (!this.rich.commandManager.isPublicApiCall || this.rich.options.raiseClientEventsOnModificationsViaAPI) {
                this.deferredEvents.push(new PublicEvent(type, e));
                this.handleDeferredEvents();
            }
        };
        GlobalEventDispatcher.prototype.handleDeferredEvents = function () {
            if (!this.isLocked() && (!this.rich.commandManager.isPublicApiCall || this.rich.options.raiseClientEventsOnModificationsViaAPI)) {
                var singleEvents_1 = [];
                this.deferredEvents = __aspxRichEdit.ListUtils.reducedMap(this.deferredEvents, function (e) {
                    if (e.type == PublicApiEventType.None)
                        return e;
                    singleEvents_1.push(e);
                    return null;
                });
                __aspxRichEdit.ListUtils.addListOnTail(this.deferredEvents, __aspxRichEdit.ListUtils.unique(singleEvents_1, function (a, b) { return a.type - b.type; }));
                for (var action = void 0; action = this.deferredEvents.shift();)
                    action.action();
            }
        };
        GlobalEventDispatcher.prototype.onUpdateUnlocked = function (_occurredEvents) {
            this.handleDeferredEvents();
        };
        GlobalEventDispatcher.prototype.processModelChanged = function () {
            var _this = this;
            this.addDeferredEvent(function () { return _this.onModelChanged(); }, PublicApiEventType.ModelChanged);
        };
        GlobalEventDispatcher.prototype.NotifySelectionChanged = function (_selection) {
            var _this = this;
            this.addDeferredEvent(function () { return _this.rich.clientSideEvents.raiseSelectionChanged(); }, PublicApiEventType.SelectionChanged);
        };
        GlobalEventDispatcher.prototype.NotifyScrollPositionChanged = function () { };
        GlobalEventDispatcher.prototype.NotifySimpleRunInserted = function (subDocument, position, length, _characterProperties, _characterStyle, _type, _text) {
            var _this = this;
            this.processModelChanged();
            this.addDeferredEvent(function () { return _this.rich.clientSideEvents.raiseContentInserted(subDocument.id, new __aspxRichEdit.FixedInterval(position, length)); });
        };
        GlobalEventDispatcher.prototype.NotifyParagraphInserted = function (subDocument, position, _paragraph) {
            var _this = this;
            this.processModelChanged();
            this.addDeferredEvent(function () { return _this.rich.clientSideEvents.raiseContentInserted(subDocument.id, new __aspxRichEdit.FixedInterval(position, 1)); });
        };
        GlobalEventDispatcher.prototype.NotifySectionInserted = function (subDocument, position, _section, _sectionIndex) {
            var _this = this;
            this.processModelChanged();
            this.addDeferredEvent(function () { return _this.rich.clientSideEvents.raiseContentInserted(subDocument.id, new __aspxRichEdit.FixedInterval(position, 1)); });
        };
        GlobalEventDispatcher.prototype.NotifyInlinePictureInserted = function (subDocument, position, _id, _scaleX, _scaleY) {
            var _this = this;
            this.processModelChanged();
            this.addDeferredEvent(function () { return _this.rich.clientSideEvents.raiseContentInserted(subDocument.id, new __aspxRichEdit.FixedInterval(position, 1)); });
        };
        GlobalEventDispatcher.prototype.NotifyAnchoredPictureInserted = function (subDocument, _objectId, position, _id, _size, _anchorInfo) {
            var _this = this;
            this.processModelChanged();
            this.addDeferredEvent(function () { return _this.rich.clientSideEvents.raiseContentInserted(subDocument.id, new __aspxRichEdit.FixedInterval(position, 1)); });
        };
        GlobalEventDispatcher.prototype.NotifyAnchoredTextBoxInserted = function (subDocument, _objectId, _subDocId, position, _anchorInfo) {
            var _this = this;
            this.processModelChanged();
            this.addDeferredEvent(function () { return _this.rich.clientSideEvents.raiseContentInserted(subDocument.id, new __aspxRichEdit.FixedInterval(position, 1)); });
        };
        GlobalEventDispatcher.prototype.NotifyAnchorObjectRemoved = function (_subDocument, _objectId, _position) {
        };
        GlobalEventDispatcher.prototype.NotifyLoadInlinePictures = function (_subDocument, _imagesInfo) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyInlinePicturesUpdated = function (_subDocument, _updatedImagesInfo) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyIntervalRemoved = function (subDocument, position, length) {
            var _this = this;
            this.processModelChanged();
            this.addDeferredEvent(function () { return _this.rich.clientSideEvents.raiseContentRemoved(subDocument.id, new __aspxRichEdit.FixedInterval(position, length)); });
        };
        GlobalEventDispatcher.prototype.NotifySectionMerged = function (_subDocument, _sectionIndex, _getPropertiesFromNext) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyParagraphMerged = function (_subDocument, _position, _getPropertiesFromNext) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyCharacterFormattingChanged = function (subDocument, _property, newState) {
            var _this = this;
            this.processModelChanged();
            this.addDeferredEvent(function () { return _this.rich.clientSideEvents.raiseCharacterPropertiesChanged(subDocument.id, newState.interval); });
        };
        GlobalEventDispatcher.prototype.NotifyCharacterPropertiesChanged = function (subDocument, newState) {
            var _this = this;
            this.processModelChanged();
            this.addDeferredEvent(function () { return _this.rich.clientSideEvents.raiseCharacterPropertiesChanged(subDocument.id, newState.interval); });
        };
        GlobalEventDispatcher.prototype.NotifyParagraphFormattingChanged = function (subDocument, _property, newState) {
            var _this = this;
            this.processModelChanged();
            var paragraphIndexs = subDocument.getParagraphsIndices(newState.interval);
            var _loop_3 = function (i) {
                var parInd = i;
                this_3.addDeferredEvent(function () { return _this.rich.clientSideEvents.raiseParagraphPropertiesChanged(subDocument.id, parInd); });
            };
            var this_3 = this;
            for (var i = paragraphIndexs.start; i < paragraphIndexs.end; i++) {
                _loop_3(i);
            }
        };
        GlobalEventDispatcher.prototype.NotifyParagraphPropertiesChanged = function (subDocument, paragraphIndex, _properties, _style, _tabs, _numberingListIndex, _listLevelIndex) {
            var _this = this;
            this.processModelChanged();
            this.addDeferredEvent(function () { return _this.rich.clientSideEvents.raiseParagraphPropertiesChanged(subDocument.id, paragraphIndex); });
        };
        GlobalEventDispatcher.prototype.NotifySectionFormattingChanged = function (_section, _sectionIndex, _property, _newState) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyInlineObjectRunPropertyChanged = function (_subDocument, _property, _position, _newState) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyAnchoredPictureSizeChanged = function (_subDocument, _objectId, _position, _newState) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyAnchoredTextBoxSizeChanged = function (_subDocument, _objectId, _position, _newState) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyAnchoredTextBoxPropertiesChanged = function (_subDocument, _objectId, _position, _newState) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyAnchorInfoPropertyChanged = function (_subDocument, _objectId, _property, _newState) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyShapeChanged = function (_subDocument, _objectId, _newState) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyShapePropertyChanged = function (_subDocument, _objectId, _property, _newState) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyTabInserted = function (_subDocument, _newState) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyTabDeleted = function (_subDocument, _newState) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyCreateStyleLink = function (_paragraphStyleName) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyDeleteStyleLink = function (_paragraphStyleName) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyCharacterStyleApplied = function (_subDocument, _newState) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyParagraphStyleApplied = function (_subDocument, _newState) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyTextBufferChanged = function (_subDocument, _newState) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyParagraphNumberingListChanged = function (_subDocument, _newState, _oldAbstractNumberingListIndex) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyAbstractNumberingListAdded = function (_index) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyAbstractNumberingListDeleted = function (_index) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyNumberingListAdded = function (_index) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyNumberingListDeleted = function (_index) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyListLevelPropertyChanged = function (_property, _newState) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyListLevelParagraphPropertyChanged = function (_property, _newState) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyListLevelCharacterPropertyChanged = function (_property, _newState) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyIOverrideListLevelChanged = function (_property, _newState) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyFieldInserted = function (_subDocument, _startPosition, _separatorPosition, _endPosition) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyFieldDeleted = function (_subDocument, _endPosition) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyHyperlinkInfoChanged = function (_subDocument, _fieldResultInterval, _fieldCodeInterval, _newHyperlinkInfo) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyDefaultTabWidthChanged = function (_defaultTabWidth) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyPageColorChanged = function (_pageColor) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyDifferentOddAndEvenPagesChanged = function (_newValue) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyHeaderFooterCreated = function (_isHeader, _type, _subDocumentInfo) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyHeaderFooterIndexChanged = function (_sectionIndex, _isHeader, _type, _newIndex, _model) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyBookmarkCreated = function (_subDocument, _newState) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyBookmarkDeleted = function (_subDocument, _newState) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyTableCreated = function (_subDocument, _table) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyTableRemoved = function (subDocument, startPosition, endPosition, _nestedLevel) {
            var _this = this;
            this.processModelChanged();
            this.addDeferredEvent(function () { return _this.rich.clientSideEvents.raiseContentRemoved(subDocument.id, __aspxRichEdit.FixedInterval.fromPositions(startPosition, endPosition)); });
        };
        GlobalEventDispatcher.prototype.NotifyTableStartPositionShifted = function (_subDocument, _table, _oldPosition, _newPosition) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyTableCellPropertyChanged = function (_subDocument, _property, _newState) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyTablePropertyChanged = function (_subDocument, _property, _newState) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyTableRowPropertyChanged = function (_subDocument, _property, _newState) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyTableCellSplittedHorizontally = function (_subDocument, _table, _rowIndex, _cellIndex, _rightDirection) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyTableCellMergedHorizontally = function (_subDocument, _table, _rowIndex, _cellIndex, _rightDirection) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyTableRowInserted = function (_subDocument, _table, _rowIndex) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyTableRowRemoved = function (_subDocument, _table, _rowIndex) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyTableCellRemoved = function (_subDocument, _table, _rowIndex, _cellIndex) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyTableCellInserted = function (_subDocument, _table, _rowIndex, _cellIndex) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyTableStyleChanged = function (_subDocument, _table, _newStyle) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyParagraphAndCharacterMergedPropertiesReset = function (_subDocument, _interval) {
            this.processModelChanged();
        };
        GlobalEventDispatcher.prototype.NotifyLoadFontInfo = function (_fontInfo, _fontIndex) { };
        return GlobalEventDispatcher;
    }(__aspxRichEdit.BatchUpdatableObject));
    __aspxRichEdit.GlobalEventDispatcher = GlobalEventDispatcher;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlExporter = (function () {
        function HtmlExporter(control) {
            this.rangeCopy = null;
            this.control = control;
        }
        Object.defineProperty(HtmlExporter.prototype, "colorProvider", {
            get: function () { return this.control.model.colorProvider; },
            enumerable: true,
            configurable: true
        });
        HtmlExporter.prototype.getHtmlElementsByInterval = function (model, subDocument, interval) {
            if (interval.length === 0)
                return "";
            var unitConverter = this.control.uiUnitConverter;
            var unitTypeToString = unitConverter.getUnits() == __aspxRichEdit.RichEditUnit.Centimeter ? "cm" : "in";
            var iterator = subDocument.getConstRunIterator(interval);
            var remainLength = interval.length;
            var currentPosition = interval.start;
            var renderer = this.control.viewManager.renderer;
            var result = "";
            var paragraphsInInterval = subDocument.getParagraphsByInterval(interval);
            var paragraphs = [];
            for (var i = 0, paragraphInInterval; paragraphInInterval = paragraphsInInterval[i]; i++) {
                if (interval.containsWithIntervalEnd(paragraphInInterval.getEndPosition()))
                    paragraphs.push(paragraphInInterval);
            }
            var listsInInterval = [];
            for (var i = 0, paragraph; paragraph = paragraphs[i]; i++) {
                if (paragraph.isInList()) {
                    var paragraphNumberingListIndex = paragraph.getNumberingListIndex();
                    var paragraphListLevelIndex = paragraph.getListLevelIndex();
                    var paragraphStart = paragraph.startLogPosition.value;
                    var paragraphEnd = paragraph.getEndPosition();
                    var existingItem = null;
                    for (var j = 0; j < listsInInterval.length; j++) {
                        if (listsInInterval[j].numberingListIndex == paragraphNumberingListIndex && listsInInterval[j].listLevelIndex == paragraphListLevelIndex)
                            existingItem = listsInInterval[j];
                    }
                    if (existingItem && (paragraphListLevelIndex == 0 || existingItem.end == paragraphStart
                        || listsInInterval[listsInInterval.length - 1].listLevelIndex > paragraphListLevelIndex)) {
                        existingItem.end = paragraphEnd;
                    }
                    else {
                        listsInInterval.push({
                            numberingListIndex: paragraphNumberingListIndex, listLevelIndex: paragraphListLevelIndex,
                            start: paragraphStart, end: paragraphEnd
                        });
                    }
                    var listLevelIndex = paragraphListLevelIndex;
                    while (listLevelIndex > 0) {
                        var parentItem = null;
                        for (var j = 0; j < listsInInterval.length; j++) {
                            if (listsInInterval[j].listLevelIndex == listLevelIndex - 1)
                                parentItem = listsInInterval[j];
                        }
                        if (parentItem)
                            parentItem.end = paragraphEnd;
                        listLevelIndex--;
                    }
                }
            }
            var isInsideFieldCode = false;
            var hyperlinkInfo = null;
            var hasFields = false;
            while (iterator.moveNext()) {
                var tableCell = __aspxRichEdit.Table.getTableCellByPosition(subDocument.tables, iterator.currentInterval().start);
                var isContinueMergingCell = tableCell && tableCell.verticalMerging === __aspxRichEdit.TableCellMergingState.Continue;
                var listToStartIndex = -1;
                var listsToEndIndices = [];
                if (!tableCell) {
                    if (listsInInterval.length) {
                        var currentPosition_1 = iterator.currentInterval().start;
                        for (var i = 0; i < listsInInterval.length; i++) {
                            if (listsInInterval[i].start == currentPosition_1)
                                listToStartIndex = i;
                            if (listsInInterval[i].end == iterator.currentInterval().end)
                                listsToEndIndices.push(i);
                        }
                        if (listToStartIndex < 0 && currentPosition_1 == interval.start) {
                            var firstParagraph = subDocument.getParagraphByPosition(currentPosition_1);
                            if (firstParagraph.getNumberingListIndex() == listsInInterval[0].numberingListIndex)
                                listToStartIndex = 0;
                        }
                    }
                    if (listToStartIndex > -1) {
                        var numberingList = model.numberingLists[listsInInterval[listToStartIndex].numberingListIndex];
                        var listFormatType = "";
                        switch (numberingList.levels[listsInInterval[listToStartIndex].listLevelIndex].getListLevelProperties().format) {
                            case __aspxRichEdit.NumberingFormat.Bullet:
                                listFormatType = "disc";
                                break;
                            case __aspxRichEdit.NumberingFormat.Decimal:
                                listFormatType = "decimal";
                                break;
                            case __aspxRichEdit.NumberingFormat.LowerLetter:
                                listFormatType = "lower-alpha";
                                break;
                            case __aspxRichEdit.NumberingFormat.UpperLetter:
                                listFormatType = "upper-alpha";
                                break;
                            case __aspxRichEdit.NumberingFormat.LowerRoman:
                                listFormatType = "lower-roman";
                                break;
                            case __aspxRichEdit.NumberingFormat.UpperRoman:
                                listFormatType = "upper-roman";
                                break;
                            default:
                                break;
                        }
                        result += "<" + (numberingList.getListType() != __aspxRichEdit.NumberingType.Bullet ? "ol" : "ul") + " style=\"list-style-type:" + listFormatType + "\">";
                    }
                }
                var run = iterator.currentRun;
                var isRunInEmptyParagraph = run.paragraph.length === 1;
                if (paragraphs.length && (run.getType() != __aspxRichEdit.RunType.ParagraphRun || isRunInEmptyParagraph)) {
                    var paragraphToStartIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(paragraphs, function (p) { return p.startLogPosition.value; }, currentPosition);
                    if (paragraphToStartIndex > -1) {
                        var currentParagraph = paragraphs[paragraphToStartIndex];
                        paragraphs.splice(paragraphToStartIndex, 1);
                        if (tableCell) {
                            var parentRow = tableCell.parentRow;
                            var parentTable = parentRow.parentTable;
                            var paragraphStartPosition = currentParagraph.startLogPosition.value;
                            if (parentTable.getStartPosition() == paragraphStartPosition) {
                                if (parentTable.parentCell) {
                                    var parentCell = parentTable.parentCell;
                                    while (parentCell) {
                                        var currentParentRow = parentCell.parentRow;
                                        var currentParentTable = currentParentRow.parentTable;
                                        if (currentParentTable.getStartPosition() == paragraphStartPosition)
                                            result += "<table style=\"" + this.getTableStyle(model, currentParentTable) + "\"><tbody>";
                                        if (currentParentRow.getStartPosition() == paragraphStartPosition) {
                                            result += "<tr>";
                                            if (currentParentRow.gridBefore > 0)
                                                result += "<td style=\"mso-cell-special:placeholder\" colspan=\"" + currentParentRow.gridBefore + "\">&nbsp;</td>";
                                        }
                                        if (parentCell.startParagraphPosition.value == paragraphStartPosition)
                                            result += "<td style=\"" + this.getCellStyle(model, parentCell) + "\"" + (parentCell.columnSpan > 1 ? " colspan=\"" + parentCell.columnSpan + "\"" : "") + ">";
                                        parentCell = currentParentTable.parentCell;
                                    }
                                }
                                result += "<table style=\"" + this.getTableStyle(model, parentTable) + "\"><tbody>";
                            }
                            if (parentRow.getStartPosition() == paragraphStartPosition) {
                                result += "<tr>";
                                if (parentRow.gridBefore > 0)
                                    result += "<td style=\"mso-cell-special:placeholder\" colspan=\"" + parentRow.gridBefore + "\">&nbsp;</td>";
                            }
                            if (tableCell.startParagraphPosition.value == paragraphStartPosition && !isContinueMergingCell) {
                                var rowSpan = 1;
                                if (tableCell.verticalMerging === __aspxRichEdit.TableCellMergingState.Restart) {
                                    var rowIndex = parentTable.rows.indexOf(parentRow);
                                    var cellIndex = parentRow.cells.indexOf(tableCell);
                                    for (var i_1 = rowIndex + 1, row = void 0; row = parentTable.rows[i_1]; i_1++) {
                                        var nextRowCellIndex = cellIndex;
                                        if (row.cells.length != parentRow.cells.length) {
                                            var extraCellsCount = 0;
                                            var isNextRowLonger = row.cells.length > parentRow.cells.length;
                                            var shorterRow = isNextRowLonger ? parentRow : row;
                                            for (var j_1 = 0; (j_1 < cellIndex) && (j_1 < shorterRow.cells.length); j_1++) {
                                                extraCellsCount += shorterRow.cells[j_1].columnSpan - 1;
                                                if (!isNextRowLonger)
                                                    extraCellsCount -= parentRow.cells[j_1].columnSpan - 1;
                                            }
                                            nextRowCellIndex += (isNextRowLonger ? 1 : -1) * extraCellsCount;
                                        }
                                        var nextRowCell = row.cells[nextRowCellIndex];
                                        if (nextRowCell && nextRowCell.verticalMerging === __aspxRichEdit.TableCellMergingState.Continue)
                                            rowSpan++;
                                        else
                                            break;
                                    }
                                }
                                result += "<td style=\"" + this.getCellStyle(model, tableCell) + "\"" + (rowSpan > 1 ? " rowspan=\"" + rowSpan + "\"" : "") +
                                    (tableCell.columnSpan > 1 ? " colspan=\"" + tableCell.columnSpan + "\"" : "") + ">";
                            }
                        }
                        if (!isContinueMergingCell) {
                            var maskedParagraphProperties = currentParagraph.getParagraphMergedProperies();
                            var paragraphStyle = "";
                            var firstLineIndentType = maskedParagraphProperties.firstLineIndentType;
                            if (firstLineIndentType != __aspxRichEdit.ParagraphFirstLineIndent.None) {
                                paragraphStyle += "text-indent: " + (firstLineIndentType == __aspxRichEdit.ParagraphFirstLineIndent.Hanging ? "-" : "") +
                                    unitConverter.twipsToUI(maskedParagraphProperties.firstLineIndent) + unitTypeToString + ";";
                            }
                            if (maskedParagraphProperties.alignment != __aspxRichEdit.ParagraphAlignment.Unspecified) {
                                paragraphStyle += "text-align: ";
                                switch (maskedParagraphProperties.alignment) {
                                    case __aspxRichEdit.ParagraphAlignment.Left:
                                        paragraphStyle += "left;";
                                        break;
                                    case __aspxRichEdit.ParagraphAlignment.Right:
                                        paragraphStyle += "right;";
                                        break;
                                    case __aspxRichEdit.ParagraphAlignment.Justify:
                                        paragraphStyle += "justify;";
                                        break;
                                    case __aspxRichEdit.ParagraphAlignment.Center:
                                        paragraphStyle += "center;";
                                        break;
                                    default:
                                        break;
                                }
                            }
                            if (maskedParagraphProperties.lineSpacingType != __aspxRichEdit.ParagraphLineSpacingType.Single) {
                                var lineSpacingInUI = unitConverter.twipsToUI(maskedParagraphProperties.lineSpacing) + unitTypeToString + ";";
                                paragraphStyle += "line-height: ";
                                switch (maskedParagraphProperties.lineSpacingType) {
                                    case __aspxRichEdit.ParagraphLineSpacingType.AtLeast:
                                        paragraphStyle += lineSpacingInUI;
                                        break;
                                    case __aspxRichEdit.ParagraphLineSpacingType.Double:
                                        paragraphStyle += "2;";
                                        break;
                                    case __aspxRichEdit.ParagraphLineSpacingType.Exactly:
                                        paragraphStyle += lineSpacingInUI + "mso-line-height-rule: exactly;";
                                        break;
                                    case __aspxRichEdit.ParagraphLineSpacingType.Multiple:
                                        paragraphStyle += maskedParagraphProperties.lineSpacing + ";";
                                        break;
                                    case __aspxRichEdit.ParagraphLineSpacingType.Sesquialteral:
                                        paragraphStyle += "1.5;";
                                        break;
                                    default:
                                        break;
                                }
                            }
                            if (__aspxRichEdit.ColorHelper.getAlpha(maskedParagraphProperties.shadingInfo.getActualColor(this.colorProvider)) > 0)
                                paragraphStyle += "background: " + __aspxRichEdit.ColorHelper.getCssStringInternal(maskedParagraphProperties.shadingInfo.getActualColor(this.colorProvider)) + ";";
                            if (maskedParagraphProperties.leftIndent)
                                paragraphStyle += "margin-left: " + unitConverter.twipsToUI(maskedParagraphProperties.leftIndent) + unitTypeToString + ";";
                            if (maskedParagraphProperties.rightIndent)
                                paragraphStyle += "margin-right: " + unitConverter.twipsToUI(maskedParagraphProperties.rightIndent) + unitTypeToString + ";";
                            paragraphStyle += "margin-top: " + unitConverter.twipsToUI(maskedParagraphProperties.spacingBefore) + unitTypeToString + ";";
                            paragraphStyle += "margin-bottom: " + unitConverter.twipsToUI(maskedParagraphProperties.spacingAfter) + unitTypeToString + ";";
                            var topBorderStyle = this.getBorderCssString(maskedParagraphProperties.topBorder);
                            if (topBorderStyle)
                                paragraphStyle += "border-top:" + topBorderStyle + ";";
                            var leftBorderStyle = this.getBorderCssString(maskedParagraphProperties.leftBorder);
                            if (leftBorderStyle)
                                paragraphStyle += "border-left:" + leftBorderStyle + ";";
                            var bottomBorderStyle = this.getBorderCssString(maskedParagraphProperties.bottomBorder);
                            if (bottomBorderStyle)
                                paragraphStyle += "border-bottom:" + bottomBorderStyle + ";";
                            var rightBorderStyle = this.getBorderCssString(maskedParagraphProperties.rightBorder);
                            if (rightBorderStyle)
                                paragraphStyle += "border-right:" + rightBorderStyle + ";";
                            if (isRunInEmptyParagraph) {
                                var charProps = run.getCharacterMergedProperies();
                                paragraphStyle += __aspxRichEdit.HtmlConverter.getCssRules(charProps, charProps.textColor.toRgb(this.colorProvider), false, false).join(";");
                            }
                            result += (currentParagraph.isInList() && !tableCell ? "<li>" : "") + "<p" + (paragraphStyle ? " style=\"" + paragraphStyle + "\"" : "") + ">";
                            if (isRunInEmptyParagraph)
                                result += "&nbsp;";
                        }
                    }
                }
                var html = "";
                var innerHtml = "";
                var length = Math.min(remainLength, iterator.currentInterval().length);
                switch (run.getType()) {
                    case __aspxRichEdit.RunType.ParagraphRun:
                        if (!isContinueMergingCell) {
                            html = "</p>";
                            var paragraphEndPosition = run.paragraph.getEndPosition();
                            if (tableCell) {
                                var parentRow = tableCell.parentRow;
                                var parentTable = parentRow.parentTable;
                                if (tableCell.endParagrapPosition.value == paragraphEndPosition)
                                    html += "</td>";
                                if (parentRow.getEndPosition() == paragraphEndPosition) {
                                    if (parentRow.gridAfter > 0)
                                        html += "<td style=\"mso-cell-special:placeholder\" colspan=\"" + parentRow.gridAfter + "\">&nbsp;</td>";
                                    html += "</tr>";
                                }
                                if (parentTable.getEndPosition() == paragraphEndPosition)
                                    html += "</tbody></table>";
                            }
                        }
                        break;
                    case __aspxRichEdit.RunType.InlinePictureRun:
                    case __aspxRichEdit.RunType.AnchoredPictureRun:
                        var picRun = run;
                        var charMergProps = run.getCharacterMergedProperies();
                        var pictureBox = new __aspxRichEdit.LayoutPictureBox(charMergProps, charMergProps.getLayoutColorInfo(this.colorProvider), picRun.id, __aspxRichEdit.UnitConverter.twipsToPixels(picRun.getActualWidth()), __aspxRichEdit.UnitConverter.twipsToPixels(picRun.getActualHeight()));
                        innerHtml = renderer.renderPicture(pictureBox);
                        break;
                    case __aspxRichEdit.RunType.InlineTextBoxRun:
                    case __aspxRichEdit.RunType.AnchoredTextBoxRun:
                        var textBoxRun = run;
                        var internalSubDocument = this.control.model.subDocuments[textBoxRun.subDocId];
                        innerHtml = "<table border='1' style='border-width: 0px; border-collapse: collapse; border-spacing: 0px;'><tbody><tr>";
                        innerHtml += "<td style='" + this.getTextBoxStyleString(textBoxRun) + "'>";
                        innerHtml += this.getHtmlElementsByInterval(model, internalSubDocument, new __aspxRichEdit.FixedInterval(0, internalSubDocument.getDocumentEndPosition()));
                        innerHtml += "</td></tr></tbody></table>";
                        break;
                    case __aspxRichEdit.RunType.FieldCodeStartRun:
                        isInsideFieldCode = true;
                        var fieldIndex = __aspxRichEdit.Field.normedBinaryIndexOf(subDocument.fields, currentPosition + 1);
                        var field = subDocument.fields[fieldIndex];
                        if (field.isHyperlinkField())
                            hyperlinkInfo = field.getHyperlinkInfo();
                        break;
                    case __aspxRichEdit.RunType.FieldCodeEndRun:
                        isInsideFieldCode = false;
                        break;
                    case __aspxRichEdit.RunType.FieldResultEndRun:
                        hasFields = true;
                        break;
                    case __aspxRichEdit.RunType.LayoutDependentRun:
                        var currentField = subDocument.fields[__aspxRichEdit.Field.normedBinaryIndexOf(subDocument.fields, currentPosition)];
                        if (currentField) {
                            var codeText = REWebUtils.Str.Trim(subDocument.getText(currentField.getCodeInterval()).split("\\")[0]).toUpperCase();
                            if (codeText == "NUMPAGES")
                                innerHtml = this.control.layout.lastMaxNumPages.toString();
                            else if (codeText == "PAGE")
                                innerHtml = (this.control.selection.pageIndex + 1).toString();
                        }
                        break;
                    default:
                        if (!isInsideFieldCode) {
                            var text = subDocument.getText(new __aspxRichEdit.FixedInterval(currentPosition, length));
                            switch (text.charAt(0)) {
                                case __aspxRichEdit.RichUtils.specialCharacters.PageBreak:
                                    innerHtml = "<br style=\"page-break-before:always\">";
                                    break;
                                case __aspxRichEdit.RichUtils.specialCharacters.LineBreak:
                                    innerHtml = "<br>";
                                    break;
                                default:
                                    innerHtml = __aspxRichEdit.HTMLUtils.encodeHtml(text);
                                    break;
                            }
                        }
                        break;
                }
                if (!html && innerHtml) {
                    var characterProperties = run.getCharacterMergedProperies();
                    var boxStyle = "white-space:pre;" + __aspxRichEdit.HtmlConverter.getCssRules(characterProperties, characterProperties.textColor.toRgb(this.colorProvider), run.getType() == __aspxRichEdit.RunType.TextRun, false).join(";");
                    html = "<span style=\"" + boxStyle + "\">" + innerHtml + "</span>";
                    if (hyperlinkInfo) {
                        var url = hyperlinkInfo.uri + (hyperlinkInfo.anchor != "" ? "#" + hyperlinkInfo.anchor : "");
                        var tooltip = hyperlinkInfo.tip;
                        html = "<a href=\"" + url + "\" title=\"" + tooltip + "\">" + html + "</a>";
                        hyperlinkInfo = null;
                    }
                    else {
                        if (characterProperties.fontUnderlineType != __aspxRichEdit.UnderlineType.None && !characterProperties.underlineWordsOnly) {
                            var underlineColor = characterProperties.underlineColor.toRgb(this.colorProvider);
                            var cssColorValue = (underlineColor != __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR) ? __aspxRichEdit.ColorHelper.getCssStringInternal(underlineColor) : "initial";
                            html = "<span style=\"text-decoration: underline; color: " + cssColorValue + "\">" + html + "</span>";
                        }
                        if (characterProperties.script !== __aspxRichEdit.CharacterFormattingScript.Normal)
                            html = "<span style=\"font-size: " + characterProperties.fontSize + "px;\">" + html + "</span>";
                        if (__aspxRichEdit.ColorHelper.getAlpha(__aspxRichEdit.CharacterProperties.getActualBackgroundColor(characterProperties, this.colorProvider)) > 0)
                            html = "<span style=\"background: " + __aspxRichEdit.ColorHelper.getCssStringInternal(__aspxRichEdit.CharacterProperties.getActualBackgroundColor(characterProperties, this.colorProvider)) + "\">" + html + "</span>";
                    }
                }
                result += html;
                if (listsToEndIndices.length) {
                    for (var i = listsToEndIndices.length - 1; i >= 0; i--)
                        result += "</" + (model.numberingLists[listsInInterval[listsToEndIndices[i]].numberingListIndex].getListType() != __aspxRichEdit.NumberingType.Bullet ? "ol" : "ul") + ">";
                }
                currentPosition += length;
                remainLength -= length;
            }
            if (/^<td[^>]*>/gi.test(result))
                result = "<tr>" + result;
            if (/<\/td>$/gi.test(result))
                result += "</tr>";
            if (/^<tr[^>]*>/gi.test(result))
                result = "<table style=\"" + this.getTableStyle(model, null) + "\"><tbody>" + result;
            if (/<\/tr>$/gi.test(result))
                result += "</tbody></table>";
            if (hasFields && __aspxRichEdit.StringUtils.isNullOrEmpty(result))
                result = "<span class='field-mark'>&nbsp;</span>";
            return result;
        };
        HtmlExporter.prototype.getBorderCssString = function (borderInfo) {
            var borderStyle = "";
            if (borderInfo) {
                if (borderInfo.width)
                    borderStyle += " " + __aspxRichEdit.UnitConverter.twipsToPixels(borderInfo.width) + "px";
                switch (borderInfo.style) {
                    case __aspxRichEdit.BorderLineStyle.Dashed:
                        borderStyle += " dashed";
                        break;
                    case __aspxRichEdit.BorderLineStyle.Dotted:
                        borderStyle += " dotted";
                        break;
                    case __aspxRichEdit.BorderLineStyle.Double:
                        borderStyle += " double";
                        break;
                    case __aspxRichEdit.BorderLineStyle.Inset:
                        borderStyle += " inset";
                        break;
                    case __aspxRichEdit.BorderLineStyle.None:
                        borderStyle += " none";
                        break;
                    case __aspxRichEdit.BorderLineStyle.Outset:
                        borderStyle += " outset";
                        break;
                    case __aspxRichEdit.BorderLineStyle.Single:
                        borderStyle += " solid";
                    default:
                        break;
                }
                var rgba = this.control.model.colorProvider.getRgbaFromModelColor(borderInfo.color);
                if (__aspxRichEdit.ColorHelper.getAlpha(rgba) > 0)
                    borderStyle += " " + __aspxRichEdit.ColorHelper.getCssStringInternal(rgba);
            }
            return borderStyle;
        };
        HtmlExporter.prototype.getTableWidthUnitCssString = function (width) {
            return width.type == __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent ? width.value / 50 + "%" : __aspxRichEdit.UnitConverter.twipsToPoints(width.value) + "pt";
        };
        HtmlExporter.prototype.getTableStyle = function (model, table) {
            var defaultTableProperties = model.defaultTableProperties;
            var tableProperties = table ? table.properties : defaultTableProperties;
            var style = table ? table.style : model.getDefaultTableStyle();
            var tableStyle = "";
            var tableIndent = new __aspxRichEdit.TablePropertiesMergerIndent().getProperty(tableProperties, style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, defaultTableProperties);
            if (tableIndent.value)
                tableStyle += "margin-left:" + this.getTableWidthUnitCssString(tableIndent) + ";";
            var cellSpacing = new __aspxRichEdit.TablePropertiesMergerCellSpacing().getProperty(tableProperties, style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, defaultTableProperties);
            tableStyle += (cellSpacing.value ? "border-spacing:" + this.getTableWidthUnitCssString(cellSpacing) : "border-collapse: collapse") + ";";
            return tableStyle;
        };
        HtmlExporter.prototype.getCellStyle = function (model, cell) {
            var cellProperties = cell.properties;
            var defaultTableProperties = model.defaultTableProperties;
            var defaultCellProperties = model.defaultTableCellProperties;
            var parentTable = cell.parentRow.parentTable;
            var tableStyle = parentTable.style;
            var tableHorizontalBorderStyle = this.getBorderCssString((new __aspxRichEdit.TablePropertiesMergerBorderHorizontal())
                .getProperty(parentTable.properties, tableStyle, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, defaultTableProperties));
            var tableVerticalBorderStyle = this.getBorderCssString((new __aspxRichEdit.TablePropertiesMergerBorderVertical())
                .getProperty(parentTable.properties, tableStyle, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, defaultTableProperties));
            var cellStyle = "";
            var isTopOutsideBorder = cell.parentRow.parentTable.rows[0] == cell.parentRow;
            var isBottomOutsideBorder = __aspxRichEdit.ListUtils.last(cell.parentRow.parentTable.rows) == cell.parentRow;
            var isLeftOutsideBorder = cell.parentRow.cells[0] == cell;
            var isRightOutsideBorder = __aspxRichEdit.ListUtils.last(cell.parentRow.cells) == cell;
            var topBorderStyle = this.getBorderCssString((new __aspxRichEdit.TableCellPropertiesMergerBorderTop(cell.parentRow.tablePropertiesException, isTopOutsideBorder))
                .getProperty(cellProperties, tableStyle, cell.conditionalFormatting, defaultCellProperties)) || tableVerticalBorderStyle;
            if (topBorderStyle)
                cellStyle += "border-top:" + topBorderStyle + ";";
            var leftBorderStyle = this.getBorderCssString((new __aspxRichEdit.TableCellPropertiesMergerBorderLeft(cell.parentRow.tablePropertiesException, isLeftOutsideBorder))
                .getProperty(cellProperties, tableStyle, cell.conditionalFormatting, defaultCellProperties)) || tableHorizontalBorderStyle;
            if (leftBorderStyle)
                cellStyle += "border-left:" + leftBorderStyle + ";";
            var bottomBorderStyle = this.getBorderCssString((new __aspxRichEdit.TableCellPropertiesMergerBorderBottom(cell.parentRow.tablePropertiesException, isBottomOutsideBorder))
                .getProperty(cellProperties, tableStyle, cell.conditionalFormatting, defaultCellProperties)) || tableVerticalBorderStyle;
            if (bottomBorderStyle)
                cellStyle += "border-bottom:" + bottomBorderStyle + ";";
            var rightBorderStyle = this.getBorderCssString((new __aspxRichEdit.TableCellPropertiesMergerBorderRight(cell.parentRow.tablePropertiesException, isRightOutsideBorder))
                .getProperty(cellProperties, tableStyle, cell.conditionalFormatting, defaultCellProperties)) || tableHorizontalBorderStyle;
            if (rightBorderStyle)
                cellStyle += "border-right:" + rightBorderStyle + ";";
            var marginLeft = new __aspxRichEdit.TableCellPropertiesMergerMarginLeft(parentTable, model, cell.parentRow.tablePropertiesException).getProperty(cellProperties, tableStyle, cell.conditionalFormatting, defaultCellProperties);
            if (marginLeft.value)
                cellStyle += "padding-left:" + this.getTableWidthUnitCssString(marginLeft) + ";";
            var marginTop = new __aspxRichEdit.TableCellPropertiesMergerMarginTop(parentTable, model, cell.parentRow.tablePropertiesException).getProperty(cellProperties, tableStyle, cell.conditionalFormatting, defaultCellProperties);
            if (marginTop.value)
                cellStyle += "padding-top:" + this.getTableWidthUnitCssString(marginTop) + ";";
            var marginRight = new __aspxRichEdit.TableCellPropertiesMergerMarginRight(parentTable, model, cell.parentRow.tablePropertiesException).getProperty(cellProperties, tableStyle, cell.conditionalFormatting, defaultCellProperties);
            if (marginRight.value)
                cellStyle += "padding-right:" + this.getTableWidthUnitCssString(marginRight) + ";";
            var marginBottom = new __aspxRichEdit.TableCellPropertiesMergerMarginBottom(parentTable, model, cell.parentRow.tablePropertiesException).getProperty(cellProperties, tableStyle, cell.conditionalFormatting, defaultCellProperties);
            if (marginBottom.value)
                cellStyle += "padding-bottom:" + this.getTableWidthUnitCssString(marginBottom) + ";";
            var verticalAlignment = new __aspxRichEdit.TableCellVerticalAlignmentMerger().getProperty(cellProperties, tableStyle, cell.conditionalFormatting, defaultCellProperties);
            switch (verticalAlignment) {
                case __aspxRichEdit.TableCellVerticalAlignment.Bottom:
                    cellStyle += "vertical-align:bottom;";
                    break;
                case __aspxRichEdit.TableCellVerticalAlignment.Center:
                    cellStyle += "vertical-align:middle;";
                    break;
                case __aspxRichEdit.TableCellVerticalAlignment.Top:
                    cellStyle += "vertical-align:top;";
                    break;
                default:
                    break;
            }
            var cellBackground = new __aspxRichEdit.TableCellPropertiesMergerShadingInfo().getProperty(cellProperties, tableStyle, cell.conditionalFormatting, defaultCellProperties)
                .getActualColor(this.colorProvider);
            if (__aspxRichEdit.ColorHelper.getAlpha(cellBackground) > 0)
                cellStyle += "background: " + __aspxRichEdit.ColorHelper.getCssStringInternal(cellBackground) + ";";
            cellStyle += "width: " + __aspxRichEdit.UnitConverter.twipsToPixels(cell.preferredWidth.value) + "px;";
            return cellStyle;
        };
        HtmlExporter.prototype.getTextBoxStyleString = function (textBoxRun) {
            var contentMargins = textBoxRun.textBoxProperties.getContentMargins();
            var result = "padding-top:" + __aspxRichEdit.UnitConverter.twipsToPixels(contentMargins.top) + "px;";
            result += "padding-bottom:" + __aspxRichEdit.UnitConverter.twipsToPixels(contentMargins.bottom) + "px;";
            result += "padding-left:" + __aspxRichEdit.UnitConverter.twipsToPixels(contentMargins.left) + "px;";
            result += "padding-right:" + __aspxRichEdit.UnitConverter.twipsToPixels(contentMargins.right) + "px;";
            result += "border:" + __aspxRichEdit.UnitConverter.twipsToPixels(textBoxRun.shape.outlineWidth) + "px solid " + __aspxRichEdit.ColorHelper.getCssString(textBoxRun.shape.outlineColor, true) + ";";
            result += "background-color:" + __aspxRichEdit.ColorHelper.getCssString(textBoxRun.shape.fillColor, true) + ";";
            return result;
        };
        return HtmlExporter;
    }());
    __aspxRichEdit.HtmlExporter = HtmlExporter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    __aspxRichEdit.INPUT_CLASS_NAME = "dxreInputTarget";
    var EMPTY_KEYCODE = 229;
    var TAB_KEYCODE = 9;
    var IDEOGRAPHIC_SPACE_CHARCODE = 12288;
    var InputEditorBase = (function () {
        function InputEditorBase(control, eventManager, parent) {
            this.control = control;
            this.eventManager = eventManager;
            this.canInsertTextOnInputEvent = this.canUseInputEvent();
            this.createHierarchy(parent);
            this.initialize();
            this.isIME = false;
            this.inputWithAlt = false;
        }
        InputEditorBase.prototype.initialize = function () {
            this.initializeIfNotReadOnly();
            this.initEvents();
            this.prevKeyCode = EMPTY_KEYCODE;
        };
        InputEditorBase.prototype.initializeIfNotReadOnly = function () {
            if (this.control.readOnly !== __aspxRichEdit.ReadOnlyMode.Persistent && !this.initializedIfNotReadOnly) {
                this.initializedIfNotReadOnly = true;
                this.initializeIfNotReadOnlyCore();
            }
        };
        InputEditorBase.prototype.initializeIfNotReadOnlyCore = function () {
        };
        InputEditorBase.prototype.initEvents = function () {
            var _this = this;
            REWebUtils.Evt.AttachEventToElement(this.getEditableDocument(), "keydown", function (evt) { return _this.onKeyDown(evt); });
            REWebUtils.Evt.AttachEventToElement(this.getEditableDocument(), "keyup", function (evt) { return setTimeout(function () { return _this.onKeyUp(evt); }, 0); });
            REWebUtils.Evt.AttachEventToElement(this.getEditableDocument(), "keypress", function (evt) { return _this.onKeyPress(evt); });
            REWebUtils.Evt.AttachEventToElement(this.getEditableDocument(), "focus", function () { return _this.onFocus(); });
            REWebUtils.Evt.AttachEventToElement(this.getEditableDocument(), "blur", function (evt) { return setTimeout(function () { return _this.onBlur(evt); }, 10); });
            REWebUtils.Evt.AttachEventToElement(this.getEditableDocument(), "contextmenu", function (evt) { return _this.onContextMenu(evt); });
            if (this.canInsertTextOnInputEvent)
                REWebUtils.Evt.AttachEventToElement(this.getEditableDocument(), "input", function (evt) { return _this.onInput(evt); });
        };
        InputEditorBase.prototype.createHierarchy = function (parent) {
            var _this = this;
            this.inputElement = this.createInputElement();
            this.inputElement.className = __aspxRichEdit.INPUT_CLASS_NAME;
            parent.appendChild(this.inputElement);
            this.createHierarchyCore();
            REWebUtils.Evt.AttachEventToElement(this.inputElement, "load", function () { return _this.recreateIfNeeded(); });
        };
        InputEditorBase.prototype.createHierarchyCore = function () { };
        InputEditorBase.prototype.createInputElement = function () {
            return null;
        };
        InputEditorBase.prototype.onInput = function (_evt) {
            var _this = this;
            if (this.canInsertTextOnInputEvent)
                setTimeout(function () { return _this.onTextInput(); }, 0);
        };
        InputEditorBase.prototype.onBlur = function (_evt) {
            var targetElement = REWebUtils.GetActiveElement();
            if (!targetElement || !this.control.isRibbon(targetElement) || REWebUtils.IsInteractiveControl(targetElement))
                this.eventManager.onFocusOut();
            this.clearInputElement();
        };
        InputEditorBase.prototype.onFocus = function () {
            this.selectEditableDocumentContent();
            this.eventManager.onFocusIn();
        };
        InputEditorBase.prototype.onKeyDown = function (evt) {
            var _this = this;
            if (!this.control.clientSideEvents.raiseKeyDown(evt)) {
                if (!this.isIME) {
                    evt = this.getNormalizedEvent(evt);
                    var keyCode = REWebUtils.Evt.GetKeyCode(evt);
                    this.needProcessShortcutOnKeyUp = !keyCode || keyCode == EMPTY_KEYCODE;
                    this.canInsertTextOnInputEvent = this.canUseInputEvent();
                    if (evt.altKey || evt.ctrlKey || evt.metaKey)
                        this.canInsertTextOnInputEvent = false;
                    if (evt.altKey)
                        if (keyCode >= REWebUtils.KeyCode.Numpad_0 && keyCode <= REWebUtils.KeyCode.Numpad_9)
                            this.inputWithAlt = true;
                        else if (keyCode != 18)
                            this.inputWithAlt = false;
                    if (!this.needProcessShortcutOnKeyUp) {
                        var isShortcut = this.isProcessShortcut(keyCode) && this.onShortcut(evt);
                        if (isShortcut || (keyCode === TAB_KEYCODE && !this.control.options.acceptsTab)) {
                            this.prevKeyCode = keyCode;
                            return;
                        }
                    }
                    if (!this.canInsertTextOnInputEvent && !this.control.isTouchMode())
                        setTimeout(function () {
                            if (!_this.isIME)
                                _this.onTextInput();
                        }, 0);
                    this.prevKeyCode = keyCode;
                }
            }
            else
                REWebUtils.Evt.PreventEvent(evt);
        };
        InputEditorBase.prototype.isProcessShortcut = function (keyCode) {
            return !(keyCode == REWebUtils.KeyCode.Space && this.prevKeyCode == REWebUtils.KeyCode.SingleQuote && !REWebUtils.Browser.MacOSPlatform);
        };
        InputEditorBase.prototype.onKeyUp = function (evt) {
            this.control.clientSideEvents.raiseKeyUp(evt);
            if (this.needProcessShortcutOnKeyUp) {
                this.onShortcut(evt);
                this.needProcessShortcutOnKeyUp = false;
            }
        };
        InputEditorBase.prototype.onKeyPress = function (evt) {
            var _this = this;
            if (!evt.altKey) {
                if (this.inputWithAlt)
                    setTimeout(function () { return _this.onTextInput(); }, 0);
                this.inputWithAlt = false;
            }
        };
        InputEditorBase.prototype.onContextMenu = function (evt) {
            REWebUtils.PopupUtils.PreventContextMenu(evt);
            evt.preventDefault();
            this.control.popupMenuManager.showByKey();
        };
        InputEditorBase.prototype.onShortcut = function (evt) {
            var shortcutCode = this.getShortcutCode(evt);
            if (!this.control.shortcutManager.isKnownShortcut(shortcutCode))
                return false;
            this.onShortcutCore(evt, shortcutCode);
            return true;
        };
        InputEditorBase.prototype.onShortcutCore = function (evt, shortcutCode) {
            if (!REWebUtils.Browser.WebKitTouchUI)
                this.clearInputElement();
            this.selectEditableDocumentContent();
            if (!this.control.shortcutManager.isClipboardCommandShortcut(shortcutCode) && !REWebUtils.Browser.MacOSMobilePlatform)
                REWebUtils.Evt.PreventEvent(evt);
            this.eventManager.onShortcut(shortcutCode);
        };
        InputEditorBase.prototype.onText = function (text, currentText, isUpdated) {
            if (!this.canInsertTextOnInputEvent)
                this.needProcessShortcutOnKeyUp = false;
            this.eventManager.onText(text, isUpdated);
            this.previousText = currentText;
        };
        InputEditorBase.prototype.onTextReplace = function (_text, currentText) {
            this.previousText = currentText;
        };
        InputEditorBase.prototype.onTextInput = function () {
            var text = this.getEditableDocumentText();
            if (text) {
                if (this.previousText) {
                    var previousText = this.previousText.replace(String.fromCharCode(REWebUtils.KeyCode.NonBreakingSpace), String.fromCharCode(REWebUtils.KeyCode.Space));
                    var previousTextLastIndex = previousText.length - 1;
                    if (text[previousTextLastIndex] && text[previousTextLastIndex] != previousText[previousTextLastIndex])
                        this.onText(text[previousTextLastIndex], text, true);
                    var insertedCharacterCount = text.length - previousText.length;
                    if (insertedCharacterCount > 0) {
                        for (var i = text.length - insertedCharacterCount; i < text.length; i++)
                            this.onText(text[i], text, false);
                    }
                }
                else
                    this.onText(text, text, false);
            }
        };
        InputEditorBase.prototype.captureFocus = function () {
        };
        InputEditorBase.prototype.canUseInputEvent = function () {
            return REWebUtils.Browser.Firefox && REWebUtils.Browser.MajorVersion >= 14 || REWebUtils.Browser.WebKitTouchUI;
        };
        InputEditorBase.prototype.getEditableDocumentText = function () {
            return REWebUtils.GetInnerText(this.getEditableTextOwner()).replace(/(\r\n|\n|\r)/gm, "");
        };
        InputEditorBase.prototype.getEditableTextOwner = function () {
            return null;
        };
        InputEditorBase.prototype.setPosition = function (left, top) {
            this.inputElement.style.left = left + "px";
            this.inputElement.style.top = top + "px";
        };
        InputEditorBase.prototype.clearInputElement = function () {
            this.previousText = "";
        };
        InputEditorBase.prototype.setEditableDocumentContent = function (_content) {
            this.previousText = "";
        };
        InputEditorBase.prototype.setEditableDocumentCursorPosition = function (_cursorPosition) { };
        InputEditorBase.prototype.selectEditableDocumentContent = function () {
            this.control.barManager.updateItemsState([__aspxRichEdit.RichEditClientCommand.CopySelection, __aspxRichEdit.RichEditClientCommand.PasteSelection, __aspxRichEdit.RichEditClientCommand.CutSelection]);
        };
        InputEditorBase.prototype.getEditableDocumentContent = function () {
            return "";
        };
        InputEditorBase.prototype.getEditableDocument = function () {
            return null;
        };
        InputEditorBase.prototype.getNormalizedEvent = function (evt) {
            if (REWebUtils.Browser.IE && REWebUtils.Browser.MajorVersion < 9) {
                var eventCopy = {};
                for (var i in evt)
                    eventCopy[i] = evt[i];
                return eventCopy;
            }
            return evt;
        };
        InputEditorBase.prototype.recreateIfNeeded = function () { };
        InputEditorBase.prototype.getShortcutCode = function (evt) {
            var keyCode = REWebUtils.Evt.GetKeyCode(evt);
            var modifiers = 0;
            if (evt.altKey)
                modifiers |= REWebUtils.ModifierKey.Alt;
            if (evt.ctrlKey)
                modifiers |= REWebUtils.ModifierKey.Ctrl;
            if (evt.shiftKey)
                modifiers |= REWebUtils.ModifierKey.Shift;
            if (evt.metaKey && REWebUtils.Browser.MacOSPlatform)
                modifiers |= REWebUtils.ModifierKey.Meta;
            return modifiers | keyCode;
        };
        return InputEditorBase;
    }());
    __aspxRichEdit.InputEditorBase = InputEditorBase;
    var DivInputEditor = (function (_super) {
        __extends(DivInputEditor, _super);
        function DivInputEditor(control, eventManager, parent) {
            return _super.call(this, control, eventManager, parent) || this;
        }
        DivInputEditor.prototype.initializeIfNotReadOnlyCore = function () {
            this.inputElement.contentEditable = "true";
            this.clearInputElement();
        };
        DivInputEditor.prototype.setPosition = function (left, top) {
            _super.prototype.setPosition.call(this, left, top);
        };
        DivInputEditor.prototype.createInputElement = function () {
            return document.createElement("DIV");
        };
        DivInputEditor.prototype.onKeyDown = function (evt) {
            this.handled = false;
            _super.prototype.onKeyDown.call(this, evt);
            this.canSkipInputEvent = true;
        };
        DivInputEditor.prototype.onKeyUp = function (evt) {
            _super.prototype.onKeyUp.call(this, evt);
            this.control.owner.hidePopupMenu();
            this.onTextInput();
        };
        DivInputEditor.prototype.onInput = function (evt) {
            if (!this.canSkipInputEvent) {
                this.handled = false;
                _super.prototype.onInput.call(this, evt);
            }
            this.control.owner.hidePopupMenu();
            this.canSkipInputEvent = false;
        };
        DivInputEditor.prototype.onFocus = function () {
            if (!this.canSkipFocusAndBlur)
                _super.prototype.onFocus.call(this);
            this.canSkipFocusAndBlur = false;
        };
        DivInputEditor.prototype.onBlur = function (evt) {
            if (!this.canSkipFocusAndBlur)
                _super.prototype.onBlur.call(this, evt);
        };
        DivInputEditor.prototype.onShortcutCore = function (evt, shortcutCode) {
            var _this = this;
            if (shortcutCode !== REWebUtils.KeyCode.Space || !REWebUtils.Browser.MacOSMobilePlatform) {
                this.handled = true;
                setTimeout(function () { return _this.clearInputElement(); }, 0);
                _super.prototype.onShortcutCore.call(this, evt, shortcutCode);
            }
        };
        DivInputEditor.prototype.onTextReplace = function (text, currentText) {
            this.eventManager.onTextReplace(text);
            _super.prototype.onTextReplace.call(this, text, currentText);
        };
        DivInputEditor.prototype.onTextInput = function () {
            var text = this.getEditableDocumentText();
            if (!this.handled) {
                var isTextReplaced = !this.cursorWasSetOnLastPosition && this.getEditableDocumentCursorPosition() === this.getEditableDocumentFullText().length;
                var lastWordStartIndex = 0;
                if (!isTextReplaced && this.previousText) {
                    var previousText = this.previousText;
                    var lastSpaceIndex = previousText.lastIndexOf(" ");
                    if (lastSpaceIndex >= 0)
                        lastWordStartIndex = lastSpaceIndex + 1;
                    var lengthToReplaceCheck = (text.length > previousText.length ? previousText.length : text.length) - lastWordStartIndex - 1;
                    var currentWordPart = text.substr(lastWordStartIndex, lengthToReplaceCheck);
                    var previousWordPart = previousText.substr(lastWordStartIndex, lengthToReplaceCheck);
                    if (currentWordPart !== previousWordPart)
                        isTextReplaced = true;
                }
                if (isTextReplaced)
                    this.onTextReplace(text.substr(lastWordStartIndex), text);
                else
                    _super.prototype.onTextInput.call(this);
                if (this.previousText && text.length < this.previousText.length || !text.length) {
                    var deletedCharacterCount = this.previousText ? this.previousText.length - text.length : 1;
                    for (var i = 0; i < deletedCharacterCount; i++)
                        this.eventManager.onShortcut(REWebUtils.KeyCode.Backspace);
                    this.previousText = text;
                }
                this.cursorWasSetOnLastPosition = true;
                this.handled = true;
            }
            if (REWebUtils.Browser.MacOSMobilePlatform && text[text.length - 1] == " ")
                this.clearInputElement();
        };
        DivInputEditor.prototype.getEditableTextOwner = function () {
            return this.inputElement;
        };
        DivInputEditor.prototype.captureFocus = function () {
            this.inputElement.focus();
        };
        DivInputEditor.prototype.getEditableDocument = function () {
            return this.inputElement;
        };
        DivInputEditor.prototype.clearInputElement = function () {
            _super.prototype.clearInputElement.call(this);
            __aspxRichEdit.HTMLUtils.clearInnerHtml(this.inputElement);
            this.cursorWasSetOnLastPosition = true;
        };
        DivInputEditor.prototype.setEditableDocumentContent = function (content) {
            if (content)
                this.inputElement.innerHTML = content;
            else
                this.clearInputElement();
        };
        DivInputEditor.prototype.setEditableDocumentCursorPosition = function (cursorPosition) {
            var textLength = this.getEditableDocumentFullText().length;
            if (cursorPosition > textLength)
                cursorPosition = textLength;
            if (this.inputElement.childNodes.length > 0) {
                var range = document.createRange();
                var selection = window.getSelection();
                var lastChild = this.inputElement.childNodes[this.inputElement.childNodes.length - 1];
                if (cursorPosition <= lastChild.textContent.length) {
                    range.setStart(lastChild, cursorPosition);
                    range.collapse(true);
                    selection.removeAllRanges();
                    selection.addRange(range);
                    this.previousText = this.getEditableDocumentText();
                    this.cursorWasSetOnLastPosition = cursorPosition === textLength;
                }
            }
        };
        DivInputEditor.prototype.getEditableDocumentText = function () {
            return this.getEditableDocumentFullText().substring(0, this.getEditableDocumentCursorPosition());
        };
        DivInputEditor.prototype.getEditableDocumentFullText = function () {
            return _super.prototype.getEditableDocumentText.call(this).replace(/\s/g, " ");
        };
        DivInputEditor.prototype.getEditableDocumentContent = function () {
            return this.inputElement.innerHTML;
        };
        DivInputEditor.prototype.getEditableDocumentCursorPosition = function () {
            var selection = window.getSelection();
            var cursorPosition = selection.focusOffset;
            if (REWebUtils.Browser.MacOSMobilePlatform) {
                var fullText = this.getEditableDocumentFullText();
                if (fullText[fullText.length - 1] === " " && fullText.length > 1)
                    cursorPosition++;
            }
            return cursorPosition;
        };
        DivInputEditor.prototype.selectEditableDocumentContent = function () {
            var selection = window.getSelection();
            var firstChildNode = null;
            if (this.inputElement.childNodes.length) {
                firstChildNode = this.inputElement.childNodes[0];
                if (!firstChildNode.childNodes.length)
                    return;
            }
            selection.removeAllRanges();
            selection.selectAllChildren(this.inputElement);
            _super.prototype.selectEditableDocumentContent.call(this);
        };
        return DivInputEditor;
    }(InputEditorBase));
    __aspxRichEdit.DivInputEditor = DivInputEditor;
    var IFrameInputEditor = (function (_super) {
        __extends(IFrameInputEditor, _super);
        function IFrameInputEditor(control, eventManager, parent) {
            return _super.call(this, control, eventManager, parent) || this;
        }
        IFrameInputEditor.prototype.createHierarchyCore = function () {
            var frameHtml = "<!DOCTYPE html>";
            frameHtml += "<html>";
            frameHtml += "<head>";
            frameHtml += "</head>";
            frameHtml += "<body style=\"padding: 0px; margin: 0px; overflow: hidden;\" loaded=\"true\">";
            frameHtml += "</body>";
            frameHtml += "</html>";
            this.editableDocument = this.inputElement.contentDocument || this.inputElement.contentWindow.document;
            this.editableDocument.open();
            this.editableDocument.write(frameHtml);
            this.editableDocument.close();
        };
        IFrameInputEditor.prototype.initializeIfNotReadOnlyCore = function () {
            if (REWebUtils.Browser.WebKitFamily)
                this.editableDocument.body.setAttribute("contenteditable", "true");
            else
                this.editableDocument.designMode = "on";
        };
        IFrameInputEditor.prototype.createInputElement = function () {
            var element = document.createElement("IFRAME");
            element.src = "javascript:false;";
            return element;
        };
        IFrameInputEditor.prototype.initEvents = function () {
            var _this = this;
            _super.prototype.initEvents.call(this);
            REWebUtils.Evt.AttachEventToElement(this.getEditableDocument(), "compositionstart", function (evt) { return _this.onCompositionStart(evt); });
            REWebUtils.Evt.AttachEventToElement(this.getEditableDocument(), "compositionupdate", function (evt) { return REWebUtils.Browser.IE || REWebUtils.Browser.Edge ?
                _this.onCompositionUpdate(evt) : setTimeout(function () { return _this.onCompositionUpdate(evt); }, 0); });
            REWebUtils.Evt.AttachEventToElement(this.getEditableDocument(), "compositionend", function (evt) { return !REWebUtils.Browser.Safari ?
                _this.onCompositionEnd(evt) : setTimeout(function () { return _this.onCompositionEnd(evt); }, 0); });
            REWebUtils.Evt.AttachEventToElement(this.getEditableDocument(), "copy", function (evt) {
                if (!__aspxRichEdit.ControlOptions.isEnabled(_this.control.options.copy))
                    return REWebUtils.Evt.PreventEvent(evt);
            });
            REWebUtils.Evt.AttachEventToElement(this.getEditableDocument(), "cut", function (evt) {
                if (!__aspxRichEdit.ControlOptions.isEnabled(_this.control.options.cut))
                    return REWebUtils.Evt.PreventEvent(evt);
            });
            REWebUtils.Evt.AttachEventToElement(this.getEditableDocument(), "paste", function (evt) {
                if (!__aspxRichEdit.ControlOptions.isEnabled(_this.control.options.paste))
                    return REWebUtils.Evt.PreventEvent(evt);
                var e = evt;
                if (e && e.clipboardData && e.clipboardData.items) {
                    var items = e.clipboardData.items;
                    if (!REWebUtils.OfficeBuffer.isBufferContainText(items)) {
                        var blob = REWebUtils.OfficeBuffer.getBufferImage(items);
                        if (blob) {
                            REWebUtils.Evt.PreventEvent(evt);
                            var reader = new FileReader();
                            var image_1 = _this.editableDocument.createElement("IMG");
                            reader.onload = function (ev) {
                                image_1.src = ev.target.result;
                                _this.control.importHtml([image_1], _this.control.selection.getLastSelectedInterval());
                            };
                            reader.readAsDataURL(blob);
                        }
                    }
                }
            });
        };
        IFrameInputEditor.prototype.captureFocus = function () {
            if ((REWebUtils.Browser.Opera && REWebUtils.Browser.MajorVersion <= 12) ||
                REWebUtils.Browser.Chrome && this.inputElement === document.activeElement ||
                ((REWebUtils.Browser.IE || REWebUtils.Browser.Edge) && this.control.readOnly == __aspxRichEdit.ReadOnlyMode.Persistent) ||
                REWebUtils.Browser.Firefox)
                this.inputElement.contentWindow.focus();
            else
                REWebUtils.SetFocus(this.control.readOnly == __aspxRichEdit.ReadOnlyMode.Persistent ? this.inputElement : this.editableDocument.body);
        };
        IFrameInputEditor.prototype.setPosition = function (left, top) {
            _super.prototype.setPosition.call(this, left, top);
            if (left && top)
                this.selectEditableDocumentContent();
        };
        IFrameInputEditor.prototype.clearInputElement = function () {
            if (this.previousText != this.getEditableDocumentText())
                _super.prototype.onTextInput.call(this);
            _super.prototype.clearInputElement.call(this);
            __aspxRichEdit.HTMLUtils.clearInnerHtml(this.editableDocument.body);
        };
        IFrameInputEditor.prototype.setEditableDocumentContent = function (content) {
            _super.prototype.setEditableDocumentContent.call(this, content);
            this.isIME = false;
            this.editableDocument.body.innerHTML = content;
        };
        IFrameInputEditor.prototype.getEditableDocumentContent = function () {
            return this.editableDocument.body.innerHTML;
        };
        IFrameInputEditor.prototype.selectEditableDocumentContent = function () {
            var firstChildNode = this.editableDocument.body.childNodes[0];
            if (firstChildNode && !firstChildNode.childNodes.length && !(firstChildNode.nodeType === 3 && firstChildNode.nodeValue === ""))
                return;
            var selection = this.editableDocument.getSelection ? this.editableDocument.getSelection() : this.editableDocument["selection"];
            if (selection.removeAllRanges)
                selection.removeAllRanges();
            else if (selection.empty)
                selection.empty();
            if (selection.selectAllChildren)
                selection.selectAllChildren(this.editableDocument.body);
            else if (selection.createRange) {
                try {
                    var range = selection.createRange();
                    range.moveToElementText(this.editableDocument.body);
                }
                catch (e) { }
                range.select();
            }
            _super.prototype.selectEditableDocumentContent.call(this);
        };
        IFrameInputEditor.prototype.getEditableDocument = function () {
            return this.editableDocument;
        };
        IFrameInputEditor.prototype.getEditableTextOwner = function () {
            return this.editableDocument.body;
        };
        IFrameInputEditor.prototype.onBlur = function (evt) {
            _super.prototype.onBlur.call(this, evt);
            this.isIME = false;
            this.endInputIME();
        };
        IFrameInputEditor.prototype.onShortcutCore = function (evt, shortcutCode) {
            var prevSelectedInterval = this.control.selection.getLastSelectedInterval();
            _super.prototype.onShortcutCore.call(this, evt, shortcutCode);
            if (this.control.selection.getLastSelectedInterval() != prevSelectedInterval)
                this.selectEditableDocumentContent();
        };
        IFrameInputEditor.prototype.onTextInput = function () {
            var _this = this;
            setTimeout(function () {
                var editableDocumentText = _this.getEditableDocumentText();
                if (editableDocumentText.charCodeAt(0) == IDEOGRAPHIC_SPACE_CHARCODE || REWebUtils.Str.Trim(editableDocumentText))
                    _super.prototype.onTextInput.call(_this);
            }, 0);
        };
        IFrameInputEditor.prototype.onTextReplace = function (text, currentText) {
            this.eventManager.onTextReplace(text, this.previousText.length);
            _super.prototype.onTextReplace.call(this, text, currentText);
        };
        IFrameInputEditor.prototype.recreateIfNeeded = function () {
            var iframeDocument = this.inputElement.contentDocument || this.inputElement.contentWindow.document;
            if (!iframeDocument.body.hasAttribute("loaded")) {
                this.initializedIfNotReadOnly = false;
                this.createHierarchyCore();
                this.initialize();
            }
        };
        IFrameInputEditor.prototype.onCompositionStart = function (_evt) {
            this.isIME = true;
            this.needProcessShortcutOnKeyUp = false;
            if (!REWebUtils.Browser.IE && !REWebUtils.Browser.Edge)
                this.clearInputElement();
            this.startInputIME();
        };
        IFrameInputEditor.prototype.onCompositionUpdate = function (_evt) {
            var text = this.getEditableDocumentText();
            if (this.isIME && text.length && this.previousText != text) {
                this.onTextReplace(text, text);
                this.updateInputIME();
            }
        };
        IFrameInputEditor.prototype.onCompositionEnd = function (_evt) {
            var text = this.getEditableDocumentText();
            if (text.length && this.previousText != text)
                this.onTextReplace(text, text);
            else if (!REWebUtils.Browser.Edge)
                this.clearInputElement();
            if (text.charCodeAt(text.length - 1) == IDEOGRAPHIC_SPACE_CHARCODE)
                this.clearInputElement();
            this.isIME = false;
            this.endInputIME();
        };
        IFrameInputEditor.prototype.startInputIME = function () {
            this.inputElement.style.position = "absolute";
            var lastSelectedIntervalStartPosition = this.control.selection.getLastSelectedInterval().start;
            var subDocument = this.control.selection.model.activeSubDocument;
            var layoutPosition = subDocument.isMain() ?
                new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.control.selection.layout, subDocument, lastSelectedIntervalStartPosition, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                    .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true)) :
                new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.selection.layout, subDocument, lastSelectedIntervalStartPosition, this.control.selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Box)
                    .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true));
            if (!layoutPosition)
                return null;
            var currentTextIndent = this.editableDocument.body.style.textIndent;
            var propChar = __aspxRichEdit.HtmlConverter.getSizeSignificantRules(this.control.inputPosition.getMergedCharacterPropertiesRaw()).join(";");
            this.editableDocument.body.setAttribute("style", "padding: 0px; margin: 0px; overflow: hidden; color: transparent; " + propChar);
            this.editableDocument.body.style.textIndent = currentTextIndent;
            var layoutX = layoutPosition.getLayoutX(this.control.measurer, __aspxRichEdit.DocumentLayoutDetailsLevel.Row);
            var layoutPoint = new __aspxRichEdit.LayoutPoint(layoutPosition.pageIndex, layoutX, layoutPosition.getLayoutY(__aspxRichEdit.DocumentLayoutDetailsLevel.Row));
            var pageElement = this.control.viewManager.cache[layoutPoint.pageIndex].page;
            layoutPoint.applyOffset(new __aspxRichEdit.Point(pageElement.offsetLeft, pageElement.offsetTop));
            this.setPosition(layoutPoint.x, layoutPoint.y);
            this.editableDocument.body.style.textIndent = this.previousText.length ? currentTextIndent :
                layoutPosition.getLayoutX(this.control.measurer, __aspxRichEdit.DocumentLayoutDetailsLevel.Box) +
                    layoutPosition.box.getCharOffsetXInPixels(this.control.measurer, layoutPosition.charOffset) - layoutX + "px";
            this.inputElement.style.width = layoutPosition.row.width + "px";
            if (REWebUtils.Browser.IE || REWebUtils.Browser.Edge) {
                this.editableDocument.body.style.width = this.inputElement.style.width;
                this.editableDocument.body.style.height = this.inputElement.style.height = layoutPosition.row.height + "px";
            }
            if (layoutPosition.row.boxes.length > 1) {
                this.editableDocument.body.style.lineHeight = layoutPosition.row.height + "px";
                this.editableDocument.body.style.marginTop = (layoutPosition.box.height - layoutPosition.row.height) / 2 + "px";
            }
        };
        IFrameInputEditor.prototype.updateInputIME = function () {
            var lastSelectedIntervalStartPosition = this.control.selection.getLastSelectedInterval().start;
            var subDocument = this.control.selection.model.activeSubDocument;
            var layoutPosition = subDocument.isMain() ?
                new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.control.selection.layout, subDocument, lastSelectedIntervalStartPosition, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                    .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true)) :
                new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.selection.layout, subDocument, lastSelectedIntervalStartPosition, this.control.selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Box)
                    .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true));
            if (!layoutPosition)
                return null;
            var paragraphProperties = this.control.model.activeSubDocument.getParagraphByPosition(lastSelectedIntervalStartPosition).getParagraphMergedProperies();
            var text = this.getEditableDocumentText();
            if (text.length === 2)
                this.inputElement.style.height = (paragraphProperties.alignment == __aspxRichEdit.ParagraphAlignment.Left ? layoutPosition.pageArea.height : 0) + "px";
            var inputWidth = parseInt(this.inputElement.style.width);
            if (inputWidth && inputWidth != layoutPosition.row.width) {
                var widthDiff = layoutPosition.row.width - parseInt(this.inputElement.style.width);
                this.inputElement.style.width = layoutPosition.row.width + "px";
                this.editableDocument.body.style.textIndent = parseInt(this.editableDocument.body.style.textIndent) + widthDiff + "px";
                this.inputElement.style.left = parseInt(this.inputElement.style.left) - widthDiff + "px";
            }
        };
        IFrameInputEditor.prototype.endInputIME = function () {
            this.inputElement.style.width = "0px";
            this.inputElement.style.height = "0px";
        };
        return IFrameInputEditor;
    }(InputEditorBase));
    __aspxRichEdit.IFrameInputEditor = IFrameInputEditor;
    var InputController = (function () {
        function InputController(control, eventManager, parent) {
            this.control = control;
            this.inputEditor = this.createInputEditor(parent, eventManager);
            this.exporter = new __aspxRichEdit.HtmlExporter(this.control);
        }
        InputController.prototype.createInputEditor = function (parent, eventManager) {
            if (this.control.isTouchMode())
                return new DivInputEditor(this.control, eventManager, parent);
            return new IFrameInputEditor(this.control, eventManager, parent);
        };
        InputController.prototype.getEditableDocument = function () {
            return this.inputEditor.getEditableDocument();
        };
        InputController.prototype.getExportedRangeCopy = function () {
            return this.exporter.rangeCopy;
        };
        InputController.prototype.captureFocus = function () {
            this.inputEditor.captureFocus();
        };
        InputController.prototype.setPosition = function (left, top) {
            this.inputEditor.setPosition(left, top);
        };
        InputController.prototype.renderSelectionToEditableDocument = function () {
            if (this.control.selection.intervals.length === 0 || this.control.selection.isCollapsed())
                return;
            var rangeCopy = __aspxRichEdit.ModelManipulator.createRangeCopy(this.control.modelManipulator.model.activeSubDocument, this.control.selection.getIntervalsClone());
            var model = rangeCopy.model;
            var interval = new __aspxRichEdit.FixedInterval(0, model.activeSubDocument.getDocumentEndPosition() - (rangeCopy.addedUselessParagraphMarkInEnd ? 1 : 0));
            var html = this.exporter.getHtmlElementsByInterval(model, model.activeSubDocument, interval);
            if (html.length) {
                var guids = __aspxRichEdit.RichUtils.getCopyPasteGuid(this.control.getGuidParams());
                html = "<span id=\"" + guids + "\"><b style=\"font-weight: normal;\" id=\"" + guids + "\">" + html + "</b><span>";
                this.exporter.rangeCopy = rangeCopy;
            }
            this.setEditableDocumentContent(html);
            this.selectEditableDocumentContent();
        };
        InputController.prototype.setEditableDocumentContent = function (content) {
            this.inputEditor.setEditableDocumentContent(content);
        };
        InputController.prototype.setEditableDocumentCursorPosition = function (cursorPosition) {
            this.inputEditor.setEditableDocumentCursorPosition(cursorPosition);
        };
        InputController.prototype.getEditableDocumentContent = function () {
            return this.inputEditor.getEditableDocumentContent();
        };
        InputController.prototype.selectEditableDocumentContent = function () {
            this.inputEditor.selectEditableDocumentContent();
        };
        return InputController;
    }());
    __aspxRichEdit.InputController = InputController;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var MeasureInfo = (function () {
        function MeasureInfo(text, charProp) {
            this.text = text;
            this.charProp = charProp;
            this.resultSize = this.charProp.getSize(this.text);
        }
        Object.defineProperty(MeasureInfo.prototype, "signCssString", {
            get: function () {
                return __aspxRichEdit.HtmlConverter.getSizeSignificantCssString(this.charProp);
            },
            enumerable: true,
            configurable: true
        });
        return MeasureInfo;
    }());
    __aspxRichEdit.MeasureInfo = MeasureInfo;
    var MeasureInfoText = (function (_super) {
        __extends(MeasureInfoText, _super);
        function MeasureInfoText() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        MeasureInfoText.prototype.getEncodedText = function () {
            return __aspxRichEdit.HTMLUtils.encodeHtml(this.text);
        };
        return MeasureInfoText;
    }(MeasureInfo));
    __aspxRichEdit.MeasureInfoText = MeasureInfoText;
    var MeasureInfoNonText = (function (_super) {
        __extends(MeasureInfoNonText, _super);
        function MeasureInfoNonText() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        MeasureInfoNonText.prototype.getEncodedText = function () {
            return this.text;
        };
        return MeasureInfoNonText;
    }(MeasureInfo));
    __aspxRichEdit.MeasureInfoNonText = MeasureInfoNonText;
    var Measurer = (function () {
        function Measurer(id) {
            var measureContainer = document.createElement("div");
            measureContainer.id = id + "_Measure";
            measureContainer.className = "dxreMeasurer";
            document.body.appendChild(measureContainer);
            this.measureContainer = measureContainer;
        }
        Measurer.prototype.setCharacterPropertiesCache = function (charPropsCache) {
            this.charPropsCache = charPropsCache;
        };
        Measurer.prototype.clearCache = function () {
            this.charPropsCache.resetSizes();
        };
        Measurer.prototype.measure = function (measureInfos) {
            this.htmlParts = [];
            this.nodeIndex = 0;
            this.nonCachedMeasureInfos = [];
            for (var _i = 0, measureInfos_1 = measureInfos; _i < measureInfos_1.length; _i++) {
                var info = measureInfos_1[_i];
                if (!info.resultSize) {
                    if (info.charProp.script !== __aspxRichEdit.CharacterFormattingScript.Normal)
                        this.pushInfoToQueue(info.sbInfo = this.createSpaceMeasureInfo(info));
                    this.pushInfoToQueue(info);
                }
            }
            this.measureContainer.innerHTML = this.htmlParts.join("");
            var nodes = this.measureContainer.childNodes;
            for (var _a = 0, _b = this.nonCachedMeasureInfos; _a < _b.length; _a++) {
                var info = _b[_a];
                var cacheValue = info.charProp.getSize(info.text);
                if (cacheValue)
                    info.resultSize = cacheValue;
                else
                    this.applyCalculatedSize(info, nodes);
            }
        };
        Measurer.prototype.pushInfoToQueue = function (info) {
            this.nonCachedMeasureInfos.push(info);
            if (info.resultSize !== null) {
                this.nonCachedMeasureInfos.push(info);
                info.nodeIndex = this.nodeIndex++;
                this.htmlParts.push("<pre style=\"" + info.signCssString + " \">" + info.getEncodedText() + "</pre>");
                info.charProp.setSize(info.text, null);
                info.resultSize = null;
            }
        };
        Measurer.prototype.createSpaceMeasureInfo = function (info) {
            var newCharProp = info.charProp.clone();
            newCharProp.script = __aspxRichEdit.CharacterFormattingScript.Normal;
            newCharProp = this.charPropsCache.getItem(newCharProp);
            return new MeasureInfoNonText(" ", newCharProp);
        };
        Measurer.prototype.applyCalculatedSize = function (info, nodes) {
            var node = nodes[info.nodeIndex];
            var style = document.defaultView.getComputedStyle(node, null);
            info.resultSize = new __aspxRichEdit.Size(parseFloat(style.width), info.charProp.script == __aspxRichEdit.CharacterFormattingScript.Normal ? parseFloat(style.height) : info.sbInfo.resultSize.height);
            info.charProp.setSize(info.text, info.resultSize);
        };
        return Measurer;
    }());
    __aspxRichEdit.Measurer = Measurer;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var PopupMenuManager = (function () {
        function PopupMenuManager(controlOwner, viewManager, measurer, selection) {
            this.controlOwner = controlOwner;
            this.viewManager = viewManager;
            this.measurer = measurer;
            this.selection = selection;
        }
        PopupMenuManager.prototype.setSelection = function (selection) {
            this.selection = selection;
        };
        PopupMenuManager.prototype.showByKey = function () {
            var _this = this;
            this.controlOwner.showPopupMenu(function (_contextMenuBar) {
                var point = _this.getContextMenuAbsPoint(_this.selection.getLastSelectedInterval().start);
                return point ? point : _this.undefinedPoint();
            });
        };
        PopupMenuManager.prototype.showByMouseClick = function (point) {
            var _this = this;
            this.controlOwner.showPopupMenu(function (contextMenuBar) {
                if (contextMenuBar.isSpellingMenu) {
                    var layoutPoint = _this.getContextMenuAbsPoint(_this.selection.getLastSelectedInterval().start);
                    if (layoutPoint)
                        return layoutPoint;
                }
                return point;
            });
        };
        PopupMenuManager.prototype.showByTouchClick = function () {
            var _this = this;
            this.controlOwner.showPopupMenu(function (_contextMenuBar) {
                var point = _this.getContextMenuAbsPoint(_this.selection.getLastSelectedInterval().start);
                return point ? point : _this.undefinedPoint();
            });
        };
        PopupMenuManager.prototype.undefinedPoint = function () {
            return new __aspxRichEdit.Point(REWebUtils.GetAbsolutePositionX(this.viewManager.canvas), REWebUtils.GetAbsolutePositionY(this.viewManager.canvas));
        };
        PopupMenuManager.prototype.getContextMenuAbsPoint = function (lastSelectedIntervalStartPosition) {
            var subDocument = this.selection.model.activeSubDocument;
            var layoutPosition = subDocument.isMain() ?
                new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.selection.layout, subDocument, lastSelectedIntervalStartPosition, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                    .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true)) :
                new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.selection.layout, subDocument, lastSelectedIntervalStartPosition, this.selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Box)
                    .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true));
            if (!layoutPosition)
                return null;
            var layoutPoint = new __aspxRichEdit.LayoutPoint(layoutPosition.pageIndex, layoutPosition.getLayoutX(this.measurer), layoutPosition.getLayoutY(__aspxRichEdit.DocumentLayoutDetailsLevel.Row) + layoutPosition.row.height);
            if (this.viewManager.canvasManager.isVisiblePosition(layoutPoint)) {
                var pageElement = this.viewManager.cache[layoutPoint.pageIndex].page;
                return layoutPoint.applyOffset(new __aspxRichEdit.Point(REWebUtils.GetAbsolutePositionX(pageElement), REWebUtils.GetAbsolutePositionY(pageElement)));
            }
            return null;
        };
        return PopupMenuManager;
    }());
    __aspxRichEdit.PopupMenuManager = PopupMenuManager;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AutoCorrectProviderBase = (function () {
        function AutoCorrectProviderBase(control) {
            this.control = control;
        }
        AutoCorrectProviderBase.prototype.revise = function () {
            var _this = this;
            var pos = this.control.selection.getLastSelectedInterval().start;
            var lastInsertedChar = this.control.model.activeSubDocument.getText(new __aspxRichEdit.FixedInterval(pos - 1, 1));
            if (this.isTriggerChar(lastInsertedChar)) {
                var wordStartPos = __aspxRichEdit.ModelWordPositionHelper.getWordStartPositionByCharCondition(this.control.model.activeSubDocument, pos - 1, function (char) { return _this.isSeparator(char); });
                var wordEndPos = (this.includeTriggerChar(lastInsertedChar) ? pos : pos - 1) - wordStartPos;
                var interval = new __aspxRichEdit.FixedInterval(wordStartPos, wordEndPos);
                var text = this.control.model.activeSubDocument.getText(interval);
                var selectionStateInfo = null;
                if (!this.includeTriggerChar(lastInsertedChar))
                    selectionStateInfo = this.control.selection.getSelectionState();
                var autoCorrectResult = this.reviseCore(text, interval);
                if (selectionStateInfo)
                    autoCorrectResult ? this.control.selection.restoreSelectionState(selectionStateInfo, __aspxRichEdit.UpdateInputPositionProperties.Yes) : selectionStateInfo.destructor();
                return autoCorrectResult;
            }
            return false;
        };
        AutoCorrectProviderBase.prototype.isSeparator = function (char) {
            return !__aspxRichEdit.RichUtils.isAlphanumeric.test(char);
        };
        AutoCorrectProviderBase.prototype.isTriggerChar = function (char) {
            return this.isSeparator(char);
        };
        AutoCorrectProviderBase.prototype.includeTriggerChar = function (_char) {
            return false;
        };
        return AutoCorrectProviderBase;
    }());
    __aspxRichEdit.AutoCorrectProviderBase = AutoCorrectProviderBase;
    var EventAutoCorrectProvider = (function (_super) {
        __extends(EventAutoCorrectProvider, _super);
        function EventAutoCorrectProvider() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        EventAutoCorrectProvider.prototype.reviseCore = function (text, interval) {
            this.control.history.beginTransaction();
            var handled = this.control.clientSideEvents.raiseAutoCorrect(text, interval);
            this.control.history.endTransaction();
            return handled;
        };
        EventAutoCorrectProvider.prototype.isTriggerChar = function (_char) {
            return true;
        };
        EventAutoCorrectProvider.prototype.includeTriggerChar = function (_char) {
            return true;
        };
        return EventAutoCorrectProvider;
    }(AutoCorrectProviderBase));
    __aspxRichEdit.EventAutoCorrectProvider = EventAutoCorrectProvider;
    var TwoInitialCapitalsAutoCorrectProvider = (function (_super) {
        __extends(TwoInitialCapitalsAutoCorrectProvider, _super);
        function TwoInitialCapitalsAutoCorrectProvider() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TwoInitialCapitalsAutoCorrectProvider.prototype.reviseCore = function (text, interval) {
            if (text.length > 2 && text[0] === text[0].toUpperCase() && text[1] === text[1].toUpperCase()) {
                for (var i = 2; i < text.length; i++)
                    if (text[i] !== text[i].toLowerCase() || text[i] == text[i].toUpperCase())
                        return false;
                var replaceWith = text.substring(0, 1) + text[1].toLowerCase() + text.slice(2);
                this.control.modelManipulator.insertText(this.control, this.control.model.activeSubDocument, interval, replaceWith, false);
                return true;
            }
            return false;
        };
        return TwoInitialCapitalsAutoCorrectProvider;
    }(AutoCorrectProviderBase));
    __aspxRichEdit.TwoInitialCapitalsAutoCorrectProvider = TwoInitialCapitalsAutoCorrectProvider;
    var BulletedListAutoCorrectProvider = (function (_super) {
        __extends(BulletedListAutoCorrectProvider, _super);
        function BulletedListAutoCorrectProvider() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.numberingRegEx = /^[0-9]+[\.\)]$/;
            return _this;
        }
        BulletedListAutoCorrectProvider.prototype.reviseCore = function (text, interval) {
            var subDocument = this.control.model.activeSubDocument;
            var position = interval.end;
            var paragraphIndex = subDocument.getParagraphIndexByPosition(position);
            var paragraph = subDocument.paragraphs[paragraphIndex];
            if (paragraph.isInList())
                return false;
            var parStartPosition = paragraph.startLogPosition.value;
            if (parStartPosition !== interval.start)
                return false;
            var targetNumberingListType = this.getTargetNumberingListType(text);
            if (targetNumberingListType === undefined)
                return false;
            this.control.history.beginTransaction();
            __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, subDocument, new __aspxRichEdit.FixedInterval(parStartPosition, 0), __aspxRichEdit.UpdateInputPositionProperties.No, false);
            __aspxRichEdit.ModelManipulator.removeInterval(this.control, subDocument, __aspxRichEdit.FixedInterval.fromPositions(parStartPosition, position + 1), true, false);
            if (targetNumberingListType === __aspxRichEdit.NumberingType.Bullet)
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ToggleBulletedListItem).execute(this.control.commandManager.isPublicApiCall);
            else {
                var targetIndex = parseInt(text.slice(0, -1));
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ToggleNumberingListItem).execute(this.control.commandManager.isPublicApiCall, targetIndex);
                var numberingListIndex = this.control.model.numberingLists.length - 1;
                var separator = text[text.length - 1];
                for (var i = 0, length = this.control.model.numberingLists[numberingListIndex].levels.length; i < length; i++)
                    this.control.history.addAndRedo(new __aspxRichEdit.ListLevelDisplayFormatStringHistoryItem(this.control.modelManipulator, this.control.model.activeSubDocument, true, numberingListIndex, i, REWebUtils.Formatter.Format("{{0}}" + separator, i)));
            }
            this.control.history.endTransaction();
            return true;
        };
        BulletedListAutoCorrectProvider.prototype.isSeparator = function (char) {
            return __aspxRichEdit.RichUtils.isWhitespace.test(char);
        };
        BulletedListAutoCorrectProvider.prototype.isTriggerChar = function (char) {
            return char.charCodeAt(0) != REWebUtils.KeyCode.Enter && __aspxRichEdit.RichUtils.isWhitespace.test(char);
        };
        BulletedListAutoCorrectProvider.prototype.getTargetNumberingListType = function (paragraphText) {
            if (paragraphText.length === 1 && paragraphText.indexOf("*") === 0)
                return __aspxRichEdit.NumberingType.Bullet;
            if (this.numberingRegEx.test(paragraphText))
                return __aspxRichEdit.NumberingType.Simple;
            return undefined;
        };
        return BulletedListAutoCorrectProvider;
    }(AutoCorrectProviderBase));
    __aspxRichEdit.BulletedListAutoCorrectProvider = BulletedListAutoCorrectProvider;
    var UrlAutoCorrectProvider = (function (_super) {
        __extends(UrlAutoCorrectProvider, _super);
        function UrlAutoCorrectProvider() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.urlRegex = /^(?:[a-z][\w-]+:(?:\/{1,3}([^./]*:[^./]*@){0,1})|www\d{0,3}[.]|ftp[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\([^\s<>]*\))+(?:\([^\s<>]*\)|[^\s`!()\[\]{};:'"".,<>?«»“”‘’])$/i;
            _this.emailRegex = /^(mailto:)?[-\w!#$%&'*+/=?^_`{|}~]+(?:\.[-\w!#$%&'*+/=?^_`{|}~]+)*@(?:\w+([-\w]*\w)\.)[\w]+$/;
            _this.localRegex = /^(([a-zA-Z][:][\\])|(\\\\))(((?![<>:"\\|?*]).)+((?![ .])\\)?)*$/;
            return _this;
        }
        UrlAutoCorrectProvider.prototype.reviseCore = function (text, interval) {
            if (this.urlRegex.test(text) || this.emailRegex.test(text) || this.localRegex.test(text)) {
                this.control.history.beginTransaction();
                __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, this.control.model.activeSubDocument, interval, __aspxRichEdit.UpdateInputPositionProperties.No, this.control.selection.endOfLine);
                this.control.selection.intervals = [interval];
                var command = this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowHyperlinkForm);
                var state = command.getState();
                var parameters = command.createParameters(new __aspxRichEdit.CommandOptions(this.control));
                var initParameters = parameters.clone();
                parameters.text = text;
                parameters.url = this.createNavigateUri(text);
                var result = command.applyParameters(new __aspxRichEdit.IntervalCommandState(state.enabled, interval), parameters, initParameters);
                this.control.history.endTransaction();
                return result;
            }
            return false;
        };
        UrlAutoCorrectProvider.prototype.createNavigateUri = function (url) {
            if (url.indexOf(":") == -1 && url.indexOf("@") > 0)
                return "mailto:" + url;
            if (url.indexOf("www") == 0)
                return "http://" + url;
            if (url.indexOf("\\") == 0)
                return "file://" + url.replace(/\\/g, "\\\\");
            return url;
        };
        UrlAutoCorrectProvider.prototype.isSeparator = function (char) {
            return __aspxRichEdit.RichUtils.isWhitespace.test(char);
        };
        return UrlAutoCorrectProvider;
    }(AutoCorrectProviderBase));
    __aspxRichEdit.UrlAutoCorrectProvider = UrlAutoCorrectProvider;
    var TableBasedAutoCorrectProviderBase = (function (_super) {
        __extends(TableBasedAutoCorrectProviderBase, _super);
        function TableBasedAutoCorrectProviderBase(control, replaceInfo) {
            var _this = _super.call(this, control) || this;
            _this.replaceInfo = new __aspxRichEdit.AutoCorrectReplaceInfoCollection();
            _this.replaceInfo.caseSensitive = replaceInfo.caseSensitive;
            _this.initReplaceInfo(replaceInfo);
            return _this;
        }
        TableBasedAutoCorrectProviderBase.prototype.compare = function (origin, target) {
            if (!this.replaceInfo.caseSensitive) {
                origin = origin.toLocaleLowerCase();
                target = target.toLocaleLowerCase();
            }
            return origin === target ? 0 : (origin < target ? -1 : 1);
        };
        return TableBasedAutoCorrectProviderBase;
    }(AutoCorrectProviderBase));
    __aspxRichEdit.TableBasedAutoCorrectProviderBase = TableBasedAutoCorrectProviderBase;
    var TableBasedSimpleAutoCorrectProvider = (function (_super) {
        __extends(TableBasedSimpleAutoCorrectProvider, _super);
        function TableBasedSimpleAutoCorrectProvider() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableBasedSimpleAutoCorrectProvider.prototype.initReplaceInfo = function (replaceInfo) {
            var _this = this;
            __aspxRichEdit.ListUtils.foreach(replaceInfo.dictionary, function (val) {
                if (__aspxRichEdit.RichUtils.isAlphanumeric.test(val.what))
                    _this.replaceInfo.dictionary.push(val);
            });
        };
        TableBasedSimpleAutoCorrectProvider.prototype.reviseCore = function (text, interval) {
            var _this = this;
            var replaceWordIndex = __aspxRichEdit.Utils.binaryIndexOf(this.replaceInfo.dictionary, function (a) { return _this.compare(a.what, text); });
            if (replaceWordIndex >= 0) {
                var replaceWith = this.replaceInfo.dictionary[replaceWordIndex].with;
                this.control.modelManipulator.insertText(this.control, this.control.model.activeSubDocument, interval, replaceWith, false);
                return true;
            }
            return false;
        };
        return TableBasedSimpleAutoCorrectProvider;
    }(TableBasedAutoCorrectProviderBase));
    __aspxRichEdit.TableBasedSimpleAutoCorrectProvider = TableBasedSimpleAutoCorrectProvider;
    var TableBasedCompositeAutoCorrectProvider = (function (_super) {
        __extends(TableBasedCompositeAutoCorrectProvider, _super);
        function TableBasedCompositeAutoCorrectProvider() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableBasedCompositeAutoCorrectProvider.prototype.initReplaceInfo = function (replaceInfo) {
            var _this = this;
            __aspxRichEdit.ListUtils.foreach(replaceInfo.dictionary, function (val) {
                var lastSymbol = val.what[val.what.length - 1];
                if (!__aspxRichEdit.RichUtils.isAlphanumeric.test(val.what) && __aspxRichEdit.RichUtils.isAlphanumeric.test(lastSymbol))
                    _this.replaceInfo.dictionary.push(val);
            });
        };
        TableBasedCompositeAutoCorrectProvider.prototype.reviseCore = function (text, interval) {
            for (var _i = 0, _a = this.replaceInfo.dictionary; _i < _a.length; _i++) {
                var val = _a[_i];
                if (this.isEndOf(val.what, text)) {
                    var diff = val.what.length - text.length;
                    var start = interval.start - diff;
                    if (start >= 0) {
                        var intervalToCheck = new __aspxRichEdit.FixedInterval(start, interval.end - start);
                        var textToCheck = this.control.model.activeSubDocument.getText(intervalToCheck);
                        if (this.isEndOf(val.what, textToCheck)) {
                            this.control.modelManipulator.insertText(this.control, this.control.model.activeSubDocument, intervalToCheck, val.with, false);
                            return true;
                        }
                    }
                }
            }
            return false;
        };
        TableBasedCompositeAutoCorrectProvider.prototype.isEndOf = function (origin, target) {
            return this.compare(origin.substr(target.length * -1, target.length), target) == 0;
        };
        return TableBasedCompositeAutoCorrectProvider;
    }(TableBasedAutoCorrectProviderBase));
    __aspxRichEdit.TableBasedCompositeAutoCorrectProvider = TableBasedCompositeAutoCorrectProvider;
    var TableBasedImmediateAutoCorrectProvider = (function (_super) {
        __extends(TableBasedImmediateAutoCorrectProvider, _super);
        function TableBasedImmediateAutoCorrectProvider() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableBasedImmediateAutoCorrectProvider.prototype.initReplaceInfo = function (replaceInfo) {
            var _this = this;
            this.triggeredChar = [];
            __aspxRichEdit.ListUtils.foreach(replaceInfo.dictionary, function (val) {
                var lastSymbol = val.what[val.what.length - 1];
                if (!__aspxRichEdit.RichUtils.isAlphanumeric.test(lastSymbol)) {
                    _this.triggeredChar.push(lastSymbol);
                    _this.replaceInfo.dictionary.push(val);
                }
            });
        };
        TableBasedImmediateAutoCorrectProvider.prototype.isTriggerChar = function (char) {
            return __aspxRichEdit.ListUtils.anyOf(this.triggeredChar, function (currVal) { return currVal == char; });
        };
        TableBasedImmediateAutoCorrectProvider.prototype.includeTriggerChar = function (_char) {
            return true;
        };
        return TableBasedImmediateAutoCorrectProvider;
    }(TableBasedCompositeAutoCorrectProvider));
    __aspxRichEdit.TableBasedImmediateAutoCorrectProvider = TableBasedImmediateAutoCorrectProvider;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AutoCorrectService = (function () {
        function AutoCorrectService(control, settings) {
            this.control = control;
            this.settings = settings;
            this.providers = [];
            this.registerDefaultProviders();
        }
        AutoCorrectService.prototype.registerDefaultProviders = function () {
            this.providers.push(new __aspxRichEdit.EventAutoCorrectProvider(this.control));
            if (this.settings.replaceTextAsYouType) {
                this.providers.push(new __aspxRichEdit.TableBasedSimpleAutoCorrectProvider(this.control, this.settings.replaceInfo));
                this.providers.push(new __aspxRichEdit.TableBasedCompositeAutoCorrectProvider(this.control, this.settings.replaceInfo));
                this.providers.push(new __aspxRichEdit.TableBasedImmediateAutoCorrectProvider(this.control, this.settings.replaceInfo));
            }
            if (this.settings.correctTwoInitialCapitals)
                this.providers.push(new __aspxRichEdit.TwoInitialCapitalsAutoCorrectProvider(this.control));
            if (this.settings.enableAutomaticNumbering)
                this.providers.push(new __aspxRichEdit.BulletedListAutoCorrectProvider(this.control));
            if (this.settings.detectUrls)
                this.providers.push(new __aspxRichEdit.UrlAutoCorrectProvider(this.control));
        };
        AutoCorrectService.prototype.performAutoCorrect = function () {
            if (this.control.selection.isCollapsed()) {
                for (var _i = 0, _a = this.providers; _i < _a.length; _i++) {
                    var provider = _a[_i];
                    if (provider.revise())
                        return;
                }
            }
        };
        return AutoCorrectService;
    }());
    __aspxRichEdit.AutoCorrectService = AutoCorrectService;
    var AutoCorrectSettings = (function () {
        function AutoCorrectSettings() {
            this.detectUrls = true;
            this.correctTwoInitialCapitals = false;
            this.replaceTextAsYouType = false;
            this.enableAutomaticNumbering = true;
            this.replaceInfo = new AutoCorrectReplaceInfoCollection();
        }
        return AutoCorrectSettings;
    }());
    __aspxRichEdit.AutoCorrectSettings = AutoCorrectSettings;
    var AutoCorrectReplaceInfoCollection = (function () {
        function AutoCorrectReplaceInfoCollection() {
            this.caseSensitive = false;
            this.dictionary = [];
        }
        return AutoCorrectReplaceInfoCollection;
    }());
    __aspxRichEdit.AutoCorrectReplaceInfoCollection = AutoCorrectReplaceInfoCollection;
    var AutoCorrectReplaceInfo = (function () {
        function AutoCorrectReplaceInfo(whatReplace, withReplace) {
            this.what = whatReplace;
            this.with = withReplace;
        }
        return AutoCorrectReplaceInfo;
    }());
    __aspxRichEdit.AutoCorrectReplaceInfo = AutoCorrectReplaceInfo;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var VISIBLE_PAGES_RANGE = 2;
    var VISIBLE_PAGES_RANGE_TOUCH = 0;
    var VISIBLE_AREA_HEIGHT_MULTIPLIER = 2;
    var CanvasScrollInfo = (function () {
        function CanvasScrollInfo(canvas, sizes) {
            this.lastScrollTop = -1;
            this.lastScrollLeft = -1;
            this.startVisiblePageIndex = 0;
            this.endVisiblePageIndex = 0;
            this.init(canvas, sizes);
        }
        CanvasScrollInfo.prototype.init = function (canvas, sizes) {
            this.canvas = canvas;
            this.sizes = sizes;
            this.renderPagesOffset = REWebUtils.Browser.TouchUI ? VISIBLE_PAGES_RANGE_TOUCH : VISIBLE_PAGES_RANGE;
        };
        CanvasScrollInfo.prototype.getStartRenderPageIndex = function () {
            return Math.max(0, this.startVisiblePageIndex - this.renderPagesOffset);
        };
        CanvasScrollInfo.prototype.getEndRenderPageIndex = function () {
            return this.endVisiblePageIndex + this.renderPagesOffset;
        };
        CanvasScrollInfo.prototype.renderPageIndexInterval = function () {
            return __aspxRichEdit.FixedInterval.fromPositions(this.getStartRenderPageIndex(), this.getEndRenderPageIndex() + 1);
        };
        CanvasScrollInfo.prototype.updatePageIndexesInfo = function (pages) {
            if (!pages.length)
                return;
            var scrollTop = this.canvas.scrollTop;
            this.lastScrollLeft = this.canvas.scrollLeft;
            if (this.startVisiblePageIndex >= 0 && scrollTop == this.lastScrollTop)
                return;
            this.startVisiblePageIndex = this.sizes.findPageIndexByOffsetY(pages, this.canvas.scrollTop);
            this.endVisiblePageIndex = this.sizes.findPageIndexByOffsetY(pages, this.canvas.scrollTop + this.sizes.getVisibleAreaHeight(false));
            this.lastScrollTop = scrollTop;
        };
        CanvasScrollInfo.prototype.getVisibleInterval = function () {
            var visibleHeightInterval = new __aspxRichEdit.FixedInterval(this.canvas.scrollTop, this.sizes.getVisibleAreaHeight(false));
            var fullRenderedHeight = visibleHeightInterval.length * VISIBLE_AREA_HEIGHT_MULTIPLIER;
            return new __aspxRichEdit.FixedInterval(Math.max(0, visibleHeightInterval.center - Math.floor(fullRenderedHeight / 2)), fullRenderedHeight).getBoundaryInterval();
        };
        return CanvasScrollInfo;
    }());
    __aspxRichEdit.CanvasScrollInfo = CanvasScrollInfo;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var CanvasScrollManager = (function () {
        function CanvasScrollManager(viewManager, horizontalRuler) {
            this.updateScrollTimeoutId = -1;
            this.waitForDblClickTimeoutId = -1;
            this.viewManager = viewManager;
            this.horizontalRuler = horizontalRuler;
        }
        Object.defineProperty(CanvasScrollManager.prototype, "canvas", {
            get: function () { return this.viewManager.canvas; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(CanvasScrollManager.prototype, "sizes", {
            get: function () { return this.viewManager.sizes; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(CanvasScrollManager.prototype, "scrollTop", {
            get: function () { return this.canvas.scrollTop; },
            set: function (val) { this.canvas.scrollTop = val; },
            enumerable: true,
            configurable: true
        });
        CanvasScrollManager.prototype.setScrollEnabled = function (enabled) {
            if (enabled)
                this.canvas.style.overflow = "";
            else
                this.canvas.style.overflow = "hidden";
            this.updateScrollVisibility();
        };
        CanvasScrollManager.prototype.updateScrollVisibility = function () {
            if (!this.scrollMeasurer) {
                this.scrollMeasurer = document.createElement("div");
                this.scrollMeasurer.style.position = "absolute";
                this.scrollMeasurer.style.top = "0";
                this.scrollMeasurer.style.bottom = "0";
                this.scrollMeasurer.style.right = "0";
                this.scrollMeasurer.style.left = "0";
            }
            this.canvas.appendChild(this.scrollMeasurer);
            var prevScrollYVisibility = this.sizes.scrollYVisible;
            this.sizes.updateScrollVisibility(this.scrollMeasurer.offsetWidth, this.scrollMeasurer.offsetHeight);
            this.canvas.removeChild(this.scrollMeasurer);
            if (prevScrollYVisibility !== this.sizes.scrollYVisible && this.horizontalRuler)
                this.horizontalRuler.adjust();
        };
        CanvasScrollManager.prototype.scrollToX = function (canvasState) {
            var position = canvasState.lp;
            var relativePosition = canvasState.relativePosition;
            var y = this.sizes.getPageOffsetY(this.viewManager.layout.pages[position.pageIndex]);
            var height = 0;
            if (position.detailsLevel >= __aspxRichEdit.DocumentLayoutDetailsLevel.PageArea) {
                y += position.pageArea.y;
                if (position.detailsLevel >= __aspxRichEdit.DocumentLayoutDetailsLevel.Column) {
                    y += position.column.y;
                    if (position.detailsLevel >= __aspxRichEdit.DocumentLayoutDetailsLevel.Row) {
                        y += position.row.y;
                        if (relativePosition === __aspxRichEdit.Scroll.RelativePosition.Bottom)
                            y += position.row.height;
                        else if (relativePosition === __aspxRichEdit.Scroll.RelativePosition.Inside)
                            height = position.row.height;
                    }
                    else if (relativePosition === __aspxRichEdit.Scroll.RelativePosition.Bottom)
                        y += position.column.height;
                    else if (relativePosition === __aspxRichEdit.Scroll.RelativePosition.Inside)
                        height = position.column.height;
                }
                else if (relativePosition === __aspxRichEdit.Scroll.RelativePosition.Bottom)
                    y += position.pageArea.height;
                else if (relativePosition === __aspxRichEdit.Scroll.RelativePosition.Inside)
                    height = position.pageArea.height;
            }
            else if (relativePosition === __aspxRichEdit.Scroll.RelativePosition.Bottom)
                y += position.page.height;
            else if (relativePosition === __aspxRichEdit.Scroll.RelativePosition.Inside)
                height = position.page.height;
            if (relativePosition === __aspxRichEdit.Scroll.RelativePosition.Bottom)
                y -= this.sizes.getVisibleAreaHeight(false);
            y += canvasState.getVerticalOffset(this.sizes);
            if (relativePosition === __aspxRichEdit.Scroll.RelativePosition.Inside) {
                var scrollTop = this.canvas.scrollTop;
                var scrollVisibleAreaHeight = this.sizes.getVisibleAreaHeight(false);
                if (y < scrollTop)
                    this.canvas.scrollTop = y;
                else if (y + height > scrollVisibleAreaHeight + scrollTop)
                    this.canvas.scrollTop = y + height - scrollVisibleAreaHeight;
            }
            else
                this.canvas.scrollTop = y;
        };
        CanvasScrollManager.prototype.NotifyScrollPositionChanged = function (canvasState) {
            var _this = this;
            if (this.updateScrollTimeoutId > 0) {
                clearTimeout(this.updateScrollTimeoutId);
                this.updateScrollTimeoutId = -1;
            }
            if (this.waitForDblClickTimeoutId > 0) {
                this.updateScrollTimeoutId = setTimeout(function () {
                    _this.scrollToX(canvasState);
                }, __aspxRichEdit.MouseHandler.WAIT_FOR_DBLCLICK_INTERVAL);
            }
            else
                this.scrollToX(canvasState);
        };
        CanvasScrollManager.prototype.waitForDblClick = function () {
            var _this = this;
            if (this.waitForDblClickTimeoutId > 0)
                clearTimeout(this.waitForDblClickTimeoutId);
            this.waitForDblClickTimeoutId = setTimeout(function () {
                _this.waitForDblClickTimeoutId = -1;
            }, __aspxRichEdit.MouseHandler.WAIT_FOR_DBLCLICK_INTERVAL);
        };
        return CanvasScrollManager;
    }());
    __aspxRichEdit.CanvasScrollManager = CanvasScrollManager;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var CanvasSizeInfo = (function () {
        function CanvasSizeInfo() {
            this.topSpacing = -1;
            this.betweenPageSpacing = 1;
            this.visibleAreaSize = new __aspxRichEdit.Size(-1, -1);
            this.scrollWidth = -1;
            this.scrollWidth = REWebUtils.GetVerticalScrollBarWidth();
        }
        CanvasSizeInfo.prototype.isInitialized = function () {
            return this.topSpacing >= 0;
        };
        CanvasSizeInfo.prototype.initialize = function (page, canvas) {
            var pageElementStyle = REWebUtils.GetCurrentStyle(page);
            this.topSpacing = REWebUtils.PxToFloat(pageElementStyle.borderTopWidth) + REWebUtils.PxToFloat(pageElementStyle.marginTop);
            this.betweenPageSpacing = REWebUtils.PxToFloat(pageElementStyle.borderTopWidth) + REWebUtils.PxToFloat(pageElementStyle.borderBottomWidth) +
                Math.max(REWebUtils.PxToFloat(pageElementStyle.marginTop), REWebUtils.PxToFloat(pageElementStyle.marginBottom));
            this.setVisibleAreaSize(canvas.offsetWidth, canvas.offsetHeight);
        };
        CanvasSizeInfo.prototype.findPageIndexByOffsetY = function (pages, offsetY) {
            var _this = this;
            return Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(pages, function (p) { return _this.getPageOffsetY(p); }, offsetY));
        };
        CanvasSizeInfo.prototype.getPageOffsetY = function (layoutPage) {
            return layoutPage.y + (this.topSpacing + layoutPage.index * this.betweenPageSpacing);
        };
        CanvasSizeInfo.prototype.setVisibleAreaSize = function (width, height) {
            this.visibleAreaSize.width = width;
            this.visibleAreaSize.height = height;
        };
        CanvasSizeInfo.prototype.getVisibleAreaWidth = function (includeScrollBars) {
            if (includeScrollBars)
                return this.visibleAreaSize.width;
            return this.scrollYVisible ? this.visibleAreaSize.width - this.scrollWidth : this.visibleAreaSize.width;
        };
        CanvasSizeInfo.prototype.getVisibleAreaHeight = function (includeScrollBars) {
            if (includeScrollBars)
                return this.visibleAreaSize.height;
            return this.scrollXVisible ? this.visibleAreaSize.height - this.scrollWidth : this.visibleAreaSize.height;
        };
        CanvasSizeInfo.prototype.updateScrollVisibility = function (measurerWidth, measurerHeight) {
            this.scrollXVisible = measurerHeight < this.visibleAreaSize.height;
            this.scrollYVisible = measurerWidth < this.visibleAreaSize.width;
        };
        return CanvasSizeInfo;
    }());
    __aspxRichEdit.CanvasSizeInfo = CanvasSizeInfo;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlConverter = (function () {
        function HtmlConverter() {
        }
        HtmlConverter.getCssRules = function (charProps, textColor, isWordBox, noStrikeoutAndUnderline) {
            var rules = HtmlConverter.getSizeSignificantRules(charProps);
            textColor = textColor !== __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR ? textColor : __aspxRichEdit.ColorHelper.BLACK_COLOR;
            rules.push("color: " + __aspxRichEdit.ColorHelper.getCssStringInternal(textColor));
            if (!noStrikeoutAndUnderline) {
                if (charProps.fontStrikeoutType != __aspxRichEdit.StrikeoutType.None && (isWordBox || !charProps.strikeoutWordsOnly))
                    rules.push("text-decoration: line-through");
                if (charProps.fontUnderlineType != __aspxRichEdit.UnderlineType.None && (isWordBox || !charProps.underlineWordsOnly))
                    rules.push("text-decoration: underline");
            }
            return rules;
        };
        HtmlConverter.getSizeSignificantCssString = function (characterProperties) {
            return HtmlConverter.getSizeSignificantRules(characterProperties).join(";");
        };
        HtmlConverter.buildHyperlinkTipString = function (hyperlinkTip) {
            if (!hyperlinkTip)
                hyperlinkTip = "";
            hyperlinkTip = hyperlinkTip.replace(/['|"]/g, "&quot;");
            return hyperlinkTip + "\nCtrl + " + ASPxClientRichEdit.CommonLabels.ClickToFollowHyperlink;
        };
        HtmlConverter.getSizeSignificantRules = function (characterProperties) {
            var rules = [];
            if (characterProperties.allCaps)
                rules.push("text-transform: uppercase");
            rules.push("font-family: " + HtmlConverter.buildFontFamilyRule(characterProperties.fontInfo.cssString) + " !important");
            if (characterProperties.fontBold)
                rules.push("font-weight: bold");
            if (characterProperties.fontItalic)
                rules.push("font-style: italic");
            var fontSizePx = __aspxRichEdit.UnitConverter.pointsToPixelsF(characterProperties.fontSize);
            if (characterProperties.script == __aspxRichEdit.CharacterFormattingScript.Normal)
                rules.push("font-size: " + __aspxRichEdit.MathUtils.round(fontSizePx, 3) + "px !important");
            else {
                rules.push("font-size: " + __aspxRichEdit.MathUtils.round(fontSizePx * characterProperties.fontInfo.scriptMultiplier, 3) + "px !important");
            }
            return rules;
        };
        HtmlConverter.buildFontFamilyRule = function (cssString) {
            var result = cssString.replace(/"/g, "&quot;");
            if (result.replace(/</g, '&lt;').replace(/>/g, '&gt;') != result)
                result = result.replace(/'/g, "&quot;");
            return result;
        };
        return HtmlConverter;
    }());
    __aspxRichEdit.HtmlConverter = HtmlConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutPoint = (function (_super) {
        __extends(LayoutPoint, _super);
        function LayoutPoint(pageIndex, pageX, pageY) {
            var _this = _super.call(this, pageX, pageY) || this;
            _this.pageIndex = pageIndex;
            return _this;
        }
        LayoutPoint.prototype.isEmpty = function () {
            return this.pageIndex == -1;
        };
        LayoutPoint.Empty = function () {
            return new LayoutPoint(-1, -1, -1);
        };
        LayoutPoint.prototype.clone = function () {
            return new LayoutPoint(this.pageIndex, this.x, this.y);
        };
        Object.defineProperty(LayoutPoint.prototype, "point", {
            get: function () {
                return new __aspxRichEdit.Point(this.x, this.y);
            },
            enumerable: true,
            configurable: true
        });
        return LayoutPoint;
    }(__aspxRichEdit.Point));
    __aspxRichEdit.LayoutPoint = LayoutPoint;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var CreateBookmarkCommandParameter = (function (_super) {
        __extends(CreateBookmarkCommandParameter, _super);
        function CreateBookmarkCommandParameter(control, bkmTemplate) {
            var _this = _super.call(this, control) || this;
            _this.bkmTemplate = bkmTemplate;
            return _this;
        }
        return CreateBookmarkCommandParameter;
    }(__aspxRichEdit.CommandOptions));
    __aspxRichEdit.CreateBookmarkCommandParameter = CreateBookmarkCommandParameter;
    var BookmarkCommandBase = (function (_super) {
        __extends(BookmarkCommandBase, _super);
        function BookmarkCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        BookmarkCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.bookmarks);
        };
        BookmarkCommandBase.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        return BookmarkCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.BookmarkCommandBase = BookmarkCommandBase;
    var CreateBookmarkCommand = (function (_super) {
        __extends(CreateBookmarkCommand, _super);
        function CreateBookmarkCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CreateBookmarkCommand.prototype.executeCore = function (_state, parameter) {
            var bkmTemplate = parameter.param;
            var subDocument = parameter.subDocument;
            if (!__aspxRichEdit.Bookmark.isValidName(bkmTemplate.name, true))
                return false;
            this.control.history.beginTransaction();
            var bkmInfo = __aspxRichEdit.BookmarksManipulator.findBookmark(this.control.model.subDocuments, bkmTemplate.name);
            if (bkmInfo)
                this.control.history.addAndRedo(new __aspxRichEdit.DeleteBookmarkHistoryItem(this.control.modelManipulator, bkmInfo.subDocument, bkmInfo.bookmark.constBookmark));
            this.control.history.addAndRedo(new __aspxRichEdit.CreateBookmarkHistoryItem(this.control.modelManipulator, subDocument, bkmTemplate));
            this.control.history.endTransaction();
            return true;
        };
        return CreateBookmarkCommand;
    }(BookmarkCommandBase));
    __aspxRichEdit.CreateBookmarkCommand = CreateBookmarkCommand;
    var DeleteBookmarksCommand = (function (_super) {
        __extends(DeleteBookmarksCommand, _super);
        function DeleteBookmarksCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DeleteBookmarksCommand.prototype.executeCore = function (_state, parameter) {
            var bookmarkNames = parameter.param;
            this.control.history.beginTransaction();
            var changed = false;
            for (var _i = 0, bookmarkNames_1 = bookmarkNames; _i < bookmarkNames_1.length; _i++) {
                var name_1 = bookmarkNames_1[_i];
                var bookmarkInfo = __aspxRichEdit.BookmarksManipulator.findBookmark(this.control.model.subDocuments, name_1);
                if (!bookmarkInfo)
                    continue;
                this.control.history.addAndRedo(new __aspxRichEdit.DeleteBookmarkHistoryItem(this.control.modelManipulator, bookmarkInfo.subDocument, bookmarkInfo.bookmark.constBookmark));
                changed = true;
            }
            this.control.history.endTransaction();
            return changed;
        };
        return DeleteBookmarksCommand;
    }(BookmarkCommandBase));
    __aspxRichEdit.DeleteBookmarksCommand = DeleteBookmarksCommand;
    var GoToBookmarkCommand = (function (_super) {
        __extends(GoToBookmarkCommand, _super);
        function GoToBookmarkCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToBookmarkCommand.prototype.executeCore = function (_state, parameter) {
            var obj = __aspxRichEdit.BookmarksManipulator.findBookmark(this.control.model.subDocuments, parameter.param);
            if (!obj)
                return false;
            var selection = this.control.selection;
            var subDocument = obj.subDocument;
            var bookmark = obj.bookmark;
            this.changeSubDocument(subDocument);
            selection.setSelection(new __aspxRichEdit.SetSelectionParams()
                .setInterval(bookmark.interval)
                .setEndOfLine(false)
                .setUpdateInputPositionProperties(false)
                .setCorrectIntervalDueToFields(true)
                .setCorrectIntervalDueToTables(true));
            selection.scrollManager.setScroll(new __aspxRichEdit.Scroll.State().byModelPosition
                .setModelPosition(bookmark.start)
                .setRelativePosition(__aspxRichEdit.Scroll.RelativePosition.Top)
                .setVerticalOffset(function (sizes) { return -Math.ceil(sizes.getVisibleAreaHeight(false) / 4); }));
            return true;
        };
        GoToBookmarkCommand.prototype.changeSubDocument = function (subDocument) {
            if (this.control.model.activeSubDocument == subDocument)
                return;
            if (subDocument.isMain())
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToMain)
                    .execute(this.control.commandManager.isPublicApiCall);
            else
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToHeaderFooterBySubDocument)
                    .execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, subDocument));
        };
        GoToBookmarkCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return GoToBookmarkCommand;
    }(BookmarkCommandBase));
    __aspxRichEdit.GoToBookmarkCommand = GoToBookmarkCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RichEditClientCommand;
    (function (RichEditClientCommand) {
        RichEditClientCommand[RichEditClientCommand["None"] = 0] = "None";
        RichEditClientCommand[RichEditClientCommand["FileNew"] = 1] = "FileNew";
        RichEditClientCommand[RichEditClientCommand["FileOpen"] = 2] = "FileOpen";
        RichEditClientCommand[RichEditClientCommand["FileSave"] = 3] = "FileSave";
        RichEditClientCommand[RichEditClientCommand["FileSaveAs"] = 4] = "FileSaveAs";
        RichEditClientCommand[RichEditClientCommand["FilePrint"] = 5] = "FilePrint";
        RichEditClientCommand[RichEditClientCommand["Undo"] = 6] = "Undo";
        RichEditClientCommand[RichEditClientCommand["Redo"] = 7] = "Redo";
        RichEditClientCommand[RichEditClientCommand["PasteSelection"] = 8] = "PasteSelection";
        RichEditClientCommand[RichEditClientCommand["CopySelection"] = 9] = "CopySelection";
        RichEditClientCommand[RichEditClientCommand["CutSelection"] = 10] = "CutSelection";
        RichEditClientCommand[RichEditClientCommand["ChangeFontName"] = 11] = "ChangeFontName";
        RichEditClientCommand[RichEditClientCommand["ChangeStyle"] = 12] = "ChangeStyle";
        RichEditClientCommand[RichEditClientCommand["ChangeFontSize"] = 13] = "ChangeFontSize";
        RichEditClientCommand[RichEditClientCommand["IncreaseFontSize"] = 14] = "IncreaseFontSize";
        RichEditClientCommand[RichEditClientCommand["DecreaseFontSize"] = 15] = "DecreaseFontSize";
        RichEditClientCommand[RichEditClientCommand["MakeTextUpperCase"] = 16] = "MakeTextUpperCase";
        RichEditClientCommand[RichEditClientCommand["MakeTextLowerCase"] = 17] = "MakeTextLowerCase";
        RichEditClientCommand[RichEditClientCommand["CapitalizeEachWordTextCase"] = 18] = "CapitalizeEachWordTextCase";
        RichEditClientCommand[RichEditClientCommand["ToggleTextCase"] = 19] = "ToggleTextCase";
        RichEditClientCommand[RichEditClientCommand["ToggleFontBold"] = 20] = "ToggleFontBold";
        RichEditClientCommand[RichEditClientCommand["ToggleFontItalic"] = 21] = "ToggleFontItalic";
        RichEditClientCommand[RichEditClientCommand["ToggleFontUnderline"] = 22] = "ToggleFontUnderline";
        RichEditClientCommand[RichEditClientCommand["ToggleFontDoubleUnderline"] = 23] = "ToggleFontDoubleUnderline";
        RichEditClientCommand[RichEditClientCommand["ToggleFontStrikeout"] = 24] = "ToggleFontStrikeout";
        RichEditClientCommand[RichEditClientCommand["ToggleFontSuperscript"] = 26] = "ToggleFontSuperscript";
        RichEditClientCommand[RichEditClientCommand["ToggleFontSubscript"] = 27] = "ToggleFontSubscript";
        RichEditClientCommand[RichEditClientCommand["ChangeFontForeColor"] = 28] = "ChangeFontForeColor";
        RichEditClientCommand[RichEditClientCommand["ChangeFontBackColor"] = 29] = "ChangeFontBackColor";
        RichEditClientCommand[RichEditClientCommand["ClearFormatting"] = 30] = "ClearFormatting";
        RichEditClientCommand[RichEditClientCommand["ToggleBulletedListItem"] = 31] = "ToggleBulletedListItem";
        RichEditClientCommand[RichEditClientCommand["ToggleNumberingListItem"] = 32] = "ToggleNumberingListItem";
        RichEditClientCommand[RichEditClientCommand["ToggleMultilevelListItem"] = 33] = "ToggleMultilevelListItem";
        RichEditClientCommand[RichEditClientCommand["DecreaseIndent"] = 34] = "DecreaseIndent";
        RichEditClientCommand[RichEditClientCommand["IncreaseIndent"] = 35] = "IncreaseIndent";
        RichEditClientCommand[RichEditClientCommand["ToggleShowWhitespace"] = 36] = "ToggleShowWhitespace";
        RichEditClientCommand[RichEditClientCommand["ToggleParagraphAlignmentLeft"] = 37] = "ToggleParagraphAlignmentLeft";
        RichEditClientCommand[RichEditClientCommand["ToggleParagraphAlignmentCenter"] = 38] = "ToggleParagraphAlignmentCenter";
        RichEditClientCommand[RichEditClientCommand["ToggleParagraphAlignmentRight"] = 39] = "ToggleParagraphAlignmentRight";
        RichEditClientCommand[RichEditClientCommand["ToggleParagraphAlignmentJustify"] = 40] = "ToggleParagraphAlignmentJustify";
        RichEditClientCommand[RichEditClientCommand["SetSingleParagraphSpacing"] = 41] = "SetSingleParagraphSpacing";
        RichEditClientCommand[RichEditClientCommand["SetSesquialteralParagraphSpacing"] = 42] = "SetSesquialteralParagraphSpacing";
        RichEditClientCommand[RichEditClientCommand["SetDoubleParagraphSpacing"] = 43] = "SetDoubleParagraphSpacing";
        RichEditClientCommand[RichEditClientCommand["AddSpacingBeforeParagraph"] = 45] = "AddSpacingBeforeParagraph";
        RichEditClientCommand[RichEditClientCommand["AddSpacingAfterParagraph"] = 46] = "AddSpacingAfterParagraph";
        RichEditClientCommand[RichEditClientCommand["RemoveSpacingBeforeParagraph"] = 47] = "RemoveSpacingBeforeParagraph";
        RichEditClientCommand[RichEditClientCommand["RemoveSpacingAfterParagraph"] = 48] = "RemoveSpacingAfterParagraph";
        RichEditClientCommand[RichEditClientCommand["ChangeParagraphBackColor"] = 49] = "ChangeParagraphBackColor";
        RichEditClientCommand[RichEditClientCommand["Find"] = 50] = "Find";
        RichEditClientCommand[RichEditClientCommand["Replace"] = 51] = "Replace";
        RichEditClientCommand[RichEditClientCommand["ShowFontForm"] = 52] = "ShowFontForm";
        RichEditClientCommand[RichEditClientCommand["ShowParagraphForm"] = 53] = "ShowParagraphForm";
        RichEditClientCommand[RichEditClientCommand["InsertPageBreak"] = 54] = "InsertPageBreak";
        RichEditClientCommand[RichEditClientCommand["ShowInsertTableForm"] = 55] = "ShowInsertTableForm";
        RichEditClientCommand[RichEditClientCommand["InsertPicture"] = 56] = "InsertPicture";
        RichEditClientCommand[RichEditClientCommand["ShowBookmarkForm"] = 58] = "ShowBookmarkForm";
        RichEditClientCommand[RichEditClientCommand["ShowHyperlinkForm"] = 59] = "ShowHyperlinkForm";
        RichEditClientCommand[RichEditClientCommand["ShowSymbolForm"] = 65] = "ShowSymbolForm";
        RichEditClientCommand[RichEditClientCommand["SetNormalSectionPageMargins"] = 66] = "SetNormalSectionPageMargins";
        RichEditClientCommand[RichEditClientCommand["SetNarrowSectionPageMargins"] = 67] = "SetNarrowSectionPageMargins";
        RichEditClientCommand[RichEditClientCommand["SetModerateSectionPageMargins"] = 68] = "SetModerateSectionPageMargins";
        RichEditClientCommand[RichEditClientCommand["SetWideSectionPageMargins"] = 69] = "SetWideSectionPageMargins";
        RichEditClientCommand[RichEditClientCommand["ShowPageMarginsSetupForm"] = 70] = "ShowPageMarginsSetupForm";
        RichEditClientCommand[RichEditClientCommand["SetPortraitPageOrientation"] = 71] = "SetPortraitPageOrientation";
        RichEditClientCommand[RichEditClientCommand["SetLandscapePageOrientation"] = 72] = "SetLandscapePageOrientation";
        RichEditClientCommand[RichEditClientCommand["ShowPagePaperSetupForm"] = 73] = "ShowPagePaperSetupForm";
        RichEditClientCommand[RichEditClientCommand["SetSectionOneColumn"] = 74] = "SetSectionOneColumn";
        RichEditClientCommand[RichEditClientCommand["SetSectionTwoColumns"] = 75] = "SetSectionTwoColumns";
        RichEditClientCommand[RichEditClientCommand["SetSectionThreeColumns"] = 76] = "SetSectionThreeColumns";
        RichEditClientCommand[RichEditClientCommand["ShowColumnsSetupForm"] = 77] = "ShowColumnsSetupForm";
        RichEditClientCommand[RichEditClientCommand["InsertColumnBreak"] = 79] = "InsertColumnBreak";
        RichEditClientCommand[RichEditClientCommand["InsertSectionBreakNextPage"] = 80] = "InsertSectionBreakNextPage";
        RichEditClientCommand[RichEditClientCommand["InsertSectionBreakEvenPage"] = 81] = "InsertSectionBreakEvenPage";
        RichEditClientCommand[RichEditClientCommand["InsertSectionBreakOddPage"] = 82] = "InsertSectionBreakOddPage";
        RichEditClientCommand[RichEditClientCommand["ChangePageColor"] = 90] = "ChangePageColor";
        RichEditClientCommand[RichEditClientCommand["ToggleShowHorizontalRuler"] = 94] = "ToggleShowHorizontalRuler";
        RichEditClientCommand[RichEditClientCommand["FullScreen"] = 98] = "FullScreen";
        RichEditClientCommand[RichEditClientCommand["SetSectionLegalPaperKind"] = 99] = "SetSectionLegalPaperKind";
        RichEditClientCommand[RichEditClientCommand["SetSectionFolioPaperKind"] = 100] = "SetSectionFolioPaperKind";
        RichEditClientCommand[RichEditClientCommand["SetSectionA4PaperKind"] = 101] = "SetSectionA4PaperKind";
        RichEditClientCommand[RichEditClientCommand["SetSectionA5PaperKind"] = 102] = "SetSectionA5PaperKind";
        RichEditClientCommand[RichEditClientCommand["SetSectionA6PaperKind"] = 103] = "SetSectionA6PaperKind";
        RichEditClientCommand[RichEditClientCommand["SetSectionB5PaperKind"] = 104] = "SetSectionB5PaperKind";
        RichEditClientCommand[RichEditClientCommand["SetSectionExecutivePaperKind"] = 105] = "SetSectionExecutivePaperKind";
        RichEditClientCommand[RichEditClientCommand["SelectAll"] = 106] = "SelectAll";
        RichEditClientCommand[RichEditClientCommand["ShowPageSetupForm"] = 107] = "ShowPageSetupForm";
        RichEditClientCommand[RichEditClientCommand["ShowNumberingListForm"] = 108] = "ShowNumberingListForm";
        RichEditClientCommand[RichEditClientCommand["ExtendLineDown"] = 109] = "ExtendLineDown";
        RichEditClientCommand[RichEditClientCommand["ExtendLineEnd"] = 110] = "ExtendLineEnd";
        RichEditClientCommand[RichEditClientCommand["ExtendLineStart"] = 111] = "ExtendLineStart";
        RichEditClientCommand[RichEditClientCommand["ExtendLineUp"] = 112] = "ExtendLineUp";
        RichEditClientCommand[RichEditClientCommand["ExtendNextCharacter"] = 113] = "ExtendNextCharacter";
        RichEditClientCommand[RichEditClientCommand["ExtendPreviousCharacter"] = 114] = "ExtendPreviousCharacter";
        RichEditClientCommand[RichEditClientCommand["ExtendSelectLine"] = 115] = "ExtendSelectLine";
        RichEditClientCommand[RichEditClientCommand["InsertParagraph"] = 116] = "InsertParagraph";
        RichEditClientCommand[RichEditClientCommand["InsertText"] = 117] = "InsertText";
        RichEditClientCommand[RichEditClientCommand["LineDown"] = 118] = "LineDown";
        RichEditClientCommand[RichEditClientCommand["LineEnd"] = 119] = "LineEnd";
        RichEditClientCommand[RichEditClientCommand["LineStart"] = 120] = "LineStart";
        RichEditClientCommand[RichEditClientCommand["LineUp"] = 121] = "LineUp";
        RichEditClientCommand[RichEditClientCommand["NextCharacter"] = 122] = "NextCharacter";
        RichEditClientCommand[RichEditClientCommand["PreviousCharacter"] = 123] = "PreviousCharacter";
        RichEditClientCommand[RichEditClientCommand["SelectLine"] = 124] = "SelectLine";
        RichEditClientCommand[RichEditClientCommand["ToggleBackspaceKey"] = 125] = "ToggleBackspaceKey";
        RichEditClientCommand[RichEditClientCommand["ToggleDeleteKey"] = 126] = "ToggleDeleteKey";
        RichEditClientCommand[RichEditClientCommand["InsertLineBreak"] = 127] = "InsertLineBreak";
        RichEditClientCommand[RichEditClientCommand["NextPage"] = 128] = "NextPage";
        RichEditClientCommand[RichEditClientCommand["ExtendNextPage"] = 129] = "ExtendNextPage";
        RichEditClientCommand[RichEditClientCommand["PreviousPage"] = 130] = "PreviousPage";
        RichEditClientCommand[RichEditClientCommand["ExtendPreviousPage"] = 131] = "ExtendPreviousPage";
        RichEditClientCommand[RichEditClientCommand["ChangeInlinePictureScale"] = 132] = "ChangeInlinePictureScale";
        RichEditClientCommand[RichEditClientCommand["IncrementParagraphLeftIndent"] = 133] = "IncrementParagraphLeftIndent";
        RichEditClientCommand[RichEditClientCommand["DecrementParagraphLeftIndent"] = 134] = "DecrementParagraphLeftIndent";
        RichEditClientCommand[RichEditClientCommand["DragMoveContent"] = 135] = "DragMoveContent";
        RichEditClientCommand[RichEditClientCommand["DragCopyContent"] = 136] = "DragCopyContent";
        RichEditClientCommand[RichEditClientCommand["InsertSpace"] = 137] = "InsertSpace";
        RichEditClientCommand[RichEditClientCommand["RulerSectionMarginLeft"] = 138] = "RulerSectionMarginLeft";
        RichEditClientCommand[RichEditClientCommand["RulerSectionMarginRight"] = 139] = "RulerSectionMarginRight";
        RichEditClientCommand[RichEditClientCommand["RulerParagraphRightIndent"] = 140] = "RulerParagraphRightIndent";
        RichEditClientCommand[RichEditClientCommand["RulerSectionColumnsSettings"] = 141] = "RulerSectionColumnsSettings";
        RichEditClientCommand[RichEditClientCommand["RulerParagraphLeftIndents"] = 142] = "RulerParagraphLeftIndents";
        RichEditClientCommand[RichEditClientCommand["InsertTabMark"] = 143] = "InsertTabMark";
        RichEditClientCommand[RichEditClientCommand["InsertShiftTabMark"] = 144] = "InsertShiftTabMark";
        RichEditClientCommand[RichEditClientCommand["DocumentStart"] = 145] = "DocumentStart";
        RichEditClientCommand[RichEditClientCommand["ExtendDocumentStart"] = 146] = "ExtendDocumentStart";
        RichEditClientCommand[RichEditClientCommand["DocumentEnd"] = 147] = "DocumentEnd";
        RichEditClientCommand[RichEditClientCommand["ExtendDocumentEnd"] = 148] = "ExtendDocumentEnd";
        RichEditClientCommand[RichEditClientCommand["GoToNextWord"] = 149] = "GoToNextWord";
        RichEditClientCommand[RichEditClientCommand["ExtendGoToNextWord"] = 150] = "ExtendGoToNextWord";
        RichEditClientCommand[RichEditClientCommand["GoToPrevWord"] = 151] = "GoToPrevWord";
        RichEditClientCommand[RichEditClientCommand["ExtendGoToPrevWord"] = 152] = "ExtendGoToPrevWord";
        RichEditClientCommand[RichEditClientCommand["GoToStartParagraph"] = 153] = "GoToStartParagraph";
        RichEditClientCommand[RichEditClientCommand["ExtendGoToStartParagraph"] = 154] = "ExtendGoToStartParagraph";
        RichEditClientCommand[RichEditClientCommand["GoToEndParagraph"] = 155] = "GoToEndParagraph";
        RichEditClientCommand[RichEditClientCommand["ExtendGoToEndParagraph"] = 156] = "ExtendGoToEndParagraph";
        RichEditClientCommand[RichEditClientCommand["ReloadDocument"] = 157] = "ReloadDocument";
        RichEditClientCommand[RichEditClientCommand["ShowErrorModelIsChangedMessageCommand"] = 158] = "ShowErrorModelIsChangedMessageCommand";
        RichEditClientCommand[RichEditClientCommand["ShowErrorSessionHasExpiredMessageCommand"] = 159] = "ShowErrorSessionHasExpiredMessageCommand";
        RichEditClientCommand[RichEditClientCommand["SelectParagraph"] = 160] = "SelectParagraph";
        RichEditClientCommand[RichEditClientCommand["ShowErrorOpeningAndOverstoreImpossibleMessageCommand"] = 161] = "ShowErrorOpeningAndOverstoreImpossibleMessageCommand";
        RichEditClientCommand[RichEditClientCommand["SetSectionLetterPaperKind"] = 162] = "SetSectionLetterPaperKind";
        RichEditClientCommand[RichEditClientCommand["ShowErrorClipboardAccessDeniedMessageCommand"] = 163] = "ShowErrorClipboardAccessDeniedMessageCommand";
        RichEditClientCommand[RichEditClientCommand["SelectLineNoUpdateControlState"] = 164] = "SelectLineNoUpdateControlState";
        RichEditClientCommand[RichEditClientCommand["ExtendSelectLineNoUpdateControlState"] = 165] = "ExtendSelectLineNoUpdateControlState";
        RichEditClientCommand[RichEditClientCommand["ShowTabsForm"] = 166] = "ShowTabsForm";
        RichEditClientCommand[RichEditClientCommand["ShowCustomNumberingListForm"] = 167] = "ShowCustomNumberingListForm";
        RichEditClientCommand[RichEditClientCommand["ShowServiceFontForm"] = 168] = "ShowServiceFontForm";
        RichEditClientCommand[RichEditClientCommand["ShowServiceSymbolsForm"] = 169] = "ShowServiceSymbolsForm";
        RichEditClientCommand[RichEditClientCommand["RestartNumberingList"] = 170] = "RestartNumberingList";
        RichEditClientCommand[RichEditClientCommand["DeleteTabRuler"] = 171] = "DeleteTabRuler";
        RichEditClientCommand[RichEditClientCommand["InsertTabRuler"] = 172] = "InsertTabRuler";
        RichEditClientCommand[RichEditClientCommand["MoveTabRuler"] = 173] = "MoveTabRuler";
        RichEditClientCommand[RichEditClientCommand["IncrementNumberingIndent"] = 174] = "IncrementNumberingIndent";
        RichEditClientCommand[RichEditClientCommand["DecrementNumberingIndent"] = 175] = "DecrementNumberingIndent";
        RichEditClientCommand[RichEditClientCommand["IncrementParagraphIndentFromFirstRow"] = 176] = "IncrementParagraphIndentFromFirstRow";
        RichEditClientCommand[RichEditClientCommand["DecrementParagraphIndentFromFirstRow"] = 177] = "DecrementParagraphIndentFromFirstRow";
        RichEditClientCommand[RichEditClientCommand["CreateField"] = 178] = "CreateField";
        RichEditClientCommand[RichEditClientCommand["UpdateField"] = 179] = "UpdateField";
        RichEditClientCommand[RichEditClientCommand["ToggleFieldCodes"] = 180] = "ToggleFieldCodes";
        RichEditClientCommand[RichEditClientCommand["ShowAllFieldCodes"] = 186] = "ShowAllFieldCodes";
        RichEditClientCommand[RichEditClientCommand["ShowAllFieldResults"] = 187] = "ShowAllFieldResults";
        RichEditClientCommand[RichEditClientCommand["ToggleAllFields"] = 188] = "ToggleAllFields";
        RichEditClientCommand[RichEditClientCommand["ContinueNumberingList"] = 189] = "ContinueNumberingList";
        RichEditClientCommand[RichEditClientCommand["InsertNumerationToParagraphs"] = 190] = "InsertNumerationToParagraphs";
        RichEditClientCommand[RichEditClientCommand["DeleteNumerationFromParagraphs"] = 191] = "DeleteNumerationFromParagraphs";
        RichEditClientCommand[RichEditClientCommand["ShowErrorInnerExceptionMessageCommand"] = 192] = "ShowErrorInnerExceptionMessageCommand";
        RichEditClientCommand[RichEditClientCommand["ShowErrorAuthExceptionMessageCommand"] = 193] = "ShowErrorAuthExceptionMessageCommand";
        RichEditClientCommand[RichEditClientCommand["ShowEditHyperlinkForm"] = 194] = "ShowEditHyperlinkForm";
        RichEditClientCommand[RichEditClientCommand["OpenHyperlink"] = 195] = "OpenHyperlink";
        RichEditClientCommand[RichEditClientCommand["RemoveHyperlink"] = 196] = "RemoveHyperlink";
        RichEditClientCommand[RichEditClientCommand["ShowErrorSavingMessageCommand"] = 197] = "ShowErrorSavingMessageCommand";
        RichEditClientCommand[RichEditClientCommand["ShowErrorOpeningMessageCommand"] = 198] = "ShowErrorOpeningMessageCommand";
        RichEditClientCommand[RichEditClientCommand["ShowErrorDocVariableErrorCommand"] = 199] = "ShowErrorDocVariableErrorCommand";
        RichEditClientCommand[RichEditClientCommand["UpdateAllFields"] = 200] = "UpdateAllFields";
        RichEditClientCommand[RichEditClientCommand["InsertNonBreakingSpace"] = 201] = "InsertNonBreakingSpace";
        RichEditClientCommand[RichEditClientCommand["RemoveHyperlinks"] = 202] = "RemoveHyperlinks";
        RichEditClientCommand[RichEditClientCommand["CreateDateField"] = 203] = "CreateDateField";
        RichEditClientCommand[RichEditClientCommand["CreateTimeField"] = 204] = "CreateTimeField";
        RichEditClientCommand[RichEditClientCommand["CreatePageField"] = 205] = "CreatePageField";
        RichEditClientCommand[RichEditClientCommand["ShowCreateHyperlinkForm"] = 206] = "ShowCreateHyperlinkForm";
        RichEditClientCommand[RichEditClientCommand["SentenceCase"] = 207] = "SentenceCase";
        RichEditClientCommand[RichEditClientCommand["SwitchTextCase"] = 208] = "SwitchTextCase";
        RichEditClientCommand[RichEditClientCommand["GoToFirstDataRecord"] = 209] = "GoToFirstDataRecord";
        RichEditClientCommand[RichEditClientCommand["GoToPreviousDataRecord"] = 210] = "GoToPreviousDataRecord";
        RichEditClientCommand[RichEditClientCommand["GoToNextDataRecord"] = 211] = "GoToNextDataRecord";
        RichEditClientCommand[RichEditClientCommand["GoToLastDataRecord"] = 212] = "GoToLastDataRecord";
        RichEditClientCommand[RichEditClientCommand["ToggleViewMergedData"] = 213] = "ToggleViewMergedData";
        RichEditClientCommand[RichEditClientCommand["ShowInsertMergeFieldForm"] = 214] = "ShowInsertMergeFieldForm";
        RichEditClientCommand[RichEditClientCommand["CreateMergeField"] = 215] = "CreateMergeField";
        RichEditClientCommand[RichEditClientCommand["ShowFinishAndMergeForm"] = 216] = "ShowFinishAndMergeForm";
        RichEditClientCommand[RichEditClientCommand["ShowSaveMergedDocumentForm"] = 218] = "ShowSaveMergedDocumentForm";
        RichEditClientCommand[RichEditClientCommand["AddSelectedLineCommandNoUpdateControlState"] = 219] = "AddSelectedLineCommandNoUpdateControlState";
        RichEditClientCommand[RichEditClientCommand["InsertHeader"] = 220] = "InsertHeader";
        RichEditClientCommand[RichEditClientCommand["InsertFooter"] = 221] = "InsertFooter";
        RichEditClientCommand[RichEditClientCommand["LinkHeaderFooterToPrevious"] = 222] = "LinkHeaderFooterToPrevious";
        RichEditClientCommand[RichEditClientCommand["CreateBookmark"] = 225] = "CreateBookmark";
        RichEditClientCommand[RichEditClientCommand["DeleteBookmarks"] = 226] = "DeleteBookmarks";
        RichEditClientCommand[RichEditClientCommand["GoToPageHeader"] = 227] = "GoToPageHeader";
        RichEditClientCommand[RichEditClientCommand["GoToPageFooter"] = 228] = "GoToPageFooter";
        RichEditClientCommand[RichEditClientCommand["GoToNextPageHeaderFooter"] = 229] = "GoToNextPageHeaderFooter";
        RichEditClientCommand[RichEditClientCommand["GoToPreviousPageHeaderFooter"] = 230] = "GoToPreviousPageHeaderFooter";
        RichEditClientCommand[RichEditClientCommand["ToggleDifferentFirstPage"] = 231] = "ToggleDifferentFirstPage";
        RichEditClientCommand[RichEditClientCommand["ToggleDifferentOddAndEvenPages"] = 232] = "ToggleDifferentOddAndEvenPages";
        RichEditClientCommand[RichEditClientCommand["ClosePageHeaderFooter"] = 233] = "ClosePageHeaderFooter";
        RichEditClientCommand[RichEditClientCommand["ContextItem_HeadersFooters"] = 234] = "ContextItem_HeadersFooters";
        RichEditClientCommand[RichEditClientCommand["InsertPageNumberField"] = 235] = "InsertPageNumberField";
        RichEditClientCommand[RichEditClientCommand["InsertPageCountField"] = 236] = "InsertPageCountField";
        RichEditClientCommand[RichEditClientCommand["GoToBookmark"] = 237] = "GoToBookmark";
        RichEditClientCommand[RichEditClientCommand["InsertTableCore"] = 238] = "InsertTableCore";
        RichEditClientCommand[RichEditClientCommand["ContextItem_Tables"] = 239] = "ContextItem_Tables";
        RichEditClientCommand[RichEditClientCommand["ShowTablePropertiesForm"] = 240] = "ShowTablePropertiesForm";
        RichEditClientCommand[RichEditClientCommand["ShowCellOptionsForm"] = 242] = "ShowCellOptionsForm";
        RichEditClientCommand[RichEditClientCommand["InsertTableColumnToTheLeft"] = 243] = "InsertTableColumnToTheLeft";
        RichEditClientCommand[RichEditClientCommand["InsertTableColumnToTheRight"] = 244] = "InsertTableColumnToTheRight";
        RichEditClientCommand[RichEditClientCommand["InsertTableRowBelow"] = 245] = "InsertTableRowBelow";
        RichEditClientCommand[RichEditClientCommand["InsertTableRowAbove"] = 246] = "InsertTableRowAbove";
        RichEditClientCommand[RichEditClientCommand["DeleteTableRows"] = 247] = "DeleteTableRows";
        RichEditClientCommand[RichEditClientCommand["DeleteTableColumns"] = 248] = "DeleteTableColumns";
        RichEditClientCommand[RichEditClientCommand["InsertTableCellWithShiftToTheLeft"] = 249] = "InsertTableCellWithShiftToTheLeft";
        RichEditClientCommand[RichEditClientCommand["DeleteTableCellsWithShiftToTheHorizontally"] = 250] = "DeleteTableCellsWithShiftToTheHorizontally";
        RichEditClientCommand[RichEditClientCommand["DeleteTable"] = 251] = "DeleteTable";
        RichEditClientCommand[RichEditClientCommand["ShowInsertTableCellsForm"] = 252] = "ShowInsertTableCellsForm";
        RichEditClientCommand[RichEditClientCommand["ShowDeleteTableCellsForm"] = 253] = "ShowDeleteTableCellsForm";
        RichEditClientCommand[RichEditClientCommand["MergeTableCells"] = 254] = "MergeTableCells";
        RichEditClientCommand[RichEditClientCommand["ShowSplitTableCellsForm"] = 255] = "ShowSplitTableCellsForm";
        RichEditClientCommand[RichEditClientCommand["SplitTableCellsCommand"] = 256] = "SplitTableCellsCommand";
        RichEditClientCommand[RichEditClientCommand["InsertTableCellsWithShiftToTheVertically"] = 257] = "InsertTableCellsWithShiftToTheVertically";
        RichEditClientCommand[RichEditClientCommand["DeleteTableCellsWithShiftToTheVertically"] = 258] = "DeleteTableCellsWithShiftToTheVertically";
        RichEditClientCommand[RichEditClientCommand["ShowBorderShadingForm"] = 259] = "ShowBorderShadingForm";
        RichEditClientCommand[RichEditClientCommand["TableCellAlignTopLeft"] = 260] = "TableCellAlignTopLeft";
        RichEditClientCommand[RichEditClientCommand["TableCellAlignTopCenter"] = 261] = "TableCellAlignTopCenter";
        RichEditClientCommand[RichEditClientCommand["TableCellAlignTopRight"] = 262] = "TableCellAlignTopRight";
        RichEditClientCommand[RichEditClientCommand["TableCellAlignMiddleLeft"] = 263] = "TableCellAlignMiddleLeft";
        RichEditClientCommand[RichEditClientCommand["TableCellAlignMiddleCenter"] = 264] = "TableCellAlignMiddleCenter";
        RichEditClientCommand[RichEditClientCommand["TableCellAlignMiddleRight"] = 265] = "TableCellAlignMiddleRight";
        RichEditClientCommand[RichEditClientCommand["TableCellAlignBottomLeft"] = 266] = "TableCellAlignBottomLeft";
        RichEditClientCommand[RichEditClientCommand["TableCellAlignBottomCenter"] = 267] = "TableCellAlignBottomCenter";
        RichEditClientCommand[RichEditClientCommand["TableCellAlignBottomRight"] = 268] = "TableCellAlignBottomRight";
        RichEditClientCommand[RichEditClientCommand["ApplyTableStyle"] = 269] = "ApplyTableStyle";
        RichEditClientCommand[RichEditClientCommand["ToggleTableCellsTopBorder"] = 270] = "ToggleTableCellsTopBorder";
        RichEditClientCommand[RichEditClientCommand["ToggleTableCellsRightBorder"] = 271] = "ToggleTableCellsRightBorder";
        RichEditClientCommand[RichEditClientCommand["ToggleTableCellsBottomBorder"] = 272] = "ToggleTableCellsBottomBorder";
        RichEditClientCommand[RichEditClientCommand["ToggleTableCellsLeftBorder"] = 273] = "ToggleTableCellsLeftBorder";
        RichEditClientCommand[RichEditClientCommand["ToggleTableCellNoBorder"] = 274] = "ToggleTableCellNoBorder";
        RichEditClientCommand[RichEditClientCommand["ToggleTableCellAllBorders"] = 275] = "ToggleTableCellAllBorders";
        RichEditClientCommand[RichEditClientCommand["ToggleTableCellInsideBorders"] = 276] = "ToggleTableCellInsideBorders";
        RichEditClientCommand[RichEditClientCommand["ToggleTableCellInsideHorizontalBorders"] = 277] = "ToggleTableCellInsideHorizontalBorders";
        RichEditClientCommand[RichEditClientCommand["ToggleTableCellInsideVerticalBorders"] = 278] = "ToggleTableCellInsideVerticalBorders";
        RichEditClientCommand[RichEditClientCommand["ToggleTableCellOutsideBorders"] = 279] = "ToggleTableCellOutsideBorders";
        RichEditClientCommand[RichEditClientCommand["ToggleFirstRow"] = 280] = "ToggleFirstRow";
        RichEditClientCommand[RichEditClientCommand["ToggleLastRow"] = 281] = "ToggleLastRow";
        RichEditClientCommand[RichEditClientCommand["ToggleFirstColumn"] = 282] = "ToggleFirstColumn";
        RichEditClientCommand[RichEditClientCommand["ToggleLastColumn"] = 283] = "ToggleLastColumn";
        RichEditClientCommand[RichEditClientCommand["ToggleBandedRows"] = 284] = "ToggleBandedRows";
        RichEditClientCommand[RichEditClientCommand["ToggleBandedColumn"] = 285] = "ToggleBandedColumn";
        RichEditClientCommand[RichEditClientCommand["SelectTableCell"] = 286] = "SelectTableCell";
        RichEditClientCommand[RichEditClientCommand["SelectTableColumn"] = 287] = "SelectTableColumn";
        RichEditClientCommand[RichEditClientCommand["SelectTableRow"] = 288] = "SelectTableRow";
        RichEditClientCommand[RichEditClientCommand["SelectTable"] = 289] = "SelectTable";
        RichEditClientCommand[RichEditClientCommand["ChangeTableBorderColorRepositoryItem"] = 290] = "ChangeTableBorderColorRepositoryItem";
        RichEditClientCommand[RichEditClientCommand["ChangeTableBorderWidthRepositoryItem"] = 291] = "ChangeTableBorderWidthRepositoryItem";
        RichEditClientCommand[RichEditClientCommand["ChangeTableBorderStyleRepositoryItem"] = 292] = "ChangeTableBorderStyleRepositoryItem";
        RichEditClientCommand[RichEditClientCommand["ShowErrorPathTooLongCommand"] = 293] = "ShowErrorPathTooLongCommand";
        RichEditClientCommand[RichEditClientCommand["ChangeTableCellShading"] = 294] = "ChangeTableCellShading";
        RichEditClientCommand[RichEditClientCommand["ToggleShowTableGridLines"] = 295] = "ToggleShowTableGridLines";
        RichEditClientCommand[RichEditClientCommand["ExtendSelectTableCell"] = 296] = "ExtendSelectTableCell";
        RichEditClientCommand[RichEditClientCommand["ExtendSelectTableColumn"] = 297] = "ExtendSelectTableColumn";
        RichEditClientCommand[RichEditClientCommand["ExtendSelectTableRow"] = 298] = "ExtendSelectTableRow";
        RichEditClientCommand[RichEditClientCommand["ExtendSelectTable"] = 299] = "ExtendSelectTable";
        RichEditClientCommand[RichEditClientCommand["SelectTableCellsRange"] = 300] = "SelectTableCellsRange";
        RichEditClientCommand[RichEditClientCommand["ShowServiceBorderShadingForm"] = 301] = "ShowServiceBorderShadingForm";
        RichEditClientCommand[RichEditClientCommand["RulerTableColumnSeparators"] = 302] = "RulerTableColumnSeparators";
        RichEditClientCommand[RichEditClientCommand["ChangeActiveSubDocumentToMain"] = 303] = "ChangeActiveSubDocumentToMain";
        RichEditClientCommand[RichEditClientCommand["ChangeActiveSubDocumentToHeaderFooterByPageIndex"] = 304] = "ChangeActiveSubDocumentToHeaderFooterByPageIndex";
        RichEditClientCommand[RichEditClientCommand["ChangeActiveSubDocumentToHeaderFooterBySubDocument"] = 305] = "ChangeActiveSubDocumentToHeaderFooterBySubDocument";
        RichEditClientCommand[RichEditClientCommand["ShowErrorInvalidDocumentFormat"] = 306] = "ShowErrorInvalidDocumentFormat";
        RichEditClientCommand[RichEditClientCommand["SetSectionPageSize"] = 307] = "SetSectionPageSize";
        RichEditClientCommand[RichEditClientCommand["SetSectionColumnCount"] = 308] = "SetSectionColumnCount";
        RichEditClientCommand[RichEditClientCommand["ChangeTableRowHeight"] = 309] = "ChangeTableRowHeight";
        RichEditClientCommand[RichEditClientCommand["ChangeTableCellWidth"] = 310] = "ChangeTableCellWidth";
        RichEditClientCommand[RichEditClientCommand["ChangeTableColumnWidth"] = 311] = "ChangeTableColumnWidth";
        RichEditClientCommand[RichEditClientCommand["ChangeTableLook"] = 312] = "ChangeTableLook";
        RichEditClientCommand[RichEditClientCommand["ShowSpellCheckerForm"] = 313] = "ShowSpellCheckerForm";
        RichEditClientCommand[RichEditClientCommand["IgnoreSpellingError"] = 314] = "IgnoreSpellingError";
        RichEditClientCommand[RichEditClientCommand["IgnoreAllSpellingErrors"] = 315] = "IgnoreAllSpellingErrors";
        RichEditClientCommand[RichEditClientCommand["DeleteRepeatedWord"] = 316] = "DeleteRepeatedWord";
        RichEditClientCommand[RichEditClientCommand["AddWordToDictionary"] = 317] = "AddWordToDictionary";
        RichEditClientCommand[RichEditClientCommand["ChangeSpellingError"] = 318] = "ChangeSpellingError";
        RichEditClientCommand[RichEditClientCommand["ChangeAllSpellingErrors"] = 319] = "ChangeAllSpellingErrors";
        RichEditClientCommand[RichEditClientCommand["ShowSpellingCheckCompletedMessage"] = 320] = "ShowSpellingCheckCompletedMessage";
        RichEditClientCommand[RichEditClientCommand["RulerChangeTableColumnWidth"] = 321] = "RulerChangeTableColumnWidth";
        RichEditClientCommand[RichEditClientCommand["RulerChangeTableRowHeight"] = 322] = "RulerChangeTableRowHeight";
        RichEditClientCommand[RichEditClientCommand["DeleteTableCellsByBackspace"] = 323] = "DeleteTableCellsByBackspace";
        RichEditClientCommand[RichEditClientCommand["GoToDataRecord"] = 324] = "GoToDataRecord";
        RichEditClientCommand[RichEditClientCommand["FindAll"] = 325] = "FindAll";
        RichEditClientCommand[RichEditClientCommand["ReplaceNext"] = 326] = "ReplaceNext";
        RichEditClientCommand[RichEditClientCommand["ReplaceAll"] = 327] = "ReplaceAll";
        RichEditClientCommand[RichEditClientCommand["HideFindResults"] = 328] = "HideFindResults";
        RichEditClientCommand[RichEditClientCommand["ActivateRibbon"] = 329] = "ActivateRibbon";
        RichEditClientCommand[RichEditClientCommand["ChangeHeaderOffset"] = 330] = "ChangeHeaderOffset";
        RichEditClientCommand[RichEditClientCommand["ChangeFooterOffset"] = 331] = "ChangeFooterOffset";
        RichEditClientCommand[RichEditClientCommand["Download"] = 332] = "Download";
        RichEditClientCommand[RichEditClientCommand["ShowErrorCantSaveToEmptyPathMessageCommand"] = 333] = "ShowErrorCantSaveToEmptyPathMessageCommand";
        RichEditClientCommand[RichEditClientCommand["RemoveNextWord"] = 334] = "RemoveNextWord";
        RichEditClientCommand[RichEditClientCommand["RemovePrevWord"] = 335] = "RemovePrevWord";
        RichEditClientCommand[RichEditClientCommand["GoToStartNextPage"] = 336] = "GoToStartNextPage";
        RichEditClientCommand[RichEditClientCommand["GoToStartPrevPage"] = 337] = "GoToStartPrevPage";
        RichEditClientCommand[RichEditClientCommand["ExtendGoToStartNextPage"] = 338] = "ExtendGoToStartNextPage";
        RichEditClientCommand[RichEditClientCommand["ExtendGoToStartPrevPage"] = 339] = "ExtendGoToStartPrevPage";
        RichEditClientCommand[RichEditClientCommand["SetSectionPageMargins"] = 340] = "SetSectionPageMargins";
        RichEditClientCommand[RichEditClientCommand["AssignShortcut"] = 341] = "AssignShortcut";
        RichEditClientCommand[RichEditClientCommand["ShowLayoutOptionsForm"] = 342] = "ShowLayoutOptionsForm";
        RichEditClientCommand[RichEditClientCommand["ChangeFloatingObjectFillColor"] = 343] = "ChangeFloatingObjectFillColor";
        RichEditClientCommand[RichEditClientCommand["ChangeFloatingObjectOutlineColor"] = 344] = "ChangeFloatingObjectOutlineColor";
        RichEditClientCommand[RichEditClientCommand["ChangeFloatingObjectOutlineWidth"] = 345] = "ChangeFloatingObjectOutlineWidth";
        RichEditClientCommand[RichEditClientCommand["SetFloatingObjectSquareTextWrapType"] = 346] = "SetFloatingObjectSquareTextWrapType";
        RichEditClientCommand[RichEditClientCommand["SetFloatingObjectTightTextWrapType"] = 347] = "SetFloatingObjectTightTextWrapType";
        RichEditClientCommand[RichEditClientCommand["SetFloatingObjectThroughTextWrapType"] = 348] = "SetFloatingObjectThroughTextWrapType";
        RichEditClientCommand[RichEditClientCommand["SetFloatingObjectTopAndBottomTextWrapType"] = 349] = "SetFloatingObjectTopAndBottomTextWrapType";
        RichEditClientCommand[RichEditClientCommand["SetFloatingObjectBehindTextWrapType"] = 350] = "SetFloatingObjectBehindTextWrapType";
        RichEditClientCommand[RichEditClientCommand["SetFloatingObjectInFrontOfTextWrapType"] = 351] = "SetFloatingObjectInFrontOfTextWrapType";
        RichEditClientCommand[RichEditClientCommand["SetFloatingObjectTopLeftAlignment"] = 352] = "SetFloatingObjectTopLeftAlignment";
        RichEditClientCommand[RichEditClientCommand["SetFloatingObjectTopCenterAlignment"] = 353] = "SetFloatingObjectTopCenterAlignment";
        RichEditClientCommand[RichEditClientCommand["SetFloatingObjectTopRightAlignment"] = 354] = "SetFloatingObjectTopRightAlignment";
        RichEditClientCommand[RichEditClientCommand["SetFloatingObjectMiddleLeftAlignment"] = 355] = "SetFloatingObjectMiddleLeftAlignment";
        RichEditClientCommand[RichEditClientCommand["SetFloatingObjectMiddleCenterAlignment"] = 356] = "SetFloatingObjectMiddleCenterAlignment";
        RichEditClientCommand[RichEditClientCommand["SetFloatingObjectMiddleRightAlignment"] = 357] = "SetFloatingObjectMiddleRightAlignment";
        RichEditClientCommand[RichEditClientCommand["SetFloatingObjectBottomLeftAlignment"] = 358] = "SetFloatingObjectBottomLeftAlignment";
        RichEditClientCommand[RichEditClientCommand["SetFloatingObjectBottomCenterAlignment"] = 359] = "SetFloatingObjectBottomCenterAlignment";
        RichEditClientCommand[RichEditClientCommand["SetFloatingObjectBottomRightAlignment"] = 360] = "SetFloatingObjectBottomRightAlignment";
        RichEditClientCommand[RichEditClientCommand["FloatingObjectBringForward"] = 361] = "FloatingObjectBringForward";
        RichEditClientCommand[RichEditClientCommand["FloatingObjectBringToFront"] = 362] = "FloatingObjectBringToFront";
        RichEditClientCommand[RichEditClientCommand["FloatingObjectBringInFrontOfText"] = 363] = "FloatingObjectBringInFrontOfText";
        RichEditClientCommand[RichEditClientCommand["FloatingObjectSendBackward"] = 364] = "FloatingObjectSendBackward";
        RichEditClientCommand[RichEditClientCommand["FloatingObjectSendToBack"] = 365] = "FloatingObjectSendToBack";
        RichEditClientCommand[RichEditClientCommand["FloatingObjectSendBehindText"] = 366] = "FloatingObjectSendBehindText";
        RichEditClientCommand[RichEditClientCommand["ContextItem_FloatingObjects"] = 367] = "ContextItem_FloatingObjects";
        RichEditClientCommand[RichEditClientCommand["InsertAnchoredTextBox"] = 368] = "InsertAnchoredTextBox";
        RichEditClientCommand[RichEditClientCommand["ChangeActiveSubDocumentToTextBox"] = 369] = "ChangeActiveSubDocumentToTextBox";
        RichEditClientCommand[RichEditClientCommand["ChangeTextBoxProperties"] = 370] = "ChangeTextBoxProperties";
        RichEditClientCommand[RichEditClientCommand["ChangeFloatingObjectShape"] = 371] = "ChangeFloatingObjectShape";
        RichEditClientCommand[RichEditClientCommand["CreateEmptyMergeField"] = 372] = "CreateEmptyMergeField";
        RichEditClientCommand[RichEditClientCommand["CreateEmptyDocVariableField"] = 373] = "CreateEmptyDocVariableField";
        RichEditClientCommand[RichEditClientCommand["SetFloatingObjectInlineTextWrapType"] = 374] = "SetFloatingObjectInlineTextWrapType";
        RichEditClientCommand[RichEditClientCommand["FloatingObjectDragDropChangePosition"] = 375] = "FloatingObjectDragDropChangePosition";
        RichEditClientCommand[RichEditClientCommand["InsertHtml"] = 376] = "InsertHtml";
        RichEditClientCommand[RichEditClientCommand["CreateTocField"] = 377] = "CreateTocField";
        RichEditClientCommand[RichEditClientCommand["CreateTableOfEquationsField"] = 378] = "CreateTableOfEquationsField";
        RichEditClientCommand[RichEditClientCommand["CreateTableOfFiguresField"] = 379] = "CreateTableOfFiguresField";
        RichEditClientCommand[RichEditClientCommand["CreateTableOfTablesField"] = 380] = "CreateTableOfTablesField";
        RichEditClientCommand[RichEditClientCommand["CreateEquationCaptionField"] = 381] = "CreateEquationCaptionField";
        RichEditClientCommand[RichEditClientCommand["CreateFigureCaptionField"] = 382] = "CreateFigureCaptionField";
        RichEditClientCommand[RichEditClientCommand["CreateTableCaptionField"] = 383] = "CreateTableCaptionField";
        RichEditClientCommand[RichEditClientCommand["UpdateTableOfContents"] = 384] = "UpdateTableOfContents";
        RichEditClientCommand[RichEditClientCommand["SetParagraphBodyTextLevel"] = 385] = "SetParagraphBodyTextLevel";
        RichEditClientCommand[RichEditClientCommand["SetParagraphHeading1Level"] = 386] = "SetParagraphHeading1Level";
        RichEditClientCommand[RichEditClientCommand["SetParagraphHeading2Level"] = 387] = "SetParagraphHeading2Level";
        RichEditClientCommand[RichEditClientCommand["SetParagraphHeading3Level"] = 388] = "SetParagraphHeading3Level";
        RichEditClientCommand[RichEditClientCommand["SetParagraphHeading4Level"] = 389] = "SetParagraphHeading4Level";
        RichEditClientCommand[RichEditClientCommand["SetParagraphHeading5Level"] = 390] = "SetParagraphHeading5Level";
        RichEditClientCommand[RichEditClientCommand["SetParagraphHeading6Level"] = 391] = "SetParagraphHeading6Level";
        RichEditClientCommand[RichEditClientCommand["SetParagraphHeading7Level"] = 392] = "SetParagraphHeading7Level";
        RichEditClientCommand[RichEditClientCommand["SetParagraphHeading8Level"] = 393] = "SetParagraphHeading8Level";
        RichEditClientCommand[RichEditClientCommand["SetParagraphHeading9Level"] = 394] = "SetParagraphHeading9Level";
        RichEditClientCommand[RichEditClientCommand["ChangeHeadingLevel"] = 395] = "ChangeHeadingLevel";
        RichEditClientCommand[RichEditClientCommand["SetParagraphLevel"] = 396] = "SetParagraphLevel";
        RichEditClientCommand[RichEditClientCommand["CreateFieldWithCode"] = 397] = "CreateFieldWithCode";
        RichEditClientCommand[RichEditClientCommand["ChangeHyperlink"] = 398] = "ChangeHyperlink";
        RichEditClientCommand[RichEditClientCommand["SetAutoFitContents"] = 399] = "SetAutoFitContents";
        RichEditClientCommand[RichEditClientCommand["SetAutoFitWindow"] = 400] = "SetAutoFitWindow";
        RichEditClientCommand[RichEditClientCommand["SetFixedColumnWidth"] = 401] = "SetFixedColumnWidth";
        RichEditClientCommand[RichEditClientCommand["InsertRtf"] = 402] = "InsertRtf";
        RichEditClientCommand[RichEditClientCommand["GetRtf"] = 403] = "GetRtf";
        RichEditClientCommand[RichEditClientCommand["ForceSyncWithServer"] = 404] = "ForceSyncWithServer";
        RichEditClientCommand[RichEditClientCommand["SwitchToSimpleView"] = 405] = "SwitchToSimpleView";
        RichEditClientCommand[RichEditClientCommand["SwitchToPrintLayoutView"] = 406] = "SwitchToPrintLayoutView";
        RichEditClientCommand[RichEditClientCommand["ChangeViewType"] = 407] = "ChangeViewType";
        RichEditClientCommand[RichEditClientCommand["InsertContentFromServer"] = 408] = "InsertContentFromServer";
        RichEditClientCommand[RichEditClientCommand["ShowInsertContentFromServerErrorDialogCommand"] = 409] = "ShowInsertContentFromServerErrorDialogCommand";
        RichEditClientCommand[RichEditClientCommand["OpenDocumentLocally"] = 410] = "OpenDocumentLocally";
        RichEditClientCommand[RichEditClientCommand["InsertPictureLocally"] = 411] = "InsertPictureLocally";
        RichEditClientCommand[RichEditClientCommand["CreateNewDocumentLocally"] = 412] = "CreateNewDocumentLocally";
        RichEditClientCommand[RichEditClientCommand["ExportDocument"] = 413] = "ExportDocument";
        RichEditClientCommand[RichEditClientCommand["DownloadDocumentLocally"] = 414] = "DownloadDocumentLocally";
        RichEditClientCommand[RichEditClientCommand["ShowErrorLoadPictureMessage"] = 415] = "ShowErrorLoadPictureMessage";
    })(RichEditClientCommand = __aspxRichEdit.RichEditClientCommand || (__aspxRichEdit.RichEditClientCommand = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RedoCommand = (function (_super) {
        __extends(RedoCommand, _super);
        function RedoCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RedoCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled() && this.control.history.canRedo());
        };
        RedoCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.undo);
        };
        RedoCommand.prototype.executeCore = function (state, _options) {
            if (state.enabled) {
                this.control.history.redo();
                return true;
            }
            return false;
        };
        RedoCommand.prototype.canModify = function () {
            return true;
        };
        return RedoCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.RedoCommand = RedoCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ShortcutManager = (function () {
        function ShortcutManager(commandManager, control) {
            this.knownNonCommandShortcuts = {};
            this.control = control;
            this.init(commandManager);
        }
        ShortcutManager.prototype.init = function (commandManager) {
            this.knownNonCommandShortcuts = {};
            this.knownNonCommandShortcuts[REWebUtils.KeyCode.Esc] = true;
            this.shortcuts = {};
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ClearFormatting, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Space], [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Space]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.CopySelection, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_c], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_c, REWebUtils.KeyCode.F3]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.CreateField, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.F9], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.F9]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.CutSelection, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_x], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_x, REWebUtils.KeyCode.F2]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.DecreaseIndent, [REWebUtils.ModifierKey.Ctrl | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Key_m], [REWebUtils.ModifierKey.Meta | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Key_m]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.DocumentEnd, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.End], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.End]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.DocumentStart, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Home], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Home]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ExtendDocumentEnd, [REWebUtils.ModifierKey.Ctrl | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.End], [REWebUtils.ModifierKey.Meta | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.End]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ExtendDocumentStart, [REWebUtils.ModifierKey.Ctrl | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Home], [REWebUtils.ModifierKey.Meta | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Home]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ExtendGoToEndParagraph, [REWebUtils.ModifierKey.Ctrl | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Down], [REWebUtils.ModifierKey.Meta | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Down]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ExtendGoToNextWord, [REWebUtils.ModifierKey.Ctrl | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Right], [REWebUtils.ModifierKey.Alt | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Right]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ExtendGoToPrevWord, [REWebUtils.ModifierKey.Ctrl | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Left], [REWebUtils.ModifierKey.Alt | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Left]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ExtendGoToStartParagraph, [REWebUtils.ModifierKey.Ctrl | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Up], [REWebUtils.ModifierKey.Meta | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Up]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ExtendLineDown, [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Down], [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Down]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ExtendLineEnd, [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.End], [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.End]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ExtendLineStart, [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Home], [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Home]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ExtendLineUp, [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Up], [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Up]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ExtendNextCharacter, [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Right], [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Right]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ExtendNextPage, [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.PageDown], [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.PageDown]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ExtendPreviousCharacter, [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Left], [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Left]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ExtendPreviousPage, [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.PageUp], [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.PageUp]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.FullScreen, [REWebUtils.KeyCode.F11, REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.F10], [REWebUtils.KeyCode.F11]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.GoToEndParagraph, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Down], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Down]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.GoToNextWord, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Right], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Right]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.GoToPrevWord, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Left], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Left]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.GoToStartParagraph, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Up], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Up]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.IncreaseIndent, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_m], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_m]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.InsertColumnBreak, [REWebUtils.ModifierKey.Ctrl | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Enter], [REWebUtils.ModifierKey.Meta | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Enter]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.InsertLineBreak, [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Enter], [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Enter]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.InsertPageBreak, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Enter], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Enter]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.InsertParagraph, [REWebUtils.KeyCode.Enter], [REWebUtils.KeyCode.Enter]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.InsertShiftTabMark, [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Tab], [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Tab]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.InsertSpace, [REWebUtils.KeyCode.Space], [REWebUtils.KeyCode.Space, REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Space]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.InsertTabMark, [REWebUtils.KeyCode.Tab], [REWebUtils.KeyCode.Tab]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.LineDown, [REWebUtils.KeyCode.Down], [REWebUtils.KeyCode.Down]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.LineEnd, [REWebUtils.KeyCode.End], [REWebUtils.KeyCode.End]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.LineStart, [REWebUtils.KeyCode.Home], [REWebUtils.KeyCode.Home]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.LineUp, [REWebUtils.KeyCode.Up], [REWebUtils.KeyCode.Up]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.NextCharacter, [REWebUtils.KeyCode.Right], [REWebUtils.KeyCode.Right]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.NextPage, [REWebUtils.KeyCode.PageDown], [REWebUtils.KeyCode.PageDown]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.PasteSelection, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_v, REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Insert], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_v, REWebUtils.KeyCode.F4]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.PreviousCharacter, [REWebUtils.KeyCode.Left], [REWebUtils.KeyCode.Left]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.PreviousPage, [REWebUtils.KeyCode.PageUp], [REWebUtils.KeyCode.PageUp]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.Redo, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_y], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_y]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.SelectAll, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_a], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_a]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.SetDoubleParagraphSpacing, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_2], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_2]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.SetSesquialteralParagraphSpacing, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_5], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_5]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.SetSingleParagraphSpacing, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_1], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_1]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ShowFontForm, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_d], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_d]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ShowHyperlinkForm, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_k], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_k]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.Find, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_f], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_f]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.Replace, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_h], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_h]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ToggleAllFields, [REWebUtils.ModifierKey.Alt | REWebUtils.KeyCode.F9], [REWebUtils.ModifierKey.Alt | REWebUtils.KeyCode.F9]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ToggleBackspaceKey, [REWebUtils.KeyCode.Backspace], [REWebUtils.KeyCode.Backspace]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ToggleDeleteKey, [REWebUtils.KeyCode.Delete], [REWebUtils.KeyCode.Delete]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ToggleFieldCodes, [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.F9], [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.F9]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ToggleFontItalic, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_i], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_i]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ToggleFontSubscript, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Equals], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Equals]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ToggleFontSuperscript, [REWebUtils.ModifierKey.Ctrl | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Equals], [REWebUtils.ModifierKey.Meta | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Equals]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ToggleFontUnderline, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_u], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_u]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ToggleParagraphAlignmentCenter, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_e], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_e]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ToggleParagraphAlignmentJustify, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_j], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_j]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ToggleParagraphAlignmentLeft, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_l], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_l]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ToggleParagraphAlignmentRight, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_r], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_r]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ToggleShowWhitespace, [REWebUtils.ModifierKey.Ctrl | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Key_8], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_8]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.Undo, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_z], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_z, REWebUtils.KeyCode.F1]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.UpdateField, [REWebUtils.KeyCode.F9], [REWebUtils.KeyCode.F9]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ToggleFontBold, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Key_b], [REWebUtils.ModifierKey.Meta | REWebUtils.KeyCode.Key_b]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.InsertNonBreakingSpace, [REWebUtils.ModifierKey.Ctrl | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Space], [REWebUtils.ModifierKey.Alt | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Space]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.RemoveHyperlinks, [REWebUtils.ModifierKey.Ctrl | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.F9], [REWebUtils.ModifierKey.Meta | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.F9]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.CreateDateField, [REWebUtils.ModifierKey.Alt | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Key_d], [REWebUtils.ModifierKey.Ctrl | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Key_d]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.CreatePageField, [REWebUtils.ModifierKey.Alt | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Key_p], [REWebUtils.ModifierKey.Ctrl | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Key_p]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.CreateTimeField, [REWebUtils.ModifierKey.Alt | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Key_t], [REWebUtils.ModifierKey.Ctrl | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Key_t]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.SwitchTextCase, [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.F3], [REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.F3]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ShowSpellCheckerForm, [REWebUtils.KeyCode.F7], [REWebUtils.KeyCode.F7]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.RemoveNextWord, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Delete], [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Delete]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.RemovePrevWord, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Backspace], [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.Backspace]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.GoToStartNextPage, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.PageDown], [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.PageDown]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.GoToStartPrevPage, [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.PageUp], [REWebUtils.ModifierKey.Ctrl | REWebUtils.KeyCode.PageUp]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ExtendGoToStartNextPage, [REWebUtils.ModifierKey.Ctrl | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.PageDown], [REWebUtils.ModifierKey.Ctrl | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.PageDown]);
            this.createShortcut(commandManager, __aspxRichEdit.RichEditClientCommand.ExtendGoToStartPrevPage, [REWebUtils.ModifierKey.Ctrl | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.PageUp], [REWebUtils.ModifierKey.Ctrl | REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.PageUp]);
        };
        ShortcutManager.prototype.createShortcut = function (commandManager, commandId, winShortcuts, macOSShortcuts) {
            var _this = this;
            __aspxRichEdit.ListUtils.foreach(REWebUtils.Browser.MacOSPlatform ? (macOSShortcuts ? macOSShortcuts : []) : (winShortcuts ? winShortcuts : []), function (keyCode) { return _this.shortcuts[keyCode] = new CommandHolder(commandManager.getCommand(commandId)); });
        };
        ShortcutManager.prototype.processShortcut = function (keyCode) {
            var commandHolder = this.shortcuts[keyCode];
            if (!commandHolder || this.denyThisTabKeyCode(keyCode))
                return false;
            commandHolder.executeCommand(this);
            return true;
        };
        ShortcutManager.prototype.isKnownShortcut = function (keyCode) {
            return (!!this.shortcuts[keyCode] || this.knownNonCommandShortcuts[keyCode]) && !this.denyThisTabKeyCode(keyCode);
        };
        ShortcutManager.prototype.isClipboardCommandShortcut = function (keyCode) {
            var commandHolder = this.shortcuts[keyCode];
            return commandHolder ? commandHolder.isClipboardCommand() : false;
        };
        ShortcutManager.prototype.assignShortcut = function (keyCode, callback) {
            this.shortcuts[keyCode] = new UserDefinedFunctionHolder(callback);
        };
        ShortcutManager.prototype.denyThisTabKeyCode = function (keyCode) {
            return !this.control.options.acceptsTab && ShortcutManager.pressTabKeyCode(keyCode);
        };
        ShortcutManager.pressTabKeyCode = function (keyCode) {
            return keyCode === REWebUtils.KeyCode.Tab || keyCode === (REWebUtils.ModifierKey.Shift | REWebUtils.KeyCode.Tab);
        };
        return ShortcutManager;
    }());
    __aspxRichEdit.ShortcutManager = ShortcutManager;
    var CommandHolderBase = (function () {
        function CommandHolderBase() {
        }
        CommandHolderBase.prototype.executeCommand = function (shortcutManager) {
            shortcutManager.lastCommandExecutedByShortcut = true;
            this.callExecuteCommand();
            shortcutManager.lastCommandExecutedByShortcut = false;
        };
        CommandHolderBase.prototype.callExecuteCommand = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        CommandHolderBase.prototype.isClipboardCommand = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return CommandHolderBase;
    }());
    __aspxRichEdit.CommandHolderBase = CommandHolderBase;
    var CommandHolder = (function (_super) {
        __extends(CommandHolder, _super);
        function CommandHolder(command) {
            var _this = _super.call(this) || this;
            _this.command = command;
            return _this;
        }
        CommandHolder.prototype.callExecuteCommand = function () {
            this.command.execute(false);
        };
        CommandHolder.prototype.isClipboardCommand = function () {
            return this.command instanceof __aspxRichEdit.ClipboardCommand;
        };
        return CommandHolder;
    }(CommandHolderBase));
    __aspxRichEdit.CommandHolder = CommandHolder;
    var UserDefinedFunctionHolder = (function (_super) {
        __extends(UserDefinedFunctionHolder, _super);
        function UserDefinedFunctionHolder(userCommandCallback) {
            var _this = _super.call(this) || this;
            _this.userCommandCallback = userCommandCallback;
            return _this;
        }
        UserDefinedFunctionHolder.prototype.callExecuteCommand = function () {
            this.userCommandCallback();
        };
        UserDefinedFunctionHolder.prototype.isClipboardCommand = function () {
            return false;
        };
        return UserDefinedFunctionHolder;
    }(CommandHolderBase));
    __aspxRichEdit.UserDefinedFunctionHolder = UserDefinedFunctionHolder;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var UndoCommand = (function (_super) {
        __extends(UndoCommand, _super);
        function UndoCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        UndoCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled() && this.control.history.canUndo());
        };
        UndoCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.undo);
        };
        UndoCommand.prototype.executeCore = function (state, _options) {
            if (state.enabled) {
                this.control.history.undo();
                return true;
            }
            return false;
        };
        UndoCommand.prototype.canModify = function () {
            return true;
        };
        return UndoCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.UndoCommand = UndoCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var LevelInfo = (function () {
            function LevelInfo(element, childElements) {
                this.element = element;
                this.childElements = childElements;
            }
            LevelInfo.prototype.initTagImporter = function (importer) {
                if (__aspxRichEdit.HTMLUtils.isTextNode(this.element))
                    this.tagImporter = new HtmlImport.HtmlTextNodeImporter(importer);
                else {
                    var tag = this.element.tagName;
                    var constr = importer.tagImporters[tag ? tag.toUpperCase() : ""];
                    this.tagImporter = new (constr ? constr : HtmlImport.HtmlUndefinedTagImporter)(importer);
                }
                return this;
            };
            return LevelInfo;
        }());
        HtmlImport.LevelInfo = LevelInfo;
        var HtmlImportData = (function () {
            function HtmlImportData(runsInfo, tablesInfo) {
                this.runsInfo = runsInfo;
                this.tablesInfo = tablesInfo;
            }
            return HtmlImportData;
        }());
        HtmlImport.HtmlImportData = HtmlImportData;
        var HtmlImporter = (function () {
            function HtmlImporter(control, emptyImageCacheId, interval, initElements) {
                this.fieldsId = 0;
                if (!HtmlImporter.importers) {
                    HtmlImporter.importers = [
                        HtmlImport.HtmlATagImporter,
                        HtmlImport.HtmlBTagImporter,
                        HtmlImport.HtmlBrTagImporter,
                        HtmlImport.HtmlCenterTagImporter,
                        HtmlImport.HtmlCiteTagImporter,
                        HtmlImport.HtmlDivTagImporter,
                        HtmlImport.HtmlEmTagImporter,
                        HtmlImport.HtmlITagImporter,
                        HtmlImport.HtmlImgTagImporter,
                        HtmlImport.HtmlLiTagImporter,
                        HtmlImport.HtmlOlTagImporter,
                        HtmlImport.HtmlPTagImporter,
                        HtmlImport.HtmlTableTagImporter,
                        HtmlImport.HtmlTbodyTagImporter,
                        HtmlImport.HtmlH1TagImporter,
                        HtmlImport.HtmlH2TagImporter,
                        HtmlImport.HtmlH3TagImporter,
                        HtmlImport.HtmlH4TagImporter,
                        HtmlImport.HtmlH5TagImporter,
                        HtmlImport.HtmlH6TagImporter,
                        HtmlImport.HtmlPreTagImporter,
                        HtmlImport.HtmlSpanTagImporter,
                        HtmlImport.HtmlTrTagImporter,
                        HtmlImport.HtmlTtTagImporter,
                        HtmlImport.HtmlTdTagImporter,
                        HtmlImport.HtmlThTagImporter,
                        HtmlImport.HtmlUlTagImporter,
                    ];
                }
                this.control = control;
                this.emptyImageCacheId = emptyImageCacheId;
                this.interval = interval.clone();
                this.currPosition = interval.start;
                this.levelInfo = [new LevelInfo(null, initElements)];
                this.loadFontInfos = [];
                this.tempFontInfoCache = new __aspxRichEdit.FontInfoCache(this.control.model.cache.fontInfoCache.fontMeasurer);
                this.htmlImporterMaskedCharacterProperties =
                    new HtmlImport.HtmlImporterMaskedCharacterProperties(this.control, this.loadFontInfos, this.tempFontInfoCache);
                this.paragraphListpropertiesUtils = new HtmlImport.ParagraphListPropertiesUtils(this.htmlImporterMaskedCharacterProperties);
                this.tagImporters = {};
                for (var _i = 0, _a = HtmlImporter.importers; _i < _a.length; _i++) {
                    var importerConst = _a[_i];
                    this.tagImporters[new importerConst(this).elementTag()] = importerConst;
                }
            }
            Object.defineProperty(HtmlImporter.prototype, "currElement", {
                get: function () { return __aspxRichEdit.ListUtils.last(this.levelInfo).element; },
                enumerable: true,
                configurable: true
            });
            ;
            Object.defineProperty(HtmlImporter.prototype, "currElementChilds", {
                get: function () { return __aspxRichEdit.ListUtils.last(this.levelInfo).childElements; },
                enumerable: true,
                configurable: true
            });
            ;
            HtmlImporter.prototype.import = function () {
                var subDoc = this.control.model.activeSubDocument;
                this.importedRunsInfo = [];
                this.importedTablesInfo = [];
                __aspxRichEdit.ListUtils.clear(this.loadFontInfos);
                this.tempFontInfoCache.clear();
                this.control.history.beginTransaction();
                if (this.interval.length > 0) {
                    __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, subDoc, new __aspxRichEdit.FixedInterval(this.interval.start, 0), __aspxRichEdit.UpdateInputPositionProperties.No, this.control.selection.endOfLine);
                    __aspxRichEdit.ModelManipulator.removeInterval(this.control, subDoc, this.interval, false, true);
                    this.interval.length = 0;
                }
                var pos = this.interval.start;
                this.prevRunIsParagraph = pos == 0 ||
                    (subDoc.getRunByPosition(pos - 1).isParagraphOrSectionRun() && __aspxRichEdit.ListUtils.allOf(subDoc.tables, function (tbl) { return tbl.getEndPosition() != pos; }));
                this.convertChildElements();
                if (this.importedRunsInfo.length)
                    __aspxRichEdit.ModelManipulator.pasteHtmlData(this.control, subDoc, this.interval, new HtmlImportData(this.importedRunsInfo, this.getSortedTables()));
                for (var _i = 0, _a = this.loadFontInfos; _i < _a.length; _i++) {
                    var info = _a[_i];
                    this.control.modelManipulator.text.loadFontInfo(info.fontInfo, info.subDocument, [info.applyNewFontOnIntervalsAfterLoad]);
                }
                this.control.history.endTransaction();
            };
            HtmlImporter.prototype.convertChildElements = function () {
                for (var _i = 0, _a = this.currElementChilds; _i < _a.length; _i++) {
                    var element = _a[_i];
                    this.convertElement(element);
                }
            };
            HtmlImporter.prototype.getSortedTables = function () {
                return this.importedTablesInfo.sort(function (a, b) {
                    var aInt = a.interval;
                    var bInt = b.interval;
                    var posDiff = aInt.start - bInt.start;
                    if (posDiff)
                        return posDiff;
                    return aInt.containsInterval(bInt) ? -1 : 1;
                });
            };
            HtmlImporter.prototype.convertElement = function (element) {
                if (element.style && element.style.display == "none")
                    return;
                this.levelInfo.push(new LevelInfo(element, element.childNodes).initTagImporter(this));
                var importer = __aspxRichEdit.ListUtils.last(this.levelInfo).tagImporter;
                this.putDownParentPropertiesToChild();
                if (importer.isAllowed())
                    importer.importBefore();
                if (importer.isImportChilds())
                    this.convertChildElements();
                if (importer.isAllowed())
                    importer.importAfter();
                this.levelInfo.pop();
            };
            HtmlImporter.prototype.putDownParentPropertiesToChild = function () {
                if (!this.currElementChilds)
                    return;
                var element = this.currElement;
                var missTag = HtmlImporter.MapMissTablePropertiesByTagNames[__aspxRichEdit.ListUtils.last(this.levelInfo).tagImporter.elementTag()];
                __aspxRichEdit.ListUtils.foreach(this.currElementChilds, function (childElement) {
                    var childElemStyle = childElement.style;
                    if (!childElemStyle)
                        return;
                    for (var prop in childElemStyle) {
                        if (missTag && /^(border|background|marginLeft)/gi.test(prop))
                            continue;
                        if (childElemStyle[prop] === "" && element.style[prop] !== "" && !(HtmlImporter.MapShorthandProperty[prop]))
                            childElemStyle[prop] = element.style[prop];
                    }
                });
            };
            HtmlImporter.prototype.addRun = function (run) {
                this.importedRunsInfo.push(run);
                this.currPosition += run.runLength;
                this.prevRunIsParagraph = run.runType == __aspxRichEdit.RunType.ParagraphRun || run.runType == __aspxRichEdit.RunType.SectionRun;
            };
            HtmlImporter.prototype.getLastImportedRun = function () {
                return __aspxRichEdit.ListUtils.last(this.importedRunsInfo);
            };
            HtmlImporter.prototype.columnSize = function () {
                var section = this.control.model.getSectionByPosition(this.interval.start);
                return __aspxRichEdit.LayoutFormatter.ColumnCalculator.findMinimalColumnSize(section.sectionProperties)
                    .applyConverter(__aspxRichEdit.UnitConverter.pixelsToTwips);
            };
            HtmlImporter.convertHtml = function (html) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.HtmlImporter, "convertHtml", function () { return html; });
                html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3");
                html = html.replace(/\s*mso-bidi-font-family/gi, "font-family");
                html = html.replace(/\s*MARGIN: 0cm 0cm 0pt\s*;/gi, '');
                html = html.replace(/\s*MARGIN: 0cm 0cm 0pt\s*"/gi, "\"");
                html = html.replace(/\s*TEXT-INDENT: 0cm\s*;/gi, '');
                html = html.replace(/\s*TEXT-INDENT: 0cm\s*"/gi, "\"");
                html = html.replace(/\s*FONT-VARIANT: [^\s;]+;?"/gi, "\"");
                html = html.replace(/\s*tab-stops:[^;"]*;?/gi, '');
                html = html.replace(/\s*tab-stops:[^"]*/gi, '');
                html = html.replace(/<\w+:imagedata/gi, '<img');
                html = html.replace(/<p([^>]*)><o:[pP][^>]*>\s*<\/o:[pP]><\/p>(?=\s*<\/td>)/gi, '<p$1>&nbsp;<\/p>');
                html = html.replace(/<\/?\w+:[^>]*>/gi, '');
                html = html.replace(/<STYLE[^>]*>[\s\S]*?<\/STYLE[^>]*>/gi, '');
                html = html.replace(/<(?:META|LINK)[^>]*>\s*/gi, '');
                html = html.replace(/<\\?\?xml[^>]*>/gi, '');
                html = html.replace(/<o:[pP][^>]*>\s*<\/o:[pP]>/gi, '');
                html = html.replace(/<o:[pP][^>]*>.*?<\/o:[pP]>/gi, '&nbsp;');
                html = html.replace(/<st1:.*?>/gi, '');
                html = html.replace(/<\!--[\s\S]*?-->/g, '');
                html = html.replace(/\s*style="\s*"/gi, '');
                html = html.replace(/style=""/ig, "");
                html = html.replace(/style=''/ig, "");
                var stRegExp = new RegExp('(?:style=\\")([^\\"]*)(?:\\")', 'gi');
                html = html.replace(stRegExp, function (str) {
                    str = str.replace(/&quot;/gi, "'");
                    str = str.replace(/&#xA;/gi, " ");
                    return str;
                });
                html = html.replace(/^\s|\s$/gi, '');
                html = html.replace(/<font[^>]*>([^<>]+)<\/font>/gi, '$1');
                html = html.replace(/<span\s*><span\s*>([^<>]+)<\/span><\/span>/ig, '$1');
                html = html.replace(/<span>([^<>]+)<\/span>/gi, '$1');
                html = html.replace(/<li([^>]*)>([^<>]+)<\/li>/gi, '<li$1><p>$2</p></li>');
                html = html.replace(/<li([^>]*)>(([^<>]*)<(?!p)[\s\S]*?)<\/li>/gi, '<li$1><p>$2</p></li>');
                html = html.replace(/<caption([^>]*)>[\s\S]*?<\/caption>/gi, '');
                var array = html.match(/<[^>]*style\s*=\s*[^>]*>/gi);
                if (array && array.length > 0) {
                    for (var i = 0, elementHtml; elementHtml = array[i]; i++) {
                        var fontFamilyArray = elementHtml.match(/\s*font-family\s*:\s*(([^;]*)([\"';\s)](?!>))|([^;"']*))/gi);
                        if (fontFamilyArray && fontFamilyArray.length > 1) {
                            var commonValue = fontFamilyArray[0].replace(/font-family\s*:\s*([^;]*)[\"'; ]/gi, "$1");
                            var resultElementHtml = elementHtml;
                            for (var j = 0, fontFamily; fontFamily = fontFamilyArray[j]; j++)
                                resultElementHtml = resultElementHtml.replace(fontFamily, "font-family: " + commonValue + ";");
                            html = html.replace(elementHtml, resultElementHtml);
                        }
                    }
                }
                html = html.replace(/^\n|\n$/gi, '');
                html = html.replace(/(\n+(<br>)|(<\/p>|<br>)\n+)/gi, '$2$3');
                html = html.replace(/(\n+\s+)|(\s+\n+)/gi, ' ');
                html = html.replace(/\n+/gi, ' ');
                html = html.replace(/>[\s]*</g, "><");
                html = html.replace(/(<\/(?!(p)+)(\s*[^>]*)?>)<\/td>/gi, '$1<p>&nbsp;</p></td>');
                html = html.replace(/(<\/(?!(p)+)(\s*[^>]*)?>)<\/th>/gi, '$1<p>&nbsp;</p></th>');
                html = html.replace(/<span(\s(?!data-re-rangecopy)[^>]*)?><a(\s[^>]*)>([\s\S]*?)<\/a><\/span>/gi, '<a$2><span$1>$3</span></a>');
                html = html.replace(/<script(\s[^>]*)?>[\s\S]*?<\/script>/gi, '');
                html = html.replace(/<u>([\s\S]*?)<\/u>/gi, '<span style="text-decoration: underline">$1</span>');
                html = html.replace(/<s>([\s\S]*?)<\/s>/gi, '<span style="text-decoration: line-through">$1</span>');
                html = html.replace(/<\/([^\s>]+)(\s[^>]*)?><br><\/([^\s>]+)(\s[^>]*)?>/gi, '');
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.HtmlImporter, "convertHtml", function () { return html; });
                return html;
            };
            HtmlImporter.importers = null;
            HtmlImporter.MapMissTablePropertiesByTagNames = new __aspxRichEdit.MapCreatorStringAsKey()
                .add("TABLE", true)
                .add("TD", true)
                .add("TH", true)
                .get();
            HtmlImporter.MapShorthandProperty = new __aspxRichEdit.MapCreatorStringAsKey()
                .add("background", true)
                .add("border", true)
                .add("borderImage", true)
                .add("borderTop", true)
                .add("borderRight", true)
                .add("borderBottom", true)
                .add("borderLeft", true)
                .add("borderWidth", true)
                .add("borderColor", true)
                .add("borderStyle", true)
                .add("borderRadius", true)
                .add("font", true)
                .add("fontVariant", true)
                .add("listStyle", true)
                .add("margin", true)
                .add("padding", true)
                .add("transition", true)
                .add("transform", true)
                .add("listStyleType", true)
                .add("cssText", true)
                .get();
            return HtmlImporter;
        }());
        HtmlImport.HtmlImporter = HtmlImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var LoadFontInfo = (function () {
            function LoadFontInfo(fontInfo, subDocument, applyNewFontOnIntervalsAfterLoad) {
                this.fontInfo = fontInfo;
                this.subDocument = subDocument;
                this.applyNewFontOnIntervalsAfterLoad = applyNewFontOnIntervalsAfterLoad;
            }
            return LoadFontInfo;
        }());
        HtmlImport.LoadFontInfo = LoadFontInfo;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ReadOnlyMode;
    (function (ReadOnlyMode) {
        ReadOnlyMode[ReadOnlyMode["None"] = 0] = "None";
        ReadOnlyMode[ReadOnlyMode["Persistent"] = 1] = "Persistent";
        ReadOnlyMode[ReadOnlyMode["Temporary"] = 2] = "Temporary";
    })(ReadOnlyMode = __aspxRichEdit.ReadOnlyMode || (__aspxRichEdit.ReadOnlyMode = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var IntervalAlgorithms = (function () {
        function IntervalAlgorithms() {
        }
        IntervalAlgorithms.getIntersection = function (intervalA, intervalB) {
            return IntervalAlgorithms.getIntersectionTemplate(intervalA, intervalB, intervalA);
        };
        IntervalAlgorithms.getIntersectionTemplate = function (intervalA, intervalB, template) {
            var start = Math.max(intervalA.start, intervalB.start);
            var end = Math.min(intervalA.end, intervalB.end);
            if (start > end)
                return null;
            return template.makeByStartEnd(start, end);
        };
        IntervalAlgorithms.getIntersectionNonNullLength = function (intervalA, intervalB) {
            return IntervalAlgorithms.getIntersectionNonNullLengthTemplate(intervalA, intervalB, intervalA);
        };
        IntervalAlgorithms.getIntersectionNonNullLengthTemplate = function (intervalA, intervalB, template) {
            var inters = IntervalAlgorithms.getIntersectionTemplate(intervalA, intervalB, template);
            return inters && inters.length ? inters : null;
        };
        IntervalAlgorithms.getIntersectionsTwoArraysOfInterval = function (intervalsA, intervalsB) {
            return IntervalAlgorithms.getIntersectionsTwoArraysOfIntervalTemplate(intervalsA, intervalsB, intervalsA[0]);
        };
        IntervalAlgorithms.getIntersectionsTwoArraysOfIntervalTemplate = function (intervalsA, intervalsB, template) {
            var result = [];
            var lengthIntervalsA = intervalsA.length;
            var lengthIntervalsB = intervalsB.length;
            var intervalsAIndex = 0;
            var intervalsBIndex = 0;
            var currAInterval = intervalsA[intervalsAIndex];
            var currBInterval = intervalsB[intervalsBIndex];
            var currResultInterval;
            while (intervalsAIndex < lengthIntervalsA && intervalsBIndex < lengthIntervalsB) {
                var intersection = IntervalAlgorithms.getIntersectionTemplate(currAInterval, currBInterval, template);
                if (intersection) {
                    if (currResultInterval && currResultInterval.end == intersection.start)
                        currResultInterval.length += intersection.length;
                    else {
                        currResultInterval = intersection;
                        result.push(currResultInterval);
                    }
                }
                if (currAInterval.end < currBInterval.end) {
                    intervalsAIndex++;
                    currAInterval = intervalsA[intervalsAIndex];
                }
                else {
                    intervalsBIndex++;
                    currBInterval = intervalsB[intervalsBIndex];
                }
            }
            return result;
        };
        IntervalAlgorithms.getAffectedObjects = function (objects, intervals, getFirstIndex, conflictResolver) {
            if (getFirstIndex === void 0) { getFirstIndex = function (start) {
                return __aspxRichEdit.Utils.normedInterpolationIndexOf(objects, function (obj) { return obj.interval.start; }, start);
            }; }
            if (conflictResolver === void 0) { conflictResolver = function (objectInterval, touchingIntervalLength, touchPoint) {
                return objectInterval.start == touchPoint && touchingIntervalLength == 0;
            }; }
            return IntervalAlgorithms.getAffectedObjectsTemplate(objects, intervals, intervals[0], getFirstIndex, conflictResolver);
        };
        IntervalAlgorithms.getAffectedObjectsTemplate = function (objects, intervals, template, getFirstIndex, conflictResolver) {
            if (getFirstIndex === void 0) { getFirstIndex = function (start) {
                return __aspxRichEdit.Utils.normedInterpolationIndexOf(objects, function (obj) { return obj.interval.start; }, start);
            }; }
            if (conflictResolver === void 0) { conflictResolver = function (objectInterval, touchingIntervalLength, touchPoint) {
                return objectInterval.start == touchPoint && touchingIntervalLength == 0;
            }; }
            var collector = new __aspxRichEdit.SparseIntervalsCollector(template);
            for (var _i = 0, intervals_1 = intervals; _i < intervals_1.length; _i++) {
                var interval = intervals_1[_i];
                var ind = Math.max(0, getFirstIndex(interval.start, objects));
                for (var obj = void 0; obj = objects[ind]; ind++) {
                    var objInterval = obj.interval;
                    if (objInterval.start > interval.end)
                        break;
                    var intersection = IntervalAlgorithms.getIntersectionTemplate(objInterval, interval, template);
                    if (intersection && (intersection.length || conflictResolver(objInterval, interval.length, intersection.start)))
                        collector.add(ind);
                }
            }
            return collector.getIntervals();
        };
        IntervalAlgorithms.handleAffectedObjects = function (objects, intervals, callback, getFirstIndex) {
            if (getFirstIndex === void 0) { getFirstIndex = function (start) {
                return __aspxRichEdit.Utils.normedInterpolationIndexOf(objects, function (obj) { return obj.interval.start; }, start);
            }; }
            var template = new __aspxRichEdit.FixedInterval(0, 0);
            for (var _i = 0, intervals_2 = intervals; _i < intervals_2.length; _i++) {
                var interval = intervals_2[_i];
                var ind = Math.max(0, getFirstIndex(interval.start, objects));
                for (var obj = void 0; obj = objects[ind]; ind++) {
                    var objInterval = obj.interval;
                    if (objInterval.start > interval.end)
                        break;
                    var intersection = IntervalAlgorithms.getIntersectionTemplate(objInterval, interval, template);
                    if (intersection)
                        callback(obj, ind, interval, intersection);
                }
            }
        };
        IntervalAlgorithms.getMergedIntervals = function (intervals, needSort) {
            return IntervalAlgorithms.getMergedIntervalsTemplate(intervals, needSort, intervals[0]);
        };
        IntervalAlgorithms.getMergedIntervalsTemplate = function (intervals, needSort, template) {
            if (intervals.length < 2)
                return intervals.length > 0 ? [template.makeByStartLength(intervals[0].start, intervals[0].length)] : [];
            var sortedIntervals = needSort ?
                [].concat(intervals).sort(function (a, b) { return a.start - b.start; }) :
                intervals;
            var result = [];
            for (var i = 0, interval; interval = sortedIntervals[i];) {
                var minBound = interval.start;
                var maxBound = interval.end;
                for (++i; (interval = sortedIntervals[i]) != undefined && (interval.start <= maxBound); i++)
                    if (interval.end > maxBound)
                        maxBound = interval.end;
                result.push(template.makeByStartEnd(minBound, maxBound));
            }
            return result;
        };
        IntervalAlgorithms.reflectIntervals = function (intervals, bounds) {
            return IntervalAlgorithms.reflectIntervalsTemplate(intervals, bounds, bounds);
        };
        IntervalAlgorithms.reflectIntervalsTemplate = function (intervals, bounds, template) {
            if (!intervals.length)
                return [template.makeByStartLength(bounds.start, bounds.length)];
            var lastIntervalEnd = __aspxRichEdit.ListUtils.last(intervals).end;
            var result = __aspxRichEdit.ListUtils.reducedMap(intervals, function (curr, i) {
                return IntervalAlgorithms.getIntersectionNonNullLengthTemplate(template.makeByStartEnd(intervals[i - 1].end, curr.start), bounds, template);
            }, 1);
            if (bounds.start < intervals[0].start)
                result.unshift(template.makeByStartEnd(bounds.start, intervals[0].start));
            if (bounds.end > lastIntervalEnd)
                result.push(template.makeByStartEnd(lastIntervalEnd, bounds.end));
            return result;
        };
        return IntervalAlgorithms;
    }());
    __aspxRichEdit.IntervalAlgorithms = IntervalAlgorithms;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LinkedInterval = (function (_super) {
        __extends(LinkedInterval, _super);
        function LinkedInterval(manager, interval) {
            var _this = _super.call(this) || this;
            _this._start = manager.registerPosition(interval.start);
            _this._end = manager.registerPosition(interval.end);
            return _this;
        }
        Object.defineProperty(LinkedInterval.prototype, "start", {
            get: function () { return this._start.value; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(LinkedInterval.prototype, "length", {
            get: function () { return this._end.value - this._start.value; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(LinkedInterval.prototype, "end", {
            get: function () { return this._end.value; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(LinkedInterval.prototype, "center", {
            get: function () { return (this.start + this.end) / 2; },
            enumerable: true,
            configurable: true
        });
        LinkedInterval.prototype.destructor = function (manager) {
            manager.unregisterPosition(this._start);
            manager.unregisterPosition(this._end);
        };
        LinkedInterval.prototype.equals = function (obj) {
            return obj && this.start == obj.start && this.end == obj.end;
        };
        return LinkedInterval;
    }(__aspxRichEdit.ConstInterval));
    __aspxRichEdit.LinkedInterval = LinkedInterval;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SparseIntervalsCollector = (function () {
        function SparseIntervalsCollector(template) {
            this.intervals = [];
            this.template = template;
        }
        SparseIntervalsCollector.prototype.add = function (index) {
            if (this.curr && this.curr.end == index) {
                this.curr.length++;
                return;
            }
            this.curr = this.template.makeByStartLength(index, 1);
            this.intervals.push(this.curr);
        };
        SparseIntervalsCollector.prototype.getIntervals = function () {
            return new SparseIntervals(this.intervals);
        };
        return SparseIntervalsCollector;
    }());
    __aspxRichEdit.SparseIntervalsCollector = SparseIntervalsCollector;
    var SparseIntervalsMapCollector = (function () {
        function SparseIntervalsMapCollector(cmp, template) {
            this.intervals = [];
            this.valMap = {};
            this.cmp = cmp;
            this.template = template;
        }
        SparseIntervalsMapCollector.prototype.add = function (index, value) {
            if (this.curr && this.curr.end == index && this.cmp(this.currVal, value) == 0) {
                this.curr.length++;
                return;
            }
            this.curr = this.template.makeByStartLength(index, 1);
            this.intervals.push(this.curr);
            this.currVal = value;
            this.valMap[index] = value;
        };
        SparseIntervalsMapCollector.prototype.getIterator = function () {
            return new SparseIntervalsMapIterator(this.intervals, this.valMap);
        };
        return SparseIntervalsMapCollector;
    }());
    __aspxRichEdit.SparseIntervalsMapCollector = SparseIntervalsMapCollector;
    var SparseIntervalsMapIterator = (function () {
        function SparseIntervalsMapIterator(intervals, valMap) {
            this.sparseIntervals = new SparseIntervals(intervals);
            this.valMap = valMap;
            this.intervalIndex = -1;
        }
        SparseIntervalsMapIterator.prototype.moveToNextPosition = function () {
            if (this.interval && this.posInInterval + 1 < this.interval.length) {
                this.posInInterval++;
                this.position++;
                return true;
            }
            return this.moveToNextInterval();
        };
        SparseIntervalsMapIterator.prototype.moveToNextInterval = function () {
            if (this.intervalIndex + 1 < this.sparseIntervals.numIntervals) {
                this.intervalIndex++;
                this.interval = this.sparseIntervals.getInterval(this.intervalIndex);
                this.posInInterval = 0;
                this.position = this.interval.start;
                this.object = this.valMap[this.position];
                return true;
            }
            return false;
        };
        return SparseIntervalsMapIterator;
    }());
    __aspxRichEdit.SparseIntervalsMapIterator = SparseIntervalsMapIterator;
    var SparseIntervals = (function () {
        function SparseIntervals(list) {
            if (list === void 0) { list = []; }
            this.list = list;
            this._count = 0;
            this._numIntervals = 0;
            for (var _i = 0, list_1 = list; _i < list_1.length; _i++) {
                var curr = list_1[_i];
                this._count += curr.length;
                this._numIntervals++;
            }
        }
        Object.defineProperty(SparseIntervals.prototype, "count", {
            get: function () { return this._count; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(SparseIntervals.prototype, "numIntervals", {
            get: function () { return this._numIntervals; },
            enumerable: true,
            configurable: true
        });
        SparseIntervals.prototype.getInterval = function (index) {
            return this.list[index];
        };
        SparseIntervals.prototype.getNativeIterator = function () {
            return new SparseIntervalsIterator(this);
        };
        SparseIntervals.prototype.getObjectsIterator = function (objects) {
            return new SparseObjectsIterator(this, objects);
        };
        return SparseIntervals;
    }());
    __aspxRichEdit.SparseIntervals = SparseIntervals;
    var SparseIntervalsIterator = (function () {
        function SparseIntervalsIterator(sparseIntervals) {
            this.sparseIntervals = sparseIntervals;
            this.intervalIndex = -1;
        }
        Object.defineProperty(SparseIntervalsIterator.prototype, "isStarted", {
            get: function () { return !!this.curr; },
            enumerable: true,
            configurable: true
        });
        SparseIntervalsIterator.prototype.moveNext = function () {
            if (this.curr && this.posInInterval + 1 < this.curr.length) {
                this.posInInterval++;
                this.index++;
                this.initObject();
                return true;
            }
            if (this.intervalIndex + 1 < this.sparseIntervals.numIntervals) {
                this.intervalIndex++;
                this.curr = this.sparseIntervals.getInterval(this.intervalIndex);
                if (!this.curr.length)
                    return this.moveNext();
                this.posInInterval = 0;
                this.index = this.curr.start;
                this.initObject();
                return true;
            }
            return false;
        };
        SparseIntervalsIterator.prototype.movePrev = function () {
            if (this.curr && this.posInInterval - 1 >= this.curr.start) {
                this.posInInterval--;
                this.index--;
                this.initObject();
                return true;
            }
            if (!this.isStarted)
                this.intervalIndex = this.sparseIntervals.numIntervals;
            if (this.intervalIndex - 1 >= 0) {
                this.intervalIndex--;
                this.curr = this.sparseIntervals.getInterval(this.intervalIndex);
                this.posInInterval = Math.max(this.curr.length - 1, this.curr.start);
                this.index = this.curr.start;
                this.initObject();
                return true;
            }
            return false;
        };
        SparseIntervalsIterator.prototype.initObject = function () { };
        return SparseIntervalsIterator;
    }());
    __aspxRichEdit.SparseIntervalsIterator = SparseIntervalsIterator;
    var SparseObjectsIterator = (function (_super) {
        __extends(SparseObjectsIterator, _super);
        function SparseObjectsIterator(sparseIntervals, objects) {
            var _this = _super.call(this, sparseIntervals) || this;
            _this.objects = objects;
            return _this;
        }
        SparseObjectsIterator.prototype.initObject = function () {
            this.obj = this.objects[this.index];
        };
        return SparseObjectsIterator;
    }(SparseIntervalsIterator));
    __aspxRichEdit.SparseObjectsIterator = SparseObjectsIterator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ServerCommandRequest = (function () {
        function ServerCommandRequest(requestType, subDocumentId, commandParams) {
            this.type = requestType;
            this.subDocumentId = subDocumentId;
            this.params = commandParams;
        }
        ServerCommandRequest.prototype.getJsonObject = function (withPostData) {
            var request = {};
            request[__aspxRichEdit.JSONCommandParametersProperty.CommandType] = this.type;
            request[__aspxRichEdit.JSONCommandParametersProperty.IncId] = this.id;
            request[__aspxRichEdit.JSONCommandParametersProperty.ServerParams] = this.prepareParams(this.params, withPostData);
            if (this.subDocumentId >= 0)
                request[__aspxRichEdit.JSONCommandParametersProperty.SubDocumentId] = this.subDocumentId;
            request[__aspxRichEdit.JSONCommandParametersProperty.FontInfoCacheLength] = this.fontInfoCacheLength;
            return request;
        };
        ServerCommandRequest.prototype.prepareParams = function (params, withPostData) {
            for (var param in params) {
                if (params.hasOwnProperty(param)) {
                    var value = params[param];
                    if (typeof value == "string")
                        params[param] = withPostData ? __aspxRichEdit.HTMLUtils.prepareTextForCallBackRequest(value) : __aspxRichEdit.HTMLUtils.prepareTextForRequest(value);
                    if (typeof value == "object")
                        params[param] = this.prepareParams(value, withPostData);
                }
            }
            return params;
        };
        ServerCommandRequest.isEditRequest = function (request) {
            return ServerCommandRequest.isEditCommandType(request.type);
        };
        ServerCommandRequest.isEditCommandType = function (type) {
            return type < 0;
        };
        ServerCommandRequest.isLoadCommandType = function (type) {
            return type > 0;
        };
        ServerCommandRequest.isUIBlockingCommandType = function (type) {
            return type === __aspxRichEdit.CommandType.StartCommand || type === __aspxRichEdit.CommandType.OpenDocument || type === __aspxRichEdit.CommandType.NewDocument;
        };
        ServerCommandRequest.prototype.isOpenDocumentRequest = function () {
            return false;
        };
        ServerCommandRequest.prototype.isSaveDocumentRequest = function () {
            return false;
        };
        ServerCommandRequest.prototype.isSpellCheckerRequest = function () {
            return false;
        };
        ServerCommandRequest.prototype.isGetSetRtfRequest = function () {
            return false;
        };
        ServerCommandRequest.prototype.isForcePushRerquest = function () {
            return false;
        };
        ServerCommandRequest.prototype.extendTextRequest = function (_subDocument, _position, _textLength, _characterPropertiesJSON, _characterStyleName, _type, _text) {
            return false;
        };
        return ServerCommandRequest;
    }());
    __aspxRichEdit.ServerCommandRequest = ServerCommandRequest;
    var EditCommandRequest = (function (_super) {
        __extends(EditCommandRequest, _super);
        function EditCommandRequest() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        EditCommandRequest.prototype.getJsonObject = function (withPostData) {
            var request = _super.prototype.getJsonObject.call(this, withPostData);
            request[__aspxRichEdit.JSONCommandParametersProperty.EditIncId] = this.editIncId;
            return request;
        };
        return EditCommandRequest;
    }(ServerCommandRequest));
    __aspxRichEdit.EditCommandRequest = EditCommandRequest;
    var LoadCommandRequest = (function (_super) {
        __extends(LoadCommandRequest, _super);
        function LoadCommandRequest() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LoadCommandRequest.prototype.isOpenDocumentRequest = function () {
            return __aspxRichEdit.EnumUtils.isAnyOf(this.type, __aspxRichEdit.CommandType.OpenDocument, __aspxRichEdit.CommandType.NewDocument, __aspxRichEdit.CommandType.ReloadDocument);
        };
        LoadCommandRequest.prototype.isSaveDocumentRequest = function () {
            return this.type === __aspxRichEdit.CommandType.SaveDocument || this.type === __aspxRichEdit.CommandType.SaveAsDocument;
        };
        LoadCommandRequest.prototype.isSpellCheckerRequest = function () {
            return this.type === __aspxRichEdit.CommandType.CheckSpelling || this.type === __aspxRichEdit.CommandType.AddWordToDictionary;
        };
        LoadCommandRequest.prototype.isGetSetRtfRequest = function () {
            return __aspxRichEdit.EnumUtils.isAnyOf(this.type, __aspxRichEdit.CommandType.GetRtf, __aspxRichEdit.CommandType.InsertRtf);
        };
        LoadCommandRequest.prototype.isForcePushRerquest = function () {
            return this.type === __aspxRichEdit.CommandType.ForceSyncWithServer;
        };
        return LoadCommandRequest;
    }(ServerCommandRequest));
    __aspxRichEdit.LoadCommandRequest = LoadCommandRequest;
    var EditTextBufferCommandRequest = (function (_super) {
        __extends(EditTextBufferCommandRequest, _super);
        function EditTextBufferCommandRequest(requestType, subDocumentId, text, commandParams) {
            var _this = _super.call(this, requestType, subDocumentId, commandParams) || this;
            _this.text = text;
            return _this;
        }
        EditTextBufferCommandRequest.prototype.getJsonObject = function (withPostData) {
            this.params[__aspxRichEdit.JSONInsertTextCommandProperty.Text] = this.text;
            return _super.prototype.getJsonObject.call(this, withPostData);
        };
        EditTextBufferCommandRequest.prototype.extendTextRequest = function (subDocument, position, textLength, characterPropertiesJSON, characterStyleName, type, text) {
            if (this.subDocumentId == subDocument.id &&
                this.type === __aspxRichEdit.CommandType.InsertSimpleRun &&
                this.params[__aspxRichEdit.JSONInsertTextCommandProperty.Position] + this.params[__aspxRichEdit.JSONInsertTextCommandProperty.Length] === position &&
                this.params[__aspxRichEdit.JSONInsertTextCommandProperty.RunType] === type &&
                this.params[__aspxRichEdit.JSONInsertTextCommandProperty.CharacterStyleName] === characterStyleName &&
                JSON.stringify(this.params[__aspxRichEdit.JSONInsertTextCommandProperty.CharacterProperties]) === JSON.stringify(characterPropertiesJSON)) {
                this.text += text;
                this.params[__aspxRichEdit.JSONInsertTextCommandProperty.Length] += textLength;
                return true;
            }
            else
                return false;
        };
        return EditTextBufferCommandRequest;
    }(EditCommandRequest));
    __aspxRichEdit.EditTextBufferCommandRequest = EditTextBufferCommandRequest;
    var ClientServerTextBufferChangedCommandRequest = (function (_super) {
        __extends(ClientServerTextBufferChangedCommandRequest, _super);
        function ClientServerTextBufferChangedCommandRequest(requestType, subDocumentId, state, commandParams) {
            var _this = _super.call(this, requestType, subDocumentId, commandParams) || this;
            _this.state = state;
            return _this;
        }
        ClientServerTextBufferChangedCommandRequest.prototype.getJsonObject = function (withPostData) {
            this.params[__aspxRichEdit.JSONPropertyStateBasedCommand.State] = this.state.toJSON(withPostData);
            return _super.prototype.getJsonObject.call(this, withPostData);
        };
        return ClientServerTextBufferChangedCommandRequest;
    }(EditCommandRequest));
    __aspxRichEdit.ClientServerTextBufferChangedCommandRequest = ClientServerTextBufferChangedCommandRequest;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var CommandType;
    (function (CommandType) {
        CommandType[CommandType["Unknown"] = 0] = "Unknown";
        CommandType[CommandType["LoadPieceTable"] = 1] = "LoadPieceTable";
        CommandType[CommandType["OpenDocument"] = 2] = "OpenDocument";
        CommandType[CommandType["SaveDocument"] = 3] = "SaveDocument";
        CommandType[CommandType["NewDocument"] = 4] = "NewDocument";
        CommandType[CommandType["SaveAsDocument"] = 5] = "SaveAsDocument";
        CommandType[CommandType["ReloadDocument"] = 6] = "ReloadDocument";
        CommandType[CommandType["StartCommand"] = 7] = "StartCommand";
        CommandType[CommandType["CheckSpelling"] = 8] = "CheckSpelling";
        CommandType[CommandType["AddWordToDictionary"] = 9] = "AddWordToDictionary";
        CommandType[CommandType["GetRtf"] = 10] = "GetRtf";
        CommandType[CommandType["InsertRtf"] = 11] = "InsertRtf";
        CommandType[CommandType["ForceSyncWithServer"] = 12] = "ForceSyncWithServer";
        CommandType[CommandType["InsertContentFromServer"] = 13] = "InsertContentFromServer";
        CommandType[CommandType["DownloadMergedDocument"] = 14] = "DownloadMergedDocument";
        CommandType[CommandType["DeleteRuns"] = -1] = "DeleteRuns";
        CommandType[CommandType["InsertSimpleRun"] = -2] = "InsertSimpleRun";
        CommandType[CommandType["ChangeCharacterProperty"] = -3] = "ChangeCharacterProperty";
        CommandType[CommandType["ChangeTextBuffer"] = -4] = "ChangeTextBuffer";
        CommandType[CommandType["ApplyCharacterStyle"] = -5] = "ApplyCharacterStyle";
        CommandType[CommandType["ChangeCharacterPropertiesUseValue"] = -6] = "ChangeCharacterPropertiesUseValue";
        CommandType[CommandType["InsertParagraph"] = -7] = "InsertParagraph";
        CommandType[CommandType["MergeParagraphs"] = -8] = "MergeParagraphs";
        CommandType[CommandType["ChangeParagraphProperty"] = -9] = "ChangeParagraphProperty";
        CommandType[CommandType["ApplyParagraphStyle"] = -10] = "ApplyParagraphStyle";
        CommandType[CommandType["ChangeParagraphPropertiesUseValue"] = -11] = "ChangeParagraphPropertiesUseValue";
        CommandType[CommandType["InsertSection"] = -12] = "InsertSection";
        CommandType[CommandType["MergeSections"] = -13] = "MergeSections";
        CommandType[CommandType["ChangeSectionProperties"] = -14] = "ChangeSectionProperties";
        CommandType[CommandType["CreateBookmark"] = -15] = "CreateBookmark";
        CommandType[CommandType["DeleteBookmark"] = -16] = "DeleteBookmark";
        CommandType[CommandType["InsertInlinePicture"] = -17] = "InsertInlinePicture";
        CommandType[CommandType["ChangeInlineObjectProperties"] = -18] = "ChangeInlineObjectProperties";
        CommandType[CommandType["LoadInlinePictures"] = -19] = "LoadInlinePictures";
        CommandType[CommandType["UpdateInlinePictures"] = -20] = "UpdateInlinePictures";
        CommandType[CommandType["DelayedPrint"] = -21] = "DelayedPrint";
        CommandType[CommandType["ChangeDefaultTabWidth"] = -22] = "ChangeDefaultTabWidth";
        CommandType[CommandType["ChangePageColor"] = -23] = "ChangePageColor";
        CommandType[CommandType["SaveMergedDocument"] = -24] = "SaveMergedDocument";
        CommandType[CommandType["ChangeDifferentOddAndEvenPages"] = -25] = "ChangeDifferentOddAndEvenPages";
        CommandType[CommandType["ApplyNumberingList"] = -26] = "ApplyNumberingList";
        CommandType[CommandType["AddNumberingList"] = -27] = "AddNumberingList";
        CommandType[CommandType["DeleteNumberingList"] = -28] = "DeleteNumberingList";
        CommandType[CommandType["AddAbstractNumberingList"] = -29] = "AddAbstractNumberingList";
        CommandType[CommandType["DeleteAbstractNumberingList"] = -30] = "DeleteAbstractNumberingList";
        CommandType[CommandType["ChangeListLevelCharacterProperties"] = -31] = "ChangeListLevelCharacterProperties";
        CommandType[CommandType["ChangeListLevelParagraphProperties"] = -32] = "ChangeListLevelParagraphProperties";
        CommandType[CommandType["ChangeListLevelProperties"] = -33] = "ChangeListLevelProperties";
        CommandType[CommandType["ChangeIOverrideListLevel"] = -34] = "ChangeIOverrideListLevel";
        CommandType[CommandType["DeleteTabAtParagraph"] = -35] = "DeleteTabAtParagraph";
        CommandType[CommandType["InsertTabToParagraph"] = -36] = "InsertTabToParagraph";
        CommandType[CommandType["CreateStyleLink"] = -37] = "CreateStyleLink";
        CommandType[CommandType["DeleteStyleLink"] = -38] = "DeleteStyleLink";
        CommandType[CommandType["InsertField"] = -39] = "InsertField";
        CommandType[CommandType["FieldUpdate"] = -40] = "FieldUpdate";
        CommandType[CommandType["HyperlinkInfoChanged"] = -41] = "HyperlinkInfoChanged";
        CommandType[CommandType["DeleteField"] = -42] = "DeleteField";
        CommandType[CommandType["CreateHeader"] = -43] = "CreateHeader";
        CommandType[CommandType["CreateFooter"] = -44] = "CreateFooter";
        CommandType[CommandType["ChangeHeaderIndex"] = -45] = "ChangeHeaderIndex";
        CommandType[CommandType["ChangeFooterIndex"] = -46] = "ChangeFooterIndex";
        CommandType[CommandType["CreateTable"] = -47] = "CreateTable";
        CommandType[CommandType["RemoveTable"] = -48] = "RemoveTable";
        CommandType[CommandType["ShiftTableStartPosition"] = -49] = "ShiftTableStartPosition";
        CommandType[CommandType["ChangeTableCell"] = -50] = "ChangeTableCell";
        CommandType[CommandType["ChangeTableCellProperty"] = -51] = "ChangeTableCellProperty";
        CommandType[CommandType["ChangeTableRow"] = -52] = "ChangeTableRow";
        CommandType[CommandType["ChangeTableRowProperty"] = -53] = "ChangeTableRowProperty";
        CommandType[CommandType["ChangeTable"] = -54] = "ChangeTable";
        CommandType[CommandType["ChangeTableProperty"] = -55] = "ChangeTableProperty";
        CommandType[CommandType["SplitTableCellHorizontally"] = -56] = "SplitTableCellHorizontally";
        CommandType[CommandType["MergeTableCellHorizontally"] = -57] = "MergeTableCellHorizontally";
        CommandType[CommandType["InsertTableRow"] = -58] = "InsertTableRow";
        CommandType[CommandType["RemoveTableRow"] = -59] = "RemoveTableRow";
        CommandType[CommandType["RemoveTableCell"] = -60] = "RemoveTableCell";
        CommandType[CommandType["InsertTableCell"] = -61] = "InsertTableCell";
        CommandType[CommandType["ApplyTableStyle"] = -62] = "ApplyTableStyle";
        CommandType[CommandType["LoadFontInfo"] = -63] = "LoadFontInfo";
        CommandType[CommandType["ChangeCharacterProperties"] = -64] = "ChangeCharacterProperties";
        CommandType[CommandType["ChangeParagraphProperties"] = -65] = "ChangeParagraphProperties";
        CommandType[CommandType["InsertAnchoredPicture"] = -66] = "InsertAnchoredPicture";
        CommandType[CommandType["ChangeAnchorInfoProperty"] = -67] = "ChangeAnchorInfoProperty";
        CommandType[CommandType["ChangeAnchoredObjectShapeProperty"] = -68] = "ChangeAnchoredObjectShapeProperty";
        CommandType[CommandType["ChangeAnchoredPictureSize"] = -69] = "ChangeAnchoredPictureSize";
        CommandType[CommandType["ChangeAnchoredTextBoxSize"] = -70] = "ChangeAnchoredTextBoxSize";
        CommandType[CommandType["InsertAnchoredTextBox"] = -71] = "InsertAnchoredTextBox";
        CommandType[CommandType["ChangeTextBoxProperties"] = -72] = "ChangeTextBoxProperties";
        CommandType[CommandType["RequestModelAfterHibernation"] = -73] = "RequestModelAfterHibernation";
    })(CommandType = __aspxRichEdit.CommandType || (__aspxRichEdit.CommandType = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ServerDispatcherModelChangesListener = (function () {
        function ServerDispatcherModelChangesListener(dispatcher) {
            this.dispatcher = dispatcher;
        }
        ServerDispatcherModelChangesListener.prototype.NotifySimpleRunInserted = function (subDocument, position, textLength, characterProperties, characterStyle, runType, text) {
            var characterPropertiesJSON = __aspxRichEdit.JSONMaskedCharacterPropertiesConverter.convertToJSON(characterProperties);
            var lastRequestInQueue = this.dispatcher.lastRequestInQueue;
            if (lastRequestInQueue && lastRequestInQueue.extendTextRequest(subDocument, position, textLength, characterPropertiesJSON, characterStyle.styleName, runType, text))
                return;
            var params = {};
            params[__aspxRichEdit.JSONInsertTextCommandProperty.Position] = position;
            params[__aspxRichEdit.JSONInsertTextCommandProperty.Length] = textLength;
            params[__aspxRichEdit.JSONInsertTextCommandProperty.RunType] = runType;
            params[__aspxRichEdit.JSONInsertTextCommandProperty.CharacterProperties] = characterPropertiesJSON;
            params[__aspxRichEdit.JSONInsertTextCommandProperty.CharacterStyleName] = characterStyle.styleName;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditTextBufferCommandRequest(__aspxRichEdit.CommandType.InsertSimpleRun, subDocument.id, text, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyParagraphInserted = function (subDocument, position, paragraph) {
            var params = {};
            params[__aspxRichEdit.JSONInsertParagraphCommandProperty.Position] = position;
            params[__aspxRichEdit.JSONInsertParagraphCommandProperty.ParagraphProperties] = __aspxRichEdit.JSONMaskedParagraphPropertiesConverter.convertToJSON(paragraph.maskedParagraphProperties);
            params[__aspxRichEdit.JSONInsertParagraphCommandProperty.StyleName] = paragraph.paragraphStyle.styleName;
            params[__aspxRichEdit.JSONInsertParagraphCommandProperty.NumberingListIndex] = paragraph.numberingListIndex;
            params[__aspxRichEdit.JSONInsertParagraphCommandProperty.ListLevelIndex] = paragraph.listLevelIndex;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.InsertParagraph, subDocument.id, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifySectionInserted = function (subDocument, position, section, _sectionIndex) {
            var params = {};
            params[__aspxRichEdit.JSONInsertSectionCommandProperty.Position] = position;
            params[__aspxRichEdit.JSONInsertSectionCommandProperty.SectionProperties] = __aspxRichEdit.JSONSectionPropertiesConverter.convertToJSON(section.sectionProperties);
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.InsertSection, subDocument.id, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyInlinePictureInserted = function (subDocument, position, id, scaleX, scaleY) {
            var params = {};
            params[__aspxRichEdit.JSONInlinePictureCommandsImageInfo.Position] = position;
            params[__aspxRichEdit.JSONInlinePictureCommandsImageInfo.ScaleWidth] = scaleX;
            params[__aspxRichEdit.JSONInlinePictureCommandsImageInfo.ScaleHeight] = scaleY;
            params[__aspxRichEdit.JSONInlinePictureCommandsImageInfo.ImageCacheId] = id;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.InsertInlinePicture, subDocument.id, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyAnchoredPictureInserted = function (subDocument, _objectId, position, id, size, anchorInfo) {
            var params = {};
            params[__aspxRichEdit.JSONInsertFloatingObjectCommandInfo.Position] = position;
            params[__aspxRichEdit.JSONInsertFloatingObjectCommandInfo.Size] = __aspxRichEdit.JSONInlinePictureSizeConverterConverter.convertToJSON(size);
            params[__aspxRichEdit.JSONInsertFloatingObjectCommandInfo.ImageCacheId] = id;
            params[__aspxRichEdit.JSONInsertFloatingObjectCommandInfo.AnchorInfo] = __aspxRichEdit.JSONAnchorInfoConverter.convertToJSON(anchorInfo);
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.InsertAnchoredPicture, subDocument.id, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyAnchoredTextBoxInserted = function (subDocument, _objectId, subDocId, position, anchorInfo) {
            var params = {};
            params[__aspxRichEdit.JSONInsertFloatingObjectCommandInfo.Position] = position;
            params[__aspxRichEdit.JSONInsertFloatingObjectCommandInfo.SubDocId] = subDocId;
            params[__aspxRichEdit.JSONInsertFloatingObjectCommandInfo.AnchorInfo] = __aspxRichEdit.JSONAnchorInfoConverter.convertToJSON(anchorInfo);
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.InsertAnchoredTextBox, subDocument.id, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyAnchorObjectRemoved = function (_subDocument, _objectId, _position) {
        };
        ServerDispatcherModelChangesListener.prototype.NotifyLoadInlinePictures = function (subDocument, imagesInfo) {
            var params = {};
            for (var ind = 0, imageInfo = void 0; imageInfo = imagesInfo[ind]; ind++) {
                var jsonImgInfo = {};
                jsonImgInfo[__aspxRichEdit.JSONInlinePictureCommandsImageInfo.Guid] = imageInfo.guid;
                jsonImgInfo[__aspxRichEdit.JSONInlinePictureCommandsImageInfo.Position] = imageInfo.position;
                jsonImgInfo[__aspxRichEdit.JSONInlinePictureCommandsImageInfo.SourceUrl] = imageInfo.sourceUrl;
                params[ind] = jsonImgInfo;
            }
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.LoadInlinePictures, subDocument.id, params), new __aspxRichEdit.RequestParams(false, true, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyInlinePicturesUpdated = function (subDocument, updatedImagesInfo) {
            var params = {};
            for (var ind = 0, imageInfo = void 0; imageInfo = updatedImagesInfo[ind]; ind++) {
                var jsonImgInfo = {};
                jsonImgInfo[__aspxRichEdit.JSONInlinePictureCommandsImageInfo.Position] = imageInfo.position;
                jsonImgInfo[__aspxRichEdit.JSONInlinePictureCommandsImageInfo.ScaleWidth] = imageInfo.scaleX;
                jsonImgInfo[__aspxRichEdit.JSONInlinePictureCommandsImageInfo.ScaleHeight] = imageInfo.scaleY;
                jsonImgInfo[__aspxRichEdit.JSONInlinePictureCommandsImageInfo.ImageCacheId] = imageInfo.id;
                params[ind] = jsonImgInfo;
            }
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.UpdateInlinePictures, subDocument.id, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyInlineObjectRunPropertyChanged = function (subDocument, property, _position, newState) {
            this.pushPropertyRequest(subDocument.id, property, newState, __aspxRichEdit.CommandType.ChangeInlineObjectProperties);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyAnchoredPictureSizeChanged = function (subDocument, _objectId, _position, newState) {
            this.pushStateBasedRequest(subDocument.id, newState, __aspxRichEdit.CommandType.ChangeAnchoredPictureSize);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyAnchoredTextBoxSizeChanged = function (subDocument, _objectId, _position, newState) {
            this.pushStateBasedRequest(subDocument.id, newState, __aspxRichEdit.CommandType.ChangeAnchoredTextBoxSize);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyAnchoredTextBoxPropertiesChanged = function (subDocument, _objectId, _position, newState) {
            this.pushStateBasedRequest(subDocument.id, newState, __aspxRichEdit.CommandType.ChangeTextBoxProperties);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyAnchorInfoPropertyChanged = function (subDocument, _objectId, property, newState) {
            this.pushPropertyRequest(subDocument.id, property, newState, __aspxRichEdit.CommandType.ChangeAnchorInfoProperty);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyShapeChanged = function (_subDocument, _objectId, _newState) {
        };
        ServerDispatcherModelChangesListener.prototype.NotifyShapePropertyChanged = function (subDocument, _objectId, property, newState) {
            this.pushPropertyRequest(subDocument.id, property, newState, __aspxRichEdit.CommandType.ChangeAnchoredObjectShapeProperty);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyIntervalRemoved = function (subDocument, position, length) {
            var params = {};
            params[__aspxRichEdit.JSONDeleteRunsCommandProperty.Position] = position;
            params[__aspxRichEdit.JSONDeleteRunsCommandProperty.Length] = length;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.DeleteRuns, subDocument.id, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifySectionMerged = function (subDocument, sectionIndex, getPropertiesFromNext) {
            var params = {};
            params[__aspxRichEdit.JSONMergeSectionsCommandProperty.SectionIndex] = sectionIndex;
            params[__aspxRichEdit.JSONMergeSectionsCommandProperty.GetPropertiesFromNext] = __aspxRichEdit.Utils.boolToInt(getPropertiesFromNext);
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.MergeSections, subDocument.id, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyParagraphMerged = function (subDocument, position, getPropertiesFromNext) {
            var params = {};
            params[__aspxRichEdit.JSONMergeParagraphsCommandProperty.Position] = position;
            params[__aspxRichEdit.JSONMergeParagraphsCommandProperty.GetPropertiesFromNext] = __aspxRichEdit.Utils.boolToInt(getPropertiesFromNext);
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.MergeParagraphs, subDocument.id, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyCharacterFormattingChanged = function (subDocument, property, newState) {
            if (property === __aspxRichEdit.JSONCharacterFormattingProperty.UseValue)
                this.pushStateBasedRequest(subDocument.id, newState, __aspxRichEdit.CommandType.ChangeCharacterPropertiesUseValue);
            else
                this.pushPropertyRequest(subDocument.id, property, newState, __aspxRichEdit.CommandType.ChangeCharacterProperty);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyCharacterPropertiesChanged = function (subDocument, newState) {
            this.pushStateBasedRequest(subDocument.id, newState, __aspxRichEdit.CommandType.ChangeCharacterProperties);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyTabInserted = function (subDocument, newState) {
            this.pushStateBasedRequest(subDocument.id, newState, __aspxRichEdit.CommandType.InsertTabToParagraph);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyTabDeleted = function (subDocument, newState) {
            this.pushStateBasedRequest(subDocument.id, newState, __aspxRichEdit.CommandType.DeleteTabAtParagraph);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyParagraphFormattingChanged = function (subDocument, property, newState) {
            if (property === __aspxRichEdit.JSONParagraphFormattingProperty.UseValue)
                this.pushStateBasedRequest(subDocument.id, newState, __aspxRichEdit.CommandType.ChangeParagraphPropertiesUseValue);
            else
                this.pushPropertyRequest(subDocument.id, property, newState, __aspxRichEdit.CommandType.ChangeParagraphProperty);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyParagraphPropertiesChanged = function (subDocument, paragraphIndex, properties, style, tabs, numberingListIndex, listLevelIndex) {
            var params = {};
            params[__aspxRichEdit.JSONParagraphPropertiesChangedProperty.ParagraphIndex] = paragraphIndex;
            params[__aspxRichEdit.JSONParagraphPropertiesChangedProperty.ParagraphProperties] = __aspxRichEdit.JSONMaskedParagraphPropertiesConverter.convertToJSON(properties);
            params[__aspxRichEdit.JSONParagraphPropertiesChangedProperty.ListLevelIndex] = listLevelIndex;
            params[__aspxRichEdit.JSONParagraphPropertiesChangedProperty.NumberingListIndex] = numberingListIndex;
            params[__aspxRichEdit.JSONParagraphPropertiesChangedProperty.StyleName] = style.styleName;
            var tabParams = [];
            for (var i = 0, tabInfo = void 0; tabInfo = tabs.tabsInfo[i]; i++)
                tabParams.push(__aspxRichEdit.JSONTabConverter.convertToJSON(tabInfo));
            params[__aspxRichEdit.JSONParagraphPropertiesChangedProperty.TabsProperties] = tabParams;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.ChangeParagraphProperties, subDocument.id, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifySectionFormattingChanged = function (_section, _sectionIndex, property, newState) {
            this.pushPropertyRequest(-1, property, newState, __aspxRichEdit.CommandType.ChangeSectionProperties);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyParagraphAndCharacterMergedPropertiesReset = function (_subDocument, _interval) {
        };
        ServerDispatcherModelChangesListener.prototype.NotifyTextBufferChanged = function (subDocument, newState) {
            this.dispatcher.pushRequest(new __aspxRichEdit.ClientServerTextBufferChangedCommandRequest(__aspxRichEdit.CommandType.ChangeTextBuffer, subDocument.id, newState, {}), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyCharacterStyleApplied = function (subDocument, newState) {
            this.pushStateBasedRequest(subDocument.id, newState, __aspxRichEdit.CommandType.ApplyCharacterStyle);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyParagraphStyleApplied = function (subDocument, newState) {
            this.pushStateBasedRequest(subDocument.id, newState, __aspxRichEdit.CommandType.ApplyParagraphStyle);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyParagraphNumberingListChanged = function (subDocument, newState, _oldAbstractNumberingListIndex) {
            this.pushStateBasedRequest(subDocument.id, newState, __aspxRichEdit.CommandType.ApplyNumberingList);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyAbstractNumberingListAdded = function (index) {
            var numberingList = this.dispatcher.control.model.abstractNumberingLists[index];
            var listLevelsInfo = [];
            for (var _i = 0, _a = numberingList.levels; _i < _a.length; _i++) {
                var listLevel = _a[_i];
                var levelInfo = {};
                levelInfo[__aspxRichEdit.JSONAddAbstractNumberingListCommandPropery.CharacterProperties] = __aspxRichEdit.JSONMaskedCharacterPropertiesConverter.convertToJSON(listLevel.getCharacterProperties());
                levelInfo[__aspxRichEdit.JSONAddAbstractNumberingListCommandPropery.ParagraphProperties] = __aspxRichEdit.JSONMaskedParagraphPropertiesConverter.convertToJSON(listLevel.getParagraphProperties());
                levelInfo[__aspxRichEdit.JSONAddAbstractNumberingListCommandPropery.ListLevelProperties] = __aspxRichEdit.JSONListLevelPropertiesConverter.convertToJSON(listLevel.getListLevelProperties());
                listLevelsInfo.push(levelInfo);
            }
            var params = {};
            params[__aspxRichEdit.JSONAddAbstractNumberingListCommandPropery.Deleted] = __aspxRichEdit.Utils.boolToInt(numberingList.deleted);
            params[__aspxRichEdit.JSONAddAbstractNumberingListCommandPropery.Levels] = listLevelsInfo;
            params[__aspxRichEdit.JSONAddAbstractNumberingListCommandPropery.InnerId] = numberingList.innerId;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.AddAbstractNumberingList, -1, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyAbstractNumberingListDeleted = function (index) {
            var params = {};
            params[__aspxRichEdit.JSONDeleteAbstractNumberingListCommandProperty.Index] = index;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.DeleteAbstractNumberingList, -1, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyNumberingListAdded = function (index) {
            var numberingList = this.dispatcher.control.model.numberingLists[index];
            var listLevelsInfo = [];
            for (var listLevel, i = 0; listLevel = numberingList.levels[i]; i++) {
                var levelInfo = {};
                if (listLevel instanceof __aspxRichEdit.OverrideListLevel) {
                    levelInfo[__aspxRichEdit.JSONAddAbstractNumberingListCommandPropery.CharacterProperties] = __aspxRichEdit.JSONMaskedCharacterPropertiesConverter.convertToJSON(listLevel.getCharacterProperties());
                    levelInfo[__aspxRichEdit.JSONAddAbstractNumberingListCommandPropery.ParagraphProperties] = __aspxRichEdit.JSONMaskedParagraphPropertiesConverter.convertToJSON(listLevel.getParagraphProperties());
                    levelInfo[__aspxRichEdit.JSONAddAbstractNumberingListCommandPropery.ListLevelProperties] = __aspxRichEdit.JSONListLevelPropertiesConverter.convertToJSON(listLevel.getListLevelProperties());
                }
                else {
                    levelInfo[__aspxRichEdit.JSONAddAbstractNumberingListCommandPropery.NewStart] = listLevel.getNewStart();
                }
                levelInfo[__aspxRichEdit.JSONAddAbstractNumberingListCommandPropery.OverrideStart] = __aspxRichEdit.Utils.boolToInt(listLevel.overrideStart);
                listLevelsInfo.push(levelInfo);
            }
            var params = {};
            params[__aspxRichEdit.JSONAddAbstractNumberingListCommandPropery.AbstractNumberingListIndex] = numberingList.abstractNumberingListIndex;
            params[__aspxRichEdit.JSONAddAbstractNumberingListCommandPropery.Deleted] = numberingList.deleted;
            params[__aspxRichEdit.JSONAddAbstractNumberingListCommandPropery.InnerId] = numberingList.innerId;
            params[__aspxRichEdit.JSONAddAbstractNumberingListCommandPropery.Levels] = listLevelsInfo;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.AddNumberingList, -1, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyNumberingListDeleted = function (index) {
            var params = {};
            params[__aspxRichEdit.JSONDeleteAbstractNumberingListCommandProperty.Index] = index;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.DeleteNumberingList, -1, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyListLevelPropertyChanged = function (property, newState) {
            this.pushPropertyRequest(-1, property, newState, __aspxRichEdit.CommandType.ChangeListLevelProperties);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyListLevelParagraphPropertyChanged = function (property, newState) {
            this.pushPropertyRequest(-1, property, newState, __aspxRichEdit.CommandType.ChangeListLevelParagraphProperties);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyListLevelCharacterPropertyChanged = function (property, newState) {
            this.pushPropertyRequest(-1, property, newState, __aspxRichEdit.CommandType.ChangeListLevelCharacterProperties);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyIOverrideListLevelChanged = function (property, newState) {
            this.pushPropertyRequest(-1, property, newState, __aspxRichEdit.CommandType.ChangeIOverrideListLevel);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyCreateStyleLink = function (paragraphStyleName) {
            var params = {};
            params[__aspxRichEdit.JSONStyleLinkCommandBaseProperty.StyleName] = paragraphStyleName;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.CreateStyleLink, -1, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyDeleteStyleLink = function (paragraphStyleName) {
            var params = {};
            params[__aspxRichEdit.JSONStyleLinkCommandBaseProperty.StyleName] = paragraphStyleName;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.DeleteStyleLink, -1, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyFieldInserted = function (subDocument, startPosition, separatorPosition, endPosition) {
            var params = {};
            params[__aspxRichEdit.JSONFieldProperty.StartPos] = startPosition;
            params[__aspxRichEdit.JSONFieldProperty.SeparatorPos] = separatorPosition;
            params[__aspxRichEdit.JSONFieldProperty.EndPos] = endPosition;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.InsertField, subDocument.id, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyFieldDeleted = function (subDocument, endPosition) {
            var params = {};
            params[__aspxRichEdit.JSONFieldProperty.EndPos] = endPosition;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.DeleteField, subDocument.id, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyHyperlinkInfoChanged = function (subDocument, fieldResultInterval, fieldCodeInterval, newHyperlinkInfo) {
            var params = {};
            params[__aspxRichEdit.JSONFieldProperty.StartPos] = fieldCodeInterval.start - 1;
            params[__aspxRichEdit.JSONFieldProperty.EndPos] = fieldResultInterval.end + 1;
            if (newHyperlinkInfo) {
                params[__aspxRichEdit.JSONFieldProperty.Uri] = newHyperlinkInfo.uri;
                params[__aspxRichEdit.JSONFieldProperty.Anchor] = newHyperlinkInfo.anchor;
                params[__aspxRichEdit.JSONFieldProperty.Tip] = newHyperlinkInfo.tip;
                params[__aspxRichEdit.JSONFieldProperty.Visited] = __aspxRichEdit.Utils.boolToInt(newHyperlinkInfo.visited);
            }
            else
                params[__aspxRichEdit.JSONFieldProperty.NoInfo] = 1;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.HyperlinkInfoChanged, subDocument.id, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyDefaultTabWidthChanged = function (defaultTabWidth) {
            var params = {};
            params[__aspxRichEdit.JSONModelPropertyProperty.DefaultTabWidth] = defaultTabWidth;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.ChangeDefaultTabWidth, -1, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyPageColorChanged = function (pageColor) {
            var params = {};
            params[__aspxRichEdit.JSONModelPropertyProperty.PageColor] = pageColor;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.ChangePageColor, -1, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyDifferentOddAndEvenPagesChanged = function (newValue) {
            var params = {};
            params[__aspxRichEdit.JSONModelPropertyProperty.OddEvenPages] = __aspxRichEdit.Utils.boolToInt(newValue);
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.ChangeDifferentOddAndEvenPages, -1, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyHeaderFooterCreated = function (isHeader, type, subDocumentInfo) {
            var params = {};
            params[__aspxRichEdit.JSONCreateHeaderFooterCommandBaseProperty.Type] = type;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(isHeader ? __aspxRichEdit.CommandType.CreateHeader : __aspxRichEdit.CommandType.CreateFooter, subDocumentInfo.subDocumentId, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyHeaderFooterIndexChanged = function (sectionIndex, isHeader, type, newIndex, _model) {
            var params = {};
            params[__aspxRichEdit.JSONChangeHeaderFooterIndexCommandBase.SectionIndex] = sectionIndex;
            params[__aspxRichEdit.JSONChangeHeaderFooterIndexCommandBase.NewObjectIndex] = newIndex;
            params[__aspxRichEdit.JSONChangeHeaderFooterIndexCommandBase.Type] = type;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(isHeader ? __aspxRichEdit.CommandType.ChangeHeaderIndex : __aspxRichEdit.CommandType.ChangeFooterIndex, -1, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyBookmarkCreated = function (subDocument, newState) {
            this.pushStateBasedRequest(subDocument.id, newState, __aspxRichEdit.CommandType.CreateBookmark);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyBookmarkDeleted = function (subDocument, newState) {
            this.pushStateBasedRequest(subDocument.id, newState, __aspxRichEdit.CommandType.DeleteBookmark);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyTableCreated = function (subDocument, table) {
            var params = {};
            params[__aspxRichEdit.JSONEnumClientTableInfo.Position] = table.getStartPosition();
            params[__aspxRichEdit.JSONEnumClientTableInfo.Rows] = JSONTableHelper.getJSONTableRows(table);
            params[__aspxRichEdit.JSONEnumClientTableInfo.TableInfo] = JSONTableHelper.getJSONTableInfo(table);
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.CreateTable, subDocument.id, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyTableRemoved = function (subDocument, startPosition, _endPosition, nestedLevel) {
            var params = {};
            params[__aspxRichEdit.JSONEnumClientTableInfo.TablePosition] = JSONTableHelper.tablePositionToJSONCore(startPosition, nestedLevel);
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.RemoveTable, subDocument.id, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyTableStartPositionShifted = function (subDocument, table, _oldPosition, newPosition) {
            var params = {};
            params[__aspxRichEdit.JSONEnumClientTableInfo.TablePosition] = JSONTableHelper.tablePositionToJSON(table);
            params[__aspxRichEdit.JSONEnumClientTableInfo.Position] = newPosition;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.ShiftTableStartPosition, subDocument.id, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyTableCellPropertyChanged = function (subDocument, property, newState) {
            var commandType;
            switch (property) {
                case __aspxRichEdit.JSONServerTableCellProperty.ColumnSpan:
                case __aspxRichEdit.JSONServerTableCellProperty.PreferredWidth:
                case __aspxRichEdit.JSONServerTableCellProperty.VerticalMerging:
                    commandType = __aspxRichEdit.CommandType.ChangeTableCell;
                    break;
                default:
                    commandType = __aspxRichEdit.CommandType.ChangeTableCellProperty;
                    break;
            }
            this.pushPropertyRequest(subDocument.id, property, newState, commandType);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyTablePropertyChanged = function (subDocument, property, newState) {
            var commandType;
            switch (property) {
                case __aspxRichEdit.JSONEnumTableProperty.PreferredWidth:
                case __aspxRichEdit.JSONEnumTableProperty.TableLookTypes:
                    commandType = __aspxRichEdit.CommandType.ChangeTable;
                    break;
                default:
                    commandType = __aspxRichEdit.CommandType.ChangeTableProperty;
            }
            this.pushPropertyRequest(subDocument.id, property, newState, commandType);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyTableRowPropertyChanged = function (subDocument, property, newState) {
            var commandType;
            switch (property) {
                case __aspxRichEdit.JSONServerTableRowProperty.GridAfter:
                case __aspxRichEdit.JSONServerTableRowProperty.GridBefore:
                case __aspxRichEdit.JSONServerTableRowProperty.Height:
                case __aspxRichEdit.JSONServerTableRowProperty.WidthAfter:
                case __aspxRichEdit.JSONServerTableRowProperty.WidthBefore:
                    commandType = __aspxRichEdit.CommandType.ChangeTableRow;
                    break;
                default:
                    commandType = __aspxRichEdit.CommandType.ChangeTableRowProperty;
                    break;
            }
            this.pushPropertyRequest(subDocument.id, property, newState, commandType);
        };
        ServerDispatcherModelChangesListener.prototype.NotifyTableCellSplittedHorizontally = function (subDocument, table, rowIndex, cellIndex, rightDirection) {
            var newCell = table.rows[rowIndex].cells[rightDirection ? (cellIndex + 1) : (cellIndex - 1)];
            var jsonCell = {};
            jsonCell[__aspxRichEdit.JSONEnumClientTableCellInfo.CellIndex] = rightDirection ? cellIndex : (cellIndex - 1);
            jsonCell[__aspxRichEdit.JSONEnumClientTableCellInfo.RightDirection] = __aspxRichEdit.Utils.boolToInt(rightDirection);
            jsonCell[__aspxRichEdit.JSONEnumClientTableCellInfo.CellInfo] = JSONTableHelper.getJSONTableCellInfo(newCell);
            var jsonRow = {};
            jsonRow[__aspxRichEdit.JSONEnumClientTableRowInfo.RowIndex] = rowIndex;
            jsonRow[__aspxRichEdit.JSONEnumClientTableRowInfo.Cells] = jsonCell;
            var params = {};
            params[__aspxRichEdit.JSONEnumClientTableInfo.TablePosition] = JSONTableHelper.tablePositionToJSON(table);
            params[__aspxRichEdit.JSONEnumClientTableInfo.Rows] = jsonRow;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.SplitTableCellHorizontally, subDocument.id, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyTableCellMergedHorizontally = function (subDocument, table, rowIndex, cellIndex, rightDirection) {
            var jsonCell = {};
            jsonCell[__aspxRichEdit.JSONEnumClientTableCellInfo.CellIndex] = rightDirection ? cellIndex : (cellIndex + 1);
            jsonCell[__aspxRichEdit.JSONEnumClientTableCellInfo.RightDirection] = __aspxRichEdit.Utils.boolToInt(rightDirection);
            var jsonRow = {};
            jsonRow[__aspxRichEdit.JSONEnumClientTableRowInfo.RowIndex] = rowIndex;
            jsonRow[__aspxRichEdit.JSONEnumClientTableRowInfo.Cells] = jsonCell;
            var params = {};
            params[__aspxRichEdit.JSONEnumClientTableInfo.TablePosition] = JSONTableHelper.tablePositionToJSON(table);
            params[__aspxRichEdit.JSONEnumClientTableInfo.Rows] = jsonRow;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.MergeTableCellHorizontally, subDocument.id, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyTableRowInserted = function (subDocument, table, rowIndex) {
            var row = table.rows[rowIndex];
            var jsonRow = {};
            jsonRow[__aspxRichEdit.JSONEnumClientTableRowInfo.RowIndex] = rowIndex;
            jsonRow[__aspxRichEdit.JSONEnumClientTableRowInfo.Cells] = JSONTableHelper.getJSONTableRowCells(row);
            jsonRow[__aspxRichEdit.JSONEnumClientTableRowInfo.RowInfo] = JSONTableHelper.getJSONTableRowInfo(row);
            var params = {};
            params[__aspxRichEdit.JSONEnumClientTableInfo.TablePosition] = JSONTableHelper.tablePositionToJSON(table);
            params[__aspxRichEdit.JSONEnumClientTableInfo.Rows] = jsonRow;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.InsertTableRow, subDocument.id, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyTableRowRemoved = function (subDocument, table, rowIndex) {
            var jsonRow = {};
            jsonRow[__aspxRichEdit.JSONEnumClientTableRowInfo.RowIndex] = rowIndex;
            var params = {};
            params[__aspxRichEdit.JSONEnumClientTableInfo.TablePosition] = JSONTableHelper.tablePositionToJSON(table);
            params[__aspxRichEdit.JSONEnumClientTableInfo.Rows] = jsonRow;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.RemoveTableRow, subDocument.id, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyTableCellRemoved = function (subDocument, table, rowIndex, cellIndex) {
            var jsonCell = {};
            jsonCell[__aspxRichEdit.JSONEnumClientTableCellInfo.CellIndex] = cellIndex;
            var jsonRow = {};
            jsonRow[__aspxRichEdit.JSONEnumClientTableRowInfo.RowIndex] = rowIndex;
            jsonRow[__aspxRichEdit.JSONEnumClientTableRowInfo.Cells] = jsonCell;
            var params = {};
            params[__aspxRichEdit.JSONEnumClientTableInfo.TablePosition] = JSONTableHelper.tablePositionToJSON(table);
            params[__aspxRichEdit.JSONEnumClientTableInfo.Rows] = jsonRow;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.RemoveTableCell, subDocument.id, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyTableCellInserted = function (subDocument, table, rowIndex, cellIndex) {
            var jsonRow = {};
            jsonRow[__aspxRichEdit.JSONEnumClientTableRowInfo.RowIndex] = rowIndex;
            jsonRow[__aspxRichEdit.JSONEnumClientTableRowInfo.Cells] = JSONTableHelper.getJSONTableCell(table.rows[rowIndex].cells[cellIndex], cellIndex);
            var params = {};
            params[__aspxRichEdit.JSONEnumClientTableInfo.TablePosition] = JSONTableHelper.tablePositionToJSON(table);
            params[__aspxRichEdit.JSONEnumClientTableInfo.Rows] = jsonRow;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.InsertTableCell, subDocument.id, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyTableStyleChanged = function (subDocument, table, newStyle) {
            var jsonTableInfo = {};
            jsonTableInfo[__aspxRichEdit.JSONEnumClientTableFormatting.StyleName] = newStyle ? newStyle.styleName : null;
            var params = {};
            params[__aspxRichEdit.JSONEnumClientTableInfo.TablePosition] = JSONTableHelper.tablePositionToJSON(table);
            params[__aspxRichEdit.JSONEnumClientTableInfo.TableInfo] = jsonTableInfo;
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.ApplyTableStyle, subDocument.id, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.NotifyLoadFontInfo = function (fontInfo, fontIndex) {
            var jsonFontInfo = {};
            jsonFontInfo[__aspxRichEdit.JSONFontInfoProperty.Name] = fontInfo.name;
            var params = {};
            params[__aspxRichEdit.JSONLoadFontInfoCommand.FontInfo] = jsonFontInfo;
            params[__aspxRichEdit.JSONLoadFontInfoCommand.FontInfoIndex] = fontIndex;
            this.dispatcher.pushRequest(new __aspxRichEdit.LoadCommandRequest(__aspxRichEdit.CommandType.LoadFontInfo, -1, params), new __aspxRichEdit.RequestParams(false, true, false));
        };
        ServerDispatcherModelChangesListener.prototype.pushPropertyRequest = function (subDocumentId, property, newState, commandType) {
            var params = {};
            params[__aspxRichEdit.JSONPropertyStateBasedCommand.Property] = property;
            params[__aspxRichEdit.JSONPropertyStateBasedCommand.State] = newState.toJSON();
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(commandType, subDocumentId, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        ServerDispatcherModelChangesListener.prototype.pushStateBasedRequest = function (subDocumentId, newState, commandType) {
            var params = {};
            params[__aspxRichEdit.JSONPropertyStateBasedCommand.State] = newState.toJSON();
            this.dispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(commandType, subDocumentId, params), new __aspxRichEdit.RequestParams(false, false, false));
        };
        return ServerDispatcherModelChangesListener;
    }());
    __aspxRichEdit.ServerDispatcherModelChangesListener = ServerDispatcherModelChangesListener;
    var JSONTableHelper = (function () {
        function JSONTableHelper() {
        }
        JSONTableHelper.tablePositionToJSON = function (table) {
            return JSONTableHelper.tablePositionToJSONCore(table.getStartPosition(), table.nestedLevel);
        };
        JSONTableHelper.tablePositionToJSONCore = function (startPosition, nestedLevel) {
            var param = {};
            param[__aspxRichEdit.JSONEnumClientTablePosition.ParagraphStartPosition] = startPosition;
            param[__aspxRichEdit.JSONEnumClientTablePosition.NestedLevel] = nestedLevel;
            return param;
        };
        JSONTableHelper.getJSONTableInfo = function (table) {
            var jsonTable = {};
            jsonTable[__aspxRichEdit.JSONEnumClientTableFormatting.TableProperties] = __aspxRichEdit.JSONTablePropertiesConverter.convertToJSON(table.properties);
            jsonTable[__aspxRichEdit.JSONEnumClientTableFormatting.PreferredWidth] = __aspxRichEdit.JSONTableWidthUnitConverter.convertToJSON(table.preferredWidth);
            jsonTable[__aspxRichEdit.JSONEnumClientTableFormatting.LookTypes] = table.lookTypes;
            jsonTable[__aspxRichEdit.JSONEnumClientTableFormatting.StyleName] = table.style.styleName;
            return jsonTable;
        };
        JSONTableHelper.getJSONTableRows = function (table) {
            var jsonRows = [];
            for (var _i = 0, _a = table.rows; _i < _a.length; _i++) {
                var row = _a[_i];
                var jsonRow = {};
                jsonRow[__aspxRichEdit.JSONEnumClientTableRowInfo.Cells] = JSONTableHelper.getJSONTableRowCells(row);
                jsonRow[__aspxRichEdit.JSONEnumClientTableRowInfo.RowInfo] = JSONTableHelper.getJSONTableRowInfo(row);
                jsonRows.push(jsonRow);
            }
            return jsonRows;
        };
        JSONTableHelper.getJSONTableRowInfo = function (row) {
            var jsonRowInfo = {};
            jsonRowInfo[__aspxRichEdit.JSONEnumClientTableRowFormatting.GridAfter] = row.gridAfter;
            jsonRowInfo[__aspxRichEdit.JSONEnumClientTableRowFormatting.GridBefore] = row.gridBefore;
            jsonRowInfo[__aspxRichEdit.JSONEnumClientTableRowFormatting.Height] = __aspxRichEdit.JSONTableHeightUnitConverter.convertToJSON(row.height);
            jsonRowInfo[__aspxRichEdit.JSONEnumClientTableRowFormatting.TableRowProperties] = __aspxRichEdit.JSONTableRowPropertiesConverter.convertToJSON(row.properties);
            jsonRowInfo[__aspxRichEdit.JSONEnumClientTableRowFormatting.TablePropertiesException] = __aspxRichEdit.JSONTablePropertiesConverter.convertToJSON(row.tablePropertiesException);
            jsonRowInfo[__aspxRichEdit.JSONEnumClientTableRowFormatting.WidthBefore] = __aspxRichEdit.JSONTableWidthUnitConverter.convertToJSON(row.widthBefore);
            jsonRowInfo[__aspxRichEdit.JSONEnumClientTableRowFormatting.WidthAfter] = __aspxRichEdit.JSONTableWidthUnitConverter.convertToJSON(row.widthAfter);
            return jsonRowInfo;
        };
        JSONTableHelper.getJSONTableRowCells = function (row) {
            var jsonCells = [];
            for (var _i = 0, _a = row.cells; _i < _a.length; _i++) {
                var cell = _a[_i];
                jsonCells.push(JSONTableHelper.getJSONTableCell(cell, -1));
            }
            return jsonCells;
        };
        JSONTableHelper.getJSONTableCell = function (cell, cellIndex) {
            var jsonCell = {};
            if (cellIndex >= 0)
                jsonCell[__aspxRichEdit.JSONEnumClientTableCellInfo.CellIndex] = cellIndex;
            jsonCell[__aspxRichEdit.JSONEnumClientTableCellInfo.CellInfo] = JSONTableHelper.getJSONTableCellInfo(cell);
            jsonCell[__aspxRichEdit.JSONEnumClientTableCellInfo.StartCellPosition] = cell.startParagraphPosition.value;
            jsonCell[__aspxRichEdit.JSONEnumClientTableCellInfo.EndCellPosition] = cell.endParagrapPosition.value;
            return jsonCell;
        };
        JSONTableHelper.getJSONTableCellInfo = function (cell) {
            var jsonCellInfo = {};
            jsonCellInfo[__aspxRichEdit.JSONEnumClientTableCellFormatting.ColumnSpan] = cell.columnSpan;
            jsonCellInfo[__aspxRichEdit.JSONEnumClientTableCellFormatting.CellProperties] = __aspxRichEdit.JSONTableCellPropertiesConverter.convertToJSON(cell.properties);
            jsonCellInfo[__aspxRichEdit.JSONEnumClientTableCellFormatting.PreferredWidth] = __aspxRichEdit.JSONTableWidthUnitConverter.convertToJSON(cell.preferredWidth);
            jsonCellInfo[__aspxRichEdit.JSONEnumClientTableCellFormatting.VerticalMerging] = cell.verticalMerging;
            return jsonCellInfo;
        };
        return JSONTableHelper;
    }());
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ServerDispatcherResponseProcessor = (function () {
        function ServerDispatcherResponseProcessor() {
        }
        ServerDispatcherResponseProcessor.processCommandResponce = function (dispatcher, commandType, isNewWorkSession, jsonServerParams, jsonCacheData) {
            var control = dispatcher.control;
            if (isNewWorkSession)
                ServerDispatcherResponseProcessor.processNewWorkSessionResponse(dispatcher, jsonServerParams);
            var model = control.model;
            var docIsLoaded = model.mainSubDocument.getLastChunk() && model.isLoaded();
            var cachesExporter = new __aspxRichEdit.WebCachesExporter(model.cache, jsonCacheData, model);
            var isNewDocument = isNewWorkSession ? jsonServerParams[__aspxRichEdit.JSONInitSessionProperty.IsNewDocument] : false;
            switch (commandType) {
                case __aspxRichEdit.CommandType.StartCommand:
                    __aspxRichEdit.JSONImporter.importOptions(model.options, jsonServerParams[__aspxRichEdit.JSONInitSessionProperty.Options]);
                    __aspxRichEdit.JSONImporter.importStringResources(control.stringResources, jsonServerParams[__aspxRichEdit.JSONInitSessionProperty.StringResources]);
                    break;
                case __aspxRichEdit.CommandType.SaveAsDocument:
                case __aspxRichEdit.CommandType.SaveDocument:
                    dispatcher.processSaveResponse(jsonServerParams[__aspxRichEdit.JSONInitSessionProperty.HistoryId]);
                    break;
                case __aspxRichEdit.CommandType.DelayedPrint:
                    control.owner.sendDownloadRequest(__aspxRichEdit.DownloadRequestType.PrintCurrentDocument);
                    break;
                case __aspxRichEdit.CommandType.LoadInlinePictures:
                    var subDocument = model.subDocuments[jsonServerParams[__aspxRichEdit.JSONLoadInlinePictureCommand.SubDocumentId]];
                    if (subDocument)
                        control.modelManipulator.text.applyImagesLoadedOnPaste(subDocument, jsonServerParams[__aspxRichEdit.JSONLoadInlinePictureCommand.LoadedImagesInfo]);
                    break;
                case __aspxRichEdit.CommandType.FieldUpdate:
                    control.modelManipulator.fieldsManipulator.continueUpdateFields(control, jsonServerParams);
                    break;
                case __aspxRichEdit.CommandType.LoadFontInfo:
                    control.modelManipulator.text.applyFontInfoLoadedOnPaste(control, control.model.cache.fontInfoCache.getItemByJsonKey(jsonServerParams[__aspxRichEdit.JSONLoadFontInfoCommand.FontInfoIndex]), jsonCacheData[__aspxRichEdit.JSONCachesDataProperty.FontInfoCache]);
                    break;
                case __aspxRichEdit.CommandType.CheckSpelling:
                    control.spellChecker.processResponse(jsonServerParams[__aspxRichEdit.JSONCheckSpellingCommand.CheckedIntervals]);
                    break;
                case __aspxRichEdit.CommandType.InsertRtf:
                    control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.InsertRtf).handleResponce(jsonServerParams);
                    break;
                case __aspxRichEdit.CommandType.GetRtf:
                    control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.GetRtf).handleResponce(jsonServerParams);
                    break;
                case __aspxRichEdit.CommandType.RequestModelAfterHibernation:
                    ServerDispatcherResponseProcessor.processAfterHibernationResponce(dispatcher, cachesExporter);
                    break;
                case __aspxRichEdit.CommandType.ForceSyncWithServer:
                    control.model.forceSyncWithServerCallbackManager.handleResponce(jsonServerParams);
                    break;
                case __aspxRichEdit.CommandType.InsertContentFromServer:
                    control.model.insertContentFromServerRequestManager.handleResponce(control, jsonServerParams);
                    break;
                case __aspxRichEdit.CommandType.DownloadMergedDocument:
                    var base64 = jsonServerParams[__aspxRichEdit.JSONInitSessionProperty.Document];
                    var format = jsonServerParams[__aspxRichEdit.JSONInitSessionProperty.DocumentFormat];
                    this.processDocumentDownload(base64, format);
                    break;
            }
            if (isNewDocument)
                ServerDispatcherResponseProcessor.processNewDocumentResponse(model, null, jsonServerParams[__aspxRichEdit.JSONInitSessionProperty.Document]);
            cachesExporter.importSubDocuments(control.documentProtectionSettings);
            if (isNewDocument) {
                control.layoutFormatterManager.openDocument();
                control.layout.pageColor = model.pageBackColor;
                control.layoutFormatterManager.forceFormatPage(0);
                control.inputPosition.reset();
                control.barManager.setEnabled(true);
                control.horizontalRulerControl.setEnable(true);
                control.selection.deprecatedSetSelection(0, 0, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes, true, true, __aspxRichEdit.ModelScrollManager.DontChangeScrollPosition);
                control.selection.raiseSelectionChanged();
                control.spellChecker.check();
            }
            control.layoutFormatterManager.runFormattingAsync();
            if (!model.isLoaded()) {
            }
            else if (docIsLoaded !== model.isLoaded())
                this.processDocumentLoaded(control);
            if (isNewDocument && !!jsonServerParams[__aspxRichEdit.JSONInitSessionProperty.InvalidDocument])
                control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowErrorInvalidDocumentFormat).execute(control.commandManager.isPublicApiCall);
            cachesExporter.dispose();
        };
        ServerDispatcherResponseProcessor.processDocumentLoaded = function (control) {
            for (var _i = 0, _a = control.model.mainSubDocument.fields; _i < _a.length; _i++) {
                var field = _a[_i];
                var fieldParser = __aspxRichEdit.FieldParserFabric.getParser(control, control.model.mainSubDocument, field);
                if (fieldParser)
                    fieldParser.updateInfo();
            }
            control.clientSideEvents.raiseDocumentLoaded();
        };
        ServerDispatcherResponseProcessor.processNewDocumentResponse = function (documentModel, imageCorrespondence, obj) {
            __aspxRichEdit.JSONImporter.importDocumentProperties(documentModel, obj[__aspxRichEdit.JSONDocumentModelProperty.DocumentProperties]);
            __aspxRichEdit.JSONImporter.importCompatibilitySettings(documentModel, obj[__aspxRichEdit.JSONDocumentModelProperty.CompatibilitySettings]);
            __aspxRichEdit.JSONStylesExporter.importStyles(documentModel, obj[__aspxRichEdit.JSONDocumentModelProperty.Styles]);
            __aspxRichEdit.JSONImporter.importModelHeaderFooter(documentModel.headers, obj[__aspxRichEdit.JSONDocumentModelProperty.Headers], __aspxRichEdit.HeaderSubDocumentInfo);
            __aspxRichEdit.JSONImporter.importModelHeaderFooter(documentModel.footers, obj[__aspxRichEdit.JSONDocumentModelProperty.Footers], __aspxRichEdit.FooterSubDocumentInfo);
            __aspxRichEdit.JSONImporter.importSections(documentModel, obj[__aspxRichEdit.JSONDocumentModelProperty.Sections]);
            __aspxRichEdit.JSONNumberingListImporter.importAbstractNumberingLists(documentModel, obj[__aspxRichEdit.JSONDocumentModelProperty.AbstractNumberingLists]);
            __aspxRichEdit.JSONNumberingListImporter.importNumberingLists(documentModel, obj[__aspxRichEdit.JSONDocumentModelProperty.NumberingLists]);
            __aspxRichEdit.JSONNumberingListImporter.importAbstractNumberingListTemplates(documentModel, obj[__aspxRichEdit.JSONDocumentModelProperty.AbstractNumberingListTemplates]);
            __aspxRichEdit.JSONImporter.importImages(documentModel.cache.imageCache, imageCorrespondence, obj[__aspxRichEdit.JSONDocumentModelProperty.Images]);
            var paletteColors = obj[__aspxRichEdit.JSONDocumentModelProperty.PaletteColors];
            for (var index in paletteColors) {
                if (!paletteColors.hasOwnProperty(index))
                    continue;
                documentModel.colorProvider.palette.setColor(parseInt(index), paletteColors[index]);
            }
            var officeThemeColors = obj[__aspxRichEdit.JSONDocumentModelProperty.OfficeThemeColors];
            for (var index in officeThemeColors) {
                if (!officeThemeColors.hasOwnProperty(index))
                    continue;
                documentModel.colorProvider.officeTheme.colors.setDrawingColor(parseInt(index), __aspxRichEdit.JSONDrawingColorConverter.convertFromJSON(officeThemeColors[index]));
            }
        };
        ServerDispatcherResponseProcessor.processNewWorkSessionResponse = function (dispatcher, obj) {
            var sessionGuid = obj[__aspxRichEdit.JSONInitSessionProperty.SessionGuid];
            var documentInfo = new __aspxRichEdit.DocumentInfo(obj[__aspxRichEdit.JSONInitSessionProperty.FileName], obj[__aspxRichEdit.JSONInitSessionProperty.DocumentHasSource]);
            if (!!obj[__aspxRichEdit.JSONInitSessionProperty.IsNewDocument])
                dispatcher.control.initialize(sessionGuid, documentInfo, obj[__aspxRichEdit.JSONInitSessionProperty.EmptyImageCacheID], obj[__aspxRichEdit.JSONInitSessionProperty.SubDocumentsCounter], null);
            else
                dispatcher.control.setWorkSession(sessionGuid, documentInfo, obj[__aspxRichEdit.JSONInitSessionProperty.LastExecutedEditCommandId]);
            dispatcher.editRequestID = obj[__aspxRichEdit.JSONInitSessionProperty.LastExecutedEditCommandId];
            dispatcher.wasModifiedOnServer = !!obj[__aspxRichEdit.JSONInitSessionProperty.IsModified];
        };
        ServerDispatcherResponseProcessor.processAfterHibernationResponce = function (dispatcher, cachesExporter) {
            var control = dispatcher.control;
            var result = {};
            var jsonModel = {};
            jsonModel[__aspxRichEdit.JSONDocumentModelProperty.DocumentProperties] = __aspxRichEdit.JSONExporter.exportDocumentProperties(control.model);
            jsonModel[__aspxRichEdit.JSONDocumentModelProperty.Styles] = __aspxRichEdit.JSONStylesExporter.exportStyles(control.model);
            jsonModel[__aspxRichEdit.JSONDocumentModelProperty.Sections] = __aspxRichEdit.JSONExporter.exportSections(control.model);
            jsonModel[__aspxRichEdit.JSONDocumentModelProperty.AbstractNumberingLists] =
                __aspxRichEdit.JSONNumberingListExporter.exportAbstractNumberingLists(control.model);
            jsonModel[__aspxRichEdit.JSONDocumentModelProperty.NumberingLists] =
                __aspxRichEdit.JSONNumberingListExporter.exportNumberingLists(control.model);
            jsonModel[__aspxRichEdit.JSONDocumentModelProperty.Headers] = __aspxRichEdit.JSONExporter.exportModelHeaderFooter(control.model.headers);
            jsonModel[__aspxRichEdit.JSONDocumentModelProperty.Footers] = __aspxRichEdit.JSONExporter.exportModelHeaderFooter(control.model.footers);
            jsonModel[__aspxRichEdit.JSONDocumentModelProperty.AbstractNumberingListTemplates] =
                __aspxRichEdit.JSONNumberingListExporter.exportAbstractNumberingListTemplates(control.model);
            var jsonCaches = {};
            jsonCaches[__aspxRichEdit.JSONCachesDataProperty.CharacterPropertiesCache] =
                control.model.cache.maskedCharacterPropertiesCache.convertToJSON(__aspxRichEdit.JSONMaskedCharacterPropertiesConverter.convertToJSON);
            jsonCaches[__aspxRichEdit.JSONCachesDataProperty.ParagraphPropertiesCache] =
                control.model.cache.maskedParagraphPropertiesCache.convertToJSON(__aspxRichEdit.JSONMaskedParagraphPropertiesConverter.convertToJSON);
            jsonCaches[__aspxRichEdit.JSONCachesDataProperty.ListLevelPropertiesCache] =
                control.model.cache.listLevelPropertiesCache.convertToJSON(__aspxRichEdit.JSONListLevelPropertiesConverter.convertToJSON);
            jsonCaches[__aspxRichEdit.JSONCachesDataProperty.TableRowPropertiesCache] =
                control.model.cache.tableRowPropertiesCache.convertToJSON(__aspxRichEdit.JSONTableRowPropertiesConverter.convertToJSON);
            jsonCaches[__aspxRichEdit.JSONCachesDataProperty.TableCellPropertiesCache] =
                control.model.cache.tableCellPropertiesCache.convertToJSON(__aspxRichEdit.JSONTableCellPropertiesConverter.convertToJSON);
            jsonCaches[__aspxRichEdit.JSONCachesDataProperty.SubDocuments] = cachesExporter.exportSubDocuments();
            jsonCaches[__aspxRichEdit.JSONCachesDataProperty.FontInfoCache] =
                control.model.cache.fontInfoCache.convertToJSON(__aspxRichEdit.JSONFontInfoConverter.convertToJSON);
            result[__aspxRichEdit.JSONInitSessionProperty.Document] = jsonModel;
            result[__aspxRichEdit.JSONInitSessionProperty.Caches] = jsonCaches;
            result[__aspxRichEdit.JSONInitSessionProperty.Options] = __aspxRichEdit.JSONExporter.exportOptions(control.options);
            result[__aspxRichEdit.JSONInitSessionProperty.StringResources] = __aspxRichEdit.JSONExporter.exportStringResources(control.stringResources);
            return result;
        };
        ServerDispatcherResponseProcessor.insertDocumentModelFromServer = function (control, response, insertToPos, insertToSubDocumentId, removeInterval) {
            var model = control.model;
            var newDocumentModel = new __aspxRichEdit.DocumentModel(model.options, 0);
            newDocumentModel.cache.fontInfoCache = model.cache.fontInfoCache;
            newDocumentModel.cache.imageCache = model.cache.imageCache;
            var cachesExporter = new __aspxRichEdit.WebCachesExporter(newDocumentModel.cache, response[__aspxRichEdit.JSONUpdateFieldCommandResult.Caches], newDocumentModel);
            var imageCorrespondence = response[__aspxRichEdit.JSONUpdateFieldCommandResult.ImageCorrespondence];
            ServerDispatcherResponseProcessor.processNewDocumentResponse(newDocumentModel, imageCorrespondence, response[__aspxRichEdit.JSONUpdateFieldCommandResult.DocumentModel]);
            cachesExporter.importSubDocuments(control.documentProtectionSettings, function (run) {
                var runType = run.getType();
                if (runType == __aspxRichEdit.RunType.InlinePictureRun || runType == __aspxRichEdit.RunType.AnchoredPictureRun) {
                    var picRun = run;
                    picRun.id = imageCorrespondence[picRun.id];
                }
            });
            var subDocument = model.subDocuments[insertToSubDocumentId];
            if (removeInterval)
                __aspxRichEdit.ModelManipulator.removeInterval(control, subDocument, removeInterval, false, true);
            __aspxRichEdit.ModelManipulator.insertSubDocument(control, subDocument, insertToPos, newDocumentModel.activeSubDocument, new __aspxRichEdit.FixedInterval(0, response[__aspxRichEdit.JSONUpdateFieldCommandResult.DocumentLength]));
            cachesExporter.dispose();
        };
        ServerDispatcherResponseProcessor.processDocumentDownload = function (base64, format) {
            base64 = atob(base64);
            var n = base64.length, arr = new Uint8Array(n);
            while (n--)
                arr[n] = base64.charCodeAt(n);
            var fileName = "MergedDocument" + __aspxRichEdit.FileNameHelper.convertToString(format);
            var file = (new Blob([arr]));
            if (window.navigator.msSaveOrOpenBlob)
                window.navigator.msSaveOrOpenBlob(file, fileName);
            else {
                var a_1 = document.createElement('a');
                var url_1 = URL.createObjectURL(file);
                a_1.href = url_1;
                a_1.download = fileName;
                document.body.appendChild(a_1);
                a_1.click();
                setTimeout(function () {
                    document.body.removeChild(a_1);
                    window.URL.revokeObjectURL(url_1);
                }, 0);
            }
        };
        return ServerDispatcherResponseProcessor;
    }());
    __aspxRichEdit.ServerDispatcherResponseProcessor = ServerDispatcherResponseProcessor;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var WebCachesExporter = (function () {
        function WebCachesExporter(cache, caches, documentModel) {
            this.documentModel = documentModel;
            this.cache = cache;
            var fontInfoCache = caches[__aspxRichEdit.JSONCachesDataProperty.FontInfoCache];
            var charPropsCache = caches[__aspxRichEdit.JSONCachesDataProperty.CharacterPropertiesCache];
            var parPropsCache = caches[__aspxRichEdit.JSONCachesDataProperty.ParagraphPropertiesCache];
            var listLevelPropsCache = caches[__aspxRichEdit.JSONCachesDataProperty.ListLevelPropertiesCache];
            var tableRowPropsCache = caches[__aspxRichEdit.JSONCachesDataProperty.TableRowPropertiesCache];
            var tableCellPropsCache = caches[__aspxRichEdit.JSONCachesDataProperty.TableCellPropertiesCache];
            var colorModelInfoCache = caches[__aspxRichEdit.JSONCachesDataProperty.ColorModelInfoCache];
            var shadingInfoCache = caches[__aspxRichEdit.JSONCachesDataProperty.ShadingInfoCache];
            if (fontInfoCache)
                cache.fontInfoCache.merge(fontInfoCache, __aspxRichEdit.JSONFontInfoConverter.convertFromJSON);
            if (colorModelInfoCache)
                cache.colorModelInfoCache.merge(colorModelInfoCache, __aspxRichEdit.JSONColorModelInfoConverter.convertFromJSON);
            if (shadingInfoCache)
                cache.shadingInfoCache.merge(shadingInfoCache, function (obj) { return __aspxRichEdit.JSONShadingInfoConverter.convertFromJSON(obj, cache.colorModelInfoCache); });
            if (charPropsCache)
                cache.maskedCharacterPropertiesCache.merge(charPropsCache, function (property) { return __aspxRichEdit.JSONMaskedCharacterPropertiesConverter.convertFromJSON(property, cache.colorModelInfoCache, cache.shadingInfoCache, cache.fontInfoCache); });
            if (parPropsCache)
                cache.maskedParagraphPropertiesCache.merge(parPropsCache, function (property) { return __aspxRichEdit.JSONMaskedParagraphPropertiesConverter.convertFromJSON(property, cache.colorModelInfoCache, cache.shadingInfoCache); });
            if (listLevelPropsCache)
                cache.listLevelPropertiesCache.merge(listLevelPropsCache, __aspxRichEdit.JSONListLevelPropertiesConverter.convertFromJSON);
            if (tableRowPropsCache)
                cache.tableRowPropertiesCache.merge(tableRowPropsCache, __aspxRichEdit.JSONTableRowPropertiesConverter.convertFromJSON);
            if (tableCellPropsCache)
                cache.tableCellPropertiesCache.merge(tableCellPropsCache, function (property) { return __aspxRichEdit.JSONTableCellPropertiesConverter.convertFromJSON(property, cache.colorModelInfoCache, cache.shadingInfoCache); });
            this.jsonSubDocs = caches[__aspxRichEdit.JSONCachesDataProperty.SubDocuments];
        }
        WebCachesExporter.prototype.importSubDocuments = function (documentProtectionSettings, customRunAction) {
            for (var key in this.jsonSubDocs) {
                if (!this.jsonSubDocs.hasOwnProperty(key))
                    continue;
                var subDocumentId = parseInt(key);
                var jsonSubDoc = this.jsonSubDocs[key];
                var subDocType = jsonSubDoc[__aspxRichEdit.JSONPieceTableInfo.Type];
                var info = void 0;
                switch (subDocType) {
                    case __aspxRichEdit.SubDocumentInfoType.Header:
                        info = WebCachesExporter.getInfoBySubDocumentId(this.documentModel.headers, subDocumentId);
                        break;
                    case __aspxRichEdit.SubDocumentInfoType.Footer:
                        info = WebCachesExporter.getInfoBySubDocumentId(this.documentModel.footers, subDocumentId);
                        break;
                    case __aspxRichEdit.SubDocumentInfoType.Main:
                        info = __aspxRichEdit.SubDocumentInfoBase.create(subDocType, subDocumentId, -1);
                        break;
                    case __aspxRichEdit.SubDocumentInfoType.TextBox:
                        info = __aspxRichEdit.SubDocumentInfoBase.create(subDocType, subDocumentId, jsonSubDoc[__aspxRichEdit.JSONPieceTableInfo.ParentPieceTableId]);
                        break;
                    default:
                        throw new Error("Unknown subDocumentType");
                }
                var subDocument = info.isMain ? this.documentModel.mainSubDocument : this.documentModel.importSubDocument(info);
                var jsonSubDocStructures = jsonSubDoc[__aspxRichEdit.JSONPieceTableInfo.Info];
                __aspxRichEdit.JSONSubDocumentImporter.importSubDocument(subDocument, documentProtectionSettings, jsonSubDocStructures, customRunAction);
            }
        };
        WebCachesExporter.prototype.exportSubDocuments = function () {
            var subDocuments = this.documentModel.subDocuments;
            var jsonSubDocuments = [];
            for (var key in subDocuments) {
                if (subDocuments.hasOwnProperty(key)) {
                    var jsonSubDocument = [];
                    __aspxRichEdit.JSONSubDocumentExporter.exportSubDocument(subDocuments[key], jsonSubDocument);
                    jsonSubDocuments.push(jsonSubDocument);
                }
            }
            return jsonSubDocuments;
        };
        WebCachesExporter.getInfoBySubDocumentId = function (infos, subDocumentId) {
            for (var _i = 0, infos_1 = infos; _i < infos_1.length; _i++) {
                var info = infos_1[_i];
                if (info.subDocumentId === subDocumentId)
                    return info;
            }
            throw new Error(__aspxRichEdit.Errors.InternalException);
        };
        WebCachesExporter.prototype.dispose = function () {
            this.cache.clearTemporaryCaches();
        };
        return WebCachesExporter;
    }());
    __aspxRichEdit.WebCachesExporter = WebCachesExporter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ModelPositionHolder = (function () {
        function ModelPositionHolder(pos, posManager) {
            this.pos = posManager.registerPosition(pos);
            this.posManager = posManager;
        }
        Object.defineProperty(ModelPositionHolder.prototype, "modelPosition", {
            get: function () {
                return this.pos.value;
            },
            enumerable: true,
            configurable: true
        });
        ModelPositionHolder.prototype.destructor = function () {
            this.posManager.unregisterPosition(this.pos);
        };
        return ModelPositionHolder;
    }());
    __aspxRichEdit.ModelPositionHolder = ModelPositionHolder;
    var AnchorObjectsPositionInfo = (function () {
        function AnchorObjectsPositionInfo(model) {
            this.model = model;
            this.cache = {};
        }
        AnchorObjectsPositionInfo.prototype.add = function (obj, modelPosition) {
            this.delete(obj.objectId);
            this.cache[obj.objectId] = new ModelPositionHolder(modelPosition, this.model.subDocuments[obj.belongsToSubDocId].positionManager);
        };
        AnchorObjectsPositionInfo.prototype.delete = function (id) {
            var info = this.cache[id];
            if (info) {
                info.destructor();
                delete this.cache[id];
            }
        };
        AnchorObjectsPositionInfo.prototype.getPosition = function (objectId) {
            return this.cache[objectId].modelPosition;
        };
        AnchorObjectsPositionInfo.prototype.clear = function () {
            __aspxRichEdit.MapUtilsKeyAsNumber.foreach(this.cache, function (posInfo) { return posInfo.destructor(); });
            this.cache = {};
        };
        return AnchorObjectsPositionInfo;
    }());
    __aspxRichEdit.AnchorObjectsPositionInfo = AnchorObjectsPositionInfo;
    var DocumentLayout = (function () {
        function DocumentLayout(anchorObjectsPositionInfo) {
            this.anchorObjectsPositionInfo = anchorObjectsPositionInfo;
            this.setEmptyLayout(__aspxRichEdit.ColorHelper.NO_COLOR);
        }
        DocumentLayout.prototype.setEmptyLayout = function (pageColor) {
            this.pages = [];
            this.validPageCount = 0;
            this.lastMaxNumPages = 0;
            this.isFullyFormatted = false;
            this.pageColor = pageColor;
            this.anchorObjectsPositionInfo.clear();
        };
        DocumentLayout.prototype.getLastValidPage = function () {
            return this.pages[this.validPageCount - 1];
        };
        DocumentLayout.prototype.isPageValid = function (pageIndex) {
            return pageIndex < this.validPageCount && this.pages[pageIndex].isValid;
        };
        return DocumentLayout;
    }());
    __aspxRichEdit.DocumentLayout = DocumentLayout;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutAnchorObjectFinder = (function () {
        function LayoutAnchorObjectFinder(layout, pos, subDocId, findOnlyOnPage) {
            var pageIndex;
            var pageIndexEnd;
            if (findOnlyOnPage === undefined) {
                pageIndex = 0;
                pageIndexEnd = layout.validPageCount;
            }
            else {
                pageIndex = findOnlyOnPage;
                pageIndexEnd = Math.min(findOnlyOnPage + 1, layout.validPageCount);
            }
            for (var page = void 0; (page = layout.pages[pageIndex]) && pageIndex < pageIndexEnd; pageIndex++)
                for (var _i = 0, _a = page.anchoredObjectHolder.getObjectsForRenderer(layout.anchorObjectsPositionInfo); _i < _a.length; _i++) {
                    var obj = _a[_i];
                    if (layout.anchorObjectsPositionInfo.getPosition(obj.objectId) == pos && obj.belongsToSubDocId === subDocId) {
                        this.page = page;
                        this.obj = obj;
                        return;
                    }
                }
        }
        return LayoutAnchorObjectFinder;
    }());
    __aspxRichEdit.LayoutAnchorObjectFinder = LayoutAnchorObjectFinder;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var PageIndexAndInterval = (function () {
        function PageIndexAndInterval(pageIndex, interval) {
            this.interval = interval;
            this.pageIndex = pageIndex;
        }
        return PageIndexAndInterval;
    }());
    var LayoutPositionCreatorConflictFlags = (function () {
        function LayoutPositionCreatorConflictFlags() {
        }
        LayoutPositionCreatorConflictFlags.prototype.setDefault = function (defaultVal) {
            this.left = defaultVal;
            this.middle = defaultVal;
            this.right = defaultVal;
            this.simple = defaultVal;
            return this;
        };
        LayoutPositionCreatorConflictFlags.prototype.setCustom = function (left, middle, right, simple) {
            this.left = left;
            this.middle = middle;
            this.right = right;
            this.simple = simple;
            return this;
        };
        LayoutPositionCreatorConflictFlags.prototype.allIsTrue = function () {
            return this.left && this.middle && this.right && this.simple;
        };
        LayoutPositionCreatorConflictFlags.prototype.atLeastOneIsTrue = function () {
            return this.left || this.middle || this.right || this.simple;
        };
        LayoutPositionCreatorConflictFlags.prototype.atLeastOneIsFalse = function () {
            return !(this.left && this.middle && this.right && this.simple);
        };
        LayoutPositionCreatorConflictFlags.prototype.copyFrom = function (obj) {
            this.left = obj.left;
            this.middle = obj.middle;
            this.right = obj.right;
            this.simple = obj.simple;
            return this;
        };
        LayoutPositionCreatorConflictFlags.prototype.clone = function () {
            return new LayoutPositionCreatorConflictFlags().copyFrom(this);
        };
        return LayoutPositionCreatorConflictFlags;
    }());
    __aspxRichEdit.LayoutPositionCreatorConflictFlags = LayoutPositionCreatorConflictFlags;
    var LayoutPositionCreator = (function () {
        function LayoutPositionCreator(documentLayout, subDocument, logPosition, detailsLevel) {
            this.layout = documentLayout;
            this.subDocument = subDocument;
            this.position = logPosition;
            this.startPosition = logPosition;
            this.detailsLevel = detailsLevel;
            this.result = new __aspxRichEdit.LayoutPosition(detailsLevel);
        }
        LayoutPositionCreator.prototype.create = function (endRowConflictFlags, middleRowConflictFlags) {
            this.endRowConflictFlags = endRowConflictFlags;
            this.middleRowConflictFlags = middleRowConflictFlags;
            return null;
        };
        LayoutPositionCreator.createLightLayoutPosition = function (documentLayout, subDocument, logPosition, pageIndex, detailsLevel, endOfLine, closerToTheRightEdgeHiddenBox) {
            return (subDocument.isMain() ?
                new LayoutPositionMainSubDocumentCreator(documentLayout, subDocument, logPosition, detailsLevel)
                    .create(new LayoutPositionCreatorConflictFlags().setDefault(endOfLine), new LayoutPositionCreatorConflictFlags().setDefault(closerToTheRightEdgeHiddenBox)) :
                new LayoutPositionOtherSubDocumentCreator(documentLayout, subDocument, logPosition, pageIndex, detailsLevel)
                    .create(new LayoutPositionCreatorConflictFlags().setDefault(endOfLine), new LayoutPositionCreatorConflictFlags().setDefault(closerToTheRightEdgeHiddenBox)));
        };
        LayoutPositionCreator.prototype.updateRowInfo = function () {
            var _a;
            var rows = this.result.column.rows;
            var rowIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(rows, function (r) { return r.columnOffset; }, this.position);
            var row = rows[rowIndex];
            _a = LayoutPositionCreator.conflictResolver(this.position, this.endRowConflictFlags, rows, row, rowIndex, function (obj) { return obj.columnOffset; }, function (obj) { return obj.getEndPosition(); }), this.result.row = _a[0], this.result.rowIndex = _a[1];
            if (this.result.detailsLevel > __aspxRichEdit.DocumentLayoutDetailsLevel.Row) {
                this.position = Math.max(0, this.position - this.result.row.columnOffset);
                this.updateBoxInfo();
            }
        };
        LayoutPositionCreator.prototype.updateBoxInfo = function () {
            var _a;
            var boxes = this.result.row.boxes;
            var boxIndex = Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(boxes, function (b) { return b.rowOffset; }, this.position));
            var box = boxes[boxIndex];
            _a = LayoutPositionCreator.conflictResolver(this.position, this.middleRowConflictFlags, boxes, box, boxIndex, function (obj) { return obj.rowOffset; }, function (obj) { return obj.getEndPosition(); }), this.result.box = _a[0], this.result.boxIndex = _a[1];
            if (this.result.detailsLevel > __aspxRichEdit.DocumentLayoutDetailsLevel.Box) {
                this.position = Math.max(0, this.position - this.result.box.rowOffset);
                var boxLength = this.result.box.getLength();
                this.result.charOffset = this.position < boxLength ? this.position : boxLength;
            }
        };
        LayoutPositionCreator.conflictResolver = function (position, conflictFlags, objects, object, objectIndex, getObjectStartPos, getObjectEndPos) {
            var prevObject = objects[objectIndex - 1];
            var objectStartPos = getObjectStartPos(object);
            if (prevObject && objectStartPos == position) {
                var prevObjectEndPos = getObjectEndPos(prevObject);
                if (objectStartPos == prevObjectEndPos)
                    return conflictFlags.simple ? [prevObject, objectIndex - 1] : [object, objectIndex];
                else
                    return conflictFlags.right ? [prevObject, objectIndex - 1] : [object, objectIndex];
            }
            var nextObject = objects[objectIndex + 1];
            if (nextObject) {
                var objectEndPos = getObjectEndPos(object);
                if (position >= objectEndPos) {
                    var nextObjectStartPos = getObjectStartPos(nextObject);
                    if (objectEndPos == nextObjectStartPos)
                        return conflictFlags.simple ? [object, objectIndex] : [nextObject, objectIndex + 1];
                    if (position == objectEndPos)
                        return conflictFlags.left ? [object, objectIndex] : [nextObject, objectIndex + 1];
                    return conflictFlags.middle ? [object, objectIndex] : [nextObject, objectIndex + 1];
                }
            }
            return [object, objectIndex];
        };
        return LayoutPositionCreator;
    }());
    __aspxRichEdit.LayoutPositionCreator = LayoutPositionCreator;
    var LayoutPositionMainSubDocumentCreator = (function (_super) {
        __extends(LayoutPositionMainSubDocumentCreator, _super);
        function LayoutPositionMainSubDocumentCreator(documentLayout, subDocument, logPosition, detailsLevel, isUseMoreHardAlgorithm) {
            if (isUseMoreHardAlgorithm === void 0) { isUseMoreHardAlgorithm = false; }
            var _this = _super.call(this, documentLayout, subDocument, logPosition, detailsLevel) || this;
            _this.isUseMoreHardAlgorithm = isUseMoreHardAlgorithm;
            if (!_this.subDocument.isMain())
                throw new Error("LayoutPositionMainSubDocumentCreator need set here main sub document");
            return _this;
        }
        LayoutPositionMainSubDocumentCreator.prototype.create = function (endRowConflictFlags, middleRowConflictFlags) {
            _super.prototype.create.call(this, endRowConflictFlags, middleRowConflictFlags);
            if (this.layout.pages.length)
                this.updatePageInfo();
            else
                this.result = null;
            return this.result;
        };
        LayoutPositionMainSubDocumentCreator.ensureLayoutPosition = function (formatterController, documentLayout, subDocument, logPosition, detailsLevel, endRowConflictFlags, middleRowConflictFlags) {
            while (true) {
                var layoutPosition = new LayoutPositionMainSubDocumentCreator(documentLayout, subDocument, logPosition, detailsLevel)
                    .create(endRowConflictFlags, middleRowConflictFlags);
                if (layoutPosition)
                    break;
                if (!formatterController.layoutFormatterManager.forceFormatPage(documentLayout.validPageCount))
                    break;
            }
            return layoutPosition;
        };
        LayoutPositionMainSubDocumentCreator.prototype.updatePageInfoInterval = function (validPageCount, pages, foundPage) {
            var _this = this;
            if (foundPage.index == 0 && this.position <= foundPage.getPosition())
                return validPageCount > 0 ? foundPage : null;
            var firstPageInGroupIndex = Math.max(0, __aspxRichEdit.LayoutPage.getFirstPageInGroup(pages, foundPage.index).index - 1);
            var lastPageInGroup = __aspxRichEdit.LayoutPage.getLastValidPageInGroup(pages, foundPage.index, validPageCount, !this.isUseMoreHardAlgorithm, true);
            if (!lastPageInGroup)
                return null;
            var endPageIndex = Math.min(validPageCount, lastPageInGroup.index + 2);
            var intervalsList = [];
            for (var pageIndex = Math.max(0, firstPageInGroupIndex - 1); pageIndex < endPageIndex; pageIndex++) {
                var page = pages[pageIndex];
                page.calculateContentIntervals(this.layout.anchorObjectsPositionInfo, this.isUseMoreHardAlgorithm);
                for (var _i = 0, _a = page.getContentIntervals(); _i < _a.length; _i++) {
                    var interval = _a[_i];
                    if (interval.containsWithoutIntervalEndAndStart(this.position))
                        return page;
                    intervalsList.push(new PageIndexAndInterval(page.index, interval));
                }
            }
            if (intervalsList.length == 0)
                return null;
            intervalsList.sort(function (a, b) { return a.interval.start - b.interval.start; });
            if (__aspxRichEdit.Log.isDebug)
                __aspxRichEdit.ListUtils.foreach(intervalsList, function (a, ind) {
                    __aspxRichEdit.ListUtils.foreach(intervalsList, function (b) {
                        if (__aspxRichEdit.IntervalAlgorithms.getIntersectionNonNullLength(a.interval, b.interval))
                            throw new Error("Detected page intervals intersection. It's very bad. " +
                                __aspxRichEdit.ListUtils.map(intervalsList, function (curr) { return __aspxRichEdit.LogObjToStr.fixedInterval(curr.interval); }).join(", "));
                    }, ind + 1);
                });
            var currInfo = intervalsList[0];
            var nextInfo;
            for (var nextInfoIndex = 1; nextInfo = intervalsList[nextInfoIndex]; nextInfoIndex++) {
                if (__aspxRichEdit.FixedInterval.fromPositions(currInfo.interval.end, nextInfo.interval.start).containsWithIntervalEnd(this.position))
                    break;
                currInfo = nextInfo;
            }
            var firstPageIndex = currInfo.pageIndex;
            var secondPageIndex = nextInfo ? nextInfo.pageIndex : firstPageIndex + 1;
            if (firstPageIndex == secondPageIndex)
                return pages[firstPageIndex];
            if (secondPageIndex >= validPageCount) {
                if (this.layout.isFullyFormatted)
                    return pages[firstPageIndex];
                else
                    return this.endRowConflictFlags.allIsTrue() &&
                        __aspxRichEdit.ListUtils.anyOf(pages[firstPageIndex].getContentIntervals(), function (interval) { return interval.containsWithIntervalEnd(_this.position); }) ? pages[firstPageIndex] : null;
            }
            if (!nextInfo)
                return null;
            return this.getPageResolvedFlag(currInfo.interval.end, nextInfo.interval.start) ? pages[firstPageIndex] : pages[secondPageIndex];
        };
        LayoutPositionMainSubDocumentCreator.prototype.getPageResolvedFlag = function (posA, posB) {
            return posA == posB ? this.endRowConflictFlags.simple :
                (posA == this.position ? this.endRowConflictFlags.left :
                    (posB == this.position ? this.endRowConflictFlags.right :
                        this.endRowConflictFlags.middle));
        };
        LayoutPositionMainSubDocumentCreator.prototype.updatePageInfo = function () {
            var validPageCount = this.layout.validPageCount;
            var pages = this.layout.pages;
            var foundPageIndex = Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(pages, function (p) { return p.getPosition(); }, this.position, 0, validPageCount - 1));
            var foundPage = pages[foundPageIndex];
            if (foundPage)
                this.result.page = this.updatePageInfoInterval(validPageCount, pages, foundPage);
            if (!this.result.page) {
                this.result = null;
                return;
            }
            this.result.pageIndex = this.result.page.index;
            if (this.result.detailsLevel > __aspxRichEdit.DocumentLayoutDetailsLevel.Page) {
                this.position = Math.max(0, this.position - this.result.page.getPosition());
                this.updatePageAreaInfo();
            }
        };
        LayoutPositionMainSubDocumentCreator.prototype.updatePageAreaInfo = function () {
            var _a;
            var areas = this.result.page.mainSubDocumentPageAreas;
            if (areas.length > 1) {
                var pageAreaIndex = Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(areas, function (a) { return a.pageOffset; }, this.position));
                var pageArea = areas[pageAreaIndex];
                _a = LayoutPositionCreator.conflictResolver(this.position, this.endRowConflictFlags, areas, pageArea, pageAreaIndex, function (obj) { return obj.pageOffset; }, function (obj) { return obj.getEndPosition(); }), this.result.pageArea = _a[0], this.result.pageAreaIndex = _a[1];
            }
            else {
                this.result.pageAreaIndex = 0;
                this.result.pageArea = areas[0];
            }
            if (this.result.detailsLevel > __aspxRichEdit.DocumentLayoutDetailsLevel.PageArea) {
                this.position = Math.max(0, this.position - this.result.pageArea.pageOffset);
                this.updateColumnInfo();
            }
        };
        LayoutPositionMainSubDocumentCreator.prototype.updateColumnInfo = function () {
            var _a;
            var columns = this.result.pageArea.columns;
            if (columns.length > 1) {
                var columnIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(columns, function (c) { return c.pageAreaOffset; }, this.position);
                var column = columns[columnIndex];
                _a = LayoutPositionCreator.conflictResolver(this.position, this.endRowConflictFlags, columns, column, columnIndex, function (obj) { return obj.pageAreaOffset; }, function (obj) { return obj.getEndPosition(); }), this.result.column = _a[0], this.result.columnIndex = _a[1];
            }
            else {
                this.result.columnIndex = 0;
                this.result.column = columns[0];
            }
            if (this.result.detailsLevel > __aspxRichEdit.DocumentLayoutDetailsLevel.Column) {
                this.position = Math.max(0, this.position - this.result.column.pageAreaOffset);
                this.updateRowInfo();
            }
        };
        return LayoutPositionMainSubDocumentCreator;
    }(LayoutPositionCreator));
    __aspxRichEdit.LayoutPositionMainSubDocumentCreator = LayoutPositionMainSubDocumentCreator;
    var LayoutPositionOtherSubDocumentCreator = (function (_super) {
        __extends(LayoutPositionOtherSubDocumentCreator, _super);
        function LayoutPositionOtherSubDocumentCreator(documentLayout, subDocument, logPosition, pageIndex, detailsLevel) {
            var _this = _super.call(this, documentLayout, subDocument, logPosition, detailsLevel) || this;
            if (_this.subDocument.isMain())
                throw new Error("LayoutPositionMainSubDocumentCreator need set here not main sub document");
            _this.result.page = _this.layout.pages[pageIndex];
            _this.result.pageIndex = pageIndex;
            return _this;
        }
        LayoutPositionOtherSubDocumentCreator.prototype.create = function (endRowConflictFlags, middleRowConflictFlags) {
            _super.prototype.create.call(this, endRowConflictFlags, middleRowConflictFlags);
            if (!this.result.page) {
                this.result = null;
                return null;
            }
            this.result.pageArea = this.result.page.otherPageAreas[this.subDocument.id];
            if (!this.result.pageArea) {
                this.result = null;
            }
            else {
                this.result.pageAreaIndex = 0;
                this.position = Math.max(0, this.position - this.result.pageArea.pageOffset);
                this.result.column = this.result.pageArea.columns[0];
                this.result.columnIndex = 0;
                this.position = Math.max(0, this.position - this.result.column.pageAreaOffset);
                this.updateRowInfo();
            }
            return this.result;
        };
        return LayoutPositionOtherSubDocumentCreator;
    }(LayoutPositionCreator));
    __aspxRichEdit.LayoutPositionOtherSubDocumentCreator = LayoutPositionOtherSubDocumentCreator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Chunk = (function () {
        function Chunk(startLogPosition, textBuffer, isLast) {
            this.textBuffer = "";
            this.textRuns = [];
            this.startLogPosition = startLogPosition;
            this.textBuffer = textBuffer;
            this.isLast = isLast;
        }
        Chunk.prototype.getEndPosition = function () {
            return this.startLogPosition.value + this.textBuffer.length;
        };
        Chunk.prototype.getRunText = function (run) {
            return this.textBuffer.substr(run.startOffset, run.getLength());
        };
        Chunk.prototype.getTextInChunk = function (offsetAtStartChunk, length) {
            return this.textBuffer.substr(offsetAtStartChunk, length);
        };
        Chunk.prototype.splitRun = function (runIndex, offset) {
            var run = this.textRuns[runIndex];
            if (!run)
                throw new Error("Undefined run");
            if (offset >= run.getLength())
                throw new Error("Offset >= run.length");
            var newRun = run.createSimularity(run.startOffset + offset, run.getLength() - offset, run.paragraph, run.characterStyle, run.maskedCharacterProperties);
            run.setLength(offset);
            this.textRuns.splice(runIndex + 1, 0, newRun);
        };
        return Chunk;
    }());
    __aspxRichEdit.Chunk = Chunk;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var CompatSettings = (function () {
        function CompatSettings() {
        }
        return CompatSettings;
    }());
    __aspxRichEdit.CompatSettings = CompatSettings;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DocumentModel = (function () {
        function DocumentModel(options, subDocumentsIdCounter) {
            this.sections = [];
            this.headers = [];
            this.footers = [];
            this.characterStyles = [];
            this.paragraphStyles = [];
            this.numberingListStyles = [];
            this.tableStyles = [];
            this.tableCellStyles = [];
            this.rtfCommandsOptions = {};
            this.subDocuments = {};
            this.abstractNumberingListTemplates = [];
            this.abstractNumberingLists = [];
            this.numberingLists = [];
            this.abstractNumberingListsIdProvider = new __aspxRichEdit.AbstractNumberingListIdProvider(this);
            this.numberingListsIdProvider = new __aspxRichEdit.NumberingListIdProvider(this);
            this.repositoryBorderItem = new __aspxRichEdit.BorderInfo();
            this.compatSettings = [];
            this.subDocumentsIdCounter = -1;
            this.loaded = false;
            this.cache = new __aspxRichEdit.DocumentCache();
            this.mainSubDocument = this.importSubDocument(__aspxRichEdit.SubDocumentInfoBase.create(__aspxRichEdit.SubDocumentInfoType.Main, __aspxRichEdit.SubDocument.MAIN_SUBDOCUMENT_ID, -1));
            this.activeSubDocument = this.mainSubDocument;
            this.stylesManager = new __aspxRichEdit.StylesManager(this);
            this.options = options;
            this.subDocumentsIdCounter = subDocumentsIdCounter;
            this.colorProvider = new __aspxRichEdit.ColorProvider(this.cache.colorModelInfoCache);
            this.initRepositoryBorderItem();
            this.forceSyncWithServerCallbackManager = new __aspxRichEdit.ForceSyncWithServerCallbackManager();
            this.insertContentFromServerRequestManager = new __aspxRichEdit.InsertContentFromServerRequestManager();
            this.webSettings = new __aspxRichEdit.WebSettings();
            this.compatibilitySettings = new CompatibilitySettings();
        }
        DocumentModel.prototype.getAllBookmarks = function (getHiddenToo) {
            var result = [];
            __aspxRichEdit.MapUtilsKeyAsNumber.foreach(this.subDocuments, function (subDoc) {
                if (getHiddenToo)
                    __aspxRichEdit.ListUtils.addListOnTail(result, subDoc.bookmarks);
                else
                    __aspxRichEdit.ListUtils.foreach(subDoc.bookmarks, function (bm) {
                        if (!bm.isHidden())
                            result.push(bm);
                    });
            });
            return result;
        };
        DocumentModel.prototype.initRepositoryBorderItem = function () {
            this.repositoryBorderItem.color = this.colorProvider.getModelColorFromRgba(__aspxRichEdit.ColorHelper.AUTOMATIC_COLOR);
            this.repositoryBorderItem.style = __aspxRichEdit.BorderLineStyle.Single;
            this.repositoryBorderItem.width = __aspxRichEdit.UnitConverter.pixelsToTwipsF(1);
        };
        DocumentModel.prototype.getCharacterStyleByName = function (name) {
            return this.stylesManager.getCharacterStyleByName(name);
        };
        DocumentModel.prototype.getParagraphStyleByName = function (name) {
            return this.stylesManager.getParagraphStyleByName(name);
        };
        DocumentModel.prototype.getNumberingListStyleByName = function (name) {
            return this.stylesManager.getNumberingListStyleByName(name);
        };
        DocumentModel.prototype.getTableStyleByName = function (name) {
            return this.stylesManager.getTableStyleByName(name);
        };
        DocumentModel.prototype.getTableCellStyleByName = function (name) {
            return this.stylesManager.getTableCellStyleByName(name);
        };
        DocumentModel.prototype.getDefaultCharacterStyle = function () {
            return this.stylesManager.getDefaultCharacterStyle();
        };
        DocumentModel.prototype.getDefaultParagraphStyle = function () {
            return this.stylesManager.getDefaultParagraphStyle();
        };
        DocumentModel.prototype.getDefaultTableStyle = function () {
            return this.stylesManager.getDefaultTableStyle();
        };
        DocumentModel.prototype.getDefaultTableCellStyle = function () {
            return this.stylesManager.getDefaultTableCellStyle();
        };
        DocumentModel.prototype.setDefaultCharacterProperties = function (obj) {
            this.defaultCharacterProperties = __aspxRichEdit.JSONMaskedCharacterPropertiesConverter.convertFromJSON(obj, this.cache.colorModelInfoCache, this.cache.shadingInfoCache, this.cache.fontInfoCache);
            this.defaultCharacterProperties = this.cache.maskedCharacterPropertiesCache.getItem(this.defaultCharacterProperties);
        };
        DocumentModel.prototype.setDefaultParagraphProperties = function (obj) {
            this.defaultParagraphProperties = __aspxRichEdit.JSONMaskedParagraphPropertiesConverter.convertFromJSON(obj, this.cache.colorModelInfoCache, this.cache.shadingInfoCache);
            this.defaultParagraphProperties = this.cache.maskedParagraphPropertiesCache.getItem(this.defaultParagraphProperties);
        };
        DocumentModel.prototype.getSectionsByInterval = function (interval) {
            var result = [], section;
            var endPosition = interval.end;
            var sectionIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.sections, function (s) { return s.startLogPosition.value; }, interval.start);
            for (; section = this.sections[sectionIndex]; sectionIndex++) {
                if (section.startLogPosition.value > endPosition)
                    break;
                result.push(section);
            }
            return result;
        };
        DocumentModel.prototype.getSectionIndicesByIntervals = function (intervals) {
            var result = [];
            for (var i = 0, interval; interval = intervals[i]; i++) {
                var sectionIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.sections, function (s) { return s.startLogPosition.value; }, interval.start);
                var intervalEnd = interval.end;
                result.push(sectionIndex++);
                for (var section = void 0; section = this.sections[sectionIndex]; sectionIndex++) {
                    if (section.startLogPosition.value < intervalEnd)
                        result.push(sectionIndex);
                    else
                        break;
                }
            }
            return __aspxRichEdit.ListUtils.uniqueNumber(result);
        };
        DocumentModel.prototype.getSectionByPosition = function (position) {
            var sectionIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.sections, function (s) { return s.startLogPosition.value; }, position);
            return this.sections[sectionIndex];
        };
        DocumentModel.prototype.getCurrentLength = function () {
            var lastChunk = this.mainSubDocument.getLastChunk();
            var lastRun = lastChunk.textRuns[lastChunk.textRuns.length - 1];
            return lastChunk.startLogPosition.value + lastRun.startOffset + lastRun.getLength();
        };
        DocumentModel.prototype.isLoaded = function () {
            if (this.loaded)
                return true;
            this.loaded = this.mainSubDocument.getLastChunk().isLast;
            return this.loaded;
        };
        DocumentModel.prototype.getNumberingListIndexById = function (id) {
            for (var i = 0, numberingList; numberingList = this.numberingLists[i]; i++) {
                if (numberingList.getId() === id)
                    return i;
            }
            return -1;
        };
        DocumentModel.prototype.getAbstractNumberingListIndexById = function (id) {
            for (var i = 0, abstractNumberingList; abstractNumberingList = this.abstractNumberingLists[i]; i++) {
                if (abstractNumberingList.getId() === id)
                    return i;
            }
            return -1;
        };
        DocumentModel.prototype.getRangeListCounters = function (paragraph) {
            var calculator = new __aspxRichEdit.NumberingListCountersCalculator(paragraph.getAbstractNumberingList());
            return calculator.calculateCounters(paragraph);
        };
        DocumentModel.prototype.resetMergedFormattingCache = function (type) {
            this.mainSubDocument.resetMergedFormattingCache(type);
        };
        DocumentModel.prototype.getPreviousSection = function (section) {
            var sectionIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.sections, function (s) { return s.startLogPosition.value; }, section.startLogPosition.value);
            return this.sections[sectionIndex - 1];
        };
        DocumentModel.prototype.getNextSection = function (section) {
            var sectionIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.sections, function (s) { return s.startLogPosition.value; }, section.startLogPosition.value);
            return this.sections[sectionIndex + 1];
        };
        DocumentModel.prototype.importSubDocument = function (info) {
            return this.createSubDocumentInternal(info, false);
        };
        DocumentModel.prototype.createSubDocument = function (subDocumentInfoType, parentSubDocumentId, disableInit) {
            if (disableInit === void 0) { disableInit = false; }
            var id = this.subDocumentsIdCounter++;
            var info = __aspxRichEdit.SubDocumentInfoBase.create(subDocumentInfoType, id, parentSubDocumentId);
            if (info.getType() !== subDocumentInfoType)
                throw new Error("SubDocument.type doesn't equal to info.type");
            return this.createSubDocumentInternal(info, disableInit ? false : true);
        };
        DocumentModel.prototype.createSubDocumentInternal = function (info, isRuntimeCreated) {
            if (this.subDocuments[info.subDocumentId])
                throw new Error("SubDocument with this ID already exists");
            var subDocument = new __aspxRichEdit.SubDocument(this, info);
            if (isRuntimeCreated)
                this.initNewSubDocument(subDocument);
            this.subDocuments[info.subDocumentId] = subDocument;
            return subDocument;
        };
        DocumentModel.prototype.initNewSubDocument = function (subDocument) {
            subDocument.chunks = [new __aspxRichEdit.Chunk(subDocument.positionManager.registerPosition(0), "", true)];
            subDocument.paragraphs.push(new __aspxRichEdit.Paragraph(subDocument, subDocument.positionManager.registerPosition(0), 1, this.getDefaultParagraphStyle(), __aspxRichEdit.MaskedParagraphProperties.createDefault(this)));
            subDocument.chunks[0].textRuns.push(new __aspxRichEdit.ParagraphRun(0, subDocument.paragraphs[0], this.getDefaultCharacterStyle(), __aspxRichEdit.MaskedCharacterProperties.createDefault(this)));
            subDocument.chunks[0].textBuffer = __aspxRichEdit.RichUtils.specialCharacters.ParagraphMark;
        };
        return DocumentModel;
    }());
    __aspxRichEdit.DocumentModel = DocumentModel;
    var ResetFormattingCacheType;
    (function (ResetFormattingCacheType) {
        ResetFormattingCacheType[ResetFormattingCacheType["Character"] = 1] = "Character";
        ResetFormattingCacheType[ResetFormattingCacheType["Paragraph"] = 2] = "Paragraph";
        ResetFormattingCacheType[ResetFormattingCacheType["All"] = 2147483647] = "All";
    })(ResetFormattingCacheType = __aspxRichEdit.ResetFormattingCacheType || (__aspxRichEdit.ResetFormattingCacheType = {}));
    var CompatibilitySettings = (function () {
        function CompatibilitySettings() {
            this.dontJustifyLinesEndingInSoftLineBreak = false;
        }
        return CompatibilitySettings;
    }());
    __aspxRichEdit.CompatibilitySettings = CompatibilitySettings;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FindReplaceState;
    (function (FindReplaceState) {
        FindReplaceState[FindReplaceState["Start"] = 0] = "Start";
        FindReplaceState[FindReplaceState["Found"] = 1] = "Found";
        FindReplaceState[FindReplaceState["DocumentBegin"] = 2] = "DocumentBegin";
        FindReplaceState[FindReplaceState["DocumentEnd"] = 3] = "DocumentEnd";
        FindReplaceState[FindReplaceState["SearchEnd"] = 4] = "SearchEnd";
    })(FindReplaceState = __aspxRichEdit.FindReplaceState || (__aspxRichEdit.FindReplaceState = {}));
    var SearchDirection;
    (function (SearchDirection) {
        SearchDirection[SearchDirection["Up"] = 1] = "Up";
        SearchDirection[SearchDirection["Down"] = 2] = "Down";
        SearchDirection[SearchDirection["All"] = 3] = "All";
    })(SearchDirection = __aspxRichEdit.SearchDirection || (__aspxRichEdit.SearchDirection = {}));
    var FindReplaceHelper = (function () {
        function FindReplaceHelper(control, subDocument, layout) {
            this.control = control;
            this.subDocument = subDocument;
            this.layout = layout;
        }
        FindReplaceHelper.prototype.setSearchParams = function (whatFind, replaceWith, searchDirection, matchCase, regularExpression, findWithPosition, wholeWordsOnly) {
            if (findWithPosition < 0 || findWithPosition > this.subDocument.getDocumentEndPosition())
                throw "In FindReplaceHelper setSearchParams findWithPosition < 0 || findWithPosition > this.subDocument.getDocumentEndPosition()";
            if (wholeWordsOnly && regularExpression)
                throw "In FindReplaceHelper setSearchParams can't set wholeWordsOnly && regularExpression";
            if (wholeWordsOnly && FindReplaceHelper.isCanSetWholeWordsOnlyForThisExpression(whatFind) >= 0)
                throw "In FindReplaceHelper setSearchParams whatFind expression consider not Alphanumeric char[" + FindReplaceHelper.isCanSetWholeWordsOnlyForThisExpression(whatFind) + "]";
            var recalculateSuppFunc = (this.template != (matchCase ? whatFind : whatFind.toUpperCase())) ||
                (this.regularExpression != regularExpression) || (this.matchCase != matchCase) ||
                (this.searchDirection == SearchDirection.Up && searchDirection != SearchDirection.Up) ||
                (this.searchDirection != SearchDirection.Up && searchDirection == SearchDirection.Up);
            this.replaceWith = replaceWith;
            this.searchDirection = searchDirection;
            this.regularExpression = regularExpression;
            this.matchCase = matchCase;
            this.wholeWordsOnly = wholeWordsOnly;
            this.template = this.matchCase ? whatFind : whatFind.toUpperCase();
            this.lastFound = null;
            this.state = FindReplaceState.Start;
            this.beginOrStartDocumentReach = false;
            this.findWithPosition = findWithPosition;
            this.currentPos = findWithPosition;
            this.templateLength = whatFind.length;
            if (!this.wholeWordsOnly && recalculateSuppFunc || !this.supportFunction)
                this.crateSupportFunction();
        };
        FindReplaceHelper.isCanSetWholeWordsOnlyForThisExpression = function (expression) {
            for (var i = 0; i < expression.length; i++)
                if (!expression[i].match(__aspxRichEdit.RichUtils.isAlphanumeric))
                    return i;
            return -1;
        };
        FindReplaceHelper.prototype.findNext = function () {
            if (this.state == FindReplaceState.SearchEnd)
                this.setSearchParams(this.template, this.replaceWith, this.searchDirection, this.matchCase, this.regularExpression, this.findWithPosition, this.wholeWordsOnly);
            var newState;
            switch (this.searchDirection) {
                case SearchDirection.Down:
                    newState = this.findNextDown();
                    break;
                case SearchDirection.All:
                    newState = this.findNextAll();
                    break;
                case SearchDirection.Up:
                    newState = this.findNextUp();
                    break;
            }
            if (newState == FindReplaceState.DocumentEnd || newState == FindReplaceState.DocumentBegin)
                this.beginOrStartDocumentReach = true;
            return newState;
        };
        FindReplaceHelper.prototype.findNextDown = function () {
            switch (this.state) {
                case FindReplaceState.Start:
                case FindReplaceState.Found:
                    var isBelowStartPos = this.currentPos >= this.findWithPosition;
                    if (this.findNextDownInternal(this.currentPos, isBelowStartPos ? this.subDocument.getDocumentEndPosition() : this.findWithPosition))
                        this.state = FindReplaceState.Found;
                    else {
                        if (!isBelowStartPos || this.findWithPosition == 0)
                            this.state = FindReplaceState.SearchEnd;
                        else
                            this.state = FindReplaceState.DocumentEnd;
                    }
                    break;
                case FindReplaceState.DocumentEnd:
                    if (this.findWithPosition == 0)
                        this.state = FindReplaceState.SearchEnd;
                    else {
                        if (this.findNextDownInternal(0, this.findWithPosition))
                            this.state = FindReplaceState.Found;
                        else
                            this.state = FindReplaceState.SearchEnd;
                    }
                    break;
            }
            return this.state;
        };
        FindReplaceHelper.prototype.findNextUp = function () {
            switch (this.state) {
                case FindReplaceState.Start:
                case FindReplaceState.Found:
                    var isAboveStartPos = this.currentPos <= this.findWithPosition;
                    if (this.beginOrStartDocumentReach && isAboveStartPos) {
                        this.lastFound = null;
                        this.state = FindReplaceState.SearchEnd;
                        return this.state;
                    }
                    if (this.findNextUpInternal(isAboveStartPos ? 0 : this.findWithPosition, this.currentPos))
                        this.state = FindReplaceState.Found;
                    else {
                        if (!isAboveStartPos || this.findWithPosition == this.subDocument.getDocumentEndPosition() - 1)
                            this.state = FindReplaceState.SearchEnd;
                        else
                            this.state = FindReplaceState.DocumentBegin;
                    }
                    break;
                case FindReplaceState.DocumentBegin:
                    var docEnd = this.subDocument.getDocumentEndPosition();
                    if (this.findWithPosition == docEnd - 1)
                        this.state = FindReplaceState.SearchEnd;
                    else {
                        if (this.findNextUpInternal(this.findWithPosition, docEnd - 1))
                            this.state = FindReplaceState.Found;
                        else
                            this.state = FindReplaceState.SearchEnd;
                    }
                    break;
            }
            return this.state;
        };
        FindReplaceHelper.prototype.findNextAll = function () {
            while (this.findNextDown() == FindReplaceState.DocumentEnd)
                ;
            return this.state;
        };
        FindReplaceHelper.prototype.findNextDownInternal = function (lowerPosition, greaterPosition) {
            var charIterator = new ForwardCharacterIterator(this.control, this.subDocument, lowerPosition, greaterPosition);
            if (this.wholeWordsOnly)
                return this.findNextDownWholeWordsOnly(charIterator, lowerPosition, greaterPosition);
            var offset = 0;
            var posWhenStartEquivalents = -1;
            while (charIterator.nextChar()) {
                if (!this.matchCase)
                    charIterator.char = charIterator.char.toUpperCase();
                while (offset > 0 && this.template[offset] != charIterator.char) {
                    offset = this.supportFunction[offset - 1];
                    posWhenStartEquivalents++;
                }
                if (this.template[offset] == charIterator.char) {
                    if (offset == 0)
                        posWhenStartEquivalents = charIterator.getCurrLogPosition();
                    offset++;
                }
                if (offset == this.templateLength) {
                    this.lastFound = __aspxRichEdit.FixedInterval.fromPositions(posWhenStartEquivalents, charIterator.getCurrLogPosition() + 1);
                    this.currentPos = this.lastFound.end;
                    return true;
                }
            }
            this.currentPos = greaterPosition;
            this.lastFound = null;
            return false;
        };
        FindReplaceHelper.prototype.findNextDownWholeWordsOnly = function (charIterator, lowerPosition, greaterPosition) {
            var offset = 0;
            if (this.layout.pages[0].getPosition() < lowerPosition &&
                this.isCharCanBeInWord((this.subDocument.isMain() ? new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.layout, this.subDocument, lowerPosition - 1, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                    : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.layout, this.subDocument, lowerPosition - 1, this.control.selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character))
                    .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true))))
                offset = -1;
            var posWhenStartEquivalents = -1;
            while (charIterator.nextChar()) {
                if (offset == this.templateLength) {
                    if (charIterator.char.match(__aspxRichEdit.RichUtils.isAlphanumeric)) {
                        offset = -1;
                        continue;
                    }
                    else {
                        this.lastFound = __aspxRichEdit.FixedInterval.fromPositions(posWhenStartEquivalents, charIterator.getCurrLogPosition() + 1);
                        this.currentPos = this.lastFound.end;
                        return true;
                    }
                }
                if (offset < 0 && !charIterator.char.match(__aspxRichEdit.RichUtils.isAlphanumeric) || offset >= 0 && this.template[offset] == (this.matchCase ? charIterator.char : charIterator.char.toUpperCase())) {
                    offset += 1;
                    if (offset == 0)
                        posWhenStartEquivalents = charIterator.getCurrLogPosition();
                }
                else
                    offset = -1;
            }
            this.currentPos = greaterPosition;
            this.lastFound = null;
            return false;
        };
        FindReplaceHelper.prototype.findNextUpInternal = function (lowerPosition, greaterPosition) {
            if (greaterPosition < 1) {
                this.currentPos = 0;
                this.lastFound = null;
                return false;
            }
            var charIterator = new BackwardCharacterIterator(this.control, this.subDocument, lowerPosition, greaterPosition);
            if (this.wholeWordsOnly)
                return this.findNextUpWholeWordsOnly(charIterator, greaterPosition);
            var offset = 0;
            var templateLastInd = this.templateLength - 1;
            var posWhenStartEquivalents = -1;
            while (charIterator.prevChar()) {
                if (!this.matchCase)
                    charIterator.char = charIterator.char.toUpperCase();
                while (offset > 0 && this.template[templateLastInd - offset] != charIterator.char)
                    offset = this.supportFunction[offset - 1];
                if (this.template[templateLastInd - offset] == charIterator.char) {
                    if (offset == 0)
                        posWhenStartEquivalents = charIterator.getCurrLogPosition() + 1;
                    offset++;
                }
                if (offset == this.templateLength) {
                    this.lastFound = __aspxRichEdit.FixedInterval.fromPositions(charIterator.getCurrLogPosition(), posWhenStartEquivalents);
                    this.currentPos = Math.max(0, this.lastFound.start - 1);
                    return true;
                }
            }
            this.currentPos = 0;
            this.lastFound = null;
            return false;
        };
        FindReplaceHelper.prototype.findNextUpWholeWordsOnly = function (charIterator, greaterPosition) {
            var offset = 0;
            var layoutPage = this.subDocument.isMain() ? this.layout.getLastValidPage() : this.layout.pages[this.control.selection.pageIndex];
            var posWhenStartEquivalents = -1;
            if (greaterPosition < layoutPage.getEndPosition() - 1 &&
                this.isCharCanBeInWord((this.subDocument.isMain() ? new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.layout, this.subDocument, greaterPosition + 1, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                    : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.layout, this.subDocument, greaterPosition + 1, this.control.selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character))
                    .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false))))
                offset = -1;
            else
                posWhenStartEquivalents = charIterator.getCurrLogPosition();
            var templateLastInd = this.templateLength - 1;
            while (charIterator.prevChar()) {
                if (offset == this.templateLength) {
                    if (charIterator.char.match(__aspxRichEdit.RichUtils.isAlphanumeric)) {
                        offset = -1;
                        continue;
                    }
                    else {
                        this.lastFound = __aspxRichEdit.FixedInterval.fromPositions(charIterator.getCurrLogPosition(), posWhenStartEquivalents + 1);
                        this.currentPos = this.lastFound.start;
                        return true;
                    }
                }
                if (offset < 0) {
                    offset = charIterator.char.match(__aspxRichEdit.RichUtils.isAlphanumeric) ? -1 : 0;
                    if (offset == 0)
                        posWhenStartEquivalents = charIterator.getCurrLogPosition();
                }
                else {
                    if (this.template[templateLastInd - offset] == (this.matchCase ? charIterator.char : charIterator.char.toUpperCase()))
                        offset += 1;
                }
            }
            if (offset == this.templateLength) {
                this.currentPos = 0;
                this.lastFound = new __aspxRichEdit.FixedInterval(0, posWhenStartEquivalents + 1);
                return true;
            }
            this.currentPos = 0;
            this.lastFound = null;
            return false;
        };
        FindReplaceHelper.prototype.isCharCanBeInWord = function (layoutPos) {
            if (!layoutPos)
                return false;
            layoutPos.switchToStartNextBoxInRow();
            if (layoutPos.box.getType() != __aspxRichEdit.LayoutBoxType.Text && layoutPos.box.getType() != __aspxRichEdit.LayoutBoxType.Dash)
                return false;
            var char;
            if (layoutPos.charOffset >= layoutPos.box.getLength()) {
                if (layoutPos.advanceToNextRow(this.layout))
                    char = layoutPos.row.boxes[0].renderGetContent(null)[0];
                else
                    return false;
            }
            else
                char = layoutPos.box.renderGetContent(null)[layoutPos.charOffset];
            return char.match(__aspxRichEdit.RichUtils.isAlphanumeric).length > 0;
        };
        FindReplaceHelper.prototype.getLastFound = function () {
            return this.lastFound ? this.lastFound.clone() : null;
        };
        FindReplaceHelper.prototype.replaceLastFound = function () {
            if (!this.lastFound || this.replaceWith === null || this.replaceWith === undefined)
                return;
            var control = this.control;
            var firstRun = this.subDocument.getRunByPosition(this.lastFound.start);
            var charStyle = firstRun.characterStyle;
            var maskedCharProp = firstRun.maskedCharacterProperties;
            control.history.beginTransaction();
            control.history.addAndRedo(new __aspxRichEdit.SetSelectionHistoryItem(control.modelManipulator, this.subDocument, [new __aspxRichEdit.FixedInterval(this.lastFound.start, this.replaceWith.length)], control.selection, __aspxRichEdit.UpdateInputPositionProperties.No, control.selection.endOfLine));
            control.history.addAndRedo(new __aspxRichEdit.RemoveIntervalHistoryItem(control.modelManipulator, this.subDocument, this.lastFound, false));
            if (this.replaceWith)
                control.history.addAndRedo(new __aspxRichEdit.InsertTextHistoryItem(control.modelManipulator, this.subDocument, this.lastFound.start, this.replaceWith, maskedCharProp, charStyle));
            control.history.endTransaction();
            var diff = this.replaceWith.length - this.templateLength;
            if (this.searchDirection != SearchDirection.Up)
                this.currentPos += diff;
            if (this.findWithPosition >= this.lastFound.end)
                this.findWithPosition += diff;
            this.lastFound = null;
        };
        FindReplaceHelper.prototype.replaceAll = function () {
            if (this.replaceWith === null || this.replaceWith === undefined)
                return;
            var control = this.control;
            var oldFindWithPosition = this.findWithPosition;
            this.setSearchParams(this.template, this.replaceWith, this.searchDirection, this.matchCase, this.regularExpression, 0, this.wholeWordsOnly);
            var selection = control.selection;
            var history = control.history;
            var storedPosition = this.subDocument.positionManager.registerPosition(selection.getLastSelectedInterval().start);
            this.currentPos = 0;
            var resultIntervals = [];
            while (this.findNextAll() == FindReplaceState.Found)
                resultIntervals.push(this.lastFound.getLinkedInterval(this.subDocument.positionManager));
            if (resultIntervals.length) {
                history.beginTransaction();
                for (var _i = 0, resultIntervals_1 = resultIntervals; _i < resultIntervals_1.length; _i++) {
                    var curr = resultIntervals_1[_i];
                    var firstRun = this.subDocument.getRunByPosition(curr.start);
                    var charStyle = firstRun.characterStyle;
                    var maskedCharProp = firstRun.maskedCharacterProperties;
                    control.history.addAndRedo(new __aspxRichEdit.RemoveIntervalHistoryItem(control.modelManipulator, this.subDocument, curr.getFixedInterval(), false));
                    if (this.replaceWith.length)
                        control.history.addAndRedo(new __aspxRichEdit.InsertTextHistoryItem(control.modelManipulator, this.subDocument, curr.start, this.replaceWith, maskedCharProp, charStyle));
                    curr.destructor(this.subDocument.positionManager);
                }
                history.addAndRedo(new __aspxRichEdit.SetSelectionHistoryItem(this.control.modelManipulator, this.subDocument, [new __aspxRichEdit.FixedInterval(Math.min(storedPosition.value, this.subDocument.getDocumentEndPosition() - 1), 0)], selection, __aspxRichEdit.UpdateInputPositionProperties.Yes, selection.endOfLine));
                history.endTransaction();
            }
            this.subDocument.positionManager.unregisterPosition(storedPosition);
            this.setSearchParams(this.template, this.replaceWith, this.searchDirection, this.matchCase, this.regularExpression, oldFindWithPosition, this.wholeWordsOnly);
        };
        FindReplaceHelper.prototype.crateSupportFunction = function () {
            var template;
            if (this.searchDirection == SearchDirection.Up) {
                template = "";
                for (var i = this.templateLength - 1; i >= 0; i--)
                    template += this.template[i];
            }
            else
                template = this.template;
            this.supportFunction = [0];
            for (var topBound = 2; topBound < this.templateLength; topBound++)
                this.supportFunction.push(FindReplaceHelper.calcOneElemSuppFunc(template, topBound));
        };
        FindReplaceHelper.calcOneElemSuppFunc = function (template, topBound) {
            for (var offset = 1; offset < topBound; offset++) {
                var lenComparePhrase = topBound - offset;
                var i = 0;
                for (; i < lenComparePhrase; i++) {
                    if (template[i] != template[i + offset])
                        break;
                }
                if (i == lenComparePhrase)
                    return topBound - offset;
            }
            return 0;
        };
        return FindReplaceHelper;
    }());
    __aspxRichEdit.FindReplaceHelper = FindReplaceHelper;
    var CharacterIteratorBase = (function () {
        function CharacterIteratorBase(control, subDocument, startPosition, endPosition) {
            this.control = control;
            this.subDocument = subDocument;
            this.iterator = subDocument.isMain() ? new __aspxRichEdit.LayoutBoxIteratorMainSubDocument(subDocument, control.layout, startPosition, endPosition) : new __aspxRichEdit.LayoutBoxIteratorOtherSubDocument(subDocument, control.layout, startPosition, endPosition, control.selection.pageIndex);
            while (!this.iterator.isInitialized())
                control.layoutFormatterManager.forceFormatPage(control.layout.validPageCount);
            this.char = null;
            this.charIndexInBox = -1;
        }
        CharacterIteratorBase.prototype.getCurrLogPosition = function () {
            return this.iterator.position.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Box) + this.charIndexInBox;
        };
        CharacterIteratorBase.prototype.getCharInternal = function () {
            switch (this.iterator.position.box.getType()) {
                case __aspxRichEdit.LayoutBoxType.Text:
                    this.char = this.iterator.position.box.text[this.charIndexInBox];
                    break;
                case __aspxRichEdit.LayoutBoxType.Dash:
                    this.char = this.iterator.position.box.text[this.charIndexInBox];
                    break;
                case __aspxRichEdit.LayoutBoxType.Space:
                    this.char = __aspxRichEdit.RichUtils.specialCharacters.Space;
                    break;
                case __aspxRichEdit.LayoutBoxType.TabSpace:
                    this.char = __aspxRichEdit.RichUtils.specialCharacters.TabMark;
                    break;
                default:
                    this.char = String.fromCharCode(0);
            }
        };
        return CharacterIteratorBase;
    }());
    __aspxRichEdit.CharacterIteratorBase = CharacterIteratorBase;
    var ForwardCharacterIterator = (function (_super) {
        __extends(ForwardCharacterIterator, _super);
        function ForwardCharacterIterator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ForwardCharacterIterator.prototype.getCharInternal = function () {
            if (this.charIndexInBox >= this.iterator.position.box.getLength())
                return false;
            _super.prototype.getCharInternal.call(this);
            return true;
        };
        ForwardCharacterIterator.prototype.nextChar = function () {
            if (this.charIndexInBox == -1) {
                this.iterator.moveNext(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true));
                this.charIndexInBox = this.iterator.position.charOffset;
                if (this.iterator.position.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Box) + this.charIndexInBox < this.iterator.intervalEnd && this.getCharInternal())
                    return true;
            }
            else
                this.charIndexInBox++;
            this.char = null;
            while (this.char == null && this.iterator.position.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Box) + this.charIndexInBox < this.iterator.intervalEnd) {
                if (!this.getCharInternal()) {
                    if (this.iterator.moveNext(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true)))
                        this.charIndexInBox = this.iterator.position.charOffset;
                    else
                        return false;
                }
            }
            return !!this.char;
        };
        return ForwardCharacterIterator;
    }(CharacterIteratorBase));
    __aspxRichEdit.ForwardCharacterIterator = ForwardCharacterIterator;
    var BackwardCharacterIterator = (function (_super) {
        __extends(BackwardCharacterIterator, _super);
        function BackwardCharacterIterator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        BackwardCharacterIterator.prototype.getCharInternal = function () {
            if (this.charIndexInBox < 0)
                return false;
            _super.prototype.getCharInternal.call(this);
            return true;
        };
        BackwardCharacterIterator.prototype.prevChar = function () {
            if (this.charIndexInBox == -1) {
                this.iterator.movePrev(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
                this.charIndexInBox = this.iterator.position.charOffset - 1;
                if (this.charIndexInBox == -1) {
                    if (!this.iterator.movePrev(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false)))
                        return false;
                    this.charIndexInBox = this.iterator.position.box.getLength() - 1;
                }
                if (this.getCharInternal())
                    return true;
                this.charIndexInBox = -1;
            }
            else
                this.charIndexInBox--;
            this.char = null;
            while (this.char == null && this.iterator.position.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Box) + this.charIndexInBox >= this.iterator.intervalStart) {
                if (!this.getCharInternal()) {
                    if (this.iterator.position.charOffset > 0)
                        this.iterator.movePrev(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true));
                    if (this.iterator.movePrev(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true)))
                        this.charIndexInBox = this.iterator.position.box.getLength() - 1;
                    else
                        return false;
                }
            }
            return !!this.char;
        };
        return BackwardCharacterIterator;
    }(CharacterIteratorBase));
    __aspxRichEdit.BackwardCharacterIterator = BackwardCharacterIterator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Position = (function () {
        function Position(value) {
            this.value = value;
            this.refCount = 0;
        }
        Position.prototype.incRefCount = function () {
            ++this.refCount;
        };
        Position.prototype.decRefCount = function () {
            --this.refCount;
        };
        Position.prototype.hasReference = function () {
            return this.refCount > 0;
        };
        return Position;
    }());
    __aspxRichEdit.Position = Position;
    var PositionManager = (function () {
        function PositionManager() {
            this.positions = [];
        }
        PositionManager.prototype.registerPosition = function (position) {
            var index = __aspxRichEdit.Utils.binaryIndexOf(this.positions, function (p) { return p.value - position; });
            if (index >= 0) {
                var findedPosition = this.positions[index];
                findedPosition.incRefCount();
                return findedPosition;
            }
            var indexWhereInsert = ~index;
            var newPosition = new Position(position);
            newPosition.incRefCount();
            this.positions.splice(indexWhereInsert, 0, newPosition);
            return newPosition;
        };
        PositionManager.prototype.unregisterPosition = function (position) {
            var exactIndex = this.findPosition(position);
            if (exactIndex != null) {
                var findedPosition = this.positions[exactIndex];
                findedPosition.decRefCount();
                if (!findedPosition.hasReference())
                    this.positions.splice(exactIndex, 1);
            }
            else
                throw new Error("PositionManager unregisterPosition: unregister nonexisted Position");
        };
        PositionManager.prototype.findPosition = function (position) {
            var index = __aspxRichEdit.Utils.binaryIndexOf(this.positions, function (p) { return p.value - position.value; });
            if (index >= 0) {
                var exactIndex;
                for (exactIndex = index; exactIndex >= 0 && this.positions[exactIndex].value == position.value; exactIndex--) {
                    if (this.positions[exactIndex] == position)
                        return exactIndex;
                }
                var positionsLength = this.positions.length;
                for (exactIndex = index + 1; exactIndex < positionsLength && this.positions[exactIndex].value == position.value; exactIndex++) {
                    if (this.positions[exactIndex] == position)
                        return exactIndex;
                }
            }
            return null;
        };
        PositionManager.prototype.reset = function () {
            this.positions = [];
        };
        PositionManager.prototype.advance = function (position, delta) {
            var index = __aspxRichEdit.Utils.binaryIndexOf(this.positions, function (p) { return p.value - position; });
            var advanceIndex = index >= 0 ? index : ~index;
            var positionsLength = this.positions.length;
            if (advanceIndex >= positionsLength)
                return;
            if (index >= 0)
                advanceIndex = this.correctPositionIndex(position, delta, advanceIndex);
            var i;
            for (i = advanceIndex; i < positionsLength; i++)
                this.positions[i].value += delta;
            if (delta < 0 && advanceIndex < positionsLength && advanceIndex >= 0) {
                for (i = advanceIndex; i < positionsLength && this.positions[i].value < position; i++)
                    this.positions[i].value = position;
            }
        };
        PositionManager.prototype.correctPositionIndex = function (position, delta, corrIndex) {
            if (delta < 0) {
                while (corrIndex < this.positions.length && this.positions[corrIndex].value == position)
                    corrIndex++;
            }
            else {
                while (corrIndex > 0 && this.positions[corrIndex - 1].value == this.positions[corrIndex].value)
                    corrIndex--;
            }
            return corrIndex;
        };
        return PositionManager;
    }());
    __aspxRichEdit.PositionManager = PositionManager;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RangePermission = (function (_super) {
        __extends(RangePermission, _super);
        function RangePermission(positionManager, interval, userName, group) {
            var _this = _super.call(this, positionManager, interval) || this;
            _this.userName = userName.toLowerCase();
            _this.group = group.toLowerCase();
            return _this;
        }
        RangePermission.prototype.isGranted = function (settings) {
            return RangePermission.allow(this.group, RangePermission.EVERYONE_GROUP_NAME) ||
                RangePermission.allow(this.userName, settings.authenticationUserName) ||
                RangePermission.allow(this.userName, settings.authenticationEMail) ||
                RangePermission.allow(this.group, settings.authenticationGroup);
        };
        RangePermission.allow = function (permissionValue, settingsValue) {
            return settingsValue != "" && permissionValue == settingsValue;
        };
        Object.defineProperty(RangePermission.prototype, "end", {
            get: function () { return this._interval.end - 1; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RangePermission.prototype, "length", {
            get: function () { return this.end - this.start; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RangePermission.prototype, "interval", {
            get: function () { return new __aspxRichEdit.BoundaryInterval(this.start, this.end); },
            enumerable: true,
            configurable: true
        });
        RangePermission.prototype.clone = function (positionManager) {
            return new RangePermission(positionManager, this.interval, this.userName, this.group);
        };
        RangePermission.EVERYONE_GROUP_NAME = "Everyone".toLowerCase();
        return RangePermission;
    }(__aspxRichEdit.BookmarkBase));
    __aspxRichEdit.RangePermission = RangePermission;
    var DocumentProtectionSettings = (function () {
        function DocumentProtectionSettings() {
            this.rangeVisibility = __aspxRichEdit.BookmarksVisibility.Auto;
            this.rangeHighlightColor = "rgb(164, 160, 0)";
            this.rangeHighlightBracketsColor = "rgb(255, 254, 213)";
            this.authenticationEMail = "";
            this.authenticationGroup = "";
            this.authenticationUserName = "";
        }
        return DocumentProtectionSettings;
    }());
    __aspxRichEdit.DocumentProtectionSettings = DocumentProtectionSettings;
    var HashAlgorithmType;
    (function (HashAlgorithmType) {
        HashAlgorithmType[HashAlgorithmType["None"] = 0] = "None";
        HashAlgorithmType[HashAlgorithmType["Md2"] = 1] = "Md2";
        HashAlgorithmType[HashAlgorithmType["Md4"] = 2] = "Md4";
        HashAlgorithmType[HashAlgorithmType["Md5"] = 3] = "Md5";
        HashAlgorithmType[HashAlgorithmType["Sha1"] = 4] = "Sha1";
        HashAlgorithmType[HashAlgorithmType["Mac"] = 5] = "Mac";
        HashAlgorithmType[HashAlgorithmType["Ripemd"] = 6] = "Ripemd";
        HashAlgorithmType[HashAlgorithmType["Ripemd160"] = 7] = "Ripemd160";
        HashAlgorithmType[HashAlgorithmType["HMac"] = 9] = "HMac";
        HashAlgorithmType[HashAlgorithmType["Sha256"] = 12] = "Sha256";
        HashAlgorithmType[HashAlgorithmType["Sha384"] = 13] = "Sha384";
        HashAlgorithmType[HashAlgorithmType["Sha512"] = 14] = "Sha512";
    })(HashAlgorithmType = __aspxRichEdit.HashAlgorithmType || (__aspxRichEdit.HashAlgorithmType = {}));
    var DocumentProtectionProperties = (function () {
        function DocumentProtectionProperties() {
        }
        return DocumentProtectionProperties;
    }());
    __aspxRichEdit.DocumentProtectionProperties = DocumentProtectionProperties;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SwitchTextCaseManipulator = (function () {
        function SwitchTextCaseManipulator(dispatcher) {
            this.dispatcher = dispatcher;
        }
        return SwitchTextCaseManipulator;
    }());
    __aspxRichEdit.SwitchTextCaseManipulator = SwitchTextCaseManipulator;
    var WordPart = (function () {
        function WordPart(position, text, type) {
            this.position = position;
            this.text = text;
            this.type = type;
        }
        WordPart.prototype.merge = function (pos, text, type) {
            if (this.position + this.text.length == pos && this.type == type && (type == __aspxRichEdit.LayoutBoxType.Text || type == __aspxRichEdit.LayoutBoxType.Dash || type == __aspxRichEdit.LayoutBoxType.Space)) {
                this.text += text;
                return true;
            }
            return false;
        };
        WordPart.prototype.getEndPosition = function () {
            return this.position + this.text.length;
        };
        return WordPart;
    }());
    __aspxRichEdit.WordPart = WordPart;
    var SentenceWord = (function () {
        function SentenceWord() {
            this.parts = [];
        }
        SentenceWord.prototype.getLastWordPart = function () {
            return this.parts[this.parts.length - 1];
        };
        return SentenceWord;
    }());
    __aspxRichEdit.SentenceWord = SentenceWord;
    var Sentence = (function () {
        function Sentence() {
            this.words = [];
        }
        Sentence.prototype.getLastWord = function () {
            return this.words[this.words.length - 1];
        };
        return Sentence;
    }());
    __aspxRichEdit.Sentence = Sentence;
    var SentenceStructureBuilder = (function () {
        function SentenceStructureBuilder(subDocument, layout, selection, interval) {
            this.currSentence = null;
            this.currWord = null;
            this.currWordPart = null;
            this.isSentenceEnd = false;
            this.isWordEnd = false;
            this.findEndLastSentence = false;
            this.subDocument = subDocument;
            this.layout = layout;
            this.interval = interval;
            this.sentences = [];
            this.selection = selection;
        }
        SentenceStructureBuilder.getBuilder = function (control, subDocument, layout, interval, splitByInterval) {
            var builder = new SentenceStructureBuilder(subDocument, layout, control.selection, interval);
            while (!builder.build())
                control.layoutFormatterManager.forceFormatPage(layout.validPageCount);
            if (splitByInterval)
                SentenceStructureBuilder.splitPartsByInterval(builder.sentences, interval);
            SentenceStructureBuilder.correctFirstSentence(builder.sentences);
            return builder;
        };
        SentenceStructureBuilder.correctFirstSentence = function (sentences) {
            var firstSentenceWords = sentences[0].words;
            for (var startFirstSentenceWordIndex = 0, word; word = firstSentenceWords[startFirstSentenceWordIndex]; startFirstSentenceWordIndex++) {
                var type = word.parts[0].type;
                if (type != __aspxRichEdit.LayoutBoxType.Space && type != __aspxRichEdit.LayoutBoxType.LineBreak && type != __aspxRichEdit.LayoutBoxType.TabSpace)
                    break;
            }
            if (startFirstSentenceWordIndex > 0 && startFirstSentenceWordIndex < firstSentenceWords.length) {
                var newFirstSentence = new Sentence();
                for (; startFirstSentenceWordIndex > 0; startFirstSentenceWordIndex--)
                    newFirstSentence.words.push(firstSentenceWords.shift());
                sentences.unshift(newFirstSentence);
            }
        };
        SentenceStructureBuilder.splitPartsByInterval = function (sentences, interval) {
            SentenceStructureBuilder.splitPartsByPosition(sentences, interval.start);
            SentenceStructureBuilder.splitPartsByPosition(sentences, interval.end);
        };
        SentenceStructureBuilder.splitPartsByPosition = function (sentences, position) {
            var sentenceIndex = Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(sentences, function (s) { return s.words[0].parts[0].position; }, position));
            var sentence = sentences[sentenceIndex];
            var wordIndex = Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(sentence.words, function (w) { return w.parts[0].position; }, position));
            var sentenceWord = sentence.words[wordIndex];
            for (var wordPartIndex = 0, part; part = sentenceWord.parts[wordPartIndex]; wordPartIndex++) {
                if (part.position > position)
                    break;
            }
            wordPartIndex = wordPartIndex > 0 ? wordPartIndex - 1 : 0;
            part = sentenceWord.parts[wordPartIndex];
            if (position > part.position && position < part.position + part.text.length) {
                sentenceWord.parts.splice(wordPartIndex + 1, 0, new WordPart(position, part.text.substr(position - part.position), part.type));
                part.text = part.text.substr(0, position - part.position);
            }
        };
        SentenceStructureBuilder.prototype.build = function () {
            var endPosition = this.subDocument.isMain() ? this.layout.getLastValidPage().getEndPosition() : this.layout.pages[this.selection.pageIndex].getEndPosition();
            if (this.findEndLastSentence) {
                this.interval = __aspxRichEdit.FixedInterval.fromPositions(this.interval.end, endPosition);
                this.layoutBoxIterator.resetToInterval(this.interval.start, this.interval.end);
                this.collect();
            }
            else {
                if (this.needCalculateMoreLayout())
                    return false;
                var firstSentenceStartPosition = this.findFirstSentenceStartPosition();
                this.layoutBoxIterator = this.subDocument.isMain() ? new __aspxRichEdit.LayoutBoxIteratorMainSubDocument(this.subDocument, this.layout, firstSentenceStartPosition, this.interval.end) : new __aspxRichEdit.LayoutBoxIteratorOtherSubDocument(this.subDocument, this.layout, firstSentenceStartPosition, this.interval.end, this.selection.pageIndex);
                this.addNewSentence();
                this.addNewWord();
                this.collect();
                this.findEndLastSentence = true;
            }
            if (this.currSentence.words.length == 1 && this.currWord.parts.length == 0) {
                this.sentences.pop();
                return true;
            }
            if (this.interval.end == endPosition)
                return this.layout.isFullyFormatted;
            else
                return this.build();
        };
        SentenceStructureBuilder.prototype.collect = function () {
            while (this.layoutBoxIterator.moveNext(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false))) {
                var layoutPos = this.layoutBoxIterator.position;
                if (this.lastBox && this.lastBox === layoutPos.box)
                    continue;
                this.lastBox = layoutPos.box;
                switch (layoutPos.box.getType()) {
                    case __aspxRichEdit.LayoutBoxType.Text:
                        var textBox = layoutPos.box;
                        for (var charIndex = layoutPos.charOffset, currAbsolutePosition = layoutPos.getLogPosition() + charIndex, char; char = textBox.text[charIndex]; charIndex++, currAbsolutePosition++) {
                            switch (char) {
                                case ".":
                                case ";":
                                    if (this.isSentenceEnd) {
                                        this.addNewSentence();
                                        this.addNewWord();
                                        if (this.findEndLastSentence)
                                            return;
                                    }
                                    this.addNewWordPart(currAbsolutePosition, char, __aspxRichEdit.LayoutBoxType.Text);
                                    this.isSentenceEnd = true;
                                    break;
                                case "!":
                                    var prevChar = __aspxRichEdit.StringUtils.getSymbolFromEnd(this.currWordPart.text, 1);
                                    if (this.isSentenceEnd && prevChar && prevChar != "!") {
                                        this.addNewSentence();
                                        this.addNewWord();
                                        if (this.findEndLastSentence)
                                            return;
                                    }
                                    this.addNewWordPart(currAbsolutePosition, char, __aspxRichEdit.LayoutBoxType.Text);
                                    this.isSentenceEnd = true;
                                    break;
                                case "?":
                                    var prevChar = __aspxRichEdit.StringUtils.getSymbolFromEnd(this.currWordPart.text, 1);
                                    if (this.isSentenceEnd && !(prevChar && prevChar == "!")) {
                                        this.addNewSentence();
                                        this.addNewWord();
                                        if (this.findEndLastSentence)
                                            return;
                                    }
                                    this.addNewWordPart(currAbsolutePosition, char, __aspxRichEdit.LayoutBoxType.Text);
                                    this.isSentenceEnd = true;
                                    break;
                                case __aspxRichEdit.RichUtils.specialCharacters.Dot:
                                case __aspxRichEdit.RichUtils.specialCharacters.Hyphen:
                                case __aspxRichEdit.RichUtils.specialCharacters.TrademarkSymbol:
                                case __aspxRichEdit.RichUtils.specialCharacters.CopyrightSymbol:
                                case __aspxRichEdit.RichUtils.specialCharacters.RegisteredTrademarkSymbol:
                                case __aspxRichEdit.RichUtils.specialCharacters.Ellipsis:
                                case __aspxRichEdit.RichUtils.specialCharacters.LeftDoubleQuote:
                                case __aspxRichEdit.RichUtils.specialCharacters.LeftSingleQuote:
                                case __aspxRichEdit.RichUtils.specialCharacters.RightDoubleQuote:
                                case __aspxRichEdit.RichUtils.specialCharacters.RightSingleQuote:
                                case __aspxRichEdit.RichUtils.specialCharacters.OpeningDoubleQuotationMark:
                                case __aspxRichEdit.RichUtils.specialCharacters.OpeningSingleQuotationMark:
                                case __aspxRichEdit.RichUtils.specialCharacters.ClosingDoubleQuotationMark:
                                case __aspxRichEdit.RichUtils.specialCharacters.ClosingSingleQuotationMark:
                                case __aspxRichEdit.RichUtils.specialCharacters.RegisteredTrademarkSymbol:
                                case __aspxRichEdit.RichUtils.specialCharacters.RegisteredTrademarkSymbol:
                                case ",":
                                case "@":
                                case "#":
                                case "$":
                                case "%":
                                case "^":
                                case "&":
                                case "*":
                                case "(":
                                case ")":
                                case "=":
                                case "+":
                                case "[":
                                case "]":
                                case "{":
                                case "}":
                                case "\\":
                                case "|":
                                case ":":
                                case "\'":
                                case "\"":
                                case "<":
                                case ">":
                                case "/":
                                case "~":
                                case "`":
                                    if (this.isWordEnd)
                                        this.addNewWord();
                                    this.addNewWordPart(currAbsolutePosition, char, __aspxRichEdit.LayoutBoxType.Text);
                                    this.isWordEnd = true;
                                    break;
                                default:
                                    if (this.isSentenceEnd) {
                                        this.addNewSentence();
                                        this.addNewWord();
                                        if (this.findEndLastSentence)
                                            return;
                                        this.isSentenceEnd = false;
                                        this.isWordEnd = false;
                                    }
                                    else if (this.isWordEnd) {
                                        this.addNewWord();
                                        this.isWordEnd = false;
                                    }
                                    this.addNewWordPart(currAbsolutePosition, char, __aspxRichEdit.LayoutBoxType.Text);
                                    break;
                            }
                        }
                        break;
                    case __aspxRichEdit.LayoutBoxType.SectionMark:
                    case __aspxRichEdit.LayoutBoxType.ParagraphMark:
                        this.addNewWordPart(layoutPos.getLogPosition(), " ", layoutPos.box.getType());
                        this.addNewSentence();
                        this.addNewWord();
                        if (this.findEndLastSentence)
                            return;
                        this.isSentenceEnd = false;
                        this.isWordEnd = false;
                        break;
                    case __aspxRichEdit.LayoutBoxType.Dash:
                    case __aspxRichEdit.LayoutBoxType.Space:
                    case __aspxRichEdit.LayoutBoxType.TabSpace:
                        this.addNewWordPart(layoutPos.getLogPosition(), " ", layoutPos.box.getType());
                        this.isWordEnd = true;
                        break;
                    default:
                        if (this.currWord.parts.length > 0)
                            this.addNewWord();
                        this.addNewWordPart(layoutPos.getLogPosition(), " ", layoutPos.box.getType());
                        this.addNewWord();
                        break;
                }
            }
        };
        SentenceStructureBuilder.prototype.addNewSentence = function () {
            this.currSentence = new Sentence();
            this.sentences.push(this.currSentence);
            this.currWord = null;
            this.currWordPart = null;
        };
        SentenceStructureBuilder.prototype.addNewWord = function () {
            this.currWord = new SentenceWord();
            this.currSentence.words.push(this.currWord);
            this.currWordPart = null;
        };
        SentenceStructureBuilder.prototype.addNewWordPart = function (pos, text, type) {
            var mergeSuccess = this.currWordPart && this.currWordPart.merge(pos, text, type);
            if (!mergeSuccess) {
                this.currWordPart = new WordPart(pos, text, type);
                this.currWord.parts.push(this.currWordPart);
            }
        };
        SentenceStructureBuilder.prototype.needCalculateMoreLayout = function () {
            var lastValidPage = this.subDocument.isMain() ? this.layout.getLastValidPage() : this.layout.pages[this.selection.pageIndex];
            return lastValidPage && (this.subDocument.isMain() ? lastValidPage.getEndPosition() : lastValidPage.otherPageAreas[this.subDocument.id].getEndPosition()) < this.interval.end;
        };
        SentenceStructureBuilder.prototype.findFirstSentenceStartPosition = function () {
            var layoutBoxIterator = this.subDocument.isMain() ? new __aspxRichEdit.LayoutBoxIteratorMainSubDocument(this.subDocument, this.layout, 0, this.interval.start) : new __aspxRichEdit.LayoutBoxIteratorOtherSubDocument(this.subDocument, this.layout, 0, this.interval.start, this.selection.pageIndex);
            var suspiciousPosition = -1;
            var isFindSentenceStart = false;
            while (layoutBoxIterator.movePrev(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true))) {
                var layoutPos = layoutBoxIterator.position;
                switch (layoutPos.box.getType()) {
                    case __aspxRichEdit.LayoutBoxType.Text:
                        var textBox = layoutPos.box;
                        var lastIndexBox = layoutPos.charOffset > 0 || layoutPos.getLogPosition() >= this.interval.start ? layoutPos.charOffset : textBox.text.length - 1;
                        for (var charIndex = lastIndexBox, char; char = textBox.text[charIndex]; charIndex--) {
                            switch (char) {
                                case ".":
                                case "!":
                                case "?":
                                case ";":
                                    if (layoutPos.getLogPosition() != this.interval.start)
                                        isFindSentenceStart = true;
                                    break;
                                default:
                                    suspiciousPosition = layoutPos.getLogPosition();
                                    break;
                            }
                            if (isFindSentenceStart)
                                break;
                        }
                        break;
                    case __aspxRichEdit.LayoutBoxType.SectionMark:
                    case __aspxRichEdit.LayoutBoxType.ParagraphMark:
                        layoutBoxIterator.moveNext(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
                        suspiciousPosition = layoutBoxIterator.position.getLogPosition();
                        isFindSentenceStart = true;
                        break;
                }
                if (isFindSentenceStart)
                    break;
            }
            if (suspiciousPosition < 0)
                return layoutBoxIterator.position.getLogPosition();
            else
                return suspiciousPosition;
        };
        return SentenceStructureBuilder;
    }());
    __aspxRichEdit.SentenceStructureBuilder = SentenceStructureBuilder;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var StylesManager = (function () {
        function StylesManager(documentModel) {
            this.characterStyleNameToIndex = {};
            this.paragraphStyleNameToIndex = {};
            this.numberingListStyleNameToIndex = {};
            this.tableStyleNameToIndex = {};
            this.tableCellStyleNameToIndex = {};
            this.documentModel = documentModel;
        }
        StylesManager.prototype.registerLink = function (characterStyle, paragraphStyle) {
            characterStyle.linkedStyle = paragraphStyle;
            paragraphStyle.linkedStyle = characterStyle;
        };
        StylesManager.prototype.unregisterLink = function (characterStyle, paragraphStyle) {
            characterStyle.linkedStyle = null;
            paragraphStyle.linkedStyle = null;
        };
        StylesManager.prototype.getCharacterStyleByName = function (styleName) {
            return StylesManager.getStyleByNameCore(styleName, this.documentModel.characterStyles, this.characterStyleNameToIndex);
        };
        StylesManager.prototype.getParagraphStyleByName = function (styleName) {
            return StylesManager.getStyleByNameCore(styleName, this.documentModel.paragraphStyles, this.paragraphStyleNameToIndex);
        };
        StylesManager.prototype.getNumberingListStyleByName = function (styleName) {
            return StylesManager.getStyleByNameCore(styleName, this.documentModel.numberingListStyles, this.numberingListStyleNameToIndex);
        };
        StylesManager.prototype.getTableStyleByName = function (styleName) {
            return StylesManager.getStyleByNameCore(styleName, this.documentModel.tableStyles, this.tableStyleNameToIndex);
        };
        StylesManager.prototype.getTableCellStyleByName = function (styleName) {
            return StylesManager.getStyleByNameCore(styleName, this.documentModel.tableCellStyles, this.tableCellStyleNameToIndex);
        };
        StylesManager.prototype.getDefaultCharacterStyle = function () {
            var _this = this;
            return this.defaultCharacterStyle || this.getDefaultStyleCore(this.documentModel.characterStyles, function (style) {
                _this.defaultCharacterStyle = style;
            });
        };
        StylesManager.prototype.getDefaultParagraphStyle = function () {
            var _this = this;
            return this.defaultParagraphStyle || this.getDefaultStyleCore(this.documentModel.paragraphStyles, function (style) {
                _this.defaultParagraphStyle = style;
            });
        };
        StylesManager.prototype.getDefaultTableStyle = function () {
            return this.getTableStyleByName(__aspxRichEdit.TableStyle.DEFAULT_STYLENAME) || this.getTableStyleByName(__aspxRichEdit.TableStyle.DEFAULT_STYLENAME_2) || this.documentModel.tableStyles[0] || null;
        };
        StylesManager.prototype.getDefaultTableCellStyle = function () {
            return this.getTableCellStyleByName(__aspxRichEdit.TableCellStyle.DEFAULT_STYLENAME) || this.documentModel.tableCellStyles[0] || null;
        };
        StylesManager.prototype.addCharacterStyle = function (style) {
            return style ? this.getCharacterStyleByName(style.styleName) || this.addCharacterStyleCore(style) : null;
        };
        StylesManager.prototype.removeLastStyle = function () {
            var style = this.documentModel.characterStyles.pop();
            delete this.characterStyleNameToIndex[style.styleName];
        };
        StylesManager.prototype.addParagraphStyle = function (style) {
            return style ? this.getParagraphStyleByName(style.styleName) || this.addParagraphStyleCore(style) : null;
        };
        StylesManager.prototype.addTableStyle = function (style) {
            return style ? this.getTableStyleByName(style.styleName) || this.addTableStyleCore(style) : null;
        };
        StylesManager.prototype.addTableCellStyle = function (style) {
            return style ? this.getTableCellStyleByName(style.styleName) || this.addTableCellStyleCore(style) : null;
        };
        StylesManager.prototype.addTableStyleCore = function (oldStyle) {
            var newStyle = oldStyle.clone();
            this.tableStyleNameToIndex[newStyle.styleName] = this.documentModel.tableStyles.push(newStyle) - 1;
            for (var type in oldStyle.conditionalStyles) {
                if (!oldStyle.conditionalStyles.hasOwnProperty(type))
                    continue;
                newStyle.conditionalStyles[type] = this.cloneTableConditionalStyle(oldStyle.conditionalStyles[type]);
            }
            return newStyle;
        };
        StylesManager.prototype.addTableCellStyleCore = function (oldStyle) {
            var newStyle = oldStyle.clone();
            newStyle.characterProperties = this.documentModel.cache.mergedCharacterPropertiesCache.getItem(oldStyle.characterProperties);
            newStyle.tableCellProperties = this.documentModel.cache.tableCellPropertiesCache.getItem(oldStyle.tableCellProperties);
            return newStyle;
        };
        StylesManager.prototype.cloneTableConditionalStyle = function (style) {
            var maskedCharacterProperties = style.maskedCharacterProperties;
            if (maskedCharacterProperties.fontInfo && maskedCharacterProperties.fontInfo.index === undefined)
                maskedCharacterProperties.fontInfo = this.documentModel.cache.fontInfoCache.getItemByName(maskedCharacterProperties.fontInfo.name);
            return new __aspxRichEdit.TableConditionalStyle(style.tableProperties.clone(), this.documentModel.cache.tableRowPropertiesCache.getItem(style.tableRowProperties), this.documentModel.cache.tableCellPropertiesCache.getItem(style.tableCellProperties), this.documentModel.cache.maskedParagraphPropertiesCache.getItem(style.maskedParagraphProperties), this.documentModel.cache.maskedCharacterPropertiesCache.getItem(maskedCharacterProperties), style.tabs.clone());
        };
        StylesManager.prototype.addCharacterStyleCore = function (oldStyle) {
            var newStyle = oldStyle.clone();
            this.characterStyleNameToIndex[newStyle.styleName] = this.documentModel.characterStyles.push(newStyle) - 1;
            var maskedCharacterProperties = oldStyle.maskedCharacterProperties;
            if (maskedCharacterProperties.fontInfo && maskedCharacterProperties.fontInfo.index === undefined)
                maskedCharacterProperties.fontInfo = this.documentModel.cache.fontInfoCache.getItemByName(maskedCharacterProperties.fontInfo.name);
            newStyle.maskedCharacterProperties = this.documentModel.cache.maskedCharacterPropertiesCache.getItem(maskedCharacterProperties);
            newStyle.parent = this.addCharacterStyle(oldStyle.parent);
            newStyle.linkedStyle = this.addParagraphStyle(oldStyle.linkedStyle);
            return newStyle;
        };
        StylesManager.prototype.addParagraphStyleCore = function (oldStyle) {
            var newStyle = oldStyle.clone();
            this.paragraphStyleNameToIndex[newStyle.styleName] = this.documentModel.paragraphStyles.push(newStyle) - 1;
            var maskedCharacterProperties = oldStyle.maskedCharacterProperties;
            if (maskedCharacterProperties.fontInfo && maskedCharacterProperties.fontInfo.index === undefined)
                maskedCharacterProperties.fontInfo = this.documentModel.cache.fontInfoCache.getItemByName(maskedCharacterProperties.fontInfo.name);
            newStyle.maskedCharacterProperties = this.documentModel.cache.maskedCharacterPropertiesCache.getItem(maskedCharacterProperties);
            newStyle.maskedParagraphProperties = this.documentModel.cache.maskedParagraphPropertiesCache.getItem(oldStyle.maskedParagraphProperties);
            newStyle.linkedStyle = this.addCharacterStyle(oldStyle.linkedStyle);
            newStyle.parent = this.addParagraphStyle(oldStyle.parent);
            return newStyle;
        };
        StylesManager.prototype.getDefaultStyleCore = function (styles, updateCache) {
            for (var i = 0, style; style = styles[i]; i++) {
                if (style.isDefault) {
                    updateCache(style);
                    return style;
                }
            }
        };
        StylesManager.getPresetCharacterStyleByName = function (styleName) {
            return this.getStyleByNameCore(styleName, this.presetCharacterStyles, this.presetCharacterStyleNameToIndex);
        };
        StylesManager.getPresetParagraphStyleByName = function (styleName) {
            return this.getStyleByNameCore(styleName, this.presetParagraphStyles, this.presetParagraphStyleNameToIndex);
        };
        StylesManager.getPresetTableStyleByName = function (styleName) {
            return this.getStyleByNameCore(styleName, this.presetTableStyles, this.presetTableStyleNameToIndex);
        };
        StylesManager.populatePresetStyles = function (stylesContainer) {
            if (StylesManager.presetCharacterStyles.length)
                return;
            var characterStylesContainer = stylesContainer[__aspxRichEdit.JSONStylesProperty.Character];
            var paragraphStylesContainer = stylesContainer[__aspxRichEdit.JSONStylesProperty.Paragraph];
            var tableStylesContainer = stylesContainer[__aspxRichEdit.JSONStylesProperty.Table];
            var documentCache = new __aspxRichEdit.DocumentCache();
            var webCaches = new __aspxRichEdit.WebCachesExporter(documentCache, stylesContainer[__aspxRichEdit.JSONStylesProperty.Caches], null);
            __aspxRichEdit.FontInfoCache.fillDefaultFonts(documentCache.fontInfoCache);
            StylesManager.populatePresetCharacterStyles(characterStylesContainer, documentCache);
            StylesManager.populatePresetParagraphStyles(paragraphStylesContainer, documentCache);
            StylesManager.populatePresetTableStyles(tableStylesContainer, documentCache);
            for (var i = 0, style = void 0; style = StylesManager.presetCharacterStyles[i]; i++) {
                var jsonStyle = characterStylesContainer[i];
                style.parent = StylesManager.getPresetCharacterStyleByName(jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.ParentStyleName]);
                var linkedStyleName = jsonStyle[__aspxRichEdit.JSONCharacterStyleProperty.LinkedStyleName];
                if (linkedStyleName !== undefined)
                    style.linkedStyle = StylesManager.getPresetParagraphStyleByName(linkedStyleName);
            }
            for (var i = 0, style = void 0; style = StylesManager.presetParagraphStyles[i]; i++) {
                var jsonStyle = paragraphStylesContainer[i];
                style.parent = StylesManager.getPresetParagraphStyleByName(jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.ParentStyleName]);
                var linkedStyleName = jsonStyle[__aspxRichEdit.JSONParagraphStyleProperty.LinkedStyleName];
                if (linkedStyleName !== undefined)
                    style.linkedStyle = StylesManager.getPresetCharacterStyleByName(linkedStyleName);
                var nextParStyleName = jsonStyle[__aspxRichEdit.JSONParagraphStyleProperty.NextParagraphStyleName];
                if (nextParStyleName !== undefined)
                    style.nextParagraphStyle = StylesManager.getPresetParagraphStyleByName(nextParStyleName);
            }
            for (var i = 0, style = void 0; style = StylesManager.presetTableStyles[i]; i++)
                style.parent = StylesManager.getPresetTableStyleByName(tableStylesContainer[i][__aspxRichEdit.JSONStyleBaseProperty.ParentStyleName]);
            webCaches.dispose();
        };
        StylesManager.populatePresetCharacterStyles = function (characterStylesContainer, cache) {
            StylesManager.presetCharacterStyles = [];
            if (characterStylesContainer) {
                for (var _i = 0, characterStylesContainer_1 = characterStylesContainer; _i < characterStylesContainer_1.length; _i++) {
                    var jsonStyle = characterStylesContainer_1[_i];
                    var styleName = jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.StyleName];
                    StylesManager.presetCharacterStyles.push(new __aspxRichEdit.CharacterStyle(styleName, StylesManager.presetStylesLocalizedNames[styleName] || jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.LocalizedStyleName], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Deleted], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Hidden], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Semihidden], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.IsDefault], cache.maskedCharacterPropertiesCache.getItemByJsonKey(jsonStyle[__aspxRichEdit.JSONCharacterStyleProperty.CharacterPropertiesCacheIndex]), jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Base64EncodedImage]));
                }
            }
        };
        StylesManager.populatePresetParagraphStyles = function (paragraphStylesContainer, cache) {
            StylesManager.presetParagraphStyles = [];
            if (paragraphStylesContainer) {
                for (var _i = 0, paragraphStylesContainer_1 = paragraphStylesContainer; _i < paragraphStylesContainer_1.length; _i++) {
                    var jsonStyle = paragraphStylesContainer_1[_i];
                    var styleName = jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.StyleName];
                    StylesManager.presetParagraphStyles.push(new __aspxRichEdit.ParagraphStyle(styleName, StylesManager.presetStylesLocalizedNames[styleName] || jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.LocalizedStyleName], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Deleted], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Hidden], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Semihidden], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.IsDefault], cache.maskedCharacterPropertiesCache.getItemByJsonKey(jsonStyle[__aspxRichEdit.JSONParagraphStyleProperty.CharacterPropertiesCacheIndex]), cache.maskedParagraphPropertiesCache.getItemByJsonKey(jsonStyle[__aspxRichEdit.JSONParagraphStyleProperty.ParagraphPropertiesCacheIndex]), __aspxRichEdit.JSONTabConverter.convertFromJSONToTabProperties(jsonStyle[__aspxRichEdit.JSONParagraphStyleProperty.Tabs]), !!jsonStyle[__aspxRichEdit.JSONParagraphStyleProperty.AutoUpdate], jsonStyle[__aspxRichEdit.JSONParagraphStyleProperty.NumberingListIndex], jsonStyle[__aspxRichEdit.JSONParagraphStyleProperty.ListLevelIndex], jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Base64EncodedImage]));
                }
            }
        };
        StylesManager.populatePresetTableStyles = function (tableStylesContainer, cache) {
            StylesManager.presetTableStyles = [];
            if (tableStylesContainer) {
                for (var _i = 0, tableStylesContainer_1 = tableStylesContainer; _i < tableStylesContainer_1.length; _i++) {
                    var jsonStyle = tableStylesContainer_1[_i];
                    var styleName = jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.StyleName];
                    StylesManager.presetTableStyles.push(new __aspxRichEdit.TableStyle(styleName, StylesManager.presetStylesLocalizedNames[styleName] || jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.LocalizedStyleName], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Deleted], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Hidden], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Semihidden], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.IsDefault], __aspxRichEdit.JSONTableConditionalStyleConverter.convertStylesFromJSON(jsonStyle[__aspxRichEdit.JSONTableStyleProperty.ConditionalStyles], cache), __aspxRichEdit.JSONTableConditionalStyleConverter.convertFromJSON(jsonStyle[__aspxRichEdit.JSONTableStyleProperty.BaseConditionalStyle], cache), jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Base64EncodedImage]));
                }
            }
        };
        StylesManager.getStyleByNameCore = function (styleName, styles, cache) {
            var styleIndex = cache[styleName];
            if (styleIndex === undefined) {
                for (var i = 0, style; style = styles[i]; i++) {
                    if (cache[style.styleName] === undefined)
                        cache[style.styleName] = i;
                    if (style.styleName === styleName)
                        return style;
                }
                return null;
            }
            else
                return styles[styleIndex];
        };
        StylesManager.characterPrefix = "CS-";
        StylesManager.paragraphPrefix = "PS-";
        StylesManager.presetStylesLocalizedNames = {};
        StylesManager.presetCharacterStyleNameToIndex = {};
        StylesManager.presetParagraphStyleNameToIndex = {};
        StylesManager.presetTableStyleNameToIndex = {};
        StylesManager.presetCharacterStyles = [];
        StylesManager.presetParagraphStyles = [];
        StylesManager.presetTableStyles = [];
        return StylesManager;
    }());
    __aspxRichEdit.StylesManager = StylesManager;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var WebSettings = (function () {
        function WebSettings() {
            this.leftMargin = 0;
            this.topMargin = 0;
            this.rightMargin = 0;
            this.bottomMargin = 0;
            this.id = 1;
        }
        WebSettings.prototype.isBodyMarginsSet = function () {
            return this.leftMargin != 0 || this.topMargin != 0 || this.rightMargin != 0 || this.bottomMargin != 0;
        };
        return WebSettings;
    }());
    __aspxRichEdit.WebSettings = WebSettings;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DragFloatingObjectsHelper = (function () {
        function DragFloatingObjectsHelper(control, resizeBoxVisualizer) {
            this.control = control;
            this.resizeBoxVisualizer = resizeBoxVisualizer;
        }
        DragFloatingObjectsHelper.prototype.start = function (evt) {
            var layout = this.control.layout;
            this.startPoint = __aspxRichEdit.Point.plus(evt.absolutePoint, evt.scroll);
            this.startLayoutPoint = evt.layoutPoint;
            this.startPageIndex = evt.layoutPoint.pageIndex;
            this.pageIndex = this.startPageIndex;
            this.box = layout.pages[this.startPageIndex].anchoredObjectHolder.getObjectByModelPosition(layout, this.control.selection.specialRunInfo.getPosition(), this.control.model.activeSubDocument.id);
            this.boxPoint = new __aspxRichEdit.Point(this.box.x, this.box.y);
            this.clickBoxDistance = __aspxRichEdit.Point.minus(this.startLayoutPoint, this.boxPoint);
        };
        DragFloatingObjectsHelper.prototype.move = function (evt) {
            this.pageIndex = evt.layoutPoint.pageIndex;
            var newPoint = __aspxRichEdit.Point.minus(evt.layoutPoint, this.clickBoxDistance);
            this.resizeBoxVisualizer.showAtPos(this.pageIndex, newPoint);
        };
        DragFloatingObjectsHelper.prototype.end = function (evt) {
            var delta = this.getDelta(evt);
            if (delta.isZero() || !evt.layoutPoint)
                return;
            var endPageIndex = evt.layoutPoint.pageIndex;
            var newPosition = __aspxRichEdit.Point.minus(evt.layoutPoint, this.clickBoxDistance);
            this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.FloatingObjectDragDropChangePosition).execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.FloatingObjectDragDropChangePositionCommandParameters(this.control, this.startPageIndex, endPageIndex, newPosition, evt.layoutPoint.point));
            this.control.layoutFormatterManager.forceFormatPage(endPageIndex);
            endPageIndex = Math.min(endPageIndex, this.control.layout.pages.length);
            var page = this.control.layout.pages[endPageIndex];
            var box = page.anchoredObjectHolder
                .getObjectByModelPosition(this.control.layout, this.control.selection.specialRunInfo.getPosition(), this.control.model.activeSubDocument.id);
            this.resizeBoxVisualizer.show(endPageIndex, null, null, null, box);
        };
        DragFloatingObjectsHelper.prototype.rollback = function () {
            this.resizeBoxVisualizer.showAtPos(this.startPageIndex, this.boxPoint);
            this.control.history.endTransaction();
        };
        DragFloatingObjectsHelper.prototype.getDelta = function (evt) {
            return __aspxRichEdit.Point.minus(__aspxRichEdit.Point.plus(evt.absolutePoint, evt.scroll), this.startPoint);
        };
        return DragFloatingObjectsHelper;
    }());
    __aspxRichEdit.DragFloatingObjectsHelper = DragFloatingObjectsHelper;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ResizeBoxHelper = (function () {
        function ResizeBoxHelper(control, resizeBoxVisualizer) {
            this.control = control;
            this.resizeBoxVisualizer = resizeBoxVisualizer;
        }
        ResizeBoxHelper.prototype.start = function (evt) {
            var specialRunInfo = this.control.selection.specialRunInfo;
            var pos = specialRunInfo.getPosition();
            var run = this.control.model.activeSubDocument.getRunByPosition(pos);
            if (specialRunInfo.isSelectedAnchorObject) {
                var parentSubDoc = specialRunInfo.getParentSubDocument();
                var finder = new __aspxRichEdit.LayoutAnchorObjectFinder(this.control.layout, pos, parentSubDoc.id, parentSubDoc.isHeaderFooter() ? this.control.selection.pageIndex : undefined);
                this.startSize = new __aspxRichEdit.Size(finder.obj.width, finder.obj.height);
            }
            else
                this.startSize = new __aspxRichEdit.Size(__aspxRichEdit.UnitConverter.twipsToPixels(run.size.getActualWidth()), __aspxRichEdit.UnitConverter.twipsToPixels(run.size.getActualHeight()));
            this.lockAspectRatio = run.size.lockAspectRatio;
            this.rotation = __aspxRichEdit.UnitConverter.modelUnitsToDegrees(run.size.rotation) * Math.PI / 180;
            this.startX = evt.absolutePoint.x;
            this.startY = evt.absolutePoint.y;
            this.startScrollLeft = evt.scroll.x;
            this.startScrollTop = evt.scroll.y;
            this.lockH = evt.source == __aspxRichEdit.MouseEventSource.ResizeBox_S || evt.source == __aspxRichEdit.MouseEventSource.ResizeBox_N;
            this.lockV = evt.source == __aspxRichEdit.MouseEventSource.ResizeBox_E || evt.source == __aspxRichEdit.MouseEventSource.ResizeBox_W;
            this.sideH = evt.source == __aspxRichEdit.MouseEventSource.ResizeBox_E || evt.source == __aspxRichEdit.MouseEventSource.ResizeBox_NE || evt.source == __aspxRichEdit.MouseEventSource.ResizeBox_SE;
            this.sideV = evt.source == __aspxRichEdit.MouseEventSource.ResizeBox_SE || evt.source == __aspxRichEdit.MouseEventSource.ResizeBox_S || evt.source == __aspxRichEdit.MouseEventSource.ResizeBox_SW;
        };
        ResizeBoxHelper.prototype.move = function (evt) {
            this.size = this.getSize(evt);
            this.positionDelta = this.getPositionDelta(this.size);
            this.resizeBoxVisualizer.recalculate(this.size, this.positionDelta, null);
        };
        ResizeBoxHelper.prototype.end = function (evt) {
            var run = this.control.model.activeSubDocument.getRunByPosition(this.control.selection.specialRunInfo.getPosition());
            if (!this.size) {
                this.size = this.getSize(evt);
                this.positionDelta = this.getPositionDelta(this.size);
            }
            if (run.getType() == __aspxRichEdit.RunType.InlinePictureRun) {
                var changeInlinePictureScaleCommand = this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeInlinePictureScale);
                var originalSize = run.size.originalSize;
                var newWidth = __aspxRichEdit.UnitConverter.pixelsToTwips(100 * this.size.width / originalSize.width);
                var newHeight = __aspxRichEdit.UnitConverter.pixelsToTwips(100 * this.size.height / originalSize.height);
                changeInlinePictureScaleCommand.execute(this.control.commandManager.isPublicApiCall, [newWidth, newHeight]);
            }
            else {
                var layoutOptionsCommand = this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowLayoutOptionsForm);
                var params = layoutOptionsCommand.createParameters(new __aspxRichEdit.CommandOptions(this.control));
                var initParams = params.clone();
                params.useAbsoluteWidth = true;
                params.useAbsoluteHeight = true;
                params.absoluteWidth = __aspxRichEdit.UnitConverter.pixelsToTwips(this.size.width);
                params.absoluteHeight = __aspxRichEdit.UnitConverter.pixelsToTwips(this.size.height);
                params.offsetX = params.offsetX + __aspxRichEdit.UnitConverter.pixelsToTwips(this.positionDelta.width);
                params.offsetY = params.offsetY + __aspxRichEdit.UnitConverter.pixelsToTwips(this.positionDelta.height);
                layoutOptionsCommand.applyParameters(layoutOptionsCommand.getState(), params, initParams);
            }
        };
        ResizeBoxHelper.prototype.getSize = function (evt) {
            var absDeltaX = evt.absolutePoint.x - (this.startScrollLeft - evt.scroll.x) - this.startX;
            var absDeltaY = evt.absolutePoint.y - (this.startScrollTop - evt.scroll.y) - this.startY;
            var deltaX = absDeltaX * Math.cos(this.rotation) - (-absDeltaY) * Math.sin(this.rotation);
            var deltaY = -(absDeltaX * Math.sin(this.rotation) + (-absDeltaY) * Math.cos(this.rotation));
            var newWidth, newHeight;
            deltaY = !this.sideV && deltaY > 0 ? Math.min(this.startSize.height + 1, deltaY) : deltaY;
            deltaX = !this.sideH && deltaX > 0 ? Math.min(this.startSize.width + 1, deltaX) : deltaX;
            if (!this.lockH && !this.lockV && this.lockAspectRatio) {
                if (Math.abs(deltaX) > Math.abs(deltaY)) {
                    newWidth = this.sideH ? Math.max(1, this.startSize.width + deltaX) : (this.startSize.width - deltaX);
                    newHeight = this.startSize.height * (newWidth / this.startSize.width);
                }
                else {
                    newHeight = this.sideV ? Math.max(1, this.startSize.height + deltaY) : (this.startSize.height - deltaY);
                    newWidth = this.startSize.width * (newHeight / this.startSize.height);
                }
            }
            else {
                deltaX = this.lockH ? 0 : deltaX;
                deltaY = this.lockV ? 0 : deltaY;
                newWidth = Math.max(1, this.sideH ? (this.startSize.width + deltaX) : (this.startSize.width - deltaX));
                newHeight = Math.max(1, this.sideV ? (this.startSize.height + deltaY) : (this.startSize.height - deltaY));
            }
            return new __aspxRichEdit.Size(newWidth, newHeight);
        };
        ResizeBoxHelper.prototype.getPositionDelta = function (newSize) {
            var deltaWidth = this.startSize.width - newSize.width;
            var deltaHeight = this.startSize.height - newSize.height;
            var halfDeltaWidth = (!this.lockV && (this.sideH && !this.sideV || !this.sideH && this.sideV) ? -deltaWidth : deltaWidth) / 2;
            var halfDeltaHeight = deltaHeight / 2;
            var deltaX = halfDeltaWidth * Math.cos(this.rotation) - halfDeltaHeight * Math.sin(this.rotation);
            var deltaY = halfDeltaHeight * Math.cos(this.rotation) + halfDeltaWidth * Math.sin(this.rotation);
            if ((this.sideH || this.sideV) && !(!this.lockV && this.sideH && !this.sideV)) {
                deltaX = -deltaX;
                deltaY = -deltaY;
            }
            return new __aspxRichEdit.Size(deltaX + deltaWidth / 2, deltaY + deltaHeight / 2);
        };
        return ResizeBoxHelper;
    }());
    __aspxRichEdit.ResizeBoxHelper = ResizeBoxHelper;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ResizeTableHelperBase = (function () {
        function ResizeTableHelperBase(control, resizeTableVisualizer, evt) {
            this.setAdaptors();
            this.control = control;
            this.resizeTableVisualizer = resizeTableVisualizer;
            var sourceElement = REWebUtils.Evt.GetEventSource(evt.mouseEvent);
            this.setIndexes(sourceElement);
            if (!this.isInited())
                return;
            var pageAreaPlusColumn = this.getPartialLayoutPosition(evt.layoutPoint.pageIndex);
            this.columnBoundsRelativePage = new __aspxRichEdit.Rectangle();
            this.columnBoundsRelativePage.copyFrom(pageAreaPlusColumn.pageArea);
            this.columnBoundsRelativePage.applyXOffset(pageAreaPlusColumn.column.x).applyYOffset(pageAreaPlusColumn.column.y);
            this.sourceElementSize = new __aspxRichEdit.Size(sourceElement.offsetWidth, sourceElement.offsetHeight);
            this.startPositionRelativeTable = new __aspxRichEdit.Point(REWebUtils.PxToInt(sourceElement.style.left), REWebUtils.PxToInt(sourceElement.style.top));
            this.pointDirAdp.init(this.startPositionRelativeTable).position += Math.round(this.sizeDirAdp.init(this.sourceElementSize).length / 2);
            this.pointDirAdp.anotherPosition = 0;
            this.currPositionRelativeTable = this.startPositionRelativeTable.clone();
            var lineSize = new __aspxRichEdit.Size(this.layoutTable.width, this.layoutTable.height);
            this.sizeDirAdp.init(lineSize).length = 1;
            this.resizeTableVisualizer.init(evt.layoutPoint.pageIndex, lineSize);
            this.updateVisualizer();
            this.setSpecific();
        }
        ResizeTableHelperBase.prototype.isInited = function () {
            return this.tableIndex !== undefined;
        };
        ResizeTableHelperBase.prototype.move = function (evt) {
            if (!evt.layoutPoint || !this.isInited())
                return;
            var currPosRelativeTable = this.pointDirAdp.init(evt.layoutPoint.point).position -
                this.rectDirAdp.init(this.columnBoundsRelativePage).position -
                this.rectDirAdp.init(this.layoutTable).position;
            if (currPosRelativeTable >= this.minValueRelativeTable && currPosRelativeTable <= this.maxValueRelativeTable) {
                this.pointDirAdp.init(this.currPositionRelativeTable).position = currPosRelativeTable;
                this.updateVisualizer();
            }
        };
        ResizeTableHelperBase.prototype.end = function (evt) {
            if (!this.isInited())
                return;
            this.move(evt);
            if (Math.abs(this.pointDirAdp.init(this.currPositionRelativeTable).position - this.pointDirAdp.init(this.startPositionRelativeTable).position)
                > ResizeTableHelperBase.DIFFERENT_BY_PIXELS_ALLOW_CHANGE_MODEL)
                this.applyChanges();
            this.resizeTableVisualizer.hide();
        };
        ResizeTableHelperBase.prototype.updateVisualizer = function () {
            this.resizeTableVisualizer.show(new __aspxRichEdit.Point(this.columnBoundsRelativePage.x + this.layoutTable.x + this.currPositionRelativeTable.x, this.columnBoundsRelativePage.y + this.layoutTable.y + this.currPositionRelativeTable.y));
        };
        ResizeTableHelperBase.prototype.getPartialLayoutPosition = function (pageIndex) {
            var _this = this;
            var page = this.control.layout.pages[pageIndex];
            var subDocument = this.control.model.activeSubDocument;
            if (!subDocument.isMain()) {
                var pageArea = page.otherPageAreas[subDocument.id];
                var column = pageArea.columns[0];
                this.layoutTable = ResizeTableHelperBase.getLayoutTable(column, this.tableIndex);
                return new PageAreaPlusColumn(pageArea, column);
            }
            return __aspxRichEdit.ListUtils.anyOf(page.mainSubDocumentPageAreas, function (pageArea) {
                var column = __aspxRichEdit.ListUtils.anyOf(pageArea.columns, function (column) {
                    return (_this.layoutTable = ResizeTableHelperBase.getLayoutTable(column, _this.tableIndex)) ? column : null;
                });
                return column ? new PageAreaPlusColumn(pageArea, column) : null;
            });
        };
        ResizeTableHelperBase.getLayoutTable = function (column, tableIndex) {
            return __aspxRichEdit.ListUtils.elementBy(column.tablesInfo, function (tInfo) { return tInfo.logicInfo.grid.table.index == tableIndex; });
        };
        ResizeTableHelperBase.prototype.setIndexes = function (sourceElement) {
            this.tableIndex = sourceElement.parentNode["dxTableIndex"];
        };
        ResizeTableHelperBase.DIFFERENT_BY_PIXELS_ALLOW_CHANGE_MODEL = 5;
        ResizeTableHelperBase.TABLE_SEPARATOR_DIVISION_MARGIN_X = 7;
        ResizeTableHelperBase.TABLE_SEPARATOR_DIVISION_MARGIN_Y = 7;
        return ResizeTableHelperBase;
    }());
    __aspxRichEdit.ResizeTableHelperBase = ResizeTableHelperBase;
    var ResizeRowTableHelper = (function (_super) {
        __extends(ResizeRowTableHelper, _super);
        function ResizeRowTableHelper() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ResizeRowTableHelper.prototype.setAdaptors = function () {
            this.rectDirAdp = new __aspxRichEdit.RectangleDirectionAdaptorY();
            this.pointDirAdp = new __aspxRichEdit.PointDirectionAdaptorY();
            this.sizeDirAdp = new __aspxRichEdit.SizeDirectionAdaptorY();
        };
        ResizeRowTableHelper.canHandleResize = function (evt) {
            return REWebUtils.Evt.GetEventSource(evt.mouseEvent).className.indexOf(__aspxRichEdit.DocumentRenderer.CLASSNAMES.TABLE_ROW_CURSOR) > -1;
        };
        ResizeRowTableHelper.prototype.isInited = function () {
            return _super.prototype.isInited.call(this) && this.layoutRowIndex !== undefined;
        };
        ResizeRowTableHelper.prototype.setIndexes = function (sourceElement) {
            _super.prototype.setIndexes.call(this, sourceElement);
            this.layoutRowIndex = sourceElement["dxLayoutRowIndex"];
        };
        ResizeRowTableHelper.prototype.setSpecific = function () {
            if (!this.isInited())
                return;
            this.minValueRelativeTable = this.layoutTable.tableRows[this.layoutRowIndex].y - this.layoutTable.y + ResizeTableHelperBase.TABLE_SEPARATOR_DIVISION_MARGIN_Y;
            this.maxValueRelativeTable = this.columnBoundsRelativePage.height - this.layoutTable.y;
        };
        ResizeRowTableHelper.prototype.applyChanges = function () {
            if (!this.isInited())
                return;
            this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.RulerChangeTableRowHeight).execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.RulerChangeTableRowHeightCommandParameters(this.tableIndex, this.currPositionRelativeTable.y - this.startPositionRelativeTable.y, this.layoutTable, this.layoutRowIndex));
        };
        return ResizeRowTableHelper;
    }(ResizeTableHelperBase));
    __aspxRichEdit.ResizeRowTableHelper = ResizeRowTableHelper;
    var ResizeColumnTableHelper = (function (_super) {
        __extends(ResizeColumnTableHelper, _super);
        function ResizeColumnTableHelper() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ResizeColumnTableHelper.prototype.setAdaptors = function () {
            this.rectDirAdp = new __aspxRichEdit.RectangleDirectionAdaptorX();
            this.pointDirAdp = new __aspxRichEdit.PointDirectionAdaptorX();
            this.sizeDirAdp = new __aspxRichEdit.SizeDirectionAdaptorX();
        };
        ResizeColumnTableHelper.canHandleResize = function (evt) {
            return REWebUtils.Evt.GetEventSource(evt.mouseEvent).className.indexOf(__aspxRichEdit.DocumentRenderer.CLASSNAMES.TABLE_COLUMN_CURSOR) > -1;
        };
        ResizeColumnTableHelper.prototype.applyChanges = function () {
            this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.RulerChangeTableColumnWidth).execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.RulerChangeTableColumnWidthCommandParameters(this.tableIndex, this.currPositionRelativeTable.x - this.startPositionRelativeTable.x, this.layoutTable, this.startPositionRelativeTable.x + this.layoutTable.x, false));
        };
        ResizeColumnTableHelper.prototype.setSpecific = function () {
            var columnsXPositions = this.layoutTable.logicInfo.grid.columns.positions;
            var columnIndex = ResizeColumnTableHelper.findNearestColumnIndex(columnsXPositions, this.startPositionRelativeTable.x);
            this.minValueRelativeTable = (columnIndex == 0 ? -this.layoutTable.x : columnsXPositions[columnIndex - 1] + ResizeTableHelperBase.TABLE_SEPARATOR_DIVISION_MARGIN_X);
            this.maxValueRelativeTable = columnIndex == columnsXPositions.length - 1 ?
                Number.MAX_VALUE :
                columnsXPositions[columnIndex + 1] - ResizeTableHelperBase.TABLE_SEPARATOR_DIVISION_MARGIN_X;
        };
        ResizeColumnTableHelper.findNearestColumnIndex = function (columnsXPositions, xPosRelativeTable) {
            var centralColumnIndex = Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(columnsXPositions, function (x) { return x; }, xPosRelativeTable));
            var columnIndexes = [centralColumnIndex];
            if (centralColumnIndex + 1 < columnsXPositions.length)
                columnIndexes.push(centralColumnIndex + 1);
            if (centralColumnIndex - 1 > 0)
                columnIndexes.unshift(centralColumnIndex - 1);
            return __aspxRichEdit.ListUtils.min(columnIndexes, function (a, b) {
                return Math.abs(columnsXPositions[a] - xPosRelativeTable) - Math.abs(columnsXPositions[b] - xPosRelativeTable);
            });
        };
        return ResizeColumnTableHelper;
    }(ResizeTableHelperBase));
    __aspxRichEdit.ResizeColumnTableHelper = ResizeColumnTableHelper;
    var PageAreaPlusColumn = (function () {
        function PageAreaPlusColumn(pageArea, column) {
            this.pageArea = pageArea;
            this.column = column;
        }
        return PageAreaPlusColumn;
    }());
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RotateBoxHelper = (function () {
        function RotateBoxHelper(control, resizeBoxVisualizer) {
            this.control = control;
            this.resizeBoxVisualizer = resizeBoxVisualizer;
        }
        RotateBoxHelper.prototype.start = function (evt) {
            var page = this.control.layout.pages[evt.layoutPoint.pageIndex];
            var subDocId = this.control.model.activeSubDocument.id;
            var box = page.anchoredObjectHolder.getObjectByModelPosition(this.control.layout, this.control.selection.specialRunInfo.getPosition(), subDocId);
            this.centerPoint = box.center;
        };
        RotateBoxHelper.prototype.move = function (evt) {
            this.resizeBoxVisualizer.recalculate(null, null, this.getRotation(this.centerPoint, evt.layoutPoint));
        };
        RotateBoxHelper.prototype.end = function (evt) {
            var newRotation = this.getRotation(this.centerPoint, evt.layoutPoint);
            var layoutOptionsCommand = this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowLayoutOptionsForm);
            var params = layoutOptionsCommand.createParameters(new __aspxRichEdit.CommandOptions(this.control));
            var initParams = params.clone();
            params.rotation = __aspxRichEdit.UnitConverter.radiansToDegrees(newRotation);
            layoutOptionsCommand.applyParameters(layoutOptionsCommand.getState(), params, initParams);
            this.resizeBoxVisualizer.recalculate(null, null, newRotation);
        };
        RotateBoxHelper.prototype.getRotation = function (center, point) {
            var rotation = Math.atan2(center.y - point.y, center.x - point.x);
            rotation -= Math.PI / 2;
            rotation = (rotation < 0) ? rotation + 2 * Math.PI : rotation;
            var delta = 0.05;
            var correctingValues = [0, Math.PI / 2, Math.PI, 3 * Math.PI / 2, 2 * Math.PI];
            for (var i = 0; i < correctingValues.length; i++)
                if (Math.abs(rotation - correctingValues[i]) < delta)
                    rotation = correctingValues[i];
            if (rotation == 2 * Math.PI)
                rotation = 0;
            return rotation;
        };
        return RotateBoxHelper;
    }());
    __aspxRichEdit.RotateBoxHelper = RotateBoxHelper;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ControlOptions = (function () {
        function ControlOptions() {
            this.copy = DocumentCapability.Default;
            this.createNew = DocumentCapability.Default;
            this.cut = DocumentCapability.Default;
            this.drag = DocumentCapability.Default;
            this.drop = DocumentCapability.Default;
            this.open = DocumentCapability.Default;
            this.paste = DocumentCapability.Default;
            this.printing = DocumentCapability.Default;
            this.save = DocumentCapability.Default;
            this.saveAs = DocumentCapability.Default;
            this.download = DocumentCapability.Default;
            this.fullScreen = DocumentCapability.Default;
            this.tabMarker = __aspxRichEdit.RichUtils.specialCharacters.TabMark;
            this.pageBreakInsertMode = PageBreakInsertMode.NewLine;
            this.characterFormatting = DocumentCapability.Default;
            this.characterStyle = DocumentCapability.Default;
            this.fields = DocumentCapability.Default;
            this.hyperlinks = DocumentCapability.Default;
            this.inlinePictures = DocumentCapability.Default;
            this.paragraphFormatting = DocumentCapability.Default;
            this.paragraphs = DocumentCapability.Default;
            this.paragraphStyle = DocumentCapability.Default;
            this.paragraphTabs = DocumentCapability.Default;
            this.sections = DocumentCapability.Default;
            this.tabSymbol = DocumentCapability.Default;
            this.undo = DocumentCapability.Default;
            this.bookmarks = DocumentCapability.Default;
            this.numberingBulleted = DocumentCapability.Default;
            this.numberingMultiLevel = DocumentCapability.Default;
            this.numberingSimple = DocumentCapability.Default;
            this.headersFooters = DocumentCapability.Default;
            this.tables = DocumentCapability.Default;
            this.tableStyle = DocumentCapability.Default;
            this.floatingObjects = DocumentCapability.Default;
            this.acceptsTab = true;
            this.raiseClientEventsOnModificationsViaAPI = true;
        }
        ControlOptions.isEnabled = function (capability) {
            return capability === DocumentCapability.Default || capability === DocumentCapability.Enabled;
        };
        ControlOptions.isVisible = function (capability) {
            return capability !== DocumentCapability.Hidden;
        };
        return ControlOptions;
    }());
    __aspxRichEdit.ControlOptions = ControlOptions;
    var DocumentCapability;
    (function (DocumentCapability) {
        DocumentCapability[DocumentCapability["Default"] = 0] = "Default";
        DocumentCapability[DocumentCapability["Disabled"] = 1] = "Disabled";
        DocumentCapability[DocumentCapability["Enabled"] = 2] = "Enabled";
        DocumentCapability[DocumentCapability["Hidden"] = 3] = "Hidden";
    })(DocumentCapability = __aspxRichEdit.DocumentCapability || (__aspxRichEdit.DocumentCapability = {}));
    var PageBreakInsertMode;
    (function (PageBreakInsertMode) {
        PageBreakInsertMode[PageBreakInsertMode["NewLine"] = 0] = "NewLine";
        PageBreakInsertMode[PageBreakInsertMode["CurrentLine"] = 1] = "CurrentLine";
    })(PageBreakInsertMode = __aspxRichEdit.PageBreakInsertMode || (__aspxRichEdit.PageBreakInsertMode = {}));
    var BookmarksVisibility;
    (function (BookmarksVisibility) {
        BookmarksVisibility[BookmarksVisibility["Auto"] = 0] = "Auto";
        BookmarksVisibility[BookmarksVisibility["Visible"] = 1] = "Visible";
        BookmarksVisibility[BookmarksVisibility["Hidden"] = 2] = "Hidden";
    })(BookmarksVisibility = __aspxRichEdit.BookmarksVisibility || (__aspxRichEdit.BookmarksVisibility = {}));
    var MailMergeOptions = (function () {
        function MailMergeOptions() {
            this.isEnabled = false;
            this.viewMergedData = false;
            this.activeRecordIndex = 0;
            this.recordCount = 0;
        }
        return MailMergeOptions;
    }());
    __aspxRichEdit.MailMergeOptions = MailMergeOptions;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InnerClientProperties = (function () {
        function InnerClientProperties(viewsSettings) {
            this.showHiddenSymbols = false;
            this.showTableGridLines = false;
            this.viewsSettings = new ViewsSettings();
            this.viewsSettings.copyFrom(viewsSettings);
        }
        return InnerClientProperties;
    }());
    __aspxRichEdit.InnerClientProperties = InnerClientProperties;
    var ViewsSettings = (function () {
        function ViewsSettings() {
            this.viewType = ViewType.PrintLayout;
            this.paddings = new __aspxRichEdit.Margins(15, 15, 15, 15);
        }
        Object.defineProperty(ViewsSettings.prototype, "widthOfContent", {
            get: function () { return this.widthOfPage - this.paddings.getHorizontalMargins(); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ViewsSettings.prototype, "isSimpleView", {
            get: function () { return this.viewType == ViewType.Simple; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ViewsSettings.prototype, "isPrintLayoutView", {
            get: function () { return this.viewType == ViewType.PrintLayout; },
            enumerable: true,
            configurable: true
        });
        ViewsSettings.prototype.copyFrom = function (obj) {
            this.paddings = new __aspxRichEdit.Margins(obj.paddings.left, obj.paddings.right, obj.paddings.top, obj.paddings.bottom);
            this.viewType = obj.viewType;
            this.widthOfPage = obj.widthOfPage;
        };
        return ViewsSettings;
    }());
    __aspxRichEdit.ViewsSettings = ViewsSettings;
    var ViewType;
    (function (ViewType) {
        ViewType[ViewType["Simple"] = 0] = "Simple";
        ViewType[ViewType["PrintLayout"] = 1] = "PrintLayout";
    })(ViewType = __aspxRichEdit.ViewType || (__aspxRichEdit.ViewType = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var PaperKind;
    (function (PaperKind) {
        PaperKind[PaperKind["Custom"] = 0] = "Custom";
        PaperKind[PaperKind["Letter"] = 1] = "Letter";
        PaperKind[PaperKind["LetterSmall"] = 2] = "LetterSmall";
        PaperKind[PaperKind["Tabloid"] = 3] = "Tabloid";
        PaperKind[PaperKind["Ledger"] = 4] = "Ledger";
        PaperKind[PaperKind["Legal"] = 5] = "Legal";
        PaperKind[PaperKind["Statement"] = 6] = "Statement";
        PaperKind[PaperKind["Executive"] = 7] = "Executive";
        PaperKind[PaperKind["A3"] = 8] = "A3";
        PaperKind[PaperKind["A4"] = 9] = "A4";
        PaperKind[PaperKind["A4Small"] = 10] = "A4Small";
        PaperKind[PaperKind["A5"] = 11] = "A5";
        PaperKind[PaperKind["B4"] = 12] = "B4";
        PaperKind[PaperKind["B5"] = 13] = "B5";
        PaperKind[PaperKind["Folio"] = 14] = "Folio";
        PaperKind[PaperKind["Quarto"] = 15] = "Quarto";
        PaperKind[PaperKind["Standard10x14"] = 16] = "Standard10x14";
        PaperKind[PaperKind["Standard11x17"] = 17] = "Standard11x17";
        PaperKind[PaperKind["Note"] = 18] = "Note";
        PaperKind[PaperKind["Number9Envelope"] = 19] = "Number9Envelope";
        PaperKind[PaperKind["Number10Envelope"] = 20] = "Number10Envelope";
        PaperKind[PaperKind["Number11Envelope"] = 21] = "Number11Envelope";
        PaperKind[PaperKind["Number12Envelope"] = 22] = "Number12Envelope";
        PaperKind[PaperKind["Number14Envelope"] = 23] = "Number14Envelope";
        PaperKind[PaperKind["CSheet"] = 24] = "CSheet";
        PaperKind[PaperKind["DSheet"] = 25] = "DSheet";
        PaperKind[PaperKind["ESheet"] = 26] = "ESheet";
        PaperKind[PaperKind["DLEnvelope"] = 27] = "DLEnvelope";
        PaperKind[PaperKind["C5Envelope"] = 28] = "C5Envelope";
        PaperKind[PaperKind["C3Envelope"] = 29] = "C3Envelope";
        PaperKind[PaperKind["C4Envelope"] = 30] = "C4Envelope";
        PaperKind[PaperKind["C6Envelope"] = 31] = "C6Envelope";
        PaperKind[PaperKind["C65Envelope"] = 32] = "C65Envelope";
        PaperKind[PaperKind["B4Envelope"] = 33] = "B4Envelope";
        PaperKind[PaperKind["B5Envelope"] = 34] = "B5Envelope";
        PaperKind[PaperKind["B6Envelope"] = 35] = "B6Envelope";
        PaperKind[PaperKind["ItalyEnvelope"] = 36] = "ItalyEnvelope";
        PaperKind[PaperKind["MonarchEnvelope"] = 37] = "MonarchEnvelope";
        PaperKind[PaperKind["PersonalEnvelope"] = 38] = "PersonalEnvelope";
        PaperKind[PaperKind["USStandardFanfold"] = 39] = "USStandardFanfold";
        PaperKind[PaperKind["GermanStandardFanfold"] = 40] = "GermanStandardFanfold";
        PaperKind[PaperKind["GermanLegalFanfold"] = 41] = "GermanLegalFanfold";
        PaperKind[PaperKind["IsoB4"] = 42] = "IsoB4";
        PaperKind[PaperKind["JapanesePostcard"] = 43] = "JapanesePostcard";
        PaperKind[PaperKind["Standard9x11"] = 44] = "Standard9x11";
        PaperKind[PaperKind["Standard10x11"] = 45] = "Standard10x11";
        PaperKind[PaperKind["Standard15x11"] = 46] = "Standard15x11";
        PaperKind[PaperKind["InviteEnvelope"] = 47] = "InviteEnvelope";
        PaperKind[PaperKind["LetterExtra"] = 50] = "LetterExtra";
        PaperKind[PaperKind["LegalExtra"] = 51] = "LegalExtra";
        PaperKind[PaperKind["TabloidExtra"] = 52] = "TabloidExtra";
        PaperKind[PaperKind["A4Extra"] = 53] = "A4Extra";
        PaperKind[PaperKind["LetterTransverse"] = 54] = "LetterTransverse";
        PaperKind[PaperKind["A4Transverse"] = 55] = "A4Transverse";
        PaperKind[PaperKind["LetterExtraTransverse"] = 56] = "LetterExtraTransverse";
        PaperKind[PaperKind["APlus"] = 57] = "APlus";
        PaperKind[PaperKind["BPlus"] = 58] = "BPlus";
        PaperKind[PaperKind["LetterPlus"] = 59] = "LetterPlus";
        PaperKind[PaperKind["A4Plus"] = 60] = "A4Plus";
        PaperKind[PaperKind["A5Transverse"] = 61] = "A5Transverse";
        PaperKind[PaperKind["B5Transverse"] = 62] = "B5Transverse";
        PaperKind[PaperKind["A3Extra"] = 63] = "A3Extra";
        PaperKind[PaperKind["A5Extra"] = 64] = "A5Extra";
        PaperKind[PaperKind["B5Extra"] = 65] = "B5Extra";
        PaperKind[PaperKind["A2"] = 66] = "A2";
        PaperKind[PaperKind["A3Transverse"] = 67] = "A3Transverse";
        PaperKind[PaperKind["A3ExtraTransverse"] = 68] = "A3ExtraTransverse";
        PaperKind[PaperKind["JapaneseDoublePostcard"] = 69] = "JapaneseDoublePostcard";
        PaperKind[PaperKind["A6"] = 70] = "A6";
        PaperKind[PaperKind["JapaneseEnvelopeKakuNumber2"] = 71] = "JapaneseEnvelopeKakuNumber2";
        PaperKind[PaperKind["JapaneseEnvelopeKakuNumber3"] = 72] = "JapaneseEnvelopeKakuNumber3";
        PaperKind[PaperKind["JapaneseEnvelopeChouNumber3"] = 73] = "JapaneseEnvelopeChouNumber3";
        PaperKind[PaperKind["JapaneseEnvelopeChouNumber4"] = 74] = "JapaneseEnvelopeChouNumber4";
        PaperKind[PaperKind["LetterRotated"] = 75] = "LetterRotated";
        PaperKind[PaperKind["A3Rotated"] = 76] = "A3Rotated";
        PaperKind[PaperKind["A4Rotated"] = 77] = "A4Rotated";
        PaperKind[PaperKind["A5Rotated"] = 78] = "A5Rotated";
        PaperKind[PaperKind["B4JisRotated"] = 79] = "B4JisRotated";
        PaperKind[PaperKind["B5JisRotated"] = 80] = "B5JisRotated";
        PaperKind[PaperKind["JapanesePostcardRotated"] = 81] = "JapanesePostcardRotated";
        PaperKind[PaperKind["JapaneseDoublePostcardRotated"] = 82] = "JapaneseDoublePostcardRotated";
        PaperKind[PaperKind["A6Rotated"] = 83] = "A6Rotated";
        PaperKind[PaperKind["JapaneseEnvelopeKakuNumber2Rotated"] = 84] = "JapaneseEnvelopeKakuNumber2Rotated";
        PaperKind[PaperKind["JapaneseEnvelopeKakuNumber3Rotated"] = 85] = "JapaneseEnvelopeKakuNumber3Rotated";
        PaperKind[PaperKind["JapaneseEnvelopeChouNumber3Rotated"] = 86] = "JapaneseEnvelopeChouNumber3Rotated";
        PaperKind[PaperKind["JapaneseEnvelopeChouNumber4Rotated"] = 87] = "JapaneseEnvelopeChouNumber4Rotated";
        PaperKind[PaperKind["B6Jis"] = 88] = "B6Jis";
        PaperKind[PaperKind["B6JisRotated"] = 89] = "B6JisRotated";
        PaperKind[PaperKind["Standard12x11"] = 90] = "Standard12x11";
        PaperKind[PaperKind["JapaneseEnvelopeYouNumber4"] = 91] = "JapaneseEnvelopeYouNumber4";
        PaperKind[PaperKind["JapaneseEnvelopeYouNumber4Rotated"] = 92] = "JapaneseEnvelopeYouNumber4Rotated";
        PaperKind[PaperKind["Prc16K"] = 93] = "Prc16K";
        PaperKind[PaperKind["Prc32K"] = 94] = "Prc32K";
        PaperKind[PaperKind["Prc32KBig"] = 95] = "Prc32KBig";
        PaperKind[PaperKind["PrcEnvelopeNumber1"] = 96] = "PrcEnvelopeNumber1";
        PaperKind[PaperKind["PrcEnvelopeNumber2"] = 97] = "PrcEnvelopeNumber2";
        PaperKind[PaperKind["PrcEnvelopeNumber3"] = 98] = "PrcEnvelopeNumber3";
        PaperKind[PaperKind["PrcEnvelopeNumber4"] = 99] = "PrcEnvelopeNumber4";
        PaperKind[PaperKind["PrcEnvelopeNumber5"] = 100] = "PrcEnvelopeNumber5";
        PaperKind[PaperKind["PrcEnvelopeNumber6"] = 101] = "PrcEnvelopeNumber6";
        PaperKind[PaperKind["PrcEnvelopeNumber7"] = 102] = "PrcEnvelopeNumber7";
        PaperKind[PaperKind["PrcEnvelopeNumber8"] = 103] = "PrcEnvelopeNumber8";
        PaperKind[PaperKind["PrcEnvelopeNumber9"] = 104] = "PrcEnvelopeNumber9";
        PaperKind[PaperKind["PrcEnvelopeNumber10"] = 105] = "PrcEnvelopeNumber10";
        PaperKind[PaperKind["Prc16KRotated"] = 106] = "Prc16KRotated";
        PaperKind[PaperKind["Prc32KRotated"] = 107] = "Prc32KRotated";
        PaperKind[PaperKind["Prc32KBigRotated"] = 108] = "Prc32KBigRotated";
        PaperKind[PaperKind["PrcEnvelopeNumber1Rotated"] = 109] = "PrcEnvelopeNumber1Rotated";
        PaperKind[PaperKind["PrcEnvelopeNumber2Rotated"] = 110] = "PrcEnvelopeNumber2Rotated";
        PaperKind[PaperKind["PrcEnvelopeNumber3Rotated"] = 111] = "PrcEnvelopeNumber3Rotated";
        PaperKind[PaperKind["PrcEnvelopeNumber4Rotated"] = 112] = "PrcEnvelopeNumber4Rotated";
        PaperKind[PaperKind["PrcEnvelopeNumber5Rotated"] = 113] = "PrcEnvelopeNumber5Rotated";
        PaperKind[PaperKind["PrcEnvelopeNumber6Rotated"] = 114] = "PrcEnvelopeNumber6Rotated";
        PaperKind[PaperKind["PrcEnvelopeNumber7Rotated"] = 115] = "PrcEnvelopeNumber7Rotated";
        PaperKind[PaperKind["PrcEnvelopeNumber8Rotated"] = 116] = "PrcEnvelopeNumber8Rotated";
        PaperKind[PaperKind["PrcEnvelopeNumber9Rotated"] = 117] = "PrcEnvelopeNumber9Rotated";
        PaperKind[PaperKind["PrcEnvelopeNumber10Rotated"] = 118] = "PrcEnvelopeNumber10Rotated";
    })(PaperKind = __aspxRichEdit.PaperKind || (__aspxRichEdit.PaperKind = {}));
    var PaperSizeConverter = (function () {
        function PaperSizeConverter() {
        }
        PaperSizeConverter.calculatePaperSize = function (paperKind) {
            var result = PaperSizeConverter.paperSizeTable[paperKind];
            return result ? result : PaperSizeConverter.paperSizeTable[PaperKind.Letter];
        };
        PaperSizeConverter.calculatePaperKind = function (size, defaultValue, tolerance, badSizeDefaultValue) {
            if (tolerance === void 0) { tolerance = 0; }
            if (badSizeDefaultValue === void 0) { badSizeDefaultValue = defaultValue; }
            if (size.width == 0 || size.height == 0)
                return badSizeDefaultValue;
            var entSize;
            for (var paperKind in PaperSizeConverter.paperSizeTable) {
                if (!PaperSizeConverter.paperSizeTable.hasOwnProperty(paperKind))
                    continue;
                entSize = PaperSizeConverter.paperSizeTable[paperKind];
                if (Math.abs(size.width - entSize.width) <= tolerance && Math.abs(size.height - entSize.height) <= tolerance)
                    return parseInt(paperKind);
            }
            return defaultValue;
        };
        PaperSizeConverter.paperSizeTable = new __aspxRichEdit.MapCreatorNumberAsKey()
            .add(PaperKind.Letter, new __aspxRichEdit.Size(12240, 15840))
            .add(PaperKind.LetterSmall, new __aspxRichEdit.Size(12240, 15840))
            .add(PaperKind.Tabloid, new __aspxRichEdit.Size(15840, 24480))
            .add(PaperKind.Ledger, new __aspxRichEdit.Size(24480, 15840))
            .add(PaperKind.Legal, new __aspxRichEdit.Size(12240, 20160))
            .add(PaperKind.Statement, new __aspxRichEdit.Size(7920, 12240))
            .add(PaperKind.Executive, new __aspxRichEdit.Size(10440, 15120))
            .add(PaperKind.A3, new __aspxRichEdit.Size(16839, 23814))
            .add(PaperKind.A4, new __aspxRichEdit.Size(11907, 16839))
            .add(PaperKind.A4Small, new __aspxRichEdit.Size(11907, 16839))
            .add(PaperKind.A5, new __aspxRichEdit.Size(8391, 11907))
            .add(PaperKind.B4, new __aspxRichEdit.Size(14572, 20639))
            .add(PaperKind.B5, new __aspxRichEdit.Size(10319, 14571))
            .add(PaperKind.Folio, new __aspxRichEdit.Size(12240, 18720))
            .add(PaperKind.Quarto, new __aspxRichEdit.Size(12189, 15591))
            .add(PaperKind.Standard10x14, new __aspxRichEdit.Size(14400, 20160))
            .add(PaperKind.Standard11x17, new __aspxRichEdit.Size(15840, 24480))
            .add(PaperKind.Note, new __aspxRichEdit.Size(12240, 15840))
            .add(PaperKind.Number9Envelope, new __aspxRichEdit.Size(5580, 12780))
            .add(PaperKind.Number10Envelope, new __aspxRichEdit.Size(5940, 13680))
            .add(PaperKind.Number11Envelope, new __aspxRichEdit.Size(6480, 14940))
            .add(PaperKind.Number12Envelope, new __aspxRichEdit.Size(6840, 15840))
            .add(PaperKind.Number14Envelope, new __aspxRichEdit.Size(7200, 16560))
            .add(PaperKind.CSheet, new __aspxRichEdit.Size(24480, 31680))
            .add(PaperKind.DSheet, new __aspxRichEdit.Size(31680, 48960))
            .add(PaperKind.ESheet, new __aspxRichEdit.Size(48960, 63360))
            .add(PaperKind.DLEnvelope, new __aspxRichEdit.Size(6237, 12474))
            .add(PaperKind.C5Envelope, new __aspxRichEdit.Size(9185, 12984))
            .add(PaperKind.C3Envelope, new __aspxRichEdit.Size(18369, 25965))
            .add(PaperKind.C4Envelope, new __aspxRichEdit.Size(12983, 18369))
            .add(PaperKind.C6Envelope, new __aspxRichEdit.Size(6463, 9184))
            .add(PaperKind.C65Envelope, new __aspxRichEdit.Size(6463, 12983))
            .add(PaperKind.B4Envelope, new __aspxRichEdit.Size(14173, 20013))
            .add(PaperKind.B5Envelope, new __aspxRichEdit.Size(9978, 14173))
            .add(PaperKind.B6Envelope, new __aspxRichEdit.Size(9978, 7087))
            .add(PaperKind.ItalyEnvelope, new __aspxRichEdit.Size(6236, 13039))
            .add(PaperKind.MonarchEnvelope, new __aspxRichEdit.Size(5580, 10800))
            .add(PaperKind.PersonalEnvelope, new __aspxRichEdit.Size(5220, 9360))
            .add(PaperKind.USStandardFanfold, new __aspxRichEdit.Size(21420, 15840))
            .add(PaperKind.GermanStandardFanfold, new __aspxRichEdit.Size(12240, 17280))
            .add(PaperKind.GermanLegalFanfold, new __aspxRichEdit.Size(12240, 18720))
            .add(PaperKind.IsoB4, new __aspxRichEdit.Size(14173, 20013))
            .add(PaperKind.JapanesePostcard, new __aspxRichEdit.Size(5669, 8391))
            .add(PaperKind.Standard9x11, new __aspxRichEdit.Size(12960, 15840))
            .add(PaperKind.Standard10x11, new __aspxRichEdit.Size(14400, 15840))
            .add(PaperKind.Standard15x11, new __aspxRichEdit.Size(21600, 15840))
            .add(PaperKind.InviteEnvelope, new __aspxRichEdit.Size(12472, 12472))
            .add(PaperKind.LetterExtra, new __aspxRichEdit.Size(13680, 17280))
            .add(PaperKind.LegalExtra, new __aspxRichEdit.Size(13680, 21600))
            .add(PaperKind.TabloidExtra, new __aspxRichEdit.Size(16834, 25920))
            .add(PaperKind.A4Extra, new __aspxRichEdit.Size(13349, 18274))
            .add(PaperKind.LetterTransverse, new __aspxRichEdit.Size(12240, 15840))
            .add(PaperKind.A4Transverse, new __aspxRichEdit.Size(11907, 16839))
            .add(PaperKind.LetterExtraTransverse, new __aspxRichEdit.Size(13680, 17280))
            .add(PaperKind.APlus, new __aspxRichEdit.Size(12869, 20183))
            .add(PaperKind.BPlus, new __aspxRichEdit.Size(17291, 27609))
            .add(PaperKind.LetterPlus, new __aspxRichEdit.Size(12240, 18274))
            .add(PaperKind.A4Plus, new __aspxRichEdit.Size(11907, 18709))
            .add(PaperKind.A5Transverse, new __aspxRichEdit.Size(8391, 11907))
            .add(PaperKind.B5Transverse, new __aspxRichEdit.Size(10319, 14571))
            .add(PaperKind.A3Extra, new __aspxRichEdit.Size(18255, 25228))
            .add(PaperKind.A5Extra, new __aspxRichEdit.Size(9865, 13323))
            .add(PaperKind.B5Extra, new __aspxRichEdit.Size(11395, 15647))
            .add(PaperKind.A2, new __aspxRichEdit.Size(23811, 33676))
            .add(PaperKind.A3Transverse, new __aspxRichEdit.Size(16839, 23814))
            .add(PaperKind.A3ExtraTransverse, new __aspxRichEdit.Size(18255, 25228))
            .add(PaperKind.JapaneseDoublePostcard, new __aspxRichEdit.Size(11339, 8391))
            .add(PaperKind.A6, new __aspxRichEdit.Size(5953, 8391))
            .add(PaperKind.JapaneseEnvelopeKakuNumber2, new __aspxRichEdit.Size(12240, 15840))
            .add(PaperKind.JapaneseEnvelopeKakuNumber3, new __aspxRichEdit.Size(12240, 15840))
            .add(PaperKind.JapaneseEnvelopeChouNumber3, new __aspxRichEdit.Size(12240, 15840))
            .add(PaperKind.JapaneseEnvelopeChouNumber4, new __aspxRichEdit.Size(12240, 15840))
            .add(PaperKind.LetterRotated, new __aspxRichEdit.Size(15840, 12240))
            .add(PaperKind.A3Rotated, new __aspxRichEdit.Size(23814, 16839))
            .add(PaperKind.A4Rotated, new __aspxRichEdit.Size(16839, 11907))
            .add(PaperKind.A5Rotated, new __aspxRichEdit.Size(11907, 8391))
            .add(PaperKind.B4JisRotated, new __aspxRichEdit.Size(20636, 14570))
            .add(PaperKind.B5JisRotated, new __aspxRichEdit.Size(14570, 10318))
            .add(PaperKind.JapanesePostcardRotated, new __aspxRichEdit.Size(8391, 5669))
            .add(PaperKind.JapaneseDoublePostcardRotated, new __aspxRichEdit.Size(8391, 11339))
            .add(PaperKind.A6Rotated, new __aspxRichEdit.Size(8391, 5953))
            .add(PaperKind.JapaneseEnvelopeKakuNumber2Rotated, new __aspxRichEdit.Size(12240, 15840))
            .add(PaperKind.JapaneseEnvelopeKakuNumber3Rotated, new __aspxRichEdit.Size(12240, 15840))
            .add(PaperKind.JapaneseEnvelopeChouNumber3Rotated, new __aspxRichEdit.Size(12240, 15840))
            .add(PaperKind.JapaneseEnvelopeChouNumber4Rotated, new __aspxRichEdit.Size(12240, 15840))
            .add(PaperKind.B6Jis, new __aspxRichEdit.Size(7257, 10318))
            .add(PaperKind.B6JisRotated, new __aspxRichEdit.Size(10318, 7257))
            .add(PaperKind.Standard12x11, new __aspxRichEdit.Size(17280, 15840))
            .add(PaperKind.JapaneseEnvelopeYouNumber4, new __aspxRichEdit.Size(12240, 15840))
            .add(PaperKind.JapaneseEnvelopeYouNumber4Rotated, new __aspxRichEdit.Size(15840, 12240))
            .add(PaperKind.Prc16K, new __aspxRichEdit.Size(8277, 12189))
            .add(PaperKind.Prc32K, new __aspxRichEdit.Size(5499, 8561))
            .add(PaperKind.Prc32KBig, new __aspxRichEdit.Size(5499, 8561))
            .add(PaperKind.PrcEnvelopeNumber1, new __aspxRichEdit.Size(5783, 9354))
            .add(PaperKind.PrcEnvelopeNumber2, new __aspxRichEdit.Size(5783, 9978))
            .add(PaperKind.PrcEnvelopeNumber3, new __aspxRichEdit.Size(7087, 9978))
            .add(PaperKind.PrcEnvelopeNumber4, new __aspxRichEdit.Size(6236, 11792))
            .add(PaperKind.PrcEnvelopeNumber5, new __aspxRichEdit.Size(6236, 12472))
            .add(PaperKind.PrcEnvelopeNumber6, new __aspxRichEdit.Size(6803, 13039))
            .add(PaperKind.PrcEnvelopeNumber7, new __aspxRichEdit.Size(9071, 13039))
            .add(PaperKind.PrcEnvelopeNumber8, new __aspxRichEdit.Size(6803, 17518))
            .add(PaperKind.PrcEnvelopeNumber9, new __aspxRichEdit.Size(12983, 18369))
            .add(PaperKind.PrcEnvelopeNumber10, new __aspxRichEdit.Size(18369, 25965))
            .add(PaperKind.Prc16KRotated, new __aspxRichEdit.Size(12189, 8277))
            .add(PaperKind.Prc32KRotated, new __aspxRichEdit.Size(8561, 5499))
            .add(PaperKind.Prc32KBigRotated, new __aspxRichEdit.Size(8561, 5499))
            .add(PaperKind.PrcEnvelopeNumber1Rotated, new __aspxRichEdit.Size(9354, 5783))
            .add(PaperKind.PrcEnvelopeNumber2Rotated, new __aspxRichEdit.Size(9978, 5783))
            .add(PaperKind.PrcEnvelopeNumber3Rotated, new __aspxRichEdit.Size(9978, 7087))
            .add(PaperKind.PrcEnvelopeNumber4Rotated, new __aspxRichEdit.Size(11792, 6236))
            .add(PaperKind.PrcEnvelopeNumber5Rotated, new __aspxRichEdit.Size(12472, 6236))
            .add(PaperKind.PrcEnvelopeNumber6Rotated, new __aspxRichEdit.Size(13039, 6803))
            .add(PaperKind.PrcEnvelopeNumber7Rotated, new __aspxRichEdit.Size(13039, 9071))
            .add(PaperKind.PrcEnvelopeNumber8Rotated, new __aspxRichEdit.Size(17518, 6803))
            .add(PaperKind.PrcEnvelopeNumber9Rotated, new __aspxRichEdit.Size(18369, 12983))
            .add(PaperKind.PrcEnvelopeNumber10Rotated, new __aspxRichEdit.Size(25965, 18369))
            .get();
        return PaperSizeConverter;
    }());
    __aspxRichEdit.PaperSizeConverter = PaperSizeConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var StringResources = (function () {
        function StringResources() {
        }
        return StringResources;
    }());
    __aspxRichEdit.StringResources = StringResources;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Scroll;
    (function (Scroll) {
        var CanvasState = (function () {
            function CanvasState(lp, relativePosition, getVerticalOffset) {
                this.lp = lp;
                this.relativePosition = relativePosition;
                this.getVerticalOffset = getVerticalOffset;
            }
            return CanvasState;
        }());
        Scroll.CanvasState = CanvasState;
    })(Scroll = __aspxRichEdit.Scroll || (__aspxRichEdit.Scroll = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ModelScrollManager = (function () {
        function ModelScrollManager() {
            this.onChanged = new __aspxRichEdit.EventDispatcher();
            this.init();
        }
        ModelScrollManager.prototype.setScroll = function (state) {
            this.state = state;
        };
        ModelScrollManager.prototype.init = function () {
            this.state = null;
        };
        ModelScrollManager.StandartScrollPosition = -1;
        ModelScrollManager.DontChangeScrollPosition = -2;
        return ModelScrollManager;
    }());
    __aspxRichEdit.ModelScrollManager = ModelScrollManager;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Scroll;
    (function (Scroll) {
        var RelativePosition;
        (function (RelativePosition) {
            RelativePosition[RelativePosition["Top"] = 0] = "Top";
            RelativePosition[RelativePosition["Bottom"] = 1] = "Bottom";
            RelativePosition[RelativePosition["Inside"] = 2] = "Inside";
        })(RelativePosition = Scroll.RelativePosition || (Scroll.RelativePosition = {}));
        var State = (function () {
            function State() {
            }
            Object.defineProperty(State.prototype, "byModelPosition", {
                get: function () { return (new ModelStateByModelPosition()); },
                enumerable: true,
                configurable: true
            });
            Object.defineProperty(State.prototype, "byScrollInfo", {
                get: function () { return (new ModelStateByPageInfo()); },
                enumerable: true,
                configurable: true
            });
            Object.defineProperty(State.prototype, "nothing", {
                get: function () { return new ModelStateEmpty(); },
                enumerable: true,
                configurable: true
            });
            return State;
        }());
        Scroll.State = State;
        var ModelStateByModelPosition = (function () {
            function ModelStateByModelPosition() {
            }
            ModelStateByModelPosition.prototype.setModelPosition = function (modelPosition) {
                this.modelPosition = modelPosition;
                return this;
            };
            ModelStateByModelPosition.prototype.useCurrentPosition = function (selection) {
                return this.setModelPosition(selection.forwardDirection ?
                    selection.getLastSelectedInterval().end :
                    selection.getLastSelectedInterval().start);
            };
            ModelStateByModelPosition.prototype.setVerticalOffset = function (getVerticalOffset) {
                this.getVerticalOffset = getVerticalOffset;
                return this;
            };
            ModelStateByModelPosition.prototype.useStdOffset = function () {
                return this.setVerticalOffset(function () { return 0; });
            };
            ModelStateByModelPosition.prototype.setRelativePosition = function (relativePosition) {
                this.relativePosition = relativePosition;
                return this;
            };
            ModelStateByModelPosition.prototype.useStdRelativePosition = function () {
                return this.setRelativePosition(RelativePosition.Inside);
            };
            ModelStateByModelPosition.prototype.getCanvasState = function (selection) {
                var layout = selection.layout;
                var subDocument = selection.model.activeSubDocument;
                var modelPos = this.modelPosition;
                var cursorPos = subDocument.isMain()
                    ? new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(layout, subDocument, modelPos, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                        .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false))
                    : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(layout, subDocument, modelPos, selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                        .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
                return cursorPos ? new Scroll.CanvasState(cursorPos, this.relativePosition, this.getVerticalOffset) : null;
            };
            return ModelStateByModelPosition;
        }());
        Scroll.ModelStateByModelPosition = ModelStateByModelPosition;
        var ModelStateByPageInfo = (function () {
            function ModelStateByPageInfo() {
            }
            ModelStateByPageInfo.prototype.setPageInfo = function (scrollTopInfo) {
                this.getVerticalOffset = function () { return scrollTopInfo.topPositionRelativePage; };
                this.pageIndex = scrollTopInfo.pageIndex;
                this.relativePosition = RelativePosition.Top;
                return this;
            };
            ModelStateByPageInfo.prototype.getCanvasState = function (selection) {
                var layout = selection.layout;
                return layout.isFullyFormatted || layout.isPageValid(this.pageIndex + 1) ?
                    new Scroll.CanvasState(new __aspxRichEdit.LayoutPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Page).initByIndexes(this.pageIndex).applyObjectsAsMainSubDocument(layout, -1), this.relativePosition, this.getVerticalOffset) :
                    null;
            };
            return ModelStateByPageInfo;
        }());
        Scroll.ModelStateByPageInfo = ModelStateByPageInfo;
        var ModelStateEmpty = (function () {
            function ModelStateEmpty() {
            }
            ModelStateEmpty.prototype.getCanvasState = function (_selection) {
                return null;
            };
            return ModelStateEmpty;
        }());
        Scroll.ModelStateEmpty = ModelStateEmpty;
    })(Scroll = __aspxRichEdit.Scroll || (__aspxRichEdit.Scroll = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ScrollFormatter = (function (_super) {
        __extends(ScrollFormatter, _super);
        function ScrollFormatter(selection) {
            var _this = _super.call(this) || this;
            _this.onScrollLayoutChanged = new __aspxRichEdit.EventDispatcher();
            _this.selection = selection;
            return _this;
        }
        ScrollFormatter.prototype.NotifyPagesReady = function (_pageChanges) {
            this.process();
        };
        ScrollFormatter.prototype.NotifyFullyFormatted = function () {
            this.process();
        };
        ;
        ScrollFormatter.prototype.NotifyScrollChanged = function () {
            this.process();
        };
        ScrollFormatter.prototype.onUpdateUnlocked = function (_occurredEvents) {
            this.process();
        };
        ScrollFormatter.prototype.process = function () {
            var modelState = this.selection.scrollManager.state;
            if (modelState)
                if (this.canvasState = modelState.getCanvasState(this.selection))
                    this.selection.scrollManager.init();
            if (this.isUpdateLocked())
                return;
            if (this.canvasState) {
                this.raiseScrollChanged();
                this.canvasState = null;
            }
        };
        ScrollFormatter.prototype.raiseScrollChanged = function () {
            this.onScrollLayoutChanged.raise("NotifyScrollPositionChanged", this.canvasState);
        };
        return ScrollFormatter;
    }(__aspxRichEdit.BatchUpdatableObject));
    __aspxRichEdit.ScrollFormatter = ScrollFormatter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InputPosition = (function () {
        function InputPosition(selection, model) {
            this.model = model;
            this.selection = selection;
            this.intervals = selection.getIntervalsClone();
            this.subDocument = model.activeSubDocument;
            this.sourceRun = null;
            this.characterStyle = null;
            this.maskedCharacterProperties = new __aspxRichEdit.MaskedCharacterProperties();
            this.mergedCharacterPropertiesRaw = new __aspxRichEdit.CharacterProperties();
            this.mergedCharacterPropertiesFull = this.mergedCharacterPropertiesRaw.clone();
            this.mergedParagraphPropertiesRaw = new __aspxRichEdit.ParagraphProperties();
            this.mergedParagraphPropertiesFull = this.mergedParagraphPropertiesRaw.clone();
            this.mergedSectionPropertiesRaw = new __aspxRichEdit.SectionProperties();
            this.mergedSectionPropertiesFull = this.mergedSectionPropertiesRaw.clone();
        }
        InputPosition.prototype.reset = function () {
            this.intervals = this.selection.getIntervalsClone();
            this.subDocument = this.model.activeSubDocument;
            this.resetReturnValues();
        };
        InputPosition.prototype.resetSectionMergedProperties = function () {
            this.mergedSectionPropertiesRaw = null;
            this.mergedSectionPropertiesFull = null;
        };
        InputPosition.prototype.resetParagraphMergedProperties = function () {
            this.mergedParagraphPropertiesRaw = null;
            this.mergedParagraphPropertiesFull = null;
        };
        InputPosition.prototype.setPropertiesFromPosition = function (subDocument, position) {
            this.intervals = [new __aspxRichEdit.FixedInterval(position, 0)];
            this.subDocument = subDocument;
            this.resetReturnValues();
        };
        InputPosition.prototype.getCharacterStyle = function () {
            if (!this.characterStyle)
                this.characterStyle = this.getCharacterStyleInternal();
            return this.characterStyle;
        };
        InputPosition.prototype.setCharacterStyle = function (characterStyle) {
            this.characterStyle = characterStyle;
        };
        InputPosition.prototype.getMaskedCharacterProperties = function () {
            if (!this.maskedCharacterProperties) {
                this.setSourceRun();
                this.maskedCharacterProperties = this.sourceRun.maskedCharacterProperties.clone();
            }
            return this.maskedCharacterProperties;
        };
        InputPosition.prototype.getMergedCharacterPropertiesRaw = function () {
            if (!this.mergedCharacterPropertiesRaw)
                this.setMergedCharacterAndParagraphPropertiesRaw();
            return this.mergedCharacterPropertiesRaw;
        };
        InputPosition.prototype.getMergedCharacterPropertiesFull = function () {
            if (!this.mergedCharacterPropertiesFull)
                this.mergedCharacterPropertiesFull = InputPosition.mergePropertiesFull(this.getMergedCharacterPropertiesRaw(), __aspxRichEdit.CharacterPropertyDescriptor.ALL_FIELDS);
            return this.mergedCharacterPropertiesFull;
        };
        InputPosition.prototype.getMergedParagraphPropertiesRaw = function () {
            if (!this.mergedParagraphPropertiesRaw)
                this.setMergedCharacterAndParagraphPropertiesRaw();
            return this.mergedParagraphPropertiesRaw;
        };
        InputPosition.prototype.getMergedParagraphPropertiesFull = function () {
            if (!this.mergedParagraphPropertiesFull)
                this.mergedParagraphPropertiesFull = InputPosition.mergePropertiesFull(this.getMergedParagraphPropertiesRaw(), __aspxRichEdit.ParagraphPropertyDescriptor.ALL_FIELDS);
            return this.mergedParagraphPropertiesFull;
        };
        InputPosition.prototype.getMergedSectionPropertiesRaw = function () {
            if (!this.mergedSectionPropertiesRaw) {
                var interval = this.getLastInterval();
                var intervalStartPosition = interval.start;
                var intervalEndPosition = interval.end;
                var sections = this.model.sections;
                var sectionIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(sections, function (s) { return s.startLogPosition.value; }, intervalStartPosition);
                this.mergedSectionPropertiesRaw = sections[sectionIndex++].sectionProperties.clone();
                for (var section; (section = sections[sectionIndex]) && (section.startLogPosition.value < intervalEndPosition); sectionIndex++)
                    InputPosition.mergePropertiesRaw(this.mergedSectionPropertiesRaw, section.sectionProperties, __aspxRichEdit.SectionPropertyDescriptor.ALL_FIELDS);
            }
            return this.mergedSectionPropertiesRaw;
        };
        InputPosition.prototype.getMergedSectionPropertiesFull = function () {
            if (!this.mergedSectionPropertiesFull)
                this.mergedSectionPropertiesFull = InputPosition.mergePropertiesFull(this.getMergedSectionPropertiesRaw(), __aspxRichEdit.SectionPropertyDescriptor.ALL_FIELDS);
            return this.mergedSectionPropertiesFull;
        };
        InputPosition.prototype.setMergedCharacterAndParagraphPropertiesRaw = function () {
            this.setSourceRun();
            this.mergedCharacterPropertiesRaw = this.sourceRun.getCharacterMergedProperies().clone();
            this.mergedParagraphPropertiesRaw = this.sourceRun.paragraph.getParagraphMergedProperies().clone();
            var interval = this.getLastInterval();
            var intervalStartPosition = interval.start;
            var intervalEndPosition = interval.end;
            var chunks = this.subDocument.chunks;
            var chunkIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(chunks, function (c) { return c.startLogPosition.value; }, intervalStartPosition);
            var chunk = chunks[chunkIndex];
            var runIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(chunk.textRuns, function (r) { return chunk.startLogPosition.value + r.startOffset; }, intervalStartPosition);
            var prevParagraph = this.sourceRun.paragraph;
            exitBothLoops: for (; chunk = chunks[chunkIndex]; chunkIndex++) {
                for (var run; run = chunk.textRuns[runIndex]; runIndex++) {
                    if (chunk.startLogPosition.value + run.startOffset >= intervalEndPosition)
                        break exitBothLoops;
                    if (run !== this.sourceRun) {
                        if (run.getType() === __aspxRichEdit.RunType.TextRun)
                            InputPosition.mergePropertiesRaw(this.mergedCharacterPropertiesRaw, run.getCharacterMergedProperies(), __aspxRichEdit.CharacterPropertyDescriptor.ALL_FIELDS);
                        if (prevParagraph !== run.paragraph) {
                            InputPosition.mergePropertiesRaw(this.mergedParagraphPropertiesRaw, run.paragraph.getParagraphMergedProperies(), __aspxRichEdit.ParagraphPropertyDescriptor.ALL_FIELDS);
                            prevParagraph = run.paragraph;
                        }
                    }
                }
            }
        };
        InputPosition.mergePropertiesRaw = function (sourceProps, otherProps, descriptors) {
            for (var i = 0, desc; desc = descriptors[i]; i++) {
                if (!desc.binaryEquals(desc.getProp(sourceProps), desc.getProp(otherProps)))
                    desc.setProp(sourceProps, undefined);
            }
        };
        InputPosition.mergePropertiesFull = function (sourceProps, descriptors) {
            var result = sourceProps.clone();
            for (var i = 0, desc; desc = descriptors[i]; i++) {
                if (desc.getProp(result) === undefined)
                    desc.setProp(result, desc.defaultValue);
            }
            return result;
        };
        InputPosition.prototype.getCharacterStyleInternal = function () {
            var interval = this.getLastInterval();
            if (interval.length == 0)
                return this.getCharacterStyleCollapsedIntervalInternal(interval.start);
            var chunks = this.subDocument.chunks;
            var intervalStartPosition = interval.start;
            var intervalEndPosition = interval.end;
            var firstRun = this.subDocument.getRunAndIndexesByPosition(intervalStartPosition);
            if (intervalStartPosition == firstRun.run.paragraph.startLogPosition.value && firstRun.run.paragraph.length > 1)
                return firstRun.run.characterStyle;
            if (intervalStartPosition > 0) {
                var prevFirstRun = this.subDocument.getRunAndIndexesByPosition(intervalStartPosition - 1);
                if (prevFirstRun.run.getType() == __aspxRichEdit.RunType.TextRun)
                    return prevFirstRun.run.characterStyle;
            }
            for (var chunk, chunkIndex = firstRun.chunkIndex; chunk = chunks[chunkIndex]; chunkIndex++) {
                for (var run, runIndex = firstRun.runIndex; run = chunk.textRuns[runIndex]; runIndex++) {
                    if (chunk.startLogPosition.value + run.startOffset >= intervalEndPosition)
                        return firstRun.run.characterStyle;
                    if (run.getType() == __aspxRichEdit.RunType.TextRun)
                        return run.characterStyle;
                }
            }
            return firstRun.run.characterStyle;
        };
        InputPosition.prototype.isHyperlinkField = function (resultRunPosition) {
            resultRunPosition++;
            var fields = this.subDocument.fields;
            return fields[0] && __aspxRichEdit.ListUtils.reverseElementBy(fields, function (f) { return f.getFieldEndPosition() == resultRunPosition; }, Math.max(0, __aspxRichEdit.Field.normedBinaryIndexOf(fields, resultRunPosition))).isHyperlinkField();
        };
        InputPosition.prototype.getCharacterStyleCollapsedIntervalInternal = function (intervalStartPosition) {
            var chunks = this.subDocument.chunks;
            if (intervalStartPosition == 0)
                return chunks[0].textRuns[0].characterStyle;
            var iter = new __aspxRichEdit.ModelIterator(this.subDocument, false);
            iter.setPosition(intervalStartPosition - 1);
            if (!iter.run.isParagraphOrSectionRun() && !(iter.run.getType() == __aspxRichEdit.RunType.FieldResultEndRun && this.isHyperlinkField(iter.getAbsolutePosition())))
                return iter.run.characterStyle;
            iter.moveToNextRun();
            return iter.run.characterStyle;
        };
        InputPosition.prototype.setSourceRun = function () {
            if (this.sourceRun)
                return;
            var interval = this.getLastInterval();
            if (interval.length == 0) {
                if (interval.start == 0) {
                    var firstChunk = this.subDocument.chunks[0];
                    this.sourceRun = firstChunk ? firstChunk.textRuns[0].clone() : null;
                }
                else {
                    var iter = new __aspxRichEdit.ModelIterator(this.subDocument, false);
                    iter.setPosition(interval.start - 1);
                    if (!__aspxRichEdit.EnumUtils.isAnyOf(iter.run.getType(), __aspxRichEdit.RunType.TextRun, __aspxRichEdit.RunType.FieldResultEndRun))
                        iter.moveToNextRun();
                    this.sourceRun = iter.run.clone();
                }
            }
            else {
                var firstRunInInterval = this.subDocument.getRunByPosition(interval.start);
                if (firstRunInInterval.getType() == __aspxRichEdit.RunType.TextRun) {
                    this.sourceRun = firstRunInInterval.clone();
                    return;
                }
                var intervalEnd = interval.end;
                var lastRunInInterval = this.subDocument.getRunByPosition(intervalEnd - 1);
                var lastSection = this.model.sections[this.model.sections.length - 1];
                if (intervalEnd == lastSection.startLogPosition.value + lastSection.getLength() && intervalEnd > 2)
                    lastRunInInterval = this.subDocument.getRunByPosition(intervalEnd - 2);
                if (lastRunInInterval.getType() == __aspxRichEdit.RunType.TextRun) {
                    this.sourceRun = lastRunInInterval.clone();
                    return;
                }
                this.sourceRun = firstRunInInterval.clone();
            }
        };
        InputPosition.prototype.getLastInterval = function () {
            return this.intervals[this.intervals.length - 1];
        };
        InputPosition.prototype.resetReturnValues = function () {
            this.sourceRun = null;
            this.characterStyle = null;
            this.maskedCharacterProperties = null;
            this.mergedCharacterPropertiesRaw = null;
            this.mergedCharacterPropertiesFull = null;
            this.mergedParagraphPropertiesRaw = null;
            this.mergedParagraphPropertiesFull = null;
            this.mergedSectionPropertiesRaw = null;
            this.mergedSectionPropertiesFull = null;
        };
        return InputPosition;
    }());
    __aspxRichEdit.InputPosition = InputPosition;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SelectedTableRowInfo = (function () {
        function SelectedTableRowInfo(rowIndex, cells) {
            this.rowIndex = rowIndex;
            this.cells = cells;
        }
        Object.defineProperty(SelectedTableRowInfo.prototype, "row", {
            get: function () { return this.cells[0].cell.parentRow; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(SelectedTableRowInfo.prototype, "isSeries", {
            get: function () {
                var _this = this;
                return __aspxRichEdit.ListUtils.allOf(this.cells, function (cellInfo, cellInd) { return cellInfo.cellIndex == _this.cells[cellInd - 1].cellIndex + 1; }, 1);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(SelectedTableRowInfo.prototype, "columnCountInSeries", {
            get: function () {
                return this.isSeries ? __aspxRichEdit.ListUtils.accumulateNumber(this.cells, 0, function (cellInfo) { return cellInfo.cell.columnSpan; }) : 0;
            },
            enumerable: true,
            configurable: true
        });
        return SelectedTableRowInfo;
    }());
    __aspxRichEdit.SelectedTableRowInfo = SelectedTableRowInfo;
    var SelectedTableCellInfo = (function () {
        function SelectedTableCellInfo(cell, cellIndex) {
            this.cell = cell;
            this.cellIndex = cellIndex;
        }
        return SelectedTableCellInfo;
    }());
    __aspxRichEdit.SelectedTableCellInfo = SelectedTableCellInfo;
    var TableSelectionData = (function () {
        function TableSelectionData(info, rows) {
            this.info = info;
            this.rows = rows;
            if (!rows[0]) {
                this._isSquare = false;
                this._isSelectedEntireTable = false;
                this._withoutGapByRows = false;
                this._areCellsSelectedInSeries = false;
            }
        }
        Object.defineProperty(TableSelectionData.prototype, "numRows", {
            get: function () { return this.rows.length; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(TableSelectionData.prototype, "startRowIndex", {
            get: function () { return this.rows[0].rowIndex; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(TableSelectionData.prototype, "isSquare", {
            get: function () { return this._isSquare === undefined ? (this._isSquare = this.calculateIsSquare()) : this._isSquare; },
            enumerable: true,
            configurable: true
        });
        ;
        Object.defineProperty(TableSelectionData.prototype, "firstCell", {
            get: function () { return this.firstCellInfo.cell; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(TableSelectionData.prototype, "firstCellInfo", {
            get: function () { return this.firstRowInfo.cells[0]; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(TableSelectionData.prototype, "firstRowInfo", {
            get: function () { return this.rows[0]; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(TableSelectionData.prototype, "lastCellInfo", {
            get: function () { return __aspxRichEdit.ListUtils.last(this.lastRowInfo.cells); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(TableSelectionData.prototype, "lastCell", {
            get: function () { return this.lastCellInfo.cell; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(TableSelectionData.prototype, "lastRowInfo", {
            get: function () { return __aspxRichEdit.ListUtils.last(this.rows); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(TableSelectionData.prototype, "withoutGapByRows", {
            get: function () {
                var _this = this;
                return this._withoutGapByRows === undefined ?
                    (this._withoutGapByRows = __aspxRichEdit.ListUtils.allOf(this.rows, function (row, i) { return row.rowIndex == _this.rows[i - 1].rowIndex + 1; }, 1)) : this._withoutGapByRows;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(TableSelectionData.prototype, "isSelectedEntireTable", {
            get: function () {
                return this._isSelectedEntireTable === undefined ?
                    (this._isSelectedEntireTable = this.numRows == this.info.table.rows.length &&
                        __aspxRichEdit.ListUtils.allOf2(this.rows, this.info.table.rows, function (selR, modelR) { return selR.cells.length == modelR.cells.length; })) :
                    this._isSelectedEntireTable;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(TableSelectionData.prototype, "areCellsSelectedInSeries", {
            get: function () {
                var _this = this;
                return this._areCellsSelectedInSeries === undefined ?
                    (this._areCellsSelectedInSeries = __aspxRichEdit.ListUtils.allOf(this.rows, function (rowInfo, rowInd) {
                        return (rowInd == 0 || (rowInfo.rowIndex == _this.rows[rowInd - 1].rowIndex + 1)) && rowInfo.isSeries;
                    })) :
                    this._areCellsSelectedInSeries;
            },
            enumerable: true,
            configurable: true
        });
        TableSelectionData.prototype.foreach = function (onEachRowCallback, onEachCellCallback) {
            for (var rowOffset = 0, rowInfo = void 0; rowInfo = this.rows[rowOffset]; rowOffset++) {
                onEachRowCallback(rowInfo);
                for (var cellOffset = 0, cellInfo = void 0; cellInfo = rowInfo.cells[cellOffset]; cellOffset++)
                    onEachCellCallback(cellInfo, rowInfo);
            }
        };
        TableSelectionData.prototype.allOfCells = function (onEachCellCallback) {
            for (var rowOffset = 0, rowInfo = void 0; rowInfo = this.rows[rowOffset]; rowOffset++) {
                for (var cellOffset = 0, cellInfo = void 0; cellInfo = rowInfo.cells[cellOffset]; cellOffset++) {
                    if (!onEachCellCallback(cellInfo, rowInfo))
                        return false;
                }
            }
            return true;
        };
        TableSelectionData.prototype.calculateIsSquare = function () {
            var prevInterval;
            if (!this.withoutGapByRows)
                return false;
            var _loop_4 = function (rowInfo) {
                var rowGridInfo = this_4.info.gridInfoManager.tableCellInfos[rowInfo.rowIndex];
                var spans = __aspxRichEdit.ListUtils.map(rowInfo.cells, function (cellInfo) { return new __aspxRichEdit.FixedInterval(rowGridInfo[cellInfo.cellIndex].getGridCellIndex(), cellInfo.cell.columnSpan); });
                var isSeriesofSpans = __aspxRichEdit.ListUtils.allOf(spans, function (s, i) { return s.start == spans[i - 1].end; }, 1);
                var currInterval = new __aspxRichEdit.BoundaryInterval(spans[0].start, __aspxRichEdit.ListUtils.last(spans).end);
                if (!isSeriesofSpans || (prevInterval && !currInterval.equals(prevInterval)))
                    return { value: false };
                prevInterval = currInterval;
            };
            var this_4 = this;
            for (var _i = 0, _a = this.rows; _i < _a.length; _i++) {
                var rowInfo = _a[_i];
                var state_1 = _loop_4(rowInfo);
                if (typeof state_1 === "object")
                    return state_1.value;
            }
            return true;
        };
        TableSelectionData.prototype.atLeastOneCellFullySelected = function (selection) {
            return this.numRows > 1 || (this.numRows == 1 && this.rows[0].cells.length > 1) || this.firstCell.interval.equals(selection.getLastSelectedInterval());
        };
        return TableSelectionData;
    }());
    __aspxRichEdit.TableSelectionData = TableSelectionData;
    var SelectedTableInfo = (function () {
        function SelectedTableInfo(table, gridInfoManager, rawRowsData, extendedRowsData) {
            this.table = table;
            this.gridInfoManager = gridInfoManager;
            this.rawData = new TableSelectionData(this, rawRowsData);
            this.extendedData = new TableSelectionData(this, extendedRowsData);
        }
        Object.defineProperty(SelectedTableInfo.prototype, "isSelected", {
            get: function () { return !!this.rawData.rows.length; },
            enumerable: true,
            configurable: true
        });
        return SelectedTableInfo;
    }());
    __aspxRichEdit.SelectedTableInfo = SelectedTableInfo;
    var SelectedCellsCalculator = (function () {
        function SelectedCellsCalculator() {
            this.map = {};
        }
        SelectedCellsCalculator.prototype.calculate = function (tables, intervals) {
            var table = this.findTable(tables, intervals);
            return table ?
                this.fillResult(table, intervals) :
                new SelectedTableInfo(null, null, [], []);
        };
        SelectedCellsCalculator.prototype.findTable = function (tables, intervals) {
            if (!tables.length)
                return null;
            var fullInterval = new __aspxRichEdit.BoundaryInterval(intervals[0].start, __aspxRichEdit.ListUtils.last(intervals).end);
            if (fullInterval.length == 0)
                return __aspxRichEdit.Table.getTableByPosition(tables, fullInterval.start, true);
            var startTable = __aspxRichEdit.Table.correctBoundTable(tables, Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(tables, function (t) { return t.getStartPosition(); }, fullInterval.start)), fullInterval.start, function (index) { return --index; });
            var foundTable = null;
            var numFoundTablesOnOneLevel = 0;
            for (var tbl = startTable, tblInd = tbl.index; (tbl = tables[tblInd]) && (tbl.getStartPosition() <= fullInterval.end); tblInd++) {
                var inters = __aspxRichEdit.IntervalAlgorithms.getIntersection(tbl.interval, fullInterval);
                if (inters && (inters.length || inters.start != tbl.getEndPosition())) {
                    if (!foundTable || tbl.nestedLevel < foundTable.nestedLevel) {
                        foundTable = tbl;
                        numFoundTablesOnOneLevel = 1;
                    }
                    else if (tbl.nestedLevel == foundTable.nestedLevel)
                        numFoundTablesOnOneLevel++;
                }
            }
            return foundTable && numFoundTablesOnOneLevel == 1 && foundTable.interval.containsInterval(fullInterval) ? foundTable : null;
        };
        SelectedCellsCalculator.prototype.fillResult = function (table, intervals) {
            var intervalInd = 0;
            var selInterval = intervals[intervalInd].getBoundaryInterval();
            var tblPos = new __aspxRichEdit.TablePosition(table, -1, -1);
            while (tblPos.moveToNextRow()) {
                while (tblPos.moveToNextCell()) {
                    var cellInterval = tblPos.cell.interval;
                    var inters = __aspxRichEdit.IntervalAlgorithms.getIntersection(selInterval, cellInterval);
                    if (inters && (inters.length || !selInterval.length && inters.start < cellInterval.end)) {
                        this.add(tblPos);
                        if (tblPos.cell.endParagrapPosition.value >= selInterval.end) {
                            var nextInterval = intervals[++intervalInd];
                            if (nextInterval)
                                selInterval = nextInterval.getBoundaryInterval();
                            else
                                return this.extendMergedCells(table);
                        }
                    }
                }
            }
            return this.extendMergedCells(table);
        };
        SelectedCellsCalculator.prototype.add = function (tblPos) {
            tblPos = tblPos.clone();
            var oldVal = this.map[tblPos.rowIndex];
            if (oldVal)
                oldVal.push(tblPos);
            else
                this.map[tblPos.rowIndex] = [tblPos];
        };
        SelectedCellsCalculator.prototype.extendMergedCells = function (table) {
            var _this = this;
            var gridInfoManager = new __aspxRichEdit.LayoutFormatter.Table.CellGridInfoManager(table);
            var weakPositions = __aspxRichEdit.MapUtilsKeyAsNumber.toListBy(this.map, function (poss) { return __aspxRichEdit.ListUtils.deepCopy(poss); });
            __aspxRichEdit.ListUtils.foreach(weakPositions, function (tblPoss) {
                __aspxRichEdit.ListUtils.foreach(tblPoss, function (tblPos) {
                    if (tblPos.cell.verticalMerging != __aspxRichEdit.TableCellMergingState.None) {
                        var cellInfo_1 = gridInfoManager.gridInfosByTablePosition(tblPos);
                        __aspxRichEdit.ListUtils.foreachOnInterval(cellInfo_1.rowIndexesInterval, function (rowIndex) {
                            _this.add(new __aspxRichEdit.TablePosition(table, rowIndex, cellInfo_1.getCellIndexAbs(rowIndex)).init());
                        });
                    }
                });
            });
            var rowsInfo = __aspxRichEdit.MapUtilsKeyAsNumber.toListBy(this.map, function (tblPoss) {
                return __aspxRichEdit.ListUtils.unique(tblPoss, function (a, b) { return a.cellIndex - b.cellIndex; });
            })
                .sort(function (a, b) { return a[0].rowIndex - b[0].rowIndex; });
            return new SelectedTableInfo(table, gridInfoManager, SelectedCellsCalculator.translateRowPositionsToSelectedInfo(weakPositions), SelectedCellsCalculator.translateRowPositionsToSelectedInfo(rowsInfo));
        };
        SelectedCellsCalculator.translateRowPositionsToSelectedInfo = function (poss) {
            return __aspxRichEdit.ListUtils.map(poss, function (rowCellsPoss) { return new SelectedTableRowInfo(rowCellsPoss[0].rowIndex, __aspxRichEdit.ListUtils.map(rowCellsPoss, function (tblPos) { return new SelectedTableCellInfo(tblPos.cell, tblPos.cellIndex); })); });
        };
        return SelectedCellsCalculator;
    }());
    __aspxRichEdit.SelectedCellsCalculator = SelectedCellsCalculator;
    var TableSelectionExtender = (function () {
        function TableSelectionExtender() {
        }
        TableSelectionExtender.correctIntervalDueToTables = function (subDocument, newInterval) {
            if (newInterval.length == 0 || subDocument.tables.length == 0)
                return;
            var startCell = __aspxRichEdit.Table.getTableCellByPosition(subDocument.tables, newInterval.start);
            var endCell = __aspxRichEdit.Table.getTableCellByPosition(subDocument.tables, newInterval.end);
            if (startCell == null && endCell == null)
                return;
            if (startCell == null && endCell != null) {
                if (newInterval.end != endCell.parentRow.getStartPosition())
                    newInterval.expand(new __aspxRichEdit.FixedInterval(newInterval.end, endCell.parentRow.getEndPosition() - newInterval.end));
                return;
            }
            if (startCell != null && newInterval.end == startCell.endParagrapPosition.value) {
                newInterval.expand(startCell.interval);
                return;
            }
            if ((startCell != null && endCell == null) || TableSelectionExtender.firstCellIsParentCellForSecondCellsTable(endCell, startCell)) {
                if (newInterval.end != startCell.parentRow.parentTable.getEndPosition())
                    newInterval.expand(new __aspxRichEdit.FixedInterval(startCell.parentRow.getStartPosition(), newInterval.start - startCell.parentRow.getStartPosition()));
                return;
            }
            var startTable = __aspxRichEdit.Table.getTableByPosition(subDocument.tables, newInterval.start, false);
            var endTable = __aspxRichEdit.Table.getTableByPosition(subDocument.tables, newInterval.end, false);
            if (startTable != endTable) {
                newInterval.expand(new __aspxRichEdit.FixedInterval(startCell.parentRow.getStartPosition(), newInterval.start - startCell.parentRow.getStartPosition()));
                if (newInterval.end != endCell.parentRow.getStartPosition())
                    newInterval.expand(new __aspxRichEdit.FixedInterval(newInterval.end, endCell.parentRow.getEndPosition() - newInterval.end));
                return;
            }
            if (startCell != null && endCell != null && startCell != endCell && startCell.parentRow.parentTable == endCell.parentRow.parentTable) {
                newInterval.expand(startCell.interval);
                if (newInterval.end != endCell.startParagraphPosition.value)
                    newInterval.expand(endCell.interval);
                return;
            }
        };
        TableSelectionExtender.firstCellIsParentCellForSecondCellsTable = function (firstCell, secondCell) {
            if (firstCell == null || secondCell == null || secondCell.parentRow.parentTable.parentCell == null)
                return false;
            var parentTable = secondCell.parentRow.parentTable;
            while (parentTable.parentCell != null) {
                if (parentTable.parentCell == firstCell)
                    return true;
                parentTable = parentTable.parentCell.parentRow.parentTable;
            }
            return false;
        };
        return TableSelectionExtender;
    }());
    __aspxRichEdit.TableSelectionExtender = TableSelectionExtender;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SelectedSpecialRunInfo = (function () {
        function SelectedSpecialRunInfo() {
            this.noSpecRun();
        }
        SelectedSpecialRunInfo.prototype.noSpecRun = function () {
            this.setSpecRunInfo(null, -1, -1, false, -1);
        };
        SelectedSpecialRunInfo.prototype.setSpecRunInfo = function (parentSubDocument, picturePos, textBoxPos, isAnchoredObject, textBoxInnerSubDocumentId) {
            this.picturePos = picturePos;
            this.textBoxPos = textBoxPos;
            this.parentSubDocument = parentSubDocument;
            this.isAnchoredObject = isAnchoredObject;
            this.textBoxInnerSubDocumentId = textBoxInnerSubDocumentId;
        };
        SelectedSpecialRunInfo.prototype.init = function (interval, activeSubDocument) {
            if (this.textBoxInnerSubDocumentId == activeSubDocument.id)
                return;
            if (interval.length == 1) {
                var run = activeSubDocument.getRunByPosition(interval.start);
                switch (run.getType()) {
                    case __aspxRichEdit.RunType.AnchoredTextBoxRun:
                        this.setSpecRunInfo(activeSubDocument, -1, interval.start, true, run.subDocId);
                        break;
                    case __aspxRichEdit.RunType.AnchoredPictureRun:
                        this.setSpecRunInfo(activeSubDocument, interval.start, -1, true, -1);
                        break;
                    case __aspxRichEdit.RunType.InlinePictureRun:
                        this.setSpecRunInfo(activeSubDocument, interval.start, -1, false, -1);
                        break;
                }
            }
            else
                this.noSpecRun();
        };
        SelectedSpecialRunInfo.prototype.getTextBoxInnerSubDocumentId = function () {
            return this.textBoxInnerSubDocumentId;
        };
        Object.defineProperty(SelectedSpecialRunInfo.prototype, "isSelectedAnchorObject", {
            get: function () {
                return this.isAnchoredObject;
            },
            enumerable: true,
            configurable: true
        });
        SelectedSpecialRunInfo.prototype.getParentSubDocument = function () {
            return this.parentSubDocument;
        };
        SelectedSpecialRunInfo.prototype.getPosition = function () {
            return this.picturePos > -1 ? this.picturePos : this.textBoxPos;
        };
        SelectedSpecialRunInfo.prototype.getPicturePosition = function () {
            return this.picturePos;
        };
        SelectedSpecialRunInfo.prototype.getTextBoxPosition = function () {
            return this.textBoxPos;
        };
        SelectedSpecialRunInfo.prototype.isPictureSelected = function () {
            return this.picturePos > -1;
        };
        SelectedSpecialRunInfo.prototype.isTextBoxSelected = function () {
            return this.textBoxPos > -1;
        };
        SelectedSpecialRunInfo.prototype.isSelected = function () {
            return this.isPictureSelected() || this.isTextBoxSelected();
        };
        return SelectedSpecialRunInfo;
    }());
    __aspxRichEdit.SelectedSpecialRunInfo = SelectedSpecialRunInfo;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Selection = (function (_super) {
        __extends(Selection, _super);
        function Selection(model, layout) {
            var _this = _super.call(this) || this;
            _this.keepX = -1;
            _this.specialRunInfo = new __aspxRichEdit.SelectedSpecialRunInfo();
            _this.forwardDirection = true;
            _this.endOfLine = false;
            _this.intervals = [new __aspxRichEdit.FixedInterval(0, 0)];
            _this.searchIntervals = [];
            _this.misspelledIntervals = [];
            _this.pageIndex = -1;
            _this.onChanged = new __aspxRichEdit.EventDispatcher();
            _this.onSearchChanged = new __aspxRichEdit.EventDispatcher();
            _this.onMisspelledSelectionChanged = new __aspxRichEdit.EventDispatcher();
            _this.lastSelectedIntervalIndex = 0;
            _this.model = model;
            _this.layout = layout;
            _this.scrollManager = new __aspxRichEdit.ModelScrollManager();
            return _this;
        }
        Object.defineProperty(Selection.prototype, "collapsedPostion", {
            get: function () { return this.forwardDirection ? this.getLastSelectedInterval().start : this.getLastSelectedInterval().end; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Selection.prototype, "lastSelectedInterval", {
            get: function () { return this.intervals[this.lastSelectedIntervalIndex]; },
            enumerable: true,
            configurable: true
        });
        ;
        Object.defineProperty(Selection.prototype, "tableInfo", {
            get: function () {
                if (!this._tableInfo)
                    this._tableInfo = new __aspxRichEdit.SelectedCellsCalculator().calculate(this.model.activeSubDocument.tables, this.intervals);
                return this._tableInfo;
            },
            enumerable: true,
            configurable: true
        });
        Selection.prototype.onUpdateUnlocked = function (occurredEvents) {
            if (occurredEvents & SelectionBatchUpdateEvents.SelectionChanged)
                this.raiseSelectionChanged();
            if (occurredEvents & SelectionBatchUpdateEvents.SearchSelectionChanged)
                this.raiseSearchSelectionChanged();
            if (occurredEvents & SelectionBatchUpdateEvents.MisspelledSelectionChanged)
                this.raiseMisspelledSelectionChanged();
        };
        Selection.prototype.getSelectionState = function () {
            return new __aspxRichEdit.SelectionStateInfo(this.model.activeSubDocument.positionManager, this.intervals, this.forwardDirection, this.keepX, this.endOfLine);
        };
        Selection.prototype.restoreSelectionState = function (selectionState, upd) {
            this.keepX = selectionState.keepX;
            this.intervals = [];
            for (var i = 0, interval; interval = selectionState.intervals[i]; i++) {
                var newInterval = interval.getFixedInterval();
                if (i == 0)
                    this.setSelection(new __aspxRichEdit.SetSelectionParams()
                        .setInterval(interval.getFixedInterval())
                        .setEndOfLine(selectionState.endOfLine)
                        .setCorrectIntervalDueToFields(true)
                        .setCorrectIntervalDueToTables(true)
                        .setKeepX(selectionState.keepX)
                        .setUseFieldUiChecks(false));
                else
                    this.addIntervalToSelection(newInterval, selectionState.forwardDirection, selectionState.endOfLine, upd);
                this.keepX = selectionState.keepX;
            }
            selectionState.destructor();
        };
        Selection.prototype.resetSearchSelection = function () {
            if (this.searchIntervals.length) {
                this.searchIntervals = [];
                this.raiseSearchSelectionChanged();
            }
        };
        Selection.prototype.setFullSelection = function (intervals) {
            this.keepX = -1;
            this.forwardDirection = true;
            this.endOfLine = true;
            this.intervals = __aspxRichEdit.ListUtils.deepCopy(intervals);
            this._tableInfo = null;
            this.lastSelectedIntervalIndex = intervals.length;
            this.inputPosition.reset();
            this.raiseSelectionChanged();
        };
        Selection.prototype.getIntervalsClone = function () {
            return __aspxRichEdit.ListUtils.deepCopy(this.intervals);
        };
        Selection.prototype.correctAfterTextBufferChanged = function (control) {
            var intersection = __aspxRichEdit.IntervalAlgorithms.getIntersectionsTwoArraysOfInterval([__aspxRichEdit.FixedInterval.fromPositions(0, control.model.activeSubDocument.getDocumentEndPosition())], this.intervals);
            if (!__aspxRichEdit.ListUtils.equals(intersection, this.intervals))
                control.history.addAndRedo(new __aspxRichEdit.SetSelectionHistoryItem(control.modelManipulator, control.model.activeSubDocument, intersection, this, UpdateInputPositionProperties.No, this.endOfLine));
        };
        Selection.prototype.isCollapsed = function () {
            return __aspxRichEdit.ConstInterval.isCollapsed(this.intervals);
        };
        Selection.prototype.setSelection = function (params) {
            this.deprecatedSetSelection(params.interval.start, params.interval.end, params.endOfLine, params.keepX, params.updateInputPositionProperties ? UpdateInputPositionProperties.Yes : UpdateInputPositionProperties.No, params.correctIntervalDueToFields, params.correctIntervalDueToTables, __aspxRichEdit.ModelScrollManager.DontChangeScrollPosition, params.useFieldUiChecks);
        };
        Selection.prototype.addSelection = function (anchor, end, endOfLine, keepX, correctIntervalDueToTables, visibleModelPosition, useUiChecks) {
            if (correctIntervalDueToTables === void 0) { correctIntervalDueToTables = true; }
            if (visibleModelPosition === void 0) { visibleModelPosition = __aspxRichEdit.ModelScrollManager.StandartScrollPosition; }
            if (useUiChecks === void 0) { useUiChecks = true; }
            this.keepX = keepX;
            var forwardDirection = (end >= anchor);
            var newInterval = new __aspxRichEdit.FixedInterval(Math.min(anchor, end), Math.abs(anchor - end));
            if (this.forwardDirection != forwardDirection || this.endOfLine != endOfLine || !this.getLastSelectedInterval().equals(newInterval)) {
                if (this.isCollapsed())
                    this.intervals = [];
                if (correctIntervalDueToTables)
                    __aspxRichEdit.TableSelectionExtender.correctIntervalDueToTables(this.model.activeSubDocument, newInterval);
                if (useUiChecks)
                    __aspxRichEdit.Field.correctIntervalDueToFields(this.model.activeSubDocument, newInterval);
                else
                    __aspxRichEdit.Field.correctIntervalDueToFieldsWithoutUiChecks(this.model.activeSubDocument, newInterval);
                this.addIntervalToSelection(newInterval, forwardDirection, endOfLine, UpdateInputPositionProperties.Yes);
            }
            this.scrollManager.setScroll(new __aspxRichEdit.Scroll.State().byModelPosition.setModelPosition(visibleModelPosition).useStdRelativePosition().useStdOffset());
            this.deprecatedCallSetScrollPosition(visibleModelPosition);
        };
        Selection.prototype.setSearchSelectionIntervals = function (intervals) {
            this.searchIntervals = __aspxRichEdit.IntervalAlgorithms.getMergedIntervals(intervals, false);
            this.raiseSearchSelectionChanged();
        };
        Selection.prototype.setMisspelledSelectionIntervals = function (intervals) {
            this.misspelledIntervals = __aspxRichEdit.IntervalAlgorithms.getMergedIntervals(intervals, false);
            this.raiseMisspelledSelectionChanged();
        };
        Selection.prototype.extendLastSelection = function (end, endOfLine, keepX, upd, callInCaseIntervalsEqual, visibleModelPosition) {
            if (upd === void 0) { upd = UpdateInputPositionProperties.Yes; }
            if (callInCaseIntervalsEqual === void 0) { callInCaseIntervalsEqual = null; }
            if (visibleModelPosition === void 0) { visibleModelPosition = __aspxRichEdit.ModelScrollManager.StandartScrollPosition; }
            this.keepX = keepX;
            var lastInterval = this.getLastSelectedInterval();
            var currInterval = lastInterval.clone();
            var oldAnchor = this.forwardDirection ? lastInterval.start : lastInterval.end;
            var forwardDirection = (end >= oldAnchor);
            var newInterval = new __aspxRichEdit.FixedInterval(Math.min(oldAnchor, end), Math.abs(oldAnchor - end));
            if (this.endOfLine != endOfLine || this.forwardDirection != forwardDirection || !lastInterval.equals(newInterval)) {
                __aspxRichEdit.TableSelectionExtender.correctIntervalDueToTables(this.model.activeSubDocument, newInterval);
                __aspxRichEdit.Field.correctIntervalDueToFields(this.model.activeSubDocument, newInterval);
                if (callInCaseIntervalsEqual && currInterval.equals(newInterval))
                    callInCaseIntervalsEqual(this.model.activeSubDocument.fields, this);
                else {
                    this.intervals.splice(this.lastSelectedIntervalIndex, 1);
                    this.addIntervalToSelection(newInterval, forwardDirection, endOfLine, upd);
                }
            }
            this.deprecatedCallSetScrollPosition(visibleModelPosition);
        };
        Selection.prototype.extendLastSelectionOnOneSide = function (end, endOfLine, isDragLeftEdge) {
            var lastInterval = this.getLastSelectedInterval();
            var newInterval = null;
            var forwardDirection = this.getCalculatedForwardDirection(end);
            if (isDragLeftEdge && end < lastInterval.end)
                newInterval = new __aspxRichEdit.FixedInterval(end, lastInterval.length - (end - lastInterval.start));
            else if (!isDragLeftEdge && ((end - lastInterval.start) >= 1))
                newInterval = new __aspxRichEdit.FixedInterval(lastInterval.start, end - lastInterval.start);
            if (newInterval && (this.endOfLine != endOfLine || !lastInterval.equals(newInterval))) {
                this.intervals.splice(this.lastSelectedIntervalIndex, 1);
                __aspxRichEdit.TableSelectionExtender.correctIntervalDueToTables(this.model.activeSubDocument, newInterval);
                __aspxRichEdit.Field.correctIntervalDueToFields(this.model.activeSubDocument, newInterval);
                this.addIntervalToSelection(newInterval, forwardDirection, endOfLine, UpdateInputPositionProperties.No);
            }
        };
        Selection.prototype.getCalculatedForwardDirection = function (end) {
            var lastInterval = this.getLastSelectedInterval();
            var oldAnchor = this.forwardDirection ? lastInterval.start : lastInterval.end;
            return end >= oldAnchor;
        };
        Selection.prototype.addIntervalToSelection = function (newInterval, forwardDirection, endOfLine, upd) {
            if (this.model.activeSubDocument.getDocumentEndPosition() == newInterval.start && newInterval.length == 0)
                throw new Error("Impossible set selection with length == 0 after last paragraph run.");
            this._tableInfo = null;
            this.intervals.push(newInterval);
            this.intervals = __aspxRichEdit.IntervalAlgorithms.getMergedIntervals(this.intervals, true);
            this.lastSelectedIntervalIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.intervals, function (curr) { return curr.start; }, newInterval.start);
            this.forwardDirection = forwardDirection;
            this.endOfLine = endOfLine;
            if (upd == UpdateInputPositionProperties.Yes)
                this.inputPosition.reset();
            this.raiseSelectionChanged();
        };
        Selection.prototype.raiseSelectionChanged = function () {
            if (this.isUpdateLocked())
                this.registerOccurredEvent(SelectionBatchUpdateEvents.SelectionChanged);
            else
                this.onChanged.raise("NotifySelectionChanged", this);
        };
        Selection.prototype.raiseSearchSelectionChanged = function () {
            if (this.isUpdateLocked())
                this.registerOccurredEvent(SelectionBatchUpdateEvents.SearchSelectionChanged);
            else
                this.onSearchChanged.raise("NotifySearchSelectionChanged");
        };
        Selection.prototype.raiseMisspelledSelectionChanged = function () {
            if (this.isUpdateLocked())
                this.registerOccurredEvent(SelectionBatchUpdateEvents.MisspelledSelectionChanged);
            else
                this.onMisspelledSelectionChanged.raise("NotifyMisspelledSelectionChanged");
        };
        Selection.prototype.deprecatedSetSelection = function (firstPosition, secondPosition, endOfLine, keepX, upd, correctIntervalDueToFields, correctIntervalDueToTables, visibleModelPosition, useFieldUiChecks) {
            if (correctIntervalDueToFields === void 0) { correctIntervalDueToFields = true; }
            if (correctIntervalDueToTables === void 0) { correctIntervalDueToTables = true; }
            if (visibleModelPosition === void 0) { visibleModelPosition = __aspxRichEdit.ModelScrollManager.StandartScrollPosition; }
            if (useFieldUiChecks === void 0) { useFieldUiChecks = true; }
            if (firstPosition < 0 || secondPosition < 0)
                throw new Error(__aspxRichEdit.Errors.InternalException);
            this.keepX = keepX;
            var newInterval = new __aspxRichEdit.FixedInterval(Math.min(firstPosition, secondPosition), Math.abs(firstPosition - secondPosition));
            this.specialRunInfo.init(newInterval, this.model.activeSubDocument);
            if (this.endOfLine != endOfLine || this.intervals.length != 1 || !this.intervals[0].equals(newInterval)) {
                this.intervals = [];
                if (correctIntervalDueToTables)
                    __aspxRichEdit.TableSelectionExtender.correctIntervalDueToTables(this.model.activeSubDocument, newInterval);
                if (correctIntervalDueToFields)
                    if (useFieldUiChecks)
                        __aspxRichEdit.Field.correctIntervalDueToFields(this.model.activeSubDocument, newInterval);
                    else
                        __aspxRichEdit.Field.correctIntervalDueToFieldsWithoutUiChecks(this.model.activeSubDocument, newInterval);
                this.addIntervalToSelection(newInterval, secondPosition >= firstPosition, endOfLine, upd);
            }
            this.deprecatedCallSetScrollPosition(visibleModelPosition);
        };
        Selection.prototype.deprecatedCallSetScrollPosition = function (visibleModelPosition) {
            if (visibleModelPosition == __aspxRichEdit.ModelScrollManager.DontChangeScrollPosition)
                return;
            this.scrollManager.setScroll(__aspxRichEdit.ModelScrollManager.StandartScrollPosition ?
                new __aspxRichEdit.Scroll.State().byModelPosition
                    .useCurrentPosition(this)
                    .useStdRelativePosition()
                    .useStdOffset() :
                new __aspxRichEdit.Scroll.State().byModelPosition
                    .setModelPosition(visibleModelPosition)
                    .useStdRelativePosition()
                    .useStdOffset());
        };
        Selection.prototype.getLastSelectedInterval = function () {
            return this.intervals[this.lastSelectedIntervalIndex];
        };
        return Selection;
    }(__aspxRichEdit.BatchUpdatableObject));
    __aspxRichEdit.Selection = Selection;
    var SelectionBatchUpdateEvents;
    (function (SelectionBatchUpdateEvents) {
        SelectionBatchUpdateEvents[SelectionBatchUpdateEvents["None"] = 0] = "None";
        SelectionBatchUpdateEvents[SelectionBatchUpdateEvents["SelectionChanged"] = 1] = "SelectionChanged";
        SelectionBatchUpdateEvents[SelectionBatchUpdateEvents["SearchSelectionChanged"] = 4] = "SearchSelectionChanged";
        SelectionBatchUpdateEvents[SelectionBatchUpdateEvents["MisspelledSelectionChanged"] = 8] = "MisspelledSelectionChanged";
    })(SelectionBatchUpdateEvents || (SelectionBatchUpdateEvents = {}));
    var UpdateInputPositionProperties;
    (function (UpdateInputPositionProperties) {
        UpdateInputPositionProperties[UpdateInputPositionProperties["No"] = 0] = "No";
        UpdateInputPositionProperties[UpdateInputPositionProperties["Yes"] = 1] = "Yes";
    })(UpdateInputPositionProperties = __aspxRichEdit.UpdateInputPositionProperties || (__aspxRichEdit.UpdateInputPositionProperties = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SelectionStateInfo = (function () {
        function SelectionStateInfo(manager, intervals, forwardDirection, keepX, endOfLine) {
            this.manager = manager;
            this.keepX = keepX;
            this.forwardDirection = forwardDirection;
            this.endOfLine = endOfLine;
            this.intervals = __aspxRichEdit.ListUtils.map(intervals, function (curr) { return curr.getLinkedInterval(manager); });
        }
        SelectionStateInfo.prototype.destructor = function () {
            for (var _i = 0, _a = this.intervals; _i < _a.length; _i++) {
                var interval = _a[_i];
                interval.destructor(this.manager);
            }
            this.intervals = [];
        };
        return SelectionStateInfo;
    }());
    __aspxRichEdit.SelectionStateInfo = SelectionStateInfo;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SetSelectionParams = (function () {
        function SetSelectionParams() {
            this.interval = null;
            this.endOfLine = true;
            this.keepX = -1;
            this.updateInputPositionProperties = true;
            this.correctIntervalDueToFields = true;
            this.correctIntervalDueToTables = true;
            this.useFieldUiChecks = true;
        }
        SetSelectionParams.prototype.setInterval = function (interval) {
            this.interval = interval.clone();
            return this;
        };
        SetSelectionParams.prototype.setPosition = function (position) {
            this.interval = new __aspxRichEdit.FixedInterval(position, 0);
            return this;
        };
        SetSelectionParams.prototype.setEndOfLine = function (endOfLine) {
            this.endOfLine = endOfLine;
            return this;
        };
        SetSelectionParams.prototype.setKeepX = function (keepX) {
            this.keepX = keepX;
            return this;
        };
        SetSelectionParams.prototype.setUpdateInputPositionProperties = function (updateInputPositionProperties) {
            this.updateInputPositionProperties = updateInputPositionProperties;
            return this;
        };
        SetSelectionParams.prototype.setCorrectIntervalDueToFields = function (correctIntervalDueToFields) {
            this.correctIntervalDueToFields = correctIntervalDueToFields;
            return this;
        };
        SetSelectionParams.prototype.setCorrectIntervalDueToTables = function (correctIntervalDueToTables) {
            this.correctIntervalDueToTables = correctIntervalDueToTables;
            return this;
        };
        SetSelectionParams.prototype.setUseFieldUiChecks = function (useFieldUiChecks) {
            this.useFieldUiChecks = useFieldUiChecks;
            return this;
        };
        return SetSelectionParams;
    }());
    __aspxRichEdit.SetSelectionParams = SetSelectionParams;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ModelWordPositionHelper = (function () {
        function ModelWordPositionHelper() {
        }
        ModelWordPositionHelper.getWordStartPosition = function (subDocument, position) {
            return ModelWordPositionHelper.getWordStartPositionByCharCondition(subDocument, position, function (char) { return __aspxRichEdit.RichUtils.isWhitespace.test(char); });
        };
        ModelWordPositionHelper.getWordStartPositionByCharCondition = function (subDocument, position, condition) {
            var iterator = new __aspxRichEdit.ModelIterator(subDocument, true);
            iterator.setPosition(position);
            while (iterator.moveToPrevChar()) {
                var char = iterator.getCurrentChar();
                var runType = iterator.run.getType();
                if (condition(char) || runType == __aspxRichEdit.RunType.ParagraphRun || runType == __aspxRichEdit.RunType.SectionRun)
                    return iterator.getAbsolutePosition() + 1;
            }
            return iterator.getAbsolutePosition();
        };
        ModelWordPositionHelper.getPrevWordStartPosition = function (subDocument, position) {
            var iterator = new __aspxRichEdit.ModelIterator(subDocument, true);
            iterator.setPosition(position);
            var firstWhitespaceIsFound = false;
            var prevWordIsFound = false;
            while (iterator.moveToPrevChar()) {
                var char = iterator.getCurrentChar();
                var runType = iterator.run.getType();
                if ((__aspxRichEdit.RichUtils.isWhitespace.test(char) && prevWordIsFound) || runType == __aspxRichEdit.RunType.ParagraphRun || runType == __aspxRichEdit.RunType.SectionRun)
                    return iterator.getAbsolutePosition() + 1;
                if (__aspxRichEdit.RichUtils.isWhitespace.test(char))
                    firstWhitespaceIsFound = true;
                else if (firstWhitespaceIsFound)
                    prevWordIsFound = true;
            }
            return iterator.getAbsolutePosition();
        };
        ModelWordPositionHelper.getNextWordEndPosition = function (subDocument, position) {
            var iterator = new __aspxRichEdit.ModelIterator(subDocument, true);
            iterator.setPosition(position);
            var firstWhitespaceIsFound = false;
            var nextWordIsFound = false;
            do {
                var char = iterator.getCurrentChar();
                var runType = iterator.run.getType();
                if ((__aspxRichEdit.RichUtils.isWhitespace.test(char) && nextWordIsFound) || runType == __aspxRichEdit.RunType.ParagraphRun || runType == __aspxRichEdit.RunType.SectionRun)
                    return iterator.getAbsolutePosition() - 1;
                if (__aspxRichEdit.RichUtils.isWhitespace.test(char))
                    firstWhitespaceIsFound = true;
                else if (firstWhitespaceIsFound)
                    nextWordIsFound = true;
            } while (iterator.moveToNextChar());
            return iterator.getAbsolutePosition();
        };
        return ModelWordPositionHelper;
    }());
    __aspxRichEdit.ModelWordPositionHelper = ModelWordPositionHelper;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SpellCheckerInterval = (function (_super) {
        __extends(SpellCheckerInterval, _super);
        function SpellCheckerInterval() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SpellCheckerInterval.prototype.setStart = function (start) {
            this.start = start;
            this.onChanged();
        };
        SpellCheckerInterval.prototype.setLength = function (length) {
            this.length = length;
            this.onChanged();
        };
        SpellCheckerInterval.prototype.onChanged = function () { };
        return SpellCheckerInterval;
    }(__aspxRichEdit.FixedInterval));
    __aspxRichEdit.SpellCheckerInterval = SpellCheckerInterval;
    var UncheckedInterval = (function (_super) {
        __extends(UncheckedInterval, _super);
        function UncheckedInterval(start, length, isSplitted) {
            if (isSplitted === void 0) { isSplitted = true; }
            var _this = _super.call(this, start, length) || this;
            _this.info = new UncheckedIntervalInfo(isSplitted);
            return _this;
        }
        UncheckedInterval.prototype.onChanged = function () {
            this.info.isChecking = false;
        };
        return UncheckedInterval;
    }(SpellCheckerInterval));
    __aspxRichEdit.UncheckedInterval = UncheckedInterval;
    var UncheckedIntervalInfo = (function () {
        function UncheckedIntervalInfo(isSplitted) {
            this.isSplitted = isSplitted;
            this.isChecking = false;
        }
        return UncheckedIntervalInfo;
    }());
    __aspxRichEdit.UncheckedIntervalInfo = UncheckedIntervalInfo;
    var MisspelledInterval = (function (_super) {
        __extends(MisspelledInterval, _super);
        function MisspelledInterval(start, length, errorInfo) {
            var _this = _super.call(this, start, length) || this;
            _this.errorInfo = errorInfo;
            return _this;
        }
        return MisspelledInterval;
    }(SpellCheckerInterval));
    __aspxRichEdit.MisspelledInterval = MisspelledInterval;
    var IgnoredInterval = (function (_super) {
        __extends(IgnoredInterval, _super);
        function IgnoredInterval(start, length, word) {
            var _this = _super.call(this, start, length) || this;
            _this.word = word;
            return _this;
        }
        return IgnoredInterval;
    }(SpellCheckerInterval));
    __aspxRichEdit.IgnoredInterval = IgnoredInterval;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SpellCheckerIntervalCollection = (function () {
        function SpellCheckerIntervalCollection() {
            this.intervals = [];
        }
        SpellCheckerIntervalCollection.prototype.getIntervals = function () {
            return this.intervals;
        };
        SpellCheckerIntervalCollection.prototype.add = function (newInterval) {
            var index = this.intervals.length;
            while (index > 0) {
                if (this.intervals[index - 1].start < newInterval.start)
                    break;
                index--;
            }
            this.intervals.splice(index, 0, newInterval);
        };
        SpellCheckerIntervalCollection.prototype.remove = function (index) {
            this.intervals.splice(index, 1);
        };
        SpellCheckerIntervalCollection.prototype.onModelIntervalChanged = function (start, length, isSeparator) {
            if (length > 0)
                this.onModelIntervalInserted(start, length, isSeparator);
            else
                this.onModelIntervalRemoved(start, -length);
        };
        SpellCheckerIntervalCollection.prototype.onModelIntervalInserted = function (start, length, _isSeparator) {
            this.forEach(function (interval) {
                if (interval.start > start)
                    interval.setStart(interval.start + length);
                else if (interval.end >= start)
                    interval.setLength(interval.length + length);
            });
        };
        SpellCheckerIntervalCollection.prototype.onModelIntervalRemoved = function (start, length) {
            var _this = this;
            var removedInterval = new __aspxRichEdit.FixedInterval(start, length);
            this.forEach(function (interval, index) {
                if (removedInterval.containsInterval(interval))
                    _this.remove(index);
                else if (removedInterval.start < interval.start) {
                    interval.setLength(interval.length - Math.max(0, removedInterval.end - interval.start));
                    interval.setStart(interval.start - Math.min(removedInterval.length, interval.start - removedInterval.start));
                }
                else if (interval.end > removedInterval.start)
                    interval.setLength(interval.length - Math.min(removedInterval.length, interval.end - removedInterval.start));
            });
        };
        SpellCheckerIntervalCollection.prototype.forEach = function (callback) {
            var index = this.intervals.length;
            while (--index >= 0)
                callback(this.intervals[index], index);
        };
        SpellCheckerIntervalCollection.prototype.deleteIntervalsByPositions = function (start, end) {
            var _this = this;
            var defInterval = __aspxRichEdit.FixedInterval.fromPositions(start, end);
            this.forEach(function (interval, index) {
                var intersection = __aspxRichEdit.IntervalAlgorithms.getIntersection(interval, defInterval);
                if (intersection && intersection.length > 0)
                    _this.remove(index);
            });
        };
        SpellCheckerIntervalCollection.prototype.findIntervalIndexByPositions = function (start, end) {
            return __aspxRichEdit.ListUtils.indexBy(this.intervals, function (interval) { return interval.start == start && interval.end == end; });
        };
        return SpellCheckerIntervalCollection;
    }());
    __aspxRichEdit.SpellCheckerIntervalCollection = SpellCheckerIntervalCollection;
    var UncheckedIntervalCollection = (function (_super) {
        __extends(UncheckedIntervalCollection, _super);
        function UncheckedIntervalCollection() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        UncheckedIntervalCollection.prototype.findCheckingIntervalByPositions = function (start, end) {
            var index = this.findIntervalIndexByPositions(start, end);
            return index >= 0 && this.intervals[index].info.isChecking ? this.intervals[index] : null;
        };
        UncheckedIntervalCollection.prototype.onModelIntervalInserted = function (start, length, isSeparator) {
            var hasIntersection = false;
            var separatorWasAdded = false;
            this.forEach(function (interval) {
                if (interval.containsWithIntervalEnd(start)) {
                    hasIntersection = true;
                    if (isSeparator && interval.end == start)
                        separatorWasAdded = true;
                    else
                        interval.info.isSplitted = false;
                }
            });
            if (!separatorWasAdded)
                _super.prototype.onModelIntervalInserted.call(this, start, length, isSeparator);
            if (!hasIntersection)
                this.add(new __aspxRichEdit.UncheckedInterval(start, length, false));
        };
        UncheckedIntervalCollection.prototype.onModelIntervalRemoved = function (start, length) {
            var removedInterval = new __aspxRichEdit.FixedInterval(start, length);
            var hasIntersection = false;
            this.forEach(function (interval) {
                if (__aspxRichEdit.IntervalAlgorithms.getIntersection(interval, removedInterval))
                    hasIntersection = true;
            });
            _super.prototype.onModelIntervalRemoved.call(this, start, length);
            if (!hasIntersection)
                this.add(new __aspxRichEdit.UncheckedInterval(start, 1));
        };
        return UncheckedIntervalCollection;
    }(SpellCheckerIntervalCollection));
    __aspxRichEdit.UncheckedIntervalCollection = UncheckedIntervalCollection;
    var MisspelledIntervalCollection = (function (_super) {
        __extends(MisspelledIntervalCollection, _super);
        function MisspelledIntervalCollection() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        MisspelledIntervalCollection.prototype.addIfNotExists = function (newInterval) {
            if (this.findIntervalIndexByPositions(newInterval.start, newInterval.end) < 0)
                this.add(newInterval);
        };
        MisspelledIntervalCollection.prototype.findNext = function (position) {
            for (var i = 0, interval = void 0; interval = this.intervals[i]; i++)
                if (interval.end >= position)
                    return interval;
            return this.intervals[0] ? this.intervals[0] : null;
        };
        MisspelledIntervalCollection.prototype.deleteOldIntervals = function (defInterval, isIntervalStartWithParagraph) {
            var _this = this;
            this.forEach(function (interval, index) {
                var intersection = __aspxRichEdit.IntervalAlgorithms.getIntersection(interval, defInterval);
                if (intersection && intersection.length > 0)
                    if (isIntervalStartWithParagraph || interval.start !== defInterval.start || interval.errorInfo.errorType !== __aspxRichEdit.SpellingErrorType.Repeating)
                        _this.remove(index);
            });
        };
        return MisspelledIntervalCollection;
    }(SpellCheckerIntervalCollection));
    __aspxRichEdit.MisspelledIntervalCollection = MisspelledIntervalCollection;
    var IgnoredIntervalCollection = (function (_super) {
        __extends(IgnoredIntervalCollection, _super);
        function IgnoredIntervalCollection() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        IgnoredIntervalCollection.prototype.contains = function (start, length, word) {
            var index = this.findIntervalIndexByPositions(start, start + length);
            return index >= 0 && this.intervals[index].word == word;
        };
        return IgnoredIntervalCollection;
    }(SpellCheckerIntervalCollection));
    __aspxRichEdit.IgnoredIntervalCollection = IgnoredIntervalCollection;
    var IgnoredWordsCollection = (function () {
        function IgnoredWordsCollection() {
            this.ignoredWords = [];
        }
        IgnoredWordsCollection.prototype.add = function (word) {
            if (!this.contains(word))
                this.ignoredWords.push(word);
        };
        IgnoredWordsCollection.prototype.contains = function (word) {
            return this.ignoredWords.indexOf(word) !== -1;
        };
        return IgnoredWordsCollection;
    }());
    __aspxRichEdit.IgnoredWordsCollection = IgnoredWordsCollection;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SpellCheckerIntervalsManager = (function () {
        function SpellCheckerIntervalsManager(subDocument) {
            this.subDocument = subDocument;
            this.uncheckedIntervalCollection = new __aspxRichEdit.UncheckedIntervalCollection();
            this.misspelledIntervalCollection = new __aspxRichEdit.MisspelledIntervalCollection();
            this.ignoredIntervalCollection = new __aspxRichEdit.IgnoredIntervalCollection();
            this.ignoredWordsCollection = new __aspxRichEdit.IgnoredWordsCollection();
            this.isInitialize = false;
        }
        SpellCheckerIntervalsManager.prototype.initializeUncheckedIntervals = function () {
            if (!this.isInitialize) {
                this.createUncheckedIntervals(0, this.subDocument.getDocumentEndPosition());
                this.isInitialize = true;
            }
        };
        SpellCheckerIntervalsManager.prototype.getIntervalsToCheck = function () {
            this.splitUncheckedIntervals();
            var results = [];
            var totalLength = 0;
            var uncheckedIntervals = this.uncheckedIntervalCollection.getIntervals();
            for (var i = 0, uncheckedInterval = void 0; uncheckedInterval = uncheckedIntervals[i]; i++) {
                if (uncheckedInterval.info.isChecking || totalLength > __aspxRichEdit.SpellChecker.MAX_REQUEST_LENGTH)
                    return results;
                this.expandUncheckedInterval(uncheckedInterval);
                if (uncheckedInterval.length > 0) {
                    this.prepareUncheckedInterval(uncheckedInterval);
                    uncheckedInterval.info.isChecking = true;
                    totalLength += uncheckedInterval.length;
                    results.push(uncheckedInterval);
                }
            }
            this.removeEmptyUncheckedIntervals();
            return results;
        };
        SpellCheckerIntervalsManager.prototype.applyCheckResults = function (checkedIntervals) {
            for (var i = 0, checkedInterval = void 0; checkedInterval = checkedIntervals[i]; i++) {
                var startPosition = checkedInterval[__aspxRichEdit.JSONCheckSpellingCommand.StartPosition];
                var endPosition = checkedInterval[__aspxRichEdit.JSONCheckSpellingCommand.EndPosition];
                var checkingInterval = this.uncheckedIntervalCollection.findCheckingIntervalByPositions(startPosition, endPosition);
                if (checkingInterval) {
                    var isIntervalStartWithParagraph = startPosition === __aspxRichEdit.ModelWordPositionHelper.getPrevWordStartPosition(this.subDocument, startPosition);
                    this.misspelledIntervalCollection.deleteOldIntervals(checkingInterval, isIntervalStartWithParagraph);
                    this.createMisspelledIntervals(checkedInterval[__aspxRichEdit.JSONCheckSpellingCommand.SpellingErrors], checkingInterval);
                    this.uncheckedIntervalCollection.deleteIntervalsByPositions(startPosition, endPosition);
                }
            }
        };
        SpellCheckerIntervalsManager.prototype.onModelIntervalChanged = function (start, length, isSeparator) {
            this.uncheckedIntervalCollection.onModelIntervalChanged(start, length, isSeparator);
            this.misspelledIntervalCollection.onModelIntervalChanged(start, length, isSeparator);
            this.ignoredIntervalCollection.onModelIntervalChanged(start, length, isSeparator);
        };
        SpellCheckerIntervalsManager.prototype.getMisspelledIntervals = function () {
            return this.misspelledIntervalCollection.getIntervals();
        };
        SpellCheckerIntervalsManager.prototype.getUncheckedIntervalsCount = function () {
            return this.uncheckedIntervalCollection.getIntervals().length;
        };
        SpellCheckerIntervalsManager.prototype.getSelectedMisspelledInterval = function (selectionIntervals) {
            var selectedInterval = null;
            this.misspelledIntervalCollection.forEach(function (interval) {
                if (interval.containsInterval(selectionIntervals[0]))
                    selectedInterval = interval;
            });
            return selectedInterval;
        };
        SpellCheckerIntervalsManager.prototype.findNextMisspelledInterval = function (position) {
            return this.misspelledIntervalCollection.findNext(position);
        };
        SpellCheckerIntervalsManager.prototype.addIgnoredInterval = function (start, end, word) {
            this.ignoredIntervalCollection.add(new __aspxRichEdit.IgnoredInterval(start, end, word));
        };
        SpellCheckerIntervalsManager.prototype.deleteMisspelledIntervalsByPositions = function (start, end) {
            this.misspelledIntervalCollection.deleteIntervalsByPositions(start, end);
        };
        SpellCheckerIntervalsManager.prototype.ignoreAll = function (word) {
            var _this = this;
            this.ignoredWordsCollection.add(word);
            this.misspelledIntervalCollection.forEach(function (interval, index) {
                if (interval.errorInfo.word == word && interval.errorInfo.errorType == __aspxRichEdit.SpellingErrorType.Misspelling) {
                    _this.misspelledIntervalCollection.remove(index);
                }
            });
        };
        SpellCheckerIntervalsManager.prototype.removeIntervalsWithErrorByWord = function (word) {
            var _this = this;
            this.misspelledIntervalCollection.forEach(function (interval, index) {
                if (interval.errorInfo.word == word && interval.errorInfo.errorType == __aspxRichEdit.SpellingErrorType.Misspelling)
                    _this.misspelledIntervalCollection.remove(index);
            });
        };
        SpellCheckerIntervalsManager.prototype.getIntervalsWithErrorByWord = function (word) {
            var intervals = [];
            this.misspelledIntervalCollection.forEach(function (interval) {
                if (interval.errorInfo.word == word && interval.errorInfo.errorType == __aspxRichEdit.SpellingErrorType.Misspelling) {
                    intervals.push(new __aspxRichEdit.FixedInterval(interval.start, interval.length));
                }
            });
            return intervals;
        };
        SpellCheckerIntervalsManager.prototype.expandUncheckedInterval = function (interval) {
            var expandIntervalStart = __aspxRichEdit.ModelWordPositionHelper.getPrevWordStartPosition(this.subDocument, interval.start);
            var expandIntervalEnd = __aspxRichEdit.ModelWordPositionHelper.getNextWordEndPosition(this.subDocument, interval.end);
            interval.start = expandIntervalStart;
            interval.length = expandIntervalEnd - expandIntervalStart;
        };
        SpellCheckerIntervalsManager.prototype.removeEmptyUncheckedIntervals = function () {
            var _this = this;
            this.uncheckedIntervalCollection.forEach(function (interval, index) {
                if (interval.length == 0)
                    _this.uncheckedIntervalCollection.remove(index);
            });
        };
        SpellCheckerIntervalsManager.prototype.prepareUncheckedInterval = function (interval) {
            var iterator = new __aspxRichEdit.ModelIterator(this.subDocument, false);
            var textToCheck = "";
            var hiddenIntervals = [];
            var ignoredLength = 0;
            var ignoredStart = 0;
            var fieldLevel = 0;
            var isPreviouslyHiddeh = false;
            iterator.setPosition(interval.start);
            do {
                if (!iterator.run.getCharacterMergedProperies().hidden && iterator.run.getType() !== __aspxRichEdit.RunType.FieldCodeStartRun && fieldLevel === 0) {
                    textToCheck += iterator.getCurrentChar();
                    if (isPreviouslyHiddeh) {
                        hiddenIntervals.push(new __aspxRichEdit.FixedInterval(ignoredStart, ignoredLength));
                        ignoredLength = 0;
                        isPreviouslyHiddeh = false;
                    }
                    ignoredStart++;
                }
                else {
                    ignoredLength++;
                    isPreviouslyHiddeh = true;
                    if (iterator.run.getType() == __aspxRichEdit.RunType.FieldCodeStartRun)
                        fieldLevel++;
                    if (iterator.run.getType() == __aspxRichEdit.RunType.FieldResultEndRun)
                        fieldLevel--;
                }
            } while (iterator.getAbsolutePosition() < interval.end && iterator.moveToNextChar());
            interval.info.textToCheck = textToCheck;
            interval.info.hiddenIntervals = hiddenIntervals;
        };
        SpellCheckerIntervalsManager.prototype.createUncheckedIntervals = function (start, end) {
            var intervalCount = 0;
            var iterator = new __aspxRichEdit.ModelIterator(this.subDocument, true);
            iterator.setPosition(start);
            do {
                if (iterator.run.getType() == __aspxRichEdit.RunType.ParagraphRun) {
                    var currentPosition = iterator.getAbsolutePosition();
                    var length_1 = currentPosition - start;
                    if (length_1 > 0) {
                        this.uncheckedIntervalCollection.add(new __aspxRichEdit.UncheckedInterval(start, length_1));
                        intervalCount++;
                    }
                    start = currentPosition + 1;
                }
            } while (iterator.getAbsolutePosition() < end && iterator.moveToNextRun());
            if (intervalCount == 0 && end > start)
                this.uncheckedIntervalCollection.add(new __aspxRichEdit.UncheckedInterval(start, end - start));
        };
        SpellCheckerIntervalsManager.prototype.splitUncheckedIntervals = function () {
            var uncheckedIntervals = this.uncheckedIntervalCollection.getIntervals();
            for (var i = 0, uncheckedInterval = void 0; uncheckedInterval = uncheckedIntervals[i]; i++) {
                if (uncheckedInterval.info.isChecking)
                    return;
                if (!uncheckedInterval.info.isSplitted) {
                    if (uncheckedInterval.length > __aspxRichEdit.SpellChecker.MAX_REQUEST_LENGTH) {
                        var start = uncheckedInterval.start;
                        var end = uncheckedInterval.end;
                        this.uncheckedIntervalCollection.remove(i);
                        this.createUncheckedIntervals(start, end);
                    }
                    else
                        uncheckedInterval.info.isSplitted = true;
                }
            }
        };
        SpellCheckerIntervalsManager.prototype.createMisspelledIntervals = function (spellingErrors, checkingInterval) {
            for (var i = 0, error = void 0; error = spellingErrors[i]; i++) {
                var errorStart = error[__aspxRichEdit.JSONCheckSpellingCommand.ErrorStart] + checkingInterval.start;
                var errorLength = error[__aspxRichEdit.JSONCheckSpellingCommand.ErrorLength];
                for (var j = 0, hiddenInterval = void 0; hiddenInterval = checkingInterval.info.hiddenIntervals[j]; j++) {
                    if (error[__aspxRichEdit.JSONCheckSpellingCommand.ErrorStart] > hiddenInterval.start)
                        errorStart += hiddenInterval.length;
                    else if (hiddenInterval.start < error[__aspxRichEdit.JSONCheckSpellingCommand.ErrorStart] + error[__aspxRichEdit.JSONCheckSpellingCommand.ErrorLength])
                        errorLength += hiddenInterval.length;
                }
                var word = error[__aspxRichEdit.JSONCheckSpellingCommand.ErrorWord];
                if (!this.ignoredIntervalCollection.contains(errorStart, errorLength, word) &&
                    (!this.ignoredWordsCollection.contains(word) || error[__aspxRichEdit.JSONCheckSpellingCommand.ErrorType] != __aspxRichEdit.SpellingErrorType.Misspelling)) {
                    var spellingErrorInfo = new __aspxRichEdit.SpellingErrorInfo(error[__aspxRichEdit.JSONCheckSpellingCommand.ErrorType], error[__aspxRichEdit.JSONCheckSpellingCommand.Suggestions], word);
                    var misspelledInterval = new __aspxRichEdit.MisspelledInterval(errorStart, errorLength, spellingErrorInfo);
                    this.misspelledIntervalCollection.addIfNotExists(misspelledInterval);
                }
            }
        };
        return SpellCheckerIntervalsManager;
    }());
    __aspxRichEdit.SpellCheckerIntervalsManager = SpellCheckerIntervalsManager;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SpellCheckerModelChangesListener = (function () {
        function SpellCheckerModelChangesListener(spellChecker) {
            this.spellChecker = spellChecker;
        }
        SpellCheckerModelChangesListener.prototype.NotifySimpleRunInserted = function (_subDocument, position, length, _characterProperties, _characterStyle, _type, text) {
            this.spellChecker.onModelIntervalChanged(position, length, length == 1 && __aspxRichEdit.RichUtils.isWhitespace.test(text));
        };
        SpellCheckerModelChangesListener.prototype.NotifyParagraphInserted = function (_subDocument, position) {
            this.spellChecker.onModelIntervalChanged(position, 1, true);
        };
        SpellCheckerModelChangesListener.prototype.NotifySectionInserted = function (_subDocument, _position) { };
        SpellCheckerModelChangesListener.prototype.NotifyInlinePictureInserted = function (_subDocument, position, _id, _scaleX, _scaleY) {
            this.spellChecker.onModelIntervalChanged(position, 1, true);
        };
        SpellCheckerModelChangesListener.prototype.NotifyAnchoredPictureInserted = function (_subDocument, _objectId, position, _id, _size, _anchorInfo) {
            this.spellChecker.onModelIntervalChanged(position, 1, true);
        };
        SpellCheckerModelChangesListener.prototype.NotifyAnchoredTextBoxInserted = function (_subDocument, _objectId, _subDocId, position, _anchorInfo) {
            this.spellChecker.onModelIntervalChanged(position, 1, true);
        };
        SpellCheckerModelChangesListener.prototype.NotifyAnchorObjectRemoved = function (_subDocument, _objectId, _position) {
        };
        SpellCheckerModelChangesListener.prototype.NotifyLoadInlinePictures = function (_subDocument, _imagesInfo) { };
        SpellCheckerModelChangesListener.prototype.NotifyInlinePicturesUpdated = function (_subDocument, _updatedImagesInfo) { };
        SpellCheckerModelChangesListener.prototype.NotifyIntervalRemoved = function (_subDocument, position, length) {
            this.spellChecker.onModelIntervalChanged(position, -length, false);
        };
        SpellCheckerModelChangesListener.prototype.NotifySectionMerged = function (_subDocument, _sectionIndex, _getPropertiesFromNext) { };
        SpellCheckerModelChangesListener.prototype.NotifyParagraphMerged = function (_subDocument, position, _getPropertiesFromNext) {
            this.spellChecker.onModelIntervalChanged(position, -1, false);
        };
        SpellCheckerModelChangesListener.prototype.NotifyCharacterFormattingChanged = function (_subDocument, _property, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyCharacterPropertiesChanged = function (_subDocument, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyParagraphFormattingChanged = function (_subDocument, _property, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyParagraphPropertiesChanged = function (_subDocument, _paragraphIndex, _properties, _style, _tabs, _numberingListIndex, _listLevelIndex) { };
        SpellCheckerModelChangesListener.prototype.NotifySectionFormattingChanged = function (_section, _sectionIndex, _property, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyInlineObjectRunPropertyChanged = function (_subDocument, _property, _position, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyAnchoredPictureSizeChanged = function (_subDocument, _objectId, _position, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyAnchoredTextBoxSizeChanged = function (_subDocument, _objectId, _position, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyAnchoredTextBoxPropertiesChanged = function (_subDocument, _objectId, _position, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyAnchorInfoPropertyChanged = function (_subDocument, _objectId, _property, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyShapeChanged = function (_subDocument, _objectId, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyShapePropertyChanged = function (_subDocument, _objectId, _property, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyTabInserted = function (_subDocument, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyTabDeleted = function (_subDocument, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyCreateStyleLink = function (_paragraphStyleName) { };
        SpellCheckerModelChangesListener.prototype.NotifyDeleteStyleLink = function (_paragraphStyleName) { };
        SpellCheckerModelChangesListener.prototype.NotifyCharacterStyleApplied = function (_subDocument, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyParagraphStyleApplied = function (_subDocument, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyTextBufferChanged = function (_subDocument, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyParagraphAndCharacterMergedPropertiesReset = function (_subDocument, _interval) { };
        SpellCheckerModelChangesListener.prototype.NotifyParagraphNumberingListChanged = function (_subDocument, _newState, _oldAbstractNumberingListIndex) { };
        SpellCheckerModelChangesListener.prototype.NotifyAbstractNumberingListAdded = function (_index) { };
        SpellCheckerModelChangesListener.prototype.NotifyAbstractNumberingListDeleted = function (_index) { };
        SpellCheckerModelChangesListener.prototype.NotifyNumberingListAdded = function (_index) { };
        SpellCheckerModelChangesListener.prototype.NotifyNumberingListDeleted = function (_index) { };
        SpellCheckerModelChangesListener.prototype.NotifyListLevelPropertyChanged = function (_property, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyListLevelParagraphPropertyChanged = function (_property, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyListLevelCharacterPropertyChanged = function (_property, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyIOverrideListLevelChanged = function (_property, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyFieldInserted = function (_subDocument, _startPosition, _separatorPosition, _endPosition) { };
        SpellCheckerModelChangesListener.prototype.NotifyFieldDeleted = function (_subDocument, _endPosition) { };
        SpellCheckerModelChangesListener.prototype.NotifyHyperlinkInfoChanged = function (_subDocument, _fieldResultInterval, _fieldCodeInterval, _newHyperlinkInfo) { };
        SpellCheckerModelChangesListener.prototype.NotifyDefaultTabWidthChanged = function (_defaultTabWidth) { };
        SpellCheckerModelChangesListener.prototype.NotifyPageColorChanged = function (_pageColor) { };
        SpellCheckerModelChangesListener.prototype.NotifyDifferentOddAndEvenPagesChanged = function (_newValue) { };
        SpellCheckerModelChangesListener.prototype.NotifyHeaderFooterCreated = function (_isHeader, _type, _subDocumentInfo) { };
        SpellCheckerModelChangesListener.prototype.NotifyHeaderFooterIndexChanged = function (_sectionIndex, _isHeader, _type, _newIndex, _model) { };
        SpellCheckerModelChangesListener.prototype.NotifyBookmarkCreated = function (_subDocument, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyBookmarkDeleted = function (_subDocument, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyTableCreated = function (_subDocument, _table) { };
        SpellCheckerModelChangesListener.prototype.NotifyTableRemoved = function (_subDocument, _startPosition, _endPosition, _nestedLevel) { };
        SpellCheckerModelChangesListener.prototype.NotifyTableStartPositionShifted = function (_subDocument, _table, _oldPosition, _newPosition) { };
        SpellCheckerModelChangesListener.prototype.NotifyTableCellPropertyChanged = function (_subDocument, _property, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyTablePropertyChanged = function (_subDocument, _property, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyTableRowPropertyChanged = function (_subDocument, _property, _newState) { };
        SpellCheckerModelChangesListener.prototype.NotifyTableCellSplittedHorizontally = function (_subDocument, _table, _rowIndex, _cellIndex, _rightDirection) { };
        SpellCheckerModelChangesListener.prototype.NotifyTableCellMergedHorizontally = function (_subDocument, _table, _rowIndex, _cellIndex, _rightDirection) { };
        SpellCheckerModelChangesListener.prototype.NotifyTableRowInserted = function (_subDocument, _table, _rowIndex) { };
        SpellCheckerModelChangesListener.prototype.NotifyTableRowRemoved = function (_subDocument, _table, _rowIndex) { };
        SpellCheckerModelChangesListener.prototype.NotifyTableCellRemoved = function (_subDocument, _table, _rowIndex, _cellIndex) { };
        SpellCheckerModelChangesListener.prototype.NotifyTableCellInserted = function (_subDocument, _table, _rowIndex, _cellIndex) { };
        SpellCheckerModelChangesListener.prototype.NotifyTableStyleChanged = function (_subDocument, _table, _newStyle) { };
        SpellCheckerModelChangesListener.prototype.NotifyLoadFontInfo = function (_fontInfo, _fontIndex) { };
        return SpellCheckerModelChangesListener;
    }());
    __aspxRichEdit.SpellCheckerModelChangesListener = SpellCheckerModelChangesListener;
    var SpellCheckerSelectionChangesListener = (function () {
        function SpellCheckerSelectionChangesListener(control, spellChecker) {
            this.control = control;
            this.spellChecker = spellChecker;
        }
        SpellCheckerSelectionChangesListener.prototype.NotifySelectionChanged = function (selection) {
            if (!this.spellChecker.settings.isEnabled)
                return;
            var startPosition = selection.forwardDirection ? selection.getLastSelectedInterval().end : selection.getLastSelectedInterval().start;
            if (this.lastStartPosition === startPosition)
                return;
            this.lastStartPosition = startPosition;
            var wordStartPosition = __aspxRichEdit.ModelWordPositionHelper.getWordStartPosition(this.control.model.activeSubDocument, startPosition);
            if (this.lastWordStartPosition === wordStartPosition)
                return;
            if (startPosition == wordStartPosition && startPosition - this.lastWordStartPosition == 1) {
                this.lastWordStartPosition = wordStartPosition;
                return;
            }
            this.lastWordStartPosition = wordStartPosition;
            this.spellChecker.onCurrentSelectedWordChanged();
        };
        SpellCheckerSelectionChangesListener.prototype.NotifyScrollPositionChanged = function () { };
        return SpellCheckerSelectionChangesListener;
    }());
    __aspxRichEdit.SpellCheckerSelectionChangesListener = SpellCheckerSelectionChangesListener;
    var SpellCheckerLayoutChangesListener = (function () {
        function SpellCheckerLayoutChangesListener(spellChecker) {
            this.spellChecker = spellChecker;
        }
        SpellCheckerLayoutChangesListener.prototype.NotifyPagesReady = function (_pageChanges) {
            this.spellChecker.onLayoutChanged();
        };
        SpellCheckerLayoutChangesListener.prototype.NotifyFullyFormatted = function () { };
        ;
        return SpellCheckerLayoutChangesListener;
    }());
    __aspxRichEdit.SpellCheckerLayoutChangesListener = SpellCheckerLayoutChangesListener;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SpellChecker = (function () {
        function SpellChecker(control, settings) {
            this.control = control;
            this.settings = settings;
        }
        SpellChecker.prototype.initialize = function (subDocument) {
            this.subDocument = subDocument;
            this.intervalsManager = subDocument.spellCheckerIntervalsManager;
            this.hasActiveRequest = false;
        };
        SpellChecker.prototype.check = function () {
            var _this = this;
            if (this.settings.isEnabled) {
                setTimeout(function () {
                    _this.checkCore();
                }, 0);
            }
        };
        SpellChecker.prototype.processResponse = function (checkedIntervals) {
            this.intervalsManager.applyCheckResults(checkedIntervals);
            this.updateMisspelledBoxes();
            this.hasActiveRequest = false;
            this.checkCore();
        };
        SpellChecker.prototype.getSelectedMisspelledInterval = function (selectionIntervals) {
            return this.intervalsManager.getSelectedMisspelledInterval(selectionIntervals);
        };
        SpellChecker.prototype.findNextMisspelledInterval = function (position) {
            return this.intervalsManager.findNextMisspelledInterval(position);
        };
        SpellChecker.prototype.ignore = function (misspelledInterval) {
            this.intervalsManager.addIgnoredInterval(misspelledInterval.start, misspelledInterval.end, misspelledInterval.errorInfo.word);
            this.intervalsManager.deleteMisspelledIntervalsByPositions(misspelledInterval.start, misspelledInterval.end);
            this.updateMisspelledBoxes();
        };
        SpellChecker.prototype.ignoreAll = function (misspelledInterval) {
            this.intervalsManager.ignoreAll(misspelledInterval.errorInfo.word);
            this.updateMisspelledBoxes();
        };
        SpellChecker.prototype.addWord = function (misspelledInterval) {
            var word = misspelledInterval.errorInfo.word;
            this.intervalsManager.removeIntervalsWithErrorByWord(word);
            this.updateMisspelledBoxes();
            this.sendAddWordRequest(word);
        };
        SpellChecker.prototype.getIntervalsWithErrorByWord = function (word) {
            return this.intervalsManager.getIntervalsWithErrorByWord(word);
        };
        SpellChecker.prototype.isInProgress = function () {
            return this.intervalsManager.getUncheckedIntervalsCount() > 0;
        };
        SpellChecker.prototype.getMisspelledIntervals = function () {
            return this.intervalsManager.getMisspelledIntervals();
        };
        SpellChecker.prototype.onModelIntervalChanged = function (start, length, isSeparator) {
            if (this.settings.isEnabled)
                this.intervalsManager.onModelIntervalChanged(start, length, isSeparator);
        };
        SpellChecker.prototype.onCurrentSelectedWordChanged = function () {
            this.check();
        };
        SpellChecker.prototype.onLayoutChanged = function () {
            this.updateMisspelledBoxes();
        };
        SpellChecker.prototype.onActiveSubDocumentChanged = function () {
            var _this = this;
            this.initialize(this.control.model.activeSubDocument);
            this.check();
            setTimeout(function () {
                _this.updateMisspelledBoxes();
            }, 0);
        };
        SpellChecker.prototype.checkCore = function () {
            if (this.hasActiveRequest)
                return;
            this.intervalsManager.initializeUncheckedIntervals();
            var intervalsToCheck = this.intervalsManager.getIntervalsToCheck();
            if (intervalsToCheck.length > 0)
                this.sendCheckSpellingRequest(intervalsToCheck);
        };
        SpellChecker.prototype.sendCheckSpellingRequest = function (uncheckedIntervals) {
            var params = {};
            var intervalsToCheck = [];
            for (var i = 0, uncheckedInterval = void 0; uncheckedInterval = uncheckedIntervals[i]; i++) {
                var interval = {};
                interval[__aspxRichEdit.JSONCheckSpellingCommand.StartPosition] = uncheckedInterval.start;
                interval[__aspxRichEdit.JSONCheckSpellingCommand.EndPosition] = uncheckedInterval.end;
                interval[__aspxRichEdit.JSONCheckSpellingCommand.TextToCheck] = uncheckedInterval.info.textToCheck;
                intervalsToCheck.push(interval);
            }
            params[__aspxRichEdit.JSONCheckSpellingCommand.IntervalsToCheck] = intervalsToCheck;
            params[__aspxRichEdit.JSONCheckSpellingCommand.CustomDictionaryGuid] = this.settings.customDictionaryGuid;
            this.control.serverDispatcher.pushRequest(new __aspxRichEdit.LoadCommandRequest(__aspxRichEdit.CommandType.CheckSpelling, this.subDocument.id, params), new __aspxRichEdit.RequestParams(false, true, false));
            this.hasActiveRequest = true;
        };
        SpellChecker.prototype.sendAddWordRequest = function (word) {
            var params = {};
            params[__aspxRichEdit.JSONCheckSpellingCommand.AddedWord] = word;
            params[__aspxRichEdit.JSONCheckSpellingCommand.CustomDictionaryGuid] = this.settings.customDictionaryGuid;
            this.control.serverDispatcher.pushRequest(new __aspxRichEdit.LoadCommandRequest(__aspxRichEdit.CommandType.AddWordToDictionary, -1, params), new __aspxRichEdit.RequestParams(false, true, true));
        };
        SpellChecker.prototype.updateMisspelledBoxes = function () {
            if (this.settings.isEnabled)
                this.control.selection.setMisspelledSelectionIntervals(this.getMisspelledIntervals());
        };
        SpellChecker.MAX_REQUEST_LENGTH = 300;
        return SpellChecker;
    }());
    __aspxRichEdit.SpellChecker = SpellChecker;
    var SpellCheckerSettings = (function () {
        function SpellCheckerSettings() {
        }
        return SpellCheckerSettings;
    }());
    __aspxRichEdit.SpellCheckerSettings = SpellCheckerSettings;
    var SpellingErrorType;
    (function (SpellingErrorType) {
        SpellingErrorType[SpellingErrorType["Unknown"] = 0] = "Unknown";
        SpellingErrorType[SpellingErrorType["Misspelling"] = 1] = "Misspelling";
        SpellingErrorType[SpellingErrorType["Repeating"] = 2] = "Repeating";
        SpellingErrorType[SpellingErrorType["Syntax"] = 3] = "Syntax";
    })(SpellingErrorType = __aspxRichEdit.SpellingErrorType || (__aspxRichEdit.SpellingErrorType = {}));
    var SpellingErrorInfo = (function () {
        function SpellingErrorInfo(errorType, suggestions, word) {
            this.errorType = errorType;
            this.suggestions = suggestions;
            this.word = word;
        }
        return SpellingErrorInfo;
    }());
    __aspxRichEdit.SpellingErrorInfo = SpellingErrorInfo;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var BarManager = (function (_super) {
        __extends(BarManager, _super);
        function BarManager(bars) {
            var _this = _super.call(this) || this;
            _this.bars = bars;
            return _this;
        }
        BarManager.prototype.initialize = function (control) {
            this.control = control;
            for (var i = 0, bar; bar = this.bars[i]; i++) {
                bar.onChanged.add(this);
            }
        };
        BarManager.prototype.onUpdateUnlocked = function () {
        };
        BarManager.prototype.getRibbonBar = function () {
            for (var _i = 0, _a = this.bars; _i < _a.length; _i++) {
                var bar = _a[_i];
                if (bar.isRibbon())
                    return bar;
            }
            return null;
        };
        BarManager.prototype.activateContextItem = function (clientCommand) {
            for (var i = 0, bar; bar = this.bars[i]; i++) {
                if (bar.hasContextItems()) {
                    bar.setContextItemVisible(clientCommand, true);
                    bar.activateContextItem(clientCommand);
                }
            }
        };
        BarManager.prototype.activateRibbon = function () {
            var ribbonBar = this.getRibbonBar();
            if (ribbonBar)
                ribbonBar.activate();
        };
        BarManager.prototype.updateContextMenu = function () {
            for (var i = 0, bar; bar = this.bars[i]; i++) {
                if (bar.isContextMenu()) {
                    this.updateItemsList(bar);
                    var commandKeys = bar.getCommandKeys();
                    for (var j = 0, commandKey; commandKey = commandKeys[j]; j++) {
                        this.updateBarItem(bar, commandKey);
                    }
                }
            }
        };
        BarManager.prototype.updateItemsList = function (bar) {
            var suggestions;
            if (this.control.spellChecker.settings.isEnabled) {
                var selectedMisspelledInterval = this.control.spellChecker.getSelectedMisspelledInterval(this.control.selection.intervals);
                if (selectedMisspelledInterval)
                    suggestions = selectedMisspelledInterval.errorInfo.suggestions;
            }
            bar.updateItemsList(suggestions);
        };
        BarManager.prototype.updateItemsState = function (queryCommands) {
            if (this.isUpdateLocked())
                return;
            var anyQuerySended = !!queryCommands.length;
            var queryCommandsHash = {};
            __aspxRichEdit.ListUtils.foreach(queryCommands, function (queryCommandKey) { return queryCommandsHash[queryCommandKey] = true; });
            for (var i = 0, bar; bar = this.bars[i]; i++) {
                if (bar.isVisible()) {
                    var commandKeys = bar.getCommandKeys();
                    for (var j = 0, commandKey = void 0; commandKey = commandKeys[j]; j++) {
                        if (anyQuerySended && !queryCommandsHash[commandKey])
                            continue;
                        this.updateBarItem(bar, commandKey);
                    }
                }
                if (bar.hasContextItems()) {
                    var commandKeys = bar.getContextKeys();
                    for (var j = 0, commandKey = void 0; commandKey = commandKeys[j]; j++) {
                        if (anyQuerySended && !queryCommandsHash[commandKey])
                            continue;
                        this.updateContextItem(bar, commandKey);
                    }
                }
                bar.completeUpdate();
            }
        };
        BarManager.prototype.updateBarItem = function (bar, commandKey) {
            var command = this.control.commandManager.getCommand(commandKey);
            if (command) {
                var commandState = command.getState();
                bar.setItemVisible(commandKey, commandState.visible);
                if (commandState.visible) {
                    bar.setItemEnabled(commandKey, commandState.enabled);
                    if (!commandState.denyUpdateValue) {
                        var itemValue = this.getItemValue(commandState.value);
                        if (commandState.items)
                            bar.setItemSubItems(commandKey, commandState.items);
                        bar.setItemValue(commandKey, itemValue);
                    }
                }
            }
        };
        BarManager.prototype.updateContextItem = function (bar, commandKey) {
            var command = this.control.commandManager.getCommand(commandKey);
            if (command) {
                bar.setContextItemVisible(commandKey, command.getState().visible);
            }
        };
        BarManager.prototype.setEnabled = function (enabled) {
            for (var i = 0, bar; bar = this.bars[i]; i++)
                bar.setEnabled(enabled);
        };
        BarManager.prototype.onCanvasMouseDown = function () {
            for (var i = 0, bar; bar = this.bars[i]; i++)
                bar.onCanvasMouseDown();
        };
        BarManager.prototype.NotifyBarCommandExecuted = function (commandID, parameter) {
            var executeResult = this.control.commandManager.getCommand(commandID).execute(this.control.commandManager.isPublicApiCall, parameter);
            if (!executeResult)
                this.updateItemsState([commandID]);
        };
        BarManager.prototype.NotifyBarUpdateRequested = function () {
            this.updateItemsState([]);
        };
        BarManager.prototype.NotifySelectionChanged = function (_selection) {
            this.updateItemsState([]);
        };
        BarManager.prototype.NotifyScrollPositionChanged = function () { };
        BarManager.prototype.getItemValue = function (value) {
            return value instanceof __aspxRichEdit.FontInfo ? value.name : value;
        };
        return BarManager;
    }(__aspxRichEdit.BatchUpdatableObject));
    __aspxRichEdit.BarManager = BarManager;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var QuickSearchPanel = (function () {
        function QuickSearchPanel(owner, searchManager) {
            this.owner = owner;
            this.searchManager = searchManager;
            this.initialize();
        }
        Object.defineProperty(QuickSearchPanel.prototype, "core", {
            get: function () { return this.owner.core; },
            enumerable: true,
            configurable: true
        });
        QuickSearchPanel.prototype.initialize = function () {
            this.createElements();
            this.timerId = null;
            this.height = REWebUtils.GetClearClientHeight(this.getQuickSearchPanelWrapper());
            this.attachEvents();
            this.initializeFields();
        };
        QuickSearchPanel.prototype.initializeFields = function () {
            if (this.searchManager.whatFind) {
                this.getSearchField().value = this.searchManager.whatFind;
                if (this.searchManager.foundIntervals.length)
                    this.updateSearchInfo(-1);
                else
                    this.findAll();
            }
        };
        QuickSearchPanel.prototype.createElements = function () { };
        QuickSearchPanel.prototype.attachEvents = function () {
            var searchField = this.getSearchField();
            var prevBtn = this.getPrevButton();
            var nextBtn = this.getNextButton();
            var collapseBtn = this.getCollapseButton();
            var closeBtn = this.getCloseButton();
            var that = this;
            closeBtn.onclick = function () { that.hide(true); };
            collapseBtn.onclick = function () { that.showFindReplaceDialog(); };
            prevBtn.onclick = function () {
                if (that.searchManager.foundIntervals.length)
                    that.findPrev();
                else
                    that.findAll();
            };
            nextBtn.onclick = function () {
                if (that.searchManager.foundIntervals.length)
                    that.findNext();
                else
                    that.findAll();
            };
            searchField.onkeydown = function (e) {
                var keyCode = REWebUtils.Evt.GetKeyCode(e);
                if (keyCode === REWebUtils.KeyCode.Esc) {
                    that.hide(true);
                }
                else if (keyCode === REWebUtils.KeyCode.Enter) {
                    if (that.searchManager.foundIntervals.length)
                        if (e.shiftKey)
                            that.findPrev();
                        else
                            that.findNext();
                    else
                        that.findAll();
                    REWebUtils.Evt.PreventEvent(e);
                }
                else {
                    var shortcutCode = REWebUtils.GetShortcutCodeByEvent(e);
                    if (shortcutCode === QuickSearchPanel.shortcuts.showDialog || shortcutCode === QuickSearchPanel.shortcuts.showPanel) {
                        REWebUtils.Evt.PreventEvent(e);
                        if (shortcutCode === QuickSearchPanel.shortcuts.showDialog)
                            that.showFindReplaceDialog();
                    }
                }
            };
            searchField.onkeyup = function (e) {
                clearTimeout(that.timerId);
                var keyCode = REWebUtils.Evt.GetKeyCode(e);
                if (keyCode === REWebUtils.KeyCode.Enter)
                    return;
                if (!that.getSearchField().value) {
                    that.clearResult();
                    that.searchManager.resetSearch();
                    return;
                }
                that.timerId = setTimeout(function () {
                    that.findAll();
                }, 700);
            };
        };
        QuickSearchPanel.prototype.findNext = function () {
            var index = this.searchManager.findNextIntervalIndex();
            if (index !== null) {
                this.searchManager.selectIntervalByIndex(index);
                this.searchManager.scrollToIntervalByIndex(index);
                this.updateSearchInfo(index);
            }
        };
        QuickSearchPanel.prototype.findPrev = function () {
            var index = this.searchManager.findPrevIntervalIndex();
            if (index !== null) {
                this.searchManager.selectIntervalByIndex(index);
                this.searchManager.scrollToIntervalByIndex(index);
                this.updateSearchInfo(index);
            }
        };
        QuickSearchPanel.prototype.findAll = function () {
            var whatFind = this.getSearchField().value;
            if (whatFind) {
                this.searchManager.findAll(whatFind, false);
                this.updateSearchInfo(-1);
                var index = this.searchManager.findNextIntervalIndex();
                if (index !== null)
                    this.searchManager.scrollToIntervalByIndex(index);
            }
        };
        QuickSearchPanel.prototype.updateSearchInfo = function (index) {
            if (this.searchManager.foundIntervals.length) {
                var resultText = index >= 0 ?
                    REWebUtils.Formatter.Format("{0} " + ASPxClientRichEdit.QuickSearchPanel.Of + " {1}", index + 1, this.searchManager.foundIntervals.length) :
                    ASPxClientRichEdit.QuickSearchPanel.Items + ": " + this.searchManager.foundIntervals.length;
                this.getResultLabel().innerHTML = resultText;
                return;
            }
            this.getResultLabel().innerHTML = ASPxClientRichEdit.QuickSearchPanel.NoMatches;
        };
        QuickSearchPanel.prototype.clearResult = function () {
            this.getResultLabel().innerHTML = "";
        };
        QuickSearchPanel.prototype.getQuickSearchPanelWrapper = function () {
            return this.owner.getChildElement(QuickSearchPanel.wrapperPostfix);
        };
        QuickSearchPanel.prototype.getSearchField = function () {
            if (!this.searchField) {
                var inputElements = this.owner.getChildElement(QuickSearchPanel.wrapperPostfix).getElementsByTagName("INPUT");
                for (var i = 0, element = void 0; element = inputElements[i]; i++)
                    if (element.type.toLowerCase() === "text") {
                        this.searchField = element;
                        break;
                    }
            }
            return this.searchField;
        };
        QuickSearchPanel.prototype.getPrevButton = function () {
            return this.owner.getChildElement(QuickSearchPanel.prevBtnPostfix);
        };
        QuickSearchPanel.prototype.getNextButton = function () {
            return this.owner.getChildElement(QuickSearchPanel.nextBtnPostfix);
        };
        QuickSearchPanel.prototype.getCollapseButton = function () {
            return this.owner.getChildElement(QuickSearchPanel.collapseBtnPostfix);
        };
        QuickSearchPanel.prototype.getCloseButton = function () {
            return this.owner.getChildElement(QuickSearchPanel.closeBtnPostfix);
        };
        QuickSearchPanel.prototype.getResultLabel = function () {
            if (!this.resultLabel) {
                var inputElement = this.getSearchField();
                var tdContainer = inputElement.parentElement;
                var span = document.createElement("SPAN");
                tdContainer.appendChild(span);
                REWebUtils.SetStyles(span, { lineHeight: tdContainer.offsetHeight });
                this.resultLabel = span;
            }
            return this.resultLabel;
        };
        QuickSearchPanel.prototype.NotifySearchReset = function () {
            this.clearResult();
        };
        QuickSearchPanel.prototype.showFindReplaceDialog = function () {
            this.core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.Replace).execute(this.core.commandManager.isPublicApiCall);
        };
        QuickSearchPanel.prototype.show = function () {
            if (!this.isVisible() && !this.owner.hasActiveDialog()) {
                var panel = this.getQuickSearchPanelWrapper();
                REWebUtils.SetElementVisibility(panel, true);
                panel.style.height = this.height + "px";
                this.searchManager.onChanged.add(this);
                this.initializeFields();
            }
            REWebUtils.SetFocus(this.getSearchField());
            this.getSearchField().select();
        };
        QuickSearchPanel.prototype.hide = function (resetSearch) {
            if (this.isVisible()) {
                var panel = this.getQuickSearchPanelWrapper();
                panel.style.height = "0px";
                REWebUtils.SetElementVisibility(panel, false);
                this.onClose(resetSearch);
            }
        };
        QuickSearchPanel.prototype.onClose = function (resetSearch) {
            if (resetSearch)
                this.searchManager.resetSearch();
            this.searchManager.onChanged.remove(this);
            this.getSearchField().value = "";
            this.clearResult();
            this.core.focusManager.captureFocus();
        };
        QuickSearchPanel.prototype.isVisible = function () {
            var style = REWebUtils.GetCurrentStyle(this.getQuickSearchPanelWrapper());
            return style.visibility !== "hidden";
        };
        QuickSearchPanel.shortcuts = {
            showPanel: REWebUtils.ParseShortcutString(REWebUtils.Browser.MacOSPlatform ? "CMD+F" : "CTRL+F"),
            showDialog: REWebUtils.ParseShortcutString(REWebUtils.Browser.MacOSPlatform ? "CMD+H" : "CTRL+H")
        };
        QuickSearchPanel.containerPostfix = "_QS";
        QuickSearchPanel.wrapperPostfix = "_QSPW";
        QuickSearchPanel.prevBtnPostfix = "_QSPPrevBtn";
        QuickSearchPanel.nextBtnPostfix = "_QSPNextBtn";
        QuickSearchPanel.collapseBtnPostfix = "_QSPCollapseBtn";
        QuickSearchPanel.closeBtnPostfix = "_QSPCloseBtn";
        return QuickSearchPanel;
    }());
    __aspxRichEdit.QuickSearchPanel = QuickSearchPanel;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SearchManager = (function () {
        function SearchManager(control) {
            this.onChanged = new __aspxRichEdit.EventDispatcher();
            this.control = control;
            this.foundIntervals = [];
            this.whatFind = null;
        }
        SearchManager.prototype.raiseSearchReset = function () {
            this.resetSearch();
            this.onChanged.raise("NotifySearchReset");
        };
        SearchManager.prototype.onActiveSubDocumentChanged = function () {
            this.raiseSearchReset();
        };
        SearchManager.prototype.findAll = function (text, matchCase) {
            this.whatFind = text;
            var command = this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.FindAll);
            command.execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.FindAllCommandOptions(this.control, text, matchCase, true, this.foundIntervals));
        };
        SearchManager.prototype.replaceAll = function (text, replaceText, matchCase) {
            this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ReplaceAll)
                .execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.ReplaceAllCommandOptions(this.control, text, replaceText, matchCase));
        };
        SearchManager.prototype.replace = function (text, replaceText, matchCase) {
            if (this.findIntervalIndex(this.control.selection.intervals[0]) >= 0) {
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ReplaceNext)
                    .execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.ReplaceNextCommandOptions(this.control, text, replaceText, matchCase));
                return true;
            }
            return false;
        };
        SearchManager.prototype.resetSearch = function () {
            this.foundIntervals = [];
            if (this.control.selection.searchIntervals.length)
                this.control.selection.resetSearchSelection();
        };
        SearchManager.prototype.findNextIntervalIndex = function () {
            for (var i = 0, interval = void 0; interval = this.foundIntervals[i]; i++)
                if (interval.start >= this.control.selection.intervals[0].end)
                    return i;
            return this.foundIntervals.length ? 0 : null;
        };
        SearchManager.prototype.findPrevIntervalIndex = function () {
            for (var i = this.foundIntervals.length - 1, interval = void 0; interval = this.foundIntervals[i]; i--)
                if (interval.start < this.control.selection.intervals[0].start)
                    return i;
            return this.foundIntervals.length ? this.foundIntervals.length - 1 : null;
        };
        SearchManager.prototype.findIntervalIndex = function (desiredInterval) {
            return __aspxRichEdit.ListUtils.indexBy(this.foundIntervals, function (interval) { return interval.start == desiredInterval.start && interval.end == desiredInterval.end; });
        };
        SearchManager.prototype.selectIntervalByIndex = function (intervalIndex) {
            var interval = this.foundIntervals[intervalIndex];
            this.control.selection.deprecatedSetSelection(interval.start, interval.end, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
        };
        SearchManager.prototype.scrollToIntervalByIndex = function (intervalIndex) {
            this.control.beginUpdate();
            var interval = this.foundIntervals[intervalIndex];
            this.control.selection.scrollManager.setScroll(new __aspxRichEdit.Scroll.State().byModelPosition.setModelPosition(interval.start).useStdRelativePosition().useStdOffset());
            this.control.endUpdate();
        };
        return SearchManager;
    }());
    __aspxRichEdit.SearchManager = SearchManager;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Errors = (function () {
        function Errors() {
        }
        Errors.ThrowNotImplementedError = function () {
            throw new Error("The method is not implemented.");
        };
        Errors.ArgumentException = function (argument, value) {
            return argument + " is not a valid value for " + (value ? value.toString() : typeof (value));
        };
        Errors.NotImplemented = "The method is not implemented.";
        Errors.InternalException = "Internal exception.";
        Errors.ValueCannotBeNull = "Value cannot be null.";
        Errors.DocxImporter = "Error on docx importer";
        return Errors;
    }());
    __aspxRichEdit.Errors = Errors;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var EventDispatcher = (function () {
        function EventDispatcher() {
            this.listeners = [];
        }
        EventDispatcher.prototype.add = function (listener) {
            if (!listener)
                throw new Error(__aspxRichEdit.Errors.NotImplemented);
            if (!this.hasEventListener(listener))
                this.listeners.push(listener);
        };
        EventDispatcher.prototype.remove = function (listener) {
            for (var i = 0, currentListener; currentListener = this.listeners[i]; i++) {
                if (currentListener === listener) {
                    this.listeners.splice(i, 1);
                    break;
                }
            }
        };
        EventDispatcher.prototype.raise = function (funcName) {
            var args = [];
            for (var _i = 1; _i < arguments.length; _i++) {
                args[_i - 1] = arguments[_i];
            }
            for (var i = 0, listener; listener = this.listeners[i]; i++) {
                listener[funcName].apply(listener, args);
            }
        };
        EventDispatcher.prototype.hasEventListener = function (listener) {
            for (var i = 0, l = this.listeners.length; i < l; i++)
                if (this.listeners[i] === listener)
                    return true;
            return false;
        };
        return EventDispatcher;
    }());
    __aspxRichEdit.EventDispatcher = EventDispatcher;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DocumentFormat;
    (function (DocumentFormat) {
        DocumentFormat[DocumentFormat["Undefined"] = 0] = "Undefined";
        DocumentFormat[DocumentFormat["PlainText"] = 1] = "PlainText";
        DocumentFormat[DocumentFormat["Rtf"] = 2] = "Rtf";
        DocumentFormat[DocumentFormat["Html"] = 3] = "Html";
        DocumentFormat[DocumentFormat["OpenXml"] = 4] = "OpenXml";
        DocumentFormat[DocumentFormat["Mht"] = 5] = "Mht";
        DocumentFormat[DocumentFormat["WordML"] = 6] = "WordML";
        DocumentFormat[DocumentFormat["OpenDocument"] = 7] = "OpenDocument";
        DocumentFormat[DocumentFormat["ePub"] = 9] = "ePub";
        DocumentFormat[DocumentFormat["Doc"] = 10] = "Doc";
    })(DocumentFormat = __aspxRichEdit.DocumentFormat || (__aspxRichEdit.DocumentFormat = {}));
    var FileNameHelper = (function () {
        function FileNameHelper(fullPath, isPDF) {
            var pattern = __aspxRichEdit.StringUtils.stringTrim(fullPath).replace(/\//g, "\\").match(/(.*?\\?)([^\\]*)(\..+?)$/i);
            this.isPDF = isPDF;
            this.folderPath = pattern ? FileNameHelper.normalizeVirtualFolderPath(pattern[1], false) : "";
            this.name = pattern ? pattern[2] : "";
            this.extension = this.isPDF ? ".pdf" : (pattern ? pattern[3] : "");
            this.documentFormat = FileNameHelper.convertToDocumentFormat("." + this.extension);
        }
        FileNameHelper.prototype.getFullPath = function () {
            return this.folderPath + this.name + this.extension;
        };
        FileNameHelper.prototype.checkFileName = function () {
            if (this.name.length === 0)
                throw new Error("File name is not defined");
        };
        FileNameHelper.prototype.checkExtension = function () {
            if (this.extension.length === 0)
                throw new Error("File extension is not defined");
        };
        FileNameHelper.normalizeVirtualFolderPath = function (folderPath, isNormalizePath) {
            if (isNormalizePath)
                folderPath = __aspxRichEdit.StringUtils.stringTrim(folderPath).replace(/\//g, "\\");
            if (folderPath.length == 0 || folderPath == "\\")
                return "";
            return __aspxRichEdit.StringUtils.getSymbolFromEnd(folderPath, 1) == "\\" ? folderPath : folderPath + "\\";
        };
        FileNameHelper.convertToDocumentFormat = function (fileName) {
            var fName = __aspxRichEdit.StringUtils.stringTrim(fileName);
            if (FileNameHelper.testFormat(fName, "doc"))
                return DocumentFormat.Doc;
            if (FileNameHelper.testFormat(fName, "epub"))
                return DocumentFormat.ePub;
            if (FileNameHelper.testFormat(fName, "html") || FileNameHelper.testFormat(fName, "htm"))
                return DocumentFormat.Html;
            if (FileNameHelper.testFormat(fName, "mht"))
                return DocumentFormat.Mht;
            if (FileNameHelper.testFormat(fName, "odt"))
                return DocumentFormat.OpenDocument;
            if (FileNameHelper.testFormat(fName, "docx"))
                return DocumentFormat.OpenXml;
            if (FileNameHelper.testFormat(fName, "txt"))
                return DocumentFormat.PlainText;
            if (FileNameHelper.testFormat(fName, "rtf"))
                return DocumentFormat.Rtf;
            if (FileNameHelper.testFormat(fName, "xml"))
                return DocumentFormat.WordML;
            return DocumentFormat.Undefined;
        };
        FileNameHelper.convertExtensionToDocumentFormat = function (extension) {
            switch (extension.toLowerCase()) {
                case "doc":
                case ".doc": return DocumentFormat.Doc;
                case "epub":
                case ".epub": return DocumentFormat.ePub;
                case "html":
                case ".html":
                case "htm":
                case "htm": return DocumentFormat.Html;
                case "mht":
                case ".mht": return DocumentFormat.Mht;
                case "odt":
                case ".odt": return DocumentFormat.OpenDocument;
                case "docx":
                case ".docx": return DocumentFormat.OpenXml;
                case "txt":
                case ".txt": return DocumentFormat.PlainText;
                case "rtf":
                case ".rtf": return DocumentFormat.Rtf;
                case "xml":
                case ".xml": return DocumentFormat.WordML;
                default: return DocumentFormat.Undefined;
            }
        };
        FileNameHelper.convertToString = function (docFormat) {
            switch (docFormat) {
                case DocumentFormat.Doc: return ".doc";
                case DocumentFormat.ePub: return ".epub";
                case DocumentFormat.Html: return ".html";
                case DocumentFormat.Mht: return ".mht";
                case DocumentFormat.OpenDocument: return ".odt";
                case DocumentFormat.PlainText: return ".txt";
                case DocumentFormat.Rtf: return ".rtf";
                case DocumentFormat.WordML: return ".xml";
                case DocumentFormat.OpenXml: return ".docx";
                default: return "";
            }
        };
        FileNameHelper.testFormat = function (fileName, extension) {
            return new RegExp(".*\\." + extension + "$", "i").test(fileName);
        };
        return FileNameHelper;
    }());
    __aspxRichEdit.FileNameHelper = FileNameHelper;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Margins = (function () {
        function Margins(left, right, top, bottom) {
            this.left = left;
            this.right = right;
            this.top = top;
            this.bottom = bottom;
        }
        Margins.prototype.copyFrom = function (obj) {
            this.left = obj.left;
            this.right = obj.right;
            this.top = obj.top;
            this.bottom = obj.bottom;
        };
        Margins.prototype.clone = function () {
            return new Margins(this.left, this.right, this.top, this.bottom);
        };
        Margins.prototype.equals = function (obj) {
            return obj && this.top == obj.top &&
                this.bottom == obj.bottom &&
                this.right == obj.right &&
                this.left == obj.left;
        };
        Margins.prototype.toAnotherMeasuringSystem = function (converter) {
            this.left = converter(this.left);
            this.right = converter(this.right);
            this.top = converter(this.top);
            this.bottom = converter(this.bottom);
            return this;
        };
        Margins.prototype.getHorizontalMargins = function () {
            return this.left + this.right;
        };
        Margins.prototype.getVerticalMargins = function () {
            return this.top + this.bottom;
        };
        return Margins;
    }());
    __aspxRichEdit.Margins = Margins;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Pair = (function () {
        function Pair(first, second) {
            this.first = first;
            this.second = second;
        }
        return Pair;
    }());
    __aspxRichEdit.Pair = Pair;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RuntimeTemplateModelCreator;
    (function (RuntimeTemplateModelCreator) {
        var ManagerParams = (function () {
            function ManagerParams(name, func) {
                if (func === void 0) { func = null; }
                this.name = name;
                this.func = func;
            }
            return ManagerParams;
        }());
        RuntimeTemplateModelCreator.ManagerParams = ManagerParams;
        var ManagerInfo = (function () {
            function ManagerInfo(id, obj) {
                this.id = id;
                this.obj = obj;
            }
            return ManagerInfo;
        }());
        var SimpleObjectsManager = (function () {
            function SimpleObjectsManager() {
                this.map = {};
                this.createdVariables = [];
            }
            SimpleObjectsManager.prototype.add = function (obj, constructorName, params) {
                if (__aspxRichEdit.StringUtils.startsAt(constructorName, "new "))
                    constructorName = constructorName.substr(4);
                var indOfOpenBracket = constructorName.indexOf("(");
                if (indOfOpenBracket == -1)
                    indOfOpenBracket = constructorName.length;
                var constructorParams = constructorName.substring(indOfOpenBracket);
                if (!constructorParams.length)
                    constructorParams = "()";
                var variablePrefixName = constructorName.charAt(0).toLowerCase() + constructorName.substring(1, indOfOpenBracket);
                var info = this.map[variablePrefixName];
                if (info === undefined)
                    info = this.map[variablePrefixName] = [];
                var equalObj;
                if (obj.equals)
                    equalObj = __aspxRichEdit.ListUtils.elementBy(info, function (curr) { return curr.obj.equals(obj); });
                if (equalObj)
                    return variablePrefixName + "_" + equalObj.id;
                var id = info.length ? __aspxRichEdit.ListUtils.last(info).id + 1 : 0;
                var variableName = variablePrefixName + "_" + id;
                info.push(new ManagerInfo(id, obj));
                var t = [];
                t.push("const " + variableName + ": " + constructorName.substring(0, indOfOpenBracket) + " = new " + constructorName.substr(0, indOfOpenBracket) + constructorParams + ";");
                for (var _i = 0, params_1 = params; _i < params_1.length; _i++) {
                    var p = params_1[_i];
                    t.push(variableName + "." + p.name + " = " + (p.func ? p.func() : obj[p.name]) + ";");
                }
                this.createdVariables.push(t.join("\r\n"));
                return variableName;
            };
            return SimpleObjectsManager;
        }());
        RuntimeTemplateModelCreator.SimpleObjectsManager = SimpleObjectsManager;
        var Options = (function () {
            function Options() {
                this.defineBorderInfo = false;
                this.defineTableBorderInfo = false;
                this.defineTableCellBorderInfo = false;
                this.defineFullTableProperties = false;
                this.defineFullTableRowProperties = false;
                this.defineFullTableCellProperties = false;
            }
            Options.prototype.enableSeparateBorderInfo = function () {
                this.defineBorderInfo = true;
                return this;
            };
            Options.prototype.enableSeparateTableBorderInfo = function () {
                this.defineTableBorderInfo = true;
                return this;
            };
            Options.prototype.enableSeparateTableCellBorderInfo = function () {
                this.defineTableCellBorderInfo = true;
                return this;
            };
            Options.prototype.enableFullTableProperties = function () {
                this.defineFullTableProperties = true;
                return this;
            };
            Options.prototype.enableFullTableRowProperties = function () {
                this.defineFullTableRowProperties = true;
                return this;
            };
            Options.prototype.enableFullTableCellProperties = function () {
                this.defineFullTableCellProperties = true;
                return this;
            };
            return Options;
        }());
        RuntimeTemplateModelCreator.Options = Options;
        var Creator = (function () {
            function Creator(model, layout, options) {
                if (layout === void 0) { layout = null; }
                if (options === void 0) { options = new Options(); }
                var _this = this;
                this.layout = layout;
                this.subDocument = model.mainSubDocument;
                this.subDocumentVariableName = RuntimeTemplateModelCreator.Creator.getSubDocumentVariableName(this.subDocument);
                this.model = model;
                this.options = options;
                this.idMap = new SimpleObjectsManager();
                this.tblIndex = 0;
                this.str = [];
                this.fillModel();
                this.str.push(this.subDocumentVariableName + " = model.activeSubDocument;");
                this.fillTables();
                this.fillFields();
                this.fillBookmarks();
                __aspxRichEdit.MapUtilsKeyAsNumber.foreach(this.model.subDocuments, function (sd) {
                    if (sd.isMain())
                        return;
                    _this.subDocumentVariableName = RuntimeTemplateModelCreator.Creator.getSubDocumentVariableName(sd);
                    _this.subDocument = sd;
                    var parentSubDocumentId = sd.isTextBox() ? sd.info.parentSubDocumentId : -1;
                    _this.str.push("const " + _this.subDocumentVariableName + ": SubDocument = TestDocumentModel.addOtherSubDocument(model, SubDocumentInfoType." + __aspxRichEdit.SubDocumentInfoType[sd.info.getType()] + ", " + parentSubDocumentId + ",");
                    _this.str.push("[");
                    _this.fillChunks();
                    _this.str.push("],");
                    _this.str.push("[");
                    _this.fillParagraphs();
                    _this.str.push("]);");
                    _this.fillTables();
                    _this.fillFields();
                    _this.fillBookmarks();
                });
                this.str.push("layout = new TestLayoutCreator([");
                for (var _i = 0, _a = this.layout.pages; _i < _a.length; _i++) {
                    var p = _a[_i];
                    this.fillPage(p);
                }
                this.str.push("], model).getLayout();");
            }
            Object.defineProperty(Creator.prototype, "documentModel", {
                get: function () { __aspxRichEdit.ListUtils.addListOnTail(this.idMap.createdVariables, this.str); return this.idMap.createdVariables.join("\r\n"); },
                enumerable: true,
                configurable: true
            });
            Object.defineProperty(Creator.prototype, "tables", {
                get: function () { return this.subDocument.tables; },
                enumerable: true,
                configurable: true
            });
            Object.defineProperty(Creator.prototype, "table", {
                get: function () { return this.tables[this.tblIndex]; },
                enumerable: true,
                configurable: true
            });
            Creator.create = function (model, layout, options) {
                if (layout === void 0) { layout = null; }
                if (options === void 0) { options = new Options(); }
                return new Creator(model, layout, options).documentModel;
            };
            Creator.getSubDocumentVariableName = function (sd) {
                if (sd.isMain())
                    return "subDocument";
                var typeAsStr = __aspxRichEdit.SubDocumentInfoType[sd.info.getType()];
                return "subDocument_" + typeAsStr + "_" + sd.id;
            };
            Creator.prototype.escape = function (str) {
                return str.replace(/\\/g, "\\\\")
                    .replace(/"/g, "\\\"");
            };
            Creator.prototype.fillFields = function () {
                var _this = this;
                __aspxRichEdit.ListUtils.foreach(this.subDocument.fields, function (f, ind) {
                    _this.str.push("Field.addField(" + _this.subDocumentVariableName + ".fields, new Field(" + _this.subDocumentVariableName + ".positionManager, " + ind + ", " + f.getFieldStartPosition() + ", " + f.getSeparatorPosition() + ", " + f.getFieldEndPosition() + ", " + f.showCode + ",");
                    if (f.getHyperlinkInfo())
                        _this.str.push("new HyperlinkInfo(\"" + _this.escape(f.getHyperlinkInfo().uri) + "\", \"" + _this.escape(f.getHyperlinkInfo().anchor) + "\", \"" + _this.escape(f.getHyperlinkInfo().tip) + "\", " + f.getHyperlinkInfo().visited + "))); //" + _this.escape(_this.subDocument.getText(f.getAllFieldInterval())));
                    else {
                        _this.str.push("undefined)); //" + _this.escape(_this.subDocument.getText(f.getAllFieldInterval())));
                        _this.mergeLastStrings(2);
                    }
                });
            };
            Creator.prototype.fillBookmarks = function () {
                if (!this.subDocument.bookmarks.length)
                    return;
                this.str.push(this.subDocumentVariableName + ".bookmarks = [];");
                for (var _i = 0, _a = this.subDocument.bookmarks; _i < _a.length; _i++) {
                    var b = _a[_i];
                    this.str.push(this.subDocumentVariableName + ".bookmarks.push(new Bookmark(" + this.subDocumentVariableName + ".positionManager, new BoundaryInterval(" + b.start + ", " + b.end + "), " + this.escape(b.name) + ")); //" + this.escape(this.subDocument.getText(b.interval)));
                }
            };
            Creator.prototype.fillModel = function () {
                this.str.push("model = TestDocumentModel.create(");
                this.str.push("[");
                this.fillChunks();
                this.str.push("],");
                this.str.push("[");
                this.fillParagraphs();
                this.str.push("],");
                this.str.push("[");
                this.fillSections();
                this.str.push("]);");
            };
            Creator.prototype.tableWidthUnit = function (w) {
                return "new TableWidthUnit().init(" + w.value + ", TableWidthUnitType." + __aspxRichEdit.TableWidthUnitType[w.type] + ")";
            };
            Creator.prototype.borderInfo = function (b) {
                if (this.options.defineBorderInfo)
                    return this.idMap.add(b, "BorderInfo", [
                        new ManagerParams("colorIndex"),
                        new ManagerParams("frame"),
                        new ManagerParams("offset"),
                        new ManagerParams("shadow"),
                        new ManagerParams("style"),
                        new ManagerParams("width"),
                    ]);
                else
                    return "new BorderInfo()";
            };
            Creator.prototype.tableBorders = function (brds) {
                var _this = this;
                if (this.options.defineTableBorderInfo)
                    return this.idMap.add(brds, "TableBorders", [
                        new ManagerParams("topBorder", function () { return _this.borderInfo(brds.topBorder); }),
                        new ManagerParams("rightBorder", function () { return _this.borderInfo(brds.rightBorder); }),
                        new ManagerParams("bottomBorder", function () { return _this.borderInfo(brds.bottomBorder); }),
                        new ManagerParams("leftBorder", function () { return _this.borderInfo(brds.leftBorder); }),
                        new ManagerParams("insideHorizontalBorder", function () { return _this.borderInfo(brds.insideHorizontalBorder); }),
                        new ManagerParams("insideVerticalBorder", function () { return _this.borderInfo(brds.insideVerticalBorder); }),
                    ]);
                else
                    return "new TableBorders()";
            };
            Creator.prototype.asEnum = function (objEnum, objEnumName, mask, excessNullValue) {
                if (excessNullValue === void 0) { excessNullValue = Number.MAX_VALUE; }
                var res = [];
                var isFoundNullValue = false;
                for (var key in objEnum) {
                    if (!objEnum.hasOwnProperty(key))
                        continue;
                    var keyNum = parseInt(key);
                    if (!isNaN(keyNum) && (keyNum & mask) == keyNum) {
                        if (excessNullValue != keyNum)
                            res.push(objEnum[key]);
                        else
                            isFoundNullValue = true;
                    }
                }
                if (isFoundNullValue && !res.length)
                    res.push(objEnum[excessNullValue]);
                return __aspxRichEdit.ListUtils.map(res, function (r) { return objEnumName + "." + r; }).join(" | ");
            };
            Creator.prototype.tableCellMargins = function (cm) {
                var _this = this;
                return this.idMap.add(cm, "TableCellMargins", [
                    new ManagerParams("top", function () { return _this.tableWidthUnit(cm.top); }),
                    new ManagerParams("bottom", function () { return _this.tableWidthUnit(cm.bottom); }),
                    new ManagerParams("left", function () { return _this.tableWidthUnit(cm.left); }),
                    new ManagerParams("right", function () { return _this.tableWidthUnit(cm.right); }),
                ]);
            };
            Creator.prototype.tableProperties = function (p) {
                var _this = this;
                if (this.options.defineFullTableProperties)
                    return this.idMap.add(p, "TableProperties", [
                        new ManagerParams("avoidDoubleBorders"),
                        new ManagerParams("backgroundColor"),
                        new ManagerParams("borders", function () { return _this.tableBorders(p.borders); }),
                        new ManagerParams("bottomFromText"),
                        new ManagerParams("cellMargins", function () { return _this.tableCellMargins(p.cellMargins); }),
                        new ManagerParams("cellSpacing", function () { return _this.tableWidthUnit(p.cellSpacing); }),
                        new ManagerParams("horizontalAlignMode"),
                        new ManagerParams("horizontalAnchorType"),
                        new ManagerParams("indent", function () { return _this.tableWidthUnit(p.indent); }),
                        new ManagerParams("isTableOverlap"),
                        new ManagerParams("layoutType", function () { return "TableLayoutType." + __aspxRichEdit.TableLayoutType[p.layoutType]; }),
                        new ManagerParams("leftFromText"),
                        new ManagerParams("mask", function () { return _this.asEnum(__aspxRichEdit.TablePropertiesMask, "TablePropertiesMask", p.mask, __aspxRichEdit.TablePropertiesMask.UseNone); }),
                        new ManagerParams("rightFromText"),
                        new ManagerParams("tableHorizontalPosition"),
                        new ManagerParams("tableRowAlignment"),
                        new ManagerParams("tableStyleColumnBandSize"),
                        new ManagerParams("tableStyleRowBandSize"),
                        new ManagerParams("tableVerticalPosition"),
                        new ManagerParams("textWrapping"),
                        new ManagerParams("topFromText"),
                        new ManagerParams("verticalAlignMode"),
                        new ManagerParams("verticalAnchorType"),
                    ]);
                else
                    return this.idMap.add(p, "TableProperties", [
                        new ManagerParams("cellMargins", function () { return _this.tableCellMargins(p.cellMargins); }),
                        new ManagerParams("cellSpacing", function () { return _this.tableWidthUnit(p.cellSpacing); }),
                        new ManagerParams("indent", function () { return _this.tableWidthUnit(p.indent); }),
                        new ManagerParams("layoutType", function () { return "TableLayoutType." + __aspxRichEdit.TableLayoutType[p.layoutType]; }),
                        new ManagerParams("mask", function () { return _this.asEnum(__aspxRichEdit.TablePropertiesMask, "TablePropertiesMask", p.mask, __aspxRichEdit.TablePropertiesMask.UseNone); }),
                    ]);
            };
            Creator.prototype.tableLookTypes = function (lt) {
                return this.asEnum(__aspxRichEdit.TableLookTypes, "TableLookTypes", lt, __aspxRichEdit.TableLookTypes.None);
            };
            Creator.prototype.tableStyle = function (_s) {
                return "new TableStyle(\"name\", \"name\", false, false, false, false, {}, null, null)";
            };
            Creator.prototype.tableRowProperties = function (prop) {
                var _this = this;
                if (this.options.defineFullTableRowProperties)
                    return this.idMap.add(prop, "TableRowProperties", [
                        new ManagerParams("cantSplit"),
                        new ManagerParams("cellSpacing", function () { return _this.tableWidthUnit(prop.cellSpacing); }),
                        new ManagerParams("divId"),
                        new ManagerParams("header"),
                        new ManagerParams("hideCellMark"),
                        new ManagerParams("mask", function () { return _this.asEnum(__aspxRichEdit.TableRowPropertiesMask, "TableRowPropertiesMask", prop.mask, __aspxRichEdit.TableRowPropertiesMask.UseNone); }),
                        new ManagerParams("tableRowAlignment"),
                    ]);
                else
                    return this.idMap.add(prop, "TableRowProperties", [
                        new ManagerParams("cellSpacing", function () { return _this.tableWidthUnit(prop.cellSpacing); }),
                        new ManagerParams("mask", function () { return _this.asEnum(__aspxRichEdit.TableRowPropertiesMask, "TableRowPropertiesMask", prop.mask, __aspxRichEdit.TableRowPropertiesMask.UseNone); }),
                    ]);
            };
            Creator.prototype.tblCellRuns = function (c) {
                var nextLevel = this.subDocument.tablesByLevels[this.table.nestedLevel + 1];
                if (!nextLevel)
                    nextLevel = [];
                var cellInterval = c.interval;
                var internalTables = __aspxRichEdit.ListUtils.reducedMap(nextLevel, function (t) {
                    return __aspxRichEdit.IntervalAlgorithms.getIntersectionNonNullLength(t.interval, cellInterval) ? t : null;
                });
                var isNeedChunkIndex = this.subDocument.chunks.length > 1;
                var it = new __aspxRichEdit.ModelIterator(this.subDocument, false);
                it.setPosition(cellInterval.start);
                var runStr = [];
                var _loop_5 = function () {
                    var pos = it.getAbsolutePosition();
                    if (pos >= cellInterval.end)
                        return "break";
                    var curr = new __aspxRichEdit.FixedInterval(pos, it.run.getLength());
                    if (__aspxRichEdit.ListUtils.allOf(internalTables, function (t) { return !__aspxRichEdit.IntervalAlgorithms.getIntersectionNonNullLength(t.interval, curr); }))
                        runStr.push(isNeedChunkIndex ? "[" + it.chunkIndex + ", " + it.runIndex + "]" : "" + it.runIndex);
                };
                do {
                    var state_2 = _loop_5();
                    if (state_2 === "break")
                        break;
                } while (it.moveToNextRun());
                this.str.push("[" + runStr.join(", ") + "],");
            };
            Creator.prototype.tableCellborders = function (brds) {
                var _this = this;
                if (this.options.defineTableCellBorderInfo)
                    return this.idMap.add(brds, "TableCellBorders", [
                        new ManagerParams("topBorder", function () { return _this.borderInfo(brds.topBorder); }),
                        new ManagerParams("rightBorder", function () { return _this.borderInfo(brds.rightBorder); }),
                        new ManagerParams("bottomBorder", function () { return _this.borderInfo(brds.bottomBorder); }),
                        new ManagerParams("leftBorder", function () { return _this.borderInfo(brds.leftBorder); }),
                        new ManagerParams("topLeftDiagonalBorder", function () { return _this.borderInfo(brds.topLeftDiagonalBorder); }),
                        new ManagerParams("topRightDiagonalBorder", function () { return _this.borderInfo(brds.topRightDiagonalBorder); }),
                    ]);
                else
                    return "new TableCellBorders()";
            };
            Creator.prototype.tableCellProperties = function (prop) {
                var _this = this;
                if (this.options.defineFullTableCellProperties)
                    return this.idMap.add(prop, "TableCellProperties", [
                        new ManagerParams("backgroundColor"),
                        new ManagerParams("borders", function () { return _this.tableCellborders(prop.borders); }),
                        new ManagerParams("cellMargins", function () { return _this.tableCellMargins(prop.cellMargins); }),
                        new ManagerParams("fitText"),
                        new ManagerParams("foreColor"),
                        new ManagerParams("hideCellMark"),
                        new ManagerParams("mask", function () { return _this.asEnum(__aspxRichEdit.TableCellPropertiesMask, "TableCellPropertiesMask", prop.mask, __aspxRichEdit.TableCellPropertiesMask.UseNone); }),
                        new ManagerParams("noWrap"),
                        new ManagerParams("shading"),
                        new ManagerParams("textDirection"),
                        new ManagerParams("verticalAlignment"),
                    ]);
                else
                    return this.idMap.add(prop, "TableCellProperties", [
                        new ManagerParams("cellMargins", function () { return _this.tableCellMargins(prop.cellMargins); }),
                        new ManagerParams("mask", function () { return _this.asEnum(__aspxRichEdit.TableCellPropertiesMask, "TableCellPropertiesMask", prop.mask, __aspxRichEdit.TableCellPropertiesMask.UseNone); }),
                    ]);
            };
            Creator.prototype.internalTables = function (c) {
                var nextLevel = this.subDocument.tablesByLevels[this.table.nestedLevel + 1];
                if (nextLevel) {
                    var cellInterval_1 = c.interval;
                    var tbls = __aspxRichEdit.ListUtils.reducedMap(nextLevel, function (t) {
                        return __aspxRichEdit.IntervalAlgorithms.getIntersectionNonNullLength(t.interval, cellInterval_1) ? t : null;
                    });
                    if (tbls.length) {
                        this.str.push("[");
                        for (var _i = 0, tbls_1 = tbls; _i < tbls_1.length; _i++) {
                            var t = tbls_1[_i];
                            this.fillTable(t.index);
                        }
                        this.str.push("],");
                        return true;
                    }
                }
                this.str.push("[],");
                return false;
            };
            Creator.prototype.mergeLastStrings = function (num) {
                this.str.push(this.str.splice(this.str.length - num, num).join(" "));
            };
            Creator.prototype.tableCells = function (cells) {
                for (var _i = 0, cells_1 = cells; _i < cells_1.length; _i++) {
                    var c = cells_1[_i];
                    this.str.push("new MockTableCell(");
                    this.tblCellRuns(c),
                        this.str.push(c.columnSpan + ",");
                    this.str.push("TableCellMergingState." + __aspxRichEdit.TableCellMergingState[c.verticalMerging] + ",");
                    this.mergeLastStrings(4);
                    var intTbls = this.internalTables(c);
                    if (!intTbls)
                        this.mergeLastStrings(2);
                    this.str.push(this.tableWidthUnit(c.preferredWidth) + ",");
                    this.str.push(this.tableCellProperties(c.properties) + "),");
                    this.mergeLastStrings(intTbls ? 2 : 3);
                }
            };
            Creator.prototype.fillTableRows = function () {
                for (var _i = 0, _a = this.table.rows; _i < _a.length; _i++) {
                    var r = _a[_i];
                    this.str.push("new MockTableRow(" + r.gridBefore + ", " + r.gridAfter + ", [");
                    this.tableCells(r.cells);
                    this.str.push("],");
                    this.str.push("new TableHeightUnit().init(" + r.height.value + ", TableHeightUnitType." + __aspxRichEdit.TableHeightUnitType[r.height.type] + "),");
                    this.str.push(this.tableRowProperties(r.properties) + ",");
                    this.str.push(this.tableWidthUnit(r.widthBefore) + ",");
                    this.str.push(this.tableWidthUnit(r.widthAfter) + ",");
                    this.str.push("true),");
                    this.mergeLastStrings(6);
                }
            };
            Creator.prototype.fillTable = function (tInd) {
                var oldInd = this.tblIndex;
                this.tblIndex = tInd;
                this.str.push("new MockTable([");
                this.fillTableRows();
                this.str.push("],");
                this.str.push(this.tableWidthUnit(this.table.preferredWidth) + ",");
                this.str.push(this.tableProperties(this.table.properties) + ",");
                this.str.push(this.tableLookTypes(this.table.lookTypes) + ",");
                this.str.push(this.tableStyle(this.table.style) + "),");
                this.tblIndex = oldInd;
            };
            Creator.prototype.fillTables = function () {
                if (!this.tables.length)
                    return;
                this.str.push("new ImposeTableHelper(" + this.subDocumentVariableName + ", [");
                for (var _i = 0, _a = this.subDocument.tablesByLevels[0]; _i < _a.length; _i++) {
                    var t = _a[_i];
                    this.fillTable(t.index);
                }
                this.str.push("]);");
            };
            Creator.prototype.fillSections = function () {
                for (var _i = 0, _a = this.model.sections; _i < _a.length; _i++) {
                    var _s = _a[_i];
                    this.str.push("new MockSection(0),");
                }
            };
            Creator.prototype.fillParagraphs = function () {
                for (var _i = 0, _a = this.subDocument.paragraphs; _i < _a.length; _i++) {
                    var _p = _a[_i];
                    this.str.push("new MockParagraph(0, 0, -1, -1),");
                }
            };
            Creator.prototype.fillChunks = function () {
                for (var _i = 0, _a = this.subDocument.chunks; _i < _a.length; _i++) {
                    var c = _a[_i];
                    this.str.push("[");
                    this.fillRuns(c);
                    this.str.push("]");
                }
            };
            Creator.prototype.size = function (s) {
                return "new Size(" + s.width + ", " + s.height + ")";
            };
            Creator.prototype.point = function (p) {
                return "new Point(" + p.x + ", " + p.y + ")";
            };
            Creator.prototype.anchorInfo = function (obj) {
                var _this = this;
                return this.idMap.add(obj, "AnchorInfo", [
                    new ManagerParams("allowOverlap"),
                    new ManagerParams("topDistance"),
                    new ManagerParams("bottomDistance"),
                    new ManagerParams("leftDistance"),
                    new ManagerParams("rightDistance"),
                    new ManagerParams("hidden"),
                    new ManagerParams("horizontalPositionAlignment"),
                    new ManagerParams("horizontalPositionType"),
                    new ManagerParams("isBehindDoc"),
                    new ManagerParams("layoutTableCell"),
                    new ManagerParams("locked"),
                    new ManagerParams("offset", function () { return _this.point(obj.offset); }),
                    new ManagerParams("percentOffset", function () { return _this.point(obj.percentOffset); }),
                    new ManagerParams("verticalPositionAlignment"),
                    new ManagerParams("verticalPositionType"),
                    new ManagerParams("wrapSide"),
                    new ManagerParams("wrapType"),
                    new ManagerParams("zOrder"),
                ]);
            };
            Creator.prototype.shape = function (s) {
                return "new Shape(" + s.fillColor + ", " + s.outlineColor + ", " + s.outlineWidth + ")";
            };
            Creator.prototype.textBoxProps = function (props) {
                return this.idMap.add(props, "new TextBoxProperties(new Margins(" + props.leftMargin + ", " + props.rightMargin + ", " + props.topMargin + ", " + props.bottomMargin + "))", [
                    new ManagerParams("resizeShapeToFitText"),
                    new ManagerParams("upright"),
                    new ManagerParams("verticalAlignment"),
                    new ManagerParams("wrapText"),
                ]);
            };
            Creator.prototype.fillRuns = function (c) {
                for (var _i = 0, _a = c.textRuns; _i < _a.length; _i++) {
                    var r = _a[_i];
                    switch (r.getType()) {
                        case __aspxRichEdit.RunType.TextRun: {
                            var run = r;
                            this.str.push("new MockTextRun(0, 0, \"" + this.escape(c.getTextInChunk(run.startOffset, run.length)) + "\"),");
                            break;
                        }
                        case __aspxRichEdit.RunType.ParagraphRun: {
                            this.str.push("new MockParagraphRun(0, 0),");
                            break;
                        }
                        case __aspxRichEdit.RunType.SectionRun: {
                            this.str.push("new MockSectionRun(0, 0),");
                            break;
                        }
                        case __aspxRichEdit.RunType.AnchoredPictureRun: {
                            var run = r;
                            var size = "new PictureSize(" + run.size.lockAspectRatio + ", " + run.size.rotation + ", " + this.size(run.size.originalSize) + ", " + this.size(run.size.scale) + ")";
                            this.str.push("new MockAnchoredPictureRun(0, 0, " + this.shape(run.shape) + ", " + run.id + ", " + size + ", " + this.anchorInfo(run.anchorInfo) + ", " + run.isLoaded + "),");
                            break;
                        }
                        case __aspxRichEdit.RunType.AnchoredTextBoxRun: {
                            var run = r;
                            var size = "new AnchorTextBoxSize(" + run.size.lockAspectRatio + ", " + run.size.rotation + ", " + this.size(run.size.absoluteSize) + ", " + this.size(run.size.relativeSize) + ", " + run.size.relativeWidthType + ", " + run.size.relativeHeightType + ", " + run.size.useAbsoluteWidth() + ", " + run.size.useAbsoluteHeight() + ")";
                            this.str.push("new MockAnchoredTextBoxRun(0, 0, " + this.shape(run.shape) + ", " + run.subDocId + ", " + size + ", " + this.anchorInfo(run.anchorInfo) + ", " + this.textBoxProps(run.textBoxProperties) + "),");
                            break;
                        }
                        case __aspxRichEdit.RunType.FieldCodeEndRun: {
                            this.str.push("new MockFieldCodeEndRun(0, 0),");
                            break;
                        }
                        case __aspxRichEdit.RunType.FieldCodeStartRun: {
                            this.str.push("new MockFieldCodeStartRun(0, 0),");
                            break;
                        }
                        case __aspxRichEdit.RunType.FieldResultEndRun: {
                            this.str.push("new MockFieldResultEndRun(0, 0),");
                            break;
                        }
                        case __aspxRichEdit.RunType.InlinePictureRun: {
                            var run = r;
                            var size = "new PictureSize(" + run.size.lockAspectRatio + ", " + run.size.rotation + ", " + this.size(run.size.originalSize) + ", " + this.size(run.size.scale) + ")";
                            this.str.push("new MockInlinePictureRun(0, 0, " + this.shape(run.shape) + ", " + run.id + ", " + size + ", " + run.isLoaded + "),");
                            break;
                        }
                        case __aspxRichEdit.RunType.LayoutDependentRun: {
                            this.str.push("new MockLayoutDependentRun(0, 0),");
                            break;
                        }
                        case __aspxRichEdit.RunType.EndNoteRun:
                        case __aspxRichEdit.RunType.FootNoteRun:
                        case __aspxRichEdit.RunType.Undefined:
                        case __aspxRichEdit.RunType.InlineTextBoxRun:
                        default: throw new Error("NotSupportedRun");
                    }
                    this.str.push("// [" + (c.startLogPosition.value + r.startOffset) + ", " + (c.startLogPosition.value + r.startOffset + r.getLength()) + "]");
                    this.mergeLastStrings(2);
                }
            };
            Creator.prototype.pushRectangleProps = function (prefix, r) {
                this.str.push(prefix + "Width: " + r.width + ",");
                this.str.push(prefix + "Height: " + r.height + ",");
                this.str.push(prefix + "X: " + r.x + ",");
                this.str.push(prefix + "Y: " + r.y + ",");
                this.mergeLastStrings(4);
            };
            Creator.prototype.fillPage = function (page) {
                var _this = this;
                this.str.push("{");
                this.pushRectangleProps("page", page);
                this.str.push("pageStartPosition: " + page.getPosition() + ",");
                this.str.push("pageIsContentValid: " + true + ",");
                this.str.push("pageIsFirstInSection: " + page.flags.get(__aspxRichEdit.LayoutPageFlags.IsFirstPageOfSection) + ",");
                this.str.push("pageCalculateIntervals: " + true + ",");
                this.mergeLastStrings(4);
                this.str.push("pagePageAreas: [");
                for (var _i = 0, _a = page.mainSubDocumentPageAreas; _i < _a.length; _i++) {
                    var pa = _a[_i];
                    this.fillPageArea(pa);
                }
                __aspxRichEdit.MapUtilsKeyAsNumber.foreach(page.otherPageAreas, function (pa) {
                    return _this.fillPageArea(pa);
                });
                this.str.push("]},");
            };
            Creator.prototype.fillPageArea = function (pa) {
                this.str.push("{");
                this.pushRectangleProps("pageArea", pa);
                this.str.push("pageAreaSubDocument: " + RuntimeTemplateModelCreator.Creator.getSubDocumentVariableName(pa.subDocument) + ",");
                this.str.push("pageAreaPageOffset: " + pa.pageOffset + ",");
                this.str.push("pageAreaColumns: [");
                this.mergeLastStrings(3);
                for (var _i = 0, _a = pa.columns; _i < _a.length; _i++) {
                    var c = _a[_i];
                    this.fillColumn(c);
                }
                this.str.push("]},");
            };
            Creator.prototype.fillColumn = function (c) {
                this.str.push("{");
                this.pushRectangleProps("column", c);
                this.str.push("columnParagraphFrames: [],");
                this.str.push("columnPageAreaOffset: " + c.pageAreaOffset + ",");
                this.str.push("columnRows: [");
                this.mergeLastStrings(3);
                for (var _i = 0, _a = c.rows; _i < _a.length; _i++) {
                    var r = _a[_i];
                    this.fillRow(r);
                }
                this.str.push("]},");
            };
            Creator.prototype.fillRow = function (r) {
                this.str.push("{");
                this.pushRectangleProps("row", r);
                this.str.push("rowBaseLine: " + r.baseLine + ",");
                this.str.push("rowSpacingBefore: " + r.getSpacingBefore() + ",");
                this.str.push("rowSpacingAfter: " + r.getSpacingAfter() + ",");
                this.str.push("rowNumberingListBox: " + r.numberingListBox + ",");
                this.str.push("rowColumnOffset: " + r.columnOffset + ",");
                this.mergeLastStrings(5);
                this.str.push("rowBoxes: [");
                for (var _i = 0, _a = r.boxes; _i < _a.length; _i++) {
                    var b = _a[_i];
                    this.fillBox(b);
                }
                this.str.push("]},");
            };
            Creator.prototype.fillBox = function (b) {
                var str = "{ width: " + b.width + ", height: " + b.height + ", type: LayoutBoxType." + __aspxRichEdit.LayoutBoxType[b.getType()] + ", charProp: null, getAscent: () => " + b.getAscent() + ", getDescent: () => " + b.getDescent();
                switch (b.getType()) {
                    case __aspxRichEdit.LayoutBoxType.Text:
                        str += ", text: \"" + this.escape(b.text) + "\" },";
                        break;
                    case __aspxRichEdit.LayoutBoxType.Dash:
                        str += ", text: \"" + this.escape(b.text) + "\" },";
                        break;
                    case __aspxRichEdit.LayoutBoxType.Picture:
                        str += ", id: " + b.id + " },";
                        break;
                    case __aspxRichEdit.LayoutBoxType.Space:
                    case __aspxRichEdit.LayoutBoxType.TabSpace:
                    case __aspxRichEdit.LayoutBoxType.LineBreak:
                    case __aspxRichEdit.LayoutBoxType.PageBreak:
                    case __aspxRichEdit.LayoutBoxType.ColumnBreak:
                    case __aspxRichEdit.LayoutBoxType.ParagraphMark:
                        str += " },";
                        break;
                }
                this.str.push(str);
            };
            return Creator;
        }());
        RuntimeTemplateModelCreator.Creator = Creator;
    })(RuntimeTemplateModelCreator = __aspxRichEdit.RuntimeTemplateModelCreator || (__aspxRichEdit.RuntimeTemplateModelCreator = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TEST_CLASS = (function () {
        function TEST_CLASS() {
        }
        TEST_CLASS.pagesIntervals = function (control) {
            console.log(__aspxRichEdit.ListUtils.map(control.layout.pages, TEST_CLASS.pageIntervals).join("\n"));
        };
        TEST_CLASS.pageIntervals = function (page) {
            return "\tPage[" + page.index + "]Intervals: " +
                __aspxRichEdit.LogListHelper.level_1(__aspxRichEdit.LogObjToStr.fixedInterval, page.getContentIntervals(), "\t\t", "\t")();
        };
        TEST_CLASS.getLayoutPosition = function (control, pos) {
            var subDocument = control.model.activeSubDocument;
            var selection = control.selection;
            return (subDocument.isMain()
                ? new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(control.layout, subDocument, pos, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(control.layout, subDocument, pos, selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character))
                .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
        };
        TEST_CLASS.recalcPageIntervals = function (control) {
            for (var _i = 0, _a = control.layout.pages; _i < _a.length; _i++) {
                var page = _a[_i];
                page.flags.set(__aspxRichEdit.LayoutPageFlags.IsIntervalsCorrect, false);
                page.calculateContentIntervals(control.layout.anchorObjectsPositionInfo, false);
                page.getContentIntervals();
            }
        };
        TEST_CLASS.clearAllRunMergedProperties = function (control) {
            __aspxRichEdit.ListUtils.foreach(control.model.activeSubDocument.chunks, function (chunk) { return __aspxRichEdit.ListUtils.foreach(chunk.textRuns, function (run) { return run.resetCharacterMergedProperties(); }); });
            control.layoutFormatterManager.invalidator.onIntervalChanged(control.model.activeSubDocument, new __aspxRichEdit.FixedInterval(0, control.model.activeSubDocument.getDocumentEndPosition()));
            while (!control.layout.isFullyFormatted)
                control.layoutFormatterManager.forceFormatPage(control.layout.validPageCount);
        };
        TEST_CLASS.checkLayoutPage = function (layout, page) {
            var pagePos = page.getPosition();
            var collectedIntervals = [];
            var pageAreas = page.mainSubDocumentPageAreas;
            if (pageAreas[0].pageOffset != 0)
                console.log(page.index, page, "First page area offset != 0");
            for (var pageAreaIndex = 0, pageArea = void 0; pageArea = pageAreas[pageAreaIndex]; pageAreaIndex++) {
                var pageAreaPos = pagePos + pageArea.pageOffset;
                var columns = pageArea.columns;
                if (columns[0].pageAreaOffset != 0)
                    console.log(page.index, page, pageAreaIndex, pageArea, "First column offset != 0");
                for (var columnIndex = 0, column = void 0; column = columns[columnIndex]; columnIndex++) {
                    var columnPos = pageAreaPos + column.pageAreaOffset;
                    var rows = column.rows;
                    if (rows[0].columnOffset != 0)
                        console.log(page.index, page, pageAreaIndex, pageArea, columnIndex, column, "First row offset != 0");
                    for (var rowIndex = 0, row = void 0; row = rows[rowIndex]; rowIndex++) {
                        var rowPos = columnPos + row.columnOffset;
                        collectedIntervals.push(new __aspxRichEdit.FixedInterval(rowPos, row.getLastBoxEndPositionInRow()));
                        var boxes = row.boxes;
                        if (boxes[0].rowOffset != 0)
                            console.log(page.index, page, pageAreaIndex, pageArea, columnIndex, column, row, rowIndex, "First box offset != 0");
                    }
                }
            }
            var lastEndPos = 0;
            for (var _i = 0, collectedIntervals_1 = collectedIntervals; _i < collectedIntervals_1.length; _i++) {
                var interval = collectedIntervals_1[_i];
                if (interval.start < lastEndPos)
                    console.log("Intervals of row not sorted", page, collectedIntervals);
                lastEndPos = interval.end;
            }
            var mergedIntervals = __aspxRichEdit.IntervalAlgorithms.getMergedIntervals(collectedIntervals, true);
            var pageIntervalIndex = 0;
            page.calculateContentIntervals(layout.anchorObjectsPositionInfo, false);
            var pageIntervals = page.getContentIntervals();
            var currPageInterval = pageIntervals[pageIntervalIndex];
            for (var mergedIntervalIndex = 0, mgInt = void 0; mgInt = mergedIntervals[mergedIntervalIndex]; mergedIntervalIndex++) {
                if (!currPageInterval.containsInterval(mgInt)) {
                    pageIntervalIndex++;
                    currPageInterval = pageIntervals[pageIntervalIndex];
                    if (!currPageInterval || !currPageInterval.containsInterval(mgInt))
                        console.log("current page contentIntervals not consider some row intervals", [mgInt.start, mgInt.end], mergedIntervals, pageIntervals, collectedIntervals, page);
                }
            }
        };
        TEST_CLASS.checkLayout = function (_model, layout) {
            var pages = layout.pages;
            for (var pageIndex = 0, page = void 0; page = pages[pageIndex]; pageIndex++) {
                TEST_CLASS.checkLayoutPage(layout, page);
            }
        };
        TEST_CLASS.checkModel = function (model) {
            for (var sid in model.subDocuments) {
                if (!model.subDocuments.hasOwnProperty(sid))
                    continue;
                var subDocument = model.subDocuments[sid];
                var prevParagraphEnd = 0;
                for (var pIndex = 0, paragraph = void 0; paragraph = subDocument.paragraphs[pIndex]; pIndex++) {
                    if (paragraph.startLogPosition.value !== prevParagraphEnd) {
                        console.log("paragraphs[" + pIndex + "].length !== prevParagraphEnd");
                    }
                    prevParagraphEnd = paragraph.getEndPosition();
                    if (paragraph.length === 0) {
                        console.log("paragraphs[" + pIndex + "].length == 0");
                        continue;
                    }
                    var endParRun = subDocument.getRunByPosition(paragraph.getEndPosition() - 1);
                    if (endParRun.getType() !== __aspxRichEdit.RunType.ParagraphRun) {
                        console.log("The last run of paragraph " + pIndex + " is not ParagraphRun");
                        continue;
                    }
                }
                if (subDocument.paragraphs[subDocument.paragraphs.length - 1].getEndPosition() !== subDocument.getLastChunk().getEndPosition())
                    console.log("paragraphs.length !== chunks.length in sid=" + sid);
                var prevTableStartPosition = -1;
                for (var tIndex = 0, table = void 0; table = subDocument.tables[tIndex]; tIndex++) {
                    if (table.getStartPosition() < prevTableStartPosition)
                        console.log("tables are not sorted. tables[" + tIndex + "].getStartPosition() < prevTableStartPosition in sid=" + sid);
                    prevTableStartPosition = table.getStartPosition();
                    if (table.index !== tIndex)
                        console.log("subDocument.tables[" + tIndex + "] !== subDocument.tables[" + tIndex + "].index");
                    if (table.nestedLevel == 0 && table.parentCell)
                        console.log("subDocument.tables[" + tIndex + "].parentCell exists but nestedLevel===0");
                    else if (table.nestedLevel > 0 && !table.parentCell)
                        console.log("subDocument.tables[" + tIndex + "].parentCell doesn't exist but nestedLevel>0");
                    else if (table.parentCell && table.parentCell.parentRow.parentTable.index >= table.index)
                        console.log("subDocument.tables[" + tIndex + "].parentCell.parentRow.parentTable.index >= table.index");
                    var prevRowEndPosition = -1;
                    var prevColumnsCount = -1;
                    for (var rIndex = 0, row = void 0; row = table.rows[rIndex]; rIndex++) {
                        var currentColumnsCount = row.gridAfter + row.gridBefore;
                        if (row.cells.length === 0)
                            console.log("tables[" + tIndex + "].rows.length === 0");
                        if (prevRowEndPosition >= 0 && prevRowEndPosition !== row.getStartPosition())
                            console.log("tables[" + tIndex + "].rows[" + rIndex + "].getStartPosition() != prevRowEndPosition");
                        if (row.parentTable !== table)
                            console.log("tables[" + tIndex + "].rows[" + rIndex + "].parentTable != table");
                        prevRowEndPosition = row.getEndPosition();
                        for (var cIndex = 0, cell = void 0; cell = row.cells[cIndex]; cIndex++) {
                            currentColumnsCount += cell.columnSpan;
                            if (cell.startParagraphPosition.value >= cell.endParagrapPosition.value)
                                console.log("tables[" + tIndex + "].rows[" + rIndex + "].cells[" + cIndex + "].startParagraphPosition.value >= cell.endParagrapPosition.value");
                            var startParagraph = subDocument.getParagraphByPosition(cell.startParagraphPosition.value);
                            var endParagraph = subDocument.getParagraphByPosition(cell.endParagrapPosition.value - 1);
                            if (cell.startParagraphPosition.value !== startParagraph.startLogPosition.value)
                                console.log("tables[" + tIndex + "].rows[" + rIndex + "].cells[" + cIndex + "] doesn't start with paragraph");
                            if (cell.endParagrapPosition.value !== endParagraph.getEndPosition())
                                console.log("tables[" + tIndex + "].rows[" + rIndex + "].cells[" + cIndex + "] doesn't end with paragraph");
                        }
                        if (rIndex > 0 && currentColumnsCount !== prevColumnsCount)
                            console.log("tables[" + tIndex + "].rows[" + rIndex + "].columnsCount(" + currentColumnsCount + ") != prevColumnsCount(" + prevColumnsCount + ")");
                        prevColumnsCount = currentColumnsCount;
                    }
                }
            }
        };
        TEST_CLASS.getPlaceActualTableProperties = function (table, prefix) {
            if (prefix === void 0) { prefix = ""; }
            var prefix_1 = prefix + "\t";
            var prefix_2 = prefix_1 + "\t";
            var prefix_3 = prefix_2 + "\t";
            var prefix_4 = prefix_3 + "\t";
            var prefix_5 = prefix_4 + "\t";
            var cellHandler = function (cell, cellIndex) {
                return prefix_3 + "cell[" + cellIndex + "]\n" + __aspxRichEdit.LogObjToStr.tableCellMembers(cell, prefix_4) + "\n" + prefix_4 + "cellProperties\n" + __aspxRichEdit.LogObjToStr.tableCellProperties(cell.properties, prefix_5);
            };
            var rowHandler = function (row, rowIndex) {
                return prefix_1 + "row[" + rowIndex + "]:\n" + __aspxRichEdit.LogObjToStr.tableRowMembers(row, prefix_2) + "\n" + prefix_2 + "rowProperties:\n" + __aspxRichEdit.LogObjToStr.tableRowProperties(row.properties, prefix_3) + "\n" + prefix_2 + "cells:\n" + __aspxRichEdit.Log.join("\n", __aspxRichEdit.Log.map(cellHandler, row.cells));
            };
            var result = [];
            result.push(__aspxRichEdit.Log.TRIPLE_SOLID_BLOCK + "\n" + __aspxRichEdit.LogObjToStr.tableMembers(table, prefix));
            result.push(prefix + "tableProperties\n" + __aspxRichEdit.LogObjToStr.tableProperties(table.properties, prefix_1));
            result.push(prefix + "rows\n" + __aspxRichEdit.Log.join("\n", __aspxRichEdit.Log.map(rowHandler, table.rows)));
            result.push(prefix + "styles\n" + __aspxRichEdit.LogObjToStr.tableStyle(table.style, prefix_1));
            console.log(result.join("\n"));
        };
        TEST_CLASS.getTableStructure = function (subDocument, index) {
            var result = "";
            var table = subDocument.tables[index];
            result += "<(" + index + ")";
            for (var rowIndex = 0, row = void 0; row = table.rows[rowIndex]; rowIndex++) {
                if (rowIndex > 0)
                    result += "\n";
                result += "\t";
                result += __aspxRichEdit.StringUtils.mergeStringNTimes("→ ", row.gridBefore);
                for (var cellIndex = 0, cell = void 0; cell = row.cells[cellIndex]; cellIndex++) {
                    result += " [" + cell.startParagraphPosition.value + " ";
                    if (cell.columnSpan > 1)
                        result += Array(cell.columnSpan).join("→");
                    if (cell.verticalMerging === __aspxRichEdit.TableCellMergingState.Restart)
                        result += "↓";
                    if (cell.verticalMerging === __aspxRichEdit.TableCellMergingState.Continue)
                        result += "↑";
                    for (var ind = index + 1, nextTable = void 0; nextTable = subDocument.tables[ind]; ind++) {
                        if (nextTable.nestedLevel == table.nestedLevel + 1 &&
                            cell.interval.containsInterval(nextTable.interval))
                            result += "\n\t" + this.getTableStructure(subDocument, ind) + "\n";
                    }
                    result += " " + cell.endParagrapPosition.value + "] ";
                }
                result += __aspxRichEdit.StringUtils.mergeStringNTimes("← ", row.gridAfter);
            }
            result += ">";
            return result;
        };
        TEST_CLASS.getTableIndexesInfoByLayoutCell = function (cellInfo) {
            var tti = new TEST_TABLE_INFO();
            var rowInfo = cellInfo.parentRow;
            var tableInfo = rowInfo.parentTable;
            var logicInfo = tableInfo.logicInfo.grid;
            tti.modelTableIndex = logicInfo.table.index;
            tti.nestedLevel = logicInfo.table.nestedLevel;
            tti.layoutRowIndex = __aspxRichEdit.ListUtils.indexOf(tableInfo.tableRows, rowInfo);
            tti.layoutCellIndex = __aspxRichEdit.ListUtils.indexOf(rowInfo.rowCells, cellInfo);
            return tti;
        };
        TEST_CLASS.anchorInfoToString = function (ancInfo) {
            var result = [];
            if (ancInfo.isUsedHorizontalAbsolutePosition())
                result.push("Horiz ABS pos " + __aspxRichEdit.Log.mask(__aspxRichEdit.AnchorObjectHorizontalPositionType, ancInfo.horizontalPositionType) + " " + __aspxRichEdit.UnitConverter.twipsToPixels(ancInfo.offset.x) + "px");
            if (ancInfo.isUsedHorizontalAlignment() || ancInfo.isUsedHorizontalBookLayout()) {
                result.push(ancInfo.isUsedHorizontalAlignment() ? "Horiz ALIGNMENT " : "Horiz BookLayout ");
                result.push(__aspxRichEdit.Log.mask(__aspxRichEdit.AnchorObjectHorizontalPositionType, ancInfo.horizontalPositionType));
                result.push(" ");
                result.push(__aspxRichEdit.Log.mask(__aspxRichEdit.AnchorObjectHorizontalPositionAlignment, ancInfo.horizontalPositionAlignment));
            }
            if (ancInfo.isUsedHorizontalRelativePosition())
                result.push("Horiz RELATIVE pos " + ancInfo.percentOffset.x / __aspxRichEdit.AnchorInfo.RELATIVE_COEFF + "%");
            if (ancInfo.isUsedVerticalAbsolutePosition())
                result.push("\nVert ABS pos " + __aspxRichEdit.Log.mask(__aspxRichEdit.AnchorObjectVerticalPositionType, ancInfo.verticalPositionType) + " " + __aspxRichEdit.UnitConverter.twipsToPixels(ancInfo.offset.y) + "px");
            if (ancInfo.isUsedVerticalAlignment()) {
                result.push("\nVert ALIGNMENT pos");
                result.push(__aspxRichEdit.Log.mask(__aspxRichEdit.AnchorObjectVerticalPositionType, ancInfo.verticalPositionType));
                result.push(" ");
                result.push(__aspxRichEdit.Log.mask(__aspxRichEdit.AnchorObjectVerticalPositionAlignment, ancInfo.verticalPositionAlignment));
            }
            if (ancInfo.isUsedVerticalRelativePosition())
                result.push("\nVert RELATIVE pos " + ancInfo.percentOffset.y / __aspxRichEdit.AnchorInfo.RELATIVE_COEFF + "%");
            result.push("\nDistanceFromText\n");
            result.push("\t Top: " + __aspxRichEdit.UnitConverter.twipsToPixels(ancInfo.topDistance) + "px \n");
            result.push("\t Bottom: " + __aspxRichEdit.UnitConverter.twipsToPixels(ancInfo.bottomDistance) + "px \n");
            result.push("\t Left: " + __aspxRichEdit.UnitConverter.twipsToPixels(ancInfo.leftDistance) + "px \n");
            result.push("\t Right: " + __aspxRichEdit.UnitConverter.twipsToPixels(ancInfo.rightDistance) + "px \n");
            return result.join("");
        };
        TEST_CLASS.selectionInfo = function (selection) {
            var res = [];
            __aspxRichEdit.ListUtils.foreach(selection.intervals, function (curr) { return res.push(__aspxRichEdit.LogObjToStr.fixedInterval(curr)); });
            res.push("pageIndex=" + selection.pageIndex);
            res.push("activeSubDoc=" + __aspxRichEdit.LogObjToStr.subDocumentInfoBase(selection.model.activeSubDocument.info, "", " "));
            if (selection.specialRunInfo.isSelected()) {
                if (selection.specialRunInfo.isPictureSelected()) {
                    res.push(selection.specialRunInfo.isSelectedAnchorObject ? "anchored picture" : "inline picture");
                    res.push("pos=" + selection.specialRunInfo.getPicturePosition());
                }
                else {
                    res.push(selection.specialRunInfo.isSelectedAnchorObject ? "anchored text box" : "inline text box");
                    res.push("pos=" + selection.specialRunInfo.getTextBoxPosition());
                    res.push("internalSubDocId=" + selection.specialRunInfo.textBoxInnerSubDocumentId);
                }
                res.push("parentSubDoc=" + __aspxRichEdit.LogObjToStr.subDocumentInfoBase(selection.specialRunInfo.getParentSubDocument().info, "", " "));
            }
            return res.join("\n");
        };
        return TEST_CLASS;
    }());
    __aspxRichEdit.TEST_CLASS = TEST_CLASS;
    var TEST_CLASS_PROPS_ANALYZE = (function () {
        function TEST_CLASS_PROPS_ANALYZE() {
        }
        TEST_CLASS_PROPS_ANALYZE.analyzeContainer = function (container, getPropFromContainer, enumObject, enumProperty) {
            return container.getUseValue(enumProperty) ?
                "Consider property " + enumObject[enumProperty] + " with value " + getPropFromContainer(container) :
                "";
        };
        TEST_CLASS_PROPS_ANALYZE.analyzeTableConditionalStyles = function (tableStyle, getContainerFromCondStyle, getValue, enumObject, enumProperty) {
            var result = [];
            __aspxRichEdit.EnumUtils.foreach(__aspxRichEdit.ConditionalTableStyleFormatting, function (enumKey) {
                var condStyle = tableStyle.conditionalStyles[enumKey];
                if (condStyle)
                    result.push("ConditionalStyle " + __aspxRichEdit.ConditionalTableStyleFormatting[enumKey] + ": " + TEST_CLASS_PROPS_ANALYZE.analyzeContainer(getContainerFromCondStyle(condStyle), getValue, enumObject, enumProperty));
                return false;
            });
            if (tableStyle.baseConditionalStyle)
                result.push("ConditionalStyle BASE: " + TEST_CLASS_PROPS_ANALYZE.analyzeContainer(getContainerFromCondStyle(tableStyle.baseConditionalStyle), getValue, enumObject, enumProperty));
            return result.length ? result.join("\n") : "Dont consider that property";
        };
        TEST_CLASS_PROPS_ANALYZE.analyzeTableConditionalStyleByCharacterPropertyFontSize = function (tableStyle) {
            return TEST_CLASS_PROPS_ANALYZE.analyzeTableConditionalStyles(tableStyle, function (tblCondStyle) { return tblCondStyle.maskedCharacterProperties; }, function (c) { return c.fontSize; }, __aspxRichEdit.CharacterPropertiesMask, __aspxRichEdit.CharacterPropertiesMask.UseDoubleFontSize);
        };
        TEST_CLASS_PROPS_ANALYZE.analyzeTableConditionalStyleByCharacterPropertyColor = function (tableStyle) {
            return TEST_CLASS_PROPS_ANALYZE.analyzeTableConditionalStyles(tableStyle, function (tblCondStyle) { return tblCondStyle.maskedCharacterProperties; }, function (c) { return c.textColor; }, __aspxRichEdit.CharacterPropertiesMask, __aspxRichEdit.CharacterPropertiesMask.UseForeColorIndex);
        };
        return TEST_CLASS_PROPS_ANALYZE;
    }());
    __aspxRichEdit.TEST_CLASS_PROPS_ANALYZE = TEST_CLASS_PROPS_ANALYZE;
    var BOX_ITERATOR_VISUALIZER = (function () {
        function BOX_ITERATOR_VISUALIZER(control) {
            this.canRunNext = true;
            this.canRunPrev = true;
            this.control = control;
            this.reset();
        }
        BOX_ITERATOR_VISUALIZER.prototype.reset = function () {
            this.it = new __aspxRichEdit.LayoutBoxIteratorMainSubDocument(this.control.model.activeSubDocument, this.control.layout, this.control.selection.getLastSelectedInterval().start, this.control.selection.getLastSelectedInterval().end);
        };
        BOX_ITERATOR_VISUALIZER.prototype.next = function () {
            if (this.canRunNext) {
                if (this.it.moveNext(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false))) {
                    var posStart = this.it.position.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Character);
                    var posEnd = this.it.position.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Box) + this.it.position.box.getLength();
                    this.control.selection.deprecatedSetSelection(posStart, posEnd, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes, true, true, __aspxRichEdit.ModelScrollManager.StandartScrollPosition);
                    this.canRunPrev = true;
                    return true;
                }
                else {
                    this.canRunNext = false;
                    return false;
                }
            }
            return false;
        };
        BOX_ITERATOR_VISUALIZER.prototype.prev = function () {
            if (this.canRunPrev) {
                if (this.it.movePrev(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false))) {
                    var posStart = this.it.position.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Character);
                    var posEnd = this.it.position.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Box) + this.it.position.box.getLength();
                    var docEndPos = this.control.model.activeSubDocument.getDocumentEndPosition();
                    if (posStart == posEnd && posStart == docEndPos)
                        this.control.selection.deprecatedSetSelection(docEndPos - 1, docEndPos, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes, true, true, __aspxRichEdit.ModelScrollManager.StandartScrollPosition);
                    else
                        this.control.selection.deprecatedSetSelection(posStart, posEnd, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes, true, true, __aspxRichEdit.ModelScrollManager.StandartScrollPosition);
                    this.canRunNext = true;
                    return true;
                }
                else {
                    this.canRunPrev = false;
                    return false;
                }
            }
            return false;
        };
        return BOX_ITERATOR_VISUALIZER;
    }());
    __aspxRichEdit.BOX_ITERATOR_VISUALIZER = BOX_ITERATOR_VISUALIZER;
    var TEST_TABLE_INFO = (function () {
        function TEST_TABLE_INFO() {
        }
        TEST_TABLE_INFO.prototype.toString = function () {
            return "modelTableIndex: " + this.modelTableIndex + ", nestedLevel: " + this.nestedLevel + ", layoutRowIndex: " + this.layoutRowIndex + ", layoutCellIndex: " + this.layoutCellIndex;
        };
        return TEST_TABLE_INFO;
    }());
    __aspxRichEdit.TEST_TABLE_INFO = TEST_TABLE_INFO;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DebugVisualizerType;
    (function (DebugVisualizerType) {
        DebugVisualizerType[DebugVisualizerType["None"] = 0] = "None";
        DebugVisualizerType[DebugVisualizerType["TableBounds"] = 1] = "TableBounds";
        DebugVisualizerType[DebugVisualizerType["LayoutBounds"] = 2] = "LayoutBounds";
    })(DebugVisualizerType = __aspxRichEdit.DebugVisualizerType || (__aspxRichEdit.DebugVisualizerType = {}));
    var DebugVisualizerManager = (function () {
        function DebugVisualizerManager(cache) {
            this.vizualizers = {};
            this.containers = {};
            this.cache = cache;
            this.vizualizers[DebugVisualizerType.TableBounds] = new TableBoundsVisibleInfoHelper();
            this.vizualizers[DebugVisualizerType.LayoutBounds] = new LayoutBoundsInfoHelper();
        }
        DebugVisualizerManager.prototype.show = function (vizType, layout, pageIndex) {
            var viz = this.vizualizers[vizType];
            var pageContainer = this.getPageContainer(viz, pageIndex);
            DebugVisualizerManager.clearContainer(pageContainer);
            viz.fillPageContainer(layout, pageContainer, pageIndex);
            __aspxRichEdit.DocumentRenderer.getServiceContainerCore(this.cache[pageIndex].page).appendChild(pageContainer);
        };
        DebugVisualizerManager.clearContainer = function (container) {
            while (container.firstChild)
                __aspxRichEdit.HTMLUtils.hideNode(container.firstChild);
        };
        DebugVisualizerManager.prototype.hide = function (vizType, pageIndex) {
            var viz = this.vizualizers[vizType];
            var currContainer = this.getPageContainer(viz, pageIndex);
            __aspxRichEdit.HTMLUtils.hideNode(currContainer);
        };
        DebugVisualizerManager.prototype.hideAll = function (vizType) {
            if (vizType === void 0) { vizType = DebugVisualizerType.None; }
            var viz = this.vizualizers[vizType];
            if (viz) {
                var vizContainers = this.containers[viz.getType()];
                if (vizContainers) {
                    __aspxRichEdit.ListUtils.foreach(vizContainers, function (cont) { return __aspxRichEdit.HTMLUtils.hideNode(cont); });
                    delete this.containers[viz.getType()];
                }
            }
            else {
                __aspxRichEdit.MapUtilsKeyAsNumber.foreach(this.containers, function (vizContainers) {
                    return __aspxRichEdit.ListUtils.foreach(vizContainers, function (cont) { return __aspxRichEdit.HTMLUtils.hideNode(cont); });
                });
                this.containers = {};
            }
        };
        DebugVisualizerManager.prototype.getPageContainer = function (viz, pageIndex) {
            var vizContainers = this.containers[viz.getType()];
            if (!vizContainers)
                vizContainers = this.containers[viz.getType()] = [];
            var currLen = vizContainers.length;
            while (currLen <= pageIndex)
                currLen = vizContainers.push(__aspxRichEdit.DocumentRenderer.renderContainer(viz.getContainerClassName()));
            return vizContainers[pageIndex];
        };
        return DebugVisualizerManager;
    }());
    __aspxRichEdit.DebugVisualizerManager = DebugVisualizerManager;
    var DebugBaseVisualizer = (function () {
        function DebugBaseVisualizer() {
        }
        DebugBaseVisualizer.prototype.createElement = function (className, bounds, textContent) {
            if (textContent === void 0) { textContent = ""; }
            var element = __aspxRichEdit.DocumentRenderer.renderContainer(className);
            __aspxRichEdit.HTMLUtils.setStyleSizeAndPosition(element.style, bounds.rectangle.applyMarginsOutside(new __aspxRichEdit.Margins(1, 1, 1, 1)));
            if (textContent.length)
                element.textContent = textContent;
            return element;
        };
        return DebugBaseVisualizer;
    }());
    __aspxRichEdit.DebugBaseVisualizer = DebugBaseVisualizer;
    var LayoutBoundsInfoHelper = (function (_super) {
        __extends(LayoutBoundsInfoHelper, _super);
        function LayoutBoundsInfoHelper() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutBoundsInfoHelper.prototype.getType = function () {
            return DebugVisualizerType.LayoutBounds;
        };
        LayoutBoundsInfoHelper.prototype.getContainerClassName = function () {
            return "dxreDebugLayoutBoundsContainer";
        };
        LayoutBoundsInfoHelper.prototype.fillPageContainer = function (layout, pageContainer, pageIndex) {
            var _this = this;
            var page = layout.pages[pageIndex];
            __aspxRichEdit.ListUtils.foreach(page.mainSubDocumentPageAreas, function (pa) { return _this.drawPageArea(pageContainer, pa); });
            __aspxRichEdit.MapUtilsKeyAsNumber.foreach(page.otherPageAreas, function (pa) { return _this.drawPageArea(pageContainer, pa); });
        };
        LayoutBoundsInfoHelper.prototype.drawPageArea = function (pageContainer, pa) {
            var _this = this;
            var elem = this.createElement("dxreDebugPageAreaBounds", pa);
            __aspxRichEdit.ListUtils.foreach(pa.columns, function (col) { return _this.drawColumn(elem, col); });
            pageContainer.appendChild(elem);
        };
        LayoutBoundsInfoHelper.prototype.drawColumn = function (pageAreaContainer, column) {
            var _this = this;
            var elem = this.createElement("dxreDebugColumnBounds", column);
            __aspxRichEdit.ListUtils.foreach(column.rows, function (row) { return _this.drawRow(elem, row); });
            pageAreaContainer.appendChild(elem);
        };
        LayoutBoundsInfoHelper.prototype.drawRow = function (columnContainer, row) {
            var elem = this.createElement("dxreDebugRowBounds", row);
            columnContainer.appendChild(elem);
        };
        return LayoutBoundsInfoHelper;
    }(DebugBaseVisualizer));
    __aspxRichEdit.LayoutBoundsInfoHelper = LayoutBoundsInfoHelper;
    var TableBoundsVisibleInfoHelper = (function (_super) {
        __extends(TableBoundsVisibleInfoHelper, _super);
        function TableBoundsVisibleInfoHelper() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableBoundsVisibleInfoHelper.prototype.getType = function () {
            return DebugVisualizerType.TableBounds;
        };
        TableBoundsVisibleInfoHelper.prototype.getContainerClassName = function () {
            return "dxreDebugTableBoundsContainer";
        };
        TableBoundsVisibleInfoHelper.prototype.fillPageContainer = function (layout, pageContainer, pageIndex) {
            var _this = this;
            var layoutPage = layout.pages[pageIndex];
            for (var _i = 0, _a = layoutPage.mainSubDocumentPageAreas; _i < _a.length; _i++) {
                var pageArea = _a[_i];
                this.setElementsFromPageArea(pageArea, pageContainer);
            }
            __aspxRichEdit.MapUtilsKeyAsNumber.foreach(layoutPage.otherPageAreas, function (otherPageArea) {
                return _this.setElementsFromPageArea(otherPageArea, pageContainer);
            });
        };
        TableBoundsVisibleInfoHelper.prototype.setElementsFromPageArea = function (layoutPageArea, container) {
            for (var _i = 0, _a = layoutPageArea.columns; _i < _a.length; _i++) {
                var column = _a[_i];
                for (var _b = 0, _c = column.tablesInfo; _b < _c.length; _b++) {
                    var tbl = _c[_b];
                    var tblColumnElem = container.appendChild(this.createElement("dxreDebugTableColumnBound", tbl.rectangle.applyOffset(new __aspxRichEdit.Point(layoutPageArea.x + column.x, layoutPageArea.y + column.y))
                        .applyRightInternalOffset(2).applyBottomInternalOffset(2), "" + tbl.logicInfo.grid.table.index));
                    for (var _d = 0, _e = tbl.tableRows; _d < _e.length; _d++) {
                        var row = _e[_d];
                        var rowElem = tblColumnElem.appendChild(this.createElement("dxreDebugTableRowBound", row.rectangle.applyOffset(new __aspxRichEdit.Point(-tbl.x, -tbl.y)).applyRightInternalOffset(2).applyBottomInternalOffset(2), "" + row.rowIndex));
                        for (var _f = 0, _g = row.rowCells; _f < _g.length; _f++) {
                            var cell = _g[_f];
                            rowElem.appendChild(this.createElement("dxreDebugTableCellBound", cell.rectangle.applyOffset(new __aspxRichEdit.Point(-row.x, -row.y)).applyRightInternalOffset(2).applyBottomInternalOffset(2), "" + cell.cellGridIndex));
                        }
                    }
                }
            }
        };
        return TableBoundsVisibleInfoHelper;
    }(DebugBaseVisualizer));
    __aspxRichEdit.TableBoundsVisibleInfoHelper = TableBoundsVisibleInfoHelper;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var WordGroupMask;
    (function (WordGroupMask) {
        WordGroupMask[WordGroupMask["NoOne"] = 0] = "NoOne";
        WordGroupMask[WordGroupMask["Space"] = 1] = "Space";
        WordGroupMask[WordGroupMask["LeftSingleQuote"] = 2] = "LeftSingleQuote";
        WordGroupMask[WordGroupMask["RightSingleQuote"] = 4] = "RightSingleQuote";
        WordGroupMask[WordGroupMask["LeftDoubleQuote"] = 8] = "LeftDoubleQuote";
        WordGroupMask[WordGroupMask["RightDoubleQuote"] = 16] = "RightDoubleQuote";
        WordGroupMask[WordGroupMask["DoubleQuote"] = 32] = "DoubleQuote";
        WordGroupMask[WordGroupMask["PunctuationMark"] = 64] = "PunctuationMark";
        WordGroupMask[WordGroupMask["DiffersFromAll"] = 128] = "DiffersFromAll";
        WordGroupMask[WordGroupMask["Others"] = 256] = "Others";
    })(WordGroupMask = __aspxRichEdit.WordGroupMask || (__aspxRichEdit.WordGroupMask = {}));
    var LayoutWordBounds = (function () {
        function LayoutWordBounds(groupSeparator) {
            this.prevSymbolStartPos = -1;
            this.groupSeparator = groupSeparator;
        }
        LayoutWordBounds.getLayoutWordStartBound = function (layout, subDocument, selection, startPosition) {
            return new LayoutStartWordBound().getBound(new __aspxRichEdit.LayoutWordStartBoundsIterator(layout, subDocument, selection, startPosition));
        };
        LayoutWordBounds.getLayoutWordEndBound = function (layout, subDocument, selection, startPosition, isJoinSpacesOnEndWord) {
            return new LayoutEndWordBound(isJoinSpacesOnEndWord).getBound(new __aspxRichEdit.LayoutWordEndBoundsIterator(layout, subDocument, selection, startPosition));
        };
        LayoutWordBounds.prototype.getBound = function (iterator) {
            this.iterator = iterator;
            if (!this.iterator.isSet())
                return this.iterator.startResultPosition;
            while (this.iterator.getNextSymbolGroup()) {
                if (this.groupSeparator.applyMask(this.iterator.groupMask))
                    return this.getFinalPosition(true);
                this.prevSymbolStartPos = this.iterator.currSymbolStartPosition();
            }
            return this.getFinalPosition(false);
        };
        return LayoutWordBounds;
    }());
    __aspxRichEdit.LayoutWordBounds = LayoutWordBounds;
    var LayoutEndWordBound = (function (_super) {
        __extends(LayoutEndWordBound, _super);
        function LayoutEndWordBound(isJoinSpacesOnEndWord) {
            return _super.call(this, new __aspxRichEdit.LayoutWordBoundsNextGroupSeparator(isJoinSpacesOnEndWord)) || this;
        }
        LayoutEndWordBound.prototype.getFinalPosition = function (byGroupDiffers) {
            return this.prevSymbolStartPos + (byGroupDiffers ? 1 : 0);
        };
        return LayoutEndWordBound;
    }(LayoutWordBounds));
    __aspxRichEdit.LayoutEndWordBound = LayoutEndWordBound;
    var LayoutStartWordBound = (function (_super) {
        __extends(LayoutStartWordBound, _super);
        function LayoutStartWordBound() {
            return _super.call(this, new __aspxRichEdit.LayoutWordBoundsPrevGroupSeparator()) || this;
        }
        LayoutStartWordBound.prototype.getFinalPosition = function (_byGroupDiffers) {
            return this.iterator.currSymbolStartPosition() + 1;
        };
        return LayoutStartWordBound;
    }(LayoutWordBounds));
    __aspxRichEdit.LayoutStartWordBound = LayoutStartWordBound;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutWordBoundsGroupSeparator = (function () {
        function LayoutWordBoundsGroupSeparator() {
            this.isAnyGroupSet = false;
        }
        LayoutWordBoundsGroupSeparator.prototype.applyMask = function (mask) {
            if (!this.isAnyGroupSet) {
                this.isAnyGroupSet = true;
                this.whileNoOneGroupSet(mask);
                return false;
            }
            if (mask == this.ignoredGroupMask)
                return false;
            this.ignoredGroupMask = __aspxRichEdit.WordGroupMask.NoOne;
            if (this.mask.get(__aspxRichEdit.WordGroupMask.DiffersFromAll))
                return true;
            this.mask.set(mask, true);
            if (this.prevMask && this.prevMask.getValue() != this.mask.getValue())
                return true;
            this.prevMask = this.mask.clone();
            return false;
        };
        return LayoutWordBoundsGroupSeparator;
    }());
    __aspxRichEdit.LayoutWordBoundsGroupSeparator = LayoutWordBoundsGroupSeparator;
    var LayoutWordBoundsNextGroupSeparator = (function (_super) {
        __extends(LayoutWordBoundsNextGroupSeparator, _super);
        function LayoutWordBoundsNextGroupSeparator(isJoinSpacesOnEndWord) {
            var _this = _super.call(this) || this;
            _this.initGroup = isJoinSpacesOnEndWord ? __aspxRichEdit.WordGroupMask.Space : __aspxRichEdit.WordGroupMask.NoOne;
            return _this;
        }
        LayoutWordBoundsNextGroupSeparator.prototype.whileNoOneGroupSet = function (mask) {
            if (mask == __aspxRichEdit.WordGroupMask.DiffersFromAll) {
                this.mask = new __aspxRichEdit.Flag(mask);
                return;
            }
            this.ignoredGroupMask = mask;
            this.prevMask = new __aspxRichEdit.Flag(this.initGroup);
            this.mask = new __aspxRichEdit.Flag(this.initGroup);
        };
        return LayoutWordBoundsNextGroupSeparator;
    }(LayoutWordBoundsGroupSeparator));
    __aspxRichEdit.LayoutWordBoundsNextGroupSeparator = LayoutWordBoundsNextGroupSeparator;
    var LayoutWordBoundsPrevGroupSeparator = (function (_super) {
        __extends(LayoutWordBoundsPrevGroupSeparator, _super);
        function LayoutWordBoundsPrevGroupSeparator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutWordBoundsPrevGroupSeparator.prototype.whileNoOneGroupSet = function (mask) {
            if (mask == __aspxRichEdit.WordGroupMask.Space) {
                this.ignoredGroupMask = __aspxRichEdit.WordGroupMask.Space;
                this.mask = new __aspxRichEdit.Flag(__aspxRichEdit.WordGroupMask.NoOne);
                this.prevMask = null;
            }
            else {
                this.mask = new __aspxRichEdit.Flag(mask);
                this.prevMask = this.mask.clone();
            }
        };
        return LayoutWordBoundsPrevGroupSeparator;
    }(LayoutWordBoundsGroupSeparator));
    __aspxRichEdit.LayoutWordBoundsPrevGroupSeparator = LayoutWordBoundsPrevGroupSeparator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AnchorListener = (function (_super) {
        __extends(AnchorListener, _super);
        function AnchorListener() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        AnchorListener.prototype.baseFrameClassName = function () {
            return __aspxRichEdit.DocumentRenderer.CLASSNAMES.ANCHOR;
        };
        return AnchorListener;
    }(__aspxRichEdit.FrameBaseListener));
    __aspxRichEdit.AnchorListener = AnchorListener;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AutoScrollListener = (function () {
        function AutoScrollListener(serviceContainer) {
            this.serviceContainer = serviceContainer;
            this.baseFrame = __aspxRichEdit.DocumentRenderer.renderContainer(__aspxRichEdit.DocumentRenderer.CLASSNAMES.AUTO_SCROLL);
            this.top = __aspxRichEdit.DocumentRenderer.renderContainer(__aspxRichEdit.DocumentRenderer.CLASSNAMES.AUTO_SCROLL_CURSOR);
            this.center = __aspxRichEdit.DocumentRenderer.renderContainer(__aspxRichEdit.DocumentRenderer.CLASSNAMES.AUTO_SCROLL_CURSOR);
            this.bottom = __aspxRichEdit.DocumentRenderer.renderContainer(__aspxRichEdit.DocumentRenderer.CLASSNAMES.AUTO_SCROLL_CURSOR);
            REWebUtils.AddClassNameToElement(this.top, __aspxRichEdit.DocumentRenderer.CLASSNAMES.AUTO_SCROLL_CURSOR_N);
            REWebUtils.AddClassNameToElement(this.center, __aspxRichEdit.DocumentRenderer.CLASSNAMES.AUTO_SCROLL_CURSOR_NS);
            REWebUtils.AddClassNameToElement(this.bottom, __aspxRichEdit.DocumentRenderer.CLASSNAMES.AUTO_SCROLL_CURSOR_S);
        }
        AutoScrollListener.prototype.NotifyHide = function () {
            __aspxRichEdit.HTMLUtils.hideNode(this.baseFrame);
            __aspxRichEdit.HTMLUtils.hideNode(this.top);
            __aspxRichEdit.HTMLUtils.hideNode(this.center);
            __aspxRichEdit.HTMLUtils.hideNode(this.bottom);
        };
        AutoScrollListener.prototype.NotifyShow = function (_pageIndex, bounds, _tip, _isTextBox, _isAnchoredObject, _rotation) {
            __aspxRichEdit.HTMLUtils.setStyleSizeAndPosition(this.baseFrame.style, bounds);
            this.top.style.top = "0px";
            this.top.style.height = bounds.y + "px";
            this.center.style.top = bounds.y + "px";
            this.center.style.height = bounds.height + "px";
            this.bottom.style.top = bounds.getBottomBoundPosition() + "px";
            this.bottom.style.height = "100%";
            this.serviceContainer.appendChild(this.baseFrame);
            this.serviceContainer.appendChild(this.top);
            this.serviceContainer.appendChild(this.center);
            this.serviceContainer.appendChild(this.bottom);
        };
        AutoScrollListener.HALF_SIZE = 10;
        return AutoScrollListener;
    }());
    __aspxRichEdit.AutoScrollListener = AutoScrollListener;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DragCaretListener = (function (_super) {
        __extends(DragCaretListener, _super);
        function DragCaretListener() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DragCaretListener.prototype.baseFrameClassName = function () {
            return __aspxRichEdit.DocumentRenderer.CLASSNAMES.DRAG_CARET;
        };
        DragCaretListener.CARET_WIDTH = 1;
        return DragCaretListener;
    }(__aspxRichEdit.FrameBaseListener));
    __aspxRichEdit.DragCaretListener = DragCaretListener;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FullTableSelectorListener = (function (_super) {
        __extends(FullTableSelectorListener, _super);
        function FullTableSelectorListener() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FullTableSelectorListener.prototype.baseFrameClassName = function () {
            return __aspxRichEdit.DocumentRenderer.CLASSNAMES.FULL_TABLE_SELECTOR;
        };
        return FullTableSelectorListener;
    }(__aspxRichEdit.FrameBaseListener));
    __aspxRichEdit.FullTableSelectorListener = FullTableSelectorListener;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ResizeBoxListener = (function (_super) {
        __extends(ResizeBoxListener, _super);
        function ResizeBoxListener(rendererCache) {
            var _this = _super.call(this, rendererCache) || this;
            var cornerPrefix = ResizeBoxListener.getCornerPrefix();
            __aspxRichEdit.ListUtils.foreach(ResizeBoxListener.cornerLinesInfo, function (info) {
                var lineElem = __aspxRichEdit.DocumentRenderer.renderContainer(__aspxRichEdit.FrameBaseListener.CLASSNAMES.CORNER_LINE_PREFIX + info[0]);
                _this.baseFrame.appendChild(lineElem);
                __aspxRichEdit.ListUtils.foreach(info, function (direction) {
                    lineElem.appendChild(__aspxRichEdit.DocumentRenderer.renderContainer(cornerPrefix + direction));
                }, 1);
            });
            _this.baseFrame.appendChild(__aspxRichEdit.DocumentRenderer.renderContainer(__aspxRichEdit.FrameBaseListener.CLASSNAMES.ROTATION_BOX));
            _this.baseFrame.appendChild(__aspxRichEdit.DocumentRenderer.renderContainer(__aspxRichEdit.FrameBaseListener.CLASSNAMES.ROTATION_LINE));
            return _this;
        }
        ResizeBoxListener.prototype.baseFrameClassName = function () {
            return __aspxRichEdit.FrameBaseListener.CLASSNAMES.CONTAINER;
        };
        ResizeBoxListener.getCornerPrefix = function () {
            return __aspxRichEdit.FrameBaseListener.CLASSNAMES.CORNER_ELEM_PREFIX +
                (REWebUtils.Browser.TouchUI ? __aspxRichEdit.FrameBaseListener.CLASSNAMES.CORNER_TOUCH_POSTFIX : "");
        };
        ResizeBoxListener.cornerLinesInfo = [
            ["W", "W"],
            ["E", "E"],
            ["N", "NW", "N", "NE"],
            ["S", "SW", "S", "SE"]
        ];
        ResizeBoxListener.directionToSource = {
            "NW": __aspxRichEdit.MouseEventSource.ResizeBox_NW,
            "NE": __aspxRichEdit.MouseEventSource.ResizeBox_NE,
            "SE": __aspxRichEdit.MouseEventSource.ResizeBox_SE,
            "SW": __aspxRichEdit.MouseEventSource.ResizeBox_SW,
            "N": __aspxRichEdit.MouseEventSource.ResizeBox_N,
            "E": __aspxRichEdit.MouseEventSource.ResizeBox_E,
            "S": __aspxRichEdit.MouseEventSource.ResizeBox_S,
            "W": __aspxRichEdit.MouseEventSource.ResizeBox_W
        };
        return ResizeBoxListener;
    }(__aspxRichEdit.FrameBaseListener));
    __aspxRichEdit.ResizeBoxListener = ResizeBoxListener;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ResizeTableListener = (function (_super) {
        __extends(ResizeTableListener, _super);
        function ResizeTableListener() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ResizeTableListener.prototype.baseFrameClassName = function () {
            return __aspxRichEdit.DocumentRenderer.CLASSNAMES.TABLE_BORDER_LINE;
        };
        return ResizeTableListener;
    }(__aspxRichEdit.FrameBaseListener));
    __aspxRichEdit.ResizeTableListener = ResizeTableListener;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var zIndexCssClassType;
    (function (zIndexCssClassType) {
        zIndexCssClassType[zIndexCssClassType["TextBoxBg"] = 0] = "TextBoxBg";
        zIndexCssClassType[zIndexCssClassType["TblRowBg"] = 1] = "TblRowBg";
        zIndexCssClassType[zIndexCssClassType["TblCellBg"] = 2] = "TblCellBg";
        zIndexCssClassType[zIndexCssClassType["ParBg"] = 3] = "ParBg";
        zIndexCssClassType[zIndexCssClassType["BoxBg"] = 4] = "BoxBg";
        zIndexCssClassType[zIndexCssClassType["FieldBg"] = 5] = "FieldBg";
        zIndexCssClassType[zIndexCssClassType["SelRange"] = 6] = "SelRange";
        zIndexCssClassType[zIndexCssClassType["BoxSpace"] = 7] = "BoxSpace";
        zIndexCssClassType[zIndexCssClassType["SelSearch"] = 8] = "SelSearch";
        zIndexCssClassType[zIndexCssClassType["SelRow"] = 9] = "SelRow";
        zIndexCssClassType[zIndexCssClassType["Box"] = 10] = "Box";
        zIndexCssClassType[zIndexCssClassType["Bookmark"] = 11] = "Bookmark";
        zIndexCssClassType[zIndexCssClassType["TableBorder"] = 12] = "TableBorder";
        zIndexCssClassType[zIndexCssClassType["SelMissp"] = 13] = "SelMissp";
        zIndexCssClassType[zIndexCssClassType["SelCursor"] = 14] = "SelCursor";
        zIndexCssClassType[zIndexCssClassType["SelTouchBar"] = 15] = "SelTouchBar";
        zIndexCssClassType[zIndexCssClassType["TblCursor"] = 16] = "TblCursor";
        zIndexCssClassType[zIndexCssClassType["AnchoredPicture"] = 17] = "AnchoredPicture";
        zIndexCssClassType[zIndexCssClassType["TextBox"] = 18] = "TextBox";
    })(zIndexCssClassType = __aspxRichEdit.zIndexCssClassType || (__aspxRichEdit.zIndexCssClassType = {}));
    var ZIndexHelper = (function () {
        function ZIndexHelper() {
        }
        ZIndexHelper.getClassName = function (level, zIndexCssNames) {
            return "dxre" + ZIndexHelper.names[zIndexCssNames] + "ZL" + (__aspxRichEdit.Utils.restrictValue(level, -ZIndexHelper.maxLevel, ZIndexHelper.maxLevel) + ZIndexHelper.maxLevel);
        };
        ZIndexHelper.mainHeaderFooterPageAreaLevel = 0;
        ZIndexHelper.maxLevel = 4;
        ZIndexHelper.names = new __aspxRichEdit.MapCreatorNumberAsKey()
            .add(zIndexCssClassType.TextBoxBg, "TextBoxBg")
            .add(zIndexCssClassType.TblRowBg, "TblRowBg")
            .add(zIndexCssClassType.TblCellBg, "TblCellBg")
            .add(zIndexCssClassType.ParBg, "ParBg")
            .add(zIndexCssClassType.BoxBg, "BoxBg")
            .add(zIndexCssClassType.FieldBg, "FieldBg")
            .add(zIndexCssClassType.SelRange, "SelRange")
            .add(zIndexCssClassType.BoxSpace, "BoxSpace")
            .add(zIndexCssClassType.SelSearch, "SelSearch")
            .add(zIndexCssClassType.SelRow, "SelRow")
            .add(zIndexCssClassType.Box, "Box")
            .add(zIndexCssClassType.Bookmark, "Bookmark")
            .add(zIndexCssClassType.TableBorder, "TableBorder")
            .add(zIndexCssClassType.SelMissp, "SelMissp")
            .add(zIndexCssClassType.SelCursor, "SelCursor")
            .add(zIndexCssClassType.SelTouchBar, "SelTouchBar")
            .add(zIndexCssClassType.TblCursor, "TblCursor")
            .add(zIndexCssClassType.AnchoredPicture, "AnchoredPicture")
            .add(zIndexCssClassType.TextBox, "TextBox")
            .get();
        return ZIndexHelper;
    }());
    __aspxRichEdit.ZIndexHelper = ZIndexHelper;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeFontHighlightColorCommand = (function (_super) {
        __extends(ChangeFontHighlightColorCommand, _super);
        function ChangeFontHighlightColorCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeFontHighlightColorCommand.prototype.getDescriptor = function () {
            return __aspxRichEdit.CharacterPropertyDescriptor.highlightColor;
        };
        ChangeFontHighlightColorCommand.prototype.getValueForState = function (val) {
            return val ? val.toRgb(this.control.model.colorProvider) : undefined;
        };
        ChangeFontHighlightColorCommand.prototype.isLockUpdateValue = function () {
            return true;
        };
        ChangeFontHighlightColorCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return __aspxRichEdit.ColorModelInfo.makeByColor(__aspxRichEdit.ColorHelper.anyToColor(parameter, __aspxRichEdit.ColorHelper.NO_COLOR));
        };
        return ChangeFontHighlightColorCommand;
    }(__aspxRichEdit.ChangeCharacterPropertiesCommandBase));
    __aspxRichEdit.ChangeFontHighlightColorCommand = ChangeFontHighlightColorCommand;
    var ChangeFontShadingInfoCommand = (function (_super) {
        __extends(ChangeFontShadingInfoCommand, _super);
        function ChangeFontShadingInfoCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeFontShadingInfoCommand.prototype.getDescriptor = function () {
            return __aspxRichEdit.CharacterPropertyDescriptor.shadingInfo;
        };
        ChangeFontShadingInfoCommand.prototype.getValueForState = function (val) {
            return val ? val.getActualColor(this.colorProvider) : undefined;
        };
        ChangeFontShadingInfoCommand.prototype.isLockUpdateValue = function () {
            return true;
        };
        ChangeFontShadingInfoCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return __aspxRichEdit.ShadingInfo.createByColor(__aspxRichEdit.ColorModelInfo.makeByColor(__aspxRichEdit.ColorHelper.anyToColor(parameter, __aspxRichEdit.ColorHelper.NO_COLOR)));
        };
        return ChangeFontShadingInfoCommand;
    }(__aspxRichEdit.ChangeCharacterPropertiesCommandBase));
    __aspxRichEdit.ChangeFontShadingInfoCommand = ChangeFontShadingInfoCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeFontColorCommand = (function (_super) {
        __extends(ChangeFontColorCommand, _super);
        function ChangeFontColorCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeFontColorCommand.prototype.getDescriptor = function () {
            return __aspxRichEdit.CharacterPropertyDescriptor.textColor;
        };
        ChangeFontColorCommand.prototype.getValueForState = function (val) {
            return val ? val.toRgb(this.control.model.colorProvider) : undefined;
        };
        ChangeFontColorCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return __aspxRichEdit.ColorModelInfo.makeByColor(__aspxRichEdit.ColorHelper.anyToColor(parameter, __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR));
        };
        ChangeFontColorCommand.prototype.isLockUpdateValue = function () {
            return true;
        };
        return ChangeFontColorCommand;
    }(__aspxRichEdit.ChangeCharacterPropertiesCommandBase));
    __aspxRichEdit.ChangeFontColorCommand = ChangeFontColorCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeFontNameCommand = (function (_super) {
        __extends(ChangeFontNameCommand, _super);
        function ChangeFontNameCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeFontNameCommand.prototype.getDescriptor = function () {
            return __aspxRichEdit.CharacterPropertyDescriptor.fontInfo;
        };
        ChangeFontNameCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            if (__aspxRichEdit.Utils.isNumber(parameter))
                return this.control.model.cache.fontInfoCache.getItemByJsonKey(parameter);
            else if (typeof parameter == "string") {
                var fontInfo = this.control.model.cache.fontInfoCache.getItemByName(parameter);
                if (!fontInfo) {
                    var mergedCharacterProperties = this.control.inputPosition.getMergedCharacterPropertiesFull();
                    if (mergedCharacterProperties.fontInfo) {
                        fontInfo = mergedCharacterProperties.fontInfo.clone();
                        fontInfo.name = parameter;
                        fontInfo.cssString = parameter.match(/^\w+\s/gi) ? "'" + parameter + "'" : parameter;
                        this.control.modelManipulator.text.loadFontInfo(fontInfo, this.control.model.activeSubDocument, this.control.selection.intervals);
                        return fontInfo;
                    }
                }
                if (fontInfo)
                    return fontInfo;
            }
            return this.getCurrentValue();
        };
        return ChangeFontNameCommand;
    }(__aspxRichEdit.ChangeCharacterPropertiesCommandBase));
    __aspxRichEdit.ChangeFontNameCommand = ChangeFontNameCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeFontSizeCommand = (function (_super) {
        __extends(ChangeFontSizeCommand, _super);
        function ChangeFontSizeCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeFontSizeCommand.prototype.getDescriptor = function () {
            return __aspxRichEdit.CharacterPropertyDescriptor.size;
        };
        ChangeFontSizeCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            var res = typeof parameter == "string" ? parseFloat(parameter) : parameter;
            return this.isFontSizeValueCorrect(res) ? res : this.getCurrentValue();
        };
        ChangeFontSizeCommand.prototype.isFontSizeValueCorrect = function (size) {
            if (__aspxRichEdit.Utils.isNumber(size) && !isNaN(size) && size >= __aspxRichEdit.RichUtils.minFontSize && size <= __aspxRichEdit.RichUtils.maxFontSize) {
                var decimal = size % 1;
                if (decimal === 0 || decimal === 0.5)
                    return true;
            }
            return false;
        };
        return ChangeFontSizeCommand;
    }(__aspxRichEdit.ChangeCharacterPropertiesCommandBase));
    __aspxRichEdit.ChangeFontSizeCommand = ChangeFontSizeCommand;
    var StepFontSizeCommand = (function (_super) {
        __extends(StepFontSizeCommand, _super);
        function StepFontSizeCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        StepFontSizeCommand.prototype.executeCore = function (_state, options) {
            var desc = this.getDescriptor();
            var modelIter = new __aspxRichEdit.ModelIterator(options.subDocument, false);
            var collector = new __aspxRichEdit.SparseIntervalsMapCollector(__aspxRichEdit.CompareUtils.numberCmpFunc, new __aspxRichEdit.FixedInterval(0, 0));
            for (var _i = 0, _a = this.getApplyToIntervals(options); _i < _a.length; _i++) {
                var interval = _a[_i];
                var endPos = interval.end;
                modelIter.setPosition(interval.start);
                do {
                    var currPos = modelIter.getAbsolutePosition();
                    if (currPos >= endPos)
                        break;
                    collector.add(currPos, modelIter.run.getCharacterMergedProperies().fontSize);
                } while (modelIter.moveToNextChar());
            }
            this.control.inputPosition.reset();
            var history = this.control.history;
            history.beginTransaction();
            var intervalIter = collector.getIterator();
            while (intervalIter.moveToNextInterval())
                history.addAndRedo(new (desc.getHistoryItemConstructor())(this.control.modelManipulator, options.subDocument, intervalIter.interval, this.step(intervalIter.object), true));
            history.endTransaction();
            return true;
        };
        return StepFontSizeCommand;
    }(ChangeFontSizeCommand));
    __aspxRichEdit.StepFontSizeCommand = StepFontSizeCommand;
    var DecreaseFontSizeCommand = (function (_super) {
        __extends(DecreaseFontSizeCommand, _super);
        function DecreaseFontSizeCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DecreaseFontSizeCommand.prototype.step = function (currValue) {
            return __aspxRichEdit.RichUtils.getPreviousPredefinedFontSize(currValue);
        };
        return DecreaseFontSizeCommand;
    }(StepFontSizeCommand));
    __aspxRichEdit.DecreaseFontSizeCommand = DecreaseFontSizeCommand;
    var IncreaseFontSizeCommand = (function (_super) {
        __extends(IncreaseFontSizeCommand, _super);
        function IncreaseFontSizeCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        IncreaseFontSizeCommand.prototype.step = function (currValue) {
            return __aspxRichEdit.RichUtils.getNextPredefinedFontSize(currValue);
        };
        return IncreaseFontSizeCommand;
    }(StepFontSizeCommand));
    __aspxRichEdit.IncreaseFontSizeCommand = IncreaseFontSizeCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ToggleFontBoldCommand = (function (_super) {
        __extends(ToggleFontBoldCommand, _super);
        function ToggleFontBoldCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleFontBoldCommand.prototype.getDescriptor = function () {
            return __aspxRichEdit.CharacterPropertyDescriptor.bold;
        };
        ToggleFontBoldCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return this.convertBooleanParameterToEnumType(parameter, true, false);
        };
        return ToggleFontBoldCommand;
    }(__aspxRichEdit.ChangeCharacterPropertiesCommandBase));
    __aspxRichEdit.ToggleFontBoldCommand = ToggleFontBoldCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ToggleFontItalicCommand = (function (_super) {
        __extends(ToggleFontItalicCommand, _super);
        function ToggleFontItalicCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleFontItalicCommand.prototype.getDescriptor = function () {
            return __aspxRichEdit.CharacterPropertyDescriptor.italic;
        };
        ToggleFontItalicCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return this.convertBooleanParameterToEnumType(parameter, true, false);
        };
        return ToggleFontItalicCommand;
    }(__aspxRichEdit.ChangeCharacterPropertiesCommandBase));
    __aspxRichEdit.ToggleFontItalicCommand = ToggleFontItalicCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeFontScriptCommand = (function (_super) {
        __extends(ChangeFontScriptCommand, _super);
        function ChangeFontScriptCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeFontScriptCommand.prototype.getDescriptor = function () {
            return __aspxRichEdit.CharacterPropertyDescriptor.script;
        };
        return ChangeFontScriptCommand;
    }(__aspxRichEdit.ChangeCharacterPropertiesCommandBase));
    __aspxRichEdit.ChangeFontScriptCommand = ChangeFontScriptCommand;
    var ToggleFontSubscriptCommand = (function (_super) {
        __extends(ToggleFontSubscriptCommand, _super);
        function ToggleFontSubscriptCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleFontSubscriptCommand.prototype.getDescriptor = function () {
            return __aspxRichEdit.CharacterPropertyDescriptor.script;
        };
        ToggleFontSubscriptCommand.prototype.getValueForState = function (val) {
            return val == __aspxRichEdit.CharacterFormattingScript.Subscript;
        };
        ToggleFontSubscriptCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return this.convertBooleanParameterToEnumType(parameter, __aspxRichEdit.CharacterFormattingScript.Subscript, __aspxRichEdit.CharacterFormattingScript.Normal);
        };
        return ToggleFontSubscriptCommand;
    }(__aspxRichEdit.ChangeCharacterPropertiesCommandBase));
    __aspxRichEdit.ToggleFontSubscriptCommand = ToggleFontSubscriptCommand;
    var ToggleFontSuperscriptCommand = (function (_super) {
        __extends(ToggleFontSuperscriptCommand, _super);
        function ToggleFontSuperscriptCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleFontSuperscriptCommand.prototype.getDescriptor = function () {
            return __aspxRichEdit.CharacterPropertyDescriptor.script;
        };
        ToggleFontSuperscriptCommand.prototype.getValueForState = function (val) {
            return val == __aspxRichEdit.CharacterFormattingScript.Superscript;
        };
        ToggleFontSuperscriptCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return this.convertBooleanParameterToEnumType(parameter, __aspxRichEdit.CharacterFormattingScript.Superscript, __aspxRichEdit.CharacterFormattingScript.Normal);
        };
        return ToggleFontSuperscriptCommand;
    }(__aspxRichEdit.ChangeCharacterPropertiesCommandBase));
    __aspxRichEdit.ToggleFontSuperscriptCommand = ToggleFontSuperscriptCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ToggleFontStrikeoutCommand = (function (_super) {
        __extends(ToggleFontStrikeoutCommand, _super);
        function ToggleFontStrikeoutCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleFontStrikeoutCommand.prototype.getDescriptor = function () {
            return __aspxRichEdit.CharacterPropertyDescriptor.strikeoutType;
        };
        ToggleFontStrikeoutCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return this.convertBooleanParameterToEnumType(parameter, __aspxRichEdit.StrikeoutType.Single, __aspxRichEdit.StrikeoutType.None);
        };
        return ToggleFontStrikeoutCommand;
    }(__aspxRichEdit.ChangeCharacterPropertiesCommandBase));
    __aspxRichEdit.ToggleFontStrikeoutCommand = ToggleFontStrikeoutCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeFontUnderlineCommand = (function (_super) {
        __extends(ChangeFontUnderlineCommand, _super);
        function ChangeFontUnderlineCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeFontUnderlineCommand.prototype.getDescriptor = function () {
            return __aspxRichEdit.CharacterPropertyDescriptor.underlineType;
        };
        return ChangeFontUnderlineCommand;
    }(__aspxRichEdit.ChangeCharacterPropertiesCommandBase));
    __aspxRichEdit.ChangeFontUnderlineCommand = ChangeFontUnderlineCommand;
    var ToggleFontSingleUnderlineCommand = (function (_super) {
        __extends(ToggleFontSingleUnderlineCommand, _super);
        function ToggleFontSingleUnderlineCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleFontSingleUnderlineCommand.prototype.getActualValue = function (_parameter, currentValue) {
            return currentValue ? __aspxRichEdit.UnderlineType.None : __aspxRichEdit.UnderlineType.Single;
        };
        ToggleFontSingleUnderlineCommand.prototype.getValueForState = function (val) {
            return val == __aspxRichEdit.UnderlineType.Single;
        };
        ToggleFontSingleUnderlineCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return this.convertBooleanParameterToEnumType(parameter, __aspxRichEdit.UnderlineType.Single, __aspxRichEdit.UnderlineType.None);
        };
        return ToggleFontSingleUnderlineCommand;
    }(ChangeFontUnderlineCommand));
    __aspxRichEdit.ToggleFontSingleUnderlineCommand = ToggleFontSingleUnderlineCommand;
    var ToggleFontDoubleUnderlineCommand = (function (_super) {
        __extends(ToggleFontDoubleUnderlineCommand, _super);
        function ToggleFontDoubleUnderlineCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleFontDoubleUnderlineCommand.prototype.getActualValue = function (_parameter, currentValue) {
            return currentValue ? __aspxRichEdit.UnderlineType.None : __aspxRichEdit.UnderlineType.Double;
        };
        ToggleFontDoubleUnderlineCommand.prototype.getValueForState = function (val) {
            return val == __aspxRichEdit.UnderlineType.Double;
        };
        ToggleFontDoubleUnderlineCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return this.convertBooleanParameterToEnumType(parameter, __aspxRichEdit.UnderlineType.Double, __aspxRichEdit.UnderlineType.None);
        };
        return ToggleFontDoubleUnderlineCommand;
    }(ChangeFontUnderlineCommand));
    __aspxRichEdit.ToggleFontDoubleUnderlineCommand = ToggleFontDoubleUnderlineCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ForceSyncWithServerCommand = (function (_super) {
        __extends(ForceSyncWithServerCommand, _super);
        function ForceSyncWithServerCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ForceSyncWithServerCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(_super.prototype.isEnabled.call(this));
        };
        ForceSyncWithServerCommand.prototype.canModify = function () {
            return true;
        };
        ForceSyncWithServerCommand.prototype.executeCore = function (_state, options) {
            this.control.model.forceSyncWithServerCallbackManager.addCallback(this.control, options.param);
            return true;
        };
        return ForceSyncWithServerCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ForceSyncWithServerCommand = ForceSyncWithServerCommand;
    var ForceSyncWithServerCallbackManager = (function () {
        function ForceSyncWithServerCallbackManager() {
            this.reset();
        }
        ForceSyncWithServerCallbackManager.prototype.reset = function () {
            this.map = {};
        };
        ForceSyncWithServerCallbackManager.prototype.addCallback = function (control, callback) {
            var id = ForceSyncWithServerCallbackManager.id++;
            var request = new __aspxRichEdit.LoadCommandRequest(__aspxRichEdit.CommandType.ForceSyncWithServer, control.model.mainSubDocument.id, new __aspxRichEdit.MapCreatorNumberAsKey().add(__aspxRichEdit.JSONForceSyncWithServerCommand.Id, id).get());
            control.serverDispatcher.pushRequest(request, new __aspxRichEdit.RequestParams(false, true, true));
            this.map[id] = callback;
        };
        ForceSyncWithServerCallbackManager.prototype.handleResponce = function (responce) {
            var id = responce[__aspxRichEdit.JSONForceSyncWithServerCommand.Id];
            var callback = this.map[id];
            if (callback) {
                delete this.map[id];
                callback();
            }
        };
        ForceSyncWithServerCallbackManager.id = 0;
        return ForceSyncWithServerCallbackManager;
    }());
    __aspxRichEdit.ForceSyncWithServerCallbackManager = ForceSyncWithServerCallbackManager;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertContentFromServerCommand = (function (_super) {
        __extends(InsertContentFromServerCommand, _super);
        function InsertContentFromServerCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertContentFromServerCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(_super.prototype.isEnabled.call(this));
        };
        InsertContentFromServerCommand.prototype.executeCore = function (_state, options) {
            options.subDocument.documentModel.insertContentFromServerRequestManager.addCallback(this.control, options.param, options.intervals[0].start, options.subDocument);
            return true;
        };
        return InsertContentFromServerCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.InsertContentFromServerCommand = InsertContentFromServerCommand;
    var Data = (function () {
        function Data(position, subDocument) {
            this.position = position;
            this.subDocument = subDocument;
        }
        return Data;
    }());
    var InsertContentFromServerRequestManager = (function () {
        function InsertContentFromServerRequestManager() {
            this.reset();
        }
        InsertContentFromServerRequestManager.prototype.reset = function () {
            this.map = {};
        };
        InsertContentFromServerRequestManager.prototype.addCallback = function (control, requestId, position, subDocument) {
            var id = InsertContentFromServerRequestManager.id++;
            var request = new __aspxRichEdit.LoadCommandRequest(__aspxRichEdit.CommandType.InsertContentFromServer, control.model.mainSubDocument.id, new __aspxRichEdit.MapCreatorNumberAsKey()
                .add(__aspxRichEdit.JSONInsertContentFromServerCommand.Id, id)
                .add(__aspxRichEdit.JSONInsertContentFromServerCommand.UserRequestId, requestId)
                .get());
            control.serverDispatcher.pushRequest(request, new __aspxRichEdit.RequestParams(false, true, true));
            this.map[id] = new Data(position, subDocument);
        };
        InsertContentFromServerRequestManager.prototype.handleResponce = function (control, responce) {
            var id = responce[__aspxRichEdit.JSONInsertContentFromServerCommand.Id];
            var data = this.map[id];
            if (data === undefined)
                return;
            delete this.map[id];
            var userModel = responce[__aspxRichEdit.JSONInsertContentFromServerCommand.Model];
            if (userModel === undefined) {
                var simpleText = responce[__aspxRichEdit.JSONInsertContentFromServerCommand.SimpleText];
                if (__aspxRichEdit.Utils.isString(simpleText) && simpleText.length != 0)
                    control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.InsertText)
                        .execute(control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(control, simpleText)
                        .setSubDocument(data.subDocument)
                        .setIntervals([new __aspxRichEdit.FixedInterval(data.position, 0)]));
            }
            else
                __aspxRichEdit.ServerDispatcherResponseProcessor.insertDocumentModelFromServer(control, userModel, data.position, data.subDocument.id);
        };
        InsertContentFromServerRequestManager.id = 0;
        return InsertContentFromServerRequestManager;
    }());
    __aspxRichEdit.InsertContentFromServerRequestManager = InsertContentFromServerRequestManager;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogAlertMessageCommand = (function (_super) {
        __extends(DialogAlertMessageCommand, _super);
        function DialogAlertMessageCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogAlertMessageCommand.prototype.createParameters = function (_options) {
            var parameters = new AlertMessageDialogParameters();
            parameters.messageTextId = this.getMessageTextId();
            return parameters;
        };
        DialogAlertMessageCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return DialogAlertMessageCommand;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogAlertMessageCommand = DialogAlertMessageCommand;
    var DialogErrorMessageCommand = (function (_super) {
        __extends(DialogErrorMessageCommand, _super);
        function DialogErrorMessageCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogErrorMessageCommand.prototype.getDialogName = function () {
            return "ErrorMessage";
        };
        return DialogErrorMessageCommand;
    }(DialogAlertMessageCommand));
    __aspxRichEdit.DialogErrorMessageCommand = DialogErrorMessageCommand;
    var DialogInformationMessageCommand = (function (_super) {
        __extends(DialogInformationMessageCommand, _super);
        function DialogInformationMessageCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogInformationMessageCommand.prototype.getDialogName = function () {
            return "InformationMessage";
        };
        return DialogInformationMessageCommand;
    }(DialogAlertMessageCommand));
    __aspxRichEdit.DialogInformationMessageCommand = DialogInformationMessageCommand;
    var DialogWarningMessageCommand = (function (_super) {
        __extends(DialogWarningMessageCommand, _super);
        function DialogWarningMessageCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogWarningMessageCommand.prototype.getDialogName = function () {
            return "WarningMessage";
        };
        return DialogWarningMessageCommand;
    }(DialogAlertMessageCommand));
    __aspxRichEdit.DialogWarningMessageCommand = DialogWarningMessageCommand;
    var ShowErrorModelIsChangedMessageCommand = (function (_super) {
        __extends(ShowErrorModelIsChangedMessageCommand, _super);
        function ShowErrorModelIsChangedMessageCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ShowErrorModelIsChangedMessageCommand.prototype.getMessageTextId = function () {
            return AlertMessageText.ModelIsChanged;
        };
        ShowErrorModelIsChangedMessageCommand.prototype.afterClosing = function () {
            this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ReloadDocument).execute(this.control.commandManager.isPublicApiCall);
        };
        return ShowErrorModelIsChangedMessageCommand;
    }(DialogErrorMessageCommand));
    __aspxRichEdit.ShowErrorModelIsChangedMessageCommand = ShowErrorModelIsChangedMessageCommand;
    var ShowErrorSessionHasExpiredMessageCommand = (function (_super) {
        __extends(ShowErrorSessionHasExpiredMessageCommand, _super);
        function ShowErrorSessionHasExpiredMessageCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ShowErrorSessionHasExpiredMessageCommand.prototype.getMessageTextId = function () {
            return AlertMessageText.SessionHasExpired;
        };
        return ShowErrorSessionHasExpiredMessageCommand;
    }(DialogErrorMessageCommand));
    __aspxRichEdit.ShowErrorSessionHasExpiredMessageCommand = ShowErrorSessionHasExpiredMessageCommand;
    var ShowErrorOpeningAndOverstoreImpossibleMessageCommand = (function (_super) {
        __extends(ShowErrorOpeningAndOverstoreImpossibleMessageCommand, _super);
        function ShowErrorOpeningAndOverstoreImpossibleMessageCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ShowErrorOpeningAndOverstoreImpossibleMessageCommand.prototype.getMessageTextId = function () {
            return AlertMessageText.OpeningAndOverstoreImpossible;
        };
        return ShowErrorOpeningAndOverstoreImpossibleMessageCommand;
    }(DialogErrorMessageCommand));
    __aspxRichEdit.ShowErrorOpeningAndOverstoreImpossibleMessageCommand = ShowErrorOpeningAndOverstoreImpossibleMessageCommand;
    var ShowErrorCantSaveToEmptyPathMessageCommand = (function (_super) {
        __extends(ShowErrorCantSaveToEmptyPathMessageCommand, _super);
        function ShowErrorCantSaveToEmptyPathMessageCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ShowErrorCantSaveToEmptyPathMessageCommand.prototype.getMessageTextId = function () {
            return AlertMessageText.CantSaveToEmptyPath;
        };
        return ShowErrorCantSaveToEmptyPathMessageCommand;
    }(DialogErrorMessageCommand));
    __aspxRichEdit.ShowErrorCantSaveToEmptyPathMessageCommand = ShowErrorCantSaveToEmptyPathMessageCommand;
    var ShowWarningClipboardAccessDeniedMessageCommand = (function (_super) {
        __extends(ShowWarningClipboardAccessDeniedMessageCommand, _super);
        function ShowWarningClipboardAccessDeniedMessageCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ShowWarningClipboardAccessDeniedMessageCommand.prototype.getMessageTextId = function () {
            return REWebUtils.Browser.TouchUI ? AlertMessageText.ClipboardAccessDeniedTouch : AlertMessageText.ClipboardAccessDenied;
        };
        return ShowWarningClipboardAccessDeniedMessageCommand;
    }(DialogWarningMessageCommand));
    __aspxRichEdit.ShowWarningClipboardAccessDeniedMessageCommand = ShowWarningClipboardAccessDeniedMessageCommand;
    var ShowErrorInnerExceptionMessageCommand = (function (_super) {
        __extends(ShowErrorInnerExceptionMessageCommand, _super);
        function ShowErrorInnerExceptionMessageCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ShowErrorInnerExceptionMessageCommand.prototype.getMessageTextId = function () {
            return AlertMessageText.InnerException;
        };
        ShowErrorInnerExceptionMessageCommand.prototype.afterClosing = function () {
            this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ReloadDocument).execute(false);
        };
        return ShowErrorInnerExceptionMessageCommand;
    }(DialogErrorMessageCommand));
    __aspxRichEdit.ShowErrorInnerExceptionMessageCommand = ShowErrorInnerExceptionMessageCommand;
    var ShowErrorInvalidDocumentMessageCommand = (function (_super) {
        __extends(ShowErrorInvalidDocumentMessageCommand, _super);
        function ShowErrorInvalidDocumentMessageCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ShowErrorInvalidDocumentMessageCommand.prototype.getMessageTextId = function () {
            return AlertMessageText.InvalidDocumentFormat;
        };
        ShowErrorInvalidDocumentMessageCommand.prototype.lockUIUpdating = function (_prevModifiedState) {
            return true;
        };
        return ShowErrorInvalidDocumentMessageCommand;
    }(DialogErrorMessageCommand));
    __aspxRichEdit.ShowErrorInvalidDocumentMessageCommand = ShowErrorInvalidDocumentMessageCommand;
    var ShowErrorAuthExceptionMessageCommand = (function (_super) {
        __extends(ShowErrorAuthExceptionMessageCommand, _super);
        function ShowErrorAuthExceptionMessageCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ShowErrorAuthExceptionMessageCommand.prototype.getMessageTextId = function () {
            return AlertMessageText.AuthException;
        };
        ShowErrorAuthExceptionMessageCommand.prototype.afterClosing = function () {
            this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ReloadDocument).execute(this.control.commandManager.isPublicApiCall);
        };
        return ShowErrorAuthExceptionMessageCommand;
    }(DialogErrorMessageCommand));
    __aspxRichEdit.ShowErrorAuthExceptionMessageCommand = ShowErrorAuthExceptionMessageCommand;
    var ShowErrorCantOpenDocument = (function (_super) {
        __extends(ShowErrorCantOpenDocument, _super);
        function ShowErrorCantOpenDocument() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ShowErrorCantOpenDocument.prototype.getMessageTextId = function () {
            return AlertMessageText.CantOpenFile;
        };
        ShowErrorCantOpenDocument.prototype.isEnabledInClosedDocument = function () {
            return true;
        };
        return ShowErrorCantOpenDocument;
    }(DialogErrorMessageCommand));
    __aspxRichEdit.ShowErrorCantOpenDocument = ShowErrorCantOpenDocument;
    var ShowErrorCantSaveDocument = (function (_super) {
        __extends(ShowErrorCantSaveDocument, _super);
        function ShowErrorCantSaveDocument() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ShowErrorCantSaveDocument.prototype.getMessageTextId = function () {
            return AlertMessageText.CantSaveFile;
        };
        return ShowErrorCantSaveDocument;
    }(DialogErrorMessageCommand));
    __aspxRichEdit.ShowErrorCantSaveDocument = ShowErrorCantSaveDocument;
    var ShowErrorPathTooLong = (function (_super) {
        __extends(ShowErrorPathTooLong, _super);
        function ShowErrorPathTooLong() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ShowErrorPathTooLong.prototype.getMessageTextId = function () {
            return AlertMessageText.PathTooLongException;
        };
        return ShowErrorPathTooLong;
    }(DialogErrorMessageCommand));
    __aspxRichEdit.ShowErrorPathTooLong = ShowErrorPathTooLong;
    var ShowErrorDocVariableExceptionCommand = (function (_super) {
        __extends(ShowErrorDocVariableExceptionCommand, _super);
        function ShowErrorDocVariableExceptionCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ShowErrorDocVariableExceptionCommand.prototype.getMessageTextId = function () {
            return AlertMessageText.DocVariableException;
        };
        return ShowErrorDocVariableExceptionCommand;
    }(DialogErrorMessageCommand));
    __aspxRichEdit.ShowErrorDocVariableExceptionCommand = ShowErrorDocVariableExceptionCommand;
    var ShowInsertContentFromServerErrorDialogCommand = (function (_super) {
        __extends(ShowInsertContentFromServerErrorDialogCommand, _super);
        function ShowInsertContentFromServerErrorDialogCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ShowInsertContentFromServerErrorDialogCommand.prototype.getMessageTextId = function () {
            return AlertMessageText.InsertContentFromServerException;
        };
        return ShowInsertContentFromServerErrorDialogCommand;
    }(DialogErrorMessageCommand));
    __aspxRichEdit.ShowInsertContentFromServerErrorDialogCommand = ShowInsertContentFromServerErrorDialogCommand;
    var ShowLoadPictureErrorDialogCommand = (function (_super) {
        __extends(ShowLoadPictureErrorDialogCommand, _super);
        function ShowLoadPictureErrorDialogCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ShowLoadPictureErrorDialogCommand.prototype.getMessageTextId = function () {
            return AlertMessageText.LoadPictureError;
        };
        return ShowLoadPictureErrorDialogCommand;
    }(DialogErrorMessageCommand));
    __aspxRichEdit.ShowLoadPictureErrorDialogCommand = ShowLoadPictureErrorDialogCommand;
    var ShowSpellingCheckCompletedCommand = (function (_super) {
        __extends(ShowSpellingCheckCompletedCommand, _super);
        function ShowSpellingCheckCompletedCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ShowSpellingCheckCompletedCommand.prototype.getMessageTextId = function () {
            return AlertMessageText.SpellingCheckCompleted;
        };
        return ShowSpellingCheckCompletedCommand;
    }(DialogInformationMessageCommand));
    __aspxRichEdit.ShowSpellingCheckCompletedCommand = ShowSpellingCheckCompletedCommand;
    var AlertMessageDialogParameters = (function (_super) {
        __extends(AlertMessageDialogParameters, _super);
        function AlertMessageDialogParameters() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        AlertMessageDialogParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.messageTextId = obj.messageTextId;
        };
        AlertMessageDialogParameters.prototype.clone = function () {
            var newInstance = new AlertMessageDialogParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        AlertMessageDialogParameters.prototype.toAnotherMeasuringSystem = function (_converter) {
            return this;
        };
        return AlertMessageDialogParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.AlertMessageDialogParameters = AlertMessageDialogParameters;
    var AlertMessageText;
    (function (AlertMessageText) {
        AlertMessageText[AlertMessageText["ModelIsChanged"] = 0] = "ModelIsChanged";
        AlertMessageText[AlertMessageText["SessionHasExpired"] = 1] = "SessionHasExpired";
        AlertMessageText[AlertMessageText["OpeningAndOverstoreImpossible"] = 2] = "OpeningAndOverstoreImpossible";
        AlertMessageText[AlertMessageText["ClipboardAccessDenied"] = 3] = "ClipboardAccessDenied";
        AlertMessageText[AlertMessageText["InnerException"] = 4] = "InnerException";
        AlertMessageText[AlertMessageText["AuthException"] = 5] = "AuthException";
        AlertMessageText[AlertMessageText["CantOpenFile"] = 6] = "CantOpenFile";
        AlertMessageText[AlertMessageText["CantSaveFile"] = 7] = "CantSaveFile";
        AlertMessageText[AlertMessageText["DocVariableException"] = 8] = "DocVariableException";
        AlertMessageText[AlertMessageText["PathTooLongException"] = 9] = "PathTooLongException";
        AlertMessageText[AlertMessageText["InvalidDocumentFormat"] = 10] = "InvalidDocumentFormat";
        AlertMessageText[AlertMessageText["SpellingCheckCompleted"] = 11] = "SpellingCheckCompleted";
        AlertMessageText[AlertMessageText["ClipboardAccessDeniedTouch"] = 12] = "ClipboardAccessDeniedTouch";
        AlertMessageText[AlertMessageText["CantSaveToEmptyPath"] = 13] = "CantSaveToEmptyPath";
        AlertMessageText[AlertMessageText["InsertContentFromServerException"] = 14] = "InsertContentFromServerException";
        AlertMessageText[AlertMessageText["LoadPictureError"] = 15] = "LoadPictureError";
    })(AlertMessageText = __aspxRichEdit.AlertMessageText || (__aspxRichEdit.AlertMessageText = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogBookmarksCommand = (function (_super) {
        __extends(DialogBookmarksCommand, _super);
        function DialogBookmarksCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogBookmarksCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.visible = this.IsVisible();
            return state;
        };
        DialogBookmarksCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.bookmarks) && this.control.selection.intervals.length === 1;
        };
        DialogBookmarksCommand.prototype.IsVisible = function () {
            return __aspxRichEdit.ControlOptions.isVisible(this.control.options.bookmarks);
        };
        DialogBookmarksCommand.prototype.createParameters = function (_options) {
            var parameters = new BookmarksDialogParameters();
            parameters.bookmarks = __aspxRichEdit.ListUtils.map(this.control.model.getAllBookmarks(false), function (bm) { return new BookmarkDioalogInfo(bm.name, bm.start); });
            parameters.allowedAddNewBookmarks = this.control.readOnly != __aspxRichEdit.ReadOnlyMode.Persistent;
            return parameters;
        };
        DialogBookmarksCommand.prototype.applyParameters = function (_state, newParams) {
            if (newParams.newBookmarkName != "") {
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.CreateBookmark)
                    .execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, new __aspxRichEdit.ConstBookmark(this.control.selection.intervals[0], newParams.newBookmarkName)));
            }
            else if (newParams.deletedBookmarkNames.length > 0)
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.DeleteBookmarks).execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, newParams.deletedBookmarkNames));
            return true;
        };
        DialogBookmarksCommand.prototype.getDialogName = function () {
            return "Bookmarks";
        };
        DialogBookmarksCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return DialogBookmarksCommand;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogBookmarksCommand = DialogBookmarksCommand;
    var BookmarkDioalogInfo = (function () {
        function BookmarkDioalogInfo(name, start) {
            this.name = name;
            this.start = start;
        }
        return BookmarkDioalogInfo;
    }());
    __aspxRichEdit.BookmarkDioalogInfo = BookmarkDioalogInfo;
    var BookmarksDialogParameters = (function (_super) {
        __extends(BookmarksDialogParameters, _super);
        function BookmarksDialogParameters() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        BookmarksDialogParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.bookmarks = obj.bookmarks;
            this.deletedBookmarkNames = obj.deletedBookmarkNames;
            this.newBookmarkName = obj.newBookmarkName;
            this.allowedAddNewBookmarks = obj.allowedAddNewBookmarks;
        };
        BookmarksDialogParameters.prototype.clone = function () {
            var newInstance = new BookmarksDialogParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        BookmarksDialogParameters.prototype.toAnotherMeasuringSystem = function (_converter) {
            return this;
        };
        return BookmarksDialogParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.BookmarksDialogParameters = BookmarksDialogParameters;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogBorderShadingCommandBase = (function (_super) {
        __extends(DialogBorderShadingCommandBase, _super);
        function DialogBorderShadingCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogBorderShadingCommandBase.prototype.getState = function () {
            var visible = this.control.selection.tableInfo.extendedData.numRows > 0;
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled() && visible);
            state.visible = visible;
            return state;
        };
        DialogBorderShadingCommandBase.prototype.makeParams = function (applyToWholeTable, colorProvider) {
            var dialogParams = new BorderShadingDialogParameters();
            var selection = this.control.selection;
            var tableInfo = selection.tableInfo;
            var startCell = tableInfo.extendedData.firstCell;
            var table = startCell.parentRow.parentTable;
            var selectionStateInfo;
            dialogParams.applyToWholeTable = applyToWholeTable;
            if ((typeof dialogParams.applyToWholeTable !== "boolean" && this.isNoFullSelectedCell(selection)) || dialogParams.applyToWholeTable === true) {
                selectionStateInfo = selection.getSelectionState();
                selection.deprecatedSetSelection(table.getStartPosition(), table.getEndPosition(), selection.endOfLine, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
                tableInfo = selection.tableInfo;
            }
            this.topBorderCommand = new __aspxRichEdit.ToggleTableCellsTopBorderCommand(this.control);
            this.rightBorderCommand = new __aspxRichEdit.ToggleTableCellsRightBorderCommand(this.control);
            this.bottomBorderCommand = new __aspxRichEdit.ToggleTableCellsBottomBorderCommand(this.control);
            this.leftBorderCommand = new __aspxRichEdit.ToggleTableCellsLeftBorderCommand(this.control);
            this.insideHorizontalBordersCommand = new __aspxRichEdit.ToggleTableCellInsideHorizontalBordersCommand(this.control);
            this.insideVerticalBordersCommand = new __aspxRichEdit.ToggleTableCellInsideVerticalBordersCommand(this.control);
            dialogParams.top = DialogBorderInfo.create(this.topBorderCommand.getGeneralizedBorder(), colorProvider);
            dialogParams.right = DialogBorderInfo.create(this.rightBorderCommand.getGeneralizedBorder(), colorProvider);
            dialogParams.bottom = DialogBorderInfo.create(this.bottomBorderCommand.getGeneralizedBorder(), colorProvider);
            dialogParams.left = DialogBorderInfo.create(this.leftBorderCommand.getGeneralizedBorder(), colorProvider);
            dialogParams.insideHorizontal = DialogBorderInfo.create(this.insideHorizontalBordersCommand.getGeneralizedBorder(), colorProvider);
            dialogParams.insideVertical = DialogBorderInfo.create(this.insideVerticalBordersCommand.getGeneralizedBorder(), colorProvider);
            dialogParams.init(this.colorProvider, tableInfo, this.control.modelManipulator.model);
            if (selectionStateInfo)
                this.control.selection.restoreSelectionState(selectionStateInfo, __aspxRichEdit.UpdateInputPositionProperties.Yes);
            return dialogParams;
        };
        DialogBorderShadingCommandBase.prototype.applyParameters = function (_state, newParams, initParams) {
            var selection = this.control.selection;
            var tableInfo = selection.tableInfo;
            var startCell = tableInfo.extendedData.firstCell;
            var table = startCell.parentRow.parentTable;
            var selectionStateInfo;
            if ((typeof newParams.applyToWholeTable !== "boolean" && this.isNoFullSelectedCell(selection)) || newParams.applyToWholeTable === true) {
                selectionStateInfo = selection.getSelectionState();
                selection.deprecatedSetSelection(table.getStartPosition(), table.getEndPosition(), selection.endOfLine, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
                tableInfo = selection.tableInfo;
            }
            var history = this.control.history;
            history.beginTransaction();
            var changed = false;
            if (newParams.backgroundColor !== initParams.backgroundColor) {
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeTableCellShading).execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeTableCellShading).
                    DEPRECATEDConvertOptionsParameter(newParams.backgroundColor)));
                changed = true;
            }
            if (newParams.top && !newParams.top.equals(initParams.top)) {
                this.topBorderCommand.execute(this.control.commandManager.isPublicApiCall, newParams.top.getBorderInfo());
                changed = true;
            }
            if (newParams.bottom && !newParams.bottom.equals(initParams.bottom)) {
                this.bottomBorderCommand.execute(this.control.commandManager.isPublicApiCall, newParams.bottom.getBorderInfo());
                changed = true;
            }
            if (newParams.right && !newParams.right.equals(initParams.right)) {
                this.rightBorderCommand.execute(this.control.commandManager.isPublicApiCall, newParams.right.getBorderInfo());
                changed = true;
            }
            if (newParams.left && !newParams.left.equals(initParams.left)) {
                this.leftBorderCommand.execute(this.control.commandManager.isPublicApiCall, newParams.left.getBorderInfo());
                changed = true;
            }
            if (newParams.insideHorizontal && !newParams.insideHorizontal.equals(initParams.insideHorizontal)) {
                this.insideHorizontalBordersCommand.execute(this.control.commandManager.isPublicApiCall, newParams.insideHorizontal.getBorderInfo());
                changed = true;
            }
            if (newParams.insideVertical && !newParams.insideVertical.equals(initParams.insideVertical)) {
                this.insideVerticalBordersCommand.execute(this.control.commandManager.isPublicApiCall, newParams.insideVertical.getBorderInfo());
                changed = true;
            }
            history.endTransaction();
            if (selectionStateInfo)
                this.control.selection.restoreSelectionState(selectionStateInfo, __aspxRichEdit.UpdateInputPositionProperties.Yes);
            return changed || !!selectionStateInfo;
        };
        DialogBorderShadingCommandBase.prototype.isNoFullSelectedCell = function (selection) {
            var tableInfo = selection.tableInfo;
            if (tableInfo.extendedData.numRows > 1 || tableInfo.extendedData.rows[0].cells.length > 1)
                return false;
            var startCell = tableInfo.extendedData.firstCell;
            return selection.intervals[0].start !== startCell.startParagraphPosition.value || selection.intervals[0].end !== startCell.endParagrapPosition.value;
        };
        DialogBorderShadingCommandBase.prototype.getDialogName = function () {
            return "BorderShading";
        };
        return DialogBorderShadingCommandBase;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogBorderShadingCommandBase = DialogBorderShadingCommandBase;
    var DialogBorderShadingCommand = (function (_super) {
        __extends(DialogBorderShadingCommand, _super);
        function DialogBorderShadingCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogBorderShadingCommand.prototype.createParameters = function (options) {
            return this.makeParams(options.param, this.control.model.colorProvider);
        };
        return DialogBorderShadingCommand;
    }(DialogBorderShadingCommandBase));
    __aspxRichEdit.DialogBorderShadingCommand = DialogBorderShadingCommand;
    var DialogServiceBorderShadingCommand = (function (_super) {
        __extends(DialogServiceBorderShadingCommand, _super);
        function DialogServiceBorderShadingCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogServiceBorderShadingCommand.prototype.createParameters = function (_options) {
            return this.makeParams(null, this.control.model.colorProvider);
        };
        DialogServiceBorderShadingCommand.prototype.afterClosing = function (options) {
            this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowTablePropertiesForm)
                .execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, options.param));
        };
        return DialogServiceBorderShadingCommand;
    }(DialogBorderShadingCommandBase));
    __aspxRichEdit.DialogServiceBorderShadingCommand = DialogServiceBorderShadingCommand;
    var BorderShadingDialogParameters = (function (_super) {
        __extends(BorderShadingDialogParameters, _super);
        function BorderShadingDialogParameters() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.borderLineHorizontalInVisible = false;
            _this.borderLineVerticalInVisible = false;
            return _this;
        }
        BorderShadingDialogParameters.prototype.init = function (colorProvider, tableInfo, model) {
            var firstCell = tableInfo.extendedData.firstCell;
            var table = tableInfo.table;
            var backColorMerger = new __aspxRichEdit.TableCellPropertiesMergerShadingInfo();
            var backgroundColor = backColorMerger.getProperty(firstCell.properties, table.style, firstCell.conditionalFormatting, model.defaultTableCellProperties).getActualColor(colorProvider);
            this.backgroundColor = this.getColor(tableInfo.extendedData.allOfCells(function (cellInfo) {
                var bc = backColorMerger.getProperty(cellInfo.cell.properties, table.style, cellInfo.cell.conditionalFormatting, model.defaultTableCellProperties);
                return backgroundColor == (bc ? bc.getActualColor(colorProvider) : null);
            }) ? backgroundColor : null);
            this.borderLineHorizontalInVisible = tableInfo.extendedData.numRows > 1;
            this.borderLineVerticalInVisible = __aspxRichEdit.ListUtils.anyOf(tableInfo.extendedData.rows, function (rowInfo) { return rowInfo.cells.length > 1; });
            this.setModeButton = this.getModeState();
        };
        BorderShadingDialogParameters.prototype.getModeState = function () {
            if (this.isModeStateNone())
                return SetModeButtons.None;
            if (this.isModeStateAll())
                return SetModeButtons.All;
            if (this.isModeStateBox())
                return SetModeButtons.Box;
            if (this.isModeStateGrid())
                return SetModeButtons.Grid;
            return SetModeButtons.Custom;
        };
        BorderShadingDialogParameters.prototype.isModeStateNone = function () {
            var borders = [this.top, this.right, this.bottom, this.left, this.insideVertical, this.insideHorizontal];
            for (var i = 0; i < borders.length; i++) {
                if (borders[i] != null && !(borders[i].style === __aspxRichEdit.BorderLineStyle.None || borders[i].width === 0))
                    return false;
            }
            return true;
        };
        BorderShadingDialogParameters.prototype.isModeStateAll = function () {
            var borders = [this.top, this.right, this.bottom, this.left];
            borders.push(this.insideVertical);
            borders.push(this.insideHorizontal);
            if ((borders[0] == null) || (borders[0].style === __aspxRichEdit.BorderLineStyle.None) || (borders[0].width === 0))
                return false;
            if (!this.borderLineHorizontalInVisible && !this.borderLineVerticalInVisible)
                return false;
            for (var i = 1; i < borders.length; i++) {
                if ((borders[i] == null) || !borders[0].equals(borders[i]))
                    return false;
            }
            return true;
        };
        BorderShadingDialogParameters.prototype.isModeStateBox = function () {
            var borders = [this.top, this.right, this.bottom, this.left];
            var bordersIn = [this.insideVertical, this.insideHorizontal];
            if ((borders[0] == null) || (borders[0].style === __aspxRichEdit.BorderLineStyle.None) || (borders[0].width === 0))
                return false;
            for (var i = 1; i < borders.length; i++) {
                if ((borders[i] == null) || !borders[0].equals(borders[i]))
                    return false;
            }
            if (!this.borderLineHorizontalInVisible && !this.borderLineVerticalInVisible)
                return true;
            for (var i = 0; i < bordersIn.length; i++) {
                if ((bordersIn[i] == null) || !(bordersIn[i].style === __aspxRichEdit.BorderLineStyle.None || bordersIn[i].width === 0))
                    return false;
            }
            return true;
        };
        BorderShadingDialogParameters.prototype.isModeStateGrid = function () {
            var borders = [this.top, this.right, this.bottom, this.left];
            var bordersIn = [this.insideVertical, this.insideHorizontal];
            if ((borders[0] == null) || (borders[0].style === __aspxRichEdit.BorderLineStyle.None) || (borders[0].width === 0))
                return false;
            if (!this.borderLineHorizontalInVisible && !this.borderLineVerticalInVisible)
                return false;
            for (var i = 1; i < borders.length; i++) {
                if ((borders[i] == null) || !borders[0].equals(borders[i]))
                    return false;
            }
            for (var i = 0; i < bordersIn.length; i++) {
                if ((bordersIn[i] == null) || bordersIn[i].style !== __aspxRichEdit.BorderLineStyle.Single || bordersIn[i].color !== borders[0].color || (bordersIn[i].width !== BorderShadingDialogParameters.gridWidth))
                    return false;
            }
            return true;
        };
        BorderShadingDialogParameters.prototype.getColor = function (color) {
            if (color == __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR)
                return "Auto";
            if (color != undefined)
                return __aspxRichEdit.ColorHelper.colorToHash(color).toUpperCase();
            else
                return undefined;
        };
        BorderShadingDialogParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.backgroundColor = obj.backgroundColor;
            this.top = obj.top !== null ? obj.top.clone() : null;
            this.right = obj.right !== null ? obj.right.clone() : null;
            this.bottom = obj.bottom !== null ? obj.bottom.clone() : null;
            this.left = obj.left !== null ? obj.left.clone() : null;
            this.insideHorizontal = obj.insideHorizontal !== null ? obj.insideHorizontal.clone() : null;
            this.insideVertical = obj.insideVertical !== null ? obj.insideVertical.clone() : null;
            this.applyToWholeTable = obj.applyToWholeTable;
        };
        BorderShadingDialogParameters.prototype.clone = function () {
            var newInstance = new BorderShadingDialogParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        BorderShadingDialogParameters.prototype.toAnotherMeasuringSystem = function (_converter) {
            return this;
        };
        BorderShadingDialogParameters.gridWidth = __aspxRichEdit.UnitConverter.twipsToPointsF(15);
        return BorderShadingDialogParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.BorderShadingDialogParameters = BorderShadingDialogParameters;
    var DialogBorderInfo = (function () {
        function DialogBorderInfo() {
        }
        DialogBorderInfo.create = function (borderInfo, colorProvider) {
            if (!borderInfo)
                return null;
            var dialogBorderInfo = new DialogBorderInfo();
            dialogBorderInfo.color = __aspxRichEdit.ColorHelper.colorToHash(borderInfo.color.toRgb(colorProvider)).toUpperCase();
            dialogBorderInfo.width = __aspxRichEdit.UnitConverter.twipsToPointsF(borderInfo.width);
            dialogBorderInfo.style = borderInfo.style;
            return dialogBorderInfo;
        };
        DialogBorderInfo.prototype.getBorderInfo = function () {
            var borderInfo = new __aspxRichEdit.BorderInfo();
            borderInfo.color = this.color === null ? __aspxRichEdit.ColorModelInfo.noColor : __aspxRichEdit.ColorModelInfo.makeByColor(__aspxRichEdit.ColorHelper.hashToColor(this.color));
            borderInfo.width = __aspxRichEdit.UnitConverter.pointsToTwips(this.width);
            borderInfo.style = this.style;
            return borderInfo;
        };
        DialogBorderInfo.prototype.equals = function (obj) {
            return obj && this.style == obj.style &&
                this.color == obj.color &&
                this.width == obj.width;
        };
        DialogBorderInfo.prototype.copyFrom = function (obj) {
            this.style = obj.style;
            this.color = obj.color;
            this.width = obj.width;
        };
        DialogBorderInfo.prototype.clone = function () {
            var result = new DialogBorderInfo();
            result.copyFrom(this);
            return result;
        };
        return DialogBorderInfo;
    }());
    __aspxRichEdit.DialogBorderInfo = DialogBorderInfo;
    var SetModeButtons;
    (function (SetModeButtons) {
        SetModeButtons[SetModeButtons["None"] = 0] = "None";
        SetModeButtons[SetModeButtons["Box"] = 1] = "Box";
        SetModeButtons[SetModeButtons["All"] = 2] = "All";
        SetModeButtons[SetModeButtons["Grid"] = 3] = "Grid";
        SetModeButtons[SetModeButtons["Custom"] = 4] = "Custom";
    })(SetModeButtons = __aspxRichEdit.SetModeButtons || (__aspxRichEdit.SetModeButtons = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogColumnsCommand = (function (_super) {
        __extends(DialogColumnsCommand, _super);
        function DialogColumnsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogColumnsCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.sections) && this.control.model.activeSubDocument.isMain() &&
                __aspxRichEdit.SectionPropertiesCommandBase.rangePermissionIncludeFullSection(this.control, this.control.model.activeSubDocument, this.control.selection.intervals);
        };
        DialogColumnsCommand.prototype.createParameters = function (_options) {
            var columnsInfo = new ColumnsInfoUI();
            var secProps = this.control.inputPosition.getMergedSectionPropertiesRaw();
            columnsInfo.equalColumnWidth = secProps.equalWidthColumns;
            if (secProps.pageWidth != undefined && secProps.marginLeft != undefined && secProps.marginRight != undefined)
                columnsInfo.pageWidth = secProps.pageWidth - secProps.marginLeft - secProps.marginRight;
            else
                columnsInfo.pageWidth = ColumnsInfoUI.minColumnWidth;
            var columnCount = secProps.columnCount == undefined ? 0 : secProps.columnCount;
            columnsInfo.changeColumnCount(columnCount);
            for (var i = 0, info; info = secProps.columnsInfo[i]; i++) {
                columnsInfo.columns[i].width = info.width;
                columnsInfo.columns[i].spacing = info.space;
            }
            return new ColumnsDialogParameters().init(columnsInfo, this.control.uiUnitConverter);
        };
        DialogColumnsCommand.prototype.applyParameters = function (_state, newParams) {
            var interval = this.getInterval(newParams.columnsInfo.applyType);
            var modelManipulator = this.control.modelManipulator;
            var columnsInfo = newParams.columnsInfo;
            this.control.history.beginTransaction();
            var columns = [];
            for (var i = 0, columnInfo; columnInfo = columnsInfo.columns[i]; i++) {
                var column = new __aspxRichEdit.SectionColumnProperties(columnInfo.width, columnInfo.spacing);
                columns.push(column);
            }
            this.control.history.addAndRedo(new __aspxRichEdit.SectionColumnsInfoHistoryItem(modelManipulator, modelManipulator.model.activeSubDocument, interval, columns));
            this.control.history.addAndRedo(new __aspxRichEdit.SectionColumnCountHistoryItem(modelManipulator, modelManipulator.model.activeSubDocument, interval, columnsInfo.columnCount));
            this.control.history.addAndRedo(new __aspxRichEdit.SectionEqualWidthColumnsHistoryItem(modelManipulator, modelManipulator.model.activeSubDocument, interval, columnsInfo.equalColumnWidth));
            this.control.history.endTransaction();
            return true;
        };
        DialogColumnsCommand.prototype.getInterval = function (applyTo) {
            if (applyTo == __aspxRichEdit.SectionPropertiesApplyType.WholeDocument)
                return new __aspxRichEdit.FixedInterval(0, this.control.model.mainSubDocument.getDocumentEndPosition() - 1);
            var selectedSections = this.control.model.getSectionsByInterval(this.control.selection.getLastSelectedInterval());
            if (applyTo == __aspxRichEdit.SectionPropertiesApplyType.SelectedSections) {
                var lastSection = selectedSections[selectedSections.length - 1];
                return __aspxRichEdit.FixedInterval.fromPositions(selectedSections[0].startLogPosition.value, lastSection.startLogPosition.value + lastSection.getLength() - 1);
            }
            if (applyTo == __aspxRichEdit.SectionPropertiesApplyType.ThisPointForward)
                return __aspxRichEdit.FixedInterval.fromPositions(selectedSections[0].startLogPosition.value, this.control.model.mainSubDocument.getDocumentEndPosition());
            return new __aspxRichEdit.FixedInterval(selectedSections[0].startLogPosition.value, selectedSections[0].getLength() - 1);
        };
        DialogColumnsCommand.prototype.getDialogName = function () {
            return "Columns";
        };
        DialogColumnsCommand.prototype.lockInputPositionUpdating = function (_prevModifiedState) {
            return false;
        };
        return DialogColumnsCommand;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogColumnsCommand = DialogColumnsCommand;
    var ColumnsDialogParameters = (function (_super) {
        __extends(ColumnsDialogParameters, _super);
        function ColumnsDialogParameters() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ColumnsDialogParameters.prototype.init = function (columnsInfo, unitConverter) {
            this.columnsInfo = columnsInfo;
            this.unitConverter = unitConverter;
            return this;
        };
        ColumnsDialogParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            var columnsInfo = new ColumnsInfoUI();
            columnsInfo.copyFrom(obj.columnsInfo);
            this.columnsInfo = columnsInfo;
            this.unitConverter = obj.unitConverter;
        };
        ColumnsDialogParameters.prototype.clone = function () {
            var newInstance = new ColumnsDialogParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        ColumnsDialogParameters.prototype.toAnotherMeasuringSystem = function (_converter) {
            return this;
        };
        return ColumnsDialogParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.ColumnsDialogParameters = ColumnsDialogParameters;
    var ColumnsInfoUI = (function () {
        function ColumnsInfoUI() {
            this.columns = [];
            this.equalColumnWidth = false;
            this.applyType = __aspxRichEdit.SectionPropertiesApplyType.WholeDocument;
        }
        ColumnsInfoUI.prototype.getMaxColumnCount = function () {
            return Math.ceil(this.pageWidth / (ColumnsInfoUI.minColumnWidth + ColumnsInfoUI.minSpacingWidth));
        };
        ColumnsInfoUI.prototype.hasColumnsNull = function () {
            if (this.columnCount > this.columns.length)
                return true;
            for (var i = 0; i < this.columnCount; i++) {
                if (!this.columns[i].width)
                    return true;
                if (!this.columns[i].spacing && this.columns[i].spacing != 0)
                    return true;
            }
            return false;
        };
        ColumnsInfoUI.prototype.hasColumnsInfoUINull = function () {
            if (!this.columnCount)
                return true;
            return this.hasColumnsNull();
        };
        ColumnsInfoUI.prototype.changeColumnCount = function (count) {
            if (count < 0)
                return;
            count = Math.min(count, this.getMaxColumnCount());
            var previousCount = this.columns.length;
            var hasColumnInfoUINull = this.hasColumnsInfoUINull();
            for (var i = this.columns.length; i < count; i++)
                this.columns[i] = new ColumnInfoUI(i + 1);
            this.columns.splice(count);
            this.columnCount = count;
            if (hasColumnInfoUINull) {
                this.calculateEqualColumnsOnChangeCount();
                return;
            }
            if (!this.equalColumnWidth && previousCount > 0)
                this.calculateNotEqualColumnsOnChangeCount(previousCount);
            else
                this.calculateEqualColumnsOnChangeCount();
        };
        ColumnsInfoUI.prototype.calculateEqualColumnsOnChangeCount = function () {
            if (this.columns.length <= 0)
                return;
            var spacingValue;
            if (this.columns[0].spacing && this.columns[0].spacing != 0)
                spacingValue = this.columns[0].spacing;
            else
                spacingValue = ColumnsInfoUI.minColumnWidth;
            this.calculateUniformColumnsByColumnSpacing(spacingValue);
        };
        ColumnsInfoUI.prototype.calculateNotEqualColumnsOnChangeCount = function (previousCount) {
            if (this.columns.length <= 0)
                return;
            if (this.columns.length == 1)
                this.columns[0].width = this.pageWidth;
            var calculateCount = Math.min(previousCount, this.columns.length);
            for (var i = 0; i < calculateCount; i++)
                this.columns[i].width = Math.max(ColumnsInfoUI.minColumnWidth, this.columns[i].width * previousCount / this.columns.length);
            for (var i = 0; i < calculateCount - 1; i++)
                this.columns[i].spacing = Math.max(ColumnsInfoUI.minSpacingWidth, this.columns[i].spacing * (previousCount - 1) / (this.columns.length - 1));
            if (calculateCount > 0)
                for (var i = calculateCount; i < this.columns.length; i++)
                    this.columns[i].width = this.columns[calculateCount - 1].width;
            if (calculateCount > 1)
                for (var i = calculateCount - 1; i < this.columns.length - 1; i++)
                    this.columns[i].spacing = this.columns[calculateCount - 2].spacing;
            this.disableTheLastSpacing();
            this.correctColumns();
        };
        ColumnsInfoUI.prototype.correctColumns = function () {
            if (!this.columnCount || this.columnCount <= 0)
                return;
            var difference = -this.calculateAvailableSpace();
            var calculatorWidth = new ColumnsDistributionWidthPriorityCalculator(this.columns);
            var calculatorSpacing = new ColumnsDistributionSpacingPriorityCalculator(this.columns);
            var sumWidth = calculatorWidth.calculateTotal(0, this.columns.length - 1);
            var sumSpacing = calculatorSpacing.calculateTotal(0, this.columns.length - 1);
            var partWidth = sumWidth / (sumWidth + sumSpacing);
            var differenceWidth = Math.ceil(difference * partWidth);
            var differenceSpacing = difference - differenceWidth;
            calculatorWidth.distributeSpace(0, this.columns.length - 1, differenceWidth);
            calculatorSpacing.distributeSpace(0, this.columns.length - 2, differenceSpacing);
        };
        ColumnsInfoUI.prototype.disableTheLastSpacing = function () {
            this.columns[this.columns.length - 1].spacing = 0;
        };
        ColumnsInfoUI.prototype.recalculateColumnsByWidthAfterIndex = function (index) {
            if (this.hasColumnsInfoUINull())
                return;
            if (this.equalColumnWidth)
                this.calculateColumnWidthForUniformColumns();
            else
                this.changeColumnsNotEqualByWidthAfterIndex(index);
        };
        ColumnsInfoUI.prototype.recalculateColumnsBySpacingAfterIndex = function (index) {
            if (this.hasColumnsInfoUINull())
                return;
            if (this.equalColumnWidth)
                this.calculateColumnSpacingForUniformColumns();
            else
                this.changeColumnsNotEqualBySpacingAfterIndex(index);
        };
        ColumnsInfoUI.prototype.calculateUniformColumnsCore = function (columnWidth, columnSpacing, restWidth, restSpacing) {
            var calculatorWidth = new ColumnsDistributionWidthPriorityCalculator(this.columns);
            var calculatorSpacing = new ColumnsDistributionSpacingPriorityCalculator(this.columns);
            calculatorWidth.setAllValues(columnWidth, restWidth);
            calculatorSpacing.setAllValues(columnSpacing, restSpacing);
            this.disableTheLastSpacing();
        };
        ColumnsInfoUI.prototype.calculateColumnWidthForUniformColumns = function () {
            var columnWidth = (this.columns[0].width) ? this.columns[0].width : ColumnsInfoUI.minColumnWidth;
            this.calculateUniformColumnsByColumnWidth(columnWidth);
        };
        ColumnsInfoUI.prototype.calculateUniformColumnsByColumnWidth = function (columnWidth) {
            if (!this.columnCount || this.columnCount <= 0)
                return;
            if (this.columnCount <= 1)
                columnWidth = this.pageWidth;
            if (columnWidth * this.columnCount > this.pageWidth)
                columnWidth = this.pageWidth / this.columnCount;
            columnWidth = Math.max(columnWidth, ColumnsInfoUI.minColumnWidth);
            var dividend = this.pageWidth - columnWidth * this.columnCount;
            var divider = Math.max(1, this.columnCount - 1);
            var restSpacing = dividend % divider;
            var columnSpacing = dividend / divider;
            this.calculateUniformColumnsCore(columnWidth, columnSpacing, 0, restSpacing);
        };
        ColumnsInfoUI.prototype.calculateColumnSpacingForUniformColumns = function () {
            if (this.hasColumnsInfoUINull())
                return;
            var columnSpacing = (this.columns[0].spacing) ? this.columns[0].spacing : ColumnsInfoUI.minSpacingWidth;
            this.calculateUniformColumnsByColumnSpacing(columnSpacing);
        };
        ColumnsInfoUI.prototype.calculateUniformColumnsByColumnSpacing = function (columnSpacing) {
            if (!this.columnCount || this.columnCount <= 0)
                return;
            columnSpacing = Math.max(columnSpacing, ColumnsInfoUI.minSpacingWidth);
            if (columnSpacing * (this.columnCount - 1) > this.pageWidth - ColumnsInfoUI.minColumnWidth * this.columnCount)
                columnSpacing = Math.ceil((this.pageWidth - ColumnsInfoUI.minColumnWidth * this.columnCount) / (this.columnCount - 1));
            if (this.columnCount == 1)
                columnSpacing = 0;
            var dividend = Math.ceil(this.pageWidth - columnSpacing * (this.columnCount - 1));
            var restWidth = Math.ceil(dividend % this.columnCount);
            var columnWidth = Math.ceil(dividend / this.columnCount);
            this.calculateUniformColumnsCore(columnWidth, columnSpacing, restWidth, 0);
        };
        ColumnsInfoUI.prototype.calculateAvailableSpace = function () {
            var usedSpace = 0;
            for (var i = 0; i < this.columnCount; i++)
                usedSpace += ((this.columns[i].width) ? this.columns[i].width : 0) + ((this.columns[i].spacing) ? this.columns[i].spacing : 0);
            return this.pageWidth - usedSpace;
        };
        ColumnsInfoUI.prototype.changeColumnsNotEqualByWidthAfterIndex = function (index) {
            if (!this.columnCount || this.columnCount <= 0 || index >= this.columnCount)
                return;
            var calculatorWidth = new ColumnsDistributionWidthPriorityCalculator(this.columns);
            var calculatorSpacing = new ColumnsDistributionSpacingPriorityCalculator(this.columns);
            calculatorWidth.correctValue(index);
            var difference = -this.calculateAvailableSpace();
            difference = calculatorWidth.distributeSpace(index + 1, this.columnCount - 1, difference);
            difference = calculatorWidth.distributeSpace(0, index - 1, difference);
            difference = calculatorSpacing.distributeSpace(0, this.columnCount - 2, difference);
            this.columns[index].width -= difference;
            this.disableTheLastSpacing();
        };
        ColumnsInfoUI.prototype.changeColumnsNotEqualBySpacingAfterIndex = function (index) {
            if (!this.columnCount || this.columnCount <= 0 || index >= this.columnCount)
                return;
            var calculatorWidth = new ColumnsDistributionWidthPriorityCalculator(this.columns);
            var calculatorSpacing = new ColumnsDistributionSpacingPriorityCalculator(this.columns);
            calculatorSpacing.correctValue(index);
            var difference = -this.calculateAvailableSpace();
            difference = calculatorWidth.distributeSpace(index + 1, this.columnCount - 1, difference);
            difference = calculatorWidth.distributeSpace(0, index, difference);
            difference = calculatorSpacing.distributeSpace(0, index - 1, difference);
            difference = calculatorSpacing.distributeSpace(index + 1, this.columnCount - 2, difference);
            this.columns[index].spacing -= difference;
            this.disableTheLastSpacing();
        };
        ColumnsInfoUI.prototype.clone = function () {
            var obj = new ColumnsInfoUI();
            obj.copyFrom(this);
            return obj;
        };
        ColumnsInfoUI.prototype.copyFrom = function (info) {
            this.applyType = info.applyType;
            this.equalColumnWidth = info.equalColumnWidth;
            this.pageWidth = info.pageWidth;
            this.changeColumnCount(info.columns.length);
            for (var i = 0; i < this.columns.length; i++) {
                this.columns[i].width = info.columns[i].width;
                this.columns[i].spacing = info.columns[i].spacing;
            }
        };
        ColumnsInfoUI.minColumnWidth = 720;
        ColumnsInfoUI.minSpacingWidth = 0;
        return ColumnsInfoUI;
    }());
    __aspxRichEdit.ColumnsInfoUI = ColumnsInfoUI;
    var ColumnInfoUI = (function () {
        function ColumnInfoUI(num) {
            this.num = num;
        }
        return ColumnInfoUI;
    }());
    __aspxRichEdit.ColumnInfoUI = ColumnInfoUI;
    var ColumnsDistributionCalculator = (function () {
        function ColumnsDistributionCalculator(columns) {
            this.columns = [];
            this.columns = columns;
        }
        ColumnsDistributionCalculator.prototype.calculateTotal = function (from, to) {
            var result = 0;
            for (var i = from; i <= to; i++)
                result += this.getValue(this.columns[i]);
            return result;
        };
        ColumnsDistributionCalculator.prototype.hasEnoughSpaceForDistribution = function (from, to, space) {
            var total = this.calculateTotal(from, to);
            return space < total - this.getMinValue() * (to - from + 1);
        };
        ColumnsDistributionCalculator.prototype.setMinValues = function (from, to, space) {
            for (var i = from; i <= to; i++) {
                space -= this.getValue(this.columns[i]) - this.getMinValue();
                this.setValue(this.columns[i], this.getMinValue());
            }
            return space;
        };
        ColumnsDistributionCalculator.prototype.correctValue = function (index) {
            if (index >= this.columns.length)
                return;
            if (this.getValue(this.columns[index]) < this.getMinValue())
                this.setValue(this.columns[index], this.getMinValue());
        };
        ColumnsDistributionCalculator.prototype.distributeRemainder = function (from, to, remainder) {
            var correction = (remainder > 0) ? 1 : -1;
            while (remainder != 0) {
                for (var i = from; i <= to && (remainder != 0); i++) {
                    var newValue = this.getValue(this.columns[i]) - correction;
                    if (newValue > this.getMinValue()) {
                        this.setValue(this.columns[i], newValue);
                        remainder -= correction;
                    }
                }
            }
            return 0;
        };
        ColumnsDistributionCalculator.prototype.distributeSpaceCore = function (from, to, space) {
            var remainder = Math.round(space % (to - from + 1));
            var difference = Math.round(space / (to - from + 1));
            for (var i = from; i <= to; i++) {
                var newValue = this.getValue(this.columns[i]) - difference;
                if (newValue >= this.getMinValue())
                    this.setValue(this.columns[i], newValue);
                else {
                    this.setValue(this.columns[i], this.getMinValue());
                    remainder += (this.getMinValue() - newValue);
                }
            }
            this.distributeRemainder(from, to, remainder);
            return 0;
        };
        ColumnsDistributionCalculator.prototype.distributeSpace = function (from, to, space) {
            if (from > to)
                return space;
            if (this.hasEnoughSpaceForDistribution(from, to, space))
                return this.distributeSpaceCore(from, to, space);
            else
                return this.setMinValues(from, to, space);
        };
        ColumnsDistributionCalculator.prototype.setAllValues = function (value, rest) {
            var count = this.columns.length;
            for (var i = 0; i < count; i++)
                this.setValue(this.columns[i], value);
            this.distributeSpace(0, count - 1, -rest);
        };
        ColumnsDistributionCalculator.prototype.getMinValue = function () { return null; };
        ColumnsDistributionCalculator.prototype.getValue = function (_column) { return null; };
        ColumnsDistributionCalculator.prototype.setValue = function (_column, _value) { };
        return ColumnsDistributionCalculator;
    }());
    __aspxRichEdit.ColumnsDistributionCalculator = ColumnsDistributionCalculator;
    var ColumnsDistributionWidthPriorityCalculator = (function (_super) {
        __extends(ColumnsDistributionWidthPriorityCalculator, _super);
        function ColumnsDistributionWidthPriorityCalculator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ColumnsDistributionWidthPriorityCalculator.prototype.getMinValue = function () {
            return 720;
        };
        ColumnsDistributionWidthPriorityCalculator.prototype.getValue = function (column) {
            return (column.width) ? column.width : 0;
        };
        ColumnsDistributionWidthPriorityCalculator.prototype.setValue = function (column, value) {
            column.width = value;
        };
        return ColumnsDistributionWidthPriorityCalculator;
    }(ColumnsDistributionCalculator));
    __aspxRichEdit.ColumnsDistributionWidthPriorityCalculator = ColumnsDistributionWidthPriorityCalculator;
    var ColumnsDistributionSpacingPriorityCalculator = (function (_super) {
        __extends(ColumnsDistributionSpacingPriorityCalculator, _super);
        function ColumnsDistributionSpacingPriorityCalculator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ColumnsDistributionSpacingPriorityCalculator.prototype.getMinValue = function () {
            return 0;
        };
        ColumnsDistributionSpacingPriorityCalculator.prototype.getValue = function (column) {
            return (column.spacing) ? column.spacing : 0;
        };
        ColumnsDistributionSpacingPriorityCalculator.prototype.setValue = function (column, value) {
            column.spacing = value;
        };
        return ColumnsDistributionSpacingPriorityCalculator;
    }(ColumnsDistributionCalculator));
    __aspxRichEdit.ColumnsDistributionSpacingPriorityCalculator = ColumnsDistributionSpacingPriorityCalculator;
    var ColumnsEditorController = (function () {
        function ColumnsEditorController(parameters) {
            this.presets = [];
            this.columnsInfo = parameters.columnsInfo;
            this.unitConverter = parameters.unitConverter;
            this.presets.push(new SingleColumnsInfoPreset());
            this.presets.push(new TwoColumnsInfoPreset());
            this.presets.push(new ThreeColumnsInfoPreset());
            this.presets.push(new LeftNarrowColumnsInfoPreset());
            this.presets.push(new RightNarrowColumnsInfoPreset());
        }
        ColumnsEditorController.prototype.changeColumnCount = function (count) {
            this.columnsInfo.changeColumnCount(count);
        };
        ColumnsEditorController.prototype.setEqualColumnWidth = function (value) {
            this.columnsInfo.equalColumnWidth = value;
            if (value)
                this.columnsInfo.calculateColumnSpacingForUniformColumns();
        };
        ColumnsEditorController.prototype.applyPreset = function (index) {
            this.presets[index].applyTo(this.columnsInfo);
        };
        ColumnsEditorController.prototype.matchPreset = function (index) {
            return this.presets[index].matchTo(this.columnsInfo);
        };
        ColumnsEditorController.prototype.getWidth = function (index) {
            var width = this.columnsInfo.columns[index].width;
            return this.unitConverter.twipsToUI(width);
        };
        ColumnsEditorController.prototype.getSpacing = function (index) {
            var spacing = this.columnsInfo.columns[index].spacing;
            return this.unitConverter.twipsToUI(spacing);
        };
        ColumnsEditorController.prototype.setWidth = function (index, value) {
            var width = this.unitConverter.UIToTwips(value);
            this.columnsInfo.columns[index].width = width;
            this.columnsInfo.recalculateColumnsByWidthAfterIndex(index);
        };
        ColumnsEditorController.prototype.setSpacing = function (index, value) {
            var spacing = this.unitConverter.UIToTwips(value);
            this.columnsInfo.columns[index].spacing = spacing;
            this.columnsInfo.recalculateColumnsBySpacingAfterIndex(index);
        };
        return ColumnsEditorController;
    }());
    __aspxRichEdit.ColumnsEditorController = ColumnsEditorController;
    var ColumnsInfoPreset = (function () {
        function ColumnsInfoPreset() {
        }
        ColumnsInfoPreset.prototype.getSpacing = function () { return 1800; };
        ColumnsInfoPreset.prototype.matchTo = function (_columnsInfo) { return false; };
        return ColumnsInfoPreset;
    }());
    __aspxRichEdit.ColumnsInfoPreset = ColumnsInfoPreset;
    var UniformColumnsInfoPreset = (function (_super) {
        __extends(UniformColumnsInfoPreset, _super);
        function UniformColumnsInfoPreset() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        UniformColumnsInfoPreset.prototype.getColumnCount = function () { return null; };
        UniformColumnsInfoPreset.prototype.matchTo = function (columnsInfo) {
            if (!columnsInfo.equalColumnWidth)
                return false;
            if (!columnsInfo.columnCount)
                return false;
            return columnsInfo.columnCount == this.getColumnCount();
        };
        UniformColumnsInfoPreset.prototype.applyTo = function (columnsInfo) {
            columnsInfo.equalColumnWidth = true;
            if (columnsInfo.columns.length > 0)
                columnsInfo.columns[0].spacing = this.getSpacing();
            columnsInfo.changeColumnCount(this.getColumnCount());
        };
        return UniformColumnsInfoPreset;
    }(ColumnsInfoPreset));
    __aspxRichEdit.UniformColumnsInfoPreset = UniformColumnsInfoPreset;
    var SingleColumnsInfoPreset = (function (_super) {
        __extends(SingleColumnsInfoPreset, _super);
        function SingleColumnsInfoPreset() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SingleColumnsInfoPreset.prototype.getColumnCount = function () { return 1; };
        return SingleColumnsInfoPreset;
    }(UniformColumnsInfoPreset));
    __aspxRichEdit.SingleColumnsInfoPreset = SingleColumnsInfoPreset;
    var TwoColumnsInfoPreset = (function (_super) {
        __extends(TwoColumnsInfoPreset, _super);
        function TwoColumnsInfoPreset() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TwoColumnsInfoPreset.prototype.getColumnCount = function () { return 2; };
        return TwoColumnsInfoPreset;
    }(UniformColumnsInfoPreset));
    __aspxRichEdit.TwoColumnsInfoPreset = TwoColumnsInfoPreset;
    var ThreeColumnsInfoPreset = (function (_super) {
        __extends(ThreeColumnsInfoPreset, _super);
        function ThreeColumnsInfoPreset() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ThreeColumnsInfoPreset.prototype.getColumnCount = function () { return 3; };
        return ThreeColumnsInfoPreset;
    }(UniformColumnsInfoPreset));
    __aspxRichEdit.ThreeColumnsInfoPreset = ThreeColumnsInfoPreset;
    var TwoNonUniformColumnsInfoPreset = (function (_super) {
        __extends(TwoNonUniformColumnsInfoPreset, _super);
        function TwoNonUniformColumnsInfoPreset() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TwoNonUniformColumnsInfoPreset.prototype.getFirstColumnRelativeWidth = function () { return null; };
        TwoNonUniformColumnsInfoPreset.prototype.matchTo = function (columnsInfo) {
            if (columnsInfo.equalColumnWidth)
                return false;
            if (columnsInfo.columnCount != 2)
                return false;
            if (columnsInfo.columns.length != 2)
                return false;
            if (!columnsInfo.columns[0].width)
                return false;
            if (!columnsInfo.columns[0].spacing && columnsInfo.columns[1].spacing != 0)
                return false;
            if (!columnsInfo.columns[1].width)
                return false;
            if (!columnsInfo.columns[1].spacing && columnsInfo.columns[1].spacing != 0)
                return false;
            var totalWidth = columnsInfo.pageWidth - this.getSpacing();
            if (columnsInfo.columns[0].width != Math.round(totalWidth * this.getFirstColumnRelativeWidth()))
                return false;
            if (columnsInfo.columns[0].spacing != this.getSpacing())
                return false;
            if (columnsInfo.columns[1].width != Math.round(totalWidth - columnsInfo.columns[0].width))
                return false;
            return columnsInfo.columns[1].spacing == 0;
        };
        TwoNonUniformColumnsInfoPreset.prototype.applyTo = function (columnsInfo) {
            columnsInfo.equalColumnWidth = false;
            columnsInfo.changeColumnCount(2);
            var totalWidth = columnsInfo.pageWidth - this.getSpacing();
            columnsInfo.columns[0].width = Math.round(totalWidth * this.getFirstColumnRelativeWidth());
            columnsInfo.columns[0].spacing = this.getSpacing();
            columnsInfo.columns[1].width = Math.round(totalWidth - columnsInfo.columns[0].width);
            columnsInfo.columns[1].spacing = 0;
        };
        return TwoNonUniformColumnsInfoPreset;
    }(ColumnsInfoPreset));
    __aspxRichEdit.TwoNonUniformColumnsInfoPreset = TwoNonUniformColumnsInfoPreset;
    var LeftNarrowColumnsInfoPreset = (function (_super) {
        __extends(LeftNarrowColumnsInfoPreset, _super);
        function LeftNarrowColumnsInfoPreset() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LeftNarrowColumnsInfoPreset.prototype.getFirstColumnRelativeWidth = function () { return 0.292; };
        return LeftNarrowColumnsInfoPreset;
    }(TwoNonUniformColumnsInfoPreset));
    __aspxRichEdit.LeftNarrowColumnsInfoPreset = LeftNarrowColumnsInfoPreset;
    var RightNarrowColumnsInfoPreset = (function (_super) {
        __extends(RightNarrowColumnsInfoPreset, _super);
        function RightNarrowColumnsInfoPreset() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RightNarrowColumnsInfoPreset.prototype.getFirstColumnRelativeWidth = function () { return 0.708; };
        return RightNarrowColumnsInfoPreset;
    }(TwoNonUniformColumnsInfoPreset));
    __aspxRichEdit.RightNarrowColumnsInfoPreset = RightNarrowColumnsInfoPreset;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogCustomNumberingListCommand = (function (_super) {
        __extends(DialogCustomNumberingListCommand, _super);
        function DialogCustomNumberingListCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogCustomNumberingListCommand.prototype.createParameters = function (options) {
            this.listType = options.param.listType;
            return options.param;
        };
        DialogCustomNumberingListCommand.prototype.applyParameters = function (_state, newParams) {
            var modelManipulator = this.control.modelManipulator;
            var activeSubDocument = modelManipulator.model.activeSubDocument;
            var history = this.control.history;
            var initParams = new DialogCustomNumberingListParameters();
            initParams.init(this.colorProvider, newParams.initAbstractNumberingList);
            if (initParams.equals(newParams)) {
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.InsertNumerationToParagraphs)
                    .execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, newParams.initAbstractNumberingList));
                return;
            }
            history.beginTransaction();
            var firstParagraph = activeSubDocument.getParagraphByPosition(this.control.selection.intervals[0].start);
            var abstractNumberingList = null;
            var abstractNumberingListIndex = -1;
            if (this.control.selection.isCollapsed() && firstParagraph.isInList()) {
                abstractNumberingList = newParams.initAbstractNumberingList;
                abstractNumberingListIndex = firstParagraph.getNumberingList().abstractNumberingListIndex;
                newParams.applyToParagraph = false;
            }
            else {
                abstractNumberingList = new __aspxRichEdit.AbstractNumberingList(this.control.model);
                abstractNumberingList.copyFrom(newParams.initAbstractNumberingList);
                history.addAndRedo(new __aspxRichEdit.AddAbstractNumberingListHistoryItem(this.control.modelManipulator, this.control.model.activeSubDocument, abstractNumberingList));
                abstractNumberingListIndex = this.control.model.abstractNumberingLists.length - 1;
            }
            for (var i = 0, length = newParams.levels.length; i < length; i++) {
                var level = newParams.levels[i];
                var initLevel = initParams.levels[i];
                if (level.displayFormatString != initLevel.displayFormatString)
                    history.addAndRedo(new __aspxRichEdit.ListLevelDisplayFormatStringHistoryItem(modelManipulator, activeSubDocument, true, abstractNumberingListIndex, i, level.displayFormatString));
                if (level.format != initLevel.format)
                    history.addAndRedo(new __aspxRichEdit.ListLevelFormatHistoryItem(modelManipulator, activeSubDocument, true, abstractNumberingListIndex, i, level.format));
                if (level.start != initLevel.start)
                    history.addAndRedo(new __aspxRichEdit.ListLevelStartHistoryItem(modelManipulator, activeSubDocument, true, abstractNumberingListIndex, i, level.start));
                if (level.alignment != initLevel.alignment)
                    history.addAndRedo(new __aspxRichEdit.ListLevelAlignmentHistoryItem(modelManipulator, activeSubDocument, true, abstractNumberingListIndex, i, level.alignment));
                if (level.separator != initLevel.separator)
                    history.addAndRedo(new __aspxRichEdit.ListLevelSeparatorHistoryItem(modelManipulator, activeSubDocument, true, abstractNumberingListIndex, i, level.separator));
                if (level.leftIndent != initLevel.leftIndent)
                    history.addAndRedo(new __aspxRichEdit.ListLevelParagraphLeftIndentHistoryItem(modelManipulator, activeSubDocument, true, abstractNumberingListIndex, i, level.leftIndent, true));
                if (level.firstLineIndent != initLevel.firstLineIndent)
                    history.addAndRedo(new __aspxRichEdit.ListLevelParagraphFirstLineIndentHistoryItem(modelManipulator, activeSubDocument, true, abstractNumberingListIndex, i, level.firstLineIndent, true));
                if (level.firstLineIndentType != initLevel.firstLineIndentType)
                    history.addAndRedo(new __aspxRichEdit.ListLevelParagraphFirstLineIndentTypeHistoryItem(modelManipulator, activeSubDocument, true, abstractNumberingListIndex, i, level.firstLineIndentType, true));
                var fontName = this.control.model.cache.fontInfoCache.getItemByName(level.fontName);
                var initFontName = this.control.model.cache.fontInfoCache.getItemByName(initLevel.fontName);
                if (fontName != initFontName)
                    history.addAndRedo(new __aspxRichEdit.ListLevelFontNameHistoryItem(modelManipulator, activeSubDocument, true, abstractNumberingListIndex, i, fontName, true));
                if (__aspxRichEdit.ColorHelper.hashToColor(level.fontColor) != __aspxRichEdit.ColorHelper.hashToColor(initLevel.fontColor))
                    history.addAndRedo(new __aspxRichEdit.ListLevelFontTextColorHistoryItem(modelManipulator, activeSubDocument, true, abstractNumberingListIndex, i, __aspxRichEdit.ColorModelInfo.makeByColor(__aspxRichEdit.ColorHelper.hashToColor(level.fontColor)), true));
                if (level.fontSize != initLevel.fontSize)
                    history.addAndRedo(new __aspxRichEdit.ListLevelFontSizeHistoryItem(modelManipulator, activeSubDocument, true, abstractNumberingListIndex, i, level.fontSize, true));
                var bold = !!(level.fontStyle & 1);
                var initBold = !!(initLevel.fontStyle & 1);
                if (bold != initBold)
                    history.addAndRedo(new __aspxRichEdit.ListLevelFontBoldHistoryItem(modelManipulator, activeSubDocument, true, abstractNumberingListIndex, i, bold, true));
                var italic = !!(level.fontStyle & 2);
                var initItalic = !!(initLevel.fontStyle & 2);
                if (italic != initItalic)
                    history.addAndRedo(new __aspxRichEdit.ListLevelFontItalicHistoryItem(modelManipulator, activeSubDocument, true, abstractNumberingListIndex, i, italic, true));
            }
            if (newParams.applyToParagraph)
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.InsertNumerationToParagraphs)
                    .execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, abstractNumberingList));
            history.endTransaction();
            return true;
        };
        DialogCustomNumberingListCommand.prototype.getDialogName = function () {
            switch (this.listType) {
                case __aspxRichEdit.NumberingType.Bullet:
                    return "BulletedList";
                case __aspxRichEdit.NumberingType.Simple:
                    return "SimpleNumberingList";
                case __aspxRichEdit.NumberingType.MultiLevel:
                    return "MultiLevelNumberingList";
            }
            return null;
        };
        return DialogCustomNumberingListCommand;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogCustomNumberingListCommand = DialogCustomNumberingListCommand;
    var DialogCustomNumberingListParameters = (function (_super) {
        __extends(DialogCustomNumberingListParameters, _super);
        function DialogCustomNumberingListParameters() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.currentLevel = 0;
            _this.levels = [];
            _this.coreInitialFontColors = [];
            _this.applyToParagraph = true;
            return _this;
        }
        DialogCustomNumberingListParameters.prototype.init = function (colorProvider, abstractNumberingList, currentLevel) {
            if (currentLevel != null)
                this.currentLevel = currentLevel;
            if (abstractNumberingList != null) {
                this.listType = abstractNumberingList.getListType();
                this.initAbstractNumberingList = abstractNumberingList;
                for (var i = 0; i < abstractNumberingList.levels.length; i++) {
                    var level = this.initLevel(colorProvider, abstractNumberingList.levels[i]);
                    this.levels.push(level);
                }
            }
        };
        DialogCustomNumberingListParameters.prototype.initLevel = function (colorProvider, listLevel) {
            var level = new CustomListlevel();
            var listLevelProperties = listLevel.getListLevelProperties();
            level.displayFormatString = listLevelProperties.displayFormatString;
            level.format = listLevelProperties.format;
            level.start = listLevelProperties.start;
            level.alignment = listLevelProperties.alignment;
            level.separator = listLevelProperties.separator;
            var paragraphProperties = listLevel.getParagraphProperties();
            level.leftIndent = paragraphProperties.leftIndent;
            level.firstLineIndent = paragraphProperties.firstLineIndent;
            level.firstLineIndentType = paragraphProperties.firstLineIndentType;
            var characterProperties = listLevel.getCharacterProperties();
            level.fontName = characterProperties.fontInfo.name;
            var foreColor = characterProperties.textColor.toRgb(colorProvider);
            level.fontColor = __aspxRichEdit.ColorHelper.colorToHash(foreColor);
            this.coreInitialFontColors.push(foreColor);
            level.fontSize = characterProperties.fontSize;
            level.fontStyle = (characterProperties.fontBold ? 1 : 0) | (characterProperties.fontItalic ? 2 : 0);
            return level;
        };
        DialogCustomNumberingListParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.currentLevel = obj.currentLevel;
            this.listType = obj.listType;
            this.applyToParagraph = obj.applyToParagraph;
            this.copyLevelsFrom(obj.levels);
        };
        DialogCustomNumberingListParameters.prototype.clone = function () {
            var newInstance = new DialogCustomNumberingListParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        DialogCustomNumberingListParameters.prototype.toAnotherMeasuringSystem = function (_converter) {
            return this;
        };
        DialogCustomNumberingListParameters.prototype.copyLevelsFrom = function (levels) {
            this.levels = [];
            for (var i = 0, length = levels.length; i < length; i++) {
                var level = new CustomListlevel();
                level.copyFrom(levels[i]);
                this.levels.push(level);
            }
        };
        DialogCustomNumberingListParameters.prototype.equals = function (obj) {
            for (var i = 0, level; level = obj.levels[i]; i++) {
                if (!level.equals(this.levels[i]))
                    return false;
            }
            return true;
        };
        return DialogCustomNumberingListParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.DialogCustomNumberingListParameters = DialogCustomNumberingListParameters;
    var CustomListlevel = (function () {
        function CustomListlevel() {
        }
        CustomListlevel.prototype.copyFrom = function (obj) {
            this.displayFormatString = obj.displayFormatString;
            this.format = obj.format;
            this.start = obj.start;
            this.alignment = obj.alignment;
            this.separator = obj.separator;
            this.leftIndent = obj.leftIndent;
            this.firstLineIndent = obj.firstLineIndent;
            this.firstLineIndentType = obj.firstLineIndentType;
            this.fontName = obj.fontName;
            this.fontColor = obj.fontColor;
            this.fontSize = obj.fontSize;
            this.fontStyle = obj.fontStyle;
        };
        CustomListlevel.prototype.equals = function (obj) {
            return this.displayFormatString == obj.displayFormatString &&
                this.format == obj.format &&
                this.start == obj.start &&
                this.alignment == obj.alignment &&
                this.separator == obj.separator &&
                this.leftIndent == obj.leftIndent &&
                this.firstLineIndent == obj.firstLineIndent &&
                this.firstLineIndentType == obj.firstLineIndentType &&
                this.fontName == obj.fontName &&
                this.fontColor == obj.fontColor &&
                this.fontSize == obj.fontSize &&
                this.fontStyle == obj.fontStyle;
        };
        return CustomListlevel;
    }());
    __aspxRichEdit.CustomListlevel = CustomListlevel;
    var NumberingListFormPreviewHelper = (function () {
        function NumberingListFormPreviewHelper(richEdit, abstractNumberingList, currentLevel) {
            this.richEdit = richEdit;
            this.abstractNumberingList = abstractNumberingList;
            this.currentLevel = currentLevel;
        }
        NumberingListFormPreviewHelper.prototype.createPreview = function () {
            var preview = document.createElement("div");
            for (var i = 0; i < 4; i++)
                preview.appendChild(this.createRowElement(i));
            return preview;
        };
        NumberingListFormPreviewHelper.prototype.createRowElement = function (index) {
            var separatorWidth = 7;
            var rowHeight = 25;
            var margin = 10;
            var foreColor = 0xbbbbbbbb;
            var fakeString = "▬▬▬▬▬▬▬▬▬";
            var isMultiLevel = this.abstractNumberingList.getListType() == __aspxRichEdit.NumberingType.MultiLevel;
            var currentLevelIndex = isMultiLevel ? index % NumberingListFormPreviewHelper.depth : this.currentLevel;
            var currentMajorIndex = isMultiLevel ? Math.floor(index / NumberingListFormPreviewHelper.depth) : index;
            var paragraphProperties = this.abstractNumberingList.levels[currentLevelIndex].getParagraphProperties();
            var characterProperties = this.abstractNumberingList.levels[currentLevelIndex].getCharacterProperties();
            var listBoxText = this.getNumberingListBoxText(currentLevelIndex, currentMajorIndex);
            var layoutNumberingListBox = new __aspxRichEdit.LayoutNumberingListBox(characterProperties, characterProperties.getLayoutColorInfo(this.richEdit.model.colorProvider), listBoxText, "", this.richEdit.model.cache.mergedCharacterPropertiesCache);
            __aspxRichEdit.LayoutBox.initializeWithMeasurer([new __aspxRichEdit.LayoutFormatter.Row.Box.BoxWrap(layoutNumberingListBox.textBox, null)], this.richEdit.measurer, false);
            var textBoxCharacterProperties = this.richEdit.model.defaultCharacterProperties.clone();
            textBoxCharacterProperties.textColor = __aspxRichEdit.ColorModelInfo.makeByColor(foreColor);
            var layoutTextBox = new __aspxRichEdit.LayoutTextBox(textBoxCharacterProperties, textBoxCharacterProperties.getLayoutColorInfo(this.richEdit.model.colorProvider), fakeString);
            __aspxRichEdit.LayoutBox.initializeWithMeasurer([new __aspxRichEdit.LayoutFormatter.Row.Box.BoxWrap(layoutTextBox, null)], this.richEdit.measurer, false);
            layoutTextBox.x = layoutNumberingListBox.textBox.width + separatorWidth;
            var layoutRow = new __aspxRichEdit.LayoutRow();
            layoutRow.numberingListBox = layoutNumberingListBox;
            layoutRow.boxes.push(layoutTextBox);
            layoutRow.height = Math.max(layoutNumberingListBox.textBox.height, rowHeight);
            layoutRow.width = layoutNumberingListBox.textBox.width + layoutTextBox.width;
            layoutRow.x = isMultiLevel ? __aspxRichEdit.UnitConverter.twipsToPixels(paragraphProperties.leftIndent - paragraphProperties.firstLineIndent) + margin : margin;
            layoutRow.y = index * layoutRow.height + margin;
            return this.richEdit.viewManager.renderer.renderRow(layoutRow, __aspxRichEdit.ZIndexHelper.mainHeaderFooterPageAreaLevel);
        };
        NumberingListFormPreviewHelper.prototype.getNumberingListBoxText = function (levelIndex, majorIndex) {
            var _a;
            var items = [];
            for (var j = 0; j <= levelIndex; j++) {
                var listLevelProperties = this.abstractNumberingList.levels[j].getListLevelProperties();
                var converter = __aspxRichEdit.OrdinalBasedNumberConverter.createConverter(listLevelProperties.format);
                items.push(converter.convertNumber(listLevelProperties.start + majorIndex));
            }
            var displayFormatString = this.abstractNumberingList.levels[levelIndex].getListLevelProperties().displayFormatString;
            return (_a = REWebUtils.Formatter).Format.apply(_a, [displayFormatString].concat(items));
        };
        NumberingListFormPreviewHelper.depth = 3;
        return NumberingListFormPreviewHelper;
    }());
    __aspxRichEdit.NumberingListFormPreviewHelper = NumberingListFormPreviewHelper;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogFindReplaceCommand = (function (_super) {
        __extends(DialogFindReplaceCommand, _super);
        function DialogFindReplaceCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogFindReplaceCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        DialogFindReplaceCommand.prototype.createParameters = function (_options) {
            var parameters = new FindReplaceDialogParameters();
            parameters.controller = this.control.searchManager;
            return parameters;
        };
        DialogFindReplaceCommand.prototype.applyParameters = function (_state, _params) {
            return true;
        };
        DialogFindReplaceCommand.prototype.getDialogName = function () {
            return "FindReplace";
        };
        DialogFindReplaceCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        DialogFindReplaceCommand.prototype.isModal = function () {
            return false;
        };
        DialogFindReplaceCommand.getTextForResult = function (control, subDocument, interval) {
            var entryContextRadius = 20;
            var paragraphInterval = subDocument.getParagraphByPosition(interval.start).interval;
            var searchPartText = DialogFindReplaceCommand.getTextForward(control, subDocument, interval.start, interval.end, interval.length);
            var leftPartText = DialogFindReplaceCommand.getTextBackward(control, subDocument, interval.start, paragraphInterval.start, entryContextRadius);
            var rightPartText = DialogFindReplaceCommand.getTextForward(control, subDocument, interval.end, paragraphInterval.end, entryContextRadius);
            var resultText = "" + REWebUtils.Str.EncodeHtml(leftPartText) + ("<b>" + REWebUtils.Str.EncodeHtml(searchPartText) + "</b>") + REWebUtils.Str.EncodeHtml(rightPartText);
            return resultText;
        };
        DialogFindReplaceCommand.getTextForward = function (control, subDocument, startPosition, endPosition, length) {
            var text = "";
            var charIterator = new __aspxRichEdit.ForwardCharacterIterator(control, subDocument, startPosition, endPosition);
            while (charIterator.nextChar() && text.length < length)
                text += charIterator.char;
            return charIterator.iterator.intervalEnd > charIterator.getCurrLogPosition() && text.length === length && charIterator.nextChar() ? text + "..." : text;
        };
        DialogFindReplaceCommand.getTextBackward = function (control, subDocument, startPosition, endPosition, length) {
            var text = "";
            var charIterator = new __aspxRichEdit.BackwardCharacterIterator(control, subDocument, endPosition, startPosition);
            while (charIterator.prevChar() && text.length < length)
                text = charIterator.char + text;
            return charIterator.iterator.intervalStart < charIterator.getCurrLogPosition() && text.length === length && charIterator.prevChar() ? "..." + text : text;
        };
        return DialogFindReplaceCommand;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogFindReplaceCommand = DialogFindReplaceCommand;
    var FindReplaceDialogParameters = (function (_super) {
        __extends(FindReplaceDialogParameters, _super);
        function FindReplaceDialogParameters() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FindReplaceDialogParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.controller = obj.controller;
        };
        FindReplaceDialogParameters.prototype.clone = function () {
            var newInstance = new FindReplaceDialogParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        FindReplaceDialogParameters.prototype.toAnotherMeasuringSystem = function (_converter) {
            return this;
        };
        return FindReplaceDialogParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.FindReplaceDialogParameters = FindReplaceDialogParameters;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogFinishAndMergeCommand = (function (_super) {
        __extends(DialogFinishAndMergeCommand, _super);
        function DialogFinishAndMergeCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogFinishAndMergeCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        DialogFinishAndMergeCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.fields) && this.control.mailMergeOptions.isEnabled;
        };
        DialogFinishAndMergeCommand.prototype.canModify = function () {
            return true;
        };
        DialogFinishAndMergeCommand.prototype.createParameters = function (_options) {
            var parameters = new FinishAndMergeDialogParameters();
            parameters.range = MailMergeExportRange.AllRecords;
            parameters.exportFrom = 1;
            parameters.exportRecordsCount = this.control.mailMergeOptions.recordCount;
            parameters.mergeMode = MergeMode.NewParagraph;
            return parameters;
        };
        DialogFinishAndMergeCommand.prototype.getDialogName = function () {
            return "FinishAndMerge";
        };
        return DialogFinishAndMergeCommand;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogFinishAndMergeCommand = DialogFinishAndMergeCommand;
    var FinishAndMergeDialogParameters = (function (_super) {
        __extends(FinishAndMergeDialogParameters, _super);
        function FinishAndMergeDialogParameters() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FinishAndMergeDialogParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.range = obj.range;
            this.exportFrom = obj.exportFrom;
            this.exportRecordsCount = obj.exportRecordsCount;
            this.mergeMode = obj.mergeMode;
        };
        FinishAndMergeDialogParameters.prototype.clone = function () {
            var newInstance = new FinishAndMergeDialogParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        FinishAndMergeDialogParameters.prototype.toAnotherMeasuringSystem = function (_converter) {
            return this;
        };
        return FinishAndMergeDialogParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.FinishAndMergeDialogParameters = FinishAndMergeDialogParameters;
    var MergeMode;
    (function (MergeMode) {
        MergeMode[MergeMode["NewParagraph"] = 0] = "NewParagraph";
        MergeMode[MergeMode["NewSection"] = 1] = "NewSection";
        MergeMode[MergeMode["JoinTables"] = 2] = "JoinTables";
    })(MergeMode = __aspxRichEdit.MergeMode || (__aspxRichEdit.MergeMode = {}));
    var MailMergeExportRange;
    (function (MailMergeExportRange) {
        MailMergeExportRange[MailMergeExportRange["AllRecords"] = 0] = "AllRecords";
        MailMergeExportRange[MailMergeExportRange["CurrentRecord"] = 1] = "CurrentRecord";
        MailMergeExportRange[MailMergeExportRange["Range"] = 2] = "Range";
    })(MailMergeExportRange = __aspxRichEdit.MailMergeExportRange || (__aspxRichEdit.MailMergeExportRange = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogFontCommandBase = (function (_super) {
        __extends(DialogFontCommandBase, _super);
        function DialogFontCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogFontCommandBase.prototype.getDialogName = function () {
            return "EditFont";
        };
        DialogFontCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.characterFormatting);
        };
        return DialogFontCommandBase;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogFontCommandBase = DialogFontCommandBase;
    var DialogFontCommand = (function (_super) {
        __extends(DialogFontCommand, _super);
        function DialogFontCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogFontCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.IntervalCommandStateEx(this.isEnabled(), this.getActualIntervals());
            state.visible = __aspxRichEdit.ControlOptions.isVisible(this.control.options.characterFormatting) && !this.control.selection.specialRunInfo.isPictureSelected();
            return state;
        };
        DialogFontCommand.prototype.getActualIntervals = function () {
            if (this.control.selection.isCollapsed())
                return [this.control.model.activeSubDocument.getWholeWordInterval(this.control.selection.intervals[0].start)];
            return this.control.selection.getIntervalsClone();
        };
        DialogFontCommand.prototype.createParameters = function (_options) {
            var parameters = new FontDialogParameters();
            parameters.init(this.colorProvider, this.control.inputPosition.getMergedCharacterPropertiesRaw());
            return parameters;
        };
        DialogFontCommand.prototype.applyParameters = function (_state, newParams, initParams) {
            var newProps = new __aspxRichEdit.CharacterProperties();
            newProps.allCaps = newParams.allCaps !== initParams.allCaps ? newParams.allCaps : undefined;
            newProps.fontInfo = newParams.fontName !== null && newParams.fontName !== initParams.fontName ?
                (this.control.model.cache.fontInfoCache.getItemByName(newParams.fontName) || undefined) : undefined;
            newProps.fontSize = newParams.fontSize !== null && newParams.fontSize !== initParams.fontSize ?
                newParams.fontSize : undefined;
            newProps.fontStrikeoutType = newParams.fontStrikeoutType !== null && newParams.fontStrikeoutType !== initParams.fontStrikeoutType ?
                newParams.fontStrikeoutType : undefined;
            newProps.fontBold = newParams.fontStyle !== null && newParams.fontStyle !== initParams.fontStyle && !!(newParams.fontStyle & 1) && (newParams.fontStyle & 1) !== (initParams.fontStyle & 1) ?
                !!(newParams.fontStyle & 1) : undefined;
            newProps.fontItalic = newParams.fontStyle !== null && newParams.fontStyle !== initParams.fontStyle && !!(newParams.fontStyle & 2) && (newParams.fontStyle & 2) !== (initParams.fontStyle & 2) ?
                !!(newParams.fontStyle & 2) : undefined;
            newProps.fontUnderlineType = newParams.fontUnderlineType !== null && newParams.fontUnderlineType !== initParams.fontUnderlineType ?
                newParams.fontUnderlineType : undefined;
            newProps.hidden = newParams.hidden !== initParams.hidden ? newParams.hidden : undefined;
            newProps.script = newParams.script !== null && newParams.script !== initParams.script ? newParams.script : undefined;
            newProps.underlineWordsOnly = newParams.underlineWordsOnly !== initParams.underlineWordsOnly ? newParams.underlineWordsOnly : undefined;
            newProps.textColor = newParams.fontColor !== null && newParams.fontColor !== initParams.fontColor ?
                __aspxRichEdit.ColorModelInfo.makeByColor(newParams.fontColor == "Auto" ? __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR : __aspxRichEdit.ColorHelper.stringToColor(newParams.fontColor)) : undefined;
            newProps.underlineColor = newParams.fontUnderlineColor !== null && newParams.fontUnderlineColor !== initParams.fontUnderlineColor ?
                __aspxRichEdit.ColorModelInfo.makeByColor(newParams.fontUnderlineColor == "Auto" ? __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR : __aspxRichEdit.ColorHelper.stringToColor(newParams.fontUnderlineColor))
                : undefined;
            var isResetBackColor = newParams.backColor !== initParams.backColor;
            newProps.shadingInfo = isResetBackColor ?
                __aspxRichEdit.ShadingInfo.createByColor(__aspxRichEdit.ColorModelInfo.makeByColor(newParams.backColor === null ? __aspxRichEdit.ColorHelper.NO_COLOR : __aspxRichEdit.ColorHelper.stringToColor(newParams.backColor)))
                : undefined;
            newProps.highlightColor = isResetBackColor ? __aspxRichEdit.ColorModelInfo.noColor : undefined;
            newProps.strikeoutWordsOnly = undefined;
            newProps.noProof = undefined;
            newProps.strikeoutColor = undefined;
            newProps.langInfo = undefined;
            newProps.compositeFontInfo = undefined;
            return new CharacterPropertiesApplier(this.control, newProps).apply();
        };
        return DialogFontCommand;
    }(DialogFontCommandBase));
    __aspxRichEdit.DialogFontCommand = DialogFontCommand;
    var DialogServiceFontCommand = (function (_super) {
        __extends(DialogServiceFontCommand, _super);
        function DialogServiceFontCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogServiceFontCommand.prototype.createParameters = function (options) {
            this.dialogCustomNumberingListParameters = options.param;
            var level = this.dialogCustomNumberingListParameters.levels[this.dialogCustomNumberingListParameters.currentLevel];
            var parameters = new FontDialogParameters();
            parameters.initServicePart(level);
            return parameters;
        };
        DialogServiceFontCommand.prototype.applyParameters = function (_state, params) {
            var level = this.dialogCustomNumberingListParameters.levels[this.dialogCustomNumberingListParameters.currentLevel];
            level.fontColor = params.fontColor;
            level.fontName = params.fontName;
            level.fontSize = params.fontSize;
            level.fontStyle = params.fontStyle;
            return false;
        };
        DialogServiceFontCommand.prototype.afterClosing = function () {
            var clientCommand = __aspxRichEdit.RichEditClientCommand.ShowCustomNumberingListForm;
            this.control.commandManager.getCommand(clientCommand).execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, this.dialogCustomNumberingListParameters));
        };
        return DialogServiceFontCommand;
    }(DialogFontCommandBase));
    __aspxRichEdit.DialogServiceFontCommand = DialogServiceFontCommand;
    var FontDialogParameters = (function (_super) {
        __extends(FontDialogParameters, _super);
        function FontDialogParameters() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.fontName = null;
            _this.fontStyle = null;
            _this.fontSize = null;
            _this.fontColor = null;
            _this.backColor = null;
            _this.fontUnderlineType = null;
            _this.fontUnderlineColor = null;
            _this.fontStrikeoutType = null;
            _this.underlineWordsOnly = null;
            _this.script = null;
            _this.allCaps = null;
            _this.hidden = null;
            return _this;
        }
        FontDialogParameters.prototype.init = function (colorProvider, rawCharProps) {
            this.allCaps = rawCharProps.allCaps;
            this.fontColor = rawCharProps.textColor ? FontDialogParameters.getColor(rawCharProps.textColor.toRgb(colorProvider)) : undefined;
            this.backColor = rawCharProps.shadingInfo && rawCharProps.highlightColor ?
                FontDialogParameters.getColor(__aspxRichEdit.CharacterProperties.getActualBackgroundColor(rawCharProps, colorProvider)) : undefined;
            this.fontName = rawCharProps.fontInfo ? rawCharProps.fontInfo.name : null;
            this.fontSize = rawCharProps.fontSize;
            this.fontStrikeoutType = rawCharProps.fontStrikeoutType;
            this.fontStyle = (rawCharProps.fontBold ? 1 : 0) | (rawCharProps.fontItalic ? 2 : 0);
            this.fontUnderlineColor = rawCharProps.underlineColor ? FontDialogParameters.getColor(rawCharProps.underlineColor.toRgb(colorProvider)) : undefined;
            this.fontUnderlineType = rawCharProps.fontUnderlineType;
            this.hidden = rawCharProps.hidden;
            this.script = rawCharProps.script;
            this.underlineWordsOnly = rawCharProps.underlineWordsOnly;
        };
        FontDialogParameters.getColor = function (color) {
            if (color === __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR)
                return "Auto";
            if (color === __aspxRichEdit.ColorHelper.NO_COLOR)
                return null;
            return color !== undefined ? __aspxRichEdit.ColorHelper.colorToHash(color).toUpperCase() : undefined;
        };
        FontDialogParameters.prototype.initServicePart = function (level) {
            this.fontColor = level.fontColor;
            this.fontName = level.fontName;
            this.fontSize = level.fontSize;
            this.fontStyle = level.fontStyle;
        };
        FontDialogParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.allCaps = obj.allCaps;
            this.fontColor = obj.fontColor;
            this.fontName = obj.fontName;
            this.fontSize = obj.fontSize;
            this.fontStrikeoutType = obj.fontStrikeoutType;
            this.fontStyle = obj.fontStyle;
            this.fontUnderlineColor = obj.fontUnderlineColor;
            this.fontUnderlineType = obj.fontUnderlineType;
            this.hidden = obj.hidden;
            this.script = obj.script;
            this.underlineWordsOnly = obj.underlineWordsOnly;
            this.backColor = obj.backColor;
        };
        FontDialogParameters.prototype.clone = function () {
            var newInstance = new FontDialogParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        FontDialogParameters.prototype.toAnotherMeasuringSystem = function (_converter) {
            return this;
        };
        return FontDialogParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.FontDialogParameters = FontDialogParameters;
    var CharacterPropertiesApplier = (function () {
        function CharacterPropertiesApplier(control, newCharProps) {
            this.control = control;
            this.newCharProps = newCharProps;
        }
        CharacterPropertiesApplier.prototype.apply = function () {
            this.modelManip = this.control.modelManipulator;
            this.subDoc = this.modelManip.model.activeSubDocument;
            var history = this.control.history;
            this.maskedCharProps = this.control.inputPosition.getMaskedCharacterProperties();
            this.charPropsRaw = this.control.inputPosition.getMergedCharacterPropertiesRaw();
            this.charPropsFull = this.control.inputPosition.getMergedCharacterPropertiesFull();
            this.charPropsRaw = this.control.inputPosition.getMergedCharacterPropertiesRaw();
            this.oldCharPropsRaw = this.charPropsRaw.clone();
            var changed = 0;
            this.intervals = this.control.selection.getIntervalsClone();
            history.beginTransaction();
            changed |= this.applyProp(__aspxRichEdit.CharacterPropertyDescriptor.allCaps);
            changed |= this.applyProp(__aspxRichEdit.CharacterPropertyDescriptor.size);
            changed |= this.applyProp(__aspxRichEdit.CharacterPropertyDescriptor.bold);
            changed |= this.applyProp(__aspxRichEdit.CharacterPropertyDescriptor.italic);
            changed |= this.applyProp(__aspxRichEdit.CharacterPropertyDescriptor.fontInfo);
            changed |= this.applyProp(__aspxRichEdit.CharacterPropertyDescriptor.script);
            changed |= this.applyProp(__aspxRichEdit.CharacterPropertyDescriptor.strikeoutType);
            changed |= this.applyProp(__aspxRichEdit.CharacterPropertyDescriptor.underlineType);
            changed |= this.applyProp(__aspxRichEdit.CharacterPropertyDescriptor.underlineWordsOnly);
            changed |= this.applyProp(__aspxRichEdit.CharacterPropertyDescriptor.strikeoutWordsOnly);
            changed |= this.applyProp(__aspxRichEdit.CharacterPropertyDescriptor.noProof);
            changed |= this.applyProp(__aspxRichEdit.CharacterPropertyDescriptor.hidden);
            changed |= this.applyProp(__aspxRichEdit.CharacterPropertyDescriptor.textColor);
            changed |= this.applyProp(__aspxRichEdit.CharacterPropertyDescriptor.shadingInfo);
            changed |= this.applyProp(__aspxRichEdit.CharacterPropertyDescriptor.highlightColor);
            changed |= this.applyProp(__aspxRichEdit.CharacterPropertyDescriptor.strikeoutColor);
            changed |= this.applyProp(__aspxRichEdit.CharacterPropertyDescriptor.underlineColor);
            changed |= this.applyProp(__aspxRichEdit.CharacterPropertyDescriptor.langInfo);
            changed |= this.applyProp(__aspxRichEdit.CharacterPropertyDescriptor.compositeFontInfo);
            history.endTransaction();
            return !!changed;
        };
        CharacterPropertiesApplier.prototype.applyProp = function (descriptor) {
            var newValue = descriptor.getProp(this.newCharProps);
            var currValue = descriptor.getProp(this.oldCharPropsRaw);
            if (newValue !== undefined && newValue !== currValue) {
                descriptor.setProp(this.maskedCharProps, newValue);
                descriptor.setProp(this.charPropsRaw, newValue);
                descriptor.setProp(this.charPropsFull, newValue);
                this.maskedCharProps.setUseValue(descriptor.maskValue(), true);
                for (var _i = 0, _a = this.intervals; _i < _a.length; _i++) {
                    var interval = _a[_i];
                    if (interval.length > 0)
                        this.control.history.addAndRedo(new (descriptor.getHistoryItemConstructor())(this.modelManip, this.subDoc, interval, newValue, true));
                }
                return 1;
            }
            return 0;
        };
        return CharacterPropertiesApplier;
    }());
    __aspxRichEdit.CharacterPropertiesApplier = CharacterPropertiesApplier;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogHyperlinkCommandBase = (function (_super) {
        __extends(DialogHyperlinkCommandBase, _super);
        function DialogHyperlinkCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogHyperlinkCommandBase.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.value = this.getStateValue();
            state.visible = this.isVisible();
            return state;
        };
        DialogHyperlinkCommandBase.prototype.getStateValue = function () {
            return this.getSelectedField();
        };
        DialogHyperlinkCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.hyperlinks) && this.control.selection.intervals.length === 1 &&
                __aspxRichEdit.CreateFieldCommandBase.isTableProtectionOk(this.control);
        };
        DialogHyperlinkCommandBase.prototype.isVisible = function () {
            return __aspxRichEdit.ControlOptions.isVisible(this.control.options.hyperlinks);
        };
        DialogHyperlinkCommandBase.prototype.createParameters = function (_options) {
            var parameters = new DialogHyperlinkParameters();
            parameters.canChangeDisplayText = this.canChangeDisplayText();
            var field = this.getState().value;
            if (field) {
                var hyperlinkInfo = field.getHyperlinkInfo();
                parameters.url = hyperlinkInfo.uri;
                parameters.anchor = hyperlinkInfo.anchor;
                parameters.tooltip = hyperlinkInfo.tip;
                parameters.text = __aspxRichEdit.FieldContextMenuHelper.getHyperlinkResultText(this.control.model.activeSubDocument, field);
            }
            else
                parameters.text = parameters.canChangeDisplayText ? this.control.model.activeSubDocument.getText(this.control.selection.intervals[0]) : "";
            parameters.bookmarkNames = __aspxRichEdit.ListUtils.map(this.control.model.getAllBookmarks(false), function (bm) { return bm.name; });
            return parameters;
        };
        DialogHyperlinkCommandBase.prototype.canChangeDisplayText = function () {
            var iterator = new __aspxRichEdit.ModelIterator(this.control.model.activeSubDocument, false);
            iterator.setPosition(this.control.selection.intervals[0].start);
            do {
                if (iterator.getAbsolutePosition() >= this.control.selection.intervals[0].end)
                    break;
                var runType = iterator.run.getType();
                if (runType == __aspxRichEdit.RunType.InlinePictureRun ||
                    runType == __aspxRichEdit.RunType.AnchoredPictureRun ||
                    runType == __aspxRichEdit.RunType.AnchoredTextBoxRun ||
                    runType == __aspxRichEdit.RunType.InlineTextBoxRun)
                    return false;
            } while (iterator.moveToNextRun());
            return true;
        };
        DialogHyperlinkCommandBase.prototype.applyParameters = function (state, newParams, initParams) {
            if (newParams.tooltip == initParams.tooltip && newParams.url == initParams.url && newParams.anchor == initParams.anchor && newParams.text == initParams.text)
                return;
            var hyperlinkInfo = new __aspxRichEdit.HyperlinkInfo(newParams.url, newParams.anchor, newParams.tooltip, false);
            if (hyperlinkInfo.anchor == "" && hyperlinkInfo.uri == "")
                return;
            var modelManipulator = this.control.modelManipulator;
            var selection = this.control.selection;
            var subDocument = this.control.model.activeSubDocument;
            var history = this.control.history;
            var oldSelection = selection.getLastSelectedInterval();
            if (oldSelection.end == subDocument.getDocumentEndPosition()) {
                oldSelection.length--;
                if (oldSelection.length < 0)
                    return;
            }
            history.beginTransaction();
            this.control.beginUpdate();
            var field = this.getField(state.value);
            history.addAndRedo(new __aspxRichEdit.ChangeFieldHyperlinkInfoHistoryItem(modelManipulator, subDocument, field.index, hyperlinkInfo));
            if (newParams.tooltip != initParams.tooltip || newParams.url != initParams.url || newParams.anchor != initParams.anchor) {
                selection.deprecatedSetSelection(field.getCodeStartPosition(), field.getSeparatorPosition(), false, selection.keepX, __aspxRichEdit.UpdateInputPositionProperties.No, false);
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.InsertText).execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, DialogHyperlinkCommandBase.getNewCodeText(hyperlinkInfo)));
            }
            if (initParams.canChangeDisplayText && newParams.text != initParams.text || field.getResultInterval().length == 0) {
                selection.deprecatedSetSelection(field.getResultStartPosition(), field.getResultEndPosition(), false, selection.keepX, __aspxRichEdit.UpdateInputPositionProperties.No, false);
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.InsertText).execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, !newParams.text || newParams.text == "" ? hyperlinkInfo.getUriPlusAnchor() : newParams.text));
            }
            history.addAndRedo(new __aspxRichEdit.ApplyFieldHyperlinkStyleHistoryItem(modelManipulator, this.control.model.activeSubDocument, field.getResultInterval()));
            selection.deprecatedSetSelection(field.getFieldEndPosition(), field.getFieldEndPosition(), false, selection.keepX, __aspxRichEdit.UpdateInputPositionProperties.No, false);
            this.control.endUpdate();
            history.endTransaction();
            return true;
        };
        DialogHyperlinkCommandBase.getNewCodeText = function (hyperlinkInfo) {
            return [
                "HYPERLINK \"",
                hyperlinkInfo.uri,
                "\"",
                hyperlinkInfo.tip == "" ? "" : " \\o \"" + hyperlinkInfo.tip + "\"",
                hyperlinkInfo.anchor == "" ? "" : " \\l \"" + hyperlinkInfo.anchor + "\""
            ].join("");
        };
        DialogHyperlinkCommandBase.prototype.getField = function (stateValue) {
            var field;
            if (stateValue) {
                field = stateValue;
                field.showCode = false;
            }
            else {
                var selection = this.control.selection;
                var subDocument = this.control.model.activeSubDocument;
                var initSelectionInterval = selection.getLastSelectedInterval();
                this.control.history.addAndRedo(new __aspxRichEdit.FieldInsertHistoryItem(this.control, this.control.modelManipulator, subDocument, initSelectionInterval.start, 0, initSelectionInterval.length, false));
                var fieldIndex = __aspxRichEdit.Field.normedBinaryIndexOf(subDocument.fields, initSelectionInterval.start + 1);
                field = subDocument.fields[fieldIndex];
            }
            return field;
        };
        DialogHyperlinkCommandBase.prototype.showCreateHyperlinkItem = function () {
            return __aspxRichEdit.FieldContextMenuHelper.showCreateHyperlinkItem(this.control.model.activeSubDocument.fields, this.control.selection.getLastSelectedInterval());
        };
        DialogHyperlinkCommandBase.prototype.getSelectedField = function () {
            return __aspxRichEdit.FieldContextMenuHelper.showHyperlinkItems(this.control.model.activeSubDocument.fields, this.control.selection.getLastSelectedInterval());
        };
        DialogHyperlinkCommandBase.prototype.hasOneSelectedHyperlink = function () {
            return !!this.getSelectedField();
        };
        DialogHyperlinkCommandBase.prototype.getDialogName = function () {
            return "Hyperlink";
        };
        return DialogHyperlinkCommandBase;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogHyperlinkCommandBase = DialogHyperlinkCommandBase;
    var DialogCreateOrEditHyperlinkCommand = (function (_super) {
        __extends(DialogCreateOrEditHyperlinkCommand, _super);
        function DialogCreateOrEditHyperlinkCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogCreateOrEditHyperlinkCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && (this.showCreateHyperlinkItem() || this.hasOneSelectedHyperlink());
        };
        return DialogCreateOrEditHyperlinkCommand;
    }(DialogHyperlinkCommandBase));
    __aspxRichEdit.DialogCreateOrEditHyperlinkCommand = DialogCreateOrEditHyperlinkCommand;
    var DialogCreateHyperlinkCommand = (function (_super) {
        __extends(DialogCreateHyperlinkCommand, _super);
        function DialogCreateHyperlinkCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogCreateHyperlinkCommand.prototype.isVisible = function () {
            return _super.prototype.isVisible.call(this) && this.showCreateHyperlinkItem();
        };
        return DialogCreateHyperlinkCommand;
    }(DialogHyperlinkCommandBase));
    __aspxRichEdit.DialogCreateHyperlinkCommand = DialogCreateHyperlinkCommand;
    var DialogEditHyperlinkCommand = (function (_super) {
        __extends(DialogEditHyperlinkCommand, _super);
        function DialogEditHyperlinkCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogEditHyperlinkCommand.prototype.isVisible = function () {
            return _super.prototype.isVisible.call(this) && this.hasOneSelectedHyperlink();
        };
        return DialogEditHyperlinkCommand;
    }(DialogHyperlinkCommandBase));
    __aspxRichEdit.DialogEditHyperlinkCommand = DialogEditHyperlinkCommand;
    var DialogHyperlinkParameters = (function (_super) {
        __extends(DialogHyperlinkParameters, _super);
        function DialogHyperlinkParameters() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.url = "";
            _this.text = "";
            _this.tooltip = "";
            _this.anchor = "";
            _this.bookmarkNames = [];
            _this.canChangeDisplayText = true;
            return _this;
        }
        DialogHyperlinkParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.url = obj.url;
            this.text = obj.text;
            this.tooltip = obj.tooltip;
            this.canChangeDisplayText = obj.canChangeDisplayText;
            this.bookmarkNames = obj.bookmarkNames;
        };
        DialogHyperlinkParameters.prototype.clone = function () {
            var newInstance = new DialogHyperlinkParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        DialogHyperlinkParameters.prototype.toAnotherMeasuringSystem = function (_converter) {
            return this;
        };
        return DialogHyperlinkParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.DialogHyperlinkParameters = DialogHyperlinkParameters;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogInsertImageCommand = (function (_super) {
        __extends(DialogInsertImageCommand, _super);
        function DialogInsertImageCommand(control) {
            return _super.call(this, control) || this;
        }
        DialogInsertImageCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.inlinePictures) && this.control.selection.intervals.length === 1;
        };
        DialogInsertImageCommand.prototype.createParameters = function (_options) {
            return new InsertImageDialogParameters();
        };
        DialogInsertImageCommand.prototype.applyParameters = function (_state, newParams) {
            var scaleX = 100;
            var scaleY = 100;
            var allowedSize = __aspxRichEdit.RichUtils.getAllowedSizeForImage(this.control);
            if (newParams.originalWidth > allowedSize.width)
                scaleX = (allowedSize.width / newParams.originalWidth) * 100;
            if (newParams.originalHeight > allowedSize.height)
                scaleY = (allowedSize.height / newParams.originalHeight) * 100;
            __aspxRichEdit.ModelManipulator.insertInlinePicture(this.control, this.control.selection.intervals[0].clone(), newParams.id, newParams.originalWidth, newParams.originalHeight, Math.min(scaleX, scaleY), Math.min(scaleX, scaleY), true);
            if (newParams.base64EncodedImage)
                this.control.model.cache.imageCache.add(newParams.id, newParams.base64EncodedImage);
            return true;
        };
        DialogInsertImageCommand.prototype.getDialogName = function () {
            return "InsertImage";
        };
        return DialogInsertImageCommand;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogInsertImageCommand = DialogInsertImageCommand;
    var InsertImageDialogParameters = (function (_super) {
        __extends(InsertImageDialogParameters, _super);
        function InsertImageDialogParameters() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.id = 0;
            return _this;
        }
        InsertImageDialogParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.id = obj.id;
            this.originalWidth = obj.originalWidth;
            this.originalHeight = obj.originalHeight;
            this.base64EncodedImage = obj.base64EncodedImage;
        };
        InsertImageDialogParameters.prototype.clone = function () {
            var newInstance = new InsertImageDialogParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        InsertImageDialogParameters.prototype.toAnotherMeasuringSystem = function (_converter) {
            return this;
        };
        return InsertImageDialogParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.InsertImageDialogParameters = InsertImageDialogParameters;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogInsertMergeFieldCommand = (function (_super) {
        __extends(DialogInsertMergeFieldCommand, _super);
        function DialogInsertMergeFieldCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogInsertMergeFieldCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        DialogInsertMergeFieldCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.fields) && this.control.mailMergeOptions.isEnabled;
        };
        DialogInsertMergeFieldCommand.prototype.createParameters = function (_options) {
            return new InsertMergeFieldDialogParameters();
        };
        DialogInsertMergeFieldCommand.prototype.applyParameters = function (_state, params) {
            if (params.fieldName != null) {
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.CreateMergeField).execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, params.fieldName));
                return true;
            }
            return false;
        };
        DialogInsertMergeFieldCommand.prototype.getDialogName = function () {
            return "InsertMergeField";
        };
        DialogInsertMergeFieldCommand.prototype.isModal = function () {
            return false;
        };
        return DialogInsertMergeFieldCommand;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogInsertMergeFieldCommand = DialogInsertMergeFieldCommand;
    var InsertMergeFieldDialogParameters = (function (_super) {
        __extends(InsertMergeFieldDialogParameters, _super);
        function InsertMergeFieldDialogParameters() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertMergeFieldDialogParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.fieldName = obj.fieldName;
        };
        InsertMergeFieldDialogParameters.prototype.clone = function () {
            var newInstance = new InsertMergeFieldDialogParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        InsertMergeFieldDialogParameters.prototype.toAnotherMeasuringSystem = function (_converter) {
            return this;
        };
        return InsertMergeFieldDialogParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.InsertMergeFieldDialogParameters = InsertMergeFieldDialogParameters;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogInsertTableCellsCommand = (function (_super) {
        __extends(DialogInsertTableCellsCommand, _super);
        function DialogInsertTableCellsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogInsertTableCellsCommand.prototype.getState = function () {
            var visible = this.control.selection.tableInfo.extendedData.numRows > 0;
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled() && visible);
            state.visible = visible;
            return state;
        };
        DialogInsertTableCellsCommand.prototype.createParameters = function (_options) {
            var parameters = new TableCellsDialogParameters();
            parameters.tableCellOperation = TableCellOperation.ShiftToTheVertically;
            return parameters;
        };
        DialogInsertTableCellsCommand.prototype.applyParameters = function (_state, params) {
            var command = __aspxRichEdit.RichEditClientCommand.None;
            switch (params.tableCellOperation) {
                case TableCellOperation.ShiftToTheHorizontally:
                    command = __aspxRichEdit.RichEditClientCommand.InsertTableCellWithShiftToTheLeft;
                    break;
                case TableCellOperation.ShiftToTheVertically:
                    command = __aspxRichEdit.RichEditClientCommand.InsertTableCellsWithShiftToTheVertically;
                    break;
                case TableCellOperation.RowOperation:
                    command = __aspxRichEdit.RichEditClientCommand.InsertTableRowAbove;
                    break;
                case TableCellOperation.ColumnOperation:
                    command = __aspxRichEdit.RichEditClientCommand.InsertTableColumnToTheLeft;
                    break;
            }
            return this.control.commandManager.getCommand(command).execute(this.control.commandManager.isPublicApiCall);
        };
        DialogInsertTableCellsCommand.prototype.getDialogName = function () {
            return "InsertTableCells";
        };
        return DialogInsertTableCellsCommand;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogInsertTableCellsCommand = DialogInsertTableCellsCommand;
    var DialogDeleteTableCellsCommand = (function (_super) {
        __extends(DialogDeleteTableCellsCommand, _super);
        function DialogDeleteTableCellsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogDeleteTableCellsCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.visible = this.control.selection.tableInfo.extendedData.numRows > 0 && !this.control.selection.specialRunInfo.isSelected();
            return state;
        };
        DialogDeleteTableCellsCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) &&
                __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables) &&
                (this.control.selection.tableInfo.extendedData.isSquare || this.control.selection.tableInfo.extendedData.numRows == 1);
        };
        DialogDeleteTableCellsCommand.prototype.createParameters = function (_options) {
            var parameters = new TableCellsDialogParameters();
            parameters.tableCellOperation = TableCellOperation.ShiftToTheHorizontally;
            return parameters;
        };
        DialogDeleteTableCellsCommand.prototype.applyParameters = function (_state, params) {
            var command = __aspxRichEdit.RichEditClientCommand.None;
            switch (params.tableCellOperation) {
                case TableCellOperation.ShiftToTheHorizontally:
                    command = __aspxRichEdit.RichEditClientCommand.DeleteTableCellsWithShiftToTheHorizontally;
                    break;
                case TableCellOperation.ShiftToTheVertically:
                    command = __aspxRichEdit.RichEditClientCommand.DeleteTableCellsWithShiftToTheVertically;
                    break;
                case TableCellOperation.RowOperation:
                    command = __aspxRichEdit.RichEditClientCommand.DeleteTableRows;
                    break;
                case TableCellOperation.ColumnOperation:
                    command = __aspxRichEdit.RichEditClientCommand.DeleteTableColumns;
                    break;
            }
            return this.control.commandManager.getCommand(command).execute(this.control.commandManager.isPublicApiCall);
        };
        DialogDeleteTableCellsCommand.prototype.getDialogName = function () {
            return "DeleteTableCells";
        };
        return DialogDeleteTableCellsCommand;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogDeleteTableCellsCommand = DialogDeleteTableCellsCommand;
    var TableCellsDialogParameters = (function (_super) {
        __extends(TableCellsDialogParameters, _super);
        function TableCellsDialogParameters() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellsDialogParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.tableCellOperation = obj.tableCellOperation;
        };
        TableCellsDialogParameters.prototype.clone = function () {
            var newInstance = new TableCellsDialogParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        TableCellsDialogParameters.prototype.toAnotherMeasuringSystem = function (_converter) {
            return this;
        };
        return TableCellsDialogParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.TableCellsDialogParameters = TableCellsDialogParameters;
    var TableCellOperation;
    (function (TableCellOperation) {
        TableCellOperation[TableCellOperation["ShiftToTheHorizontally"] = 0] = "ShiftToTheHorizontally";
        TableCellOperation[TableCellOperation["ShiftToTheVertically"] = 1] = "ShiftToTheVertically";
        TableCellOperation[TableCellOperation["RowOperation"] = 2] = "RowOperation";
        TableCellOperation[TableCellOperation["ColumnOperation"] = 3] = "ColumnOperation";
    })(TableCellOperation = __aspxRichEdit.TableCellOperation || (__aspxRichEdit.TableCellOperation = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogInsertTableCommand = (function (_super) {
        __extends(DialogInsertTableCommand, _super);
        function DialogInsertTableCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogInsertTableCommand.prototype.createParameters = function (_options) {
            var parameters = new InsertTableDialogParameters();
            parameters.rowCount = 2;
            parameters.columnCount = 5;
            return parameters;
        };
        DialogInsertTableCommand.prototype.applyParameters = function (_state, params) {
            if (params.rowCount > 0 && params.columnCount > 0) {
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.InsertTableCore).execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, { rowCount: params.rowCount, cellCount: params.columnCount }));
                return true;
            }
            return false;
        };
        DialogInsertTableCommand.prototype.getDialogName = function () {
            return "InsertTable";
        };
        return DialogInsertTableCommand;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogInsertTableCommand = DialogInsertTableCommand;
    var InsertTableDialogParameters = (function (_super) {
        __extends(InsertTableDialogParameters, _super);
        function InsertTableDialogParameters() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertTableDialogParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.rowCount = obj.rowCount;
            this.columnCount = obj.columnCount;
        };
        InsertTableDialogParameters.prototype.clone = function () {
            var newInstance = new InsertTableDialogParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        InsertTableDialogParameters.prototype.toAnotherMeasuringSystem = function (_converter) {
            return this;
        };
        return InsertTableDialogParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.InsertTableDialogParameters = InsertTableDialogParameters;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogLayoutOptionsCommand = (function (_super) {
        __extends(DialogLayoutOptionsCommand, _super);
        function DialogLayoutOptionsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogLayoutOptionsCommand.prototype.getState = function () {
            var enabled = this.isEnabled();
            var state = new __aspxRichEdit.SimpleCommandState(enabled);
            state.visible = enabled;
            return state;
        };
        DialogLayoutOptionsCommand.prototype.isEnabled = function () {
            var specialRunInfo = this.control.selection.specialRunInfo;
            return _super.prototype.isEnabled.call(this) && specialRunInfo.isSelected() &&
                this.getFloatingObjectParentSubDocument().isEditable([new __aspxRichEdit.FixedInterval(specialRunInfo.getPosition(), 1)]);
        };
        DialogLayoutOptionsCommand.prototype.createParameters = function (_options) {
            var dialogParameters = new LayoutOptionsDialogParameters();
            var specialRunInfo = this.control.selection.specialRunInfo;
            var run = specialRunInfo.getParentSubDocument().getRunByPosition(specialRunInfo.getPosition());
            if (run.getType() === __aspxRichEdit.RunType.InlinePictureRun)
                dialogParameters.init(null, run.size, null, this.control);
            else {
                if (run.getType() === __aspxRichEdit.RunType.AnchoredPictureRun) {
                    var anchoredRun = run;
                    dialogParameters.init(anchoredRun.anchorInfo, anchoredRun.size, null, this.control);
                }
                else {
                    var anchoredRun = run;
                    dialogParameters.init(anchoredRun.anchorInfo, anchoredRun.size, anchoredRun.textBoxProperties, this.control);
                }
            }
            return dialogParameters;
        };
        DialogLayoutOptionsCommand.prototype.applyParameters = function (_state, params, initParams) {
            var specialRunInfo = this.control.selection.specialRunInfo;
            var position = specialRunInfo.getPosition();
            var interval = new __aspxRichEdit.FixedInterval(position, 1);
            var subDocument = specialRunInfo.getParentSubDocument();
            var run = subDocument.getRunByPosition(position);
            var modelManipulator = this.control.modelManipulator;
            var anchorInfoManipulator = modelManipulator.floatingObjectsManipulator.anchorInfo;
            var topInfo = this.control.viewManager.canvasManager.getScrollTopInfo();
            var history = this.control.history;
            history.beginTransaction();
            var changed = false;
            var sizeChanged = false;
            if (initParams.wrapType !== null && params.wrapType === null && run.getType() === __aspxRichEdit.RunType.AnchoredPictureRun) {
                var pictureRun = run;
                __aspxRichEdit.ModelManipulator.insertInlinePicture(this.control, interval, pictureRun.id, pictureRun.size.originalSize.width, pictureRun.size.originalSize.height, pictureRun.size.scale.width, pictureRun.size.scale.height, true);
                run = subDocument.getRunByPosition(interval.start);
                changed = true;
            }
            if (initParams.wrapType === null && params.wrapType !== null && run.getType() === __aspxRichEdit.RunType.InlinePictureRun) {
                var pictureRun = run;
                var newAnchorInfo = new __aspxRichEdit.AnchorInfo();
                newAnchorInfo.zOrder = __aspxRichEdit.ZOrderManipulator.getNewZOrder(modelManipulator.model.activeSubDocument);
                __aspxRichEdit.FloatingObjectsManipulator.insertAnchoredPicture(this.control, interval, pictureRun.id, pictureRun.size, new __aspxRichEdit.Shape(), newAnchorInfo, pictureRun.isLoaded);
                run = subDocument.getRunByPosition(interval.start);
                changed = true;
            }
            if (run.getType() != __aspxRichEdit.RunType.InlinePictureRun && params.horizontalPositionAlignment !== undefined && params.horizontalPositionAlignment != initParams.horizontalPositionAlignment) {
                history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, subDocument, interval, params.horizontalPositionAlignment, anchorInfoManipulator.horizontalPositionAlignment));
                changed = true;
            }
            if (run.getType() != __aspxRichEdit.RunType.InlinePictureRun && params.horizontalPositionType !== undefined && params.horizontalPositionType != initParams.horizontalPositionType) {
                history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, subDocument, interval, params.horizontalPositionType, anchorInfoManipulator.horizontalPositionType));
                changed = true;
            }
            if (run.getType() != __aspxRichEdit.RunType.InlinePictureRun && params.offsetX !== undefined && params.offsetX != initParams.offsetX) {
                history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, subDocument, interval, params.offsetX, anchorInfoManipulator.offsetX));
                changed = true;
            }
            if (run.getType() != __aspxRichEdit.RunType.InlinePictureRun && params.percentOffsetX !== undefined && params.percentOffsetX != initParams.percentOffsetX) {
                history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, subDocument, interval, params.percentOffsetX, anchorInfoManipulator.percentOffsetX));
                changed = true;
            }
            if (run.getType() != __aspxRichEdit.RunType.InlinePictureRun && params.verticalPositionAlignment !== undefined && params.verticalPositionAlignment != initParams.verticalPositionAlignment) {
                history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, subDocument, interval, params.verticalPositionAlignment, anchorInfoManipulator.verticalPositionAlignment));
                changed = true;
            }
            if (run.getType() != __aspxRichEdit.RunType.InlinePictureRun && params.verticalPositionType !== undefined && params.verticalPositionType != initParams.verticalPositionType) {
                history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, subDocument, interval, params.verticalPositionType, anchorInfoManipulator.verticalPositionType));
                changed = true;
            }
            if (run.getType() != __aspxRichEdit.RunType.InlinePictureRun && params.offsetY !== undefined && params.offsetY != initParams.offsetY) {
                history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, subDocument, interval, params.offsetY, anchorInfoManipulator.offsetY));
                changed = true;
            }
            if (run.getType() != __aspxRichEdit.RunType.InlinePictureRun && params.percentOffsetY !== undefined && params.percentOffsetY != initParams.percentOffsetY) {
                history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, subDocument, interval, params.percentOffsetY, anchorInfoManipulator.percentOffsetY));
                changed = true;
            }
            if (run.getType() != __aspxRichEdit.RunType.InlinePictureRun && params.locked !== undefined && params.locked != initParams.locked) {
                history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, subDocument, interval, params.locked, anchorInfoManipulator.locked));
                changed = true;
            }
            if (run.getType() != __aspxRichEdit.RunType.InlinePictureRun && params.wrapType !== undefined && params.wrapType !== null && params.wrapType != initParams.wrapType) {
                history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, subDocument, interval, params.wrapType, anchorInfoManipulator.wrapType));
                changed = true;
            }
            if (run.getType() != __aspxRichEdit.RunType.InlinePictureRun && params.wrapSide !== undefined && params.wrapSide != initParams.wrapSide) {
                history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, subDocument, interval, params.wrapSide, anchorInfoManipulator.wrapSide));
                changed = true;
            }
            if (run.getType() != __aspxRichEdit.RunType.InlinePictureRun && params.topDistance !== undefined && params.topDistance != initParams.topDistance) {
                history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, subDocument, interval, params.topDistance, anchorInfoManipulator.topDistance));
                changed = true;
            }
            if (run.getType() != __aspxRichEdit.RunType.InlinePictureRun && params.bottomDistance !== undefined && params.bottomDistance != initParams.bottomDistance) {
                history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, subDocument, interval, params.bottomDistance, anchorInfoManipulator.bottomDistance));
                changed = true;
            }
            if (run.getType() != __aspxRichEdit.RunType.InlinePictureRun && params.leftDistance !== undefined && params.leftDistance != initParams.leftDistance) {
                history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, subDocument, interval, params.leftDistance, anchorInfoManipulator.leftDistance));
                changed = true;
            }
            if (run.getType() != __aspxRichEdit.RunType.InlinePictureRun && params.rightDistance !== undefined && params.rightDistance != initParams.rightDistance) {
                history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, subDocument, interval, params.rightDistance, anchorInfoManipulator.rightDistance));
                changed = true;
            }
            var size = run.size.clone();
            if (params.absoluteHeight !== undefined && params.absoluteHeight != initParams.absoluteHeight || params.absoluteWidth !== undefined && params.absoluteWidth != initParams.absoluteWidth) {
                if (size instanceof __aspxRichEdit.PictureSize) {
                    var pictureRun = run;
                    var scaleX = (params.absoluteWidth / pictureRun.size.originalSize.width) * 100;
                    var scaleY = (params.absoluteHeight / pictureRun.size.originalSize.height) * 100;
                    var scale = new __aspxRichEdit.Size(scaleX, scaleY);
                    size.scale = scale;
                }
                else {
                    size.absoluteSize.width = params.absoluteWidth;
                    size.absoluteSize.height = params.absoluteHeight;
                }
                sizeChanged = true;
            }
            if (initParams.useAbsoluteHeight !== undefined && params.useAbsoluteHeight !== initParams.useAbsoluteHeight && size instanceof __aspxRichEdit.AnchorTextBoxSize) {
                if (params.useAbsoluteHeight) {
                    size.absoluteSize.height = params.absoluteHeight;
                    params.textBoxProperties.resizeShapeToFitText = false;
                }
                size.setUseAbsoluteHeight(params.useAbsoluteHeight);
                sizeChanged = true;
            }
            if (initParams.useAbsoluteWidth !== undefined && params.useAbsoluteWidth !== initParams.useAbsoluteWidth && size instanceof __aspxRichEdit.AnchorTextBoxSize) {
                if (params.useAbsoluteWidth)
                    size.absoluteSize.width = params.absoluteWidth;
                size.setUseAbsoluteWidth(params.useAbsoluteWidth);
                sizeChanged = true;
            }
            if (initParams.relativeHeight !== undefined && params.relativeHeight !== initParams.relativeHeight && size instanceof __aspxRichEdit.AnchorTextBoxSize) {
                size.relativeSize.height = params.relativeHeight;
                sizeChanged = true;
            }
            if (initParams.relativeWidth !== undefined && params.relativeWidth !== initParams.relativeWidth && size instanceof __aspxRichEdit.AnchorTextBoxSize) {
                size.relativeSize.width = params.relativeWidth;
                sizeChanged = true;
            }
            if (initParams.relativeHeightType !== undefined && params.relativeHeightType !== initParams.relativeHeightType && size instanceof __aspxRichEdit.AnchorTextBoxSize) {
                size.relativeHeightType = params.relativeHeightType;
                sizeChanged = true;
            }
            if (initParams.relativeWidthType !== undefined && params.relativeWidthType !== initParams.relativeWidthType && size instanceof __aspxRichEdit.AnchorTextBoxSize) {
                size.relativeWidthType = params.relativeWidthType;
                sizeChanged = true;
            }
            if (params.rotation !== undefined && params.rotation != initParams.rotation) {
                size.rotation = __aspxRichEdit.UnitConverter.degreesToModelUnits(params.rotation);
                sizeChanged = true;
            }
            if (params.lockAspectRatio !== undefined && params.lockAspectRatio != initParams.lockAspectRatio) {
                size.lockAspectRatio = params.lockAspectRatio;
                sizeChanged = true;
            }
            if (params.isBehindDoc !== undefined && params.isBehindDoc != initParams.isBehindDoc) {
                history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, subDocument, interval, params.isBehindDoc, anchorInfoManipulator.isBehindDoc));
                changed = true;
            }
            if (sizeChanged) {
                if (size instanceof __aspxRichEdit.PictureSize)
                    if (run.getType() === __aspxRichEdit.RunType.InlinePictureRun) {
                        history.addAndRedo(new __aspxRichEdit.ChangeRectangularObjectScaleHistoryItem(modelManipulator, subDocument, interval, size.scale));
                        if (params.lockAspectRatio != initParams.lockAspectRatio)
                            history.addAndRedo(new __aspxRichEdit.ChangeRectangularObjectLockAspectRatioHistoryItem(modelManipulator, subDocument, interval, size.lockAspectRatio));
                    }
                    else
                        history.addAndRedo(new __aspxRichEdit.ChangeAnchoredPictureSizeHistoryItem(modelManipulator, subDocument, interval, size));
                else
                    history.addAndRedo(new __aspxRichEdit.ChangeAnchoredTextBoxSizeHistoryItem(modelManipulator, subDocument, interval, size));
                changed = true;
            }
            if (initParams.textBoxProperties !== undefined && !params.textBoxProperties.equals(initParams.textBoxProperties)) {
                history.addAndRedo(new __aspxRichEdit.ChangeTextBoxPropertiesHistoryItem(modelManipulator, subDocument, interval, params.textBoxProperties));
                changed = true;
            }
            history.endTransaction();
            if (topInfo)
                this.control.selection.scrollManager.setScroll(new __aspxRichEdit.Scroll.State().byScrollInfo.setPageInfo(topInfo));
            return changed;
        };
        DialogLayoutOptionsCommand.prototype.getDialogName = function () {
            return "LayoutOptions";
        };
        return DialogLayoutOptionsCommand;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogLayoutOptionsCommand = DialogLayoutOptionsCommand;
    var LayoutOptionsDialogParameters = (function (_super) {
        __extends(LayoutOptionsDialogParameters, _super);
        function LayoutOptionsDialogParameters() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutOptionsDialogParameters.prototype.init = function (anchorInfo, size, textBoxProperties, control) {
            var isAnchoredObject = anchorInfo !== null;
            this.horizontalPositionType = isAnchoredObject ? anchorInfo.horizontalPositionType : __aspxRichEdit.AnchorObjectHorizontalPositionType.Column;
            this.horizontalPositionAlignment = isAnchoredObject ? anchorInfo.horizontalPositionAlignment : __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Center;
            this.verticalPositionType = isAnchoredObject ? anchorInfo.verticalPositionType : __aspxRichEdit.AnchorObjectVerticalPositionType.Paragraph;
            this.verticalPositionAlignment = isAnchoredObject ? anchorInfo.verticalPositionAlignment : __aspxRichEdit.AnchorObjectVerticalPositionAlignment.Top;
            this.offsetX = isAnchoredObject ? anchorInfo.offset.x : null;
            this.offsetY = isAnchoredObject ? anchorInfo.offset.y : null;
            this.percentOffsetX = isAnchoredObject ? anchorInfo.percentOffset.x : null;
            this.percentOffsetY = isAnchoredObject ? anchorInfo.percentOffset.y : null;
            this.locked = isAnchoredObject ? anchorInfo.locked : null;
            this.wrapType = isAnchoredObject ? anchorInfo.wrapType : null;
            this.wrapSide = isAnchoredObject ? anchorInfo.wrapSide : null;
            this.isBehindDoc = isAnchoredObject ? anchorInfo.isBehindDoc : null;
            this.leftDistance = isAnchoredObject ? anchorInfo.leftDistance : null;
            this.rightDistance = isAnchoredObject ? anchorInfo.rightDistance : null;
            this.topDistance = isAnchoredObject ? anchorInfo.topDistance : null;
            this.bottomDistance = isAnchoredObject ? anchorInfo.bottomDistance : null;
            this.rotation = __aspxRichEdit.UnitConverter.modelUnitsToDegrees(size.rotation);
            this.lockAspectRatio = size.lockAspectRatio;
            if (size instanceof __aspxRichEdit.PictureSize) {
                var pictureSize = size;
                this.originalWidth = pictureSize.originalSize.width;
                this.originalHeight = pictureSize.originalSize.height;
                this.absoluteWidth = (pictureSize.originalSize.width * pictureSize.scale.width) / 100;
                this.absoluteHeight = (pictureSize.originalSize.height * pictureSize.scale.height) / 100;
            }
            else {
                var section = control.model.getSectionByPosition(control.selection.intervals[0].start);
                var boundsCalculator = new __aspxRichEdit.LayoutFormatter.BoundsCalculator();
                boundsCalculator.init(section);
                var textBoxSize = size;
                this.useAbsoluteHeight = textBoxSize.useAbsoluteHeight();
                this.useAbsoluteWidth = textBoxSize.useAbsoluteWidth();
                this.absoluteWidth = this.useAbsoluteWidth ?
                    textBoxSize.absoluteSize.width :
                    __aspxRichEdit.UnitConverter.pixelsToTwips(textBoxSize.getActualRelativeWidth(boundsCalculator));
                this.absoluteHeight = this.useAbsoluteHeight ?
                    textBoxSize.absoluteSize.height :
                    __aspxRichEdit.UnitConverter.pixelsToTwips(textBoxSize.getActualRelativeHeight(boundsCalculator));
                this.relativeWidth = textBoxSize.relativeSize.width;
                this.relativeHeight = textBoxSize.relativeSize.height;
                this.relativeWidthType = textBoxSize.relativeWidthType;
                this.relativeHeightType = textBoxSize.relativeHeightType;
                this.originalWidth = this.absoluteWidth;
                this.originalHeight = this.absoluteHeight;
            }
            if (isAnchoredObject) {
                if (anchorInfo.isUsedHorizontalAlignment())
                    this.horizontalAligmentType = LayoutDialogAlignmentType.Alignment;
                else if (anchorInfo.isUsedHorizontalBookLayout())
                    this.horizontalAligmentType = LayoutDialogAlignmentType.BookLayout;
                else
                    this.horizontalAligmentType = anchorInfo.isUsedHorizontalRelativePosition() ? LayoutDialogAlignmentType.Relative : LayoutDialogAlignmentType.Absolute;
                if (anchorInfo.isUsedVerticalAlignment())
                    this.verticalAligmentType = LayoutDialogAlignmentType.Alignment;
                else
                    this.verticalAligmentType = anchorInfo.isUsedVerticalRelativePosition() ? LayoutDialogAlignmentType.Relative : LayoutDialogAlignmentType.Absolute;
            }
            else {
                this.horizontalAligmentType = LayoutDialogAlignmentType.Absolute;
                this.verticalAligmentType = LayoutDialogAlignmentType.Absolute;
            }
            if (textBoxProperties)
                this.textBoxProperties = new __aspxRichEdit.TextBoxProperties(textBoxProperties.getContentMargins());
        };
        LayoutOptionsDialogParameters.prototype.copyFrom = function (obj) {
            this.horizontalPositionType = obj.horizontalPositionType;
            this.horizontalPositionAlignment = obj.horizontalPositionAlignment;
            this.verticalPositionType = obj.verticalPositionType;
            this.verticalPositionAlignment = obj.verticalPositionAlignment;
            this.offsetX = obj.offsetX;
            this.offsetY = obj.offsetY;
            this.percentOffsetX = obj.percentOffsetX;
            this.percentOffsetY = obj.percentOffsetY;
            this.locked = obj.locked;
            this.wrapType = obj.wrapType;
            this.wrapSide = obj.wrapSide;
            this.isBehindDoc = obj.isBehindDoc;
            this.leftDistance = obj.leftDistance;
            this.rightDistance = obj.rightDistance;
            this.topDistance = obj.topDistance;
            this.bottomDistance = obj.bottomDistance;
            this.originalWidth = obj.originalWidth;
            this.originalHeight = obj.originalHeight;
            this.absoluteHeight = obj.absoluteHeight;
            this.absoluteWidth = obj.absoluteWidth;
            this.useAbsoluteHeight = obj.useAbsoluteHeight;
            this.useAbsoluteWidth = obj.useAbsoluteWidth;
            this.relativeHeight = obj.relativeHeight;
            this.relativeWidth = obj.relativeWidth;
            this.relativeHeightType = obj.relativeHeightType;
            this.relativeWidthType = obj.relativeWidthType;
            this.rotation = obj.rotation;
            this.lockAspectRatio = obj.lockAspectRatio;
            this.horizontalAligmentType = obj.horizontalAligmentType;
            this.verticalAligmentType = obj.verticalAligmentType;
            this.textBoxProperties = obj.textBoxProperties ? obj.textBoxProperties.clone() : obj.textBoxProperties;
        };
        LayoutOptionsDialogParameters.prototype.clone = function () {
            var newInstance = new LayoutOptionsDialogParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        LayoutOptionsDialogParameters.prototype.toAnotherMeasuringSystem = function (converterFunc) {
            if (this.offsetX)
                this.offsetX = converterFunc(this.offsetX);
            if (this.offsetY)
                this.offsetY = converterFunc(this.offsetY);
            if (this.leftDistance)
                this.leftDistance = converterFunc(this.leftDistance);
            if (this.rightDistance)
                this.rightDistance = converterFunc(this.rightDistance);
            if (this.topDistance)
                this.topDistance = converterFunc(this.topDistance);
            if (this.bottomDistance)
                this.bottomDistance = converterFunc(this.bottomDistance);
            if (this.absoluteHeight)
                this.absoluteHeight = converterFunc(this.absoluteHeight);
            if (this.absoluteWidth)
                this.absoluteWidth = converterFunc(this.absoluteWidth);
            if (this.originalWidth)
                this.originalWidth = converterFunc(this.originalWidth);
            if (this.originalHeight)
                this.originalHeight = converterFunc(this.originalHeight);
            if (this.textBoxProperties)
                this.textBoxProperties.setMarginsToAnotherMeasuringSystem(converterFunc);
            return this;
        };
        return LayoutOptionsDialogParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.LayoutOptionsDialogParameters = LayoutOptionsDialogParameters;
    var LayoutDialogAlignmentType;
    (function (LayoutDialogAlignmentType) {
        LayoutDialogAlignmentType[LayoutDialogAlignmentType["Alignment"] = 0] = "Alignment";
        LayoutDialogAlignmentType[LayoutDialogAlignmentType["BookLayout"] = 1] = "BookLayout";
        LayoutDialogAlignmentType[LayoutDialogAlignmentType["Absolute"] = 2] = "Absolute";
        LayoutDialogAlignmentType[LayoutDialogAlignmentType["Relative"] = 3] = "Relative";
    })(LayoutDialogAlignmentType = __aspxRichEdit.LayoutDialogAlignmentType || (__aspxRichEdit.LayoutDialogAlignmentType = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogNumberingListCommand = (function (_super) {
        __extends(DialogNumberingListCommand, _super);
        function DialogNumberingListCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogNumberingListCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.visible = (__aspxRichEdit.ControlOptions.isVisible(this.control.options.numberingBulleted) || __aspxRichEdit.ControlOptions.isVisible(this.control.options.numberingMultiLevel) ||
                __aspxRichEdit.ControlOptions.isVisible(this.control.options.numberingSimple)) && !this.control.selection.specialRunInfo.isPictureSelected();
            return state;
        };
        DialogNumberingListCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && (__aspxRichEdit.ControlOptions.isEnabled(this.control.options.numberingBulleted) || __aspxRichEdit.ControlOptions.isEnabled(this.control.options.numberingMultiLevel) || __aspxRichEdit.ControlOptions.isEnabled(this.control.options.numberingSimple));
        };
        DialogNumberingListCommand.prototype.createParameters = function (options) {
            var dialogParameters = new DialogNumberingListParameters();
            if (options.param instanceof __aspxRichEdit.AbstractNumberingList)
                dialogParameters.selectedAbstractNumberingList = options.param;
            else if (!this.areThereParagraphsInDifferentLists())
                dialogParameters.selectedAbstractNumberingList = this.getSelectedAbstractNumberingList();
            var paragraphsIndices = this.control.model.activeSubDocument.getParagraphIndicesByIntervals(this.control.selection.intervals);
            var levelIndex = -1;
            for (var i = 0; i < paragraphsIndices.length; i++) {
                var paragraph = this.control.model.activeSubDocument.paragraphs[paragraphsIndices[i]];
                if (paragraph.isInList())
                    levelIndex = levelIndex < 0 ? paragraph.getListLevelIndex() : Math.min(levelIndex, paragraph.getListLevelIndex());
                else {
                    levelIndex = 0;
                    break;
                }
            }
            dialogParameters.currentLevel = levelIndex;
            return dialogParameters;
        };
        DialogNumberingListCommand.prototype.areThereParagraphsInDifferentLists = function () {
            var prevNumbListIndex = -1;
            var paragraphsIndices = this.control.model.activeSubDocument.getParagraphIndicesByIntervals(this.control.selection.intervals);
            var paragraphsIndicesLength = paragraphsIndices.length;
            for (var i = 0; i < paragraphsIndicesLength; i++) {
                var paragraphIndex = paragraphsIndices[i];
                var paragraph = this.control.model.activeSubDocument.paragraphs[paragraphIndex];
                if (!paragraph.isInList())
                    continue;
                if (prevNumbListIndex == -1) {
                    prevNumbListIndex = paragraph.numberingListIndex;
                    continue;
                }
                if (prevNumbListIndex != paragraph.numberingListIndex)
                    return true;
            }
            return false;
        };
        DialogNumberingListCommand.prototype.getSelectedAbstractNumberingList = function () {
            var listIndex = this.getFirstNumberingListIndex();
            if (listIndex == -1)
                return null;
            var list = this.control.model.numberingLists[listIndex];
            return list.getAbstractNumberingList();
        };
        DialogNumberingListCommand.prototype.getFirstNumberingListIndex = function () {
            var paragraphsIndices = this.control.model.activeSubDocument.getParagraphIndicesByIntervals(this.control.selection.intervals);
            var paragraphsIndicesLength = paragraphsIndices.length;
            for (var i = 0; i < paragraphsIndicesLength; i++) {
                var paragraphIndex = paragraphsIndices[i];
                var paragraph = this.control.model.activeSubDocument.paragraphs[paragraphIndex];
                if (paragraph.isInList())
                    return paragraph.numberingListIndex;
            }
            return -1;
        };
        DialogNumberingListCommand.prototype.applyParameters = function (_state, params) {
            var firstParagraph = this.control.model.activeSubDocument.getParagraphByPosition(this.control.selection.intervals[0].start);
            if (params.selectedAbstractNumberingList) {
                if (this.control.selection.isCollapsed() && firstParagraph.isInList()) {
                    var abstractNumberingList = firstParagraph.getAbstractNumberingList();
                    var levelIndex = firstParagraph.getListLevelIndex();
                    var newParams = new __aspxRichEdit.DialogCustomNumberingListParameters();
                    newParams.init(this.colorProvider, abstractNumberingList);
                    newParams.levels[levelIndex].copyFrom(newParams.initLevel(this.colorProvider, params.selectedAbstractNumberingList.levels[levelIndex]));
                    var dialogCustomNumberingListCommand = new __aspxRichEdit.DialogCustomNumberingListCommand(this.control);
                    dialogCustomNumberingListCommand.applyParameters(_state, newParams);
                }
                else
                    this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.InsertNumerationToParagraphs)
                        .execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, params.selectedAbstractNumberingList));
                return true;
            }
            else if (params.selectedAbstractNumberingList === null) {
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.DeleteNumerationFromParagraphs).execute(this.control.commandManager.isPublicApiCall);
                return true;
            }
            return false;
        };
        DialogNumberingListCommand.prototype.getDialogName = function () {
            return "NumberingList";
        };
        return DialogNumberingListCommand;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogNumberingListCommand = DialogNumberingListCommand;
    var DialogNumberingListParameters = (function (_super) {
        __extends(DialogNumberingListParameters, _super);
        function DialogNumberingListParameters() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.currentLevel = 0;
            return _this;
        }
        DialogNumberingListParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.selectedAbstractNumberingList = obj.selectedAbstractNumberingList;
        };
        DialogNumberingListParameters.prototype.clone = function () {
            var newInstance = new DialogNumberingListParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        DialogNumberingListParameters.prototype.toAnotherMeasuringSystem = function (_converter) {
            return this;
        };
        return DialogNumberingListParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.DialogNumberingListParameters = DialogNumberingListParameters;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogOpenFileCommand = (function (_super) {
        __extends(DialogOpenFileCommand, _super);
        function DialogOpenFileCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogOpenFileCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.visible = this.control.options.open !== __aspxRichEdit.DocumentCapability.Hidden;
            return state;
        };
        DialogOpenFileCommand.prototype.createParameters = function (_options) {
            var parameters = new OpenFileDialogParameters();
            parameters.src = null;
            return parameters;
        };
        DialogOpenFileCommand.prototype.executeCore = function (state) {
            if (this.control.owner.hasWorkDirectory)
                return _super.prototype.executeCore.call(this, state, null);
            else
                return this.executeShowErrorMessageCommand();
        };
        DialogOpenFileCommand.prototype.applyParameters = function (_state, params) {
            if (this.control.getModifiedState() && !this.control.owner.confirmOnLosingChanges())
                return false;
            this.control.closeDocument();
            var reqParams = {};
            reqParams[__aspxRichEdit.JSONInitSessionProperty.Src] = new __aspxRichEdit.FileNameHelper(params.src, false).getFullPath();
            this.control.serverDispatcher.pushRequest(new __aspxRichEdit.LoadCommandRequest(__aspxRichEdit.CommandType.OpenDocument, -1, reqParams), new __aspxRichEdit.RequestParams(true, true, true));
        };
        DialogOpenFileCommand.prototype.getDialogName = function () {
            return "FileOpen";
        };
        DialogOpenFileCommand.prototype.executeShowErrorMessageCommand = function () {
            return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowErrorOpeningAndOverstoreImpossibleMessageCommand)
                .execute(this.control.commandManager.isPublicApiCall);
        };
        DialogOpenFileCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        DialogOpenFileCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.open);
        };
        return DialogOpenFileCommand;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogOpenFileCommand = DialogOpenFileCommand;
    var OpenFileDialogParameters = (function (_super) {
        __extends(OpenFileDialogParameters, _super);
        function OpenFileDialogParameters() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.src = null;
            return _this;
        }
        OpenFileDialogParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.src = obj.src;
        };
        OpenFileDialogParameters.prototype.clone = function () {
            var newInstance = new OpenFileDialogParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        OpenFileDialogParameters.prototype.toAnotherMeasuringSystem = function (_converter) {
            return this;
        };
        return OpenFileDialogParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.OpenFileDialogParameters = OpenFileDialogParameters;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogPageSetupCommand = (function (_super) {
        __extends(DialogPageSetupCommand, _super);
        function DialogPageSetupCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogPageSetupCommand.prototype.getState = function (options) {
            if (options === void 0) { options = this.convertToCommandOptions(undefined); }
            return new __aspxRichEdit.IntervalCommandStateEx(this.isEnabled(), __aspxRichEdit.SectionPropertiesCommandBase.getIntervals(this.control, options.subDocument));
        };
        DialogPageSetupCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.sections) &&
                __aspxRichEdit.SectionPropertiesCommandBase.rangePermissionIncludeFullSection(this.control, this.control.model.activeSubDocument, this.control.selection.intervals);
        };
        DialogPageSetupCommand.prototype.createParameters = function (_options) {
            var dialogParams = new PageSetupDialogParameters();
            dialogParams.init(this.control.inputPosition.getMergedSectionPropertiesRaw(), this.getInitialTab(), this.control.model.differentOddAndEvenPages);
            return dialogParams;
        };
        DialogPageSetupCommand.prototype.applyParameters = function (_state, newParams, initParams) {
            var interval = this.getInterval(newParams.applyTo);
            var isEqualIntervals = this.getInitInterval().equals(interval);
            var modelManipulator = this.control.modelManipulator;
            var subDocument = modelManipulator.model.activeSubDocument;
            var history = this.control.history;
            this.control.inputPosition.resetSectionMergedProperties();
            history.beginTransaction();
            var changed = false;
            if (newParams.marginBottom !== undefined && (newParams.marginBottom !== initParams.marginBottom || !isEqualIntervals)) {
                history.addAndRedo(new __aspxRichEdit.SectionMarginBottomHistoryItem(modelManipulator, subDocument, interval, newParams.marginBottom));
                changed = true;
            }
            if (newParams.marginLeft !== undefined && (newParams.marginLeft !== initParams.marginLeft || !isEqualIntervals)) {
                history.addAndRedo(new __aspxRichEdit.SectionMarginLeftHistoryItem(modelManipulator, subDocument, interval, newParams.marginLeft));
                changed = true;
            }
            if (newParams.marginRight !== undefined && (newParams.marginRight !== initParams.marginRight || !isEqualIntervals)) {
                history.addAndRedo(new __aspxRichEdit.SectionMarginRightHistoryItem(modelManipulator, subDocument, interval, newParams.marginRight));
                changed = true;
            }
            if (newParams.marginTop !== undefined && (newParams.marginTop !== initParams.marginTop || !isEqualIntervals)) {
                history.addAndRedo(new __aspxRichEdit.SectionMarginTopHistoryItem(modelManipulator, subDocument, interval, newParams.marginTop));
                changed = true;
            }
            if ((newParams.pageWidth !== undefined && newParams.pageHeight !== undefined) &&
                (newParams.pageWidth !== initParams.pageWidth || newParams.pageHeight !== initParams.pageHeight || !isEqualIntervals)) {
                var sections = this.control.model.getSectionsByInterval(interval);
                for (var i = 0, section; section = sections[i]; i++) {
                    var sectionInterval = new __aspxRichEdit.FixedInterval(section.startLogPosition.value, section.getLength() - 1);
                    if (section.sectionProperties.landscape !== (newParams.pageWidth > newParams.pageHeight))
                        history.addAndRedo(new __aspxRichEdit.SectionLandscapeHistoryItem(modelManipulator, subDocument, sectionInterval, newParams.pageWidth > newParams.pageHeight));
                    history.addAndRedo(new __aspxRichEdit.SectionPageWidthHistoryItem(modelManipulator, subDocument, sectionInterval, newParams.pageWidth));
                    history.addAndRedo(new __aspxRichEdit.SectionPageHeightHistoryItem(modelManipulator, subDocument, sectionInterval, newParams.pageHeight));
                }
                changed = true;
            }
            if (newParams.startType !== undefined && newParams.startType !== initParams.startType) {
                history.addAndRedo(new __aspxRichEdit.SectionStartTypeHistoryItem(modelManipulator, subDocument, interval, newParams.startType));
                changed = true;
            }
            if (newParams.headerDifferentFirstPage !== undefined && (newParams.headerDifferentFirstPage !== initParams.headerDifferentFirstPage || !isEqualIntervals)) {
                history.addAndRedo(new __aspxRichEdit.SectionDifferentFirstPageHistoryItem(modelManipulator, subDocument, interval, newParams.headerDifferentFirstPage));
                changed = true;
            }
            if (newParams.headerDifferentOddAndEven !== undefined && (newParams.headerDifferentOddAndEven !== initParams.headerDifferentOddAndEven || !isEqualIntervals)) {
                history.addAndRedo(new __aspxRichEdit.DifferentOddAndEvenPagesHistoryItem(modelManipulator, subDocument, newParams.headerDifferentOddAndEven));
                changed = true;
            }
            if (newParams.headerOffset !== undefined && (newParams.headerOffset !== initParams.headerOffset || !isEqualIntervals)) {
                history.addAndRedo(new __aspxRichEdit.SectionHeaderOffsetHistoryItem(modelManipulator, subDocument, interval, newParams.headerOffset));
                changed = true;
            }
            if (newParams.footerOffset !== undefined && (newParams.footerOffset !== initParams.footerOffset || !isEqualIntervals)) {
                history.addAndRedo(new __aspxRichEdit.SectionFooterOffsetHistoryItem(modelManipulator, subDocument, interval, newParams.footerOffset));
                changed = true;
            }
            history.endTransaction();
            return changed;
        };
        DialogPageSetupCommand.prototype.getInterval = function (applyTo) {
            if (applyTo == SectionPropertiesApplyType.WholeDocument)
                return new __aspxRichEdit.FixedInterval(0, this.control.model.mainSubDocument.getDocumentEndPosition() - 1);
            if (this.control.model.activeSubDocument.isMain()) {
                var sectionIndices = this.control.model.getSectionIndicesByIntervals(this.control.selection.intervals);
                var firstSection = this.control.model.sections[sectionIndices[0]];
                if (applyTo == SectionPropertiesApplyType.SelectedSections) {
                    var lastSection = this.control.model.sections[sectionIndices[sectionIndices.length - 1]];
                    return __aspxRichEdit.FixedInterval.fromPositions(firstSection.startLogPosition.value, lastSection.startLogPosition.value + lastSection.getLength() - 1);
                }
                if (applyTo == SectionPropertiesApplyType.ThisPointForward)
                    return __aspxRichEdit.FixedInterval.fromPositions(firstSection.startLogPosition.value, this.control.model.mainSubDocument.getDocumentEndPosition() - 1);
                return new __aspxRichEdit.FixedInterval(firstSection.startLogPosition.value, firstSection.getLength() - 1);
            }
            else if (this.control.model.activeSubDocument.isHeaderFooter()) {
                var layoutPage = this.control.layout.pages[this.control.selection.pageIndex];
                if (layoutPage) {
                    var position = layoutPage.getPosition();
                    var section = this.control.model.getSectionByPosition(position);
                    if (applyTo === SectionPropertiesApplyType.CurrentSection || applyTo == SectionPropertiesApplyType.SelectedSections)
                        return new __aspxRichEdit.FixedInterval(section.startLogPosition.value, section.getLength());
                    else if (applyTo === SectionPropertiesApplyType.ThisPointForward)
                        return __aspxRichEdit.FixedInterval.fromPositions(section.startLogPosition.value, this.control.model.mainSubDocument.getDocumentEndPosition() - 1);
                }
            }
        };
        DialogPageSetupCommand.prototype.getInitInterval = function () {
            if (this.control.model.activeSubDocument.isMain()) {
                var sectionIndices = this.control.model.getSectionIndicesByIntervals(this.control.selection.intervals);
                var firstSection = this.control.model.sections[sectionIndices[0]];
                var lastSection = this.control.model.sections[sectionIndices[sectionIndices.length - 1]];
                return __aspxRichEdit.FixedInterval.fromPositions(firstSection.startLogPosition.value, lastSection.startLogPosition.value + lastSection.getLength() - 1);
            }
            else {
                var layoutPage = this.control.layout.pages[this.control.selection.pageIndex];
                var section = this.control.model.getSectionByPosition(layoutPage.getPosition());
                return new __aspxRichEdit.FixedInterval(section.startLogPosition.value, section.getLength());
            }
        };
        DialogPageSetupCommand.prototype.getInitialTab = function () {
            return PageSetupDialogTab.Margins;
        };
        DialogPageSetupCommand.prototype.getDialogName = function () {
            return "PageSetup";
        };
        DialogPageSetupCommand.prototype.lockInputPositionUpdating = function (_prevModifiedState) {
            return false;
        };
        return DialogPageSetupCommand;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogPageSetupCommand = DialogPageSetupCommand;
    var ShowPagePaperSetupFormCommand = (function (_super) {
        __extends(ShowPagePaperSetupFormCommand, _super);
        function ShowPagePaperSetupFormCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ShowPagePaperSetupFormCommand.prototype.getInitialTab = function () {
            return PageSetupDialogTab.Paper;
        };
        return ShowPagePaperSetupFormCommand;
    }(DialogPageSetupCommand));
    __aspxRichEdit.ShowPagePaperSetupFormCommand = ShowPagePaperSetupFormCommand;
    var PageSetupDialogParameters = (function (_super) {
        __extends(PageSetupDialogParameters, _super);
        function PageSetupDialogParameters() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        PageSetupDialogParameters.prototype.init = function (initSecProps, tabs, differentOddAndEvenPages) {
            this.applyTo = SectionPropertiesApplyType.WholeDocument;
            this.marginBottom = initSecProps.marginBottom;
            this.marginLeft = initSecProps.marginLeft;
            this.marginRight = initSecProps.marginRight;
            this.marginTop = initSecProps.marginTop;
            this.landscape = initSecProps.landscape;
            this.pageHeight = initSecProps.pageHeight;
            this.pageWidth = initSecProps.pageWidth;
            this.startType = initSecProps.startType;
            this.headerDifferentOddAndEven = differentOddAndEvenPages;
            this.headerDifferentFirstPage = initSecProps.differentFirstPage;
            this.headerOffset = initSecProps.headerOffset;
            this.footerOffset = initSecProps.footerOffset;
            this.initialTab = tabs;
        };
        PageSetupDialogParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.marginBottom = obj.marginBottom;
            this.marginLeft = obj.marginLeft;
            this.marginRight = obj.marginRight;
            this.marginTop = obj.marginTop;
            this.landscape = obj.landscape;
            this.applyTo = obj.applyTo;
            this.pageHeight = obj.pageHeight;
            this.pageWidth = obj.pageWidth;
            this.startType = obj.startType;
            this.headerDifferentFirstPage = obj.headerDifferentFirstPage;
            this.headerDifferentOddAndEven = obj.headerDifferentOddAndEven;
            this.headerOffset = obj.headerOffset;
            this.footerOffset = obj.footerOffset;
            this.initialTab = obj.initialTab;
        };
        PageSetupDialogParameters.prototype.clone = function () {
            var newInstance = new PageSetupDialogParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        PageSetupDialogParameters.prototype.toAnotherMeasuringSystem = function (converter) {
            if (this.marginBottom)
                this.marginBottom = converter(this.marginBottom);
            if (this.marginLeft)
                this.marginLeft = converter(this.marginLeft);
            if (this.marginRight)
                this.marginRight = converter(this.marginRight);
            if (this.marginTop)
                this.marginTop = converter(this.marginTop);
            if (this.pageWidth)
                this.pageWidth = converter(this.pageWidth);
            if (this.pageHeight)
                this.pageHeight = converter(this.pageHeight);
            if (this.headerOffset)
                this.headerOffset = converter(this.headerOffset);
            if (this.footerOffset)
                this.footerOffset = converter(this.footerOffset);
            return this;
        };
        return PageSetupDialogParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.PageSetupDialogParameters = PageSetupDialogParameters;
    var SectionPropertiesApplyType;
    (function (SectionPropertiesApplyType) {
        SectionPropertiesApplyType[SectionPropertiesApplyType["WholeDocument"] = 0] = "WholeDocument";
        SectionPropertiesApplyType[SectionPropertiesApplyType["CurrentSection"] = 1] = "CurrentSection";
        SectionPropertiesApplyType[SectionPropertiesApplyType["SelectedSections"] = 2] = "SelectedSections";
        SectionPropertiesApplyType[SectionPropertiesApplyType["ThisPointForward"] = 4] = "ThisPointForward";
    })(SectionPropertiesApplyType = __aspxRichEdit.SectionPropertiesApplyType || (__aspxRichEdit.SectionPropertiesApplyType = {}));
    var PageSetupDialogTab;
    (function (PageSetupDialogTab) {
        PageSetupDialogTab[PageSetupDialogTab["Margins"] = 0] = "Margins";
        PageSetupDialogTab[PageSetupDialogTab["Paper"] = 1] = "Paper";
        PageSetupDialogTab[PageSetupDialogTab["Layout"] = 2] = "Layout";
    })(PageSetupDialogTab = __aspxRichEdit.PageSetupDialogTab || (__aspxRichEdit.PageSetupDialogTab = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogParagraphPropertiesCommand = (function (_super) {
        __extends(DialogParagraphPropertiesCommand, _super);
        function DialogParagraphPropertiesCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogParagraphPropertiesCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.IntervalCommandStateEx(this.isEnabled(), this.control.selection.getIntervalsClone());
            state.visible = __aspxRichEdit.ControlOptions.isVisible(this.control.options.paragraphFormatting);
            return state;
        };
        DialogParagraphPropertiesCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.paragraphFormatting);
        };
        DialogParagraphPropertiesCommand.prototype.getIntervalsForModifying = function () {
            return __aspxRichEdit.RichUtils.getIntervalsOfSelectedParagraphs(this.control.selection.intervals, this.control.model.activeSubDocument);
        };
        DialogParagraphPropertiesCommand.prototype.createParameters = function (_options) {
            var parameters = new ParagraphDialogParameters();
            parameters.init(this.colorProvider, this.control.inputPosition.getMergedParagraphPropertiesRaw(), this.control.inputPosition.getMergedSectionPropertiesRaw());
            return parameters;
        };
        DialogParagraphPropertiesCommand.prototype.applyParameters = function (_state, newParams, initParams) {
            var newProps = new __aspxRichEdit.ParagraphProperties();
            if (newParams.leftIndent != null) {
                var leftIndent = newParams.firstLineIndentType === __aspxRichEdit.ParagraphFirstLineIndent.Hanging ?
                    newParams.leftIndent + newParams.firstLineIndent :
                    newParams.leftIndent;
                newProps.leftIndent = leftIndent !== initParams.leftIndent || newParams.firstLineIndentType !== initParams.firstLineIndentType ?
                    leftIndent : undefined;
            }
            else
                newProps.leftIndent = undefined;
            newProps.alignment = newParams.alignment != null && newParams.alignment !== initParams.alignment ? newParams.alignment : undefined;
            newProps.contextualSpacing = newParams.contextualSpacing != null && newParams.contextualSpacing !== initParams.contextualSpacing ?
                newParams.contextualSpacing : undefined;
            newProps.firstLineIndent = newParams.firstLineIndent != null && newParams.firstLineIndent !== initParams.firstLineIndent ?
                newParams.firstLineIndent : undefined;
            newProps.firstLineIndentType = newParams.firstLineIndentType != null && newParams.firstLineIndentType !== initParams.firstLineIndentType ?
                newParams.firstLineIndentType : undefined;
            newProps.keepLinesTogether = newParams.keepLinesTogether !== initParams.keepLinesTogether ?
                newParams.keepLinesTogether : undefined;
            newProps.spacingAfter = newParams.spacingAfter != null && newParams.spacingAfter !== initParams.spacingAfter ?
                newParams.spacingAfter : undefined;
            newProps.spacingBefore = newParams.spacingBefore != null && newParams.spacingBefore !== initParams.spacingBefore ?
                newParams.spacingBefore : undefined;
            newProps.pageBreakBefore = newParams.pageBreakBefore !== initParams.pageBreakBefore ?
                newParams.pageBreakBefore : undefined;
            newProps.rightIndent = newParams.rightIndent != null && newParams.rightIndent !== initParams.rightIndent ?
                newParams.rightIndent : undefined;
            newProps.outlineLevel = newParams.outlineLevel !== initParams.outlineLevel ?
                newParams.outlineLevel : undefined;
            newProps.lineSpacingType = newParams.lineSpacingType != null && newParams.lineSpacingType !== initParams.lineSpacingType ?
                newParams.lineSpacingType : undefined;
            newProps.shadingInfo = newParams.backColor !== initParams.backColor ?
                __aspxRichEdit.ShadingInfo.createByColor(__aspxRichEdit.ColorModelInfo.makeByColor(newParams.backColor == null ? __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR : __aspxRichEdit.ColorHelper.stringToColor(newParams.backColor))) : undefined;
            if ((newParams.lineSpacingType === __aspxRichEdit.ParagraphLineSpacingType.AtLeast || newParams.lineSpacingType === __aspxRichEdit.ParagraphLineSpacingType.Exactly) &&
                (newParams.lineSpacing != null && (newProps.lineSpacingType !== undefined || newParams.lineSpacing !== initParams.lineSpacing)))
                newProps.lineSpacing = newParams.lineSpacing;
            else if (newParams.lineSpacingType === __aspxRichEdit.ParagraphLineSpacingType.Multiple && (newParams.lineSpacingMultiple != null &&
                (newProps.lineSpacingType !== undefined || newParams.lineSpacingMultiple !== initParams.lineSpacingMultiple)))
                newProps.lineSpacing = newParams.lineSpacingMultiple;
            else
                newProps.lineSpacing = undefined;
            return new ParagraphPropertiesApplier(this.control, newProps).apply();
        };
        DialogParagraphPropertiesCommand.prototype.getDialogName = function () {
            return "EditParagraph";
        };
        return DialogParagraphPropertiesCommand;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogParagraphPropertiesCommand = DialogParagraphPropertiesCommand;
    var ParagraphDialogParameters = (function (_super) {
        __extends(ParagraphDialogParameters, _super);
        function ParagraphDialogParameters() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphDialogParameters.prototype.init = function (colorProvider, parProps, secProps) {
            this.alignment = parProps.alignment;
            this.outlineLevel = parProps.outlineLevel;
            this.rightIndent = parProps.rightIndent;
            this.spacingAfter = parProps.spacingAfter;
            this.spacingBefore = parProps.spacingBefore;
            this.lineSpacingType = parProps.lineSpacingType;
            this.firstLineIndentType = parProps.firstLineIndentType;
            this.firstLineIndent = parProps.firstLineIndent;
            this.contextualSpacing = parProps.contextualSpacing;
            this.keepLinesTogether = parProps.keepLinesTogether;
            this.pageBreakBefore = parProps.pageBreakBefore;
            this.pageWidth = secProps.pageWidth - secProps.marginLeft - secProps.marginRight;
            this.leftIndent = parProps.firstLineIndentType === __aspxRichEdit.ParagraphFirstLineIndent.Hanging ? parProps.leftIndent - parProps.firstLineIndent : parProps.leftIndent;
            this.backColor = this.getColor(parProps.shadingInfo.getActualColor(colorProvider));
            switch (parProps.lineSpacingType) {
                case __aspxRichEdit.ParagraphLineSpacingType.AtLeast:
                case __aspxRichEdit.ParagraphLineSpacingType.Exactly:
                    this.lineSpacing = parProps.lineSpacing;
                    this.lineSpacingMultiple = 3;
                    break;
                case __aspxRichEdit.ParagraphLineSpacingType.Multiple:
                    this.lineSpacing = 240;
                    this.lineSpacingMultiple = parProps.lineSpacing;
                    break;
                default:
                    this.lineSpacing = 240;
                    this.lineSpacingMultiple = 3;
                    break;
            }
        };
        ParagraphDialogParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.alignment = obj.alignment;
            this.outlineLevel = obj.outlineLevel;
            this.rightIndent = obj.rightIndent;
            this.spacingBefore = obj.spacingBefore;
            this.spacingAfter = obj.spacingAfter;
            this.lineSpacingType = obj.lineSpacingType;
            this.firstLineIndentType = obj.firstLineIndentType;
            this.firstLineIndent = obj.firstLineIndent;
            this.contextualSpacing = obj.contextualSpacing;
            this.keepLinesTogether = obj.keepLinesTogether;
            this.pageBreakBefore = obj.pageBreakBefore;
            this.pageWidth = obj.pageWidth;
            this.leftIndent = obj.leftIndent;
            this.lineSpacing = obj.lineSpacing;
            this.lineSpacingMultiple = obj.lineSpacingMultiple;
            this.backColor = obj.backColor;
        };
        ParagraphDialogParameters.prototype.clone = function () {
            var newInstance = new ParagraphDialogParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        ParagraphDialogParameters.prototype.toAnotherMeasuringSystem = function (converter) {
            if (this.pageWidth)
                this.pageWidth = converter(this.pageWidth);
            if (this.firstLineIndent)
                this.firstLineIndent = converter(this.firstLineIndent);
            if (this.leftIndent)
                this.leftIndent = converter(this.leftIndent);
            if (this.lineSpacing)
                this.lineSpacing = converter(this.lineSpacing);
            if (this.rightIndent)
                this.rightIndent = converter(this.rightIndent);
            if (this.spacingAfter)
                this.spacingAfter = converter(this.spacingAfter);
            if (this.spacingBefore)
                this.spacingBefore = converter(this.spacingBefore);
            return this;
        };
        ParagraphDialogParameters.prototype.getColor = function (color) {
            if (color === __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR)
                return null;
            if (color != undefined)
                return __aspxRichEdit.ColorHelper.colorToHash(color).toUpperCase();
            else
                return undefined;
        };
        return ParagraphDialogParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.ParagraphDialogParameters = ParagraphDialogParameters;
    var ParagraphPropertiesApplier = (function () {
        function ParagraphPropertiesApplier(control, newParProps) {
            this.control = control;
            this.newParProps = newParProps;
        }
        ParagraphPropertiesApplier.prototype.apply = function () {
            var _this = this;
            this.modelManip = this.control.modelManipulator;
            this.subDoc = this.modelManip.model.activeSubDocument;
            var history = this.control.history;
            this.parPropsFull = this.control.inputPosition.getMergedParagraphPropertiesFull();
            this.parPropsRaw = this.control.inputPosition.getMergedParagraphPropertiesRaw();
            this.oldParPropsRaw = this.parPropsRaw.clone();
            var parIndices = this.control.model.activeSubDocument.getParagraphIndicesByIntervals(this.control.selection.intervals);
            var changed = 0;
            history.beginTransaction();
            __aspxRichEdit.ListUtils.reverseForeach(parIndices, function (parIndex) {
                var interval = _this.subDoc.paragraphs[parIndex].interval;
                changed |= _this.applyProp(interval, __aspxRichEdit.ParagraphPropertyDescriptor.firstLineIndentType);
                changed |= _this.applyProp(interval, __aspxRichEdit.ParagraphPropertyDescriptor.firstLineIndent);
                changed |= _this.applyProp(interval, __aspxRichEdit.ParagraphPropertyDescriptor.widowOrphanControl);
                changed |= _this.applyProp(interval, __aspxRichEdit.ParagraphPropertyDescriptor.afterAutoSpacing);
                changed |= _this.applyProp(interval, __aspxRichEdit.ParagraphPropertyDescriptor.outlineLevel);
                changed |= _this.applyProp(interval, __aspxRichEdit.ParagraphPropertyDescriptor.beforeAutoSpacing);
                changed |= _this.applyProp(interval, __aspxRichEdit.ParagraphPropertyDescriptor.pageBreakBefore);
                changed |= _this.applyProp(interval, __aspxRichEdit.ParagraphPropertyDescriptor.rightIndent);
                changed |= _this.applyProp(interval, __aspxRichEdit.ParagraphPropertyDescriptor.suppressHyphenation);
                changed |= _this.applyProp(interval, __aspxRichEdit.ParagraphPropertyDescriptor.suppressLineNumbers);
                changed |= _this.applyProp(interval, __aspxRichEdit.ParagraphPropertyDescriptor.keepLinesTogether);
                changed |= _this.applyProp(interval, __aspxRichEdit.ParagraphPropertyDescriptor.keepWithNext);
                changed |= _this.applyProp(interval, __aspxRichEdit.ParagraphPropertyDescriptor.shadingInfo);
                changed |= _this.applyProp(interval, __aspxRichEdit.ParagraphPropertyDescriptor.leftIndent);
                changed |= _this.applyProp(interval, __aspxRichEdit.ParagraphPropertyDescriptor.lineSpacingType);
                changed |= _this.applyProp(interval, __aspxRichEdit.ParagraphPropertyDescriptor.lineSpacing);
                changed |= _this.applyProp(interval, __aspxRichEdit.ParagraphPropertyDescriptor.alignment);
                changed |= _this.applyProp(interval, __aspxRichEdit.ParagraphPropertyDescriptor.contextualSpacing);
                changed |= _this.applyProp(interval, __aspxRichEdit.ParagraphPropertyDescriptor.spacingBefore);
                changed |= _this.applyProp(interval, __aspxRichEdit.ParagraphPropertyDescriptor.spacingAfter);
                changed |= _this.applyProp(interval, __aspxRichEdit.ParagraphPropertyDescriptor.divId);
            });
            history.endTransaction();
            return !!changed;
        };
        ParagraphPropertiesApplier.prototype.applyProp = function (interval, descriptor) {
            var newValue = descriptor.getProp(this.newParProps);
            var currValue = descriptor.getProp(this.oldParPropsRaw);
            if (newValue !== undefined && newValue !== currValue) {
                descriptor.setProp(this.parPropsFull, newValue);
                descriptor.setProp(this.parPropsRaw, newValue);
                this.control.history.addAndRedo(new (descriptor.getHistoryItemConstructor())(this.modelManip, this.subDoc, interval, newValue, true));
                return 1;
            }
            return 0;
        };
        return ParagraphPropertiesApplier;
    }());
    __aspxRichEdit.ParagraphPropertiesApplier = ParagraphPropertiesApplier;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogSaveFileCommand = (function (_super) {
        __extends(DialogSaveFileCommand, _super);
        function DialogSaveFileCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogSaveFileCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.visible = this.control.options.saveAs !== __aspxRichEdit.DocumentCapability.Hidden;
            return state;
        };
        DialogSaveFileCommand.prototype.createParameters = function (_options) {
            var fileNameHelper = new __aspxRichEdit.FileNameHelper(this.control.documentInfo.getFileName(), false);
            var saveFileDialogParameters = new SaveFileDialogParameters();
            saveFileDialogParameters.fileName = fileNameHelper.name !== "" ? fileNameHelper.name : "document1";
            saveFileDialogParameters.documentFormat = fileNameHelper.documentFormat != __aspxRichEdit.DocumentFormat.Undefined ?
                fileNameHelper.documentFormat : __aspxRichEdit.DocumentFormat.OpenXml;
            saveFileDialogParameters.folderPath = "";
            saveFileDialogParameters.fileSavedToServer = true;
            return saveFileDialogParameters;
        };
        DialogSaveFileCommand.prototype.executeCore = function (state, parameter) {
            if (this.control.owner.hasWorkDirectory)
                return _super.prototype.executeCore.call(this, state, parameter);
            else
                return this.executeShowErrorMessageCommand();
        };
        DialogSaveFileCommand.prototype.applyParameters = function (_state, params) {
            if (params.fileSavedToServer) {
                var reqParams = {};
                reqParams[__aspxRichEdit.JSONInitSessionProperty.FileName] = params.fileName;
                reqParams[__aspxRichEdit.JSONInitSessionProperty.FolderPath] = params.folderPath;
                reqParams[__aspxRichEdit.JSONInitSessionProperty.DocumentFormat] = params.documentFormat;
                reqParams[__aspxRichEdit.JSONInitSessionProperty.HistoryId] = this.control.history.getCurrentItemId();
                this.control.serverDispatcher.pushRequest(new __aspxRichEdit.LoadCommandRequest(__aspxRichEdit.CommandType.SaveAsDocument, -1, reqParams), new __aspxRichEdit.RequestParams(true, true, true));
            }
            else
                return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.Download)
                    .execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, params.documentFormat));
            return true;
        };
        DialogSaveFileCommand.prototype.getDialogName = function () {
            return "FileSaveAs";
        };
        DialogSaveFileCommand.prototype.executeShowErrorMessageCommand = function () {
            return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowErrorOpeningAndOverstoreImpossibleMessageCommand).execute(this.control.commandManager.isPublicApiCall);
        };
        DialogSaveFileCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.saveAs);
        };
        DialogSaveFileCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return DialogSaveFileCommand;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogSaveFileCommand = DialogSaveFileCommand;
    var SaveFileDialogParameters = (function (_super) {
        __extends(SaveFileDialogParameters, _super);
        function SaveFileDialogParameters() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.fileName = "";
            _this.folderPath = "";
            _this.documentFormat = __aspxRichEdit.DocumentFormat.Undefined;
            _this.fileSavedToServer = true;
            return _this;
        }
        SaveFileDialogParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.fileName = obj.fileName;
            this.folderPath = obj.folderPath;
            this.documentFormat = obj.documentFormat;
            this.fileSavedToServer = obj.fileSavedToServer;
        };
        SaveFileDialogParameters.prototype.clone = function () {
            var newInstance = new SaveFileDialogParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        SaveFileDialogParameters.prototype.toAnotherMeasuringSystem = function (_converter) {
            return this;
        };
        return SaveFileDialogParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.SaveFileDialogParameters = SaveFileDialogParameters;
    var DialogSaveMergedDocumentCommand = (function (_super) {
        __extends(DialogSaveMergedDocumentCommand, _super);
        function DialogSaveMergedDocumentCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogSaveMergedDocumentCommand.prototype.createParameters = function (options) {
            var parameters = options.param;
            var saveFileDialogParameters = new SaveMergedDocumentDialogParameters();
            saveFileDialogParameters.fileName = "result";
            saveFileDialogParameters.documentFormat = __aspxRichEdit.DocumentFormat.OpenXml;
            saveFileDialogParameters.folderPath = "";
            saveFileDialogParameters.fileSavedToServer = true;
            saveFileDialogParameters.mergeMode = parameters.mergeMode;
            switch (parameters.range) {
                case __aspxRichEdit.MailMergeExportRange.AllRecords:
                    saveFileDialogParameters.firstRecordIndex = 0;
                    saveFileDialogParameters.lastRecordIndex = this.control.mailMergeOptions.recordCount - 1;
                    break;
                case __aspxRichEdit.MailMergeExportRange.CurrentRecord:
                    saveFileDialogParameters.firstRecordIndex = this.control.mailMergeOptions.activeRecordIndex;
                    saveFileDialogParameters.lastRecordIndex = this.control.mailMergeOptions.activeRecordIndex;
                    break;
                case __aspxRichEdit.MailMergeExportRange.Range:
                    saveFileDialogParameters.firstRecordIndex = parameters.exportFrom - 1;
                    saveFileDialogParameters.lastRecordIndex = parameters.exportFrom + parameters.exportRecordsCount - 2;
                    break;
            }
            return saveFileDialogParameters;
        };
        DialogSaveMergedDocumentCommand.prototype.applyParameters = function (_state, params) {
            if (params.fileSavedToServer) {
                var reqParams = {};
                reqParams[__aspxRichEdit.JSONInitSessionProperty.FileName] = params.fileName;
                reqParams[__aspxRichEdit.JSONInitSessionProperty.FolderPath] = params.folderPath;
                reqParams[__aspxRichEdit.JSONInitSessionProperty.DocumentFormat] = params.documentFormat;
                reqParams[__aspxRichEdit.JSONInitSessionProperty.FirstRecordIndex] = params.firstRecordIndex;
                reqParams[__aspxRichEdit.JSONInitSessionProperty.LastRecordIndex] = params.lastRecordIndex;
                reqParams[__aspxRichEdit.JSONInitSessionProperty.MergeMode] = params.mergeMode;
                reqParams[__aspxRichEdit.JSONInitSessionProperty.HistoryId] = this.control.history.getCurrentItemId();
                this.control.serverDispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.SaveMergedDocument, -1, reqParams), new __aspxRichEdit.RequestParams(true, true, true));
            }
            else {
                var request = new __aspxRichEdit.LoadCommandRequest(__aspxRichEdit.CommandType.DownloadMergedDocument, this.control.model.mainSubDocument.id, new __aspxRichEdit.MapCreatorNumberAsKey()
                    .add(__aspxRichEdit.JSONInitSessionProperty.DocumentFormat, params.documentFormat)
                    .add(__aspxRichEdit.JSONInitSessionProperty.FirstRecordIndex, params.firstRecordIndex)
                    .add(__aspxRichEdit.JSONInitSessionProperty.LastRecordIndex, params.lastRecordIndex)
                    .add(__aspxRichEdit.JSONInitSessionProperty.MergeMode, params.mergeMode)
                    .get());
                this.control.serverDispatcher.pushRequest(request, new __aspxRichEdit.RequestParams(false, true, true));
            }
            return true;
        };
        return DialogSaveMergedDocumentCommand;
    }(DialogSaveFileCommand));
    __aspxRichEdit.DialogSaveMergedDocumentCommand = DialogSaveMergedDocumentCommand;
    var SaveMergedDocumentDialogParameters = (function (_super) {
        __extends(SaveMergedDocumentDialogParameters, _super);
        function SaveMergedDocumentDialogParameters() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SaveMergedDocumentDialogParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.firstRecordIndex = obj.firstRecordIndex;
            this.lastRecordIndex = obj.lastRecordIndex;
            this.mergeMode = obj.mergeMode;
        };
        SaveMergedDocumentDialogParameters.prototype.clone = function () {
            var newInstance = new SaveMergedDocumentDialogParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        SaveMergedDocumentDialogParameters.prototype.toAnotherMeasuringSystem = function (converter) {
            _super.prototype.toAnotherMeasuringSystem.call(this, converter);
            return this;
        };
        return SaveMergedDocumentDialogParameters;
    }(SaveFileDialogParameters));
    __aspxRichEdit.SaveMergedDocumentDialogParameters = SaveMergedDocumentDialogParameters;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogSpellCheckerCommand = (function (_super) {
        __extends(DialogSpellCheckerCommand, _super);
        function DialogSpellCheckerCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogSpellCheckerCommand.prototype.getState = function () {
            var selectedMisspelledInterval = this.control.spellChecker.getSelectedMisspelledInterval(this.control.selection.intervals);
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled(), selectedMisspelledInterval);
            state.visible = selectedMisspelledInterval !== null;
            return state;
        };
        DialogSpellCheckerCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && this.control.spellChecker.settings.isEnabled;
        };
        DialogSpellCheckerCommand.prototype.createParameters = function (_options) {
            var parameters = new SpellCheckerDialogParameters();
            parameters.controller = new SpellCheckerDialogController(this.control, this.control.spellChecker);
            return parameters;
        };
        DialogSpellCheckerCommand.prototype.applyParameters = function (_state, _newParameters) {
            return true;
        };
        DialogSpellCheckerCommand.prototype.getDialogName = function () {
            return "Spelling";
        };
        return DialogSpellCheckerCommand;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogSpellCheckerCommand = DialogSpellCheckerCommand;
    var SpellCheckerDialogParameters = (function (_super) {
        __extends(SpellCheckerDialogParameters, _super);
        function SpellCheckerDialogParameters() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SpellCheckerDialogParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.controller = obj.controller;
        };
        SpellCheckerDialogParameters.prototype.clone = function () {
            var newInstance = new SpellCheckerDialogParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        SpellCheckerDialogParameters.prototype.toAnotherMeasuringSystem = function (_converter) {
            return this;
        };
        return SpellCheckerDialogParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.SpellCheckerDialogParameters = SpellCheckerDialogParameters;
    var SpellCheckerDialogController = (function () {
        function SpellCheckerDialogController(control, spellChecker) {
            this.control = control;
            this.spellChecker = spellChecker;
        }
        Object.defineProperty(SpellCheckerDialogController.prototype, "isRepeatingError", {
            get: function () { return this.misspelledInterval.errorInfo.errorType == __aspxRichEdit.SpellingErrorType.Repeating; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(SpellCheckerDialogController.prototype, "canAddToDictionary", {
            get: function () { return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.AddWordToDictionary).getState().enabled; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(SpellCheckerDialogController.prototype, "suggestions", {
            get: function () { return this.misspelledInterval.errorInfo.suggestions; },
            enumerable: true,
            configurable: true
        });
        SpellCheckerDialogController.prototype.tryFindNextError = function () {
            this.misspelledInterval = this.spellChecker.findNextMisspelledInterval(this.control.selection.intervals[0].start);
            if (this.misspelledInterval) {
                this.control.selection.deprecatedSetSelection(this.misspelledInterval.start, this.misspelledInterval.end, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
                return true;
            }
            else {
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowSpellingCheckCompletedMessage).execute(this.control.commandManager.isPublicApiCall);
                return false;
            }
        };
        SpellCheckerDialogController.prototype.getContext = function () {
            return this.misspelledInterval.errorInfo.word;
        };
        SpellCheckerDialogController.prototype.ignoreOnce = function () {
            this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.IgnoreSpellingError).execute(this.control.commandManager.isPublicApiCall);
        };
        SpellCheckerDialogController.prototype.ignoreAll = function () {
            this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.IgnoreAllSpellingErrors).execute(this.control.commandManager.isPublicApiCall);
        };
        SpellCheckerDialogController.prototype.addToDictionary = function () {
            this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.AddWordToDictionary).execute(this.control.commandManager.isPublicApiCall);
        };
        SpellCheckerDialogController.prototype.delete = function () {
            this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.DeleteRepeatedWord).execute(this.control.commandManager.isPublicApiCall);
        };
        SpellCheckerDialogController.prototype.change = function (text) {
            this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeSpellingError).execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, text));
        };
        SpellCheckerDialogController.prototype.changeAll = function (text) {
            this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeAllSpellingErrors).execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, text));
        };
        return SpellCheckerDialogController;
    }());
    __aspxRichEdit.SpellCheckerDialogController = SpellCheckerDialogController;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogSplitTableCellsCommand = (function (_super) {
        __extends(DialogSplitTableCellsCommand, _super);
        function DialogSplitTableCellsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogSplitTableCellsCommand.prototype.getState = function () {
            var enabled = this.control.selection.tableInfo.rawData.isSquare &&
                !this.control.selection.specialRunInfo.isPictureSelected();
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled() && enabled);
            state.visible = enabled;
            return state;
        };
        DialogSplitTableCellsCommand.prototype.createParameters = function (_options) {
            var tableInfo = this.control.selection.tableInfo;
            var parameters = new SplitTableCellsDialogParameters();
            parameters.rowCount = tableInfo.rawData.numRows;
            parameters.columnCount = tableInfo.rawData.rows[0].columnCountInSeries;
            parameters.isMergeBeforeSplit = tableInfo.rawData.numRows > 1 || tableInfo.rawData.rows[0].cells.length > 1;
            parameters.disableRowsSelector = !tableInfo.extendedData.isSquare;
            parameters.availableRowNumber = parameters.disableRowsSelector ?
                1 :
                tableInfo.rawData.numRows;
            return parameters;
        };
        DialogSplitTableCellsCommand.prototype.applyParameters = function (_state, params) {
            return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.SplitTableCellsCommand)
                .execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, params));
        };
        DialogSplitTableCellsCommand.prototype.getDialogName = function () {
            return "SplitTableCells";
        };
        return DialogSplitTableCellsCommand;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogSplitTableCellsCommand = DialogSplitTableCellsCommand;
    var SplitTableCellsDialogParameters = (function (_super) {
        __extends(SplitTableCellsDialogParameters, _super);
        function SplitTableCellsDialogParameters() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SplitTableCellsDialogParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.rowCount = obj.rowCount;
            this.columnCount = obj.columnCount;
            this.isMergeBeforeSplit = obj.isMergeBeforeSplit;
        };
        SplitTableCellsDialogParameters.prototype.clone = function () {
            var newInstance = new SplitTableCellsDialogParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        SplitTableCellsDialogParameters.prototype.toAnotherMeasuringSystem = function (_converter) {
            return this;
        };
        return SplitTableCellsDialogParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.SplitTableCellsDialogParameters = SplitTableCellsDialogParameters;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogSymbolsCommandBase = (function (_super) {
        __extends(DialogSymbolsCommandBase, _super);
        function DialogSymbolsCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogSymbolsCommandBase.prototype.getDialogName = function () {
            return "Symbols";
        };
        return DialogSymbolsCommandBase;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogSymbolsCommandBase = DialogSymbolsCommandBase;
    var DialogSymbolsCommand = (function (_super) {
        __extends(DialogSymbolsCommand, _super);
        function DialogSymbolsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogSymbolsCommand.prototype.getState = function () {
            return new __aspxRichEdit.IntervalCommandStateEx(this.isEnabled(), this.control.selection.getIntervalsClone());
        };
        DialogSymbolsCommand.prototype.createParameters = function (_options) {
            var charProps = this.control.inputPosition.getMergedCharacterPropertiesRaw();
            var parameters = new DialogSymbolsParameters();
            parameters.fontName = charProps.fontInfo ? charProps.fontInfo.name : this.control.model.defaultCharacterProperties.fontInfo.name;
            return parameters;
        };
        DialogSymbolsCommand.prototype.applyParameters = function (state, newParams) {
            this.control.history.beginTransaction();
            var modelManipulator = this.control.modelManipulator;
            var maskedCharacterProperties = this.control.inputPosition.getMaskedCharacterProperties();
            var fontInfo = this.control.model.cache.fontInfoCache.getItemByName(newParams.fontName) || null;
            maskedCharacterProperties.fontInfo = fontInfo;
            maskedCharacterProperties.setUseValue(__aspxRichEdit.CharacterPropertiesMask.UseFontName, true);
            for (var i = 0, interval = void 0; interval = state.intervals[i]; i++) {
                if (interval.length > 0)
                    this.control.history.addAndRedo(new __aspxRichEdit.FontNameHistoryItem(modelManipulator, modelManipulator.model.activeSubDocument, interval, fontInfo, true));
            }
            this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.InsertText)
                .execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, newParams.symbol));
            this.control.history.endTransaction();
            return true;
        };
        return DialogSymbolsCommand;
    }(DialogSymbolsCommandBase));
    __aspxRichEdit.DialogSymbolsCommand = DialogSymbolsCommand;
    var DialogServiceSymbolsCommand = (function (_super) {
        __extends(DialogServiceSymbolsCommand, _super);
        function DialogServiceSymbolsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogServiceSymbolsCommand.prototype.createParameters = function (options) {
            this.dialogCustomNumberingListParameters = options.param;
            var parameters = new DialogSymbolsParameters();
            parameters.fontName = options.param.levels[options.param.currentLevel].fontName;
            return parameters;
        };
        DialogServiceSymbolsCommand.prototype.applyParameters = function (_state, newParams) {
            var level = this.dialogCustomNumberingListParameters.levels[this.dialogCustomNumberingListParameters.currentLevel];
            level.fontName = newParams.fontName;
            level.displayFormatString = newParams.symbol;
            return false;
        };
        DialogServiceSymbolsCommand.prototype.afterClosing = function () {
            var clientCommand = __aspxRichEdit.RichEditClientCommand.ShowCustomNumberingListForm;
            this.control.commandManager.getCommand(clientCommand).execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, this.dialogCustomNumberingListParameters));
        };
        return DialogServiceSymbolsCommand;
    }(DialogSymbolsCommandBase));
    __aspxRichEdit.DialogServiceSymbolsCommand = DialogServiceSymbolsCommand;
    var DialogSymbolsParameters = (function (_super) {
        __extends(DialogSymbolsParameters, _super);
        function DialogSymbolsParameters() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogSymbolsParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.symbol = obj.symbol;
            this.fontName = obj.fontName;
        };
        DialogSymbolsParameters.prototype.clone = function () {
            var newInstance = new DialogSymbolsParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        DialogSymbolsParameters.prototype.toAnotherMeasuringSystem = function (_converter) {
            return this;
        };
        return DialogSymbolsParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.DialogSymbolsParameters = DialogSymbolsParameters;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogTablePropertiesCommand = (function (_super) {
        __extends(DialogTablePropertiesCommand, _super);
        function DialogTablePropertiesCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogTablePropertiesCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.visible = this.control.selection.tableInfo.extendedData.numRows > 0 && !this.control.selection.specialRunInfo.isPictureSelected();
            return state;
        };
        DialogTablePropertiesCommand.prototype.createParameters = function (options) {
            var dialogParams = new TablePropertiesDialogParameters();
            var table = this.control.selection.tableInfo.table;
            var subDocument = options.subDocument;
            var position = table.parentCell ? table.parentCell.endParagrapPosition.value : this.control.selection.intervals[0].start;
            var lp = subDocument.isMain() ?
                new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.control.layout, subDocument, position, __aspxRichEdit.DocumentLayoutDetailsLevel.Row)
                    .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false)) :
                new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.layout, subDocument, position, this.control.selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Row)
                    .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
            var maxTableWidth = __aspxRichEdit.UnitConverter.pixelsToTwipsF(table.parentCell ? lp.row.width : __aspxRichEdit.LayoutColumn.findSectionColumnWithMinimumWidth(lp.pageArea.columns));
            dialogParams.init(this.control.selection.tableInfo, this.control.model, maxTableWidth, this.getInitialTab());
            return dialogParams;
        };
        DialogTablePropertiesCommand.prototype.applyParameters = function (_state, newParams, initParams) {
            var modelManipulator = this.control.modelManipulator;
            var subDocument = modelManipulator.model.activeSubDocument;
            var tableInfo = this.control.selection.tableInfo;
            var table = tableInfo.table;
            var history = this.control.history;
            if (!subDocument.isEditable([__aspxRichEdit.FixedInterval.fromPositions(table.getStartPosition(), table.getEndPosition())]))
                return false;
            var changed = false;
            history.beginTransaction();
            newParams.tablePreferredWidth = this.getActualPreferredWidth(newParams.useDefaultTableWidth, newParams.tablePreferredWidth);
            if (newParams.tablePreferredWidth && !newParams.tablePreferredWidth.equals(initParams.tablePreferredWidth)) {
                history.addAndRedo(new __aspxRichEdit.TablePreferredWidthHistoryItem(modelManipulator, subDocument, table.index, newParams.tablePreferredWidth));
                changed = true;
            }
            if (newParams.tableRowAlignment !== undefined && newParams.tableRowAlignment !== null && newParams.tableRowAlignment !== initParams.tableRowAlignment) {
                history.addAndRedo(new __aspxRichEdit.TableTableRowAlignmentHistoryItem(modelManipulator, subDocument, table.index, newParams.tableRowAlignment, true));
                for (var i = 0; i < table.rows.length; i++)
                    history.addAndRedo(new __aspxRichEdit.TableRowTableRowAlignmentHistoryItem(modelManipulator, subDocument, table.index, i, newParams.tableRowAlignment, true));
                changed = true;
            }
            if (!newParams.tableRowAlignment || newParams.tableRowAlignment !== __aspxRichEdit.TableRowAlignment.Left)
                newParams.tableIndent = 0;
            if (newParams.tableIndent !== initParams.tableIndent) {
                var newTableIndent = __aspxRichEdit.TableWidthUnit.create(newParams.tableIndent, __aspxRichEdit.TableWidthUnitType.ModelUnits);
                history.addAndRedo(new __aspxRichEdit.TableIndentHistoryItem(modelManipulator, subDocument, table.index, newTableIndent, true));
                changed = true;
            }
            if (!newParams.allowCellSpacing)
                newParams.cellSpacing = 0;
            if (newParams.cellSpacing !== undefined && newParams.cellSpacing !== initParams.cellSpacing) {
                var newCellSpacing = void 0;
                if (newParams.allowCellSpacing)
                    newCellSpacing = __aspxRichEdit.TableWidthUnit.create(newParams.cellSpacing / 2, __aspxRichEdit.TableWidthUnitType.ModelUnits);
                else
                    newCellSpacing = subDocument.documentModel.defaultTableProperties.cellSpacing.clone();
                history.addAndRedo(new __aspxRichEdit.TableCellSpacingHistoryItem(modelManipulator, subDocument, table.index, newCellSpacing, true));
                for (var i = 0; i < table.rows.length; i++)
                    history.addAndRedo(new __aspxRichEdit.TableRowCellSpacingHistoryItem(modelManipulator, subDocument, table.index, i, newCellSpacing, true));
                changed = true;
            }
            var newlayoutType = newParams.resizeToFitContent ? __aspxRichEdit.TableLayoutType.Autofit : __aspxRichEdit.TableLayoutType.Fixed;
            if (newlayoutType !== table.properties.layoutType) {
                history.addAndRedo(new __aspxRichEdit.TableLayoutTypeHistoryItem(modelManipulator, subDocument, table.index, newlayoutType, true));
                changed = true;
            }
            if (newParams.defaultCellMarginTop !== initParams.defaultCellMarginTop || newParams.defaultCellMarginRight !== initParams.defaultCellMarginRight ||
                newParams.defaultCellMarginBottom !== initParams.defaultCellMarginBottom || newParams.defaultCellMarginLeft !== initParams.defaultCellMarginLeft) {
                var topCellMargin = __aspxRichEdit.TableWidthUnit.create(newParams.defaultCellMarginTop, __aspxRichEdit.TableWidthUnitType.ModelUnits);
                var rightCellmargin = __aspxRichEdit.TableWidthUnit.create(newParams.defaultCellMarginRight, __aspxRichEdit.TableWidthUnitType.ModelUnits);
                var bottomCellMargin = __aspxRichEdit.TableWidthUnit.create(newParams.defaultCellMarginBottom, __aspxRichEdit.TableWidthUnitType.ModelUnits);
                var leftCellMargin = __aspxRichEdit.TableWidthUnit.create(newParams.defaultCellMarginLeft, __aspxRichEdit.TableWidthUnitType.ModelUnits);
                var newCellMargins = [topCellMargin, rightCellmargin, bottomCellMargin, leftCellMargin];
                history.addAndRedo(new __aspxRichEdit.TableCellMarginsHistoryItem(modelManipulator, subDocument, table.index, newCellMargins, [true, true, true, true]));
                changed = true;
            }
            newParams.rowHeight = this.getActualRowHeight(newParams.useDefaultRowHeight, newParams.rowHeight);
            __aspxRichEdit.ListUtils.foreach(tableInfo.extendedData.rows, function (rowInfo) {
                var row = table.rows[rowInfo.rowIndex];
                if (newParams.rowHeight && !row.height.equals(newParams.rowHeight)) {
                    history.addAndRedo(new __aspxRichEdit.TableRowHeightHistoryItem(modelManipulator, subDocument, table.index, rowInfo.rowIndex, newParams.rowHeight));
                    changed = true;
                }
                if (newParams.cantSplit !== undefined && newParams.cantSplit != initParams.cantSplit) {
                    history.addAndRedo(new __aspxRichEdit.TableRowCantSplitHistoryItem(modelManipulator, subDocument, table.index, rowInfo.rowIndex, newParams.cantSplit, true));
                    changed = true;
                }
            });
            newParams.columnPreferredWidth = this.getActualPreferredWidth(newParams.useDefaultColumnWidth, newParams.columnPreferredWidth);
            if (newParams.columnPreferredWidth) {
                var columnsRange_1 = __aspxRichEdit.TableCellUtils.getColumnsRangeBySelectedCells(tableInfo.extendedData);
                if (columnsRange_1.isNormalized()) {
                    __aspxRichEdit.ListUtils.foreach(table.rows, function (row, rowIndex) {
                        __aspxRichEdit.ListUtils.foreach(__aspxRichEdit.TableCellUtils.getCellIndicesByColumnsRange(row, columnsRange_1), function (cellIndex) {
                            if (!row.cells[cellIndex].preferredWidth.equals(newParams.columnPreferredWidth)) {
                                history.addAndRedo(new __aspxRichEdit.TableCellPreferredWidthHistoryItem(modelManipulator, subDocument, table.index, rowIndex, cellIndex, newParams.columnPreferredWidth));
                                changed = true;
                            }
                        });
                    });
                }
            }
            newParams.cellPreferredWidth = this.getActualPreferredWidth(newParams.useDefaultCellWidth, newParams.cellPreferredWidth);
            tableInfo.extendedData.foreach(function () { }, function (cellInfo, rowInfo) {
                var cell = cellInfo.cell;
                if (newParams.cellPreferredWidth && !cell.preferredWidth.equals(newParams.cellPreferredWidth) && !newParams.cellPreferredWidth.equals(initParams.cellPreferredWidth)) {
                    history.addAndRedo(new __aspxRichEdit.TableCellPreferredWidthHistoryItem(modelManipulator, subDocument, table.index, rowInfo.rowIndex, cellInfo.cellIndex, newParams.cellPreferredWidth));
                    changed = true;
                }
                if (cell.verticalMerging === __aspxRichEdit.TableCellMergingState.Restart) {
                    var nextCellRowIndex = rowInfo.rowIndex + 1;
                    while (table.rows[nextCellRowIndex]) {
                        var nextCellIndex = __aspxRichEdit.TableCellUtils.getCellIndexByColumnIndex(table.rows[nextCellRowIndex], cellInfo.cellIndex);
                        var nextCell = table.rows[nextCellRowIndex].cells[nextCellIndex];
                        if (nextCell.verticalMerging !== __aspxRichEdit.TableCellMergingState.Continue)
                            break;
                        if (newParams.cellPreferredWidth && !nextCell.preferredWidth.equals(newParams.cellPreferredWidth)) {
                            history.addAndRedo(new __aspxRichEdit.TableCellPreferredWidthHistoryItem(modelManipulator, subDocument, table.index, nextCellRowIndex, nextCellIndex, newParams.cellPreferredWidth));
                            changed = true;
                        }
                        nextCellRowIndex++;
                    }
                }
                if (newParams.cellVerticalAlignment !== undefined && newParams.cellVerticalAlignment !== null && newParams.cellVerticalAlignment !== initParams.cellVerticalAlignment) {
                    history.addAndRedo(new __aspxRichEdit.TableCellVerticalAlignmentHistoryItem(modelManipulator, subDocument, table.index, rowInfo.rowIndex, cellInfo.cellIndex, newParams.cellVerticalAlignment, true));
                    changed = true;
                }
                if (newParams.cellNoWrap !== undefined && newParams.cellNoWrap != initParams.cellNoWrap) {
                    history.addAndRedo(new __aspxRichEdit.TableCellNoWrapHistoryItem(modelManipulator, subDocument, table.index, rowInfo.rowIndex, cellInfo.cellIndex, newParams.cellNoWrap, true));
                    changed = true;
                }
                if (newParams.cellMarginsSameAsTable) {
                    var defaultCellMargins = subDocument.documentModel.defaultTableCellProperties.cellMargins;
                    if (!defaultCellMargins.equals(cell.properties.cellMargins)) {
                        var newCellMargins = [defaultCellMargins.top.clone(), defaultCellMargins.right.clone(), defaultCellMargins.bottom.clone(), defaultCellMargins.left.clone()];
                        history.addAndRedo(new __aspxRichEdit.TableCellCellMarginsHistoryItem(modelManipulator, subDocument, table.index, rowInfo.rowIndex, cellInfo.cellIndex, newCellMargins, [false, false, false, false]));
                        changed = true;
                    }
                }
                else {
                    if (newParams.cellMarginTop !== initParams.cellMarginTop || newParams.cellMarginRight !== initParams.cellMarginRight ||
                        newParams.cellMarginBottom !== initParams.cellMarginBottom || newParams.cellMarginLeft !== initParams.cellMarginLeft) {
                        var topCellMargin = __aspxRichEdit.TableWidthUnit.create(newParams.cellMarginTop, __aspxRichEdit.TableWidthUnitType.ModelUnits);
                        var rightCellmargin = __aspxRichEdit.TableWidthUnit.create(newParams.cellMarginRight, __aspxRichEdit.TableWidthUnitType.ModelUnits);
                        var bottomCellMargin = __aspxRichEdit.TableWidthUnit.create(newParams.cellMarginBottom, __aspxRichEdit.TableWidthUnitType.ModelUnits);
                        var leftCellMargin = __aspxRichEdit.TableWidthUnit.create(newParams.cellMarginLeft, __aspxRichEdit.TableWidthUnitType.ModelUnits);
                        var newCellMargins = [topCellMargin, rightCellmargin, bottomCellMargin, leftCellMargin];
                        history.addAndRedo(new __aspxRichEdit.TableCellCellMarginsHistoryItem(modelManipulator, subDocument, table.index, rowInfo.rowIndex, cellInfo.cellIndex, newCellMargins, [true, true, true, true]));
                        changed = true;
                    }
                }
            });
            history.endTransaction();
            return changed;
        };
        DialogTablePropertiesCommand.prototype.getActualPreferredWidth = function (useDefaultValue, preferredWidth) {
            if (useDefaultValue === null)
                return null;
            if (useDefaultValue === true)
                return __aspxRichEdit.TableWidthUnit.create(0, __aspxRichEdit.TableWidthUnitType.Auto);
            return preferredWidth;
        };
        DialogTablePropertiesCommand.prototype.getActualRowHeight = function (useDefaultRowHeight, rowHeight) {
            if (useDefaultRowHeight === null)
                return null;
            if (useDefaultRowHeight === true)
                return __aspxRichEdit.TableHeightUnit.createDefault();
            return rowHeight;
        };
        DialogTablePropertiesCommand.prototype.getInitialTab = function () {
            return TablePropertiesDialogTab.Table;
        };
        DialogTablePropertiesCommand.prototype.getDialogName = function () {
            return "TableProperties";
        };
        return DialogTablePropertiesCommand;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogTablePropertiesCommand = DialogTablePropertiesCommand;
    var DialogCellPropertiesCommand = (function (_super) {
        __extends(DialogCellPropertiesCommand, _super);
        function DialogCellPropertiesCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogCellPropertiesCommand.prototype.getInitialTab = function () {
            return TablePropertiesDialogTab.Cell;
        };
        return DialogCellPropertiesCommand;
    }(DialogTablePropertiesCommand));
    __aspxRichEdit.DialogCellPropertiesCommand = DialogCellPropertiesCommand;
    var TablePropertiesDialogParameters = (function (_super) {
        __extends(TablePropertiesDialogParameters, _super);
        function TablePropertiesDialogParameters() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TablePropertiesDialogParameters.prototype.init = function (tableInfo, model, maxTableWidth, tab) {
            var table = tableInfo.table;
            this.tableInit(table, model);
            this.rowInit(tableInfo, model);
            this.columnInit(tableInfo);
            this.cellInit(tableInfo, model);
            this.maxTableWidth = maxTableWidth;
            this.initialTab = tab;
            this.isNestedTable = table.nestedLevel > 0;
        };
        TablePropertiesDialogParameters.prototype.tableInit = function (table, model) {
            this.useDefaultTableWidth = table.preferredWidth.type === __aspxRichEdit.TableWidthUnitType.Auto || table.preferredWidth.type === __aspxRichEdit.TableWidthUnitType.Nil;
            this.tablePreferredWidth = table.preferredWidth.clone();
            this.tableRowAlignment = __aspxRichEdit.LayoutFormatter.Table.TableAlignmentApplier.getTableAlignment(table);
            var actualTableIndent = new __aspxRichEdit.TablePropertiesMergerIndent()
                .getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, model.defaultTableProperties);
            this.tableIndent = actualTableIndent.type === __aspxRichEdit.TableWidthUnitType.ModelUnits ? actualTableIndent.value : 0;
            this.cellSpacing = this.getCellSpacing(table, model);
            this.allowCellSpacing = this.cellSpacing !== 0;
            var layoutType = new __aspxRichEdit.TablePropertiesMergerLayoutType().getProperty(table.properties);
            this.resizeToFitContent = layoutType === __aspxRichEdit.TableLayoutType.Autofit;
            this.defaultCellMarginLeft = new __aspxRichEdit.TablePropertiesMergerMarginLeft().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, model.defaultTableProperties).value;
            this.defaultCellMarginRight = new __aspxRichEdit.TablePropertiesMergerMarginRight().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, model.defaultTableProperties).value;
            this.defaultCellMarginTop = new __aspxRichEdit.TablePropertiesMergerMarginTop().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, model.defaultTableProperties).value;
            this.defaultCellMarginBottom = new __aspxRichEdit.TablePropertiesMergerMarginBottom().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, model.defaultTableProperties).value;
        };
        TablePropertiesDialogParameters.prototype.getCellSpacing = function (table, model) {
            var firstRow = table.rows[0];
            var firstRowCellSpacing = new __aspxRichEdit.TableRowPropertiesMergerCellSpacing(model, table, firstRow.tablePropertiesException)
                .getProperty(firstRow.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.FirstRow, model.defaultTableRowProperties);
            for (var i = 0, currentRow = void 0; currentRow = table.rows[i]; i++) {
                var currentRowCellSpacing = new __aspxRichEdit.TableRowPropertiesMergerCellSpacing(model, table, currentRow.tablePropertiesException)
                    .getProperty(currentRow.properties, table.style, currentRow.conditionalFormatting, model.defaultTableRowProperties);
                if (!firstRowCellSpacing.equals(currentRowCellSpacing))
                    return null;
            }
            return firstRowCellSpacing.type === __aspxRichEdit.TableWidthUnitType.ModelUnits ? (firstRowCellSpacing.value * 2) : 0;
        };
        TablePropertiesDialogParameters.prototype.rowInit = function (tableInfo, model) {
            var table = tableInfo.table;
            var identicalRowHeight = true;
            var identicalCantSplit = true;
            var cantSplitMerger = new __aspxRichEdit.TableRowPropertiesMergerCantSplit();
            var firstRow = table.rows[tableInfo.extendedData.startRowIndex];
            var firstRowCantSplit = cantSplitMerger.getProperty(firstRow.properties, table.style, firstRow.conditionalFormatting, model.defaultTableRowProperties);
            var firstRowHeight = firstRow.height.clone();
            __aspxRichEdit.ListUtils.reverseForeach(tableInfo.extendedData.rows, function (rowInfo) {
                var currentRow = table.rows[rowInfo.rowIndex];
                var currentCantSplit = cantSplitMerger.getProperty(currentRow.properties, table.style, currentRow.conditionalFormatting, model.defaultTableRowProperties);
                identicalRowHeight = currentRow.height.equals(firstRowHeight);
                identicalCantSplit = identicalCantSplit && (firstRowCantSplit === currentCantSplit);
            }, tableInfo.extendedData.rows.length - 1, 1);
            this.useDefaultRowHeight = identicalRowHeight ? firstRowHeight.value === 0 : null;
            this.cantSplit = identicalCantSplit ? firstRowCantSplit : null;
            this.rowHeight = __aspxRichEdit.TableHeightUnit.create(identicalRowHeight ? firstRowHeight.value : 0, firstRowHeight.type === __aspxRichEdit.TableHeightUnitType.Exact ? __aspxRichEdit.TableHeightUnitType.Exact : __aspxRichEdit.TableHeightUnitType.Minimum);
        };
        TablePropertiesDialogParameters.prototype.columnInit = function (tableInfo) {
            var table = tableInfo.table;
            var identicalColumnWidth = true;
            var columnsRange = __aspxRichEdit.TableCellUtils.getColumnsRangeBySelectedCells(tableInfo.extendedData);
            var firstCellWidth = null;
            for (var rowIndex = 0, row = void 0; row = table.rows[rowIndex]; rowIndex++) {
                var cellIndices = __aspxRichEdit.TableCellUtils.getCellIndicesByColumnsRange(row, columnsRange);
                for (var i = 0; i < cellIndices.length; i++) {
                    var cellIndex = cellIndices[i];
                    if (firstCellWidth === null)
                        firstCellWidth = table.rows[rowIndex].cells[cellIndex].preferredWidth;
                    else
                        identicalColumnWidth = identicalColumnWidth && table.rows[rowIndex].cells[cellIndex].preferredWidth.equals(firstCellWidth);
                }
            }
            this.useDefaultColumnWidth = identicalColumnWidth ? firstCellWidth.type === __aspxRichEdit.TableWidthUnitType.Auto : null;
            this.columnPreferredWidth = firstCellWidth.clone();
        };
        TablePropertiesDialogParameters.prototype.cellInit = function (tableInfo, model) {
            var _this = this;
            var table = tableInfo.table;
            this.cellMarginsSameAsTable = true;
            var identicalCellWidth = true;
            var identicalVerticalAlignment = true;
            var identicalNoWrap = true;
            var identicalLeftMargins = true;
            var identicalRightMargins = true;
            var identicalTopMargins = true;
            var identicalBottomMargins = true;
            var noWrapMerger = new __aspxRichEdit.TableCellPropertiesMergerNoWrap();
            var verticalAlignmentMerger = new __aspxRichEdit.TableCellVerticalAlignmentMerger();
            var firstSelectedCell = tableInfo.extendedData.firstCell;
            var firstCellWidth = firstSelectedCell.preferredWidth.clone();
            var firstCellVerticalAlignment = verticalAlignmentMerger.getProperty(firstSelectedCell.properties, table.style, firstSelectedCell.conditionalFormatting, model.defaultTableCellProperties);
            var firstCellNoWrap = noWrapMerger.getProperty(firstSelectedCell.properties, table.style, firstSelectedCell.conditionalFormatting, model.defaultTableCellProperties);
            var firstCellMargins = this.getActualCellMargins(table, firstSelectedCell, model);
            __aspxRichEdit.ListUtils.foreach(tableInfo.extendedData.rows, function (rowInfo) {
                __aspxRichEdit.ListUtils.foreach(rowInfo.cells, function (cellInfo) {
                    var cell = cellInfo.cell;
                    identicalCellWidth = identicalCellWidth && (firstCellWidth.equals(cell.preferredWidth));
                    var currentCellVerticalAlignment = verticalAlignmentMerger.getProperty(cell.properties, table.style, cell.conditionalFormatting, model.defaultTableCellProperties);
                    identicalVerticalAlignment = identicalVerticalAlignment && (firstCellVerticalAlignment === currentCellVerticalAlignment);
                    var currentCellNoWrap = noWrapMerger.getProperty(cell.properties, table.style, cell.conditionalFormatting, model.defaultTableCellProperties);
                    identicalNoWrap = identicalNoWrap && (firstCellNoWrap === currentCellNoWrap);
                    var curreantCellMargins = _this.getActualCellMargins(table, cell, model);
                    identicalTopMargins = identicalTopMargins && firstCellMargins.top.equals(curreantCellMargins.top);
                    identicalRightMargins = identicalRightMargins && firstCellMargins.right.equals(curreantCellMargins.right);
                    identicalBottomMargins = identicalBottomMargins && firstCellMargins.bottom.equals(curreantCellMargins.bottom);
                    identicalLeftMargins = identicalLeftMargins && firstCellMargins.left.equals(curreantCellMargins.left);
                    if (cell.properties.getUseValue(__aspxRichEdit.TableCellPropertiesMask.UseTopMargin) || cell.properties.getUseValue(__aspxRichEdit.TableCellPropertiesMask.UseRightMargin) ||
                        cell.properties.getUseValue(__aspxRichEdit.TableCellPropertiesMask.UseBottomMargin) || cell.properties.getUseValue(__aspxRichEdit.TableCellPropertiesMask.UseLeftMargin))
                        _this.cellMarginsSameAsTable = false;
                });
            });
            this.useDefaultCellWidth = identicalCellWidth ? firstCellWidth.type === __aspxRichEdit.TableWidthUnitType.Auto : null;
            this.cellPreferredWidth = firstCellWidth;
            this.cellVerticalAlignment = identicalVerticalAlignment ? firstCellVerticalAlignment : null;
            this.cellNoWrap = identicalNoWrap ? firstCellNoWrap : null;
            this.cellMarginTop = identicalTopMargins ? firstCellMargins.top.value : null;
            this.cellMarginRight = identicalRightMargins ? firstCellMargins.right.value : null;
            this.cellMarginBottom = identicalBottomMargins ? firstCellMargins.bottom.value : null;
            this.cellMarginLeft = identicalLeftMargins ? firstCellMargins.left.value : null;
        };
        TablePropertiesDialogParameters.prototype.getActualCellMargins = function (table, cell, model) {
            var defaultTableCellProps = model.defaultTableCellProperties;
            var cellMarginLeft = new __aspxRichEdit.TableCellPropertiesMergerMarginLeft(table, model, cell.parentRow.tablePropertiesException)
                .getProperty(cell.properties, table.style, cell.conditionalFormatting, defaultTableCellProps).clone();
            var cellMarginRight = new __aspxRichEdit.TableCellPropertiesMergerMarginRight(table, model, cell.parentRow.tablePropertiesException)
                .getProperty(cell.properties, table.style, cell.conditionalFormatting, defaultTableCellProps).clone();
            var cellMarginTop = new __aspxRichEdit.TableCellPropertiesMergerMarginTop(table, model, cell.parentRow.tablePropertiesException)
                .getProperty(cell.properties, table.style, cell.conditionalFormatting, defaultTableCellProps).clone();
            var cellMarginBottom = new __aspxRichEdit.TableCellPropertiesMergerMarginBottom(table, model, cell.parentRow.tablePropertiesException)
                .getProperty(cell.properties, table.style, cell.conditionalFormatting, defaultTableCellProps).clone();
            return __aspxRichEdit.TableCellMargins.create(cellMarginTop, cellMarginRight, cellMarginBottom, cellMarginLeft);
        };
        TablePropertiesDialogParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.useDefaultTableWidth = obj.useDefaultTableWidth;
            this.tablePreferredWidth = obj.tablePreferredWidth.clone();
            this.tableRowAlignment = obj.tableRowAlignment;
            this.tableIndent = obj.tableIndent;
            this.cellSpacing = obj.cellSpacing;
            this.allowCellSpacing = obj.allowCellSpacing;
            this.resizeToFitContent = obj.resizeToFitContent;
            this.defaultCellMarginLeft = obj.defaultCellMarginLeft;
            this.defaultCellMarginRight = obj.defaultCellMarginRight;
            this.defaultCellMarginTop = obj.defaultCellMarginTop;
            this.defaultCellMarginBottom = obj.defaultCellMarginTop;
            this.useDefaultRowHeight = obj.useDefaultRowHeight;
            this.rowHeight = obj.rowHeight.clone();
            this.cantSplit = obj.cantSplit;
            this.useDefaultColumnWidth = obj.useDefaultColumnWidth;
            this.columnPreferredWidth = obj.columnPreferredWidth.clone();
            this.useDefaultCellWidth = obj.useDefaultCellWidth;
            this.cellPreferredWidth = obj.cellPreferredWidth.clone();
            this.cellVerticalAlignment = obj.cellVerticalAlignment;
            this.cellNoWrap = obj.cellNoWrap;
            this.cellMarginLeft = obj.cellMarginLeft;
            this.cellMarginRight = obj.cellMarginRight;
            this.cellMarginTop = obj.cellMarginTop;
            this.cellMarginBottom = obj.cellMarginBottom;
            this.cellMarginsSameAsTable = obj.cellMarginsSameAsTable;
            this.maxTableWidth = obj.maxTableWidth;
            this.initialTab = obj.initialTab;
            this.isNestedTable = obj.isNestedTable;
        };
        TablePropertiesDialogParameters.prototype.clone = function () {
            var newInstance = new TablePropertiesDialogParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        TablePropertiesDialogParameters.prototype.toAnotherMeasuringSystem = function (converter) {
            if (this.tablePreferredWidth && this.tablePreferredWidth.type === __aspxRichEdit.TableWidthUnitType.ModelUnits)
                this.tablePreferredWidth.value = converter(this.tablePreferredWidth.value);
            if (this.tableIndent)
                this.tableIndent = converter(this.tableIndent);
            if (this.cellSpacing)
                this.cellSpacing = converter(this.cellSpacing);
            if (this.defaultCellMarginLeft)
                this.defaultCellMarginLeft = converter(this.defaultCellMarginLeft);
            if (this.defaultCellMarginRight)
                this.defaultCellMarginRight = converter(this.defaultCellMarginRight);
            if (this.defaultCellMarginTop)
                this.defaultCellMarginTop = converter(this.defaultCellMarginTop);
            if (this.defaultCellMarginBottom)
                this.defaultCellMarginBottom = converter(this.defaultCellMarginBottom);
            if (this.rowHeight)
                this.rowHeight.value = converter(this.rowHeight.value);
            if (this.columnPreferredWidth && this.columnPreferredWidth.type === __aspxRichEdit.TableWidthUnitType.ModelUnits)
                this.columnPreferredWidth.value = converter(this.columnPreferredWidth.value);
            if (this.cellPreferredWidth && this.cellPreferredWidth.type === __aspxRichEdit.TableWidthUnitType.ModelUnits)
                this.cellPreferredWidth.value = converter(this.cellPreferredWidth.value);
            if (this.cellMarginTop)
                this.cellMarginTop = converter(this.cellMarginTop);
            if (this.cellMarginRight)
                this.cellMarginRight = converter(this.cellMarginRight);
            if (this.cellMarginBottom)
                this.cellMarginBottom = converter(this.cellMarginBottom);
            if (this.cellMarginLeft)
                this.cellMarginLeft = converter(this.cellMarginLeft);
            if (this.maxTableWidth)
                this.maxTableWidth = converter(this.maxTableWidth);
            return this;
        };
        return TablePropertiesDialogParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.TablePropertiesDialogParameters = TablePropertiesDialogParameters;
    var TablePropertiesDialogDefaults = (function () {
        function TablePropertiesDialogDefaults() {
        }
        TablePropertiesDialogDefaults.MinTableIndentByDefault = -15 * 1440;
        TablePropertiesDialogDefaults.MaxTableIndentByDefault = 15 * 1440;
        TablePropertiesDialogDefaults.MinTableWidthByDefault = 0;
        TablePropertiesDialogDefaults.MaxTableWidthInModelUnitsByDefault = 22 * 1440;
        TablePropertiesDialogDefaults.MaxTableWidthInPercentByDefault = 600;
        TablePropertiesDialogDefaults.MinRowHeightByDefault = 0;
        TablePropertiesDialogDefaults.MaxRowHeightByDefault = 22 * 1440;
        TablePropertiesDialogDefaults.MinColumnWidthByDefault = 0;
        TablePropertiesDialogDefaults.MaxColumnWidthInModelUnitsByDefault = 22 * 1440;
        TablePropertiesDialogDefaults.MaxColumnWidthInPercentByDefault = 100;
        TablePropertiesDialogDefaults.MinCellWidthByDefault = 0;
        TablePropertiesDialogDefaults.MaxCellWidthInModelUnitsByDefault = 22 * 1440;
        TablePropertiesDialogDefaults.MaxCellWidthInPercentByDefault = 100;
        return TablePropertiesDialogDefaults;
    }());
    __aspxRichEdit.TablePropertiesDialogDefaults = TablePropertiesDialogDefaults;
    var TablePropertiesDialogTab;
    (function (TablePropertiesDialogTab) {
        TablePropertiesDialogTab[TablePropertiesDialogTab["Table"] = 0] = "Table";
        TablePropertiesDialogTab[TablePropertiesDialogTab["Row"] = 1] = "Row";
        TablePropertiesDialogTab[TablePropertiesDialogTab["Column"] = 2] = "Column";
        TablePropertiesDialogTab[TablePropertiesDialogTab["Cell"] = 3] = "Cell";
    })(TablePropertiesDialogTab = __aspxRichEdit.TablePropertiesDialogTab || (__aspxRichEdit.TablePropertiesDialogTab = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DialogTabsCommand = (function (_super) {
        __extends(DialogTabsCommand, _super);
        function DialogTabsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogTabsCommand.prototype.createParameters = function (_options) {
            var parameters = new DialogTabsParameters();
            parameters.defaultTabStop = this.control.model.defaultTabWidth;
            var paragraphIndices = this.control.model.activeSubDocument.getParagraphIndicesByIntervals(this.control.selection.intervals);
            if (this.paragraphsHasEqualTabProperties(paragraphIndices))
                parameters.tabProperties = this.control.model.activeSubDocument.paragraphs[paragraphIndices[0]].tabs.clone();
            else
                parameters.tabProperties = new __aspxRichEdit.TabProperties();
            return parameters;
        };
        DialogTabsCommand.prototype.applyParameters = function (_state, newParams, initParams) {
            var modelManipulator = this.control.modelManipulator;
            this.control.history.beginTransaction();
            if (newParams.defaultTabStop && newParams.defaultTabStop !== initParams.defaultTabStop)
                this.control.history.addAndRedo(new __aspxRichEdit.DocumentDefaultTabWidthHistoryItem(modelManipulator, modelManipulator.model.activeSubDocument, newParams.defaultTabStop));
            this.deleteAllTabs();
            var paragraphIndices = this.control.model.activeSubDocument.getParagraphIndicesByIntervals(this.control.selection.intervals);
            for (var i = 0, tabInfo = void 0; tabInfo = newParams.tabProperties.tabsInfo[i]; i++) {
                for (var j = paragraphIndices.length - 1; j >= 0; j--) {
                    var paragraphIndex = paragraphIndices[j];
                    var paragraph = this.control.model.activeSubDocument.paragraphs[paragraphIndex];
                    this.control.history.addAndRedo(new __aspxRichEdit.InsertTabToParagraphHistoryItem(modelManipulator, modelManipulator.model.activeSubDocument, paragraph.interval, tabInfo));
                }
            }
            this.control.history.endTransaction();
            return true;
        };
        DialogTabsCommand.prototype.deleteAllTabs = function () {
            var modelManipulator = this.control.modelManipulator;
            var paragraphIndices = this.control.model.activeSubDocument.getParagraphIndicesByIntervals(this.control.selection.intervals);
            for (var i = paragraphIndices.length - 1; i >= 0; i--) {
                var paragraph = this.control.model.activeSubDocument.paragraphs[paragraphIndices[i]];
                var interval = paragraph.interval;
                var tabs = paragraph.getTabs();
                var tab = void 0;
                while (tab = tabs.positions.pop())
                    this.control.history.addAndRedo(new __aspxRichEdit.DeleteTabAtParagraphHistoryItem(modelManipulator, modelManipulator.model.activeSubDocument, interval, tab));
            }
        };
        DialogTabsCommand.prototype.paragraphsHasEqualTabProperties = function (paragraphIndices) {
            var firstParagraph = this.control.model.activeSubDocument.paragraphs[paragraphIndices[0]];
            for (var i = paragraphIndices.length - 1; i > 0; i--) {
                var paragraph = this.control.model.activeSubDocument.paragraphs[paragraphIndices[i]];
                if (!firstParagraph.tabs.equals(paragraph.tabs))
                    return false;
            }
            return true;
        };
        DialogTabsCommand.prototype.getDialogName = function () {
            return "Tabs";
        };
        return DialogTabsCommand;
    }(__aspxRichEdit.ShowDialogCommandBase));
    __aspxRichEdit.DialogTabsCommand = DialogTabsCommand;
    var DialogTabsParameters = (function (_super) {
        __extends(DialogTabsParameters, _super);
        function DialogTabsParameters() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DialogTabsParameters.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.defaultTabStop = obj.defaultTabStop;
            this.tabProperties = obj.tabProperties.clone();
        };
        DialogTabsParameters.prototype.clone = function () {
            var newInstance = new DialogTabsParameters();
            newInstance.copyFrom(this);
            return newInstance;
        };
        DialogTabsParameters.prototype.toAnotherMeasuringSystem = function (converter) {
            if (this.defaultTabStop)
                this.defaultTabStop = converter(this.defaultTabStop);
            return this;
        };
        return DialogTabsParameters;
    }(__aspxRichEdit.DialogParametersBase));
    __aspxRichEdit.DialogTabsParameters = DialogTabsParameters;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ShowQuickSearchPanelCommand = (function (_super) {
        __extends(ShowQuickSearchPanelCommand, _super);
        function ShowQuickSearchPanelCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ShowQuickSearchPanelCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        ShowQuickSearchPanelCommand.prototype.executeCore = function (_state) {
            this.control.owner.showQuickSearchPanel();
            return true;
        };
        ShowQuickSearchPanelCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return ShowQuickSearchPanelCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ShowQuickSearchPanelCommand = ShowQuickSearchPanelCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DownloadDocumentCommand = (function (_super) {
        __extends(DownloadDocumentCommand, _super);
        function DownloadDocumentCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DownloadDocumentCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        DownloadDocumentCommand.prototype.executeCore = function (_state, options) {
            this.control.serverDispatcher.forceSendingRequest();
            this.control.owner.sendDownloadRequest(__aspxRichEdit.DownloadRequestType.DownloadCurrentDocument, JSON.stringify({
                "documentFormat": options.param
            }));
            return true;
        };
        DownloadDocumentCommand.prototype.lockInputPositionUpdating = function (_prevModifiedState) {
            return true;
        };
        DownloadDocumentCommand.prototype.lockUIUpdating = function (_prevModifiedState) {
            return true;
        };
        DownloadDocumentCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.download);
        };
        DownloadDocumentCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return DownloadDocumentCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.DownloadDocumentCommand = DownloadDocumentCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var NewDocumentCommand = (function (_super) {
        __extends(NewDocumentCommand, _super);
        function NewDocumentCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        NewDocumentCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.visible = this.control.options.createNew !== __aspxRichEdit.DocumentCapability.Hidden;
            return state;
        };
        NewDocumentCommand.prototype.executeCore = function (_state) {
            if (this.control.getModifiedState() && !this.control.owner.confirmOnLosingChanges())
                return false;
            this.control.closeDocument();
            this.control.serverDispatcher.pushRequest(new __aspxRichEdit.LoadCommandRequest(__aspxRichEdit.CommandType.NewDocument, -1, {}), new __aspxRichEdit.RequestParams(true, true, true));
            return true;
        };
        NewDocumentCommand.prototype.lockInputPositionUpdating = function (_prevModifiedState) {
            return true;
        };
        NewDocumentCommand.prototype.lockUIUpdating = function (_prevModifiedState) {
            return true;
        };
        NewDocumentCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.createNew);
        };
        NewDocumentCommand.prototype.isEnabledInClosedDocument = function () {
            return true;
        };
        NewDocumentCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return NewDocumentCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.NewDocumentCommand = NewDocumentCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var PrintDocumentCommand = (function (_super) {
        __extends(PrintDocumentCommand, _super);
        function PrintDocumentCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        PrintDocumentCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.visible = this.control.options.printing !== __aspxRichEdit.DocumentCapability.Hidden;
            return state;
        };
        PrintDocumentCommand.prototype.executeCore = function (_state) {
            var _this = this;
            var updateAllFieldsCommand = this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.UpdateAllFields);
            if (this.control.fieldsSettings.updateFieldsBeforePrint && updateAllFieldsCommand.getState().enabled) {
                var opts = new __aspxRichEdit.CommandSimpleOptions(this.control, new __aspxRichEdit.UpdateAllFieldsCommandOptions());
                opts.param.callback = function () {
                    _this.sendPrintRequest();
                };
                opts.param.updateOptions.updateToc = false;
                updateAllFieldsCommand.execute(this.control.commandManager.isPublicApiCall, opts);
            }
            else
                this.sendPrintRequest();
            return true;
        };
        PrintDocumentCommand.prototype.sendPrintRequest = function () {
            if (this.control.serverDispatcher.hasQueue()) {
                this.control.serverDispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.DelayedPrint, -1, {}), new __aspxRichEdit.RequestParams(false, true, false));
            }
            else
                this.control.owner.sendDownloadRequest(DownloadRequestType.PrintCurrentDocument);
        };
        PrintDocumentCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        PrintDocumentCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.printing);
        };
        return PrintDocumentCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.PrintDocumentCommand = PrintDocumentCommand;
    var DownloadRequestType;
    (function (DownloadRequestType) {
        DownloadRequestType[DownloadRequestType["PrintCurrentDocument"] = 0] = "PrintCurrentDocument";
        DownloadRequestType[DownloadRequestType["DownloadCurrentDocument"] = 1] = "DownloadCurrentDocument";
    })(DownloadRequestType = __aspxRichEdit.DownloadRequestType || (__aspxRichEdit.DownloadRequestType = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ReloadDocumentCommand = (function (_super) {
        __extends(ReloadDocumentCommand, _super);
        function ReloadDocumentCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ReloadDocumentCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        ReloadDocumentCommand.prototype.executeCore = function (_state) {
            this.control.closeDocument();
            this.control.serverDispatcher.pushRequest(new __aspxRichEdit.LoadCommandRequest(__aspxRichEdit.CommandType.ReloadDocument, -1, {}), new __aspxRichEdit.RequestParams(false, true, true));
            return true;
        };
        ReloadDocumentCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return ReloadDocumentCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ReloadDocumentCommand = ReloadDocumentCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SaveDocumentCommand = (function (_super) {
        __extends(SaveDocumentCommand, _super);
        function SaveDocumentCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SaveDocumentCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.visible = this.control.options.save !== __aspxRichEdit.DocumentCapability.Hidden;
            return state;
        };
        SaveDocumentCommand.prototype.executeCore = function () {
            if (this.needShowSaveAsDialog())
                return this.executeSaveAsCommand();
            var params = {};
            params[__aspxRichEdit.JSONInitSessionProperty.HistoryId] = this.control.history.getCurrentItemId();
            this.control.serverDispatcher.pushRequest(new __aspxRichEdit.LoadCommandRequest(__aspxRichEdit.CommandType.SaveDocument, -1, params), new __aspxRichEdit.RequestParams(false, true, true));
            return true;
        };
        SaveDocumentCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.save) &&
                (this.control.getModifiedState() === __aspxRichEdit.IsModified.True || !this.control.documentInfo.hasSource());
        };
        SaveDocumentCommand.prototype.needShowSaveAsDialog = function () {
            var documentInfo = this.control.documentInfo;
            return this.control.owner.hasWorkDirectory && !documentInfo.getFileName() && !documentInfo.hasSource() && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.saveAs);
        };
        SaveDocumentCommand.prototype.executeSaveAsCommand = function () {
            return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.FileSaveAs).execute(this.control.commandManager.isPublicApiCall);
        };
        SaveDocumentCommand.prototype.canModify = function () {
            return true;
        };
        return SaveDocumentCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.SaveDocumentCommand = SaveDocumentCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangePageColorCommand = (function (_super) {
        __extends(ChangePageColorCommand, _super);
        function ChangePageColorCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangePageColorCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.value = this.control.model.pageBackColor;
            state.denyUpdateValue = true;
            return state;
        };
        ChangePageColorCommand.prototype.executeCore = function (_state, parameter) {
            var newColor = parameter.param;
            if (newColor != this.control.model.pageBackColor) {
                this.control.history.addAndRedo(new __aspxRichEdit.PageColorHistoryItem(this.control.modelManipulator, this.control.model.activeSubDocument, newColor));
                return true;
            }
            return false;
        };
        ChangePageColorCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && !this.control.model.isDocumentProtectionEnabled;
        };
        ChangePageColorCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return __aspxRichEdit.ColorHelper.anyToColor(parameter, __aspxRichEdit.ColorHelper.NO_COLOR);
        };
        return ChangePageColorCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ChangePageColorCommand = ChangePageColorCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeHyperlinkCommandOptions = (function (_super) {
        __extends(ChangeHyperlinkCommandOptions, _super);
        function ChangeHyperlinkCommandOptions(control, fieldIndex, hyperlinkInfo, text) {
            var _this = _super.call(this, control) || this;
            _this.fieldIndex = fieldIndex;
            _this.hyperlinkInfo = hyperlinkInfo;
            _this.text = text;
            return _this;
        }
        return ChangeHyperlinkCommandOptions;
    }(__aspxRichEdit.CommandOptions));
    __aspxRichEdit.ChangeHyperlinkCommandOptions = ChangeHyperlinkCommandOptions;
    var ChangeHyperlinkCommand = (function (_super) {
        __extends(ChangeHyperlinkCommand, _super);
        function ChangeHyperlinkCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeHyperlinkCommand.prototype.getState = function (options) {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled() && options.fieldIndex >= 0);
        };
        ChangeHyperlinkCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.fields);
        };
        ChangeHyperlinkCommand.prototype.executeCore = function (_state, options) {
            var field = options.subDocument.fields[options.fieldIndex];
            if (!field || !field.isHyperlinkField())
                return false;
            this.control.history.beginTransaction();
            this.control.modelManipulator.insertText(this.control, options.subDocument, field.getCodeInterval(), __aspxRichEdit.DialogHyperlinkCommandBase.getNewCodeText(options.hyperlinkInfo), false, false, __aspxRichEdit.ModelScrollManager.DontChangeScrollPosition);
            if (options.text)
                this.control.modelManipulator.insertText(this.control, options.subDocument, field.getResultInterval(), options.text, false, false, __aspxRichEdit.ModelScrollManager.DontChangeScrollPosition);
            this.control.history.addAndRedo(new __aspxRichEdit.ChangeFieldHyperlinkInfoHistoryItem(this.control.modelManipulator, options.subDocument, field.index, options.hyperlinkInfo));
            this.control.history.endTransaction();
            return true;
        };
        return ChangeHyperlinkCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ChangeHyperlinkCommand = ChangeHyperlinkCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var CreateFieldCommandBase = (function (_super) {
        __extends(CreateFieldCommandBase, _super);
        function CreateFieldCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CreateFieldCommandBase.prototype.getState = function () {
            return new __aspxRichEdit.IntervalCommandState(this.isEnabled(), this.control.selection.getLastSelectedInterval());
        };
        CreateFieldCommandBase.isTableProtectionOk = function (control) {
            var subDoc = control.model.activeSubDocument;
            var interval = CreateFieldCommandBase.getIntervalWithoutLastParagraphMark(control.selection.getLastSelectedInterval(), subDoc);
            if (interval.length == 0)
                return true;
            var tables = control.model.activeSubDocument.tables;
            for (var tblIndex = Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(tables, function (t) { return t.getStartPosition(); }, interval.start)), table = void 0; table = tables[tblIndex]; tblIndex++) {
                if (table.getStartPosition() >= interval.end)
                    break;
                if (__aspxRichEdit.IntervalAlgorithms.getIntersectionNonNullLength(table.interval, interval)) {
                    var startCell = __aspxRichEdit.Table.getTableCellByPosition(tables, interval.start);
                    var endCell = __aspxRichEdit.Table.getTableCellByPosition(tables, interval.end);
                    return startCell && endCell && startCell === endCell &&
                        interval.end < subDoc.getParagraphByPosition(endCell.endParagrapPosition.value).getEndPosition();
                }
            }
            return true;
        };
        CreateFieldCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.fields) &&
                CreateFieldCommandBase.isTableProtectionOk(this.control) && this.control.model.activeSubDocument.fieldsWaitingForUpdate == null;
        };
        CreateFieldCommandBase.getIntervalWithoutLastParagraphMark = function (interval, subDocument) {
            interval = interval.clone();
            var lastDocPos = subDocument.getDocumentEndPosition();
            if (interval.end == lastDocPos) {
                interval.length--;
                if (interval.length < 0)
                    interval = new __aspxRichEdit.FixedInterval(lastDocPos - 1, 0);
            }
            return interval;
        };
        return CreateFieldCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.CreateFieldCommandBase = CreateFieldCommandBase;
    var CreateFieldCommand = (function (_super) {
        __extends(CreateFieldCommand, _super);
        function CreateFieldCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CreateFieldCommand.prototype.DEPRECATEDCorrectlMainCommandOptions = function (options) {
            options.intervals = [CreateFieldCommandBase.getIntervalWithoutLastParagraphMark(this.control.selection.getLastSelectedInterval(), options.subDocument)];
        };
        CreateFieldCommand.prototype.executeCore = function (_state, options) {
            var subDocument = options.subDocument;
            var interval = options.intervals[0];
            this.control.history.addAndRedo(new __aspxRichEdit.FieldInsertHistoryItem(this.control, this.control.modelManipulator, subDocument, interval.start, interval.length, 0, true));
            __aspxRichEdit.Field.DEBUG_FIELDS_CHECKS(subDocument);
            return true;
        };
        return CreateFieldCommand;
    }(CreateFieldCommandBase));
    __aspxRichEdit.CreateFieldCommand = CreateFieldCommand;
    var CreatePredefinedFieldCommand = (function (_super) {
        __extends(CreatePredefinedFieldCommand, _super);
        function CreatePredefinedFieldCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CreatePredefinedFieldCommand.prototype.DEPRECATEDCorrectlMainCommandOptions = function (options) {
            options.intervals = [CreateFieldCommandBase.getIntervalWithoutLastParagraphMark(this.control.selection.getLastSelectedInterval(), options.subDocument)];
        };
        CreatePredefinedFieldCommand.prototype.executeCore = function (_state, options) {
            var _this = this;
            var subDocument = options.subDocument;
            var interval = options.intervals[0];
            var selection = this.control.selection;
            var history = this.control.history;
            history.beginTransaction();
            var startPosition = interval.start;
            history.addAndRedo(new __aspxRichEdit.SetSelectionHistoryItem(this.control.modelManipulator, subDocument, [new __aspxRichEdit.FixedInterval(startPosition, 0)], selection, __aspxRichEdit.UpdateInputPositionProperties.No, false));
            if (interval.length > 0)
                history.addAndRedo(new __aspxRichEdit.RemoveIntervalHistoryItem(this.control.modelManipulator, subDocument, interval, false));
            var run = subDocument.getRunByPosition(startPosition);
            var prefix = this.getPrefix();
            if (prefix.length > 0) {
                history.addAndRedo(new __aspxRichEdit.InsertTextHistoryItem(this.control.modelManipulator, subDocument, startPosition, prefix + " ", run.maskedCharacterProperties, run.characterStyle));
                startPosition += prefix.length + 1;
            }
            if (this.needNewParagraph()) {
                var currentParagraph = subDocument.getParagraphByPosition(startPosition);
                if (startPosition > currentParagraph.startLogPosition.value) {
                    __aspxRichEdit.ModelManipulator.insertParagraph(this.control, subDocument, new __aspxRichEdit.FixedInterval(startPosition, 0));
                    startPosition++;
                }
                __aspxRichEdit.ModelManipulator.insertParagraph(this.control, subDocument, new __aspxRichEdit.FixedInterval(startPosition, 0));
            }
            history.addAndRedo(new __aspxRichEdit.FieldInsertHistoryItem(this.control, this.control.modelManipulator, subDocument, startPosition, 0, 0, !this.needUpdate()));
            var insertedText = this.getInsertedText(options.param);
            history.addAndRedo(new __aspxRichEdit.InsertTextHistoryItem(this.control.modelManipulator, subDocument, startPosition + 1, insertedText, run.maskedCharacterProperties, run.characterStyle));
            var fieldInterval = this.needUpdate() ?
                __aspxRichEdit.FixedInterval.fromPositions(startPosition, startPosition + insertedText.length + 3) :
                new __aspxRichEdit.FixedInterval(startPosition + insertedText.length, 0);
            history.addAndRedo(new __aspxRichEdit.SetSelectionHistoryItem(this.control.modelManipulator, subDocument, [fieldInterval], selection, __aspxRichEdit.UpdateInputPositionProperties.No, false));
            if (this.needUpdate()) {
                (new __aspxRichEdit.FieldsWaitingForUpdate(this.control, subDocument, selection.intervals, new __aspxRichEdit.UpdateFieldsOptions(), function () {
                    var fieldEndPos = subDocument.fields[__aspxRichEdit.Field.normedBinaryIndexOf(subDocument.fields, startPosition + 1)].getFieldEndPosition();
                    history.addAndRedo(new __aspxRichEdit.SetSelectionHistoryItem(_this.control.modelManipulator, subDocument, [new __aspxRichEdit.FixedInterval(fieldEndPos, 0)], selection, __aspxRichEdit.UpdateInputPositionProperties.No, false));
                    history.endTransaction();
                })).update(null);
            }
            else
                history.endTransaction();
            return true;
        };
        CreatePredefinedFieldCommand.prototype.needUpdate = function () {
            return true;
        };
        CreatePredefinedFieldCommand.prototype.needNewParagraph = function () {
            return false;
        };
        CreatePredefinedFieldCommand.prototype.getPrefix = function () {
            return "";
        };
        return CreatePredefinedFieldCommand;
    }(CreateFieldCommandBase));
    __aspxRichEdit.CreatePredefinedFieldCommand = CreatePredefinedFieldCommand;
    var CreateFieldWithCodeCommand = (function (_super) {
        __extends(CreateFieldWithCodeCommand, _super);
        function CreateFieldWithCodeCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CreateFieldWithCodeCommand.prototype.getInsertedText = function (code) {
            return code;
        };
        return CreateFieldWithCodeCommand;
    }(CreatePredefinedFieldCommand));
    __aspxRichEdit.CreateFieldWithCodeCommand = CreateFieldWithCodeCommand;
    var CreatePageFieldCommand = (function (_super) {
        __extends(CreatePageFieldCommand, _super);
        function CreatePageFieldCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CreatePageFieldCommand.prototype.getInsertedText = function (_parameter) {
            return "PAGE";
        };
        return CreatePageFieldCommand;
    }(CreatePredefinedFieldCommand));
    __aspxRichEdit.CreatePageFieldCommand = CreatePageFieldCommand;
    var CreatePageCountFieldCommand = (function (_super) {
        __extends(CreatePageCountFieldCommand, _super);
        function CreatePageCountFieldCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CreatePageCountFieldCommand.prototype.getInsertedText = function (_parameter) {
            return "NUMPAGES";
        };
        return CreatePageCountFieldCommand;
    }(CreatePredefinedFieldCommand));
    __aspxRichEdit.CreatePageCountFieldCommand = CreatePageCountFieldCommand;
    var CreateDateFieldCommand = (function (_super) {
        __extends(CreateDateFieldCommand, _super);
        function CreateDateFieldCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CreateDateFieldCommand.prototype.getInsertedText = function (_parameter) {
            return "DATE \\@ \"M/d/yyyy\"";
        };
        return CreateDateFieldCommand;
    }(CreatePredefinedFieldCommand));
    __aspxRichEdit.CreateDateFieldCommand = CreateDateFieldCommand;
    var CreateTimeFieldCommand = (function (_super) {
        __extends(CreateTimeFieldCommand, _super);
        function CreateTimeFieldCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CreateTimeFieldCommand.prototype.getInsertedText = function (_parameter) {
            return "TIME \\@ \"h:mm am/pm\"";
        };
        return CreateTimeFieldCommand;
    }(CreatePredefinedFieldCommand));
    __aspxRichEdit.CreateTimeFieldCommand = CreateTimeFieldCommand;
    var CreateMergeFieldCommand = (function (_super) {
        __extends(CreateMergeFieldCommand, _super);
        function CreateMergeFieldCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CreateMergeFieldCommand.prototype.getInsertedText = function (parameter) {
            return parameter.indexOf(" ") !== -1 ? REWebUtils.Formatter.Format("MERGEFIELD \"{0}\"", parameter) : REWebUtils.Formatter.Format("MERGEFIELD {0}", parameter);
        };
        return CreateMergeFieldCommand;
    }(CreatePredefinedFieldCommand));
    __aspxRichEdit.CreateMergeFieldCommand = CreateMergeFieldCommand;
    var CreateEmptyMergeFieldCommand = (function (_super) {
        __extends(CreateEmptyMergeFieldCommand, _super);
        function CreateEmptyMergeFieldCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CreateEmptyMergeFieldCommand.prototype.getInsertedText = function (_parameter) {
            return "MERGEFIELD \"\"";
        };
        CreateEmptyMergeFieldCommand.prototype.needUpdate = function () {
            return false;
        };
        return CreateEmptyMergeFieldCommand;
    }(CreatePredefinedFieldCommand));
    __aspxRichEdit.CreateEmptyMergeFieldCommand = CreateEmptyMergeFieldCommand;
    var CreateEmptyDocVariableFieldCommand = (function (_super) {
        __extends(CreateEmptyDocVariableFieldCommand, _super);
        function CreateEmptyDocVariableFieldCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CreateEmptyDocVariableFieldCommand.prototype.getInsertedText = function (_parameter) {
            return "DOCVARIABLE \"\"";
        };
        CreateEmptyDocVariableFieldCommand.prototype.needUpdate = function () {
            return false;
        };
        return CreateEmptyDocVariableFieldCommand;
    }(CreatePredefinedFieldCommand));
    __aspxRichEdit.CreateEmptyDocVariableFieldCommand = CreateEmptyDocVariableFieldCommand;
    var CreateTableOfContentCommandBase = (function (_super) {
        __extends(CreateTableOfContentCommandBase, _super);
        function CreateTableOfContentCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CreateTableOfContentCommandBase.prototype.isEnabled = function () {
            var currentTocField = __aspxRichEdit.FieldCommandHelper.findTocFieldBySelection(this.control.model.activeSubDocument, this.control.selection);
            return _super.prototype.isEnabled.call(this) && currentTocField == null;
        };
        CreateTableOfContentCommandBase.prototype.getInsertedText = function (_parameter) {
            return "TOC \\h \\c \"Table\"";
        };
        CreateTableOfContentCommandBase.prototype.needNewParagraph = function () {
            return true;
        };
        return CreateTableOfContentCommandBase;
    }(CreatePredefinedFieldCommand));
    __aspxRichEdit.CreateTableOfContentCommandBase = CreateTableOfContentCommandBase;
    var CreateTocFieldCommand = (function (_super) {
        __extends(CreateTocFieldCommand, _super);
        function CreateTocFieldCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CreateTocFieldCommand.prototype.getInsertedText = function (_parameter) {
            return "TOC \\h \\u";
        };
        return CreateTocFieldCommand;
    }(CreateTableOfContentCommandBase));
    __aspxRichEdit.CreateTocFieldCommand = CreateTocFieldCommand;
    var CreateTableOfEquationsFieldCommand = (function (_super) {
        __extends(CreateTableOfEquationsFieldCommand, _super);
        function CreateTableOfEquationsFieldCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CreateTableOfEquationsFieldCommand.prototype.getInsertedText = function (_parameter) {
            return "TOC \\h \\c \"Equation\"";
        };
        return CreateTableOfEquationsFieldCommand;
    }(CreateTableOfContentCommandBase));
    __aspxRichEdit.CreateTableOfEquationsFieldCommand = CreateTableOfEquationsFieldCommand;
    var CreateTableOfFiguresFieldCommand = (function (_super) {
        __extends(CreateTableOfFiguresFieldCommand, _super);
        function CreateTableOfFiguresFieldCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CreateTableOfFiguresFieldCommand.prototype.getInsertedText = function (_parameter) {
            return "TOC \\h \\c \"Figure\"";
        };
        return CreateTableOfFiguresFieldCommand;
    }(CreateTableOfContentCommandBase));
    __aspxRichEdit.CreateTableOfFiguresFieldCommand = CreateTableOfFiguresFieldCommand;
    var CreateTableOfTablesFieldCommand = (function (_super) {
        __extends(CreateTableOfTablesFieldCommand, _super);
        function CreateTableOfTablesFieldCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CreateTableOfTablesFieldCommand.prototype.getInsertedText = function (_parameter) {
            return "TOC \\h \\c \"Table\"";
        };
        return CreateTableOfTablesFieldCommand;
    }(CreateTableOfContentCommandBase));
    __aspxRichEdit.CreateTableOfTablesFieldCommand = CreateTableOfTablesFieldCommand;
    var CreateEquationCaptionFieldCommand = (function (_super) {
        __extends(CreateEquationCaptionFieldCommand, _super);
        function CreateEquationCaptionFieldCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CreateEquationCaptionFieldCommand.prototype.getInsertedText = function (_parameter) {
            return "SEQ Equation \\* ARABIC";
        };
        CreateEquationCaptionFieldCommand.prototype.getPrefix = function () {
            return ASPxClientRichEdit.SeqCaptionPrefixes.EquationPrefix;
        };
        return CreateEquationCaptionFieldCommand;
    }(CreatePredefinedFieldCommand));
    __aspxRichEdit.CreateEquationCaptionFieldCommand = CreateEquationCaptionFieldCommand;
    var CreateFigureCaptionFieldCommand = (function (_super) {
        __extends(CreateFigureCaptionFieldCommand, _super);
        function CreateFigureCaptionFieldCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CreateFigureCaptionFieldCommand.prototype.getInsertedText = function (_parameter) {
            return "SEQ Figure \\* ARABIC";
        };
        CreateFigureCaptionFieldCommand.prototype.getPrefix = function () {
            return ASPxClientRichEdit.SeqCaptionPrefixes.FigurePrefix;
        };
        return CreateFigureCaptionFieldCommand;
    }(CreatePredefinedFieldCommand));
    __aspxRichEdit.CreateFigureCaptionFieldCommand = CreateFigureCaptionFieldCommand;
    var CreateTableCaptionFieldCommand = (function (_super) {
        __extends(CreateTableCaptionFieldCommand, _super);
        function CreateTableCaptionFieldCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CreateTableCaptionFieldCommand.prototype.getInsertedText = function (_parameter) {
            return "SEQ Table \\* ARABIC";
        };
        CreateTableCaptionFieldCommand.prototype.getPrefix = function () {
            return ASPxClientRichEdit.SeqCaptionPrefixes.TablePrefix;
        };
        return CreateTableCaptionFieldCommand;
    }(CreatePredefinedFieldCommand));
    __aspxRichEdit.CreateTableCaptionFieldCommand = CreateTableCaptionFieldCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FieldCommandHelper = (function () {
        function FieldCommandHelper() {
        }
        FieldCommandHelper.findTocFieldBySelection = function (subDocument, selection) {
            var fields = subDocument.fields;
            if (!fields.length)
                return null;
            var field;
            var isToc = false;
            var currentInterval = selection.intervals[0].clone();
            if (selection.isCollapsed()) {
                currentInterval.length++;
                var fieldIndex = __aspxRichEdit.Field.normedBinaryIndexOf(fields, currentInterval.start);
                if (fieldIndex < 0)
                    return null;
                field = fields[fieldIndex];
                do
                    isToc = this.isTocField(subDocument, field);
                while (!isToc && (field = field.parent));
            }
            else {
                var fieldIndex = Math.max(0, __aspxRichEdit.Field.normedBinaryIndexOf(fields, currentInterval.start));
                field = fields[fieldIndex].getAbsolutelyTopLevelField();
                for (fieldIndex = field.index; field = fields[fieldIndex]; fieldIndex++)
                    if (isToc = this.isTocField(subDocument, field) || field.getFieldStartPosition() >= currentInterval.end)
                        break;
            }
            if (!isToc || !__aspxRichEdit.IntervalAlgorithms.getIntersectionNonNullLength(field.getAllFieldInterval(), currentInterval))
                return null;
            return field;
        };
        FieldCommandHelper.isTocField = function (subDocument, field) {
            var iterator = new __aspxRichEdit.ModelIterator(subDocument, true);
            iterator.setPosition(field.getCodeStartPosition());
            var findFieldNameResult = __aspxRichEdit.FieldParserFabric.findName(iterator);
            return findFieldNameResult && findFieldNameResult.fieldNameToParser.name == __aspxRichEdit.FieldParserFabric.TOC_NAME;
        };
        return FieldCommandHelper;
    }());
    __aspxRichEdit.FieldCommandHelper = FieldCommandHelper;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GoToRecordCommandBase = (function (_super) {
        __extends(GoToRecordCommandBase, _super);
        function GoToRecordCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToRecordCommandBase.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        GoToRecordCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.fields) && this.control.mailMergeOptions.isEnabled &&
                this.control.mailMergeOptions.viewMergedData && this.canNavigate() && this.control.model.activeSubDocument.fieldsWaitingForUpdate == null;
        };
        GoToRecordCommandBase.prototype.canModify = function () {
            return true;
        };
        GoToRecordCommandBase.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return typeof (parameter) === 'number' ? parameter : this.control.mailMergeOptions.activeRecordIndex;
        };
        GoToRecordCommandBase.prototype.executeCore = function (_state, options) {
            var recordIndex = this.calculateNextRecordIndex(options.param);
            this.control.mailMergeOptions.activeRecordIndex = recordIndex;
            var opts = new __aspxRichEdit.CommandSimpleOptions(this.control, new __aspxRichEdit.UpdateAllFieldsCommandOptions());
            opts.param.updateOptions.updateToc = true;
            this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.UpdateAllFields).execute(this.control.commandManager.isPublicApiCall, opts);
            return true;
        };
        GoToRecordCommandBase.prototype.canNavigate = function () {
            return true;
        };
        GoToRecordCommandBase.prototype.calculateNextRecordIndex = function (recordIndex) {
            return Math.min(recordIndex, this.control.mailMergeOptions.recordCount - 1);
        };
        return GoToRecordCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.GoToRecordCommandBase = GoToRecordCommandBase;
    var GoToFirstDataRecordCommand = (function (_super) {
        __extends(GoToFirstDataRecordCommand, _super);
        function GoToFirstDataRecordCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToFirstDataRecordCommand.prototype.canNavigate = function () {
            return this.control.mailMergeOptions.activeRecordIndex > 0;
        };
        GoToFirstDataRecordCommand.prototype.calculateNextRecordIndex = function (_recordIndex) {
            return 0;
        };
        return GoToFirstDataRecordCommand;
    }(GoToRecordCommandBase));
    __aspxRichEdit.GoToFirstDataRecordCommand = GoToFirstDataRecordCommand;
    var GoToPreviousDataRecordCommand = (function (_super) {
        __extends(GoToPreviousDataRecordCommand, _super);
        function GoToPreviousDataRecordCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToPreviousDataRecordCommand.prototype.canNavigate = function () {
            return this.control.mailMergeOptions.activeRecordIndex > 0;
        };
        GoToPreviousDataRecordCommand.prototype.calculateNextRecordIndex = function (recordIndex) {
            return recordIndex - 1;
        };
        return GoToPreviousDataRecordCommand;
    }(GoToRecordCommandBase));
    __aspxRichEdit.GoToPreviousDataRecordCommand = GoToPreviousDataRecordCommand;
    var GoToNextDataRecordCommand = (function (_super) {
        __extends(GoToNextDataRecordCommand, _super);
        function GoToNextDataRecordCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToNextDataRecordCommand.prototype.canNavigate = function () {
            return this.control.mailMergeOptions.activeRecordIndex < this.control.mailMergeOptions.recordCount - 1;
        };
        GoToNextDataRecordCommand.prototype.calculateNextRecordIndex = function (recordIndex) {
            return recordIndex + 1;
        };
        return GoToNextDataRecordCommand;
    }(GoToRecordCommandBase));
    __aspxRichEdit.GoToNextDataRecordCommand = GoToNextDataRecordCommand;
    var GoToLastDataRecordCommand = (function (_super) {
        __extends(GoToLastDataRecordCommand, _super);
        function GoToLastDataRecordCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToLastDataRecordCommand.prototype.canNavigate = function () {
            return this.control.mailMergeOptions.activeRecordIndex < this.control.mailMergeOptions.recordCount - 1;
        };
        GoToLastDataRecordCommand.prototype.calculateNextRecordIndex = function (_recordIndex) {
            return this.control.mailMergeOptions.recordCount - 1;
        };
        return GoToLastDataRecordCommand;
    }(GoToRecordCommandBase));
    __aspxRichEdit.GoToLastDataRecordCommand = GoToLastDataRecordCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HyperlinkCommandBase = (function (_super) {
        __extends(HyperlinkCommandBase, _super);
        function HyperlinkCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        HyperlinkCommandBase.prototype.getState = function () {
            var subDocument = this.control.model.activeSubDocument;
            __aspxRichEdit.Field.DEBUG_FIELDS_CHECKS(subDocument);
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.value = __aspxRichEdit.FieldContextMenuHelper.showHyperlinkItems(subDocument.fields, this.control.selection.getLastSelectedInterval());
            state.visible = state.value !== null;
            return state;
        };
        HyperlinkCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.hyperlinks);
        };
        return HyperlinkCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.HyperlinkCommandBase = HyperlinkCommandBase;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var OpenHyperlinkCommand = (function (_super) {
        __extends(OpenHyperlinkCommand, _super);
        function OpenHyperlinkCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        OpenHyperlinkCommand.prototype.executeCore = function (state, options) {
            var field;
            if (options.param)
                field = options.param;
            else {
                if (!state.visible)
                    return false;
                field = state.value;
            }
            var hyperlinkInfo = field.getHyperlinkInfo();
            var fieldIsEditable = this.control.model.activeSubDocument.isEditable([field.getAllFieldInterval()]);
            if (!hyperlinkInfo.visited && this.control.readOnly != __aspxRichEdit.ReadOnlyMode.Persistent && fieldIsEditable) {
                var newHyperlinkInfo = hyperlinkInfo.clone();
                newHyperlinkInfo.visited = true;
                var resultInterval = field.getResultInterval();
                this.control.history.beginTransaction();
                this.control.history.addAndRedo(new __aspxRichEdit.ChangeFieldHyperlinkInfoHistoryItem(this.control.modelManipulator, this.control.model.activeSubDocument, field.index, newHyperlinkInfo));
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeFontForeColor).execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, __aspxRichEdit.ColorModelInfo.makeByColor(__aspxRichEdit.ColorHelper.hashToColor("#483D8B")))
                    .setChangeSelection(false)
                    .setSubDocument(options.subDocument)
                    .setIntervals([resultInterval]));
                this.control.history.endTransaction();
                this.control.serverDispatcher.forceSendingRequest();
            }
            if (hyperlinkInfo.anchor)
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.GoToBookmark)
                    .execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, hyperlinkInfo.anchor));
            else if (!(REWebUtils.IsUrlContainsClientScript(hyperlinkInfo.uri) || /^\s*data\s*\:\s*/gi.test(hyperlinkInfo.uri)))
                REWebUtils.Url.Navigate(hyperlinkInfo.uri, "_blank");
            return true;
        };
        OpenHyperlinkCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return OpenHyperlinkCommand;
    }(__aspxRichEdit.HyperlinkCommandBase));
    __aspxRichEdit.OpenHyperlinkCommand = OpenHyperlinkCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RemoveHyperlinkCommand = (function (_super) {
        __extends(RemoveHyperlinkCommand, _super);
        function RemoveHyperlinkCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RemoveHyperlinkCommand.prototype.executeCore = function (state, _options) {
            var history = this.control.history;
            var modelManipulator = this.control.modelManipulator;
            var field = state.value;
            history.beginTransaction();
            history.addAndRedo(new __aspxRichEdit.RemoveHyperlinkHistoryItem(modelManipulator, field, this.control));
            history.endTransaction();
            return true;
        };
        return RemoveHyperlinkCommand;
    }(__aspxRichEdit.HyperlinkCommandBase));
    __aspxRichEdit.RemoveHyperlinkCommand = RemoveHyperlinkCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RemoveHyperlinksCommand = (function (_super) {
        __extends(RemoveHyperlinksCommand, _super);
        function RemoveHyperlinksCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RemoveHyperlinksCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        RemoveHyperlinksCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.hyperlinks);
        };
        RemoveHyperlinksCommand.prototype.executeCore = function (_state, options) {
            var subDocument = options.subDocument;
            var fields = subDocument.fields;
            if (fields.length < 1)
                return false;
            var history = this.control.history;
            var interval = options.intervals[0];
            var fieldIndex = Math.max(0, __aspxRichEdit.Field.normedBinaryIndexOf(fields, interval.start));
            var field = fields[fieldIndex].getAbsolutelyTopLevelField();
            var linkedInterval = interval.getLinkedInterval(subDocument.positionManager);
            history.beginTransaction();
            for (fieldIndex = field.index; (field = fields[fieldIndex]) && field.getFieldStartPosition() < linkedInterval.end;) {
                if (__aspxRichEdit.IntervalAlgorithms.getIntersection(__aspxRichEdit.FixedInterval.fromPositions(field.getCodeStartPosition(), field.getResultEndPosition()), interval))
                    history.addAndRedo(new __aspxRichEdit.RemoveHyperlinkHistoryItem(this.control.modelManipulator, field, this.control));
                else
                    fieldIndex++;
            }
            this.control.selection.correctAfterTextBufferChanged(this.control);
            history.endTransaction();
            linkedInterval.destructor(subDocument.positionManager);
            return true;
        };
        RemoveHyperlinksCommand.prototype.DEPRECATEDCorrectlMainCommandOptions = function (options) {
            options.intervals = [this.control.selection.getLastSelectedInterval()];
        };
        return RemoveHyperlinksCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.RemoveHyperlinksCommand = RemoveHyperlinksCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ShowAllFieldCodesCommand = (function (_super) {
        __extends(ShowAllFieldCodesCommand, _super);
        function ShowAllFieldCodesCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ShowAllFieldCodesCommand.prototype.getState = function () {
            return new __aspxRichEdit.IntervalCommandState(this.isEnabled(), this.control.selection.getLastSelectedInterval());
        };
        ShowAllFieldCodesCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.fields);
        };
        ShowAllFieldCodesCommand.prototype.executeCore = function (_state, options) {
            var subDocumentsList = [options.subDocument];
            var atLeastOneSubDocRecalculated = false;
            for (var subDocumentIndex = 0, currSubDoc; currSubDoc = subDocumentsList[subDocumentIndex]; subDocumentIndex++) {
                var fields = currSubDoc.fields;
                var fieldIndexStartRecalculateLayout = null;
                for (var fieldIndex = 0, field; field = fields[fieldIndex]; fieldIndex++) {
                    if (field.showCode == this.baseValue()) {
                        if (fieldIndexStartRecalculateLayout === null)
                            fieldIndexStartRecalculateLayout = fieldIndex;
                        field.showCode = !this.baseValue();
                    }
                }
                if (fieldIndexStartRecalculateLayout !== null) {
                    atLeastOneSubDocRecalculated = true;
                    this.control.layoutFormatterManager.invalidator.onIntervalChanged(currSubDoc, __aspxRichEdit.FixedInterval.fromPositions(fields[fieldIndexStartRecalculateLayout].getFieldStartPosition(), fields[fields.length - 1].getFieldEndPosition()));
                }
            }
            return atLeastOneSubDocRecalculated;
        };
        ShowAllFieldCodesCommand.prototype.baseValue = function () {
            return false;
        };
        ShowAllFieldCodesCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return ShowAllFieldCodesCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ShowAllFieldCodesCommand = ShowAllFieldCodesCommand;
    var ShowAllFieldResultCommand = (function (_super) {
        __extends(ShowAllFieldResultCommand, _super);
        function ShowAllFieldResultCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ShowAllFieldResultCommand.prototype.baseValue = function () {
            return true;
        };
        return ShowAllFieldResultCommand;
    }(ShowAllFieldCodesCommand));
    __aspxRichEdit.ShowAllFieldResultCommand = ShowAllFieldResultCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ToggleAllFieldsCommand = (function (_super) {
        __extends(ToggleAllFieldsCommand, _super);
        function ToggleAllFieldsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleAllFieldsCommand.prototype.getState = function () {
            return new __aspxRichEdit.IntervalCommandState(this.isEnabled(), this.control.selection.getLastSelectedInterval());
        };
        ToggleAllFieldsCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.fields);
        };
        ToggleAllFieldsCommand.prototype.executeCore = function (_state, options) {
            var subDocument = options.subDocument;
            __aspxRichEdit.Field.DEBUG_FIELDS_CHECKS(subDocument);
            var subDocumentsList = [subDocument];
            var atLeastExistOneField = false;
            for (var subDocumentIndex = 0, currSubDoc; currSubDoc = subDocumentsList[subDocumentIndex]; subDocumentIndex++) {
                var fields = currSubDoc.fields;
                if (fields.length > 0)
                    atLeastExistOneField = true;
                for (var fieldIndex = 0, field; field = fields[fieldIndex]; fieldIndex++)
                    if (field.showCode) {
                        this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowAllFieldResults)
                            .execute(this.control.commandManager.isPublicApiCall, options);
                        return true;
                    }
            }
            if (atLeastExistOneField) {
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowAllFieldCodes)
                    .execute(this.control.commandManager.isPublicApiCall, options);
                return true;
            }
            return false;
        };
        ToggleAllFieldsCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return ToggleAllFieldsCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ToggleAllFieldsCommand = ToggleAllFieldsCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ToggleFieldCodesCommand = (function (_super) {
        __extends(ToggleFieldCodesCommand, _super);
        function ToggleFieldCodesCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleFieldCodesCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.visible = __aspxRichEdit.FieldContextMenuHelper.showUpdateAndToogleCodeItems(this.control.model.activeSubDocument.fields, this.control.selection.intervals);
            return state;
        };
        ToggleFieldCodesCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.fields);
        };
        ToggleFieldCodesCommand.prototype.executeCore = function (_state, options) {
            var parameter = options.param;
            var selection = this.control.selection;
            var subDocument = options.subDocument;
            var fields = subDocument.fields;
            var intervals = options.intervals;
            var toggleMode = typeof options.param !== 'boolean';
            var commandExecuted = false;
            for (var intervalIndex = 0, interval; interval = intervals[intervalIndex]; intervalIndex++) {
                if (interval.length == 0) {
                    var fieldVisabilityInfo = __aspxRichEdit.FieldVisabilityInfo.getRelativeVisabilityInfo(interval.start, fields);
                    for (var infoIndex = fieldVisabilityInfo.length - 1, info; info = fieldVisabilityInfo[infoIndex]; infoIndex--) {
                        var field = info.field;
                        var newSelectionStartPos = -1;
                        if (info.showResult && (parameter === true || toggleMode)) {
                            field.showCode = true;
                            newSelectionStartPos = field.getCodeStartPosition();
                        }
                        else if (info.showCode && (parameter === false || toggleMode)) {
                            field.showCode = false;
                            newSelectionStartPos = field.getFieldStartPosition();
                        }
                        if (newSelectionStartPos >= 0) {
                            this.control.layoutFormatterManager.invalidator.onIntervalChanged(subDocument, field.getAllFieldInterval());
                            if (subDocument == this.control.model.activeSubDocument)
                                selection.deprecatedSetSelection(newSelectionStartPos, newSelectionStartPos, selection.endOfLine, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
                            commandExecuted = true;
                            break;
                        }
                    }
                    if (fieldVisabilityInfo.length == 0) {
                        var fieldIndex = __aspxRichEdit.Field.normedBinaryIndexOf(fields, interval.start + 1);
                        if (fieldIndex >= 0) {
                            var field = fields[fieldIndex];
                            if (!field.parent && field.getFieldStartPosition() == interval.start && (toggleMode || field.showCode !== parameter)) {
                                field.showCode = !field.showCode;
                                this.control.layoutFormatterManager.invalidator.onIntervalChanged(subDocument, field.getAllFieldInterval());
                                if (subDocument == this.control.model.activeSubDocument)
                                    selection.deprecatedSetSelection(field.getFieldStartPosition(), field.getFieldStartPosition(), selection.endOfLine, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
                                commandExecuted = true;
                            }
                        }
                    }
                }
                else {
                    var intervalEnd = interval.end;
                    var fieldIndex = Math.max(0, __aspxRichEdit.Field.normedBinaryIndexOf(fields, interval.start + 1));
                    var field = fields[fieldIndex];
                    while (field.parent) {
                        if (interval.start < field.getFieldStartPosition() || field.getFieldEndPosition() <= interval.start)
                            field = field.parent;
                        else
                            break;
                    }
                    fieldIndex = field.index;
                    var needSetState = toggleMode ? !field.showCode : parameter;
                    if (field.showCode !== needSetState) {
                        field.showCode = needSetState;
                        this.control.layoutFormatterManager.invalidator.onIntervalChanged(subDocument, field.getAllFieldInterval());
                        commandExecuted = true;
                        if (field.getFieldStartPosition() != interval.start && field.getAllFieldInterval().containsWithIntervalEnd(interval.start)) {
                            var newSelectionPos = needSetState ? field.getCodeStartPosition() : field.getFieldStartPosition();
                            if (subDocument == this.control.model.activeSubDocument)
                                selection.deprecatedSetSelection(newSelectionPos, newSelectionPos, selection.endOfLine, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
                        }
                    }
                    for (fieldIndex++; field = fields[fieldIndex]; fieldIndex++) {
                        if (field.getFieldStartPosition() >= intervalEnd)
                            break;
                        if (field.getFieldEndPosition() <= interval.start)
                            continue;
                        if (field.showCode !== needSetState) {
                            field.showCode = needSetState;
                            this.control.layoutFormatterManager.invalidator.onIntervalChanged(subDocument, field.getAllFieldInterval());
                            commandExecuted = true;
                        }
                    }
                }
            }
            return commandExecuted;
        };
        ToggleFieldCodesCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return ToggleFieldCodesCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ToggleFieldCodesCommand = ToggleFieldCodesCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ToggleViewMergedDataCommand = (function (_super) {
        __extends(ToggleViewMergedDataCommand, _super);
        function ToggleViewMergedDataCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleViewMergedDataCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.value = this.control.mailMergeOptions.viewMergedData;
            return state;
        };
        ToggleViewMergedDataCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.fields) && this.control.mailMergeOptions.isEnabled;
        };
        ToggleViewMergedDataCommand.prototype.canModify = function () {
            return true;
        };
        ToggleViewMergedDataCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            var mailMergeOptions = this.control.mailMergeOptions;
            return typeof parameter === 'boolean' ? parameter : !mailMergeOptions.viewMergedData;
        };
        ToggleViewMergedDataCommand.prototype.executeCore = function (_state, options) {
            var mailMergeOptions = this.control.mailMergeOptions;
            var viewMergedData = options.param;
            if (mailMergeOptions.viewMergedData !== viewMergedData) {
                mailMergeOptions.viewMergedData = viewMergedData;
                var opts = new __aspxRichEdit.CommandSimpleOptions(this.control, new __aspxRichEdit.UpdateAllFieldsCommandOptions());
                opts.param.updateOptions.updateToc = true;
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.UpdateAllFields).execute(this.control.commandManager.isPublicApiCall, opts);
                return true;
            }
            return false;
        };
        return ToggleViewMergedDataCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ToggleViewMergedDataCommand = ToggleViewMergedDataCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var UpdateFieldsOptions = (function () {
        function UpdateFieldsOptions(updateToc) {
            if (updateToc === void 0) { updateToc = true; }
            this.updateToc = updateToc;
        }
        return UpdateFieldsOptions;
    }());
    __aspxRichEdit.UpdateFieldsOptions = UpdateFieldsOptions;
    var UpdateAllFieldsCommandOptions = (function () {
        function UpdateAllFieldsCommandOptions() {
            this.callback = function () { };
            this.updateOptions = new UpdateFieldsOptions();
        }
        return UpdateAllFieldsCommandOptions;
    }());
    __aspxRichEdit.UpdateAllFieldsCommandOptions = UpdateAllFieldsCommandOptions;
    var UpdateAllFieldsCommand = (function (_super) {
        __extends(UpdateAllFieldsCommand, _super);
        function UpdateAllFieldsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        UpdateAllFieldsCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        UpdateAllFieldsCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.fields);
        };
        UpdateAllFieldsCommand.prototype.canModify = function () {
            return true;
        };
        UpdateAllFieldsCommand.prototype.executeCore = function (_state, options) {
            if (!options.param)
                options.param = new UpdateAllFieldsCommandOptions();
            var modelManipulator = this.control.modelManipulator;
            var model = modelManipulator.model;
            var history = this.control.history;
            var subDocuments = __aspxRichEdit.MapUtilsKeyAsNumber.toList(model.subDocuments);
            this.needUpdateSubDocuments = __aspxRichEdit.ListUtils.countIf(subDocuments, function (subDoc) { return subDoc.fields.length > 0; });
            if (this.needUpdateSubDocuments == 0) {
                if (options.param.callback)
                    (options.param.callback)();
                return false;
            }
            this.selectionStateInfo = this.control.selection.getSelectionState();
            history.beginTransaction();
            this.control.history.addAndRedo(new __aspxRichEdit.SetSelectionHistoryItem(this.control.modelManipulator, model.activeSubDocument, this.control.selection.intervals, this.control.selection, __aspxRichEdit.UpdateInputPositionProperties.No, false));
            var needEndUpdate = false;
            for (var _i = 0, subDocuments_1 = subDocuments; _i < subDocuments_1.length; _i++) {
                var subDocument = subDocuments_1[_i];
                this.updateSubDoc(subDocument, needEndUpdate, options.param);
                needEndUpdate = true;
            }
            return true;
        };
        UpdateAllFieldsCommand.prototype.updateSubDoc = function (subDocument, needEndUpdate, options) {
            var _this = this;
            if (!subDocument.fields.length)
                return;
            __aspxRichEdit.Field.DEBUG_FIELDS_CHECKS(subDocument);
            if (needEndUpdate) {
                this.control.endUpdate();
                this.control.endLoading();
            }
            this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.UpdateField)
                .execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.UpdateFieldCommandParameters(subDocument, [new __aspxRichEdit.FixedInterval(0, subDocument.getDocumentEndPosition())], function () {
                if (!--_this.needUpdateSubDocuments) {
                    _this.control.selection.restoreSelectionState(_this.selectionStateInfo, __aspxRichEdit.UpdateInputPositionProperties.Yes);
                    _this.control.history.addAndRedo(new __aspxRichEdit.SetSelectionHistoryItem(_this.control.modelManipulator, _this.control.model.activeSubDocument, _this.control.selection.intervals, _this.control.selection, __aspxRichEdit.UpdateInputPositionProperties.No, false));
                    _this.control.history.endTransaction();
                    if (options.callback)
                        (options.callback)();
                }
            }, options.updateOptions));
        };
        return UpdateAllFieldsCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.UpdateAllFieldsCommand = UpdateAllFieldsCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var UpdateFieldCommandParameters = (function () {
        function UpdateFieldCommandParameters(subDocument, intervals, callbackFunc, updateOptions) {
            if (updateOptions === void 0) { updateOptions = new __aspxRichEdit.UpdateFieldsOptions(); }
            this.subDocument = subDocument;
            this.intervals = intervals;
            this.callbackFunc = callbackFunc;
            this.updateOptions = updateOptions;
        }
        return UpdateFieldCommandParameters;
    }());
    __aspxRichEdit.UpdateFieldCommandParameters = UpdateFieldCommandParameters;
    var UpdateFieldCommand = (function (_super) {
        __extends(UpdateFieldCommand, _super);
        function UpdateFieldCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        UpdateFieldCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.visible = __aspxRichEdit.FieldContextMenuHelper.showUpdateAndToogleCodeItems(this.control.model.activeSubDocument.fields, this.control.selection.intervals);
            return state;
        };
        UpdateFieldCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.fields);
        };
        UpdateFieldCommand.prototype.canModify = function () {
            return true;
        };
        UpdateFieldCommand.prototype.executeCore = function (_state, options) {
            var _this = this;
            var param = options.param;
            if (!param) {
                var intervalsForUpdate = this.control.selection.intervals;
                var callback = null;
                var tocField_1 = __aspxRichEdit.FieldCommandHelper.findTocFieldBySelection(this.control.model.activeSubDocument, this.control.selection);
                if (tocField_1) {
                    intervalsForUpdate = __aspxRichEdit.IntervalAlgorithms.getMergedIntervals(intervalsForUpdate.concat(tocField_1.getAllFieldInterval()), true);
                    callback = function () {
                        _this.control.history.addAndRedo(new __aspxRichEdit.SetSelectionHistoryItem(_this.control.modelManipulator, subDocument, [new __aspxRichEdit.FixedInterval(tocField_1.getFieldStartPosition(), 0)], _this.control.selection, __aspxRichEdit.UpdateInputPositionProperties.No, false));
                    };
                }
                param = new UpdateFieldCommandParameters(this.control.model.activeSubDocument, intervalsForUpdate, callback);
            }
            var subDocument = param.subDocument;
            if (subDocument.fieldsWaitingForUpdate)
                return false;
            __aspxRichEdit.Field.DEBUG_FIELDS_CHECKS(subDocument);
            this.control.history.beginTransaction();
            (new __aspxRichEdit.FieldsWaitingForUpdate(this.control, subDocument, param.intervals, param.updateOptions, function () {
                _this.control.history.endTransaction();
                if (param.callbackFunc)
                    param.callbackFunc();
            })).update(null);
            return true;
        };
        return UpdateFieldCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.UpdateFieldCommand = UpdateFieldCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var UpdateTableOfContentsCommand = (function (_super) {
        __extends(UpdateTableOfContentsCommand, _super);
        function UpdateTableOfContentsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        UpdateTableOfContentsCommand.prototype.getState = function () {
            return new __aspxRichEdit.IntervalCommandState(this.isEnabled(), this.control.selection.getLastSelectedInterval());
        };
        UpdateTableOfContentsCommand.prototype.isEnabled = function () {
            var tocField = __aspxRichEdit.FieldCommandHelper.findTocFieldBySelection(this.control.model.activeSubDocument, this.control.selection);
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.fields) && tocField != null;
        };
        UpdateTableOfContentsCommand.prototype.executeCore = function (_state, _options) {
            var _this = this;
            var subDocument = this.control.model.activeSubDocument;
            var tocField = __aspxRichEdit.FieldCommandHelper.findTocFieldBySelection(subDocument, this.control.selection);
            if (!tocField)
                return false;
            this.control.history.beginTransaction();
            var updateParams = new __aspxRichEdit.UpdateFieldCommandParameters(subDocument, [tocField.getAllFieldInterval()], function () {
                _this.control.history.addAndRedo(new __aspxRichEdit.SetSelectionHistoryItem(_this.control.modelManipulator, subDocument, [new __aspxRichEdit.FixedInterval(tocField.getFieldStartPosition(), 0)], _this.control.selection, __aspxRichEdit.UpdateInputPositionProperties.No, false));
            });
            var result = this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.UpdateField).execute(this.control.commandManager.isPublicApiCall, updateParams);
            this.control.history.endTransaction();
            return result;
        };
        return UpdateTableOfContentsCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.UpdateTableOfContentsCommand = UpdateTableOfContentsCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FindAllCommandOptions = (function (_super) {
        __extends(FindAllCommandOptions, _super);
        function FindAllCommandOptions(control, text, matchCase, highlightResults, results) {
            var _this = _super.call(this, control) || this;
            _this.text = text;
            _this.matchCase = matchCase;
            _this.highlightResults = highlightResults;
            _this.results = results;
            return _this;
        }
        return FindAllCommandOptions;
    }(__aspxRichEdit.CommandOptions));
    __aspxRichEdit.FindAllCommandOptions = FindAllCommandOptions;
    var FindAllCommand = (function (_super) {
        __extends(FindAllCommand, _super);
        function FindAllCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FindAllCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        FindAllCommand.prototype.executeCore = function (_state, options) {
            var searchSettings = options;
            var foundIntervals = [];
            var findReplaceHelper = new __aspxRichEdit.FindReplaceHelper(this.control, options.subDocument, this.control.layout);
            findReplaceHelper.setSearchParams(searchSettings.text, null, __aspxRichEdit.SearchDirection.All, searchSettings.matchCase, false, 0, false);
            while (findReplaceHelper.findNext() !== __aspxRichEdit.FindReplaceState.SearchEnd) {
                var lastFound = findReplaceHelper.getLastFound();
                foundIntervals.push(lastFound);
            }
            if (searchSettings.highlightResults)
                this.control.selection.setSearchSelectionIntervals(foundIntervals);
            if (searchSettings.results) {
                searchSettings.results.splice(0, searchSettings.results.length);
                foundIntervals.forEach(function (interval) {
                    searchSettings.results.push(interval);
                });
            }
            return true;
        };
        FindAllCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return FindAllCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.FindAllCommand = FindAllCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HideFindResultsCommand = (function (_super) {
        __extends(HideFindResultsCommand, _super);
        function HideFindResultsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        HideFindResultsCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        HideFindResultsCommand.prototype.executeCore = function (_state, _parameter) {
            if (this.control.selection.searchIntervals.length)
                this.control.selection.resetSearchSelection();
            return true;
        };
        HideFindResultsCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return HideFindResultsCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.HideFindResultsCommand = HideFindResultsCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ReplaceAllCommandOptions = (function (_super) {
        __extends(ReplaceAllCommandOptions, _super);
        function ReplaceAllCommandOptions(control, text, replaceText, matchCase) {
            var _this = _super.call(this, control) || this;
            _this.text = text;
            _this.replaceText = replaceText;
            _this.matchCase = matchCase;
            return _this;
        }
        return ReplaceAllCommandOptions;
    }(__aspxRichEdit.CommandOptions));
    __aspxRichEdit.ReplaceAllCommandOptions = ReplaceAllCommandOptions;
    var ReplaceAllCommand = (function (_super) {
        __extends(ReplaceAllCommand, _super);
        function ReplaceAllCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ReplaceAllCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        ReplaceAllCommand.prototype.executeCore = function (_state, options) {
            var searchSettings = options;
            var findReplaceHelper = new __aspxRichEdit.FindReplaceHelper(this.control, options.subDocument, this.control.layout);
            findReplaceHelper.setSearchParams(searchSettings.text, searchSettings.replaceText, __aspxRichEdit.SearchDirection.All, searchSettings.matchCase, false, 0, false);
            findReplaceHelper.replaceAll();
            return true;
        };
        return ReplaceAllCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ReplaceAllCommand = ReplaceAllCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ReplaceNextCommandOptions = (function (_super) {
        __extends(ReplaceNextCommandOptions, _super);
        function ReplaceNextCommandOptions() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        return ReplaceNextCommandOptions;
    }(__aspxRichEdit.ReplaceAllCommandOptions));
    __aspxRichEdit.ReplaceNextCommandOptions = ReplaceNextCommandOptions;
    var ReplaceNextCommand = (function (_super) {
        __extends(ReplaceNextCommand, _super);
        function ReplaceNextCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ReplaceNextCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        ReplaceNextCommand.prototype.executeCore = function (_state, options) {
            var searchSettings = options;
            var findReplaceHelper = new __aspxRichEdit.FindReplaceHelper(this.control, options.subDocument, this.control.layout);
            findReplaceHelper.setSearchParams(searchSettings.text, searchSettings.replaceText, __aspxRichEdit.SearchDirection.All, searchSettings.matchCase, false, this.control.selection.intervals[0].start, false);
            if (findReplaceHelper.findNext() === __aspxRichEdit.FindReplaceState.Found) {
                findReplaceHelper.replaceLastFound();
                return true;
            }
            return false;
        };
        return ReplaceNextCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ReplaceNextCommand = ReplaceNextCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeAnchoredPictureSizeCommand = (function (_super) {
        __extends(ChangeAnchoredPictureSizeCommand, _super);
        function ChangeAnchoredPictureSizeCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeAnchoredPictureSizeCommand.prototype.getState = function () {
            var isEnabled = this.isEnabled();
            var value;
            if (isEnabled) {
                var run = this.control.model.activeSubDocument.getRunByPosition(this.control.selection.specialRunInfo.getPicturePosition());
                value = run.size;
            }
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled(), value);
        };
        ChangeAnchoredPictureSizeCommand.prototype.canModify = function () {
            return true;
        };
        ChangeAnchoredPictureSizeCommand.prototype.isEnabled = function () {
            var specialRunInfo = this.control.selection.specialRunInfo;
            return _super.prototype.isEnabled.call(this) && specialRunInfo.isPictureSelected() && specialRunInfo.isSelectedAnchorObject &&
                this.getFloatingObjectParentSubDocument().isEditable([new __aspxRichEdit.FixedInterval(specialRunInfo.getPicturePosition(), 1)]);
        };
        ChangeAnchoredPictureSizeCommand.prototype.DEPRECATEDCorrectlMainCommandOptions = function (options) {
            options.intervals = [new __aspxRichEdit.FixedInterval(this.control.selection.getLastSelectedInterval().start, 1)];
        };
        ChangeAnchoredPictureSizeCommand.prototype.executeCore = function (_state, options) {
            this.control.history.addAndRedo(new __aspxRichEdit.ChangeAnchoredPictureSizeHistoryItem(this.control.modelManipulator, options.subDocument, options.intervals[0], options.param));
            return true;
        };
        ChangeAnchoredPictureSizeCommand.prototype.lockInputPositionUpdating = function (_prevModifiedState) {
            return true;
        };
        ChangeAnchoredPictureSizeCommand.prototype.lockUIUpdating = function (prevModifiedState) {
            return prevModifiedState === this.control.getModifiedState();
        };
        return ChangeAnchoredPictureSizeCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ChangeAnchoredPictureSizeCommand = ChangeAnchoredPictureSizeCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeFloatingObjectShapeCommand = (function (_super) {
        __extends(ChangeFloatingObjectShapeCommand, _super);
        function ChangeFloatingObjectShapeCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeFloatingObjectShapeCommand.prototype.getState = function () {
            var isEnabled = this.isEnabled();
            var value;
            if (isEnabled) {
                value = this.getValue();
            }
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled(), value);
        };
        ChangeFloatingObjectShapeCommand.prototype.canModify = function () {
            return true;
        };
        ChangeFloatingObjectShapeCommand.prototype.isEnabled = function () {
            var specialRunInfo = this.control.selection.specialRunInfo;
            return _super.prototype.isEnabled.call(this) && specialRunInfo.isSelected() && specialRunInfo.isSelectedAnchorObject &&
                this.getFloatingObjectParentSubDocument().isEditable([new __aspxRichEdit.FixedInterval(specialRunInfo.getPosition(), 1)]);
        };
        ChangeFloatingObjectShapeCommand.prototype.executeCore = function (_state, options) {
            var modelManipulator = this.control.modelManipulator;
            var specialRunInfo = this.control.selection.specialRunInfo;
            this.control.history.addAndRedo(new __aspxRichEdit.ShapeHistoryItem(modelManipulator, specialRunInfo.getParentSubDocument(), new __aspxRichEdit.FixedInterval(specialRunInfo.getPosition(), 1), options.param));
            return true;
        };
        ChangeFloatingObjectShapeCommand.prototype.getValue = function () {
            var specialRunInfo = this.control.selection.specialRunInfo;
            var run = specialRunInfo.getParentSubDocument().getRunByPosition(specialRunInfo.getPosition());
            var anchoredRun = run;
            return anchoredRun.shape.clone();
        };
        return ChangeFloatingObjectShapeCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ChangeFloatingObjectShapeCommand = ChangeFloatingObjectShapeCommand;
    var ChangeShapePropertyCommandBase = (function (_super) {
        __extends(ChangeShapePropertyCommandBase, _super);
        function ChangeShapePropertyCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeShapePropertyCommandBase.prototype.getState = function () {
            var isEnabled = this.isEnabled();
            var value;
            if (isEnabled) {
                var specialRunInfo = this.control.selection.specialRunInfo;
                var run = specialRunInfo.getParentSubDocument().getRunByPosition(specialRunInfo.getPosition());
                var anchoredRun = run;
                value = this.getValue(anchoredRun.shape);
            }
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled(), value);
        };
        ChangeShapePropertyCommandBase.prototype.isEnabled = function () {
            var specialRunInfo = this.control.selection.specialRunInfo;
            return _super.prototype.isEnabled.call(this) && specialRunInfo.isSelected() && specialRunInfo.isSelectedAnchorObject;
        };
        return ChangeShapePropertyCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ChangeShapePropertyCommandBase = ChangeShapePropertyCommandBase;
    var ChangeShapeFillColorCommand = (function (_super) {
        __extends(ChangeShapeFillColorCommand, _super);
        function ChangeShapeFillColorCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeShapeFillColorCommand.prototype.getState = function () {
            var state = _super.prototype.getState.call(this);
            state.denyUpdateValue = true;
            return state;
        };
        ChangeShapeFillColorCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return __aspxRichEdit.ColorHelper.anyToColor(parameter, __aspxRichEdit.ColorHelper.NO_COLOR);
        };
        ChangeShapeFillColorCommand.prototype.executeCore = function (_state, options) {
            var modelManipulator = this.control.modelManipulator;
            var specialRunInfo = this.control.selection.specialRunInfo;
            this.control.history.addAndRedo(new __aspxRichEdit.ShapePropertyHistoryItem(modelManipulator, specialRunInfo.getParentSubDocument(), new __aspxRichEdit.FixedInterval(specialRunInfo.getPosition(), 1), options.param, modelManipulator.floatingObjectsManipulator.shape.fillColor));
            return true;
        };
        ChangeShapeFillColorCommand.prototype.getValue = function (shape) {
            return shape.fillColor;
        };
        return ChangeShapeFillColorCommand;
    }(ChangeShapePropertyCommandBase));
    __aspxRichEdit.ChangeShapeFillColorCommand = ChangeShapeFillColorCommand;
    var ChangeShapeOutlineColorCommand = (function (_super) {
        __extends(ChangeShapeOutlineColorCommand, _super);
        function ChangeShapeOutlineColorCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeShapeOutlineColorCommand.prototype.getState = function () {
            var state = _super.prototype.getState.call(this);
            state.denyUpdateValue = true;
            return state;
        };
        ChangeShapeOutlineColorCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return __aspxRichEdit.ColorHelper.anyToColor(parameter, __aspxRichEdit.ColorHelper.NO_COLOR);
        };
        ChangeShapeOutlineColorCommand.prototype.executeCore = function (_state, options) {
            var modelManipulator = this.control.modelManipulator;
            var specialRunInfo = this.control.selection.specialRunInfo;
            this.control.history.addAndRedo(new __aspxRichEdit.ShapePropertyHistoryItem(modelManipulator, specialRunInfo.getParentSubDocument(), new __aspxRichEdit.FixedInterval(specialRunInfo.getPosition(), 1), options.param, modelManipulator.floatingObjectsManipulator.shape.outlineColor));
            return true;
        };
        ChangeShapeOutlineColorCommand.prototype.getValue = function (shape) {
            return shape.outlineColor;
        };
        return ChangeShapeOutlineColorCommand;
    }(ChangeShapePropertyCommandBase));
    __aspxRichEdit.ChangeShapeOutlineColorCommand = ChangeShapeOutlineColorCommand;
    var ChangeShapeOutlineWidthCommand = (function (_super) {
        __extends(ChangeShapeOutlineWidthCommand, _super);
        function ChangeShapeOutlineWidthCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeShapeOutlineWidthCommand.prototype.executeCore = function (_state, options) {
            var modelManipulator = this.control.modelManipulator;
            var specialRunInfo = this.control.selection.specialRunInfo;
            this.control.history.addAndRedo(new __aspxRichEdit.ShapePropertyHistoryItem(modelManipulator, specialRunInfo.getParentSubDocument(), new __aspxRichEdit.FixedInterval(specialRunInfo.getPosition(), 1), options.param, modelManipulator.floatingObjectsManipulator.shape.outlineWidth));
            return true;
        };
        ChangeShapeOutlineWidthCommand.prototype.getValue = function (shape) {
            return shape.outlineWidth;
        };
        return ChangeShapeOutlineWidthCommand;
    }(ChangeShapePropertyCommandBase));
    __aspxRichEdit.ChangeShapeOutlineWidthCommand = ChangeShapeOutlineWidthCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeTextBoxPropertiesCommand = (function (_super) {
        __extends(ChangeTextBoxPropertiesCommand, _super);
        function ChangeTextBoxPropertiesCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeTextBoxPropertiesCommand.prototype.getState = function () {
            var isEnabled = this.isEnabled();
            var value;
            if (isEnabled)
                value = this.getValue();
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled(), value);
        };
        ChangeTextBoxPropertiesCommand.prototype.canModify = function () {
            return true;
        };
        ChangeTextBoxPropertiesCommand.prototype.isEnabled = function () {
            var specialRunInfo = this.control.selection.specialRunInfo;
            return _super.prototype.isEnabled.call(this) && specialRunInfo.isTextBoxSelected() &&
                this.getFloatingObjectParentSubDocument().isEditable([new __aspxRichEdit.FixedInterval(specialRunInfo.getPosition(), 1)]);
        };
        ChangeTextBoxPropertiesCommand.prototype.executeCore = function (_state, options) {
            var modelManipulator = this.control.modelManipulator;
            var subDocument = this.control.selection.specialRunInfo.getParentSubDocument();
            this.control.history.addAndRedo(new __aspxRichEdit.ChangeTextBoxPropertiesHistoryItem(modelManipulator, subDocument, new __aspxRichEdit.FixedInterval(this.control.selection.specialRunInfo.getTextBoxPosition(), 1), options.param));
            return true;
        };
        ChangeTextBoxPropertiesCommand.prototype.getValue = function () {
            var specialRunInfo = this.control.selection.specialRunInfo;
            var run = specialRunInfo.getParentSubDocument().getRunByPosition(specialRunInfo.getTextBoxPosition());
            var textBoxRun = run;
            return textBoxRun.textBoxProperties.clone();
        };
        return ChangeTextBoxPropertiesCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ChangeTextBoxPropertiesCommand = ChangeTextBoxPropertiesCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ContextItemFloatingObjects = (function (_super) {
        __extends(ContextItemFloatingObjects, _super);
        function ContextItemFloatingObjects() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ContextItemFloatingObjects.prototype.getState = function () {
            var specialRunInfo = this.control.selection.specialRunInfo;
            var state = new __aspxRichEdit.SimpleCommandState(true, false);
            state.visible = specialRunInfo.isSelected() &&
                this.getFloatingObjectParentSubDocument().isEditable([new __aspxRichEdit.FixedInterval(specialRunInfo.getPosition(), 1)]);
            return state;
        };
        ContextItemFloatingObjects.prototype.canModify = function () {
            return true;
        };
        ContextItemFloatingObjects.prototype.executeCore = function (_state, _parameter) {
            return false;
        };
        return ContextItemFloatingObjects;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ContextItemFloatingObjects = ContextItemFloatingObjects;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FloatingObjectBringForwardBackwardCommandBase = (function (_super) {
        __extends(FloatingObjectBringForwardBackwardCommandBase, _super);
        function FloatingObjectBringForwardBackwardCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FloatingObjectBringForwardBackwardCommandBase.prototype.isBehindDoc = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        FloatingObjectBringForwardBackwardCommandBase.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        FloatingObjectBringForwardBackwardCommandBase.prototype.canModify = function () {
            return true;
        };
        FloatingObjectBringForwardBackwardCommandBase.prototype.isEnabled = function () {
            var specialRunInfo = this.control.selection.specialRunInfo;
            return _super.prototype.isEnabled.call(this) && specialRunInfo.isSelected() && specialRunInfo.isSelectedAnchorObject &&
                this.getFloatingObjectParentSubDocument().isEditable([new __aspxRichEdit.FixedInterval(specialRunInfo.getPosition(), 1)]);
        };
        FloatingObjectBringForwardBackwardCommandBase.prototype.executeCore = function (_state, _parameter) {
            var modelManipulator = this.control.modelManipulator;
            var specialRunInfo = this.control.selection.specialRunInfo;
            if (modelManipulator.model.activeSubDocument.getRunByPosition(specialRunInfo.getPosition())
                .anchorInfo.isBehindDoc != this.isBehindDoc())
                this.control.history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, specialRunInfo.getParentSubDocument(), new __aspxRichEdit.FixedInterval(this.control.selection.specialRunInfo.getPosition(), 1), this.isBehindDoc(), modelManipulator.floatingObjectsManipulator.anchorInfo.isBehindDoc));
            return true;
        };
        return FloatingObjectBringForwardBackwardCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.FloatingObjectBringForwardBackwardCommandBase = FloatingObjectBringForwardBackwardCommandBase;
    var FloatingObjectBringForwardCommand = (function (_super) {
        __extends(FloatingObjectBringForwardCommand, _super);
        function FloatingObjectBringForwardCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FloatingObjectBringForwardCommand.prototype.executeCore = function (_state, _parameter) {
            return __aspxRichEdit.ZOrderManipulator.bringForward(this.control, this.control.selection.specialRunInfo.getPosition());
        };
        return FloatingObjectBringForwardCommand;
    }(FloatingObjectBringForwardBackwardCommandBase));
    __aspxRichEdit.FloatingObjectBringForwardCommand = FloatingObjectBringForwardCommand;
    var FloatingObjectBringToFrontCommand = (function (_super) {
        __extends(FloatingObjectBringToFrontCommand, _super);
        function FloatingObjectBringToFrontCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FloatingObjectBringToFrontCommand.prototype.executeCore = function (_state, _parameter) {
            return __aspxRichEdit.ZOrderManipulator.bringToFront(this.control, this.control.selection.specialRunInfo.getPosition());
        };
        return FloatingObjectBringToFrontCommand;
    }(FloatingObjectBringForwardBackwardCommandBase));
    __aspxRichEdit.FloatingObjectBringToFrontCommand = FloatingObjectBringToFrontCommand;
    var FloatingObjectSendBackwardCommand = (function (_super) {
        __extends(FloatingObjectSendBackwardCommand, _super);
        function FloatingObjectSendBackwardCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FloatingObjectSendBackwardCommand.prototype.executeCore = function (_state, _parameter) {
            return __aspxRichEdit.ZOrderManipulator.sendBackward(this.control, this.control.selection.specialRunInfo.getPosition());
        };
        return FloatingObjectSendBackwardCommand;
    }(FloatingObjectBringForwardBackwardCommandBase));
    __aspxRichEdit.FloatingObjectSendBackwardCommand = FloatingObjectSendBackwardCommand;
    var FloatingObjectSendToBackCommand = (function (_super) {
        __extends(FloatingObjectSendToBackCommand, _super);
        function FloatingObjectSendToBackCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FloatingObjectSendToBackCommand.prototype.executeCore = function (_state, _parameter) {
            return __aspxRichEdit.ZOrderManipulator.sendToBack(this.control, this.control.selection.specialRunInfo.getPosition());
        };
        return FloatingObjectSendToBackCommand;
    }(FloatingObjectBringForwardBackwardCommandBase));
    __aspxRichEdit.FloatingObjectSendToBackCommand = FloatingObjectSendToBackCommand;
    var FloatingObjectBringInFrontOfTextCommand = (function (_super) {
        __extends(FloatingObjectBringInFrontOfTextCommand, _super);
        function FloatingObjectBringInFrontOfTextCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FloatingObjectBringInFrontOfTextCommand.prototype.isBehindDoc = function () {
            return false;
        };
        return FloatingObjectBringInFrontOfTextCommand;
    }(FloatingObjectBringForwardBackwardCommandBase));
    __aspxRichEdit.FloatingObjectBringInFrontOfTextCommand = FloatingObjectBringInFrontOfTextCommand;
    var FloatingObjectSendBehindTextCommand = (function (_super) {
        __extends(FloatingObjectSendBehindTextCommand, _super);
        function FloatingObjectSendBehindTextCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FloatingObjectSendBehindTextCommand.prototype.isBehindDoc = function () {
            return true;
        };
        return FloatingObjectSendBehindTextCommand;
    }(FloatingObjectBringForwardBackwardCommandBase));
    __aspxRichEdit.FloatingObjectSendBehindTextCommand = FloatingObjectSendBehindTextCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FloatingObjectDragDropChangePositionCommand = (function (_super) {
        __extends(FloatingObjectDragDropChangePositionCommand, _super);
        function FloatingObjectDragDropChangePositionCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FloatingObjectDragDropChangePositionCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        FloatingObjectDragDropChangePositionCommand.prototype.canModify = function () {
            return true;
        };
        FloatingObjectDragDropChangePositionCommand.prototype.isEnabled = function () {
            var specialRunInfo = this.control.selection.specialRunInfo;
            return _super.prototype.isEnabled.call(this) && specialRunInfo.isSelected() && specialRunInfo.isSelectedAnchorObject &&
                this.getFloatingObjectParentSubDocument().isEditable([new __aspxRichEdit.FixedInterval(specialRunInfo.getPosition(), 1)]);
        };
        FloatingObjectDragDropChangePositionCommand.prototype.executeCore = function (_state, options) {
            var topInfo = this.control.viewManager.canvasManager.getScrollTopInfo();
            var subDocument = this.control.model.activeSubDocument;
            var runInfo = this.control.model.activeSubDocument.getRunAndIndexesByPosition(this.control.selection.specialRunInfo.getPosition());
            var oldRun = runInfo.run.clone();
            var oldRunPos = runInfo.getAbsoluteRunPosition();
            var layoutPoint = new __aspxRichEdit.LayoutPoint(options.endPageIndex, options.finalClickPoint.x, options.finalClickPoint.y);
            var prevHtr = this.control.hitTestManager.calculate(layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.Character, subDocument);
            prevHtr.correctAsVisibleBox();
            this.control.history.beginTransaction();
            if (prevHtr.row.tableCellInfo) {
                var paragraphStartHTR = this.findParagraphStartOnThisPage(prevHtr);
                var newLogPos = paragraphStartHTR.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Row);
                var offset = oldRun.anchorInfo.layoutTableCell ? prevHtr.row.tableCellInfo.x : 0;
                var newPoint = new __aspxRichEdit.Point(options.finalPoint.x - paragraphStartHTR.pageArea.x - paragraphStartHTR.column.x - offset, options.finalPoint.y - paragraphStartHTR.getLayoutY(__aspxRichEdit.DocumentLayoutDetailsLevel.Row));
                __aspxRichEdit.ModelManipulator.removeInterval(this.control, subDocument, this.control.selection.getLastSelectedInterval(), false, false);
                this.control.layoutFormatterManager.forceFormatPage(options.endPageIndex);
                var newRunPos = newLogPos + (oldRunPos < newLogPos ? -1 : 0);
                this.addRun(oldRun, newRunPos, this.getNewAnchorInfo(oldRun.anchorInfo, newPoint));
            }
            else {
                if (options.startPageIndex !== options.endPageIndex)
                    __aspxRichEdit.ModelManipulator.removeInterval(this.control, subDocument, this.control.selection.getLastSelectedInterval(), false, false);
                this.control.layoutFormatterManager.forceFormatPage(options.endPageIndex);
                var layoutPoint_1 = new __aspxRichEdit.LayoutPoint(Math.min(options.endPageIndex, this.control.layout.pages.length), options.finalPoint.x, options.finalPoint.y);
                var htr = this.control.hitTestManager.calculate(layoutPoint_1, __aspxRichEdit.DocumentLayoutDetailsLevel.Row, subDocument);
                var newPoint = new __aspxRichEdit.Point(options.finalPoint.x - htr.getLayoutX(null, __aspxRichEdit.DocumentLayoutDetailsLevel.Column), options.finalPoint.y);
                var newAnchorInfo = this.getNewAnchorInfo(oldRun.anchorInfo, newPoint);
                if (options.startPageIndex !== options.endPageIndex) {
                    var newRunPos = this.findParagraphStartOnThisPage(htr).getLogPosition();
                    this.addRun(oldRun, newRunPos, newAnchorInfo);
                }
                else {
                    var command = this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowLayoutOptionsForm);
                    var parameters = command.createParameters(new __aspxRichEdit.CommandOptions(this.control));
                    var initParameters = parameters.clone();
                    parameters.init(newAnchorInfo, oldRun.size, oldRun.getType() === __aspxRichEdit.RunType.AnchoredTextBoxRun ? oldRun.textBoxProperties : null, this.control);
                    command.applyParameters(command.getState(), parameters, initParameters);
                }
            }
            this.control.history.endTransaction();
            this.control.selection.scrollManager.setScroll(new __aspxRichEdit.Scroll.State().byScrollInfo.setPageInfo(topInfo));
            return true;
        };
        FloatingObjectDragDropChangePositionCommand.prototype.findParagraphStartOnThisPage = function (htr) {
            var paragraph = this.control.model.activeSubDocument.getParagraphByPosition(htr.getLogPosition());
            while (htr.stepBackRow()) {
                if (!paragraph.interval.contains(htr.getLogPosition())) {
                    htr.stepForwardRow();
                    break;
                }
            }
            return htr;
        };
        FloatingObjectDragDropChangePositionCommand.prototype.addRun = function (oldRun, position, anchorInfo) {
            if (oldRun.getType() == __aspxRichEdit.RunType.AnchoredPictureRun) {
                var pictureRun = oldRun;
                __aspxRichEdit.FloatingObjectsManipulator.insertAnchoredPicture(this.control, new __aspxRichEdit.FixedInterval(position, 0), pictureRun.id, pictureRun.size.clone(), pictureRun.shape.clone(), anchorInfo, pictureRun.isLoaded);
            }
            else {
                var textBoxRun = oldRun;
                var originalSubDocument = this.control.model.subDocuments[textBoxRun.subDocId];
                __aspxRichEdit.FloatingObjectsManipulator.insertAnchoredTextbox(this.control, this.control.model.activeSubDocument, new __aspxRichEdit.FixedInterval(position, 0), textBoxRun.size.clone(), textBoxRun.shape.clone(), textBoxRun.textBoxProperties.clone(), anchorInfo);
                if (originalSubDocument.getDocumentEndPosition() > 1) {
                    var newTextBoxRun = this.control.model.activeSubDocument.getRunAndIndexesByPosition(position).run;
                    this.control.modelManipulator.text.insertSubDocumentInOtherSubDocument(this.control.model.subDocuments[newTextBoxRun.subDocId], 0, originalSubDocument, new __aspxRichEdit.FixedInterval(0, originalSubDocument.getDocumentEndPosition() - 1));
                }
            }
        };
        FloatingObjectDragDropChangePositionCommand.prototype.getNewAnchorInfo = function (anchorInfo, newPoint) {
            anchorInfo = anchorInfo.clone();
            anchorInfo.horizontalPositionAlignment = __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.None;
            anchorInfo.verticalPositionAlignment = __aspxRichEdit.AnchorObjectVerticalPositionAlignment.None;
            anchorInfo.horizontalPositionType = __aspxRichEdit.AnchorObjectHorizontalPositionType.Column;
            anchorInfo.verticalPositionType = __aspxRichEdit.AnchorObjectVerticalPositionType.Page;
            anchorInfo.percentOffset.x = 0;
            anchorInfo.percentOffset.y = 0;
            anchorInfo.offset.x = __aspxRichEdit.UnitConverter.pixelsToTwips(newPoint.x);
            anchorInfo.offset.y = __aspxRichEdit.UnitConverter.pixelsToTwips(newPoint.y);
            return anchorInfo;
        };
        return FloatingObjectDragDropChangePositionCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.FloatingObjectDragDropChangePositionCommand = FloatingObjectDragDropChangePositionCommand;
    var FloatingObjectDragDropChangePositionCommandParameters = (function (_super) {
        __extends(FloatingObjectDragDropChangePositionCommandParameters, _super);
        function FloatingObjectDragDropChangePositionCommandParameters(control, startPageIndex, endPageIndex, finalPoint, finalClickPoint) {
            var _this = _super.call(this, control) || this;
            _this.startPageIndex = startPageIndex;
            _this.endPageIndex = endPageIndex;
            _this.finalPoint = finalPoint;
            _this.finalClickPoint = finalClickPoint;
            return _this;
        }
        return FloatingObjectDragDropChangePositionCommandParameters;
    }(__aspxRichEdit.CommandOptions));
    __aspxRichEdit.FloatingObjectDragDropChangePositionCommandParameters = FloatingObjectDragDropChangePositionCommandParameters;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertAnchoredTextBoxCommand = (function (_super) {
        __extends(InsertAnchoredTextBoxCommand, _super);
        function InsertAnchoredTextBoxCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertAnchoredTextBoxCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        InsertAnchoredTextBoxCommand.prototype.canModify = function () {
            return !this.control.model.isDocumentProtectionEnabled;
        };
        InsertAnchoredTextBoxCommand.prototype.isEnabled = function () {
            var subDoc = this.control.model.activeSubDocument;
            return _super.prototype.isEnabled.call(this) &&
                __aspxRichEdit.ControlOptions.isEnabled(this.control.options.floatingObjects) &&
                (subDoc.isMain() || subDoc.isHeaderFooter());
        };
        InsertAnchoredTextBoxCommand.prototype.executeCore = function (_state, options) {
            var history = this.control.history;
            var topBottomMargin = __aspxRichEdit.UnitConverter.inchesToTwips(0.05);
            var leftRightMargin = __aspxRichEdit.UnitConverter.inchesToTwips(0.1);
            var absoluteSize = new __aspxRichEdit.Size(__aspxRichEdit.UnitConverter.inchesToTwips(2), __aspxRichEdit.UnitConverter.inchesToTwips(0.3));
            var relativeSize = new __aspxRichEdit.Size(__aspxRichEdit.AnchorTextBoxSize.RELATIVE_COEFF * 0.40, __aspxRichEdit.AnchorTextBoxSize.RELATIVE_COEFF * 0.20);
            var size = new __aspxRichEdit.AnchorTextBoxSize(false, 0, absoluteSize, relativeSize, __aspxRichEdit.RelativeWidthType.Margin, __aspxRichEdit.RelativeHeightType.Margin, false, false);
            var contentMargins = new __aspxRichEdit.Margins(leftRightMargin, leftRightMargin, topBottomMargin, topBottomMargin);
            var textBoxProperties = new __aspxRichEdit.TextBoxProperties(contentMargins);
            var anchorInfo = new __aspxRichEdit.AnchorInfo();
            anchorInfo.zOrder = __aspxRichEdit.ZOrderManipulator.getNewZOrder(options.subDocument);
            history.beginTransaction();
            __aspxRichEdit.FloatingObjectsManipulator.insertAnchoredTextbox(this.control, this.control.model.activeSubDocument, this.control.selection.getLastSelectedInterval(), size, new __aspxRichEdit.Shape(__aspxRichEdit.ColorHelper.stringToColor(__aspxRichEdit.ColorHelper.colorNames.white), __aspxRichEdit.ColorHelper.BLACK_COLOR, __aspxRichEdit.UnitConverter.pointsToTwips(3 / 4)), textBoxProperties, anchorInfo);
            this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToTextBox)
                .execute(this.control.commandManager.isPublicApiCall, options);
            history.endTransaction();
            return true;
        };
        return InsertAnchoredTextBoxCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.InsertAnchoredTextBoxCommand = InsertAnchoredTextBoxCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SetFloatingObjectAlignmentCommandBase = (function (_super) {
        __extends(SetFloatingObjectAlignmentCommandBase, _super);
        function SetFloatingObjectAlignmentCommandBase() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.anchorObjectHorizontalPositionType = __aspxRichEdit.AnchorObjectHorizontalPositionType.Margin;
            _this.anchorObjectVerticalPositionType = __aspxRichEdit.AnchorObjectVerticalPositionType.Margin;
            return _this;
        }
        SetFloatingObjectAlignmentCommandBase.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled(), this.getStateValue());
        };
        SetFloatingObjectAlignmentCommandBase.prototype.getStateValue = function () {
            var value = false;
            if (this.isEnabled()) {
                var specialRunInfo = this.control.selection.specialRunInfo;
                var anchoredRun = specialRunInfo.getParentSubDocument()
                    .getRunByPosition(specialRunInfo.getPosition());
                if (anchoredRun.anchorInfo.horizontalPositionAlignment === this.anchorObjectHorizontalAlignment
                    && anchoredRun.anchorInfo.verticalPositionAlignment === this.anchorObjectVerticalAlignment
                    && anchoredRun.anchorInfo.horizontalPositionType === this.anchorObjectHorizontalPositionType
                    && anchoredRun.anchorInfo.verticalPositionType === this.anchorObjectVerticalPositionType)
                    value = true;
            }
            return value;
        };
        SetFloatingObjectAlignmentCommandBase.prototype.canModify = function () {
            return true;
        };
        SetFloatingObjectAlignmentCommandBase.prototype.isEnabled = function () {
            var specialRunInfo = this.control.selection.specialRunInfo;
            return _super.prototype.isEnabled.call(this) && specialRunInfo.isSelected() && specialRunInfo.isSelectedAnchorObject &&
                this.getFloatingObjectParentSubDocument().isEditable([new __aspxRichEdit.FixedInterval(specialRunInfo.getPosition(), 1)]);
        };
        SetFloatingObjectAlignmentCommandBase.prototype.executeCore = function (_state, _parameter) {
            var modelManipulator = this.control.modelManipulator;
            var specialRunInfo = this.control.selection.specialRunInfo;
            var subDocument = specialRunInfo.getParentSubDocument();
            var run = subDocument.getRunByPosition(specialRunInfo.getPosition());
            var anchoredRun = run.getType() == __aspxRichEdit.RunType.AnchoredPictureRun ? run : run;
            if (anchoredRun.anchorInfo.horizontalPositionAlignment !== this.anchorObjectHorizontalAlignment || anchoredRun.anchorInfo.verticalPositionAlignment !== this.anchorObjectVerticalAlignment) {
                this.control.history.beginTransaction();
                this.control.history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, subDocument, new __aspxRichEdit.FixedInterval(specialRunInfo.getPosition(), 1), this.anchorObjectHorizontalAlignment, modelManipulator.floatingObjectsManipulator.anchorInfo.horizontalPositionAlignment));
                this.control.history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, subDocument, new __aspxRichEdit.FixedInterval(specialRunInfo.getPosition(), 1), this.anchorObjectVerticalAlignment, modelManipulator.floatingObjectsManipulator.anchorInfo.verticalPositionAlignment));
                this.control.history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, subDocument, new __aspxRichEdit.FixedInterval(specialRunInfo.getPosition(), 1), this.anchorObjectHorizontalPositionType, modelManipulator.floatingObjectsManipulator.anchorInfo.horizontalPositionType));
                this.control.history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, subDocument, new __aspxRichEdit.FixedInterval(specialRunInfo.getPosition(), 1), this.anchorObjectVerticalPositionType, modelManipulator.floatingObjectsManipulator.anchorInfo.verticalPositionType));
                this.control.history.endTransaction();
            }
            return true;
        };
        return SetFloatingObjectAlignmentCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.SetFloatingObjectAlignmentCommandBase = SetFloatingObjectAlignmentCommandBase;
    var SetFloatingObjectTopLeftAlignmentCommand = (function (_super) {
        __extends(SetFloatingObjectTopLeftAlignmentCommand, _super);
        function SetFloatingObjectTopLeftAlignmentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.anchorObjectHorizontalAlignment = __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Left;
            _this.anchorObjectVerticalAlignment = __aspxRichEdit.AnchorObjectVerticalPositionAlignment.Top;
            return _this;
        }
        return SetFloatingObjectTopLeftAlignmentCommand;
    }(SetFloatingObjectAlignmentCommandBase));
    __aspxRichEdit.SetFloatingObjectTopLeftAlignmentCommand = SetFloatingObjectTopLeftAlignmentCommand;
    var SetFloatingObjectTopCenterAlignmentCommand = (function (_super) {
        __extends(SetFloatingObjectTopCenterAlignmentCommand, _super);
        function SetFloatingObjectTopCenterAlignmentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.anchorObjectHorizontalAlignment = __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Center;
            _this.anchorObjectVerticalAlignment = __aspxRichEdit.AnchorObjectVerticalPositionAlignment.Top;
            return _this;
        }
        return SetFloatingObjectTopCenterAlignmentCommand;
    }(SetFloatingObjectAlignmentCommandBase));
    __aspxRichEdit.SetFloatingObjectTopCenterAlignmentCommand = SetFloatingObjectTopCenterAlignmentCommand;
    var SetFloatingObjectTopRightAlignmentCommand = (function (_super) {
        __extends(SetFloatingObjectTopRightAlignmentCommand, _super);
        function SetFloatingObjectTopRightAlignmentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.anchorObjectHorizontalAlignment = __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Right;
            _this.anchorObjectVerticalAlignment = __aspxRichEdit.AnchorObjectVerticalPositionAlignment.Top;
            return _this;
        }
        return SetFloatingObjectTopRightAlignmentCommand;
    }(SetFloatingObjectAlignmentCommandBase));
    __aspxRichEdit.SetFloatingObjectTopRightAlignmentCommand = SetFloatingObjectTopRightAlignmentCommand;
    var SetFloatingObjectMiddleLeftAlignmentCommand = (function (_super) {
        __extends(SetFloatingObjectMiddleLeftAlignmentCommand, _super);
        function SetFloatingObjectMiddleLeftAlignmentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.anchorObjectHorizontalAlignment = __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Left;
            _this.anchorObjectVerticalAlignment = __aspxRichEdit.AnchorObjectVerticalPositionAlignment.Center;
            return _this;
        }
        return SetFloatingObjectMiddleLeftAlignmentCommand;
    }(SetFloatingObjectAlignmentCommandBase));
    __aspxRichEdit.SetFloatingObjectMiddleLeftAlignmentCommand = SetFloatingObjectMiddleLeftAlignmentCommand;
    var SetFloatingObjectMiddleCenterAlignmentCommand = (function (_super) {
        __extends(SetFloatingObjectMiddleCenterAlignmentCommand, _super);
        function SetFloatingObjectMiddleCenterAlignmentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.anchorObjectHorizontalAlignment = __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Center;
            _this.anchorObjectVerticalAlignment = __aspxRichEdit.AnchorObjectVerticalPositionAlignment.Center;
            return _this;
        }
        return SetFloatingObjectMiddleCenterAlignmentCommand;
    }(SetFloatingObjectAlignmentCommandBase));
    __aspxRichEdit.SetFloatingObjectMiddleCenterAlignmentCommand = SetFloatingObjectMiddleCenterAlignmentCommand;
    var SetFloatingObjectMiddleRightAlignmentCommand = (function (_super) {
        __extends(SetFloatingObjectMiddleRightAlignmentCommand, _super);
        function SetFloatingObjectMiddleRightAlignmentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.anchorObjectHorizontalAlignment = __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Right;
            _this.anchorObjectVerticalAlignment = __aspxRichEdit.AnchorObjectVerticalPositionAlignment.Center;
            return _this;
        }
        return SetFloatingObjectMiddleRightAlignmentCommand;
    }(SetFloatingObjectAlignmentCommandBase));
    __aspxRichEdit.SetFloatingObjectMiddleRightAlignmentCommand = SetFloatingObjectMiddleRightAlignmentCommand;
    var SetFloatingObjectBottomLeftAlignmentCommand = (function (_super) {
        __extends(SetFloatingObjectBottomLeftAlignmentCommand, _super);
        function SetFloatingObjectBottomLeftAlignmentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.anchorObjectHorizontalAlignment = __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Left;
            _this.anchorObjectVerticalAlignment = __aspxRichEdit.AnchorObjectVerticalPositionAlignment.Bottom;
            return _this;
        }
        return SetFloatingObjectBottomLeftAlignmentCommand;
    }(SetFloatingObjectAlignmentCommandBase));
    __aspxRichEdit.SetFloatingObjectBottomLeftAlignmentCommand = SetFloatingObjectBottomLeftAlignmentCommand;
    var SetFloatingObjectBottomCenterAlignmentCommand = (function (_super) {
        __extends(SetFloatingObjectBottomCenterAlignmentCommand, _super);
        function SetFloatingObjectBottomCenterAlignmentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.anchorObjectHorizontalAlignment = __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Center;
            _this.anchorObjectVerticalAlignment = __aspxRichEdit.AnchorObjectVerticalPositionAlignment.Bottom;
            return _this;
        }
        return SetFloatingObjectBottomCenterAlignmentCommand;
    }(SetFloatingObjectAlignmentCommandBase));
    __aspxRichEdit.SetFloatingObjectBottomCenterAlignmentCommand = SetFloatingObjectBottomCenterAlignmentCommand;
    var SetFloatingObjectBottomRightAlignmentCommand = (function (_super) {
        __extends(SetFloatingObjectBottomRightAlignmentCommand, _super);
        function SetFloatingObjectBottomRightAlignmentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.anchorObjectHorizontalAlignment = __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Right;
            _this.anchorObjectVerticalAlignment = __aspxRichEdit.AnchorObjectVerticalPositionAlignment.Bottom;
            return _this;
        }
        return SetFloatingObjectBottomRightAlignmentCommand;
    }(SetFloatingObjectAlignmentCommandBase));
    __aspxRichEdit.SetFloatingObjectBottomRightAlignmentCommand = SetFloatingObjectBottomRightAlignmentCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SetFloatingObjectTextWrapTypeCommandBase = (function (_super) {
        __extends(SetFloatingObjectTextWrapTypeCommandBase, _super);
        function SetFloatingObjectTextWrapTypeCommandBase() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.isBehindDoc = false;
            return _this;
        }
        SetFloatingObjectTextWrapTypeCommandBase.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled(), this.getStateValue());
        };
        SetFloatingObjectTextWrapTypeCommandBase.prototype.getStateValue = function () {
            var value = false;
            if (this.isEnabled()) {
                var specialRunInfo = this.control.selection.specialRunInfo;
                var anchoredRun = specialRunInfo.getParentSubDocument()
                    .getRunByPosition(specialRunInfo.getPosition());
                if (anchoredRun && anchoredRun.anchorInfo && anchoredRun.anchorInfo.wrapType === this.anchorObjectTextWrapType &&
                    anchoredRun.anchorInfo.isBehindDoc === this.isBehindDoc)
                    value = true;
            }
            return value;
        };
        SetFloatingObjectTextWrapTypeCommandBase.prototype.canModify = function () {
            return true;
        };
        SetFloatingObjectTextWrapTypeCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && this.isEnabledCore() &&
                this.getFloatingObjectParentSubDocument().isEditable([new __aspxRichEdit.FixedInterval(this.control.selection.specialRunInfo.getPosition(), 1)]);
        };
        SetFloatingObjectTextWrapTypeCommandBase.prototype.isEnabledCore = function () {
            return this.control.selection.specialRunInfo.isSelected();
        };
        SetFloatingObjectTextWrapTypeCommandBase.prototype.executeCore = function (_state, _parameter) {
            var modelManipulator = this.control.modelManipulator;
            var specialRunInfo = this.control.selection.specialRunInfo;
            var subDocument = specialRunInfo.getParentSubDocument();
            var position = specialRunInfo.getPosition();
            var run = subDocument.getRunByPosition(position);
            this.control.history.beginTransaction();
            if (run.getType() === __aspxRichEdit.RunType.InlinePictureRun) {
                var interval = new __aspxRichEdit.FixedInterval(position, 1);
                var pictureRun = run;
                var anchorInfo = new __aspxRichEdit.AnchorInfo();
                anchorInfo.zOrder = __aspxRichEdit.ZOrderManipulator.getNewZOrder(modelManipulator.model.activeSubDocument);
                __aspxRichEdit.FloatingObjectsManipulator.insertAnchoredPicture(this.control, interval, pictureRun.id, pictureRun.size, new __aspxRichEdit.Shape(), anchorInfo, pictureRun.isLoaded);
                run = subDocument.getRunByPosition(interval.start);
            }
            var anchoredRun = run.getType() == __aspxRichEdit.RunType.AnchoredPictureRun ? run : run;
            if (anchoredRun.anchorInfo.wrapType !== this.anchorObjectTextWrapType || anchoredRun.anchorInfo.isBehindDoc !== this.isBehindDoc) {
                this.control.history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, subDocument, new __aspxRichEdit.FixedInterval(position, 1), this.anchorObjectTextWrapType, modelManipulator.floatingObjectsManipulator.anchorInfo.wrapType));
                this.control.history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, subDocument, new __aspxRichEdit.FixedInterval(position, 1), this.isBehindDoc, modelManipulator.floatingObjectsManipulator.anchorInfo.isBehindDoc));
            }
            this.control.history.endTransaction();
            return true;
        };
        return SetFloatingObjectTextWrapTypeCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.SetFloatingObjectTextWrapTypeCommandBase = SetFloatingObjectTextWrapTypeCommandBase;
    var SetFloatingObjectSquareTextWrapTypeCommand = (function (_super) {
        __extends(SetFloatingObjectSquareTextWrapTypeCommand, _super);
        function SetFloatingObjectSquareTextWrapTypeCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.anchorObjectTextWrapType = __aspxRichEdit.AnchorObjectTextWrapType.Square;
            return _this;
        }
        return SetFloatingObjectSquareTextWrapTypeCommand;
    }(SetFloatingObjectTextWrapTypeCommandBase));
    __aspxRichEdit.SetFloatingObjectSquareTextWrapTypeCommand = SetFloatingObjectSquareTextWrapTypeCommand;
    var SetFloatingObjectTightTextWrapTypeCommand = (function (_super) {
        __extends(SetFloatingObjectTightTextWrapTypeCommand, _super);
        function SetFloatingObjectTightTextWrapTypeCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.anchorObjectTextWrapType = __aspxRichEdit.AnchorObjectTextWrapType.Tight;
            return _this;
        }
        return SetFloatingObjectTightTextWrapTypeCommand;
    }(SetFloatingObjectTextWrapTypeCommandBase));
    __aspxRichEdit.SetFloatingObjectTightTextWrapTypeCommand = SetFloatingObjectTightTextWrapTypeCommand;
    var SetFloatingObjectThroughTextWrapTypeCommand = (function (_super) {
        __extends(SetFloatingObjectThroughTextWrapTypeCommand, _super);
        function SetFloatingObjectThroughTextWrapTypeCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.anchorObjectTextWrapType = __aspxRichEdit.AnchorObjectTextWrapType.Through;
            return _this;
        }
        return SetFloatingObjectThroughTextWrapTypeCommand;
    }(SetFloatingObjectTextWrapTypeCommandBase));
    __aspxRichEdit.SetFloatingObjectThroughTextWrapTypeCommand = SetFloatingObjectThroughTextWrapTypeCommand;
    var SetFloatingObjectTopAndBottomTextWrapTypeCommand = (function (_super) {
        __extends(SetFloatingObjectTopAndBottomTextWrapTypeCommand, _super);
        function SetFloatingObjectTopAndBottomTextWrapTypeCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.anchorObjectTextWrapType = __aspxRichEdit.AnchorObjectTextWrapType.TopAndBottom;
            return _this;
        }
        return SetFloatingObjectTopAndBottomTextWrapTypeCommand;
    }(SetFloatingObjectTextWrapTypeCommandBase));
    __aspxRichEdit.SetFloatingObjectTopAndBottomTextWrapTypeCommand = SetFloatingObjectTopAndBottomTextWrapTypeCommand;
    var SetFloatingObjectInFrontOfTextWrapTypeCommand = (function (_super) {
        __extends(SetFloatingObjectInFrontOfTextWrapTypeCommand, _super);
        function SetFloatingObjectInFrontOfTextWrapTypeCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.anchorObjectTextWrapType = __aspxRichEdit.AnchorObjectTextWrapType.None;
            return _this;
        }
        return SetFloatingObjectInFrontOfTextWrapTypeCommand;
    }(SetFloatingObjectTextWrapTypeCommandBase));
    __aspxRichEdit.SetFloatingObjectInFrontOfTextWrapTypeCommand = SetFloatingObjectInFrontOfTextWrapTypeCommand;
    var SetFloatingObjectBehindTextWrapTypeCommand = (function (_super) {
        __extends(SetFloatingObjectBehindTextWrapTypeCommand, _super);
        function SetFloatingObjectBehindTextWrapTypeCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.anchorObjectTextWrapType = __aspxRichEdit.AnchorObjectTextWrapType.None;
            _this.isBehindDoc = true;
            return _this;
        }
        return SetFloatingObjectBehindTextWrapTypeCommand;
    }(SetFloatingObjectTextWrapTypeCommandBase));
    __aspxRichEdit.SetFloatingObjectBehindTextWrapTypeCommand = SetFloatingObjectBehindTextWrapTypeCommand;
    var SetFloatingObjectInlineTextWrapTypeCommand = (function (_super) {
        __extends(SetFloatingObjectInlineTextWrapTypeCommand, _super);
        function SetFloatingObjectInlineTextWrapTypeCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetFloatingObjectInlineTextWrapTypeCommand.prototype.getStateValue = function () {
            var value = false;
            if (this.isEnabled()) {
                var run = this.control.model.activeSubDocument.getRunByPosition(this.control.selection.specialRunInfo.getPicturePosition());
                if (run.getType() === __aspxRichEdit.RunType.InlinePictureRun)
                    value = true;
            }
            return value;
        };
        SetFloatingObjectInlineTextWrapTypeCommand.prototype.isEnabledCore = function () {
            return this.control.selection.specialRunInfo.isPictureSelected();
        };
        SetFloatingObjectInlineTextWrapTypeCommand.prototype.executeCore = function (_state, _parameter) {
            var interval = this.control.selection.getLastSelectedInterval();
            var run = this.control.model.activeSubDocument.getRunByPosition(this.control.selection.specialRunInfo.getPicturePosition());
            var pictureRun = run;
            if (run.getType() !== __aspxRichEdit.RunType.InlinePictureRun)
                __aspxRichEdit.ModelManipulator.insertInlinePicture(this.control, interval, pictureRun.id, pictureRun.size.originalSize.width, pictureRun.size.originalSize.height, pictureRun.size.scale.width, pictureRun.size.scale.height, pictureRun.size.lockAspectRatio);
            return true;
        };
        return SetFloatingObjectInlineTextWrapTypeCommand;
    }(SetFloatingObjectTextWrapTypeCommandBase));
    __aspxRichEdit.SetFloatingObjectInlineTextWrapTypeCommand = SetFloatingObjectInlineTextWrapTypeCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var CloseHeaderFooterCommand = (function (_super) {
        __extends(CloseHeaderFooterCommand, _super);
        function CloseHeaderFooterCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CloseHeaderFooterCommand.prototype.executeCore = function (_state, _options) {
            return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToMain)
                .execute(this.control.commandManager.isPublicApiCall);
        };
        CloseHeaderFooterCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return CloseHeaderFooterCommand;
    }(__aspxRichEdit.HeaderFooterCommandBase));
    __aspxRichEdit.CloseHeaderFooterCommand = CloseHeaderFooterCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ContextItemHeadersFooters = (function (_super) {
        __extends(ContextItemHeadersFooters, _super);
        function ContextItemHeadersFooters() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ContextItemHeadersFooters.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.control.innerClientProperties.viewsSettings.isPrintLayoutView, false);
            state.visible = this.control.model.activeSubDocument.isHeaderFooter();
            return state;
        };
        return ContextItemHeadersFooters;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ContextItemHeadersFooters = ContextItemHeadersFooters;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DifferentFirstPageAndOddEvenHeaderFooterCommandBase = (function (_super) {
        __extends(DifferentFirstPageAndOddEvenHeaderFooterCommandBase, _super);
        function DifferentFirstPageAndOddEvenHeaderFooterCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DifferentFirstPageAndOddEvenHeaderFooterCommandBase.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return typeof parameter === 'boolean' ? parameter : !this.getValue();
        };
        DifferentFirstPageAndOddEvenHeaderFooterCommandBase.prototype.executeCore = function (state, options) {
            var pageIndex = this.control.selection.pageIndex;
            var sectionIndex = this.getSectionIndex(pageIndex);
            var section = this.control.model.sections[sectionIndex];
            var activeSubDoc = this.control.model.activeSubDocument;
            var isHeader = activeSubDoc.isHeader();
            var sectionHeadersFooters = __aspxRichEdit.HeaderFooterCommandBase.getSectionHeadersFooters(isHeader, section);
            var newValue = options.param;
            if (newValue === state.value)
                return false;
            this.control.history.beginTransaction();
            var page = this.control.layoutFormatterManager.forceFormatPage(pageIndex);
            var isFirstPageOfSection = page.flags.get(__aspxRichEdit.LayoutPageFlags.IsFirstPageOfSection);
            this.changeSectionProperty(activeSubDoc, section, newValue);
            var headerFooterType = __aspxRichEdit.SectionHeadersFooters.getActualObjectType(section, isFirstPageOfSection, __aspxRichEdit.Utils.isEven(page.layoutPageIndex));
            var info = sectionHeadersFooters.getObject(headerFooterType);
            if (!info) {
                var manipulator = __aspxRichEdit.HeaderFooterCommandBase.getManipulator(isHeader, this.control);
                manipulator.changeObjectIndex(sectionIndex, headerFooterType, manipulator.createObject(headerFooterType));
                info = sectionHeadersFooters.getObject(headerFooterType);
            }
            if (!this.control.layout.isFullyFormatted)
                this.control.layoutFormatterManager.formatSyncAllDocument();
            if (!this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToHeaderFooterByPageIndex).execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.ChangeActiveSubDocumentToHeaderFooterByPageIndexCommandParameters(this.control, pageIndex, isHeader)))
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToHeaderFooterByPageIndex).execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.ChangeActiveSubDocumentToHeaderFooterByPageIndexCommandParameters(this.control, this.control.layout.pages.length - 1, isHeader));
            this.control.history.endTransaction();
            return true;
        };
        return DifferentFirstPageAndOddEvenHeaderFooterCommandBase;
    }(__aspxRichEdit.HeaderFooterCommandBase));
    __aspxRichEdit.DifferentFirstPageAndOddEvenHeaderFooterCommandBase = DifferentFirstPageAndOddEvenHeaderFooterCommandBase;
    var DifferentFirstPageHeaderFooterCommand = (function (_super) {
        __extends(DifferentFirstPageHeaderFooterCommand, _super);
        function DifferentFirstPageHeaderFooterCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DifferentFirstPageHeaderFooterCommand.prototype.getValue = function () {
            return this.control.model.sections[this.getSectionIndex(this.control.selection.pageIndex)].sectionProperties.differentFirstPage;
        };
        DifferentFirstPageHeaderFooterCommand.prototype.changeSectionProperty = function (activeSubDoc, section, newValue) {
            this.control.history.addAndRedo(new __aspxRichEdit.SectionDifferentFirstPageHistoryItem(this.control.modelManipulator, activeSubDoc, new __aspxRichEdit.FixedInterval(section.startLogPosition.value, section.getLength()), newValue));
        };
        return DifferentFirstPageHeaderFooterCommand;
    }(DifferentFirstPageAndOddEvenHeaderFooterCommandBase));
    __aspxRichEdit.DifferentFirstPageHeaderFooterCommand = DifferentFirstPageHeaderFooterCommand;
    var DifferentOddEvenHeaderFooterCommand = (function (_super) {
        __extends(DifferentOddEvenHeaderFooterCommand, _super);
        function DifferentOddEvenHeaderFooterCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DifferentOddEvenHeaderFooterCommand.prototype.getValue = function () {
            return this.control.model.differentOddAndEvenPages;
        };
        DifferentOddEvenHeaderFooterCommand.prototype.changeSectionProperty = function (activeSubDoc, _section, newValue) {
            this.control.history.addAndRedo(new __aspxRichEdit.DifferentOddAndEvenPagesHistoryItem(this.control.modelManipulator, activeSubDoc, newValue));
        };
        return DifferentOddEvenHeaderFooterCommand;
    }(DifferentFirstPageAndOddEvenHeaderFooterCommandBase));
    __aspxRichEdit.DifferentOddEvenHeaderFooterCommand = DifferentOddEvenHeaderFooterCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GoToHeaderFooterCommandBase = (function (_super) {
        __extends(GoToHeaderFooterCommandBase, _super);
        function GoToHeaderFooterCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToHeaderFooterCommandBase.prototype.executeCore = function (_state, _options) {
            return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToHeaderFooterByPageIndex)
                .execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.ChangeActiveSubDocumentToHeaderFooterByPageIndexCommandParameters(this.control, this.control.selection.pageIndex, this.control.model.activeSubDocument.isFooter()));
        };
        return GoToHeaderFooterCommandBase;
    }(__aspxRichEdit.HeaderFooterCommandBase));
    __aspxRichEdit.GoToHeaderFooterCommandBase = GoToHeaderFooterCommandBase;
    var GoToHeaderCommand = (function (_super) {
        __extends(GoToHeaderCommand, _super);
        function GoToHeaderCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToHeaderCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && this.control.model.activeSubDocument.isFooter();
        };
        return GoToHeaderCommand;
    }(GoToHeaderFooterCommandBase));
    __aspxRichEdit.GoToHeaderCommand = GoToHeaderCommand;
    var GoToFooterCommand = (function (_super) {
        __extends(GoToFooterCommand, _super);
        function GoToFooterCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToFooterCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && this.control.model.activeSubDocument.isHeader();
        };
        return GoToFooterCommand;
    }(GoToHeaderFooterCommandBase));
    __aspxRichEdit.GoToFooterCommand = GoToFooterCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GoToNextPrevHeaderFooterCommandBase = (function (_super) {
        __extends(GoToNextPrevHeaderFooterCommandBase, _super);
        function GoToNextPrevHeaderFooterCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToNextPrevHeaderFooterCommandBase.prototype.executeCore = function (_state, _options) {
            var selection = this.control.selection;
            var pageIndex = this.moveFunction(selection.pageIndex);
            var activeSubDocument = this.control.model.activeSubDocument;
            var isHeader = activeSubDocument.isHeader();
            for (var layoutPage = void 0; layoutPage = this.control.layoutFormatterManager.forceFormatPage(pageIndex); pageIndex = this.moveFunction(pageIndex)) {
                var pageArea = isHeader ?
                    layoutPage.getLayoutOtherPageAreasInfo().headerPageArea :
                    layoutPage.getLayoutOtherPageAreasInfo().footerPageArea;
                if (pageArea && pageArea.subDocument != activeSubDocument)
                    return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToHeaderFooterByPageIndex)
                        .execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.ChangeActiveSubDocumentToHeaderFooterByPageIndexCommandParameters(this.control, pageIndex, isHeader));
            }
            return false;
        };
        return GoToNextPrevHeaderFooterCommandBase;
    }(__aspxRichEdit.HeaderFooterCommandBase));
    __aspxRichEdit.GoToNextPrevHeaderFooterCommandBase = GoToNextPrevHeaderFooterCommandBase;
    var GoToNextHeaderFooterCommand = (function (_super) {
        __extends(GoToNextHeaderFooterCommand, _super);
        function GoToNextHeaderFooterCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToNextHeaderFooterCommand.prototype.moveFunction = function (pageIndex) {
            return ++pageIndex;
        };
        return GoToNextHeaderFooterCommand;
    }(GoToNextPrevHeaderFooterCommandBase));
    __aspxRichEdit.GoToNextHeaderFooterCommand = GoToNextHeaderFooterCommand;
    var GoToPreviousHeaderFooterCommand = (function (_super) {
        __extends(GoToPreviousHeaderFooterCommand, _super);
        function GoToPreviousHeaderFooterCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToPreviousHeaderFooterCommand.prototype.moveFunction = function (pageIndex) {
            return --pageIndex;
        };
        return GoToPreviousHeaderFooterCommand;
    }(GoToNextPrevHeaderFooterCommandBase));
    __aspxRichEdit.GoToPreviousHeaderFooterCommand = GoToPreviousHeaderFooterCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertHeaderFooterCommandBase = (function (_super) {
        __extends(InsertHeaderFooterCommandBase, _super);
        function InsertHeaderFooterCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertHeaderFooterCommandBase.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        InsertHeaderFooterCommandBase.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        InsertHeaderFooterCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) &&
                __aspxRichEdit.ControlOptions.isEnabled(this.control.options.sections) &&
                __aspxRichEdit.ControlOptions.isEnabled(this.control.options.headersFooters) &&
                this.control.innerClientProperties.viewsSettings.isPrintLayoutView &&
                this.control.model.activeSubDocument.isMain();
        };
        InsertHeaderFooterCommandBase.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            if (__aspxRichEdit.Utils.isNumber(parameter))
                return parameter;
            var subDocument = this.control.model.activeSubDocument;
            var cursorPos = __aspxRichEdit.LayoutPositionMainSubDocumentCreator.ensureLayoutPosition(this.control, this.control.layout, subDocument, this.control.selection.getLastSelectedInterval().start, __aspxRichEdit.DocumentLayoutDetailsLevel.Page, new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(this.control.selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
            return cursorPos.pageIndex;
        };
        InsertHeaderFooterCommandBase.prototype.executeCore = function (_state, options) {
            return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToHeaderFooterByPageIndex).execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.ChangeActiveSubDocumentToHeaderFooterByPageIndexCommandParameters(this.control, options.param, this.isHeader()));
        };
        return InsertHeaderFooterCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.InsertHeaderFooterCommandBase = InsertHeaderFooterCommandBase;
    var InsertHeaderCommand = (function (_super) {
        __extends(InsertHeaderCommand, _super);
        function InsertHeaderCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertHeaderCommand.prototype.isHeader = function () {
            return true;
        };
        return InsertHeaderCommand;
    }(InsertHeaderFooterCommandBase));
    __aspxRichEdit.InsertHeaderCommand = InsertHeaderCommand;
    var InsertFooterCommand = (function (_super) {
        __extends(InsertFooterCommand, _super);
        function InsertFooterCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertFooterCommand.prototype.isHeader = function () {
            return false;
        };
        return InsertFooterCommand;
    }(InsertHeaderFooterCommandBase));
    __aspxRichEdit.InsertFooterCommand = InsertFooterCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LinkHeaderFooterToPreviousCommand = (function (_super) {
        __extends(LinkHeaderFooterToPreviousCommand, _super);
        function LinkHeaderFooterToPreviousCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LinkHeaderFooterToPreviousCommand.prototype.isEnabled = function () {
            var page = this.control.layoutFormatterManager.forceFormatPage(this.control.selection.pageIndex);
            return _super.prototype.isEnabled.call(this) && page &&
                __aspxRichEdit.Section.getPageSectionIndex(page, this.control.model.sections) > 0;
        };
        LinkHeaderFooterToPreviousCommand.prototype.getValue = function () {
            if (!this.isEnabled())
                return null;
            this.isHeader = this.control.model.activeSubDocument.isHeader();
            var pageIndex = this.control.selection.pageIndex;
            var layoutPage = this.control.layoutFormatterManager.forceFormatPage(pageIndex);
            var sections = this.control.model.sections;
            var sectionIndex = __aspxRichEdit.Section.getPageSectionIndex(layoutPage, sections);
            var headerFooterType = __aspxRichEdit.SectionHeadersFooters.getActualObjectType(sections[sectionIndex], layoutPage.flags.get(__aspxRichEdit.LayoutPageFlags.IsFirstPageOfSection), __aspxRichEdit.Utils.isEven(layoutPage.layoutPageIndex));
            return __aspxRichEdit.HeaderFooterCommandBase.getSectionHeadersFooters(this.isHeader, sections[sectionIndex]).isLinkedToPrevious(headerFooterType);
        };
        LinkHeaderFooterToPreviousCommand.prototype.executeCore = function (state, _options) {
            var layoutPage = this.control.layoutFormatterManager.forceFormatPage(this.control.selection.pageIndex);
            var sectionIndex = __aspxRichEdit.Section.getPageSectionIndex(layoutPage, this.control.model.sections);
            var type = this.control.model.activeSubDocument.info.headerFooterType;
            this.control.history.beginTransaction();
            if (state.value)
                this.unlinkFromPrevious(sectionIndex, type);
            else
                this.linkToPrevious(sectionIndex, type);
            this.control.history.endTransaction();
            return true;
        };
        LinkHeaderFooterToPreviousCommand.prototype.linkToPrevious = function (sectionIndex, type) {
            var _this = this;
            var section = this.control.model.sections[sectionIndex];
            this.performLinkSectionToPrevious(sectionIndex, type, function (previousSectionIndex) {
                var previousSection = section.documentModel.sections[previousSectionIndex];
                var prevObjectIndex = __aspxRichEdit.HeaderFooterCommandBase.getSectionHeadersFooters(_this.isHeader, previousSection).getObjectIndex(type);
                if (prevObjectIndex === -1) {
                    prevObjectIndex = __aspxRichEdit.HeaderFooterCommandBase.getManipulator(_this.isHeader, _this.control).createObject(type);
                    _this.control.history.addAndRedo(_this.createChangeObjectIndexHistoryItem(previousSectionIndex, type, prevObjectIndex));
                }
                _this.control.history.addAndRedo(_this.createChangeObjectIndexHistoryItem(sectionIndex, type, prevObjectIndex));
                if (!_this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToHeaderFooterByPageIndex)
                    .execute(_this.control.commandManager.isPublicApiCall, new __aspxRichEdit.ChangeActiveSubDocumentToHeaderFooterByPageIndexCommandParameters(_this.control, _this.control.selection.pageIndex, _this.isHeader)))
                    _this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToHeaderFooterBySubDocument)
                        .execute(_this.control.commandManager.isPublicApiCall, __aspxRichEdit.HeaderFooterCommandBase.getObjectsCache(_this.isHeader, _this.control)[prevObjectIndex].getSubDocument(_this.control.model));
            });
        };
        LinkHeaderFooterToPreviousCommand.prototype.unlinkFromPrevious = function (sectionIndex, type) {
            var _this = this;
            var section = this.control.model.sections[sectionIndex];
            this.performLinkSectionToPrevious(sectionIndex, type, function (previousSectionIndex) {
                var previousSection = section.documentModel.sections[previousSectionIndex];
                var previousObject = __aspxRichEdit.HeaderFooterCommandBase.getSectionHeadersFooters(_this.isHeader, previousSection).getObject(type);
                var endPosition = previousObject.getEndPosition(section.documentModel);
                var previousObjectCopyInfo = endPosition > 1 ?
                    __aspxRichEdit.ModelManipulator.createRangeCopy(previousObject.getSubDocument(section.documentModel), [new __aspxRichEdit.FixedInterval(0, endPosition - 1)]) : null;
                var newObjectIndex = __aspxRichEdit.HeaderFooterCommandBase.getManipulator(_this.isHeader, _this.control).createObject(type);
                var newObject = __aspxRichEdit.HeaderFooterCommandBase.getObjectsCache(_this.isHeader, _this.control)[newObjectIndex];
                var newObjectSubDocument = newObject.getSubDocument(_this.control.model);
                _this.control.history.addAndRedo(_this.createChangeObjectIndexHistoryItem(sectionIndex, type, newObjectIndex));
                if (previousObjectCopyInfo)
                    __aspxRichEdit.ModelManipulator.pasteRangeCopy(_this.control, newObjectSubDocument, __aspxRichEdit.FixedInterval.fromPositions(0, newObjectSubDocument.getDocumentEndPosition()), previousObjectCopyInfo);
                if (!_this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToHeaderFooterByPageIndex).execute(_this.control.commandManager.isPublicApiCall, new __aspxRichEdit.ChangeActiveSubDocumentToHeaderFooterByPageIndexCommandParameters(_this.control, _this.control.selection.pageIndex, _this.isHeader)))
                    _this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToHeaderFooterBySubDocument).execute(_this.control.commandManager.isPublicApiCall, newObject.getSubDocument(_this.control.model));
            });
        };
        LinkHeaderFooterToPreviousCommand.prototype.performLinkSectionToPrevious = function (sectionIndex, type, linkAction) {
            var nextSection = this.control.model.sections[sectionIndex + 1];
            var section = this.control.model.sections[sectionIndex];
            var shouldRelinkNextSection = nextSection && this.areSectionsLinked(section, nextSection, type);
            linkAction(sectionIndex - 1);
            if (shouldRelinkNextSection)
                this.linkToPrevious(sectionIndex + 1, type);
        };
        LinkHeaderFooterToPreviousCommand.prototype.areSectionsLinked = function (section1, section2, type) {
            return __aspxRichEdit.HeaderFooterCommandBase.getSectionHeadersFooters(this.isHeader, section2).getObject(type) ===
                __aspxRichEdit.HeaderFooterCommandBase.getSectionHeadersFooters(this.isHeader, section1).getObject(type);
        };
        LinkHeaderFooterToPreviousCommand.prototype.createChangeObjectIndexHistoryItem = function (sectionIndex, type, newIndex) {
            return new (this.isHeader ? __aspxRichEdit.ChangeHeaderIndexHistoryItem : __aspxRichEdit.ChangeFooterIndexHistoryItem)(this.control.modelManipulator, sectionIndex, type, newIndex, this.control.commandManager);
        };
        return LinkHeaderFooterToPreviousCommand;
    }(__aspxRichEdit.HeaderFooterCommandBase));
    __aspxRichEdit.LinkHeaderFooterToPreviousCommand = LinkHeaderFooterToPreviousCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ApplyStyleCommand = (function (_super) {
        __extends(ApplyStyleCommand, _super);
        function ApplyStyleCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ApplyStyleCommand.prototype.getState = function () {
            var interval = this.control.selection.getLastSelectedInterval().clone();
            var commonParagraphStyle;
            var commonCharacterStyle;
            if (interval.length === 0)
                commonCharacterStyle = this.control.inputPosition.getCharacterStyle();
            if (!commonCharacterStyle || commonCharacterStyle.isDefault) {
                var runs = this.control.model.activeSubDocument.getRunsByInterval(interval);
                var commonParagraphStyle = runs[0].paragraph.paragraphStyle;
                var commonCharacterStyle = runs[0].characterStyle;
                for (var i = 1, run; run = runs[i]; i++) {
                    if (commonCharacterStyle && run.characterStyle !== commonCharacterStyle)
                        commonCharacterStyle = null;
                    if (commonParagraphStyle && run.paragraph.paragraphStyle !== commonParagraphStyle)
                        commonParagraphStyle = null;
                    if (!commonParagraphStyle && !commonCharacterStyle)
                        break;
                }
            }
            var styleNameWithPrefix = "";
            if (commonCharacterStyle && commonCharacterStyle.linkedStyle)
                styleNameWithPrefix = __aspxRichEdit.StylesManager.paragraphPrefix + commonCharacterStyle.linkedStyle.styleName;
            else if (commonCharacterStyle && !commonCharacterStyle.isDefault)
                styleNameWithPrefix = __aspxRichEdit.StylesManager.characterPrefix + commonCharacterStyle.styleName;
            else if (commonParagraphStyle && !commonParagraphStyle.isDefault)
                styleNameWithPrefix = __aspxRichEdit.StylesManager.paragraphPrefix + commonParagraphStyle.styleName;
            else
                styleNameWithPrefix = __aspxRichEdit.StylesManager.paragraphPrefix + this.control.model.getDefaultParagraphStyle().styleName;
            var state = new __aspxRichEdit.IntervalCommandState(this.isEnabled(), interval, styleNameWithPrefix);
            var items = [[], []];
            for (var _i = 0, _a = this.control.model.paragraphStyles; _i < _a.length; _i++) {
                var ps = _a[_i];
                if (!ps.deleted && !ps.hidden && !ps.semihidden)
                    items[0].push({ value: __aspxRichEdit.StylesManager.paragraphPrefix + ps.styleName, text: ps.localizedName, data: ps.base64EncodedImage });
            }
            for (var _b = 0, _c = this.control.model.characterStyles; _b < _c.length; _b++) {
                var cs = _c[_b];
                if (!cs.deleted && !cs.hidden && !cs.semihidden && !cs.linkedStyle)
                    items[1].push({ value: __aspxRichEdit.StylesManager.characterPrefix + cs.styleName, text: cs.localizedName, data: cs.base64EncodedImage });
            }
            for (var i_2 = 0, ps = void 0; ps = __aspxRichEdit.StylesManager.presetParagraphStyles[i_2]; i_2++) {
                if (!ps.deleted && !ps.hidden && !ps.semihidden && !this.control.model.getParagraphStyleByName(ps.styleName))
                    items[0].push({ value: __aspxRichEdit.StylesManager.paragraphPrefix + ps.styleName, text: ps.localizedName, data: ps.base64EncodedImage });
            }
            for (var i_3 = 0, cs = void 0; cs = __aspxRichEdit.StylesManager.presetCharacterStyles[i_3]; i_3++) {
                if (!cs.deleted && !cs.hidden && !cs.semihidden && !cs.linkedStyle && !this.control.model.getCharacterStyleByName(cs.styleName))
                    items[1].push({ value: __aspxRichEdit.StylesManager.characterPrefix + cs.styleName, text: cs.localizedName, data: cs.base64EncodedImage });
            }
            state.items = items;
            return state;
        };
        ApplyStyleCommand.prototype.executeCore = function (state, options) {
            var parameter = options.param;
            var prefix = parameter.substr(0, 3);
            var styleName = parameter.substr(3);
            var interval = state.interval.clone();
            var executed = true;
            var isPresetStyle = false;
            this.control.history.beginTransaction();
            switch (prefix) {
                case __aspxRichEdit.StylesManager.characterPrefix:
                    if (interval.length == 0)
                        interval = options.subDocument.getWholeWordInterval(interval.start);
                    var characterStyle = this.control.model.getCharacterStyleByName(styleName);
                    if (!characterStyle) {
                        characterStyle = __aspxRichEdit.StylesManager.getPresetCharacterStyleByName(styleName).clone();
                        isPresetStyle = characterStyle != null;
                    }
                    if (interval.length == 0) {
                        if (isPresetStyle) {
                            var fontInfo = characterStyle.maskedCharacterProperties.fontInfo;
                            if (fontInfo && fontInfo.index === undefined)
                                characterStyle.maskedCharacterProperties.fontInfo = this.control.model.cache.fontInfoCache.getItemByName(fontInfo.name);
                        }
                        this.control.inputPosition.setCharacterStyle(characterStyle);
                        executed = false;
                    }
                    else
                        this.applyCharacterStyle(interval, characterStyle, isPresetStyle, options.subDocument);
                    break;
                case __aspxRichEdit.StylesManager.paragraphPrefix:
                    var paragraphStyle = this.control.model.getParagraphStyleByName(styleName);
                    if (!paragraphStyle) {
                        paragraphStyle = __aspxRichEdit.StylesManager.getPresetParagraphStyleByName(styleName).clone();
                        isPresetStyle = paragraphStyle != null;
                    }
                    this.applyParagraphStyle(interval, paragraphStyle, isPresetStyle, options.subDocument);
                    break;
                default:
                    throw new Error("Parameter must have next structure: (PS/CS)-StyleName");
            }
            this.control.history.endTransaction();
            return executed;
        };
        ApplyStyleCommand.prototype.applyCharacterStyle = function (interval, style, isPresetStyle, subDocument) {
            if (__aspxRichEdit.ControlOptions.isEnabled(this.control.options.characterStyle)) {
                __aspxRichEdit.StylesManipulator.applyCharacterStyle(this.control.history, this.control.modelManipulator, subDocument, interval, isPresetStyle ? this.control.model.stylesManager.addCharacterStyle(style) : style, false);
            }
        };
        ApplyStyleCommand.prototype.applyParagraphStyle = function (interval, style, isPresetStyle, subDocument) {
            var count = this.calculateAffectedParagraphCount(interval, subDocument);
            if (count > 0 && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.paragraphStyle)) {
                var paragraphIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(subDocument.paragraphs, function (p) { return p.startLogPosition.value; }, interval.start);
                for (var i = 0; i < count; i++) {
                    var paragraph = subDocument.paragraphs[paragraphIndex + i];
                    var paragraphInterval = new __aspxRichEdit.FixedInterval(paragraph.startLogPosition.value, paragraph.length);
                    var modelManipulator = this.control.modelManipulator;
                    this.control.history.addAndRedo(new __aspxRichEdit.ApplyParagraphStyleHistoryItem(modelManipulator, subDocument, paragraphInterval, isPresetStyle ? modelManipulator.model.stylesManager.addParagraphStyle(style) : style));
                    this.control.history.addAndRedo(new __aspxRichEdit.ParagraphUseValueHistoryItem(modelManipulator, subDocument, paragraphInterval, 0));
                    this.control.history.addAndRedo(new __aspxRichEdit.FontUseValueHistoryItem(modelManipulator, subDocument, paragraphInterval, 0));
                }
            }
            else
                this.applyParagraphLinkedStyle(interval, style, isPresetStyle, subDocument);
        };
        ApplyStyleCommand.prototype.applyParagraphLinkedStyle = function (interval, style, isPresetStyle, subDocument) {
            if (__aspxRichEdit.ControlOptions.isEnabled(this.control.options.characterStyle)) {
                if (!style.linkedStyle)
                    this.createCharacterStyle(style);
                this.applyCharacterStyle(interval, style.linkedStyle, isPresetStyle, subDocument);
            }
        };
        ApplyStyleCommand.prototype.createCharacterStyle = function (paragraphStyle) {
            var style = new __aspxRichEdit.CharacterStyle(paragraphStyle.styleName + " Char", paragraphStyle.localizedName + " Char", false, false, false, false, paragraphStyle.maskedCharacterProperties);
            this.control.history.addAndRedo(new __aspxRichEdit.CreateStyleLinkHistoryItem(this.control.modelManipulator, this.control.modelManipulator.model.activeSubDocument, style, paragraphStyle));
        };
        ApplyStyleCommand.prototype.calculateAffectedParagraphCount = function (interval, subDocument) {
            var paragraphs = subDocument.getParagraphsByInterval(interval);
            if (paragraphs.length > 1)
                return paragraphs.length;
            var paragraph = paragraphs[0];
            var lastParagraphCharSelected = interval.length >= paragraph.length - 1;
            if (interval.start === paragraph.startLogPosition.value && lastParagraphCharSelected || interval.length === 0)
                return 1;
            return 0;
        };
        ApplyStyleCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && (__aspxRichEdit.ControlOptions.isEnabled(this.control.options.characterStyle) || __aspxRichEdit.ControlOptions.isEnabled(this.control.options.paragraphStyle));
        };
        ApplyStyleCommand.prototype.getIntervalsForModifying = function () {
            return __aspxRichEdit.RichUtils.getIntervalsOfSelectedParagraphs(this.control.selection.intervals, this.control.model.activeSubDocument);
        };
        return ApplyStyleCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ApplyStyleCommand = ApplyStyleCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ClearFormattingCommand = (function (_super) {
        __extends(ClearFormattingCommand, _super);
        function ClearFormattingCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ClearFormattingCommand.prototype.getActualIntervals = function () {
            if (this.control.selection.isCollapsed())
                return [this.control.model.activeSubDocument.getWholeWordInterval(this.control.selection.intervals[0].start)];
            return this.control.selection.getIntervalsClone();
        };
        ClearFormattingCommand.prototype.getState = function () {
            return new __aspxRichEdit.IntervalCommandStateEx(this.isEnabled(), this.getActualIntervals());
        };
        ClearFormattingCommand.prototype.DEPRECATEDCorrectlMainCommandOptions = function (options) {
            options.intervals = this.getActualIntervals();
        };
        ClearFormattingCommand.prototype.executeCore = function (_state, options) {
            var modelManipulator = this.control.modelManipulator;
            var model = modelManipulator.model;
            var subDocument = options.subDocument;
            this.control.history.beginTransaction();
            var defaultCharProperties = model.defaultCharacterProperties;
            if (options.intervals.length > 0) {
                for (var i = 0, interval = void 0; interval = options.intervals[i]; i++) {
                    if (interval.length > 0) {
                        this.control.history.addAndRedo(new __aspxRichEdit.ApplyCharacterStyleHistoryItem(modelManipulator, subDocument, interval, model.getDefaultCharacterStyle(), true));
                        this.control.history.addAndRedo(new __aspxRichEdit.FontBoldHistoryItem(modelManipulator, subDocument, interval, defaultCharProperties.fontBold, false));
                        this.control.history.addAndRedo(new __aspxRichEdit.FontCapsHistoryItem(modelManipulator, subDocument, interval, defaultCharProperties.allCaps, false));
                        this.control.history.addAndRedo(new __aspxRichEdit.FontUnderlineTypeHistoryItem(modelManipulator, subDocument, interval, defaultCharProperties.fontUnderlineType, false));
                        this.control.history.addAndRedo(new __aspxRichEdit.FontTextColorHistoryItem(modelManipulator, subDocument, interval, defaultCharProperties.textColor, false));
                        this.control.history.addAndRedo(new __aspxRichEdit.FontHighlightColorHistoryItem(modelManipulator, subDocument, interval, defaultCharProperties.highlightColor, false));
                        this.control.history.addAndRedo(new __aspxRichEdit.FontHiddenHistoryItem(modelManipulator, subDocument, interval, defaultCharProperties.hidden, false));
                        this.control.history.addAndRedo(new __aspxRichEdit.FontItalicHistoryItem(modelManipulator, subDocument, interval, defaultCharProperties.fontItalic, false));
                        this.control.history.addAndRedo(new __aspxRichEdit.FontNameHistoryItem(modelManipulator, subDocument, interval, defaultCharProperties.fontInfo, false));
                        this.control.history.addAndRedo(new __aspxRichEdit.FontScriptHistoryItem(modelManipulator, subDocument, interval, defaultCharProperties.script, false));
                        this.control.history.addAndRedo(new __aspxRichEdit.FontSizeHistoryItem(modelManipulator, subDocument, interval, defaultCharProperties.fontSize, false));
                        this.control.history.addAndRedo(new __aspxRichEdit.FontStrikeoutTypeHistoryItem(modelManipulator, subDocument, interval, defaultCharProperties.fontStrikeoutType, false));
                        this.control.history.addAndRedo(new __aspxRichEdit.FontUnderlineColorHistoryItem(modelManipulator, subDocument, interval, defaultCharProperties.underlineColor, false));
                        this.control.history.addAndRedo(new __aspxRichEdit.FontUnderlineWordsOnlyHistoryItem(modelManipulator, subDocument, interval, defaultCharProperties.underlineWordsOnly, false));
                        this.control.history.addAndRedo(new __aspxRichEdit.FontStrikeoutWordsOnlyHistoryItem(modelManipulator, subDocument, interval, defaultCharProperties.strikeoutWordsOnly, false));
                        this.control.history.addAndRedo(new __aspxRichEdit.FontStrikeoutColorHistoryItem(modelManipulator, subDocument, interval, defaultCharProperties.strikeoutColor, false));
                        this.control.history.addAndRedo(new __aspxRichEdit.FontNoProofHistoryItem(modelManipulator, subDocument, interval, defaultCharProperties.noProof, false));
                    }
                }
            }
            var paragraphIndices = model.activeSubDocument.getParagraphIndicesByIntervals(options.intervals);
            for (var i = paragraphIndices.length - 1; i >= 0; i--) {
                var paragraph = subDocument.paragraphs[paragraphIndices[i]];
                var interval = paragraph.interval;
                paragraph.onParagraphPropertiesChanged();
                this.control.history.addAndRedo(new __aspxRichEdit.ApplyParagraphStyleHistoryItem(modelManipulator, subDocument, interval, model.getDefaultParagraphStyle()));
                var defaultParProperties = model.defaultParagraphProperties;
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphAlignmentHistoryItem(modelManipulator, subDocument, interval, defaultParProperties.alignment, false));
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphContextualSpacingHistoryItem(modelManipulator, subDocument, interval, defaultParProperties.contextualSpacing, false));
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphAfterAutoSpacingHistoryItem(modelManipulator, subDocument, interval, defaultParProperties.afterAutoSpacing, false));
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphShadingInfoIndexHistoryItem(modelManipulator, subDocument, interval, defaultParProperties.shadingInfo, false));
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphBeforeAutoSpacingHistoryItem(modelManipulator, subDocument, interval, defaultParProperties.beforeAutoSpacing, false));
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentHistoryItem(modelManipulator, subDocument, interval, defaultParProperties.firstLineIndent, false));
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentTypeHistoryItem(modelManipulator, subDocument, interval, defaultParProperties.firstLineIndentType, false));
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphKeepLinesTogetherHistoryItem(modelManipulator, subDocument, interval, defaultParProperties.keepLinesTogether, false));
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphLeftIndentHistoryItem(modelManipulator, subDocument, interval, defaultParProperties.leftIndent, false));
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphLineSpacingHistoryItem(modelManipulator, subDocument, interval, defaultParProperties.lineSpacing, false));
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphLineSpacingTypeHistoryItem(modelManipulator, subDocument, interval, defaultParProperties.lineSpacingType, false));
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphOutlineLevelHistoryItem(modelManipulator, subDocument, interval, defaultParProperties.outlineLevel, false));
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphPageBreakBeforeHistoryItem(modelManipulator, subDocument, interval, defaultParProperties.pageBreakBefore, false));
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphRightIndentHistoryItem(modelManipulator, subDocument, interval, defaultParProperties.rightIndent, false));
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphSpacingAfterHistoryItem(modelManipulator, subDocument, interval, defaultParProperties.spacingAfter, false));
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphSpacingBeforeHistoryItem(modelManipulator, subDocument, interval, defaultParProperties.spacingBefore, false));
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphSuppressHyphenationHistoryItem(modelManipulator, subDocument, interval, defaultParProperties.suppressHyphenation, false));
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphSuppressLineNumbersHistoryItem(modelManipulator, subDocument, interval, defaultParProperties.suppressLineNumbers, false));
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphWidowOrphanControlHistoryItem(modelManipulator, subDocument, interval, defaultParProperties.widowOrphanControl, false));
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphDivIdHistoryItem(modelManipulator, subDocument, interval, defaultParProperties.divId, false));
            }
            this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.DeleteNumerationFromParagraphs).execute(this.control.commandManager.isPublicApiCall);
            this.control.history.endTransaction();
            return true;
        };
        ClearFormattingCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.characterFormatting);
        };
        return ClearFormattingCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ClearFormattingCommand = ClearFormattingCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeViewTypeCommand = (function (_super) {
        __extends(ChangeViewTypeCommand, _super);
        function ChangeViewTypeCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeViewTypeCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        ChangeViewTypeCommand.prototype.executeCore = function (_state, options) {
            if (this.control.innerClientProperties.viewsSettings.viewType != options.param) {
                if (this.control.model.activeSubDocument.isHeaderFooter())
                    this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToMain)
                        .execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandOptions(this.control));
                this.control.innerClientProperties.viewsSettings.viewType = options.param;
                this.control.onViewTypeChanged();
                this.control.selection.scrollManager.setScroll(new __aspxRichEdit.Scroll.State().byModelPosition
                    .setModelPosition(this.control.selection.getLastSelectedInterval().start).useStdRelativePosition().useStdOffset());
                return true;
            }
            return false;
        };
        ChangeViewTypeCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled(), this.control.innerClientProperties.viewsSettings.viewType);
        };
        ChangeViewTypeCommand.prototype.updateControlState = function (prevModifiedState) {
            this.control.viewManager.adjust(true);
            _super.prototype.updateControlState.call(this, prevModifiedState);
        };
        return ChangeViewTypeCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ChangeViewTypeCommand = ChangeViewTypeCommand;
    var SwitchToPrintLayoutViewCommand = (function (_super) {
        __extends(SwitchToPrintLayoutViewCommand, _super);
        function SwitchToPrintLayoutViewCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SwitchToPrintLayoutViewCommand.prototype.DEPRECATEDConvertOptionsParameter = function (_parameter) {
            return __aspxRichEdit.ViewType.PrintLayout;
        };
        SwitchToPrintLayoutViewCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled(), this.control.innerClientProperties.viewsSettings.isPrintLayoutView);
        };
        return SwitchToPrintLayoutViewCommand;
    }(ChangeViewTypeCommand));
    __aspxRichEdit.SwitchToPrintLayoutViewCommand = SwitchToPrintLayoutViewCommand;
    var SwitchToSimpleViewCommand = (function (_super) {
        __extends(SwitchToSimpleViewCommand, _super);
        function SwitchToSimpleViewCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SwitchToSimpleViewCommand.prototype.DEPRECATEDConvertOptionsParameter = function (_parameter) {
            return __aspxRichEdit.ViewType.Simple;
        };
        SwitchToSimpleViewCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled(), this.control.innerClientProperties.viewsSettings.isSimpleView);
        };
        return SwitchToSimpleViewCommand;
    }(ChangeViewTypeCommand));
    __aspxRichEdit.SwitchToSimpleViewCommand = SwitchToSimpleViewCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ToggleFullScreenCommand = (function (_super) {
        __extends(ToggleFullScreenCommand, _super);
        function ToggleFullScreenCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleFullScreenCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.value = this.control.owner.isInFullScreenMode;
            return state;
        };
        ToggleFullScreenCommand.prototype.executeCore = function (_state, options) {
            if (options.param == this.control.owner.isInFullScreenMode)
                return false;
            this.control.owner.toggleFullScreenMode();
            return true;
        };
        ToggleFullScreenCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.fullScreen);
        };
        ToggleFullScreenCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return ToggleFullScreenCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ToggleFullScreenCommand = ToggleFullScreenCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ToggleShowHiddenSymbolsCommand = (function (_super) {
        __extends(ToggleShowHiddenSymbolsCommand, _super);
        function ToggleShowHiddenSymbolsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleShowHiddenSymbolsCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled(), this.control.innerClientProperties.showHiddenSymbols);
        };
        ToggleShowHiddenSymbolsCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return typeof parameter === 'boolean' ? parameter : !this.control.innerClientProperties.showHiddenSymbols;
        };
        ToggleShowHiddenSymbolsCommand.prototype.executeCore = function (_state, options) {
            var newValue = options.param;
            if (newValue !== this.control.innerClientProperties.showHiddenSymbols) {
                this.control.innerClientProperties.showHiddenSymbols = newValue;
                var topInfo = this.control.viewManager.canvasManager.getScrollTopInfo();
                this.control.layoutFormatterManager.invalidator.onChangedAllLayout();
                this.control.selection.scrollManager.setScroll(new __aspxRichEdit.Scroll.State().byScrollInfo.setPageInfo(topInfo));
                return true;
            }
            return false;
        };
        ToggleShowHiddenSymbolsCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return ToggleShowHiddenSymbolsCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ToggleShowHiddenSymbolsCommand = ToggleShowHiddenSymbolsCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ToggleShowTableGridLinesCommand = (function (_super) {
        __extends(ToggleShowTableGridLinesCommand, _super);
        function ToggleShowTableGridLinesCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleShowTableGridLinesCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled(), this.control.innerClientProperties.showTableGridLines);
        };
        ToggleShowTableGridLinesCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables);
        };
        ToggleShowTableGridLinesCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return typeof parameter === 'boolean' ? parameter : !this.control.innerClientProperties.showTableGridLines;
        };
        ToggleShowTableGridLinesCommand.prototype.executeCore = function (_state, options) {
            if (options.param !== this.control.innerClientProperties.showTableGridLines) {
                this.control.innerClientProperties.showTableGridLines = options.param;
                this.control.layoutFormatterManager.invalidator.onChangedAllLayout();
                return true;
            }
            return false;
        };
        ToggleShowTableGridLinesCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return ToggleShowTableGridLinesCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ToggleShowTableGridLinesCommand = ToggleShowTableGridLinesCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeNumberingIndentCommandBase = (function (_super) {
        __extends(ChangeNumberingIndentCommandBase, _super);
        function ChangeNumberingIndentCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeNumberingIndentCommandBase.prototype.getState = function (options) {
            if (options === void 0) { options = this.convertToCommandOptions(undefined); }
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled(options));
        };
        ChangeNumberingIndentCommandBase.prototype.isEnabled = function (options) {
            return _super.prototype.isEnabled.call(this, options) && options.subDocument.getParagraphByPosition(options.intervals[0].start).isInList();
        };
        ChangeNumberingIndentCommandBase.prototype.executeCore = function (_state, options) {
            var paragraphIndices = options.subDocument.getParagraphIndicesByIntervals(this.control.selection.intervals);
            var firstParagraph = options.subDocument.paragraphs[paragraphIndices[0]];
            if (!firstParagraph.isInList())
                return false;
            this.control.history.beginTransaction();
            if (this.hasPreviousParagraphsInList(paragraphIndices[0], options.subDocument) || firstParagraph.getListLevelIndex() > 0)
                this.changeListLevelIndices(paragraphIndices, options.subDocument);
            else
                this.changeListLevelIndents(paragraphIndices, options.subDocument);
            this.control.history.endTransaction();
            return true;
        };
        ChangeNumberingIndentCommandBase.prototype.changeListLevelIndices = function (paragraphIndices, subDocument) {
            var paragraphIndicesLength = paragraphIndices.length;
            for (var i = 0; i < paragraphIndicesLength; i++) {
                var paragraphIndex = paragraphIndices[i];
                var paragraph = subDocument.paragraphs[paragraphIndex];
                var newListLevelIndex = this.getNewListLevelIndex(paragraph);
                if (newListLevelIndex !== paragraph.getListLevelIndex())
                    this.control.history.addAndRedo(new __aspxRichEdit.AddParagraphToListHistoryItem(this.control.modelManipulator, subDocument, paragraphIndex, paragraph.numberingListIndex, newListLevelIndex));
            }
        };
        ChangeNumberingIndentCommandBase.prototype.changeListLevelIndents = function (paragraphIndices, subDocument) {
            var startParagraph = subDocument.paragraphs[paragraphIndices[0]];
            var tabs = this.getTabs(paragraphIndices, subDocument);
            var abstractNumberingListIndex = startParagraph.getAbstractNumberingListIndex();
            var abstractNumberingList = startParagraph.getAbstractNumberingList();
            var firstLevelProperties = abstractNumberingList.levels[0].getParagraphMergedProperies();
            var currentLeftIndent = this.getLeftIndentPosition(firstLevelProperties.leftIndent, firstLevelProperties.firstLineIndent, firstLevelProperties.firstLineIndentType);
            var nextListLevelIndent = this.getNextListLevelIndent(currentLeftIndent, tabs);
            this.assignNewIndent(abstractNumberingListIndex, nextListLevelIndent, subDocument);
        };
        ChangeNumberingIndentCommandBase.prototype.assignNewIndent = function (abstractNumberingListIndex, nextListLevelIndent, subDocument) {
            var abstractNumberingList = this.control.model.abstractNumberingLists[abstractNumberingListIndex];
            var levels = abstractNumberingList.levels;
            var firstLevelProperties = abstractNumberingList.levels[0].getParagraphMergedProperies();
            var delta = this.calculateLeftIndentDelta(nextListLevelIndent, firstLevelProperties.leftIndent, firstLevelProperties.firstLineIndent, firstLevelProperties.firstLineIndentType);
            var levelCount = levels.length;
            for (var i = 0; i < levelCount; i++) {
                var level = levels[i];
                var levelProperties = level.getParagraphMergedProperies();
                var newLeftIndent = levelProperties.leftIndent + delta;
                if (newLeftIndent >= 0) {
                    if (levelProperties.firstLineIndentType == __aspxRichEdit.ParagraphFirstLineIndent.Hanging) {
                        var firstLineLeftIndent = newLeftIndent - levelProperties.firstLineIndent;
                        if (firstLineLeftIndent < 0)
                            newLeftIndent -= firstLineLeftIndent;
                    }
                    if (i == 0 && levelProperties.leftIndent == newLeftIndent)
                        break;
                    this.control.history.addAndRedo(new __aspxRichEdit.ListLevelParagraphLeftIndentHistoryItem(this.control.modelManipulator, subDocument, true, abstractNumberingListIndex, i, newLeftIndent, true));
                }
                else if (i == 0)
                    break;
            }
        };
        ChangeNumberingIndentCommandBase.prototype.calculateLeftIndentDelta = function (nextListLevelIndent, currentLeftIndent, firstLineIndent, firstLineIndentType) {
            return nextListLevelIndent - this.getLeftIndentPosition(currentLeftIndent, firstLineIndent, firstLineIndentType);
        };
        ChangeNumberingIndentCommandBase.prototype.hasPreviousParagraphsInList = function (paragraphIndex, subDocument) {
            var abstractNumberingListIndex = subDocument.paragraphs[paragraphIndex].getAbstractNumberingListIndex();
            for (var i = paragraphIndex - 1, prevParagraph; prevParagraph = subDocument.paragraphs[i]; i--) {
                if (prevParagraph.getAbstractNumberingListIndex() === abstractNumberingListIndex)
                    return true;
            }
            return false;
        };
        ChangeNumberingIndentCommandBase.prototype.getLeftIndentPosition = function (currentLeftIndent, firstLineIndent, firstLineIndentType) {
            return firstLineIndentType === __aspxRichEdit.ParagraphFirstLineIndent.Hanging ? (currentLeftIndent - firstLineIndent) : currentLeftIndent;
        };
        return ChangeNumberingIndentCommandBase;
    }(__aspxRichEdit.ParagraphIndentCommandBase));
    __aspxRichEdit.ChangeNumberingIndentCommandBase = ChangeNumberingIndentCommandBase;
    var IncrementNumberingIndentCommand = (function (_super) {
        __extends(IncrementNumberingIndentCommand, _super);
        function IncrementNumberingIndentCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        IncrementNumberingIndentCommand.prototype.getNextListLevelIndent = function (currentLeftIndent, tabs) {
            var nearestRightDefaultTab = this.getNearRightDefaultTab(currentLeftIndent);
            var nearestRightTab = this.getNearRightTab(currentLeftIndent, tabs);
            return (nearestRightDefaultTab < nearestRightTab || nearestRightTab == currentLeftIndent) ? nearestRightDefaultTab : nearestRightTab;
        };
        IncrementNumberingIndentCommand.prototype.getNewListLevelIndex = function (paragraph) {
            return Math.min(7, paragraph.getListLevelIndex() + 1);
        };
        return IncrementNumberingIndentCommand;
    }(ChangeNumberingIndentCommandBase));
    __aspxRichEdit.IncrementNumberingIndentCommand = IncrementNumberingIndentCommand;
    var DecrementNumberingIndentCommand = (function (_super) {
        __extends(DecrementNumberingIndentCommand, _super);
        function DecrementNumberingIndentCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DecrementNumberingIndentCommand.prototype.getNextListLevelIndent = function (currentLeftIndent, tabs) {
            var nearestLeftDefaultTab = this.getNearLeftDefaultTab(currentLeftIndent);
            var nearestLeftTab = this.getNearLeftTab(currentLeftIndent, tabs);
            return (nearestLeftDefaultTab > nearestLeftTab || nearestLeftTab == currentLeftIndent) ? nearestLeftDefaultTab : nearestLeftTab;
        };
        DecrementNumberingIndentCommand.prototype.getNewListLevelIndex = function (paragraph) {
            return Math.max(0, paragraph.getListLevelIndex() - 1);
        };
        return DecrementNumberingIndentCommand;
    }(ChangeNumberingIndentCommandBase));
    __aspxRichEdit.DecrementNumberingIndentCommand = DecrementNumberingIndentCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ContinueNumberingListCommand = (function (_super) {
        __extends(ContinueNumberingListCommand, _super);
        function ContinueNumberingListCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ContinueNumberingListCommand.prototype.getState = function (options) {
            if (options === void 0) { options = this.convertToCommandOptions(undefined); }
            var subDocument = options.subDocument;
            var state = new __aspxRichEdit.IntervalCommandStateEx(this.isEnabled(), this.control.selection.getIntervalsClone());
            state.visible = false;
            if (state.enabled) {
                var startParagraphIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(subDocument.paragraphs, function (p) { return p.startLogPosition.value; }, state.intervals[0].start);
                var paragraph = subDocument.paragraphs[startParagraphIndex];
                if (paragraph.isInList() && this.getTargetNumberingListIndex(startParagraphIndex, paragraph.getAbstractNumberingListIndex(), subDocument) >= 0)
                    state.visible = true;
                state.enabled = state.visible;
            }
            return state;
        };
        ContinueNumberingListCommand.prototype.executeCore = function (state, options) {
            var subDocument = options.subDocument;
            var startParagraphIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(options.subDocument.paragraphs, function (p) { return p.startLogPosition.value; }, state.intervals[0].start);
            var startParagraphAbstractNumberingListIndex = subDocument.paragraphs[startParagraphIndex].getAbstractNumberingListIndex();
            var targetNumberingListIndex = this.getTargetNumberingListIndex(startParagraphIndex, startParagraphAbstractNumberingListIndex, subDocument);
            this.control.history.beginTransaction();
            for (var i = startParagraphIndex, paragraph; paragraph = subDocument.paragraphs[i]; i++) {
                if (paragraph.getAbstractNumberingListIndex() === startParagraphAbstractNumberingListIndex)
                    this.control.history.addAndRedo(new __aspxRichEdit.AddParagraphToListHistoryItem(this.control.modelManipulator, subDocument, i, targetNumberingListIndex, paragraph.getListLevelIndex()));
            }
            this.control.history.endTransaction();
            return true;
        };
        ContinueNumberingListCommand.prototype.getTargetNumberingListIndex = function (startParagraphIndex, currentAbstractNumberingListIndex, subDocument) {
            for (var i = startParagraphIndex - 1, prevParagraph; prevParagraph = subDocument.paragraphs[i]; i--) {
                var prevParagraphAbstractNumberingListIndex = prevParagraph.getAbstractNumberingListIndex();
                if (prevParagraphAbstractNumberingListIndex === currentAbstractNumberingListIndex)
                    return -1;
                if (prevParagraphAbstractNumberingListIndex >= 0)
                    return prevParagraph.getNumberingListIndex();
            }
            return -1;
        };
        return ContinueNumberingListCommand;
    }(__aspxRichEdit.NumberingListCommandBase));
    __aspxRichEdit.ContinueNumberingListCommand = ContinueNumberingListCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertNumerationToParagraphsCommand = (function (_super) {
        __extends(InsertNumerationToParagraphsCommand, _super);
        function InsertNumerationToParagraphsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertNumerationToParagraphsCommand.prototype.getState = function (options) {
            if (options === void 0) { options = this.convertToCommandOptions(undefined); }
            return new __aspxRichEdit.IntervalCommandStateEx(this.isEnabled(), __aspxRichEdit.ListUtils.deepCopy(options.intervals));
        };
        InsertNumerationToParagraphsCommand.prototype.executeCore = function (_state, options) {
            var numberingList = options.param;
            this.abstractNumberingList = numberingList;
            var subDocument = options.subDocument;
            var paragraphIndices = options.subDocument.getParagraphIndicesByIntervals(options.intervals);
            this.control.history.beginTransaction();
            var paragraphsLayoutPositions = this.getParagraphsLayoutPositions(paragraphIndices, subDocument);
            var targetListIndex;
            if (numberingList instanceof __aspxRichEdit.AbstractNumberingList)
                targetListIndex = this.createNewList(numberingList, subDocument);
            else
                targetListIndex = this.control.model.numberingLists.indexOf(numberingList);
            var paragraphsLevelIndices = this.getParagraphsLevelIndices(paragraphIndices, paragraphsLayoutPositions, false, targetListIndex, -1, subDocument);
            this.insertNumberingListCore(paragraphIndices, targetListIndex, paragraphsLevelIndices, paragraphsLayoutPositions, subDocument);
            this.control.history.endTransaction();
            return true;
        };
        InsertNumerationToParagraphsCommand.prototype.getNumberingListType = function () {
            return this.abstractNumberingList.getListType();
        };
        return InsertNumerationToParagraphsCommand;
    }(__aspxRichEdit.NumberingListCommandBaseBase));
    __aspxRichEdit.InsertNumerationToParagraphsCommand = InsertNumerationToParagraphsCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DeleteNumerationFromParagraphsCommand = (function (_super) {
        __extends(DeleteNumerationFromParagraphsCommand, _super);
        function DeleteNumerationFromParagraphsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DeleteNumerationFromParagraphsCommand.prototype.getState = function (options) {
            if (options === void 0) { options = this.convertToCommandOptions(undefined); }
            return new __aspxRichEdit.IntervalCommandStateEx(this.isEnabled(), __aspxRichEdit.ListUtils.deepCopy(options.intervals));
        };
        DeleteNumerationFromParagraphsCommand.prototype.executeCore = function (_state, options) {
            var paragraphIndices = options.subDocument.getParagraphIndicesByIntervals(options.intervals);
            this.control.history.beginTransaction();
            this.deleteNumberingList(paragraphIndices, options.subDocument);
            this.control.history.endTransaction();
            return true;
        };
        DeleteNumerationFromParagraphsCommand.prototype.getNumberingListType = function () {
            return null;
        };
        return DeleteNumerationFromParagraphsCommand;
    }(__aspxRichEdit.NumberingListCommandBase));
    __aspxRichEdit.DeleteNumerationFromParagraphsCommand = DeleteNumerationFromParagraphsCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RestartNumberingListCommand = (function (_super) {
        __extends(RestartNumberingListCommand, _super);
        function RestartNumberingListCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RestartNumberingListCommand.prototype.getState = function (options) {
            if (options === void 0) { options = this.convertToCommandOptions(undefined); }
            var subDocument = options.subDocument;
            var state = new __aspxRichEdit.IntervalCommandStateEx(this.isEnabled(), __aspxRichEdit.ListUtils.deepCopy(options.intervals));
            state.visible = false;
            if (state.enabled) {
                var startParagraphIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(subDocument.paragraphs, function (p) { return p.startLogPosition.value; }, options.intervals[0].start);
                var paragraph = subDocument.paragraphs[startParagraphIndex];
                if (paragraph.isInList()) {
                    var abstractNumberingListIndex = paragraph.getAbstractNumberingListIndex();
                    for (var i = startParagraphIndex - 1, prevParagraph; prevParagraph = subDocument.paragraphs[i]; i--) {
                        if (prevParagraph.getAbstractNumberingListIndex() === abstractNumberingListIndex &&
                            prevParagraph.listLevelIndex === paragraph.listLevelIndex) {
                            state.visible = true;
                            break;
                        }
                    }
                }
                state.enabled = state.visible;
            }
            return state;
        };
        RestartNumberingListCommand.prototype.executeCore = function (_state, options) {
            var subDocument = options.subDocument;
            var startParagraphIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(subDocument.paragraphs, function (paragraph) { return paragraph.startLogPosition.value; }, options.intervals[0].start);
            this.control.history.beginTransaction();
            var firstParagraph = subDocument.paragraphs[startParagraphIndex];
            var listType = firstParagraph.getNumberingList().getListType();
            var templateIndex = this.getNumberingListTemplateIndex(listType);
            var newListIndex = this.createNewList(this.control.model.abstractNumberingListTemplates[templateIndex], subDocument);
            var startParagraphAbstractNumberingListIndex = firstParagraph.getAbstractNumberingListIndex();
            for (var i = startParagraphIndex, paragraph; paragraph = subDocument.paragraphs[i]; i++) {
                if (paragraph.getAbstractNumberingListIndex() === startParagraphAbstractNumberingListIndex)
                    this.control.history.addAndRedo(new __aspxRichEdit.AddParagraphToListHistoryItem(this.control.modelManipulator, subDocument, i, newListIndex, paragraph.getListLevelIndex()));
            }
            this.control.history.endTransaction();
            return true;
        };
        return RestartNumberingListCommand;
    }(__aspxRichEdit.NumberingListCommandBase));
    __aspxRichEdit.RestartNumberingListCommand = RestartNumberingListCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ToggleBulletedListCommand = (function (_super) {
        __extends(ToggleBulletedListCommand, _super);
        function ToggleBulletedListCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleBulletedListCommand.prototype.getNumberingListType = function () {
            return __aspxRichEdit.NumberingType.Bullet;
        };
        ToggleBulletedListCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.numberingBulleted);
        };
        return ToggleBulletedListCommand;
    }(__aspxRichEdit.ToggleNumberingListCommand));
    __aspxRichEdit.ToggleBulletedListCommand = ToggleBulletedListCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ToggleMultiLevelListCommand = (function (_super) {
        __extends(ToggleMultiLevelListCommand, _super);
        function ToggleMultiLevelListCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleMultiLevelListCommand.prototype.getNumberingListType = function () {
            return __aspxRichEdit.NumberingType.MultiLevel;
        };
        ToggleMultiLevelListCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.numberingMultiLevel);
        };
        return ToggleMultiLevelListCommand;
    }(__aspxRichEdit.NumberingListCommandBase));
    __aspxRichEdit.ToggleMultiLevelListCommand = ToggleMultiLevelListCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AddSpacingAfterParagraphCommand = (function (_super) {
        __extends(AddSpacingAfterParagraphCommand, _super);
        function AddSpacingAfterParagraphCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        AddSpacingAfterParagraphCommand.prototype.getDescriptor = function () {
            return __aspxRichEdit.ParagraphPropertyDescriptor.spacingAfter;
        };
        AddSpacingAfterParagraphCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && this.getCurrentValue() === 0;
        };
        AddSpacingAfterParagraphCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return parameter == null ? __aspxRichEdit.UnitConverter.pointsToTwips(12) : parameter;
        };
        return AddSpacingAfterParagraphCommand;
    }(__aspxRichEdit.ChangeParagraphPropertiesCommandBase));
    __aspxRichEdit.AddSpacingAfterParagraphCommand = AddSpacingAfterParagraphCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AddSpacingBeforeParagraphCommand = (function (_super) {
        __extends(AddSpacingBeforeParagraphCommand, _super);
        function AddSpacingBeforeParagraphCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        AddSpacingBeforeParagraphCommand.prototype.getDescriptor = function () {
            return __aspxRichEdit.ParagraphPropertyDescriptor.spacingBefore;
        };
        AddSpacingBeforeParagraphCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && this.getCurrentValue() === 0;
        };
        AddSpacingBeforeParagraphCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return parameter == null ? __aspxRichEdit.UnitConverter.pointsToTwips(12) : parameter;
        };
        return AddSpacingBeforeParagraphCommand;
    }(__aspxRichEdit.ChangeParagraphPropertiesCommandBase));
    __aspxRichEdit.AddSpacingBeforeParagraphCommand = AddSpacingBeforeParagraphCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeHeadingLevelCommand = (function (_super) {
        __extends(ChangeHeadingLevelCommand, _super);
        function ChangeHeadingLevelCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeHeadingLevelCommand.prototype.getDescriptor = function () {
            return __aspxRichEdit.ParagraphPropertyDescriptor.outlineLevel;
        };
        ChangeHeadingLevelCommand.prototype.isLockUpdateValue = function () {
            return true;
        };
        return ChangeHeadingLevelCommand;
    }(__aspxRichEdit.ChangeParagraphPropertiesCommandBase));
    __aspxRichEdit.ChangeHeadingLevelCommand = ChangeHeadingLevelCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeIndentCommandBase = (function (_super) {
        __extends(ChangeIndentCommandBase, _super);
        function ChangeIndentCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeIndentCommandBase.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.visible = __aspxRichEdit.ControlOptions.isVisible(this.control.options.paragraphFormatting) && !this.control.selection.specialRunInfo.isPictureSelected();
            return state;
        };
        ChangeIndentCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.paragraphFormatting);
        };
        ChangeIndentCommandBase.prototype.executeCore = function (_state, options) {
            var paragraphIndices = options.subDocument.getParagraphIndicesByIntervals(options.intervals);
            var commandId = this.shouldProcessAsNumberingParagraphs(paragraphIndices, options.subDocument) ?
                this.processNumberingIndentsCommandId() :
                this.processParagraphIndentsCommandId();
            return this.control.commandManager.getCommand(commandId).execute(this.control.commandManager.isPublicApiCall, options);
        };
        ChangeIndentCommandBase.prototype.getIntervalsForModifying = function () {
            return __aspxRichEdit.RichUtils.getIntervalsOfSelectedParagraphs(this.control.selection.intervals, this.control.model.activeSubDocument);
        };
        ChangeIndentCommandBase.prototype.shouldProcessAsNumberingParagraphs = function (paragraphIndices, subDocument) {
            var abstractNumberingListIndex = subDocument.paragraphs[paragraphIndices[0]].getAbstractNumberingListIndex();
            if (abstractNumberingListIndex < 0)
                return false;
            var paragraphIndicesLength = paragraphIndices.length;
            for (var i = 1; i < paragraphIndicesLength; i++) {
                var paragraphIndex = paragraphIndices[i];
                if (subDocument.paragraphs[paragraphIndex].getAbstractNumberingListIndex() !== abstractNumberingListIndex)
                    return false;
            }
            return true;
        };
        return ChangeIndentCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ChangeIndentCommandBase = ChangeIndentCommandBase;
    var DecrementIndentCommand = (function (_super) {
        __extends(DecrementIndentCommand, _super);
        function DecrementIndentCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DecrementIndentCommand.prototype.processParagraphIndentsCommandId = function () {
            return __aspxRichEdit.RichEditClientCommand.DecrementParagraphLeftIndent;
        };
        DecrementIndentCommand.prototype.processNumberingIndentsCommandId = function () {
            return __aspxRichEdit.RichEditClientCommand.DecrementNumberingIndent;
        };
        return DecrementIndentCommand;
    }(ChangeIndentCommandBase));
    __aspxRichEdit.DecrementIndentCommand = DecrementIndentCommand;
    var IncrementIndentCommand = (function (_super) {
        __extends(IncrementIndentCommand, _super);
        function IncrementIndentCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        IncrementIndentCommand.prototype.processParagraphIndentsCommandId = function () {
            return __aspxRichEdit.RichEditClientCommand.IncrementParagraphLeftIndent;
        };
        IncrementIndentCommand.prototype.processNumberingIndentsCommandId = function () {
            return __aspxRichEdit.RichEditClientCommand.IncrementNumberingIndent;
        };
        return IncrementIndentCommand;
    }(ChangeIndentCommandBase));
    __aspxRichEdit.IncrementIndentCommand = IncrementIndentCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeParagraphBackColorCommand = (function (_super) {
        __extends(ChangeParagraphBackColorCommand, _super);
        function ChangeParagraphBackColorCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeParagraphBackColorCommand.prototype.executeCore = function (_state, options) {
            var subDocument = options.subDocument;
            var intervals = this.control.selection.intervals;
            var isParagraphBackColorChanged = this.control.commandManager.isPublicApiCall || this.control.selection.isCollapsed() || __aspxRichEdit.ListUtils.anyOf(intervals, function (interval) {
                var paragraphs = subDocument.getParagraphsByInterval(interval);
                return paragraphs.length > 1 || interval.contains(paragraphs[0].getEndPosition() - 1);
            });
            if (isParagraphBackColorChanged)
                return _super.prototype.executeCore.call(this, _state, options);
            else {
                var fontShadingInfoCommand = new __aspxRichEdit.ChangeFontShadingInfoCommand(this.control);
                fontShadingInfoCommand.execute(this.control.commandManager.isPublicApiCall, options);
            }
        };
        ChangeParagraphBackColorCommand.prototype.getDescriptor = function () {
            return __aspxRichEdit.ParagraphPropertyDescriptor.shadingInfo;
        };
        ChangeParagraphBackColorCommand.prototype.getValueForState = function (val) {
            return val ? val.getActualColor(this.colorProvider) : undefined;
        };
        ChangeParagraphBackColorCommand.prototype.isLockUpdateValue = function () {
            return true;
        };
        ChangeParagraphBackColorCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return __aspxRichEdit.ShadingInfo.createByColor(__aspxRichEdit.ColorModelInfo.makeByColor(__aspxRichEdit.ColorHelper.anyToColor(parameter, __aspxRichEdit.ColorHelper.NO_COLOR)));
        };
        return ChangeParagraphBackColorCommand;
    }(__aspxRichEdit.ChangeParagraphPropertiesCommandBase));
    __aspxRichEdit.ChangeParagraphBackColorCommand = ChangeParagraphBackColorCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeParagraphIndentFromFirstRowCommandBase = (function (_super) {
        __extends(ChangeParagraphIndentFromFirstRowCommandBase, _super);
        function ChangeParagraphIndentFromFirstRowCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeParagraphIndentFromFirstRowCommandBase.prototype.executeCore = function (_state, options) {
            var subDocument = options.subDocument;
            var paragraphIndices = subDocument.getParagraphIndicesByIntervals(options.intervals);
            var firstParagraph = subDocument.paragraphs[paragraphIndices[0]];
            if (this.needUpdateFirstLineIndent(firstParagraph)) {
                this.control.history.beginTransaction();
                var maxFirstLineIndent = this.getMaxFirstLineIndent(firstParagraph, subDocument);
                var tabs = this.getTabs(paragraphIndices, subDocument);
                var firstLineIndent = this.getFirstLineIndent(firstParagraph, tabs);
                this.assignParagraphFirstLineIndent(firstParagraph, firstLineIndent, maxFirstLineIndent, subDocument);
                this.control.history.endTransaction();
                return true;
            }
            else
                return this.getParagraphLeftIndentCommand().execute(this.control.commandManager.isPublicApiCall);
        };
        ChangeParagraphIndentFromFirstRowCommandBase.prototype.assignParagraphFirstLineIndent = function (paragraph, firstLineIndent, maxValue, subDocument) {
            if (firstLineIndent > 0) {
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentTypeHistoryItem(this.control.modelManipulator, subDocument, paragraph.interval, __aspxRichEdit.ParagraphFirstLineIndent.Indented, true));
                var distanceToRight = maxValue - (paragraph.getParagraphMergedProperies().leftIndent + firstLineIndent);
                if (distanceToRight < 0)
                    firstLineIndent += distanceToRight;
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentHistoryItem(this.control.modelManipulator, subDocument, paragraph.interval, firstLineIndent, true));
            }
            else if (firstLineIndent < 0) {
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentTypeHistoryItem(this.control.modelManipulator, subDocument, paragraph.interval, __aspxRichEdit.ParagraphFirstLineIndent.Hanging, true));
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentHistoryItem(this.control.modelManipulator, subDocument, paragraph.interval, Math.abs(firstLineIndent), true));
            }
            else {
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentTypeHistoryItem(this.control.modelManipulator, subDocument, paragraph.interval, __aspxRichEdit.ParagraphFirstLineIndent.None, true));
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentHistoryItem(this.control.modelManipulator, subDocument, paragraph.interval, 0, true));
            }
        };
        ChangeParagraphIndentFromFirstRowCommandBase.prototype.getFirstLineIndentAbsPosition = function (paragraphProperties) {
            switch (paragraphProperties.firstLineIndentType) {
                case __aspxRichEdit.ParagraphFirstLineIndent.Indented:
                    return paragraphProperties.leftIndent + paragraphProperties.firstLineIndent;
                case __aspxRichEdit.ParagraphFirstLineIndent.Hanging:
                    return paragraphProperties.leftIndent - paragraphProperties.firstLineIndent;
                default:
                    return paragraphProperties.leftIndent;
            }
        };
        return ChangeParagraphIndentFromFirstRowCommandBase;
    }(__aspxRichEdit.ParagraphIndentCommandBase));
    __aspxRichEdit.ChangeParagraphIndentFromFirstRowCommandBase = ChangeParagraphIndentFromFirstRowCommandBase;
    var IncrementParagraphIndentFromFirstRowCommand = (function (_super) {
        __extends(IncrementParagraphIndentFromFirstRowCommand, _super);
        function IncrementParagraphIndentFromFirstRowCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        IncrementParagraphIndentFromFirstRowCommand.prototype.getParagraphLeftIndentCommand = function () {
            return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.IncrementParagraphLeftIndent);
        };
        IncrementParagraphIndentFromFirstRowCommand.prototype.getMaxFirstLineIndent = function (paragraph, subDocument) {
            var logPosition = paragraph.startLogPosition.value;
            var layoutPosition = (subDocument.isMain()
                ? new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.control.layout, subDocument, logPosition, __aspxRichEdit.DocumentLayoutDetailsLevel.Column)
                : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.layout, subDocument, logPosition, this.control.selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Column))
                .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true));
            if (layoutPosition)
                return __aspxRichEdit.UnitConverter.pixelsToTwips(layoutPosition.column.width);
            else {
                var section = this.control.model.getSectionByPosition(paragraph.startLogPosition.value);
                return __aspxRichEdit.UnitConverter.pixelsToTwips(__aspxRichEdit.LayoutFormatter.ColumnCalculator.findMinimalColumnSize(section.sectionProperties).width);
            }
        };
        IncrementParagraphIndentFromFirstRowCommand.prototype.getFirstLineIndent = function (paragraph, tabs) {
            var paragraphProperties = paragraph.getParagraphMergedProperies();
            var firstLineIndentAbsPosition = this.getFirstLineIndentAbsPosition(paragraphProperties);
            var nearestRightTab = this.getNearRightTab(firstLineIndentAbsPosition, tabs);
            var nearestDefaultTab = this.getNearRightDefaultTab(firstLineIndentAbsPosition);
            if (nearestRightTab > firstLineIndentAbsPosition)
                return Math.min(nearestRightTab, nearestDefaultTab) - paragraphProperties.leftIndent;
            return nearestDefaultTab - paragraphProperties.leftIndent;
        };
        IncrementParagraphIndentFromFirstRowCommand.prototype.needUpdateFirstLineIndent = function (paragraph) {
            var paragraphProperties = paragraph.getParagraphMergedProperies();
            var currentIndent = paragraphProperties.leftIndent;
            var rightDefaultTab = this.getNearRightDefaultTab(paragraphProperties.leftIndent + paragraphProperties.firstLineIndentType);
            switch (paragraphProperties.firstLineIndentType) {
                case __aspxRichEdit.ParagraphFirstLineIndent.Indented:
                    currentIndent += paragraphProperties.firstLineIndent;
                    break;
                case __aspxRichEdit.ParagraphFirstLineIndent.Hanging:
                    currentIndent -= paragraphProperties.firstLineIndent;
            }
            return currentIndent < rightDefaultTab;
        };
        return IncrementParagraphIndentFromFirstRowCommand;
    }(ChangeParagraphIndentFromFirstRowCommandBase));
    __aspxRichEdit.IncrementParagraphIndentFromFirstRowCommand = IncrementParagraphIndentFromFirstRowCommand;
    var DecrementParagraphIndentFromFirstRowCommand = (function (_super) {
        __extends(DecrementParagraphIndentFromFirstRowCommand, _super);
        function DecrementParagraphIndentFromFirstRowCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DecrementParagraphIndentFromFirstRowCommand.prototype.getMaxFirstLineIndent = function (_paragraph, _subDocument) {
            return Number.MAX_VALUE;
        };
        DecrementParagraphIndentFromFirstRowCommand.prototype.getFirstLineIndent = function (paragraph, tabs) {
            var paragraphProperties = paragraph.getParagraphMergedProperies();
            var firstLineIndentAbsPosition = this.getFirstLineIndentAbsPosition(paragraphProperties);
            var nearestLeftTab = this.getNearLeftTab(firstLineIndentAbsPosition, tabs);
            var nearestDefaultTab = this.getNearLeftDefaultTab(firstLineIndentAbsPosition);
            return Math.max(0, Math.max(nearestLeftTab, nearestDefaultTab) - paragraphProperties.leftIndent);
        };
        DecrementParagraphIndentFromFirstRowCommand.prototype.needUpdateFirstLineIndent = function (paragraph) {
            var paragraphProperties = paragraph.getParagraphMergedProperies();
            return paragraphProperties.firstLineIndentType === __aspxRichEdit.ParagraphFirstLineIndent.Indented;
        };
        DecrementParagraphIndentFromFirstRowCommand.prototype.getParagraphLeftIndentCommand = function () {
            return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.DecrementParagraphLeftIndent);
        };
        return DecrementParagraphIndentFromFirstRowCommand;
    }(ChangeParagraphIndentFromFirstRowCommandBase));
    __aspxRichEdit.DecrementParagraphIndentFromFirstRowCommand = DecrementParagraphIndentFromFirstRowCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeParagraphLeftIndentCommand = (function (_super) {
        __extends(ChangeParagraphLeftIndentCommand, _super);
        function ChangeParagraphLeftIndentCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeParagraphLeftIndentCommand.prototype.executeCore = function (_state, options) {
            var subDocument = options.subDocument;
            var paragraphIndices = subDocument.getParagraphIndicesByIntervals(this.control.selection.intervals);
            var result = false;
            this.control.history.beginTransaction();
            var tabs = this.getTabs(paragraphIndices, subDocument);
            var paragraphIndicesLength = paragraphIndices.length;
            for (var i = 0; i < paragraphIndicesLength; i++) {
                var paragraphIndex = paragraphIndices[i];
                result = this.applyLeftIndentToParagraph(subDocument.paragraphs[paragraphIndex], tabs) || result;
            }
            this.control.history.endTransaction();
            return result;
        };
        ChangeParagraphLeftIndentCommand.prototype.applyLeftIndentToParagraph = function (paragraph, tabs) {
            var newLeftIndent = this.getNewLeftIndent(paragraph, tabs);
            var maxLeftIndent = this.getMaxLeftIndent(paragraph);
            var parInterval = paragraph.interval;
            if (newLeftIndent === paragraph.getParagraphMergedProperies().leftIndent)
                return false;
            if (newLeftIndent >= 0) {
                if (paragraph.getParagraphMergedProperies().firstLineIndentType === __aspxRichEdit.ParagraphFirstLineIndent.Hanging) {
                    var firstLineLeftIndent = newLeftIndent - paragraph.getParagraphMergedProperies().firstLineIndent;
                    if (firstLineLeftIndent < 0)
                        newLeftIndent -= firstLineLeftIndent;
                }
            }
            var modelManipulator = this.control.modelManipulator;
            this.control.history.addAndRedo(new __aspxRichEdit.ParagraphLeftIndentHistoryItem(modelManipulator, modelManipulator.model.activeSubDocument, parInterval, newLeftIndent, true));
            if (paragraph.getParagraphMergedProperies().firstLineIndentType == __aspxRichEdit.ParagraphFirstLineIndent.Indented) {
                var distanceToRight = maxLeftIndent - (paragraph.getParagraphMergedProperies().leftIndent + paragraph.getParagraphMergedProperies().firstLineIndent);
                if (distanceToRight < 0) {
                    this.control.history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentHistoryItem(modelManipulator, modelManipulator.model.activeSubDocument, parInterval, paragraph.getParagraphMergedProperies().firstLineIndent + distanceToRight, true));
                }
            }
            return true;
        };
        return ChangeParagraphLeftIndentCommand;
    }(__aspxRichEdit.ParagraphIndentCommandBase));
    __aspxRichEdit.ChangeParagraphLeftIndentCommand = ChangeParagraphLeftIndentCommand;
    var IncrementParagraphLeftIndentCommand = (function (_super) {
        __extends(IncrementParagraphLeftIndentCommand, _super);
        function IncrementParagraphLeftIndentCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        IncrementParagraphLeftIndentCommand.prototype.getNewLeftIndent = function (paragraph, tabs) {
            var paragraphProperties = paragraph.getParagraphMergedProperies();
            var nearRightDefaultTab = this.getNearRightDefaultTab(paragraphProperties.leftIndent);
            var nearRightTab = this.getNearRightTab(paragraphProperties.leftIndent, tabs);
            var result = (nearRightDefaultTab < nearRightTab || nearRightTab === paragraphProperties.leftIndent) ? nearRightDefaultTab : nearRightTab;
            var position = this.getPosition(paragraph);
            if (!position) {
                var section = this.control.model.getSectionByPosition(paragraph.startLogPosition.value);
                var minimalColumnSize = __aspxRichEdit.LayoutFormatter.ColumnCalculator.findMinimalColumnSize(section.sectionProperties);
                return Math.min(result, __aspxRichEdit.UnitConverter.pixelsToTwips(minimalColumnSize.width));
            }
            return Math.min(result, __aspxRichEdit.UnitConverter.pixelsToTwips(position.column.width));
        };
        IncrementParagraphLeftIndentCommand.prototype.getMaxLeftIndent = function (paragraph) {
            var position = this.getPosition(paragraph);
            if (position)
                return __aspxRichEdit.UnitConverter.pixelsToTwips(position.column.width);
            else {
                var section = this.control.model.getSectionByPosition(paragraph.startLogPosition.value);
                return __aspxRichEdit.UnitConverter.pixelsToTwips(__aspxRichEdit.LayoutFormatter.ColumnCalculator.findMinimalColumnSize(section.sectionProperties).width);
            }
        };
        IncrementParagraphLeftIndentCommand.prototype.getPosition = function (paragraph) {
            var subDocument = this.control.model.activeSubDocument;
            return (subDocument.isMain() ? new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.control.layout, subDocument, paragraph.startLogPosition.value, __aspxRichEdit.DocumentLayoutDetailsLevel.Column)
                : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.layout, subDocument, paragraph.startLogPosition.value, this.control.selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Column))
                .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true));
        };
        return IncrementParagraphLeftIndentCommand;
    }(ChangeParagraphLeftIndentCommand));
    __aspxRichEdit.IncrementParagraphLeftIndentCommand = IncrementParagraphLeftIndentCommand;
    var DecrementParagraphLeftIndentCommand = (function (_super) {
        __extends(DecrementParagraphLeftIndentCommand, _super);
        function DecrementParagraphLeftIndentCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DecrementParagraphLeftIndentCommand.prototype.getNewLeftIndent = function (paragraph, tabs) {
            var paragraphProperties = paragraph.getParagraphMergedProperies();
            var nearLeftDefaultTab = this.getNearLeftDefaultTab(paragraphProperties.leftIndent);
            var nearLeftTab = this.getNearLeftTab(paragraphProperties.leftIndent, tabs);
            return (nearLeftDefaultTab > nearLeftTab || nearLeftTab == paragraphProperties.leftIndent) ? nearLeftDefaultTab : nearLeftTab;
        };
        DecrementParagraphLeftIndentCommand.prototype.getMaxLeftIndent = function (_paragraph) {
            return Number.MAX_VALUE;
        };
        return DecrementParagraphLeftIndentCommand;
    }(ChangeParagraphLeftIndentCommand));
    __aspxRichEdit.DecrementParagraphLeftIndentCommand = DecrementParagraphLeftIndentCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RemoveSpacingAfterParagraphCommand = (function (_super) {
        __extends(RemoveSpacingAfterParagraphCommand, _super);
        function RemoveSpacingAfterParagraphCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RemoveSpacingAfterParagraphCommand.prototype.getDescriptor = function () {
            return __aspxRichEdit.ParagraphPropertyDescriptor.spacingAfter;
        };
        RemoveSpacingAfterParagraphCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return parameter != null ? parameter : 0;
        };
        RemoveSpacingAfterParagraphCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && this.control.inputPosition.getMergedParagraphPropertiesFull().spacingAfter > 0;
        };
        return RemoveSpacingAfterParagraphCommand;
    }(__aspxRichEdit.ChangeParagraphPropertiesCommandBase));
    __aspxRichEdit.RemoveSpacingAfterParagraphCommand = RemoveSpacingAfterParagraphCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RemoveSpacingBeforeParagraphCommand = (function (_super) {
        __extends(RemoveSpacingBeforeParagraphCommand, _super);
        function RemoveSpacingBeforeParagraphCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RemoveSpacingBeforeParagraphCommand.prototype.getDescriptor = function () {
            return __aspxRichEdit.ParagraphPropertyDescriptor.spacingBefore;
        };
        RemoveSpacingBeforeParagraphCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return parameter != null ? parameter : 0;
        };
        RemoveSpacingBeforeParagraphCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && this.control.inputPosition.getMergedParagraphPropertiesFull().spacingBefore > 0;
        };
        return RemoveSpacingBeforeParagraphCommand;
    }(__aspxRichEdit.ChangeParagraphPropertiesCommandBase));
    __aspxRichEdit.RemoveSpacingBeforeParagraphCommand = RemoveSpacingBeforeParagraphCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SetParagraphSpacingTypeCommandBase = (function (_super) {
        __extends(SetParagraphSpacingTypeCommandBase, _super);
        function SetParagraphSpacingTypeCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetParagraphSpacingTypeCommandBase.prototype.getDescriptor = function () {
            return __aspxRichEdit.ParagraphPropertyDescriptor.lineSpacingType;
        };
        SetParagraphSpacingTypeCommandBase.prototype.getValueForState = function (val) {
            return val == this.getSpacingType();
        };
        SetParagraphSpacingTypeCommandBase.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return this.convertBooleanParameterToEnumType(parameter, this.getSpacingType(), this.getSpacingType());
        };
        return SetParagraphSpacingTypeCommandBase;
    }(__aspxRichEdit.ChangeParagraphPropertiesCommandBase));
    __aspxRichEdit.SetParagraphSpacingTypeCommandBase = SetParagraphSpacingTypeCommandBase;
    var SetSingleParagraphSpacingCommand = (function (_super) {
        __extends(SetSingleParagraphSpacingCommand, _super);
        function SetSingleParagraphSpacingCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetSingleParagraphSpacingCommand.prototype.getSpacingType = function () {
            return __aspxRichEdit.ParagraphLineSpacingType.Single;
        };
        return SetSingleParagraphSpacingCommand;
    }(SetParagraphSpacingTypeCommandBase));
    __aspxRichEdit.SetSingleParagraphSpacingCommand = SetSingleParagraphSpacingCommand;
    var SetSesquialteralParagraphSpacingCommand = (function (_super) {
        __extends(SetSesquialteralParagraphSpacingCommand, _super);
        function SetSesquialteralParagraphSpacingCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetSesquialteralParagraphSpacingCommand.prototype.getSpacingType = function () {
            return __aspxRichEdit.ParagraphLineSpacingType.Sesquialteral;
        };
        return SetSesquialteralParagraphSpacingCommand;
    }(SetParagraphSpacingTypeCommandBase));
    __aspxRichEdit.SetSesquialteralParagraphSpacingCommand = SetSesquialteralParagraphSpacingCommand;
    var SetDoubleParagraphSpacingCommand = (function (_super) {
        __extends(SetDoubleParagraphSpacingCommand, _super);
        function SetDoubleParagraphSpacingCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetDoubleParagraphSpacingCommand.prototype.getSpacingType = function () {
            return __aspxRichEdit.ParagraphLineSpacingType.Double;
        };
        return SetDoubleParagraphSpacingCommand;
    }(SetParagraphSpacingTypeCommandBase));
    __aspxRichEdit.SetDoubleParagraphSpacingCommand = SetDoubleParagraphSpacingCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ToggleParagraphAlignmentCommand = (function (_super) {
        __extends(ToggleParagraphAlignmentCommand, _super);
        function ToggleParagraphAlignmentCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleParagraphAlignmentCommand.prototype.getDescriptor = function () {
            return __aspxRichEdit.ParagraphPropertyDescriptor.alignment;
        };
        ToggleParagraphAlignmentCommand.prototype.getValueForState = function (val) {
            return val == this.getParagraphAlignment();
        };
        ToggleParagraphAlignmentCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return this.convertBooleanParameterToEnumType(parameter, this.getParagraphAlignment(), this.getOppositeAlignment());
        };
        ToggleParagraphAlignmentCommand.prototype.getOppositeAlignment = function () {
            return __aspxRichEdit.ParagraphAlignment.Left;
        };
        return ToggleParagraphAlignmentCommand;
    }(__aspxRichEdit.ChangeParagraphPropertiesCommandBase));
    __aspxRichEdit.ToggleParagraphAlignmentCommand = ToggleParagraphAlignmentCommand;
    var ToggleParagraphAlignmentLeftCommand = (function (_super) {
        __extends(ToggleParagraphAlignmentLeftCommand, _super);
        function ToggleParagraphAlignmentLeftCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleParagraphAlignmentLeftCommand.prototype.getParagraphAlignment = function () {
            return __aspxRichEdit.ParagraphAlignment.Left;
        };
        ToggleParagraphAlignmentLeftCommand.prototype.getOppositeAlignment = function () {
            return __aspxRichEdit.ParagraphAlignment.Justify;
        };
        return ToggleParagraphAlignmentLeftCommand;
    }(ToggleParagraphAlignmentCommand));
    __aspxRichEdit.ToggleParagraphAlignmentLeftCommand = ToggleParagraphAlignmentLeftCommand;
    var ToggleParagraphAlignmentCenterCommand = (function (_super) {
        __extends(ToggleParagraphAlignmentCenterCommand, _super);
        function ToggleParagraphAlignmentCenterCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleParagraphAlignmentCenterCommand.prototype.getParagraphAlignment = function () {
            return __aspxRichEdit.ParagraphAlignment.Center;
        };
        return ToggleParagraphAlignmentCenterCommand;
    }(ToggleParagraphAlignmentCommand));
    __aspxRichEdit.ToggleParagraphAlignmentCenterCommand = ToggleParagraphAlignmentCenterCommand;
    var ToggleParagraphAlignmentRightCommand = (function (_super) {
        __extends(ToggleParagraphAlignmentRightCommand, _super);
        function ToggleParagraphAlignmentRightCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleParagraphAlignmentRightCommand.prototype.getParagraphAlignment = function () {
            return __aspxRichEdit.ParagraphAlignment.Right;
        };
        return ToggleParagraphAlignmentRightCommand;
    }(ToggleParagraphAlignmentCommand));
    __aspxRichEdit.ToggleParagraphAlignmentRightCommand = ToggleParagraphAlignmentRightCommand;
    var ToggleParagraphAlignmentJustifyCommand = (function (_super) {
        __extends(ToggleParagraphAlignmentJustifyCommand, _super);
        function ToggleParagraphAlignmentJustifyCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleParagraphAlignmentJustifyCommand.prototype.getParagraphAlignment = function () {
            return __aspxRichEdit.ParagraphAlignment.Justify;
        };
        return ToggleParagraphAlignmentJustifyCommand;
    }(ToggleParagraphAlignmentCommand));
    __aspxRichEdit.ToggleParagraphAlignmentJustifyCommand = ToggleParagraphAlignmentJustifyCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GetRtfCommandOptions = (function (_super) {
        __extends(GetRtfCommandOptions, _super);
        function GetRtfCommandOptions(interval, callback, subDocument) {
            var _this = _super.call(this, null) || this;
            _this.interval = interval;
            _this.callback = callback;
            _this.setSubDocument(subDocument);
            return _this;
        }
        return GetRtfCommandOptions;
    }(__aspxRichEdit.CommandOptions));
    __aspxRichEdit.GetRtfCommandOptions = GetRtfCommandOptions;
    var GetRtfCommand = (function (_super) {
        __extends(GetRtfCommand, _super);
        function GetRtfCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GetRtfCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        GetRtfCommand.prototype.executeCore = function (_state, options) {
            var reqParams = {};
            reqParams[__aspxRichEdit.JSONGetRtfCommand.Position] = options.interval.start;
            reqParams[__aspxRichEdit.JSONGetRtfCommand.Length] = options.interval.length;
            reqParams[__aspxRichEdit.JSONGetRtfCommand.SubDocumentId] = options.subDocument.id;
            var request = new __aspxRichEdit.LoadCommandRequest(__aspxRichEdit.CommandType.GetRtf, options.subDocument.id, reqParams);
            this.control.serverDispatcher.pushRequest(request, new __aspxRichEdit.RequestParams(false, true, true));
            this.control.model.rtfCommandsOptions[request.id] = options;
            return true;
        };
        GetRtfCommand.prototype.handleResponce = function (responce) {
            var id = responce[__aspxRichEdit.JSONGetRtfCommand.Id];
            var options = this.control.model.rtfCommandsOptions[id];
            delete this.control.model.rtfCommandsOptions[id];
            options.callback(responce[__aspxRichEdit.JSONGetRtfCommand.ResultRtf]);
        };
        return GetRtfCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.GetRtfCommand = GetRtfCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertRtfCommandOptions = (function (_super) {
        __extends(InsertRtfCommandOptions, _super);
        function InsertRtfCommandOptions(rtfText, position, subDocument, callback) {
            var _this = _super.call(this, null) || this;
            _this.rtfText = rtfText;
            _this.position = position;
            _this.setSubDocument(subDocument);
            _this.callback = callback;
            return _this;
        }
        return InsertRtfCommandOptions;
    }(__aspxRichEdit.CommandOptions));
    __aspxRichEdit.InsertRtfCommandOptions = InsertRtfCommandOptions;
    var InsertRtfCommand = (function (_super) {
        __extends(InsertRtfCommand, _super);
        function InsertRtfCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertRtfCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        InsertRtfCommand.prototype.executeCore = function (_state, options) {
            var reqParams = {};
            reqParams[__aspxRichEdit.JSONInsertRtfCommand.RtfText] = options.rtfText;
            var request = new __aspxRichEdit.LoadCommandRequest(__aspxRichEdit.CommandType.InsertRtf, options.subDocument.id, reqParams);
            this.control.serverDispatcher.pushRequest(request, new __aspxRichEdit.RequestParams(false, true, true));
            this.control.model.rtfCommandsOptions[request.id] = options;
            return true;
        };
        InsertRtfCommand.prototype.handleResponce = function (response) {
            var id = response[__aspxRichEdit.JSONInsertRtfCommand.Id];
            var options = this.control.model.rtfCommandsOptions[response[__aspxRichEdit.JSONInsertRtfCommand.Id]];
            var result = response[__aspxRichEdit.JSONInsertRtfCommand.Result];
            var isRtfValid = result != null;
            delete this.control.model.rtfCommandsOptions[id];
            if (isRtfValid) {
                this.control.beginUpdate();
                __aspxRichEdit.ServerDispatcherResponseProcessor.insertDocumentModelFromServer(this.control, result, options.position, options.subDocument.id);
                this.control.endUpdate();
                this.control.barManager.updateItemsState([]);
            }
            options.callback(new __aspxRichEdit.FixedInterval(options.position, isRtfValid ? result[__aspxRichEdit.JSONUpdateFieldCommandResult.DocumentLength] : 0), isRtfValid);
        };
        return InsertRtfCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.InsertRtfCommand = InsertRtfCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RulerParagraphLeftIndentsCommandValue = (function (_super) {
        __extends(RulerParagraphLeftIndentsCommandValue, _super);
        function RulerParagraphLeftIndentsCommandValue(control, hanging, firstLine) {
            var _this = _super.call(this, control) || this;
            _this.hanging = hanging;
            _this.firstLine = firstLine;
            return _this;
        }
        return RulerParagraphLeftIndentsCommandValue;
    }(__aspxRichEdit.CommandOptions));
    __aspxRichEdit.RulerParagraphLeftIndentsCommandValue = RulerParagraphLeftIndentsCommandValue;
    var RulerParagraphLeftIndentsCommand = (function (_super) {
        __extends(RulerParagraphLeftIndentsCommand, _super);
        function RulerParagraphLeftIndentsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RulerParagraphLeftIndentsCommand.prototype.DEPRECATEDCorrectlMainCommandOptions = function (options) {
            options.subDocument = this.control.model.activeSubDocument;
            options.intervals = this.control.selection.intervals;
        };
        RulerParagraphLeftIndentsCommand.prototype.getState = function (options) {
            if (options === void 0) { options = this.convertToCommandOptions(undefined); }
            if (!options.subDocument)
                this.DEPRECATEDCorrectlMainCommandOptions(options);
            var info = __aspxRichEdit.RichUtils.getSelectedParagraphs(options.intervals, options.subDocument);
            var parProps = info.paragraphs[0].getParagraphMergedProperies();
            var leftIndent = __aspxRichEdit.UnitConverter.twipsToPixels(parProps.leftIndent);
            var fstLineIndent = __aspxRichEdit.UnitConverter.twipsToPixels(parProps.firstLineIndent);
            switch (parProps.firstLineIndentType) {
                case __aspxRichEdit.ParagraphFirstLineIndent.Indented:
                    return new __aspxRichEdit.SimpleCommandState(this.isEnabled(), new RulerParagraphLeftIndentsCommandValue(this.control, leftIndent, leftIndent + fstLineIndent));
                case __aspxRichEdit.ParagraphFirstLineIndent.None:
                    return new __aspxRichEdit.SimpleCommandState(this.isEnabled(), new RulerParagraphLeftIndentsCommandValue(this.control, leftIndent, leftIndent));
                case __aspxRichEdit.ParagraphFirstLineIndent.Hanging:
                    return new __aspxRichEdit.SimpleCommandState(this.isEnabled(), new RulerParagraphLeftIndentsCommandValue(this.control, leftIndent, leftIndent - fstLineIndent));
            }
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        RulerParagraphLeftIndentsCommand.prototype.getIntervalsForModifying = function () {
            return __aspxRichEdit.RichUtils.getIntervalsOfSelectedParagraphs(this.control.selection.intervals, this.control.model.activeSubDocument);
        };
        RulerParagraphLeftIndentsCommand.prototype.executeCore = function (_state, options) {
            var indents = options;
            var subDocument = options.subDocument;
            var hanging = __aspxRichEdit.UnitConverter.pixelsToTwips(indents.hanging);
            var fstLine = __aspxRichEdit.UnitConverter.pixelsToTwips(indents.firstLine);
            var firstLineIndent = Math.abs(hanging - fstLine);
            var firstLineIndentType = __aspxRichEdit.ParagraphFirstLineIndent.None;
            if (hanging < fstLine)
                firstLineIndentType = __aspxRichEdit.ParagraphFirstLineIndent.Indented;
            else if (hanging > fstLine)
                firstLineIndentType = __aspxRichEdit.ParagraphFirstLineIndent.Hanging;
            var modelManipulator = this.control.modelManipulator;
            this.control.history.beginTransaction();
            for (var _i = 0, _a = options.intervals; _i < _a.length; _i++) {
                var interval = _a[_i];
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentHistoryItem(modelManipulator, subDocument, interval, firstLineIndent, true));
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentTypeHistoryItem(modelManipulator, subDocument, interval, firstLineIndentType, true));
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphLeftIndentHistoryItem(modelManipulator, subDocument, interval, hanging, true));
            }
            this.control.history.endTransaction();
            return true;
        };
        return RulerParagraphLeftIndentsCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.RulerParagraphLeftIndentsCommand = RulerParagraphLeftIndentsCommand;
    var RulerParagraphRightIndentCommand = (function (_super) {
        __extends(RulerParagraphRightIndentCommand, _super);
        function RulerParagraphRightIndentCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RulerParagraphRightIndentCommand.prototype.getState = function (options) {
            if (options === void 0) { options = this.convertToCommandOptions(undefined); }
            var info = __aspxRichEdit.RichUtils.getSelectedParagraphs(options.intervals, options.subDocument);
            var parWithMaxRightIndent = info.paragraphs[0];
            for (var i = 1, paragraph; paragraph = info.paragraphs[i]; i++)
                if (paragraph.getParagraphMergedProperies().rightIndent > parWithMaxRightIndent.getParagraphMergedProperies().rightIndent)
                    parWithMaxRightIndent = paragraph;
            var rightIndent = __aspxRichEdit.UnitConverter.twipsToPixels(parWithMaxRightIndent.getParagraphMergedProperies().rightIndent);
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled(), new RulerParagraphLeftIndentsCommandValue(this.control, rightIndent, undefined));
        };
        RulerParagraphRightIndentCommand.prototype.getIntervalsForModifying = function () {
            return __aspxRichEdit.RichUtils.getIntervalsOfSelectedParagraphs(this.control.selection.intervals, this.control.model.activeSubDocument);
        };
        RulerParagraphRightIndentCommand.prototype.executeCore = function (state, options) {
            this.control.history.beginTransaction();
            for (var i = 0, interval; interval = state.value.intervals[i]; i++)
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphRightIndentHistoryItem(this.control.modelManipulator, options.subDocument, interval, __aspxRichEdit.UnitConverter.pixelsToTwips(options.param), true));
            this.control.history.endTransaction();
            return true;
        };
        return RulerParagraphRightIndentCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.RulerParagraphRightIndentCommand = RulerParagraphRightIndentCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RulerTabAction;
    (function (RulerTabAction) {
        RulerTabAction[RulerTabAction["None"] = 0] = "None";
        RulerTabAction[RulerTabAction["Insert"] = 1] = "Insert";
        RulerTabAction[RulerTabAction["Delete"] = 2] = "Delete";
    })(RulerTabAction = __aspxRichEdit.RulerTabAction || (__aspxRichEdit.RulerTabAction = {}));
    var TabRulerCommandBase = (function (_super) {
        __extends(TabRulerCommandBase, _super);
        function TabRulerCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TabRulerCommandBase.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        TabRulerCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.paragraphTabs);
        };
        TabRulerCommandBase.prototype.executeCore = function (_state, options) {
            var info = __aspxRichEdit.RichUtils.getSelectedParagraphs(options.intervals, options.subDocument);
            this.control.history.beginTransaction();
            this.executeHistoryItems(this.control.modelManipulator, options.subDocument, info.intervals[0], info.paragraphs[0], options.param);
            this.control.history.endTransaction();
            return true;
        };
        TabRulerCommandBase.prototype.findTabByPosition = function (paragraph, position) {
            var index = __aspxRichEdit.Utils.binaryIndexOf(paragraph.tabs.tabsInfo, function (a) { return a.position - position; });
            return index > -1 ? paragraph.tabs.tabsInfo[index] : null;
        };
        TabRulerCommandBase.prototype.getIntervalsForModifying = function () {
            return __aspxRichEdit.RichUtils.getIntervalsOfSelectedParagraphs(this.control.selection.intervals, this.control.model.activeSubDocument);
        };
        return TabRulerCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.TabRulerCommandBase = TabRulerCommandBase;
    var InsertTabToParagraphCommand = (function (_super) {
        __extends(InsertTabToParagraphCommand, _super);
        function InsertTabToParagraphCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertTabToParagraphCommand.prototype.executeHistoryItems = function (modelManipulator, subDocument, interval, _firstParagraph, params) {
            var tabInfo = new __aspxRichEdit.TabInfo(__aspxRichEdit.UnitConverter.pixelsToTwips(params.position), params.align, __aspxRichEdit.TabLeaderType.None, false, false);
            this.control.history.addAndRedo(new __aspxRichEdit.InsertTabToParagraphHistoryItem(modelManipulator, subDocument, interval, tabInfo));
        };
        return InsertTabToParagraphCommand;
    }(TabRulerCommandBase));
    __aspxRichEdit.InsertTabToParagraphCommand = InsertTabToParagraphCommand;
    var DeleteTabAtParagraphCommand = (function (_super) {
        __extends(DeleteTabAtParagraphCommand, _super);
        function DeleteTabAtParagraphCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DeleteTabAtParagraphCommand.prototype.executeHistoryItems = function (modelManipulator, subDocument, interval, firstParagraph, params) {
            var tabInfo = this.findTabByPosition(firstParagraph, __aspxRichEdit.UnitConverter.pixelsToTwips(params));
            this.control.history.addAndRedo(new __aspxRichEdit.DeleteTabAtParagraphHistoryItem(modelManipulator, subDocument, interval, tabInfo));
        };
        return DeleteTabAtParagraphCommand;
    }(TabRulerCommandBase));
    __aspxRichEdit.DeleteTabAtParagraphCommand = DeleteTabAtParagraphCommand;
    var MoveTabRulerInParagraphCommand = (function (_super) {
        __extends(MoveTabRulerInParagraphCommand, _super);
        function MoveTabRulerInParagraphCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        MoveTabRulerInParagraphCommand.prototype.executeHistoryItems = function (modelManipulator, subDocument, interval, firstParagraph, params) {
            var oldTabInfo = this.findTabByPosition(firstParagraph, __aspxRichEdit.UnitConverter.pixelsToTwips(params.start));
            var newTabInfo = oldTabInfo.clone();
            newTabInfo.position = __aspxRichEdit.UnitConverter.pixelsToTwips(params.end);
            this.control.history.addAndRedo(new __aspxRichEdit.DeleteTabAtParagraphHistoryItem(modelManipulator, subDocument, interval, oldTabInfo));
            this.control.history.addAndRedo(new __aspxRichEdit.InsertTabToParagraphHistoryItem(modelManipulator, subDocument, interval, newTabInfo));
        };
        return MoveTabRulerInParagraphCommand;
    }(TabRulerCommandBase));
    __aspxRichEdit.MoveTabRulerInParagraphCommand = MoveTabRulerInParagraphCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RulerSectionColumnsSettingsCommand = (function (_super) {
        __extends(RulerSectionColumnsSettingsCommand, _super);
        function RulerSectionColumnsSettingsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RulerSectionColumnsSettingsCommand.prototype.DEPRECATEDCorrectlMainCommandOptions = function (options) {
            var lastSelectedInterval = this.control.selection.getLastSelectedInterval();
            options.intervals = [new __aspxRichEdit.FixedInterval(this.control.selection.forwardDirection ? lastSelectedInterval.end : lastSelectedInterval.start, 0)];
        };
        RulerSectionColumnsSettingsCommand.prototype.getState = function (options) {
            if (options === void 0) { options = this.convertToCommandOptions(undefined); }
            var interval = options.intervals[0];
            var position = interval.start;
            var sectionIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.control.model.sections, function (s) { return s.startLogPosition.value; }, position);
            var section = this.control.model.sections[sectionIndex];
            var columnsBounds = __aspxRichEdit.LayoutFormatter.ColumnCalculator.generateSectionColumns(section.sectionProperties);
            var columns = [];
            for (var i = 0, columnBound; columnBound = columnsBounds[i]; i++) {
                columns.push(new __aspxRichEdit.SectionColumnProperties(columnBound.width, 0));
                if (i > 0) {
                    var prevBound = columnsBounds[i - 1];
                    columns[i - 1].space = columnBound.x - (prevBound.x + prevBound.width);
                }
            }
            var layoutPosition = options.subDocument.isMain() ?
                new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.control.layout, options.subDocument, position, __aspxRichEdit.DocumentLayoutDetailsLevel.Column)
                    .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true)) : null;
            return new RulerSectionColumnsSettingsState(this.isEnabled(), interval, columns, section.sectionProperties.equalWidthColumns, layoutPosition ? layoutPosition.columnIndex : 0);
        };
        RulerSectionColumnsSettingsCommand.prototype.executeCore = function (state, options) {
            var subDocument = options.subDocument;
            var rulerState = state;
            var changed = false;
            var modelManipulator = this.control.modelManipulator;
            if (rulerState.equalWidth) {
                var stateColumn = rulerState.value[0];
                if (options.param[0].space !== stateColumn.space) {
                    this.control.history.addAndRedo(new __aspxRichEdit.SectionSpaceHistoryItem(modelManipulator, subDocument, rulerState.interval, __aspxRichEdit.UnitConverter.pixelsToTwips(options.param[0].space)));
                    changed = true;
                }
            }
            else {
                var newColumnsInfo = [];
                var oldColumnsInfo = rulerState.value;
                __aspxRichEdit.ListUtils.foreach(options.param, function (p, i) {
                    changed = changed || p.width !== oldColumnsInfo[i].width || p.space !== oldColumnsInfo[i].space;
                    newColumnsInfo.push(new __aspxRichEdit.SectionColumnProperties(__aspxRichEdit.UnitConverter.pixelsToTwips(p.width), __aspxRichEdit.UnitConverter.pixelsToTwips(p.space || 0)));
                });
                if (changed)
                    this.control.history.addAndRedo(new __aspxRichEdit.SectionColumnsInfoHistoryItem(modelManipulator, subDocument, rulerState.interval, newColumnsInfo));
            }
            return changed;
        };
        return RulerSectionColumnsSettingsCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.RulerSectionColumnsSettingsCommand = RulerSectionColumnsSettingsCommand;
    var RulerSectionColumnsSettingsState = (function (_super) {
        __extends(RulerSectionColumnsSettingsState, _super);
        function RulerSectionColumnsSettingsState(enabled, interval, columns, equalWidth, activeIndex) {
            var _this = _super.call(this, enabled, interval, columns) || this;
            _this.equalWidth = equalWidth;
            _this.activeIndex = activeIndex;
            return _this;
        }
        return RulerSectionColumnsSettingsState;
    }(__aspxRichEdit.IntervalCommandState));
    __aspxRichEdit.RulerSectionColumnsSettingsState = RulerSectionColumnsSettingsState;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RulerSectionMarginCommandBase = (function (_super) {
        __extends(RulerSectionMarginCommandBase, _super);
        function RulerSectionMarginCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RulerSectionMarginCommandBase.prototype.DEPRECATEDCorrectlMainCommandOptions = function (options) {
            options.intervals = [this.control.selection.getLastSelectedInterval()];
        };
        RulerSectionMarginCommandBase.prototype.getLayoutTextBox = function () {
            var subDocId = this.control.selection.specialRunInfo.getParentSubDocument().id;
            var pos = this.control.selection.specialRunInfo.getPosition();
            var page = this.control.layout.pages[this.control.selection.pageIndex];
            return page ? page.anchoredObjectHolder.getObjectByModelPosition(this.control.layout, pos, subDocId) : null;
        };
        RulerSectionMarginCommandBase.prototype.isEnabled = function (_options) {
            return _super.prototype.isEnabled.call(this) && !this.control.model.activeSubDocument.isTextBox() &&
                (!this.control.model.isDocumentProtectionEnabled ||
                    __aspxRichEdit.SectionPropertiesCommandBase.rangePermissionIncludeFullSection(this.control, this.control.model.activeSubDocument, this.control.selection.intervals));
        };
        return RulerSectionMarginCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.RulerSectionMarginCommandBase = RulerSectionMarginCommandBase;
    var RulerSectionMarginLeftCommand = (function (_super) {
        __extends(RulerSectionMarginLeftCommand, _super);
        function RulerSectionMarginLeftCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RulerSectionMarginLeftCommand.prototype.getState = function (options) {
            if (options === void 0) { options = this.convertToCommandOptions(undefined); }
            var value = 0;
            if (options.subDocument.isTextBox()) {
                var layoutTextBox = this.getLayoutTextBox();
                if (layoutTextBox)
                    value = layoutTextBox.x + layoutTextBox.textBoxProperties.leftMargin;
            }
            else
                value = __aspxRichEdit.UnitConverter.twipsToPixels(this.control.inputPosition.getMergedSectionPropertiesRaw().marginLeft);
            return new __aspxRichEdit.IntervalCommandState(this.isEnabled(options), options.intervals[0], value);
        };
        RulerSectionMarginLeftCommand.prototype.executeCore = function (_state, options) {
            var interval = options.intervals[0];
            var value = __aspxRichEdit.UnitConverter.pixelsToTwips(options.param);
            this.control.history.addAndRedo(new __aspxRichEdit.SectionMarginLeftHistoryItem(this.control.modelManipulator, options.subDocument, interval, value));
            return true;
        };
        return RulerSectionMarginLeftCommand;
    }(RulerSectionMarginCommandBase));
    __aspxRichEdit.RulerSectionMarginLeftCommand = RulerSectionMarginLeftCommand;
    var RulerSectionMarginRightCommand = (function (_super) {
        __extends(RulerSectionMarginRightCommand, _super);
        function RulerSectionMarginRightCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RulerSectionMarginRightCommand.prototype.getState = function (options) {
            if (options === void 0) { options = this.convertToCommandOptions(undefined); }
            var value = 0;
            if (options.subDocument.isTextBox()) {
                var layoutTextBox = this.getLayoutTextBox();
                if (layoutTextBox) {
                    var pageWidth = this.control.innerClientProperties.viewsSettings.isSimpleView ?
                        Math.max(layoutTextBox.x + layoutTextBox.width + __aspxRichEdit.Ruler.MINIMUN_DISTANCE_BETWEEN_COLUMNS, this.control.innerClientProperties.viewsSettings.widthOfPage) :
                        __aspxRichEdit.UnitConverter.twipsToPixels(this.control.inputPosition.getMergedSectionPropertiesRaw().pageWidth);
                    value = pageWidth - layoutTextBox.x - layoutTextBox.width + layoutTextBox.textBoxProperties.rightMargin;
                }
            }
            else
                value = __aspxRichEdit.UnitConverter.twipsToPixels(this.control.inputPosition.getMergedSectionPropertiesRaw().marginRight);
            return new __aspxRichEdit.IntervalCommandState(this.isEnabled(options), options.intervals[0], value);
        };
        RulerSectionMarginRightCommand.prototype.executeCore = function (state, options) {
            var interval = state.interval;
            var value = __aspxRichEdit.UnitConverter.pixelsToTwips(options.param);
            this.control.history.addAndRedo(new __aspxRichEdit.SectionMarginRightHistoryItem(this.control.modelManipulator, options.subDocument, interval, value));
            return true;
        };
        return RulerSectionMarginRightCommand;
    }(RulerSectionMarginCommandBase));
    __aspxRichEdit.RulerSectionMarginRightCommand = RulerSectionMarginRightCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableColumnSeparatorStruct = (function () {
        function TableColumnSeparatorStruct() {
            this.index = 0;
            this.tableIndex = 0;
            this.minValue = -1;
            this.maxValue = -1;
            this.items = [];
        }
        Object.defineProperty(TableColumnSeparatorStruct.prototype, "currItem", {
            get: function () {
                return this.items[this.index];
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(TableColumnSeparatorStruct.prototype, "hasItems", {
            get: function () {
                return this.items.length > 0;
            },
            enumerable: true,
            configurable: true
        });
        TableColumnSeparatorStruct.prototype.createItem = function (position, marginLeft, marginRight) {
            this.items.push(new TableColumnSeparatorItem(position, marginLeft, marginRight));
        };
        return TableColumnSeparatorStruct;
    }());
    __aspxRichEdit.TableColumnSeparatorStruct = TableColumnSeparatorStruct;
    var TableColumnSeparatorItem = (function () {
        function TableColumnSeparatorItem(position, leftMargin, rightMargin) {
            this.leftMargin = 0;
            this.rightMargin = 0;
            this.position = position;
            this.leftMargin = leftMargin;
            this.rightMargin = rightMargin;
        }
        return TableColumnSeparatorItem;
    }());
    __aspxRichEdit.TableColumnSeparatorItem = TableColumnSeparatorItem;
    var RulerTableColumnSeparatorsCommand = (function (_super) {
        __extends(RulerTableColumnSeparatorsCommand, _super);
        function RulerTableColumnSeparatorsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RulerTableColumnSeparatorsCommand.prototype.DEPRECATEDCorrectlMainCommandOptions = function (options) {
            options.intervals = [this.control.selection.getLastSelectedInterval()];
        };
        RulerTableColumnSeparatorsCommand.prototype.getState = function (options) {
            if (options === void 0) { options = this.convertToCommandOptions(undefined); }
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled(), this.getColumnSeparatorsInfo(options.intervals[0].start, options.subDocument));
        };
        RulerTableColumnSeparatorsCommand.prototype.executeCore = function (_state, _parameter) {
            return true;
        };
        RulerTableColumnSeparatorsCommand.prototype.getLogicCell = function (grid, rowIndex, cellIndex) {
            return grid.table.rows[rowIndex].cells[grid.tableCellGridInfos[rowIndex][cellIndex].getCellIndex(0)];
        };
        RulerTableColumnSeparatorsCommand.prototype.getMergedCell = function (layoutGrids, gridCell, startRowIndex) {
            var currLayoutGrid = layoutGrids[0];
            if (layoutGrids.length > 1) {
                for (var table = void 0, i = 0; table = layoutGrids[i]; i++) {
                    if (table.tableRows[startRowIndex]) {
                        currLayoutGrid = table;
                        break;
                    }
                    startRowIndex = startRowIndex - table.tableRows.length;
                }
            }
            return this.findLayoutCellByCellGridIndex(currLayoutGrid.tableRows[startRowIndex].rowCells, gridCell.getGridCellIndex());
        };
        RulerTableColumnSeparatorsCommand.prototype.getColumnSeparatorsInfo = function (position, subDocument) {
            var struct = new TableColumnSeparatorStruct();
            if (this.control.selection.tableInfo.extendedData.numRows) {
                var layoutPosition = (subDocument.isMain()
                    ? new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.control.layout, subDocument, position, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                    : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.layout, subDocument, position, this.control.selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character))
                    .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
                if (layoutPosition) {
                    var iterator = new __aspxRichEdit.TableCellIterator(layoutPosition, this.control.layout, this.control.measurer);
                    var layoutCell = iterator.tableCellInfo;
                    if (layoutCell) {
                        var layoutGrids = iterator.getLayoutTablesAssociatedWithLogicGrid();
                        var currLayoutGrid = layoutCell.parentRow.parentTable;
                        var currLogicGrid = currLayoutGrid.logicInfo.grid;
                        var logicGridRowIndex = layoutCell.parentRow.rowIndex;
                        var gridCells = currLogicGrid.tableCellInfos[logicGridRowIndex];
                        var isCreatedLastItem = false;
                        for (var gridCell = void 0, i = 0; gridCell = gridCells[i]; i++) {
                            var startRowIndex = gridCell.getStartRowIndex();
                            if (startRowIndex != logicGridRowIndex) {
                                var mergedCell = this.getMergedCell(layoutGrids, gridCell, startRowIndex);
                                if (mergedCell) {
                                    var logicCell = this.getLogicCell(currLogicGrid, startRowIndex, mergedCell.cellGridIndex);
                                    var xPos = mergedCell.x;
                                    if (i == gridCells.length - 1) {
                                        isCreatedLastItem = true;
                                        struct.createItem(xPos + mergedCell.width, 0, 0);
                                    }
                                    struct.createItem(xPos, this.getMarginLeft(logicCell), this.getMarginRight(logicCell));
                                }
                            }
                        }
                        for (var i = 0, cell = void 0; cell = layoutCell.parentRow.rowCells[i]; i++) {
                            var logicCell = this.getLogicCell(currLogicGrid, logicGridRowIndex, cell.cellGridIndex);
                            struct.createItem(cell.x, this.getMarginLeft(logicCell), this.getMarginRight(logicCell));
                        }
                        if (!isCreatedLastItem) {
                            var lastLayoutCelll = __aspxRichEdit.ListUtils.last(layoutCell.parentRow.rowCells);
                            struct.createItem(lastLayoutCelll.getRightBoundPosition(), 0, 0);
                        }
                        struct.tableIndex = currLogicGrid.table.index;
                        struct.items = struct.items.sort(function (a, b) { return a.position - b.position; });
                        struct.index = __aspxRichEdit.Utils.normedInterpolationIndexOf(struct.items, function (item) { return item.position; }, layoutCell.x);
                        if (currLayoutGrid.parentCell) {
                            struct.minValue = currLayoutGrid.parentCell.x;
                            struct.maxValue = currLayoutGrid.parentCell.getRightBoundPosition();
                        }
                    }
                }
            }
            return struct;
        };
        RulerTableColumnSeparatorsCommand.prototype.getMarginLeft = function (cell) {
            var table = cell.parentRow.parentTable;
            var val = new __aspxRichEdit.TableCellPropertiesMergerMarginLeft(table, this.control.model, cell.parentRow.tablePropertiesException)
                .getProperty(cell.properties, table.style, cell.conditionalFormatting, this.control.model.defaultTableCellProperties);
            return __aspxRichEdit.UnitConverter.twipsToPixels(val.value);
        };
        RulerTableColumnSeparatorsCommand.prototype.getMarginRight = function (cell) {
            var table = cell.parentRow.parentTable;
            var val = new __aspxRichEdit.TableCellPropertiesMergerMarginRight(table, this.control.model, cell.parentRow.tablePropertiesException)
                .getProperty(cell.properties, table.style, cell.conditionalFormatting, this.control.model.defaultTableCellProperties);
            return __aspxRichEdit.UnitConverter.twipsToPixels(val.value);
        };
        RulerTableColumnSeparatorsCommand.prototype.findLayoutCellByCellGridIndex = function (cells, cellGridIndex) {
            return cells[__aspxRichEdit.Utils.normedInterpolationIndexOf(cells, function (c) { return c.cellGridIndex; }, cellGridIndex)];
        };
        return RulerTableColumnSeparatorsCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.RulerTableColumnSeparatorsCommand = RulerTableColumnSeparatorsCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RulerChangeTableSizeCommandParametersBase = (function () {
        function RulerChangeTableSizeCommandParametersBase(modelTableIndex, offset, layoutTable) {
            this.modelTableIndex = modelTableIndex;
            this.offset = offset;
            this.layoutTable = layoutTable;
        }
        return RulerChangeTableSizeCommandParametersBase;
    }());
    __aspxRichEdit.RulerChangeTableSizeCommandParametersBase = RulerChangeTableSizeCommandParametersBase;
    var RulerChangeTableRowHeightCommandParameters = (function (_super) {
        __extends(RulerChangeTableRowHeightCommandParameters, _super);
        function RulerChangeTableRowHeightCommandParameters(modelTableIndex, offset, layoutTable, layoutRowIndex) {
            var _this = _super.call(this, modelTableIndex, offset, layoutTable) || this;
            _this.layoutRowIndex = layoutRowIndex;
            return _this;
        }
        return RulerChangeTableRowHeightCommandParameters;
    }(RulerChangeTableSizeCommandParametersBase));
    __aspxRichEdit.RulerChangeTableRowHeightCommandParameters = RulerChangeTableRowHeightCommandParameters;
    var RulerChangeTableColumnWidthCommandParameters = (function (_super) {
        __extends(RulerChangeTableColumnWidthCommandParameters, _super);
        function RulerChangeTableColumnWidthCommandParameters(modelTableIndex, offset, layoutTable, oldBorderPosition, callFromRuler) {
            var _this = _super.call(this, modelTableIndex, offset, layoutTable) || this;
            _this.oldBorderPosition = oldBorderPosition;
            _this.callFromRuler = callFromRuler;
            return _this;
        }
        return RulerChangeTableColumnWidthCommandParameters;
    }(RulerChangeTableSizeCommandParametersBase));
    __aspxRichEdit.RulerChangeTableColumnWidthCommandParameters = RulerChangeTableColumnWidthCommandParameters;
    var RulerChangeTableSizeCommnandBase = (function (_super) {
        __extends(RulerChangeTableSizeCommnandBase, _super);
        function RulerChangeTableSizeCommnandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RulerChangeTableSizeCommnandBase.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        RulerChangeTableSizeCommnandBase.prototype.DEPRECATEDCorrectlMainCommandOptions = function (options) {
            options.intervals = [new __aspxRichEdit.FixedInterval(this.control.selection.forwardDirection ?
                    this.control.selection.getLastSelectedInterval().end :
                    this.control.selection.getLastSelectedInterval().start, 0)];
        };
        RulerChangeTableSizeCommnandBase.prototype.getLayoutTableBySelection = function (subDocument, position) {
            var selection = this.control.selection;
            var layoutPos = __aspxRichEdit.LayoutPositionCreator.createLightLayoutPosition(this.control.layout, subDocument, position, selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.TableCell, true, false);
            if (layoutPos.row.tableCellInfo)
                return layoutPos.row.tableCellInfo.parentRow.parentTable;
            return __aspxRichEdit.LayoutPositionCreator.createLightLayoutPosition(this.control.layout, subDocument, position, selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.TableCell, false, false).row.tableCellInfo.parentRow.parentTable;
        };
        RulerChangeTableSizeCommnandBase.prototype.tableIsEditable = function (modelTableIndex) {
            var table = this.control.model.activeSubDocument.tables[modelTableIndex];
            var tableInterval = __aspxRichEdit.FixedInterval.fromPositions(table.getStartPosition(), table.getEndPosition());
            return this.control.model.activeSubDocument.isEditable([tableInterval]);
        };
        return RulerChangeTableSizeCommnandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.RulerChangeTableSizeCommnandBase = RulerChangeTableSizeCommnandBase;
    var RulerChangeTableRowHeightCommand = (function (_super) {
        __extends(RulerChangeTableRowHeightCommand, _super);
        function RulerChangeTableRowHeightCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RulerChangeTableRowHeightCommand.prototype.executeCore = function (_state, options) {
            if (!this.tableIsEditable(options.param.modelTableIndex))
                return false;
            var modelManipulator = this.control.modelManipulator;
            var subDocument = options.subDocument;
            var layoutTable = options.param.layoutTable || this.getLayoutTableBySelection(subDocument, options.intervals[0].start);
            var rowIndex = layoutTable.tableRows[options.param.layoutRowIndex].rowIndex;
            var modelRow = layoutTable.logicInfo.grid.table.rows[rowIndex];
            var layoutRow = layoutTable.tableRows[options.param.layoutRowIndex];
            var height = new __aspxRichEdit.TableHeightUnit().init(__aspxRichEdit.UnitConverter.pixelsToTwips(layoutRow.height + options.param.offset), modelRow.height.type == __aspxRichEdit.TableHeightUnitType.Exact ? __aspxRichEdit.TableHeightUnitType.Exact : __aspxRichEdit.TableHeightUnitType.Minimum);
            this.control.history.addAndRedo(new __aspxRichEdit.TableRowHeightHistoryItem(modelManipulator, subDocument, options.param.modelTableIndex, rowIndex, height));
            return true;
        };
        return RulerChangeTableRowHeightCommand;
    }(RulerChangeTableSizeCommnandBase));
    __aspxRichEdit.RulerChangeTableRowHeightCommand = RulerChangeTableRowHeightCommand;
    var RulerChangeTableColumnWidthCommand = (function (_super) {
        __extends(RulerChangeTableColumnWidthCommand, _super);
        function RulerChangeTableColumnWidthCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RulerChangeTableColumnWidthCommand.prototype.executeCore = function (_state, options) {
            var parameters = options.param;
            if (!this.tableIsEditable(parameters.modelTableIndex))
                return false;
            if (parameters.oldBorderPosition + parameters.offset < 0)
                parameters.offset = -parameters.oldBorderPosition;
            var modelManipulator = this.control.modelManipulator;
            var subDocument = options.subDocument;
            var layoutTable = parameters.layoutTable || this.getLayoutTableBySelection(subDocument, options.intervals[0].start);
            var grid = layoutTable.logicInfo.grid;
            var oldPosRelativeTable = parameters.oldBorderPosition - layoutTable.x;
            var columnIndex = __aspxRichEdit.ResizeColumnTableHelper.findNearestColumnIndex(grid.columns.positions, oldPosRelativeTable);
            var newTableSizes = this.getNewTableSizes(grid, columnIndex, parameters.offset, parameters.callFromRuler);
            var history = this.control.history;
            history.beginTransaction();
            var newTableWidth = __aspxRichEdit.ListUtils.last(newTableSizes.newColumnsXPositions);
            if (!(grid.table.preferredWidth.type == __aspxRichEdit.TableWidthUnitType.ModelUnits && grid.table.preferredWidth.value == newTableWidth))
                history.addAndRedo(new __aspxRichEdit.TablePreferredWidthHistoryItem(modelManipulator, subDocument, parameters.modelTableIndex, this.toTableWidthUnit(newTableWidth)));
            if (grid.table.properties.layoutType != __aspxRichEdit.TableLayoutType.Fixed)
                history.addAndRedo(new __aspxRichEdit.TableLayoutTypeHistoryItem(modelManipulator, subDocument, parameters.modelTableIndex, __aspxRichEdit.TableLayoutType.Fixed, true));
            if (newTableSizes.tableIndentOffset != 0) {
                var oldIndent = new __aspxRichEdit.TablePropertiesMergerIndent().getProperty(grid.table.properties, grid.table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, modelManipulator.model.defaultTableProperties).value;
                history.addAndRedo(new __aspxRichEdit.TableIndentHistoryItem(modelManipulator, subDocument, parameters.modelTableIndex, this.toTableWidthUnit(__aspxRichEdit.UnitConverter.twipsToPixels(oldIndent) + newTableSizes.tableIndentOffset), true));
            }
            for (var rowIndex = 0, row = void 0; row = grid.table.rows[rowIndex]; rowIndex++) {
                for (var cellIndex = 0, cell = void 0; cell = row.cells[cellIndex]; cellIndex++) {
                    var cellStartSpan = grid.tableCellInfos[rowIndex][cellIndex].getGridCellIndex();
                    var cellEndSpan = cellStartSpan + cell.columnSpan;
                    var newCellWidthValue = newTableSizes.newColumnsXPositions[cellEndSpan] - newTableSizes.newColumnsXPositions[cellStartSpan];
                    var newCellWidth = this.toTableWidthUnit(newCellWidthValue);
                    if (!cell.preferredWidth.equals(newCellWidth))
                        history.addAndRedo(new __aspxRichEdit.TableCellPreferredWidthHistoryItem(modelManipulator, subDocument, parameters.modelTableIndex, rowIndex, cellIndex, newCellWidth));
                }
            }
            history.endTransaction();
            return true;
        };
        RulerChangeTableColumnWidthCommand.prototype.toTableWidthUnit = function (val) {
            return new __aspxRichEdit.TableWidthUnit().init(__aspxRichEdit.UnitConverter.pixelsToTwips(val), __aspxRichEdit.TableWidthUnitType.ModelUnits);
        };
        RulerChangeTableColumnWidthCommand.prototype.getNewTableSizes = function (grid, columnBoundIndex, offset, callFromRuler) {
            var newColumnsXPositions = __aspxRichEdit.ListUtils.shallowCopy(grid.columns.positions);
            if (columnBoundIndex == 0) {
                if (!callFromRuler) {
                    for (var ind = 1; ind < newColumnsXPositions.length; ind++)
                        newColumnsXPositions[ind] -= offset;
                }
                return new NewTableSizes(newColumnsXPositions, offset);
            }
            newColumnsXPositions[columnBoundIndex] += offset;
            if (callFromRuler)
                for (var ind = columnBoundIndex + 1; ind < newColumnsXPositions.length; ind++)
                    newColumnsXPositions[ind] += offset;
            return new NewTableSizes(newColumnsXPositions, 0);
        };
        return RulerChangeTableColumnWidthCommand;
    }(RulerChangeTableSizeCommnandBase));
    __aspxRichEdit.RulerChangeTableColumnWidthCommand = RulerChangeTableColumnWidthCommand;
    var NewTableSizes = (function () {
        function NewTableSizes(newColumnsXPositions, tableIndentOffset) {
            this.newColumnsXPositions = newColumnsXPositions;
            this.tableIndentOffset = tableIndentOffset;
        }
        return NewTableSizes;
    }());
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ToggleShowHorizontalRulerCommand = (function (_super) {
        __extends(ToggleShowHorizontalRulerCommand, _super);
        function ToggleShowHorizontalRulerCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleShowHorizontalRulerCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled(), this.control.horizontalRulerControl.getVisible());
        };
        ToggleShowHorizontalRulerCommand.prototype.executeCore = function (_state, options) {
            this.control.horizontalRulerControl.setVisible(options.param);
            this.control.owner.adjustControl();
            return true;
        };
        ToggleShowHorizontalRulerCommand.prototype.isEnabled = function (_options) {
            return _super.prototype.isEnabled.call(this, _options);
        };
        ToggleShowHorizontalRulerCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return ToggleShowHorizontalRulerCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ToggleShowHorizontalRulerCommand = ToggleShowHorizontalRulerCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeFooterOffsetCommand = (function (_super) {
        __extends(ChangeFooterOffsetCommand, _super);
        function ChangeFooterOffsetCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeFooterOffsetCommand.prototype.getDescriptor = function () {
            return __aspxRichEdit.SectionPropertyDescriptor.footerOffset;
        };
        return ChangeFooterOffsetCommand;
    }(__aspxRichEdit.ChangeSectionPropertiesCommandBase));
    __aspxRichEdit.ChangeFooterOffsetCommand = ChangeFooterOffsetCommand;
    var ChangeFooterOffsetRibbonCommand = (function (_super) {
        __extends(ChangeFooterOffsetRibbonCommand, _super);
        function ChangeFooterOffsetRibbonCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeFooterOffsetRibbonCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return this.control.uiUnitConverter.UIToTwips(parameter);
        };
        ChangeFooterOffsetRibbonCommand.prototype.getStateValue = function (options) {
            if (options === void 0) { options = this.convertToCommandOptions(null); }
            return this.control.uiUnitConverter.twipsToUI(_super.prototype.getStateValue.call(this, options));
        };
        return ChangeFooterOffsetRibbonCommand;
    }(ChangeFooterOffsetCommand));
    __aspxRichEdit.ChangeFooterOffsetRibbonCommand = ChangeFooterOffsetRibbonCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeHeaderOffsetCommand = (function (_super) {
        __extends(ChangeHeaderOffsetCommand, _super);
        function ChangeHeaderOffsetCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeHeaderOffsetCommand.prototype.getDescriptor = function () {
            return __aspxRichEdit.SectionPropertyDescriptor.headerOffset;
        };
        return ChangeHeaderOffsetCommand;
    }(__aspxRichEdit.ChangeSectionPropertiesCommandBase));
    __aspxRichEdit.ChangeHeaderOffsetCommand = ChangeHeaderOffsetCommand;
    var ChangeHeaderOffsetRibbonCommand = (function (_super) {
        __extends(ChangeHeaderOffsetRibbonCommand, _super);
        function ChangeHeaderOffsetRibbonCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeHeaderOffsetRibbonCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return this.control.uiUnitConverter.UIToTwips(parameter);
        };
        ChangeHeaderOffsetRibbonCommand.prototype.getStateValue = function (options) {
            if (options === void 0) { options = this.convertToCommandOptions(null); }
            return this.control.uiUnitConverter.twipsToUI(_super.prototype.getStateValue.call(this, options));
        };
        return ChangeHeaderOffsetRibbonCommand;
    }(ChangeHeaderOffsetCommand));
    __aspxRichEdit.ChangeHeaderOffsetRibbonCommand = ChangeHeaderOffsetRibbonCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SetLandscapePageOrientationCommand = (function (_super) {
        __extends(SetLandscapePageOrientationCommand, _super);
        function SetLandscapePageOrientationCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetLandscapePageOrientationCommand.prototype.getDescriptor = function () {
            return __aspxRichEdit.SectionPropertyDescriptor.landscape;
        };
        SetLandscapePageOrientationCommand.prototype.DEPRECATEDConvertOptionsParameter = function (_parameter) {
            return this.isLandscape();
        };
        SetLandscapePageOrientationCommand.prototype.getStateValue = function () {
            return this.getCurrentValue() == this.isLandscape();
        };
        SetLandscapePageOrientationCommand.prototype.executeCore = function (state, options) {
            var history = this.control.history;
            history.beginTransaction();
            var isExecuted = _super.prototype.executeCore.call(this, state, options);
            if (isExecuted) {
                var props = this.control.inputPosition.getMergedSectionPropertiesFull();
                var oldPageSize = props.pageSize;
                var iter = this.getAffectedSectionsIterator(options.intervals);
                while (iter.moveNext()) {
                    history.addAndRedo(new (__aspxRichEdit.SectionPropertyDescriptor.pageWidth.getHistoryItemConstructor())(this.control.modelManipulator, options.subDocument, iter.obj.interval, oldPageSize.height));
                    history.addAndRedo(new (__aspxRichEdit.SectionPropertyDescriptor.pageHeight.getHistoryItemConstructor())(this.control.modelManipulator, options.subDocument, iter.obj.interval, oldPageSize.width));
                }
            }
            history.endTransaction();
            return isExecuted;
        };
        SetLandscapePageOrientationCommand.prototype.isLandscape = function () {
            return true;
        };
        return SetLandscapePageOrientationCommand;
    }(__aspxRichEdit.ChangeSectionPropertiesCommandBase));
    __aspxRichEdit.SetLandscapePageOrientationCommand = SetLandscapePageOrientationCommand;
    var SetPortraitPageOrientationCommand = (function (_super) {
        __extends(SetPortraitPageOrientationCommand, _super);
        function SetPortraitPageOrientationCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetPortraitPageOrientationCommand.prototype.isLandscape = function () {
            return false;
        };
        return SetPortraitPageOrientationCommand;
    }(SetLandscapePageOrientationCommand));
    __aspxRichEdit.SetPortraitPageOrientationCommand = SetPortraitPageOrientationCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SetSectionPageMarginsCommandBase = (function (_super) {
        __extends(SetSectionPageMarginsCommandBase, _super);
        function SetSectionPageMarginsCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetSectionPageMarginsCommandBase.prototype.getCurrentValue = function () {
            return this.control.inputPosition.getMergedSectionPropertiesRaw().margins.clone();
        };
        SetSectionPageMarginsCommandBase.prototype.executeCore = function (_state, options) {
            var newValue = options.param;
            if (!this.getCurrentValue().equals(newValue)) {
                __aspxRichEdit.SectionPropertyDescriptor.marginLeft.setProp(this.control.inputPosition.getMergedSectionPropertiesRaw(), newValue.left);
                __aspxRichEdit.SectionPropertyDescriptor.marginTop.setProp(this.control.inputPosition.getMergedSectionPropertiesRaw(), newValue.top);
                __aspxRichEdit.SectionPropertyDescriptor.marginRight.setProp(this.control.inputPosition.getMergedSectionPropertiesRaw(), newValue.right);
                __aspxRichEdit.SectionPropertyDescriptor.marginBottom.setProp(this.control.inputPosition.getMergedSectionPropertiesRaw(), newValue.bottom);
                var iter = this.getAffectedSectionsIterator(options.intervals);
                this.control.history.beginTransaction();
                while (iter.moveNext()) {
                    var interval = iter.obj.interval;
                    this.setMargin(options.subDocument, interval, __aspxRichEdit.SectionPropertyDescriptor.marginLeft, newValue.left);
                    this.setMargin(options.subDocument, interval, __aspxRichEdit.SectionPropertyDescriptor.marginTop, newValue.top);
                    this.setMargin(options.subDocument, interval, __aspxRichEdit.SectionPropertyDescriptor.marginRight, newValue.right);
                    this.setMargin(options.subDocument, interval, __aspxRichEdit.SectionPropertyDescriptor.marginBottom, newValue.bottom);
                }
                this.control.history.endTransaction();
                return true;
            }
            return false;
        };
        SetSectionPageMarginsCommandBase.prototype.setMargin = function (subDocument, interval, descriptor, newValue) {
            this.control.history.addAndRedo(new (descriptor.getHistoryItemConstructor())(this.control.modelManipulator, subDocument, interval, newValue));
        };
        return SetSectionPageMarginsCommandBase;
    }(__aspxRichEdit.SectionPropertiesCommandBase));
    __aspxRichEdit.SetSectionPageMarginsCommandBase = SetSectionPageMarginsCommandBase;
    var SetSectionPageMarginsCommand = (function (_super) {
        __extends(SetSectionPageMarginsCommand, _super);
        function SetSectionPageMarginsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetSectionPageMarginsCommand.prototype.getStateValue = function () {
            return this.getCurrentValue();
        };
        return SetSectionPageMarginsCommand;
    }(SetSectionPageMarginsCommandBase));
    __aspxRichEdit.SetSectionPageMarginsCommand = SetSectionPageMarginsCommand;
    var SetPredefinedSectionPageMarginsCommand = (function (_super) {
        __extends(SetPredefinedSectionPageMarginsCommand, _super);
        function SetPredefinedSectionPageMarginsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetPredefinedSectionPageMarginsCommand.prototype.getStateValue = function () {
            return this.getPredefinedMargins().equals(this.getCurrentValue());
        };
        SetPredefinedSectionPageMarginsCommand.prototype.DEPRECATEDConvertOptionsParameter = function (_parameter) {
            return this.getPredefinedMargins();
        };
        return SetPredefinedSectionPageMarginsCommand;
    }(SetSectionPageMarginsCommandBase));
    __aspxRichEdit.SetPredefinedSectionPageMarginsCommand = SetPredefinedSectionPageMarginsCommand;
    var SetNormalSectionPageMarginsCommand = (function (_super) {
        __extends(SetNormalSectionPageMarginsCommand, _super);
        function SetNormalSectionPageMarginsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetNormalSectionPageMarginsCommand.prototype.getPredefinedMargins = function () {
            return new __aspxRichEdit.Margins(1700, 850, 1133, 1133);
        };
        return SetNormalSectionPageMarginsCommand;
    }(SetPredefinedSectionPageMarginsCommand));
    __aspxRichEdit.SetNormalSectionPageMarginsCommand = SetNormalSectionPageMarginsCommand;
    var SetNarrowSectionPageMarginsCommand = (function (_super) {
        __extends(SetNarrowSectionPageMarginsCommand, _super);
        function SetNarrowSectionPageMarginsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetNarrowSectionPageMarginsCommand.prototype.getPredefinedMargins = function () {
            return new __aspxRichEdit.Margins(720, 720, 720, 720);
        };
        return SetNarrowSectionPageMarginsCommand;
    }(SetPredefinedSectionPageMarginsCommand));
    __aspxRichEdit.SetNarrowSectionPageMarginsCommand = SetNarrowSectionPageMarginsCommand;
    var SetModerateSectionPageMarginsCommand = (function (_super) {
        __extends(SetModerateSectionPageMarginsCommand, _super);
        function SetModerateSectionPageMarginsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetModerateSectionPageMarginsCommand.prototype.getPredefinedMargins = function () {
            return new __aspxRichEdit.Margins(1080, 1080, 1440, 1440);
        };
        return SetModerateSectionPageMarginsCommand;
    }(SetPredefinedSectionPageMarginsCommand));
    __aspxRichEdit.SetModerateSectionPageMarginsCommand = SetModerateSectionPageMarginsCommand;
    var SetWideSectionPageMarginsCommand = (function (_super) {
        __extends(SetWideSectionPageMarginsCommand, _super);
        function SetWideSectionPageMarginsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetWideSectionPageMarginsCommand.prototype.getPredefinedMargins = function () {
            return new __aspxRichEdit.Margins(2880, 2880, 1440, 1440);
        };
        return SetWideSectionPageMarginsCommand;
    }(SetPredefinedSectionPageMarginsCommand));
    __aspxRichEdit.SetWideSectionPageMarginsCommand = SetWideSectionPageMarginsCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SetSectionColumnCountBaseCommand = (function (_super) {
        __extends(SetSectionColumnCountBaseCommand, _super);
        function SetSectionColumnCountBaseCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetSectionColumnCountBaseCommand.prototype.getDescriptor = function () {
            return __aspxRichEdit.SectionPropertyDescriptor.columnCount;
        };
        SetSectionColumnCountBaseCommand.prototype.isEnabled = function (options) {
            return _super.prototype.isEnabled.call(this, options) && this.control.model.activeSubDocument.isMain();
        };
        SetSectionColumnCountBaseCommand.prototype.getCurrentValue = function () {
            return this.control.inputPosition.getMergedSectionPropertiesRaw().equalWidthColumns ?
                _super.prototype.getCurrentValue.call(this) :
                undefined;
        };
        SetSectionColumnCountBaseCommand.prototype.executeCore = function (state, options) {
            var history = this.control.history;
            history.beginTransaction();
            var isExecuted = _super.prototype.executeCore.call(this, state, options);
            if (isExecuted) {
                var iter = this.getAffectedSectionsIterator(options.intervals);
                while (iter.moveNext())
                    history.addAndRedo(new (__aspxRichEdit.SectionPropertyDescriptor.equalWidthColumns.getHistoryItemConstructor())(this.control.modelManipulator, options.subDocument, iter.obj.interval, true));
            }
            history.endTransaction();
            return isExecuted;
        };
        return SetSectionColumnCountBaseCommand;
    }(__aspxRichEdit.ChangeSectionPropertiesCommandBase));
    __aspxRichEdit.SetSectionColumnCountBaseCommand = SetSectionColumnCountBaseCommand;
    var SetSectionColumnCountCommand = (function (_super) {
        __extends(SetSectionColumnCountCommand, _super);
        function SetSectionColumnCountCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        return SetSectionColumnCountCommand;
    }(SetSectionColumnCountBaseCommand));
    __aspxRichEdit.SetSectionColumnCountCommand = SetSectionColumnCountCommand;
    var SetSectionColumnPredefinedCountCommand = (function (_super) {
        __extends(SetSectionColumnPredefinedCountCommand, _super);
        function SetSectionColumnPredefinedCountCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetSectionColumnPredefinedCountCommand.prototype.getStateValue = function (options) {
            return options.param === this.getCurrentValue();
        };
        return SetSectionColumnPredefinedCountCommand;
    }(SetSectionColumnCountBaseCommand));
    __aspxRichEdit.SetSectionColumnPredefinedCountCommand = SetSectionColumnPredefinedCountCommand;
    var SetSectionOneColumnCommand = (function (_super) {
        __extends(SetSectionOneColumnCommand, _super);
        function SetSectionOneColumnCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetSectionOneColumnCommand.prototype.DEPRECATEDConvertOptionsParameter = function (_parameter) {
            return 1;
        };
        return SetSectionOneColumnCommand;
    }(SetSectionColumnPredefinedCountCommand));
    __aspxRichEdit.SetSectionOneColumnCommand = SetSectionOneColumnCommand;
    var SetSectionTwoColumnsCommand = (function (_super) {
        __extends(SetSectionTwoColumnsCommand, _super);
        function SetSectionTwoColumnsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetSectionTwoColumnsCommand.prototype.DEPRECATEDConvertOptionsParameter = function (_parameter) {
            return 2;
        };
        return SetSectionTwoColumnsCommand;
    }(SetSectionColumnPredefinedCountCommand));
    __aspxRichEdit.SetSectionTwoColumnsCommand = SetSectionTwoColumnsCommand;
    var SetSectionThreeColumnsCommand = (function (_super) {
        __extends(SetSectionThreeColumnsCommand, _super);
        function SetSectionThreeColumnsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetSectionThreeColumnsCommand.prototype.DEPRECATEDConvertOptionsParameter = function (_parameter) {
            return 3;
        };
        return SetSectionThreeColumnsCommand;
    }(SetSectionColumnPredefinedCountCommand));
    __aspxRichEdit.SetSectionThreeColumnsCommand = SetSectionThreeColumnsCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SetSectionPageSizeCommand = (function (_super) {
        __extends(SetSectionPageSizeCommand, _super);
        function SetSectionPageSizeCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetSectionPageSizeCommand.prototype.executeCore = function (_state, options) {
            var parameters = options.param;
            var modelManipulator = this.control.modelManipulator;
            var history = this.control.history;
            var subDocument = options.subDocument;
            var iter = this.getAffectedSectionsIterator(options.intervals);
            var newLandscape = parameters.size.width > parameters.size.height;
            var changed = false;
            history.beginTransaction();
            while (iter.moveNext()) {
                var sectionInterval = iter.obj.interval;
                var secProps = iter.obj.sectionProperties;
                var oldLandscape = secProps.landscape;
                if (parameters.updateOrientation && oldLandscape !== newLandscape) {
                    history.addAndRedo(new __aspxRichEdit.SectionLandscapeHistoryItem(modelManipulator, subDocument, sectionInterval, newLandscape));
                    changed = true;
                }
                var newWidth = parameters.updateOrientation || !oldLandscape ? parameters.size.width : parameters.size.height;
                if (secProps.pageWidth !== newWidth) {
                    history.addAndRedo(new __aspxRichEdit.SectionPageWidthHistoryItem(modelManipulator, subDocument, sectionInterval, newWidth));
                    changed = true;
                }
                var newHeigth = parameters.updateOrientation || !oldLandscape ? parameters.size.height : parameters.size.width;
                if (secProps.pageHeight !== newHeigth) {
                    history.addAndRedo(new __aspxRichEdit.SectionPageHeightHistoryItem(modelManipulator, subDocument, sectionInterval, newHeigth));
                    changed = true;
                }
            }
            history.endTransaction();
            return changed;
        };
        SetSectionPageSizeCommand.prototype.getStateValue = function (_options) {
            return this.control.inputPosition.getMergedSectionPropertiesRaw().pageSize;
        };
        SetSectionPageSizeCommand.compareSizeByTwoDimensions = function (a, b) {
            return a.equals(b) || a.width == b.height && a.height == b.width;
        };
        return SetSectionPageSizeCommand;
    }(__aspxRichEdit.SectionPropertiesCommandBase));
    __aspxRichEdit.SetSectionPageSizeCommand = SetSectionPageSizeCommand;
    var SetSectionPaperKindCommand = (function (_super) {
        __extends(SetSectionPaperKindCommand, _super);
        function SetSectionPaperKindCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetSectionPaperKindCommand.prototype.DEPRECATEDConvertOptionsParameter = function (_parameter) {
            var newSize = __aspxRichEdit.PaperSizeConverter.calculatePaperSize(this.getPaperKind());
            var currentSize = this.control.inputPosition.getMergedSectionPropertiesRaw().pageSize;
            var equal = SetSectionPageSizeCommand.compareSizeByTwoDimensions(currentSize, newSize);
            return equal ? { size: currentSize, updateOrientation: false } : { size: newSize, updateOrientation: false };
        };
        SetSectionPaperKindCommand.prototype.getStateValue = function (_options) {
            var newSize = __aspxRichEdit.PaperSizeConverter.calculatePaperSize(this.getPaperKind());
            var currentSize = this.control.inputPosition.getMergedSectionPropertiesRaw().pageSize;
            return SetSectionPageSizeCommand.compareSizeByTwoDimensions(newSize, currentSize) ? currentSize : null;
        };
        return SetSectionPaperKindCommand;
    }(SetSectionPageSizeCommand));
    __aspxRichEdit.SetSectionPaperKindCommand = SetSectionPaperKindCommand;
    var SetSectionLetterPaperKindCommand = (function (_super) {
        __extends(SetSectionLetterPaperKindCommand, _super);
        function SetSectionLetterPaperKindCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetSectionLetterPaperKindCommand.prototype.getPaperKind = function () { return __aspxRichEdit.PaperKind.Letter; };
        return SetSectionLetterPaperKindCommand;
    }(SetSectionPaperKindCommand));
    __aspxRichEdit.SetSectionLetterPaperKindCommand = SetSectionLetterPaperKindCommand;
    var SetSectionLegalPaperKindCommand = (function (_super) {
        __extends(SetSectionLegalPaperKindCommand, _super);
        function SetSectionLegalPaperKindCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetSectionLegalPaperKindCommand.prototype.getPaperKind = function () { return __aspxRichEdit.PaperKind.Legal; };
        return SetSectionLegalPaperKindCommand;
    }(SetSectionPaperKindCommand));
    __aspxRichEdit.SetSectionLegalPaperKindCommand = SetSectionLegalPaperKindCommand;
    var SetSectionFolioPaperKindCommand = (function (_super) {
        __extends(SetSectionFolioPaperKindCommand, _super);
        function SetSectionFolioPaperKindCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetSectionFolioPaperKindCommand.prototype.getPaperKind = function () { return __aspxRichEdit.PaperKind.Folio; };
        return SetSectionFolioPaperKindCommand;
    }(SetSectionPaperKindCommand));
    __aspxRichEdit.SetSectionFolioPaperKindCommand = SetSectionFolioPaperKindCommand;
    var SetSectionA4PaperKindCommand = (function (_super) {
        __extends(SetSectionA4PaperKindCommand, _super);
        function SetSectionA4PaperKindCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetSectionA4PaperKindCommand.prototype.getPaperKind = function () { return __aspxRichEdit.PaperKind.A4; };
        return SetSectionA4PaperKindCommand;
    }(SetSectionPaperKindCommand));
    __aspxRichEdit.SetSectionA4PaperKindCommand = SetSectionA4PaperKindCommand;
    var SetSectionA5PaperKindCommand = (function (_super) {
        __extends(SetSectionA5PaperKindCommand, _super);
        function SetSectionA5PaperKindCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetSectionA5PaperKindCommand.prototype.getPaperKind = function () { return __aspxRichEdit.PaperKind.A5; };
        return SetSectionA5PaperKindCommand;
    }(SetSectionPaperKindCommand));
    __aspxRichEdit.SetSectionA5PaperKindCommand = SetSectionA5PaperKindCommand;
    var SetSectionA6PaperKindCommand = (function (_super) {
        __extends(SetSectionA6PaperKindCommand, _super);
        function SetSectionA6PaperKindCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetSectionA6PaperKindCommand.prototype.getPaperKind = function () { return __aspxRichEdit.PaperKind.A6; };
        return SetSectionA6PaperKindCommand;
    }(SetSectionPaperKindCommand));
    __aspxRichEdit.SetSectionA6PaperKindCommand = SetSectionA6PaperKindCommand;
    var SetSectionB5PaperKindCommand = (function (_super) {
        __extends(SetSectionB5PaperKindCommand, _super);
        function SetSectionB5PaperKindCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetSectionB5PaperKindCommand.prototype.getPaperKind = function () { return __aspxRichEdit.PaperKind.B5; };
        return SetSectionB5PaperKindCommand;
    }(SetSectionPaperKindCommand));
    __aspxRichEdit.SetSectionB5PaperKindCommand = SetSectionB5PaperKindCommand;
    var SetSectionExecutivePaperKindCommand = (function (_super) {
        __extends(SetSectionExecutivePaperKindCommand, _super);
        function SetSectionExecutivePaperKindCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetSectionExecutivePaperKindCommand.prototype.getPaperKind = function () { return __aspxRichEdit.PaperKind.Executive; };
        return SetSectionExecutivePaperKindCommand;
    }(SetSectionPaperKindCommand));
    __aspxRichEdit.SetSectionExecutivePaperKindCommand = SetSectionExecutivePaperKindCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GoToDocumentEndCommandBase = (function (_super) {
        __extends(GoToDocumentEndCommandBase, _super);
        function GoToDocumentEndCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToDocumentEndCommandBase.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        GoToDocumentEndCommandBase.prototype.executeCore = function (_state, _options) {
            this.control.layoutFormatterManager.formatSyncAllDocument();
            var subDocument = this.control.model.activeSubDocument;
            var layout = this.control.layout;
            var lastPage = subDocument.isMain() ? layout.getLastValidPage() : layout.pages[this.control.selection.pageIndex];
            if (!this.extendSelection()) {
                var pageAreas = lastPage.mainSubDocumentPageAreas;
                var lastPageArea = pageAreas[pageAreas.length - 1];
                var lastColumn = lastPageArea.columns[lastPageArea.columns.length - 1];
                var lastRow = lastColumn.rows[lastColumn.rows.length - 1];
                var boxIndex = lastRow.getLastVisibleBoxIndex();
                if (boxIndex >= 0) {
                    var box = lastRow.boxes[boxIndex];
                    this.setSelection((subDocument.isMain() ? lastPage.getPosition() : 0) + lastPageArea.pageOffset + lastColumn.pageAreaOffset + lastRow.columnOffset + box.getEndPosition());
                }
                else {
                    var box = lastRow.boxes[0];
                    this.setSelection((subDocument.isMain() ? lastPage.getPosition() : 0) + lastPageArea.pageOffset + lastColumn.pageAreaOffset + lastRow.columnOffset + box.rowOffset);
                }
            }
            else
                this.setSelection(subDocument.isMain() ? lastPage.getEndPosition() : lastPage.otherPageAreas[subDocument.id].getEndPosition());
            return true;
        };
        GoToDocumentEndCommandBase.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return GoToDocumentEndCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.GoToDocumentEndCommandBase = GoToDocumentEndCommandBase;
    var GoToDocumentEndCommand = (function (_super) {
        __extends(GoToDocumentEndCommand, _super);
        function GoToDocumentEndCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToDocumentEndCommand.prototype.setSelection = function (position) {
            this.control.selection.deprecatedSetSelection(position, position, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
        };
        GoToDocumentEndCommand.prototype.extendSelection = function () {
            return false;
        };
        return GoToDocumentEndCommand;
    }(GoToDocumentEndCommandBase));
    __aspxRichEdit.GoToDocumentEndCommand = GoToDocumentEndCommand;
    var ExtendGoToDocumentEndCommand = (function (_super) {
        __extends(ExtendGoToDocumentEndCommand, _super);
        function ExtendGoToDocumentEndCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ExtendGoToDocumentEndCommand.prototype.setSelection = function (position) {
            this.control.selection.extendLastSelection(position, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
        };
        ExtendGoToDocumentEndCommand.prototype.extendSelection = function () {
            return true;
        };
        return ExtendGoToDocumentEndCommand;
    }(GoToDocumentEndCommandBase));
    __aspxRichEdit.ExtendGoToDocumentEndCommand = ExtendGoToDocumentEndCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GoToDocumentStartCommandBase = (function (_super) {
        __extends(GoToDocumentStartCommandBase, _super);
        function GoToDocumentStartCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToDocumentStartCommandBase.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        GoToDocumentStartCommandBase.prototype.executeCore = function (_state, _options) {
            if (this.control.layout.validPageCount < 1)
                this.control.layoutFormatterManager.forceFormatPage(0);
            this.setSelection(this.control.layout.pages[0].getPosition());
            return true;
        };
        GoToDocumentStartCommandBase.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return GoToDocumentStartCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.GoToDocumentStartCommandBase = GoToDocumentStartCommandBase;
    var GoToDocumentStartCommand = (function (_super) {
        __extends(GoToDocumentStartCommand, _super);
        function GoToDocumentStartCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToDocumentStartCommand.prototype.setSelection = function (position) {
            this.control.selection.deprecatedSetSelection(position, position, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
        };
        return GoToDocumentStartCommand;
    }(GoToDocumentStartCommandBase));
    __aspxRichEdit.GoToDocumentStartCommand = GoToDocumentStartCommand;
    var ExtendGoToDocumentStartCommand = (function (_super) {
        __extends(ExtendGoToDocumentStartCommand, _super);
        function ExtendGoToDocumentStartCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ExtendGoToDocumentStartCommand.prototype.setSelection = function (position) {
            this.control.selection.extendLastSelection(position, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
        };
        return ExtendGoToDocumentStartCommand;
    }(GoToDocumentStartCommandBase));
    __aspxRichEdit.ExtendGoToDocumentStartCommand = ExtendGoToDocumentStartCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GoToLineAboveCommand = (function (_super) {
        __extends(GoToLineAboveCommand, _super);
        function GoToLineAboveCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToLineAboveCommand.prototype.extendSelection = function () {
            return false;
        };
        GoToLineAboveCommand.prototype.getPositionForEdgeLine = function (_layoutPosition) {
            var lastInterval = this.control.selection.getLastSelectedInterval();
            return lastInterval.start;
        };
        GoToLineAboveCommand.prototype.canAdvanceToNextRow = function (cellIterator) {
            return cellIterator.tryAdvanceToAboveRow();
        };
        GoToLineAboveCommand.prototype.getNewLayoutPositionRowLevel = function (oldLayoutPosition) {
            var newLayoutPosition = oldLayoutPosition.clone();
            if (newLayoutPosition.advanceToPrevRow(this.control.layout))
                return newLayoutPosition;
            else
                return null;
        };
        GoToLineAboveCommand.prototype.getInitialSelectionEndPosition = function () {
            if (this.extendSelection() && this.control.selection.forwardDirection)
                return this.control.selection.getLastSelectedInterval().end;
            else
                return this.control.selection.getLastSelectedInterval().start;
        };
        return GoToLineAboveCommand;
    }(__aspxRichEdit.GoToLineVerticallyCommandBase));
    __aspxRichEdit.GoToLineAboveCommand = GoToLineAboveCommand;
    var ExtendGoToLineAboveCommand = (function (_super) {
        __extends(ExtendGoToLineAboveCommand, _super);
        function ExtendGoToLineAboveCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ExtendGoToLineAboveCommand.prototype.extendSelection = function () {
            return true;
        };
        ExtendGoToLineAboveCommand.prototype.getPositionForEdgeLine = function (layoutPosition) {
            return layoutPosition.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Row);
        };
        ExtendGoToLineAboveCommand.prototype.canAdvanceToNextRow = function (_cellIterator) {
            return false;
        };
        ExtendGoToLineAboveCommand.prototype.canGoToNextTableRow = function () {
            return true;
        };
        ExtendGoToLineAboveCommand.prototype.getCurrentTableRow = function (selectedCells) {
            var isForward = this.control.selection.forwardDirection;
            return isForward ? selectedCells[selectedCells.length - 1][selectedCells[selectedCells.length - 1].length - 1].parentRow : selectedCells[0][0].parentRow;
        };
        ExtendGoToLineAboveCommand.prototype.checkTableRowIndex = function (rowIndex, _length) {
            if (_length === void 0) { _length = 0; }
            return rowIndex > -1 && rowIndex != 0;
        };
        ExtendGoToLineAboveCommand.prototype.getNextTableRow = function (table, rowIndex) {
            return table.rows[rowIndex - 1];
        };
        ExtendGoToLineAboveCommand.prototype.performTableCellsSelection = function (isForward, _selectedCells, nextRow, firstCell, lastCell) {
            var parameter = {};
            parameter.firstCell = isForward ? firstCell : lastCell;
            parameter.lastCell = isForward ? nextRow.cells[__aspxRichEdit.TableCellUtils.getCellIndexByColumnIndex(nextRow, __aspxRichEdit.TableCellUtils.getStartColumnIndex(lastCell))] :
                nextRow.cells[__aspxRichEdit.TableCellUtils.getCellIndexByColumnIndex(nextRow, __aspxRichEdit.TableCellUtils.getStartColumnIndex(firstCell))];
            return this.selectTableCellsRange(parameter);
        };
        ExtendGoToLineAboveCommand.prototype.performSelectionOnTheLastTableRow = function (isForward, selectedCells) {
            if (!isForward) {
                var table = selectedCells[0][0].parentRow.parentTable;
                var lastSelectedCell_1 = selectedCells[selectedCells.length - 1][selectedCells[selectedCells.length - 1].length - 1];
                var currentIndexRow = __aspxRichEdit.Utils.binaryIndexOf(table.rows, function (row) { return row.getStartPosition() - lastSelectedCell_1.parentRow.getStartPosition(); });
                this.selectTableCellsRange({
                    firstCell: table.rows[currentIndexRow].cells[table.rows[currentIndexRow].cells.length - 1],
                    lastCell: table.rows[0].cells[0]
                });
            }
        };
        return ExtendGoToLineAboveCommand;
    }(GoToLineAboveCommand));
    __aspxRichEdit.ExtendGoToLineAboveCommand = ExtendGoToLineAboveCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LineDownCommand = (function (_super) {
        __extends(LineDownCommand, _super);
        function LineDownCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LineDownCommand.prototype.extendSelection = function () {
            return false;
        };
        LineDownCommand.prototype.getPositionForEdgeLine = function (_layoutPosition) {
            var lastIntervalEnd = this.control.selection.getLastSelectedInterval().end;
            if (this.control.model.activeSubDocument.getDocumentEndPosition() == lastIntervalEnd)
                lastIntervalEnd--;
            return lastIntervalEnd;
        };
        LineDownCommand.prototype.canAdvanceToNextRow = function (cellIterator) {
            return cellIterator.tryAdvanceToBelowRow();
        };
        LineDownCommand.prototype.getNewLayoutPositionRowLevel = function (oldLayoutPosition) {
            var newLayoutPosition = oldLayoutPosition.clone();
            if (newLayoutPosition.advanceToNextRow(this.control.layout))
                return newLayoutPosition;
            return null;
        };
        LineDownCommand.prototype.getInitialSelectionEndPosition = function () {
            if (this.extendSelection() && !this.control.selection.forwardDirection)
                return this.control.selection.getLastSelectedInterval().start;
            else
                return this.control.selection.getLastSelectedInterval().end;
        };
        return LineDownCommand;
    }(__aspxRichEdit.GoToLineVerticallyCommandBase));
    __aspxRichEdit.LineDownCommand = LineDownCommand;
    var ExtendLineDownCommand = (function (_super) {
        __extends(ExtendLineDownCommand, _super);
        function ExtendLineDownCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ExtendLineDownCommand.prototype.extendSelection = function () {
            return true;
        };
        ExtendLineDownCommand.prototype.getPositionForEdgeLine = function (layoutPosition) {
            return layoutPosition.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Row) + layoutPosition.row.getLastBoxEndPositionInRow();
        };
        ExtendLineDownCommand.prototype.canAdvanceToNextRow = function (_cellIterator) {
            return false;
        };
        ExtendLineDownCommand.prototype.canGoToNextTableRow = function () {
            return true;
        };
        ExtendLineDownCommand.prototype.getCurrentTableRow = function (selectedCells) {
            return this.control.selection.forwardDirection ? selectedCells[selectedCells.length - 1][0].parentRow : selectedCells[0][0].parentRow;
        };
        ExtendLineDownCommand.prototype.checkTableRowIndex = function (rowIndex, length) {
            if (length === void 0) { length = 0; }
            return rowIndex > -1 && rowIndex < length - 1;
        };
        ExtendLineDownCommand.prototype.getNextTableRow = function (table, rowIndex) {
            return table.rows[rowIndex + 1];
        };
        ExtendLineDownCommand.prototype.performTableCellsSelection = function (isForward, selectedCells, nextRow, firstCell, lastCell) {
            var lastSelectedCell = isForward ? lastCell : firstCell;
            var lastSelectedCellcolumnIndex = __aspxRichEdit.TableCellUtils.getStartColumnIndex(lastSelectedCell);
            var lastCellIndex = __aspxRichEdit.TableCellUtils.getCellIndexByColumnIndex(nextRow, lastSelectedCellcolumnIndex);
            var parameter = {};
            parameter.firstCell = isForward ? selectedCells[0][0] : selectedCells[selectedCells.length - 1][selectedCells[selectedCells.length - 1].length - 1];
            parameter.lastCell = nextRow.cells[lastCellIndex];
            return this.selectTableCellsRange(parameter);
        };
        ExtendLineDownCommand.prototype.performSelectionOnTheLastTableRow = function (isForward, selectedCells) {
            if (isForward) {
                var table = selectedCells[0][0].parentRow.parentTable;
                var currentIndexRow = __aspxRichEdit.Utils.binaryIndexOf(table.rows, function (row) { return row.getStartPosition() - selectedCells[0][0].parentRow.getStartPosition(); });
                this.selectTableCellsRange({
                    firstCell: table.rows[currentIndexRow].cells[0],
                    lastCell: table.rows[table.rows.length - 1].cells[table.rows[table.rows.length - 1].cells.length - 1]
                });
            }
        };
        return ExtendLineDownCommand;
    }(LineDownCommand));
    __aspxRichEdit.ExtendLineDownCommand = ExtendLineDownCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GoToLineEndCommandBase = (function (_super) {
        __extends(GoToLineEndCommandBase, _super);
        function GoToLineEndCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToLineEndCommandBase.prototype.executeCore = function (_state, _options) {
            var endSelection = this.getEndPosition();
            if (endSelection < 0)
                return false;
            this.setSelection(endSelection, -1);
            return true;
        };
        GoToLineEndCommandBase.prototype.getEndPosition = function () {
            var selection = this.control.selection;
            this.endOfLine = true;
            var position = selection.forwardDirection ? selection.getLastSelectedInterval().end : selection.getLastSelectedInterval().start;
            var subDocument = this.control.model.activeSubDocument;
            var layoutPosition = (subDocument.isMain()
                ? new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.control.layout, subDocument, position, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.layout, subDocument, position, selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character))
                .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
            if (!layoutPosition)
                return -1;
            return this.getEndPositionCore(layoutPosition);
        };
        return GoToLineEndCommandBase;
    }(__aspxRichEdit.SelectionCommandBase));
    __aspxRichEdit.GoToLineEndCommandBase = GoToLineEndCommandBase;
    var GoToLineEndCommand = (function (_super) {
        __extends(GoToLineEndCommand, _super);
        function GoToLineEndCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToLineEndCommand.prototype.setSelection = function (pos, keepX) {
            var selection = this.control.selection;
            selection.deprecatedSetSelection(pos, pos, this.endOfLine, keepX, __aspxRichEdit.UpdateInputPositionProperties.Yes);
        };
        GoToLineEndCommand.prototype.getEndPositionCore = function (layoutPosition) {
            var lastBoxInRow = layoutPosition.row.getLastVisibleBox();
            if (!lastBoxInRow)
                this.endOfLine = false;
            return layoutPosition.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Row) + (lastBoxInRow ? lastBoxInRow.getEndPosition() : 0);
        };
        return GoToLineEndCommand;
    }(GoToLineEndCommandBase));
    __aspxRichEdit.GoToLineEndCommand = GoToLineEndCommand;
    var ExtendGoToLineEndCommand = (function (_super) {
        __extends(ExtendGoToLineEndCommand, _super);
        function ExtendGoToLineEndCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ExtendGoToLineEndCommand.prototype.setSelection = function (pos, keepX) {
            var selection = this.control.selection;
            selection.extendLastSelection(pos, this.endOfLine, keepX);
        };
        ExtendGoToLineEndCommand.prototype.getEndPositionCore = function (layoutPosition) {
            return layoutPosition.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Row) + layoutPosition.row.getLastBoxEndPositionInRow();
        };
        return ExtendGoToLineEndCommand;
    }(GoToLineEndCommandBase));
    __aspxRichEdit.ExtendGoToLineEndCommand = ExtendGoToLineEndCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GoToLineStartCommandBase = (function (_super) {
        __extends(GoToLineStartCommandBase, _super);
        function GoToLineStartCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToLineStartCommandBase.prototype.getStartPosition = function () {
            var selection = this.control.selection;
            var position = selection.forwardDirection ? selection.getLastSelectedInterval().end : selection.getLastSelectedInterval().start;
            var subDocument = this.control.model.activeSubDocument;
            var layoutPosition = (subDocument.isMain()
                ? new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.control.layout, subDocument, position, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.layout, subDocument, position, selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character))
                .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true));
            if (!layoutPosition)
                return -1;
            return layoutPosition.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Row);
        };
        return GoToLineStartCommandBase;
    }(__aspxRichEdit.SelectionCommandBase));
    __aspxRichEdit.GoToLineStartCommandBase = GoToLineStartCommandBase;
    var GoToLineStartCommand = (function (_super) {
        __extends(GoToLineStartCommand, _super);
        function GoToLineStartCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToLineStartCommand.prototype.executeCore = function (_state, _options) {
            var pos = this.getStartPosition();
            if (pos < 0)
                return false;
            this.control.selection.deprecatedSetSelection(pos, pos, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
            return true;
        };
        return GoToLineStartCommand;
    }(GoToLineStartCommandBase));
    __aspxRichEdit.GoToLineStartCommand = GoToLineStartCommand;
    var ExtendGoToLineStartCommand = (function (_super) {
        __extends(ExtendGoToLineStartCommand, _super);
        function ExtendGoToLineStartCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ExtendGoToLineStartCommand.prototype.executeCore = function (_state, _options) {
            var selection = this.control.selection;
            var pos = this.getStartPosition();
            if (pos < 0)
                return false;
            selection.extendLastSelection(pos, false, -1);
            return true;
        };
        return ExtendGoToLineStartCommand;
    }(GoToLineStartCommandBase));
    __aspxRichEdit.ExtendGoToLineStartCommand = ExtendGoToLineStartCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GoToNextCharacterCommandBase = (function (_super) {
        __extends(GoToNextCharacterCommandBase, _super);
        function GoToNextCharacterCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToNextCharacterCommandBase.prototype.executeCore = function (_state, _options) {
            var position = this.getPosition();
            if (position == -1)
                return false;
            this.setSelection(position);
            return true;
        };
        GoToNextCharacterCommandBase.prototype.getPosition = function () {
            var selection = this.control.selection;
            var subDocument = this.control.model.activeSubDocument;
            var initialModelPosition = selection.forwardDirection ? selection.getLastSelectedInterval().end : selection.getLastSelectedInterval().start;
            var initialLayoutPosition = subDocument.isMain()
                ? __aspxRichEdit.LayoutPositionMainSubDocumentCreator.ensureLayoutPosition(this.control, this.control.layout, subDocument, initialModelPosition, __aspxRichEdit.DocumentLayoutDetailsLevel.Character, new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setCustom(true, true, false, false))
                : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.layout, subDocument, initialModelPosition, selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                    .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setCustom(true, true, false, false));
            var nextCharLayoutPosition;
            if (this.extendSelection()) {
                nextCharLayoutPosition = initialLayoutPosition;
                if (nextCharLayoutPosition.getLogPosition() == initialModelPosition) {
                    nextCharLayoutPosition = this.getNextCharacterPosition(nextCharLayoutPosition);
                    if (nextCharLayoutPosition.isPositionBeforeFirstBoxInRow())
                        nextCharLayoutPosition = this.getNextCharacterPosition(nextCharLayoutPosition);
                }
                else if (nextCharLayoutPosition.isPositionBeforeFirstBoxInRow())
                    nextCharLayoutPosition = this.getNextCharacterPosition(nextCharLayoutPosition);
            }
            else {
                if (!selection.isCollapsed()) {
                    var pos;
                    if (selection.forwardDirection) {
                        pos = initialLayoutPosition.getLogPosition();
                    }
                    else {
                        var selectionEndPosition = selection.getLastSelectedInterval().end;
                        pos = (subDocument.isMain()
                            ? __aspxRichEdit.LayoutPositionMainSubDocumentCreator.ensureLayoutPosition(this.control, this.control.layout, subDocument, selectionEndPosition, __aspxRichEdit.DocumentLayoutDetailsLevel.Character, new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true))
                            : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.layout, subDocument, selectionEndPosition, selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                                .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true))).getLogPosition();
                    }
                    return pos < subDocument.getDocumentEndPosition() ? pos : pos - 1;
                }
                nextCharLayoutPosition = initialLayoutPosition;
                var needFindPosition = nextCharLayoutPosition.getLogPosition() == initialModelPosition;
                if (!needFindPosition)
                    needFindPosition = __aspxRichEdit.Field.binaryIndexOf(subDocument.fields, initialModelPosition + 1) >= 0;
                if (needFindPosition) {
                    if (nextCharLayoutPosition.box.getLength() == nextCharLayoutPosition.charOffset)
                        nextCharLayoutPosition = this.getNextCharacterPosition(nextCharLayoutPosition);
                    do {
                        var prevLP = nextCharLayoutPosition;
                        nextCharLayoutPosition = this.getNextCharacterPosition(prevLP);
                        if (prevLP === nextCharLayoutPosition) {
                            nextCharLayoutPosition = initialLayoutPosition;
                            break;
                        }
                    } while (!(nextCharLayoutPosition.box.isVisible() || nextCharLayoutPosition.isPositionBeforeFirstBoxInRow()));
                }
            }
            var nextCharModelPosition = nextCharLayoutPosition.getLogPosition();
            return nextCharModelPosition == initialModelPosition ? -1 : nextCharModelPosition;
        };
        GoToNextCharacterCommandBase.prototype.getNextCharacterPosition = function (layoutPosition) {
            var nextLayoutPosition = layoutPosition.clone();
            if (nextLayoutPosition.charOffset + 1 <= nextLayoutPosition.box.getLength()) {
                nextLayoutPosition.charOffset++;
                return nextLayoutPosition;
            }
            nextLayoutPosition.charOffset = 0;
            if (nextLayoutPosition.boxIndex + 1 < nextLayoutPosition.row.boxes.length) {
                nextLayoutPosition.boxIndex++;
                nextLayoutPosition.box = nextLayoutPosition.row.boxes[nextLayoutPosition.boxIndex];
                return nextLayoutPosition;
            }
            nextLayoutPosition.boxIndex = 0;
            if (nextLayoutPosition.advanceToNextRow(this.control.layout)) {
                nextLayoutPosition.box = nextLayoutPosition.row.boxes[0];
                return nextLayoutPosition;
            }
            else
                return layoutPosition;
        };
        return GoToNextCharacterCommandBase;
    }(__aspxRichEdit.SelectionCommandBase));
    __aspxRichEdit.GoToNextCharacterCommandBase = GoToNextCharacterCommandBase;
    var GoToNextCharacterCommand = (function (_super) {
        __extends(GoToNextCharacterCommand, _super);
        function GoToNextCharacterCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToNextCharacterCommand.prototype.setSelection = function (position) {
            this.control.selection.deprecatedSetSelection(position, position, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
        };
        GoToNextCharacterCommand.prototype.extendSelection = function () {
            return false;
        };
        return GoToNextCharacterCommand;
    }(GoToNextCharacterCommandBase));
    __aspxRichEdit.GoToNextCharacterCommand = GoToNextCharacterCommand;
    var ExtendGoToNextCharacterCommand = (function (_super) {
        __extends(ExtendGoToNextCharacterCommand, _super);
        function ExtendGoToNextCharacterCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ExtendGoToNextCharacterCommand.prototype.setSelection = function (position) {
            var selection = this.control.selection;
            selection.extendLastSelection(position, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes, __aspxRichEdit.Field.jumpThroughFieldToRight);
        };
        ExtendGoToNextCharacterCommand.prototype.extendSelection = function () {
            return true;
        };
        ExtendGoToNextCharacterCommand.prototype.executeCore = function (state, options) {
            var selection = this.control.selection;
            var tableInfo = selection.tableInfo;
            var rawTblInfo = tableInfo.rawData;
            var canSelectCell = tableInfo.isSelected && rawTblInfo.areCellsSelectedInSeries && rawTblInfo.atLeastOneCellFullySelected(selection);
            if (!canSelectCell)
                return _super.prototype.executeCore.call(this, state, options);
            var forward = selection.forwardDirection || rawTblInfo.firstRowInfo.cells.length == 1;
            var lastRow = forward ? rawTblInfo.lastRowInfo : rawTblInfo.firstRowInfo;
            var cell = lastRow.row[(forward ? __aspxRichEdit.ListUtils.last(lastRow.cells) : lastRow.cells[0]).cellIndex + 1];
            if (cell) {
                return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.SelectTableCellsRange).execute(this.control.commandManager.isPublicApiCall, forward ? {
                    firstCell: rawTblInfo.firstCell,
                    lastCell: cell
                } : {
                    firstCell: rawTblInfo.lastCell,
                    lastCell: cell
                });
            }
            return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ExtendLineDown).execute(this.control.commandManager.isPublicApiCall);
        };
        return ExtendGoToNextCharacterCommand;
    }(GoToNextCharacterCommandBase));
    __aspxRichEdit.ExtendGoToNextCharacterCommand = ExtendGoToNextCharacterCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GoToNextPageCommandBase = (function (_super) {
        __extends(GoToNextPageCommandBase, _super);
        function GoToNextPageCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToNextPageCommandBase.prototype.getPosition = function () {
            var selection = this.control.selection;
            var initPosition = selection.forwardDirection ? selection.getLastSelectedInterval().end : selection.getLastSelectedInterval().start;
            var layoutPosition = new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.control.layout, this.control.model.activeSubDocument, initPosition, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
            if (!layoutPosition)
                return -1;
            var charOffset = initPosition - layoutPosition.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Box);
            var x = layoutPosition.pageArea.x + layoutPosition.column.x + layoutPosition.row.x + layoutPosition.box.x + layoutPosition.box.getCharOffsetXInPixels(this.control.measurer, charOffset);
            var y = layoutPosition.pageArea.y + layoutPosition.column.y + layoutPosition.row.y + layoutPosition.box.y;
            var siblingPageIndex = layoutPosition.pageIndex + 1;
            var siblingPage = this.control.layoutFormatterManager.forceFormatPage(siblingPageIndex);
            if (siblingPage) {
                var point = new __aspxRichEdit.LayoutPoint(siblingPageIndex, x, y);
                var htr = this.control.hitTestManager.calculate(point, __aspxRichEdit.DocumentLayoutDetailsLevel.Character, this.control.model.activeSubDocument);
                if (!this.extendSelection())
                    htr.correctAsVisibleBox();
                return htr.getPosition();
            }
            else
                return this.control.model.activeSubDocument.getDocumentEndPosition() - 1;
        };
        GoToNextPageCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && this.control.model.activeSubDocument.isMain();
        };
        return GoToNextPageCommandBase;
    }(__aspxRichEdit.SelectionCommandBase));
    __aspxRichEdit.GoToNextPageCommandBase = GoToNextPageCommandBase;
    var GoToNextPageCommand = (function (_super) {
        __extends(GoToNextPageCommand, _super);
        function GoToNextPageCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToNextPageCommand.prototype.executeCore = function (_state, _parameter) {
            var selection = this.control.selection;
            var position = this.getPosition();
            if (position < 0)
                return false;
            selection.deprecatedSetSelection(position, position, selection.endOfLine, selection.keepX, __aspxRichEdit.UpdateInputPositionProperties.Yes);
            return true;
        };
        GoToNextPageCommand.prototype.extendSelection = function () {
            return false;
        };
        return GoToNextPageCommand;
    }(GoToNextPageCommandBase));
    __aspxRichEdit.GoToNextPageCommand = GoToNextPageCommand;
    var ExtendGoToNextPageCommand = (function (_super) {
        __extends(ExtendGoToNextPageCommand, _super);
        function ExtendGoToNextPageCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ExtendGoToNextPageCommand.prototype.executeCore = function (_state, _parameter) {
            var selection = this.control.selection;
            var position = this.getPosition();
            if (position < 0)
                return false;
            selection.extendLastSelection(position, selection.endOfLine, selection.keepX);
            return true;
        };
        ExtendGoToNextPageCommand.prototype.extendSelection = function () {
            return true;
        };
        return ExtendGoToNextPageCommand;
    }(GoToNextPageCommandBase));
    __aspxRichEdit.ExtendGoToNextPageCommand = ExtendGoToNextPageCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GoToNextWordCommandBase = (function (_super) {
        __extends(GoToNextWordCommandBase, _super);
        function GoToNextWordCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToNextWordCommandBase.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        GoToNextWordCommandBase.prototype.getStartPosition = function () {
            var selection = this.control.selection;
            return selection.forwardDirection ? selection.getLastSelectedInterval().end : selection.getLastSelectedInterval().start;
        };
        GoToNextWordCommandBase.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return GoToNextWordCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.GoToNextWordCommandBase = GoToNextWordCommandBase;
    var GoToNextWordCommand = (function (_super) {
        __extends(GoToNextWordCommand, _super);
        function GoToNextWordCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToNextWordCommand.prototype.executeCore = function (_state, _options) {
            var selection = this.control.selection;
            var subDocument = this.control.model.activeSubDocument;
            var position = __aspxRichEdit.LayoutWordBounds.getLayoutWordEndBound(this.control.layout, subDocument, selection, this.getStartPosition(), true);
            if (position == subDocument.getDocumentEndPosition())
                position--;
            selection.deprecatedSetSelection(position, position, false, selection.keepX, __aspxRichEdit.UpdateInputPositionProperties.Yes);
            return true;
        };
        return GoToNextWordCommand;
    }(GoToNextWordCommandBase));
    __aspxRichEdit.GoToNextWordCommand = GoToNextWordCommand;
    var ExtendGoToNextWordCommand = (function (_super) {
        __extends(ExtendGoToNextWordCommand, _super);
        function ExtendGoToNextWordCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ExtendGoToNextWordCommand.prototype.executeCore = function (_state, _options) {
            var selection = this.control.selection;
            var position = __aspxRichEdit.LayoutWordBounds.getLayoutWordEndBound(this.control.layout, this.control.model.activeSubDocument, selection, this.getStartPosition(), true);
            selection.extendLastSelection(position, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes, __aspxRichEdit.Field.jumpThroughFieldToRight);
            return true;
        };
        return ExtendGoToNextWordCommand;
    }(GoToNextWordCommandBase));
    __aspxRichEdit.ExtendGoToNextWordCommand = ExtendGoToNextWordCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GoToParagraphEndCommandBase = (function (_super) {
        __extends(GoToParagraphEndCommandBase, _super);
        function GoToParagraphEndCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToParagraphEndCommandBase.prototype.executeCore = function (_state, _options) {
            var selection = this.control.selection;
            var position = this.getPositionEndParagraph();
            if (position < 0)
                return false;
            if (this.extendSelection())
                selection.extendLastSelection(position, false, selection.keepX);
            else
                selection.deprecatedSetSelection(position, position, false, selection.keepX, __aspxRichEdit.UpdateInputPositionProperties.Yes);
            return true;
        };
        GoToParagraphEndCommandBase.prototype.getPositionEndParagraph = function () {
            var selection = this.control.selection;
            var subDocument = this.control.model.activeSubDocument;
            var layout = this.control.layout;
            var lastPageEndPos = subDocument.isMain() ? layout.getLastValidPage().getEndPosition() : layout.pages[selection.pageIndex].otherPageAreas[subDocument.id].getEndPosition();
            var currentPos = selection.forwardDirection ? selection.getLastSelectedInterval().end : selection.getLastSelectedInterval().start;
            var boxIterator = subDocument.isMain() ? new __aspxRichEdit.LayoutBoxIteratorMainSubDocument(subDocument, layout, currentPos, lastPageEndPos) :
                new __aspxRichEdit.LayoutBoxIteratorOtherSubDocument(subDocument, layout, currentPos, lastPageEndPos, this.control.selection.pageIndex);
            if (!boxIterator.isInitialized())
                return -1;
            while (boxIterator.moveNext(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true))) {
                if (boxIterator.position.box.getType() == __aspxRichEdit.LayoutBoxType.ParagraphMark || boxIterator.position.box.getType() == __aspxRichEdit.LayoutBoxType.SectionMark) {
                    boxIterator.moveNext(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true));
                    if (boxIterator.position.getLogPosition() == lastPageEndPos)
                        return boxIterator.position.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Box);
                    return boxIterator.position.getLogPosition();
                }
            }
            if (boxIterator.position.box.getType() == __aspxRichEdit.LayoutBoxType.ParagraphMark || boxIterator.position.box.getType() == __aspxRichEdit.LayoutBoxType.SectionMark)
                return boxIterator.position.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Box);
            return boxIterator.position.getLogPosition();
        };
        return GoToParagraphEndCommandBase;
    }(__aspxRichEdit.SelectionCommandBase));
    __aspxRichEdit.GoToParagraphEndCommandBase = GoToParagraphEndCommandBase;
    var GoToParagraphEndCommand = (function (_super) {
        __extends(GoToParagraphEndCommand, _super);
        function GoToParagraphEndCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToParagraphEndCommand.prototype.extendSelection = function () {
            return false;
        };
        return GoToParagraphEndCommand;
    }(GoToParagraphEndCommandBase));
    __aspxRichEdit.GoToParagraphEndCommand = GoToParagraphEndCommand;
    var ExtendGoToParagraphEndCommand = (function (_super) {
        __extends(ExtendGoToParagraphEndCommand, _super);
        function ExtendGoToParagraphEndCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ExtendGoToParagraphEndCommand.prototype.extendSelection = function () {
            return true;
        };
        return ExtendGoToParagraphEndCommand;
    }(GoToParagraphEndCommandBase));
    __aspxRichEdit.ExtendGoToParagraphEndCommand = ExtendGoToParagraphEndCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GoToParagraphStartCommandBase = (function (_super) {
        __extends(GoToParagraphStartCommandBase, _super);
        function GoToParagraphStartCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToParagraphStartCommandBase.prototype.executeCore = function (_state, _options) {
            var position = this.getPositionStartParagraph();
            if (position < 0)
                return false;
            var selection = this.control.selection;
            if (this.extendSelection())
                selection.extendLastSelection(position, false, selection.keepX);
            else
                selection.deprecatedSetSelection(position, position, false, selection.keepX, __aspxRichEdit.UpdateInputPositionProperties.Yes);
            return true;
        };
        GoToParagraphStartCommandBase.prototype.getPositionStartParagraph = function () {
            var selection = this.control.selection;
            var layout = this.control.layout;
            var subDocument = this.control.model.activeSubDocument;
            var firstPageStartPos = layout.pages[0].getPosition();
            var currentPos = selection.forwardDirection ? selection.getLastSelectedInterval().end : selection.getLastSelectedInterval().start;
            var boxIterator = subDocument.isMain() ? new __aspxRichEdit.LayoutBoxIteratorMainSubDocument(subDocument, layout, firstPageStartPos, currentPos) : new __aspxRichEdit.LayoutBoxIteratorOtherSubDocument(subDocument, layout, firstPageStartPos, currentPos, this.control.selection.pageIndex);
            if (!boxIterator.isInitialized())
                return -1;
            boxIterator.movePrev(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true));
            if (boxIterator.position.getLogPosition() ==
                (this.control.model.activeSubDocument.isMain() ? layout.getLastValidPage().getEndPosition() : layout.pages[selection.pageIndex].otherPageAreas[subDocument.id].getEndPosition())) {
                if (boxIterator.position.box.getType() == __aspxRichEdit.LayoutBoxType.ParagraphMark || boxIterator.position.box.getType() == __aspxRichEdit.LayoutBoxType.SectionMark)
                    return boxIterator.position.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Box);
                return boxIterator.position.getLogPosition();
            }
            if (boxIterator.position.charOffset == 0)
                boxIterator.movePrev(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true));
            while (boxIterator.movePrev(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true))) {
                if (boxIterator.position.box.getType() == __aspxRichEdit.LayoutBoxType.ParagraphMark || boxIterator.position.box.getType() == __aspxRichEdit.LayoutBoxType.SectionMark) {
                    boxIterator.moveNext(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true));
                    return boxIterator.position.getLogPosition();
                }
            }
            return firstPageStartPos;
        };
        return GoToParagraphStartCommandBase;
    }(__aspxRichEdit.SelectionCommandBase));
    __aspxRichEdit.GoToParagraphStartCommandBase = GoToParagraphStartCommandBase;
    var GoToParagraphStartCommand = (function (_super) {
        __extends(GoToParagraphStartCommand, _super);
        function GoToParagraphStartCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToParagraphStartCommand.prototype.extendSelection = function () {
            return false;
        };
        return GoToParagraphStartCommand;
    }(GoToParagraphStartCommandBase));
    __aspxRichEdit.GoToParagraphStartCommand = GoToParagraphStartCommand;
    var ExtendGoToParagraphStartCommand = (function (_super) {
        __extends(ExtendGoToParagraphStartCommand, _super);
        function ExtendGoToParagraphStartCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ExtendGoToParagraphStartCommand.prototype.extendSelection = function () {
            return true;
        };
        return ExtendGoToParagraphStartCommand;
    }(GoToParagraphStartCommandBase));
    __aspxRichEdit.ExtendGoToParagraphStartCommand = ExtendGoToParagraphStartCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GoToPrevCharacterCommandBase = (function (_super) {
        __extends(GoToPrevCharacterCommandBase, _super);
        function GoToPrevCharacterCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToPrevCharacterCommandBase.prototype.executeCore = function (_state, _options) {
            var position = this.getPosition();
            if (position == -1)
                return false;
            this.setSelection(position);
            return true;
        };
        GoToPrevCharacterCommandBase.prototype.getPosition = function () {
            var selection = this.control.selection;
            var subDocument = this.control.model.activeSubDocument;
            var initialModelPosition = selection.forwardDirection ? selection.getLastSelectedInterval().end : selection.getLastSelectedInterval().start;
            var initialLayoutPosition = subDocument.isMain()
                ? __aspxRichEdit.LayoutPositionMainSubDocumentCreator.ensureLayoutPosition(this.control, this.control.layout, subDocument, initialModelPosition, __aspxRichEdit.DocumentLayoutDetailsLevel.Character, new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false))
                : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.layout, subDocument, initialModelPosition, selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                    .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
            var prevCharLayoutPosition;
            if (this.extendSelection()) {
                prevCharLayoutPosition = this.getPrevCharacterPosition(initialLayoutPosition);
            }
            else {
                if (!selection.isCollapsed()) {
                    if (selection.forwardDirection) {
                        var selectionEndPosition = selection.getLastSelectedInterval().start;
                        return (subDocument.isMain()
                            ? __aspxRichEdit.LayoutPositionMainSubDocumentCreator.ensureLayoutPosition(this.control, this.control.layout, subDocument, selectionEndPosition, __aspxRichEdit.DocumentLayoutDetailsLevel.Character, new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true))
                            : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.layout, subDocument, selectionEndPosition, selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                                .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true))).getLogPosition();
                    }
                    else
                        return initialLayoutPosition.getLogPosition();
                }
                prevCharLayoutPosition = this.getPrevCharacterPosition(initialLayoutPosition);
                if (!prevCharLayoutPosition.box.isVisible() && !prevCharLayoutPosition.isPositionBeforeFirstBoxInRow()) {
                    do {
                        var prevLP = prevCharLayoutPosition;
                        prevCharLayoutPosition = this.getPrevCharacterPosition(prevCharLayoutPosition);
                    } while (!prevCharLayoutPosition.box.isVisible() && prevLP !== prevCharLayoutPosition);
                    prevCharLayoutPosition = prevLP;
                }
            }
            var prevCharModelPosition = prevCharLayoutPosition.getLogPosition();
            return prevCharModelPosition == initialModelPosition ? -1 : prevCharModelPosition;
        };
        GoToPrevCharacterCommandBase.prototype.getPrevCharacterPosition = function (layoutPosition) {
            var prevLayoutPosition = layoutPosition.clone();
            if (prevLayoutPosition.charOffset > 0) {
                prevLayoutPosition.charOffset--;
                return prevLayoutPosition;
            }
            if (prevLayoutPosition.boxIndex - 1 >= 0) {
                prevLayoutPosition.boxIndex--;
                prevLayoutPosition.box = prevLayoutPosition.row.boxes[prevLayoutPosition.boxIndex];
                prevLayoutPosition.charOffset = prevLayoutPosition.box.getLength() - 1;
                return prevLayoutPosition;
            }
            if (prevLayoutPosition.advanceToPrevRow(this.control.layout)) {
                prevLayoutPosition.boxIndex = prevLayoutPosition.row.boxes.length - 1;
                prevLayoutPosition.box = prevLayoutPosition.row.boxes[prevLayoutPosition.boxIndex];
                prevLayoutPosition.charOffset = prevLayoutPosition.box.getLength() - 1;
                return prevLayoutPosition;
            }
            else
                return layoutPosition;
        };
        return GoToPrevCharacterCommandBase;
    }(__aspxRichEdit.SelectionCommandBase));
    __aspxRichEdit.GoToPrevCharacterCommandBase = GoToPrevCharacterCommandBase;
    var GoToPrevCharacterCommand = (function (_super) {
        __extends(GoToPrevCharacterCommand, _super);
        function GoToPrevCharacterCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToPrevCharacterCommand.prototype.setSelection = function (position) {
            this.control.selection.deprecatedSetSelection(position, position, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
        };
        GoToPrevCharacterCommand.prototype.extendSelection = function () {
            return false;
        };
        return GoToPrevCharacterCommand;
    }(GoToPrevCharacterCommandBase));
    __aspxRichEdit.GoToPrevCharacterCommand = GoToPrevCharacterCommand;
    var ExtendGoToPrevCharacterCommand = (function (_super) {
        __extends(ExtendGoToPrevCharacterCommand, _super);
        function ExtendGoToPrevCharacterCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ExtendGoToPrevCharacterCommand.prototype.setSelection = function (position) {
            var selection = this.control.selection;
            selection.extendLastSelection(position, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes, __aspxRichEdit.Field.jumpThroughFieldToLeft);
        };
        ExtendGoToPrevCharacterCommand.prototype.extendSelection = function () {
            return true;
        };
        ExtendGoToPrevCharacterCommand.prototype.executeCore = function (state, options) {
            var selection = this.control.selection;
            var tableInfo = selection.tableInfo;
            var rawTblInfo = tableInfo.rawData;
            var canSelectCell = tableInfo.isSelected && rawTblInfo.areCellsSelectedInSeries && rawTblInfo.atLeastOneCellFullySelected(selection);
            if (!canSelectCell)
                return _super.prototype.executeCore.call(this, state, options);
            var forward = selection.forwardDirection || rawTblInfo.firstRowInfo.cells.length == 1;
            var lastRow = forward ? rawTblInfo.lastRowInfo : rawTblInfo.firstRowInfo;
            var cell = lastRow.row[(forward ? __aspxRichEdit.ListUtils.last(lastRow.cells) : lastRow.cells[0]).cellIndex - 1];
            if (cell) {
                return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.SelectTableCellsRange).execute(this.control.commandManager.isPublicApiCall, forward ? {
                    firstCell: rawTblInfo.firstCell,
                    lastCell: cell
                } : {
                    firstCell: rawTblInfo.lastCell,
                    lastCell: cell
                });
            }
            return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ExtendLineUp).execute(this.control.commandManager.isPublicApiCall);
        };
        return ExtendGoToPrevCharacterCommand;
    }(GoToPrevCharacterCommandBase));
    __aspxRichEdit.ExtendGoToPrevCharacterCommand = ExtendGoToPrevCharacterCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GoToPrevPageCommandBase = (function (_super) {
        __extends(GoToPrevPageCommandBase, _super);
        function GoToPrevPageCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToPrevPageCommandBase.prototype.getPosition = function () {
            var selection = this.control.selection;
            var initPosition = selection.forwardDirection ? selection.getLastSelectedInterval().end : selection.getLastSelectedInterval().start;
            var layoutPosition = new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.control.layout, this.control.model.activeSubDocument, initPosition, __aspxRichEdit.DocumentLayoutDetailsLevel.Box)
                .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true));
            if (!layoutPosition)
                return -1;
            var charOffset = initPosition - layoutPosition.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Box);
            var x = layoutPosition.pageArea.x + layoutPosition.column.x + layoutPosition.row.x + layoutPosition.box.x + layoutPosition.box.getCharOffsetXInPixels(this.control.measurer, charOffset);
            var y = layoutPosition.pageArea.y + layoutPosition.column.y + layoutPosition.row.y + layoutPosition.box.y;
            var siblingPageIndex = layoutPosition.pageIndex - 1;
            var siblingPage = this.control.layout.pages[siblingPageIndex];
            var position = initPosition;
            if (siblingPage) {
                var point = new __aspxRichEdit.LayoutPoint(siblingPageIndex, x, y);
                var htr = this.control.hitTestManager.calculate(point, __aspxRichEdit.DocumentLayoutDetailsLevel.Character, this.control.model.activeSubDocument);
                if (!this.extendSelection())
                    htr.correctAsVisibleBox();
                position = htr.getPosition();
            }
            else
                position = 0;
            return position;
        };
        GoToPrevPageCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && this.control.model.activeSubDocument.isMain();
        };
        return GoToPrevPageCommandBase;
    }(__aspxRichEdit.SelectionCommandBase));
    __aspxRichEdit.GoToPrevPageCommandBase = GoToPrevPageCommandBase;
    var GoToPrevPageCommand = (function (_super) {
        __extends(GoToPrevPageCommand, _super);
        function GoToPrevPageCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToPrevPageCommand.prototype.executeCore = function (_state, _options) {
            var selection = this.control.selection;
            var position = this.getPosition();
            if (position < 0)
                return false;
            selection.deprecatedSetSelection(position, position, selection.endOfLine, selection.keepX, __aspxRichEdit.UpdateInputPositionProperties.Yes);
            return true;
        };
        GoToPrevPageCommand.prototype.extendSelection = function () {
            return false;
        };
        return GoToPrevPageCommand;
    }(GoToPrevPageCommandBase));
    __aspxRichEdit.GoToPrevPageCommand = GoToPrevPageCommand;
    var ExtendGoToPrevPageCommand = (function (_super) {
        __extends(ExtendGoToPrevPageCommand, _super);
        function ExtendGoToPrevPageCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ExtendGoToPrevPageCommand.prototype.executeCore = function (_state, _options) {
            var selection = this.control.selection;
            var position = this.getPosition();
            if (position < 0)
                return false;
            selection.extendLastSelection(position, selection.endOfLine, selection.keepX);
            return true;
        };
        ExtendGoToPrevPageCommand.prototype.extendSelection = function () {
            return true;
        };
        return ExtendGoToPrevPageCommand;
    }(GoToPrevPageCommandBase));
    __aspxRichEdit.ExtendGoToPrevPageCommand = ExtendGoToPrevPageCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GoToPrevWordCommandBase = (function (_super) {
        __extends(GoToPrevWordCommandBase, _super);
        function GoToPrevWordCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToPrevWordCommandBase.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        GoToPrevWordCommandBase.prototype.getStartPosition = function () {
            var selection = this.control.selection;
            return (selection.forwardDirection ? selection.getLastSelectedInterval().end : selection.getLastSelectedInterval().start);
        };
        GoToPrevWordCommandBase.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return GoToPrevWordCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.GoToPrevWordCommandBase = GoToPrevWordCommandBase;
    var GoToPrevWordCommand = (function (_super) {
        __extends(GoToPrevWordCommand, _super);
        function GoToPrevWordCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToPrevWordCommand.prototype.executeCore = function (_state, _options) {
            var selection = this.control.selection;
            var startPos = this.getStartPosition();
            var position = __aspxRichEdit.LayoutWordBounds.getLayoutWordStartBound(this.control.layout, this.control.model.activeSubDocument, selection, startPos);
            if (position == startPos)
                position = __aspxRichEdit.LayoutWordBounds.getLayoutWordStartBound(this.control.layout, this.control.model.activeSubDocument, selection, position - 1);
            selection.deprecatedSetSelection(position, position, selection.endOfLine, selection.keepX, __aspxRichEdit.UpdateInputPositionProperties.Yes);
            return true;
        };
        return GoToPrevWordCommand;
    }(GoToPrevWordCommandBase));
    __aspxRichEdit.GoToPrevWordCommand = GoToPrevWordCommand;
    var ExtendGoToPrevWordCommand = (function (_super) {
        __extends(ExtendGoToPrevWordCommand, _super);
        function ExtendGoToPrevWordCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ExtendGoToPrevWordCommand.prototype.executeCore = function (_state, _options) {
            var selection = this.control.selection;
            var startPos = this.getStartPosition();
            var position = __aspxRichEdit.LayoutWordBounds.getLayoutWordStartBound(this.control.layout, this.control.model.activeSubDocument, selection, startPos);
            if (position == startPos)
                position = __aspxRichEdit.LayoutWordBounds.getLayoutWordStartBound(this.control.layout, this.control.model.activeSubDocument, selection, position - 1);
            selection.extendLastSelection(position, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes, __aspxRichEdit.Field.jumpThroughFieldToLeft);
            return true;
        };
        return ExtendGoToPrevWordCommand;
    }(GoToPrevWordCommandBase));
    __aspxRichEdit.ExtendGoToPrevWordCommand = ExtendGoToPrevWordCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GoToStartPageCommandBase = (function (_super) {
        __extends(GoToStartPageCommandBase, _super);
        function GoToStartPageCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToStartPageCommandBase.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        GoToStartPageCommandBase.prototype.executeCore = function (_state, _options) {
            var selection = this.control.selection;
            var subDocument = this.control.model.activeSubDocument;
            var layout = this.control.layout;
            var position = selection.getLastSelectedInterval().start;
            var pageIndex = subDocument.isMain() ?
                __aspxRichEdit.LayoutPositionMainSubDocumentCreator.ensureLayoutPosition(this.control, layout, subDocument, position, __aspxRichEdit.DocumentLayoutDetailsLevel.Page, new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true)).pageIndex :
                selection.pageIndex;
            var newPageIndex = this.getNewPageIndex(pageIndex);
            var page = this.control.layoutFormatterManager.forceFormatPage(newPageIndex);
            var newPosition = (page ? page : __aspxRichEdit.ListUtils.last(layout.pages)).getPosition();
            if (selection.isCollapsed() && position == newPosition)
                return false;
            this.setNewSelection(newPosition);
            selection.scrollManager.setScroll(new __aspxRichEdit.Scroll.State().byModelPosition
                .setModelPosition(newPosition)
                .useStdRelativePosition()
                .useStdOffset());
            return true;
        };
        return GoToStartPageCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.GoToStartPageCommandBase = GoToStartPageCommandBase;
    var GoToStartNextPageCommand = (function (_super) {
        __extends(GoToStartNextPageCommand, _super);
        function GoToStartNextPageCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToStartNextPageCommand.prototype.getNewPageIndex = function (pageIndex) {
            return pageIndex + 1;
        };
        GoToStartNextPageCommand.prototype.setNewSelection = function (newPosition) {
            this.control.selection.deprecatedSetSelection(newPosition, newPosition, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes, true, true, __aspxRichEdit.ModelScrollManager.DontChangeScrollPosition);
        };
        return GoToStartNextPageCommand;
    }(GoToStartPageCommandBase));
    __aspxRichEdit.GoToStartNextPageCommand = GoToStartNextPageCommand;
    var GoToStartPrevPageCommand = (function (_super) {
        __extends(GoToStartPrevPageCommand, _super);
        function GoToStartPrevPageCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GoToStartPrevPageCommand.prototype.getNewPageIndex = function (pageIndex) {
            return Math.max(0, pageIndex - 1);
        };
        GoToStartPrevPageCommand.prototype.setNewSelection = function (newPosition) {
            this.control.selection.deprecatedSetSelection(newPosition, newPosition, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes, true, true, __aspxRichEdit.ModelScrollManager.DontChangeScrollPosition);
        };
        return GoToStartPrevPageCommand;
    }(GoToStartPageCommandBase));
    __aspxRichEdit.GoToStartPrevPageCommand = GoToStartPrevPageCommand;
    var ExtendGoToStartNextPageCommand = (function (_super) {
        __extends(ExtendGoToStartNextPageCommand, _super);
        function ExtendGoToStartNextPageCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ExtendGoToStartNextPageCommand.prototype.setNewSelection = function (newPosition) {
            this.control.selection.extendLastSelection(newPosition, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes, function () { });
        };
        return ExtendGoToStartNextPageCommand;
    }(GoToStartNextPageCommand));
    __aspxRichEdit.ExtendGoToStartNextPageCommand = ExtendGoToStartNextPageCommand;
    var ExtendGoToStartPrevPageCommand = (function (_super) {
        __extends(ExtendGoToStartPrevPageCommand, _super);
        function ExtendGoToStartPrevPageCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ExtendGoToStartPrevPageCommand.prototype.setNewSelection = function (newPosition) {
            this.control.selection.extendLastSelection(newPosition, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes, function () { });
        };
        return ExtendGoToStartPrevPageCommand;
    }(GoToStartPrevPageCommand));
    __aspxRichEdit.ExtendGoToStartPrevPageCommand = ExtendGoToStartPrevPageCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SelectAllDocumentCommand = (function (_super) {
        __extends(SelectAllDocumentCommand, _super);
        function SelectAllDocumentCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SelectAllDocumentCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        SelectAllDocumentCommand.prototype.executeCore = function (_state, _options) {
            if (!this.control.layout.isFullyFormatted)
                this.control.layoutFormatterManager.formatSyncAllDocument();
            this.control.selection.deprecatedSetSelection(0, this.control.model.activeSubDocument.getDocumentEndPosition(), true, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes, true, true, __aspxRichEdit.ModelScrollManager.DontChangeScrollPosition);
            this.control.focusManager.captureFocus();
            return true;
        };
        SelectAllDocumentCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return SelectAllDocumentCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.SelectAllDocumentCommand = SelectAllDocumentCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SelectLineCommand = (function (_super) {
        __extends(SelectLineCommand, _super);
        function SelectLineCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SelectLineCommand.prototype.executeCore = function (_state, options) {
            var selection = this.control.selection;
            var subDocument = this.control.model.activeSubDocument;
            var clickLayoutPosition = (subDocument.isMain()
                ? new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.control.layout, subDocument, options.param, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.layout, subDocument, options.param, selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character))
                .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true));
            if (!clickLayoutPosition)
                return false;
            var clickRowEndBox = clickLayoutPosition.row.boxes[clickLayoutPosition.row.boxes.length - 1];
            var clickRowStartPosition = clickLayoutPosition.getRelatedSubDocumentPagePosition() + clickLayoutPosition.pageArea.pageOffset + clickLayoutPosition.column.pageAreaOffset + clickLayoutPosition.row.columnOffset;
            var clickRowEndPosition = clickRowStartPosition + clickRowEndBox.rowOffset + clickRowEndBox.getLength();
            this.setSelection(clickRowStartPosition, clickRowEndPosition);
            return true;
        };
        SelectLineCommand.prototype.setSelection = function (startPosition, endPosition) {
            this.control.selection.deprecatedSetSelection(startPosition, endPosition, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
        };
        return SelectLineCommand;
    }(__aspxRichEdit.SelectionCommandBase));
    __aspxRichEdit.SelectLineCommand = SelectLineCommand;
    var AddSelectedLineCommandNoUpdateControlState = (function (_super) {
        __extends(AddSelectedLineCommandNoUpdateControlState, _super);
        function AddSelectedLineCommandNoUpdateControlState() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        AddSelectedLineCommandNoUpdateControlState.prototype.setSelection = function (startPosition, endPosition) {
            this.control.selection.addSelection(startPosition, endPosition, false, -1);
        };
        AddSelectedLineCommandNoUpdateControlState.prototype.lockInputPositionUpdating = function (_prevModifiedState) {
            return true;
        };
        AddSelectedLineCommandNoUpdateControlState.prototype.lockUIUpdating = function (_prevModifiedState) {
            return true;
        };
        return AddSelectedLineCommandNoUpdateControlState;
    }(SelectLineCommand));
    __aspxRichEdit.AddSelectedLineCommandNoUpdateControlState = AddSelectedLineCommandNoUpdateControlState;
    var ExtendSelectLineCommand = (function (_super) {
        __extends(ExtendSelectLineCommand, _super);
        function ExtendSelectLineCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ExtendSelectLineCommand.prototype.executeCore = function (_state, options) {
            var clickPosition = options.param;
            var selection = this.control.selection;
            var currentInterval = selection.getLastSelectedInterval();
            var intervalEnd = currentInterval.end;
            if (intervalEnd == this.control.model.activeSubDocument.getDocumentEndPosition())
                intervalEnd--;
            var subDocument = this.control.model.activeSubDocument;
            var startSelectionRowStartLayoutPosition = (subDocument.isMain()
                ? new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.control.layout, subDocument, currentInterval.start, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.layout, subDocument, currentInterval.start, selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character))
                .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
            if (!startSelectionRowStartLayoutPosition)
                return false;
            var startSelectionEndBox = startSelectionRowStartLayoutPosition.row.boxes[startSelectionRowStartLayoutPosition.row.boxes.length - 1];
            var endSelectionRowStartLayoutPosition = (subDocument.isMain()
                ? new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.control.layout, subDocument, intervalEnd, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.layout, subDocument, intervalEnd, selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character))
                .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
            if (!endSelectionRowStartLayoutPosition)
                return false;
            var endSelectionEndBox = endSelectionRowStartLayoutPosition.row.boxes[endSelectionRowStartLayoutPosition.row.boxes.length - 1];
            var clickRowStartLayoutPosition = (subDocument.isMain()
                ? new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.control.layout, subDocument, clickPosition, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.layout, subDocument, clickPosition, selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character))
                .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
            if (!clickRowStartLayoutPosition)
                return false;
            var clickEndBox = clickRowStartLayoutPosition.row.boxes[clickRowStartLayoutPosition.row.boxes.length - 1];
            var startSelectionRowStartPosition = startSelectionRowStartLayoutPosition.getRelatedSubDocumentPagePosition() + startSelectionRowStartLayoutPosition.pageArea.pageOffset +
                startSelectionRowStartLayoutPosition.column.pageAreaOffset + startSelectionRowStartLayoutPosition.row.columnOffset;
            var startSelectionRowEndPosition = startSelectionRowStartPosition + startSelectionEndBox.rowOffset + startSelectionEndBox.getLength();
            var endSelectionRowStartPosition = endSelectionRowStartLayoutPosition.getRelatedSubDocumentPagePosition() + endSelectionRowStartLayoutPosition.pageArea.pageOffset +
                endSelectionRowStartLayoutPosition.column.pageAreaOffset + endSelectionRowStartLayoutPosition.row.columnOffset;
            var endSelectionRowEndPosition = endSelectionRowStartPosition + endSelectionEndBox.rowOffset + endSelectionEndBox.getLength();
            var clickStartRowPosition = clickRowStartLayoutPosition.getRelatedSubDocumentPagePosition() + clickRowStartLayoutPosition.pageArea.pageOffset +
                clickRowStartLayoutPosition.column.pageAreaOffset + clickRowStartLayoutPosition.row.columnOffset;
            var clickEndRowPosition = clickStartRowPosition + clickEndBox.rowOffset + clickEndBox.getLength();
            if (currentInterval.start == startSelectionRowStartPosition && currentInterval.end == endSelectionRowEndPosition) {
                if (selection.forwardDirection) {
                    if (clickStartRowPosition < startSelectionRowStartPosition)
                        selection.deprecatedSetSelection(startSelectionRowEndPosition, clickStartRowPosition, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
                    else
                        selection.deprecatedSetSelection(startSelectionRowStartPosition, clickEndRowPosition, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
                }
                else {
                    if (clickStartRowPosition >= endSelectionRowStartPosition)
                        selection.deprecatedSetSelection(endSelectionRowStartPosition, clickEndRowPosition, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
                    else
                        selection.deprecatedSetSelection(endSelectionRowEndPosition, clickStartRowPosition, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
                }
            }
            else {
                if (selection.forwardDirection) {
                    var selectionEnd = clickStartRowPosition <= currentInterval.start ? Math.min(clickStartRowPosition, startSelectionRowStartPosition) : clickStartRowPosition;
                    selection.deprecatedSetSelection(currentInterval.start, selectionEnd, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
                }
                else
                    selection.deprecatedSetSelection(intervalEnd, clickStartRowPosition, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
            }
            return true;
        };
        return ExtendSelectLineCommand;
    }(__aspxRichEdit.SelectionCommandBase));
    __aspxRichEdit.ExtendSelectLineCommand = ExtendSelectLineCommand;
    var SelectLineCommandNoUpdateControlState = (function (_super) {
        __extends(SelectLineCommandNoUpdateControlState, _super);
        function SelectLineCommandNoUpdateControlState() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SelectLineCommandNoUpdateControlState.prototype.lockInputPositionUpdating = function (_prevModifiedState) {
            return true;
        };
        SelectLineCommandNoUpdateControlState.prototype.lockUIUpdating = function (_prevModifiedState) {
            return true;
        };
        return SelectLineCommandNoUpdateControlState;
    }(SelectLineCommand));
    __aspxRichEdit.SelectLineCommandNoUpdateControlState = SelectLineCommandNoUpdateControlState;
    var ExtendSelectLineCommandNoUpdateControlState = (function (_super) {
        __extends(ExtendSelectLineCommandNoUpdateControlState, _super);
        function ExtendSelectLineCommandNoUpdateControlState() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ExtendSelectLineCommandNoUpdateControlState.prototype.lockInputPositionUpdating = function (_prevModifiedState) {
            return true;
        };
        ExtendSelectLineCommandNoUpdateControlState.prototype.lockUIUpdating = function (_prevModifiedState) {
            return true;
        };
        return ExtendSelectLineCommandNoUpdateControlState;
    }(ExtendSelectLineCommand));
    __aspxRichEdit.ExtendSelectLineCommandNoUpdateControlState = ExtendSelectLineCommandNoUpdateControlState;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SelectParagraphCommand = (function (_super) {
        __extends(SelectParagraphCommand, _super);
        function SelectParagraphCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SelectParagraphCommand.prototype.executeCore = function (_state, options) {
            var paragraphs = this.control.model.activeSubDocument.paragraphs;
            var paragraphIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(paragraphs, function (p) { return p.startLogPosition.value; }, options.param);
            var paragraph = paragraphs[paragraphIndex];
            this.control.selection.deprecatedSetSelection(paragraph.startLogPosition.value, paragraph.startLogPosition.value + paragraph.length, true, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
            return true;
        };
        return SelectParagraphCommand;
    }(__aspxRichEdit.SelectionCommandBase));
    __aspxRichEdit.SelectParagraphCommand = SelectParagraphCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SelectTableCommandBase = (function (_super) {
        __extends(SelectTableCommandBase, _super);
        function SelectTableCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SelectTableCommandBase.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.visible = this.control.selection.tableInfo.extendedData.numRows > 0;
            return state;
        };
        SelectTableCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables);
        };
        SelectTableCommandBase.prototype.addSelection = function (firstPos, lastPos, isFirstSelection) {
            if (isFirstSelection)
                this.control.selection.deprecatedSetSelection(firstPos, lastPos, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes, true, false);
            else
                this.control.selection.addSelection(firstPos, lastPos, false, -1, false);
        };
        SelectTableCommandBase.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return SelectTableCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.SelectTableCommandBase = SelectTableCommandBase;
    var SelectTableCellCommand = (function (_super) {
        __extends(SelectTableCellCommand, _super);
        function SelectTableCellCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SelectTableCellCommand.prototype.executeCore = function (_state, _options) {
            var _this = this;
            var tableInfo = this.control.selection.tableInfo;
            var isFirstCell = true;
            tableInfo.extendedData.foreach(function () { }, function (cellInfo) {
                var firstPos = cellInfo.cell.startParagraphPosition.value;
                var lastPos = cellInfo.cell.endParagrapPosition.value;
                _this.addSelection(firstPos, lastPos, isFirstCell);
                isFirstCell = false;
            });
            return true;
        };
        return SelectTableCellCommand;
    }(SelectTableCommandBase));
    __aspxRichEdit.SelectTableCellCommand = SelectTableCellCommand;
    var ExtendSelectTableCellCommand = (function (_super) {
        __extends(ExtendSelectTableCellCommand, _super);
        function ExtendSelectTableCellCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ExtendSelectTableCellCommand.prototype.addSelection = function (firstPos, lastPos, _isFirstSelection) {
            this.control.selection.addSelection(firstPos, lastPos, false, -1);
        };
        return ExtendSelectTableCellCommand;
    }(SelectTableCellCommand));
    __aspxRichEdit.ExtendSelectTableCellCommand = ExtendSelectTableCellCommand;
    var SelectTableColumnCommand = (function (_super) {
        __extends(SelectTableColumnCommand, _super);
        function SelectTableColumnCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SelectTableColumnCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            if (parameter)
                return parameter;
            var columnIndices = [];
            var tableInfo = this.control.selection.tableInfo;
            var table = tableInfo.table;
            var columnIndicesMap = {};
            tableInfo.extendedData.foreach(function () { }, function (cellInfo, rowInfo) {
                var startColumnIndex = tableInfo.gridInfoManager.tableCellInfos[rowInfo.rowIndex][cellInfo.cellIndex].getGridCellIndex();
                for (var span = 0; span < cellInfo.cell.columnSpan; span++) {
                    var columnIndex = startColumnIndex + span;
                    if (!columnIndicesMap[columnIndex]) {
                        columnIndices.push(columnIndex);
                        columnIndicesMap[columnIndex] = true;
                    }
                }
            });
            return { table: table, columnIndices: columnIndices };
        };
        SelectTableColumnCommand.prototype.executeCore = function (_state, options) {
            var table = options.param.table;
            var columnIndices = options.param.columnIndices;
            var isFirstItem = true;
            var prevAddedCell = null;
            for (var i = 0, columnIndex = void 0; (columnIndex = columnIndices[i]) !== undefined; i++) {
                for (var rowIndex = 0, row = void 0; row = table.rows[rowIndex]; rowIndex++) {
                    var cellIndex = __aspxRichEdit.TableCellUtils.getCellIndexByColumnIndex(row, columnIndex);
                    var cell = row.cells[cellIndex];
                    if (cell && prevAddedCell !== cell) {
                        var firstPos = cell.startParagraphPosition.value;
                        var lastPos = cell.endParagrapPosition.value;
                        this.addSelection(firstPos, lastPos, isFirstItem);
                        isFirstItem = false;
                    }
                    prevAddedCell = cell;
                }
            }
            return true;
        };
        return SelectTableColumnCommand;
    }(SelectTableCommandBase));
    __aspxRichEdit.SelectTableColumnCommand = SelectTableColumnCommand;
    var ExtendSelectTableColumnCommand = (function (_super) {
        __extends(ExtendSelectTableColumnCommand, _super);
        function ExtendSelectTableColumnCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ExtendSelectTableColumnCommand.prototype.addSelection = function (firstPos, lastPos, _isFirstSelection) {
            this.control.selection.addSelection(firstPos, lastPos, false, -1);
        };
        return ExtendSelectTableColumnCommand;
    }(SelectTableColumnCommand));
    __aspxRichEdit.ExtendSelectTableColumnCommand = ExtendSelectTableColumnCommand;
    var SelectTableRowCommandOptions = (function (_super) {
        __extends(SelectTableRowCommandOptions, _super);
        function SelectTableRowCommandOptions(control, table, rowIndices, forwardDirection) {
            var _this = _super.call(this, control) || this;
            if (table) {
                _this.forwardDirection = forwardDirection;
                _this.rows = __aspxRichEdit.ListUtils.map(rowIndices, function (rowIndex) { return table.rows[rowIndex]; });
            }
            else {
                _this.forwardDirection = control.selection.forwardDirection;
                _this.rows = __aspxRichEdit.ListUtils.map(control.selection.tableInfo.extendedData.rows, function (rowInfo) { return rowInfo.row; });
            }
            return _this;
        }
        return SelectTableRowCommandOptions;
    }(__aspxRichEdit.CommandOptions));
    __aspxRichEdit.SelectTableRowCommandOptions = SelectTableRowCommandOptions;
    var SelectTableRowCommand = (function (_super) {
        __extends(SelectTableRowCommand, _super);
        function SelectTableRowCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SelectTableRowCommand.prototype.executeCore = function (_state, options) {
            if (!options.isSetManually) {
                options = new SelectTableRowCommandOptions(this.control, null, [], false);
            }
            for (var i = 0, row = void 0; row = options.rows[i]; i++)
                this.addSelection(options.forwardDirection ? row.getStartPosition() : row.getEndPosition(), options.forwardDirection ? row.getEndPosition() : row.getStartPosition(), i === 0);
            return true;
        };
        return SelectTableRowCommand;
    }(SelectTableCommandBase));
    __aspxRichEdit.SelectTableRowCommand = SelectTableRowCommand;
    var ExtendSelectTableRowCommand = (function (_super) {
        __extends(ExtendSelectTableRowCommand, _super);
        function ExtendSelectTableRowCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ExtendSelectTableRowCommand.prototype.addSelection = function (firstPos, lastPos, _isFirstSelection) {
            this.control.selection.addSelection(firstPos, lastPos, false, -1);
        };
        return ExtendSelectTableRowCommand;
    }(SelectTableRowCommand));
    __aspxRichEdit.ExtendSelectTableRowCommand = ExtendSelectTableRowCommand;
    var SelectTableCommand = (function (_super) {
        __extends(SelectTableCommand, _super);
        function SelectTableCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SelectTableCommand.prototype.executeCore = function (_state) {
            var table = __aspxRichEdit.Table.getTableByPosition(this.control.model.activeSubDocument.tables, this.control.selection.intervals[0].start, true);
            var firstPos = table.getFirstCell().startParagraphPosition.value;
            var lastPos = table.getLastCell().endParagrapPosition.value;
            this.addSelection(firstPos, lastPos, true);
            return true;
        };
        return SelectTableCommand;
    }(SelectTableCommandBase));
    __aspxRichEdit.SelectTableCommand = SelectTableCommand;
    var ExtendSelectTableCommand = (function (_super) {
        __extends(ExtendSelectTableCommand, _super);
        function ExtendSelectTableCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ExtendSelectTableCommand.prototype.addSelection = function (firstPos, lastPos, _isFirstSelection) {
            this.control.selection.addSelection(firstPos, lastPos, false, -1);
        };
        return ExtendSelectTableCommand;
    }(SelectTableCommand));
    __aspxRichEdit.ExtendSelectTableCommand = ExtendSelectTableCommand;
    var SelectTableCellsRangeCommand = (function (_super) {
        __extends(SelectTableCellsRangeCommand, _super);
        function SelectTableCellsRangeCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SelectTableCellsRangeCommand.prototype.executeCore = function (_state, options) {
            var parameter = options.param;
            var forwardDirection = parameter.firstCell.startParagraphPosition.value <= parameter.lastCell.startParagraphPosition.value;
            if (parameter.lastCell.parentRow.parentTable !== parameter.firstCell.parentRow.parentTable)
                throw new Error("cells should be from the same table");
            var table = parameter.firstCell.parentRow.parentTable;
            var startColumnIndex = __aspxRichEdit.TableCellUtils.getStartColumnIndex(parameter.firstCell);
            var endColumnIndex = __aspxRichEdit.TableCellUtils.getStartColumnIndex(parameter.lastCell);
            var minColumnIndex = Math.min(startColumnIndex, endColumnIndex);
            var maxColumnIndex = Math.max(startColumnIndex + parameter.firstCell.columnSpan - 1, endColumnIndex + parameter.lastCell.columnSpan - 1);
            var startRowIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(table.rows, function (r) { return r.getStartPosition(); }, parameter.firstCell.startParagraphPosition.value);
            var endRowIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(table.rows, function (r) { return r.getStartPosition(); }, parameter.lastCell.startParagraphPosition.value);
            var minRowIndex = Math.min(startRowIndex, endRowIndex);
            var maxRowIndex = Math.max(startRowIndex, endRowIndex);
            var isFirstSelection = true;
            for (var rowIndex = minRowIndex; rowIndex <= maxRowIndex; rowIndex++) {
                var row = table.rows[rowIndex];
                var columnIndex = Math.max(row.gridBefore, minColumnIndex);
                if (columnIndex > maxColumnIndex)
                    continue;
                var cellIndex = __aspxRichEdit.TableCellUtils.getCellIndexByColumnIndex(row, columnIndex);
                while (columnIndex <= maxColumnIndex) {
                    var cell = row.cells[cellIndex];
                    if (!cell)
                        break;
                    this.addSelection(forwardDirection ? cell.startParagraphPosition.value : cell.endParagrapPosition.value, forwardDirection ? cell.endParagrapPosition.value : cell.startParagraphPosition.value, isFirstSelection && !parameter.extendSelection);
                    isFirstSelection = false;
                    columnIndex += cell.columnSpan;
                    cellIndex++;
                }
            }
            return true;
        };
        return SelectTableCellsRangeCommand;
    }(SelectTableCommandBase));
    __aspxRichEdit.SelectTableCellsRangeCommand = SelectTableCellsRangeCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AssignShortcutCommandOptions = (function (_super) {
        __extends(AssignShortcutCommandOptions, _super);
        function AssignShortcutCommandOptions(control, keyCode, callback) {
            var _this = _super.call(this, control) || this;
            _this.keyCode = keyCode;
            _this.callback = callback;
            return _this;
        }
        return AssignShortcutCommandOptions;
    }(__aspxRichEdit.CommandOptions));
    __aspxRichEdit.AssignShortcutCommandOptions = AssignShortcutCommandOptions;
    var AssignShortcutCommand = (function (_super) {
        __extends(AssignShortcutCommand, _super);
        function AssignShortcutCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        AssignShortcutCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this);
        };
        AssignShortcutCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        AssignShortcutCommand.prototype.executeCore = function (_state, options) {
            this.control.shortcutManager.assignShortcut(options.keyCode, options.callback);
            return true;
        };
        return AssignShortcutCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.AssignShortcutCommand = AssignShortcutCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AddWordToDictionary = (function (_super) {
        __extends(AddWordToDictionary, _super);
        function AddWordToDictionary() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        AddWordToDictionary.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && this.control.spellChecker.settings.canAddWord;
        };
        AddWordToDictionary.prototype.isVisible = function (selectedMisspelledInterval) {
            return _super.prototype.isVisible.call(this, selectedMisspelledInterval) && selectedMisspelledInterval.errorInfo.errorType == __aspxRichEdit.SpellingErrorType.Misspelling;
        };
        AddWordToDictionary.prototype.executeCore = function (state, _options) {
            var selectedMisspelledInterval = state.value;
            this.control.spellChecker.addWord(selectedMisspelledInterval);
            return true;
        };
        return AddWordToDictionary;
    }(__aspxRichEdit.SpellingCommandBase));
    __aspxRichEdit.AddWordToDictionary = AddWordToDictionary;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeAllSpellingErrorsCommand = (function (_super) {
        __extends(ChangeAllSpellingErrorsCommand, _super);
        function ChangeAllSpellingErrorsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeAllSpellingErrorsCommand.prototype.isEnabled = function () {
            var selectedMisspelledInterval = this.control.spellChecker.getSelectedMisspelledInterval(this.control.selection.intervals);
            var suggestions = selectedMisspelledInterval ? selectedMisspelledInterval.errorInfo.suggestions : null;
            return _super.prototype.isEnabled.call(this) && suggestions && suggestions.length > 0;
        };
        ChangeAllSpellingErrorsCommand.prototype.isVisible = function (selectedMisspelledInterval) {
            return _super.prototype.isVisible.call(this, selectedMisspelledInterval) && selectedMisspelledInterval.errorInfo.errorType == __aspxRichEdit.SpellingErrorType.Misspelling;
        };
        ChangeAllSpellingErrorsCommand.prototype.executeCore = function (state, options) {
            var selectedMisspelledInterval = state.value;
            var intervalsWithErrorByWord = this.control.spellChecker.getIntervalsWithErrorByWord(selectedMisspelledInterval.errorInfo.word);
            this.control.history.beginTransaction();
            for (var i = 0, interval; interval = intervalsWithErrorByWord[i]; i++) {
                this.control.selection.deprecatedSetSelection(interval.start, interval.end, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.InsertText).execute(this.control.commandManager.isPublicApiCall, options);
            }
            this.control.history.endTransaction();
            return true;
        };
        return ChangeAllSpellingErrorsCommand;
    }(__aspxRichEdit.SpellingCommandBase));
    __aspxRichEdit.ChangeAllSpellingErrorsCommand = ChangeAllSpellingErrorsCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeSpellingErrorCommand = (function (_super) {
        __extends(ChangeSpellingErrorCommand, _super);
        function ChangeSpellingErrorCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeSpellingErrorCommand.prototype.isEnabled = function () {
            var selectedMisspelledInterval = this.control.spellChecker.getSelectedMisspelledInterval(this.control.selection.intervals);
            var suggestions = selectedMisspelledInterval ? selectedMisspelledInterval.errorInfo.suggestions : null;
            return _super.prototype.isEnabled.call(this) && suggestions && suggestions.length > 0;
        };
        ChangeSpellingErrorCommand.prototype.isVisible = function (selectedMisspelledInterval) {
            return _super.prototype.isVisible.call(this, selectedMisspelledInterval) && selectedMisspelledInterval.errorInfo.errorType == __aspxRichEdit.SpellingErrorType.Misspelling;
        };
        ChangeSpellingErrorCommand.prototype.executeCore = function (state, options) {
            var selectedMisspelledInterval = state.value;
            options.intervals = [new __aspxRichEdit.FixedInterval(selectedMisspelledInterval.start, selectedMisspelledInterval.length)];
            this.control.history.beginTransaction();
            __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, this.control.model.activeSubDocument, options.intervals[0], __aspxRichEdit.UpdateInputPositionProperties.Yes, this.control.selection.endOfLine);
            this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.InsertText)
                .execute(this.control.commandManager.isPublicApiCall, options);
            this.control.history.endTransaction();
            return true;
        };
        return ChangeSpellingErrorCommand;
    }(__aspxRichEdit.SpellingCommandBase));
    __aspxRichEdit.ChangeSpellingErrorCommand = ChangeSpellingErrorCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DeleteRepeatedWordCommand = (function (_super) {
        __extends(DeleteRepeatedWordCommand, _super);
        function DeleteRepeatedWordCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DeleteRepeatedWordCommand.prototype.isVisible = function (selectedMisspelledInterval) {
            return _super.prototype.isVisible.call(this, selectedMisspelledInterval) && selectedMisspelledInterval.errorInfo.errorType == __aspxRichEdit.SpellingErrorType.Repeating;
        };
        DeleteRepeatedWordCommand.prototype.executeCore = function (state, _options) {
            var selectedMisspelledInterval = state.value;
            var deletingInterval = __aspxRichEdit.FixedInterval.fromPositions(selectedMisspelledInterval.start - 1, selectedMisspelledInterval.end);
            this.control.history.beginTransaction();
            __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, this.control.model.activeSubDocument, new __aspxRichEdit.FixedInterval(deletingInterval.start, 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, this.control.selection.endOfLine);
            __aspxRichEdit.ModelManipulator.removeInterval(this.control, this.control.model.activeSubDocument, deletingInterval, false, false);
            this.control.history.endTransaction();
            return true;
        };
        return DeleteRepeatedWordCommand;
    }(__aspxRichEdit.SpellingCommandBase));
    __aspxRichEdit.DeleteRepeatedWordCommand = DeleteRepeatedWordCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var IgnoreAllSpellingErrorsCommand = (function (_super) {
        __extends(IgnoreAllSpellingErrorsCommand, _super);
        function IgnoreAllSpellingErrorsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        IgnoreAllSpellingErrorsCommand.prototype.isVisible = function (selectedMisspelledInterval) {
            return _super.prototype.isVisible.call(this, selectedMisspelledInterval) && selectedMisspelledInterval.errorInfo.errorType == __aspxRichEdit.SpellingErrorType.Misspelling;
        };
        IgnoreAllSpellingErrorsCommand.prototype.executeCore = function (state, _options) {
            var selectedMisspelledInterval = state.value;
            this.control.spellChecker.ignoreAll(selectedMisspelledInterval);
            return true;
        };
        return IgnoreAllSpellingErrorsCommand;
    }(__aspxRichEdit.SpellingCommandBase));
    __aspxRichEdit.IgnoreAllSpellingErrorsCommand = IgnoreAllSpellingErrorsCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var IgnoreSpellingErrorCommand = (function (_super) {
        __extends(IgnoreSpellingErrorCommand, _super);
        function IgnoreSpellingErrorCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        IgnoreSpellingErrorCommand.prototype.executeCore = function (state, _options) {
            var selectedMisspelledInterval = state.value;
            this.control.spellChecker.ignore(selectedMisspelledInterval);
            return true;
        };
        return IgnoreSpellingErrorCommand;
    }(__aspxRichEdit.SpellingCommandBase));
    __aspxRichEdit.IgnoreSpellingErrorCommand = IgnoreSpellingErrorCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FindPageIndexHelper = (function () {
        function FindPageIndexHelper() {
        }
        FindPageIndexHelper.prototype.getPageIndex = function (control, subDoc) {
            var pageIndex = 0;
            for (var page = void 0; page = control.layoutFormatterManager.forceFormatPage(pageIndex); pageIndex++)
                if (__aspxRichEdit.ListUtils.elementBy(this.getPageAreas(page.getLayoutOtherPageAreasInfo()), function (pa) { return pa && pa.subDocument.id == subDoc.id; }))
                    break;
            return __aspxRichEdit.Utils.restrictValue(pageIndex, 0, control.selection.layout.pages.length - 1);
        };
        return FindPageIndexHelper;
    }());
    var FindHeaderPageIndexHelper = (function (_super) {
        __extends(FindHeaderPageIndexHelper, _super);
        function FindHeaderPageIndexHelper() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FindHeaderPageIndexHelper.prototype.getPageAreas = function (layoutPageHeaderFooterPageAreas) {
            return [layoutPageHeaderFooterPageAreas.headerPageArea];
        };
        return FindHeaderPageIndexHelper;
    }(FindPageIndexHelper));
    var FindFooterPageIndexHelper = (function (_super) {
        __extends(FindFooterPageIndexHelper, _super);
        function FindFooterPageIndexHelper() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FindFooterPageIndexHelper.prototype.getPageAreas = function (layoutPageHeaderFooterPageAreas) {
            return [layoutPageHeaderFooterPageAreas.footerPageArea];
        };
        return FindFooterPageIndexHelper;
    }(FindPageIndexHelper));
    var FindTextBoxPageIndexHelper = (function (_super) {
        __extends(FindTextBoxPageIndexHelper, _super);
        function FindTextBoxPageIndexHelper() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FindTextBoxPageIndexHelper.prototype.getPageAreas = function (layoutPageHeaderFooterPageAreas) {
            return layoutPageHeaderFooterPageAreas.textBoxesPageAreas;
        };
        return FindTextBoxPageIndexHelper;
    }(FindPageIndexHelper));
    var ChangeActiveSubDocumentToHeaderFooterByPageIndexCommandParameters = (function (_super) {
        __extends(ChangeActiveSubDocumentToHeaderFooterByPageIndexCommandParameters, _super);
        function ChangeActiveSubDocumentToHeaderFooterByPageIndexCommandParameters(control, pageIndex, isHeader) {
            var _this = _super.call(this, control) || this;
            _this.pageIndex = pageIndex;
            _this.isHeader = isHeader;
            return _this;
        }
        return ChangeActiveSubDocumentToHeaderFooterByPageIndexCommandParameters;
    }(__aspxRichEdit.CommandOptions));
    __aspxRichEdit.ChangeActiveSubDocumentToHeaderFooterByPageIndexCommandParameters = ChangeActiveSubDocumentToHeaderFooterByPageIndexCommandParameters;
    var ChangeActiveSubDocumentCommandBase = (function (_super) {
        __extends(ChangeActiveSubDocumentCommandBase, _super);
        function ChangeActiveSubDocumentCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeActiveSubDocumentCommandBase.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        ChangeActiveSubDocumentCommandBase.prototype.finishChanges = function (newPageIndex, newActiveSubDoc, startSelection) {
            var selection = this.control.selection;
            if (!this.setNewSelectionProps(selection, this.control.model, newPageIndex, newActiveSubDoc))
                return false;
            selection.setSelection(new __aspxRichEdit.SetSelectionParams()
                .setPosition(startSelection)
                .setKeepX(-1)
                .setUpdateInputPositionProperties(true)
                .setCorrectIntervalDueToFields(true)
                .setCorrectIntervalDueToTables(true)
                .setEndOfLine(false));
            if (this.isNeedScrollAfter())
                selection.scrollManager.setScroll(new __aspxRichEdit.Scroll.State().byModelPosition.setModelPosition(startSelection).useStdRelativePosition().useStdOffset());
            if (newActiveSubDoc.isHeaderFooter())
                this.control.barManager.activateContextItem(__aspxRichEdit.RichEditClientCommand.ContextItem_HeadersFooters);
            this.control.searchManager.onActiveSubDocumentChanged();
            this.control.spellChecker.onActiveSubDocumentChanged();
            this.control.clientSideEvents.raiseActiveSubDocumentChanged();
            return true;
        };
        ChangeActiveSubDocumentCommandBase.prototype.invalidatePages = function (targetPageIndex, currActiveSubDocInfo) {
            if (currActiveSubDocInfo.isHeaderFooter) {
                var headerFooterInvalidatorHelper = new __aspxRichEdit.LayoutFormatter.HeaderFooterInvalidatorHelper(this.control.model, this.control.layout, currActiveSubDocInfo.headerFooterType);
                headerFooterInvalidatorHelper.initByPageIndex(targetPageIndex);
                this.control.layoutFormatterManager.invalidator.onPagesChanged(headerFooterInvalidatorHelper.startPageIndex, headerFooterInvalidatorHelper.endPageIndex);
            }
            else
                this.control.layoutFormatterManager.invalidator.onPagesChanged(targetPageIndex, targetPageIndex + 1);
        };
        ChangeActiveSubDocumentCommandBase.prototype.setNewSelectionProps = function (selection, model, newPageIndex, newSubDocument) {
            if (selection.pageIndex == newPageIndex && newSubDocument == model.activeSubDocument)
                return false;
            if (newSubDocument.isTextBox() && (!selection.specialRunInfo.isSelectedAnchorObject ||
                selection.specialRunInfo.getTextBoxInnerSubDocumentId() != newSubDocument.id)) {
                var parentSubDoc = model.subDocuments[newSubDocument.info.parentSubDocumentId];
                var iterator = new __aspxRichEdit.ModelIterator(parentSubDoc, true);
                iterator.setPosition(0);
                do
                    if (iterator.run.getType() == __aspxRichEdit.RunType.AnchoredTextBoxRun && iterator.run.subDocId == newSubDocument.id)
                        break;
                while (iterator.moveToNextRun());
                selection.specialRunInfo.init(new __aspxRichEdit.FixedInterval(iterator.getAbsolutePosition(), 1), parentSubDoc);
            }
            selection.pageIndex = newPageIndex;
            model.activeSubDocument = newSubDocument;
            return true;
        };
        ChangeActiveSubDocumentCommandBase.prototype.isNeedScrollAfter = function () {
            return false;
        };
        ChangeActiveSubDocumentCommandBase.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return ChangeActiveSubDocumentCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ChangeActiveSubDocumentCommandBase = ChangeActiveSubDocumentCommandBase;
    var ChangeActiveSubDocumentToMainCommand = (function (_super) {
        __extends(ChangeActiveSubDocumentToMainCommand, _super);
        function ChangeActiveSubDocumentToMainCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeActiveSubDocumentToMainCommand.prototype.executeCore = function (_state, options) {
            var selection = this.control.selection;
            var targetPageIndex = selection.pageIndex;
            if (targetPageIndex < 0)
                return false;
            this.invalidatePages(targetPageIndex, options.subDocument.info);
            var targetLayoutPage = this.control.layoutFormatterManager.forceFormatPage(targetPageIndex);
            if (!targetLayoutPage)
                targetLayoutPage = selection.layout.getLastValidPage();
            return this.finishChanges(-1, this.control.model.mainSubDocument, targetLayoutPage ? targetLayoutPage.getPosition() : 0);
        };
        return ChangeActiveSubDocumentToMainCommand;
    }(ChangeActiveSubDocumentCommandBase));
    __aspxRichEdit.ChangeActiveSubDocumentToMainCommand = ChangeActiveSubDocumentToMainCommand;
    var ChangeActiveSubDocumentToHeaderFooterByPageIndexCommand = (function (_super) {
        __extends(ChangeActiveSubDocumentToHeaderFooterByPageIndexCommand, _super);
        function ChangeActiveSubDocumentToHeaderFooterByPageIndexCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeActiveSubDocumentToHeaderFooterByPageIndexCommand.prototype.executeCore = function (_state, params) {
            var targetPageIndex = params.pageIndex;
            if (targetPageIndex >= this.control.layout.pages.length)
                return false;
            this.invalidatePages(targetPageIndex, this.control.model.activeSubDocument.info);
            var targetLayoutPage = this.control.layoutFormatterManager.forceFormatPage(targetPageIndex);
            if (!targetLayoutPage)
                return false;
            this.control.history.beginTransaction();
            var newSubDocument = this.getNewSubDocument(targetLayoutPage, params.isHeader);
            if (!newSubDocument)
                return false;
            var res = this.finishChanges(targetPageIndex, newSubDocument, 0);
            this.control.history.endTransaction();
            return res;
        };
        ChangeActiveSubDocumentToHeaderFooterByPageIndexCommand.prototype.getNewSubDocument = function (layoutPage, isHeader) {
            var pageAreas = layoutPage.getLayoutOtherPageAreasInfo();
            var pageArea = isHeader ? pageAreas.headerPageArea : pageAreas.footerPageArea;
            if (pageArea)
                return pageArea.subDocument;
            if (this.control.model.isDocumentProtectionEnabled || this.control.readOnly == __aspxRichEdit.ReadOnlyMode.Persistent)
                return null;
            var sections = this.control.model.sections;
            var sectionIndex = __aspxRichEdit.Section.getPageSectionIndex(this.control.layoutFormatterManager.forceFormatPage(layoutPage.index), sections);
            var headerFooterType = __aspxRichEdit.SectionHeadersFooters.getActualObjectType(sections[sectionIndex], layoutPage.flags.get(__aspxRichEdit.LayoutPageFlags.IsFirstPageOfSection), __aspxRichEdit.Utils.isEven(layoutPage.layoutPageIndex));
            return this.insertSubDocument(isHeader, sectionIndex, headerFooterType);
        };
        ChangeActiveSubDocumentToHeaderFooterByPageIndexCommand.prototype.insertSubDocument = function (isHeader, sectionIndex, headerFooterType) {
            var newObjectIndex = this.createHeaderFooter(isHeader, sectionIndex, headerFooterType);
            return __aspxRichEdit.HeaderFooterCommandBase.getObjectsCache(isHeader, this.control)[newObjectIndex].getSubDocument(this.control.model);
        };
        ChangeActiveSubDocumentToHeaderFooterByPageIndexCommand.prototype.createHeaderFooter = function (isHeader, sectionIndex, type) {
            var objectIndex = __aspxRichEdit.HeaderFooterCommandBase.getManipulator(isHeader, this.control).createObject(type);
            this.changeHeaderFooterObjectIndex(isHeader, sectionIndex, type, objectIndex);
            return objectIndex;
        };
        ChangeActiveSubDocumentToHeaderFooterByPageIndexCommand.prototype.changeHeaderFooterObjectIndex = function (isHeader, sectionIndex, headerFooterType, newIndex) {
            this.control.history.addAndRedo(new (isHeader ? __aspxRichEdit.ChangeHeaderIndexHistoryItem : __aspxRichEdit.ChangeFooterIndexHistoryItem)(this.control.modelManipulator, sectionIndex, headerFooterType, newIndex, this.control.commandManager));
        };
        ChangeActiveSubDocumentToHeaderFooterByPageIndexCommand.prototype.isNeedScrollAfter = function () {
            return true;
        };
        ChangeActiveSubDocumentToHeaderFooterByPageIndexCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && this.control.innerClientProperties.viewsSettings.isPrintLayoutView;
        };
        return ChangeActiveSubDocumentToHeaderFooterByPageIndexCommand;
    }(ChangeActiveSubDocumentCommandBase));
    __aspxRichEdit.ChangeActiveSubDocumentToHeaderFooterByPageIndexCommand = ChangeActiveSubDocumentToHeaderFooterByPageIndexCommand;
    var ChangeActiveSubDocumentToHeaderFooterOrTextBoxBySubDocumentCommand = (function (_super) {
        __extends(ChangeActiveSubDocumentToHeaderFooterOrTextBoxBySubDocumentCommand, _super);
        function ChangeActiveSubDocumentToHeaderFooterOrTextBoxBySubDocumentCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeActiveSubDocumentToHeaderFooterOrTextBoxBySubDocumentCommand.prototype.executeCore = function (_state, options) {
            var newActiveSubDoc = options.param;
            var targetPageIndex;
            if (this.control.selection.specialRunInfo.isTextBoxSelected() &&
                this.control.selection.specialRunInfo.getTextBoxInnerSubDocumentId() == newActiveSubDoc.id &&
                this.control.selection.pageIndex >= 0)
                targetPageIndex = this.control.selection.pageIndex;
            else
                targetPageIndex = newActiveSubDoc.info.getType() != __aspxRichEdit.SubDocumentInfoType.Main ? ChangeActiveSubDocumentToHeaderFooterBySubDocumentCommand.MapTypeToPageIndexHelper[newActiveSubDoc.info.getType()]
                    .getPageIndex(this.control, newActiveSubDoc) : this.control.selection.pageIndex;
            this.invalidatePages(targetPageIndex, this.control.model.activeSubDocument.info);
            return this.control.layoutFormatterManager.forceFormatPage(targetPageIndex) && this.finishChanges(targetPageIndex, newActiveSubDoc, 0);
        };
        ChangeActiveSubDocumentToHeaderFooterOrTextBoxBySubDocumentCommand.prototype.isNeedScrollAfter = function () {
            return true;
        };
        ChangeActiveSubDocumentToHeaderFooterOrTextBoxBySubDocumentCommand.MapTypeToPageIndexHelper = new __aspxRichEdit.MapCreatorNumberAsKey()
            .add(__aspxRichEdit.SubDocumentInfoType.Header, new FindHeaderPageIndexHelper())
            .add(__aspxRichEdit.SubDocumentInfoType.Footer, new FindFooterPageIndexHelper())
            .add(__aspxRichEdit.SubDocumentInfoType.TextBox, new FindTextBoxPageIndexHelper())
            .get();
        return ChangeActiveSubDocumentToHeaderFooterOrTextBoxBySubDocumentCommand;
    }(ChangeActiveSubDocumentCommandBase));
    __aspxRichEdit.ChangeActiveSubDocumentToHeaderFooterOrTextBoxBySubDocumentCommand = ChangeActiveSubDocumentToHeaderFooterOrTextBoxBySubDocumentCommand;
    var ChangeActiveSubDocumentToHeaderFooterBySubDocumentCommand = (function (_super) {
        __extends(ChangeActiveSubDocumentToHeaderFooterBySubDocumentCommand, _super);
        function ChangeActiveSubDocumentToHeaderFooterBySubDocumentCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeActiveSubDocumentToHeaderFooterBySubDocumentCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && this.control.innerClientProperties.viewsSettings.isPrintLayoutView;
        };
        return ChangeActiveSubDocumentToHeaderFooterBySubDocumentCommand;
    }(ChangeActiveSubDocumentToHeaderFooterOrTextBoxBySubDocumentCommand));
    __aspxRichEdit.ChangeActiveSubDocumentToHeaderFooterBySubDocumentCommand = ChangeActiveSubDocumentToHeaderFooterBySubDocumentCommand;
    var ChangeActiveSubDocumentToTextBoxCommand = (function (_super) {
        __extends(ChangeActiveSubDocumentToTextBoxCommand, _super);
        function ChangeActiveSubDocumentToTextBoxCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeActiveSubDocumentToTextBoxCommand.prototype.getState = function () {
            if (!this.isEnabled())
                return new __aspxRichEdit.SimpleCommandState(false);
            var specInfo = this.control.selection.specialRunInfo;
            if (!specInfo.isTextBoxSelected())
                return new __aspxRichEdit.SimpleCommandState(false);
            var run = this.control.model.activeSubDocument.getRunByPosition(specInfo.getTextBoxPosition());
            return new __aspxRichEdit.SimpleCommandState(run.getType() == __aspxRichEdit.RunType.AnchoredTextBoxRun, this.control.model.subDocuments[run.subDocId]);
        };
        ChangeActiveSubDocumentToTextBoxCommand.prototype.executeCore = function (state, _options) {
            if (state.value instanceof __aspxRichEdit.SubDocument)
                return _super.prototype.executeCore.call(this, state, new __aspxRichEdit.CommandSimpleOptions(this.control, state.value));
            throw new Error(__aspxRichEdit.Errors.InternalException);
        };
        return ChangeActiveSubDocumentToTextBoxCommand;
    }(ChangeActiveSubDocumentToHeaderFooterOrTextBoxBySubDocumentCommand));
    __aspxRichEdit.ChangeActiveSubDocumentToTextBoxCommand = ChangeActiveSubDocumentToTextBoxCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ApplyTableStyleCommand = (function (_super) {
        __extends(ApplyTableStyleCommand, _super);
        function ApplyTableStyleCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ApplyTableStyleCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(true, false);
            var tableInfo = this.control.selection.tableInfo;
            state.enabled = this.isEnabled() && tableInfo.extendedData.numRows > 0;
            var items = [];
            for (var i = 0, style = void 0; style = this.control.model.tableStyles[i]; i++) {
                if (!style.hidden && !style.semihidden && !style.deleted)
                    items.push({ value: style.styleName, text: style.localizedName, data: style.base64EncodedImage });
            }
            for (var i = 0, ts = void 0; ts = __aspxRichEdit.StylesManager.presetTableStyles[i]; i++) {
                if (!ts.hidden && !ts.semihidden && !ts.deleted && !this.control.model.getTableStyleByName(ts.styleName))
                    items.push({ value: ts.styleName, text: ts.localizedName, data: ts.base64EncodedImage });
            }
            state.items = items;
            if (state.enabled) {
                var table = tableInfo.table;
                state.value = table.style ? table.style.styleName : null;
            }
            return state;
        };
        ApplyTableStyleCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tableStyle);
        };
        ApplyTableStyleCommand.prototype.executeCore = function (_state, parameter) {
            this.control.history.beginTransaction();
            var style = this.control.model.getTableStyleByName(parameter.param) ||
                this.control.model.stylesManager.addTableStyle(__aspxRichEdit.StylesManager.getPresetTableStyleByName(parameter.param).clone());
            var table = this.control.selection.tableInfo.table;
            this.control.history.addAndRedo(new __aspxRichEdit.ApplyTableStyleHistoryItem(this.control.modelManipulator, this.control.model.activeSubDocument, table.index, style));
            this.control.history.endTransaction();
            return true;
        };
        return ApplyTableStyleCommand;
    }(__aspxRichEdit.TableCommandBase));
    __aspxRichEdit.ApplyTableStyleCommand = ApplyTableStyleCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AutoFitCommandBase = (function (_super) {
        __extends(AutoFitCommandBase, _super);
        function AutoFitCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        AutoFitCommandBase.prototype.getState = function () {
            if (this.isEnabled()) {
                var tbl = this.control.selection.tableInfo.table;
                if (tbl)
                    return new __aspxRichEdit.SimpleCommandState(true, tbl);
            }
            return new __aspxRichEdit.SimpleCommandState(false);
        };
        AutoFitCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables);
        };
        return AutoFitCommandBase;
    }(__aspxRichEdit.TableCommandBase));
    __aspxRichEdit.AutoFitCommandBase = AutoFitCommandBase;
    var AutoFitContentsCommand = (function (_super) {
        __extends(AutoFitContentsCommand, _super);
        function AutoFitContentsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        AutoFitContentsCommand.prototype.executeCore = function (state, parameter) {
            var _this = this;
            var table = state.value;
            var history = this.control.history;
            var subDocument = parameter.subDocument;
            history.beginTransaction();
            history.addAndRedo(new __aspxRichEdit.TableLayoutTypeHistoryItem(this.control.modelManipulator, subDocument, table.index, __aspxRichEdit.TableLayoutType.Autofit, true));
            history.addAndRedo(new __aspxRichEdit.TablePreferredWidthHistoryItem(this.control.modelManipulator, subDocument, table.index, __aspxRichEdit.TableWidthUnit.create(0, __aspxRichEdit.TableWidthUnitType.Auto)));
            __aspxRichEdit.TablesManipulator.forEachCell(table, function (pos, _cellSpan) {
                history.addAndRedo(new __aspxRichEdit.TableCellPreferredWidthHistoryItem(_this.control.modelManipulator, subDocument, table.index, pos.rowIndex, pos.cellIndex, __aspxRichEdit.TableWidthUnit.create(0, __aspxRichEdit.TableWidthUnitType.Auto)));
            });
            history.endTransaction();
            return true;
        };
        return AutoFitContentsCommand;
    }(AutoFitCommandBase));
    __aspxRichEdit.AutoFitContentsCommand = AutoFitContentsCommand;
    var AutoFitWindowCommand = (function (_super) {
        __extends(AutoFitWindowCommand, _super);
        function AutoFitWindowCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        AutoFitWindowCommand.prototype.executeCore = function (state, parameter) {
            var _this = this;
            var table = state.value;
            var history = this.control.history;
            var subDocument = parameter.subDocument;
            history.beginTransaction();
            history.addAndRedo(new __aspxRichEdit.TableLayoutTypeHistoryItem(this.control.modelManipulator, subDocument, table.index, __aspxRichEdit.TableLayoutType.Autofit, true));
            history.addAndRedo(new __aspxRichEdit.TablePreferredWidthHistoryItem(this.control.modelManipulator, subDocument, table.index, __aspxRichEdit.TableWidthUnit.create(__aspxRichEdit.TableWidthUnit.MAX_PERCENT_WIDTH, __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent)));
            var widths = __aspxRichEdit.TablesManipulator.distributeWidthsToAllColumns(table, __aspxRichEdit.TableWidthUnit.MAX_PERCENT_WIDTH);
            __aspxRichEdit.TablesManipulator.forEachCell(table, function (pos, cellSpan) {
                history.addAndRedo(new __aspxRichEdit.TableCellPreferredWidthHistoryItem(_this.control.modelManipulator, subDocument, table.index, pos.rowIndex, pos.cellIndex, __aspxRichEdit.TableWidthUnit.create(__aspxRichEdit.TablesManipulator.fullCellWidth(widths, cellSpan, pos.cell.columnSpan), __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent)));
            });
            history.endTransaction();
            return true;
        };
        return AutoFitWindowCommand;
    }(AutoFitCommandBase));
    __aspxRichEdit.AutoFitWindowCommand = AutoFitWindowCommand;
    var FixedColumnWidthCommand = (function (_super) {
        __extends(FixedColumnWidthCommand, _super);
        function FixedColumnWidthCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FixedColumnWidthCommand.prototype.executeCore = function (state, parameter) {
            var _this = this;
            var table = state.value;
            var history = this.control.history;
            var subDocument = parameter.subDocument;
            history.beginTransaction();
            history.addAndRedo(new __aspxRichEdit.TableLayoutTypeHistoryItem(this.control.modelManipulator, subDocument, table.index, __aspxRichEdit.TableLayoutType.Fixed, true));
            history.addAndRedo(new __aspxRichEdit.TablePreferredWidthHistoryItem(this.control.modelManipulator, subDocument, table.index, __aspxRichEdit.TableWidthUnit.create(0, __aspxRichEdit.TableWidthUnitType.Auto)));
            var widths = __aspxRichEdit.TablesManipulator.distributeWidthsToAllColumns(table, this.getAvaliableWidth(table, subDocument));
            __aspxRichEdit.TablesManipulator.forEachCell(table, function (pos, cellSpan) {
                history.addAndRedo(new __aspxRichEdit.TableCellPreferredWidthHistoryItem(_this.control.modelManipulator, subDocument, table.index, pos.rowIndex, pos.cellIndex, __aspxRichEdit.TableWidthUnit.create(__aspxRichEdit.TablesManipulator.fullCellWidth(widths, cellSpan, pos.cell.columnSpan), __aspxRichEdit.TableWidthUnitType.ModelUnits)));
            });
            history.endTransaction();
            return true;
        };
        FixedColumnWidthCommand.prototype.getAvaliableWidth = function (table, subDocument) {
            var lp = __aspxRichEdit.LayoutPosition.ensure(this.control, subDocument, table.getStartPosition(), __aspxRichEdit.DocumentLayoutDetailsLevel.Row, new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
            if (table.nestedLevel == 0)
                return __aspxRichEdit.LayoutColumn.findSectionColumnWithMinimumWidth(lp.pageArea.columns);
            var cell = lp.row.tableCellInfo;
            while (cell.parentRow.parentTable.logicInfo.grid.table.nestedLevel != table.nestedLevel - 1)
                cell = cell.parentRow.parentTable.parentCell;
            return cell.avaliableContentWidth;
        };
        return FixedColumnWidthCommand;
    }(AutoFitCommandBase));
    __aspxRichEdit.FixedColumnWidthCommand = FixedColumnWidthCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeTableBorderColorRepositoryItemCommand = (function (_super) {
        __extends(ChangeTableBorderColorRepositoryItemCommand, _super);
        function ChangeTableBorderColorRepositoryItemCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeTableBorderColorRepositoryItemCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(true, false);
            var tableInfo = this.control.selection.tableInfo;
            state.enabled = this.isEnabled() && tableInfo.extendedData.numRows > 0;
            state.denyUpdateValue = true;
            return state;
        };
        ChangeTableBorderColorRepositoryItemCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables);
        };
        ChangeTableBorderColorRepositoryItemCommand.prototype.executeCore = function (_state, options) {
            this.control.model.repositoryBorderItem.color = this.control.model.colorProvider.getModelColorFromRgba(options.param);
            return true;
        };
        ChangeTableBorderColorRepositoryItemCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return !parameter || parameter == __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR.toString() ?
                __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR : __aspxRichEdit.ColorHelper.stringToColor(parameter);
        };
        return ChangeTableBorderColorRepositoryItemCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ChangeTableBorderColorRepositoryItemCommand = ChangeTableBorderColorRepositoryItemCommand;
    var ChangeTableBorderWidthRepositoryItemCommand = (function (_super) {
        __extends(ChangeTableBorderWidthRepositoryItemCommand, _super);
        function ChangeTableBorderWidthRepositoryItemCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeTableBorderWidthRepositoryItemCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(true, false);
            state.enabled = this.isEnabled() && this.control.selection.tableInfo.extendedData.numRows > 0;
            state.value = this.control.model.repositoryBorderItem.width;
            return state;
        };
        ChangeTableBorderWidthRepositoryItemCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables);
        };
        ChangeTableBorderWidthRepositoryItemCommand.prototype.executeCore = function (_state, options) {
            this.control.model.repositoryBorderItem.width = options.param;
            return true;
        };
        return ChangeTableBorderWidthRepositoryItemCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ChangeTableBorderWidthRepositoryItemCommand = ChangeTableBorderWidthRepositoryItemCommand;
    var ChangeTableBorderStyleRepositoryItemCommand = (function (_super) {
        __extends(ChangeTableBorderStyleRepositoryItemCommand, _super);
        function ChangeTableBorderStyleRepositoryItemCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeTableBorderStyleRepositoryItemCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(true, false);
            state.enabled = this.isEnabled() && this.control.selection.tableInfo.extendedData.numRows > 0;
            state.value = this.control.model.repositoryBorderItem.style;
            return state;
        };
        ChangeTableBorderStyleRepositoryItemCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables);
        };
        ChangeTableBorderStyleRepositoryItemCommand.prototype.executeCore = function (_state, options) {
            this.control.model.repositoryBorderItem.style = options.param;
            return true;
        };
        return ChangeTableBorderStyleRepositoryItemCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ChangeTableBorderStyleRepositoryItemCommand = ChangeTableBorderStyleRepositoryItemCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeTableCellAlignmentCommandBase = (function (_super) {
        __extends(ChangeTableCellAlignmentCommandBase, _super);
        function ChangeTableCellAlignmentCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeTableCellAlignmentCommandBase.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(true, false);
            state.enabled = this.isEnabled() && this.control.selection.tableInfo.extendedData.numRows > 0;
            state.value = this.isChecked(this.control.model.activeSubDocument);
            return state;
        };
        ChangeTableCellAlignmentCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables);
        };
        ChangeTableCellAlignmentCommandBase.prototype.isChecked = function (subDocument) {
            var _this = this;
            var tableInfo = this.control.selection.tableInfo;
            return tableInfo.extendedData.allOfCells(function (cellInfo) {
                return new __aspxRichEdit.TableCellVerticalAlignmentMerger().getProperty(cellInfo.cell.properties, tableInfo.table.style, cellInfo.cell.conditionalFormatting, _this.control.model.defaultTableCellProperties) === _this.verticalAlignment &&
                    subDocument.getParagraphByPosition(cellInfo.cell.startParagraphPosition.value).getParagraphMergedProperies().alignment === _this.horizontalAlignment;
            });
        };
        ChangeTableCellAlignmentCommandBase.prototype.executeCore = function (_state, options) {
            var _this = this;
            this.control.history.beginTransaction();
            var tableInfo = this.control.selection.tableInfo;
            var subDocument = options.subDocument;
            var table = tableInfo.table;
            tableInfo.extendedData.foreach(function () { }, function (cellInfo, rowInfo) {
                var cell = cellInfo.cell;
                if (cell.properties.verticalAlignment !== _this.verticalAlignment || !cell.properties.getUseValue(__aspxRichEdit.TableCellPropertiesMask.UseVerticalAlignment)) {
                    _this.control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalAlignmentHistoryItem(_this.control.modelManipulator, subDocument, table.index, rowInfo.rowIndex, cellInfo.cellIndex, _this.verticalAlignment, true));
                }
                var paragraphIndices = subDocument.getParagraphsIndices(cell.interval);
                __aspxRichEdit.ListUtils.foreach(subDocument.paragraphs, function (paragraph) {
                    if (paragraph.getParagraphMergedProperies().alignment !== _this.horizontalAlignment)
                        _this.control.history.addAndRedo(new __aspxRichEdit.ParagraphAlignmentHistoryItem(_this.control.modelManipulator, subDocument, paragraph.interval, _this.horizontalAlignment, true));
                }, paragraphIndices.start, paragraphIndices.end);
            });
            this.control.history.endTransaction();
            return true;
        };
        return ChangeTableCellAlignmentCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ChangeTableCellAlignmentCommandBase = ChangeTableCellAlignmentCommandBase;
    var ChangeTableCellTopLeftAlignmentCommand = (function (_super) {
        __extends(ChangeTableCellTopLeftAlignmentCommand, _super);
        function ChangeTableCellTopLeftAlignmentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.horizontalAlignment = __aspxRichEdit.ParagraphAlignment.Left;
            _this.verticalAlignment = __aspxRichEdit.TableCellVerticalAlignment.Top;
            return _this;
        }
        return ChangeTableCellTopLeftAlignmentCommand;
    }(ChangeTableCellAlignmentCommandBase));
    __aspxRichEdit.ChangeTableCellTopLeftAlignmentCommand = ChangeTableCellTopLeftAlignmentCommand;
    var ChangeTableCellTopCenterAlignmentCommand = (function (_super) {
        __extends(ChangeTableCellTopCenterAlignmentCommand, _super);
        function ChangeTableCellTopCenterAlignmentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.horizontalAlignment = __aspxRichEdit.ParagraphAlignment.Center;
            _this.verticalAlignment = __aspxRichEdit.TableCellVerticalAlignment.Top;
            return _this;
        }
        return ChangeTableCellTopCenterAlignmentCommand;
    }(ChangeTableCellAlignmentCommandBase));
    __aspxRichEdit.ChangeTableCellTopCenterAlignmentCommand = ChangeTableCellTopCenterAlignmentCommand;
    var ChangeTableCellTopRightAlignmentCommand = (function (_super) {
        __extends(ChangeTableCellTopRightAlignmentCommand, _super);
        function ChangeTableCellTopRightAlignmentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.horizontalAlignment = __aspxRichEdit.ParagraphAlignment.Right;
            _this.verticalAlignment = __aspxRichEdit.TableCellVerticalAlignment.Top;
            return _this;
        }
        return ChangeTableCellTopRightAlignmentCommand;
    }(ChangeTableCellAlignmentCommandBase));
    __aspxRichEdit.ChangeTableCellTopRightAlignmentCommand = ChangeTableCellTopRightAlignmentCommand;
    var ChangeTableCellMiddleLeftAlignmentCommand = (function (_super) {
        __extends(ChangeTableCellMiddleLeftAlignmentCommand, _super);
        function ChangeTableCellMiddleLeftAlignmentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.horizontalAlignment = __aspxRichEdit.ParagraphAlignment.Left;
            _this.verticalAlignment = __aspxRichEdit.TableCellVerticalAlignment.Center;
            return _this;
        }
        return ChangeTableCellMiddleLeftAlignmentCommand;
    }(ChangeTableCellAlignmentCommandBase));
    __aspxRichEdit.ChangeTableCellMiddleLeftAlignmentCommand = ChangeTableCellMiddleLeftAlignmentCommand;
    var ChangeTableCellMiddleCenterAlignmentCommand = (function (_super) {
        __extends(ChangeTableCellMiddleCenterAlignmentCommand, _super);
        function ChangeTableCellMiddleCenterAlignmentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.horizontalAlignment = __aspxRichEdit.ParagraphAlignment.Center;
            _this.verticalAlignment = __aspxRichEdit.TableCellVerticalAlignment.Center;
            return _this;
        }
        return ChangeTableCellMiddleCenterAlignmentCommand;
    }(ChangeTableCellAlignmentCommandBase));
    __aspxRichEdit.ChangeTableCellMiddleCenterAlignmentCommand = ChangeTableCellMiddleCenterAlignmentCommand;
    var ChangeTableCellMiddleRightAlignmentCommand = (function (_super) {
        __extends(ChangeTableCellMiddleRightAlignmentCommand, _super);
        function ChangeTableCellMiddleRightAlignmentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.horizontalAlignment = __aspxRichEdit.ParagraphAlignment.Right;
            _this.verticalAlignment = __aspxRichEdit.TableCellVerticalAlignment.Center;
            return _this;
        }
        return ChangeTableCellMiddleRightAlignmentCommand;
    }(ChangeTableCellAlignmentCommandBase));
    __aspxRichEdit.ChangeTableCellMiddleRightAlignmentCommand = ChangeTableCellMiddleRightAlignmentCommand;
    var ChangeTableCellBottomLeftAlignmentCommand = (function (_super) {
        __extends(ChangeTableCellBottomLeftAlignmentCommand, _super);
        function ChangeTableCellBottomLeftAlignmentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.horizontalAlignment = __aspxRichEdit.ParagraphAlignment.Left;
            _this.verticalAlignment = __aspxRichEdit.TableCellVerticalAlignment.Bottom;
            return _this;
        }
        return ChangeTableCellBottomLeftAlignmentCommand;
    }(ChangeTableCellAlignmentCommandBase));
    __aspxRichEdit.ChangeTableCellBottomLeftAlignmentCommand = ChangeTableCellBottomLeftAlignmentCommand;
    var ChangeTableCellBottomCenterAlignmentCommand = (function (_super) {
        __extends(ChangeTableCellBottomCenterAlignmentCommand, _super);
        function ChangeTableCellBottomCenterAlignmentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.horizontalAlignment = __aspxRichEdit.ParagraphAlignment.Center;
            _this.verticalAlignment = __aspxRichEdit.TableCellVerticalAlignment.Bottom;
            return _this;
        }
        return ChangeTableCellBottomCenterAlignmentCommand;
    }(ChangeTableCellAlignmentCommandBase));
    __aspxRichEdit.ChangeTableCellBottomCenterAlignmentCommand = ChangeTableCellBottomCenterAlignmentCommand;
    var ChangeTableCellBottomRightAlignmentCommand = (function (_super) {
        __extends(ChangeTableCellBottomRightAlignmentCommand, _super);
        function ChangeTableCellBottomRightAlignmentCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.horizontalAlignment = __aspxRichEdit.ParagraphAlignment.Right;
            _this.verticalAlignment = __aspxRichEdit.TableCellVerticalAlignment.Bottom;
            return _this;
        }
        return ChangeTableCellBottomRightAlignmentCommand;
    }(ChangeTableCellAlignmentCommandBase));
    __aspxRichEdit.ChangeTableCellBottomRightAlignmentCommand = ChangeTableCellBottomRightAlignmentCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeTableCellShadingCommand = (function (_super) {
        __extends(ChangeTableCellShadingCommand, _super);
        function ChangeTableCellShadingCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeTableCellShadingCommand.prototype.getState = function () {
            var _this = this;
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            if (state.enabled) {
                var tableInfo = this.control.selection.tableInfo;
                var templateColor_1;
                if (__aspxRichEdit.ListUtils.allOf(tableInfo.extendedData.rows, function (rowInfo) {
                    return __aspxRichEdit.ListUtils.allOf(rowInfo.cells, function (cellInfo) {
                        if (cellInfo.cell.properties.getUseValue(__aspxRichEdit.TableCellPropertiesMask.UseShadingInfoIndex)) {
                            var currCellColor = cellInfo.cell.properties.shadingInfo.getActualColor(_this.colorProvider);
                            if (templateColor_1 === undefined) {
                                templateColor_1 = currCellColor;
                                return true;
                            }
                            else
                                return currCellColor == templateColor_1;
                        }
                        else
                            return true;
                    });
                })) {
                    switch (templateColor_1) {
                        case undefined:
                            state.value = undefined;
                            break;
                        case __aspxRichEdit.ColorHelper.NO_COLOR:
                            state.value = null;
                            break;
                        default: __aspxRichEdit.ColorHelper.colorToHash(templateColor_1);
                    }
                }
                else
                    state.value = undefined;
            }
            state.denyUpdateValue = true;
            return state;
        };
        ChangeTableCellShadingCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables) && this.control.selection.tableInfo.extendedData.numRows > 0;
        };
        ChangeTableCellShadingCommand.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return !parameter || parameter == __aspxRichEdit.ColorHelper.NO_COLOR.toString() ? __aspxRichEdit.ColorHelper.NO_COLOR : __aspxRichEdit.ColorHelper.stringToColor(parameter);
        };
        ChangeTableCellShadingCommand.prototype.executeCore = function (_state, options) {
            var _this = this;
            this.control.history.beginTransaction();
            var color = options.param;
            var tableInfo = this.control.selection.tableInfo;
            var table = tableInfo.table;
            tableInfo.extendedData.foreach(function () { }, function (cellInfo, rowInfo) {
                if (cellInfo.cell.properties.shadingInfo.getActualColor(_this.colorProvider) !== color ||
                    !cellInfo.cell.properties.getUseValue(__aspxRichEdit.TableCellPropertiesMask.UseShadingInfoIndex)) {
                    _this.control.history.addAndRedo(new __aspxRichEdit.TableCellShadingInfoHistoryItem(_this.control.modelManipulator, options.subDocument, table.index, rowInfo.rowIndex, cellInfo.cellIndex, __aspxRichEdit.ShadingInfo.createByColor(__aspxRichEdit.ColorModelInfo.makeByColor(color)), true));
                }
            });
            this.control.history.endTransaction();
            return true;
        };
        return ChangeTableCellShadingCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ChangeTableCellShadingCommand = ChangeTableCellShadingCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeTableCellWidthCommand = (function (_super) {
        __extends(ChangeTableCellWidthCommand, _super);
        function ChangeTableCellWidthCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeTableCellWidthCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(true);
            var tableInfo = this.control.selection.tableInfo;
            state.enabled = this.isEnabled() && tableInfo.extendedData.numRows > 0;
            if (state.enabled) {
                var template_1 = tableInfo.table ? tableInfo.extendedData.firstCell.preferredWidth : null;
                if (tableInfo.extendedData.allOfCells(function (cellInfo) { return cellInfo.cell.preferredWidth.equals(template_1); }))
                    state.value = template_1;
            }
            return state;
        };
        ChangeTableCellWidthCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables);
        };
        ChangeTableCellWidthCommand.prototype.executeCore = function (_state, options) {
            var _this = this;
            var tableInfo = this.control.selection.tableInfo;
            var changed = false;
            tableInfo.extendedData.foreach(function () { }, function (cellInfo, rowInfo) {
                if (!cellInfo.cell.preferredWidth.equals(options.param)) {
                    _this.control.history.addAndRedo(new __aspxRichEdit.TableCellPreferredWidthHistoryItem(_this.control.modelManipulator, options.subDocument, tableInfo.table.index, rowInfo.rowIndex, cellInfo.cellIndex, options.param.clone()));
                    changed = true;
                }
            });
            return changed;
        };
        return ChangeTableCellWidthCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ChangeTableCellWidthCommand = ChangeTableCellWidthCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeTableColumnWidthCommand = (function (_super) {
        __extends(ChangeTableColumnWidthCommand, _super);
        function ChangeTableColumnWidthCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeTableColumnWidthCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(true);
            var tableInfo = this.control.selection.tableInfo;
            state.enabled = this.isEnabled() && tableInfo.extendedData.numRows > 0;
            var width;
            if (state.enabled) {
                var table = tableInfo.table;
                var columnsRange = __aspxRichEdit.TableCellUtils.getColumnsRangeBySelectedCells(tableInfo.extendedData);
                for (var rowIndex = 0, row = void 0; row = table.rows[rowIndex]; rowIndex++) {
                    var cellIndices = __aspxRichEdit.TableCellUtils.getCellIndicesByColumnsRange(row, columnsRange);
                    for (var i = cellIndices.length - 1; i >= 0; i--) {
                        var cell = table.rows[rowIndex].cells[cellIndices[i]];
                        if (width === undefined)
                            width = cell.preferredWidth.clone();
                        else if (width && width.equals(cell.preferredWidth))
                            continue;
                        else
                            width = null;
                    }
                }
            }
            state.value = width;
            return state;
        };
        ChangeTableColumnWidthCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables);
        };
        ChangeTableColumnWidthCommand.prototype.executeCore = function (_state, options) {
            var tableInfo = this.control.selection.tableInfo;
            var table = tableInfo.table;
            var changed = false;
            var columnsRange = __aspxRichEdit.TableCellUtils.getColumnsRangeBySelectedCells(tableInfo.extendedData);
            var subDocument = options.subDocument;
            for (var rowIndex = 0, row = void 0; row = table.rows[rowIndex]; rowIndex++) {
                var cellIndices = __aspxRichEdit.TableCellUtils.getCellIndicesByColumnsRange(row, columnsRange);
                for (var i = cellIndices.length - 1; i >= 0; i--) {
                    var cell = table.rows[rowIndex].cells[cellIndices[i]];
                    if (!cell.preferredWidth.equals(options.param)) {
                        this.control.history.addAndRedo(new __aspxRichEdit.TableCellPreferredWidthHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, cellIndices[i], options.param.clone()));
                        changed = true;
                    }
                }
            }
            return changed;
        };
        return ChangeTableColumnWidthCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ChangeTableColumnWidthCommand = ChangeTableColumnWidthCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeTableLookCommandBase = (function (_super) {
        __extends(ChangeTableLookCommandBase, _super);
        function ChangeTableLookCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeTableLookCommandBase.prototype.getState = function () {
            var tableInfo = this.control.selection.tableInfo;
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled() && tableInfo.extendedData.numRows > 0, false);
            if (state.enabled)
                state.value = this.getValue(tableInfo.table);
            return state;
        };
        ChangeTableLookCommandBase.prototype.getValue = function (table) {
            var value = !!(table.lookTypes & this.option);
            return this.isInvertedTableLookType() ? !value : value;
        };
        ChangeTableLookCommandBase.prototype.isInvertedTableLookType = function () {
            return false;
        };
        ChangeTableLookCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables);
        };
        ChangeTableLookCommandBase.prototype.executeCore = function (_state, options) {
            var table = this.control.selection.tableInfo.table;
            this.control.history.beginTransaction();
            this.control.history.addAndRedo(new __aspxRichEdit.TableLookTypesHistoryItem(this.control.modelManipulator, options.subDocument, table.index, this.getNewValue(table, options.param)));
            __aspxRichEdit.TableConditionalFormattingCalculator.updateTable(this.control, table);
            this.control.history.endTransaction();
            return true;
        };
        ChangeTableLookCommandBase.prototype.getNewValue = function (table, parameter) {
            parameter = this.isInvertedTableLookType() ? !parameter : parameter;
            var value = table.lookTypes;
            if (parameter)
                value |= this.option;
            else
                value &= ~this.option;
            return value;
        };
        return ChangeTableLookCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ChangeTableLookCommandBase = ChangeTableLookCommandBase;
    var ChangeTableLookCommand = (function (_super) {
        __extends(ChangeTableLookCommand, _super);
        function ChangeTableLookCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeTableLookCommand.prototype.getValue = function (table) {
            return table.lookTypes;
        };
        ChangeTableLookCommand.prototype.getNewValue = function (_table, parameter) {
            return parameter;
        };
        return ChangeTableLookCommand;
    }(ChangeTableLookCommandBase));
    __aspxRichEdit.ChangeTableLookCommand = ChangeTableLookCommand;
    var ToggleFirstRowCommand = (function (_super) {
        __extends(ToggleFirstRowCommand, _super);
        function ToggleFirstRowCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.option = __aspxRichEdit.TableLookTypes.ApplyFirstRow;
            return _this;
        }
        return ToggleFirstRowCommand;
    }(ChangeTableLookCommandBase));
    __aspxRichEdit.ToggleFirstRowCommand = ToggleFirstRowCommand;
    var ToggleLastRowCommand = (function (_super) {
        __extends(ToggleLastRowCommand, _super);
        function ToggleLastRowCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.option = __aspxRichEdit.TableLookTypes.ApplyLastRow;
            return _this;
        }
        return ToggleLastRowCommand;
    }(ChangeTableLookCommandBase));
    __aspxRichEdit.ToggleLastRowCommand = ToggleLastRowCommand;
    var ToggleFirstColumnCommand = (function (_super) {
        __extends(ToggleFirstColumnCommand, _super);
        function ToggleFirstColumnCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.option = __aspxRichEdit.TableLookTypes.ApplyFirstColumn;
            return _this;
        }
        return ToggleFirstColumnCommand;
    }(ChangeTableLookCommandBase));
    __aspxRichEdit.ToggleFirstColumnCommand = ToggleFirstColumnCommand;
    var ToggleLastColumnCommand = (function (_super) {
        __extends(ToggleLastColumnCommand, _super);
        function ToggleLastColumnCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.option = __aspxRichEdit.TableLookTypes.ApplyLastColumn;
            return _this;
        }
        return ToggleLastColumnCommand;
    }(ChangeTableLookCommandBase));
    __aspxRichEdit.ToggleLastColumnCommand = ToggleLastColumnCommand;
    var ToggleBandedRowsCommand = (function (_super) {
        __extends(ToggleBandedRowsCommand, _super);
        function ToggleBandedRowsCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.option = __aspxRichEdit.TableLookTypes.DoNotApplyRowBanding;
            return _this;
        }
        ToggleBandedRowsCommand.prototype.isInvertedTableLookType = function () {
            return true;
        };
        return ToggleBandedRowsCommand;
    }(ChangeTableLookCommandBase));
    __aspxRichEdit.ToggleBandedRowsCommand = ToggleBandedRowsCommand;
    var ToggleBandedColumnCommand = (function (_super) {
        __extends(ToggleBandedColumnCommand, _super);
        function ToggleBandedColumnCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.option = __aspxRichEdit.TableLookTypes.DoNotApplyColumnBanding;
            return _this;
        }
        ToggleBandedColumnCommand.prototype.isInvertedTableLookType = function () {
            return true;
        };
        return ToggleBandedColumnCommand;
    }(ChangeTableLookCommandBase));
    __aspxRichEdit.ToggleBandedColumnCommand = ToggleBandedColumnCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeTableRowHeightCommand = (function (_super) {
        __extends(ChangeTableRowHeightCommand, _super);
        function ChangeTableRowHeightCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeTableRowHeightCommand.prototype.getState = function () {
            var tableInfo = this.control.selection.tableInfo;
            var state = new __aspxRichEdit.SimpleCommandState(true);
            state.enabled = this.isEnabled() && tableInfo.extendedData.numRows > 0;
            if (state.enabled) {
                var templateHeight_1 = tableInfo.table ? tableInfo.extendedData.rows[0].row.height : undefined;
                if (__aspxRichEdit.ListUtils.allOf(tableInfo.extendedData.rows, function (rowInfo) { return rowInfo.row.height.equals(templateHeight_1); }, 1))
                    state.value = templateHeight_1;
            }
            return state;
        };
        ChangeTableRowHeightCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables);
        };
        ChangeTableRowHeightCommand.prototype.executeCore = function (_state, options) {
            var _this = this;
            var tableInfo = this.control.selection.tableInfo;
            var table = tableInfo.table;
            var changed = false;
            this.control.history.beginTransaction();
            __aspxRichEdit.ListUtils.foreach(tableInfo.extendedData.rows, function (rowInfo) {
                if (!table.rows[rowInfo.rowIndex].height.equals(options.param)) {
                    _this.control.history.addAndRedo(new __aspxRichEdit.TableRowHeightHistoryItem(_this.control.modelManipulator, options.subDocument, table.index, rowInfo.rowIndex, options.param.clone()));
                    changed = true;
                }
            });
            this.control.history.endTransaction();
            return changed;
        };
        return ChangeTableRowHeightCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ChangeTableRowHeightCommand = ChangeTableRowHeightCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ContextItemTables = (function (_super) {
        __extends(ContextItemTables, _super);
        function ContextItemTables() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ContextItemTables.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(true, false);
            state.visible = this.control.selection.tableInfo.extendedData.numRows > 0 &&
                (this.control.model.activeSubDocument.isTextBox() || !this.control.selection.specialRunInfo.isSelected());
            return state;
        };
        ContextItemTables.prototype.executeCore = function (_state, _options) {
            return false;
        };
        return ContextItemTables;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ContextItemTables = ContextItemTables;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DeleteTableCellsByBackspaceCommand = (function (_super) {
        __extends(DeleteTableCellsByBackspaceCommand, _super);
        function DeleteTableCellsByBackspaceCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DeleteTableCellsByBackspaceCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        DeleteTableCellsByBackspaceCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this)
                && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables)
                && (this.control.selection.tableInfo.extendedData.isSquare || this.control.selection.tableInfo.extendedData.numRows == 1);
        };
        DeleteTableCellsByBackspaceCommand.prototype.executeCore = function (_state, _options) {
            var tableInfo = this.control.selection.tableInfo;
            if (this.control.selection.tableInfo.extendedData.isSelectedEntireTable)
                return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.DeleteTable).execute(this.control.commandManager.isPublicApiCall);
            if (tableInfo.extendedData.numRows == tableInfo.table.rows.length && this.control.selection.tableInfo.extendedData.isSquare)
                return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.DeleteTableColumns).execute(this.control.commandManager.isPublicApiCall);
            return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowDeleteTableCellsForm).execute(this.control.commandManager.isPublicApiCall);
        };
        return DeleteTableCellsByBackspaceCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.DeleteTableCellsByBackspaceCommand = DeleteTableCellsByBackspaceCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DeleteTableCellsWithShiftToTheHorizontallyCommand = (function (_super) {
        __extends(DeleteTableCellsWithShiftToTheHorizontallyCommand, _super);
        function DeleteTableCellsWithShiftToTheHorizontallyCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DeleteTableCellsWithShiftToTheHorizontallyCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        DeleteTableCellsWithShiftToTheHorizontallyCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this)
                && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables)
                && this.control.selection.tableInfo.extendedData.isSquare;
        };
        DeleteTableCellsWithShiftToTheHorizontallyCommand.prototype.executeCore = function (_state, options) {
            var _this = this;
            this.control.history.beginTransaction();
            var tableInfo = this.control.selection.tableInfo;
            var subDocument = options.subDocument;
            var table = tableInfo.table;
            if (tableInfo.extendedData.isSelectedEntireTable) {
                __aspxRichEdit.TablesManipulator.removeTableWithContent(this.control, subDocument, table);
                __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, subDocument, new __aspxRichEdit.FixedInterval(table.getStartPosition(), 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, false);
            }
            else {
                var startPosition = tableInfo.extendedData.firstCell.startParagraphPosition.value;
                __aspxRichEdit.ListUtils.reverseForeach(tableInfo.extendedData.rows, function (rowInfo) {
                    var row = table.rows[rowInfo.rowIndex];
                    if (row.cells.length === rowInfo.cells.length)
                        _this.deleteEntireRow(subDocument, table, rowInfo.rowIndex);
                    else {
                        __aspxRichEdit.ListUtils.foreach(rowInfo.cells, function (cellInfo) {
                            if (cellInfo.cell.verticalMerging != __aspxRichEdit.TableCellMergingState.Continue)
                                _this.deleteTableCell(subDocument, table, rowInfo.rowIndex, cellInfo.cellIndex);
                        });
                    }
                });
                __aspxRichEdit.TablesManipulator.normalizeVerticalSpans(this.control, subDocument, table);
                __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, subDocument, new __aspxRichEdit.FixedInterval(startPosition, 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, false);
                __aspxRichEdit.TableConditionalFormattingCalculator.updateTable(this.control, table);
            }
            this.control.history.endTransaction();
            return true;
        };
        DeleteTableCellsWithShiftToTheHorizontallyCommand.prototype.deleteEntireRow = function (subDocument, table, rowIndex) {
            __aspxRichEdit.TablesManipulator.removeTableRowWithContent(this.control, subDocument, table, rowIndex);
            __aspxRichEdit.TablesManipulator.normalizeCellColumnSpans(this.control, subDocument, table, true);
        };
        DeleteTableCellsWithShiftToTheHorizontallyCommand.prototype.deleteTableCell = function (subDocument, table, rowIndex, cellIndex) {
            __aspxRichEdit.TablesManipulator.removeTableCellWithContent(this.control, subDocument, table, rowIndex, cellIndex);
            __aspxRichEdit.TablesManipulator.normalizeTableGrid(this.control, subDocument, table);
            __aspxRichEdit.TablesManipulator.normalizeCellColumnSpans(this.control, subDocument, table, false);
        };
        return DeleteTableCellsWithShiftToTheHorizontallyCommand;
    }(__aspxRichEdit.TableCommandBase));
    __aspxRichEdit.DeleteTableCellsWithShiftToTheHorizontallyCommand = DeleteTableCellsWithShiftToTheHorizontallyCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DeleteTableCellsWithShiftToTheVerticallyCommand = (function (_super) {
        __extends(DeleteTableCellsWithShiftToTheVerticallyCommand, _super);
        function DeleteTableCellsWithShiftToTheVerticallyCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DeleteTableCellsWithShiftToTheVerticallyCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        DeleteTableCellsWithShiftToTheVerticallyCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this)
                && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables)
                && this.control.selection.tableInfo.rawData.isSquare;
        };
        DeleteTableCellsWithShiftToTheVerticallyCommand.prototype.executeCore = function (_state, options) {
            var _this = this;
            this.control.history.beginTransaction();
            var subDocument = options.subDocument;
            var tableInfo = this.control.selection.tableInfo;
            var table = tableInfo.table;
            if (tableInfo.extendedData.isSelectedEntireTable) {
                __aspxRichEdit.TablesManipulator.removeTableWithContent(this.control, subDocument, table);
                __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, this.control.model.activeSubDocument, new __aspxRichEdit.FixedInterval(table.getStartPosition(), 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, false);
            }
            else {
                var startPosition = tableInfo.rawData.firstCell.startParagraphPosition.value;
                __aspxRichEdit.ListUtils.reverseForeach(tableInfo.rawData.rows, function (rowInfo) {
                    for (var _i = 0, _a = rowInfo.cells; _i < _a.length; _i++) {
                        var cellInfo = _a[_i];
                        _this.removeTableCell(subDocument, table, rowInfo.rowIndex, cellInfo.cellIndex);
                    }
                });
                __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, this.control.model.activeSubDocument, new __aspxRichEdit.FixedInterval(startPosition, 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, false);
                __aspxRichEdit.TableConditionalFormattingCalculator.updateTable(this.control, table);
            }
            this.control.history.endTransaction();
            return true;
        };
        DeleteTableCellsWithShiftToTheVerticallyCommand.prototype.removeTableCell = function (subDocument, table, rowIndex, cellIndex) {
            var columnIndex = __aspxRichEdit.TableCellUtils.getStartColumnIndex(table.rows[rowIndex].cells[cellIndex]);
            var rowsCount = table.rows.length;
            for (var i = rowIndex; i < rowsCount; i++) {
                var cellIndex_1 = __aspxRichEdit.TableCellUtils.getCellIndexByColumnIndex(table.rows[rowIndex], columnIndex);
                if (table.rows[i].cells[cellIndex_1])
                    new __aspxRichEdit.DeleteOneTableCellWithShiftToTheUpOperation(this.control, subDocument).execute(__aspxRichEdit.TablePosition.createAndInit(table, i, cellIndex_1), false);
            }
        };
        return DeleteTableCellsWithShiftToTheVerticallyCommand;
    }(__aspxRichEdit.TableCommandBase));
    __aspxRichEdit.DeleteTableCellsWithShiftToTheVerticallyCommand = DeleteTableCellsWithShiftToTheVerticallyCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DeleteTableColumnsCommand = (function (_super) {
        __extends(DeleteTableColumnsCommand, _super);
        function DeleteTableColumnsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DeleteTableColumnsCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        DeleteTableColumnsCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this)
                && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables)
                && this.control.selection.tableInfo.rawData.isSquare;
        };
        DeleteTableColumnsCommand.prototype.executeCore = function (_state, options) {
            this.control.history.beginTransaction();
            var tableInfo = this.control.selection.tableInfo;
            var table = tableInfo.table;
            var subDocument = options.subDocument;
            if (tableInfo.rawData.firstRowInfo.cells.length == table.rows[tableInfo.rawData.firstRowInfo.rowIndex].cells.length) {
                __aspxRichEdit.TablesManipulator.removeTableWithContent(this.control, subDocument, table);
                __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, subDocument, new __aspxRichEdit.FixedInterval(table.getStartPosition(), 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, false);
            }
            else {
                var startPosition = tableInfo.rawData.firstCell.startParagraphPosition.value;
                var columnsRange = __aspxRichEdit.TableCellUtils.getColumnsRangeBySelectedCells(tableInfo.rawData);
                for (var rowIndex = 0, row = void 0; row = table.rows[rowIndex]; rowIndex++) {
                    var cellIndices = __aspxRichEdit.TableCellUtils.getCellIndicesByColumnsRange(row, columnsRange);
                    if (cellIndices.length === row.cells.length) {
                        __aspxRichEdit.TablesManipulator.removeTableRowWithContent(this.control, subDocument, table, rowIndex);
                        rowIndex--;
                    }
                    else {
                        for (var i = cellIndices.length - 1; i >= 0; i--)
                            __aspxRichEdit.TablesManipulator.removeTableCellWithContent(this.control, subDocument, table, rowIndex, cellIndices[i]);
                    }
                    __aspxRichEdit.TablesManipulator.normalizeTableGrid(this.control, subDocument, table);
                }
                this.normalizeCellVerticalMerging(subDocument, table);
                __aspxRichEdit.TablesManipulator.normalizeCellColumnSpans(this.control, subDocument, table, true);
                __aspxRichEdit.TableConditionalFormattingCalculator.updateTable(this.control, table);
                __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, subDocument, new __aspxRichEdit.FixedInterval(startPosition, 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, false);
            }
            this.control.history.endTransaction();
            return true;
        };
        DeleteTableColumnsCommand.prototype.normalizeCellVerticalMerging = function (subDocument, table) {
            for (var rowIndex = table.rows.length - 1, row = void 0; row = table.rows[rowIndex]; rowIndex--) {
                for (var cellIndex = 0, cell = void 0; cell = row.cells[cellIndex]; cellIndex++) {
                    if (cell.verticalMerging === __aspxRichEdit.TableCellMergingState.None)
                        continue;
                    var columnIndex = __aspxRichEdit.TableCellUtils.getStartColumnIndex(cell);
                    var nextRow = table.rows[rowIndex + 1];
                    if (cell.verticalMerging === __aspxRichEdit.TableCellMergingState.Restart) {
                        if (rowIndex === table.rows.length - 1) {
                            this.control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, __aspxRichEdit.TableCellMergingState.None));
                            continue;
                        }
                        var nextRowCell = nextRow.cells[__aspxRichEdit.TableCellUtils.getCellIndexByColumnIndex(nextRow, columnIndex)];
                        if (!nextRowCell || nextRowCell.verticalMerging !== __aspxRichEdit.TableCellMergingState.Continue)
                            this.control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, __aspxRichEdit.TableCellMergingState.None));
                    }
                    else {
                        var prevRow = table.rows[rowIndex - 1];
                        var prevCell = prevRow ? prevRow.cells[__aspxRichEdit.TableCellUtils.getCellIndexByColumnIndex(prevRow, columnIndex)] : null;
                        var nextRow_1 = table.rows[rowIndex + 1];
                        var nextCell = nextRow_1 ? nextRow_1.cells[__aspxRichEdit.TableCellUtils.getCellIndexByColumnIndex(nextRow_1, columnIndex)] : null;
                        if (!prevCell || prevCell.verticalMerging === __aspxRichEdit.TableCellMergingState.None) {
                            if (!nextCell || nextCell.verticalMerging !== __aspxRichEdit.TableCellMergingState.Continue)
                                this.control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, __aspxRichEdit.TableCellMergingState.None));
                            else if (nextCell && nextCell.verticalMerging === __aspxRichEdit.TableCellMergingState.Continue)
                                this.control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, __aspxRichEdit.TableCellMergingState.Restart));
                        }
                    }
                }
            }
        };
        return DeleteTableColumnsCommand;
    }(__aspxRichEdit.TableCommandBase));
    __aspxRichEdit.DeleteTableColumnsCommand = DeleteTableColumnsCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DeleteTableCommand = (function (_super) {
        __extends(DeleteTableCommand, _super);
        function DeleteTableCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DeleteTableCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        DeleteTableCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this)
                && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables)
                && this.control.selection.tableInfo.extendedData.isSquare;
        };
        DeleteTableCommand.prototype.executeCore = function (_state, options) {
            this.control.history.beginTransaction();
            var tableInfo = this.control.selection.tableInfo;
            __aspxRichEdit.TablesManipulator.removeTableWithContent(this.control, options.subDocument, tableInfo.table);
            __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, options.subDocument, new __aspxRichEdit.FixedInterval(tableInfo.table.getStartPosition(), 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, false);
            this.control.history.endTransaction();
            return true;
        };
        return DeleteTableCommand;
    }(__aspxRichEdit.TableCommandBase));
    __aspxRichEdit.DeleteTableCommand = DeleteTableCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DeleteTableRowsCommand = (function (_super) {
        __extends(DeleteTableRowsCommand, _super);
        function DeleteTableRowsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DeleteTableRowsCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        DeleteTableRowsCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this)
                && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables)
                && this.control.selection.tableInfo.rawData.isSquare;
        };
        DeleteTableRowsCommand.prototype.executeCore = function (_state, options) {
            var _this = this;
            this.control.history.beginTransaction();
            var tableInfo = this.control.selection.tableInfo;
            var subDocument = options.subDocument;
            var table = tableInfo.table;
            if (tableInfo.rawData.numRows === table.rows.length) {
                __aspxRichEdit.TablesManipulator.removeTableWithContent(this.control, subDocument, table);
                __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, subDocument, new __aspxRichEdit.FixedInterval(table.getStartPosition(), 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, false);
            }
            else {
                var startPosition = tableInfo.rawData.firstCell.startParagraphPosition.value;
                __aspxRichEdit.ListUtils.reverseForeach(tableInfo.rawData.rows, function (rowInfo) {
                    return __aspxRichEdit.TablesManipulator.removeTableRowWithContent(_this.control, subDocument, table, rowInfo.rowIndex);
                });
                __aspxRichEdit.TablesManipulator.normalizeCellColumnSpans(this.control, subDocument, table, true);
                __aspxRichEdit.TableConditionalFormattingCalculator.updateTable(this.control, table);
                __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, subDocument, new __aspxRichEdit.FixedInterval(startPosition, 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, false);
            }
            this.control.history.endTransaction();
            return true;
        };
        return DeleteTableRowsCommand;
    }(__aspxRichEdit.TableCommandBase));
    __aspxRichEdit.DeleteTableRowsCommand = DeleteTableRowsCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertTableCellWithShiftToTheHorizontallyCommandBase = (function (_super) {
        __extends(InsertTableCellWithShiftToTheHorizontallyCommandBase, _super);
        function InsertTableCellWithShiftToTheHorizontallyCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertTableCellWithShiftToTheHorizontallyCommandBase.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        InsertTableCellWithShiftToTheHorizontallyCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables) && this.control.selection.tableInfo.extendedData.numRows > 0;
        };
        InsertTableCellWithShiftToTheHorizontallyCommandBase.prototype.executeCore = function (_state, options) {
            var _this = this;
            this.control.history.beginTransaction();
            var tblInfo = this.control.selection.tableInfo;
            var table = tblInfo.table;
            var subDocument = options.subDocument;
            var newCells = [];
            tblInfo.extendedData.foreach(function () { }, function (cellInfo, rowInfo) {
                if (cellInfo.cell.verticalMerging !== __aspxRichEdit.TableCellMergingState.Continue)
                    newCells.push(_this.insertTableCell(subDocument, table, rowInfo.rowIndex, cellInfo.cellIndex));
            });
            __aspxRichEdit.TablesManipulator.normalizeVerticalSpans(this.control, subDocument, table);
            var newCellIntervals = [];
            for (var i = 0, newCell = void 0; newCell = newCells[i]; i++)
                newCellIntervals.push(newCell.interval);
            __aspxRichEdit.TableConditionalFormattingCalculator.updateTable(this.control, table);
            this.control.history.addAndRedo(new __aspxRichEdit.SetSelectionHistoryItem(this.control.modelManipulator, subDocument, newCellIntervals, this.control.selection, __aspxRichEdit.UpdateInputPositionProperties.Yes, false));
            this.control.history.endTransaction();
            return true;
        };
        return InsertTableCellWithShiftToTheHorizontallyCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.InsertTableCellWithShiftToTheHorizontallyCommandBase = InsertTableCellWithShiftToTheHorizontallyCommandBase;
    var InsertTableCellWithShiftToTheLeftCommand = (function (_super) {
        __extends(InsertTableCellWithShiftToTheLeftCommand, _super);
        function InsertTableCellWithShiftToTheLeftCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertTableCellWithShiftToTheLeftCommand.prototype.insertTableCell = function (subDocument, table, rowIndex, cellIndex) {
            __aspxRichEdit.TablesManipulator.insertCellToTheLeft(this.control, subDocument, table, rowIndex, cellIndex);
            return table.rows[rowIndex].cells[cellIndex];
        };
        return InsertTableCellWithShiftToTheLeftCommand;
    }(InsertTableCellWithShiftToTheHorizontallyCommandBase));
    __aspxRichEdit.InsertTableCellWithShiftToTheLeftCommand = InsertTableCellWithShiftToTheLeftCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertTableCellsWithShiftToTheVerticallyCommand = (function (_super) {
        __extends(InsertTableCellsWithShiftToTheVerticallyCommand, _super);
        function InsertTableCellsWithShiftToTheVerticallyCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertTableCellsWithShiftToTheVerticallyCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        InsertTableCellsWithShiftToTheVerticallyCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables) && this.control.selection.tableInfo.extendedData.areCellsSelectedInSeries;
        };
        InsertTableCellsWithShiftToTheVerticallyCommand.prototype.executeCore = function (_state, _options) {
            var _this = this;
            this.control.history.beginTransaction();
            var tableInfo = this.control.selection.tableInfo;
            var table = tableInfo.table;
            var newCells = [];
            tableInfo.extendedData.foreach(function (rowInfo) {
                return __aspxRichEdit.ListUtils.addListOnTail(newCells, _this.insertTableCellWithShiftToTheVertically(_this.control.model.activeSubDocument, table, rowInfo));
            }, function () { });
            var newCellIntervals = [];
            for (var i = 0, newCell = void 0; newCell = newCells[i]; i++)
                newCellIntervals.push(newCell.interval);
            __aspxRichEdit.TableConditionalFormattingCalculator.updateTable(this.control, table);
            this.control.history.addAndRedo(new __aspxRichEdit.SetSelectionHistoryItem(this.control.modelManipulator, this.control.model.activeSubDocument, newCellIntervals, this.control.selection, __aspxRichEdit.UpdateInputPositionProperties.Yes, false));
            this.control.history.endTransaction();
            return true;
        };
        InsertTableCellsWithShiftToTheVerticallyCommand.prototype.insertTableCellWithShiftToTheVertically = function (subDocument, table, rowInfo) {
            if (__aspxRichEdit.ListUtils.allOf(rowInfo.cells, function (c) { return c.cell.verticalMerging == __aspxRichEdit.TableCellMergingState.Continue; }))
                return [];
            var startCellIndex = rowInfo.cells[0].cellIndex;
            var endCellIndex = startCellIndex + rowInfo.cells.length - 1;
            var insertedRowsCount = this.calculateInsertedRowsCount(table, rowInfo.rowIndex, startCellIndex, endCellIndex);
            var newCells = [];
            for (var i = 0; i < insertedRowsCount; i++) {
                __aspxRichEdit.TablesManipulator.insertRowBelow(this.control, subDocument, table, table.rows.length - 1);
                for (var cellIndex = endCellIndex; cellIndex >= startCellIndex; cellIndex--) {
                    newCells = newCells.concat(this.insertCellWithShiftToTheDown(subDocument, table, rowInfo.rowIndex + i, cellIndex));
                }
            }
            this.deleteTextInCell(subDocument, table, rowInfo.rowIndex, insertedRowsCount);
            return newCells;
        };
        InsertTableCellsWithShiftToTheVerticallyCommand.prototype.calculateInsertedRowsCount = function (table, rowIndex, startCellIndex, endCellIndex) {
            var row = table.rows[rowIndex];
            var result = Number.MAX_VALUE;
            for (var i = startCellIndex; i <= endCellIndex; i++) {
                var cell = row.cells[i];
                var columnIndex = __aspxRichEdit.TableCellUtils.getStartColumnIndex(cell);
                result = Math.min(result, __aspxRichEdit.TableCellUtils.getVerticalSpanCellPositions(__aspxRichEdit.TablePosition.createAndInit(table, rowIndex, i), columnIndex).length);
            }
            return result;
        };
        InsertTableCellsWithShiftToTheVerticallyCommand.prototype.insertCellWithShiftToTheDown = function (subDocument, table, rowIndex, cellIndex) {
            var newCells = [];
            for (var i = table.rows.length - 1; i > rowIndex; i--) {
                var currentRow = table.rows[i];
                var cellsCountInCurrentRow = currentRow.cells.length;
                var previousRow = table.rows[i - 1];
                if (cellIndex >= previousRow.cells.length)
                    continue;
                if (cellIndex >= cellsCountInCurrentRow) {
                    var previousRowLastCell = previousRow.cells[previousRow.cells.length - 1];
                    this.insertTableCells(subDocument, table, i, currentRow.cells.length - 1, cellIndex - cellsCountInCurrentRow + 1, previousRowLastCell.preferredWidth);
                }
                new __aspxRichEdit.InsertTableCellWithShiftToTheDownOperation(this.control, subDocument).execute(__aspxRichEdit.TablePosition.createAndInit(table, i, cellIndex), false);
                newCells.push(table.rows[i].cells[cellIndex]);
            }
            this.deleteContentInCell(subDocument, table, rowIndex, cellIndex);
            __aspxRichEdit.TablesManipulator.normalizeTableGrid(this.control, subDocument, table);
            __aspxRichEdit.TablesManipulator.normalizeCellColumnSpans(this.control, subDocument, table, true);
            return newCells;
        };
        InsertTableCellsWithShiftToTheVerticallyCommand.prototype.insertTableCells = function (subDocument, table, patternRowIndex, patternCellIndex, insertedCellsCount, preferredWidth) {
            for (var i = 0; i < insertedCellsCount; i++) {
                var lastCellIndex = patternCellIndex + i;
                __aspxRichEdit.TablesManipulator.insertCellToTheRight(this.control, subDocument, table, patternRowIndex, lastCellIndex, false, true, false);
                this.control.history.addAndRedo(new __aspxRichEdit.TableCellPreferredWidthHistoryItem(this.control.modelManipulator, subDocument, table.index, patternRowIndex, lastCellIndex + 1, preferredWidth.clone()));
            }
        };
        InsertTableCellsWithShiftToTheVerticallyCommand.prototype.deleteTextInCell = function (subDocument, table, rowIndex, rowsCount) {
            var startRowIndex = rowIndex + 1;
            var endRowIndex = startRowIndex + rowsCount;
            for (var i = startRowIndex; i < endRowIndex; i++) {
                var row = table.rows[i];
                for (var cellIndex = 0, cell = void 0; cell = row.cells[cellIndex]; cellIndex++) {
                    if (cell.verticalMerging === __aspxRichEdit.TableCellMergingState.Continue)
                        this.deleteContentInCell(subDocument, table, i, cellIndex);
                }
            }
        };
        InsertTableCellsWithShiftToTheVerticallyCommand.prototype.deleteContentInCell = function (subDocument, table, rowIndex, cellIndex) {
            var cell = table.rows[rowIndex].cells[cellIndex];
            if (cell.endParagrapPosition.value - cell.startParagraphPosition.value > 1)
                __aspxRichEdit.ModelManipulator.removeInterval(this.control, subDocument, __aspxRichEdit.FixedInterval.fromPositions(cell.startParagraphPosition.value, cell.endParagrapPosition.value - 1), true, false);
        };
        return InsertTableCellsWithShiftToTheVerticallyCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.InsertTableCellsWithShiftToTheVerticallyCommand = InsertTableCellsWithShiftToTheVerticallyCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertTableColumnCommandBase = (function (_super) {
        __extends(InsertTableColumnCommandBase, _super);
        function InsertTableColumnCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertTableColumnCommandBase.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        InsertTableColumnCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables) && this.control.selection.tableInfo.extendedData.isSquare;
        };
        InsertTableColumnCommandBase.prototype.executeCore = function (_state, options) {
            this.control.history.beginTransaction();
            var patternCell = this.getPatternCell();
            var columnIndex = this.getColumnIndex(patternCell);
            var table = patternCell.parentRow.parentTable;
            var columnCellIndices = this.getColumnCellIndices(table, columnIndex);
            var columnCount = this.getInsertedColumnCount();
            var newCells = [];
            var subDocument = options.subDocument;
            for (var i = 0; i < columnCount; i++) {
                for (var rowIndex = columnCellIndices.length - 1; rowIndex >= 0; rowIndex--) {
                    newCells.push(this.splitTableCellCore(subDocument, table, rowIndex, columnCellIndices[rowIndex], patternCell));
                }
            }
            __aspxRichEdit.TablesManipulator.normalizeTableGrid(this.control, subDocument, table);
            __aspxRichEdit.TablesManipulator.normalizeCellColumnSpans(this.control, subDocument, table, false);
            __aspxRichEdit.TablesManipulator.normalizeTableCellWidth(this.control, subDocument, table);
            var newCellIntervals = [];
            for (var i = 0, newCell = void 0; newCell = newCells[i]; i++)
                newCellIntervals.push(newCell.interval);
            __aspxRichEdit.TableConditionalFormattingCalculator.updateTable(this.control, table);
            this.control.history.endTransaction();
            return true;
        };
        InsertTableColumnCommandBase.prototype.getInsertedColumnCount = function () {
            return __aspxRichEdit.ListUtils.accumulate(this.control.selection.tableInfo.extendedData.rows, __aspxRichEdit.Constants.MAX_SAFE_INTEGER, function (acc, rowInfo) { return Math.min(acc, rowInfo.columnCountInSeries); });
        };
        InsertTableColumnCommandBase.prototype.getColumnCellIndices = function (table, columnIndex) {
            var _this = this;
            return __aspxRichEdit.ListUtils.map(table.rows, function (currentRow) { return _this.getCurrentCellIndex(columnIndex, currentRow); });
        };
        InsertTableColumnCommandBase.prototype.insertParagraphToTheLeft = function (subDocument, currentCell) {
            var sourceRun = subDocument.getRunByPosition(currentCell.startParagraphPosition.value);
            var sourceParagraph = subDocument.getParagraphByPosition(currentCell.startParagraphPosition.value);
            this.control.history.addAndRedo(new __aspxRichEdit.InsertParagraphHistoryItem(this.control.modelManipulator, subDocument, currentCell.startParagraphPosition.value, sourceRun.maskedCharacterProperties, sourceRun.characterStyle, sourceParagraph.maskedParagraphProperties, sourceParagraph.paragraphStyle, sourceParagraph.numberingListIndex, sourceParagraph.listLevelIndex, sourceParagraph.tabs.clone()));
        };
        InsertTableColumnCommandBase.prototype.insertParagraphToTheRight = function (subDocument, currentCell) {
            var sourceRun = subDocument.getRunByPosition(currentCell.endParagrapPosition.value - 1);
            var sourceParagraph = subDocument.getParagraphByPosition(currentCell.endParagrapPosition.value - 1);
            this.control.history.addAndRedo(new __aspxRichEdit.InsertParagraphHistoryItem(this.control.modelManipulator, subDocument, currentCell.endParagrapPosition.value - 1, sourceRun.maskedCharacterProperties, sourceRun.characterStyle, sourceParagraph.maskedParagraphProperties, sourceParagraph.paragraphStyle, sourceParagraph.numberingListIndex, sourceParagraph.listLevelIndex, sourceParagraph.tabs.clone()));
        };
        return InsertTableColumnCommandBase;
    }(__aspxRichEdit.TableCommandBase));
    __aspxRichEdit.InsertTableColumnCommandBase = InsertTableColumnCommandBase;
    var InsertTableColumnToTheLeftCommand = (function (_super) {
        __extends(InsertTableColumnToTheLeftCommand, _super);
        function InsertTableColumnToTheLeftCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertTableColumnToTheLeftCommand.prototype.splitTableCellCore = function (subDocument, table, rowIndex, cellIndex, patternCell) {
            if (cellIndex < 0)
                cellIndex = table.rows[rowIndex].cells.length - 1;
            this.insertParagraphToTheLeft(subDocument, table.rows[rowIndex].cells[cellIndex]);
            this.control.history.addAndRedo(new __aspxRichEdit.SplitTableCellToTheLeftHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, true));
            this.control.history.addAndRedo(new __aspxRichEdit.TableCellPreferredWidthHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, patternCell.preferredWidth.clone()));
            return table.rows[rowIndex].cells[cellIndex];
        };
        InsertTableColumnToTheLeftCommand.prototype.getPatternCell = function () {
            return this.control.selection.tableInfo.extendedData.firstCell;
        };
        InsertTableColumnToTheLeftCommand.prototype.getColumnIndex = function (patternCell) {
            return __aspxRichEdit.TableCellUtils.getStartColumnIndex(patternCell);
        };
        InsertTableColumnToTheLeftCommand.prototype.getCurrentCellIndex = function (relativeColumnIndex, currentRow) {
            return __aspxRichEdit.TableCellUtils.getCellIndexByColumnIndex(currentRow, relativeColumnIndex);
        };
        return InsertTableColumnToTheLeftCommand;
    }(InsertTableColumnCommandBase));
    __aspxRichEdit.InsertTableColumnToTheLeftCommand = InsertTableColumnToTheLeftCommand;
    var InsertTableColumnToTheRightCommand = (function (_super) {
        __extends(InsertTableColumnToTheRightCommand, _super);
        function InsertTableColumnToTheRightCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertTableColumnToTheRightCommand.prototype.splitTableCellCore = function (subDocument, table, rowIndex, cellIndex, patternCell) {
            if (cellIndex < 0) {
                this.insertParagraphToTheLeft(subDocument, table.rows[rowIndex].cells[0]);
                this.control.history.addAndRedo(new __aspxRichEdit.SplitTableCellToTheLeftHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, 0, true));
            }
            else {
                this.insertParagraphToTheRight(subDocument, table.rows[rowIndex].cells[cellIndex]);
                this.control.history.addAndRedo(new __aspxRichEdit.SplitTableCellToTheRightHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, true));
            }
            this.control.history.addAndRedo(new __aspxRichEdit.TableCellPreferredWidthHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, Math.max(0, cellIndex), patternCell.preferredWidth.clone()));
            return table.rows[rowIndex].cells[cellIndex + 1];
        };
        InsertTableColumnToTheRightCommand.prototype.getPatternCell = function () {
            return __aspxRichEdit.ListUtils.last(__aspxRichEdit.ListUtils.last(this.control.selection.tableInfo.extendedData.rows).cells).cell;
        };
        InsertTableColumnToTheRightCommand.prototype.getColumnIndex = function (patternCell) {
            return __aspxRichEdit.TableCellUtils.getStartColumnIndex(patternCell) + patternCell.columnSpan - 1;
        };
        InsertTableColumnToTheRightCommand.prototype.getCurrentCellIndex = function (relativeColumnIndex, currentRow) {
            return __aspxRichEdit.TableCellUtils.getCellIndexByEndColumnIndex(currentRow, relativeColumnIndex);
        };
        return InsertTableColumnToTheRightCommand;
    }(InsertTableColumnCommandBase));
    __aspxRichEdit.InsertTableColumnToTheRightCommand = InsertTableColumnToTheRightCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertTableCoreCommand = (function (_super) {
        __extends(InsertTableCoreCommand, _super);
        function InsertTableCoreCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertTableCoreCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        InsertTableCoreCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables);
        };
        InsertTableCoreCommand.prototype.executeCore = function (_state, options) {
            var parameter = options.param;
            var subDocument = this.control.model.activeSubDocument;
            var position = this.control.selection.intervals[0].start;
            var lp = __aspxRichEdit.LayoutPosition.ensure(this.control, subDocument, position, __aspxRichEdit.DocumentLayoutDetailsLevel.Row, new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
            var currentTable = __aspxRichEdit.Table.getTableByPosition(subDocument.tables, position, true);
            var availableWidth = currentTable ? lp.row.tableCellInfo.avaliableContentWidth :
                __aspxRichEdit.LayoutColumn.findSectionColumnWithMinimumWidth(lp.pageArea.columns);
            this.control.history.beginTransaction();
            var table = __aspxRichEdit.TablesManipulator.insertTable(this.control, subDocument, parameter.rowCount, parameter.cellCount, position, __aspxRichEdit.UnitConverter.pixelsToTwipsF(availableWidth));
            var newTableBorder = new __aspxRichEdit.BorderInfo();
            newTableBorder.style = __aspxRichEdit.BorderLineStyle.Single;
            newTableBorder.width = 15;
            newTableBorder.color = this.control.model.colorProvider.getModelColorFromRgba(0);
            this.control.history.addAndRedo(new __aspxRichEdit.TableBordersHistoryItem(this.control.modelManipulator, subDocument, table.index, [
                newTableBorder.clone(), newTableBorder.clone(), newTableBorder.clone(), newTableBorder.clone(), newTableBorder.clone(), newTableBorder.clone()
            ], [true, true, true, true, true, true]));
            __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, subDocument, new __aspxRichEdit.FixedInterval(table.getStartPosition(), 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, false);
            __aspxRichEdit.TableConditionalFormattingCalculator.updateTable(this.control, table);
            this.control.history.endTransaction();
            return true;
        };
        return InsertTableCoreCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.InsertTableCoreCommand = InsertTableCoreCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertTableRowCommandBase = (function (_super) {
        __extends(InsertTableRowCommandBase, _super);
        function InsertTableRowCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertTableRowCommandBase.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        InsertTableRowCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables) &&
                this.control.selection.tableInfo.isSelected && this.control.selection.tableInfo.rawData.withoutGapByRows;
        };
        InsertTableRowCommandBase.prototype.executeCore = function (_state, options) {
            var _this = this;
            this.control.history.beginTransaction();
            var subDocument = options.subDocument;
            var tableInfo = this.control.selection.tableInfo;
            var table = tableInfo.table;
            var rowCount = tableInfo.rawData.numRows;
            var patternRowIndex = this.getPatternRowIndex(tableInfo);
            var newRows = __aspxRichEdit.ListUtils.initByCallback(rowCount, function (rowOffset) { return _this.insertTableRowCore(subDocument, table, patternRowIndex + rowOffset); });
            __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, subDocument, __aspxRichEdit.FixedInterval.fromPositions(newRows[0].getStartPosition(), __aspxRichEdit.ListUtils.last(newRows).getEndPosition()), __aspxRichEdit.UpdateInputPositionProperties.Yes, false);
            __aspxRichEdit.TableConditionalFormattingCalculator.updateTable(this.control, table);
            this.control.history.endTransaction();
            return true;
        };
        return InsertTableRowCommandBase;
    }(__aspxRichEdit.TableCommandBase));
    __aspxRichEdit.InsertTableRowCommandBase = InsertTableRowCommandBase;
    var InsertTableRowAboveCommand = (function (_super) {
        __extends(InsertTableRowAboveCommand, _super);
        function InsertTableRowAboveCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertTableRowAboveCommand.prototype.insertTableRowCore = function (subDocument, table, patternRowIndex) {
            __aspxRichEdit.TablesManipulator.insertRowAbove(this.control, subDocument, table, patternRowIndex);
            return table.rows[patternRowIndex];
        };
        InsertTableRowAboveCommand.prototype.getPatternRowIndex = function (tableInfo) {
            return tableInfo.rawData.rows[0].rowIndex;
        };
        return InsertTableRowAboveCommand;
    }(InsertTableRowCommandBase));
    __aspxRichEdit.InsertTableRowAboveCommand = InsertTableRowAboveCommand;
    var InsertTableRowBelowCommand = (function (_super) {
        __extends(InsertTableRowBelowCommand, _super);
        function InsertTableRowBelowCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertTableRowBelowCommand.prototype.insertTableRowCore = function (subDocument, table, patternRowIndex) {
            __aspxRichEdit.TablesManipulator.insertRowBelow(this.control, subDocument, table, patternRowIndex);
            return table.rows[patternRowIndex + 1];
        };
        InsertTableRowBelowCommand.prototype.getPatternRowIndex = function (tableInfo) {
            return tableInfo.rawData.lastRowInfo.rowIndex;
        };
        return InsertTableRowBelowCommand;
    }(InsertTableRowCommandBase));
    __aspxRichEdit.InsertTableRowBelowCommand = InsertTableRowBelowCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var MergeTableCellsCommand = (function (_super) {
        __extends(MergeTableCellsCommand, _super);
        function MergeTableCellsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        MergeTableCellsCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.visible = this.control.selection.tableInfo.extendedData.numRows > 0 && !this.control.selection.specialRunInfo.isPictureSelected();
            return state;
        };
        MergeTableCellsCommand.prototype.isEnabled = function () {
            var data = this.control.selection.tableInfo.extendedData;
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables) &&
                data.isSquare && (data.numRows > 1 || data.rows[0].cells.length > 1);
        };
        MergeTableCellsCommand.prototype.executeCore = function (_state, options) {
            this.control.history.beginTransaction();
            var tblInfo = this.control.selection.tableInfo;
            var subDocument = options.subDocument;
            this.mergeCellsHorizontally(subDocument, tblInfo);
            this.mergeCellsVertically(subDocument, tblInfo);
            __aspxRichEdit.TablesManipulator.normalizeRows(this.control, subDocument, tblInfo.table);
            __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, subDocument, tblInfo.extendedData.firstCell.interval, __aspxRichEdit.UpdateInputPositionProperties.Yes, false);
            __aspxRichEdit.TableConditionalFormattingCalculator.updateTable(this.control, tblInfo.table);
            this.control.history.endTransaction();
            return true;
        };
        MergeTableCellsCommand.prototype.mergeCellsHorizontally = function (subDocument, tblInfo) {
            var _this = this;
            tblInfo.extendedData.foreach(function (rowInfo) {
                var modelCellInterval = new __aspxRichEdit.BoundaryInterval(rowInfo.cells[0].cellIndex, __aspxRichEdit.ListUtils.last(rowInfo.cells).cellIndex + 1);
                for (var modelCellInd = modelCellInterval.end - 2; modelCellInd >= modelCellInterval.start; modelCellInd--)
                    __aspxRichEdit.TablesManipulator.mergeTwoTableCellsHorizontally(_this.control, subDocument, new __aspxRichEdit.TablePosition(tblInfo.table, rowInfo.rowIndex, modelCellInd).init());
            }, function () { });
        };
        MergeTableCellsCommand.prototype.mergeCellsVertically = function (subDocument, tblInfo) {
            var _this = this;
            __aspxRichEdit.ListUtils.reverseForeach(tblInfo.extendedData.rows, function (rowInfo) {
                __aspxRichEdit.TablesManipulator.mergeTwoTableCellsVertically(_this.control, subDocument, new __aspxRichEdit.TablePosition(tblInfo.table, rowInfo.rowIndex, rowInfo.cells[0].cellIndex).init());
            }, tblInfo.extendedData.numRows - 2);
        };
        return MergeTableCellsCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.MergeTableCellsCommand = MergeTableCellsCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SplitTableCellsCommand = (function (_super) {
        __extends(SplitTableCellsCommand, _super);
        function SplitTableCellsCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SplitTableCellsCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        SplitTableCellsCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables) && this.control.selection.tableInfo.extendedData.areCellsSelectedInSeries;
        };
        SplitTableCellsCommand.prototype.executeCore = function (_state, options) {
            var parameters = options.param;
            this.control.history.beginTransaction();
            var tableInfo = this.control.selection.tableInfo;
            var selectedCells = __aspxRichEdit.ListUtils.map(tableInfo.rawData.rows, function (rowInfo) { return __aspxRichEdit.ListUtils.map(rowInfo.cells, function (cellInfo) { return cellInfo.cell; }); });
            var firstCell = tableInfo.extendedData.firstCell;
            if (parameters.isMergeBeforeSplit) {
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.MergeTableCells).execute(this.control.commandManager.isPublicApiCall);
                selectedCells = this.filterRemovedCells(selectedCells);
            }
            this.splitTableCellsHorizontally(this.control.model.activeSubDocument, selectedCells, parameters);
            this.splitTableCellsVertically(this.control.model.activeSubDocument, selectedCells, parameters);
            __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, this.control.model.activeSubDocument, new __aspxRichEdit.FixedInterval(selectedCells[0][0].startParagraphPosition.value, 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, false);
            __aspxRichEdit.TableConditionalFormattingCalculator.updateTable(this.control, firstCell.parentRow.parentTable);
            this.control.history.endTransaction();
            return true;
        };
        SplitTableCellsCommand.prototype.splitTableCellsHorizontally = function (subDocument, selectedCells, parameters) {
            var startCell = selectedCells[0][0];
            var table = startCell.parentRow.parentTable;
            if (parameters.isMergeBeforeSplit) {
                var rowIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(table.rows, function (r) { return r.getStartPosition(); }, startCell.startParagraphPosition.value);
                var cellIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(table.rows[rowIndex].cells, function (c) { return c.startParagraphPosition.value; }, startCell.startParagraphPosition.value);
                this.splitTableCellsHorizontallyCore(subDocument, __aspxRichEdit.TablePosition.createAndInit(table, rowIndex, cellIndex), parameters.columnCount);
                return;
            }
            var topRowIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(table.rows, function (r) { return r.getStartPosition(); }, startCell.startParagraphPosition.value);
            for (var i = selectedCells.length - 1; i >= 0; i--) {
                var rowIndex = i + topRowIndex;
                var row = table.rows[rowIndex];
                var startCellIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(row.cells, function (c) { return c.startParagraphPosition.value; }, selectedCells[i][0].startParagraphPosition.value);
                for (var j = selectedCells[i].length - 1; j >= 0; j--) {
                    var cellIndex = startCellIndex + j;
                    var cell = row.cells[cellIndex];
                    if (cell.verticalMerging === __aspxRichEdit.TableCellMergingState.Continue)
                        continue;
                    this.splitTableCellsHorizontallyCore(subDocument, __aspxRichEdit.TablePosition.createAndInit(table, rowIndex, cellIndex), parameters.columnCount);
                }
            }
        };
        SplitTableCellsCommand.prototype.splitTableCellsVertically = function (subDocument, selectedCells, parameters) {
            if (parameters.rowCount === 1)
                return;
            var columnCount = this.getColumnsCountForSplitVertically(selectedCells[0], parameters);
            var startCell = selectedCells[0][0];
            var topRowIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(startCell.parentRow.parentTable.rows, function (r) { return r.getStartPosition(); }, startCell.startParagraphPosition.value);
            var startCellIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(startCell.parentRow.cells, function (c) { return c.startParagraphPosition.value; }, startCell.startParagraphPosition.value);
            this.splitTableCellsVerticallyCore(subDocument, __aspxRichEdit.TablePosition.createAndInit(startCell.parentRow.parentTable, topRowIndex, startCellIndex), parameters.rowCount, columnCount);
        };
        SplitTableCellsCommand.prototype.splitTableCellsVerticallyCore = function (subDocument, position, rowsCount, columnsCount) {
            if (position.cell.verticalMerging === __aspxRichEdit.TableCellMergingState.Restart) {
                this.splitMergedCellsVertically(subDocument, position, columnsCount, rowsCount);
                return;
            }
            var table = position.table;
            this.insertRows(subDocument, position, rowsCount);
            var startIndex = position.cellIndex;
            var endIndex = position.cellIndex + columnsCount - 1;
            for (var i = 0, cell = void 0; cell = position.row.cells[i]; i++) {
                if (i < startIndex || i > endIndex) {
                    var columnIndex = __aspxRichEdit.TableCellUtils.getStartColumnIndex(cell);
                    var mergeCellPosition = __aspxRichEdit.TableCellUtils.getVerticalSpanCellPositions(__aspxRichEdit.TablePosition.createAndInit(table, position.rowIndex, i), columnIndex)[0];
                    var restartRowIndex = mergeCellPosition.rowIndex;
                    var continionRowIndex = rowsCount + position.rowIndex - 2;
                    for (var i_4 = continionRowIndex; i_4 >= restartRowIndex; i_4--) {
                        var row = table.rows[i_4];
                        var mergeCellIndex = __aspxRichEdit.TableCellUtils.getCellIndexByColumnIndex(row, columnIndex);
                        __aspxRichEdit.TablesManipulator.mergeTwoTableCellsVertically(this.control, subDocument, __aspxRichEdit.TablePosition.createAndInit(table, i_4, mergeCellIndex));
                    }
                    __aspxRichEdit.TablesManipulator.normalizeRows(this.control, subDocument, table);
                }
            }
        };
        SplitTableCellsCommand.prototype.insertRows = function (subDocument, position, rowsCount) {
            var rowHeight = position.row.height;
            this.control.history.addAndRedo(new __aspxRichEdit.TableRowHeightHistoryItem(this.control.modelManipulator, subDocument, position.table.index, position.rowIndex, __aspxRichEdit.TableHeightUnit.create(rowHeight.value / rowsCount, rowHeight.type)));
            for (var i = 1; i < rowsCount; i++) {
                __aspxRichEdit.TablesManipulator.insertRowBelow(this.control, subDocument, position.table, position.rowIndex);
            }
        };
        SplitTableCellsCommand.prototype.splitMergedCellsVertically = function (subDocument, position, columnsCount, rowsCount) {
            var endIndex = position.cellIndex + columnsCount - 1;
            for (var cellIndex = position.cellIndex; cellIndex <= endIndex; cellIndex++) {
                this.splitMergedCellsVerticallyCore(subDocument, __aspxRichEdit.TablePosition.createAndInit(position.table, position.rowIndex, cellIndex), rowsCount);
            }
        };
        SplitTableCellsCommand.prototype.splitMergedCellsVerticallyCore = function (subDocument, position, rowsCount) {
            var columnIndex = __aspxRichEdit.TableCellUtils.getStartColumnIndex(position.cell);
            var mergedCellsPositions = __aspxRichEdit.TableCellUtils.getVerticalSpanCellPositions(position, columnIndex);
            if (mergedCellsPositions.length === rowsCount) {
                for (var i = 0, mergedCellsPosition = void 0; mergedCellsPosition = mergedCellsPositions[i]; i++) {
                    this.control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(this.control.modelManipulator, subDocument, position.table.index, mergedCellsPosition.rowIndex, mergedCellsPosition.cellIndex, __aspxRichEdit.TableCellMergingState.None));
                }
                return;
            }
            var totalRowsCount = mergedCellsPositions.length / rowsCount;
            for (var i = 0, mergedCellsPosition = void 0; mergedCellsPosition = mergedCellsPositions[i]; i++) {
                if (i % totalRowsCount == 0)
                    this.control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(this.control.modelManipulator, subDocument, position.table.index, mergedCellsPosition.rowIndex, mergedCellsPosition.cellIndex, __aspxRichEdit.TableCellMergingState.Restart));
            }
        };
        SplitTableCellsCommand.prototype.splitTableCellsHorizontallyCore = function (subDocument, position, columnsCount) {
            var columnIndex = __aspxRichEdit.TableCellUtils.getStartColumnIndex(position.cell);
            var verticalSpanPositions = __aspxRichEdit.TableCellUtils.getVerticalSpanCellPositions(position, columnIndex);
            var spanDelta = columnsCount - position.cell.columnSpan;
            var oldPatternCellWidth = position.cell.preferredWidth;
            if (oldPatternCellWidth.type !== __aspxRichEdit.TableWidthUnitType.Nil && oldPatternCellWidth.type !== __aspxRichEdit.TableWidthUnitType.Auto) {
                for (var i = verticalSpanPositions.length - 1; i >= 0; i--) {
                    var cellPosition = verticalSpanPositions[i];
                    var cellWidth = cellPosition.cell.preferredWidth;
                    if (cellWidth.type !== __aspxRichEdit.TableWidthUnitType.Nil && cellWidth.type !== __aspxRichEdit.TableWidthUnitType.Auto)
                        this.control.history.addAndRedo(new __aspxRichEdit.TableCellPreferredWidthHistoryItem(this.control.modelManipulator, subDocument, cellPosition.table.index, cellPosition.rowIndex, cellPosition.cellIndex, __aspxRichEdit.TableWidthUnit.create(cellWidth.value / columnsCount, cellWidth.type)));
                    if (cellPosition.cell.columnSpan > 1)
                        this.control.history.addAndRedo(new __aspxRichEdit.TableCellColumnSpanHistoryItem(this.control.modelManipulator, subDocument, cellPosition.table.index, cellPosition.rowIndex, cellPosition.cellIndex, Math.max(1, cellPosition.cell.columnSpan - (columnsCount - 1))));
                }
            }
            for (var i = 1; i < columnsCount; i++)
                __aspxRichEdit.TablesManipulator.insertCellToTheRight(this.control, subDocument, position.table, position.rowIndex, position.cellIndex, false, false);
            if (spanDelta > 0)
                this.normalizeColumnSpansAfterSplitHorizontally(subDocument, verticalSpanPositions, columnIndex, spanDelta);
        };
        SplitTableCellsCommand.prototype.normalizeColumnSpansAfterSplitHorizontally = function (subDocument, verticalSpanPositions, columnIndex, newColumnsCount) {
            var table = verticalSpanPositions[0].table;
            var startRowIndex = verticalSpanPositions[0].rowIndex;
            var endRowIndex = startRowIndex + verticalSpanPositions.length - 1;
            for (var rowIndex = 0, row = void 0; row = table.rows[rowIndex]; rowIndex++) {
                if (rowIndex >= startRowIndex && rowIndex <= endRowIndex)
                    continue;
                var cellIndex = __aspxRichEdit.TableCellUtils.getCellIndexByColumnIndex(row, columnIndex);
                var cell = row.cells[cellIndex];
                if (!cell) {
                    if (row.gridBefore >= columnIndex)
                        this.control.history.addAndRedo(new __aspxRichEdit.TableRowGridBeforeHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, row.gridBefore + newColumnsCount));
                    else
                        this.control.history.addAndRedo(new __aspxRichEdit.TableRowGridAfterHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, row.gridAfter + newColumnsCount));
                }
                else
                    this.control.history.addAndRedo(new __aspxRichEdit.TableCellColumnSpanHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, cell.columnSpan + newColumnsCount));
            }
        };
        SplitTableCellsCommand.prototype.getColumnsCountForSplitVertically = function (selectedCells, parameters) {
            if (parameters.isMergeBeforeSplit)
                return parameters.columnCount;
            return selectedCells.length * parameters.columnCount;
        };
        SplitTableCellsCommand.prototype.filterRemovedCells = function (selectedCells) {
            var result = [];
            var table = selectedCells[0][0].parentRow.parentTable;
            for (var i = 0, horCells = void 0; horCells = selectedCells[i]; i++) {
                var row = horCells[0].parentRow;
                if (__aspxRichEdit.ListUtils.indexOf(table.rows, row) < 0)
                    continue;
                result.push([horCells[0]]);
            }
            return result;
        };
        return SplitTableCellsCommand;
    }(__aspxRichEdit.TableCommandBase));
    __aspxRichEdit.SplitTableCellsCommand = SplitTableCellsCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ToggleTableCellsBorderCommandBase = (function (_super) {
        __extends(ToggleTableCellsBorderCommandBase, _super);
        function ToggleTableCellsBorderCommandBase() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.affectNeighbours = true;
            _this.affectInner = true;
            _this.affectOuter = true;
            _this.affectOnStateFlags = TableBorderGridCellInfo.All;
            return _this;
        }
        Object.defineProperty(ToggleTableCellsBorderCommandBase.prototype, "colorProvider", {
            get: function () { return this.control.model.colorProvider; },
            enumerable: true,
            configurable: true
        });
        ToggleTableCellsBorderCommandBase.prototype.DEPRECATEDConvertOptionsParameter = function (parameter) {
            return parameter instanceof __aspxRichEdit.BorderInfo ? parameter : this.control.model.repositoryBorderItem;
        };
        ToggleTableCellsBorderCommandBase.prototype.getState = function (options) {
            if (options === void 0) { options = this.convertToCommandOptions(null); }
            var tableInfo = this.control.selection.tableInfo;
            var enabled = this.isEnabled() && this.control.selection.tableInfo.extendedData.areCellsSelectedInSeries;
            var state = new __aspxRichEdit.SimpleCommandState(enabled);
            if (state.enabled)
                state.value = this.isChecked(tableInfo, options.param);
            return state;
        };
        ToggleTableCellsBorderCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.tables);
        };
        ToggleTableCellsBorderCommandBase.prototype.isChecked = function (tableInfo, patternBorder) {
            var table = tableInfo.table;
            if (tableInfo.extendedData.isSelectedEntireTable)
                return this.checkBorderInEntireTable(patternBorder, table);
            var tableBordersInfo = new __aspxRichEdit.LayoutFormatter.Table.TableBorderInfoProvider(this.control.model, table, __aspxRichEdit.Utils.dumbConverter);
            var bordersGrid = this.createCellBorderGrid(table, tableInfo, tableBordersInfo);
            return this.isCheckedInParticallyTableSelection(table, bordersGrid, tableBordersInfo, patternBorder);
        };
        ToggleTableCellsBorderCommandBase.prototype.executeCore = function (state, options) {
            this.control.history.beginTransaction();
            var tableInfo = this.control.selection.tableInfo;
            var table = tableInfo.table;
            var patternBorder = options.param;
            var subDocument = this.control.model.activeSubDocument;
            if (tableInfo.extendedData.isSelectedEntireTable)
                this.applyBorderToTable(subDocument, table, state.value ? null : patternBorder);
            var tblBrdProv = new __aspxRichEdit.LayoutFormatter.Table.TableBorderInfoProvider(this.control.model, table, __aspxRichEdit.Utils.dumbConverter);
            var grid = this.createCellBorderGrid(table, tableInfo, tblBrdProv);
            for (var i = 0, gridRow = void 0; gridRow = grid[i]; i++) {
                var cellIndex = -1;
                var prevCell = null;
                for (var j = 0, gridCell = void 0; gridCell = gridRow[j]; j++) {
                    if (gridCell.cell != prevCell)
                        cellIndex++;
                    prevCell = gridCell.cell;
                    if (!gridCell.cell || gridCell.cell.verticalMerging === __aspxRichEdit.TableCellMergingState.Continue)
                        continue;
                    this.applyBorderToCell(subDocument, table, gridCell, i, cellIndex, state.value ? null : patternBorder.clone());
                }
            }
            this.control.history.endTransaction();
            return true;
        };
        ToggleTableCellsBorderCommandBase.prototype.isCheckedInParticallyTableSelection = function (table, grid, tableBordersInfo, patternBorder) {
            var hasAffectedCells = false;
            for (var i = 0, gridRow = void 0; gridRow = grid[i]; i++) {
                for (var j = 0, gridCell = void 0; gridCell = gridRow[j]; j++) {
                    if (!gridCell.cell || gridCell.cell.verticalMerging === __aspxRichEdit.TableCellMergingState.Continue || gridCell.info === TableBorderGridCellInfo.None)
                        continue;
                    if (!(gridCell.info & this.affectOnStateFlags))
                        continue;
                    hasAffectedCells = true;
                    if (!this.checkBorderInParticallyTableSelection(patternBorder, table, grid, gridCell, i, j, tableBordersInfo))
                        return false;
                }
            }
            return hasAffectedCells;
        };
        ToggleTableCellsBorderCommandBase.prototype.createCellBorderGrid = function (table, tableInfo, tableBordersInfo) {
            var grid = this.createCellBorderGridCore(table, tableInfo);
            var rowsCount = grid.length;
            var columnsCount = grid[0].length;
            for (var rowIndex = 0, row = void 0; row = table.rows[rowIndex]; rowIndex++) {
                var columnIndex = row.gridBefore;
                var isLastRow = rowIndex + 1 === rowsCount;
                var hasSpacing = tableBordersInfo.cellSpacings[rowIndex] > 0;
                for (var cellIndex = 0, cell = void 0; cell = row.cells[cellIndex]; cellIndex++) {
                    var isLastCell = columnIndex + cell.columnSpan === columnsCount;
                    var gridCell = grid[rowIndex][columnIndex];
                    if (cell.verticalMerging === __aspxRichEdit.TableCellMergingState.Continue) {
                        if (isLastRow && grid[rowIndex - 1][columnIndex].info & TableBorderGridCellInfo.BottomOuter) {
                            var prevRowIndex = rowIndex;
                            do {
                                prevRowIndex--;
                                grid[prevRowIndex][columnIndex].info |= TableBorderGridCellInfo.BottomTableOuter;
                            } while (grid[prevRowIndex][columnIndex].cell.verticalMerging !== __aspxRichEdit.TableCellMergingState.Restart);
                        }
                        gridCell.info = grid[rowIndex - 1][columnIndex].info;
                    }
                    else if (!gridCell.selected) {
                        if (!hasSpacing && this.affectNeighbours) {
                            if (!isLastRow && this.checkBottomSibling(grid, rowIndex, columnIndex, ToggleTableCellsBorderCommandBase.checkVSiblingSelected))
                                gridCell.info |= TableBorderGridCellInfo.TopNeighbour;
                            if (this.checkLeftRightSiblingSelected(cell, rowIndex, columnIndex, columnIndex - 1, TableBorderGridCellInfo.RightNeighbour, grid))
                                gridCell.info |= TableBorderGridCellInfo.RightNeighbour;
                            if (ToggleTableCellsBorderCommandBase.checkVSiblingSelected(cell.columnSpan, rowIndex - 1, columnIndex, grid))
                                gridCell.info |= TableBorderGridCellInfo.BottomNeighbour;
                            if (!isLastCell && this.checkLeftRightSiblingSelected(cell, rowIndex, columnIndex, columnIndex + cell.columnSpan, TableBorderGridCellInfo.LeftNeighbour, grid))
                                gridCell.info |= TableBorderGridCellInfo.LeftNeighbour;
                        }
                    }
                    else {
                        if (this.affectInner) {
                            if (ToggleTableCellsBorderCommandBase.checkVSiblingSelected(cell.columnSpan, rowIndex - 1, columnIndex, grid))
                                gridCell.info |= TableBorderGridCellInfo.TopInner;
                            if (!isLastRow && this.checkBottomSibling(grid, rowIndex, columnIndex, ToggleTableCellsBorderCommandBase.checkVSiblingSelected))
                                gridCell.info |= TableBorderGridCellInfo.BottomInner;
                            if (this.checkLeftRightSiblingSelected(cell, rowIndex, columnIndex, columnIndex - 1, TableBorderGridCellInfo.LeftInner, grid))
                                gridCell.info |= TableBorderGridCellInfo.LeftInner;
                            if (!isLastCell && this.checkLeftRightSiblingSelected(cell, rowIndex, columnIndex, columnIndex + cell.columnSpan, TableBorderGridCellInfo.RightInner, grid))
                                gridCell.info |= TableBorderGridCellInfo.RightInner;
                        }
                        if (this.affectOuter) {
                            if (ToggleTableCellsBorderCommandBase.checkVSiblingUnselected(cell.columnSpan, rowIndex - 1, columnIndex, grid))
                                gridCell.info |= TableBorderGridCellInfo.TopOuter;
                            if (isLastRow || this.checkBottomSibling(grid, rowIndex, columnIndex, ToggleTableCellsBorderCommandBase.checkVSiblingUnselected))
                                gridCell.info |= TableBorderGridCellInfo.BottomOuter;
                            if (!this.checkLeftRightSiblingSelected(cell, rowIndex, columnIndex, columnIndex - 1, TableBorderGridCellInfo.LeftInner, grid))
                                gridCell.info |= TableBorderGridCellInfo.LeftOuter;
                            if (isLastCell || !this.checkLeftRightSiblingSelected(cell, rowIndex, columnIndex, columnIndex + cell.columnSpan, TableBorderGridCellInfo.RightInner, grid))
                                gridCell.info |= TableBorderGridCellInfo.RightOuter;
                            if (columnIndex === 0)
                                gridCell.info |= TableBorderGridCellInfo.LeftTableOuter;
                            if (columnIndex + cell.columnSpan === columnsCount)
                                gridCell.info |= TableBorderGridCellInfo.RightTableOuter;
                            if (rowIndex === 0)
                                gridCell.info |= TableBorderGridCellInfo.TopTableOuter;
                            if (rowIndex === rowsCount - 1)
                                gridCell.info |= TableBorderGridCellInfo.BottomTableOuter;
                        }
                    }
                    columnIndex += cell.columnSpan;
                }
            }
            return grid;
        };
        ToggleTableCellsBorderCommandBase.prototype.createCellBorderGridCore = function (table, tableInfo) {
            var grid = [];
            var selectedCellsVIndex = 0;
            var selectedCellsHIndex = -1;
            for (var rowIndex = 0, row = void 0; row = table.rows[rowIndex]; rowIndex++) {
                var horSelectedRowInfo = tableInfo.extendedData.rows[selectedCellsVIndex];
                if (horSelectedRowInfo && horSelectedRowInfo.row === row) {
                    selectedCellsVIndex++;
                    selectedCellsHIndex = 0;
                }
                else
                    selectedCellsHIndex = -1;
                grid.push([]);
                for (var i = 0; i < row.gridBefore; i++)
                    grid[rowIndex].push({ cell: null, info: TableBorderGridCellInfo.None, selected: false });
                var columnIndex = row.gridBefore;
                for (var cellIndex = 0, cell = void 0; cell = row.cells[cellIndex]; cellIndex++) {
                    var borderGridCell = { cell: cell, info: TableBorderGridCellInfo.None, selected: false };
                    if (cell.verticalMerging === __aspxRichEdit.TableCellMergingState.Continue && grid[rowIndex - 1][columnIndex].selected) {
                        if (grid[rowIndex - 1][columnIndex].selected)
                            borderGridCell.selected = true;
                    }
                    if (selectedCellsHIndex > -1 && horSelectedRowInfo.cells[selectedCellsHIndex] && horSelectedRowInfo.cells[selectedCellsHIndex].cell === cell) {
                        borderGridCell.selected = true;
                        selectedCellsHIndex++;
                    }
                    for (var i = 0; i < cell.columnSpan; i++)
                        grid[rowIndex].push(borderGridCell);
                    columnIndex += cell.columnSpan;
                }
                for (var i = 0; i < row.gridAfter; i++)
                    grid[rowIndex].push({ cell: null, info: TableBorderGridCellInfo.None, selected: false });
            }
            return grid;
        };
        ToggleTableCellsBorderCommandBase.prototype.checkBottomSibling = function (grid, rowIndex, columnIndex, testFunc) {
            var gridCell = grid[rowIndex][columnIndex];
            if (gridCell.cell.verticalMerging === __aspxRichEdit.TableCellMergingState.Restart) {
                while (grid[rowIndex]) {
                    rowIndex++;
                    if (!grid[rowIndex] || grid[rowIndex][columnIndex].cell.verticalMerging !== __aspxRichEdit.TableCellMergingState.Continue)
                        break;
                }
            }
            else
                rowIndex++;
            return testFunc(gridCell.cell.columnSpan, rowIndex, columnIndex, grid);
        };
        ToggleTableCellsBorderCommandBase.checkVSiblingSelected = function (columnSpan, checkingRowIndex, columnIndex, grid) {
            if (checkingRowIndex < 0)
                return false;
            if (!grid[checkingRowIndex])
                return false;
            for (var i = 0; i < columnSpan; i++) {
                if (!grid[checkingRowIndex][columnIndex + i].selected)
                    return false;
            }
            return true;
        };
        ToggleTableCellsBorderCommandBase.checkVSiblingUnselected = function (columnSpan, checkingRowIndex, columnIndex, grid) {
            if (checkingRowIndex < 0)
                return true;
            if (!grid[checkingRowIndex])
                return true;
            for (var i = 0; i < columnSpan; i++) {
                if (grid[checkingRowIndex][columnIndex + i].selected)
                    return false;
            }
            return true;
        };
        ToggleTableCellsBorderCommandBase.prototype.checkLeftRightSiblingSelected = function (cell, rowIndex, columnIndex, sibColumnIndex, testingPosition, grid) {
            if (sibColumnIndex < 0)
                return false;
            if (!grid[rowIndex][sibColumnIndex].selected)
                return false;
            if (cell.verticalMerging === __aspxRichEdit.TableCellMergingState.Restart) {
                while (true) {
                    rowIndex++;
                    if (!grid[rowIndex] || !grid[rowIndex][columnIndex].cell || grid[rowIndex][columnIndex].cell.verticalMerging !== __aspxRichEdit.TableCellMergingState.Continue)
                        break;
                    if (!grid[rowIndex][sibColumnIndex].selected)
                        return false;
                }
            }
            else if (cell.verticalMerging === __aspxRichEdit.TableCellMergingState.Continue) {
                while (rowIndex > 0) {
                    rowIndex--;
                    if (grid[rowIndex][columnIndex].cell.verticalMerging === __aspxRichEdit.TableCellMergingState.Restart) {
                        if (!(grid[rowIndex][columnIndex].info & testingPosition))
                            return false;
                        break;
                    }
                }
            }
            return true;
        };
        ToggleTableCellsBorderCommandBase.prototype.getActualLeftBorder = function (tableBordersInfo, table, rowIndex, columnIndex) {
            var pos = new __aspxRichEdit.TablePosition(table, rowIndex, columnIndex).init();
            return __aspxRichEdit.LayoutFormatter.Table.BorderHelper.getLeftBorder(this.colorProvider, pos, pos.row.cells[pos.cellIndex - 1], tableBordersInfo, __aspxRichEdit.Utils.dumbConverter);
        };
        ToggleTableCellsBorderCommandBase.prototype.getActualRightBorder = function (tableBordersInfo, table, rowIndex, columnIndex) {
            var pos = new __aspxRichEdit.TablePosition(table, rowIndex, columnIndex).init();
            return __aspxRichEdit.LayoutFormatter.Table.BorderHelper.getRightBorder(this.colorProvider, pos, pos.row.cells[pos.cellIndex + 1], tableBordersInfo, __aspxRichEdit.Utils.dumbConverter);
        };
        ToggleTableCellsBorderCommandBase.prototype.getActualTopBorder = function (grid, currentCell, tableBordersInfo, table, rowIndex, columnIndex) {
            var cellSpacing = tableBordersInfo.cellSpacings[rowIndex];
            var sibling = rowIndex > 0 ? grid[rowIndex - 1][columnIndex] : null;
            if (cellSpacing > 0)
                return __aspxRichEdit.LayoutFormatter.Table.BorderHelper.mergeThreeBorders(this.colorProvider, currentCell.cell, __aspxRichEdit.TableCellPropertiesMergerBorderTop, null, null, !sibling, tableBordersInfo.horizontalBorder, table.style, __aspxRichEdit.Utils.dumbConverter);
            if (currentCell.info & TableBorderGridCellInfo.TopTableOuter)
                return __aspxRichEdit.LayoutFormatter.Table.BorderHelper.mergeThreeBorders(this.colorProvider, currentCell.cell, __aspxRichEdit.TableCellPropertiesMergerBorderTop, null, null, true, tableBordersInfo.topBorder, table.style, __aspxRichEdit.Utils.dumbConverter);
            return __aspxRichEdit.LayoutFormatter.Table.BorderHelper.mergeThreeBorders(this.colorProvider, currentCell.cell, __aspxRichEdit.TableCellPropertiesMergerBorderTop, sibling.cell, __aspxRichEdit.TableCellPropertiesMergerBorderBottom, false, tableBordersInfo.horizontalBorder, table.style, __aspxRichEdit.Utils.dumbConverter);
        };
        ToggleTableCellsBorderCommandBase.prototype.getActualBottomBorder = function (grid, currentCell, tableBordersInfo, table, rowIndex, columnIndex) {
            var cellSpacing = tableBordersInfo.cellSpacings[rowIndex];
            var sibling = rowIndex + 1 < grid.length ? grid[rowIndex + 1][columnIndex] : null;
            if (cellSpacing > 0)
                return __aspxRichEdit.LayoutFormatter.Table.BorderHelper.mergeThreeBorders(this.colorProvider, currentCell.cell, __aspxRichEdit.TableCellPropertiesMergerBorderBottom, null, null, !sibling, tableBordersInfo.horizontalBorder, table.style, __aspxRichEdit.Utils.dumbConverter);
            if (currentCell.info & TableBorderGridCellInfo.BottomTableOuter)
                return __aspxRichEdit.LayoutFormatter.Table.BorderHelper.mergeThreeBorders(this.colorProvider, currentCell.cell, __aspxRichEdit.TableCellPropertiesMergerBorderBottom, null, null, true, tableBordersInfo.bottomBorder, table.style, __aspxRichEdit.Utils.dumbConverter);
            return __aspxRichEdit.LayoutFormatter.Table.BorderHelper.mergeThreeBorders(this.colorProvider, currentCell.cell, __aspxRichEdit.TableCellPropertiesMergerBorderBottom, sibling.cell, __aspxRichEdit.TableCellPropertiesMergerBorderTop, false, tableBordersInfo.horizontalBorder, table.style, __aspxRichEdit.Utils.dumbConverter);
        };
        return ToggleTableCellsBorderCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ToggleTableCellsBorderCommandBase = ToggleTableCellsBorderCommandBase;
    var ToggleSingleTableCellsBorderCommand = (function (_super) {
        __extends(ToggleSingleTableCellsBorderCommand, _super);
        function ToggleSingleTableCellsBorderCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleSingleTableCellsBorderCommand.prototype.getGeneralizedBorder = function () {
            var actualBorder = null;
            var tableInfo = this.control.selection.tableInfo;
            var table = tableInfo.table;
            var tableBordersInfo = new __aspxRichEdit.LayoutFormatter.Table.TableBorderInfoProvider(this.control.model, table, __aspxRichEdit.Utils.dumbConverter);
            var grid = this.createCellBorderGrid(table, tableInfo, tableBordersInfo);
            for (var i = 0, gridRow = void 0; gridRow = grid[i]; i++) {
                for (var j = 0, gridCell = void 0; gridCell = gridRow[j]; j++) {
                    if (!gridCell.cell || gridCell.cell.verticalMerging === __aspxRichEdit.TableCellMergingState.Continue || gridCell.info === TableBorderGridCellInfo.None)
                        continue;
                    if (!(gridCell.info & this.affectOnStateFlags))
                        continue;
                    if (!actualBorder) {
                        actualBorder = this.getActualCellBorder(table, grid, gridCell, i, j, tableBordersInfo);
                        continue;
                    }
                    if (!actualBorder.equals(this.getActualCellBorder(table, grid, gridCell, i, j, tableBordersInfo)))
                        return null;
                }
            }
            return actualBorder;
        };
        return ToggleSingleTableCellsBorderCommand;
    }(ToggleTableCellsBorderCommandBase));
    __aspxRichEdit.ToggleSingleTableCellsBorderCommand = ToggleSingleTableCellsBorderCommand;
    var ToggleTableCellsTopBorderCommand = (function (_super) {
        __extends(ToggleTableCellsTopBorderCommand, _super);
        function ToggleTableCellsTopBorderCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.affectOnStateFlags = TableBorderGridCellInfo.TopOuter;
            _this.affectInner = false;
            return _this;
        }
        ToggleTableCellsTopBorderCommand.prototype.getActualCellBorder = function (table, grid, currentCell, rowIndex, columnIndex, tableBordersInfo) {
            return this.getActualTopBorder(grid, currentCell, tableBordersInfo, table, rowIndex, columnIndex);
        };
        ToggleTableCellsTopBorderCommand.prototype.checkBorderInParticallyTableSelection = function (patternBorder, table, grid, currentCell, rowIndex, columnIndex, tableBordersInfo) {
            return patternBorder.equals(this.getActualCellBorder(table, grid, currentCell, rowIndex, columnIndex, tableBordersInfo));
        };
        ToggleTableCellsTopBorderCommand.prototype.checkBorderInEntireTable = function (patternBorder, table) {
            return patternBorder.equals(new __aspxRichEdit.TablePropertiesMergerBorderTop().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, this.control.model.defaultTableProperties));
        };
        ToggleTableCellsTopBorderCommand.prototype.applyBorderToTable = function (subDocument, table, borderInfo) {
            if (!borderInfo) {
                borderInfo = table.properties.borders.topBorder.clone();
                borderInfo.width = 0;
            }
            else
                borderInfo = borderInfo.clone();
            this.control.history.addAndRedo(new __aspxRichEdit.TableBordersHistoryItem(this.control.modelManipulator, subDocument, table.index, [borderInfo, undefined, undefined, undefined, undefined, undefined], [true, undefined, undefined, undefined, undefined, undefined]));
        };
        ToggleTableCellsTopBorderCommand.prototype.applyBorderToCell = function (subDocument, table, gridCell, rowIndex, cellIndex, borderInfo) {
            if (gridCell.info & TableBorderGridCellInfo.TopOuter) {
                if (!borderInfo) {
                    borderInfo = gridCell.cell.properties.borders.topBorder.clone();
                    borderInfo.width = 0;
                }
                this.control.history.addAndRedo(new __aspxRichEdit.TableCellBordersHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, [borderInfo, undefined, undefined, undefined, undefined, undefined], [true, undefined, undefined, undefined, undefined, undefined]));
            }
            if (gridCell.info & TableBorderGridCellInfo.TopNeighbour) {
                if (!borderInfo) {
                    borderInfo = gridCell.cell.properties.borders.bottomBorder.clone();
                    borderInfo.width = 0;
                }
                this.control.history.addAndRedo(new __aspxRichEdit.TableCellBordersHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, [undefined, undefined, borderInfo, undefined, undefined, undefined], [undefined, undefined, true, undefined, undefined, undefined]));
            }
        };
        return ToggleTableCellsTopBorderCommand;
    }(ToggleSingleTableCellsBorderCommand));
    __aspxRichEdit.ToggleTableCellsTopBorderCommand = ToggleTableCellsTopBorderCommand;
    var ToggleTableCellsRightBorderCommand = (function (_super) {
        __extends(ToggleTableCellsRightBorderCommand, _super);
        function ToggleTableCellsRightBorderCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.affectInner = false;
            _this.affectOnStateFlags = TableBorderGridCellInfo.RightOuter;
            return _this;
        }
        ToggleTableCellsRightBorderCommand.prototype.getActualCellBorder = function (table, _grid, _currentCell, rowIndex, columnIndex, tableBordersInfo) {
            return this.getActualRightBorder(tableBordersInfo, table, rowIndex, columnIndex);
        };
        ToggleTableCellsRightBorderCommand.prototype.checkBorderInParticallyTableSelection = function (patternBorder, table, grid, currentCell, rowIndex, columnIndex, tableBordersInfo) {
            return patternBorder.equals(this.getActualCellBorder(table, grid, currentCell, rowIndex, columnIndex, tableBordersInfo));
        };
        ToggleTableCellsRightBorderCommand.prototype.checkBorderInEntireTable = function (patternBorder, table) {
            return patternBorder.equals(new __aspxRichEdit.TablePropertiesMergerBorderRight().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, this.control.model.defaultTableProperties));
        };
        ToggleTableCellsRightBorderCommand.prototype.applyBorderToTable = function (subDocument, table, borderInfo) {
            if (!borderInfo) {
                borderInfo = table.properties.borders.rightBorder.clone();
                borderInfo.width = 0;
            }
            else
                borderInfo = borderInfo.clone();
            this.control.history.addAndRedo(new __aspxRichEdit.TableBordersHistoryItem(this.control.modelManipulator, subDocument, table.index, [undefined, borderInfo, undefined, undefined, undefined, undefined], [undefined, true, undefined, undefined, undefined, undefined]));
        };
        ToggleTableCellsRightBorderCommand.prototype.applyBorderToCell = function (subDocument, table, gridCell, rowIndex, cellIndex, borderInfo) {
            if (gridCell.info & TableBorderGridCellInfo.RightOuter) {
                if (!borderInfo) {
                    borderInfo = gridCell.cell.properties.borders.rightBorder.clone();
                    borderInfo.width = 0;
                }
                this.control.history.addAndRedo(new __aspxRichEdit.TableCellBordersHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, [undefined, borderInfo, undefined, undefined, undefined, undefined], [undefined, true, undefined, undefined, undefined, undefined]));
            }
            if (gridCell.info & TableBorderGridCellInfo.RightNeighbour) {
                if (!borderInfo) {
                    borderInfo = gridCell.cell.properties.borders.leftBorder.clone();
                    borderInfo.width = 0;
                }
                this.control.history.addAndRedo(new __aspxRichEdit.TableCellBordersHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, [undefined, undefined, undefined, borderInfo, undefined, undefined], [undefined, undefined, undefined, true, undefined, undefined]));
            }
        };
        return ToggleTableCellsRightBorderCommand;
    }(ToggleSingleTableCellsBorderCommand));
    __aspxRichEdit.ToggleTableCellsRightBorderCommand = ToggleTableCellsRightBorderCommand;
    var ToggleTableCellsBottomBorderCommand = (function (_super) {
        __extends(ToggleTableCellsBottomBorderCommand, _super);
        function ToggleTableCellsBottomBorderCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.affectInner = false;
            _this.affectOnStateFlags = TableBorderGridCellInfo.BottomOuter;
            return _this;
        }
        ToggleTableCellsBottomBorderCommand.prototype.getActualCellBorder = function (table, grid, currentCell, rowIndex, columnIndex, tableBordersInfo) {
            return this.getActualBottomBorder(grid, currentCell, tableBordersInfo, table, rowIndex, columnIndex);
        };
        ToggleTableCellsBottomBorderCommand.prototype.checkBorderInParticallyTableSelection = function (patternBorder, table, grid, currentCell, rowIndex, columnIndex, tableBordersInfo) {
            return patternBorder.equals(this.getActualCellBorder(table, grid, currentCell, rowIndex, columnIndex, tableBordersInfo));
        };
        ToggleTableCellsBottomBorderCommand.prototype.checkBorderInEntireTable = function (patternBorder, table) {
            return patternBorder.equals(new __aspxRichEdit.TablePropertiesMergerBorderBottom().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, this.control.model.defaultTableProperties));
        };
        ToggleTableCellsBottomBorderCommand.prototype.applyBorderToTable = function (subDocument, table, borderInfo) {
            if (!borderInfo) {
                borderInfo = table.properties.borders.bottomBorder.clone();
                borderInfo.width = 0;
            }
            else
                borderInfo = borderInfo.clone();
            this.control.history.addAndRedo(new __aspxRichEdit.TableBordersHistoryItem(this.control.modelManipulator, subDocument, table.index, [undefined, undefined, borderInfo, undefined, undefined, undefined], [undefined, undefined, true, undefined, undefined, undefined]));
        };
        ToggleTableCellsBottomBorderCommand.prototype.applyBorderToCell = function (subDocument, table, gridCell, rowIndex, cellIndex, borderInfo) {
            if (gridCell.info & TableBorderGridCellInfo.BottomOuter) {
                if (!borderInfo) {
                    borderInfo = gridCell.cell.properties.borders.bottomBorder.clone();
                    borderInfo.width = 0;
                }
                this.control.history.addAndRedo(new __aspxRichEdit.TableCellBordersHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, [undefined, undefined, borderInfo, undefined, undefined, undefined], [undefined, undefined, true, undefined, undefined, undefined]));
            }
            if (gridCell.info & TableBorderGridCellInfo.BottomNeighbour) {
                if (!borderInfo) {
                    borderInfo = gridCell.cell.properties.borders.topBorder.clone();
                    borderInfo.width = 0;
                }
                this.control.history.addAndRedo(new __aspxRichEdit.TableCellBordersHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, [borderInfo, undefined, undefined, undefined, undefined, undefined], [true, undefined, undefined, undefined, undefined, undefined]));
            }
        };
        return ToggleTableCellsBottomBorderCommand;
    }(ToggleSingleTableCellsBorderCommand));
    __aspxRichEdit.ToggleTableCellsBottomBorderCommand = ToggleTableCellsBottomBorderCommand;
    var ToggleTableCellsLeftBorderCommand = (function (_super) {
        __extends(ToggleTableCellsLeftBorderCommand, _super);
        function ToggleTableCellsLeftBorderCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.affectInner = false;
            _this.affectOnStateFlags = TableBorderGridCellInfo.LeftOuter;
            return _this;
        }
        ToggleTableCellsLeftBorderCommand.prototype.getActualCellBorder = function (table, _grid, _currentCell, rowIndex, columnIndex, tableBordersInfo) {
            return this.getActualLeftBorder(tableBordersInfo, table, rowIndex, columnIndex);
        };
        ToggleTableCellsLeftBorderCommand.prototype.checkBorderInParticallyTableSelection = function (patternBorder, table, grid, currentCell, rowIndex, columnIndex, tableBordersInfo) {
            return patternBorder.equals(this.getActualCellBorder(table, grid, currentCell, rowIndex, columnIndex, tableBordersInfo));
        };
        ToggleTableCellsLeftBorderCommand.prototype.checkBorderInEntireTable = function (patternBorder, table) {
            return patternBorder.equals(new __aspxRichEdit.TablePropertiesMergerBorderLeft().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, this.control.model.defaultTableProperties));
        };
        ToggleTableCellsLeftBorderCommand.prototype.applyBorderToTable = function (subDocument, table, borderInfo) {
            if (!borderInfo) {
                borderInfo = table.properties.borders.leftBorder.clone();
                borderInfo.width = 0;
            }
            else
                borderInfo = borderInfo.clone();
            this.control.history.addAndRedo(new __aspxRichEdit.TableBordersHistoryItem(this.control.modelManipulator, subDocument, table.index, [undefined, undefined, undefined, borderInfo, undefined, undefined], [undefined, undefined, undefined, true, undefined, undefined]));
        };
        ToggleTableCellsLeftBorderCommand.prototype.applyBorderToCell = function (subDocument, table, gridCell, rowIndex, cellIndex, borderInfo) {
            if (gridCell.info & TableBorderGridCellInfo.LeftOuter) {
                if (!borderInfo) {
                    borderInfo = gridCell.cell.properties.borders.leftBorder.clone();
                    borderInfo.width = 0;
                }
                this.control.history.addAndRedo(new __aspxRichEdit.TableCellBordersHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, [undefined, undefined, undefined, borderInfo, undefined, undefined], [undefined, undefined, undefined, true, undefined, undefined]));
            }
            if (gridCell.info & TableBorderGridCellInfo.LeftNeighbour) {
                if (!borderInfo) {
                    borderInfo = gridCell.cell.properties.borders.rightBorder.clone();
                    borderInfo.width = 0;
                }
                this.control.history.addAndRedo(new __aspxRichEdit.TableCellBordersHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, [undefined, borderInfo, undefined, undefined, undefined, undefined], [undefined, true, undefined, undefined, undefined, undefined]));
            }
        };
        return ToggleTableCellsLeftBorderCommand;
    }(ToggleSingleTableCellsBorderCommand));
    __aspxRichEdit.ToggleTableCellsLeftBorderCommand = ToggleTableCellsLeftBorderCommand;
    var ToggleTableCellAllBordersCommand = (function (_super) {
        __extends(ToggleTableCellAllBordersCommand, _super);
        function ToggleTableCellAllBordersCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.affectOnStateFlags = TableBorderGridCellInfo.BottomInner | TableBorderGridCellInfo.BottomOuter | TableBorderGridCellInfo.LeftInner |
                TableBorderGridCellInfo.LeftOuter | TableBorderGridCellInfo.RightInner | TableBorderGridCellInfo.RightOuter |
                TableBorderGridCellInfo.TopInner | TableBorderGridCellInfo.TopOuter;
            return _this;
        }
        ToggleTableCellAllBordersCommand.prototype.checkBorderInParticallyTableSelection = function (patternBorder, table, grid, currentCell, rowIndex, columnIndex, tableBordersInfo) {
            return patternBorder.equals(this.getActualTopBorder(grid, currentCell, tableBordersInfo, table, rowIndex, columnIndex)) &&
                patternBorder.equals(this.getActualBottomBorder(grid, currentCell, tableBordersInfo, table, rowIndex, columnIndex)) &&
                patternBorder.equals(this.getActualLeftBorder(tableBordersInfo, table, rowIndex, columnIndex)) &&
                patternBorder.equals(this.getActualRightBorder(tableBordersInfo, table, rowIndex, columnIndex));
        };
        ToggleTableCellAllBordersCommand.prototype.checkBorderInEntireTable = function (patternBorder, table) {
            return patternBorder.equals(new __aspxRichEdit.TablePropertiesMergerBorderTop().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, this.control.model.defaultTableProperties)) &&
                patternBorder.equals(new __aspxRichEdit.TablePropertiesMergerBorderRight().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, this.control.model.defaultTableProperties)) &&
                patternBorder.equals(new __aspxRichEdit.TablePropertiesMergerBorderBottom().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, this.control.model.defaultTableProperties)) &&
                patternBorder.equals(new __aspxRichEdit.TablePropertiesMergerBorderLeft().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, this.control.model.defaultTableProperties)) &&
                patternBorder.equals(new __aspxRichEdit.TablePropertiesMergerBorderHorizontal().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, this.control.model.defaultTableProperties)) &&
                patternBorder.equals(new __aspxRichEdit.TablePropertiesMergerBorderVertical().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, this.control.model.defaultTableProperties));
        };
        ToggleTableCellAllBordersCommand.prototype.applyBorderToTable = function (subDocument, table, borderInfo) {
            borderInfo = borderInfo || new __aspxRichEdit.BorderInfo();
            this.control.history.addAndRedo(new __aspxRichEdit.TableBordersHistoryItem(this.control.modelManipulator, subDocument, table.index, [
                borderInfo.clone(), borderInfo.clone(), borderInfo.clone(), borderInfo.clone(), borderInfo.clone(), borderInfo.clone()
            ], [true, true, true, true, true, true]));
        };
        ToggleTableCellAllBordersCommand.prototype.applyBorderToCell = function (subDocument, table, gridCell, rowIndex, cellIndex, borderInfo) {
            var topBorder, rightBorder, bottomBorder, leftBorder;
            if (gridCell.info & TableBorderGridCellInfo.TopOuter || gridCell.info & TableBorderGridCellInfo.TopInner || gridCell.info & TableBorderGridCellInfo.BottomNeighbour)
                topBorder = true;
            if (gridCell.info & TableBorderGridCellInfo.RightOuter || gridCell.info & TableBorderGridCellInfo.RightInner || gridCell.info & TableBorderGridCellInfo.LeftNeighbour)
                rightBorder = true;
            if (gridCell.info & TableBorderGridCellInfo.BottomOuter || gridCell.info & TableBorderGridCellInfo.BottomInner || gridCell.info & TableBorderGridCellInfo.TopNeighbour)
                bottomBorder = true;
            if (gridCell.info & TableBorderGridCellInfo.LeftOuter || gridCell.info & TableBorderGridCellInfo.LeftInner || gridCell.info & TableBorderGridCellInfo.RightNeighbour)
                leftBorder = true;
            borderInfo = borderInfo || new __aspxRichEdit.BorderInfo();
            if (topBorder || rightBorder || bottomBorder || leftBorder) {
                this.control.history.addAndRedo(new __aspxRichEdit.TableCellBordersHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, [topBorder ? borderInfo.clone() : undefined, rightBorder ? borderInfo.clone() : undefined, bottomBorder ? borderInfo.clone() : undefined, leftBorder ? borderInfo.clone() : undefined, undefined, undefined], [topBorder, rightBorder, bottomBorder, leftBorder, undefined, undefined]));
            }
        };
        return ToggleTableCellAllBordersCommand;
    }(ToggleTableCellsBorderCommandBase));
    __aspxRichEdit.ToggleTableCellAllBordersCommand = ToggleTableCellAllBordersCommand;
    var ToggleTableCellNoBorderCommand = (function (_super) {
        __extends(ToggleTableCellNoBorderCommand, _super);
        function ToggleTableCellNoBorderCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleTableCellNoBorderCommand.prototype.isChecked = function (_tableInfo) {
            return false;
        };
        ToggleTableCellNoBorderCommand.prototype.applyBorderToTable = function (subDocument, table, _borderInfo) {
            _super.prototype.applyBorderToTable.call(this, subDocument, table, new __aspxRichEdit.BorderInfo());
        };
        ToggleTableCellNoBorderCommand.prototype.applyBorderToCell = function (subDocument, table, gridCell, rowIndex, cellIndex, _borderInfo) {
            _super.prototype.applyBorderToCell.call(this, subDocument, table, gridCell, rowIndex, cellIndex, new __aspxRichEdit.BorderInfo());
        };
        return ToggleTableCellNoBorderCommand;
    }(ToggleTableCellAllBordersCommand));
    __aspxRichEdit.ToggleTableCellNoBorderCommand = ToggleTableCellNoBorderCommand;
    var ToggleTableCellInsideBordersCommand = (function (_super) {
        __extends(ToggleTableCellInsideBordersCommand, _super);
        function ToggleTableCellInsideBordersCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.affectOuter = false;
            _this.affectNeighbours = false;
            _this.affectOnStateFlags = TableBorderGridCellInfo.BottomInner | TableBorderGridCellInfo.LeftInner | TableBorderGridCellInfo.RightInner | TableBorderGridCellInfo.TopInner;
            return _this;
        }
        ToggleTableCellInsideBordersCommand.prototype.checkBorderInParticallyTableSelection = function (patternBorder, table, grid, currentCell, rowIndex, columnIndex, tableBordersInfo) {
            if (currentCell.info & TableBorderGridCellInfo.TopInner)
                return patternBorder.equals(this.getActualTopBorder(grid, currentCell, tableBordersInfo, table, rowIndex, columnIndex));
            if (currentCell.info & TableBorderGridCellInfo.RightInner)
                return patternBorder.equals(this.getActualRightBorder(tableBordersInfo, table, rowIndex, columnIndex));
            if (currentCell.info & TableBorderGridCellInfo.BottomInner)
                return patternBorder.equals(this.getActualBottomBorder(grid, currentCell, tableBordersInfo, table, rowIndex, columnIndex));
            if (currentCell.info & TableBorderGridCellInfo.LeftInner)
                return patternBorder.equals(this.getActualLeftBorder(tableBordersInfo, table, rowIndex, columnIndex));
        };
        ToggleTableCellInsideBordersCommand.prototype.checkBorderInEntireTable = function (patternBorder, table) {
            return patternBorder.equals(new __aspxRichEdit.TablePropertiesMergerBorderHorizontal().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, this.control.model.defaultTableProperties)) &&
                patternBorder.equals(new __aspxRichEdit.TablePropertiesMergerBorderVertical().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, this.control.model.defaultTableProperties));
        };
        ToggleTableCellInsideBordersCommand.prototype.applyBorderToTable = function (subDocument, table, borderInfo) {
            borderInfo = borderInfo || new __aspxRichEdit.BorderInfo();
            this.control.history.addAndRedo(new __aspxRichEdit.TableBordersHistoryItem(this.control.modelManipulator, subDocument, table.index, [
                undefined, undefined, undefined, undefined, borderInfo.clone(), borderInfo.clone()
            ], [undefined, undefined, undefined, undefined, true, true]));
        };
        ToggleTableCellInsideBordersCommand.prototype.applyBorderToCell = function (subDocument, table, gridCell, rowIndex, cellIndex, borderInfo) {
            var topBorder, rightBorder, bottomBorder, leftBorder;
            if (gridCell.info & TableBorderGridCellInfo.TopInner)
                topBorder = true;
            if (gridCell.info & TableBorderGridCellInfo.RightInner)
                rightBorder = true;
            if (gridCell.info & TableBorderGridCellInfo.BottomInner)
                bottomBorder = true;
            if (gridCell.info & TableBorderGridCellInfo.LeftInner)
                leftBorder = true;
            borderInfo = borderInfo || new __aspxRichEdit.BorderInfo();
            if (topBorder || rightBorder || bottomBorder || leftBorder) {
                this.control.history.addAndRedo(new __aspxRichEdit.TableCellBordersHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, [topBorder ? borderInfo.clone() : undefined, rightBorder ? borderInfo.clone() : undefined, bottomBorder ? borderInfo.clone() : undefined, leftBorder ? borderInfo.clone() : undefined, undefined, undefined], [topBorder, rightBorder, bottomBorder, leftBorder, undefined, undefined]));
            }
        };
        return ToggleTableCellInsideBordersCommand;
    }(ToggleTableCellsBorderCommandBase));
    __aspxRichEdit.ToggleTableCellInsideBordersCommand = ToggleTableCellInsideBordersCommand;
    var ToggleTableCellInsideHorizontalBordersCommand = (function (_super) {
        __extends(ToggleTableCellInsideHorizontalBordersCommand, _super);
        function ToggleTableCellInsideHorizontalBordersCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.affectOuter = false;
            _this.affectNeighbours = false;
            _this.affectOnStateFlags = TableBorderGridCellInfo.BottomInner | TableBorderGridCellInfo.TopInner;
            return _this;
        }
        ToggleTableCellInsideHorizontalBordersCommand.prototype.getActualCellBorder = function (table, grid, currentCell, rowIndex, columnIndex, tableBordersInfo) {
            var border1, border2;
            if (currentCell.info & TableBorderGridCellInfo.TopInner)
                border1 = this.getActualTopBorder(grid, currentCell, tableBordersInfo, table, rowIndex, columnIndex);
            if (currentCell.info & TableBorderGridCellInfo.BottomInner)
                border2 = this.getActualBottomBorder(grid, currentCell, tableBordersInfo, table, rowIndex, columnIndex);
            if (border1 && border2)
                return border1.equals(border2) ? border1 : null;
            return border1 || border2;
        };
        ToggleTableCellInsideHorizontalBordersCommand.prototype.checkBorderInParticallyTableSelection = function (patternBorder, table, grid, currentCell, rowIndex, columnIndex, tableBordersInfo) {
            return patternBorder.equals(this.getActualCellBorder(table, grid, currentCell, rowIndex, columnIndex, tableBordersInfo));
        };
        ToggleTableCellInsideHorizontalBordersCommand.prototype.checkBorderInEntireTable = function (patternBorder, table) {
            return patternBorder.equals(new __aspxRichEdit.TablePropertiesMergerBorderHorizontal().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, this.control.model.defaultTableProperties));
        };
        ToggleTableCellInsideHorizontalBordersCommand.prototype.applyBorderToTable = function (subDocument, table, borderInfo) {
            borderInfo = borderInfo || new __aspxRichEdit.BorderInfo();
            this.control.history.addAndRedo(new __aspxRichEdit.TableBordersHistoryItem(this.control.modelManipulator, subDocument, table.index, [
                undefined, undefined, undefined, undefined, borderInfo.clone(), undefined
            ], [undefined, undefined, undefined, undefined, true, undefined]));
        };
        ToggleTableCellInsideHorizontalBordersCommand.prototype.applyBorderToCell = function (subDocument, table, gridCell, rowIndex, cellIndex, borderInfo) {
            var topBorder, bottomBorder;
            if (gridCell.info & TableBorderGridCellInfo.TopInner)
                topBorder = true;
            if (gridCell.info & TableBorderGridCellInfo.BottomInner)
                bottomBorder = true;
            borderInfo = borderInfo || new __aspxRichEdit.BorderInfo();
            if (topBorder || bottomBorder) {
                this.control.history.addAndRedo(new __aspxRichEdit.TableCellBordersHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, [topBorder ? borderInfo.clone() : undefined, undefined, bottomBorder ? borderInfo.clone() : undefined, undefined, undefined, undefined], [topBorder, undefined, bottomBorder, undefined, undefined, undefined]));
            }
        };
        return ToggleTableCellInsideHorizontalBordersCommand;
    }(ToggleSingleTableCellsBorderCommand));
    __aspxRichEdit.ToggleTableCellInsideHorizontalBordersCommand = ToggleTableCellInsideHorizontalBordersCommand;
    var ToggleTableCellInsideVerticalBordersCommand = (function (_super) {
        __extends(ToggleTableCellInsideVerticalBordersCommand, _super);
        function ToggleTableCellInsideVerticalBordersCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.affectOuter = false;
            _this.affectNeighbours = false;
            _this.affectOnStateFlags = TableBorderGridCellInfo.LeftInner | TableBorderGridCellInfo.RightInner;
            return _this;
        }
        ToggleTableCellInsideVerticalBordersCommand.prototype.getActualCellBorder = function (table, _grid, currentCell, rowIndex, columnIndex, tableBordersInfo) {
            var border1, border2;
            if (currentCell.info & TableBorderGridCellInfo.LeftInner)
                border1 = this.getActualLeftBorder(tableBordersInfo, table, rowIndex, columnIndex);
            if (currentCell.info & TableBorderGridCellInfo.RightInner)
                border2 = this.getActualRightBorder(tableBordersInfo, table, rowIndex, columnIndex);
            if (border1 && border2)
                return border1.equals(border2) ? border1 : null;
            return border1 || border2;
        };
        ToggleTableCellInsideVerticalBordersCommand.prototype.checkBorderInParticallyTableSelection = function (patternBorder, table, grid, currentCell, rowIndex, columnIndex, tableBordersInfo) {
            return patternBorder.equals(this.getActualCellBorder(table, grid, currentCell, rowIndex, columnIndex, tableBordersInfo));
        };
        ToggleTableCellInsideVerticalBordersCommand.prototype.checkBorderInEntireTable = function (patternBorder, table) {
            return patternBorder.equals(new __aspxRichEdit.TablePropertiesMergerBorderVertical().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, this.control.model.defaultTableProperties));
        };
        ToggleTableCellInsideVerticalBordersCommand.prototype.applyBorderToTable = function (subDocument, table, borderInfo) {
            borderInfo = borderInfo || new __aspxRichEdit.BorderInfo();
            this.control.history.addAndRedo(new __aspxRichEdit.TableBordersHistoryItem(this.control.modelManipulator, subDocument, table.index, [
                undefined, undefined, undefined, undefined, undefined, borderInfo.clone()
            ], [undefined, undefined, undefined, undefined, undefined, true]));
        };
        ToggleTableCellInsideVerticalBordersCommand.prototype.applyBorderToCell = function (subDocument, table, gridCell, rowIndex, cellIndex, borderInfo) {
            var leftBorder, rightBorder;
            if (gridCell.info & TableBorderGridCellInfo.LeftInner)
                leftBorder = true;
            if (gridCell.info & TableBorderGridCellInfo.RightInner)
                rightBorder = true;
            borderInfo = borderInfo || new __aspxRichEdit.BorderInfo();
            if (rightBorder || leftBorder) {
                this.control.history.addAndRedo(new __aspxRichEdit.TableCellBordersHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, [undefined, rightBorder ? borderInfo.clone() : undefined, undefined, leftBorder ? borderInfo.clone() : undefined, undefined, undefined], [undefined, rightBorder, undefined, leftBorder, undefined, undefined]));
            }
        };
        return ToggleTableCellInsideVerticalBordersCommand;
    }(ToggleSingleTableCellsBorderCommand));
    __aspxRichEdit.ToggleTableCellInsideVerticalBordersCommand = ToggleTableCellInsideVerticalBordersCommand;
    var ToggleTableCellOutsideBordersCommand = (function (_super) {
        __extends(ToggleTableCellOutsideBordersCommand, _super);
        function ToggleTableCellOutsideBordersCommand() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.affectInner = false;
            _this.affectOnStateFlags = TableBorderGridCellInfo.LeftOuter | TableBorderGridCellInfo.RightOuter | TableBorderGridCellInfo.TopOuter | TableBorderGridCellInfo.BottomOuter;
            return _this;
        }
        ToggleTableCellOutsideBordersCommand.prototype.checkBorderInParticallyTableSelection = function (patternBorder, table, grid, currentCell, rowIndex, columnIndex, tableBordersInfo) {
            if (currentCell.info & TableBorderGridCellInfo.TopOuter && !patternBorder.equals(this.getActualTopBorder(grid, currentCell, tableBordersInfo, table, rowIndex, columnIndex)))
                return false;
            if (currentCell.info & TableBorderGridCellInfo.RightOuter && !patternBorder.equals(this.getActualRightBorder(tableBordersInfo, table, rowIndex, columnIndex)))
                return false;
            if (currentCell.info & TableBorderGridCellInfo.BottomOuter && !patternBorder.equals(this.getActualBottomBorder(grid, currentCell, tableBordersInfo, table, rowIndex, columnIndex)))
                return false;
            if (currentCell.info & TableBorderGridCellInfo.LeftOuter && !patternBorder.equals(this.getActualLeftBorder(tableBordersInfo, table, rowIndex, columnIndex)))
                return false;
            return true;
        };
        ToggleTableCellOutsideBordersCommand.prototype.checkBorderInEntireTable = function (patternBorder, table) {
            return patternBorder.equals(new __aspxRichEdit.TablePropertiesMergerBorderTop().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, this.control.model.defaultTableProperties)) &&
                patternBorder.equals(new __aspxRichEdit.TablePropertiesMergerBorderRight().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, this.control.model.defaultTableProperties)) &&
                patternBorder.equals(new __aspxRichEdit.TablePropertiesMergerBorderBottom().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, this.control.model.defaultTableProperties)) &&
                patternBorder.equals(new __aspxRichEdit.TablePropertiesMergerBorderLeft().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, this.control.model.defaultTableProperties));
        };
        ToggleTableCellOutsideBordersCommand.prototype.applyBorderToTable = function (subDocument, table, borderInfo) {
            borderInfo = borderInfo || new __aspxRichEdit.BorderInfo();
            this.control.history.addAndRedo(new __aspxRichEdit.TableBordersHistoryItem(this.control.modelManipulator, subDocument, table.index, [
                borderInfo.clone(), borderInfo.clone(), borderInfo.clone(), borderInfo.clone(), undefined, undefined
            ], [true, true, true, true, undefined, undefined]));
        };
        ToggleTableCellOutsideBordersCommand.prototype.applyBorderToCell = function (subDocument, table, gridCell, rowIndex, cellIndex, borderInfo) {
            var topBorder, rightBorder, bottomBorder, leftBorder;
            if (gridCell.info & TableBorderGridCellInfo.TopOuter || gridCell.info & TableBorderGridCellInfo.BottomNeighbour)
                topBorder = true;
            if (gridCell.info & TableBorderGridCellInfo.RightOuter || gridCell.info & TableBorderGridCellInfo.LeftNeighbour)
                rightBorder = true;
            if (gridCell.info & TableBorderGridCellInfo.BottomOuter || gridCell.info & TableBorderGridCellInfo.TopNeighbour)
                bottomBorder = true;
            if (gridCell.info & TableBorderGridCellInfo.LeftOuter || gridCell.info & TableBorderGridCellInfo.RightNeighbour)
                leftBorder = true;
            borderInfo = borderInfo || new __aspxRichEdit.BorderInfo();
            if (topBorder || rightBorder || bottomBorder || leftBorder) {
                this.control.history.addAndRedo(new __aspxRichEdit.TableCellBordersHistoryItem(this.control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, [topBorder ? borderInfo.clone() : undefined, rightBorder ? borderInfo.clone() : undefined, bottomBorder ? borderInfo.clone() : undefined, leftBorder ? borderInfo.clone() : undefined, undefined, undefined], [topBorder, rightBorder, bottomBorder, leftBorder, undefined, undefined]));
            }
        };
        return ToggleTableCellOutsideBordersCommand;
    }(ToggleTableCellsBorderCommandBase));
    __aspxRichEdit.ToggleTableCellOutsideBordersCommand = ToggleTableCellOutsideBordersCommand;
    var TableBorderGridCellInfo;
    (function (TableBorderGridCellInfo) {
        TableBorderGridCellInfo[TableBorderGridCellInfo["None"] = 0] = "None";
        TableBorderGridCellInfo[TableBorderGridCellInfo["LeftOuter"] = 1] = "LeftOuter";
        TableBorderGridCellInfo[TableBorderGridCellInfo["RightOuter"] = 2] = "RightOuter";
        TableBorderGridCellInfo[TableBorderGridCellInfo["BottomOuter"] = 4] = "BottomOuter";
        TableBorderGridCellInfo[TableBorderGridCellInfo["TopOuter"] = 8] = "TopOuter";
        TableBorderGridCellInfo[TableBorderGridCellInfo["RightNeighbour"] = 16] = "RightNeighbour";
        TableBorderGridCellInfo[TableBorderGridCellInfo["TopNeighbour"] = 32] = "TopNeighbour";
        TableBorderGridCellInfo[TableBorderGridCellInfo["LeftNeighbour"] = 64] = "LeftNeighbour";
        TableBorderGridCellInfo[TableBorderGridCellInfo["BottomNeighbour"] = 128] = "BottomNeighbour";
        TableBorderGridCellInfo[TableBorderGridCellInfo["RightInner"] = 256] = "RightInner";
        TableBorderGridCellInfo[TableBorderGridCellInfo["TopInner"] = 512] = "TopInner";
        TableBorderGridCellInfo[TableBorderGridCellInfo["LeftInner"] = 1024] = "LeftInner";
        TableBorderGridCellInfo[TableBorderGridCellInfo["BottomInner"] = 2048] = "BottomInner";
        TableBorderGridCellInfo[TableBorderGridCellInfo["LeftTableOuter"] = 4096] = "LeftTableOuter";
        TableBorderGridCellInfo[TableBorderGridCellInfo["RightTableOuter"] = 8192] = "RightTableOuter";
        TableBorderGridCellInfo[TableBorderGridCellInfo["TopTableOuter"] = 16384] = "TopTableOuter";
        TableBorderGridCellInfo[TableBorderGridCellInfo["BottomTableOuter"] = 32768] = "BottomTableOuter";
        TableBorderGridCellInfo[TableBorderGridCellInfo["All"] = -1] = "All";
    })(TableBorderGridCellInfo = __aspxRichEdit.TableBorderGridCellInfo || (__aspxRichEdit.TableBorderGridCellInfo = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var BackspaceCommand = (function (_super) {
        __extends(BackspaceCommand, _super);
        function BackspaceCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        BackspaceCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        BackspaceCommand.prototype.executeCore = function (_state, _options) {
            var selection = this.control.selection;
            var interval = selection.getLastSelectedInterval().clone();
            if (this.control.selection.tableInfo.extendedData.areCellsSelectedInSeries && (selection.tableInfo.extendedData.numRows > 1 || selection.tableInfo.extendedData.rows[0].cells.length > 1)) {
                var command = this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.DeleteTableCellsByBackspace);
                if (command.getState().enabled)
                    return command.execute(this.control.commandManager.isPublicApiCall);
            }
            var isIntervalCollapsed = interval.length == 0;
            var subDocument = this.control.model.activeSubDocument;
            if (isIntervalCollapsed) {
                if (this.tryChangeParagraphAlignOrIndent(interval))
                    return true;
                var layoutPosition = subDocument.isMain()
                    ? __aspxRichEdit.LayoutPositionMainSubDocumentCreator.ensureLayoutPosition(this.control, this.control.layout, subDocument, interval.start, __aspxRichEdit.DocumentLayoutDetailsLevel.Character, new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true))
                    : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.layout, subDocument, interval.start, selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                        .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true));
                interval.start = layoutPosition.getLogPosition() - 1;
                var firstPagePosition = subDocument.isMain() ?
                    this.control.layout.pages[0].getPosition() :
                    layoutPosition.pageArea.pageOffset;
                if (interval.start < firstPagePosition)
                    return false;
                if (interval.start === firstPagePosition &&
                    __aspxRichEdit.EnumUtils.isAnyOf(subDocument.getRunByPosition(interval.start).getType(), __aspxRichEdit.RunType.AnchoredPictureRun, __aspxRichEdit.RunType.AnchoredTextBoxRun))
                    return false;
                interval.length = 1;
            }
            if (interval.end == this.control.model.activeSubDocument.getDocumentEndPosition() && interval.length === 1)
                return false;
            if (isIntervalCollapsed &&
                BackspaceCommand.getIntervalAccordingFields(this.control.model.activeSubDocument, this.control.selection, interval, true))
                return true;
            if (this.control.model.activeSubDocument.isEditable([interval])) {
                this.control.history.beginTransaction();
                __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, subDocument, new __aspxRichEdit.FixedInterval(interval.start, 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, selection.endOfLine);
                __aspxRichEdit.ModelManipulator.removeInterval(this.control, this.control.model.activeSubDocument, interval, false, true);
                this.control.history.endTransaction();
                return true;
            }
            else
                return false;
        };
        BackspaceCommand.prototype.tryChangeParagraphAlignOrIndent = function (interval) {
            var pars = this.control.model.activeSubDocument.paragraphs;
            var parIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(pars, function (p) { return p.startLogPosition.value; }, interval.start);
            var par = pars[parIndex];
            return interval.start === par.startLogPosition.value && this.control.model.activeSubDocument.isEditable([par.interval]) &&
                (this.tryChangeParagraphAlign(par) || this.tryDeleteList(par, parIndex) || this.tryChangeParagraphIndent(par));
        };
        BackspaceCommand.prototype.tryChangeParagraphAlign = function (par) {
            var parProps = par.getParagraphMergedProperies();
            var alignIsRight = parProps.alignment == __aspxRichEdit.ParagraphAlignment.Right;
            if (!alignIsRight && parProps.alignment != __aspxRichEdit.ParagraphAlignment.Center)
                return false;
            this.control.history.addAndRedo(new __aspxRichEdit.ParagraphAlignmentHistoryItem(this.control.modelManipulator, this.control.model.activeSubDocument, par.interval, alignIsRight ? __aspxRichEdit.ParagraphAlignment.Center : __aspxRichEdit.ParagraphAlignment.Left, true));
            return true;
        };
        BackspaceCommand.prototype.tryDeleteList = function (par, parIndex) {
            if (!par.isInList())
                return false;
            var oldLeftIndent = par.getParagraphMergedProperies().leftIndent;
            this.control.history.beginTransaction();
            this.control.history.addAndRedo(new __aspxRichEdit.RemoveParagraphFromListHistoryItem(this.control.modelManipulator, this.control.model.activeSubDocument, parIndex));
            if (oldLeftIndent != par.getParagraphMergedProperies().leftIndent) {
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphLeftIndentHistoryItem(this.control.modelManipulator, this.control.model.activeSubDocument, par.interval, oldLeftIndent, true));
            }
            this.control.history.endTransaction();
            return true;
        };
        BackspaceCommand.prototype.tryChangeParagraphIndent = function (par) {
            var history = this.control.history;
            var parInterval = par.interval;
            var parProps = par.getParagraphMergedProperies();
            var subDocument = this.control.model.activeSubDocument;
            var indentsChanged = false;
            history.beginTransaction();
            if (parProps.leftIndent > 0) {
                history.addAndRedo(new __aspxRichEdit.ParagraphLeftIndentHistoryItem(this.control.modelManipulator, subDocument, parInterval, 0, true));
                indentsChanged = true;
            }
            if (parProps.firstLineIndent > 0) {
                history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentHistoryItem(this.control.modelManipulator, subDocument, parInterval, 0, true));
                indentsChanged = true;
            }
            if (parProps.firstLineIndentType !== __aspxRichEdit.ParagraphFirstLineIndent.None) {
                history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentTypeHistoryItem(this.control.modelManipulator, subDocument, parInterval, __aspxRichEdit.ParagraphFirstLineIndent.None, true));
                indentsChanged = true;
            }
            history.endTransaction();
            return indentsChanged;
        };
        BackspaceCommand.getIntervalAccordingFields = function (subDocument, selection, removingInterval, selectInterval) {
            var newRemovingInterval = removingInterval.clone();
            __aspxRichEdit.Field.correctIntervalDueToFields(subDocument, newRemovingInterval);
            if (removingInterval.equals(newRemovingInterval))
                return null;
            if (selectInterval)
                selection.deprecatedSetSelection(newRemovingInterval.start, newRemovingInterval.end, selection.endOfLine, selection.keepX, __aspxRichEdit.UpdateInputPositionProperties.Yes);
            return newRemovingInterval;
        };
        return BackspaceCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.BackspaceCommand = BackspaceCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeInlinePictureScaleCommand = (function (_super) {
        __extends(ChangeInlinePictureScaleCommand, _super);
        function ChangeInlinePictureScaleCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeInlinePictureScaleCommand.prototype.getState = function () {
            var isEnabled = this.isEnabled();
            var value;
            if (isEnabled) {
                var run = this.control.model.activeSubDocument.getRunByPosition(this.control.selection.specialRunInfo.getPicturePosition());
                value = [run.size.scale.width, run.size.scale.height];
            }
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled(), value);
        };
        ChangeInlinePictureScaleCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) &&
                this.control.selection.specialRunInfo.isPictureSelected() &&
                !this.control.selection.specialRunInfo.isSelectedAnchorObject;
        };
        ChangeInlinePictureScaleCommand.prototype.executeCore = function (_state, options) {
            var modelManipulator = this.control.modelManipulator;
            this.control.history.addAndRedo(new __aspxRichEdit.ChangeRectangularObjectScaleHistoryItem(modelManipulator, modelManipulator.model.activeSubDocument, new __aspxRichEdit.FixedInterval(this.control.selection.specialRunInfo.getPicturePosition(), 1), new __aspxRichEdit.Size(options.param[0], options.param[1])));
            return true;
        };
        ChangeInlinePictureScaleCommand.prototype.lockInputPositionUpdating = function (_prevModifiedState) {
            return true;
        };
        ChangeInlinePictureScaleCommand.prototype.lockUIUpdating = function (prevModifiedState) {
            return prevModifiedState === this.control.getModifiedState();
        };
        return ChangeInlinePictureScaleCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ChangeInlinePictureScaleCommand = ChangeInlinePictureScaleCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeTextCaseCommandBaseBase = (function (_super) {
        __extends(ChangeTextCaseCommandBaseBase, _super);
        function ChangeTextCaseCommandBaseBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeTextCaseCommandBaseBase.prototype.getActualIntervals = function () {
            if (this.control.selection.isCollapsed())
                return [this.control.model.activeSubDocument.getWholeWordInterval(this.control.selection.intervals[0].start, false, true)];
            return this.control.selection.getIntervalsClone();
        };
        ChangeTextCaseCommandBaseBase.prototype.getState = function () {
            return new __aspxRichEdit.IntervalCommandStateEx(this.isEnabled(), this.getActualIntervals());
        };
        ChangeTextCaseCommandBaseBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.characterFormatting);
        };
        return ChangeTextCaseCommandBaseBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ChangeTextCaseCommandBaseBase = ChangeTextCaseCommandBaseBase;
    var ChangeTextCaseCommandBase = (function (_super) {
        __extends(ChangeTextCaseCommandBase, _super);
        function ChangeTextCaseCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeTextCaseCommandBase.prototype.getActualInterval = function () {
            if (this.control.selection.isCollapsed())
                return this.control.model.activeSubDocument.getWholeWordInterval(this.control.selection.intervals[0].start, false, true);
            return this.control.selection.getLastSelectedInterval().clone();
        };
        ChangeTextCaseCommandBase.prototype.getState = function () {
            return new __aspxRichEdit.IntervalCommandStateEx(this.isEnabled(), this.getActualIntervals());
        };
        ChangeTextCaseCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.characterFormatting);
        };
        ChangeTextCaseCommandBase.prototype.executeCore = function (state, _options) {
            if (state.intervals.length === 0 || state.intervals[0].length === 0)
                return false;
            var modelManipulator = this.control.modelManipulator;
            var subDocument = modelManipulator.model.activeSubDocument;
            var layout = this.control.layout;
            this.control.history.beginTransaction();
            for (var i = 0, interval = void 0; interval = state.intervals[i]; i++) {
                this.control.history.addAndRedo(new (this.getHistoryItemName())(modelManipulator, subDocument, layout, interval, this.control));
                this.control.history.addAndRedo(new __aspxRichEdit.FontCapsHistoryItem(modelManipulator, subDocument, interval, false, true));
            }
            this.control.history.endTransaction();
            return true;
        };
        ChangeTextCaseCommandBase.prototype.getHistoryItemName = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return ChangeTextCaseCommandBase;
    }(ChangeTextCaseCommandBaseBase));
    __aspxRichEdit.ChangeTextCaseCommandBase = ChangeTextCaseCommandBase;
    var CapitalizeEachWordCaseCommand = (function (_super) {
        __extends(CapitalizeEachWordCaseCommand, _super);
        function CapitalizeEachWordCaseCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CapitalizeEachWordCaseCommand.prototype.getHistoryItemName = function () {
            return __aspxRichEdit.CapitalizeEachWordCaseHistoryItem;
        };
        return CapitalizeEachWordCaseCommand;
    }(ChangeTextCaseCommandBase));
    __aspxRichEdit.CapitalizeEachWordCaseCommand = CapitalizeEachWordCaseCommand;
    var MakeTextLowerCaseCommand = (function (_super) {
        __extends(MakeTextLowerCaseCommand, _super);
        function MakeTextLowerCaseCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        MakeTextLowerCaseCommand.prototype.getHistoryItemName = function () {
            return __aspxRichEdit.LowerCaseHistoryItem;
        };
        return MakeTextLowerCaseCommand;
    }(ChangeTextCaseCommandBase));
    __aspxRichEdit.MakeTextLowerCaseCommand = MakeTextLowerCaseCommand;
    var MakeTextUpperCaseCommand = (function (_super) {
        __extends(MakeTextUpperCaseCommand, _super);
        function MakeTextUpperCaseCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        MakeTextUpperCaseCommand.prototype.getHistoryItemName = function () {
            return __aspxRichEdit.UpperCaseHistoryItem;
        };
        return MakeTextUpperCaseCommand;
    }(ChangeTextCaseCommandBase));
    __aspxRichEdit.MakeTextUpperCaseCommand = MakeTextUpperCaseCommand;
    var ToggleTextCaseCommand = (function (_super) {
        __extends(ToggleTextCaseCommand, _super);
        function ToggleTextCaseCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleTextCaseCommand.prototype.getHistoryItemName = function () {
            return __aspxRichEdit.ToggleCaseHistoryItem;
        };
        return ToggleTextCaseCommand;
    }(ChangeTextCaseCommandBase));
    __aspxRichEdit.ToggleTextCaseCommand = ToggleTextCaseCommand;
    var SentenceCaseCommand = (function (_super) {
        __extends(SentenceCaseCommand, _super);
        function SentenceCaseCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SentenceCaseCommand.prototype.getHistoryItemName = function () {
            return __aspxRichEdit.SentenceCaseHistoryItem;
        };
        return SentenceCaseCommand;
    }(ChangeTextCaseCommandBase));
    __aspxRichEdit.SentenceCaseCommand = SentenceCaseCommand;
    var SwitchTextCaseCommand = (function (_super) {
        __extends(SwitchTextCaseCommand, _super);
        function SwitchTextCaseCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SwitchTextCaseCommand.prototype.executeCore = function (state, options) {
            var executed = false;
            this.control.history.beginTransaction();
            for (var i = 0, interval = void 0; interval = state.intervals[i]; i++) {
                var commandId = this.getCommand(interval);
                var command = (this.control.commandManager.getCommand(commandId));
                executed = command.executeCore(state, options);
            }
            this.control.history.endTransaction();
            return executed;
        };
        SwitchTextCaseCommand.prototype.getCommand = function (interval) {
            var sentences = __aspxRichEdit.SentenceStructureBuilder.getBuilder(this.control, this.control.model.activeSubDocument, this.control.layout, interval, true).sentences;
            var atLeastOneCharInNotInFirstPositionOnSentenceInUpperCase = false;
            var atLeastOneSentenceFullSelected = false;
            var atLeastOneFirstCharInSentenceInLowerCase = false;
            var atLeastOneFirstCharInWordInLowerCase = false;
            var allNotFirstCharsInWordsIsLowerCase = true;
            var allCharsInUpperCase = true;
            var allFirstCharsInWordsInUpperCase = true;
            externalLoop: for (var sentenceIndex = 0, sentence; sentence = sentences[sentenceIndex]; sentenceIndex++) {
                if (sentence.words[0].parts[0].position >= interval.start && sentence.getLastWord().getLastWordPart().getEndPosition() <= interval.end)
                    atLeastOneSentenceFullSelected = true;
                for (var wordIndex = 0, wordInfo; wordInfo = sentence.words[wordIndex]; wordIndex++) {
                    for (var wordPartIndex = 0, wordPart; wordPart = wordInfo.parts[wordPartIndex]; wordPartIndex++) {
                        if (wordPart.position < interval.start)
                            continue;
                        if (wordPart.position >= interval.end)
                            break externalLoop;
                        if (wordPart.type == __aspxRichEdit.LayoutBoxType.Text) {
                            var firstWordChar = wordPart.text[0];
                            var otherWordChars = wordPart.text.substr(1);
                            if (wordIndex == 0 && wordPartIndex == 0) {
                                atLeastOneFirstCharInSentenceInLowerCase = atLeastOneFirstCharInSentenceInLowerCase || (__aspxRichEdit.StringUtils.stringInLowerCase(firstWordChar) && !__aspxRichEdit.StringUtils.stringInUpperCase(firstWordChar));
                                atLeastOneCharInNotInFirstPositionOnSentenceInUpperCase = atLeastOneCharInNotInFirstPositionOnSentenceInUpperCase || __aspxRichEdit.StringUtils.inStringAtLeastOneSymbolInUpperCase(otherWordChars);
                            }
                            else
                                atLeastOneCharInNotInFirstPositionOnSentenceInUpperCase = atLeastOneCharInNotInFirstPositionOnSentenceInUpperCase || __aspxRichEdit.StringUtils.inStringAtLeastOneSymbolInUpperCase(wordPart.text);
                            if (wordPartIndex == 0) {
                                atLeastOneFirstCharInWordInLowerCase = atLeastOneFirstCharInWordInLowerCase || (__aspxRichEdit.StringUtils.stringInLowerCase(firstWordChar) && !__aspxRichEdit.StringUtils.stringInUpperCase(firstWordChar));
                                allFirstCharsInWordsInUpperCase = allFirstCharsInWordsInUpperCase && __aspxRichEdit.StringUtils.stringInUpperCase(firstWordChar);
                            }
                            allNotFirstCharsInWordsIsLowerCase = allNotFirstCharsInWordsIsLowerCase && __aspxRichEdit.StringUtils.stringInLowerCase(otherWordChars);
                            allCharsInUpperCase = allCharsInUpperCase && __aspxRichEdit.StringUtils.stringInUpperCase(wordPart.text);
                        }
                    }
                }
            }
            if (allCharsInUpperCase)
                return __aspxRichEdit.RichEditClientCommand.MakeTextLowerCase;
            if (allFirstCharsInWordsInUpperCase && allNotFirstCharsInWordsIsLowerCase)
                return __aspxRichEdit.RichEditClientCommand.MakeTextUpperCase;
            if (atLeastOneSentenceFullSelected && (atLeastOneFirstCharInSentenceInLowerCase || atLeastOneCharInNotInFirstPositionOnSentenceInUpperCase))
                return __aspxRichEdit.RichEditClientCommand.SentenceCase;
            if (atLeastOneFirstCharInWordInLowerCase && allNotFirstCharsInWordsIsLowerCase)
                return __aspxRichEdit.RichEditClientCommand.CapitalizeEachWordTextCase;
            return __aspxRichEdit.RichEditClientCommand.MakeTextUpperCase;
        };
        return SwitchTextCaseCommand;
    }(ChangeTextCaseCommandBaseBase));
    __aspxRichEdit.SwitchTextCaseCommand = SwitchTextCaseCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ClipboardCommand = (function (_super) {
        __extends(ClipboardCommand, _super);
        function ClipboardCommand(control, queryCommandId) {
            var _this = _super.call(this, control) || this;
            _this.queryCommandId = queryCommandId;
            if (_this.canUseBuiltInClipboard())
                ClipboardCommand.builtInClipboard = new BuiltInClipboard(_this.control);
            return _this;
        }
        ClipboardCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.visible = this.isVisible();
            return state;
        };
        ClipboardCommand.prototype.canUseBuiltInClipboard = function () {
            return this.control.isTouchMode();
        };
        ClipboardCommand.prototype.isCommandSupported = function () {
            var editableDocument = this.control.inputController.getEditableDocument();
            return !!editableDocument.queryCommandSupported && editableDocument.queryCommandSupported(this.queryCommandId);
        };
        ClipboardCommand.prototype.execute = function (isPublicApiCall, parameter) {
            if (parameter === void 0) { parameter = this.control.shortcutManager.lastCommandExecutedByShortcut; }
            var isPublicApiCallPrevValue = this.control.commandManager.isPublicApiCall;
            this.control.commandManager.isPublicApiCall = isPublicApiCall;
            if (!this.canUseBuiltInClipboard() && !parameter && !this.isCommandSupported()) {
                this.control.commandManager.isPublicApiCall = isPublicApiCallPrevValue;
                return this.executeShowErrorMessageCommand();
            }
            var options = this.convertToCommandOptions(parameter);
            this.beforeExecute();
            this.executeCore(this.getState(), options);
            this.control.commandManager.isPublicApiCall = isPublicApiCallPrevValue;
            return true;
        };
        ClipboardCommand.prototype.executeCore = function (state, options) {
            var _this = this;
            if (!state.enabled)
                return;
            if (!this.canUseBuiltInClipboard()) {
                if (!options.param)
                    this.control.inputController.getEditableDocument().execCommand(this.queryCommandId, false, null);
                setTimeout(function () {
                    var prevModifiedState = _this.control.getModifiedState();
                    _this.control.beginUpdate();
                    _this.changeModel();
                    var editableDocument = _this.control.inputController.getEditableDocument();
                    if (REWebUtils.Browser.TouchUI) {
                        window.getSelection().removeAllRanges();
                        __aspxRichEdit.HTMLUtils.clearInnerHtml(editableDocument);
                    }
                    else {
                        var selection = editableDocument.getSelection ? editableDocument.getSelection() : editableDocument.selection;
                        if (selection.removeAllRanges)
                            selection.removeAllRanges();
                        else if (selection.empty)
                            selection.empty();
                        __aspxRichEdit.HTMLUtils.clearInnerHtml(editableDocument.body);
                    }
                    if (REWebUtils.Browser.TouchUI)
                        window.getSelection().selectAllChildren(editableDocument);
                    else
                        _this.control.inputController.selectEditableDocumentContent();
                    _this.control.endUpdate();
                    _this.updateControlState(prevModifiedState);
                }, ClipboardCommand.timeout);
            }
            else
                this.executeBuiltInClipboardAction(this.getBuiltInClipboardActionType());
            return true;
        };
        ClipboardCommand.prototype.executeShowErrorMessageCommand = function () {
            return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowErrorClipboardAccessDeniedMessageCommand).execute(this.control.commandManager.isPublicApiCall);
        };
        ClipboardCommand.prototype.executeBuiltInClipboardAction = function (action) {
            var prevModifiedState = this.control.getModifiedState();
            this.control.beginUpdate();
            ClipboardCommand.builtInClipboard.execute(action);
            this.control.endUpdate();
            this.updateControlState(prevModifiedState);
        };
        ClipboardCommand.prototype.isVisible = function () {
            return true;
        };
        ClipboardCommand.prototype.getBuiltInClipboardActionType = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        ClipboardCommand.prototype.changeModel = function () {
        };
        ClipboardCommand.prototype.beforeExecute = function () {
            if (!REWebUtils.Browser.TouchUI)
                this.control.focusManager.captureFocus();
        };
        ClipboardCommand.timeout = REWebUtils.Browser.Firefox ? 10 :
            (REWebUtils.Browser.MacOSPlatform && (REWebUtils.Browser.WebKitFamily || REWebUtils.Browser.Opera) ? 10 : 0);
        return ClipboardCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.ClipboardCommand = ClipboardCommand;
    var CopySelectionCommand = (function (_super) {
        __extends(CopySelectionCommand, _super);
        function CopySelectionCommand(control) {
            return _super.call(this, control, "copy") || this;
        }
        CopySelectionCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.copy) && !this.control.selection.isCollapsed();
        };
        CopySelectionCommand.prototype.isVisible = function () {
            return __aspxRichEdit.ControlOptions.isVisible(this.control.options.copy);
        };
        CopySelectionCommand.prototype.getBuiltInClipboardActionType = function () {
            return BuiltInClipboardAction.Copy;
        };
        CopySelectionCommand.prototype.beforeExecute = function () {
            if (__aspxRichEdit.ControlOptions.isEnabled(this.control.options.copy)) {
                _super.prototype.beforeExecute.call(this);
                if (!this.canUseBuiltInClipboard())
                    this.control.inputController.renderSelectionToEditableDocument();
            }
        };
        CopySelectionCommand.prototype.isEnabledInReadOnlyMode = function () {
            return true;
        };
        return CopySelectionCommand;
    }(ClipboardCommand));
    __aspxRichEdit.CopySelectionCommand = CopySelectionCommand;
    var CutSelectionCommand = (function (_super) {
        __extends(CutSelectionCommand, _super);
        function CutSelectionCommand(control) {
            return _super.call(this, control, "cut") || this;
        }
        CutSelectionCommand.prototype.changeModel = function () {
            this.control.history.beginTransaction();
            var intervals = this.control.selection.getIntervalsClone();
            for (var i = intervals.length - 1; i >= 0; i--) {
                __aspxRichEdit.ModelManipulator.removeInterval(this.control, this.control.model.activeSubDocument, intervals[i], true, true);
            }
            __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, this.control.model.activeSubDocument, new __aspxRichEdit.FixedInterval(intervals[0].start, 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, this.control.selection.endOfLine);
            this.control.history.endTransaction();
        };
        CutSelectionCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.cut) && !this.control.selection.isCollapsed();
        };
        CutSelectionCommand.prototype.isVisible = function () {
            return __aspxRichEdit.ControlOptions.isVisible(this.control.options.cut);
        };
        CutSelectionCommand.prototype.getBuiltInClipboardActionType = function () {
            return BuiltInClipboardAction.Cut;
        };
        CutSelectionCommand.prototype.beforeExecute = function () {
            if (__aspxRichEdit.ControlOptions.isEnabled(this.control.options.cut)) {
                _super.prototype.beforeExecute.call(this);
                if (!this.canUseBuiltInClipboard())
                    this.control.inputController.renderSelectionToEditableDocument();
            }
        };
        return CutSelectionCommand;
    }(ClipboardCommand));
    __aspxRichEdit.CutSelectionCommand = CutSelectionCommand;
    var PasteSelectionCommand = (function (_super) {
        __extends(PasteSelectionCommand, _super);
        function PasteSelectionCommand(control) {
            return _super.call(this, control, "paste") || this;
        }
        PasteSelectionCommand.prototype.changeModel = function () {
            this.control.inputController.setEditableDocumentContent(__aspxRichEdit.HtmlImport.HtmlImporter.convertHtml(this.control.inputController.getEditableDocumentContent()));
            var editableElement = this.control.inputController.getEditableDocument();
            var elementsContainer = editableElement.body || editableElement;
            var elements = elementsContainer.childNodes;
            this.control.importHtml(elements, this.control.selection.getLastSelectedInterval());
        };
        PasteSelectionCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.paste);
        };
        PasteSelectionCommand.prototype.isVisible = function () {
            return __aspxRichEdit.ControlOptions.isVisible(this.control.options.paste) || this.canUseBuiltInClipboard();
        };
        PasteSelectionCommand.prototype.getBuiltInClipboardActionType = function () {
            return BuiltInClipboardAction.Paste;
        };
        PasteSelectionCommand.prototype.beforeExecute = function () {
            if (__aspxRichEdit.ControlOptions.isEnabled(this.control.options.paste)) {
                _super.prototype.beforeExecute.call(this);
                if (!this.canUseBuiltInClipboard()) {
                    var selection = REWebUtils.Browser.TouchUI ? window.getSelection() : this.control.inputController.getEditableDocument().getSelection();
                    selection.removeAllRanges();
                    var editableElement = this.control.inputController.getEditableDocument();
                    selection.selectAllChildren(editableElement.body || editableElement);
                }
            }
        };
        PasteSelectionCommand.prototype.isCommandSupported = function () {
            return REWebUtils.Browser.IE;
        };
        return PasteSelectionCommand;
    }(ClipboardCommand));
    __aspxRichEdit.PasteSelectionCommand = PasteSelectionCommand;
    var BuiltInClipboard = (function () {
        function BuiltInClipboard(control) {
            this.control = control;
        }
        BuiltInClipboard.prototype.executeCopy = function () {
            this.clipboard = __aspxRichEdit.ModelManipulator.createRangeCopy(this.control.modelManipulator.model.activeSubDocument, this.control.selection.getIntervalsClone());
        };
        BuiltInClipboard.prototype.executePaste = function () {
            if (this.clipboard)
                __aspxRichEdit.ModelManipulator.pasteRangeCopy(this.control, this.control.model.activeSubDocument, this.control.selection.getLastSelectedInterval().clone(), this.clipboard);
        };
        BuiltInClipboard.prototype.executeCut = function () {
            this.control.history.beginTransaction();
            this.clipboard = __aspxRichEdit.ModelManipulator.createRangeCopy(this.control.modelManipulator.model.activeSubDocument, this.control.selection.getIntervalsClone());
            var intervals = this.control.selection.getIntervalsClone();
            for (var i = intervals.length - 1; i >= 0; i--) {
                __aspxRichEdit.ModelManipulator.removeInterval(this.control, this.control.model.activeSubDocument, intervals[i], true, true);
            }
            __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, this.control.model.activeSubDocument, new __aspxRichEdit.FixedInterval(intervals[0].start, 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, this.control.selection.endOfLine);
            this.control.history.endTransaction();
        };
        BuiltInClipboard.prototype.createTextManipulatorIfNeeded = function () {
            if (!this.textManipulator)
                this.textManipulator = new __aspxRichEdit.TextManipulator(this.control.modelManipulator);
        };
        BuiltInClipboard.prototype.execute = function (action) {
            this.createTextManipulatorIfNeeded();
            switch (action) {
                case BuiltInClipboardAction.Copy:
                    this.executeCopy();
                    break;
                case BuiltInClipboardAction.Paste:
                    this.executePaste();
                    break;
                case BuiltInClipboardAction.Cut:
                    this.executeCut();
                    break;
            }
        };
        return BuiltInClipboard;
    }());
    __aspxRichEdit.BuiltInClipboard = BuiltInClipboard;
    var InsertHtmlCommand = (function (_super) {
        __extends(InsertHtmlCommand, _super);
        function InsertHtmlCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertHtmlCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        InsertHtmlCommand.prototype.executeCore = function (_state, options) {
            this.control.inputController.setEditableDocumentContent(__aspxRichEdit.HtmlImport.HtmlImporter.convertHtml(options.param));
            var editableElement = this.control.inputController.getEditableDocument();
            var elementsContainer = editableElement.body || editableElement;
            var elements = elementsContainer.childNodes;
            new __aspxRichEdit.HtmlImport.HtmlImporter(this.control, this.control.viewManager.emptyImageCacheId, this.control.selection.getLastSelectedInterval(), elements)
                .import();
            this.control.inputController.setEditableDocumentContent("");
            return true;
        };
        return InsertHtmlCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.InsertHtmlCommand = InsertHtmlCommand;
    var BuiltInClipboardAction;
    (function (BuiltInClipboardAction) {
        BuiltInClipboardAction[BuiltInClipboardAction["Copy"] = 0] = "Copy";
        BuiltInClipboardAction[BuiltInClipboardAction["Paste"] = 1] = "Paste";
        BuiltInClipboardAction[BuiltInClipboardAction["Cut"] = 2] = "Cut";
    })(BuiltInClipboardAction = __aspxRichEdit.BuiltInClipboardAction || (__aspxRichEdit.BuiltInClipboardAction = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DeleteCommand = (function (_super) {
        __extends(DeleteCommand, _super);
        function DeleteCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DeleteCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        DeleteCommand.prototype.executeCore = function (_state, _options) {
            this.control.history.beginTransaction();
            var selectionState = this.control.selection.getSelectionState();
            var subDocument = this.control.model.activeSubDocument;
            for (var i = 0, selectionInterval = void 0; selectionInterval = selectionState.intervals[i]; i++) {
                var removingInterval = selectionInterval.getFixedInterval();
                var isIntervalCollapsed = selectionInterval.length == 0;
                if (isIntervalCollapsed) {
                    var layoutPosition = subDocument.isMain()
                        ? __aspxRichEdit.LayoutPositionMainSubDocumentCreator.ensureLayoutPosition(this.control, this.control.layout, subDocument, selectionInterval.start, __aspxRichEdit.DocumentLayoutDetailsLevel.Character, new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(this.control.selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false))
                        : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.layout, subDocument, selectionInterval.start, this.control.selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                            .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(this.control.selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
                    layoutPosition.switchToStartNextBoxInRow();
                    removingInterval.start = layoutPosition.getLogPosition();
                    removingInterval.length = 1;
                }
                if (selectionInterval.end === this.control.model.activeSubDocument.getDocumentEndPosition() && removingInterval.length === 1)
                    continue;
                if (isIntervalCollapsed && __aspxRichEdit.BackspaceCommand.getIntervalAccordingFields(this.control.model.activeSubDocument, this.control.selection, removingInterval, true))
                    break;
                if (this.control.model.activeSubDocument.isEditable([removingInterval])) {
                    __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, subDocument, new __aspxRichEdit.FixedInterval(removingInterval.start, 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, this.control.selection.endOfLine);
                    __aspxRichEdit.ModelManipulator.removeInterval(this.control, this.control.model.activeSubDocument, removingInterval, false, true);
                }
            }
            selectionState.destructor();
            this.control.history.endTransaction();
            return true;
        };
        return DeleteCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.DeleteCommand = DeleteCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DragCopyContentCommand = (function (_super) {
        __extends(DragCopyContentCommand, _super);
        function DragCopyContentCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DragCopyContentCommand.prototype.executeCore = function (_state, options) {
            var positionTo = options.param;
            if (!this.control.model.activeSubDocument.isEditable([new __aspxRichEdit.FixedInterval(positionTo, 0)]))
                return false;
            var subDocument = this.control.model.activeSubDocument;
            var tableInfo = this.control.selection.tableInfo;
            if (this.tryCopyIntervalInsideTable(subDocument, tableInfo, positionTo))
                return true;
            var selectionState = this.control.selection.getSelectionState();
            var intervals = selectionState.intervals;
            var selectionIntervals = [];
            this.control.history.beginTransaction();
            for (var i = 0, interval = void 0; interval = intervals[i]; i++) {
                var fixedInterval = interval.getFixedInterval();
                __aspxRichEdit.ModelManipulator.copyIntervalTo(this.control, subDocument, fixedInterval, positionTo);
                selectionIntervals.push(new __aspxRichEdit.FixedInterval(positionTo, fixedInterval.length));
                positionTo += fixedInterval.length;
            }
            if (selectionIntervals.length)
                this.control.history.addAndRedo(new __aspxRichEdit.SetSelectionHistoryItem(this.control.modelManipulator, subDocument, selectionIntervals, this.control.selection, __aspxRichEdit.UpdateInputPositionProperties.Yes, this.control.selection.endOfLine));
            this.control.history.endTransaction();
            selectionState.destructor();
            return true;
        };
        DragCopyContentCommand.prototype.canModify = function () {
            return true;
        };
        DragCopyContentCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.visible = this.control.options.drag !== __aspxRichEdit.DocumentCapability.Hidden && this.control.options.drop !== __aspxRichEdit.DocumentCapability.Hidden;
            return state;
        };
        DragCopyContentCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.drag) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.drop) &&
                !this.control.selection.isCollapsed();
        };
        DragCopyContentCommand.prototype.tryCopyIntervalInsideTable = function (subDocument, tableInfo, positionTo) {
            if (!tableInfo.extendedData.numRows)
                return false;
            this.control.history.beginTransaction();
            var rangeCopy = __aspxRichEdit.ModelManipulator.createRangeCopy(subDocument, this.control.selection.getIntervalsClone());
            var newInterval = __aspxRichEdit.ModelManipulator.insertRangeCopy(this.control, subDocument, rangeCopy, positionTo);
            __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, subDocument, newInterval, __aspxRichEdit.UpdateInputPositionProperties.Yes, true);
            this.control.history.endTransaction();
            return true;
        };
        return DragCopyContentCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.DragCopyContentCommand = DragCopyContentCommand;
    var DragMoveContentCommand = (function (_super) {
        __extends(DragMoveContentCommand, _super);
        function DragMoveContentCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DragMoveContentCommand.prototype.executeCore = function (_state, options) {
            var positionTo = options.param;
            if (!this.control.model.activeSubDocument.isEditable([new __aspxRichEdit.FixedInterval(positionTo, 0)]))
                return false;
            if (this.control.selection.intervals.length == 1 &&
                this.control.model.activeSubDocument.getDocumentEndPosition() - 1 == this.control.selection.intervals[0].start ||
                !this.control.model.activeSubDocument.isEditable(this.control.selection.intervals))
                return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.DragCopyContent)
                    .execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, positionTo));
            var subDocument = this.control.model.activeSubDocument;
            var tableInfo = this.control.selection.tableInfo;
            if (tableInfo.extendedData.numRows && __aspxRichEdit.ListUtils.anyOf(tableInfo.extendedData.rows, function (rowInfo) {
                return __aspxRichEdit.ListUtils.anyOf(rowInfo.cells, function (cellInfo) {
                    return cellInfo.cell.interval.containsWithIntervalEnd(positionTo);
                });
            }))
                return false;
            if (this.tryMoveIntervalInsideTable(subDocument, tableInfo, positionTo, this.control.selection.intervals))
                return true;
            this.control.history.beginTransaction();
            var selectionState = this.control.selection.getSelectionState();
            var intervals = selectionState.intervals;
            var selectionLinkedIntervals = [];
            var skipIntervalIndex = this.getIntervalIndex(intervals, positionTo);
            if (skipIntervalIndex >= 0)
                positionTo = intervals[skipIntervalIndex].start;
            var skipInterval = intervals[skipIntervalIndex];
            var skipIntervalLength = skipInterval ? skipInterval.length : 0;
            for (var i = 0, interval = void 0; interval = intervals[i]; i++) {
                if (i === skipIntervalIndex) {
                    if (intervals.length > 1)
                        selectionLinkedIntervals.push(new __aspxRichEdit.LinkedInterval(subDocument.positionManager, new __aspxRichEdit.FixedInterval(positionTo, skipIntervalLength)));
                    positionTo += skipIntervalLength;
                    continue;
                }
                var fixedInterval = interval.getFixedInterval();
                __aspxRichEdit.ModelManipulator.moveIntervalTo(this.control, subDocument, fixedInterval, positionTo);
                var selectionStartPosition = fixedInterval.start < positionTo ? positionTo - fixedInterval.length : positionTo;
                var selectionEndPosition = selectionStartPosition + fixedInterval.length;
                selectionLinkedIntervals.push(new __aspxRichEdit.LinkedInterval(subDocument.positionManager, new __aspxRichEdit.BoundaryInterval(selectionStartPosition, selectionEndPosition)));
                if (positionTo <= fixedInterval.start)
                    positionTo += fixedInterval.length;
            }
            if (selectionLinkedIntervals.length) {
                var selectionIntervals = [];
                for (var i = 0, selectionLinkedInterval = void 0; selectionLinkedInterval = selectionLinkedIntervals[i]; i++) {
                    selectionIntervals.push(selectionLinkedInterval.getFixedInterval());
                    selectionLinkedInterval.destructor(subDocument.positionManager);
                }
                this.control.history.addAndRedo(new __aspxRichEdit.SetSelectionHistoryItem(this.control.modelManipulator, subDocument, selectionIntervals, this.control.selection, __aspxRichEdit.UpdateInputPositionProperties.Yes, this.control.selection.endOfLine));
            }
            this.control.history.endTransaction();
            selectionState.destructor();
            return intervals.length > 1 || skipIntervalIndex === -1;
        };
        DragMoveContentCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.visible = this.control.options.drag !== __aspxRichEdit.DocumentCapability.Hidden && this.control.options.drop !== __aspxRichEdit.DocumentCapability.Hidden;
            return state;
        };
        DragMoveContentCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.drag) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.drop) && !this.control.selection.isCollapsed();
        };
        DragMoveContentCommand.prototype.tryMoveIntervalInsideTable = function (subDocument, tableInfo, positionTo, intervals) {
            var _this = this;
            if (!tableInfo.extendedData.numRows)
                return false;
            var linkedIntervals = __aspxRichEdit.ListUtils.map(intervals, function (curr) { return curr.getLinkedInterval(subDocument.positionManager); });
            this.control.history.beginTransaction();
            var rangeCopy = __aspxRichEdit.ModelManipulator.createRangeCopy(subDocument, this.control.selection.getIntervalsClone());
            var newInterval = __aspxRichEdit.ModelManipulator.insertRangeCopy(this.control, subDocument, rangeCopy, positionTo)
                .getLinkedInterval(subDocument.positionManager);
            __aspxRichEdit.ListUtils.foreach(linkedIntervals, function (curr) {
                __aspxRichEdit.ModelManipulator.removeInterval(_this.control, subDocument, curr.getFixedInterval(), true, false);
                curr.destructor(subDocument.positionManager);
            });
            __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, subDocument, newInterval.getFixedInterval(), __aspxRichEdit.UpdateInputPositionProperties.Yes, true);
            this.control.history.endTransaction();
            newInterval.destructor(subDocument.positionManager);
            return true;
        };
        DragMoveContentCommand.prototype.getIntervalIndex = function (intervals, position) {
            for (var i = 0, interval = void 0; interval = intervals[i]; i++) {
                if (interval.start <= position && interval.end >= position)
                    return i;
            }
            return -1;
        };
        DragMoveContentCommand.prototype.canModify = function () {
            return true;
        };
        return DragMoveContentCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.DragMoveContentCommand = DragMoveContentCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertColumnBreakCommand = (function (_super) {
        __extends(InsertColumnBreakCommand, _super);
        function InsertColumnBreakCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertColumnBreakCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        InsertColumnBreakCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.sections) &&
                this.control.selection.tableInfo.extendedData.numRows == 0 && this.control.model.activeSubDocument.isMain();
        };
        InsertColumnBreakCommand.prototype.DEPRECATEDCorrectlMainCommandOptions = function (options) {
            options.intervals = [this.control.selection.getLastSelectedInterval().clone()];
        };
        InsertColumnBreakCommand.prototype.executeCore = function (_state, options) {
            this.control.modelManipulator.insertText(this.control, options.subDocument, options.intervals[0].clone(), __aspxRichEdit.RichUtils.specialCharacters.ColumnBreak, false);
            return true;
        };
        return InsertColumnBreakCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.InsertColumnBreakCommand = InsertColumnBreakCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertLineBreakCommand = (function (_super) {
        __extends(InsertLineBreakCommand, _super);
        function InsertLineBreakCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertLineBreakCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        InsertLineBreakCommand.prototype.DEPRECATEDCorrectlMainCommandOptions = function (options) {
            options.intervals = [this.control.selection.getLastSelectedInterval().clone()];
        };
        InsertLineBreakCommand.prototype.executeCore = function (_state, options) {
            this.control.modelManipulator.insertText(this.control, options.subDocument, options.intervals[0].clone(), __aspxRichEdit.RichUtils.specialCharacters.LineBreak, false);
            return true;
        };
        return InsertLineBreakCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.InsertLineBreakCommand = InsertLineBreakCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertPageBreakCommand = (function (_super) {
        __extends(InsertPageBreakCommand, _super);
        function InsertPageBreakCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertPageBreakCommand.prototype.getState = function (options) {
            if (options === void 0) { options = this.convertToCommandOptions(undefined); }
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled(options));
        };
        InsertPageBreakCommand.prototype.DEPRECATEDCorrectlMainCommandOptions = function (options) {
            options.intervals = [this.control.selection.getLastSelectedInterval().clone()];
        };
        InsertPageBreakCommand.prototype.executeCore = function (_state, options) {
            var interval = options.intervals[0].clone();
            this.control.history.beginTransaction();
            if (this.control.options.pageBreakInsertMode === __aspxRichEdit.PageBreakInsertMode.NewLine) {
                interval = __aspxRichEdit.ModelManipulator.insertParagraph(this.control, options.subDocument, interval);
                interval = new __aspxRichEdit.FixedInterval(interval.end, 0);
            }
            interval = this.control.modelManipulator.insertText(this.control, options.subDocument, interval, __aspxRichEdit.RichUtils.specialCharacters.PageBreak, false);
            interval = new __aspxRichEdit.FixedInterval(interval.end, 0);
            __aspxRichEdit.ModelManipulator.insertParagraph(this.control, options.subDocument, interval);
            this.control.history.endTransaction();
            return true;
        };
        InsertPageBreakCommand.prototype.isEnabled = function (options) {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.paragraphs) &&
                this.control.selection.tableInfo.extendedData.numRows == 0 && options.subDocument.isMain();
        };
        return InsertPageBreakCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.InsertPageBreakCommand = InsertPageBreakCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertParagraphCommand = (function (_super) {
        __extends(InsertParagraphCommand, _super);
        function InsertParagraphCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertParagraphCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        InsertParagraphCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.paragraphs);
        };
        InsertParagraphCommand.prototype.DEPRECATEDCorrectlMainCommandOptions = function (options) {
            options.intervals = [this.control.selection.getLastSelectedInterval().clone()];
        };
        InsertParagraphCommand.prototype.executeCore = function (_state, options) {
            var subDocument = options.subDocument;
            var interval = options.intervals[0];
            this.lock = interval.length == 0;
            if (this.tryInsertParagraphBeforeTable(interval, subDocument, !options.isSetManually))
                return true;
            if (interval.length === 0 || interval.start === 1) {
                var paragraphIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(subDocument.paragraphs, function (p) { return p.startLogPosition.value; }, interval.start);
                var paragraph = subDocument.paragraphs[paragraphIndex];
                if (paragraph.startLogPosition.value === interval.start && paragraph.isInList() && paragraph.length === 1) {
                    this.control.history.addAndRedo(new __aspxRichEdit.RemoveParagraphFromListHistoryItem(this.control.modelManipulator, subDocument, paragraphIndex));
                    return true;
                }
            }
            var selState;
            if (!options.allowChangeSelection)
                selState = this.control.selection.getSelectionState();
            __aspxRichEdit.ModelManipulator.insertParagraph(this.control, subDocument, interval.clone(), options.allowChangeSelection);
            if (selState)
                this.control.selection.restoreSelectionState(selState, __aspxRichEdit.UpdateInputPositionProperties.Yes);
            return true;
        };
        InsertParagraphCommand.prototype.lockInputPositionUpdating = function (_prevModifiedState) {
            return this.lock;
        };
        InsertParagraphCommand.prototype.lockUIUpdating = function (_prevModifiedState) {
            return this.lock;
        };
        InsertParagraphCommand.prototype.tryInsertParagraphBeforeTable = function (interval, subDocument, changeSelection) {
            if (interval.start > 0 || interval.length > 0)
                return false;
            var firstTable = subDocument.tables[0];
            if (firstTable && firstTable.getStartPosition() === 0) {
                this.control.history.beginTransaction();
                __aspxRichEdit.TablesManipulator.insertParagraphToTheCellStartAndShiftContent(this.control, subDocument, firstTable.rows[0].cells[0]);
                this.control.history.addAndRedo(new __aspxRichEdit.ShiftTableStartPositionToTheRightHistoryItem(this.control.modelManipulator, subDocument, firstTable.index));
                if (changeSelection)
                    __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, subDocument, new __aspxRichEdit.FixedInterval(0, 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, false);
                this.control.history.endTransaction();
                return true;
            }
        };
        return InsertParagraphCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.InsertParagraphCommand = InsertParagraphCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertSectionBreakCommand = (function (_super) {
        __extends(InsertSectionBreakCommand, _super);
        function InsertSectionBreakCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertSectionBreakCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        InsertSectionBreakCommand.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.sections) &&
                this.control.selection.tableInfo.extendedData.numRows == 0 && this.control.model.activeSubDocument.isMain() &&
                __aspxRichEdit.SectionPropertiesCommandBase.rangePermissionIncludeFullSection(this.control, this.control.model.activeSubDocument, this.control.selection.intervals);
        };
        InsertSectionBreakCommand.prototype.executeCore = function (_state, _options) {
            __aspxRichEdit.ModelManipulator.insertSectionAndSetStartType(this.control, this.control.selection.getLastSelectedInterval().start, this.getStartType());
            return true;
        };
        return InsertSectionBreakCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.InsertSectionBreakCommand = InsertSectionBreakCommand;
    var InsertSectionBreakNextPageCommand = (function (_super) {
        __extends(InsertSectionBreakNextPageCommand, _super);
        function InsertSectionBreakNextPageCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertSectionBreakNextPageCommand.prototype.getStartType = function () {
            return __aspxRichEdit.SectionStartType.NextPage;
        };
        return InsertSectionBreakNextPageCommand;
    }(InsertSectionBreakCommand));
    __aspxRichEdit.InsertSectionBreakNextPageCommand = InsertSectionBreakNextPageCommand;
    var InsertSectionBreakEvenPageCommand = (function (_super) {
        __extends(InsertSectionBreakEvenPageCommand, _super);
        function InsertSectionBreakEvenPageCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertSectionBreakEvenPageCommand.prototype.getStartType = function () {
            return __aspxRichEdit.SectionStartType.EvenPage;
        };
        return InsertSectionBreakEvenPageCommand;
    }(InsertSectionBreakCommand));
    __aspxRichEdit.InsertSectionBreakEvenPageCommand = InsertSectionBreakEvenPageCommand;
    var InsertSectionBreakOddPageCommand = (function (_super) {
        __extends(InsertSectionBreakOddPageCommand, _super);
        function InsertSectionBreakOddPageCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertSectionBreakOddPageCommand.prototype.getStartType = function () {
            return __aspxRichEdit.SectionStartType.OddPage;
        };
        return InsertSectionBreakOddPageCommand;
    }(InsertSectionBreakCommand));
    __aspxRichEdit.InsertSectionBreakOddPageCommand = InsertSectionBreakOddPageCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertSpaceCommand = (function (_super) {
        __extends(InsertSpaceCommand, _super);
        function InsertSpaceCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertSpaceCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        InsertSpaceCommand.prototype.DEPRECATEDCorrectlMainCommandOptions = function (options) {
            options.intervals = [this.control.selection.getLastSelectedInterval().clone()];
        };
        InsertSpaceCommand.prototype.executeCore = function (_state, options) {
            this.control.modelManipulator.insertText(this.control, options.subDocument, options.intervals[0].clone(), __aspxRichEdit.RichUtils.specialCharacters.Space, true);
            return true;
        };
        return InsertSpaceCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.InsertSpaceCommand = InsertSpaceCommand;
    var InsertNonBreakingSpaceCommand = (function (_super) {
        __extends(InsertNonBreakingSpaceCommand, _super);
        function InsertNonBreakingSpaceCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertNonBreakingSpaceCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        InsertNonBreakingSpaceCommand.prototype.DEPRECATEDCorrectlMainCommandOptions = function (options) {
            options.intervals = [this.control.selection.getLastSelectedInterval().clone()];
        };
        InsertNonBreakingSpaceCommand.prototype.executeCore = function (_state, options) {
            this.control.modelManipulator.insertText(this.control, options.subDocument, options.intervals[0].clone(), __aspxRichEdit.RichUtils.specialCharacters.NonBreakingSpace, true);
            return true;
        };
        return InsertNonBreakingSpaceCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.InsertNonBreakingSpaceCommand = InsertNonBreakingSpaceCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertTabCommandBase = (function (_super) {
        __extends(InsertTabCommandBase, _super);
        function InsertTabCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertTabCommandBase.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        InsertTabCommandBase.prototype.setNextObj = function (iter) {
            do {
                if (__aspxRichEdit.EnumUtils.isAnyOf(iter.run.getType(), __aspxRichEdit.RunType.InlinePictureRun, __aspxRichEdit.RunType.AnchoredPictureRun, __aspxRichEdit.RunType.AnchoredTextBoxRun))
                    return true;
            } while (iter.moveToNextRun());
            return false;
        };
        InsertTabCommandBase.prototype.executeCore = function (_state, _options) {
            var specInfo = this.control.selection.specialRunInfo;
            if (specInfo.isSelected() && (!specInfo.isTextBoxSelected() ||
                this.control.model.activeSubDocument.id == specInfo.getParentSubDocument().id)) {
                var iter = new __aspxRichEdit.ModelIterator(this.control.model.activeSubDocument, true);
                iter.setPosition(specInfo.getPosition() + 1);
                if (!this.setNextObj(iter)) {
                    iter.setPosition(0);
                    this.setNextObj(iter);
                }
                this.control.selection.setSelection(new __aspxRichEdit.SetSelectionParams().setInterval(new __aspxRichEdit.FixedInterval(iter.getAbsolutePosition(), 1)));
                return true;
            }
            var interval = this.control.selection.getLastSelectedInterval().clone();
            var startParagraph = this.control.model.activeSubDocument.getParagraphByPosition(interval.start);
            var documentEndPosition = this.control.model.activeSubDocument.getDocumentEndPosition();
            if (interval.start >= documentEndPosition)
                throw new Error("InsertTabCommandBase interval.start >= documentEndPosition");
            if (interval.length > 0 && interval.end > documentEndPosition)
                throw new Error("InsertTabCommandBase interval.end > documentEndPosition");
            var subDocument = this.control.model.activeSubDocument;
            var startLayoutPosition = subDocument.isMain()
                ? __aspxRichEdit.LayoutPositionMainSubDocumentCreator.ensureLayoutPosition(this.control, this.control.layout, subDocument, interval.start, __aspxRichEdit.DocumentLayoutDetailsLevel.Character, new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false))
                : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.layout, subDocument, interval.start, this.control.selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                    .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
            if (this.addTableRowIfRequired(startLayoutPosition))
                return true;
            if (this.performCellIteratorActionIfRequired(startLayoutPosition, interval.start))
                return true;
            if (!this.control.commandManager.assertLastExecutedCommandsChain(true, InsertTabCommandBase)) {
                if (startParagraph.getTabs().positions.length === 0) {
                    if (this.needProcessFirstParagraphRow(interval, startParagraph, startLayoutPosition)) {
                        if (startParagraph.isInList())
                            return this.createIndentNumberingParagraphCommand().execute(this.control.commandManager.isPublicApiCall);
                        return this.createChangeParagraphIndentFromFirstRowCommand().execute(this.control.commandManager.isPublicApiCall);
                    }
                    if (this.needProcessParagraphLeftIndent(interval, startLayoutPosition))
                        return this.createChangeIndentCommand().execute(this.control.commandManager.isPublicApiCall);
                }
            }
            if (__aspxRichEdit.ControlOptions.isEnabled(this.control.options.tabSymbol))
                this.control.modelManipulator.insertText(this.control, this.control.model.activeSubDocument, interval, this.control.options.tabMarker, true);
            return true;
        };
        InsertTabCommandBase.prototype.addTableRowIfRequired = function (lp) {
            var cellInfo = lp.row.tableCellInfo;
            if (!cellInfo)
                return false;
            var rowInfo = cellInfo.parentRow;
            var grid = rowInfo.parentTable.logicInfo.grid;
            var info = grid.tableCellGridInfos[rowInfo.rowIndex][cellInfo.cellGridIndex];
            var rowInd = info.getEndRowIndex();
            var cellInd = info.getCellIndex(info.getNumRowsInCell() - 1);
            var lastRow = __aspxRichEdit.ListUtils.last(grid.table.rows);
            if (rowInd == grid.table.rows.length && cellInd == lastRow.cells.length - 1) {
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.InsertTableRowBelow)
                    .execute(this.control.commandManager.isPublicApiCall);
                this.control.selection.setSelection(new __aspxRichEdit.SetSelectionParams()
                    .setPosition(this.control.selection.intervals[0].start)
                    .setEndOfLine(false));
                return true;
            }
            return false;
        };
        InsertTabCommandBase.prototype.needProcessFirstParagraphRow = function (interval, startParagraph, startLayoutPosition) {
            if (this.control.commandManager.assertLastExecutedCommandsChain(false, InsertTabCommandBase, __aspxRichEdit.ChangeParagraphIndentFromFirstRowCommandBase) && this.isIntervalStartInParagraphStart(interval, startParagraph))
                return true;
            return this.isIntervalStartInParagraphStart(interval, startParagraph) && (interval.length === 0 || this.isIntervalEndOnRowEnd(interval, startLayoutPosition));
        };
        InsertTabCommandBase.prototype.needProcessParagraphLeftIndent = function (interval, startLayoutPosition) {
            if (this.control.commandManager.assertLastExecutedCommandsChain(false, InsertTabCommandBase, __aspxRichEdit.ChangeIndentCommandBase))
                return true;
            var subDocument = this.control.model.activeSubDocument;
            var endLayoutPosition = (subDocument.isMain()
                ? new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.control.layout, subDocument, interval.end, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.layout, subDocument, interval.end, this.control.selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character))
                .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
            return startLayoutPosition && startLayoutPosition.isPositionBeforeFirstBoxInRow() && this.isIntervalIncludesWholeRow(startLayoutPosition, endLayoutPosition);
        };
        InsertTabCommandBase.prototype.performCellIteratorActionIfRequired = function (startLayoutPosition, pos) {
            var startCellInfo = startLayoutPosition.row.tableCellInfo;
            if (!startCellInfo)
                return false;
            var boxIterator;
            var startCellIndexes = this.getTablePos(startCellInfo);
            while (true) {
                boxIterator = this.getBoxIterator(pos, startCellInfo.parentRow.parentTable.getTopLevelColumn().logicInfo.grid.table.getEndPosition() + 1);
                if (boxIterator && boxIterator.isInitialized())
                    break;
                this.control.layoutFormatterManager.forceFormatPage(this.control.layout.validPageCount);
            }
            while (this.performCellIteratorAction(boxIterator)) {
                var currIndexes = this.getTablePos(boxIterator.position.row.tableCellInfo);
                if (!startCellIndexes.equals(currIndexes)) {
                    if (currIndexes &&
                        (startCellIndexes.table.index == currIndexes.table.index ||
                            currIndexes.table.nestedLevel > startCellIndexes.table.nestedLevel)) {
                        var grid = boxIterator.position.row.tableCellInfo.parentRow.parentTable.logicInfo.grid;
                        var cellStartPos = grid.table.rows[currIndexes.rowIndex].cells[currIndexes.cellIndex].startParagraphPosition.value;
                        this.control.selection.setSelection(new __aspxRichEdit.SetSelectionParams()
                            .setInterval(new __aspxRichEdit.FixedInterval(cellStartPos, 0))
                            .setEndOfLine(false));
                    }
                    break;
                }
            }
            return true;
        };
        InsertTabCommandBase.prototype.getTablePos = function (cellInfo) {
            if (!cellInfo)
                return null;
            var rowInfo = cellInfo.parentRow;
            var grid = rowInfo.parentTable.logicInfo.grid;
            var info = grid.tableCellGridInfos[rowInfo.rowIndex][cellInfo.cellGridIndex];
            return new __aspxRichEdit.TablePosition(grid.table, info.getStartRowIndex(), info.getCellIndex(0));
        };
        InsertTabCommandBase.prototype.isIntervalStartInParagraphStart = function (interval, paragraph) {
            return interval.start === paragraph.startLogPosition.value;
        };
        InsertTabCommandBase.prototype.isIntervalEndOnRowEnd = function (interval, layoutPosition) {
            if (!layoutPosition)
                return false;
            return layoutPosition.getRelatedSubDocumentPagePosition() + layoutPosition.pageArea.pageOffset + layoutPosition.column.pageAreaOffset + layoutPosition.row.getEndPosition() === interval.end;
        };
        InsertTabCommandBase.prototype.isIntervalIncludesWholeRow = function (startLayoutPosition, endLayoutPosition) {
            return !endLayoutPosition || endLayoutPosition.row !== startLayoutPosition.row || endLayoutPosition.isPositionAfterLastBoxInRow();
        };
        return InsertTabCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.InsertTabCommandBase = InsertTabCommandBase;
    var InsertTabCommand = (function (_super) {
        __extends(InsertTabCommand, _super);
        function InsertTabCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertTabCommand.prototype.createIndentNumberingParagraphCommand = function () {
            return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.IncrementNumberingIndent);
        };
        InsertTabCommand.prototype.createChangeParagraphIndentFromFirstRowCommand = function () {
            return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.IncrementParagraphIndentFromFirstRow);
        };
        InsertTabCommand.prototype.createChangeIndentCommand = function () {
            return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.IncreaseIndent);
        };
        InsertTabCommand.prototype.performCellIteratorAction = function (boxIterator) {
            return boxIterator.moveNext(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true));
        };
        InsertTabCommand.prototype.getBoxIterator = function (pos, endPos) {
            var subDocument = this.control.model.activeSubDocument;
            var layout = this.control.layout;
            return subDocument.isMain() ?
                new __aspxRichEdit.LayoutBoxIteratorMainSubDocument(subDocument, layout, pos, endPos) :
                new __aspxRichEdit.LayoutBoxIteratorOtherSubDocument(subDocument, layout, pos, endPos, this.control.selection.pageIndex);
        };
        return InsertTabCommand;
    }(InsertTabCommandBase));
    __aspxRichEdit.InsertTabCommand = InsertTabCommand;
    var InsertShiftTabCommand = (function (_super) {
        __extends(InsertShiftTabCommand, _super);
        function InsertShiftTabCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertShiftTabCommand.prototype.createIndentNumberingParagraphCommand = function () {
            return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.DecrementNumberingIndent);
        };
        InsertShiftTabCommand.prototype.createChangeParagraphIndentFromFirstRowCommand = function () {
            return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.DecrementParagraphIndentFromFirstRow);
        };
        InsertShiftTabCommand.prototype.createChangeIndentCommand = function () {
            return this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.DecreaseIndent);
        };
        InsertShiftTabCommand.prototype.performCellIteratorAction = function (boxIterator) {
            return boxIterator.movePrev(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true));
        };
        InsertShiftTabCommand.prototype.getBoxIterator = function (pos, _endPos) {
            var subDocument = this.control.model.activeSubDocument;
            var layout = this.control.layout;
            return subDocument.isMain() ?
                new __aspxRichEdit.LayoutBoxIteratorMainSubDocument(subDocument, layout, 0, pos) :
                new __aspxRichEdit.LayoutBoxIteratorOtherSubDocument(subDocument, layout, 0, pos, this.control.selection.pageIndex);
        };
        return InsertShiftTabCommand;
    }(InsertTabCommandBase));
    __aspxRichEdit.InsertShiftTabCommand = InsertShiftTabCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertTextCommand = (function (_super) {
        __extends(InsertTextCommand, _super);
        function InsertTextCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertTextCommand.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        InsertTextCommand.prototype.DEPRECATEDCorrectlMainCommandOptions = function (options) {
            options.intervals = [this.control.selection.getLastSelectedInterval().clone()];
        };
        InsertTextCommand.prototype.executeCore = function (_state, options) {
            if (options.param.length === 0)
                return false;
            var interval = options.intervals[0];
            this.removedInterval = !!interval.length;
            var canMergeWithPreviousCommand = options.allowChangeSelection &&
                this.control.commandManager.assertLastExecutedCommandsChain(true, InsertTextCommand);
            var selState;
            if (!options.allowChangeSelection)
                selState = this.control.selection.getSelectionState();
            this.control.modelManipulator.insertText(this.control, options.subDocument, options.intervals[0].clone(), options.param, canMergeWithPreviousCommand, options.allowChangeSelection, options.allowChangeSelection ? __aspxRichEdit.ModelScrollManager.StandartScrollPosition : __aspxRichEdit.ModelScrollManager.DontChangeScrollPosition);
            if (selState)
                this.control.selection.restoreSelectionState(selState, __aspxRichEdit.UpdateInputPositionProperties.Yes);
            return true;
        };
        InsertTextCommand.prototype.lockInputPositionUpdating = function (_prevModifiedState) {
            return !this.removedInterval;
        };
        InsertTextCommand.prototype.lockUIUpdating = function (prevModifiedState) {
            return !this.removedInterval && prevModifiedState === this.control.getModifiedState();
        };
        return InsertTextCommand;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.InsertTextCommand = InsertTextCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RemoveWordCommandBase = (function (_super) {
        __extends(RemoveWordCommandBase, _super);
        function RemoveWordCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RemoveWordCommandBase.prototype.getState = function () {
            return new __aspxRichEdit.SimpleCommandState(this.isEnabled());
        };
        RemoveWordCommandBase.prototype.executeCore = function (_state, _options) {
            var selection = this.control.selection;
            var position = selection.getLastSelectedInterval().start;
            var subDocument = this.control.model.activeSubDocument;
            var parIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(subDocument.paragraphs, function (p) { return p.startLogPosition.value; }, position);
            var delInterval = this.getDeleteInterval(subDocument, position, parIndex);
            if (!delInterval || delInterval.length == 0)
                return false;
            var fieldsAccordingInterval = __aspxRichEdit.BackspaceCommand.getIntervalAccordingFields(subDocument, selection, delInterval, false);
            if (fieldsAccordingInterval)
                delInterval.copyFrom(fieldsAccordingInterval);
            this.control.history.beginTransaction();
            __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, subDocument, new __aspxRichEdit.FixedInterval(delInterval.start, 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, selection.endOfLine);
            __aspxRichEdit.ModelManipulator.removeInterval(this.control, subDocument, delInterval, false, true);
            this.control.history.endTransaction();
            return true;
        };
        return RemoveWordCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.RemoveWordCommandBase = RemoveWordCommandBase;
    var RemovePrevWordCommand = (function (_super) {
        __extends(RemovePrevWordCommand, _super);
        function RemovePrevWordCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RemovePrevWordCommand.prototype.getDeleteInterval = function (subDocument, position, parIndex) {
            return RemovePrevWordCommand.getPrevWordInterval(this.control, subDocument, position, parIndex);
        };
        RemovePrevWordCommand.getPrevWordInterval = function (control, subDocument, position, parIndex) {
            var paragraph = subDocument.paragraphs[parIndex];
            if (paragraph.startLogPosition.value == position) {
                if (parIndex == 0)
                    return null;
                paragraph = subDocument.paragraphs[parIndex - 1];
            }
            var sentenceFindInterval = __aspxRichEdit.FixedInterval.fromPositions(paragraph.startLogPosition.value, position);
            var sentenceStructureBuilder = __aspxRichEdit.SentenceStructureBuilder.getBuilder(control, subDocument, control.layout, sentenceFindInterval, true);
            var part = __aspxRichEdit.ListUtils.reverseAnyOf(sentenceStructureBuilder.sentences, function (sentence) {
                return __aspxRichEdit.ListUtils.reverseAnyOf(sentence.words, function (word) { return word.parts[0].position < position ? word.parts[0] : null; });
            });
            return part ? __aspxRichEdit.FixedInterval.fromPositions(part.position, position) : null;
        };
        return RemovePrevWordCommand;
    }(RemoveWordCommandBase));
    __aspxRichEdit.RemovePrevWordCommand = RemovePrevWordCommand;
    var RemoveNextWordCommand = (function (_super) {
        __extends(RemoveNextWordCommand, _super);
        function RemoveNextWordCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RemoveNextWordCommand.prototype.getDeleteInterval = function (subDocument, position, parIndex) {
            return RemoveNextWordCommand.getNextWordInterval(this.control, subDocument, position, parIndex);
        };
        RemoveNextWordCommand.getNextWordInterval = function (control, subDocument, position, parIndex) {
            parIndex = Math.min(subDocument.paragraphs.length - 1, parIndex + 1);
            var paragraph = subDocument.paragraphs[parIndex];
            var sentenceFindInterval = __aspxRichEdit.FixedInterval.fromPositions(position, paragraph.getEndPosition());
            var sentenceStructureBuilder = __aspxRichEdit.SentenceStructureBuilder.getBuilder(control, subDocument, control.layout, sentenceFindInterval, true);
            var part = __aspxRichEdit.ListUtils.anyOf(sentenceStructureBuilder.sentences, function (sentence) {
                return __aspxRichEdit.ListUtils.anyOf(sentence.words, function (word) {
                    if (word.parts[0].position > position)
                        return word.parts[0];
                    return __aspxRichEdit.ListUtils.anyOf(word.parts, function (part) { return part.position > position &&
                        (part.type == __aspxRichEdit.LayoutBoxType.ParagraphMark || part.type == __aspxRichEdit.LayoutBoxType.SectionMark) ? part : null; }, 1);
                });
            });
            return __aspxRichEdit.FixedInterval.fromPositions(position, part ? part.position : paragraph.getEndPosition());
        };
        return RemoveNextWordCommand;
    }(RemoveWordCommandBase));
    __aspxRichEdit.RemoveNextWordCommand = RemoveNextWordCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SetParagraphLevelCommandBase = (function (_super) {
        __extends(SetParagraphLevelCommandBase, _super);
        function SetParagraphLevelCommandBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetParagraphLevelCommandBase.prototype.isEnabled = function () {
            return _super.prototype.isEnabled.call(this) && __aspxRichEdit.ControlOptions.isEnabled(this.control.options.paragraphFormatting);
        };
        SetParagraphLevelCommandBase.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.value = this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeHeadingLevel).getState().value == this.getLevel(null);
            return state;
        };
        SetParagraphLevelCommandBase.prototype.executeCore = function (_state, options) {
            var level = this.getLevel(options.param);
            var styleName = level > 0 ? REWebUtils.Formatter.Format("{0} {1}", __aspxRichEdit.ParagraphStyle.headingStyleName, level) : __aspxRichEdit.ParagraphStyle.normalStyleName;
            var paragraphStyle = this.control.model.getParagraphStyleByName(styleName);
            if (!paragraphStyle)
                paragraphStyle = __aspxRichEdit.StylesManager.getPresetParagraphStyleByName(styleName);
            if (paragraphStyle)
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeStyle).execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, __aspxRichEdit.StylesManager.paragraphPrefix + styleName));
            else
                this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeHeadingLevel).execute(this.control.commandManager.isPublicApiCall, new __aspxRichEdit.CommandSimpleOptions(this.control, level));
            return true;
        };
        return SetParagraphLevelCommandBase;
    }(__aspxRichEdit.CommandBase));
    __aspxRichEdit.SetParagraphLevelCommandBase = SetParagraphLevelCommandBase;
    var SetParagraphLevelCommand = (function (_super) {
        __extends(SetParagraphLevelCommand, _super);
        function SetParagraphLevelCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetParagraphLevelCommand.prototype.getState = function () {
            var state = new __aspxRichEdit.SimpleCommandState(this.isEnabled());
            state.value = this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeHeadingLevel).getState().value;
            return state;
        };
        SetParagraphLevelCommand.prototype.getLevel = function (parameter) {
            return parameter;
        };
        return SetParagraphLevelCommand;
    }(SetParagraphLevelCommandBase));
    __aspxRichEdit.SetParagraphLevelCommand = SetParagraphLevelCommand;
    var SetParagraphBodyTextLevelCommand = (function (_super) {
        __extends(SetParagraphBodyTextLevelCommand, _super);
        function SetParagraphBodyTextLevelCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetParagraphBodyTextLevelCommand.prototype.getLevel = function (_parameter) { return 0; };
        return SetParagraphBodyTextLevelCommand;
    }(SetParagraphLevelCommandBase));
    __aspxRichEdit.SetParagraphBodyTextLevelCommand = SetParagraphBodyTextLevelCommand;
    var SetParagraphHeading1LevelCommand = (function (_super) {
        __extends(SetParagraphHeading1LevelCommand, _super);
        function SetParagraphHeading1LevelCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetParagraphHeading1LevelCommand.prototype.getLevel = function (_parameter) { return 1; };
        return SetParagraphHeading1LevelCommand;
    }(SetParagraphLevelCommandBase));
    __aspxRichEdit.SetParagraphHeading1LevelCommand = SetParagraphHeading1LevelCommand;
    var SetParagraphHeading2LevelCommand = (function (_super) {
        __extends(SetParagraphHeading2LevelCommand, _super);
        function SetParagraphHeading2LevelCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetParagraphHeading2LevelCommand.prototype.getLevel = function (_parameter) { return 2; };
        return SetParagraphHeading2LevelCommand;
    }(SetParagraphLevelCommandBase));
    __aspxRichEdit.SetParagraphHeading2LevelCommand = SetParagraphHeading2LevelCommand;
    var SetParagraphHeading3LevelCommand = (function (_super) {
        __extends(SetParagraphHeading3LevelCommand, _super);
        function SetParagraphHeading3LevelCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetParagraphHeading3LevelCommand.prototype.getLevel = function (_parameter) { return 3; };
        return SetParagraphHeading3LevelCommand;
    }(SetParagraphLevelCommandBase));
    __aspxRichEdit.SetParagraphHeading3LevelCommand = SetParagraphHeading3LevelCommand;
    var SetParagraphHeading4LevelCommand = (function (_super) {
        __extends(SetParagraphHeading4LevelCommand, _super);
        function SetParagraphHeading4LevelCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetParagraphHeading4LevelCommand.prototype.getLevel = function (_parameter) { return 4; };
        return SetParagraphHeading4LevelCommand;
    }(SetParagraphLevelCommandBase));
    __aspxRichEdit.SetParagraphHeading4LevelCommand = SetParagraphHeading4LevelCommand;
    var SetParagraphHeading5LevelCommand = (function (_super) {
        __extends(SetParagraphHeading5LevelCommand, _super);
        function SetParagraphHeading5LevelCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetParagraphHeading5LevelCommand.prototype.getLevel = function (_parameter) { return 5; };
        return SetParagraphHeading5LevelCommand;
    }(SetParagraphLevelCommandBase));
    __aspxRichEdit.SetParagraphHeading5LevelCommand = SetParagraphHeading5LevelCommand;
    var SetParagraphHeading6LevelCommand = (function (_super) {
        __extends(SetParagraphHeading6LevelCommand, _super);
        function SetParagraphHeading6LevelCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetParagraphHeading6LevelCommand.prototype.getLevel = function (_parameter) { return 6; };
        return SetParagraphHeading6LevelCommand;
    }(SetParagraphLevelCommandBase));
    __aspxRichEdit.SetParagraphHeading6LevelCommand = SetParagraphHeading6LevelCommand;
    var SetParagraphHeading7LevelCommand = (function (_super) {
        __extends(SetParagraphHeading7LevelCommand, _super);
        function SetParagraphHeading7LevelCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetParagraphHeading7LevelCommand.prototype.getLevel = function (_parameter) { return 7; };
        return SetParagraphHeading7LevelCommand;
    }(SetParagraphLevelCommandBase));
    __aspxRichEdit.SetParagraphHeading7LevelCommand = SetParagraphHeading7LevelCommand;
    var SetParagraphHeading8LevelCommand = (function (_super) {
        __extends(SetParagraphHeading8LevelCommand, _super);
        function SetParagraphHeading8LevelCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetParagraphHeading8LevelCommand.prototype.getLevel = function (_parameter) { return 8; };
        return SetParagraphHeading8LevelCommand;
    }(SetParagraphLevelCommandBase));
    __aspxRichEdit.SetParagraphHeading8LevelCommand = SetParagraphHeading8LevelCommand;
    var SetParagraphHeading9LevelCommand = (function (_super) {
        __extends(SetParagraphHeading9LevelCommand, _super);
        function SetParagraphHeading9LevelCommand() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SetParagraphHeading9LevelCommand.prototype.getLevel = function (_parameter) { return 9; };
        return SetParagraphHeading9LevelCommand;
    }(SetParagraphLevelCommandBase));
    __aspxRichEdit.SetParagraphHeading9LevelCommand = SetParagraphHeading9LevelCommand;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var RunInfo = (function () {
            function RunInfo(runType, runLength) {
                this.runType = runType;
                this.runLength = runLength;
            }
            return RunInfo;
        }());
        HtmlImport.RunInfo = RunInfo;
        var ImportedTextRunInfo = (function (_super) {
            __extends(ImportedTextRunInfo, _super);
            function ImportedTextRunInfo(text, maskedCharacterProperties, control) {
                var _this = _super.call(this, __aspxRichEdit.RunType.TextRun, text.length) || this;
                _this.text = _this.replaceTabs(text, control, maskedCharacterProperties);
                _this.runLength = _this.text.length;
                _this.maskedCharacterProperties = maskedCharacterProperties;
                return _this;
            }
            ImportedTextRunInfo.prototype.replaceTabs = function (text, control, maskedCharacterProperties) {
                var _this = this;
                return text.replace(ImportedTextRunInfo.tabRegex, function (str, _offset) {
                    var len = str.length;
                    return len < 3 ?
                        __aspxRichEdit.StringUtils.mergeStringNTimes(__aspxRichEdit.RichUtils.specialCharacters.Space, len) :
                        __aspxRichEdit.StringUtils.mergeStringNTimes(__aspxRichEdit.RichUtils.specialCharacters.TabMark, _this.numTabs(len, _this.mergeCharProps(maskedCharacterProperties, control.model), control.measurer, control.model.defaultTabWidth));
                });
            };
            ImportedTextRunInfo.prototype.mergeCharProps = function (masked, model) {
                var merger = new __aspxRichEdit.CharacterPropertiesMerger();
                merger.mergeCharacterProperties(masked);
                merger.mergeCharacterProperties(model.defaultCharacterProperties);
                return merger.getMergedProperties();
            };
            ImportedTextRunInfo.prototype.numTabs = function (numSpaces, charProps, measurer, defaultTabInfo) {
                var spaces = __aspxRichEdit.StringUtils.mergeStringNTimes("&nbsp;", numSpaces);
                var info = new __aspxRichEdit.MeasureInfoNonText(spaces, charProps);
                measurer.measure([info]);
                return Math.max(1, Math.round(info.resultSize.width / __aspxRichEdit.UnitConverter.twipsToPixels(defaultTabInfo)));
            };
            ImportedTextRunInfo.tabRegex = new RegExp(__aspxRichEdit.RichUtils.specialCharacters.NonBreakingSpace + "{1,}", "gi");
            return ImportedTextRunInfo;
        }(RunInfo));
        HtmlImport.ImportedTextRunInfo = ImportedTextRunInfo;
        var ImportedParagraphListInfo = (function () {
            function ImportedParagraphListInfo(listIndex, listLevel, listFormat, listType, displayFormatString, maskedCharacterProperties) {
                this.listIndex = listIndex;
                this.listLevel = listLevel;
                this.listFormat = listFormat;
                this.listType = listType;
                this.displayFormatString = displayFormatString;
                this.maskedCharacterProperties = maskedCharacterProperties;
            }
            return ImportedParagraphListInfo;
        }());
        HtmlImport.ImportedParagraphListInfo = ImportedParagraphListInfo;
        var ImportedParagraphRunInfo = (function (_super) {
            __extends(ImportedParagraphRunInfo, _super);
            function ImportedParagraphRunInfo(listInfo, maskedParagraphProperties) {
                var _this = _super.call(this, __aspxRichEdit.RunType.ParagraphRun, __aspxRichEdit.RichUtils.specialCharacters.ParagraphMark.length) || this;
                _this.listInfo = listInfo;
                _this.maskedParagraphProperties = maskedParagraphProperties;
                return _this;
            }
            return ImportedParagraphRunInfo;
        }(RunInfo));
        HtmlImport.ImportedParagraphRunInfo = ImportedParagraphRunInfo;
        var ImportedInlinePictureRunInfo = (function (_super) {
            __extends(ImportedInlinePictureRunInfo, _super);
            function ImportedInlinePictureRunInfo(id, originalSize, scale, lockAspectRatio, sourceUrl, publicAPIID) {
                var _this = _super.call(this, __aspxRichEdit.RunType.InlinePictureRun, 1) || this;
                _this.id = id;
                _this.originalSize = originalSize;
                _this.scale = scale;
                _this.lockAspectRatio = lockAspectRatio;
                _this.sourceUrl = sourceUrl;
                _this.publicAPIID = publicAPIID;
                return _this;
            }
            return ImportedInlinePictureRunInfo;
        }(RunInfo));
        HtmlImport.ImportedInlinePictureRunInfo = ImportedInlinePictureRunInfo;
        var ImportedFieldCodeStartRunInfo = (function (_super) {
            __extends(ImportedFieldCodeStartRunInfo, _super);
            function ImportedFieldCodeStartRunInfo(hyperlinkInfo, id) {
                var _this = _super.call(this, __aspxRichEdit.RunType.FieldCodeStartRun, __aspxRichEdit.RichUtils.specialCharacters.FieldCodeStartRun.length) || this;
                _this.hyperlinkInfo = hyperlinkInfo;
                _this.id = id;
                return _this;
            }
            return ImportedFieldCodeStartRunInfo;
        }(RunInfo));
        HtmlImport.ImportedFieldCodeStartRunInfo = ImportedFieldCodeStartRunInfo;
        var ImportedFieldCodeEndRunInfo = (function (_super) {
            __extends(ImportedFieldCodeEndRunInfo, _super);
            function ImportedFieldCodeEndRunInfo(id) {
                var _this = _super.call(this, __aspxRichEdit.RunType.FieldCodeEndRun, __aspxRichEdit.RichUtils.specialCharacters.FieldCodeEndRun.length) || this;
                _this.id = id;
                return _this;
            }
            return ImportedFieldCodeEndRunInfo;
        }(RunInfo));
        HtmlImport.ImportedFieldCodeEndRunInfo = ImportedFieldCodeEndRunInfo;
        var ImportedFieldResultEndRunInfo = (function (_super) {
            __extends(ImportedFieldResultEndRunInfo, _super);
            function ImportedFieldResultEndRunInfo(id) {
                var _this = _super.call(this, __aspxRichEdit.RunType.FieldResultEndRun, __aspxRichEdit.RichUtils.specialCharacters.FieldResultEndRun.length) || this;
                _this.id = id;
                return _this;
            }
            return ImportedFieldResultEndRunInfo;
        }(RunInfo));
        HtmlImport.ImportedFieldResultEndRunInfo = ImportedFieldResultEndRunInfo;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var TableInfo = (function () {
            function TableInfo(width, properties, rows) {
                this.width = width;
                this.properties = properties;
                this.rows = rows;
                this.normalize();
            }
            Object.defineProperty(TableInfo.prototype, "interval", {
                get: function () {
                    return __aspxRichEdit.FixedInterval.fromPositions(this.rows[0].cells[0].startPosition, __aspxRichEdit.ListUtils.last(__aspxRichEdit.ListUtils.last(this.rows).cells).endPosition);
                },
                enumerable: true,
                configurable: true
            });
            TableInfo.prototype.normalize = function () {
                var minGridBefore = __aspxRichEdit.ListUtils.min(this.rows, function (rowA, rowB) { return rowA.gridBefore - rowB.gridBefore; }).gridBefore;
                if (minGridBefore > 0)
                    __aspxRichEdit.ListUtils.foreach(this.rows, function (row) { return row.gridBefore -= minGridBefore; });
                var minGridAfter = __aspxRichEdit.ListUtils.min(this.rows, function (rowA, rowB) { return rowA.gridAfter - rowB.gridAfter; }).gridAfter;
                if (minGridAfter > 0)
                    __aspxRichEdit.ListUtils.foreach(this.rows, function (row) { return row.gridAfter -= minGridAfter; });
                var maxCountLogicColumns = __aspxRichEdit.ListUtils.minMaxExtended(this.rows, function (row) { return row.countLogicColumns; }).maxValue;
                __aspxRichEdit.ListUtils.foreach(this.rows, function (row) {
                    var rowCountLogicColumns = row.countLogicColumns;
                    if (rowCountLogicColumns < maxCountLogicColumns) {
                        var newGridAfter = maxCountLogicColumns - rowCountLogicColumns - row.gridAfter;
                        if (newGridAfter) {
                            if (row.gridAfter == 0)
                                row.widthAfter = new __aspxRichEdit.TableWidthUnit().init(0, __aspxRichEdit.TableWidthUnitType.Auto);
                            row.gridAfter = newGridAfter;
                        }
                    }
                });
            };
            return TableInfo;
        }());
        HtmlImport.TableInfo = TableInfo;
        var ImportedTableRowInfo = (function () {
            function ImportedTableRowInfo(gridBefore, gridAfter, widthBefore, widthAfter, properties, cells) {
                this.gridBefore = gridBefore;
                this.gridAfter = gridAfter;
                this.widthBefore = widthBefore;
                this.widthAfter = widthAfter;
                this.properties = properties;
                this.cells = cells;
            }
            Object.defineProperty(ImportedTableRowInfo.prototype, "countLogicColumns", {
                get: function () {
                    return this.gridBefore + this.gridAfter + __aspxRichEdit.ListUtils.accumulate(this.cells, 0, function (acc, cell) { return acc + cell.columnSpan; });
                },
                enumerable: true,
                configurable: true
            });
            ImportedTableRowInfo.prototype.getCellByColumnSpan = function (colSpan) {
                var currSpan = this.gridBefore;
                return __aspxRichEdit.ListUtils.elementBy(this.cells, function (cell) {
                    if (new __aspxRichEdit.FixedInterval(currSpan, cell.columnSpan).contains(colSpan))
                        return true;
                    currSpan += cell.columnSpan;
                    return false;
                });
            };
            return ImportedTableRowInfo;
        }());
        HtmlImport.ImportedTableRowInfo = ImportedTableRowInfo;
        var ImportedTableCellInfo = (function () {
            function ImportedTableCellInfo(preferredWidth, startPosition, endPosition, columnSpan, rowSpan, properties, firstWhenVerticallyMerged) {
                this.preferredWidth = preferredWidth;
                this.startPosition = startPosition;
                this.endPosition = endPosition;
                this.columnSpan = columnSpan;
                this.rowSpan = rowSpan;
                this.properties = properties;
                this.firstWhenVerticallyMerged = firstWhenVerticallyMerged;
            }
            ImportedTableCellInfo.prototype.clone = function () {
                return new ImportedTableCellInfo(this.preferredWidth, -1, -1, this.columnSpan, this.rowSpan, this.properties, this.firstWhenVerticallyMerged);
            };
            return ImportedTableCellInfo;
        }());
        HtmlImport.ImportedTableCellInfo = ImportedTableCellInfo;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlATagImporter = (function (_super) {
            __extends(HtmlATagImporter, _super);
            function HtmlATagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlATagImporter.prototype.elementTag = function () {
                return "A";
            };
            HtmlATagImporter.prototype.importBefore = function () {
                var hyperlinkElement = this.element;
                var uriParts = hyperlinkElement.href.split("#");
                var hyperlinkInfo = new __aspxRichEdit.HyperlinkInfo(uriParts[0], uriParts.length > 1 ? uriParts[1] : "", hyperlinkElement.title, false);
                var codeText = [
                    " HYPERLINK \"",
                    hyperlinkInfo.uri,
                    "\" ",
                    hyperlinkInfo.tip == "" ? "" : "\\o \"" + hyperlinkInfo.tip + "\" ",
                    hyperlinkInfo.anchor == "" ? "" : "\\l \"" + hyperlinkInfo.anchor + "\" "
                ].join("");
                this.addRun(new HtmlImport.ImportedFieldCodeStartRunInfo(hyperlinkInfo, this.importer.fieldsId));
                this.addRun(new HtmlImport.ImportedTextRunInfo(codeText, this.importer.htmlImporterMaskedCharacterProperties.import(this.element, new __aspxRichEdit.FixedInterval(this.importer.currPosition, codeText.length)), this.importer.control));
                this.addRun(new HtmlImport.ImportedFieldCodeEndRunInfo(this.importer.fieldsId));
            };
            HtmlATagImporter.prototype.isImportChilds = function () {
                return true;
            };
            HtmlATagImporter.prototype.importAfter = function () {
                this.addRun(new HtmlImport.ImportedFieldResultEndRunInfo(this.importer.fieldsId));
                this.importer.fieldsId++;
            };
            HtmlATagImporter.prototype.isAllowed = function () {
                return __aspxRichEdit.ControlOptions.isEnabled(this.importer.control.options.hyperlinks);
            };
            return HtmlATagImporter;
        }(HtmlImport.HtmlTagImporterBase));
        HtmlImport.HtmlATagImporter = HtmlATagImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlBTagImporter = (function (_super) {
            __extends(HtmlBTagImporter, _super);
            function HtmlBTagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlBTagImporter.prototype.elementTag = function () {
                return "B";
            };
            HtmlBTagImporter.prototype.importBefore = function () {
            };
            HtmlBTagImporter.prototype.isImportChilds = function () {
                return true;
            };
            HtmlBTagImporter.prototype.importAfter = function () {
            };
            return HtmlBTagImporter;
        }(HtmlImport.HtmlTagImporterBase));
        HtmlImport.HtmlBTagImporter = HtmlBTagImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlBrTagImporter = (function (_super) {
            __extends(HtmlBrTagImporter, _super);
            function HtmlBrTagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlBrTagImporter.prototype.elementTag = function () {
                return "BR";
            };
            HtmlBrTagImporter.prototype.importBefore = function () {
                var breakChar = this.element.style.pageBreakBefore == "always" ?
                    __aspxRichEdit.RichUtils.specialCharacters.PageBreak :
                    __aspxRichEdit.RichUtils.specialCharacters.LineBreak;
                this.addRun(new HtmlImport.ImportedTextRunInfo(breakChar, this.importer.htmlImporterMaskedCharacterProperties.import(this.element, new __aspxRichEdit.FixedInterval(this.importer.currPosition, 1)), this.importer.control));
            };
            HtmlBrTagImporter.prototype.isImportChilds = function () {
                return false;
            };
            HtmlBrTagImporter.prototype.importAfter = function () {
            };
            return HtmlBrTagImporter;
        }(HtmlImport.HtmlTagImporterBase));
        HtmlImport.HtmlBrTagImporter = HtmlBrTagImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlCenterTagImporter = (function (_super) {
            __extends(HtmlCenterTagImporter, _super);
            function HtmlCenterTagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlCenterTagImporter.prototype.elementTag = function () {
                return "CENTER";
            };
            HtmlCenterTagImporter.prototype.importBefore = function () {
            };
            HtmlCenterTagImporter.prototype.isImportChilds = function () {
                return true;
            };
            HtmlCenterTagImporter.prototype.importAfter = function () {
            };
            return HtmlCenterTagImporter;
        }(HtmlImport.HtmlTagImporterBase));
        HtmlImport.HtmlCenterTagImporter = HtmlCenterTagImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlCiteTagImporter = (function (_super) {
            __extends(HtmlCiteTagImporter, _super);
            function HtmlCiteTagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlCiteTagImporter.prototype.elementTag = function () {
                return "CITE";
            };
            HtmlCiteTagImporter.prototype.importBefore = function () {
            };
            HtmlCiteTagImporter.prototype.isImportChilds = function () {
                return true;
            };
            HtmlCiteTagImporter.prototype.importAfter = function () {
            };
            return HtmlCiteTagImporter;
        }(HtmlImport.HtmlTagImporterBase));
        HtmlImport.HtmlCiteTagImporter = HtmlCiteTagImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlDivTagImporter = (function (_super) {
            __extends(HtmlDivTagImporter, _super);
            function HtmlDivTagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlDivTagImporter.prototype.elementTag = function () {
                return "DIV";
            };
            HtmlDivTagImporter.prototype.importBefore = function () {
                if (!this.importer.prevRunIsParagraph)
                    this.addRun(new HtmlImport.ImportedParagraphRunInfo(null, new HtmlImport.HtmlImporterMaskedParagraphProperties().import(this.colorProvider, this.element)));
            };
            HtmlDivTagImporter.prototype.isImportChilds = function () {
                return true;
            };
            HtmlDivTagImporter.prototype.importAfter = function () {
                if (!this.importer.prevRunIsParagraph)
                    this.addRun(new HtmlImport.ImportedParagraphRunInfo(null, new HtmlImport.HtmlImporterMaskedParagraphProperties().import(this.colorProvider, this.element)));
            };
            return HtmlDivTagImporter;
        }(HtmlImport.HtmlTagImporterBase));
        HtmlImport.HtmlDivTagImporter = HtmlDivTagImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlEmTagImporter = (function (_super) {
            __extends(HtmlEmTagImporter, _super);
            function HtmlEmTagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlEmTagImporter.prototype.elementTag = function () {
                return "EM";
            };
            HtmlEmTagImporter.prototype.importBefore = function () {
            };
            HtmlEmTagImporter.prototype.isImportChilds = function () {
                return true;
            };
            HtmlEmTagImporter.prototype.importAfter = function () {
            };
            return HtmlEmTagImporter;
        }(HtmlImport.HtmlTagImporterBase));
        HtmlImport.HtmlEmTagImporter = HtmlEmTagImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlFontTagImporter = (function (_super) {
            __extends(HtmlFontTagImporter, _super);
            function HtmlFontTagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlFontTagImporter.prototype.elementTag = function () {
                return "FONT";
            };
            HtmlFontTagImporter.prototype.importBefore = function () {
            };
            HtmlFontTagImporter.prototype.isImportChilds = function () {
                return true;
            };
            HtmlFontTagImporter.prototype.importAfter = function () {
            };
            return HtmlFontTagImporter;
        }(HtmlImport.HtmlTagImporterBase));
        HtmlImport.HtmlFontTagImporter = HtmlFontTagImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlITagImporter = (function (_super) {
            __extends(HtmlITagImporter, _super);
            function HtmlITagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlITagImporter.prototype.elementTag = function () {
                return "I";
            };
            HtmlITagImporter.prototype.importBefore = function () {
            };
            HtmlITagImporter.prototype.isImportChilds = function () {
                return true;
            };
            HtmlITagImporter.prototype.importAfter = function () {
            };
            return HtmlITagImporter;
        }(HtmlImport.HtmlTagImporterBase));
        HtmlImport.HtmlITagImporter = HtmlITagImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlImgTagImporter = (function (_super) {
            __extends(HtmlImgTagImporter, _super);
            function HtmlImgTagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlImgTagImporter.prototype.elementTag = function () {
                return "IMG";
            };
            HtmlImgTagImporter.prototype.importBefore = function () {
                var _this = this;
                var imageElement = this.importer.currElement;
                var imageUrl = imageElement.src;
                if (!imageUrl.match(/^file\:\/\//gi)) {
                    var originalSize_1 = new __aspxRichEdit.Size(imageElement.naturalWidth, imageElement.naturalHeight);
                    var imageSize_1 = new __aspxRichEdit.Size(imageElement.width || originalSize_1.width || 32, imageElement.height || originalSize_1.height || 32);
                    var scale_1 = __aspxRichEdit.Size.initByCommonAction(function (adp) { return adp(originalSize_1) ?
                        adp(imageSize_1) / adp(originalSize_1) * 100 :
                        Math.min(__aspxRichEdit.UnitConverter.pixelsToTwips(adp(imageSize_1)), adp(_this.importer.columnSize())) * 100; });
                    var imgId = this.importer.control.isNeedLoadPictureFromServer ?
                        this.importer.emptyImageCacheId :
                        this.importer.control.model.cache.imageCache.push(imageUrl);
                    this.addRun(new HtmlImport.ImportedInlinePictureRunInfo(imgId, __aspxRichEdit.Size.initByCommonAction(function (adp) { return adp(originalSize_1) ? __aspxRichEdit.UnitConverter.pixelsToTwips(adp(originalSize_1)) : 1; }), __aspxRichEdit.Size.initByCommonAction(function (cAdp, oppAdp) { return Math.min(cAdp(scale_1), oppAdp(scale_1)); }), false, imageUrl, -1));
                }
            };
            HtmlImgTagImporter.loadPicSize = function (textManipulator, subDocument, guid, base64) {
                var i = new Image();
                i.onload = function () {
                    textManipulator.applyImagesLoadedOnPaste(subDocument, new __aspxRichEdit.MapCreatorStringAsKey()
                        .add(guid, new __aspxRichEdit.MapCreatorNumberAsKey()
                        .add(__aspxRichEdit.JSONInlinePictureCommandsImageInfo.ImageCacheId, textManipulator.manipulator.model.cache.imageCache.push(base64))
                        .add(__aspxRichEdit.JSONInlinePictureCommandsImageInfo.OriginalWidth, __aspxRichEdit.UnitConverter.pixelsToTwips(i.width))
                        .add(__aspxRichEdit.JSONInlinePictureCommandsImageInfo.OriginalHeight, __aspxRichEdit.UnitConverter.pixelsToTwips(i.height))
                        .get())
                        .get());
                };
                i.src = base64;
            };
            HtmlImgTagImporter.prototype.isImportChilds = function () {
                return false;
            };
            HtmlImgTagImporter.prototype.importAfter = function () {
            };
            return HtmlImgTagImporter;
        }(HtmlImport.HtmlTagImporterBase));
        HtmlImport.HtmlImgTagImporter = HtmlImgTagImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlLiTagImporter = (function (_super) {
            __extends(HtmlLiTagImporter, _super);
            function HtmlLiTagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlLiTagImporter.prototype.elementTag = function () {
                return "LI";
            };
            HtmlLiTagImporter.prototype.importBefore = function () {
            };
            HtmlLiTagImporter.prototype.isImportChilds = function () {
                return true;
            };
            HtmlLiTagImporter.prototype.importAfter = function () {
            };
            return HtmlLiTagImporter;
        }(HtmlImport.HtmlTagImporterBase));
        HtmlImport.HtmlLiTagImporter = HtmlLiTagImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlOlTagImporter = (function (_super) {
            __extends(HtmlOlTagImporter, _super);
            function HtmlOlTagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlOlTagImporter.prototype.elementTag = function () {
                return "OL";
            };
            HtmlOlTagImporter.prototype.importBefore = function () {
            };
            HtmlOlTagImporter.prototype.isImportChilds = function () {
                return true;
            };
            HtmlOlTagImporter.prototype.importAfter = function () {
            };
            return HtmlOlTagImporter;
        }(HtmlImport.HtmlTagImporterBase));
        HtmlImport.HtmlOlTagImporter = HtmlOlTagImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlPTagImporter = (function (_super) {
            __extends(HtmlPTagImporter, _super);
            function HtmlPTagImporter() {
                var _this = _super !== null && _super.apply(this, arguments) || this;
                _this.listInfo = null;
                _this.importChilds = false;
                return _this;
            }
            HtmlPTagImporter.prototype.elementTag = function () {
                return "P";
            };
            HtmlPTagImporter.prototype.importBefore = function () {
                var emptyParagraphMatches = this.element.outerHTML.match(/^<([^\s >]+)(\s[^>]*)?>&nbsp;<\/\1>/gi);
                if (!(emptyParagraphMatches && emptyParagraphMatches.length)) {
                    if (REWebUtils.Str.Trim(REWebUtils.GetInnerText(this.element)))
                        this.listInfo = this.importer.paragraphListpropertiesUtils.import(this.element, new __aspxRichEdit.FixedInterval(this.importer.currPosition, 0));
                    this.importChilds = true;
                }
            };
            HtmlPTagImporter.prototype.isImportChilds = function () {
                return this.importChilds;
            };
            HtmlPTagImporter.prototype.importAfter = function () {
                this.addRun(new HtmlImport.ImportedParagraphRunInfo(this.listInfo, new HtmlImport.HtmlImporterMaskedParagraphProperties().import(this.colorProvider, this.element)));
            };
            return HtmlPTagImporter;
        }(HtmlImport.HtmlTagImporterBase));
        HtmlImport.HtmlPTagImporter = HtmlPTagImporter;
        var HtmlH1TagImporter = (function (_super) {
            __extends(HtmlH1TagImporter, _super);
            function HtmlH1TagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlH1TagImporter.prototype.elementTag = function () {
                return "H1";
            };
            return HtmlH1TagImporter;
        }(HtmlPTagImporter));
        HtmlImport.HtmlH1TagImporter = HtmlH1TagImporter;
        var HtmlH2TagImporter = (function (_super) {
            __extends(HtmlH2TagImporter, _super);
            function HtmlH2TagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlH2TagImporter.prototype.elementTag = function () {
                return "H2";
            };
            return HtmlH2TagImporter;
        }(HtmlPTagImporter));
        HtmlImport.HtmlH2TagImporter = HtmlH2TagImporter;
        var HtmlH3TagImporter = (function (_super) {
            __extends(HtmlH3TagImporter, _super);
            function HtmlH3TagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlH3TagImporter.prototype.elementTag = function () {
                return "H3";
            };
            return HtmlH3TagImporter;
        }(HtmlPTagImporter));
        HtmlImport.HtmlH3TagImporter = HtmlH3TagImporter;
        var HtmlH4TagImporter = (function (_super) {
            __extends(HtmlH4TagImporter, _super);
            function HtmlH4TagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlH4TagImporter.prototype.elementTag = function () {
                return "H4";
            };
            return HtmlH4TagImporter;
        }(HtmlPTagImporter));
        HtmlImport.HtmlH4TagImporter = HtmlH4TagImporter;
        var HtmlH5TagImporter = (function (_super) {
            __extends(HtmlH5TagImporter, _super);
            function HtmlH5TagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlH5TagImporter.prototype.elementTag = function () {
                return "H5";
            };
            return HtmlH5TagImporter;
        }(HtmlPTagImporter));
        HtmlImport.HtmlH5TagImporter = HtmlH5TagImporter;
        var HtmlH6TagImporter = (function (_super) {
            __extends(HtmlH6TagImporter, _super);
            function HtmlH6TagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlH6TagImporter.prototype.elementTag = function () {
                return "H6";
            };
            return HtmlH6TagImporter;
        }(HtmlPTagImporter));
        HtmlImport.HtmlH6TagImporter = HtmlH6TagImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlPreTagImporter = (function (_super) {
            __extends(HtmlPreTagImporter, _super);
            function HtmlPreTagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlPreTagImporter.prototype.elementTag = function () {
                return "PRE";
            };
            HtmlPreTagImporter.prototype.importBefore = function () {
            };
            HtmlPreTagImporter.prototype.isImportChilds = function () {
                return true;
            };
            HtmlPreTagImporter.prototype.importAfter = function () {
            };
            return HtmlPreTagImporter;
        }(HtmlImport.HtmlTagImporterBase));
        HtmlImport.HtmlPreTagImporter = HtmlPreTagImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlSpanTagImporter = (function (_super) {
            __extends(HtmlSpanTagImporter, _super);
            function HtmlSpanTagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlSpanTagImporter.prototype.elementTag = function () {
                return "SPAN";
            };
            HtmlSpanTagImporter.prototype.importBefore = function () {
            };
            HtmlSpanTagImporter.prototype.isImportChilds = function () {
                return true;
            };
            HtmlSpanTagImporter.prototype.importAfter = function () {
            };
            return HtmlSpanTagImporter;
        }(HtmlImport.HtmlTagImporterBase));
        HtmlImport.HtmlSpanTagImporter = HtmlSpanTagImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlTableTagImporter = (function (_super) {
            __extends(HtmlTableTagImporter, _super);
            function HtmlTableTagImporter() {
                var _this = _super !== null && _super.apply(this, arguments) || this;
                _this.rows = [];
                return _this;
            }
            HtmlTableTagImporter.prototype.elementTag = function () {
                return HtmlTableTagImporter.tagName;
            };
            HtmlTableTagImporter.prototype.importBefore = function () {
                var lastTableInfo = __aspxRichEdit.ListUtils.last(this.importer.importedTablesInfo);
                if (lastTableInfo && __aspxRichEdit.ListUtils.last(__aspxRichEdit.ListUtils.last(lastTableInfo.rows).cells).endPosition == this.importer.currPosition ||
                    !this.importer.prevRunIsParagraph)
                    this.addRun(new HtmlImport.ImportedParagraphRunInfo(null, new HtmlImport.HtmlImporterMaskedParagraphProperties().import(this.colorProvider, this.element)));
                this.element.innerHTML = this.element.innerHTML.replace(/<td([^>]*mso-cell-special:\s*placeholder[^>]*)>[\s\S]*?<\/td>/gi, "<td$1></td>");
            };
            HtmlTableTagImporter.prototype.isImportChilds = function () {
                return true;
            };
            HtmlTableTagImporter.prototype.importAfter = function () {
                if (!this.element.rows.length)
                    return;
                var tbl = new HtmlImport.TableInfo(this.getTableWidth(), this.getTableProperties(this.importer.control.model.colorProvider), this.rows);
                if (!(tbl.width.type == __aspxRichEdit.TableWidthUnitType.ModelUnits && tbl.width.value > 0))
                    if (!__aspxRichEdit.ListUtils.anyOf(this.rows, function (row) { return __aspxRichEdit.ListUtils.anyOf(row.cells, function (cell) {
                        return cell.preferredWidth.type == __aspxRichEdit.TableWidthUnitType.ModelUnits && cell.preferredWidth.value > 0;
                    }); })) {
                        tbl.width.type = __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent;
                        tbl.width.value = 100 * __aspxRichEdit.TableWidthUnit.MUTLIPLIER_FOR_PERCENTS;
                    }
                this.importer.importedTablesInfo.push(tbl);
            };
            HtmlTableTagImporter.prototype.getTableProperties = function (colorProvider) {
                var tblProps = new __aspxRichEdit.TableProperties();
                tblProps.layoutType = __aspxRichEdit.TableLayoutType.Autofit;
                tblProps.setUseValue(__aspxRichEdit.TablePropertiesMask.UseTableLayout, true);
                var tableStyle = REWebUtils.GetCurrentStyle(this.element);
                HtmlImport.HtmlImportUtils.setBorders(colorProvider, tblProps, tblProps.borders, tableStyle, __aspxRichEdit.TablePropertiesMask.UseTopBorder, __aspxRichEdit.TablePropertiesMask.UseRightBorder, __aspxRichEdit.TablePropertiesMask.UseBottomBorder, __aspxRichEdit.TablePropertiesMask.UseLeftBorder);
                var tableMarginLeft = HtmlImport.HtmlImportUtils.getTableWidthUnit(tableStyle.marginLeft);
                if (tableMarginLeft && tableMarginLeft.type != __aspxRichEdit.TableWidthUnitType.Nil) {
                    tblProps.indent = tableMarginLeft;
                    tblProps.setUseValue(__aspxRichEdit.TablePropertiesMask.UseTableIndent, true);
                }
                if (tableStyle.borderSpacing && tableStyle.borderCollapse != "collapse") {
                    var cellSpacing = HtmlImport.HtmlImportUtils.getTableWidthUnit(tableStyle.borderSpacing.split(" ")[0]);
                    if (cellSpacing && cellSpacing.type != __aspxRichEdit.TableWidthUnitType.Nil) {
                        tblProps.cellSpacing = cellSpacing;
                        tblProps.setUseValue(__aspxRichEdit.TablePropertiesMask.UseCellSpacing, true);
                    }
                }
                var tableBackgroundColor = __aspxRichEdit.ColorHelper.stringToColor(tableStyle.backgroundColor);
                if (tableBackgroundColor) {
                    tblProps.shadingInfo = __aspxRichEdit.ShadingInfo.createByColor(__aspxRichEdit.ColorModelInfo.makeByColor(tableBackgroundColor));
                    tblProps.setUseValue(__aspxRichEdit.TablePropertiesMask.UseShadingInfoIndex, true);
                }
                return tblProps;
            };
            HtmlTableTagImporter.prototype.getTableWidth = function () {
                var tableWidth = HtmlImport.HtmlImportUtils.getTableWidthUnit(this.element.style.width || REWebUtils.Attr.GetAttribute(this.element, "width"));
                if (!tableWidth) {
                    var parentCell = REWebUtils.GetParentByTagName(this.element, "TD");
                    if (parentCell)
                        tableWidth = HtmlImport.HtmlImportUtils.getTableWidthUnit(parentCell.style.width || REWebUtils.Attr.GetAttribute(parentCell, "width"));
                }
                return tableWidth ? tableWidth : new __aspxRichEdit.TableWidthUnit().init(0, __aspxRichEdit.TableWidthUnitType.Auto);
            };
            HtmlTableTagImporter.tagName = "TABLE";
            return HtmlTableTagImporter;
        }(HtmlImport.HtmlTagImporterBase));
        HtmlImport.HtmlTableTagImporter = HtmlTableTagImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlTbodyTagImporter = (function (_super) {
            __extends(HtmlTbodyTagImporter, _super);
            function HtmlTbodyTagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlTbodyTagImporter.prototype.elementTag = function () {
                return "TBODY";
            };
            HtmlTbodyTagImporter.prototype.importBefore = function () {
            };
            HtmlTbodyTagImporter.prototype.isImportChilds = function () {
                return true;
            };
            HtmlTbodyTagImporter.prototype.importAfter = function () {
            };
            return HtmlTbodyTagImporter;
        }(HtmlImport.HtmlTagImporterBase));
        HtmlImport.HtmlTbodyTagImporter = HtmlTbodyTagImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlTdTagImporter = (function (_super) {
            __extends(HtmlTdTagImporter, _super);
            function HtmlTdTagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlTdTagImporter.prototype.elementTag = function () {
                return "TD";
            };
            HtmlTdTagImporter.prototype.importBefore = function () {
                this.rowImporter = this.getClosestImporterByTagName(HtmlImport.HtmlTrTagImporter.tagName);
                HtmlTdTagImporter.addVerticalMergedCells(this.importer, this.getClosestImporterByTagName(HtmlImport.HtmlTableTagImporter.tagName), this.rowImporter);
                this.startPosition = this.importer.currPosition;
            };
            HtmlTdTagImporter.prototype.isImportChilds = function () {
                return true;
            };
            HtmlTdTagImporter.prototype.importAfter = function () {
                var cell = this.element;
                var cellWidth = HtmlImport.HtmlImportUtils.getTableWidthUnit(this.element.style.width || REWebUtils.Attr.GetAttribute(this.element, "width"));
                var preferredWidth = cellWidth ? cellWidth : new __aspxRichEdit.TableWidthUnit().init(0, __aspxRichEdit.TableWidthUnitType.Auto);
                var columnSpan = cell.colSpan > 1000 ? 1 : (cell.colSpan == 0 ? Number.MAX_VALUE : cell.colSpan);
                var rowSpan = cell.rowSpan == 0 ? Number.MAX_VALUE : cell.rowSpan;
                var cellStyle = REWebUtils.GetCurrentStyle(cell);
                var props = new __aspxRichEdit.TableCellProperties();
                this.importCellBorders(this.importer.control.model.colorProvider, props, cellStyle);
                this.importMargins(props, cellStyle);
                this.setVerticalAlign(props, cellStyle);
                this.setBackgroungColor(props, cellStyle);
                var lastImportedRun = this.importer.getLastImportedRun();
                if (!lastImportedRun || !this.importer.prevRunIsParagraph ||
                    this.importer.currPosition - lastImportedRun.runLength < this.startPosition) {
                    this.addRun(new HtmlImport.ImportedParagraphRunInfo(null, new HtmlImport.HtmlImporterMaskedParagraphProperties().import(this.colorProvider, this.element)));
                }
                this.rowImporter.cells.push(new HtmlImport.ImportedTableCellInfo(preferredWidth, this.startPosition, this.importer.currPosition, columnSpan, rowSpan, props, true));
            };
            HtmlTdTagImporter.addVerticalMergedCells = function (importer, tableImporter, rowImporter) {
                var prevRow = __aspxRichEdit.ListUtils.last(tableImporter.rows);
                if (!prevRow)
                    return;
                var currColSpan = rowImporter.gridBeforeInfo.gridBefore +
                    __aspxRichEdit.ListUtils.accumulate(rowImporter.cells, 0, function (acc, cell) { return acc + cell.columnSpan; });
                while (true) {
                    var prevRowImpCell = prevRow.getCellByColumnSpan(currColSpan);
                    if (prevRowImpCell && prevRowImpCell.rowSpan > 1) {
                        var impCell = prevRowImpCell.clone();
                        impCell.rowSpan--;
                        impCell.startPosition = importer.currPosition;
                        impCell.endPosition = importer.currPosition + 1;
                        impCell.firstWhenVerticallyMerged = false;
                        rowImporter.cells.push(impCell);
                        currColSpan += impCell.columnSpan;
                        importer.addRun(new HtmlImport.ImportedParagraphRunInfo(null, new __aspxRichEdit.MaskedParagraphProperties()));
                    }
                    else
                        break;
                }
            };
            HtmlTdTagImporter.prototype.setBackgroungColor = function (props, cellStyle) {
                var cellBackgroundColor = __aspxRichEdit.ColorHelper.stringToColor(cellStyle.backgroundColor);
                if (cellBackgroundColor) {
                    props.setUseValue(__aspxRichEdit.TableCellPropertiesMask.UseShadingInfoIndex, true);
                    props.shadingInfo = __aspxRichEdit.ShadingInfo.createByColor(__aspxRichEdit.ColorModelInfo.makeByColor(cellBackgroundColor));
                }
            };
            HtmlTdTagImporter.prototype.setVerticalAlign = function (props, cellStyle) {
                var align = HtmlTdTagImporter.verticalAlignInfo[cellStyle.verticalAlign];
                if (align !== undefined) {
                    props.verticalAlignment = align;
                    props.setUseValue(__aspxRichEdit.TableCellPropertiesMask.UseVerticalAlignment, true);
                }
            };
            HtmlTdTagImporter.prototype.importCellBorders = function (colorProvider, props, cellStyle) {
                HtmlImport.HtmlImportUtils.setBorders(colorProvider, props, props.borders, cellStyle, __aspxRichEdit.TableCellPropertiesMask.UseTopBorder, __aspxRichEdit.TableCellPropertiesMask.UseRightBorder, __aspxRichEdit.TableCellPropertiesMask.UseBottomBorder, __aspxRichEdit.TableCellPropertiesMask.UseLeftBorder);
            };
            HtmlTdTagImporter.prototype.importMargins = function (props, cellStyle) {
                this.importMargin(props, cellStyle.paddingTop, __aspxRichEdit.TableCellPropertiesMask.UseTopMargin, function (margins, value) { return margins.top = value; });
                this.importMargin(props, cellStyle.paddingRight, __aspxRichEdit.TableCellPropertiesMask.UseRightMargin, function (margins, value) { return margins.right = value; });
                this.importMargin(props, cellStyle.paddingBottom, __aspxRichEdit.TableCellPropertiesMask.UseBottomMargin, function (margins, value) { return margins.bottom = value; });
                this.importMargin(props, cellStyle.paddingLeft, __aspxRichEdit.TableCellPropertiesMask.UseLeftMargin, function (margins, value) { return margins.left = value; });
            };
            HtmlTdTagImporter.prototype.importMargin = function (props, value, mask, setMargin) {
                var margin = HtmlImport.HtmlImportUtils.getTableWidthUnit(value);
                if (margin) {
                    setMargin(props.cellMargins, margin);
                    props.setUseValue(mask, true);
                }
            };
            HtmlTdTagImporter.verticalAlignInfo = new __aspxRichEdit.MapCreatorStringAsKey()
                .add("bottom", __aspxRichEdit.TableCellVerticalAlignment.Bottom)
                .add("middle", __aspxRichEdit.TableCellVerticalAlignment.Center)
                .add("top", __aspxRichEdit.TableCellVerticalAlignment.Top)
                .get();
            return HtmlTdTagImporter;
        }(HtmlImport.HtmlTagImporterBase));
        HtmlImport.HtmlTdTagImporter = HtmlTdTagImporter;
        var HtmlThTagImporter = (function (_super) {
            __extends(HtmlThTagImporter, _super);
            function HtmlThTagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlThTagImporter.prototype.elementTag = function () {
                return "TH";
            };
            return HtmlThTagImporter;
        }(HtmlTdTagImporter));
        HtmlImport.HtmlThTagImporter = HtmlThTagImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlTextNodeImporter = (function (_super) {
            __extends(HtmlTextNodeImporter, _super);
            function HtmlTextNodeImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlTextNodeImporter.prototype.elementTag = function () {
                return "TextNode";
            };
            HtmlTextNodeImporter.prototype.importBefore = function () {
                var text = this.element.nodeValue || REWebUtils.GetInnerText(this.element);
                if (text && text.length)
                    this.addRun(new HtmlImport.ImportedTextRunInfo(text, this.importer.htmlImporterMaskedCharacterProperties.import(this.element, new __aspxRichEdit.FixedInterval(this.importer.currPosition, text.length)), this.importer.control));
            };
            HtmlTextNodeImporter.prototype.isImportChilds = function () {
                return false;
            };
            HtmlTextNodeImporter.prototype.importAfter = function () {
            };
            return HtmlTextNodeImporter;
        }(HtmlImport.HtmlTagImporterBase));
        HtmlImport.HtmlTextNodeImporter = HtmlTextNodeImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlTrTagImporter = (function (_super) {
            __extends(HtmlTrTagImporter, _super);
            function HtmlTrTagImporter() {
                var _this = _super !== null && _super.apply(this, arguments) || this;
                _this.cells = [];
                return _this;
            }
            HtmlTrTagImporter.prototype.elementTag = function () {
                return HtmlTrTagImporter.tagName;
            };
            HtmlTrTagImporter.prototype.importBefore = function () {
                this.rowElement = this.element;
                this.gridBeforeInfo = HtmlTrTagImporter.importGridBefore(this.rowElement);
            };
            HtmlTrTagImporter.prototype.isImportChilds = function () {
                return true;
            };
            HtmlTrTagImporter.prototype.importAfter = function () {
                if (this.cells.length) {
                    var tableImporter = this.getClosestImporterByTagName(HtmlImport.HtmlTableTagImporter.tagName);
                    HtmlImport.HtmlTdTagImporter.addVerticalMergedCells(this.importer, tableImporter, this);
                    var _a = HtmlTrTagImporter.importGridAfter(this.rowElement), gridAfter = _a.gridAfter, widthAfter = _a.widthAfter;
                    var props = new __aspxRichEdit.TableRowProperties();
                    tableImporter.rows.push(new HtmlImport.ImportedTableRowInfo(this.gridBeforeInfo.gridBefore, gridAfter, this.gridBeforeInfo.widthBefore, widthAfter, props, this.cells));
                }
            };
            HtmlTrTagImporter.importGridBefore = function (row) {
                var gridBefore = 0;
                var widthBefore = 0;
                var gridBeforeMatches = row.innerHTML.match(/^<td[^>]*mso-cell-special:\s*placeholder[^>]*><\/td>/gi);
                if (gridBeforeMatches && gridBeforeMatches.length) {
                    var cellBeforeColSpan = gridBeforeMatches[0].replace(/<td[^>]*colspan="(\d+)"[^>]*><\/td>/gi, "$1");
                    gridBefore = cellBeforeColSpan == gridBeforeMatches[0] ? 1 : parseInt(cellBeforeColSpan);
                    var cellBeforeWidth = gridBeforeMatches[0].replace(/<td[^>]*width="(\d+)"[^>]*><\/td>/gi, "$1");
                    widthBefore = cellBeforeWidth == gridBeforeMatches[0] ? 0 : __aspxRichEdit.UnitConverter.pixelsToTwips(parseFloat(cellBeforeWidth));
                }
                return { gridBefore: gridBefore, widthBefore: __aspxRichEdit.TableWidthUnit.create(widthBefore, __aspxRichEdit.TableWidthUnitType.ModelUnits) };
            };
            HtmlTrTagImporter.importGridAfter = function (row) {
                var gridAfter = 0;
                var widthAfter = 0;
                var gridAfterMatches = row.innerHTML.match(/<td[^>]*mso-cell-special:\s*placeholder[^>]*><\/td>$/gi);
                if (gridAfterMatches && gridAfterMatches.length) {
                    var cellAfterColSpan = gridAfterMatches[0].replace(/<td[^>]*colspan="(\d+)"[^>]*><\/td>/gi, "$1");
                    gridAfter = cellAfterColSpan == gridAfterMatches[0] ? 1 : parseInt(cellAfterColSpan);
                    var cellAfterWidth = gridAfterMatches[0].replace(/<td[^>]*width="(\d+)"[^>]*><\/td>/gi, "$1");
                    widthAfter = cellAfterWidth == gridAfterMatches[0] ? 0 : __aspxRichEdit.UnitConverter.pixelsToTwips(parseFloat(cellAfterWidth));
                }
                return { gridAfter: gridAfter, widthAfter: __aspxRichEdit.TableWidthUnit.create(widthAfter, __aspxRichEdit.TableWidthUnitType.ModelUnits) };
            };
            HtmlTrTagImporter.tagName = "TR";
            return HtmlTrTagImporter;
        }(HtmlImport.HtmlTagImporterBase));
        HtmlImport.HtmlTrTagImporter = HtmlTrTagImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlTtTagImporter = (function (_super) {
            __extends(HtmlTtTagImporter, _super);
            function HtmlTtTagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlTtTagImporter.prototype.elementTag = function () {
                return "TT";
            };
            HtmlTtTagImporter.prototype.importBefore = function () {
            };
            HtmlTtTagImporter.prototype.isImportChilds = function () {
                return true;
            };
            HtmlTtTagImporter.prototype.importAfter = function () {
            };
            return HtmlTtTagImporter;
        }(HtmlImport.HtmlTagImporterBase));
        HtmlImport.HtmlTtTagImporter = HtmlTtTagImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlUlTagImporter = (function (_super) {
            __extends(HtmlUlTagImporter, _super);
            function HtmlUlTagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlUlTagImporter.prototype.elementTag = function () {
                return "UL";
            };
            HtmlUlTagImporter.prototype.importBefore = function () {
            };
            HtmlUlTagImporter.prototype.isImportChilds = function () {
                return true;
            };
            HtmlUlTagImporter.prototype.importAfter = function () {
            };
            return HtmlUlTagImporter;
        }(HtmlImport.HtmlTagImporterBase));
        HtmlImport.HtmlUlTagImporter = HtmlUlTagImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlUndefinedTagImporter = (function (_super) {
            __extends(HtmlUndefinedTagImporter, _super);
            function HtmlUndefinedTagImporter() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            HtmlUndefinedTagImporter.prototype.elementTag = function () {
                return "NoTag";
            };
            HtmlUndefinedTagImporter.prototype.importBefore = function () {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.HtmlImporter, "HtmlUndefinedTagImporter.importBefore undefined tag", this.element);
            };
            HtmlUndefinedTagImporter.prototype.isImportChilds = function () {
                return !!this.importer.currElementChilds.length;
            };
            HtmlUndefinedTagImporter.prototype.importAfter = function () {
            };
            return HtmlUndefinedTagImporter;
        }(HtmlImport.HtmlTagImporterBase));
        HtmlImport.HtmlUndefinedTagImporter = HtmlUndefinedTagImporter;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlImporterMaskedCharacterProperties = (function () {
            function HtmlImporterMaskedCharacterProperties(control, loadFontInfos, tempFontInfoCache) {
                this.control = control;
                this.loadFontInfos = loadFontInfos;
                this.tempFontInfoCache = tempFontInfoCache;
            }
            HtmlImporterMaskedCharacterProperties.prototype.import = function (element, interval) {
                this.result = this.control.inputPosition.getMaskedCharacterProperties().clone();
                this.styledElement = __aspxRichEdit.HTMLUtils.isHTMLElementNode(element) ? element : (element.parentElement || element.parentNode);
                this.currentStyle = REWebUtils.GetCurrentStyle(this.styledElement);
                if (!this.currentStyle)
                    return this.result;
                this.importFontBold();
                this.importFontItalic();
                this.importAllCaps();
                this.importStrikeoutType();
                this.importUnderlineType();
                this.importForeColor();
                this.importBackColor();
                this.importFontInfo(interval);
                this.importFontSize();
                this.importHidden();
                this.importSuperscript();
                this.importSubscript();
                return this.result;
            };
            HtmlImporterMaskedCharacterProperties.prototype.importFontBold = function () {
                switch (this.currentStyle.fontWeight) {
                    case "bold":
                    case "700":
                        this.result.fontBold = true;
                        this.result.setUseValue(__aspxRichEdit.CharacterPropertiesMask.UseFontBold, true);
                }
            };
            HtmlImporterMaskedCharacterProperties.prototype.importFontItalic = function () {
                if (this.currentStyle.fontStyle == "italic") {
                    this.result.fontItalic = true;
                    this.result.setUseValue(__aspxRichEdit.CharacterPropertiesMask.UseFontItalic, true);
                }
            };
            HtmlImporterMaskedCharacterProperties.prototype.importAllCaps = function () {
                if (this.currentStyle.textTransform == "uppercase") {
                    this.result.allCaps = true;
                    this.result.setUseValue(__aspxRichEdit.CharacterPropertiesMask.UseAllCaps, true);
                }
            };
            HtmlImporterMaskedCharacterProperties.prototype.importStrikeoutType = function () {
                if (this.currentStyle.textDecoration == "line-through") {
                    this.result.fontStrikeoutType = __aspxRichEdit.StrikeoutType.Single;
                    this.result.setUseValue(__aspxRichEdit.CharacterPropertiesMask.UseFontStrikeoutType, true);
                }
            };
            HtmlImporterMaskedCharacterProperties.prototype.importUnderlineType = function () {
                if (/.*underline.*/gi.test(this.currentStyle.textDecoration)) {
                    this.result.fontUnderlineType = __aspxRichEdit.UnderlineType.Single;
                    this.result.setUseValue(__aspxRichEdit.CharacterPropertiesMask.UseFontUnderlineType, true);
                }
                else {
                    this.result.fontUnderlineType = HtmlImport.HtmlImportUtils.getPropertyByMap(HtmlImporterMaskedCharacterProperties.MapUnderlineStyleToType, this.currentStyle.borderBottomStyle, this.result.fontUnderlineType);
                    this.result.setUseValue(__aspxRichEdit.CharacterPropertiesMask.UseFontUnderlineType, true);
                }
            };
            HtmlImporterMaskedCharacterProperties.prototype.importForeColor = function () {
                if (this.styledElement.style.color !== "") {
                    var foreColor = __aspxRichEdit.ColorHelper.stringToColor(this.currentStyle.color);
                    if (foreColor != null) {
                        this.result.textColor = __aspxRichEdit.ColorModelInfo.makeByColor(foreColor);
                        this.result.setUseValue(__aspxRichEdit.CharacterPropertiesMask.UseForeColorIndex, true);
                    }
                }
            };
            HtmlImporterMaskedCharacterProperties.prototype.importBackColor = function () {
                if (this.styledElement.style.backgroundColor !== "") {
                    var backColor = __aspxRichEdit.ColorHelper.stringToColor(this.currentStyle.backgroundColor);
                    if (backColor) {
                        this.result.shadingInfo = __aspxRichEdit.ShadingInfo.createByColor(__aspxRichEdit.ColorModelInfo.makeByColor(backColor));
                        this.result.setUseValue(__aspxRichEdit.CharacterPropertiesMask.UseShadingInfoIndex, true);
                        this.result.setUseValue(__aspxRichEdit.CharacterPropertiesMask.UseHighlightColorIndex, false);
                    }
                }
            };
            HtmlImporterMaskedCharacterProperties.prototype.importFontInfo = function (interval) {
                if (this.styledElement.style.fontFamily) {
                    var fontFamily = this.currentStyle.fontFamily.replace(/"/g, "'").replace(/,(\S)/g, ", $1");
                    var fontInfo = HtmlImport.HtmlImporterFontUtils.getFontInfo(this.control.model.cache.fontInfoCache, fontFamily);
                    if (!fontInfo) {
                        if (__aspxRichEdit.ControlOptions.isEnabled(this.control.options.characterFormatting)) {
                            var fontName = fontFamily.replace(/'/g, "");
                            fontInfo = this.tempFontInfoCache.getItemByName(fontName);
                            if (!fontInfo) {
                                fontInfo = this.control.inputPosition.getMergedCharacterPropertiesFull().fontInfo.clone();
                                fontInfo.name = fontName;
                                fontInfo.cssString = fontFamily;
                                this.tempFontInfoCache.getItem(fontInfo);
                            }
                            this.loadFontInfos.push(new HtmlImport.LoadFontInfo(fontInfo, this.control.model.activeSubDocument, interval));
                        }
                        else
                            fontInfo = this.control.model.defaultCharacterProperties.fontInfo;
                    }
                    this.result.fontInfo = fontInfo;
                    this.result.setUseValue(__aspxRichEdit.CharacterPropertiesMask.UseFontName, true);
                }
            };
            HtmlImporterMaskedCharacterProperties.prototype.importFontSize = function () {
                if (this.styledElement.style.fontSize) {
                    var parentCurrentStyle = REWebUtils.GetCurrentStyle(this.styledElement.parentElement || this.styledElement.parentNode);
                    var fontSize = HtmlImport.HtmlImporterFontUtils.getFontSize(this.currentStyle.fontSize, parentCurrentStyle ? parentCurrentStyle.fontSize : null);
                    if (fontSize != null && fontSize > 0) {
                        this.result.fontSize = fontSize;
                        this.result.setUseValue(__aspxRichEdit.CharacterPropertiesMask.UseDoubleFontSize, true);
                    }
                }
            };
            HtmlImporterMaskedCharacterProperties.prototype.importHidden = function () {
                if (this.currentStyle.display == "none") {
                    this.result.hidden = true;
                    this.result.setUseValue(__aspxRichEdit.CharacterPropertiesMask.UseHidden, true);
                }
            };
            HtmlImporterMaskedCharacterProperties.prototype.importSuperscript = function () {
                if (this.currentStyle.verticalAlign == "super") {
                    this.result.script = __aspxRichEdit.CharacterFormattingScript.Superscript;
                    this.result.setUseValue(__aspxRichEdit.CharacterPropertiesMask.UseScript, true);
                }
            };
            HtmlImporterMaskedCharacterProperties.prototype.importSubscript = function () {
                if (this.currentStyle.verticalAlign == "sub") {
                    this.result.script = __aspxRichEdit.CharacterFormattingScript.Subscript;
                    this.result.setUseValue(__aspxRichEdit.CharacterPropertiesMask.UseScript, true);
                }
            };
            HtmlImporterMaskedCharacterProperties.MapUnderlineStyleToType = new __aspxRichEdit.MapCreatorStringAsKey()
                .add("solid", __aspxRichEdit.UnderlineType.Single)
                .add("dashed", __aspxRichEdit.UnderlineType.Dashed)
                .add("dotted", __aspxRichEdit.UnderlineType.Dotted)
                .add("double", __aspxRichEdit.UnderlineType.Double)
                .get();
            return HtmlImporterMaskedCharacterProperties;
        }());
        HtmlImport.HtmlImporterMaskedCharacterProperties = HtmlImporterMaskedCharacterProperties;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlImporterFontUtils = (function () {
            function HtmlImporterFontUtils() {
            }
            HtmlImporterFontUtils.getFontInfo = function (fontInfoCache, fontFamily) {
                var exactlyFontInfo = fontInfoCache.findItemByPredicate(function (fontInfo) { return fontInfo.cssString == fontFamily; });
                if (exactlyFontInfo)
                    return exactlyFontInfo;
                var importFontInfos = __aspxRichEdit.ListUtils.map(fontFamily.split(","), function (val) { return new HtmlImportUtilsFontInfo(val); });
                return fontInfoCache.findItemByPredicate(function (fontInfo) {
                    var fontInfoCssString = fontInfo.cssString;
                    return __aspxRichEdit.ListUtils.anyOf(importFontInfos, function (importFontInfo) {
                        var fontPosition = fontInfoCssString.indexOf(importFontInfo.correctedFontName);
                        return (fontPosition == 0 || fontPosition == 1 && fontInfoCssString[0] == "'") &&
                            (!importFontInfo.isGenericFontFamily || __aspxRichEdit.StringUtils.endsAt(fontInfoCssString, importFontInfo.fontName));
                    });
                });
            };
            HtmlImporterFontUtils.getFontSize = function (font, parentFont) {
                var fontSize = HtmlImporterFontUtils.getFontSizeCore(font);
                if (fontSize !== null)
                    return fontSize;
                var parentFontSize = HtmlImporterFontUtils.getFontSizeCore(parentFont);
                var currentFontSize = parentFontSize !== null ? parentFontSize : 12;
                if (font.indexOf("em") > 0)
                    return parseInt(font) * currentFontSize;
                if (font.indexOf("%") > 0)
                    return parseInt(font) * currentFontSize / 100;
                return null;
            };
            HtmlImporterFontUtils.getFontSizeCore = function (font) {
                if (!font)
                    return null;
                if (font.indexOf("px") > 0)
                    return __aspxRichEdit.UnitConverter.pixelsToPoints(parseInt(font));
                if (font.indexOf("pt") > 0)
                    return parseInt(font);
            };
            return HtmlImporterFontUtils;
        }());
        HtmlImport.HtmlImporterFontUtils = HtmlImporterFontUtils;
        var HtmlImportUtilsFontInfo = (function () {
            function HtmlImportUtilsFontInfo(fontName) {
                this.fontName = __aspxRichEdit.StringUtils.stringTrim(fontName).replace(/'/g, "");
                this.correctedFontName = HtmlImportUtilsFontInfo.CssStringToFontName[this.fontName];
                if (this.correctedFontName)
                    this.isGenericFontFamily = true;
                else {
                    this.isGenericFontFamily = false;
                    this.correctedFontName = this.fontName;
                }
            }
            HtmlImportUtilsFontInfo.CssStringToFontName = new __aspxRichEdit.MapCreatorStringAsKey()
                .add("serif", "'Times New Roman'")
                .add("sans-serif", "Arial")
                .add("cursive", "'Comic Sans MS'")
                .add("fantasy", "'Comic Sans MS'")
                .add("monospace", "'Courier New'")
                .get();
            return HtmlImportUtilsFontInfo;
        }());
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var ParagraphListPropertiesUtils = (function () {
            function ParagraphListPropertiesUtils(htmlImporterMaskedCharacterProperties) {
                this.htmlImporterMaskedCharacterProperties = htmlImporterMaskedCharacterProperties;
            }
            ParagraphListPropertiesUtils.prototype.import = function (element, interval) {
                this.listItemElement = REWebUtils.GetParentByTagName(element, "LI");
                this.msoListAttr = element.outerHTML.match(/mso-list:\s*\w*\s*level[^ ]/gi);
                if (!this.listItemElement && !this.msoListAttr)
                    return null;
                this.parentListElement = this.listItemElement ? ParagraphListPropertiesUtils.getParentListElement(this.listItemElement) : null;
                var listIndex = this.importListIndex();
                var listLevelIndex = this.importListLevelIndex();
                var listFormat;
                var displayFormatString;
                var maskedCharacterProperties;
                if (this.listItemElement) {
                    if (!this.parentListElement)
                        return null;
                    listFormat = this.importListFormatByListItemElement();
                    displayFormatString = this.importDisplayFormatStringByParentListElement(listFormat, listLevelIndex);
                    maskedCharacterProperties = null;
                }
                else {
                    var listTextElement = ParagraphListPropertiesUtils.getListTextElement(element);
                    var listText = ParagraphListPropertiesUtils.getListText(listTextElement);
                    listFormat = ParagraphListPropertiesUtils.importListFormatByReserveWay(listText);
                    displayFormatString = ParagraphListPropertiesUtils.importDisplayFormatStringByReserveWay(listFormat, listLevelIndex, listText);
                    maskedCharacterProperties = this.htmlImporterMaskedCharacterProperties.import(listTextElement, interval);
                    ParagraphListPropertiesUtils.removeSomeHtml(element, listTextElement, listText);
                }
                return new HtmlImport.ImportedParagraphListInfo(listIndex, listLevelIndex, listFormat, listFormat == __aspxRichEdit.NumberingFormat.Bullet ? __aspxRichEdit.NumberingType.Bullet : __aspxRichEdit.NumberingType.MultiLevel, displayFormatString, maskedCharacterProperties);
            };
            ParagraphListPropertiesUtils.prototype.importListIndex = function () {
                if (this.msoListAttr && this.msoListAttr.length)
                    return parseInt(this.msoListAttr[0].replace(/mso-list:\s*[A-Za-z]*(\d*)[\s\S]*/gi, '$1'));
                var mainParentListElement = this.getMainParentListElement();
                if (!mainParentListElement)
                    return 0;
                var lists = REWebUtils.GetChildNodes(mainParentListElement.parentNode, function (e) {
                    return e.tagName == "UL" || e.tagName == "OL";
                });
                return __aspxRichEdit.ListUtils.accumulate(lists, 0, function (acc, list, index) {
                    return acc + (list == mainParentListElement ? index : 0);
                });
            };
            ParagraphListPropertiesUtils.prototype.importListLevelIndex = function () {
                if (this.msoListAttr && this.msoListAttr.length)
                    return parseInt(this.msoListAttr[0].replace(/mso-list:\s*\w*\s*level/gi, '')) - 1;
                var listLevelIndex = 0;
                var parentListItemElement = this.parentListElement ? REWebUtils.GetParentByTagName(this.parentListElement, "LI") : null;
                while (parentListItemElement) {
                    listLevelIndex++;
                    parentListItemElement = REWebUtils.GetParentByTagName(parentListItemElement.parentNode, "LI");
                }
                return listLevelIndex;
            };
            ParagraphListPropertiesUtils.prototype.importListFormatByListItemElement = function () {
                return ParagraphListPropertiesUtils.getListType(this.parentListElement);
            };
            ParagraphListPropertiesUtils.importListFormatByReserveWay = function (listText) {
                if (!listText)
                    return __aspxRichEdit.NumberingFormat.None;
                var encodedIndexText = encodeURI(listText);
                if (listText == "o" || encodedIndexText.indexOf("%B7") > -1 || encodedIndexText.indexOf("%A7") > -1)
                    return __aspxRichEdit.NumberingFormat.Bullet;
                if (/^(IX|IV|V?I{1,3})/.test(listText))
                    return __aspxRichEdit.NumberingFormat.UpperRoman;
                if (/^(ix|iv|v?i{1,3})/.test(listText))
                    return __aspxRichEdit.NumberingFormat.LowerRoman;
                if (/[0-9]/.test(listText))
                    return __aspxRichEdit.NumberingFormat.Decimal;
                if (/[a-z]/.test(listText))
                    return __aspxRichEdit.NumberingFormat.LowerLetter;
                if (/[A-Z]/.test(listText))
                    return __aspxRichEdit.NumberingFormat.UpperLetter;
                return __aspxRichEdit.NumberingFormat.None;
            };
            ParagraphListPropertiesUtils.prototype.importDisplayFormatStringByParentListElement = function (listFormat, listLevelIndex) {
                var listElementParentList = ParagraphListPropertiesUtils.getParentListElement(this.parentListElement.parentNode);
                if (listElementParentList) {
                    var parentListFormat = ParagraphListPropertiesUtils.getListType(listElementParentList);
                    if (listFormat != parentListFormat)
                        return "{" + listLevelIndex + "}";
                }
                return "";
            };
            ParagraphListPropertiesUtils.importDisplayFormatStringByReserveWay = function (listFormat, listLevelIndex, listText) {
                if (listFormat == __aspxRichEdit.NumberingFormat.Bullet)
                    return "";
                if (listText.indexOf(".") > -1)
                    return __aspxRichEdit.ListUtils.accumulate(listText.split("."), "", function (acc, listItem, listIndex) {
                        return listItem ? "{" + (listLevelIndex - listIndex) + "}." + acc : acc;
                    });
                var matches = listText.match(/^(\W?)(\w+)(\W?)/);
                return matches && matches.length > 2 ? matches[1] + "{" + listLevelIndex + "}" + matches[3] : listText.charAt(0);
            };
            ParagraphListPropertiesUtils.prototype.getMainParentListElement = function () {
                var listElement = this.parentListElement ? this.parentListElement : null;
                var mainParentListElement = null;
                while (listElement) {
                    mainParentListElement = listElement;
                    listElement = ParagraphListPropertiesUtils.getParentListElement(listElement.parentNode);
                }
                return mainParentListElement;
            };
            ParagraphListPropertiesUtils.getListType = function (listElement) {
                return HtmlImport.HtmlImportUtils.getPropertyByMap(ParagraphListPropertiesUtils.MapListTypeToType, REWebUtils.GetCurrentStyle(listElement).listStyleType, __aspxRichEdit.NumberingFormat.None);
            };
            ParagraphListPropertiesUtils.getListTextElement = function (element) {
                var ignoreElements = REWebUtils.GetNodes(element, function (e) { return e.outerHTML.match(/mso-list:Ignore/gi) != null; });
                var listTextElement = ignoreElements.length ? ignoreElements[0] : null;
                if (!listTextElement) {
                    var whiteSpacesOnlyTextElements = REWebUtils.GetNodes(element, function (e) {
                        return __aspxRichEdit.HTMLUtils.isTextNode(e) && e.nodeValue && !REWebUtils.Str.Trim(e.nodeValue) ||
                            e.textContent && !REWebUtils.Str.Trim(e.textContent) ||
                            e.innerText && !REWebUtils.Str.Trim(e.innerText);
                    });
                    listTextElement = whiteSpacesOnlyTextElements.length ? whiteSpacesOnlyTextElements[0].previousSibling : (element.firstChild);
                }
                return listTextElement;
            };
            ParagraphListPropertiesUtils.getListText = function (listTextElement) {
                return listTextElement ? REWebUtils.Str.Trim((listTextElement.nodeValue || REWebUtils.GetInnerText(listTextElement))).split(" ")[0] : "";
            };
            ParagraphListPropertiesUtils.getParentListElement = function (childElement) {
                return REWebUtils.GetParentByTagName(childElement, "UL") || REWebUtils.GetParentByTagName(childElement, "OL");
            };
            ParagraphListPropertiesUtils.removeSomeHtml = function (element, listTextElement, listText) {
                if (element.childNodes.length == 1)
                    element.innerHTML = REWebUtils.Str.TrimStart(element.innerHTML.replace(listText, ''));
                else {
                    var listTextElementParent = listTextElement.parentNode;
                    listTextElementParent.removeChild(listTextElement);
                    listTextElementParent.innerHTML = listTextElementParent.innerHTML.replace(/^<([^\s>]+)(\s[^>]*)?>(\s|&nbsp;){2,}<\/\1>/g, '');
                    if (listTextElement.parentNode != element)
                        element.innerHTML = element.innerHTML.replace(/<([^\s>]+)(\s[^>]*)?><\/\1>/g, '');
                }
            };
            ParagraphListPropertiesUtils.MapListTypeToType = new __aspxRichEdit.MapCreatorStringAsKey()
                .add("decimal", __aspxRichEdit.NumberingFormat.Decimal)
                .add("circle", __aspxRichEdit.NumberingFormat.Bullet)
                .add("disc", __aspxRichEdit.NumberingFormat.Bullet)
                .add("square", __aspxRichEdit.NumberingFormat.Bullet)
                .add("lower-alpha", __aspxRichEdit.NumberingFormat.LowerLetter)
                .add("lower-latin", __aspxRichEdit.NumberingFormat.LowerLetter)
                .add("upper-alpha", __aspxRichEdit.NumberingFormat.UpperLetter)
                .add("upper-latin", __aspxRichEdit.NumberingFormat.UpperLetter)
                .add("lower-roman", __aspxRichEdit.NumberingFormat.LowerRoman)
                .add("upper-roman", __aspxRichEdit.NumberingFormat.UpperRoman)
                .get();
            return ParagraphListPropertiesUtils;
        }());
        HtmlImport.ParagraphListPropertiesUtils = ParagraphListPropertiesUtils;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlImporterMaskedParagraphProperties = (function () {
            function HtmlImporterMaskedParagraphProperties() {
            }
            HtmlImporterMaskedParagraphProperties.prototype.import = function (colorProvider, element) {
                this.result = new __aspxRichEdit.MaskedParagraphProperties();
                this.element = element;
                this.elementStyle = element.style;
                var calculatedStyle = REWebUtils.GetCurrentStyle(element);
                this.importAlignment();
                this.importFirstLineIndent();
                this.importLeftIndent();
                this.importRightIndent();
                this.importLineSpacing();
                this.importSpacingBefore();
                this.importSpacingAfter();
                this.importTopBorder(colorProvider, calculatedStyle);
                this.importRightBorder(colorProvider, calculatedStyle);
                this.importBottomBorder(colorProvider, calculatedStyle);
                this.importLeftBorder(colorProvider, calculatedStyle);
                return this.result;
            };
            HtmlImporterMaskedParagraphProperties.prototype.importAlignment = function () {
                var textAlign = this.elementStyle.textAlign;
                if (!textAlign || !textAlign.length) {
                    var parentCell = REWebUtils.GetParentByTagName(this.element, "TD");
                    if (parentCell)
                        textAlign = REWebUtils.Attr.GetAttribute(parentCell, "align");
                }
                this.result.alignment = HtmlImport.HtmlImportUtils.getPropertyByMap(HtmlImporterMaskedParagraphProperties.MapAlignmentToType, textAlign, __aspxRichEdit.ParagraphAlignment.Left);
                this.result.setUseValue(__aspxRichEdit.ParagraphPropertiesMask.UseAlignment, this.result.alignment != __aspxRichEdit.ParagraphAlignment.Left);
            };
            HtmlImporterMaskedParagraphProperties.prototype.importFirstLineIndent = function () {
                var firstLineIndent = HtmlImport.HtmlImportUtils.getValueInTwips(this.elementStyle.textIndent);
                if (firstLineIndent != null && firstLineIndent != 0) {
                    this.result.firstLineIndentType = firstLineIndent > 0 ? __aspxRichEdit.ParagraphFirstLineIndent.Indented : __aspxRichEdit.ParagraphFirstLineIndent.Hanging;
                    this.result.firstLineIndent = Math.abs(firstLineIndent);
                    this.result.setUseValue(__aspxRichEdit.ParagraphPropertiesMask.UseFirstLineIndent, true);
                }
            };
            HtmlImporterMaskedParagraphProperties.prototype.importLeftIndent = function () {
                var leftIndent = HtmlImport.HtmlImportUtils.getValueInTwips(this.elementStyle.marginLeft);
                if (leftIndent != null && leftIndent >= 0) {
                    this.result.leftIndent = leftIndent;
                    this.result.setUseValue(__aspxRichEdit.ParagraphPropertiesMask.UseLeftIndent, true);
                }
            };
            HtmlImporterMaskedParagraphProperties.prototype.importRightIndent = function () {
                var rightIndent = HtmlImport.HtmlImportUtils.getValueInTwips(this.elementStyle.marginRight);
                if (rightIndent != null && rightIndent >= 0) {
                    this.result.rightIndent = rightIndent;
                    this.result.setUseValue(__aspxRichEdit.ParagraphPropertiesMask.UseRightIndent, true);
                }
            };
            HtmlImporterMaskedParagraphProperties.prototype.importSpacingBefore = function () {
                var spacingBefore = HtmlImport.HtmlImportUtils.getValueInTwips(this.elementStyle.marginTop);
                if (spacingBefore != null && spacingBefore >= 0) {
                    this.result.spacingBefore = spacingBefore;
                    this.result.setUseValue(__aspxRichEdit.ParagraphPropertiesMask.UseSpacingBefore, true);
                }
            };
            HtmlImporterMaskedParagraphProperties.prototype.importSpacingAfter = function () {
                var spacingAfter = HtmlImport.HtmlImportUtils.getValueInTwips(this.elementStyle.marginBottom);
                if (spacingAfter != null && spacingAfter >= 0) {
                    this.result.spacingAfter = spacingAfter;
                    this.result.setUseValue(__aspxRichEdit.ParagraphPropertiesMask.UseSpacingAfter, true);
                }
            };
            HtmlImporterMaskedParagraphProperties.prototype.importLineSpacing = function () {
                this.result.setUseValue(__aspxRichEdit.ParagraphPropertiesMask.UseLineSpacing, true);
                this.result.setUseValue(__aspxRichEdit.ParagraphPropertiesMask.UseBeforeAutoSpacing, true);
                this.result.setUseValue(__aspxRichEdit.ParagraphPropertiesMask.UseAfterAutoSpacing, true);
                var stringLineHeight = this.elementStyle.lineHeight;
                var height = HtmlImport.HtmlImportUtils.getTableWidthUnit(stringLineHeight);
                if (height == null) {
                    this.setSpacingAsMultiple(parseFloat(stringLineHeight));
                    return;
                }
                switch (height.type) {
                    case __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent:
                        this.setSpacingAsMultiple(height.value / __aspxRichEdit.TableWidthUnit.MAX_PERCENT_WIDTH);
                        break;
                    case __aspxRichEdit.TableWidthUnitType.ModelUnits:
                        this.result.lineSpacing = height.value;
                        this.result.lineSpacingType = this.elementStyle["mso-line-height-rule"] == "exactly" ?
                            __aspxRichEdit.ParagraphLineSpacingType.Exactly :
                            __aspxRichEdit.ParagraphLineSpacingType.AtLeast;
                        break;
                    case __aspxRichEdit.TableWidthUnitType.Nil:
                    case __aspxRichEdit.TableWidthUnitType.Auto:
                        break;
                    default: throw new Error(__aspxRichEdit.Errors.InternalException);
                }
            };
            HtmlImporterMaskedParagraphProperties.prototype.setSpacingAsMultiple = function (multipleValue) {
                if (!multipleValue || isNaN(multipleValue))
                    return;
                this.result.lineSpacing = multipleValue;
                this.result.lineSpacingType =
                    __aspxRichEdit.Utils.numberCloseTo(multipleValue, 1.5) ? __aspxRichEdit.ParagraphLineSpacingType.Sesquialteral :
                        (__aspxRichEdit.Utils.numberCloseTo(multipleValue, 2) ? __aspxRichEdit.ParagraphLineSpacingType.Double :
                            (__aspxRichEdit.Utils.numberCloseTo(multipleValue, 1) ? __aspxRichEdit.ParagraphLineSpacingType.Single :
                                __aspxRichEdit.ParagraphLineSpacingType.Multiple));
            };
            HtmlImporterMaskedParagraphProperties.prototype.importTopBorder = function (colorProvider, calculatedStyle) {
                var borderTopInfo = HtmlImport.HtmlImportUtils.getBorderInfo(colorProvider, calculatedStyle.borderTopWidth, calculatedStyle.borderTopStyle, calculatedStyle.borderTopColor);
                if (borderTopInfo) {
                    this.result.topBorder.copyFrom(borderTopInfo);
                    this.result.setUseValue(__aspxRichEdit.ParagraphPropertiesMask.UseTopBorder, borderTopInfo.style != __aspxRichEdit.BorderLineStyle.None);
                }
            };
            HtmlImporterMaskedParagraphProperties.prototype.importRightBorder = function (colorProvider, calculatedStyle) {
                var borderRightInfo = HtmlImport.HtmlImportUtils.getBorderInfo(colorProvider, calculatedStyle.borderRightWidth, calculatedStyle.borderRightStyle, calculatedStyle.borderRightColor);
                if (borderRightInfo) {
                    this.result.rightBorder.copyFrom(borderRightInfo);
                    this.result.setUseValue(__aspxRichEdit.ParagraphPropertiesMask.UseRightBorder, borderRightInfo.style != __aspxRichEdit.BorderLineStyle.None);
                }
            };
            HtmlImporterMaskedParagraphProperties.prototype.importBottomBorder = function (colorProvider, calculatedStyle) {
                var borderBottomInfo = HtmlImport.HtmlImportUtils.getBorderInfo(colorProvider, calculatedStyle.borderBottomWidth, calculatedStyle.borderBottomStyle, calculatedStyle.borderBottomColor);
                if (borderBottomInfo) {
                    this.result.bottomBorder.copyFrom(borderBottomInfo);
                    this.result.setUseValue(__aspxRichEdit.ParagraphPropertiesMask.UseBottomBorder, borderBottomInfo.style != __aspxRichEdit.BorderLineStyle.None);
                }
            };
            HtmlImporterMaskedParagraphProperties.prototype.importLeftBorder = function (colorProvider, calculatedStyle) {
                var borderLeftInfo = HtmlImport.HtmlImportUtils.getBorderInfo(colorProvider, calculatedStyle.borderLeftWidth, calculatedStyle.borderLeftStyle, calculatedStyle.borderLeftColor);
                if (borderLeftInfo) {
                    this.result.leftBorder.copyFrom(borderLeftInfo);
                    this.result.setUseValue(__aspxRichEdit.ParagraphPropertiesMask.UseLeftBorder, borderLeftInfo.style != __aspxRichEdit.BorderLineStyle.None);
                }
            };
            HtmlImporterMaskedParagraphProperties.MapAlignmentToType = new __aspxRichEdit.MapCreatorStringAsKey()
                .add("right", __aspxRichEdit.ParagraphAlignment.Right)
                .add("justify", __aspxRichEdit.ParagraphAlignment.Justify)
                .add("center", __aspxRichEdit.ParagraphAlignment.Center)
                .get();
            return HtmlImporterMaskedParagraphProperties;
        }());
        HtmlImport.HtmlImporterMaskedParagraphProperties = HtmlImporterMaskedParagraphProperties;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var HtmlImportUtils = (function () {
            function HtmlImportUtils() {
            }
            HtmlImportUtils.getTableWidthUnit = function (stringValue) {
                if (!stringValue)
                    return null;
                var unitTypeMatches = stringValue.match(/(px|in|cm|mm|pt|pc|em|ex|%)/g);
                var unitType = unitTypeMatches ? unitTypeMatches[0] : "px";
                var numberValue = parseFloat(stringValue.replace(unitType, ''));
                if (isNaN(numberValue))
                    return null;
                switch (unitType) {
                    case "%":
                        return new __aspxRichEdit.TableWidthUnit().init(numberValue * __aspxRichEdit.TableWidthUnit.MUTLIPLIER_FOR_PERCENTS, __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent);
                    case "px":
                        return new __aspxRichEdit.TableWidthUnit().init(__aspxRichEdit.UnitConverter.pixelsToTwips(numberValue), __aspxRichEdit.TableWidthUnitType.ModelUnits);
                    case "in":
                        return new __aspxRichEdit.TableWidthUnit().init(__aspxRichEdit.UnitConverter.inchesToTwips(numberValue), __aspxRichEdit.TableWidthUnitType.ModelUnits);
                    case "cm":
                        return new __aspxRichEdit.TableWidthUnit().init(__aspxRichEdit.UnitConverter.centimetersToTwips(numberValue), __aspxRichEdit.TableWidthUnitType.ModelUnits);
                    case "mm":
                        return new __aspxRichEdit.TableWidthUnit().init(__aspxRichEdit.UnitConverter.centimetersToTwips(numberValue) * 10, __aspxRichEdit.TableWidthUnitType.ModelUnits);
                    case "pt":
                        return new __aspxRichEdit.TableWidthUnit().init(__aspxRichEdit.UnitConverter.pointsToTwips(numberValue), __aspxRichEdit.TableWidthUnitType.ModelUnits);
                    case "pc":
                        return new __aspxRichEdit.TableWidthUnit().init(__aspxRichEdit.UnitConverter.picasToTwips(numberValue), __aspxRichEdit.TableWidthUnitType.ModelUnits);
                    case "em":
                    case "ex":
                    default:
                        return new __aspxRichEdit.TableWidthUnit().init(0, __aspxRichEdit.TableWidthUnitType.Nil);
                }
            };
            HtmlImportUtils.getValueInTwips = function (stringValue) {
                var result = HtmlImportUtils.getTableWidthUnit(stringValue);
                if (result === null)
                    return null;
                if (result.type == __aspxRichEdit.TableWidthUnitType.ModelUnits)
                    return result.value;
                return 0;
            };
            HtmlImportUtils.getBorderInfo = function (colorProvider, borderWidth, borderStyle, borderColor) {
                if ((!borderWidth || !borderWidth.length) && (!borderStyle || !borderStyle.length) && (!borderColor || !borderColor.length))
                    return null;
                var border = new __aspxRichEdit.BorderInfo();
                var width = this.getTableWidthUnit(borderWidth);
                if (width != null && width.type == __aspxRichEdit.TableWidthUnitType.ModelUnits)
                    border.width = width.value;
                border.style = HtmlImportUtils.MapBorderStyleToType[borderStyle];
                if (border.style === undefined)
                    border.style = __aspxRichEdit.BorderLineStyle.None;
                var color = __aspxRichEdit.ColorHelper.stringToColor(borderColor);
                if (color != null)
                    border.color = colorProvider.getModelColorFromRgba(color == __aspxRichEdit.ColorHelper.BLACK_COLOR ? 0 : color);
                return border;
            };
            HtmlImportUtils.importBorder = function (colorProvider, props, borders, mask, setBorder, borderWidth, borderStyle, borderColor) {
                var borderInfo = HtmlImportUtils.getBorderInfo(colorProvider, borderWidth, borderStyle, borderColor);
                if (borderInfo) {
                    setBorder(borders, borderInfo.clone());
                    props.setUseValue(mask, borderInfo.style != __aspxRichEdit.BorderLineStyle.None);
                }
            };
            HtmlImportUtils.setBorders = function (colorProvider, props, borders, style, topMask, rightMask, bottomMask, leftMask) {
                HtmlImportUtils.importBorder(colorProvider, props, borders, topMask, function (brds, brd) { return brds.topBorder = brd; }, style.borderTopWidth, style.borderTopStyle, style.borderTopColor);
                HtmlImportUtils.importBorder(colorProvider, props, borders, rightMask, function (brds, brd) { return brds.rightBorder = brd; }, style.borderRightWidth, style.borderRightStyle, style.borderRightColor);
                HtmlImportUtils.importBorder(colorProvider, props, borders, bottomMask, function (brds, brd) { return brds.bottomBorder = brd; }, style.borderBottomWidth, style.borderBottomStyle, style.borderBottomColor);
                HtmlImportUtils.importBorder(colorProvider, props, borders, leftMask, function (brds, brd) { return brds.leftBorder = brd; }, style.borderLeftWidth, style.borderLeftStyle, style.borderLeftColor);
            };
            HtmlImportUtils.getPropertyByMap = function (map, elementBy, defaultValue) {
                var mapedElement = map[elementBy];
                return mapedElement !== undefined ? mapedElement : defaultValue;
            };
            HtmlImportUtils.MapBorderStyleToType = new __aspxRichEdit.MapCreatorStringAsKey()
                .add("dashed", __aspxRichEdit.BorderLineStyle.Dashed)
                .add("dotted", __aspxRichEdit.BorderLineStyle.Dotted)
                .add("double", __aspxRichEdit.BorderLineStyle.Double)
                .add("inset", __aspxRichEdit.BorderLineStyle.Inset)
                .add("outset", __aspxRichEdit.BorderLineStyle.Outset)
                .add("solid", __aspxRichEdit.BorderLineStyle.Single)
                .get();
            return HtmlImportUtils;
        }());
        HtmlImport.HtmlImportUtils = HtmlImportUtils;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONFontInfoProperty;
    (function (JSONFontInfoProperty) {
        JSONFontInfoProperty[JSONFontInfoProperty["Name"] = 0] = "Name";
        JSONFontInfoProperty[JSONFontInfoProperty["ScriptMultiplier"] = 1] = "ScriptMultiplier";
        JSONFontInfoProperty[JSONFontInfoProperty["CssString"] = 2] = "CssString";
        JSONFontInfoProperty[JSONFontInfoProperty["CanBeSet"] = 3] = "CanBeSet";
        JSONFontInfoProperty[JSONFontInfoProperty["SubScriptOffset"] = 4] = "SubScriptOffset";
    })(JSONFontInfoProperty = __aspxRichEdit.JSONFontInfoProperty || (__aspxRichEdit.JSONFontInfoProperty = {}));
    var JSONColorModelInfoProperty;
    (function (JSONColorModelInfoProperty) {
        JSONColorModelInfoProperty[JSONColorModelInfoProperty["ColorType"] = 0] = "ColorType";
        JSONColorModelInfoProperty[JSONColorModelInfoProperty["Auto"] = 1] = "Auto";
        JSONColorModelInfoProperty[JSONColorModelInfoProperty["ThemeColorIndex"] = 2] = "ThemeColorIndex";
        JSONColorModelInfoProperty[JSONColorModelInfoProperty["Tint"] = 3] = "Tint";
        JSONColorModelInfoProperty[JSONColorModelInfoProperty["Rgb"] = 4] = "Rgb";
        JSONColorModelInfoProperty[JSONColorModelInfoProperty["ColorIndex"] = 5] = "ColorIndex";
    })(JSONColorModelInfoProperty = __aspxRichEdit.JSONColorModelInfoProperty || (__aspxRichEdit.JSONColorModelInfoProperty = {}));
    var JSONCharacterFormattingProperty;
    (function (JSONCharacterFormattingProperty) {
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["FontInfoIndex"] = 0] = "FontInfoIndex";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["Size"] = 1] = "Size";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["Bold"] = 2] = "Bold";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["Italic"] = 3] = "Italic";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["StrikeoutType"] = 4] = "StrikeoutType";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["UnderlineType"] = 5] = "UnderlineType";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["AllCaps"] = 6] = "AllCaps";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["StrikeoutWordsOnly"] = 7] = "StrikeoutWordsOnly";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["UnderlineWordsOnly"] = 8] = "UnderlineWordsOnly";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["Script"] = 9] = "Script";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["Hidden"] = 10] = "Hidden";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["LangInfo"] = 11] = "LangInfo";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["NoProof"] = 12] = "NoProof";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["UseValue"] = 13] = "UseValue";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["FontName"] = 14] = "FontName";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["CompositeFontInfo"] = 15] = "CompositeFontInfo";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["TextColor"] = 16] = "TextColor";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["ShadingInfo"] = 17] = "ShadingInfo";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["HighlightColor"] = 18] = "HighlightColor";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["UnderlineColor"] = 19] = "UnderlineColor";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["StrikeoutColor"] = 20] = "StrikeoutColor";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["TextColorIndex"] = 21] = "TextColorIndex";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["ShadingInfoIndex"] = 22] = "ShadingInfoIndex";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["HighlightColorIndex"] = 23] = "HighlightColorIndex";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["UnderlineColorIndex"] = 24] = "UnderlineColorIndex";
        JSONCharacterFormattingProperty[JSONCharacterFormattingProperty["StrikeoutColorIndex"] = 25] = "StrikeoutColorIndex";
    })(JSONCharacterFormattingProperty = __aspxRichEdit.JSONCharacterFormattingProperty || (__aspxRichEdit.JSONCharacterFormattingProperty = {}));
    var JSONLangInfoProperty;
    (function (JSONLangInfoProperty) {
        JSONLangInfoProperty[JSONLangInfoProperty["Latin"] = 0] = "Latin";
        JSONLangInfoProperty[JSONLangInfoProperty["Bidi"] = 1] = "Bidi";
        JSONLangInfoProperty[JSONLangInfoProperty["EastAsia"] = 2] = "EastAsia";
    })(JSONLangInfoProperty = __aspxRichEdit.JSONLangInfoProperty || (__aspxRichEdit.JSONLangInfoProperty = {}));
    var JSONCompositeFontInfoProperty;
    (function (JSONCompositeFontInfoProperty) {
        JSONCompositeFontInfoProperty[JSONCompositeFontInfoProperty["asciiFontName"] = 0] = "asciiFontName";
        JSONCompositeFontInfoProperty[JSONCompositeFontInfoProperty["hightAnsiFontName"] = 1] = "hightAnsiFontName";
        JSONCompositeFontInfoProperty[JSONCompositeFontInfoProperty["complexScriptFontName"] = 2] = "complexScriptFontName";
        JSONCompositeFontInfoProperty[JSONCompositeFontInfoProperty["eastAsiaFontName"] = 3] = "eastAsiaFontName";
        JSONCompositeFontInfoProperty[JSONCompositeFontInfoProperty["asciiThemeFont"] = 4] = "asciiThemeFont";
        JSONCompositeFontInfoProperty[JSONCompositeFontInfoProperty["hightAnsiThemeFont"] = 5] = "hightAnsiThemeFont";
        JSONCompositeFontInfoProperty[JSONCompositeFontInfoProperty["complexScriptThemeFont"] = 6] = "complexScriptThemeFont";
        JSONCompositeFontInfoProperty[JSONCompositeFontInfoProperty["eastAsiaThemeFont"] = 7] = "eastAsiaThemeFont";
        JSONCompositeFontInfoProperty[JSONCompositeFontInfoProperty["hintFont"] = 8] = "hintFont";
    })(JSONCompositeFontInfoProperty = __aspxRichEdit.JSONCompositeFontInfoProperty || (__aspxRichEdit.JSONCompositeFontInfoProperty = {}));
    var JSONInsertTextCommandProperty;
    (function (JSONInsertTextCommandProperty) {
        JSONInsertTextCommandProperty[JSONInsertTextCommandProperty["Text"] = 0] = "Text";
        JSONInsertTextCommandProperty[JSONInsertTextCommandProperty["RunType"] = 1] = "RunType";
        JSONInsertTextCommandProperty[JSONInsertTextCommandProperty["Length"] = 2] = "Length";
        JSONInsertTextCommandProperty[JSONInsertTextCommandProperty["Position"] = 3] = "Position";
        JSONInsertTextCommandProperty[JSONInsertTextCommandProperty["CharacterStyleName"] = 4] = "CharacterStyleName";
        JSONInsertTextCommandProperty[JSONInsertTextCommandProperty["CharacterPropertiesIndex"] = 5] = "CharacterPropertiesIndex";
        JSONInsertTextCommandProperty[JSONInsertTextCommandProperty["CharacterProperties"] = 6] = "CharacterProperties";
    })(JSONInsertTextCommandProperty = __aspxRichEdit.JSONInsertTextCommandProperty || (__aspxRichEdit.JSONInsertTextCommandProperty = {}));
    var JSONLoadFontInfoCommand;
    (function (JSONLoadFontInfoCommand) {
        JSONLoadFontInfoCommand[JSONLoadFontInfoCommand["FontInfo"] = 0] = "FontInfo";
        JSONLoadFontInfoCommand[JSONLoadFontInfoCommand["FontInfoIndex"] = 1] = "FontInfoIndex";
    })(JSONLoadFontInfoCommand = __aspxRichEdit.JSONLoadFontInfoCommand || (__aspxRichEdit.JSONLoadFontInfoCommand = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONRichEditBehaviorOptionsProperty;
    (function (JSONRichEditBehaviorOptionsProperty) {
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["Copy"] = 0] = "Copy";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["CreateNew"] = 1] = "CreateNew";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["Cut"] = 2] = "Cut";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["Drag"] = 3] = "Drag";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["Drop"] = 4] = "Drop";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["FontSource"] = 5] = "FontSource";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["ForeColorSource"] = 6] = "ForeColorSource";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["MaxZoomFactor"] = 7] = "MaxZoomFactor";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["MinZoomFactor"] = 8] = "MinZoomFactor";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["OfficeScrolling"] = 9] = "OfficeScrolling";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["Open"] = 10] = "Open";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["OvertypeAllowed"] = 11] = "OvertypeAllowed";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["PageBreakInsertMode"] = 12] = "PageBreakInsertMode";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["Paste"] = 13] = "Paste";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["PasteLineBreakSubstitution"] = 14] = "PasteLineBreakSubstitution";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["PasteSingleCellAsText"] = 15] = "PasteSingleCellAsText";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["Printing"] = 16] = "Printing";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["Save"] = 17] = "Save";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["SaveAs"] = 18] = "SaveAs";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["ShowPopupMenu"] = 19] = "ShowPopupMenu";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["TabMarker"] = 20] = "TabMarker";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["Touch"] = 21] = "Touch";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["UseFontSubstitution"] = 22] = "UseFontSubstitution";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["Zooming"] = 23] = "Zooming";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["DocumentPropertiesAutoUpdate"] = 24] = "DocumentPropertiesAutoUpdate";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["KeepTextHighlightingOnClearFormatting"] = 25] = "KeepTextHighlightingOnClearFormatting";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["Download"] = 26] = "Download";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["AcceptsTab"] = 27] = "AcceptsTab";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["FullScreen"] = 28] = "FullScreen";
        JSONRichEditBehaviorOptionsProperty[JSONRichEditBehaviorOptionsProperty["RaiseClientEventsOnModificationsViaAPI"] = 29] = "RaiseClientEventsOnModificationsViaAPI";
    })(JSONRichEditBehaviorOptionsProperty = __aspxRichEdit.JSONRichEditBehaviorOptionsProperty || (__aspxRichEdit.JSONRichEditBehaviorOptionsProperty = {}));
    var JSONControlOptionsProperty;
    (function (JSONControlOptionsProperty) {
        JSONControlOptionsProperty[JSONControlOptionsProperty["Copy"] = 0] = "Copy";
        JSONControlOptionsProperty[JSONControlOptionsProperty["CreateNew"] = 1] = "CreateNew";
        JSONControlOptionsProperty[JSONControlOptionsProperty["Cut"] = 2] = "Cut";
        JSONControlOptionsProperty[JSONControlOptionsProperty["Drag"] = 3] = "Drag";
        JSONControlOptionsProperty[JSONControlOptionsProperty["Drop"] = 4] = "Drop";
        JSONControlOptionsProperty[JSONControlOptionsProperty["Open"] = 5] = "Open";
        JSONControlOptionsProperty[JSONControlOptionsProperty["Paste"] = 6] = "Paste";
        JSONControlOptionsProperty[JSONControlOptionsProperty["Printing"] = 7] = "Printing";
        JSONControlOptionsProperty[JSONControlOptionsProperty["Save"] = 8] = "Save";
        JSONControlOptionsProperty[JSONControlOptionsProperty["SaveAs"] = 9] = "SaveAs";
        JSONControlOptionsProperty[JSONControlOptionsProperty["FullScreen"] = 10] = "FullScreen";
        JSONControlOptionsProperty[JSONControlOptionsProperty["Bookmarks"] = 11] = "Bookmarks";
        JSONControlOptionsProperty[JSONControlOptionsProperty["CharacterFormatting"] = 12] = "CharacterFormatting";
        JSONControlOptionsProperty[JSONControlOptionsProperty["CharacterStyle"] = 13] = "CharacterStyle";
        JSONControlOptionsProperty[JSONControlOptionsProperty["Fields"] = 14] = "Fields";
        JSONControlOptionsProperty[JSONControlOptionsProperty["Hyperlinks"] = 15] = "Hyperlinks";
        JSONControlOptionsProperty[JSONControlOptionsProperty["InlinePictures"] = 16] = "InlinePictures";
        JSONControlOptionsProperty[JSONControlOptionsProperty["ParagraphFormatting"] = 17] = "ParagraphFormatting";
        JSONControlOptionsProperty[JSONControlOptionsProperty["Paragraphs"] = 18] = "Paragraphs";
        JSONControlOptionsProperty[JSONControlOptionsProperty["ParagraphStyle"] = 19] = "ParagraphStyle";
        JSONControlOptionsProperty[JSONControlOptionsProperty["ParagraphTabs"] = 20] = "ParagraphTabs";
        JSONControlOptionsProperty[JSONControlOptionsProperty["Sections"] = 21] = "Sections";
        JSONControlOptionsProperty[JSONControlOptionsProperty["TabSymbol"] = 22] = "TabSymbol";
        JSONControlOptionsProperty[JSONControlOptionsProperty["Undo"] = 23] = "Undo";
        JSONControlOptionsProperty[JSONControlOptionsProperty["NumberingBulleted"] = 24] = "NumberingBulleted";
        JSONControlOptionsProperty[JSONControlOptionsProperty["NumberingMultiLevel"] = 25] = "NumberingMultiLevel";
        JSONControlOptionsProperty[JSONControlOptionsProperty["NumberingSimple"] = 26] = "NumberingSimple";
        JSONControlOptionsProperty[JSONControlOptionsProperty["HeadersFooters"] = 27] = "HeadersFooters";
        JSONControlOptionsProperty[JSONControlOptionsProperty["Tables"] = 28] = "Tables";
        JSONControlOptionsProperty[JSONControlOptionsProperty["TableStyle"] = 29] = "TableStyle";
        JSONControlOptionsProperty[JSONControlOptionsProperty["TabMarker"] = 30] = "TabMarker";
        JSONControlOptionsProperty[JSONControlOptionsProperty["PageBreakInsertMode"] = 31] = "PageBreakInsertMode";
        JSONControlOptionsProperty[JSONControlOptionsProperty["AcceptsTab"] = 32] = "AcceptsTab";
        JSONControlOptionsProperty[JSONControlOptionsProperty["Download"] = 33] = "Download";
        JSONControlOptionsProperty[JSONControlOptionsProperty["RaiseClientEventsOnModificationsViaAPI"] = 34] = "RaiseClientEventsOnModificationsViaAPI";
    })(JSONControlOptionsProperty = __aspxRichEdit.JSONControlOptionsProperty || (__aspxRichEdit.JSONControlOptionsProperty = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONModelPropertyProperty;
    (function (JSONModelPropertyProperty) {
        JSONModelPropertyProperty[JSONModelPropertyProperty["DefaultTabWidth"] = 0] = "DefaultTabWidth";
        JSONModelPropertyProperty[JSONModelPropertyProperty["OddEvenPages"] = 1] = "OddEvenPages";
        JSONModelPropertyProperty[JSONModelPropertyProperty["PageColor"] = 2] = "PageColor";
    })(JSONModelPropertyProperty = __aspxRichEdit.JSONModelPropertyProperty || (__aspxRichEdit.JSONModelPropertyProperty = {}));
    var JSONDocumentModelProperty;
    (function (JSONDocumentModelProperty) {
        JSONDocumentModelProperty[JSONDocumentModelProperty["DocumentProperties"] = 0] = "DocumentProperties";
        JSONDocumentModelProperty[JSONDocumentModelProperty["Styles"] = 1] = "Styles";
        JSONDocumentModelProperty[JSONDocumentModelProperty["Sections"] = 2] = "Sections";
        JSONDocumentModelProperty[JSONDocumentModelProperty["AbstractNumberingLists"] = 3] = "AbstractNumberingLists";
        JSONDocumentModelProperty[JSONDocumentModelProperty["NumberingLists"] = 4] = "NumberingLists";
        JSONDocumentModelProperty[JSONDocumentModelProperty["Headers"] = 5] = "Headers";
        JSONDocumentModelProperty[JSONDocumentModelProperty["Footers"] = 6] = "Footers";
        JSONDocumentModelProperty[JSONDocumentModelProperty["AbstractNumberingListTemplates"] = 7] = "AbstractNumberingListTemplates";
        JSONDocumentModelProperty[JSONDocumentModelProperty["Images"] = 8] = "Images";
        JSONDocumentModelProperty[JSONDocumentModelProperty["PaletteColors"] = 9] = "PaletteColors";
        JSONDocumentModelProperty[JSONDocumentModelProperty["OfficeThemeColors"] = 10] = "OfficeThemeColors";
        JSONDocumentModelProperty[JSONDocumentModelProperty["CompatibilitySettings"] = 11] = "CompatibilitySettings";
    })(JSONDocumentModelProperty = __aspxRichEdit.JSONDocumentModelProperty || (__aspxRichEdit.JSONDocumentModelProperty = {}));
    var JSONDocumentProtectionPropertiesProperty;
    (function (JSONDocumentProtectionPropertiesProperty) {
        JSONDocumentProtectionPropertiesProperty[JSONDocumentProtectionPropertiesProperty["EnforceProtection"] = 0] = "EnforceProtection";
        JSONDocumentProtectionPropertiesProperty[JSONDocumentProtectionPropertiesProperty["ProtectionType"] = 1] = "ProtectionType";
        JSONDocumentProtectionPropertiesProperty[JSONDocumentProtectionPropertiesProperty["HashAlgorithmType"] = 2] = "HashAlgorithmType";
        JSONDocumentProtectionPropertiesProperty[JSONDocumentProtectionPropertiesProperty["HashIterationCount"] = 3] = "HashIterationCount";
        JSONDocumentProtectionPropertiesProperty[JSONDocumentProtectionPropertiesProperty["PasswordHash"] = 4] = "PasswordHash";
        JSONDocumentProtectionPropertiesProperty[JSONDocumentProtectionPropertiesProperty["PasswordPrefix"] = 5] = "PasswordPrefix";
        JSONDocumentProtectionPropertiesProperty[JSONDocumentProtectionPropertiesProperty["Word2003PasswordHash"] = 6] = "Word2003PasswordHash";
        JSONDocumentProtectionPropertiesProperty[JSONDocumentProtectionPropertiesProperty["OpenOfficePasswordHash"] = 7] = "OpenOfficePasswordHash";
    })(JSONDocumentProtectionPropertiesProperty = __aspxRichEdit.JSONDocumentProtectionPropertiesProperty || (__aspxRichEdit.JSONDocumentProtectionPropertiesProperty = {}));
    var DocumentProtectionType;
    (function (DocumentProtectionType) {
        DocumentProtectionType[DocumentProtectionType["None"] = 0] = "None";
        DocumentProtectionType[DocumentProtectionType["ReadOnly"] = 1] = "ReadOnly";
        DocumentProtectionType[DocumentProtectionType["AllowComments"] = 2] = "AllowComments";
    })(DocumentProtectionType = __aspxRichEdit.DocumentProtectionType || (__aspxRichEdit.DocumentProtectionType = {}));
    var JSONDocumentPropertiesProperty;
    (function (JSONDocumentPropertiesProperty) {
        JSONDocumentPropertiesProperty[JSONDocumentPropertiesProperty["DefaultTabWidth"] = 0] = "DefaultTabWidth";
        JSONDocumentPropertiesProperty[JSONDocumentPropertiesProperty["DifferentOddAndEvenPages"] = 1] = "DifferentOddAndEvenPages";
        JSONDocumentPropertiesProperty[JSONDocumentPropertiesProperty["DisplayBackgroundShape"] = 2] = "DisplayBackgroundShape";
        JSONDocumentPropertiesProperty[JSONDocumentPropertiesProperty["PageBackColor"] = 3] = "PageBackColor";
        JSONDocumentPropertiesProperty[JSONDocumentPropertiesProperty["DefaultCharacterProperties"] = 4] = "DefaultCharacterProperties";
        JSONDocumentPropertiesProperty[JSONDocumentPropertiesProperty["DefaultParagraphProperties"] = 5] = "DefaultParagraphProperties";
        JSONDocumentPropertiesProperty[JSONDocumentPropertiesProperty["DefaultTableProperties"] = 6] = "DefaultTableProperties";
        JSONDocumentPropertiesProperty[JSONDocumentPropertiesProperty["DefaultTableRowProperties"] = 7] = "DefaultTableRowProperties";
        JSONDocumentPropertiesProperty[JSONDocumentPropertiesProperty["DefaultTableCellProperties"] = 8] = "DefaultTableCellProperties";
        JSONDocumentPropertiesProperty[JSONDocumentPropertiesProperty["ProtectionProperties"] = 9] = "ProtectionProperties";
    })(JSONDocumentPropertiesProperty = __aspxRichEdit.JSONDocumentPropertiesProperty || (__aspxRichEdit.JSONDocumentPropertiesProperty = {}));
    var JSONCompatibilitySettingsProperty;
    (function (JSONCompatibilitySettingsProperty) {
        JSONCompatibilitySettingsProperty[JSONCompatibilitySettingsProperty["DontJustifyLinesEndingInSoftLineBreak"] = 0] = "DontJustifyLinesEndingInSoftLineBreak";
    })(JSONCompatibilitySettingsProperty = __aspxRichEdit.JSONCompatibilitySettingsProperty || (__aspxRichEdit.JSONCompatibilitySettingsProperty = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONFieldProperty;
    (function (JSONFieldProperty) {
        JSONFieldProperty[JSONFieldProperty["StartPos"] = 0] = "StartPos";
        JSONFieldProperty[JSONFieldProperty["SeparatorPos"] = 1] = "SeparatorPos";
        JSONFieldProperty[JSONFieldProperty["EndPos"] = 2] = "EndPos";
        JSONFieldProperty[JSONFieldProperty["Uri"] = 3] = "Uri";
        JSONFieldProperty[JSONFieldProperty["Anchor"] = 4] = "Anchor";
        JSONFieldProperty[JSONFieldProperty["Tip"] = 5] = "Tip";
        JSONFieldProperty[JSONFieldProperty["Visited"] = 6] = "Visited";
        JSONFieldProperty[JSONFieldProperty["NoInfo"] = 7] = "NoInfo";
    })(JSONFieldProperty = __aspxRichEdit.JSONFieldProperty || (__aspxRichEdit.JSONFieldProperty = {}));
    var JSONUpdateFieldCommand;
    (function (JSONUpdateFieldCommand) {
        JSONUpdateFieldCommand[JSONUpdateFieldCommand["ActiveRecord"] = 0] = "ActiveRecord";
        JSONUpdateFieldCommand[JSONUpdateFieldCommand["Info"] = 1] = "Info";
        JSONUpdateFieldCommand[JSONUpdateFieldCommand["SubDocumentId"] = 2] = "SubDocumentId";
    })(JSONUpdateFieldCommand = __aspxRichEdit.JSONUpdateFieldCommand || (__aspxRichEdit.JSONUpdateFieldCommand = {}));
    var JSONUpdateFieldCommandInfo;
    (function (JSONUpdateFieldCommandInfo) {
        JSONUpdateFieldCommandInfo[JSONUpdateFieldCommandInfo["ServerUpdateFieldType"] = 0] = "ServerUpdateFieldType";
        JSONUpdateFieldCommandInfo[JSONUpdateFieldCommandInfo["Data"] = 1] = "Data";
    })(JSONUpdateFieldCommandInfo = __aspxRichEdit.JSONUpdateFieldCommandInfo || (__aspxRichEdit.JSONUpdateFieldCommandInfo = {}));
    var JSONUpdateFieldCommandDocVariableInfo;
    (function (JSONUpdateFieldCommandDocVariableInfo) {
        JSONUpdateFieldCommandDocVariableInfo[JSONUpdateFieldCommandDocVariableInfo["Parameters"] = 0] = "Parameters";
        JSONUpdateFieldCommandDocVariableInfo[JSONUpdateFieldCommandDocVariableInfo["FieldName"] = 1] = "FieldName";
    })(JSONUpdateFieldCommandDocVariableInfo = __aspxRichEdit.JSONUpdateFieldCommandDocVariableInfo || (__aspxRichEdit.JSONUpdateFieldCommandDocVariableInfo = {}));
    var JSONUpdateFieldCommandDocVariableParameters;
    (function (JSONUpdateFieldCommandDocVariableParameters) {
        JSONUpdateFieldCommandDocVariableParameters[JSONUpdateFieldCommandDocVariableParameters["PureText"] = 0] = "PureText";
        JSONUpdateFieldCommandDocVariableParameters[JSONUpdateFieldCommandDocVariableParameters["IntervalStart"] = 1] = "IntervalStart";
        JSONUpdateFieldCommandDocVariableParameters[JSONUpdateFieldCommandDocVariableParameters["IntervalEnd"] = 2] = "IntervalEnd";
    })(JSONUpdateFieldCommandDocVariableParameters = __aspxRichEdit.JSONUpdateFieldCommandDocVariableParameters || (__aspxRichEdit.JSONUpdateFieldCommandDocVariableParameters = {}));
    var JSONUpdateFieldCommandResult;
    (function (JSONUpdateFieldCommandResult) {
        JSONUpdateFieldCommandResult[JSONUpdateFieldCommandResult["SimpleText"] = 0] = "SimpleText";
        JSONUpdateFieldCommandResult[JSONUpdateFieldCommandResult["DocumentLength"] = 1] = "DocumentLength";
        JSONUpdateFieldCommandResult[JSONUpdateFieldCommandResult["DocumentModel"] = 2] = "DocumentModel";
        JSONUpdateFieldCommandResult[JSONUpdateFieldCommandResult["ImageCorrespondence"] = 3] = "ImageCorrespondence";
        JSONUpdateFieldCommandResult[JSONUpdateFieldCommandResult["Caches"] = 4] = "Caches";
    })(JSONUpdateFieldCommandResult = __aspxRichEdit.JSONUpdateFieldCommandResult || (__aspxRichEdit.JSONUpdateFieldCommandResult = {}));
    var JSONServerUpdateFieldType;
    (function (JSONServerUpdateFieldType) {
        JSONServerUpdateFieldType[JSONServerUpdateFieldType["DocVariable"] = 1] = "DocVariable";
        JSONServerUpdateFieldType[JSONServerUpdateFieldType["MergeField"] = 2] = "MergeField";
    })(JSONServerUpdateFieldType = __aspxRichEdit.JSONServerUpdateFieldType || (__aspxRichEdit.JSONServerUpdateFieldType = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONShapeProperty;
    (function (JSONShapeProperty) {
        JSONShapeProperty[JSONShapeProperty["FillColor"] = 0] = "FillColor";
        JSONShapeProperty[JSONShapeProperty["OutlineColor"] = 1] = "OutlineColor";
        JSONShapeProperty[JSONShapeProperty["OutlineWidth"] = 2] = "OutlineWidth";
    })(JSONShapeProperty = __aspxRichEdit.JSONShapeProperty || (__aspxRichEdit.JSONShapeProperty = {}));
    var JSONAnchorInlineBaseSize;
    (function (JSONAnchorInlineBaseSize) {
        JSONAnchorInlineBaseSize[JSONAnchorInlineBaseSize["LockAspectRatio"] = 0] = "LockAspectRatio";
        JSONAnchorInlineBaseSize[JSONAnchorInlineBaseSize["Rotation"] = 1] = "Rotation";
        JSONAnchorInlineBaseSize[JSONAnchorInlineBaseSize["MAX_VALUE"] = 2] = "MAX_VALUE";
    })(JSONAnchorInlineBaseSize = __aspxRichEdit.JSONAnchorInlineBaseSize || (__aspxRichEdit.JSONAnchorInlineBaseSize = {}));
    var JSONPictureSize;
    (function (JSONPictureSize) {
        JSONPictureSize[JSONPictureSize["OriginalSize"] = 2] = "OriginalSize";
        JSONPictureSize[JSONPictureSize["Scale"] = 3] = "Scale";
    })(JSONPictureSize = __aspxRichEdit.JSONPictureSize || (__aspxRichEdit.JSONPictureSize = {}));
    var JSONInlineTextBoxSize;
    (function (JSONInlineTextBoxSize) {
        JSONInlineTextBoxSize[JSONInlineTextBoxSize["AbsoluteSize"] = 2] = "AbsoluteSize";
    })(JSONInlineTextBoxSize = __aspxRichEdit.JSONInlineTextBoxSize || (__aspxRichEdit.JSONInlineTextBoxSize = {}));
    var JSONAnchorTextBoxSize;
    (function (JSONAnchorTextBoxSize) {
        JSONAnchorTextBoxSize[JSONAnchorTextBoxSize["AbsoluteSize"] = 2] = "AbsoluteSize";
        JSONAnchorTextBoxSize[JSONAnchorTextBoxSize["RelativeSize"] = 3] = "RelativeSize";
        JSONAnchorTextBoxSize[JSONAnchorTextBoxSize["RelativeSizeType"] = 4] = "RelativeSizeType";
        JSONAnchorTextBoxSize[JSONAnchorTextBoxSize["UseAbsoluteSize"] = 5] = "UseAbsoluteSize";
    })(JSONAnchorTextBoxSize = __aspxRichEdit.JSONAnchorTextBoxSize || (__aspxRichEdit.JSONAnchorTextBoxSize = {}));
    var JSONTextBoxContentMargins;
    (function (JSONTextBoxContentMargins) {
        JSONTextBoxContentMargins[JSONTextBoxContentMargins["Left"] = 0] = "Left";
        JSONTextBoxContentMargins[JSONTextBoxContentMargins["Right"] = 1] = "Right";
        JSONTextBoxContentMargins[JSONTextBoxContentMargins["Top"] = 2] = "Top";
        JSONTextBoxContentMargins[JSONTextBoxContentMargins["Bottom"] = 3] = "Bottom";
    })(JSONTextBoxContentMargins = __aspxRichEdit.JSONTextBoxContentMargins || (__aspxRichEdit.JSONTextBoxContentMargins = {}));
    var JSONAnchorInfoProperty;
    (function (JSONAnchorInfoProperty) {
        JSONAnchorInfoProperty[JSONAnchorInfoProperty["AllowOverlap"] = 0] = "AllowOverlap";
        JSONAnchorInfoProperty[JSONAnchorInfoProperty["Hidden"] = 1] = "Hidden";
        JSONAnchorInfoProperty[JSONAnchorInfoProperty["LayoutTableCell"] = 2] = "LayoutTableCell";
        JSONAnchorInfoProperty[JSONAnchorInfoProperty["Locked"] = 3] = "Locked";
        JSONAnchorInfoProperty[JSONAnchorInfoProperty["IsBehindDoc"] = 4] = "IsBehindDoc";
        JSONAnchorInfoProperty[JSONAnchorInfoProperty["LeftDistance"] = 5] = "LeftDistance";
        JSONAnchorInfoProperty[JSONAnchorInfoProperty["RightDistance"] = 6] = "RightDistance";
        JSONAnchorInfoProperty[JSONAnchorInfoProperty["TopDistance"] = 7] = "TopDistance";
        JSONAnchorInfoProperty[JSONAnchorInfoProperty["BottomDistance"] = 8] = "BottomDistance";
        JSONAnchorInfoProperty[JSONAnchorInfoProperty["ZOrder"] = 9] = "ZOrder";
        JSONAnchorInfoProperty[JSONAnchorInfoProperty["WrapType"] = 10] = "WrapType";
        JSONAnchorInfoProperty[JSONAnchorInfoProperty["WrapSide"] = 11] = "WrapSide";
        JSONAnchorInfoProperty[JSONAnchorInfoProperty["HorizontalPositionType"] = 12] = "HorizontalPositionType";
        JSONAnchorInfoProperty[JSONAnchorInfoProperty["HorizontalPositionAlignment"] = 13] = "HorizontalPositionAlignment";
        JSONAnchorInfoProperty[JSONAnchorInfoProperty["VerticalPositionType"] = 14] = "VerticalPositionType";
        JSONAnchorInfoProperty[JSONAnchorInfoProperty["VerticalPositionAlignment"] = 15] = "VerticalPositionAlignment";
        JSONAnchorInfoProperty[JSONAnchorInfoProperty["OffsetX"] = 16] = "OffsetX";
        JSONAnchorInfoProperty[JSONAnchorInfoProperty["OffsetY"] = 17] = "OffsetY";
        JSONAnchorInfoProperty[JSONAnchorInfoProperty["PercentOffsetX"] = 18] = "PercentOffsetX";
        JSONAnchorInfoProperty[JSONAnchorInfoProperty["PercentOffsetY"] = 19] = "PercentOffsetY";
    })(JSONAnchorInfoProperty = __aspxRichEdit.JSONAnchorInfoProperty || (__aspxRichEdit.JSONAnchorInfoProperty = {}));
    var JSONInlinePictureCommandsImageInfo;
    (function (JSONInlinePictureCommandsImageInfo) {
        JSONInlinePictureCommandsImageInfo[JSONInlinePictureCommandsImageInfo["SourceUrl"] = 0] = "SourceUrl";
        JSONInlinePictureCommandsImageInfo[JSONInlinePictureCommandsImageInfo["Position"] = 1] = "Position";
        JSONInlinePictureCommandsImageInfo[JSONInlinePictureCommandsImageInfo["Guid"] = 2] = "Guid";
        JSONInlinePictureCommandsImageInfo[JSONInlinePictureCommandsImageInfo["ImageCacheId"] = 3] = "ImageCacheId";
        JSONInlinePictureCommandsImageInfo[JSONInlinePictureCommandsImageInfo["OriginalWidth"] = 4] = "OriginalWidth";
        JSONInlinePictureCommandsImageInfo[JSONInlinePictureCommandsImageInfo["OriginalHeight"] = 5] = "OriginalHeight";
        JSONInlinePictureCommandsImageInfo[JSONInlinePictureCommandsImageInfo["ScaleWidth"] = 6] = "ScaleWidth";
        JSONInlinePictureCommandsImageInfo[JSONInlinePictureCommandsImageInfo["ScaleHeight"] = 7] = "ScaleHeight";
        JSONInlinePictureCommandsImageInfo[JSONInlinePictureCommandsImageInfo["Base64Encoded"] = 8] = "Base64Encoded";
    })(JSONInlinePictureCommandsImageInfo = __aspxRichEdit.JSONInlinePictureCommandsImageInfo || (__aspxRichEdit.JSONInlinePictureCommandsImageInfo = {}));
    var JSONInlineObjectProperty;
    (function (JSONInlineObjectProperty) {
        JSONInlineObjectProperty[JSONInlineObjectProperty["Scales"] = 0] = "Scales";
        JSONInlineObjectProperty[JSONInlineObjectProperty["LockAspectRatio"] = 1] = "LockAspectRatio";
    })(JSONInlineObjectProperty = __aspxRichEdit.JSONInlineObjectProperty || (__aspxRichEdit.JSONInlineObjectProperty = {}));
    var JSONLoadInlinePictureCommand;
    (function (JSONLoadInlinePictureCommand) {
        JSONLoadInlinePictureCommand[JSONLoadInlinePictureCommand["SubDocumentId"] = 0] = "SubDocumentId";
        JSONLoadInlinePictureCommand[JSONLoadInlinePictureCommand["LoadedImagesInfo"] = 1] = "LoadedImagesInfo";
    })(JSONLoadInlinePictureCommand = __aspxRichEdit.JSONLoadInlinePictureCommand || (__aspxRichEdit.JSONLoadInlinePictureCommand = {}));
    var JSONCachedImageProperty;
    (function (JSONCachedImageProperty) {
        JSONCachedImageProperty[JSONCachedImageProperty["Id"] = 0] = "Id";
        JSONCachedImageProperty[JSONCachedImageProperty["Base64EncodedImage"] = 1] = "Base64EncodedImage";
    })(JSONCachedImageProperty = __aspxRichEdit.JSONCachedImageProperty || (__aspxRichEdit.JSONCachedImageProperty = {}));
    var JSONTextBoxProperties;
    (function (JSONTextBoxProperties) {
        JSONTextBoxProperties[JSONTextBoxProperties["ResizeShapeToFitText"] = 0] = "ResizeShapeToFitText";
        JSONTextBoxProperties[JSONTextBoxProperties["Upright"] = 1] = "Upright";
        JSONTextBoxProperties[JSONTextBoxProperties["VerticalAlignment"] = 2] = "VerticalAlignment";
        JSONTextBoxProperties[JSONTextBoxProperties["WrapText"] = 3] = "WrapText";
        JSONTextBoxProperties[JSONTextBoxProperties["LeftMargin"] = 4] = "LeftMargin";
        JSONTextBoxProperties[JSONTextBoxProperties["RightMargin"] = 5] = "RightMargin";
        JSONTextBoxProperties[JSONTextBoxProperties["TopMargin"] = 6] = "TopMargin";
        JSONTextBoxProperties[JSONTextBoxProperties["BottomMargin"] = 7] = "BottomMargin";
    })(JSONTextBoxProperties = __aspxRichEdit.JSONTextBoxProperties || (__aspxRichEdit.JSONTextBoxProperties = {}));
    var JSONInsertFloatingObjectCommandInfo;
    (function (JSONInsertFloatingObjectCommandInfo) {
        JSONInsertFloatingObjectCommandInfo[JSONInsertFloatingObjectCommandInfo["Position"] = 0] = "Position";
        JSONInsertFloatingObjectCommandInfo[JSONInsertFloatingObjectCommandInfo["ImageCacheId"] = 1] = "ImageCacheId";
        JSONInsertFloatingObjectCommandInfo[JSONInsertFloatingObjectCommandInfo["Size"] = 2] = "Size";
        JSONInsertFloatingObjectCommandInfo[JSONInsertFloatingObjectCommandInfo["AnchorInfo"] = 3] = "AnchorInfo";
        JSONInsertFloatingObjectCommandInfo[JSONInsertFloatingObjectCommandInfo["SubDocId"] = 4] = "SubDocId";
    })(JSONInsertFloatingObjectCommandInfo = __aspxRichEdit.JSONInsertFloatingObjectCommandInfo || (__aspxRichEdit.JSONInsertFloatingObjectCommandInfo = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONBorderBaseProperty;
    (function (JSONBorderBaseProperty) {
        JSONBorderBaseProperty[JSONBorderBaseProperty["Style"] = 0] = "Style";
        JSONBorderBaseProperty[JSONBorderBaseProperty["Color"] = 1] = "Color";
        JSONBorderBaseProperty[JSONBorderBaseProperty["ColorIndex"] = 2] = "ColorIndex";
        JSONBorderBaseProperty[JSONBorderBaseProperty["Width"] = 3] = "Width";
        JSONBorderBaseProperty[JSONBorderBaseProperty["Offset"] = 4] = "Offset";
        JSONBorderBaseProperty[JSONBorderBaseProperty["Frame"] = 5] = "Frame";
        JSONBorderBaseProperty[JSONBorderBaseProperty["Shadow"] = 6] = "Shadow";
    })(JSONBorderBaseProperty = __aspxRichEdit.JSONBorderBaseProperty || (__aspxRichEdit.JSONBorderBaseProperty = {}));
    var JSONShadingInfoProperty;
    (function (JSONShadingInfoProperty) {
        JSONShadingInfoProperty[JSONShadingInfoProperty["ShadingPattern"] = 0] = "ShadingPattern";
        JSONShadingInfoProperty[JSONShadingInfoProperty["BackColor"] = 1] = "BackColor";
        JSONShadingInfoProperty[JSONShadingInfoProperty["ForeColor"] = 2] = "ForeColor";
        JSONShadingInfoProperty[JSONShadingInfoProperty["ForeColorIndex"] = 3] = "ForeColorIndex";
        JSONShadingInfoProperty[JSONShadingInfoProperty["BackColorIndex"] = 4] = "BackColorIndex";
    })(JSONShadingInfoProperty = __aspxRichEdit.JSONShadingInfoProperty || (__aspxRichEdit.JSONShadingInfoProperty = {}));
    var JSONSDrawingColorProperty;
    (function (JSONSDrawingColorProperty) {
        JSONSDrawingColorProperty[JSONSDrawingColorProperty["Color"] = 0] = "Color";
    })(JSONSDrawingColorProperty = __aspxRichEdit.JSONSDrawingColorProperty || (__aspxRichEdit.JSONSDrawingColorProperty = {}));
    var JSONSDrawingColorModelInfoProperty;
    (function (JSONSDrawingColorModelInfoProperty) {
        JSONSDrawingColorModelInfoProperty[JSONSDrawingColorModelInfoProperty["ColorType"] = 0] = "ColorType";
        JSONSDrawingColorModelInfoProperty[JSONSDrawingColorModelInfoProperty["Rgb"] = 1] = "Rgb";
        JSONSDrawingColorModelInfoProperty[JSONSDrawingColorModelInfoProperty["System"] = 2] = "System";
        JSONSDrawingColorModelInfoProperty[JSONSDrawingColorModelInfoProperty["Scheme"] = 3] = "Scheme";
        JSONSDrawingColorModelInfoProperty[JSONSDrawingColorModelInfoProperty["Preset"] = 4] = "Preset";
        JSONSDrawingColorModelInfoProperty[JSONSDrawingColorModelInfoProperty["Hsl"] = 5] = "Hsl";
        JSONSDrawingColorModelInfoProperty[JSONSDrawingColorModelInfoProperty["ScRgb"] = 6] = "ScRgb";
    })(JSONSDrawingColorModelInfoProperty = __aspxRichEdit.JSONSDrawingColorModelInfoProperty || (__aspxRichEdit.JSONSDrawingColorModelInfoProperty = {}));
    var JSONSColorHSLProperty;
    (function (JSONSColorHSLProperty) {
        JSONSColorHSLProperty[JSONSColorHSLProperty["Hue"] = 0] = "Hue";
        JSONSColorHSLProperty[JSONSColorHSLProperty["Saturation"] = 1] = "Saturation";
        JSONSColorHSLProperty[JSONSColorHSLProperty["Luminance"] = 2] = "Luminance";
    })(JSONSColorHSLProperty = __aspxRichEdit.JSONSColorHSLProperty || (__aspxRichEdit.JSONSColorHSLProperty = {}));
    var JSONSScRGBColorProperty;
    (function (JSONSScRGBColorProperty) {
        JSONSScRGBColorProperty[JSONSScRGBColorProperty["ScR"] = 0] = "ScR";
        JSONSScRGBColorProperty[JSONSScRGBColorProperty["ScG"] = 1] = "ScG";
        JSONSScRGBColorProperty[JSONSScRGBColorProperty["ScB"] = 2] = "ScB";
    })(JSONSScRGBColorProperty = __aspxRichEdit.JSONSScRGBColorProperty || (__aspxRichEdit.JSONSScRGBColorProperty = {}));
    var JSONSelectionState;
    (function (JSONSelectionState) {
        JSONSelectionState[JSONSelectionState["ForwardDirection"] = 0] = "ForwardDirection";
        JSONSelectionState[JSONSelectionState["KeepX"] = 1] = "KeepX";
        JSONSelectionState[JSONSelectionState["EndOfLine"] = 2] = "EndOfLine";
        JSONSelectionState[JSONSelectionState["Intervals"] = 3] = "Intervals";
    })(JSONSelectionState = __aspxRichEdit.JSONSelectionState || (__aspxRichEdit.JSONSelectionState = {}));
    var JSONFixedInterval;
    (function (JSONFixedInterval) {
        JSONFixedInterval[JSONFixedInterval["Start"] = 0] = "Start";
        JSONFixedInterval[JSONFixedInterval["Length"] = 1] = "Length";
    })(JSONFixedInterval = __aspxRichEdit.JSONFixedInterval || (__aspxRichEdit.JSONFixedInterval = {}));
    var JSONCheckSpellingCommand;
    (function (JSONCheckSpellingCommand) {
        JSONCheckSpellingCommand[JSONCheckSpellingCommand["StartPosition"] = 0] = "StartPosition";
        JSONCheckSpellingCommand[JSONCheckSpellingCommand["EndPosition"] = 1] = "EndPosition";
        JSONCheckSpellingCommand[JSONCheckSpellingCommand["TextToCheck"] = 2] = "TextToCheck";
        JSONCheckSpellingCommand[JSONCheckSpellingCommand["SpellingErrors"] = 3] = "SpellingErrors";
        JSONCheckSpellingCommand[JSONCheckSpellingCommand["IntervalsToCheck"] = 4] = "IntervalsToCheck";
        JSONCheckSpellingCommand[JSONCheckSpellingCommand["CheckedIntervals"] = 5] = "CheckedIntervals";
        JSONCheckSpellingCommand[JSONCheckSpellingCommand["SubDocumentId"] = 6] = "SubDocumentId";
        JSONCheckSpellingCommand[JSONCheckSpellingCommand["AddedWord"] = 7] = "AddedWord";
        JSONCheckSpellingCommand[JSONCheckSpellingCommand["CustomDictionaryGuid"] = 8] = "CustomDictionaryGuid";
        JSONCheckSpellingCommand[JSONCheckSpellingCommand["ErrorType"] = 9] = "ErrorType";
        JSONCheckSpellingCommand[JSONCheckSpellingCommand["Suggestions"] = 10] = "Suggestions";
        JSONCheckSpellingCommand[JSONCheckSpellingCommand["ErrorWord"] = 11] = "ErrorWord";
        JSONCheckSpellingCommand[JSONCheckSpellingCommand["ErrorStart"] = 12] = "ErrorStart";
        JSONCheckSpellingCommand[JSONCheckSpellingCommand["ErrorLength"] = 13] = "ErrorLength";
    })(JSONCheckSpellingCommand = __aspxRichEdit.JSONCheckSpellingCommand || (__aspxRichEdit.JSONCheckSpellingCommand = {}));
    var JSONSize;
    (function (JSONSize) {
        JSONSize[JSONSize["Width"] = 0] = "Width";
        JSONSize[JSONSize["Height"] = 1] = "Height";
    })(JSONSize = __aspxRichEdit.JSONSize || (__aspxRichEdit.JSONSize = {}));
    var JSONForceSyncWithServerCommand;
    (function (JSONForceSyncWithServerCommand) {
        JSONForceSyncWithServerCommand[JSONForceSyncWithServerCommand["Id"] = 0] = "Id";
    })(JSONForceSyncWithServerCommand = __aspxRichEdit.JSONForceSyncWithServerCommand || (__aspxRichEdit.JSONForceSyncWithServerCommand = {}));
    var JSONInsertContentFromServerCommand;
    (function (JSONInsertContentFromServerCommand) {
        JSONInsertContentFromServerCommand[JSONInsertContentFromServerCommand["UserRequestId"] = 0] = "UserRequestId";
        JSONInsertContentFromServerCommand[JSONInsertContentFromServerCommand["Id"] = 1] = "Id";
        JSONInsertContentFromServerCommand[JSONInsertContentFromServerCommand["Model"] = 2] = "Model";
        JSONInsertContentFromServerCommand[JSONInsertContentFromServerCommand["SimpleText"] = 3] = "SimpleText";
    })(JSONInsertContentFromServerCommand = __aspxRichEdit.JSONInsertContentFromServerCommand || (__aspxRichEdit.JSONInsertContentFromServerCommand = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONAbstractNumberingListProperty;
    (function (JSONAbstractNumberingListProperty) {
        JSONAbstractNumberingListProperty[JSONAbstractNumberingListProperty["Deleted"] = 0] = "Deleted";
        JSONAbstractNumberingListProperty[JSONAbstractNumberingListProperty["Id"] = 1] = "Id";
        JSONAbstractNumberingListProperty[JSONAbstractNumberingListProperty["Levels"] = 2] = "Levels";
    })(JSONAbstractNumberingListProperty = __aspxRichEdit.JSONAbstractNumberingListProperty || (__aspxRichEdit.JSONAbstractNumberingListProperty = {}));
    var JSONNumberingListProperty;
    (function (JSONNumberingListProperty) {
        JSONNumberingListProperty[JSONNumberingListProperty["AlIndex"] = 0] = "AlIndex";
        JSONNumberingListProperty[JSONNumberingListProperty["Id"] = 1] = "Id";
        JSONNumberingListProperty[JSONNumberingListProperty["Levels"] = 2] = "Levels";
    })(JSONNumberingListProperty = __aspxRichEdit.JSONNumberingListProperty || (__aspxRichEdit.JSONNumberingListProperty = {}));
    var JSONNumberingListLevelProperty;
    (function (JSONNumberingListLevelProperty) {
        JSONNumberingListLevelProperty[JSONNumberingListLevelProperty["CharacterPropertiesIndex"] = 0] = "CharacterPropertiesIndex";
        JSONNumberingListLevelProperty[JSONNumberingListLevelProperty["ParagraphPropertiesIndex"] = 1] = "ParagraphPropertiesIndex";
        JSONNumberingListLevelProperty[JSONNumberingListLevelProperty["ListLevelPropertiesIndex"] = 2] = "ListLevelPropertiesIndex";
        JSONNumberingListLevelProperty[JSONNumberingListLevelProperty["MAX_VALUE"] = 3] = "MAX_VALUE";
    })(JSONNumberingListLevelProperty = __aspxRichEdit.JSONNumberingListLevelProperty || (__aspxRichEdit.JSONNumberingListLevelProperty = {}));
    var JSONNumberingOverrideListLevelProperty;
    (function (JSONNumberingOverrideListLevelProperty) {
        JSONNumberingOverrideListLevelProperty[JSONNumberingOverrideListLevelProperty["NewStart"] = 3] = "NewStart";
        JSONNumberingOverrideListLevelProperty[JSONNumberingOverrideListLevelProperty["OverrideStart"] = 4] = "OverrideStart";
        JSONNumberingOverrideListLevelProperty[JSONNumberingOverrideListLevelProperty["Level"] = 5] = "Level";
    })(JSONNumberingOverrideListLevelProperty = __aspxRichEdit.JSONNumberingOverrideListLevelProperty || (__aspxRichEdit.JSONNumberingOverrideListLevelProperty = {}));
    var JSONDeleteAbstractNumberingListCommandProperty;
    (function (JSONDeleteAbstractNumberingListCommandProperty) {
        JSONDeleteAbstractNumberingListCommandProperty[JSONDeleteAbstractNumberingListCommandProperty["Index"] = 0] = "Index";
    })(JSONDeleteAbstractNumberingListCommandProperty = __aspxRichEdit.JSONDeleteAbstractNumberingListCommandProperty || (__aspxRichEdit.JSONDeleteAbstractNumberingListCommandProperty = {}));
    var JSONAddAbstractNumberingListCommandPropery;
    (function (JSONAddAbstractNumberingListCommandPropery) {
        JSONAddAbstractNumberingListCommandPropery[JSONAddAbstractNumberingListCommandPropery["InnerId"] = 0] = "InnerId";
        JSONAddAbstractNumberingListCommandPropery[JSONAddAbstractNumberingListCommandPropery["Deleted"] = 1] = "Deleted";
        JSONAddAbstractNumberingListCommandPropery[JSONAddAbstractNumberingListCommandPropery["Levels"] = 2] = "Levels";
        JSONAddAbstractNumberingListCommandPropery[JSONAddAbstractNumberingListCommandPropery["ParagraphProperties"] = 3] = "ParagraphProperties";
        JSONAddAbstractNumberingListCommandPropery[JSONAddAbstractNumberingListCommandPropery["ListLevelProperties"] = 4] = "ListLevelProperties";
        JSONAddAbstractNumberingListCommandPropery[JSONAddAbstractNumberingListCommandPropery["CharacterProperties"] = 5] = "CharacterProperties";
        JSONAddAbstractNumberingListCommandPropery[JSONAddAbstractNumberingListCommandPropery["OverrideStart"] = 6] = "OverrideStart";
        JSONAddAbstractNumberingListCommandPropery[JSONAddAbstractNumberingListCommandPropery["NewStart"] = 7] = "NewStart";
        JSONAddAbstractNumberingListCommandPropery[JSONAddAbstractNumberingListCommandPropery["AbstractNumberingListIndex"] = 8] = "AbstractNumberingListIndex";
    })(JSONAddAbstractNumberingListCommandPropery = __aspxRichEdit.JSONAddAbstractNumberingListCommandPropery || (__aspxRichEdit.JSONAddAbstractNumberingListCommandPropery = {}));
    var JSONIOverrideListLevelProperty;
    (function (JSONIOverrideListLevelProperty) {
        JSONIOverrideListLevelProperty[JSONIOverrideListLevelProperty["NewStart"] = 0] = "NewStart";
        JSONIOverrideListLevelProperty[JSONIOverrideListLevelProperty["OverrideStart"] = 1] = "OverrideStart";
    })(JSONIOverrideListLevelProperty = __aspxRichEdit.JSONIOverrideListLevelProperty || (__aspxRichEdit.JSONIOverrideListLevelProperty = {}));
    var JSONListLevelProperty;
    (function (JSONListLevelProperty) {
        JSONListLevelProperty[JSONListLevelProperty["Start"] = 0] = "Start";
        JSONListLevelProperty[JSONListLevelProperty["Format"] = 1] = "Format";
        JSONListLevelProperty[JSONListLevelProperty["ConvertPreviousLevelNumberingToDecimal"] = 2] = "ConvertPreviousLevelNumberingToDecimal";
        JSONListLevelProperty[JSONListLevelProperty["SuppressBulletResize"] = 3] = "SuppressBulletResize";
        JSONListLevelProperty[JSONListLevelProperty["SuppressRestart"] = 4] = "SuppressRestart";
        JSONListLevelProperty[JSONListLevelProperty["Alignment"] = 5] = "Alignment";
        JSONListLevelProperty[JSONListLevelProperty["DisplayFormatString"] = 6] = "DisplayFormatString";
        JSONListLevelProperty[JSONListLevelProperty["RelativeRestartLevel"] = 7] = "RelativeRestartLevel";
        JSONListLevelProperty[JSONListLevelProperty["Separator"] = 8] = "Separator";
        JSONListLevelProperty[JSONListLevelProperty["TemplateCode"] = 9] = "TemplateCode";
        JSONListLevelProperty[JSONListLevelProperty["OriginalLeftIndent"] = 10] = "OriginalLeftIndent";
        JSONListLevelProperty[JSONListLevelProperty["Legacy"] = 11] = "Legacy";
        JSONListLevelProperty[JSONListLevelProperty["LegacySpace"] = 12] = "LegacySpace";
        JSONListLevelProperty[JSONListLevelProperty["LegacyIndent"] = 13] = "LegacyIndent";
    })(JSONListLevelProperty = __aspxRichEdit.JSONListLevelProperty || (__aspxRichEdit.JSONListLevelProperty = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONParagraphFormattingProperty;
    (function (JSONParagraphFormattingProperty) {
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["Alignment"] = 0] = "Alignment";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["FirstLineIndent"] = 1] = "FirstLineIndent";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["FirstLineIndentType"] = 2] = "FirstLineIndentType";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["LeftIndent"] = 3] = "LeftIndent";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["LineSpacing"] = 4] = "LineSpacing";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["LineSpacingType"] = 5] = "LineSpacingType";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["RightIndent"] = 6] = "RightIndent";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["SpacingBefore"] = 7] = "SpacingBefore";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["SpacingAfter"] = 8] = "SpacingAfter";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["SuppressHyphenation"] = 9] = "SuppressHyphenation";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["SuppressLineNumbers"] = 10] = "SuppressLineNumbers";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["ContextualSpacing"] = 11] = "ContextualSpacing";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["PageBreakBefore"] = 12] = "PageBreakBefore";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["BeforeAutoSpacing"] = 13] = "BeforeAutoSpacing";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["AfterAutoSpacing"] = 14] = "AfterAutoSpacing";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["KeepWithNext"] = 15] = "KeepWithNext";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["KeepLinesTogether"] = 16] = "KeepLinesTogether";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["WidowOrphanControl"] = 17] = "WidowOrphanControl";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["OutlineLevel"] = 18] = "OutlineLevel";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["ShadingInfo"] = 19] = "ShadingInfo";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["ShadingInfoIndex"] = 20] = "ShadingInfoIndex";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["LeftBorder"] = 21] = "LeftBorder";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["RightBorder"] = 22] = "RightBorder";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["TopBorder"] = 23] = "TopBorder";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["BottomBorder"] = 24] = "BottomBorder";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["DivId"] = 25] = "DivId";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["RightToLeft"] = 26] = "RightToLeft";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["BetweenBorder"] = 27] = "BetweenBorder";
        JSONParagraphFormattingProperty[JSONParagraphFormattingProperty["UseValue"] = 28] = "UseValue";
    })(JSONParagraphFormattingProperty = __aspxRichEdit.JSONParagraphFormattingProperty || (__aspxRichEdit.JSONParagraphFormattingProperty = {}));
    var JSONParagraphProperty;
    (function (JSONParagraphProperty) {
        JSONParagraphProperty[JSONParagraphProperty["MaskedParagraphPropertiesIndex"] = 0] = "MaskedParagraphPropertiesIndex";
        JSONParagraphProperty[JSONParagraphProperty["ParagraphStyleIndex"] = 1] = "ParagraphStyleIndex";
        JSONParagraphProperty[JSONParagraphProperty["LogPosition"] = 2] = "LogPosition";
        JSONParagraphProperty[JSONParagraphProperty["Length"] = 3] = "Length";
        JSONParagraphProperty[JSONParagraphProperty["Tabs"] = 4] = "Tabs";
        JSONParagraphProperty[JSONParagraphProperty["ListIndex"] = 5] = "ListIndex";
        JSONParagraphProperty[JSONParagraphProperty["ListLevelIndex"] = 6] = "ListLevelIndex";
    })(JSONParagraphProperty = __aspxRichEdit.JSONParagraphProperty || (__aspxRichEdit.JSONParagraphProperty = {}));
    var JSONMergeParagraphsCommandProperty;
    (function (JSONMergeParagraphsCommandProperty) {
        JSONMergeParagraphsCommandProperty[JSONMergeParagraphsCommandProperty["Position"] = 0] = "Position";
        JSONMergeParagraphsCommandProperty[JSONMergeParagraphsCommandProperty["GetPropertiesFromNext"] = 1] = "GetPropertiesFromNext";
    })(JSONMergeParagraphsCommandProperty = __aspxRichEdit.JSONMergeParagraphsCommandProperty || (__aspxRichEdit.JSONMergeParagraphsCommandProperty = {}));
    var JSONInsertParagraphCommandProperty;
    (function (JSONInsertParagraphCommandProperty) {
        JSONInsertParagraphCommandProperty[JSONInsertParagraphCommandProperty["Position"] = 0] = "Position";
        JSONInsertParagraphCommandProperty[JSONInsertParagraphCommandProperty["NumberingListIndex"] = 1] = "NumberingListIndex";
        JSONInsertParagraphCommandProperty[JSONInsertParagraphCommandProperty["ListLevelIndex"] = 2] = "ListLevelIndex";
        JSONInsertParagraphCommandProperty[JSONInsertParagraphCommandProperty["StyleName"] = 3] = "StyleName";
        JSONInsertParagraphCommandProperty[JSONInsertParagraphCommandProperty["ParagraphProperties"] = 4] = "ParagraphProperties";
        JSONInsertParagraphCommandProperty[JSONInsertParagraphCommandProperty["ParagraphPropertiesIndex"] = 5] = "ParagraphPropertiesIndex";
    })(JSONInsertParagraphCommandProperty = __aspxRichEdit.JSONInsertParagraphCommandProperty || (__aspxRichEdit.JSONInsertParagraphCommandProperty = {}));
    var JSONParagraphPropertiesChangedProperty;
    (function (JSONParagraphPropertiesChangedProperty) {
        JSONParagraphPropertiesChangedProperty[JSONParagraphPropertiesChangedProperty["ParagraphIndex"] = 0] = "ParagraphIndex";
        JSONParagraphPropertiesChangedProperty[JSONParagraphPropertiesChangedProperty["ParagraphProperties"] = 1] = "ParagraphProperties";
        JSONParagraphPropertiesChangedProperty[JSONParagraphPropertiesChangedProperty["NumberingListIndex"] = 2] = "NumberingListIndex";
        JSONParagraphPropertiesChangedProperty[JSONParagraphPropertiesChangedProperty["ListLevelIndex"] = 3] = "ListLevelIndex";
        JSONParagraphPropertiesChangedProperty[JSONParagraphPropertiesChangedProperty["TabsProperties"] = 4] = "TabsProperties";
        JSONParagraphPropertiesChangedProperty[JSONParagraphPropertiesChangedProperty["StyleName"] = 5] = "StyleName";
    })(JSONParagraphPropertiesChangedProperty = __aspxRichEdit.JSONParagraphPropertiesChangedProperty || (__aspxRichEdit.JSONParagraphPropertiesChangedProperty = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONRunBaseProperty;
    (function (JSONRunBaseProperty) {
        JSONRunBaseProperty[JSONRunBaseProperty["Type"] = 0] = "Type";
        JSONRunBaseProperty[JSONRunBaseProperty["Offset"] = 1] = "Offset";
        JSONRunBaseProperty[JSONRunBaseProperty["Length"] = 2] = "Length";
        JSONRunBaseProperty[JSONRunBaseProperty["MaskedCharacterPropertiesCacheIndex"] = 3] = "MaskedCharacterPropertiesCacheIndex";
        JSONRunBaseProperty[JSONRunBaseProperty["CharacterStyleIndex"] = 4] = "CharacterStyleIndex";
        JSONRunBaseProperty[JSONRunBaseProperty["MAX_VALUE"] = 5] = "MAX_VALUE";
    })(JSONRunBaseProperty = __aspxRichEdit.JSONRunBaseProperty || (__aspxRichEdit.JSONRunBaseProperty = {}));
    var JSONInlinePictureRunProperty;
    (function (JSONInlinePictureRunProperty) {
        JSONInlinePictureRunProperty[JSONInlinePictureRunProperty["Shape"] = 5] = "Shape";
        JSONInlinePictureRunProperty[JSONInlinePictureRunProperty["Size"] = 6] = "Size";
        JSONInlinePictureRunProperty[JSONInlinePictureRunProperty["PictureId"] = 7] = "PictureId";
    })(JSONInlinePictureRunProperty = __aspxRichEdit.JSONInlinePictureRunProperty || (__aspxRichEdit.JSONInlinePictureRunProperty = {}));
    var JSONInlineTextBoxRunProperty;
    (function (JSONInlineTextBoxRunProperty) {
        JSONInlineTextBoxRunProperty[JSONInlineTextBoxRunProperty["Shape"] = 5] = "Shape";
        JSONInlineTextBoxRunProperty[JSONInlineTextBoxRunProperty["Size"] = 6] = "Size";
        JSONInlineTextBoxRunProperty[JSONInlineTextBoxRunProperty["SubDocId"] = 7] = "SubDocId";
        JSONInlineTextBoxRunProperty[JSONInlineTextBoxRunProperty["TextBoxProperties"] = 8] = "TextBoxProperties";
    })(JSONInlineTextBoxRunProperty = __aspxRichEdit.JSONInlineTextBoxRunProperty || (__aspxRichEdit.JSONInlineTextBoxRunProperty = {}));
    var JSONAnchoredPictureRunProperty;
    (function (JSONAnchoredPictureRunProperty) {
        JSONAnchoredPictureRunProperty[JSONAnchoredPictureRunProperty["Shape"] = 5] = "Shape";
        JSONAnchoredPictureRunProperty[JSONAnchoredPictureRunProperty["Size"] = 6] = "Size";
        JSONAnchoredPictureRunProperty[JSONAnchoredPictureRunProperty["PictureId"] = 7] = "PictureId";
        JSONAnchoredPictureRunProperty[JSONAnchoredPictureRunProperty["AnchorInfo"] = 8] = "AnchorInfo";
    })(JSONAnchoredPictureRunProperty = __aspxRichEdit.JSONAnchoredPictureRunProperty || (__aspxRichEdit.JSONAnchoredPictureRunProperty = {}));
    var JSONAnchoredTextBoxRunProperty;
    (function (JSONAnchoredTextBoxRunProperty) {
        JSONAnchoredTextBoxRunProperty[JSONAnchoredTextBoxRunProperty["Shape"] = 5] = "Shape";
        JSONAnchoredTextBoxRunProperty[JSONAnchoredTextBoxRunProperty["Size"] = 6] = "Size";
        JSONAnchoredTextBoxRunProperty[JSONAnchoredTextBoxRunProperty["SubDocId"] = 7] = "SubDocId";
        JSONAnchoredTextBoxRunProperty[JSONAnchoredTextBoxRunProperty["AnchorInfo"] = 8] = "AnchorInfo";
        JSONAnchoredTextBoxRunProperty[JSONAnchoredTextBoxRunProperty["TextBoxProperties"] = 9] = "TextBoxProperties";
    })(JSONAnchoredTextBoxRunProperty = __aspxRichEdit.JSONAnchoredTextBoxRunProperty || (__aspxRichEdit.JSONAnchoredTextBoxRunProperty = {}));
    var JSONDeleteRunsCommandProperty;
    (function (JSONDeleteRunsCommandProperty) {
        JSONDeleteRunsCommandProperty[JSONDeleteRunsCommandProperty["Position"] = 0] = "Position";
        JSONDeleteRunsCommandProperty[JSONDeleteRunsCommandProperty["Length"] = 1] = "Length";
    })(JSONDeleteRunsCommandProperty = __aspxRichEdit.JSONDeleteRunsCommandProperty || (__aspxRichEdit.JSONDeleteRunsCommandProperty = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONSection;
    (function (JSONSection) {
        JSONSection[JSONSection["StartPos"] = 0] = "StartPos";
        JSONSection[JSONSection["Length"] = 1] = "Length";
        JSONSection[JSONSection["Properties"] = 2] = "Properties";
        JSONSection[JSONSection["Headers"] = 3] = "Headers";
        JSONSection[JSONSection["Footers"] = 4] = "Footers";
    })(JSONSection = __aspxRichEdit.JSONSection || (__aspxRichEdit.JSONSection = {}));
    var JSONColumnInfoProperty;
    (function (JSONColumnInfoProperty) {
        JSONColumnInfoProperty[JSONColumnInfoProperty["Width"] = 0] = "Width";
        JSONColumnInfoProperty[JSONColumnInfoProperty["Space"] = 1] = "Space";
    })(JSONColumnInfoProperty = __aspxRichEdit.JSONColumnInfoProperty || (__aspxRichEdit.JSONColumnInfoProperty = {}));
    var JSONMergeSectionsCommandProperty;
    (function (JSONMergeSectionsCommandProperty) {
        JSONMergeSectionsCommandProperty[JSONMergeSectionsCommandProperty["SectionIndex"] = 0] = "SectionIndex";
        JSONMergeSectionsCommandProperty[JSONMergeSectionsCommandProperty["GetPropertiesFromNext"] = 1] = "GetPropertiesFromNext";
    })(JSONMergeSectionsCommandProperty = __aspxRichEdit.JSONMergeSectionsCommandProperty || (__aspxRichEdit.JSONMergeSectionsCommandProperty = {}));
    var JSONInsertSectionCommandProperty;
    (function (JSONInsertSectionCommandProperty) {
        JSONInsertSectionCommandProperty[JSONInsertSectionCommandProperty["Position"] = 0] = "Position";
        JSONInsertSectionCommandProperty[JSONInsertSectionCommandProperty["SectionProperties"] = 1] = "SectionProperties";
    })(JSONInsertSectionCommandProperty = __aspxRichEdit.JSONInsertSectionCommandProperty || (__aspxRichEdit.JSONInsertSectionCommandProperty = {}));
    var JSONSectionProperty;
    (function (JSONSectionProperty) {
        JSONSectionProperty[JSONSectionProperty["MarginLeft"] = 0] = "MarginLeft";
        JSONSectionProperty[JSONSectionProperty["MarginTop"] = 1] = "MarginTop";
        JSONSectionProperty[JSONSectionProperty["MarginRight"] = 2] = "MarginRight";
        JSONSectionProperty[JSONSectionProperty["MarginBottom"] = 3] = "MarginBottom";
        JSONSectionProperty[JSONSectionProperty["ColumnCount"] = 4] = "ColumnCount";
        JSONSectionProperty[JSONSectionProperty["Space"] = 5] = "Space";
        JSONSectionProperty[JSONSectionProperty["ColumnsInfo"] = 6] = "ColumnsInfo";
        JSONSectionProperty[JSONSectionProperty["PageWidth"] = 7] = "PageWidth";
        JSONSectionProperty[JSONSectionProperty["PageHeight"] = 8] = "PageHeight";
        JSONSectionProperty[JSONSectionProperty["StartType"] = 9] = "StartType";
        JSONSectionProperty[JSONSectionProperty["Landscape"] = 10] = "Landscape";
        JSONSectionProperty[JSONSectionProperty["EqualWidthColumns"] = 11] = "EqualWidthColumns";
        JSONSectionProperty[JSONSectionProperty["DifferentFirstPage"] = 12] = "DifferentFirstPage";
        JSONSectionProperty[JSONSectionProperty["HeaderOffset"] = 13] = "HeaderOffset";
        JSONSectionProperty[JSONSectionProperty["FooterOffset"] = 14] = "FooterOffset";
    })(JSONSectionProperty = __aspxRichEdit.JSONSectionProperty || (__aspxRichEdit.JSONSectionProperty = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONStylesProperty;
    (function (JSONStylesProperty) {
        JSONStylesProperty[JSONStylesProperty["Character"] = 0] = "Character";
        JSONStylesProperty[JSONStylesProperty["Paragraph"] = 1] = "Paragraph";
        JSONStylesProperty[JSONStylesProperty["Table"] = 2] = "Table";
        JSONStylesProperty[JSONStylesProperty["TableCell"] = 3] = "TableCell";
        JSONStylesProperty[JSONStylesProperty["NumberingList"] = 4] = "NumberingList";
        JSONStylesProperty[JSONStylesProperty["Caches"] = 5] = "Caches";
    })(JSONStylesProperty = __aspxRichEdit.JSONStylesProperty || (__aspxRichEdit.JSONStylesProperty = {}));
    var JSONStyleBaseProperty;
    (function (JSONStyleBaseProperty) {
        JSONStyleBaseProperty[JSONStyleBaseProperty["StyleName"] = 0] = "StyleName";
        JSONStyleBaseProperty[JSONStyleBaseProperty["Deleted"] = 1] = "Deleted";
        JSONStyleBaseProperty[JSONStyleBaseProperty["Hidden"] = 2] = "Hidden";
        JSONStyleBaseProperty[JSONStyleBaseProperty["ParentStyleName"] = 3] = "ParentStyleName";
        JSONStyleBaseProperty[JSONStyleBaseProperty["Semihidden"] = 4] = "Semihidden";
        JSONStyleBaseProperty[JSONStyleBaseProperty["LocalizedStyleName"] = 5] = "LocalizedStyleName";
        JSONStyleBaseProperty[JSONStyleBaseProperty["IsDefault"] = 6] = "IsDefault";
        JSONStyleBaseProperty[JSONStyleBaseProperty["Base64EncodedImage"] = 7] = "Base64EncodedImage";
        JSONStyleBaseProperty[JSONStyleBaseProperty["MAX_VALUE"] = 8] = "MAX_VALUE";
    })(JSONStyleBaseProperty = __aspxRichEdit.JSONStyleBaseProperty || (__aspxRichEdit.JSONStyleBaseProperty = {}));
    var JSONCharacterStyleProperty;
    (function (JSONCharacterStyleProperty) {
        JSONCharacterStyleProperty[JSONCharacterStyleProperty["LinkedStyleName"] = 8] = "LinkedStyleName";
        JSONCharacterStyleProperty[JSONCharacterStyleProperty["CharacterPropertiesCacheIndex"] = 9] = "CharacterPropertiesCacheIndex";
    })(JSONCharacterStyleProperty = __aspxRichEdit.JSONCharacterStyleProperty || (__aspxRichEdit.JSONCharacterStyleProperty = {}));
    var JSONParagraphStyleProperty;
    (function (JSONParagraphStyleProperty) {
        JSONParagraphStyleProperty[JSONParagraphStyleProperty["CharacterPropertiesCacheIndex"] = 8] = "CharacterPropertiesCacheIndex";
        JSONParagraphStyleProperty[JSONParagraphStyleProperty["ParagraphPropertiesCacheIndex"] = 9] = "ParagraphPropertiesCacheIndex";
        JSONParagraphStyleProperty[JSONParagraphStyleProperty["LinkedStyleName"] = 10] = "LinkedStyleName";
        JSONParagraphStyleProperty[JSONParagraphStyleProperty["NextParagraphStyleName"] = 11] = "NextParagraphStyleName";
        JSONParagraphStyleProperty[JSONParagraphStyleProperty["AutoUpdate"] = 12] = "AutoUpdate";
        JSONParagraphStyleProperty[JSONParagraphStyleProperty["Tabs"] = 13] = "Tabs";
        JSONParagraphStyleProperty[JSONParagraphStyleProperty["NumberingListIndex"] = 14] = "NumberingListIndex";
        JSONParagraphStyleProperty[JSONParagraphStyleProperty["ListLevelIndex"] = 15] = "ListLevelIndex";
    })(JSONParagraphStyleProperty = __aspxRichEdit.JSONParagraphStyleProperty || (__aspxRichEdit.JSONParagraphStyleProperty = {}));
    var JSONNumberingListStyleProperty;
    (function (JSONNumberingListStyleProperty) {
        JSONNumberingListStyleProperty[JSONNumberingListStyleProperty["NumberingListIndex"] = 8] = "NumberingListIndex";
    })(JSONNumberingListStyleProperty = __aspxRichEdit.JSONNumberingListStyleProperty || (__aspxRichEdit.JSONNumberingListStyleProperty = {}));
    var JSONTableStyleProperty;
    (function (JSONTableStyleProperty) {
        JSONTableStyleProperty[JSONTableStyleProperty["BaseConditionalStyle"] = 8] = "BaseConditionalStyle";
        JSONTableStyleProperty[JSONTableStyleProperty["ConditionalStyles"] = 9] = "ConditionalStyles";
    })(JSONTableStyleProperty = __aspxRichEdit.JSONTableStyleProperty || (__aspxRichEdit.JSONTableStyleProperty = {}));
    var JSONStyleLinkCommandBaseProperty;
    (function (JSONStyleLinkCommandBaseProperty) {
        JSONStyleLinkCommandBaseProperty[JSONStyleLinkCommandBaseProperty["StyleName"] = 0] = "StyleName";
    })(JSONStyleLinkCommandBaseProperty = __aspxRichEdit.JSONStyleLinkCommandBaseProperty || (__aspxRichEdit.JSONStyleLinkCommandBaseProperty = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONEnumLoadPieceTableCommandParameters;
    (function (JSONEnumLoadPieceTableCommandParameters) {
        JSONEnumLoadPieceTableCommandParameters[JSONEnumLoadPieceTableCommandParameters["LoadOnOneRequest"] = 0] = "LoadOnOneRequest";
        JSONEnumLoadPieceTableCommandParameters[JSONEnumLoadPieceTableCommandParameters["StartPosition"] = 1] = "StartPosition";
        JSONEnumLoadPieceTableCommandParameters[JSONEnumLoadPieceTableCommandParameters["MaxChunkLength"] = 2] = "MaxChunkLength";
        JSONEnumLoadPieceTableCommandParameters[JSONEnumLoadPieceTableCommandParameters["Length"] = 3] = "Length";
    })(JSONEnumLoadPieceTableCommandParameters = __aspxRichEdit.JSONEnumLoadPieceTableCommandParameters || (__aspxRichEdit.JSONEnumLoadPieceTableCommandParameters = {}));
    var JSONCreateHeaderFooterCommandBaseProperty;
    (function (JSONCreateHeaderFooterCommandBaseProperty) {
        JSONCreateHeaderFooterCommandBaseProperty[JSONCreateHeaderFooterCommandBaseProperty["Type"] = 0] = "Type";
    })(JSONCreateHeaderFooterCommandBaseProperty = __aspxRichEdit.JSONCreateHeaderFooterCommandBaseProperty || (__aspxRichEdit.JSONCreateHeaderFooterCommandBaseProperty = {}));
    var JSONChangeHeaderFooterIndexCommandBase;
    (function (JSONChangeHeaderFooterIndexCommandBase) {
        JSONChangeHeaderFooterIndexCommandBase[JSONChangeHeaderFooterIndexCommandBase["SectionIndex"] = 0] = "SectionIndex";
        JSONChangeHeaderFooterIndexCommandBase[JSONChangeHeaderFooterIndexCommandBase["NewObjectIndex"] = 1] = "NewObjectIndex";
        JSONChangeHeaderFooterIndexCommandBase[JSONChangeHeaderFooterIndexCommandBase["Type"] = 2] = "Type";
    })(JSONChangeHeaderFooterIndexCommandBase = __aspxRichEdit.JSONChangeHeaderFooterIndexCommandBase || (__aspxRichEdit.JSONChangeHeaderFooterIndexCommandBase = {}));
    var JSONEnumLoadPieceTable;
    (function (JSONEnumLoadPieceTable) {
        JSONEnumLoadPieceTable[JSONEnumLoadPieceTable["Bookmarks"] = 0] = "Bookmarks";
        JSONEnumLoadPieceTable[JSONEnumLoadPieceTable["Fields"] = 1] = "Fields";
        JSONEnumLoadPieceTable[JSONEnumLoadPieceTable["Tables"] = 2] = "Tables";
        JSONEnumLoadPieceTable[JSONEnumLoadPieceTable["Chunks"] = 3] = "Chunks";
        JSONEnumLoadPieceTable[JSONEnumLoadPieceTable["Paragraphs"] = 4] = "Paragraphs";
        JSONEnumLoadPieceTable[JSONEnumLoadPieceTable["RangePermissions"] = 5] = "RangePermissions";
    })(JSONEnumLoadPieceTable = __aspxRichEdit.JSONEnumLoadPieceTable || (__aspxRichEdit.JSONEnumLoadPieceTable = {}));
    var JSONHeaderFooterInfoProperty;
    (function (JSONHeaderFooterInfoProperty) {
        JSONHeaderFooterInfoProperty[JSONHeaderFooterInfoProperty["SubDocumentId"] = 0] = "SubDocumentId";
        JSONHeaderFooterInfoProperty[JSONHeaderFooterInfoProperty["Type"] = 1] = "Type";
    })(JSONHeaderFooterInfoProperty = __aspxRichEdit.JSONHeaderFooterInfoProperty || (__aspxRichEdit.JSONHeaderFooterInfoProperty = {}));
    var JSONHeaderFooterStringResourcesProperty;
    (function (JSONHeaderFooterStringResourcesProperty) {
        JSONHeaderFooterStringResourcesProperty[JSONHeaderFooterStringResourcesProperty["Header"] = 0] = "Header";
        JSONHeaderFooterStringResourcesProperty[JSONHeaderFooterStringResourcesProperty["Footer"] = 1] = "Footer";
        JSONHeaderFooterStringResourcesProperty[JSONHeaderFooterStringResourcesProperty["FirstPageHeader"] = 2] = "FirstPageHeader";
        JSONHeaderFooterStringResourcesProperty[JSONHeaderFooterStringResourcesProperty["FirstPageFooter"] = 3] = "FirstPageFooter";
        JSONHeaderFooterStringResourcesProperty[JSONHeaderFooterStringResourcesProperty["EvenPageHeader"] = 4] = "EvenPageHeader";
        JSONHeaderFooterStringResourcesProperty[JSONHeaderFooterStringResourcesProperty["EvenPageFooter"] = 5] = "EvenPageFooter";
        JSONHeaderFooterStringResourcesProperty[JSONHeaderFooterStringResourcesProperty["OddPageHeader"] = 6] = "OddPageHeader";
        JSONHeaderFooterStringResourcesProperty[JSONHeaderFooterStringResourcesProperty["OddPageFooter"] = 7] = "OddPageFooter";
        JSONHeaderFooterStringResourcesProperty[JSONHeaderFooterStringResourcesProperty["SameAsPrevious"] = 8] = "SameAsPrevious";
    })(JSONHeaderFooterStringResourcesProperty = __aspxRichEdit.JSONHeaderFooterStringResourcesProperty || (__aspxRichEdit.JSONHeaderFooterStringResourcesProperty = {}));
    var JSONBookmarkProperty;
    (function (JSONBookmarkProperty) {
        JSONBookmarkProperty[JSONBookmarkProperty["StartPos"] = 0] = "StartPos";
        JSONBookmarkProperty[JSONBookmarkProperty["Length"] = 1] = "Length";
        JSONBookmarkProperty[JSONBookmarkProperty["Name"] = 2] = "Name";
    })(JSONBookmarkProperty = __aspxRichEdit.JSONBookmarkProperty || (__aspxRichEdit.JSONBookmarkProperty = {}));
    var JSONRangePermissionProperty;
    (function (JSONRangePermissionProperty) {
        JSONRangePermissionProperty[JSONRangePermissionProperty["Start"] = 0] = "Start";
        JSONRangePermissionProperty[JSONRangePermissionProperty["Length"] = 1] = "Length";
        JSONRangePermissionProperty[JSONRangePermissionProperty["UserName"] = 2] = "UserName";
        JSONRangePermissionProperty[JSONRangePermissionProperty["Group"] = 3] = "Group";
    })(JSONRangePermissionProperty = __aspxRichEdit.JSONRangePermissionProperty || (__aspxRichEdit.JSONRangePermissionProperty = {}));
    var JSONChunkProperty;
    (function (JSONChunkProperty) {
        JSONChunkProperty[JSONChunkProperty["StartPos"] = 0] = "StartPos";
        JSONChunkProperty[JSONChunkProperty["TextBuffer"] = 1] = "TextBuffer";
        JSONChunkProperty[JSONChunkProperty["Runs"] = 2] = "Runs";
        JSONChunkProperty[JSONChunkProperty["IsLast"] = 3] = "IsLast";
    })(JSONChunkProperty = __aspxRichEdit.JSONChunkProperty || (__aspxRichEdit.JSONChunkProperty = {}));
    var JSONPieceTableInfo;
    (function (JSONPieceTableInfo) {
        JSONPieceTableInfo[JSONPieceTableInfo["Type"] = 0] = "Type";
        JSONPieceTableInfo[JSONPieceTableInfo["Info"] = 1] = "Info";
        JSONPieceTableInfo[JSONPieceTableInfo["ParentPieceTableId"] = 2] = "ParentPieceTableId";
    })(JSONPieceTableInfo = __aspxRichEdit.JSONPieceTableInfo || (__aspxRichEdit.JSONPieceTableInfo = {}));
    var JSONTabInfoProperty;
    (function (JSONTabInfoProperty) {
        JSONTabInfoProperty[JSONTabInfoProperty["Alignment"] = 0] = "Alignment";
        JSONTabInfoProperty[JSONTabInfoProperty["LeaderType"] = 1] = "LeaderType";
        JSONTabInfoProperty[JSONTabInfoProperty["Position"] = 2] = "Position";
        JSONTabInfoProperty[JSONTabInfoProperty["IsDefault"] = 3] = "IsDefault";
        JSONTabInfoProperty[JSONTabInfoProperty["IsDeleted"] = 4] = "IsDeleted";
    })(JSONTabInfoProperty = __aspxRichEdit.JSONTabInfoProperty || (__aspxRichEdit.JSONTabInfoProperty = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var IsModified;
    (function (IsModified) {
        IsModified[IsModified["False"] = 0] = "False";
        IsModified[IsModified["True"] = 1] = "True";
        IsModified[IsModified["SaveInProgress"] = 2] = "SaveInProgress";
    })(IsModified = __aspxRichEdit.IsModified || (__aspxRichEdit.IsModified = {}));
    var JSONResponseError;
    (function (JSONResponseError) {
        JSONResponseError[JSONResponseError["NoErrors"] = 0] = "NoErrors";
        JSONResponseError[JSONResponseError["ModelIsChanged"] = 1] = "ModelIsChanged";
        JSONResponseError[JSONResponseError["InnerException"] = 2] = "InnerException";
        JSONResponseError[JSONResponseError["AuthException"] = 3] = "AuthException";
        JSONResponseError[JSONResponseError["CantSaveToAlreadyOpenedFile"] = 4] = "CantSaveToAlreadyOpenedFile";
        JSONResponseError[JSONResponseError["CantSaveDocument"] = 5] = "CantSaveDocument";
        JSONResponseError[JSONResponseError["CantOpenDocument"] = 6] = "CantOpenDocument";
        JSONResponseError[JSONResponseError["CalculateDocumentVariableException"] = 7] = "CalculateDocumentVariableException";
        JSONResponseError[JSONResponseError["PathTooLongException"] = 8] = "PathTooLongException";
        JSONResponseError[JSONResponseError["CantSaveToEmptyPath"] = 9] = "CantSaveToEmptyPath";
        JSONResponseError[JSONResponseError["InsertContentFromServerException"] = 10] = "InsertContentFromServerException";
        JSONResponseError[JSONResponseError["LoadPictureException"] = 11] = "LoadPictureException";
        JSONResponseError[JSONResponseError["SessionHasExpired"] = 12] = "SessionHasExpired";
    })(JSONResponseError = __aspxRichEdit.JSONResponseError || (__aspxRichEdit.JSONResponseError = {}));
    var JSONCommandParametersProperty;
    (function (JSONCommandParametersProperty) {
        JSONCommandParametersProperty[JSONCommandParametersProperty["CommandType"] = 0] = "CommandType";
        JSONCommandParametersProperty[JSONCommandParametersProperty["IncId"] = 1] = "IncId";
        JSONCommandParametersProperty[JSONCommandParametersProperty["ServerParams"] = 2] = "ServerParams";
        JSONCommandParametersProperty[JSONCommandParametersProperty["EditIncId"] = 3] = "EditIncId";
        JSONCommandParametersProperty[JSONCommandParametersProperty["FontInfoCacheLength"] = 4] = "FontInfoCacheLength";
        JSONCommandParametersProperty[JSONCommandParametersProperty["SubDocumentId"] = 5] = "SubDocumentId";
        JSONCommandParametersProperty[JSONCommandParametersProperty["Caches"] = 6] = "Caches";
        JSONCommandParametersProperty[JSONCommandParametersProperty["IsNewWorkSession"] = 7] = "IsNewWorkSession";
    })(JSONCommandParametersProperty = __aspxRichEdit.JSONCommandParametersProperty || (__aspxRichEdit.JSONCommandParametersProperty = {}));
    var JSONPropertyStateBasedCommand;
    (function (JSONPropertyStateBasedCommand) {
        JSONPropertyStateBasedCommand[JSONPropertyStateBasedCommand["State"] = 0] = "State";
        JSONPropertyStateBasedCommand[JSONPropertyStateBasedCommand["Property"] = 1] = "Property";
    })(JSONPropertyStateBasedCommand = __aspxRichEdit.JSONPropertyStateBasedCommand || (__aspxRichEdit.JSONPropertyStateBasedCommand = {}));
    var JSONInitSessionProperty;
    (function (JSONInitSessionProperty) {
        JSONInitSessionProperty[JSONInitSessionProperty["IsNewDocument"] = 0] = "IsNewDocument";
        JSONInitSessionProperty[JSONInitSessionProperty["SessionGuid"] = 1] = "SessionGuid";
        JSONInitSessionProperty[JSONInitSessionProperty["FileName"] = 2] = "FileName";
        JSONInitSessionProperty[JSONInitSessionProperty["LastExecutedEditCommandId"] = 3] = "LastExecutedEditCommandId";
        JSONInitSessionProperty[JSONInitSessionProperty["EmptyImageCacheID"] = 4] = "EmptyImageCacheID";
        JSONInitSessionProperty[JSONInitSessionProperty["SubDocumentsCounter"] = 5] = "SubDocumentsCounter";
        JSONInitSessionProperty[JSONInitSessionProperty["IsModified"] = 6] = "IsModified";
        JSONInitSessionProperty[JSONInitSessionProperty["InvalidDocument"] = 7] = "InvalidDocument";
        JSONInitSessionProperty[JSONInitSessionProperty["Document"] = 8] = "Document";
        JSONInitSessionProperty[JSONInitSessionProperty["Caches"] = 9] = "Caches";
        JSONInitSessionProperty[JSONInitSessionProperty["Options"] = 10] = "Options";
        JSONInitSessionProperty[JSONInitSessionProperty["StringResources"] = 11] = "StringResources";
        JSONInitSessionProperty[JSONInitSessionProperty["HistoryId"] = 12] = "HistoryId";
        JSONInitSessionProperty[JSONInitSessionProperty["Src"] = 13] = "Src";
        JSONInitSessionProperty[JSONInitSessionProperty["FolderPath"] = 14] = "FolderPath";
        JSONInitSessionProperty[JSONInitSessionProperty["DocumentFormat"] = 15] = "DocumentFormat";
        JSONInitSessionProperty[JSONInitSessionProperty["FirstRecordIndex"] = 16] = "FirstRecordIndex";
        JSONInitSessionProperty[JSONInitSessionProperty["LastRecordIndex"] = 17] = "LastRecordIndex";
        JSONInitSessionProperty[JSONInitSessionProperty["MergeMode"] = 18] = "MergeMode";
        JSONInitSessionProperty[JSONInitSessionProperty["DocumentHasSource"] = 19] = "DocumentHasSource";
    })(JSONInitSessionProperty = __aspxRichEdit.JSONInitSessionProperty || (__aspxRichEdit.JSONInitSessionProperty = {}));
    var JSONResponceLevelProperty;
    (function (JSONResponceLevelProperty) {
        JSONResponceLevelProperty[JSONResponceLevelProperty["ErrorCode"] = 0] = "ErrorCode";
        JSONResponceLevelProperty[JSONResponceLevelProperty["CommandsResults"] = 1] = "CommandsResults";
    })(JSONResponceLevelProperty = __aspxRichEdit.JSONResponceLevelProperty || (__aspxRichEdit.JSONResponceLevelProperty = {}));
    var JSONCachesDataProperty;
    (function (JSONCachesDataProperty) {
        JSONCachesDataProperty[JSONCachesDataProperty["CharacterPropertiesCache"] = 0] = "CharacterPropertiesCache";
        JSONCachesDataProperty[JSONCachesDataProperty["ParagraphPropertiesCache"] = 1] = "ParagraphPropertiesCache";
        JSONCachesDataProperty[JSONCachesDataProperty["ListLevelPropertiesCache"] = 2] = "ListLevelPropertiesCache";
        JSONCachesDataProperty[JSONCachesDataProperty["TableRowPropertiesCache"] = 3] = "TableRowPropertiesCache";
        JSONCachesDataProperty[JSONCachesDataProperty["TableCellPropertiesCache"] = 4] = "TableCellPropertiesCache";
        JSONCachesDataProperty[JSONCachesDataProperty["SubDocuments"] = 5] = "SubDocuments";
        JSONCachesDataProperty[JSONCachesDataProperty["FontInfoCache"] = 6] = "FontInfoCache";
        JSONCachesDataProperty[JSONCachesDataProperty["ColorModelInfoCache"] = 7] = "ColorModelInfoCache";
        JSONCachesDataProperty[JSONCachesDataProperty["ShadingInfoCache"] = 8] = "ShadingInfoCache";
    })(JSONCachesDataProperty = __aspxRichEdit.JSONCachesDataProperty || (__aspxRichEdit.JSONCachesDataProperty = {}));
    var JSONGetRtfCommand;
    (function (JSONGetRtfCommand) {
        JSONGetRtfCommand[JSONGetRtfCommand["Position"] = 0] = "Position";
        JSONGetRtfCommand[JSONGetRtfCommand["Length"] = 1] = "Length";
        JSONGetRtfCommand[JSONGetRtfCommand["SubDocumentId"] = 2] = "SubDocumentId";
        JSONGetRtfCommand[JSONGetRtfCommand["ResultRtf"] = 3] = "ResultRtf";
        JSONGetRtfCommand[JSONGetRtfCommand["Id"] = 4] = "Id";
    })(JSONGetRtfCommand = __aspxRichEdit.JSONGetRtfCommand || (__aspxRichEdit.JSONGetRtfCommand = {}));
    var JSONInsertRtfCommand;
    (function (JSONInsertRtfCommand) {
        JSONInsertRtfCommand[JSONInsertRtfCommand["RtfText"] = 0] = "RtfText";
        JSONInsertRtfCommand[JSONInsertRtfCommand["Result"] = 1] = "Result";
        JSONInsertRtfCommand[JSONInsertRtfCommand["Id"] = 2] = "Id";
    })(JSONInsertRtfCommand = __aspxRichEdit.JSONInsertRtfCommand || (__aspxRichEdit.JSONInsertRtfCommand = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONControlOptionsConverter = (function () {
        function JSONControlOptionsConverter() {
        }
        JSONControlOptionsConverter.convertFromJSON = function (obj) {
            if (!obj)
                return;
            var result = new __aspxRichEdit.ControlOptions();
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.Copy] !== undefined)
                result.copy = obj[__aspxRichEdit.JSONControlOptionsProperty.Copy];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.CreateNew] !== undefined)
                result.createNew = obj[__aspxRichEdit.JSONControlOptionsProperty.CreateNew];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.Cut] !== undefined)
                result.cut = obj[__aspxRichEdit.JSONControlOptionsProperty.Cut];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.Drag] !== undefined)
                result.drag = obj[__aspxRichEdit.JSONControlOptionsProperty.Drag];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.Drop] !== undefined)
                result.drop = obj[__aspxRichEdit.JSONControlOptionsProperty.Drop];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.Open] !== undefined)
                result.open = obj[__aspxRichEdit.JSONControlOptionsProperty.Open];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.Paste] !== undefined)
                result.paste = obj[__aspxRichEdit.JSONControlOptionsProperty.Paste];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.Printing] !== undefined)
                result.printing = obj[__aspxRichEdit.JSONControlOptionsProperty.Printing];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.Save] !== undefined)
                result.save = obj[__aspxRichEdit.JSONControlOptionsProperty.Save];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.SaveAs] !== undefined)
                result.saveAs = obj[__aspxRichEdit.JSONControlOptionsProperty.SaveAs];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.FullScreen] !== undefined)
                result.fullScreen = obj[__aspxRichEdit.JSONControlOptionsProperty.FullScreen];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.Bookmarks] !== undefined)
                result.bookmarks = obj[__aspxRichEdit.JSONControlOptionsProperty.Bookmarks];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.CharacterFormatting] !== undefined)
                result.characterFormatting = obj[__aspxRichEdit.JSONControlOptionsProperty.CharacterFormatting];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.CharacterStyle] !== undefined)
                result.characterStyle = obj[__aspxRichEdit.JSONControlOptionsProperty.CharacterStyle];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.Fields] !== undefined)
                result.fields = obj[__aspxRichEdit.JSONControlOptionsProperty.Fields];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.Hyperlinks] !== undefined)
                result.hyperlinks = obj[__aspxRichEdit.JSONControlOptionsProperty.Hyperlinks];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.InlinePictures] !== undefined)
                result.inlinePictures = obj[__aspxRichEdit.JSONControlOptionsProperty.InlinePictures];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.ParagraphFormatting] !== undefined)
                result.paragraphFormatting = obj[__aspxRichEdit.JSONControlOptionsProperty.ParagraphFormatting];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.Paragraphs] !== undefined)
                result.paragraphs = obj[__aspxRichEdit.JSONControlOptionsProperty.Paragraphs];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.ParagraphStyle] !== undefined)
                result.paragraphStyle = obj[__aspxRichEdit.JSONControlOptionsProperty.ParagraphStyle];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.ParagraphTabs] !== undefined)
                result.paragraphTabs = obj[__aspxRichEdit.JSONControlOptionsProperty.ParagraphTabs];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.Sections] !== undefined)
                result.sections = obj[__aspxRichEdit.JSONControlOptionsProperty.Sections];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.TabSymbol] !== undefined)
                result.tabSymbol = obj[__aspxRichEdit.JSONControlOptionsProperty.TabSymbol];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.Undo] !== undefined)
                result.undo = obj[__aspxRichEdit.JSONControlOptionsProperty.Undo];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.NumberingBulleted] !== undefined)
                result.numberingBulleted = obj[__aspxRichEdit.JSONControlOptionsProperty.NumberingBulleted];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.NumberingMultiLevel] !== undefined)
                result.numberingMultiLevel = obj[__aspxRichEdit.JSONControlOptionsProperty.NumberingMultiLevel];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.NumberingSimple] !== undefined)
                result.numberingSimple = obj[__aspxRichEdit.JSONControlOptionsProperty.NumberingSimple];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.HeadersFooters] !== undefined)
                result.headersFooters = obj[__aspxRichEdit.JSONControlOptionsProperty.HeadersFooters];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.Tables] !== undefined)
                result.tables = obj[__aspxRichEdit.JSONControlOptionsProperty.Tables];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.TableStyle] !== undefined)
                result.tableStyle = obj[__aspxRichEdit.JSONControlOptionsProperty.TableStyle];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.TabMarker] !== undefined)
                result.tabMarker = obj[__aspxRichEdit.JSONControlOptionsProperty.TabMarker];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.PageBreakInsertMode] !== undefined)
                result.pageBreakInsertMode = obj[__aspxRichEdit.JSONControlOptionsProperty.PageBreakInsertMode];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.AcceptsTab] !== undefined)
                result.acceptsTab = obj[__aspxRichEdit.JSONControlOptionsProperty.AcceptsTab];
            if (obj[__aspxRichEdit.JSONControlOptionsProperty.Download] !== undefined)
                result.download = obj[__aspxRichEdit.JSONControlOptionsProperty.Download];
            result.raiseClientEventsOnModificationsViaAPI = !!obj[__aspxRichEdit.JSONControlOptionsProperty.RaiseClientEventsOnModificationsViaAPI];
            return result;
        };
        JSONControlOptionsConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONControlOptionsProperty.Copy] = source.copy;
            result[__aspxRichEdit.JSONControlOptionsProperty.CreateNew] = source.createNew;
            result[__aspxRichEdit.JSONControlOptionsProperty.Cut] = source.cut;
            result[__aspxRichEdit.JSONControlOptionsProperty.Drag] = source.drag;
            result[__aspxRichEdit.JSONControlOptionsProperty.Drop] = source.drop;
            result[__aspxRichEdit.JSONControlOptionsProperty.Open] = source.open;
            result[__aspxRichEdit.JSONControlOptionsProperty.Paste] = source.paste;
            result[__aspxRichEdit.JSONControlOptionsProperty.Printing] = source.printing;
            result[__aspxRichEdit.JSONControlOptionsProperty.Save] = source.save;
            result[__aspxRichEdit.JSONControlOptionsProperty.SaveAs] = source.saveAs;
            result[__aspxRichEdit.JSONControlOptionsProperty.FullScreen] = source.fullScreen;
            result[__aspxRichEdit.JSONControlOptionsProperty.Bookmarks] = source.bookmarks;
            result[__aspxRichEdit.JSONControlOptionsProperty.CharacterFormatting] = source.characterFormatting;
            result[__aspxRichEdit.JSONControlOptionsProperty.CharacterStyle] = source.characterStyle;
            result[__aspxRichEdit.JSONControlOptionsProperty.Fields] = source.fields;
            result[__aspxRichEdit.JSONControlOptionsProperty.Hyperlinks] = source.hyperlinks;
            result[__aspxRichEdit.JSONControlOptionsProperty.InlinePictures] = source.inlinePictures;
            result[__aspxRichEdit.JSONControlOptionsProperty.ParagraphFormatting] = source.paragraphFormatting;
            result[__aspxRichEdit.JSONControlOptionsProperty.Paragraphs] = source.paragraphs;
            result[__aspxRichEdit.JSONControlOptionsProperty.ParagraphStyle] = source.paragraphStyle;
            result[__aspxRichEdit.JSONControlOptionsProperty.ParagraphTabs] = source.paragraphTabs;
            result[__aspxRichEdit.JSONControlOptionsProperty.Sections] = source.sections;
            result[__aspxRichEdit.JSONControlOptionsProperty.TabSymbol] = source.tabSymbol;
            result[__aspxRichEdit.JSONControlOptionsProperty.Undo] = source.undo;
            result[__aspxRichEdit.JSONControlOptionsProperty.NumberingBulleted] = source.numberingBulleted;
            result[__aspxRichEdit.JSONControlOptionsProperty.NumberingMultiLevel] = source.numberingMultiLevel;
            result[__aspxRichEdit.JSONControlOptionsProperty.NumberingSimple] = source.numberingSimple;
            result[__aspxRichEdit.JSONControlOptionsProperty.HeadersFooters] = source.headersFooters;
            result[__aspxRichEdit.JSONControlOptionsProperty.Tables] = source.tables;
            result[__aspxRichEdit.JSONControlOptionsProperty.TableStyle] = source.tableStyle;
            result[__aspxRichEdit.JSONControlOptionsProperty.TabMarker] = source.tabMarker;
            result[__aspxRichEdit.JSONControlOptionsProperty.PageBreakInsertMode] = source.pageBreakInsertMode;
            result[__aspxRichEdit.JSONControlOptionsProperty.AcceptsTab] = __aspxRichEdit.Utils.boolToInt(source.acceptsTab);
            result[__aspxRichEdit.JSONControlOptionsProperty.Download] = source.download;
            result[__aspxRichEdit.JSONControlOptionsProperty.RaiseClientEventsOnModificationsViaAPI] = source.raiseClientEventsOnModificationsViaAPI;
            return result;
        };
        return JSONControlOptionsConverter;
    }());
    __aspxRichEdit.JSONControlOptionsConverter = JSONControlOptionsConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONExporter = (function () {
        function JSONExporter() {
        }
        JSONExporter.exportDocumentProperties = function (documentModel) {
            var result = {};
            result[__aspxRichEdit.JSONDocumentPropertiesProperty.DefaultTabWidth] = documentModel.defaultTabWidth;
            result[__aspxRichEdit.JSONDocumentPropertiesProperty.DifferentOddAndEvenPages] = __aspxRichEdit.Utils.boolToInt(documentModel.differentOddAndEvenPages);
            result[__aspxRichEdit.JSONDocumentPropertiesProperty.DisplayBackgroundShape] = __aspxRichEdit.Utils.boolToInt(documentModel.displayBackgroundShape);
            result[__aspxRichEdit.JSONDocumentPropertiesProperty.PageBackColor] = documentModel.pageBackColor;
            result[__aspxRichEdit.JSONDocumentPropertiesProperty.DefaultCharacterProperties] =
                __aspxRichEdit.JSONMaskedCharacterPropertiesConverter.convertToJSON(documentModel.defaultCharacterProperties);
            result[__aspxRichEdit.JSONDocumentPropertiesProperty.DefaultParagraphProperties] =
                __aspxRichEdit.JSONMaskedParagraphPropertiesConverter.convertToJSON(documentModel.defaultParagraphProperties);
            result[__aspxRichEdit.JSONDocumentPropertiesProperty.DefaultTableProperties] =
                __aspxRichEdit.JSONTablePropertiesConverter.convertToJSON(documentModel.defaultTableProperties);
            result[__aspxRichEdit.JSONDocumentPropertiesProperty.DefaultTableRowProperties] =
                __aspxRichEdit.JSONTableRowPropertiesConverter.convertToJSON(documentModel.defaultTableRowProperties);
            result[__aspxRichEdit.JSONDocumentPropertiesProperty.DefaultTableCellProperties] =
                __aspxRichEdit.JSONTableCellPropertiesConverter.convertToJSON(documentModel.defaultTableCellProperties);
            return result;
        };
        JSONExporter.exportModelHeaderFooter = function (headersFooters) {
            var jsonHeadersFooters = [];
            for (var _i = 0, headersFooters_1 = headersFooters; _i < headersFooters_1.length; _i++) {
                var headerFooter = headersFooters_1[_i];
                var jsonHeaderFooter = {};
                jsonHeaderFooter[__aspxRichEdit.JSONHeaderFooterInfoProperty.Type] = headerFooter.getType();
                jsonHeaderFooter[__aspxRichEdit.JSONHeaderFooterInfoProperty.SubDocumentId] = headerFooter.subDocumentId;
                jsonHeadersFooters.push(jsonHeaderFooter);
            }
            return jsonHeadersFooters;
        };
        JSONExporter.exportSections = function (documentModel) {
            var result = [];
            for (var _i = 0, _a = documentModel.sections; _i < _a.length; _i++) {
                var section = _a[_i];
                var jsonSection = {};
                jsonSection[__aspxRichEdit.JSONSection.StartPos] = section.startLogPosition.value;
                jsonSection[__aspxRichEdit.JSONSection.Length] = section.getLength();
                jsonSection[__aspxRichEdit.JSONSection.Properties] = __aspxRichEdit.JSONSectionPropertiesConverter.convertToJSON(section.sectionProperties);
                jsonSection[__aspxRichEdit.JSONSection.Headers] = this.exportHeaderFooter(section.headers);
                jsonSection[__aspxRichEdit.JSONSection.Footers] = this.exportHeaderFooter(section.footers);
                result.push(jsonSection);
            }
            return result;
        };
        JSONExporter.exportHeaderFooter = function (headersFooters) {
            var jsonHeadersFooters = {};
            for (var type in headersFooters) {
                if (headersFooters.hasOwnProperty(type)) {
                    var jsonHeaderFooter = {};
                    jsonHeaderFooter[__aspxRichEdit.JSONHeaderFooterInfoProperty.Type] = parseInt(type);
                    jsonHeaderFooter[__aspxRichEdit.JSONHeaderFooterInfoProperty.SubDocumentId] = headersFooters[type].subDocumentId;
                    jsonHeadersFooters[type] = jsonHeaderFooter;
                }
            }
            return jsonHeadersFooters;
        };
        JSONExporter.exportOptions = function (controlOptions) {
            var result = {};
            result = __aspxRichEdit.JSONControlOptionsConverter.convertToJSON(controlOptions);
            return result;
        };
        JSONExporter.exportStringResources = function (stringResources) {
            var result = {};
            result = __aspxRichEdit.JSONStringResourcesConverter.convertToJSON(stringResources);
            return result;
        };
        return JSONExporter;
    }());
    __aspxRichEdit.JSONExporter = JSONExporter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONNumberingListExporter = (function () {
        function JSONNumberingListExporter() {
        }
        JSONNumberingListExporter.exportAbstractNumberingLists = function (documentModel) {
            var listLevelPropertiesCache = documentModel.cache.listLevelPropertiesCache;
            var maskedCharacterPropertiesCache = documentModel.cache.maskedCharacterPropertiesCache;
            var maskedParagraphPropertiesCache = documentModel.cache.maskedParagraphPropertiesCache;
            var jsonAbstractNumberingLists = [];
            for (var _i = 0, _a = documentModel.abstractNumberingLists; _i < _a.length; _i++) {
                var abstractNumberingList = _a[_i];
                var jsonAbstractNumberingList = {};
                jsonAbstractNumberingList[__aspxRichEdit.JSONAbstractNumberingListProperty.Deleted] = __aspxRichEdit.Utils.boolToInt(abstractNumberingList.deleted);
                jsonAbstractNumberingList[__aspxRichEdit.JSONAbstractNumberingListProperty.Id] = abstractNumberingList.innerId;
                var jsonLevels = [];
                for (var _b = 0, _c = abstractNumberingList.levels; _b < _c.length; _b++) {
                    var level = _c[_b];
                    var jsonLevel = {};
                    jsonLevel[__aspxRichEdit.JSONNumberingListLevelProperty.CharacterPropertiesIndex] =
                        maskedCharacterPropertiesCache.indexOf(level.getCharacterProperties());
                    jsonLevel[__aspxRichEdit.JSONNumberingListLevelProperty.ParagraphPropertiesIndex] =
                        maskedParagraphPropertiesCache.indexOf(level.getParagraphProperties());
                    jsonLevel[__aspxRichEdit.JSONNumberingListLevelProperty.ListLevelPropertiesIndex] =
                        listLevelPropertiesCache.indexOf(level.getListLevelProperties());
                    jsonLevels.push(jsonLevel);
                }
                jsonAbstractNumberingList[__aspxRichEdit.JSONAbstractNumberingListProperty.Levels] = jsonLevels;
                jsonAbstractNumberingLists.push(jsonAbstractNumberingList);
            }
            return jsonAbstractNumberingLists;
        };
        JSONNumberingListExporter.exportNumberingLists = function (documentModel) {
            var listLevelPropertiesCache = documentModel.cache.listLevelPropertiesCache;
            var maskedCharacterPropertiesCache = documentModel.cache.maskedCharacterPropertiesCache;
            var maskedParagraphPropertiesCache = documentModel.cache.maskedParagraphPropertiesCache;
            var jsonNumberingLists = [];
            for (var _i = 0, _a = documentModel.numberingLists; _i < _a.length; _i++) {
                var numberingList = _a[_i];
                var jsonNumberingList = {};
                jsonNumberingList[__aspxRichEdit.JSONNumberingListProperty.AlIndex] = numberingList.abstractNumberingListIndex;
                jsonNumberingList[__aspxRichEdit.JSONNumberingListProperty.Id] = numberingList.innerId;
                var jsonLevels = [];
                for (var _b = 0, _c = numberingList.levels; _b < _c.length; _b++) {
                    var level = _c[_b];
                    var jsonLevel = {};
                    jsonLevel[__aspxRichEdit.JSONNumberingListLevelProperty.CharacterPropertiesIndex] =
                        maskedCharacterPropertiesCache.indexOf(level.getCharacterProperties());
                    jsonLevel[__aspxRichEdit.JSONNumberingListLevelProperty.ParagraphPropertiesIndex] =
                        maskedParagraphPropertiesCache.indexOf(level.getParagraphProperties());
                    jsonLevel[__aspxRichEdit.JSONNumberingListLevelProperty.ListLevelPropertiesIndex] =
                        listLevelPropertiesCache.indexOf(level.getListLevelProperties());
                    jsonLevels.push(jsonLevel);
                }
                jsonNumberingList[__aspxRichEdit.JSONNumberingListProperty.Levels] = jsonLevels;
                jsonNumberingLists.push(jsonNumberingList);
            }
            return jsonNumberingLists;
        };
        JSONNumberingListExporter.exportAbstractNumberingListTemplates = function (documentModel) {
            var listLevelPropertiesCache = documentModel.cache.listLevelPropertiesCache;
            var maskedCharacterPropertiesCache = documentModel.cache.maskedCharacterPropertiesCache;
            var maskedParagraphPropertiesCache = documentModel.cache.maskedParagraphPropertiesCache;
            var jsonAbstractNumberingListTemplates = [];
            for (var _i = 0, _a = documentModel.abstractNumberingListTemplates; _i < _a.length; _i++) {
                var abstractNumberingListTemplate = _a[_i];
                var jsonAbstractNumberingListTemplate = {};
                jsonAbstractNumberingListTemplate[__aspxRichEdit.JSONAbstractNumberingListProperty.Deleted] = __aspxRichEdit.Utils.boolToInt(abstractNumberingListTemplate.deleted);
                jsonAbstractNumberingListTemplate[__aspxRichEdit.JSONAbstractNumberingListProperty.Id] = abstractNumberingListTemplate.innerId;
                var jsonLevels = [];
                for (var _b = 0, _c = abstractNumberingListTemplate.levels; _b < _c.length; _b++) {
                    var level = _c[_b];
                    var jsonLevel = {};
                    jsonLevel[__aspxRichEdit.JSONNumberingListLevelProperty.CharacterPropertiesIndex] =
                        maskedCharacterPropertiesCache.indexOf(level.getCharacterProperties());
                    jsonLevel[__aspxRichEdit.JSONNumberingListLevelProperty.ParagraphPropertiesIndex] =
                        maskedParagraphPropertiesCache.indexOf(level.getParagraphProperties());
                    jsonLevel[__aspxRichEdit.JSONNumberingListLevelProperty.ListLevelPropertiesIndex] =
                        listLevelPropertiesCache.indexOf(level.getListLevelProperties());
                    jsonLevels.push(jsonLevel);
                }
                jsonAbstractNumberingListTemplate[__aspxRichEdit.JSONAbstractNumberingListProperty.Levels] = jsonLevels;
                jsonAbstractNumberingListTemplates.push(jsonAbstractNumberingListTemplate);
            }
            return jsonAbstractNumberingListTemplates;
        };
        return JSONNumberingListExporter;
    }());
    __aspxRichEdit.JSONNumberingListExporter = JSONNumberingListExporter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONStringResourcesConverter = (function () {
        function JSONStringResourcesConverter() {
        }
        JSONStringResourcesConverter.convertFromJSON = function (obj) {
            var result = new __aspxRichEdit.StringResources();
            result.evenPageFooter = obj[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.EvenPageFooter];
            result.evenPageHeader = obj[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.EvenPageHeader];
            result.firstPageFooter = obj[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.FirstPageFooter];
            result.firstPageHeader = obj[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.FirstPageHeader];
            result.footer = obj[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.Footer];
            result.header = obj[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.Header];
            result.oddPageFooter = obj[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.OddPageFooter];
            result.oddPageHeader = obj[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.OddPageHeader];
            result.sameAsPrevious = obj[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.SameAsPrevious];
            return result;
        };
        JSONStringResourcesConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.EvenPageFooter] = source.evenPageFooter;
            result[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.EvenPageHeader] = source.evenPageHeader;
            result[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.FirstPageFooter] = source.firstPageFooter;
            result[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.FirstPageHeader] = source.firstPageHeader;
            result[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.Footer] = source.footer;
            result[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.Header] = source.header;
            result[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.OddPageFooter] = source.oddPageFooter;
            result[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.OddPageHeader] = source.oddPageHeader;
            result[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.SameAsPrevious] = source.sameAsPrevious;
            return result;
        };
        return JSONStringResourcesConverter;
    }());
    __aspxRichEdit.JSONStringResourcesConverter = JSONStringResourcesConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONSubDocumentExporter = (function () {
        function JSONSubDocumentExporter() {
        }
        JSONSubDocumentExporter.exportSubDocument = function (subDocument, content) {
            __aspxRichEdit.JSONTableExporter.exportTables(subDocument, content[__aspxRichEdit.JSONEnumLoadPieceTable.Tables] = []);
            JSONSubDocumentExporter.exportFields(subDocument, content[__aspxRichEdit.JSONEnumLoadPieceTable.Fields] = []);
            JSONSubDocumentExporter.exportBookmarks(subDocument, content[__aspxRichEdit.JSONEnumLoadPieceTable.Bookmarks] = []);
            JSONSubDocumentExporter.exportParagraphs(subDocument, content[__aspxRichEdit.JSONEnumLoadPieceTable.Paragraphs] = []);
            JSONSubDocumentExporter.exportChunks(subDocument, content[__aspxRichEdit.JSONEnumLoadPieceTable.Chunks] = []);
            JSONSubDocumentExporter.exportRangePermissions(subDocument, content[__aspxRichEdit.JSONEnumLoadPieceTable.RangePermissions] = []);
        };
        JSONSubDocumentExporter.exportFields = function (subDocument, jsonFields) {
            for (var _i = 0, _a = subDocument.fields; _i < _a.length; _i++) {
                var field = _a[_i];
                var jsonField = {};
                jsonField[__aspxRichEdit.JSONFieldProperty.StartPos] = field.getAllFieldInterval().start;
                jsonField[__aspxRichEdit.JSONFieldProperty.SeparatorPos] = field.getSeparatorPosition();
                jsonField[__aspxRichEdit.JSONFieldProperty.EndPos] = field.getAllFieldInterval().end;
                if (field.getHyperlinkInfo()) {
                    jsonField[__aspxRichEdit.JSONFieldProperty.Uri] = field.getHyperlinkInfo().uri;
                    jsonField[__aspxRichEdit.JSONFieldProperty.Anchor] = field.getHyperlinkInfo().anchor;
                    jsonField[__aspxRichEdit.JSONFieldProperty.Tip] = field.getHyperlinkInfo().tip;
                    jsonField[__aspxRichEdit.JSONFieldProperty.Visited] = __aspxRichEdit.Utils.boolToInt(field.getHyperlinkInfo().visited);
                }
                else
                    jsonField[__aspxRichEdit.JSONFieldProperty.NoInfo] = 1;
                jsonFields.push(jsonField);
            }
        };
        JSONSubDocumentExporter.exportBookmarks = function (subDocument, jsonBookmarks) {
            for (var _i = 0, _a = subDocument.bookmarks; _i < _a.length; _i++) {
                var bookmark = _a[_i];
                var jsonBookmark = {};
                jsonBookmark[__aspxRichEdit.JSONBookmarkProperty.StartPos] = bookmark.start;
                jsonBookmark[__aspxRichEdit.JSONBookmarkProperty.Length] = bookmark.interval.length;
                jsonBookmark[__aspxRichEdit.JSONBookmarkProperty.Name] = bookmark.name;
                jsonBookmarks.push(jsonBookmark);
            }
        };
        JSONSubDocumentExporter.exportParagraphs = function (subDocument, jsonParagraphs) {
            var paragraphs = subDocument.paragraphs;
            var parStyles = subDocument.documentModel.paragraphStyles;
            var maskedParagraphPropertiesCache = subDocument.documentModel.cache.maskedParagraphPropertiesCache;
            for (var _i = 0, paragraphs_1 = paragraphs; _i < paragraphs_1.length; _i++) {
                var modelParagraph = paragraphs_1[_i];
                var jsonParagraph = {};
                var maskedParagraphPropertiesIndex = maskedParagraphPropertiesCache.indexOf(modelParagraph.maskedParagraphProperties);
                jsonParagraph[__aspxRichEdit.JSONParagraphProperty.MaskedParagraphPropertiesIndex] = maskedParagraphPropertiesIndex;
                jsonParagraph[__aspxRichEdit.JSONParagraphProperty.ParagraphStyleIndex] = parStyles.indexOf(modelParagraph.paragraphStyle);
                jsonParagraph[__aspxRichEdit.JSONParagraphProperty.LogPosition] = modelParagraph.startLogPosition.value;
                jsonParagraph[__aspxRichEdit.JSONParagraphProperty.Length] = modelParagraph.length;
                jsonParagraph[__aspxRichEdit.JSONParagraphProperty.Tabs] = __aspxRichEdit.JSONTabConverter.convertFromTabPropertiesToJSON(modelParagraph.tabs);
                jsonParagraph[__aspxRichEdit.JSONParagraphProperty.ListIndex] = modelParagraph.numberingListIndex;
                jsonParagraph[__aspxRichEdit.JSONParagraphProperty.ListLevelIndex] = modelParagraph.listLevelIndex;
                jsonParagraphs.push(jsonParagraph);
            }
        };
        JSONSubDocumentExporter.exportChunks = function (subDocument, jsonChunks) {
            var chunks = subDocument.chunks;
            var characterStyles = subDocument.documentModel.characterStyles;
            var maskedCharacterPropertiesCache = subDocument.documentModel.cache.maskedCharacterPropertiesCache;
            for (var _i = 0, chunks_1 = chunks; _i < chunks_1.length; _i++) {
                var chunk = chunks_1[_i];
                var jsonChunk = {};
                jsonChunk[__aspxRichEdit.JSONChunkProperty.StartPos] = chunk.startLogPosition.value;
                jsonChunk[__aspxRichEdit.JSONChunkProperty.TextBuffer] = chunk.textBuffer;
                jsonChunk[__aspxRichEdit.JSONChunkProperty.IsLast] = __aspxRichEdit.Utils.boolToInt(chunk.isLast);
                var jsonRuns = [];
                for (var _a = 0, _b = chunk.textRuns; _a < _b.length; _a++) {
                    var run = _b[_a];
                    var jsonRun = {};
                    var maskedCharacterPropertiesIndex = maskedCharacterPropertiesCache.indexOf(run.maskedCharacterProperties);
                    jsonRun[__aspxRichEdit.JSONRunBaseProperty.MaskedCharacterPropertiesCacheIndex] = maskedCharacterPropertiesIndex;
                    jsonRun[__aspxRichEdit.JSONRunBaseProperty.Type] = run.getType();
                    jsonRun[__aspxRichEdit.JSONRunBaseProperty.Offset] = run.startOffset;
                    jsonRun[__aspxRichEdit.JSONRunBaseProperty.Length] = run.getLength();
                    jsonRun[__aspxRichEdit.JSONRunBaseProperty.CharacterStyleIndex] = characterStyles.indexOf(run.characterStyle);
                    jsonRuns.push(jsonRun);
                }
                jsonChunk[__aspxRichEdit.JSONChunkProperty.Runs] = jsonRuns;
                jsonChunks.push(jsonChunk);
            }
        };
        JSONSubDocumentExporter.exportRangePermissions = function (subDocument, jsonRangePermissions) {
            for (var _i = 0, _a = subDocument.rangePermissions; _i < _a.length; _i++) {
                var rangePermission = _a[_i];
                var jsonRangePermission = {};
                jsonRangePermission[__aspxRichEdit.JSONRangePermissionProperty.Start] = rangePermission.start;
                jsonRangePermission[__aspxRichEdit.JSONRangePermissionProperty.Length] = rangePermission.interval.length;
                jsonRangePermission[__aspxRichEdit.JSONRangePermissionProperty.UserName] = rangePermission.userName;
                jsonRangePermission[__aspxRichEdit.JSONRangePermissionProperty.Group] = rangePermission.group;
                jsonRangePermissions.push(jsonRangePermission);
            }
        };
        return JSONSubDocumentExporter;
    }());
    __aspxRichEdit.JSONSubDocumentExporter = JSONSubDocumentExporter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONTableExporter = (function () {
        function JSONTableExporter() {
        }
        JSONTableExporter.exportTables = function (subDocument, jsonTables) {
            var tableStyles = subDocument.documentModel.tableStyles;
            for (var _i = 0, _a = subDocument.tables; _i < _a.length; _i++) {
                var table = _a[_i];
                var jsonTable = {};
                jsonTable[__aspxRichEdit.JSONEnumTable.StyleIndex] = tableStyles.indexOf(table.style);
                jsonTable[__aspxRichEdit.JSONEnumTable.NestedLevel] = table.nestedLevel;
                var jsonTableProperties = __aspxRichEdit.JSONTablePropertiesConverter.convertToJSON(table.properties);
                jsonTable[__aspxRichEdit.JSONEnumTable.TableProperties] = jsonTableProperties;
                jsonTable[__aspxRichEdit.JSONEnumTable.Index] = table.index;
                var jsonTableWidthUnitProperty = __aspxRichEdit.JSONTableWidthUnitConverter.convertToJSON(table.preferredWidth);
                jsonTable[__aspxRichEdit.JSONEnumTable.PreferredWidth] = jsonTableWidthUnitProperty;
                jsonTable[__aspxRichEdit.JSONEnumTable.LookTypes] = table.lookTypes;
                if (table.parentCell) {
                    var parentCell = {};
                    parentCell[__aspxRichEdit.JSONEnumTableParentCellInfo.CellIndex] = table.parentCell.parentRow.cells.indexOf(table.parentCell);
                    parentCell[__aspxRichEdit.JSONEnumTableParentCellInfo.RowIndex] = table.rows.indexOf(table.parentCell.parentRow);
                    parentCell[__aspxRichEdit.JSONEnumTableParentCellInfo.TableIndex] = table.parentCell.parentRow.parentTable.index;
                    jsonTable[__aspxRichEdit.JSONEnumTable.ParentCell] = parentCell;
                }
                JSONTableExporter.exportTableRows(subDocument, table.rows, jsonTable[__aspxRichEdit.JSONEnumTable.Rows] = []);
                jsonTables.push(jsonTable);
            }
        };
        JSONTableExporter.exportTableRows = function (subDocument, tableRows, jsonRows) {
            var tableRowPropertiesCache = subDocument.documentModel.cache.tableRowPropertiesCache;
            for (var _i = 0, tableRows_1 = tableRows; _i < tableRows_1.length; _i++) {
                var row = tableRows_1[_i];
                var jsonRow = {};
                jsonRow[__aspxRichEdit.JSONEnumTableRow.GridBefore] = row.gridBefore;
                jsonRow[__aspxRichEdit.JSONEnumTableRow.GridAfter] = row.gridAfter;
                jsonRow[__aspxRichEdit.JSONEnumTableRow.WidthAfter] = __aspxRichEdit.JSONTableWidthUnitConverter.convertToJSON(row.widthAfter);
                jsonRow[__aspxRichEdit.JSONEnumTableRow.WidthBefore] = __aspxRichEdit.JSONTableWidthUnitConverter.convertToJSON(row.widthBefore);
                var tableRowPropertiesIndex = tableRowPropertiesCache.indexOf(row.properties);
                jsonRow[__aspxRichEdit.JSONEnumTableRow.TableRowPropertiesIndex] = tableRowPropertiesIndex;
                jsonRow[__aspxRichEdit.JSONEnumTableRow.TablePropertiesException] =
                    __aspxRichEdit.JSONTablePropertiesConverter.convertToJSON(row.tablePropertiesException);
                jsonRow[__aspxRichEdit.JSONEnumTableRow.Height] = __aspxRichEdit.JSONTableHeightUnitConverter.convertToJSON(row.height);
                JSONTableExporter.exportCells(subDocument, row.cells, jsonRow[__aspxRichEdit.JSONEnumTableRow.Cells] = []);
                jsonRows.push(jsonRow);
            }
        };
        JSONTableExporter.exportCells = function (subDocument, cells, jsonCells) {
            var cellStyles = subDocument.documentModel.tableCellStyles;
            var tableCellPropertiesCache = subDocument.documentModel.cache.tableCellPropertiesCache;
            for (var _i = 0, cells_2 = cells; _i < cells_2.length; _i++) {
                var cell = cells_2[_i];
                var jsonCell = {};
                jsonCell[__aspxRichEdit.JSONEnumTableCell.StyleIndex] = cellStyles.indexOf(cell.style);
                var tableCellPropertiesIndex = tableCellPropertiesCache.indexOf(cell.properties);
                jsonCell[__aspxRichEdit.JSONEnumTableCell.TableCellPropertiesIndex] = tableCellPropertiesIndex;
                jsonCell[__aspxRichEdit.JSONEnumTableCell.ColumnSpan] = cell.columnSpan;
                jsonCell[__aspxRichEdit.JSONEnumTableCell.PreferredWidth] = __aspxRichEdit.JSONTableWidthUnitConverter.convertToJSON(cell.preferredWidth);
                jsonCell[__aspxRichEdit.JSONEnumTableCell.VerticalMerging] = cell.verticalMerging;
                jsonCell[__aspxRichEdit.JSONEnumTableCell.StartParagraphPosition] = cell.startParagraphPosition.value;
                jsonCell[__aspxRichEdit.JSONEnumTableCell.EndParagraphPosition] = cell.endParagrapPosition.value;
                jsonCells.push(jsonCell);
            }
        };
        return JSONTableExporter;
    }());
    __aspxRichEdit.JSONTableExporter = JSONTableExporter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONBorderInfoConverter = (function () {
        function JSONBorderInfoConverter() {
        }
        JSONBorderInfoConverter.convertFromJSON = function (obj, colorModelInfoCache) {
            var result = new __aspxRichEdit.BorderInfo();
            result.style = obj[__aspxRichEdit.JSONBorderBaseProperty.Style];
            result.color = colorModelInfoCache.getItemByJsonKey(obj[__aspxRichEdit.JSONBorderBaseProperty.ColorIndex]);
            if (!result.color)
                result.color = __aspxRichEdit.JSONColorModelInfoConverter.convertFromJSON(obj[__aspxRichEdit.JSONBorderBaseProperty.Color]);
            result.width = obj[__aspxRichEdit.JSONBorderBaseProperty.Width];
            result.offset = obj[__aspxRichEdit.JSONBorderBaseProperty.Offset];
            result.frame = !!obj[__aspxRichEdit.JSONBorderBaseProperty.Frame];
            result.shadow = !!obj[__aspxRichEdit.JSONBorderBaseProperty.Shadow];
            return result;
        };
        JSONBorderInfoConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONBorderBaseProperty.Style] = source.style;
            result[__aspxRichEdit.JSONBorderBaseProperty.Color] = __aspxRichEdit.JSONColorModelInfoConverter.convertToJSON(source.color);
            result[__aspxRichEdit.JSONBorderBaseProperty.Width] = source.width;
            result[__aspxRichEdit.JSONBorderBaseProperty.Offset] = source.offset;
            result[__aspxRichEdit.JSONBorderBaseProperty.Frame] = __aspxRichEdit.Utils.boolToInt(source.frame);
            result[__aspxRichEdit.JSONBorderBaseProperty.Shadow] = __aspxRichEdit.Utils.boolToInt(source.shadow);
            return result;
        };
        return JSONBorderInfoConverter;
    }());
    __aspxRichEdit.JSONBorderInfoConverter = JSONBorderInfoConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONColorModelInfoConverter = (function () {
        function JSONColorModelInfoConverter() {
        }
        JSONColorModelInfoConverter.convertFromJSON = function (obj) {
            switch (obj[__aspxRichEdit.JSONColorModelInfoProperty.ColorType]) {
                case __aspxRichEdit.ColorType.Auto:
                    return __aspxRichEdit.ColorModelInfo.auto;
                case __aspxRichEdit.ColorType.Index:
                    return __aspxRichEdit.ColorModelInfo.makeByColorIndex(obj[__aspxRichEdit.JSONColorModelInfoProperty.ColorIndex], obj[__aspxRichEdit.JSONColorModelInfoProperty.Tint]);
                case __aspxRichEdit.ColorType.Rgb:
                    return __aspxRichEdit.ColorModelInfo.makeByColor(obj[__aspxRichEdit.JSONColorModelInfoProperty.Rgb], obj[__aspxRichEdit.JSONColorModelInfoProperty.Tint]);
                case __aspxRichEdit.ColorType.Theme:
                    return __aspxRichEdit.ColorModelInfo.makeByThemeColorIndex(obj[__aspxRichEdit.JSONColorModelInfoProperty.ThemeColorIndex], obj[__aspxRichEdit.JSONColorModelInfoProperty.Tint]);
            }
        };
        JSONColorModelInfoConverter.convertToJSON = function (source) {
            return source.toJSON();
        };
        return JSONColorModelInfoConverter;
    }());
    __aspxRichEdit.JSONColorModelInfoConverter = JSONColorModelInfoConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONDrawingColorConverter = (function () {
        function JSONDrawingColorConverter() {
        }
        JSONDrawingColorConverter.convertFromJSON = function (obj) {
            var info = JSONDrawingColorModelInfoConverter.convertFromJSON(obj[__aspxRichEdit.JSONSDrawingColorProperty.Color]);
            return new __aspxRichEdit.DrawingColor(info);
        };
        return JSONDrawingColorConverter;
    }());
    __aspxRichEdit.JSONDrawingColorConverter = JSONDrawingColorConverter;
    var JSONDrawingColorModelInfoConverter = (function () {
        function JSONDrawingColorModelInfoConverter() {
        }
        JSONDrawingColorModelInfoConverter.convertFromJSON = function (obj) {
            var result = new __aspxRichEdit.DrawingColorModelInfo();
            result._rgb = obj[__aspxRichEdit.JSONSDrawingColorModelInfoProperty.Rgb];
            result._systemColor = obj[__aspxRichEdit.JSONSDrawingColorModelInfoProperty.System];
            result._schemeColor = obj[__aspxRichEdit.JSONSDrawingColorModelInfoProperty.Scheme];
            result._preset = obj[__aspxRichEdit.JSONSDrawingColorModelInfoProperty.Preset];
            result._hsl = JSONColorHSLConverter.convertFromJSON(obj[__aspxRichEdit.JSONSDrawingColorModelInfoProperty.Hsl]);
            result._scRgb = JSONScRGBColorConverter.convertFromJSON(obj[__aspxRichEdit.JSONSDrawingColorModelInfoProperty.ScRgb]);
            result._colorType = obj[__aspxRichEdit.JSONSDrawingColorModelInfoProperty.ColorType];
            return result;
        };
        return JSONDrawingColorModelInfoConverter;
    }());
    __aspxRichEdit.JSONDrawingColorModelInfoConverter = JSONDrawingColorModelInfoConverter;
    var JSONColorHSLConverter = (function () {
        function JSONColorHSLConverter() {
        }
        JSONColorHSLConverter.convertFromJSON = function (obj) {
            var hue = obj[__aspxRichEdit.JSONSColorHSLProperty.Hue];
            var saturation = obj[__aspxRichEdit.JSONSColorHSLProperty.Saturation];
            var luminance = obj[__aspxRichEdit.JSONSColorHSLProperty.Luminance];
            return new __aspxRichEdit.ColorHSL(hue, saturation, luminance);
        };
        return JSONColorHSLConverter;
    }());
    __aspxRichEdit.JSONColorHSLConverter = JSONColorHSLConverter;
    var JSONScRGBColorConverter = (function () {
        function JSONScRGBColorConverter() {
        }
        JSONScRGBColorConverter.convertFromJSON = function (obj) {
            var scR = obj[__aspxRichEdit.JSONSScRGBColorProperty.ScR];
            var scG = obj[__aspxRichEdit.JSONSScRGBColorProperty.ScG];
            var scB = obj[__aspxRichEdit.JSONSScRGBColorProperty.ScB];
            return new __aspxRichEdit.ScRGBColor(scR, scG, scB);
        };
        return JSONScRGBColorConverter;
    }());
    __aspxRichEdit.JSONScRGBColorConverter = JSONScRGBColorConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONFontInfoConverter = (function () {
        function JSONFontInfoConverter() {
        }
        JSONFontInfoConverter.convertFromJSON = function (obj, result) {
            if (result === void 0) { result = new __aspxRichEdit.FontInfo(); }
            result.name = obj[__aspxRichEdit.JSONFontInfoProperty.Name];
            result.scriptMultiplier = obj[__aspxRichEdit.JSONFontInfoProperty.ScriptMultiplier];
            result.cssString = obj[__aspxRichEdit.JSONFontInfoProperty.CssString];
            result.canBeSet = !!obj[__aspxRichEdit.JSONFontInfoProperty.CanBeSet];
            result.subScriptOffset = obj[__aspxRichEdit.JSONFontInfoProperty.SubScriptOffset];
            result.isLoad = true;
            result.resetBaseLine();
            return result;
        };
        JSONFontInfoConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONFontInfoProperty.Name] = source.name;
            result[__aspxRichEdit.JSONFontInfoProperty.ScriptMultiplier] = source.scriptMultiplier;
            result[__aspxRichEdit.JSONFontInfoProperty.CssString] = source.cssString;
            result[__aspxRichEdit.JSONFontInfoProperty.CanBeSet] = __aspxRichEdit.Utils.boolToInt(source.canBeSet);
            result[__aspxRichEdit.JSONFontInfoProperty.SubScriptOffset] = source.subScriptOffset;
            return result;
        };
        return JSONFontInfoConverter;
    }());
    __aspxRichEdit.JSONFontInfoConverter = JSONFontInfoConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONImporter = (function () {
        function JSONImporter() {
        }
        JSONImporter.importDocumentProperties = function (documentModel, content) {
            documentModel.defaultTabWidth = content[__aspxRichEdit.JSONDocumentPropertiesProperty.DefaultTabWidth];
            documentModel.differentOddAndEvenPages = !!content[__aspxRichEdit.JSONDocumentPropertiesProperty.DifferentOddAndEvenPages];
            documentModel.displayBackgroundShape = !!content[__aspxRichEdit.JSONDocumentPropertiesProperty.DisplayBackgroundShape];
            documentModel.pageBackColor = content[__aspxRichEdit.JSONDocumentPropertiesProperty.PageBackColor];
            documentModel.setDefaultCharacterProperties(content[__aspxRichEdit.JSONDocumentPropertiesProperty.DefaultCharacterProperties]);
            documentModel.setDefaultParagraphProperties(content[__aspxRichEdit.JSONDocumentPropertiesProperty.DefaultParagraphProperties]);
            documentModel.defaultTableProperties = __aspxRichEdit.JSONTablePropertiesConverter.convertFromJSON(content[__aspxRichEdit.JSONDocumentPropertiesProperty.DefaultTableProperties], documentModel.cache.colorModelInfoCache, documentModel.cache.shadingInfoCache);
            documentModel.defaultTableRowProperties = documentModel.cache.tableRowPropertiesCache.getItem(__aspxRichEdit.JSONTableRowPropertiesConverter.convertFromJSON(content[__aspxRichEdit.JSONDocumentPropertiesProperty.DefaultTableRowProperties]));
            documentModel.defaultTableCellProperties = documentModel.cache.tableCellPropertiesCache.getItem(__aspxRichEdit.JSONTableCellPropertiesConverter.convertFromJSON(content[__aspxRichEdit.JSONDocumentPropertiesProperty.DefaultTableCellProperties], documentModel.cache.colorModelInfoCache, documentModel.cache.shadingInfoCache));
            var protectionProp = content[__aspxRichEdit.JSONDocumentPropertiesProperty.ProtectionProperties];
            var enforceProtection = !!(protectionProp[__aspxRichEdit.JSONDocumentProtectionPropertiesProperty.EnforceProtection]);
            var protectionType = protectionProp[__aspxRichEdit.JSONDocumentProtectionPropertiesProperty.ProtectionType];
            documentModel.isDocumentProtectionEnabled = enforceProtection && (protectionType === __aspxRichEdit.DocumentProtectionType.ReadOnly || protectionType === __aspxRichEdit.DocumentProtectionType.AllowComments);
            ;
        };
        JSONImporter.importCompatibilitySettings = function (documentModel, json) {
            documentModel.compatibilitySettings.dontJustifyLinesEndingInSoftLineBreak = !!json[__aspxRichEdit.JSONCompatibilitySettingsProperty.DontJustifyLinesEndingInSoftLineBreak];
        };
        JSONImporter.importModelHeaderFooter = function (modelContainer, jsonContent, constr) {
            for (var _i = 0, jsonContent_1 = jsonContent; _i < jsonContent_1.length; _i++) {
                var content = jsonContent_1[_i];
                var headerFooter = new constr(content[__aspxRichEdit.JSONHeaderFooterInfoProperty.SubDocumentId]);
                headerFooter.headerFooterType = content[__aspxRichEdit.JSONHeaderFooterInfoProperty.Type];
                modelContainer.push(headerFooter);
            }
        };
        JSONImporter.importSections = function (documentModel, jsonSections) {
            for (var _i = 0, jsonSections_1 = jsonSections; _i < jsonSections_1.length; _i++) {
                var jsonSection_1 = jsonSections_1[_i];
                documentModel.sections.push(new __aspxRichEdit.Section(documentModel, documentModel.mainSubDocument.positionManager.registerPosition(jsonSection_1[__aspxRichEdit.JSONSection.StartPos]), jsonSection_1[__aspxRichEdit.JSONSection.Length], __aspxRichEdit.JSONSectionPropertiesConverter.convertFromJSON(jsonSection_1[__aspxRichEdit.JSONSection.Properties])));
            }
            for (var i = 0, jsonSection; jsonSection = jsonSections[i]; i++) {
                var section = documentModel.sections[i];
                this.importHeaderFooter(section.headers, jsonSection[__aspxRichEdit.JSONSection.Headers]);
                this.importHeaderFooter(section.footers, jsonSection[__aspxRichEdit.JSONSection.Footers]);
            }
        };
        JSONImporter.importHeaderFooter = function (container, jsonSection) {
            for (var type in jsonSection) {
                if (!jsonSection.hasOwnProperty(type))
                    continue;
                container.setObjectIndex(parseInt(type), jsonSection[type]);
            }
        };
        JSONImporter.importOptions = function (controlOptions, json) {
            if (!json)
                return;
            if (json[__aspxRichEdit.JSONControlOptionsProperty.Copy] !== undefined)
                controlOptions.copy = json[__aspxRichEdit.JSONControlOptionsProperty.Copy];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.CreateNew] !== undefined)
                controlOptions.createNew = json[__aspxRichEdit.JSONControlOptionsProperty.CreateNew];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.Cut] !== undefined)
                controlOptions.cut = json[__aspxRichEdit.JSONControlOptionsProperty.Cut];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.Drag] !== undefined)
                controlOptions.drag = json[__aspxRichEdit.JSONControlOptionsProperty.Drag];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.Drop] !== undefined)
                controlOptions.drop = json[__aspxRichEdit.JSONControlOptionsProperty.Drop];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.Open] !== undefined)
                controlOptions.open = json[__aspxRichEdit.JSONControlOptionsProperty.Open];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.Paste] !== undefined)
                controlOptions.paste = json[__aspxRichEdit.JSONControlOptionsProperty.Paste];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.Printing] !== undefined)
                controlOptions.printing = json[__aspxRichEdit.JSONControlOptionsProperty.Printing];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.Save] !== undefined)
                controlOptions.save = json[__aspxRichEdit.JSONControlOptionsProperty.Save];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.SaveAs] !== undefined)
                controlOptions.saveAs = json[__aspxRichEdit.JSONControlOptionsProperty.SaveAs];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.FullScreen] !== undefined)
                controlOptions.fullScreen = json[__aspxRichEdit.JSONControlOptionsProperty.FullScreen];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.Bookmarks] !== undefined)
                controlOptions.bookmarks = json[__aspxRichEdit.JSONControlOptionsProperty.Bookmarks];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.CharacterFormatting] !== undefined)
                controlOptions.characterFormatting = json[__aspxRichEdit.JSONControlOptionsProperty.CharacterFormatting];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.CharacterStyle] !== undefined)
                controlOptions.characterStyle = json[__aspxRichEdit.JSONControlOptionsProperty.CharacterStyle];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.Fields] !== undefined)
                controlOptions.fields = json[__aspxRichEdit.JSONControlOptionsProperty.Fields];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.Hyperlinks] !== undefined)
                controlOptions.hyperlinks = json[__aspxRichEdit.JSONControlOptionsProperty.Hyperlinks];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.InlinePictures] !== undefined)
                controlOptions.inlinePictures = json[__aspxRichEdit.JSONControlOptionsProperty.InlinePictures];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.ParagraphFormatting] !== undefined)
                controlOptions.paragraphFormatting = json[__aspxRichEdit.JSONControlOptionsProperty.ParagraphFormatting];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.Paragraphs] !== undefined)
                controlOptions.paragraphs = json[__aspxRichEdit.JSONControlOptionsProperty.Paragraphs];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.ParagraphStyle] !== undefined)
                controlOptions.paragraphStyle = json[__aspxRichEdit.JSONControlOptionsProperty.ParagraphStyle];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.ParagraphTabs] !== undefined)
                controlOptions.paragraphTabs = json[__aspxRichEdit.JSONControlOptionsProperty.ParagraphTabs];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.Sections] !== undefined)
                controlOptions.sections = json[__aspxRichEdit.JSONControlOptionsProperty.Sections];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.TabSymbol] !== undefined)
                controlOptions.tabSymbol = json[__aspxRichEdit.JSONControlOptionsProperty.TabSymbol];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.Undo] !== undefined)
                controlOptions.undo = json[__aspxRichEdit.JSONControlOptionsProperty.Undo];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.NumberingBulleted] !== undefined)
                controlOptions.numberingBulleted = json[__aspxRichEdit.JSONControlOptionsProperty.NumberingBulleted];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.NumberingMultiLevel] !== undefined)
                controlOptions.numberingMultiLevel = json[__aspxRichEdit.JSONControlOptionsProperty.NumberingMultiLevel];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.NumberingSimple] !== undefined)
                controlOptions.numberingSimple = json[__aspxRichEdit.JSONControlOptionsProperty.NumberingSimple];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.HeadersFooters] !== undefined)
                controlOptions.headersFooters = json[__aspxRichEdit.JSONControlOptionsProperty.HeadersFooters];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.Tables] !== undefined)
                controlOptions.tables = json[__aspxRichEdit.JSONControlOptionsProperty.Tables];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.TableStyle] !== undefined)
                controlOptions.tableStyle = json[__aspxRichEdit.JSONControlOptionsProperty.TableStyle];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.TabMarker] !== undefined)
                controlOptions.tabMarker = json[__aspxRichEdit.JSONControlOptionsProperty.TabMarker];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.PageBreakInsertMode] !== undefined)
                controlOptions.pageBreakInsertMode = json[__aspxRichEdit.JSONControlOptionsProperty.PageBreakInsertMode];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.AcceptsTab] !== undefined)
                controlOptions.acceptsTab = !!json[__aspxRichEdit.JSONControlOptionsProperty.AcceptsTab];
            if (json[__aspxRichEdit.JSONControlOptionsProperty.Download] !== undefined)
                controlOptions.download = json[__aspxRichEdit.JSONControlOptionsProperty.Download];
            controlOptions.raiseClientEventsOnModificationsViaAPI = !!json[__aspxRichEdit.JSONControlOptionsProperty.RaiseClientEventsOnModificationsViaAPI];
        };
        JSONImporter.importStringResources = function (stringResources, obj) {
            if (!obj)
                return;
            stringResources.evenPageFooter = obj[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.EvenPageFooter];
            stringResources.evenPageHeader = obj[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.EvenPageHeader];
            stringResources.firstPageFooter = obj[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.FirstPageFooter];
            stringResources.firstPageHeader = obj[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.FirstPageHeader];
            stringResources.footer = obj[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.Footer];
            stringResources.header = obj[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.Header];
            stringResources.oddPageFooter = obj[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.OddPageFooter];
            stringResources.oddPageHeader = obj[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.OddPageHeader];
            stringResources.sameAsPrevious = obj[__aspxRichEdit.JSONHeaderFooterStringResourcesProperty.SameAsPrevious];
        };
        JSONImporter.importImages = function (cache, imageCorrespondence, obj) {
            if (obj) {
                var convertedImages = void 0;
                if (imageCorrespondence) {
                    convertedImages = __aspxRichEdit.ListUtils.map(obj, function (image) {
                        return new __aspxRichEdit.MapCreatorNumberAsKey()
                            .add(__aspxRichEdit.JSONCachedImageProperty.Id, imageCorrespondence[image[__aspxRichEdit.JSONCachedImageProperty.Id]])
                            .add(__aspxRichEdit.JSONCachedImageProperty.Base64EncodedImage, image[__aspxRichEdit.JSONCachedImageProperty.Base64EncodedImage])
                            .get();
                    });
                }
                else
                    convertedImages = obj;
                for (var _i = 0, convertedImages_1 = convertedImages; _i < convertedImages_1.length; _i++) {
                    var image = convertedImages_1[_i];
                    JSONImageCacheImageInfoConverter.pushToCache(image, cache);
                }
            }
        };
        return JSONImporter;
    }());
    __aspxRichEdit.JSONImporter = JSONImporter;
    var JSONImageCacheImageInfoConverter = (function () {
        function JSONImageCacheImageInfoConverter() {
        }
        JSONImageCacheImageInfoConverter.pushToCache = function (obj, imageCache) {
            imageCache.add(obj[__aspxRichEdit.JSONCachedImageProperty.Id], "data:image/png;base64," + obj[__aspxRichEdit.JSONCachedImageProperty.Base64EncodedImage]);
        };
        return JSONImageCacheImageInfoConverter;
    }());
    __aspxRichEdit.JSONImageCacheImageInfoConverter = JSONImageCacheImageInfoConverter;
    var JSONFixedIntervalConverter = (function () {
        function JSONFixedIntervalConverter() {
        }
        JSONFixedIntervalConverter.convertFromJSON = function (obj) {
            return new __aspxRichEdit.FixedInterval(obj[__aspxRichEdit.JSONFixedInterval.Start], obj[__aspxRichEdit.JSONFixedInterval.Length]);
        };
        JSONFixedIntervalConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONFixedInterval.Start] = source.start;
            result[__aspxRichEdit.JSONFixedInterval.Length] = source.length;
            return result;
        };
        JSONFixedIntervalConverter.convertListToJSON = function (intervals) {
            return __aspxRichEdit.ListUtils.accumulate(intervals, [], function (result, interval) {
                result.push(JSONFixedIntervalConverter.convertToJSON(interval));
                return result;
            });
        };
        JSONFixedIntervalConverter.convertListFromJSON = function (jsonIntervals) {
            return __aspxRichEdit.ListUtils.accumulate(jsonIntervals, [], function (result, jsonInterval) {
                result.push(JSONFixedIntervalConverter.convertFromJSON(jsonInterval));
                return result;
            });
        };
        return JSONFixedIntervalConverter;
    }());
    __aspxRichEdit.JSONFixedIntervalConverter = JSONFixedIntervalConverter;
    var SizeExporter = (function () {
        function SizeExporter() {
        }
        SizeExporter.convertFromJSON = function (obj) {
            return new __aspxRichEdit.Size(obj[__aspxRichEdit.JSONSize.Width], obj[__aspxRichEdit.JSONSize.Height]);
        };
        SizeExporter.convertToJSON = function (obj) {
            var jsonSize = {};
            jsonSize[__aspxRichEdit.JSONSize.Width] = obj.width;
            jsonSize[__aspxRichEdit.JSONSize.Height] = obj.height;
            return jsonSize;
        };
        SizeExporter.convertToJSONSeparately = function (width, height) {
            var jsonSize = {};
            jsonSize[__aspxRichEdit.JSONSize.Width] = width;
            jsonSize[__aspxRichEdit.JSONSize.Height] = height;
            return jsonSize;
        };
        return SizeExporter;
    }());
    __aspxRichEdit.SizeExporter = SizeExporter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONMaskedCharacterPropertiesConverter = (function () {
        function JSONMaskedCharacterPropertiesConverter() {
        }
        JSONMaskedCharacterPropertiesConverter.convertFromJSON = function (obj, colorModelInfoCache, shadingInfoCache, fontCache) {
            var result = new __aspxRichEdit.MaskedCharacterProperties();
            result.fontSize = obj[__aspxRichEdit.JSONCharacterFormattingProperty.Size];
            result.fontBold = !!obj[__aspxRichEdit.JSONCharacterFormattingProperty.Bold];
            result.fontItalic = !!obj[__aspxRichEdit.JSONCharacterFormattingProperty.Italic];
            result.fontStrikeoutType = obj[__aspxRichEdit.JSONCharacterFormattingProperty.StrikeoutType];
            result.fontUnderlineType = obj[__aspxRichEdit.JSONCharacterFormattingProperty.UnderlineType];
            result.allCaps = !!obj[__aspxRichEdit.JSONCharacterFormattingProperty.AllCaps];
            result.strikeoutWordsOnly = !!obj[__aspxRichEdit.JSONCharacterFormattingProperty.StrikeoutWordsOnly];
            result.underlineWordsOnly = !!obj[__aspxRichEdit.JSONCharacterFormattingProperty.UnderlineWordsOnly];
            result.script = obj[__aspxRichEdit.JSONCharacterFormattingProperty.Script];
            result.hidden = !!obj[__aspxRichEdit.JSONCharacterFormattingProperty.Hidden];
            result.noProof = !!obj[__aspxRichEdit.JSONCharacterFormattingProperty.NoProof];
            result.useValue = obj[__aspxRichEdit.JSONCharacterFormattingProperty.UseValue];
            result.langInfo = JSONLangInfoConverter.convertFromJSON(obj[__aspxRichEdit.JSONCharacterFormattingProperty.LangInfo]);
            result.fontInfo = fontCache instanceof __aspxRichEdit.FontInfoCache ?
                fontCache.getItemByJsonKey(obj[__aspxRichEdit.JSONCharacterFormattingProperty.FontInfoIndex]) :
                fontCache(obj[__aspxRichEdit.JSONCharacterFormattingProperty.FontInfoIndex]);
            result.compositeFontInfo = JSONCompositeFontInfoConverter.convertFromJSON(obj[__aspxRichEdit.JSONCharacterFormattingProperty.CompositeFontInfo]);
            result.textColor = colorModelInfoCache.getItemByJsonKey(obj[__aspxRichEdit.JSONCharacterFormattingProperty.TextColorIndex]);
            result.shadingInfo = shadingInfoCache.getItemByJsonKey(obj[__aspxRichEdit.JSONCharacterFormattingProperty.ShadingInfoIndex]);
            result.highlightColor = colorModelInfoCache.getItemByJsonKey(obj[__aspxRichEdit.JSONCharacterFormattingProperty.HighlightColorIndex]);
            result.underlineColor = colorModelInfoCache.getItemByJsonKey(obj[__aspxRichEdit.JSONCharacterFormattingProperty.UnderlineColorIndex]);
            result.strikeoutColor = colorModelInfoCache.getItemByJsonKey(obj[__aspxRichEdit.JSONCharacterFormattingProperty.StrikeoutColorIndex]);
            return result;
        };
        JSONMaskedCharacterPropertiesConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONCharacterFormattingProperty.FontInfoIndex] = source.fontInfo.index;
            result[__aspxRichEdit.JSONCharacterFormattingProperty.Size] = source.fontSize;
            result[__aspxRichEdit.JSONCharacterFormattingProperty.Bold] = __aspxRichEdit.Utils.boolToInt(source.fontBold);
            result[__aspxRichEdit.JSONCharacterFormattingProperty.Italic] = __aspxRichEdit.Utils.boolToInt(source.fontItalic);
            result[__aspxRichEdit.JSONCharacterFormattingProperty.StrikeoutType] = source.fontStrikeoutType;
            result[__aspxRichEdit.JSONCharacterFormattingProperty.UnderlineType] = source.fontUnderlineType;
            result[__aspxRichEdit.JSONCharacterFormattingProperty.AllCaps] = __aspxRichEdit.Utils.boolToInt(source.allCaps);
            result[__aspxRichEdit.JSONCharacterFormattingProperty.StrikeoutWordsOnly] = __aspxRichEdit.Utils.boolToInt(source.strikeoutWordsOnly);
            result[__aspxRichEdit.JSONCharacterFormattingProperty.UnderlineWordsOnly] = __aspxRichEdit.Utils.boolToInt(source.underlineWordsOnly);
            result[__aspxRichEdit.JSONCharacterFormattingProperty.TextColor] = __aspxRichEdit.JSONColorModelInfoConverter.convertToJSON(source.textColor);
            result[__aspxRichEdit.JSONCharacterFormattingProperty.ShadingInfo] = __aspxRichEdit.JSONShadingInfoConverter.convertToJSON(source.shadingInfo);
            result[__aspxRichEdit.JSONCharacterFormattingProperty.HighlightColor] = __aspxRichEdit.JSONColorModelInfoConverter.convertToJSON(source.highlightColor);
            result[__aspxRichEdit.JSONCharacterFormattingProperty.UnderlineColor] = __aspxRichEdit.JSONColorModelInfoConverter.convertToJSON(source.underlineColor);
            result[__aspxRichEdit.JSONCharacterFormattingProperty.StrikeoutColor] = __aspxRichEdit.JSONColorModelInfoConverter.convertToJSON(source.strikeoutColor);
            result[__aspxRichEdit.JSONCharacterFormattingProperty.Script] = source.script;
            result[__aspxRichEdit.JSONCharacterFormattingProperty.Hidden] = __aspxRichEdit.Utils.boolToInt(source.hidden);
            result[__aspxRichEdit.JSONCharacterFormattingProperty.NoProof] = __aspxRichEdit.Utils.boolToInt(source.noProof);
            result[__aspxRichEdit.JSONCharacterFormattingProperty.UseValue] = source.useValue;
            result[__aspxRichEdit.JSONCharacterFormattingProperty.LangInfo] = JSONLangInfoConverter.convertToJSON(source.langInfo);
            result[__aspxRichEdit.JSONCharacterFormattingProperty.CompositeFontInfo] = JSONCompositeFontInfoConverter.convertToJSON(source.compositeFontInfo);
            return result;
        };
        return JSONMaskedCharacterPropertiesConverter;
    }());
    __aspxRichEdit.JSONMaskedCharacterPropertiesConverter = JSONMaskedCharacterPropertiesConverter;
    var JSONLangInfoConverter = (function () {
        function JSONLangInfoConverter() {
        }
        JSONLangInfoConverter.convertFromJSON = function (obj) {
            var result = new __aspxRichEdit.LangInfo();
            result.bidi = obj[__aspxRichEdit.JSONLangInfoProperty.Bidi] || "";
            result.eastAsia = obj[__aspxRichEdit.JSONLangInfoProperty.EastAsia] || "";
            result.latin = obj[__aspxRichEdit.JSONLangInfoProperty.Latin] || "";
            return result;
        };
        JSONLangInfoConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONLangInfoProperty.Bidi] = source ? source.bidi : "";
            result[__aspxRichEdit.JSONLangInfoProperty.EastAsia] = source ? source.eastAsia : "";
            result[__aspxRichEdit.JSONLangInfoProperty.Latin] = source ? source.latin : "";
            return result;
        };
        return JSONLangInfoConverter;
    }());
    __aspxRichEdit.JSONLangInfoConverter = JSONLangInfoConverter;
    var JSONCompositeFontInfoConverter = (function () {
        function JSONCompositeFontInfoConverter() {
        }
        JSONCompositeFontInfoConverter.convertFromJSON = function (obj) {
            var result = new __aspxRichEdit.CompositeFontInfo();
            result.asciiFontName = obj[__aspxRichEdit.JSONCompositeFontInfoProperty.asciiFontName];
            result.hightAnsiFontName = obj[__aspxRichEdit.JSONCompositeFontInfoProperty.hightAnsiFontName];
            result.complexScriptFontName = obj[__aspxRichEdit.JSONCompositeFontInfoProperty.complexScriptFontName];
            result.eastAsiaFontName = obj[__aspxRichEdit.JSONCompositeFontInfoProperty.eastAsiaFontName];
            result.asciiThemeFont = obj[__aspxRichEdit.JSONCompositeFontInfoProperty.asciiThemeFont];
            result.hightAnsiThemeFont = obj[__aspxRichEdit.JSONCompositeFontInfoProperty.hightAnsiThemeFont];
            result.complexScriptThemeFont = obj[__aspxRichEdit.JSONCompositeFontInfoProperty.complexScriptThemeFont];
            result.eastAsiaThemeFont = obj[__aspxRichEdit.JSONCompositeFontInfoProperty.eastAsiaThemeFont];
            result.hintFont = obj[__aspxRichEdit.JSONCompositeFontInfoProperty.hintFont];
            return result;
        };
        JSONCompositeFontInfoConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONCompositeFontInfoProperty.asciiFontName] = source.asciiFontName;
            result[__aspxRichEdit.JSONCompositeFontInfoProperty.hightAnsiFontName] = source.hightAnsiFontName;
            result[__aspxRichEdit.JSONCompositeFontInfoProperty.complexScriptFontName] = source.complexScriptFontName;
            result[__aspxRichEdit.JSONCompositeFontInfoProperty.eastAsiaFontName] = source.eastAsiaFontName;
            result[__aspxRichEdit.JSONCompositeFontInfoProperty.asciiThemeFont] = source.asciiThemeFont;
            result[__aspxRichEdit.JSONCompositeFontInfoProperty.hightAnsiThemeFont] = source.hightAnsiThemeFont;
            result[__aspxRichEdit.JSONCompositeFontInfoProperty.complexScriptThemeFont] = source.complexScriptThemeFont;
            result[__aspxRichEdit.JSONCompositeFontInfoProperty.eastAsiaThemeFont] = source.eastAsiaThemeFont;
            result[__aspxRichEdit.JSONCompositeFontInfoProperty.hintFont] = source.hintFont;
            return result;
        };
        return JSONCompositeFontInfoConverter;
    }());
    __aspxRichEdit.JSONCompositeFontInfoConverter = JSONCompositeFontInfoConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONMaskedParagraphPropertiesConverter = (function () {
        function JSONMaskedParagraphPropertiesConverter() {
        }
        JSONMaskedParagraphPropertiesConverter.convertFromJSON = function (obj, colorModelInfoCache, shadingInfoCache) {
            var result = new __aspxRichEdit.MaskedParagraphProperties();
            result.alignment = obj[__aspxRichEdit.JSONParagraphFormattingProperty.Alignment];
            result.firstLineIndent = obj[__aspxRichEdit.JSONParagraphFormattingProperty.FirstLineIndent];
            result.firstLineIndentType = obj[__aspxRichEdit.JSONParagraphFormattingProperty.FirstLineIndentType];
            result.leftIndent = obj[__aspxRichEdit.JSONParagraphFormattingProperty.LeftIndent];
            result.lineSpacing = obj[__aspxRichEdit.JSONParagraphFormattingProperty.LineSpacing];
            result.lineSpacingType = obj[__aspxRichEdit.JSONParagraphFormattingProperty.LineSpacingType];
            result.rightIndent = obj[__aspxRichEdit.JSONParagraphFormattingProperty.RightIndent];
            result.spacingBefore = obj[__aspxRichEdit.JSONParagraphFormattingProperty.SpacingBefore];
            result.spacingAfter = obj[__aspxRichEdit.JSONParagraphFormattingProperty.SpacingAfter];
            result.suppressHyphenation = !!obj[__aspxRichEdit.JSONParagraphFormattingProperty.SuppressHyphenation];
            result.suppressLineNumbers = !!obj[__aspxRichEdit.JSONParagraphFormattingProperty.SuppressLineNumbers];
            result.contextualSpacing = !!obj[__aspxRichEdit.JSONParagraphFormattingProperty.ContextualSpacing];
            result.pageBreakBefore = !!obj[__aspxRichEdit.JSONParagraphFormattingProperty.PageBreakBefore];
            result.beforeAutoSpacing = !!obj[__aspxRichEdit.JSONParagraphFormattingProperty.BeforeAutoSpacing];
            result.afterAutoSpacing = !!obj[__aspxRichEdit.JSONParagraphFormattingProperty.AfterAutoSpacing];
            result.keepWithNext = !!obj[__aspxRichEdit.JSONParagraphFormattingProperty.KeepWithNext];
            result.keepLinesTogether = !!obj[__aspxRichEdit.JSONParagraphFormattingProperty.KeepLinesTogether];
            result.widowOrphanControl = !!obj[__aspxRichEdit.JSONParagraphFormattingProperty.WidowOrphanControl];
            result.outlineLevel = obj[__aspxRichEdit.JSONParagraphFormattingProperty.OutlineLevel];
            result.shadingInfo = shadingInfoCache.getItemByJsonKey(obj[__aspxRichEdit.JSONParagraphFormattingProperty.ShadingInfoIndex]);
            result.leftBorder = __aspxRichEdit.JSONBorderInfoConverter.convertFromJSON(obj[__aspxRichEdit.JSONParagraphFormattingProperty.LeftBorder], colorModelInfoCache);
            result.rightBorder = __aspxRichEdit.JSONBorderInfoConverter.convertFromJSON(obj[__aspxRichEdit.JSONParagraphFormattingProperty.RightBorder], colorModelInfoCache);
            result.topBorder = __aspxRichEdit.JSONBorderInfoConverter.convertFromJSON(obj[__aspxRichEdit.JSONParagraphFormattingProperty.TopBorder], colorModelInfoCache);
            result.bottomBorder = __aspxRichEdit.JSONBorderInfoConverter.convertFromJSON(obj[__aspxRichEdit.JSONParagraphFormattingProperty.BottomBorder], colorModelInfoCache);
            result.betweenBorder = __aspxRichEdit.JSONBorderInfoConverter.convertFromJSON(obj[__aspxRichEdit.JSONParagraphFormattingProperty.BetweenBorder], colorModelInfoCache);
            result.divId = obj[__aspxRichEdit.JSONParagraphFormattingProperty.DivId];
            result.rightToLeft = obj[__aspxRichEdit.JSONParagraphFormattingProperty.RightToLeft];
            result.useValue = obj[__aspxRichEdit.JSONParagraphFormattingProperty.UseValue];
            return result;
        };
        JSONMaskedParagraphPropertiesConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONParagraphFormattingProperty.Alignment] = source.alignment;
            result[__aspxRichEdit.JSONParagraphFormattingProperty.FirstLineIndent] = source.firstLineIndent;
            result[__aspxRichEdit.JSONParagraphFormattingProperty.FirstLineIndentType] = source.firstLineIndentType;
            result[__aspxRichEdit.JSONParagraphFormattingProperty.LeftIndent] = source.leftIndent;
            result[__aspxRichEdit.JSONParagraphFormattingProperty.LineSpacing] = source.lineSpacing;
            result[__aspxRichEdit.JSONParagraphFormattingProperty.LineSpacingType] = source.lineSpacingType;
            result[__aspxRichEdit.JSONParagraphFormattingProperty.RightIndent] = source.rightIndent;
            result[__aspxRichEdit.JSONParagraphFormattingProperty.SpacingBefore] = source.spacingBefore;
            result[__aspxRichEdit.JSONParagraphFormattingProperty.SpacingAfter] = source.spacingAfter;
            result[__aspxRichEdit.JSONParagraphFormattingProperty.SuppressHyphenation] = __aspxRichEdit.Utils.boolToInt(source.suppressHyphenation);
            result[__aspxRichEdit.JSONParagraphFormattingProperty.SuppressLineNumbers] = __aspxRichEdit.Utils.boolToInt(source.suppressLineNumbers);
            result[__aspxRichEdit.JSONParagraphFormattingProperty.ContextualSpacing] = __aspxRichEdit.Utils.boolToInt(source.contextualSpacing);
            result[__aspxRichEdit.JSONParagraphFormattingProperty.PageBreakBefore] = __aspxRichEdit.Utils.boolToInt(source.pageBreakBefore);
            result[__aspxRichEdit.JSONParagraphFormattingProperty.BeforeAutoSpacing] = __aspxRichEdit.Utils.boolToInt(source.beforeAutoSpacing);
            result[__aspxRichEdit.JSONParagraphFormattingProperty.AfterAutoSpacing] = __aspxRichEdit.Utils.boolToInt(source.afterAutoSpacing);
            result[__aspxRichEdit.JSONParagraphFormattingProperty.KeepWithNext] = __aspxRichEdit.Utils.boolToInt(source.keepWithNext);
            result[__aspxRichEdit.JSONParagraphFormattingProperty.KeepLinesTogether] = __aspxRichEdit.Utils.boolToInt(source.keepLinesTogether);
            result[__aspxRichEdit.JSONParagraphFormattingProperty.WidowOrphanControl] = __aspxRichEdit.Utils.boolToInt(source.widowOrphanControl);
            result[__aspxRichEdit.JSONParagraphFormattingProperty.OutlineLevel] = source.outlineLevel;
            result[__aspxRichEdit.JSONParagraphFormattingProperty.ShadingInfo] = __aspxRichEdit.JSONShadingInfoConverter.convertToJSON(source.shadingInfo);
            result[__aspxRichEdit.JSONParagraphFormattingProperty.LeftBorder] = __aspxRichEdit.JSONBorderInfoConverter.convertToJSON(source.leftBorder);
            result[__aspxRichEdit.JSONParagraphFormattingProperty.RightBorder] = __aspxRichEdit.JSONBorderInfoConverter.convertToJSON(source.rightBorder);
            result[__aspxRichEdit.JSONParagraphFormattingProperty.TopBorder] = __aspxRichEdit.JSONBorderInfoConverter.convertToJSON(source.topBorder);
            result[__aspxRichEdit.JSONParagraphFormattingProperty.BottomBorder] = __aspxRichEdit.JSONBorderInfoConverter.convertToJSON(source.bottomBorder);
            result[__aspxRichEdit.JSONParagraphFormattingProperty.BetweenBorder] = __aspxRichEdit.JSONBorderInfoConverter.convertToJSON(source.betweenBorder);
            result[__aspxRichEdit.JSONParagraphFormattingProperty.DivId] = source.divId;
            result[__aspxRichEdit.JSONParagraphFormattingProperty.RightToLeft] = __aspxRichEdit.Utils.boolToInt(source.rightToLeft);
            result[__aspxRichEdit.JSONParagraphFormattingProperty.UseValue] = source.useValue;
            return result;
        };
        return JSONMaskedParagraphPropertiesConverter;
    }());
    __aspxRichEdit.JSONMaskedParagraphPropertiesConverter = JSONMaskedParagraphPropertiesConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONShadingInfoConverter = (function () {
        function JSONShadingInfoConverter() {
        }
        JSONShadingInfoConverter.convertFromJSON = function (obj, cache) {
            var backColor = cache.getItemByJsonKey(obj[__aspxRichEdit.JSONShadingInfoProperty.BackColorIndex]);
            if (!backColor)
                backColor = __aspxRichEdit.JSONColorModelInfoConverter.convertFromJSON(obj[__aspxRichEdit.JSONShadingInfoProperty.BackColor]);
            var foreColor = cache.getItemByJsonKey(obj[__aspxRichEdit.JSONShadingInfoProperty.ForeColorIndex]);
            if (!foreColor)
                foreColor = __aspxRichEdit.JSONColorModelInfoConverter.convertFromJSON(obj[__aspxRichEdit.JSONShadingInfoProperty.ForeColor]);
            return new __aspxRichEdit.ShadingInfo(obj[__aspxRichEdit.JSONShadingInfoProperty.ShadingPattern], backColor, foreColor);
        };
        JSONShadingInfoConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONShadingInfoProperty.ShadingPattern] = source.shadingPattern;
            result[__aspxRichEdit.JSONShadingInfoProperty.BackColor] = __aspxRichEdit.JSONColorModelInfoConverter.convertToJSON(source.backColor);
            result[__aspxRichEdit.JSONShadingInfoProperty.ForeColor] = __aspxRichEdit.JSONColorModelInfoConverter.convertToJSON(source.foreColor);
            return result;
        };
        return JSONShadingInfoConverter;
    }());
    __aspxRichEdit.JSONShadingInfoConverter = JSONShadingInfoConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONShapeConverter = (function () {
        function JSONShapeConverter() {
        }
        JSONShapeConverter.convertFromJSON = function (obj) {
            var result = new __aspxRichEdit.Shape();
            result.fillColor = obj[__aspxRichEdit.JSONShapeProperty.FillColor];
            result.outlineColor = obj[__aspxRichEdit.JSONShapeProperty.OutlineColor];
            result.outlineWidth = obj[__aspxRichEdit.JSONShapeProperty.OutlineWidth];
            return result;
        };
        JSONShapeConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONShapeProperty.FillColor] = source.fillColor;
            result[__aspxRichEdit.JSONShapeProperty.OutlineColor] = source.outlineColor;
            result[__aspxRichEdit.JSONShapeProperty.OutlineWidth] = source.outlineWidth;
            return result;
        };
        return JSONShapeConverter;
    }());
    __aspxRichEdit.JSONShapeConverter = JSONShapeConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONStylesExporter = (function () {
        function JSONStylesExporter() {
        }
        JSONStylesExporter.importStyles = function (documentModel, content) {
            JSONStylesExporter.importCharacterStyles(documentModel, content[__aspxRichEdit.JSONStylesProperty.Character]);
            JSONStylesExporter.importParagraphStyles(documentModel, content[__aspxRichEdit.JSONStylesProperty.Paragraph]);
            JSONStylesExporter.importNumberingStyles(documentModel, content[__aspxRichEdit.JSONStylesProperty.NumberingList]);
            JSONStylesExporter.importTableStyles(documentModel, content[__aspxRichEdit.JSONStylesProperty.Table]);
            JSONStylesExporter.finishCharacterStylesImport(documentModel, content[__aspxRichEdit.JSONStylesProperty.Character]);
            JSONStylesExporter.finishParagraphStylesImport(documentModel, content[__aspxRichEdit.JSONStylesProperty.Paragraph]);
            JSONStylesExporter.finishNumberingListStylesImport(documentModel, content[__aspxRichEdit.JSONStylesProperty.NumberingList]);
            JSONStylesExporter.finishTableStylesImport(documentModel, content[__aspxRichEdit.JSONStylesProperty.Table]);
        };
        JSONStylesExporter.exportStyles = function (documentModel) {
            var jsonStyles = {};
            jsonStyles[__aspxRichEdit.JSONStylesProperty.Character] = JSONStylesExporter.exportCharacterStyles(documentModel);
            jsonStyles[__aspxRichEdit.JSONStylesProperty.Paragraph] = JSONStylesExporter.exportParagraphStyles(documentModel);
            jsonStyles[__aspxRichEdit.JSONStylesProperty.NumberingList] = JSONStylesExporter.exportNumberingStyles(documentModel);
            jsonStyles[__aspxRichEdit.JSONStylesProperty.Table] = JSONStylesExporter.exportTableStyles(documentModel);
            return jsonStyles;
        };
        ;
        JSONStylesExporter.exportCharacterStyles = function (documentModel) {
            var jsonCharacterStyles = [];
            for (var _i = 0, _a = documentModel.characterStyles; _i < _a.length; _i++) {
                var characterStyle = _a[_i];
                var jsonCharacterStyle = {};
                jsonCharacterStyle[__aspxRichEdit.JSONStyleBaseProperty.StyleName] = characterStyle.styleName;
                jsonCharacterStyle[__aspxRichEdit.JSONStyleBaseProperty.Deleted] = __aspxRichEdit.Utils.boolToInt(characterStyle.deleted);
                jsonCharacterStyle[__aspxRichEdit.JSONStyleBaseProperty.Hidden] = __aspxRichEdit.Utils.boolToInt(characterStyle.hidden);
                jsonCharacterStyle[__aspxRichEdit.JSONStyleBaseProperty.ParentStyleName] = characterStyle.parent ? characterStyle.parent.styleName : "";
                jsonCharacterStyle[__aspxRichEdit.JSONStyleBaseProperty.Semihidden] = __aspxRichEdit.Utils.boolToInt(characterStyle.semihidden);
                jsonCharacterStyle[__aspxRichEdit.JSONStyleBaseProperty.LocalizedStyleName] = characterStyle.localizedName;
                jsonCharacterStyle[__aspxRichEdit.JSONStyleBaseProperty.IsDefault] = __aspxRichEdit.Utils.boolToInt(characterStyle.isDefault);
                jsonCharacterStyle[__aspxRichEdit.JSONStyleBaseProperty.Base64EncodedImage] = characterStyle.base64EncodedImage;
                jsonCharacterStyle[__aspxRichEdit.JSONCharacterStyleProperty.LinkedStyleName] = characterStyle.linkedStyle ? characterStyle.linkedStyle.styleName : "";
                jsonCharacterStyle[__aspxRichEdit.JSONCharacterStyleProperty.CharacterPropertiesCacheIndex] = documentModel.characterStyles.indexOf(characterStyle);
                jsonCharacterStyles.push(jsonCharacterStyle);
            }
            return jsonCharacterStyles;
        };
        JSONStylesExporter.exportParagraphStyles = function (documentModel) {
            var maskedCharacterPropertiesCache = documentModel.cache.maskedCharacterPropertiesCache;
            var maskedParagraphPropertiesCache = documentModel.cache.maskedParagraphPropertiesCache;
            var jsonParagraphStyles = [];
            for (var _i = 0, _a = documentModel.paragraphStyles; _i < _a.length; _i++) {
                var paragraphStyle = _a[_i];
                var jsonParagraphStyle = {};
                jsonParagraphStyle[__aspxRichEdit.JSONStyleBaseProperty.StyleName] = paragraphStyle.styleName;
                jsonParagraphStyle[__aspxRichEdit.JSONStyleBaseProperty.Deleted] = __aspxRichEdit.Utils.boolToInt(paragraphStyle.deleted);
                jsonParagraphStyle[__aspxRichEdit.JSONStyleBaseProperty.Hidden] = __aspxRichEdit.Utils.boolToInt(paragraphStyle.hidden);
                jsonParagraphStyle[__aspxRichEdit.JSONStyleBaseProperty.ParentStyleName] = paragraphStyle.parent ? paragraphStyle.parent.styleName : "";
                jsonParagraphStyle[__aspxRichEdit.JSONStyleBaseProperty.Semihidden] = __aspxRichEdit.Utils.boolToInt(paragraphStyle.semihidden);
                jsonParagraphStyle[__aspxRichEdit.JSONStyleBaseProperty.LocalizedStyleName] = paragraphStyle.localizedName;
                jsonParagraphStyle[__aspxRichEdit.JSONStyleBaseProperty.IsDefault] = __aspxRichEdit.Utils.boolToInt(paragraphStyle.isDefault);
                jsonParagraphStyle[__aspxRichEdit.JSONStyleBaseProperty.Base64EncodedImage] = paragraphStyle.base64EncodedImage;
                jsonParagraphStyle[__aspxRichEdit.JSONParagraphStyleProperty.CharacterPropertiesCacheIndex] =
                    maskedCharacterPropertiesCache.indexOf(paragraphStyle.maskedCharacterProperties);
                jsonParagraphStyle[__aspxRichEdit.JSONParagraphStyleProperty.ParagraphPropertiesCacheIndex] =
                    maskedParagraphPropertiesCache.indexOf(paragraphStyle.maskedParagraphProperties);
                jsonParagraphStyle[__aspxRichEdit.JSONParagraphStyleProperty.LinkedStyleName] =
                    paragraphStyle.linkedStyle ? paragraphStyle.linkedStyle.styleName : "";
                jsonParagraphStyle[__aspxRichEdit.JSONParagraphStyleProperty.NextParagraphStyleName] =
                    paragraphStyle.nextParagraphStyle ? paragraphStyle.nextParagraphStyle.styleName : "";
                jsonParagraphStyle[__aspxRichEdit.JSONParagraphStyleProperty.AutoUpdate] = __aspxRichEdit.Utils.boolToInt(paragraphStyle.autoUpdate);
                jsonParagraphStyle[__aspxRichEdit.JSONParagraphStyleProperty.Tabs] = __aspxRichEdit.JSONTabConverter.convertFromTabPropertiesToJSON(paragraphStyle.tabs);
                jsonParagraphStyle[__aspxRichEdit.JSONParagraphStyleProperty.NumberingListIndex] = paragraphStyle.numberingListIndex;
                jsonParagraphStyle[__aspxRichEdit.JSONParagraphStyleProperty.ListLevelIndex] = paragraphStyle.listLevelIndex;
                jsonParagraphStyles.push(jsonParagraphStyle);
            }
            return jsonParagraphStyles;
        };
        JSONStylesExporter.exportNumberingStyles = function (documentModel) {
            var jsonNumberingStyles = [];
            for (var _i = 0, _a = documentModel.numberingListStyles; _i < _a.length; _i++) {
                var numberingStyle = _a[_i];
                var jsonNumberingStyle = {};
                jsonNumberingStyle[__aspxRichEdit.JSONStyleBaseProperty.StyleName] = numberingStyle.styleName;
                jsonNumberingStyle[__aspxRichEdit.JSONStyleBaseProperty.Deleted] = __aspxRichEdit.Utils.boolToInt(numberingStyle.deleted);
                jsonNumberingStyle[__aspxRichEdit.JSONStyleBaseProperty.Hidden] = __aspxRichEdit.Utils.boolToInt(numberingStyle.hidden);
                jsonNumberingStyle[__aspxRichEdit.JSONStyleBaseProperty.ParentStyleName] = numberingStyle.parent ? numberingStyle.parent.styleName : "";
                jsonNumberingStyle[__aspxRichEdit.JSONStyleBaseProperty.Semihidden] = __aspxRichEdit.Utils.boolToInt(numberingStyle.semihidden);
                jsonNumberingStyle[__aspxRichEdit.JSONStyleBaseProperty.LocalizedStyleName] = numberingStyle.localizedName;
                jsonNumberingStyle[__aspxRichEdit.JSONStyleBaseProperty.IsDefault] = __aspxRichEdit.Utils.boolToInt(numberingStyle.isDefault);
                jsonNumberingStyle[__aspxRichEdit.JSONStyleBaseProperty.Base64EncodedImage] = numberingStyle.base64EncodedImage;
                jsonNumberingStyle[__aspxRichEdit.JSONNumberingListStyleProperty.NumberingListIndex] = numberingStyle.numberingListIndex;
                jsonNumberingStyles.push(jsonNumberingStyle);
            }
            return jsonNumberingStyles;
        };
        JSONStylesExporter.exportTableStyles = function (documentModel) {
            var jsonTableStyles = [];
            for (var _i = 0, _a = documentModel.tableStyles; _i < _a.length; _i++) {
                var tableStyle = _a[_i];
                var jsonTableStyle = {};
                jsonTableStyle[__aspxRichEdit.JSONStyleBaseProperty.StyleName] = tableStyle.styleName;
                jsonTableStyle[__aspxRichEdit.JSONStyleBaseProperty.Deleted] = __aspxRichEdit.Utils.boolToInt(tableStyle.deleted);
                jsonTableStyle[__aspxRichEdit.JSONStyleBaseProperty.Hidden] = __aspxRichEdit.Utils.boolToInt(tableStyle.hidden);
                jsonTableStyle[__aspxRichEdit.JSONStyleBaseProperty.ParentStyleName] = tableStyle.parent ? tableStyle.parent.styleName : "";
                jsonTableStyle[__aspxRichEdit.JSONStyleBaseProperty.Semihidden] = __aspxRichEdit.Utils.boolToInt(tableStyle.semihidden);
                jsonTableStyle[__aspxRichEdit.JSONStyleBaseProperty.LocalizedStyleName] = tableStyle.localizedName;
                jsonTableStyle[__aspxRichEdit.JSONStyleBaseProperty.IsDefault] = __aspxRichEdit.Utils.boolToInt(tableStyle.isDefault);
                jsonTableStyle[__aspxRichEdit.JSONStyleBaseProperty.Base64EncodedImage] = tableStyle.base64EncodedImage;
                jsonTableStyle[__aspxRichEdit.JSONTableStyleProperty.BaseConditionalStyle] =
                    __aspxRichEdit.JSONTableConditionalStyleConverter.convertToJSON(documentModel, tableStyle.baseConditionalStyle);
                jsonTableStyle[__aspxRichEdit.JSONTableStyleProperty.ConditionalStyles] =
                    __aspxRichEdit.JSONTableConditionalStyleConverter.convertStylesToJSON(documentModel, tableStyle.conditionalStyles);
                jsonTableStyles.push(jsonTableStyle);
            }
            return jsonTableStyles;
        };
        JSONStylesExporter.importCharacterStyles = function (documentModel, content) {
            var maskedCharacterPropertiesCache = documentModel.cache.maskedCharacterPropertiesCache;
            var charStyles = documentModel.characterStyles;
            for (var _i = 0, content_1 = content; _i < content_1.length; _i++) {
                var jsonStyle = content_1[_i];
                charStyles.push(new __aspxRichEdit.CharacterStyle(jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.StyleName], jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.LocalizedStyleName], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Deleted], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Hidden], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Semihidden], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.IsDefault], maskedCharacterPropertiesCache.getItemByJsonKey(jsonStyle[__aspxRichEdit.JSONCharacterStyleProperty.CharacterPropertiesCacheIndex]), jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Base64EncodedImage]));
            }
        };
        JSONStylesExporter.importParagraphStyles = function (documentModel, content) {
            var maskedCharacterPropertiesCache = documentModel.cache.maskedCharacterPropertiesCache;
            var maskedParagraphPropertiesCache = documentModel.cache.maskedParagraphPropertiesCache;
            var parStyles = documentModel.paragraphStyles;
            for (var _i = 0, content_2 = content; _i < content_2.length; _i++) {
                var jsonStyle = content_2[_i];
                parStyles.push(new __aspxRichEdit.ParagraphStyle(jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.StyleName], jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.LocalizedStyleName], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Deleted], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Hidden], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Semihidden], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.IsDefault], maskedCharacterPropertiesCache.getItemByJsonKey(jsonStyle[__aspxRichEdit.JSONParagraphStyleProperty.CharacterPropertiesCacheIndex]), maskedParagraphPropertiesCache.getItemByJsonKey(jsonStyle[__aspxRichEdit.JSONParagraphStyleProperty.ParagraphPropertiesCacheIndex]), __aspxRichEdit.JSONTabConverter.convertFromJSONToTabProperties(jsonStyle[__aspxRichEdit.JSONParagraphStyleProperty.Tabs]), !!jsonStyle[__aspxRichEdit.JSONParagraphStyleProperty.AutoUpdate], jsonStyle[__aspxRichEdit.JSONParagraphStyleProperty.NumberingListIndex], jsonStyle[__aspxRichEdit.JSONParagraphStyleProperty.ListLevelIndex], jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Base64EncodedImage]));
            }
        };
        JSONStylesExporter.importNumberingStyles = function (documentModel, content) {
            var numListStyles = documentModel.numberingListStyles;
            for (var _i = 0, content_3 = content; _i < content_3.length; _i++) {
                var jsonStyle = content_3[_i];
                numListStyles.push(new __aspxRichEdit.NumberingListStyle(jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.StyleName], jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.LocalizedStyleName], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Deleted], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Hidden], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Semihidden], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.IsDefault], jsonStyle[__aspxRichEdit.JSONNumberingListStyleProperty.NumberingListIndex]));
            }
        };
        JSONStylesExporter.importTableStyles = function (documentModel, content) {
            var tblStyles = documentModel.tableStyles;
            for (var _i = 0, content_4 = content; _i < content_4.length; _i++) {
                var jsonStyle = content_4[_i];
                tblStyles.push(new __aspxRichEdit.TableStyle(jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.StyleName], jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.LocalizedStyleName], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Deleted], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Hidden], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Semihidden], !!jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.IsDefault], __aspxRichEdit.JSONTableConditionalStyleConverter.convertStylesFromJSON(jsonStyle[__aspxRichEdit.JSONTableStyleProperty.ConditionalStyles], documentModel.cache), __aspxRichEdit.JSONTableConditionalStyleConverter.convertFromJSON(jsonStyle[__aspxRichEdit.JSONTableStyleProperty.BaseConditionalStyle], documentModel.cache), jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.Base64EncodedImage]));
            }
        };
        JSONStylesExporter.finishCharacterStylesImport = function (documentModel, content) {
            for (var i = 0, style; style = documentModel.characterStyles[i]; i++) {
                var jsonStyle = content[i];
                style.parent = documentModel.getCharacterStyleByName(jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.ParentStyleName]);
                var linkedStyle = jsonStyle[__aspxRichEdit.JSONCharacterStyleProperty.LinkedStyleName];
                if (linkedStyle !== undefined)
                    style.linkedStyle = documentModel.getParagraphStyleByName(linkedStyle);
            }
        };
        JSONStylesExporter.finishParagraphStylesImport = function (documentModel, content) {
            for (var i = 0, style; style = documentModel.paragraphStyles[i]; i++) {
                var jsonStyle = content[i];
                style.parent = documentModel.getParagraphStyleByName(jsonStyle[__aspxRichEdit.JSONStyleBaseProperty.ParentStyleName]);
                var linkedStyle = jsonStyle[__aspxRichEdit.JSONParagraphStyleProperty.LinkedStyleName];
                if (linkedStyle !== undefined)
                    style.linkedStyle = documentModel.getCharacterStyleByName(linkedStyle);
                var nextParStyleName = jsonStyle[__aspxRichEdit.JSONParagraphStyleProperty.NextParagraphStyleName];
                if (nextParStyleName !== undefined)
                    style.nextParagraphStyle = documentModel.getParagraphStyleByName(nextParStyleName);
            }
        };
        JSONStylesExporter.finishNumberingListStylesImport = function (documentModel, content) {
            for (var i = 0, style; style = documentModel.numberingListStyles[i]; i++)
                style.parent = documentModel.getNumberingListStyleByName(content[i][__aspxRichEdit.JSONStyleBaseProperty.ParentStyleName]);
        };
        JSONStylesExporter.finishTableStylesImport = function (documentModel, content) {
            for (var i = 0, style; style = documentModel.tableStyles[i]; i++)
                style.parent = documentModel.getTableStyleByName(content[i][__aspxRichEdit.JSONStyleBaseProperty.ParentStyleName]);
        };
        return JSONStylesExporter;
    }());
    __aspxRichEdit.JSONStylesExporter = JSONStylesExporter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONTabConverter = (function () {
        function JSONTabConverter() {
        }
        JSONTabConverter.convertFromJSONToTabProperties = function (obj) {
            var tabs = new __aspxRichEdit.TabProperties();
            for (var _i = 0, obj_1 = obj; _i < obj_1.length; _i++) {
                var jsonTab = obj_1[_i];
                tabs.tabsInfo.push(JSONTabConverter.convertFromJSON(jsonTab));
            }
            return tabs;
        };
        JSONTabConverter.convertFromJSON = function (obj) {
            return new __aspxRichEdit.TabInfo(obj[__aspxRichEdit.JSONTabInfoProperty.Position], obj[__aspxRichEdit.JSONTabInfoProperty.Alignment], obj[__aspxRichEdit.JSONTabInfoProperty.LeaderType], !!obj[__aspxRichEdit.JSONTabInfoProperty.IsDeleted], !!obj[__aspxRichEdit.JSONTabInfoProperty.IsDefault]);
        };
        JSONTabConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONTabInfoProperty.Position] = source.position;
            result[__aspxRichEdit.JSONTabInfoProperty.Alignment] = source.alignment;
            result[__aspxRichEdit.JSONTabInfoProperty.LeaderType] = source.leader;
            result[__aspxRichEdit.JSONTabInfoProperty.IsDeleted] = __aspxRichEdit.Utils.boolToInt(source.deleted);
            result[__aspxRichEdit.JSONTabInfoProperty.IsDefault] = __aspxRichEdit.Utils.boolToInt(source.isDefault);
            return result;
        };
        JSONTabConverter.convertFromTabPropertiesToJSON = function (source) {
            var result = [];
            for (var _i = 0, _a = source.tabsInfo; _i < _a.length; _i++) {
                var tab = _a[_i];
                result.push(JSONTabConverter.convertToJSON(tab));
            }
            return result;
        };
        return JSONTabConverter;
    }());
    __aspxRichEdit.JSONTabConverter = JSONTabConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutColumn = (function (_super) {
        __extends(LayoutColumn, _super);
        function LayoutColumn() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.rows = [];
            _this.paragraphFrames = [];
            _this.tablesInfo = [];
            return _this;
        }
        LayoutColumn.prototype.getEndPosition = function () {
            return this.pageAreaOffset + __aspxRichEdit.ListUtils.last(this.rows).getEndPosition();
        };
        LayoutColumn.prototype.getLastRow = function () {
            return __aspxRichEdit.ListUtils.last(this.rows);
        };
        LayoutColumn.findSectionColumnWithMinimumWidth = function (columnBounds) {
            return __aspxRichEdit.ListUtils.min(columnBounds, function (a, b) { return a.width - b.width; }).width;
        };
        LayoutColumn.prototype.deepCopy = function () {
            var obj = new LayoutColumn();
            obj.pageAreaOffset = this.pageAreaOffset;
            obj.paragraphFrames = __aspxRichEdit.ListUtils.shallowCopy(this.paragraphFrames);
            obj.tablesInfo = __aspxRichEdit.ListUtils.shallowCopy(this.tablesInfo);
            obj.rows = __aspxRichEdit.ListUtils.shallowCopy(this.rows);
            obj.copyFrom(this);
            return obj;
        };
        return LayoutColumn;
    }(__aspxRichEdit.Rectangle));
    __aspxRichEdit.LayoutColumn = LayoutColumn;
    var ParagraphFrame = (function (_super) {
        __extends(ParagraphFrame, _super);
        function ParagraphFrame() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.paragraphColor = 0;
            return _this;
        }
        ParagraphFrame.prototype.equals = function (obj) {
            return _super.prototype.equals.call(this, obj) &&
                this.paragraphColor == obj.paragraphColor;
        };
        ParagraphFrame.prototype.clone = function () {
            var res = new ParagraphFrame();
            res.copyFrom(this);
            res.paragraphColor = this.paragraphColor;
            return res;
        };
        return ParagraphFrame;
    }(__aspxRichEdit.Rectangle));
    __aspxRichEdit.ParagraphFrame = ParagraphFrame;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutPageFlags;
    (function (LayoutPageFlags) {
        LayoutPageFlags[LayoutPageFlags["MustBeRendered"] = 1] = "MustBeRendered";
        LayoutPageFlags[LayoutPageFlags["ContentRendered"] = 2] = "ContentRendered";
        LayoutPageFlags[LayoutPageFlags["NeedRenderContent"] = 4] = "NeedRenderContent";
        LayoutPageFlags[LayoutPageFlags["NeedDeleteContent"] = 8] = "NeedDeleteContent";
        LayoutPageFlags[LayoutPageFlags["IsFirstPageOfSection"] = 16] = "IsFirstPageOfSection";
        LayoutPageFlags[LayoutPageFlags["IsIntervalsCorrect"] = 32] = "IsIntervalsCorrect";
        LayoutPageFlags[LayoutPageFlags["IsSelectionRendered"] = 64] = "IsSelectionRendered";
        LayoutPageFlags[LayoutPageFlags["IsSearchSelectionRendered"] = 128] = "IsSearchSelectionRendered";
        LayoutPageFlags[LayoutPageFlags["IsMisspelledSelectionRendered"] = 256] = "IsMisspelledSelectionRendered";
        LayoutPageFlags[LayoutPageFlags["IsRangePermissionsRendered"] = 512] = "IsRangePermissionsRendered";
    })(LayoutPageFlags = __aspxRichEdit.LayoutPageFlags || (__aspxRichEdit.LayoutPageFlags = {}));
    var LayoutOtherPageAreasInfo = (function () {
        function LayoutOtherPageAreasInfo(headerPageArea, footerPageArea, textBoxesPageAreas) {
            this.headerPageArea = headerPageArea;
            this.footerPageArea = footerPageArea;
            this.textBoxesPageAreas = textBoxesPageAreas;
        }
        LayoutOtherPageAreasInfo.prototype.getDocumentModel = function () {
            if (!this.documentModel) {
                var pageArea = (this.headerPageArea || this.footerPageArea || this.textBoxesPageAreas[0]);
                this.documentModel = pageArea ? pageArea.subDocument.documentModel : null;
            }
            return this.documentModel;
        };
        return LayoutOtherPageAreasInfo;
    }());
    __aspxRichEdit.LayoutOtherPageAreasInfo = LayoutOtherPageAreasInfo;
    var LayoutPage = (function (_super) {
        __extends(LayoutPage, _super);
        function LayoutPage() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.mainSubDocumentPageAreas = [];
            _this.otherPageAreas = {};
            _this.flags = new __aspxRichEdit.Flag();
            _this.anchoredObjectHolder = new __aspxRichEdit.PageAnchoredObjectHolder();
            return _this;
        }
        LayoutPage.prototype.setPosition = function (pos) {
            this.contentIntervals = [new __aspxRichEdit.FixedInterval(pos, 0)];
            this.flags.set(LayoutPageFlags.IsIntervalsCorrect, false);
        };
        LayoutPage.prototype.startWithFloatingObject = function (ancPosInfo) {
            var min = __aspxRichEdit.MapUtilsKeyAsNumber.min(this.anchoredObjectHolder.objects, function (objA, objB) { return ancPosInfo.getPosition(objA.objectId) - ancPosInfo.getPosition(objB.objectId); });
            return min && ancPosInfo.getPosition(min.objectId) < this.getPosition() ? min : null;
        };
        LayoutPage.prototype.getStartPositionConsideringAncObj = function (ancPosInfo) {
            var ancObjWhatStartPage = this.startWithFloatingObject(ancPosInfo);
            return Math.min(this.getPosition(), ancObjWhatStartPage ? ancPosInfo.getPosition(ancObjWhatStartPage.objectId) : Number.MAX_VALUE);
        };
        LayoutPage.prototype.invalidate = function () {
            this.isValid = false;
            this.markPageIntervalsAsIncorrect();
        };
        LayoutPage.prototype.getPosition = function () {
            return this.contentIntervals[0].start;
        };
        LayoutPage.prototype.deepCopy = function () {
            var obj = new LayoutPage();
            obj.isValid = this.isValid;
            obj.mainSubDocumentPageAreas = __aspxRichEdit.ListUtils.map(this.mainSubDocumentPageAreas, function (pa) { return pa.deepCopy(); });
            obj.otherPageAreas = __aspxRichEdit.MapUtilsKeyAsNumber.shallowCopy(this.otherPageAreas);
            obj.flags = this.flags.clone();
            obj.index = this.index;
            obj.layoutPageIndex = this.layoutPageIndex;
            obj.anchoredObjectHolder = this.anchoredObjectHolder.shallowCopy();
            obj.contentIntervals = __aspxRichEdit.ListUtils.shallowCopy(this.contentIntervals);
            obj.copyFrom(this);
            return obj;
        };
        LayoutPage.prototype.markPageIntervalsAsIncorrect = function () {
            this.flags.set(LayoutPageFlags.IsIntervalsCorrect, false);
        };
        LayoutPage.prototype.getLayoutOtherPageAreasInfo = function () {
            var headerPageArea;
            var footerPageArea;
            var textBoxPageAreas = [];
            __aspxRichEdit.MapUtilsKeyAsNumber.foreach(this.otherPageAreas, function (pageArea) {
                if (pageArea.subDocument.isHeader())
                    headerPageArea = pageArea;
                else if (pageArea.subDocument.isFooter())
                    footerPageArea = pageArea;
                else if (pageArea.subDocument.isTextBox())
                    textBoxPageAreas.push(pageArea);
            });
            return new LayoutOtherPageAreasInfo(headerPageArea, footerPageArea, textBoxPageAreas);
        };
        LayoutPage.prototype.calculateContentIntervals = function (anchorObjectsPositionInfo, isUseMoreHardAlgorithm) {
            var _this = this;
            if (!this.flags.get(LayoutPageFlags.IsIntervalsCorrect)) {
                var startPos = this.getPosition();
                if (isUseMoreHardAlgorithm)
                    this.contentIntervals = ContentIntervalCollector.getNoneTidyIntervals(this.mainSubDocumentPageAreas, this.contentIntervals[0].start);
                else {
                    this.contentIntervals = new ContentIntervalCollector(this.mainSubDocumentPageAreas, this.contentIntervals[0].start).getIntervals();
                    this.flags.set(LayoutPageFlags.IsIntervalsCorrect, true);
                }
                __aspxRichEdit.MapUtilsKeyAsNumber.foreach(this.anchoredObjectHolder.objects, function (obj) {
                    if (obj.belongsToSubDocId == __aspxRichEdit.SubDocument.MAIN_SUBDOCUMENT_ID)
                        _this.contentIntervals.push(new __aspxRichEdit.FixedInterval(anchorObjectsPositionInfo.getPosition(obj.objectId), 1));
                });
                this.contentIntervals = __aspxRichEdit.IntervalAlgorithms.getMergedIntervals(this.contentIntervals, true);
                var diff = startPos - this.contentIntervals[0].start;
                if (diff > 0) {
                    for (var _i = 0, _a = this.mainSubDocumentPageAreas; _i < _a.length; _i++) {
                        var pa = _a[_i];
                        pa.pageOffset = diff;
                    }
                }
            }
        };
        LayoutPage.prototype.getContentIntervals = function () {
            return this.contentIntervals;
        };
        LayoutPage.getFirstPageInGroup = function (pages, pageIndex) {
            for (; pageIndex >= 0; pageIndex--) {
                var page = pages[pageIndex];
                var firstColumn = page.mainSubDocumentPageAreas[0].columns[0];
                if (!firstColumn.rows[0] || !firstColumn.rows[0].tableCellInfo)
                    return page;
                var tblFirstRowCells = firstColumn.tablesInfo[0].tableRows[0].rowCells;
                var isAllCellsStartOnThisPage = true;
                for (var _i = 0, tblFirstRowCells_1 = tblFirstRowCells; _i < tblFirstRowCells_1.length; _i++) {
                    var cell = tblFirstRowCells_1[_i];
                    isAllCellsStartOnThisPage = isAllCellsStartOnThisPage && cell.boundFlags.get(__aspxRichEdit.TableCellBoundFlags.StartOnThisColumn);
                }
                if (isAllCellsStartOnThisPage)
                    return page;
            }
            return pages[0];
        };
        LayoutPage.getLastValidPageInGroup = function (pages, pageIndex, validPageCount, checkValid, tryFindPage) {
            var prevPage = pages[pageIndex];
            for (; pageIndex < pages.length; pageIndex++) {
                var page = pages[pageIndex];
                if (checkValid && (!page.isValid || page.index >= validPageCount))
                    return tryFindPage ? prevPage : null;
                var lastRow = __aspxRichEdit.ListUtils.last(__aspxRichEdit.ListUtils.last(__aspxRichEdit.ListUtils.last(page.mainSubDocumentPageAreas).columns).rows);
                if (!lastRow || !lastRow.tableCellInfo)
                    return page;
                var cells = lastRow.tableCellInfo ? ContentIntervalCollector.getTopLevelTableRow(lastRow.tableCellInfo.parentRow).rowCells : [];
                var isAllCellsEndOnThisPage = true;
                for (var _i = 0, cells_3 = cells; _i < cells_3.length; _i++) {
                    var cell = cells_3[_i];
                    isAllCellsEndOnThisPage = isAllCellsEndOnThisPage && cell.boundFlags.get(__aspxRichEdit.TableCellBoundFlags.EndOnThisColumn);
                }
                if (isAllCellsEndOnThisPage)
                    return page;
                prevPage = pages[pageIndex];
            }
            return __aspxRichEdit.ListUtils.last(pages);
        };
        LayoutPage.prototype.getEndPosition = function () {
            return this.getPosition() + __aspxRichEdit.ListUtils.last(this.mainSubDocumentPageAreas).getEndPosition();
        };
        LayoutPage.getPrevPageLastPostion = function (pages, currPageIndex) {
            var prevPage = pages[currPageIndex - 1];
            return prevPage ? prevPage.getEndPosition() : 0;
        };
        return LayoutPage;
    }(__aspxRichEdit.Rectangle));
    __aspxRichEdit.LayoutPage = LayoutPage;
    var ContentIntervalCollector = (function () {
        function ContentIntervalCollector(mainSubDocumentPageAreas, startPagePos) {
            this.extendInfo = [];
            this.startPagePos = startPagePos;
            this.cellIterator = new CellIteratorPosition(mainSubDocumentPageAreas);
            this.intervals = [];
        }
        ContentIntervalCollector.getNoneTidyIntervals = function (mainSubDocumentPageAreas, startPagePos) {
            var intervals = [];
            for (var _i = 0, mainSubDocumentPageAreas_1 = mainSubDocumentPageAreas; _i < mainSubDocumentPageAreas_1.length; _i++) {
                var pageArea = mainSubDocumentPageAreas_1[_i];
                for (var _a = 0, _b = pageArea.columns; _a < _b.length; _a++) {
                    var column = _b[_a];
                    var partialOffset = startPagePos + pageArea.pageOffset + column.pageAreaOffset;
                    for (var _c = 0, _d = column.rows; _c < _d.length; _c++) {
                        var row = _d[_c];
                        var lastBox = __aspxRichEdit.ListUtils.last(row.boxes);
                        intervals.push(new __aspxRichEdit.FixedInterval(partialOffset + row.columnOffset + row.boxes[0].rowOffset, lastBox.rowOffset + lastBox.getLength()));
                    }
                }
            }
            return __aspxRichEdit.IntervalAlgorithms.getMergedIntervals(intervals, false);
        };
        ContentIntervalCollector.prototype.startInterval = function (startPos) {
            if (this.intervals.length > 0) {
                var lastInterval = __aspxRichEdit.ListUtils.last(this.intervals);
                if (lastInterval.end == startPos) {
                    this.currInterval = lastInterval;
                    return;
                }
            }
            this.currInterval = new __aspxRichEdit.FixedInterval(startPos, 0);
            this.intervals.push(this.currInterval);
        };
        ContentIntervalCollector.prototype.extendInterval = function (toPos) {
            this.currInterval.length = Math.max(this.currInterval.length, toPos - this.currInterval.start);
        };
        ContentIntervalCollector.prototype.startExtend = function () {
            var flags = this.cellIterator.tableCell.boundFlags;
            this.extendInfo.push(new ExtendCellInfo(this.getPosition(ContentIntervalCollector.getCellLastRowEndPosition), this.cellIterator.tableColumn.logicInfo.grid.table.nestedLevel, !flags.get(__aspxRichEdit.TableCellBoundFlags.StartOnThisColumn) || !flags.get(__aspxRichEdit.TableCellBoundFlags.EndOnThisColumn), this.cellIterator.tableCell, this.startPagePos + this.cellIterator.pageArea.pageOffset + this.cellIterator.column.pageAreaOffset));
        };
        ContentIntervalCollector.prototype.finishExtend = function (force) {
            var actualLevel = force ? 0 : this.cellIterator.tableColumn.logicInfo.grid.table.nestedLevel;
            while (this.currInterval && this.extendInfo.length > 0) {
                var info = this.extendInfo.pop();
                if (actualLevel <= info.level) {
                    if (info.endOfCellPos >= 0)
                        this.extendInterval(info.endOfCellPos);
                    if (info.isStartNewInterval)
                        this.currInterval = null;
                }
                else {
                    this.extendInfo.push(info);
                    break;
                }
            }
        };
        ContentIntervalCollector.prototype.getPosition = function (additionalInc) {
            var addInc = additionalInc(this.cellIterator);
            if (addInc == -1)
                return -1;
            return this.startPagePos + this.cellIterator.pageArea.pageOffset + this.cellIterator.column.pageAreaOffset + addInc;
        };
        ContentIntervalCollector.prototype.getIntervals = function () {
            this.startInterval(this.startPagePos);
            var firstCell = true;
            for (; this.cellIterator.moveNext(); firstCell = false) {
                var cell = this.cellIterator.tableCell;
                this.finishExtend(false);
                if (!this.currInterval)
                    this.startInterval(this.getPosition(ContentIntervalCollector.getCellFirstRowStartPos));
                if (firstCell)
                    this.extendInterval(this.getPosition(ContentIntervalCollector.getCellFirstRowStartPos));
                if (!firstCell && !cell.boundFlags.get(__aspxRichEdit.TableCellBoundFlags.StartOnThisColumn))
                    this.startInterval(this.getPosition(ContentIntervalCollector.getCellFirstRowStartPos));
                this.startExtend();
            }
            this.finishExtend(true);
            this.handleLastExtends();
            var lastPos = this.startPagePos + __aspxRichEdit.ListUtils.last(this.cellIterator.pageAreas).getEndPosition();
            if (this.currInterval)
                this.extendInterval(lastPos);
            else
                this.addAdditionalInterval(lastPos);
            return __aspxRichEdit.IntervalAlgorithms.getMergedIntervals(this.intervals, true);
        };
        ContentIntervalCollector.prototype.handleLastExtends = function () {
            if (this.extendInfo[0]) {
                var _loop_6 = function (info) {
                    var firstLayoutRow = info.cell.internalTables[info.cell.layoutRows.length] ? null :
                        __aspxRichEdit.ListUtils.reverseElementBy(info.cell.layoutRows, function (_layoutRow, rowIndex) { return !!info.cell.internalTables[rowIndex] || rowIndex == 0; });
                    if (firstLayoutRow) {
                        this_5.startInterval(info.columnOffsetPos + firstLayoutRow.getStartPosition());
                        this_5.extendInterval(info.endOfCellPos);
                    }
                };
                var this_5 = this;
                for (var info = void 0; info = this.extendInfo.pop();) {
                    _loop_6(info);
                }
                this.currInterval = null;
            }
        };
        ContentIntervalCollector.prototype.addAdditionalInterval = function (lastPos) {
            var pageArea = __aspxRichEdit.ListUtils.last(this.cellIterator.pageAreas);
            var column = __aspxRichEdit.ListUtils.last(pageArea.columns);
            var row = __aspxRichEdit.ListUtils.last(__aspxRichEdit.ListUtils.last(__aspxRichEdit.ListUtils.last(column.tablesInfo).getTopLevelColumn().tableRows).rowCells)
                .getLastLayoutRowIncludingInternalTables();
            var rowAfterTable = column.rows[row.indexInColumn + 1];
            if (!rowAfterTable)
                return;
            this.intervals.push(__aspxRichEdit.FixedInterval.fromPositions(this.startPagePos + pageArea.pageOffset + column.pageAreaOffset + rowAfterTable.getStartPosition(), lastPos));
        };
        ContentIntervalCollector.getCellLastRowEndPosition = function (cellIterator) {
            var lastRow = __aspxRichEdit.ListUtils.last(cellIterator.tableCell.layoutRows);
            return lastRow ? lastRow.getEndPosition() : -1;
        };
        ContentIntervalCollector.getCellFirstRowStartPos = function (cellIterator) {
            return cellIterator.tableCell.getFirstLayoutRowByModelPositionIncludingInternalTables().getStartPosition();
        };
        ContentIntervalCollector.getTopLevelTableRow = function (tableRow) {
            while (tableRow.parentTable.logicInfo.grid.table.nestedLevel > 0)
                tableRow = tableRow.parentTable.parentCell.parentRow;
            return tableRow;
        };
        return ContentIntervalCollector;
    }());
    var ExtendCellInfo = (function () {
        function ExtendCellInfo(pos, level, isStartNewInterval, cell, columnOffsetPos) {
            this.endOfCellPos = pos;
            this.level = level;
            this.isStartNewInterval = isStartNewInterval;
            this.cell = cell;
            this.columnOffsetPos = columnOffsetPos;
        }
        return ExtendCellInfo;
    }());
    var CellIteratorPosition = (function () {
        function CellIteratorPosition(pageAreas) {
            this.pageAreaIndex = -1;
            this.tableIndexes = [];
            this.tableRowIndexes = [];
            this.tableCellIndexes = [];
            this.tableCellInternalTableIndexes = [];
            this.currLevel = 0;
            this.isInit = false;
            this.pageAreas = pageAreas;
        }
        CellIteratorPosition.prototype.moveNext = function () {
            if (!this.isInit) {
                this.isInit = true;
                return this.init();
            }
            return this.moveToNextTableCell();
        };
        CellIteratorPosition.prototype.init = function () {
            this.pageAreaIndex = 0;
            this.pageArea = this.pageAreas[0];
            this.columnIndex = -1;
            if (this.moveToNextColumnWithTable()) {
                this.initTopTableProperties(0);
                return true;
            }
            return false;
        };
        CellIteratorPosition.prototype.initTopTableProperties = function (tblIndexInColumn) {
            this.tableIndexes = [tblIndexInColumn, -1];
            this.tableColumn = this.column.tablesInfo[tblIndexInColumn];
            this.tableRowIndexes = [0];
            this.setTableRow(0);
            this.tableCellIndexes = [0];
            this.tableCell = this.tableRowCells[0];
            this.tableCellInternalTableIndexes = [];
            this.collectInternalTableIndexes();
        };
        CellIteratorPosition.prototype.moveToNextColumnWithTable = function () {
            if (this.column = this.pageArea.columns[++this.columnIndex])
                return this.column.tablesInfo.length > 0 ? true : this.moveToNextColumnWithTable();
            if (this.pageArea = this.pageAreas[++this.pageAreaIndex]) {
                this.columnIndex = -1;
                return this.moveToNextColumnWithTable();
            }
            return false;
        };
        CellIteratorPosition.prototype.moveToNextTableCell = function () {
            if (this.goToInternalTable() || this.goToNextTableCell() || this.goToNextTableRow())
                return true;
            return this.currLevel == 0 ? this.goToNextTopLevelTable() : this.goToTopLevel();
        };
        CellIteratorPosition.prototype.goToInternalTable = function () {
            var newInternalTblIndex = __aspxRichEdit.ListUtils.incLast(this.tableIndexes);
            var currLevelInternalTblIndexes = this.tableCellInternalTableIndexes[this.currLevel];
            if (newInternalTblIndex >= currLevelInternalTblIndexes.length)
                return false;
            this.tableColumn = this.tableCell.internalTables[currLevelInternalTblIndexes[newInternalTblIndex]];
            this.tableRowIndexes.push(0);
            this.setTableRow(0);
            this.tableCellIndexes.push(0);
            this.tableCell = this.tableRowCells[0];
            this.currLevel++;
            this.collectInternalTableIndexes();
            this.tableIndexes.push(-1);
            return true;
        };
        CellIteratorPosition.prototype.goToNextTableCell = function () {
            var nextCellIndex = __aspxRichEdit.ListUtils.incLast(this.tableCellIndexes);
            if (nextCellIndex >= this.tableRowCells.length)
                return false;
            this.tableCell = this.tableRowCells[nextCellIndex];
            this.tableCellInternalTableIndexes.pop();
            this.collectInternalTableIndexes();
            __aspxRichEdit.ListUtils.setLast(this.tableIndexes, -1);
            return true;
        };
        CellIteratorPosition.prototype.goToNextTableRow = function () {
            var nextRowIndex = __aspxRichEdit.ListUtils.incLast(this.tableRowIndexes);
            if (nextRowIndex >= this.tableColumn.tableRows.length)
                return false;
            this.setTableRow(nextRowIndex);
            __aspxRichEdit.ListUtils.setLast(this.tableCellIndexes, -1);
            return this.goToNextTableCell();
        };
        CellIteratorPosition.prototype.goToNextTopLevelTable = function () {
            this.tableIndexes[0] = this.getNextTopLevelTableIndexInThisColumn();
            if (this.tableIndexes[0] >= 0) {
                this.initTopTableProperties(this.tableIndexes[0]);
                return true;
            }
            if (!this.moveToNextColumnWithTable())
                return false;
            this.initTopTableProperties(0);
            return true;
        };
        CellIteratorPosition.prototype.goToTopLevel = function () {
            this.tableCellInternalTableIndexes.pop();
            this.tableCellIndexes.pop();
            this.tableRowIndexes.pop();
            this.tableIndexes.pop();
            this.currLevel--;
            this.tableCell = this.tableColumn.parentCell;
            this.tableRow = this.tableCell.parentRow;
            this.tableRowCells = this.getTableRowCells();
            this.tableColumn = this.tableRow.parentTable;
            return this.moveToNextTableCell();
        };
        CellIteratorPosition.prototype.getNextTopLevelTableIndexInThisColumn = function () {
            var tbls = this.column.tablesInfo;
            for (var tblIndex = this.tableIndexes[0] + 1; tblIndex < tbls.length; tblIndex++) {
                if (tbls[tblIndex].logicInfo.grid.table.nestedLevel == 0)
                    return tblIndex;
            }
            return -1;
        };
        CellIteratorPosition.prototype.collectInternalTableIndexes = function () {
            var list = [];
            var intervalTables = this.tableCell.internalTables;
            for (var key in intervalTables) {
                if (!intervalTables.hasOwnProperty(key))
                    continue;
                list.push(parseInt(key));
            }
            list.sort(__aspxRichEdit.CompareUtils.numberCmpFunc);
            this.tableCellInternalTableIndexes.push(list);
        };
        CellIteratorPosition.prototype.setTableRow = function (index) {
            this.tableRow = this.tableColumn.tableRows[index];
            this.tableRowCells = this.getTableRowCells();
        };
        CellIteratorPosition.prototype.getTableRowCells = function () {
            return __aspxRichEdit.ListUtils.shallowCopy(this.tableRow.rowCells).sort(function (a, b) {
                return a.getFirstLayoutRowByModelPositionIncludingInternalTables().getStartPosition() -
                    b.getFirstLayoutRowByModelPositionIncludingInternalTables().getStartPosition();
            });
        };
        return CellIteratorPosition;
    }());
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutPageArea = (function (_super) {
        __extends(LayoutPageArea, _super);
        function LayoutPageArea(subDocument) {
            var _this = _super.call(this) || this;
            _this.columns = [];
            _this.subDocument = subDocument;
            return _this;
        }
        LayoutPageArea.prototype.getEndPosition = function () {
            return this.pageOffset + __aspxRichEdit.ListUtils.last(this.columns).getEndPosition();
        };
        LayoutPageArea.prototype.getLastColumn = function () {
            return this.columns[this.columns.length - 1];
        };
        LayoutPageArea.prototype.deepCopy = function () {
            var obj = new LayoutPageArea(this.subDocument);
            obj.pageOffset = this.pageOffset;
            obj.columns = __aspxRichEdit.ListUtils.map(this.columns, function (col) { return col.deepCopy(); });
            obj.copyFrom(this);
            return obj;
        };
        return LayoutPageArea;
    }(__aspxRichEdit.Rectangle));
    __aspxRichEdit.LayoutPageArea = LayoutPageArea;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutRowStateFlags;
    (function (LayoutRowStateFlags) {
        LayoutRowStateFlags[LayoutRowStateFlags["NormallyEnd"] = 0] = "NormallyEnd";
        LayoutRowStateFlags[LayoutRowStateFlags["ParagraphEnd"] = 1] = "ParagraphEnd";
        LayoutRowStateFlags[LayoutRowStateFlags["PageEnd"] = 2] = "PageEnd";
        LayoutRowStateFlags[LayoutRowStateFlags["ColumnEnd"] = 4] = "ColumnEnd";
        LayoutRowStateFlags[LayoutRowStateFlags["SectionEnd"] = 8] = "SectionEnd";
        LayoutRowStateFlags[LayoutRowStateFlags["DocumentEnd"] = 16] = "DocumentEnd";
        LayoutRowStateFlags[LayoutRowStateFlags["CellTableEnd"] = 64] = "CellTableEnd";
        LayoutRowStateFlags[LayoutRowStateFlags["PageBreakBefore"] = 128] = "PageBreakBefore";
    })(LayoutRowStateFlags = __aspxRichEdit.LayoutRowStateFlags || (__aspxRichEdit.LayoutRowStateFlags = {}));
    var LayoutRow = (function (_super) {
        __extends(LayoutRow, _super);
        function LayoutRow() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.boxes = [];
            _this.bookmarkBoxes = [];
            _this.numberingListBox = null;
            _this.flags = new __aspxRichEdit.Flag(LayoutRowStateFlags.NormallyEnd);
            return _this;
        }
        LayoutRow.prototype.getEndPosition = function () {
            return this.columnOffset + this.getLastBoxEndPositionInRow();
        };
        LayoutRow.prototype.getLastBoxEndPositionInRow = function () {
            return __aspxRichEdit.ListUtils.last(this.boxes).getEndPosition();
        };
        LayoutRow.prototype.getStartPosition = function () {
            return this.columnOffset + this.boxes[0].rowOffset;
        };
        LayoutRow.prototype.getLastBox = function () {
            return __aspxRichEdit.ListUtils.last(this.boxes);
        };
        LayoutRow.prototype.isEmpty = function () {
            return this.boxes.length == 0;
        };
        LayoutRow.prototype.applySpacingBefore = function (value) {
            this.rollbackSpacingBefore();
            this.spacingBefore = value;
            this.height += this.getSpacingBefore();
            this.baseLine += this.getSpacingBefore();
        };
        LayoutRow.prototype.rollbackSpacingBefore = function () {
            this.height = this.height - this.getSpacingBefore();
            this.baseLine = this.baseLine - this.getSpacingBefore();
            this.spacingBefore = 0;
        };
        LayoutRow.prototype.applySpacingAfter = function (value) {
            this.rollbackSpacingAfter();
            this.spacingAfter = value;
            this.height += this.getSpacingAfter();
        };
        LayoutRow.prototype.rollbackSpacingAfter = function () {
            this.height = Math.max(0, this.height - this.getSpacingAfter());
            this.spacingAfter = 0;
        };
        LayoutRow.prototype.getSpacingBefore = function () {
            return this.spacingBefore || 0;
        };
        LayoutRow.prototype.getSpacingAfter = function () {
            return this.spacingAfter || 0;
        };
        LayoutRow.prototype.getLastVisibleBox = function () {
            var index = this.getLastVisibleBoxIndex();
            return index >= 0 ? this.boxes[index] : null;
        };
        LayoutRow.prototype.getLastVisibleBoxIndex = function () {
            for (var lastBoxIndexInRow = this.boxes.length - 1, box; box = this.boxes[lastBoxIndexInRow]; lastBoxIndexInRow--)
                if (box.isVisible())
                    return lastBoxIndexInRow;
            return -1;
        };
        LayoutRow.getParagraphSpacingBefore = function (paragraph, prevParagraph, isFirstRowInCell, isFirstCellInRow, isFirstRowInTable) {
            var parProps = paragraph.getParagraphMergedProperies();
            var spacingBefore = Math.abs(__aspxRichEdit.UnitConverter.twipsToPixels(parProps.spacingBefore));
            if (!spacingBefore || !prevParagraph)
                return spacingBefore;
            if (isFirstRowInCell && isFirstCellInRow && !isFirstRowInTable)
                return spacingBefore;
            if (parProps.contextualSpacing && paragraph.paragraphStyle.styleName == prevParagraph.paragraphStyle.styleName)
                return 0;
            if (isFirstRowInCell) {
                return spacingBefore;
            }
            else {
                var prevParProps = prevParagraph.getParagraphMergedProperies();
                var prevParSpacingAfter = __aspxRichEdit.UnitConverter.twipsToPixels(prevParProps.spacingAfter);
                return prevParSpacingAfter >= spacingBefore ? 0 : Math.abs(spacingBefore - prevParSpacingAfter);
            }
        };
        LayoutRow.getParagraphSpacingAfter = function (paragraph, nextParagraph) {
            var parProps = paragraph.getParagraphMergedProperies();
            var spacingAfter = Math.abs(__aspxRichEdit.UnitConverter.twipsToPixels(parProps.spacingAfter));
            if (!spacingAfter || !nextParagraph)
                return spacingAfter;
            return (parProps.contextualSpacing && paragraph.paragraphStyle.styleName == nextParagraph.paragraphStyle.styleName) ? 0 : spacingAfter;
        };
        LayoutRow.prototype.applyXOffsetToBoxes = function (offset) {
            for (var _i = 0, _a = this.boxes; _i < _a.length; _i++) {
                var box = _a[_i];
                box.x += offset;
            }
            if (this.numberingListBox) {
                this.numberingListBox.textBox.x += offset;
                if (this.numberingListBox.separatorBox)
                    this.numberingListBox.separatorBox.x += offset;
            }
        };
        return LayoutRow;
    }(__aspxRichEdit.Rectangle));
    __aspxRichEdit.LayoutRow = LayoutRow;
    var LayoutRowWithIndex = (function (_super) {
        __extends(LayoutRowWithIndex, _super);
        function LayoutRowWithIndex() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        return LayoutRowWithIndex;
    }(LayoutRow));
    __aspxRichEdit.LayoutRowWithIndex = LayoutRowWithIndex;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutSelection = (function () {
        function LayoutSelection(subDocumentInfo, pageIndex, innerClientProperties) {
            this.subDocumentInfo = null;
            this.pageIndex = -1;
            this.firstPageIndexWithSelection = 0;
            this.lastPageIndexWithSelection = 0;
            this.selectionInfo = new __aspxRichEdit.LayoutSelectionInfo(__aspxRichEdit.LayoutPageFlags.IsSelectionRendered, innerClientProperties);
            this.searchInfo = new __aspxRichEdit.LayoutSelectionInfo(__aspxRichEdit.LayoutPageFlags.IsSearchSelectionRendered, innerClientProperties);
            this.misspelledInfo = new __aspxRichEdit.LayoutSelectionInfo(__aspxRichEdit.LayoutPageFlags.IsMisspelledSelectionRendered, innerClientProperties);
            this.rangePermissionInfo = new __aspxRichEdit.LayoutSelectionInfo(__aspxRichEdit.LayoutPageFlags.IsRangePermissionsRendered, innerClientProperties);
            this.subDocumentInfo = subDocumentInfo;
            this.pageIndex = pageIndex;
        }
        LayoutSelection.prototype.updatePageIndexWithSelection = function () {
            this.firstPageIndexWithSelection = -1;
            this.lastPageIndexWithSelection = 0;
            for (var pageIndex = 0, pageInfo = void 0; pageInfo = this.selectionInfo.pageInfos[pageIndex]; pageIndex++) {
                if (pageInfo.oldItems.length) {
                    if (this.firstPageIndexWithSelection < 0)
                        this.firstPageIndexWithSelection = pageIndex;
                    this.lastPageIndexWithSelection = pageIndex;
                }
            }
        };
        return LayoutSelection;
    }());
    __aspxRichEdit.LayoutSelection = LayoutSelection;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutSelectionInfo = (function () {
        function LayoutSelectionInfo(layoutPageFlag, innerClientProperties) {
            this.pageInfos = [];
            this.changes = [];
            this.layoutPageFlag = layoutPageFlag;
            this.innerClientProperties = innerClientProperties;
        }
        LayoutSelectionInfo.prototype.changesApplied = function () {
            this.changes = [];
        };
        LayoutSelectionInfo.prototype.reset = function () {
            this.pageInfos.splice(0);
            this.changes.splice(0);
        };
        LayoutSelectionInfo.prototype.needAtLeastPageIndex = function (pageIndex) {
            while (this.pageInfos.length <= pageIndex)
                this.pageInfos.push(new __aspxRichEdit.LayoutSelectionPageInfo());
        };
        LayoutSelectionInfo.prototype.registerItem = function (pageIndex, item) {
            this.needAtLeastPageIndex(pageIndex);
            var pageInfo = this.pageInfos[pageIndex];
            pageInfo.newItems.push(item);
            pageInfo.isChanged = true;
        };
        LayoutSelectionInfo.prototype.collectPageChanges = function (layout) {
            var pages = layout.pages;
            this.pageInfos.splice(pages.length);
            if (this.innerClientProperties.viewsSettings.isSimpleView) {
                if (this.pageInfos[0])
                    this.pageInfos[0].changesCollected();
            }
            else {
                for (var pageIndex = 0, pageInfo = void 0; pageInfo = this.pageInfos[pageIndex]; pageIndex++) {
                    var pageFlags = pages[pageIndex].flags;
                    if (pageFlags.get(__aspxRichEdit.LayoutPageFlags.MustBeRendered) && pageInfo.isChanged) {
                        var maxCount = Math.max(pageInfo.oldItems.length, pageInfo.newItems.length);
                        var pageChanges = [];
                        if (!pageFlags.get(this.layoutPageFlag))
                            pageInfo.oldItems = [];
                        for (var itemIndex = 0; itemIndex < maxCount; itemIndex++) {
                            var oldItem = pageInfo.oldItems[itemIndex];
                            var newItem = pageInfo.newItems[itemIndex];
                            if (oldItem) {
                                if (newItem) {
                                    if (!oldItem.equals(newItem))
                                        pageChanges.push(new __aspxRichEdit.LayoutAreaSelectionChange(itemIndex, __aspxRichEdit.LayoutChangeType.Replaced, newItem));
                                }
                                else {
                                    for (var ind = pageInfo.oldItems.length - 1; ind >= itemIndex; ind--)
                                        pageChanges.push(new __aspxRichEdit.LayoutAreaSelectionChange(ind, __aspxRichEdit.LayoutChangeType.Deleted, oldItem));
                                    break;
                                }
                            }
                            else {
                                for (; itemIndex < pageInfo.newItems.length; itemIndex++)
                                    pageChanges.push(new __aspxRichEdit.LayoutAreaSelectionChange(itemIndex, __aspxRichEdit.LayoutChangeType.Inserted, pageInfo.newItems[itemIndex]));
                                break;
                            }
                        }
                        if (pageChanges.length)
                            this.changes.push(new __aspxRichEdit.LayoutPageSelectionChange(pageIndex, __aspxRichEdit.LayoutChangeType.Updated, pageChanges));
                    }
                    pageInfo.changesCollected();
                }
            }
        };
        return LayoutSelectionInfo;
    }());
    __aspxRichEdit.LayoutSelectionInfo = LayoutSelectionInfo;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutSelectionPageInfo = (function () {
        function LayoutSelectionPageInfo() {
            this.oldItems = [];
            this.newItems = [];
            this.isChanged = false;
        }
        LayoutSelectionPageInfo.prototype.beforeRecreatePageSelection = function () {
            this.newItems = [];
            this.isChanged = this.oldItems.length > 0;
        };
        LayoutSelectionPageInfo.prototype.changesCollected = function () {
            if (this.isChanged) {
                this.oldItems = this.newItems;
                this.newItems = [];
                this.isChanged = false;
            }
        };
        return LayoutSelectionPageInfo;
    }());
    __aspxRichEdit.LayoutSelectionPageInfo = LayoutSelectionPageInfo;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableCellBoundFlags;
    (function (TableCellBoundFlags) {
        TableCellBoundFlags[TableCellBoundFlags["StartAndEndOnOtherColumns"] = 0] = "StartAndEndOnOtherColumns";
        TableCellBoundFlags[TableCellBoundFlags["StartOnThisColumn"] = 1] = "StartOnThisColumn";
        TableCellBoundFlags[TableCellBoundFlags["EndOnThisColumn"] = 2] = "EndOnThisColumn";
    })(TableCellBoundFlags = __aspxRichEdit.TableCellBoundFlags || (__aspxRichEdit.TableCellBoundFlags = {}));
    var LayoutTableCellInfo = (function (_super) {
        __extends(LayoutTableCellInfo, _super);
        function LayoutTableCellInfo(parentRow, bound, cellGridIndex, avaliableContentWidth) {
            var _this = _super.call(this) || this;
            _this.layoutRows = [];
            _this.copyFrom(bound);
            _this.parentRow = parentRow;
            _this.layoutRows = [];
            _this.cellGridIndex = cellGridIndex;
            _this.boundFlags = new __aspxRichEdit.Flag(TableCellBoundFlags.StartOnThisColumn | TableCellBoundFlags.EndOnThisColumn);
            _this.internalTables = {};
            _this.avaliableContentWidth = avaliableContentWidth;
            return _this;
        }
        LayoutTableCellInfo.prototype.isStartWithInternalTable = function () {
            return !!this.internalTables[0];
        };
        LayoutTableCellInfo.prototype.isEndWithInternalTable = function () {
            return !!this.internalTables[this.layoutRows.length];
        };
        LayoutTableCellInfo.prototype.getLastLayoutRowIncludingInternalTables = function () {
            var lastInternalTable = this.internalTables[this.layoutRows.length];
            return lastInternalTable ?
                __aspxRichEdit.ListUtils.last(__aspxRichEdit.ListUtils.last(lastInternalTable.tableRows).rowCells).getLastLayoutRowIncludingInternalTables() :
                __aspxRichEdit.ListUtils.last(this.layoutRows);
        };
        LayoutTableCellInfo.prototype.getFirstLayoutRowByModelPositionIncludingInternalTables = function () {
            var firstInternalTable = this.internalTables[0];
            return firstInternalTable ?
                __aspxRichEdit.ListUtils.min(firstInternalTable.tableRows[0].rowCells, function (cellA, cellB) {
                    return cellA.getFirstLayoutRowByModelPositionIncludingInternalTables().columnOffset -
                        cellB.getFirstLayoutRowByModelPositionIncludingInternalTables().columnOffset;
                }).getFirstLayoutRowByModelPositionIncludingInternalTables() :
                this.layoutRows[0];
        };
        LayoutTableCellInfo.prototype.getEndPosition = function () {
            var internalTableAfterLastRow = this.internalTables[this.layoutRows.length];
            return internalTableAfterLastRow ?
                __aspxRichEdit.ListUtils.last(__aspxRichEdit.ListUtils.last(internalTableAfterLastRow.tableRows).rowCells).getEndPosition() :
                __aspxRichEdit.ListUtils.last(this.layoutRows).getEndPosition();
        };
        LayoutTableCellInfo.prototype.isEmpty = function () {
            return !this.layoutRows.length && __aspxRichEdit.MapUtilsKeyAsNumber.isEmpty(this.internalTables);
        };
        return LayoutTableCellInfo;
    }(__aspxRichEdit.Rectangle));
    __aspxRichEdit.LayoutTableCellInfo = LayoutTableCellInfo;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutTableInfo = (function () {
        function LayoutTableInfo(backgroundColor, grid) {
            this.isEditable = true;
            this.backgroundColor = backgroundColor;
            this.grid = grid;
        }
        return LayoutTableInfo;
    }());
    __aspxRichEdit.LayoutTableInfo = LayoutTableInfo;
    var LayoutTableColumnInfo = (function (_super) {
        __extends(LayoutTableColumnInfo, _super);
        function LayoutTableColumnInfo(parentCell, logicInfo, bound) {
            var _this = _super.call(this) || this;
            _this.horizontalBorders = [];
            _this.verticalBorders = [];
            _this.verticalCursorBorders = [];
            _this.horizontalCursorBorders = [];
            _this.tableRows = [];
            _this.parentCell = parentCell;
            _this.logicInfo = logicInfo;
            _this.copyFrom(bound);
            return _this;
        }
        LayoutTableColumnInfo.prototype.isLastLayoutColumnInModelTable = function () {
            var topColumn = this.getTopLevelColumn();
            return !topColumn.isBoundWithNext() && __aspxRichEdit.ListUtils.last(this.tableRows).rowIndex == topColumn.logicInfo.grid.table.rows.length - 1;
        };
        LayoutTableColumnInfo.prototype.calculateFlags = function () {
            var _this = this;
            this.boundFlags = new __aspxRichEdit.Flag(__aspxRichEdit.TableCellBoundFlags.StartOnThisColumn | __aspxRichEdit.TableCellBoundFlags.EndOnThisColumn);
            __aspxRichEdit.ListUtils.foreach(this.tableRows, function (row) {
                return __aspxRichEdit.ListUtils.foreach(row.rowCells, function (cell) {
                    if (!cell.boundFlags.get(__aspxRichEdit.TableCellBoundFlags.StartOnThisColumn))
                        _this.boundFlags.set(__aspxRichEdit.TableCellBoundFlags.StartOnThisColumn, false);
                    if (!cell.boundFlags.get(__aspxRichEdit.TableCellBoundFlags.EndOnThisColumn))
                        _this.boundFlags.set(__aspxRichEdit.TableCellBoundFlags.EndOnThisColumn, false);
                });
            });
        };
        LayoutTableColumnInfo.prototype.getTopLevelColumn = function () {
            var currCol = this;
            var parent;
            while (parent = currCol.parentCell)
                currCol = parent.parentRow.parentTable;
            return currCol;
        };
        LayoutTableColumnInfo.prototype.isBoundWithPrev = function () {
            return !this.boundFlags.get(__aspxRichEdit.TableCellBoundFlags.StartOnThisColumn);
        };
        LayoutTableColumnInfo.prototype.isBoundWithNext = function () {
            return !this.boundFlags.get(__aspxRichEdit.TableCellBoundFlags.EndOnThisColumn);
        };
        LayoutTableColumnInfo.getFirstCellInPageThatBoundWithCellPlacedInNextPage = function (tableInfos) {
            var resultCell = null;
            var resultTblNestedLevel = -1;
            var currLvl;
            for (var tblInd = tableInfos.length - 1, tbl = void 0; tbl = tableInfos[tblInd]; tblInd--) {
                var cell = __aspxRichEdit.ListUtils.anyOf(tbl.tableRows, function (row) {
                    return __aspxRichEdit.ListUtils.anyOf(row.rowCells, function (cell) {
                        return !cell.boundFlags.get(__aspxRichEdit.TableCellBoundFlags.EndOnThisColumn) ? cell : null;
                    });
                });
                if (cell && (!resultCell ||
                    (currLvl = cell.parentRow.parentTable.logicInfo.grid.table.nestedLevel) > resultTblNestedLevel)) {
                    resultCell = cell;
                    resultTblNestedLevel = currLvl;
                }
            }
            return resultCell;
        };
        LayoutTableColumnInfo.prototype.isEmpty = function () {
            return !this.tableRows.length;
        };
        return LayoutTableColumnInfo;
    }(__aspxRichEdit.Rectangle));
    __aspxRichEdit.LayoutTableColumnInfo = LayoutTableColumnInfo;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutTableCellBackgroundInfo = (function (_super) {
        __extends(LayoutTableCellBackgroundInfo, _super);
        function LayoutTableCellBackgroundInfo(bound, color) {
            var _this = _super.call(this) || this;
            _this.copyFrom(bound);
            _this.color = color;
            return _this;
        }
        return LayoutTableCellBackgroundInfo;
    }(__aspxRichEdit.Rectangle));
    __aspxRichEdit.LayoutTableCellBackgroundInfo = LayoutTableCellBackgroundInfo;
    var LayoutTableRowInfo = (function (_super) {
        __extends(LayoutTableRowInfo, _super);
        function LayoutTableRowInfo(parentTable, bound, rowIndex) {
            var _this = _super.call(this) || this;
            _this.copyFrom(bound);
            _this.parentTable = parentTable;
            _this.rowCells = [];
            _this.backgroundInfos = [];
            _this.rowIndex = rowIndex;
            return _this;
        }
        LayoutTableRowInfo.prototype.isBoundWithPrev = function () {
            return __aspxRichEdit.ListUtils.indexBy(this.rowCells, function (cell) { return !cell.boundFlags.get(__aspxRichEdit.TableCellBoundFlags.StartOnThisColumn); }) >= 0;
        };
        LayoutTableRowInfo.prototype.getCellIndexByExactlyCellGridIndex = function (cellGridIndex) {
            return __aspxRichEdit.Utils.binaryIndexOf(this.rowCells, function (cell) { return cell.cellGridIndex - cellGridIndex; });
        };
        LayoutTableRowInfo.prototype.getCellByExactlyCellGridIndex = function (cellGridIndex) {
            var cellIndex = this.getCellIndexByExactlyCellGridIndex(cellGridIndex);
            return cellIndex < 0 ? null : this.rowCells[cellIndex];
        };
        return LayoutTableRowInfo;
    }(__aspxRichEdit.Rectangle));
    __aspxRichEdit.LayoutTableRowInfo = LayoutTableRowInfo;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ParentLinkTableCell = (function () {
        function ParentLinkTableCell() {
            this.parentCell = null;
            this.parentLink = null;
            this.layoutRowIndexInParentCell = -1;
        }
        ParentLinkTableCell.prototype.createParentLink = function () {
            return this.createParentLinkInternal(this);
        };
        ParentLinkTableCell.prototype.createParentLinkInternal = function (link) {
            if (link.parentLink)
                return this.createParentLinkInternal(link.parentLink);
            var newLink = new ParentLinkTableCell();
            link.parentLink = newLink;
            return newLink;
        };
        return ParentLinkTableCell;
    }());
    __aspxRichEdit.ParentLinkTableCell = ParentLinkTableCell;
    var TableCellIterator = (function () {
        function TableCellIterator(position, layout, measurer) {
            this.tableIndex = -1;
            this.tableRowIndex = -1;
            this.tableCellIndex = -1;
            this.layoutRowIndexInCell = -1;
            this.layoutRowIndexInLayout = -1;
            this.layoutRowIndexInLayoutInitial = -1;
            this.pageIndex = 0;
            this.pageAreaIndex = 0;
            this.columnIndex = 0;
            this.skipCalculateCellIndex = false;
            this.canCalculateLastCellIndex = false;
            this.position = position;
            this.layout = layout;
            this.measurer = measurer;
            this.setPositionProperties();
            if (this.readTables(this.position.column.tablesInfo)) {
                for (var tableIndex = 0, table = void 0; table = this.position.column.tablesInfo[tableIndex]; tableIndex++)
                    if (table == this.tableInfo) {
                        this.tableIndex = tableIndex;
                        break;
                    }
            }
        }
        Object.defineProperty(TableCellIterator.prototype, "tableCellInfo", {
            get: function () {
                return this.tableCellInfoInternal;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(TableCellIterator.prototype, "isInTable", {
            get: function () {
                return this.layoutRowIndexInCell > -1;
            },
            enumerable: true,
            configurable: true
        });
        TableCellIterator.prototype.readTables = function (tables, parentCell, layountIndex) {
            var _this = this;
            if (parentCell === void 0) { parentCell = null; }
            if (layountIndex === void 0) { layountIndex = -1; }
            for (var tableIndex = 0, table = void 0; table = tables[tableIndex]; tableIndex++) {
                for (var rowIndex = 0, row = void 0; row = table.tableRows[rowIndex]; rowIndex++) {
                    for (var cellIndex = 0, cell = void 0; cell = table.tableRows[rowIndex].rowCells[cellIndex]; cellIndex++) {
                        for (var layountRowIndex in cell.internalTables) {
                            if (this.readTables(this.getConvertedObjectToArray(cell.internalTables), cell, parseInt(layountRowIndex))) {
                                var link = this.parentLink.createParentLink();
                                link.parentCell = parentCell;
                                link.layoutRowIndexInParentCell = layountIndex;
                                return true;
                            }
                        }
                        var index = __aspxRichEdit.Utils.binaryIndexOf(cell.layoutRows, function (row) { return row.indexInColumn - _this.position.rowIndex; });
                        if (index >= 0) {
                            this.tableInfo = table;
                            this.tableRowIndex = rowIndex;
                            this.tableRowInfo = row;
                            this.tableCellIndex = cellIndex;
                            this.tableCellInfoInternal = cell;
                            this.layoutRowIndexInCell = index;
                            this.layoutRowIndexInLayout = cell.layoutRows[index].indexInColumn;
                            this.layoutRowIndexInLayoutInitial = this.layoutRowIndexInLayout;
                            this.parentLink = new ParentLinkTableCell();
                            this.parentLink.parentCell = parentCell;
                            this.parentLink.layoutRowIndexInParentCell = layountIndex;
                            return true;
                        }
                    }
                }
            }
            return false;
        };
        TableCellIterator.prototype.getConvertedObjectToArray = function (obj) {
            var tables = [];
            for (var index in obj) {
                if (!obj.hasOwnProperty(index))
                    continue;
                tables.push(obj[index]);
            }
            return tables;
        };
        TableCellIterator.prototype.setPositionProperties = function () {
            this.pageIndex = this.position.pageIndex;
            this.pageAreaIndex = this.position.pageAreaIndex;
            this.columnIndex = this.position.columnIndex;
        };
        TableCellIterator.prototype.isMainSubDocument = function () {
            return this.position.pageArea.subDocument.isMain();
        };
        TableCellIterator.prototype.getSelectedInterval = function () {
            return this.tableInfo.logicInfo.grid.table.rows[this.tableRowIndex].cells[this.tableCellInfoInternal.cellGridIndex].interval;
        };
        TableCellIterator.prototype.getModifyPosition = function () {
            var newPosition = this.position.clone();
            if (this.isMainSubDocument()) {
                newPosition.pageIndex = this.pageIndex;
                newPosition.pageAreaIndex = this.pageAreaIndex;
                newPosition.columnIndex = this.columnIndex;
                newPosition.page = this.layout.pages[newPosition.pageIndex];
                newPosition.pageArea = newPosition.page.mainSubDocumentPageAreas[newPosition.pageAreaIndex];
                newPosition.column = newPosition.pageArea.columns[newPosition.columnIndex];
            }
            newPosition.rowIndex = this.layoutRowIndexInLayout;
            newPosition.row = newPosition.column.rows[newPosition.rowIndex];
            return newPosition;
        };
        TableCellIterator.prototype.tryAdvanceToRightCell = function () {
            this.skipCalculateCellIndex = true;
            this.tableCellIndex++;
            if (this.tableCellIndex >= this.tableRowInfo.rowCells.length) {
                this.tableCellIndex = 0;
                return this.tryAdvanceToBelowRowInternal();
            }
            return this.updateTableInfosIfAdvanceToBelowRow();
        };
        TableCellIterator.prototype.tryAdvanceToLeftCell = function () {
            this.skipCalculateCellIndex = true;
            this.tableCellIndex--;
            if (this.tableCellIndex < 0) {
                this.canCalculateLastCellIndex = true;
                return this.tryAdvanceToAboveRowInternal();
            }
            return this.updateTableInfosIfAdvanceToAboveRow();
        };
        TableCellIterator.prototype.tryAdvanceToBelowRow = function () {
            if (!this.canAdvanceToBelowRow())
                return false;
            return this.tryAdvanceToBelowRowInternal();
        };
        TableCellIterator.prototype.tryAdvanceToBelowRowInternal = function () {
            this.isDownDirection = true;
            this.tableRowIndex++;
            if (this.tableRowIndex >= this.tableInfo.tableRows.length) {
                this.tableRowIndex = 0;
                this.tableIndex = 0;
                if (!this.isMainSubDocument())
                    return this.tryAdvanceToLayoutRowBelowTable();
                this.columnIndex++;
                if (this.columnIndex >= this.position.pageArea.columns.length) {
                    this.columnIndex = 0;
                    this.pageAreaIndex++;
                    if (this.pageAreaIndex >= this.position.page.mainSubDocumentPageAreas.length) {
                        this.pageAreaIndex = 0;
                        this.pageIndex++;
                        if (this.pageIndex >= this.layout.validPageCount)
                            return this.tryAdvanceToLayoutRowBelowTable();
                    }
                }
            }
            if (this.updateTableInfosIfAdvanceToBelowRow())
                return true;
            return this.tryAdvanceToLayoutRowBelowTable();
        };
        TableCellIterator.prototype.updateTableInfosIfAdvanceToBelowRow = function () {
            var tables = this.getTables();
            if (tables.length > 0 && this.isEqualTables(tables[this.tableIndex], this.tableInfo)) {
                this.tableInfo = tables[this.tableIndex];
                this.tableRowInfo = this.tableInfo.tableRows[this.tableRowIndex];
                if (!this.skipCalculateCellIndex)
                    this.tableCellIndex = this.findNextCellIndex(this.tableRowInfo);
                this.tableCellInfoInternal = this.tableRowInfo.rowCells[this.tableCellIndex];
                while (!this.tableCellInfoInternal.layoutRows.length) {
                    this.tableInfo = this.tableCellInfoInternal.internalTables[0];
                    this.tableRowIndex = 0;
                    this.tableRowInfo = this.tableInfo.tableRows[this.tableRowIndex];
                    this.tableCellIndex = 0;
                    this.tableCellInfoInternal = this.tableRowInfo.rowCells[this.tableCellIndex];
                }
                this.layoutRowIndexInLayout = this.tableCellInfoInternal.layoutRows[0].indexInColumn;
                this.goToInternalTableIfExistInFirstBelowRow();
                return true;
            }
            return false;
        };
        TableCellIterator.prototype.tryAdvanceToAboveRow = function () {
            if (!this.canAdvanceToAboveRow())
                return false;
            return this.tryAdvanceToAboveRowInternal();
        };
        TableCellIterator.prototype.getLayoutTablesAssociatedWithLogicGrid = function () {
            var list = [];
            this.setPositionProperties();
            list.push(this.tableInfo);
            while (this.tryAdvanceToAboveTable())
                list.push(this.tableInfo);
            return list;
        };
        TableCellIterator.prototype.tryAdvanceToAboveTable = function () {
            var columnIndexReset = false;
            var pageAreaIndexReset = false;
            this.columnIndex--;
            if (this.columnIndex < 0) {
                columnIndexReset = true;
                this.pageAreaIndex--;
                if (this.pageAreaIndex < 0)
                    pageAreaIndexReset = true;
                this.pageIndex--;
                if (this.pageIndex < 0)
                    return false;
            }
            if (pageAreaIndexReset)
                this.pageAreaIndex = this.layout.pages[this.pageIndex].mainSubDocumentPageAreas.length - 1;
            if (columnIndexReset)
                this.columnIndex = this.layout.pages[this.pageIndex].mainSubDocumentPageAreas[this.pageAreaIndex].columns.length - 1;
            var tables = this.layout.pages[this.pageIndex].mainSubDocumentPageAreas[this.pageAreaIndex].columns[this.columnIndex].tablesInfo;
            for (var t = void 0, i = 0; t = tables[i]; i++) {
                if (t.logicInfo.grid == this.tableInfo.logicInfo.grid) {
                    this.tableInfo = t;
                    return true;
                }
            }
            return false;
        };
        TableCellIterator.prototype.tryAdvanceToAboveRowInternal = function () {
            var rowIndexReset = false, columnIndexReset = false, pageAreaIndexReset = false;
            this.isDownDirection = false;
            if (this.tableCellInfoInternal.layoutRows.length == 1 && this.tableCellInfoInternal.internalTables[this.layoutRowIndexInCell])
                if (this.goToInternalTableIfExistInLastAboveRow())
                    return true;
            var tables = [];
            this.tableRowIndex--;
            if (this.tableRowIndex < 0) {
                if (!this.isMainSubDocument())
                    return this.tryAdvanceToLayoutRowAboveTable();
                rowIndexReset = true;
                this.columnIndex--;
                if (this.columnIndex < 0) {
                    columnIndexReset = true;
                    this.pageAreaIndex--;
                    if (this.pageAreaIndex < 0) {
                        pageAreaIndexReset = true;
                        this.pageIndex--;
                        if (this.pageIndex < 0)
                            return this.tryAdvanceToLayoutRowAboveTable();
                    }
                }
                if (pageAreaIndexReset)
                    this.pageAreaIndex = this.layout.pages[this.pageIndex].mainSubDocumentPageAreas.length - 1;
                if (columnIndexReset)
                    this.columnIndex = this.layout.pages[this.pageIndex].mainSubDocumentPageAreas[this.pageAreaIndex].columns.length - 1;
                if (rowIndexReset) {
                    tables = this.getTables();
                    if (tables.length == 0)
                        return false;
                    this.tableIndex = tables.length - 1;
                    this.tableRowIndex = tables[this.tableIndex].tableRows.length - 1;
                }
            }
            if (this.updateTableInfosIfAdvanceToAboveRow())
                return true;
            return this.tryAdvanceToLayoutRowAboveTable();
        };
        TableCellIterator.prototype.updateTableInfosIfAdvanceToAboveRow = function () {
            var tables = this.getTables();
            if (tables.length > 0 && this.isEqualTables(tables[this.tableIndex], this.tableInfo)) {
                this.tableInfo = tables[this.tableIndex];
                this.tableRowInfo = this.tableInfo.tableRows[this.tableRowIndex];
                if (!this.skipCalculateCellIndex) {
                    this.tableCellIndex = this.findNextCellIndex(this.tableRowInfo);
                    this.tableRowInfo = this.tableInfo.tableRows[this.tableRowIndex];
                }
                if (this.canCalculateLastCellIndex)
                    this.tableCellIndex = this.tableRowInfo.rowCells.length - 1;
                this.tableCellInfoInternal = this.tableRowInfo.rowCells[this.tableCellIndex];
                this.layoutRowIndexInLayout = this.tableCellInfoInternal.layoutRows[this.tableCellInfoInternal.layoutRows.length - 1].indexInColumn;
                this.goToInternalTableIfExistInLastAboveRow();
                return true;
            }
            return false;
        };
        TableCellIterator.prototype.tryAdvanceToLayoutRowBelowTable = function () {
            this.setPositionProperties();
            var row = __aspxRichEdit.ListUtils.last(__aspxRichEdit.ListUtils.last(__aspxRichEdit.ListUtils.last(this.tableInfo.tableRows).rowCells).layoutRows);
            var column = this.layout.pages[this.pageIndex].mainSubDocumentPageAreas[this.pageAreaIndex].columns[this.columnIndex];
            this.layoutRowIndexInLayout = row.indexInColumn + 1;
            if (this.layoutRowIndexInLayout >= column.rows.length) {
                this.columnIndex++;
                if (this.columnIndex >= this.position.pageArea.columns.length) {
                    this.columnIndex = 0;
                    this.pageAreaIndex++;
                    if (this.pageAreaIndex >= this.position.page.mainSubDocumentPageAreas.length) {
                        this.pageAreaIndex = 0;
                        this.pageIndex++;
                        if (this.pageIndex >= this.layout.validPageCount) {
                            this.setPositionProperties();
                            this.resetLayoutRowIndex();
                            return true;
                        }
                    }
                }
                this.layoutRowIndexInLayout = 0;
            }
            return true;
        };
        TableCellIterator.prototype.isAboveLayoutRowOuterTable = function () {
            return this.parentLink && this.parentLink.parentCell && this.parentLink.layoutRowIndexInParentCell == 0;
        };
        TableCellIterator.prototype.tryAdvanceToLayoutRowOuterTable = function (parentLink) {
            var parentRow = parentLink.parentCell.parentRow;
            var parentTable = parentRow.parentTable;
            if (parentRow.rowIndex == 0 && parentLink.parentLink.parentCell)
                return this.tryAdvanceToLayoutRowOuterTable(parentLink.parentLink);
            if (parentRow.rowIndex > 0) {
                var index = this.findNextCellIndex(parentTable.tableRows[parentRow.rowIndex - 1], true);
                this.layoutRowIndexInLayout = __aspxRichEdit.ListUtils.last(parentTable.tableRows[parentRow.rowIndex - 1].rowCells[index].layoutRows).indexInColumn;
                return true;
            }
            return false;
        };
        TableCellIterator.prototype.tryAdvanceToLayoutRowAboveTable = function () {
            this.setPositionProperties();
            if (this.isAboveLayoutRowOuterTable())
                return this.tryAdvanceToLayoutRowOuterTable(this.parentLink);
            var columnIndexReset = false, pageAreaIndexReset = false;
            var row = this.tableInfo.tableRows[0].rowCells[0].layoutRows[0];
            this.layoutRowIndexInLayout = row.indexInColumn - 1;
            if (this.layoutRowIndexInLayout < 0) {
                this.columnIndex--;
                if (this.columnIndex < 0) {
                    columnIndexReset = true;
                    this.pageAreaIndex--;
                    if (this.pageAreaIndex < 0) {
                        pageAreaIndexReset = true;
                        this.pageIndex--;
                        if (this.pageIndex < 0) {
                            this.setPositionProperties();
                            this.resetLayoutRowIndex();
                            return true;
                        }
                    }
                }
                if (pageAreaIndexReset)
                    this.pageAreaIndex = this.layout.pages[this.pageIndex].mainSubDocumentPageAreas.length - 1;
                if (columnIndexReset)
                    this.columnIndex = this.layout.pages[this.pageIndex].mainSubDocumentPageAreas[this.pageAreaIndex].columns.length - 1;
                var rows = this.layout.pages[this.pageIndex].mainSubDocumentPageAreas[this.pageAreaIndex].columns[this.columnIndex].rows;
                this.layoutRowIndexInLayout = rows.length - 1;
            }
            return true;
        };
        TableCellIterator.prototype.goToInternalTableIfExistInFirstBelowRow = function () {
            if (this.tableCellInfoInternal.internalTables && this.tableCellInfoInternal.internalTables[0]) {
                var internalTable = this.tableCellInfoInternal.internalTables[0];
                this.tableCellInfoInternal = internalTable.tableRows[0].rowCells[this.findNextCellIndex(internalTable.tableRows[0])];
                if (this.goToInternalTableIfExistInFirstBelowRow())
                    return true;
                this.layoutRowIndexInLayout = this.tableCellInfoInternal.layoutRows[0].indexInColumn;
                return true;
            }
            return false;
        };
        TableCellIterator.prototype.goToInternalTableIfExistInLastAboveRow = function () {
            var lastLayoutRowIndexInInternalTable = this.tableCellInfoInternal.layoutRows.length - 1;
            if (this.tableCellInfoInternal.internalTables && this.tableCellInfoInternal.internalTables[lastLayoutRowIndexInInternalTable]) {
                var internalTable = this.tableCellInfoInternal.internalTables[lastLayoutRowIndexInInternalTable];
                var lastTableRowIndex = internalTable.tableRows.length - 1;
                var cellIndexInInternalTable = this.findNextCellIndex(internalTable.tableRows[lastTableRowIndex]);
                var lastLayoutRowIndex = internalTable.tableRows[lastTableRowIndex].rowCells[cellIndexInInternalTable].layoutRows.length - 1;
                this.layoutRowIndexInLayout = internalTable.tableRows[lastTableRowIndex].rowCells[cellIndexInInternalTable].layoutRows[lastLayoutRowIndex].indexInColumn;
                return true;
            }
            return false;
        };
        TableCellIterator.prototype.canAdvanceToBelowRow = function () {
            return this.isInTable && this.layoutRowIndexInCell == this.tableCellInfoInternal.layoutRows.length - 1;
        };
        TableCellIterator.prototype.canAdvanceToAboveRow = function () {
            return this.isInTable && this.layoutRowIndexInCell == 0;
        };
        TableCellIterator.prototype.resetLayoutRowIndex = function () {
            this.layoutRowIndexInLayout = this.layoutRowIndexInLayoutInitial;
        };
        TableCellIterator.prototype.isEqualTables = function (table1, table2) {
            return table1.logicInfo.grid == table2.logicInfo.grid;
        };
        TableCellIterator.prototype.getTables = function () {
            if (this.isMainSubDocument())
                return this.layout.pages[this.pageIndex].mainSubDocumentPageAreas[this.pageAreaIndex].columns[this.columnIndex].tablesInfo;
            return this.position.column.tablesInfo;
        };
        TableCellIterator.prototype.findNextCellIndex = function (newRow, skipSearchCellInAllTable) {
            if (skipSearchCellInAllTable === void 0) { skipSearchCellInAllTable = false; }
            var x = this.position.box.getCharOffsetXInPixels(this.measurer, this.position.charOffset) + this.position.box.x + this.position.row.x;
            if (!this.isDownDirection && !skipSearchCellInAllTable) {
                for (var tableRowInfoIndex = this.tableRowIndex; tableRowInfoIndex >= 0; tableRowInfoIndex--) {
                    var tableRowInfo = this.tableInfo.tableRows[tableRowInfoIndex];
                    var tableCellInfoIndex = Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(tableRowInfo.rowCells, function (c) { return c.x; }, x));
                    var tableCellInfo = tableRowInfo.rowCells[tableCellInfoIndex];
                    if (x >= tableCellInfo.x && x <= (tableCellInfo.x + tableCellInfo.width)) {
                        this.tableRowIndex = tableRowInfoIndex;
                        return tableCellInfoIndex;
                    }
                }
            }
            for (var i = 0; i < newRow.rowCells.length; i++) {
                var cell = newRow.rowCells[i];
                if (x >= cell.x && x <= cell.getRightBoundPosition())
                    return i;
            }
            return 0;
        };
        return TableCellIterator;
    }());
    __aspxRichEdit.TableCellIterator = TableCellIterator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TEXTBOX_AREA_MARGIN = 5;
    var HitTestManager = (function () {
        function HitTestManager(documentLayout, measurer) {
            this.documentLayout = documentLayout;
            this.measurer = measurer;
            this.result = null;
            this.point = null;
        }
        HitTestManager.prototype.calculate = function (point, requestDetailsLevel, subDocument, excludeTextBoxesFromSubDocuments) {
            if (excludeTextBoxesFromSubDocuments === void 0) { excludeTextBoxesFromSubDocuments = false; }
            this.point = point;
            this.subDocument = subDocument;
            this.excludeTextBoxesFromSubDocuments = excludeTextBoxesFromSubDocuments;
            this.result = new __aspxRichEdit.HitTestResult(subDocument);
            this.result.detailsLevel = requestDetailsLevel;
            this.result.exactlyDetailLevel = __aspxRichEdit.DocumentLayoutDetailsLevel.None;
            if (point && !point.isEmpty())
                this.calcPage();
            return this.result;
        };
        HitTestManager.prototype.calcPage = function () {
            var page = this.documentLayout.pages[this.point.pageIndex];
            this.result.pageIndex = this.point.pageIndex;
            this.result.page = page;
            var pageDeviation = HitTestManager.getDeviation(this.point, new __aspxRichEdit.Rectangle().init(0, 0, page.width, page.height));
            this.result.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.Page] = pageDeviation;
            if (pageDeviation == __aspxRichEdit.HitTestDeviation.None)
                this.result.exactlyDetailLevel = __aspxRichEdit.DocumentLayoutDetailsLevel.Page;
            this.calcFloatingObject(false);
            if (this.result.detailsLevel > __aspxRichEdit.DocumentLayoutDetailsLevel.Page)
                this.calcPageArea(this.point.x, this.point.y);
        };
        HitTestManager.prototype.calcFloatingObject = function (considerBehindTextWrap) {
            if (this.result.floatingObject)
                return;
            var anchoredObjects = this.result.page.anchoredObjectHolder.getObjectsForRenderer(this.documentLayout.anchorObjectsPositionInfo);
            for (var i = 0, obj = void 0; obj = anchoredObjects[i]; i++) {
                if ((!this.result.subDocument ||
                    obj.belongsToSubDocId == this.result.subDocument.id) &&
                    (considerBehindTextWrap || obj.levelType != __aspxRichEdit.AnchoredObjectLevelType.BehindText)) {
                    var rotatedPoint = obj.rotationInRadians == 0 ? this.point : this.point.clone().rotate(-obj.rotationInRadians, obj.center);
                    if (obj.containsPoint(rotatedPoint.x, rotatedPoint.y)) {
                        this.result.floatingObject = obj;
                        return;
                    }
                }
            }
        };
        HitTestManager.prototype.calcPageArea = function (pointX, pointY) {
            var _this = this;
            var point = new __aspxRichEdit.Point(pointX, pointY);
            var pageArea;
            var pageAreaIndex;
            if (this.subDocument) {
                if (this.subDocument.isMain()) {
                    var pageAreas = this.result.page.mainSubDocumentPageAreas;
                    pageAreaIndex = HitTestManager.findNearest(pointY, pageAreas, function (pa) { return pa.y; }, function (pa) { return pa.getBottomBoundPosition(); });
                    pageArea = pageAreas[pageAreaIndex];
                }
                else {
                    pageArea = this.result.page.otherPageAreas[this.subDocument.id];
                    pageAreaIndex = 0;
                    if (!pageArea)
                        return;
                }
            }
            else {
                var pageAreas_1 = __aspxRichEdit.ListUtils.shallowCopy(this.result.page.mainSubDocumentPageAreas);
                __aspxRichEdit.MapUtilsKeyAsNumber.foreach(this.result.page.otherPageAreas, function (pa) {
                    if (pa.subDocument.isHeaderFooter())
                        pageAreas_1.push(pa);
                });
                var textBoxPaList_1 = [];
                if (!this.excludeTextBoxesFromSubDocuments) {
                    __aspxRichEdit.ListUtils.foreach(this.result.page.anchoredObjectHolder.getObjectsForRenderer(this.documentLayout.anchorObjectsPositionInfo), function (obj) {
                        if (obj.getType() == __aspxRichEdit.LayoutBoxType.AnchorTextBox)
                            textBoxPaList_1.push(_this.result.page.otherPageAreas[obj.internalSubDocId]);
                    });
                }
                __aspxRichEdit.ListUtils.addListOnTail(textBoxPaList_1, pageAreas_1);
                pageArea = __aspxRichEdit.Utils.hitTestRectangles(point, textBoxPaList_1)[0].obj;
                pageAreaIndex = pageArea.subDocument.isMain() ? __aspxRichEdit.ListUtils.indexOf(this.result.page.mainSubDocumentPageAreas, pageArea) : 0;
                this.result.subDocument = pageArea.subDocument;
            }
            this.result.pageArea = pageArea;
            this.result.pageAreaIndex = pageAreaIndex;
            var pageAreaDeviation = HitTestManager.getDeviation(point, pageArea)
                | this.result.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.Page];
            this.result.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.PageArea] = pageAreaDeviation;
            if (pageAreaDeviation == __aspxRichEdit.HitTestDeviation.None)
                this.result.exactlyDetailLevel = __aspxRichEdit.DocumentLayoutDetailsLevel.PageArea;
            else
                this.calcFloatingObject(true);
            if (this.result.detailsLevel > __aspxRichEdit.DocumentLayoutDetailsLevel.PageArea)
                this.calcColumn(pointX - pageArea.x, pointY - pageArea.y);
        };
        HitTestManager.prototype.calcColumn = function (pointX, pointY) {
            var columns = this.result.pageArea.columns;
            var columnIndex = HitTestManager.findNearest(pointX, columns, function (col) { return col.x; }, function (col) { return col.getRightBoundPosition(); });
            var column = columns[columnIndex];
            this.result.columnIndex = columnIndex;
            this.result.column = column;
            var columnDeviation = HitTestManager.getDeviation(new __aspxRichEdit.Point(pointX, pointY), column)
                | this.result.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.PageArea];
            this.result.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.Column] = columnDeviation;
            if (columnDeviation == __aspxRichEdit.HitTestDeviation.None)
                this.result.exactlyDetailLevel = __aspxRichEdit.DocumentLayoutDetailsLevel.Column;
            else
                this.calcFloatingObject(true);
            if (this.result.detailsLevel > __aspxRichEdit.DocumentLayoutDetailsLevel.Column)
                this.calcRow(pointX - column.x, pointY - column.y);
        };
        HitTestManager.prototype.calcRow = function (pointX, pointY) {
            var rows = this.result.column.rows;
            var closestTable = this.getClosestTable(pointX, pointY);
            this.result.rowIndex = closestTable ?
                this.getLayoutRowIndexCaseInTable(pointX, pointY, closestTable) :
                Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(rows, function (r) { return r.y; }, pointY));
            var row = rows[this.result.rowIndex];
            this.result.row = row;
            var rowDeviation = HitTestManager.getDeviation(new __aspxRichEdit.Point(pointX, pointY), row)
                | this.result.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.Column];
            this.result.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.Row] = rowDeviation;
            if (rowDeviation == __aspxRichEdit.HitTestDeviation.None)
                this.result.exactlyDetailLevel = __aspxRichEdit.DocumentLayoutDetailsLevel.Row;
            else
                this.calcFloatingObject(true);
            if (this.result.detailsLevel > __aspxRichEdit.DocumentLayoutDetailsLevel.Row)
                this.calcBox(pointX - row.x, pointY - row.y);
        };
        HitTestManager.prototype.calcBox = function (pointX, pointY) {
            var boxes = this.result.row.boxes;
            var boxIndex = Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(boxes, function (b) { return b.x; }, pointX));
            var box = boxes[boxIndex];
            var boxLeftBorder = box.x;
            var boxRightBorder = boxLeftBorder + box.width;
            var boxTopBorder = this.result.row.baseLine - box.getAscent();
            var boxBottomBorder = box.height + boxTopBorder;
            if (boxBottomBorder > this.result.row.height)
                boxBottomBorder = this.result.row.height;
            this.result.boxIndex = boxIndex;
            this.result.box = this.result.row.boxes[boxIndex];
            var boxDeviation = HitTestManager.getDeviation(new __aspxRichEdit.Point(pointX, pointY), new __aspxRichEdit.Rectangle().init(boxLeftBorder, boxTopBorder, boxRightBorder - boxLeftBorder, boxBottomBorder - boxTopBorder))
                | this.result.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.Row];
            this.result.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.Box] = boxDeviation;
            if (boxDeviation == __aspxRichEdit.HitTestDeviation.None)
                this.result.exactlyDetailLevel = __aspxRichEdit.DocumentLayoutDetailsLevel.Box;
            else
                this.calcFloatingObject(true);
            if (this.result.detailsLevel > __aspxRichEdit.DocumentLayoutDetailsLevel.Box)
                this.calcCharacter(pointX - boxLeftBorder, pointY - boxTopBorder);
        };
        HitTestManager.prototype.calcCharacter = function (pointX, _pointY) {
            var boxDeviation = this.result.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.Box];
            var boxOffset = -1;
            if (boxDeviation & __aspxRichEdit.HitTestDeviation.Left)
                boxOffset = 0;
            else if (boxDeviation & __aspxRichEdit.HitTestDeviation.Right)
                boxOffset = this.result.box.getLength();
            else
                boxOffset = this.result.box.calculateCharOffsetByPointX(this.measurer, pointX);
            this.result.charOffset = boxOffset;
            this.result.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.Character] = boxDeviation;
            if (boxDeviation == __aspxRichEdit.HitTestDeviation.None)
                this.result.exactlyDetailLevel = __aspxRichEdit.DocumentLayoutDetailsLevel.Character;
            else
                this.calcFloatingObject(true);
        };
        HitTestManager.getDeviation = function (point, rect) {
            return new RectangleDeviation(rect, point).calcDeviation().deviation.getValue();
        };
        HitTestManager.findNearest = function (point, objects, minBound, maxBound) {
            var currObj = objects[0];
            var nextObjIndex = 1;
            for (var nextObj = void 0; nextObj = objects[nextObjIndex]; nextObjIndex++) {
                if (point - maxBound(currObj) <= minBound(nextObj) - point)
                    break;
                currObj = nextObj;
            }
            return nextObjIndex - 1;
        };
        HitTestManager.prototype.getClosestTable = function (pointX, pointY) {
            var tableColumnInfos = this.result.column.tablesInfo;
            if (tableColumnInfos.length == 0)
                return null;
            var belowPosition = [];
            var abovePosition = [];
            var leftRightDeviation = [];
            var exactlyColumn = __aspxRichEdit.ListUtils.reverseElementBy(tableColumnInfos, function (currTableColumnInfo) {
                var deviationResult = new RectangleDeviation(currTableColumnInfo, new __aspxRichEdit.Point(pointX, pointY)).calcDeviation();
                var deviation = deviationResult.deviation;
                if (deviation.getValue() == __aspxRichEdit.HitTestDeviation.None)
                    return true;
                if (deviation.get(__aspxRichEdit.HitTestDeviation.Top))
                    belowPosition.push(deviationResult);
                else if (deviation.get(__aspxRichEdit.HitTestDeviation.Bottom))
                    abovePosition.push(deviationResult);
                else
                    leftRightDeviation.push(deviationResult);
                return false;
            });
            if (exactlyColumn)
                return exactlyColumn;
            var isCollectBelowTables = this.result.column.rows[0].tableCellInfo && pointY <= tableColumnInfos[0].y;
            if (belowPosition.length && isCollectBelowTables)
                return HitTestManager.choiseClosestTable(belowPosition, false);
            var isCollectAboveTables = __aspxRichEdit.ListUtils.last(this.result.column.rows).tableCellInfo && pointY >= __aspxRichEdit.ListUtils.last(tableColumnInfos).y;
            if (abovePosition.length && isCollectAboveTables)
                return HitTestManager.choiseClosestTable(abovePosition, true);
            if (leftRightDeviation.length)
                return HitTestManager.choiseClosestTable(leftRightDeviation, false);
            return null;
        };
        HitTestManager.choiseClosestTable = function (tblList, isUseMax) {
            __aspxRichEdit.ListUtils.foreach(tblList, function (elem) { return elem.calcAdditionalParams(); });
            return ((isUseMax ? __aspxRichEdit.ListUtils.max : __aspxRichEdit.ListUtils.min)(tblList, function (a, b) { return a.offsetToInside.y - b.offsetToInside.y; }).initRectangle);
        };
        HitTestManager.prototype.getLayoutRowIndexCaseInTable = function (pointX, pointY, closestTable) {
            var cell;
            while (true) {
                cell = this.getCell(pointX, pointY, closestTable);
                if (cell.layoutRows.length)
                    break;
                closestTable = cell.internalTables[0];
            }
            var cellDeviation = new RectangleDeviation(cell, new __aspxRichEdit.Point(pointX, pointY)).calcDeviation().deviation.getValue();
            this.result.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.TableCell] = cellDeviation;
            if (cellDeviation == __aspxRichEdit.HitTestDeviation.None)
                this.result.exactlyDetailLevel = __aspxRichEdit.DocumentLayoutDetailsLevel.TableCell;
            var deviations = [];
            var bestSuitableTbl = __aspxRichEdit.MapUtilsKeyAsNumber.elementBy(cell.internalTables, function (tbl) {
                if (tbl.containsPoint(pointX, pointY))
                    return true;
                deviations.push(new RectangleDeviation(tbl, new __aspxRichEdit.Point(pointX, pointY)).calcDeviation().calcAdditionalParams());
                return false;
            });
            if (bestSuitableTbl)
                return this.getLayoutRowIndexCaseInTable(pointX, pointY, bestSuitableTbl);
            var layoutRowAndIndex_Index = Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(cell.layoutRows, function (r) { return r.y; }, pointY));
            var layoutRow = cell.layoutRows[layoutRowAndIndex_Index];
            var bestSuitableTblDeviation = __aspxRichEdit.ListUtils.min(deviations, function (a, b) { return a.offsetToInside.y - b.offsetToInside.y; });
            if (!bestSuitableTblDeviation ||
                new RectangleDeviation(layoutRow, new __aspxRichEdit.Point(pointX, pointY)).calcDeviation().calcAdditionalParams().offsetToInside.y <=
                    bestSuitableTblDeviation.offsetToInside.y)
                return layoutRow.indexInColumn;
            return this.getLayoutRowIndexCaseInTable(pointX, pointY, bestSuitableTblDeviation.initRectangle);
        };
        HitTestManager.getCellInRow = function (pointX, pointY, row, isForceGetCell) {
            var cells = row.rowCells;
            var cellIndex = Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(cells, function (c) { return c.x; }, pointX));
            var cell = cells[cellIndex];
            return isForceGetCell || cell.containsPoint(pointX, pointY) ? cell : null;
        };
        HitTestManager.prototype.getCell = function (pointX, pointY, closestTable) {
            var rows = closestTable.tableRows;
            var rowIndex = Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(rows, function (r) { return r.y; }, pointY));
            var row = rows[rowIndex];
            var cell = HitTestManager.getCellInRow(pointX, pointY, row, true);
            if (cell.containsPoint(pointX, pointY))
                return cell;
            var exactlyCalculatedCell = __aspxRichEdit.ListUtils.reverseAnyOf(rows, function (row) { return HitTestManager.getCellInRow(pointX, pointY, row, false); }, rowIndex - 1);
            if (exactlyCalculatedCell)
                return exactlyCalculatedCell;
            return cell;
        };
        HitTestManager.isPointInTexBoxArea = function (point, box, angle) {
            var rotatedPoint = angle == 0 ? point : point.clone().rotate(-angle, box.center);
            return rotatedPoint.x > box.x + TEXTBOX_AREA_MARGIN &&
                rotatedPoint.x < box.x + box.width - TEXTBOX_AREA_MARGIN &&
                rotatedPoint.y > box.y + TEXTBOX_AREA_MARGIN &&
                rotatedPoint.y < box.y + box.height - TEXTBOX_AREA_MARGIN;
        };
        return HitTestManager;
    }());
    __aspxRichEdit.HitTestManager = HitTestManager;
    var RectangleDeviation = (function () {
        function RectangleDeviation(initRectangle, initPoint) {
            this.initRectangle = initRectangle;
            this.initPoint = initPoint;
            this.deviation = new __aspxRichEdit.Flag(__aspxRichEdit.HitTestDeviation.None);
        }
        RectangleDeviation.prototype.calcDeviation = function () {
            if (this.initPoint.x < this.initRectangle.x)
                this.deviation.set(__aspxRichEdit.HitTestDeviation.Left, true);
            else if (this.initPoint.x > this.initRectangle.getRightBoundPosition())
                this.deviation.set(__aspxRichEdit.HitTestDeviation.Right, true);
            if (this.initPoint.y < this.initRectangle.y)
                this.deviation.set(__aspxRichEdit.HitTestDeviation.Top, true);
            else if (this.initPoint.y > this.initRectangle.getBottomBoundPosition())
                this.deviation.set(__aspxRichEdit.HitTestDeviation.Bottom, true);
            return this;
        };
        RectangleDeviation.prototype.calcAdditionalParams = function () {
            this.insidePoint = this.initPoint.clone();
            this.offsetToInside = new __aspxRichEdit.Point(0, 0);
            if (this.deviation.get(__aspxRichEdit.HitTestDeviation.Left)) {
                this.insidePoint.x = this.initRectangle.x;
                this.offsetToInside.x = this.insidePoint.x - this.initPoint.x;
            }
            else if (this.deviation.get(__aspxRichEdit.HitTestDeviation.Right)) {
                this.insidePoint.x = this.initRectangle.getRightBoundPosition();
                this.offsetToInside.x = this.initPoint.x - this.insidePoint.x;
            }
            if (this.deviation.get(__aspxRichEdit.HitTestDeviation.Top)) {
                this.insidePoint.y = this.initRectangle.y;
                this.offsetToInside.y = this.insidePoint.y - this.initPoint.y;
            }
            else if (this.deviation.get(__aspxRichEdit.HitTestDeviation.Bottom)) {
                this.insidePoint.y = this.initRectangle.getBottomBoundPosition();
                this.offsetToInside.y = this.initPoint.y - this.insidePoint.y;
            }
            return this;
        };
        return RectangleDeviation;
    }());
    __aspxRichEdit.RectangleDeviation = RectangleDeviation;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HitTestResult = (function (_super) {
        __extends(HitTestResult, _super);
        function HitTestResult(subDocument) {
            var _this = _super.call(this, DocumentLayoutDetailsLevel.None) || this;
            _this.subDocument = null;
            _this.deviations = {};
            _this.subDocument = subDocument;
            return _this;
        }
        HitTestResult.prototype.correctAsVisibleBox = function () {
            if (!this.box || this.box.isVisible())
                return;
            this.deviations[DocumentLayoutDetailsLevel.Box] = undefined;
            this.exactlyDetailLevel = Math.min(this.exactlyDetailLevel, DocumentLayoutDetailsLevel.Row);
            var boxIndex = this.row.getLastVisibleBoxIndex();
            this.boxIndex = Math.max(0, boxIndex);
            this.box = this.row.boxes[this.boxIndex];
            this.charOffset = boxIndex < 0 ? 0 : this.box.getLength();
        };
        HitTestResult.prototype.getPosition = function () {
            var result = 0;
            if (this.page && this.subDocument.isMain())
                result += this.page.getPosition();
            if (this.pageArea)
                result += this.pageArea.pageOffset;
            if (this.column)
                result += this.column.pageAreaOffset;
            if (this.row)
                result += this.row.columnOffset;
            if (this.box)
                result += this.box.rowOffset;
            if (this.charOffset >= 0)
                result += this.charOffset;
            return result;
        };
        return HitTestResult;
    }(__aspxRichEdit.LayoutPosition));
    __aspxRichEdit.HitTestResult = HitTestResult;
    var DocumentLayoutDetailsLevel;
    (function (DocumentLayoutDetailsLevel) {
        DocumentLayoutDetailsLevel[DocumentLayoutDetailsLevel["None"] = -1] = "None";
        DocumentLayoutDetailsLevel[DocumentLayoutDetailsLevel["Page"] = 0] = "Page";
        DocumentLayoutDetailsLevel[DocumentLayoutDetailsLevel["PageArea"] = 1] = "PageArea";
        DocumentLayoutDetailsLevel[DocumentLayoutDetailsLevel["Column"] = 2] = "Column";
        DocumentLayoutDetailsLevel[DocumentLayoutDetailsLevel["TableRow"] = 3] = "TableRow";
        DocumentLayoutDetailsLevel[DocumentLayoutDetailsLevel["TableCell"] = 4] = "TableCell";
        DocumentLayoutDetailsLevel[DocumentLayoutDetailsLevel["Row"] = 5] = "Row";
        DocumentLayoutDetailsLevel[DocumentLayoutDetailsLevel["Box"] = 6] = "Box";
        DocumentLayoutDetailsLevel[DocumentLayoutDetailsLevel["Character"] = 7] = "Character";
        DocumentLayoutDetailsLevel[DocumentLayoutDetailsLevel["Max"] = 255] = "Max";
    })(DocumentLayoutDetailsLevel = __aspxRichEdit.DocumentLayoutDetailsLevel || (__aspxRichEdit.DocumentLayoutDetailsLevel = {}));
    var HitTestDeviation;
    (function (HitTestDeviation) {
        HitTestDeviation[HitTestDeviation["None"] = 0] = "None";
        HitTestDeviation[HitTestDeviation["Top"] = 1] = "Top";
        HitTestDeviation[HitTestDeviation["Bottom"] = 2] = "Bottom";
        HitTestDeviation[HitTestDeviation["Left"] = 4] = "Left";
        HitTestDeviation[HitTestDeviation["Right"] = 8] = "Right";
    })(HitTestDeviation = __aspxRichEdit.HitTestDeviation || (__aspxRichEdit.HitTestDeviation = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutBoxIteratorMainSubDocument = (function (_super) {
        __extends(LayoutBoxIteratorMainSubDocument, _super);
        function LayoutBoxIteratorMainSubDocument(subDocument, layout, intervalStart, intervalEnd) {
            return _super.call(this, subDocument, layout, intervalStart, intervalEnd) || this;
        }
        LayoutBoxIteratorMainSubDocument.prototype.isInitialized = function () {
            if (!this.layout.isFullyFormatted) {
                var lastValidPage = this.layout.getLastValidPage();
                if (!lastValidPage || this.intervalEnd > __aspxRichEdit.ListUtils.last(lastValidPage.getContentIntervals()).end)
                    return false;
            }
            return true;
        };
        LayoutBoxIteratorMainSubDocument.prototype.getNewLayoutPosition = function (position, endRowConflictFlags, middleRowConflictFlags) {
            return new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.layout, this.subDocument, position, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                .create(endRowConflictFlags, middleRowConflictFlags);
        };
        LayoutBoxIteratorMainSubDocument.prototype.advancePosition = function () {
            return new __aspxRichEdit.LayoutPositionAdvanceForwardHelper(this.position, this.layout).advance();
        };
        LayoutBoxIteratorMainSubDocument.prototype.advancePositionBack = function () {
            return new __aspxRichEdit.LayoutPositionAdvanceBackwardHelper(this.position, this.layout).advance();
        };
        return LayoutBoxIteratorMainSubDocument;
    }(__aspxRichEdit.LayoutBoxIteratorBase));
    __aspxRichEdit.LayoutBoxIteratorMainSubDocument = LayoutBoxIteratorMainSubDocument;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutBoxIteratorOtherSubDocument = (function (_super) {
        __extends(LayoutBoxIteratorOtherSubDocument, _super);
        function LayoutBoxIteratorOtherSubDocument(subDocument, layout, intervalStart, intervalEnd, pageIndex) {
            var _this = _super.call(this, subDocument, layout, intervalStart, intervalEnd) || this;
            _this.pageIndex = pageIndex;
            return _this;
        }
        LayoutBoxIteratorOtherSubDocument.prototype.isInitialized = function () {
            var page = this.layout.pages[this.pageIndex];
            if (!page || page.otherPageAreas[this.subDocument.id].getEndPosition() < this.intervalEnd)
                return false;
            return true;
        };
        LayoutBoxIteratorOtherSubDocument.prototype.getNewLayoutPosition = function (position, endRowConflictFlags, middleRowConflictFlags) {
            return new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.layout, this.subDocument, position, this.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                .create(endRowConflictFlags, middleRowConflictFlags);
        };
        return LayoutBoxIteratorOtherSubDocument;
    }(__aspxRichEdit.LayoutBoxIteratorBase));
    __aspxRichEdit.LayoutBoxIteratorOtherSubDocument = LayoutBoxIteratorOtherSubDocument;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SimpleSelectionLayoutType;
    (function (SimpleSelectionLayoutType) {
        SimpleSelectionLayoutType[SimpleSelectionLayoutType["Search"] = 0] = "Search";
        SimpleSelectionLayoutType[SimpleSelectionLayoutType["Misspelled"] = 1] = "Misspelled";
        SimpleSelectionLayoutType[SimpleSelectionLayoutType["RangePermission"] = 2] = "RangePermission";
    })(SimpleSelectionLayoutType = __aspxRichEdit.SimpleSelectionLayoutType || (__aspxRichEdit.SimpleSelectionLayoutType = {}));
    var SelectionFormatter = (function (_super) {
        __extends(SelectionFormatter, _super);
        function SelectionFormatter(selection, measurer, layoutSelection, documentProtectionSettings) {
            var _this = _super.call(this) || this;
            _this.onSelectionLayoutChanged = new __aspxRichEdit.EventDispatcher();
            _this.selection = selection;
            _this.measurer = measurer;
            _this.layoutSelection = layoutSelection;
            _this.documentProtectionSettings = documentProtectionSettings;
            return _this;
        }
        SelectionFormatter.prototype.showRangePermissions = function () {
            return this.documentProtectionSettings.rangeVisibility == __aspxRichEdit.BookmarksVisibility.Visible;
        };
        SelectionFormatter.prototype.NotifySelectionChanged = function (_selection) {
            var _this = this;
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.SelectionFormatter, "NotifySelectionChanged", function () { return "intervals: " + __aspxRichEdit.ListUtils.map(_this.selection.intervals, function (currI) { return __aspxRichEdit.LogObjToStr.fixedInterval(currI); }).join(" ") + ", subDocId: " + _this.selection.model.activeSubDocument.id; });
            this.updateSubDocumentInfo();
            this.selectionChanged();
        };
        SelectionFormatter.prototype.NotifySearchSelectionChanged = function () {
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.SelectionFormatter, "NotifySearchSelectionChanged", "");
            this.layoutSelection.searchInfo.changes = [];
            for (var _i = 0, _a = this.layoutSelection.searchInfo.pageInfos; _i < _a.length; _i++) {
                var pageInfo = _a[_i];
                pageInfo.beforeRecreatePageSelection();
            }
            var subDocument = this.selection.model.activeSubDocument;
            this.createSimpleLayout(subDocument, this.intersectModelIntervalsWithValidPageIntervals(subDocument, this.selection.searchIntervals, this.layoutSelection.pageIndex), this.layoutSelection.searchInfo, SimpleSelectionLayoutType.Search);
            if (!this.isUpdateLocked())
                this.raiseSearchSelectionLayoutChanged();
        };
        SelectionFormatter.prototype.NotifyMisspelledSelectionChanged = function () {
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.SelectionFormatter, "NotifyMisspelledSelectionChanged", "");
            this.layoutSelection.misspelledInfo.changes = [];
            for (var _i = 0, _a = this.layoutSelection.misspelledInfo.pageInfos; _i < _a.length; _i++) {
                var pageInfo = _a[_i];
                pageInfo.beforeRecreatePageSelection();
            }
            var subDocument = this.selection.model.activeSubDocument;
            this.createSimpleLayout(subDocument, this.intersectModelIntervalsWithValidPageIntervals(subDocument, this.selection.misspelledIntervals, this.layoutSelection.pageIndex), this.layoutSelection.misspelledInfo, SimpleSelectionLayoutType.Misspelled);
            if (!this.isUpdateLocked())
                this.raiseMisspelledSelectionLayoutChanged();
        };
        SelectionFormatter.prototype.NotifyPagesReady = function (pageChanges) {
            var _this = this;
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.SelectionFormatter, "NotifyPagesReady", "");
            var _loop_7 = function (pageChange) {
                if (pageChange.changeType == __aspxRichEdit.LayoutChangeType.Deleted) {
                    this_6.layoutSelection.selectionInfo.pageInfos.splice(pageChange.index, 1);
                    this_6.layoutSelection.selectionInfo.changes.push(new __aspxRichEdit.LayoutPageSelectionChange(pageChange.index, __aspxRichEdit.LayoutChangeType.Deleted, []));
                    if (this_6.showRangePermissions()) {
                        this_6.layoutSelection.rangePermissionInfo.pageInfos.splice(pageChange.index, 1);
                        this_6.layoutSelection.rangePermissionInfo.changes.push(new __aspxRichEdit.LayoutPageSelectionChange(pageChange.index, __aspxRichEdit.LayoutChangeType.Deleted, []));
                    }
                }
                else {
                    this_6.buildPageSelection(pageChange.index);
                    if (this_6.showRangePermissions()) {
                        var pageInfo = this_6.layoutSelection.rangePermissionInfo.pageInfos[pageChange.index];
                        if (pageInfo)
                            pageInfo.beforeRecreatePageSelection();
                        this_6.buildRangePermissionSelection(this_6.selection.model.mainSubDocument, pageChange.index);
                        __aspxRichEdit.MapUtilsKeyAsNumber.foreach(this_6.selection.layout.pages[pageChange.index].otherPageAreas, function (pa) { return _this.buildRangePermissionSelection(pa.subDocument, pageChange.index); });
                    }
                }
            };
            var this_6 = this;
            for (var _i = 0, pageChanges_1 = pageChanges; _i < pageChanges_1.length; _i++) {
                var pageChange = pageChanges_1[_i];
                _loop_7(pageChange);
            }
            if (!this.isUpdateLocked()) {
                this.raiseSelectionLayoutChanged();
                if (this.showRangePermissions())
                    this.raiseRangePermissionLayoutChanged();
            }
        };
        SelectionFormatter.prototype.NotifyFullyFormatted = function () { };
        ;
        SelectionFormatter.prototype.onUpdateUnlocked = function (_occurredEvents) {
            this.updateSubDocumentInfo();
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.SelectionFormatter, "onUpdateUnlocked", "");
            this.raiseSelectionLayoutChanged();
            this.raiseSearchSelectionLayoutChanged();
            this.raiseMisspelledSelectionLayoutChanged();
            if (this.showRangePermissions())
                this.raiseRangePermissionLayoutChanged();
        };
        SelectionFormatter.prototype.selectionChanged = function () {
            this.layoutSelection.selectionInfo.changes = [];
            for (var _i = 0, _a = this.layoutSelection.selectionInfo.pageInfos; _i < _a.length; _i++) {
                var pageInfo = _a[_i];
                pageInfo.beforeRecreatePageSelection();
            }
            this.buildContiniousSelection();
            if (!this.isUpdateLocked())
                this.raiseSelectionLayoutChanged();
        };
        SelectionFormatter.prototype.updateSubDocumentInfo = function () {
            var needUpdate = this.layoutSelection.pageIndex != this.selection.pageIndex ||
                this.layoutSelection.subDocumentInfo != this.selection.model.activeSubDocument.info;
            if (needUpdate) {
                this.layoutSelection.pageIndex = this.selection.pageIndex;
                this.layoutSelection.subDocumentInfo = this.selection.model.activeSubDocument.info;
                this.selectionChanged();
            }
        };
        SelectionFormatter.prototype.buildContiniousSelection = function () {
            if (this.selection.isCollapsed())
                this.createCollapsedSelectionLayout(-1);
            else {
                var layout = this.selection.layout;
                var selIntervals = this.selection.intervals;
                var subDoc = this.selection.model.activeSubDocument;
                var validLayoutInterval = void 0;
                if (subDoc.isMain())
                    validLayoutInterval = __aspxRichEdit.IntervalAlgorithms.getMergedIntervals(__aspxRichEdit.ListUtils.accumulate(layout.pages, [], function (acc, page) { return __aspxRichEdit.ListUtils.addListOnTail(acc, page.getContentIntervals()); }, 0, layout.validPageCount), true);
                else {
                    if (this.selection.pageIndex < layout.validPageCount) {
                        var pageArea = layout.pages[this.selection.pageIndex].otherPageAreas[subDoc.id];
                        validLayoutInterval = pageArea ? [new __aspxRichEdit.FixedInterval(0, subDoc.getDocumentEndPosition())] : [];
                    }
                    else
                        validLayoutInterval = [];
                }
                for (var _i = 0, _a = __aspxRichEdit.IntervalAlgorithms.getIntersectionsTwoArraysOfInterval(validLayoutInterval, selIntervals); _i < _a.length; _i++) {
                    var interval = _a[_i];
                    this.createExtendedSelectionLayout(interval, this.layoutSelection.selectionInfo, selIntervals);
                }
            }
        };
        SelectionFormatter.prototype.buildPageSelection = function (pageIndex) {
            var selection = this.selection;
            var pageInfo = this.layoutSelection.selectionInfo.pageInfos[pageIndex];
            if (pageInfo)
                pageInfo.beforeRecreatePageSelection();
            if (selection.isCollapsed()) {
                this.layoutSelection.selectionInfo.changes = [];
                this.createCollapsedSelectionLayout(pageIndex);
            }
            else {
                var page = selection.layout.pages[pageIndex];
                var subDocument = selection.model.activeSubDocument;
                var intersPageIntervalsAndSelectionIntervals = [];
                if (subDocument.isMain())
                    intersPageIntervalsAndSelectionIntervals =
                        __aspxRichEdit.IntervalAlgorithms.getIntersectionsTwoArraysOfInterval(selection.intervals, page.getContentIntervals());
                else if (page.otherPageAreas[subDocument.id] && pageIndex == selection.pageIndex)
                    intersPageIntervalsAndSelectionIntervals = selection.intervals;
                for (var _i = 0, intersPageIntervalsAndSelectionIntervals_1 = intersPageIntervalsAndSelectionIntervals; _i < intersPageIntervalsAndSelectionIntervals_1.length; _i++) {
                    var interval = intersPageIntervalsAndSelectionIntervals_1[_i];
                    if (interval.length > 0)
                        this.createExtendedSelectionLayout(interval, this.layoutSelection.selectionInfo, selection.intervals);
                }
            }
        };
        SelectionFormatter.prototype.buildRangePermissionSelection = function (subDocument, pageIndex) {
            var selection = this.selection;
            var page = selection.layout.pages[pageIndex];
            var rpIntervals = __aspxRichEdit.ListUtils.map(subDocument.rangePermissions, function (rp) { return rp.interval; });
            var intersPageIntervalsAndSelectionIntervals = subDocument.isMain() ?
                __aspxRichEdit.IntervalAlgorithms.getIntersectionsTwoArraysOfInterval(rpIntervals, page.getContentIntervals()) :
                rpIntervals;
            this.createSimpleLayout(subDocument, SelectionFormatter.translateInteralsToIterators(this.selection.layout, subDocument, pageIndex, intersPageIntervalsAndSelectionIntervals), this.layoutSelection.rangePermissionInfo, SimpleSelectionLayoutType.RangePermission);
        };
        SelectionFormatter.prototype.createCollapsedSelectionLayout = function (dontCreateSelectionIfNotThisPageIndex) {
            var selection = this.selection;
            var selectionPosition = selection.intervals[0].start;
            var layout = selection.layout;
            var subDocument = selection.model.activeSubDocument;
            var cursorPos = subDocument.isMain()
                ? new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(layout, subDocument, selectionPosition, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                    .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false))
                : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(layout, subDocument, selectionPosition, selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                    .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
            if (!cursorPos || dontCreateSelectionIfNotThisPageIndex >= 0 && cursorPos.pageIndex != dontCreateSelectionIfNotThisPageIndex ||
                !cursorPos.page.isValid)
                return;
            var stepBackward = true;
            while (__aspxRichEdit.EnumUtils.isAnyOf(cursorPos.box.getType(), __aspxRichEdit.LayoutBoxType.AnchorPicture, __aspxRichEdit.LayoutBoxType.AnchorTextBox)) {
                if (stepBackward) {
                    if (!cursorPos.advanceToPrevBoxInRow())
                        stepBackward = false;
                }
                else {
                    if (!cursorPos.advanceToNextBoxInRow())
                        break;
                }
            }
            var cellInfo = cursorPos.row.tableCellInfo;
            if (cellInfo && cellInfo.boundFlags.get(__aspxRichEdit.TableCellBoundFlags.EndOnThisColumn)) {
                var rowInfo = cellInfo.parentRow;
                var tableGrid = rowInfo.parentTable.logicInfo.grid;
                var cellGridInfo = tableGrid.tableCellGridInfos[rowInfo.rowIndex][cellInfo.cellGridIndex];
                var cell = tableGrid.table.rows[cellGridInfo.getStartRowIndex()].cells[cellGridInfo.getCellIndex(0)];
                if (selectionPosition == cell.endParagrapPosition.value - 1) {
                    for (var _i = 0, _a = cursorPos.column.tablesInfo; _i < _a.length; _i++) {
                        var prevNestedTableColumnInfo = _a[_i];
                        if (prevNestedTableColumnInfo.logicInfo.grid.table.getEndPosition() == selectionPosition) {
                            var lastBorder = __aspxRichEdit.ListUtils.last(prevNestedTableColumnInfo.verticalBorders);
                            var prevLayoutRow = cursorPos.column.rows[cursorPos.rowIndex - 1];
                            var parMarkBoxHeight = cursorPos.row.boxes[0].height;
                            var floatingObjectId_1 = subDocument.isMain() || subDocument.isHeaderFooter() ?
                                __aspxRichEdit.LayoutSelectionItem.mainPageAreaSelection :
                                cursorPos.page.anchoredObjectHolder.getTextBoxByInternalSubDocId(subDocument.id).objectId;
                            var selectionCursor_1 = new __aspxRichEdit.LayoutSelectionCursorItem();
                            selectionCursor_1.init(cursorPos.pageArea.x + cursorPos.column.x + prevNestedTableColumnInfo.x + lastBorder.xPos + Math.max(1, lastBorder.borderInfo.width) + 1, cursorPos.pageArea.y + cursorPos.column.y + prevLayoutRow.getBottomBoundPosition() - parMarkBoxHeight, 1, parMarkBoxHeight);
                            selectionCursor_1.floatingObjectId = floatingObjectId_1;
                            this.layoutSelection.selectionInfo.registerItem(cursorPos.pageIndex, selectionCursor_1);
                            return;
                        }
                    }
                }
            }
            SelectionFormatter.setPositionOnVisibleBox(cursorPos);
            if (cursorPos.row.height == 0 || cursorPos.row.width == 0)
                return;
            var floatingObjectId = subDocument.isMain() || subDocument.isHeaderFooter() ?
                __aspxRichEdit.LayoutSelectionItem.mainPageAreaSelection :
                cursorPos.page.anchoredObjectHolder.getTextBoxByInternalSubDocId(subDocument.id).objectId;
            var selectionCursor = __aspxRichEdit.LayoutSelectionItem.create(cursorPos, new __aspxRichEdit.Size(1, cursorPos.box.height), floatingObjectId, __aspxRichEdit.LayoutSelectionCursorItem);
            selectionCursor.x += cursorPos.box.x + (cursorPos.box.isVisible() ? cursorPos.box.getCharOffsetXInPixels(this.measurer, cursorPos.charOffset) : 0);
            selectionCursor.y += cursorPos.row.getSpacingBefore() + cursorPos.row.baseLine - cursorPos.box.getAscent() - cursorPos.row.getSpacingBefore();
            if (cursorPos.box.characterProperties.script === __aspxRichEdit.CharacterFormattingScript.Subscript) {
                var multiplier = cursorPos.box.characterProperties.fontInfo.scriptMultiplier;
                selectionCursor.y += __aspxRichEdit.UnitConverter.pointsToPixelsF(cursorPos.box.characterProperties.fontSize) *
                    (cursorPos.box.characterProperties.fontInfo.subScriptOffset * multiplier - multiplier + 1);
            }
            this.layoutSelection.selectionInfo.registerItem(cursorPos.pageIndex, selectionCursor);
        };
        SelectionFormatter.prototype.createExtendedSelectionLayout = function (interval, layoutSelectionInfo, allIntervals) {
            var _this = this;
            var layout = this.selection.layout;
            if (layout.pages.length == 0)
                return;
            var activeSubDocument = this.selection.model.activeSubDocument;
            var isMainSubDoc = activeSubDocument.isMain();
            var page = isMainSubDoc ? layout.getLastValidPage() : layout.pages[this.layoutSelection.pageIndex];
            if (!page)
                return;
            if (this.selection.specialRunInfo.isPictureSelected() || (this.selection.specialRunInfo.isTextBoxSelected() && !activeSubDocument.isTextBox()))
                return;
            var startPos = interval.start;
            var endPos = Math.min(interval.end, isMainSubDoc ? page.getEndPosition() : page.otherPageAreas[activeSubDocument.id].getEndPosition());
            var iterator = isMainSubDoc ?
                new __aspxRichEdit.LayoutBoxIteratorMainSubDocument(activeSubDocument, layout, startPos, endPos) :
                new __aspxRichEdit.LayoutBoxIteratorOtherSubDocument(activeSubDocument, layout, startPos, endPos, this.layoutSelection.pageIndex);
            if (!iterator.isInitialized())
                throw new Error(__aspxRichEdit.Errors.InternalException);
            var currentLayoutRow = null;
            var currSelectionItem = null;
            var selectedCellsCollector = new SelectedCellsCollector();
            var currPageIndex = -1;
            for (var isFirstBox = true; iterator.moveNext(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(!isFirstBox), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true)); isFirstBox = false) {
                if (currPageIndex < iterator.position.pageIndex) {
                    currPageIndex = iterator.position.pageIndex;
                    __aspxRichEdit.MapUtilsKeyAsNumber.foreach(iterator.position.page.anchoredObjectHolder.objects, function (obj) {
                        var pos = layout.anchorObjectsPositionInfo.getPosition(obj.objectId);
                        if (obj.belongsToSubDocId == _this.layoutSelection.subDocumentInfo.subDocumentId &&
                            interval.containsInterval(new __aspxRichEdit.FixedInterval(pos, 1))) {
                            var ancObjSelItem = new __aspxRichEdit.LayoutSelectionFloatingObjectItem();
                            ancObjSelItem.copyFrom(obj.getOuterBounds(false));
                            layoutSelectionInfo.registerItem(currPageIndex, ancObjSelItem);
                        }
                    });
                }
                var currPosition = iterator.position;
                var row = currPosition.row;
                if (row.tableCellInfo) {
                    var cell = __aspxRichEdit.Table.getTableCellByPosition(activeSubDocument.tables, currPosition.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Box));
                    if (SelectionFormatter.isCellFullySelected(cell, allIntervals)) {
                        if (selectedCellsCollector.isNeedAddCellToSelection(cell, row.tableCellInfo)) {
                            currentLayoutRow = row;
                            var selectionBound = row.tableCellInfo.rectangle;
                            selectionBound.x += currPosition.pageArea.x + currPosition.column.x;
                            selectionBound.y += currPosition.pageArea.y + currPosition.column.y;
                            currSelectionItem = new __aspxRichEdit.LayoutSelectionItem();
                            currSelectionItem.floatingObjectId = activeSubDocument.isMain() || activeSubDocument.isHeaderFooter() ?
                                __aspxRichEdit.LayoutSelectionItem.mainPageAreaSelection :
                                currPosition.page.anchoredObjectHolder.getTextBoxByInternalSubDocId(activeSubDocument.id).objectId;
                            currSelectionItem.copyFrom(selectionBound);
                            layoutSelectionInfo.registerItem(currPosition.pageIndex, currSelectionItem);
                        }
                        continue;
                    }
                }
                var rightCharOffset = Math.min(endPos - currPosition.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Box), currPosition.box.getLength());
                var currentBoxLeftOffsetX = currPosition.box.getCharOffsetXInPixels(this.measurer, currPosition.charOffset);
                var currentBoxRightOffsetX = currPosition.box.getCharOffsetXInPixels(this.measurer, rightCharOffset);
                var absRowOffsetX = currPosition.pageArea.x + currPosition.column.x + currPosition.row.x;
                var absBoxOffsetX = currPosition.box.x + currentBoxLeftOffsetX + absRowOffsetX;
                var thereIsGap = !!currSelectionItem && !__aspxRichEdit.Utils.numberCloseTo(absBoxOffsetX, currSelectionItem.x + currSelectionItem.width);
                var isNeedCreateNewSelectionRow = row !== currentLayoutRow || thereIsGap;
                if (isNeedCreateNewSelectionRow) {
                    currentLayoutRow = row;
                    var floatingObjectId = activeSubDocument.isMain() || activeSubDocument.isHeaderFooter() ?
                        __aspxRichEdit.LayoutSelectionItem.mainPageAreaSelection :
                        currPosition.page.anchoredObjectHolder.getTextBoxByInternalSubDocId(activeSubDocument.id).objectId;
                    currSelectionItem = __aspxRichEdit.LayoutSelectionItem.create(currPosition, new __aspxRichEdit.Size(0, row.height), floatingObjectId, __aspxRichEdit.LayoutSelectionItem);
                    currSelectionItem.x += currPosition.box.x + currentBoxLeftOffsetX;
                    layoutSelectionInfo.registerItem(currPosition.pageIndex, currSelectionItem);
                }
                currSelectionItem.width += currentBoxRightOffsetX - currentBoxLeftOffsetX;
            }
        };
        SelectionFormatter.isCellFullySelected = function (cell, allIntervals) {
            if (!cell)
                return false;
            for (var _i = 0, allIntervals_1 = allIntervals; _i < allIntervals_1.length; _i++) {
                var interval = allIntervals_1[_i];
                if (cell.startParagraphPosition.value >= interval.start && cell.endParagrapPosition.value <= interval.end)
                    return true;
            }
            return false;
        };
        SelectionFormatter.translateInteralsToIterators = function (layout, subDocument, pageIndex, finalIntervals) {
            var makeIter = subDocument.isMain() ?
                function (interval) { return new __aspxRichEdit.LayoutBoxIteratorMainSubDocument(subDocument, layout, interval.start, interval.end); } :
                function (interval) { return new __aspxRichEdit.LayoutBoxIteratorOtherSubDocument(subDocument, layout, interval.start, interval.end, pageIndex); };
            return __aspxRichEdit.ListUtils.reducedMap(finalIntervals, function (interval) {
                if (interval.length > 0) {
                    var iter = makeIter(interval);
                    return iter.isInitialized() ? iter : null;
                }
                return null;
            });
        };
        SelectionFormatter.prototype.intersectModelIntervalsWithValidPageIntervals = function (subDocument, modelIntervals, pageIndex) {
            var layout = this.selection.layout;
            if (layout.pages.length == 0)
                return [];
            if (subDocument.isMain()) {
                var pageIntervals = __aspxRichEdit.ListUtils.accumulate(layout.pages, [], function (acc, page) {
                    return __aspxRichEdit.ListUtils.addListOnTail(acc, page.getContentIntervals());
                }, 0, layout.validPageCount);
                var mergedIntervals = __aspxRichEdit.IntervalAlgorithms.getMergedIntervals(pageIntervals, true);
                var finalIntervals = __aspxRichEdit.IntervalAlgorithms.getIntersectionsTwoArraysOfInterval(modelIntervals, mergedIntervals);
                return SelectionFormatter.translateInteralsToIterators(this.selection.layout, subDocument, pageIndex, finalIntervals);
            }
            else {
                var page = layout.pages[pageIndex];
                if (!page || !page.otherPageAreas[subDocument.id])
                    return [];
                return SelectionFormatter.translateInteralsToIterators(this.selection.layout, subDocument, pageIndex, modelIntervals);
            }
        };
        SelectionFormatter.prototype.createSimpleLayout = function (subDocument, iterators, layoutSelectionInfo, type) {
            for (var _i = 0, iterators_1 = iterators; _i < iterators_1.length; _i++) {
                var iterator = iterators_1[_i];
                var currentLayoutRow = null;
                var currSelectionItem = null;
                for (var isFirstBox = true; iterator.moveNext(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(!isFirstBox), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true)); isFirstBox = false) {
                    var currPosition = iterator.position;
                    var row = currPosition.row;
                    var rightCharOffset = Math.min(iterator.intervalEnd - currPosition.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Box), currPosition.box.getLength());
                    var currentBoxLeftOffsetX = currPosition.box.getCharOffsetXInPixels(this.measurer, currPosition.charOffset);
                    var currentBoxRightOffsetX = currPosition.box.getCharOffsetXInPixels(this.measurer, rightCharOffset);
                    var absRowOffsetX = currPosition.pageArea.x + currPosition.column.x + currPosition.row.x;
                    var absBoxOffsetX = currPosition.box.x + currentBoxLeftOffsetX + absRowOffsetX;
                    var thereIsGap = !!currSelectionItem && !__aspxRichEdit.Utils.numberCloseTo(absBoxOffsetX, currSelectionItem.x + currSelectionItem.width);
                    var isNeedCreateNewSelectionRow = row !== currentLayoutRow || thereIsGap;
                    if (isNeedCreateNewSelectionRow) {
                        currentLayoutRow = row;
                        var height = type == SimpleSelectionLayoutType.Misspelled ?
                            row.baseLine :
                            row.height - row.getSpacingAfter() - row.getSpacingBefore();
                        var yOffset = type == SimpleSelectionLayoutType.Misspelled ?
                            0 :
                            row.getSpacingBefore();
                        var floatingObjectId = subDocument.isMain() || subDocument.isHeaderFooter() ?
                            __aspxRichEdit.LayoutSelectionItem.mainPageAreaSelection :
                            currPosition.page.anchoredObjectHolder.getTextBoxByInternalSubDocId(subDocument.id).objectId;
                        currSelectionItem = __aspxRichEdit.LayoutSelectionItem.create(currPosition, new __aspxRichEdit.Size(0, height), floatingObjectId, SelectionFormatter.itemConstructorsMap[type]);
                        if (type == SimpleSelectionLayoutType.RangePermission)
                            currSelectionItem.color = this.documentProtectionSettings.rangeHighlightColor;
                        currSelectionItem.x += currPosition.box.x + currentBoxLeftOffsetX;
                        currSelectionItem.y += yOffset;
                        layoutSelectionInfo.registerItem(currPosition.pageIndex, currSelectionItem);
                    }
                    currSelectionItem.width += currentBoxRightOffsetX - currentBoxLeftOffsetX;
                }
            }
        };
        SelectionFormatter.prototype.raiseSelectionLayoutChanged = function () {
            this.layoutSelection.selectionInfo.collectPageChanges(this.selection.layout);
            this.layoutSelection.updatePageIndexWithSelection();
            this.onSelectionLayoutChanged.raise("NotifySelectionLayoutChanged");
        };
        SelectionFormatter.prototype.raiseSearchSelectionLayoutChanged = function () {
            this.layoutSelection.searchInfo.collectPageChanges(this.selection.layout);
            this.onSelectionLayoutChanged.raise("NotifySearchSelectionLayoutChanged");
        };
        SelectionFormatter.prototype.raiseMisspelledSelectionLayoutChanged = function () {
            this.layoutSelection.misspelledInfo.collectPageChanges(this.selection.layout);
            this.onSelectionLayoutChanged.raise("NotifyMisspelledSelectionLayoutChanged");
        };
        SelectionFormatter.prototype.raiseRangePermissionLayoutChanged = function () {
            this.layoutSelection.rangePermissionInfo.collectPageChanges(this.selection.layout);
            this.onSelectionLayoutChanged.raise("NotifyRangePermissionLayoutChanged");
        };
        SelectionFormatter.setPositionOnVisibleBox = function (cursorPos) {
            if (cursorPos.charOffset != 0)
                return;
            for (var boxIndex = cursorPos.boxIndex - 1; boxIndex >= 0; boxIndex--) {
                if (cursorPos.row.boxes[boxIndex].isVisible()) {
                    cursorPos.boxIndex = boxIndex;
                    cursorPos.box = cursorPos.row.boxes[cursorPos.boxIndex];
                    cursorPos.charOffset = cursorPos.box.getLength();
                    return;
                }
            }
        };
        SelectionFormatter.itemConstructorsMap = new __aspxRichEdit.MapCreatorNumberAsKey()
            .add(SimpleSelectionLayoutType.Misspelled, __aspxRichEdit.LayoutSelectionMisspelledItem)
            .add(SimpleSelectionLayoutType.RangePermission, __aspxRichEdit.LayoutRangePermissionItem)
            .add(SimpleSelectionLayoutType.Search, __aspxRichEdit.LayoutSelectionSearchItem)
            .get();
        return SelectionFormatter;
    }(__aspxRichEdit.BatchUpdatableObject));
    __aspxRichEdit.SelectionFormatter = SelectionFormatter;
    var SelectedCellsCollector = (function () {
        function SelectedCellsCollector() {
            this.fullySelectedCells = {};
        }
        SelectedCellsCollector.prototype.isNeedAddCellToSelection = function (cell, cellInfo) {
            var key = cell.endParagrapPosition.value;
            var cellInfos = this.fullySelectedCells[key];
            if (cellInfos === undefined) {
                this.fullySelectedCells[key] = [cellInfo];
                return true;
            }
            for (var _i = 0, cellInfos_1 = cellInfos; _i < cellInfos_1.length; _i++) {
                var info = cellInfos_1[_i];
                if (info === cellInfo)
                    return false;
            }
            cellInfos.push(cellInfo);
            return true;
        };
        return SelectedCellsCollector;
    }());
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SMAL_ICON_SIZE = 16;
    var AnchorVisualizer = (function (_super) {
        __extends(AnchorVisualizer, _super);
        function AnchorVisualizer() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        AnchorVisualizer.prototype.NotifySelectionChanged = function (_selection) {
            if (this.isFloatingObjectSelected())
                this.show();
            else
                this.hide();
        };
        AnchorVisualizer.prototype.NotifyScrollPositionChanged = function () { };
        AnchorVisualizer.prototype.NotifyPagesReady = function (_pageChanges) {
            if (this.isFloatingObjectSelected())
                this.show();
        };
        AnchorVisualizer.prototype.NotifyFullyFormatted = function () { };
        ;
        AnchorVisualizer.prototype.show = function () {
            var pos = this.control.selection.specialRunInfo.getPosition();
            var subDocument = this.control.selection.specialRunInfo.getParentSubDocument();
            var layoutPosition = (subDocument.isMain()
                ? new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.control.layout, subDocument, pos, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.layout, subDocument, pos, this.control.selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character))
                .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true));
            if (layoutPosition != null) {
                var x = layoutPosition.getLayoutX(this.control.measurer);
                var y = layoutPosition.getLayoutY();
                this.bounds = new __aspxRichEdit.Rectangle().init(x - SMAL_ICON_SIZE, y, SMAL_ICON_SIZE, SMAL_ICON_SIZE);
                this.pageIndex = layoutPosition.pageIndex;
                this.raiseShow();
            }
        };
        AnchorVisualizer.prototype.isFloatingObjectSelected = function () {
            return this.control.selection.specialRunInfo.isSelected() && this.control.selection.specialRunInfo.isSelectedAnchorObject;
        };
        return AnchorVisualizer;
    }(__aspxRichEdit.BaseVisualizer));
    __aspxRichEdit.AnchorVisualizer = AnchorVisualizer;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AutoScrollVisualizer = (function (_super) {
        __extends(AutoScrollVisualizer, _super);
        function AutoScrollVisualizer() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        AutoScrollVisualizer.prototype.show = function (absBounds) {
            this.pageIndex = -1;
            this.bounds = absBounds;
            this.tip = null;
            this.isTextBox = false;
            this.rotation = 0;
            this.isAnchoredObject = false;
            this.raiseShow();
        };
        return AutoScrollVisualizer;
    }(__aspxRichEdit.BaseVisualizer));
    __aspxRichEdit.AutoScrollVisualizer = AutoScrollVisualizer;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var BoxVisualizerManager = (function () {
        function BoxVisualizerManager(control) {
            this.dragCaretVisualizer = new __aspxRichEdit.DragCaretVisualizer(control);
            this.resizeBoxVisualizer = new __aspxRichEdit.ResizeBoxVisualizer(control);
            this.resizeTableVisualizer = new __aspxRichEdit.ResizeTableVisualizer(control);
            this.anchorVisualizer = new __aspxRichEdit.AnchorVisualizer(control);
            this.autoScrollVisualizer = new __aspxRichEdit.AutoScrollVisualizer(control);
            this.fullTableSelectorVisualizer = new __aspxRichEdit.FullTableSelectorVisualizer(control);
        }
        BoxVisualizerManager.prototype.initListeners = function (viewManager) {
            var rendererCache = viewManager.cache;
            this.dragCaretVisualizer.onChanged.add(new __aspxRichEdit.DragCaretListener(rendererCache));
            this.resizeBoxVisualizer.onChanged.add(new __aspxRichEdit.ResizeBoxListener(rendererCache));
            this.resizeTableVisualizer.onChanged.add(new __aspxRichEdit.ResizeTableListener(rendererCache));
            this.anchorVisualizer.onChanged.add(new __aspxRichEdit.AnchorListener(rendererCache));
            this.autoScrollVisualizer.onChanged.add(new __aspxRichEdit.AutoScrollListener(viewManager.serviceContainer));
            this.fullTableSelectorVisualizer.onChanged.add(new __aspxRichEdit.FullTableSelectorListener(rendererCache));
        };
        BoxVisualizerManager.prototype.closeDocument = function () {
            this.resizeBoxVisualizer.closeDocument();
            this.dragCaretVisualizer.closeDocument();
            this.resizeTableVisualizer.closeDocument();
            this.anchorVisualizer.closeDocument();
            this.autoScrollVisualizer.closeDocument();
            this.fullTableSelectorVisualizer.closeDocument();
        };
        return BoxVisualizerManager;
    }());
    __aspxRichEdit.BoxVisualizerManager = BoxVisualizerManager;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DragCaretVisualizer = (function (_super) {
        __extends(DragCaretVisualizer, _super);
        function DragCaretVisualizer() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DragCaretVisualizer.prototype.show = function (htr) {
            var pageIndex = htr.pageIndex;
            var bounds = new __aspxRichEdit.Rectangle().init(htr.getLayoutX(this.control.measurer, __aspxRichEdit.DocumentLayoutDetailsLevel.Character), htr.getLayoutY(__aspxRichEdit.DocumentLayoutDetailsLevel.Row), __aspxRichEdit.DragCaretListener.CARET_WIDTH, htr.row.height - htr.row.getSpacingBefore());
            if (!this.bounds || this.pageIndex != pageIndex || !bounds.equals(this.bounds)) {
                this.pageIndex = pageIndex;
                this.bounds = bounds;
                this.raiseShow();
            }
        };
        return DragCaretVisualizer;
    }(__aspxRichEdit.BaseVisualizer));
    __aspxRichEdit.DragCaretVisualizer = DragCaretVisualizer;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FullTableSelectorVisualizer = (function (_super) {
        __extends(FullTableSelectorVisualizer, _super);
        function FullTableSelectorVisualizer() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FullTableSelectorVisualizer.prototype.NotifyPagesReady = function (pageChanges) {
            for (var _i = 0, pageChanges_2 = pageChanges; _i < pageChanges_2.length; _i++) {
                var c = pageChanges_2[_i];
                if (c.changeType == __aspxRichEdit.LayoutChangeType.Deleted)
                    continue;
                this.NotifySelectionChanged(this.control.selection);
                break;
            }
        };
        FullTableSelectorVisualizer.prototype.NotifyFullyFormatted = function () { };
        ;
        FullTableSelectorVisualizer.prototype.NotifySelectionChanged = function (selection) {
            var tableInfo = selection.tableInfo;
            if (tableInfo.extendedData.numRows) {
                var sd = selection.model.activeSubDocument;
                var tbl = sd.tables[tableInfo.table.index];
                if (tbl) {
                    var tblPos = tbl.getStartPosition();
                    var lp = (sd.isMain() ?
                        new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.control.layout, sd, tblPos, __aspxRichEdit.DocumentLayoutDetailsLevel.Row) :
                        new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.layout, sd, tblPos, this.control.selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Row))
                        .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
                    if (lp && lp.row.tableCellInfo) {
                        this.pageIndex = lp.pageIndex;
                        var r = lp.row.tableCellInfo.parentRow.parentTable.rectangle;
                        r.init(lp.getLayoutX(null, __aspxRichEdit.DocumentLayoutDetailsLevel.Column) + r.x - FullTableSelectorVisualizer.OFFSET, lp.getLayoutY(__aspxRichEdit.DocumentLayoutDetailsLevel.Column) + r.y - FullTableSelectorVisualizer.OFFSET, FullTableSelectorVisualizer.SIZE, FullTableSelectorVisualizer.SIZE);
                        this.bounds = r;
                        this.raiseShow();
                        return;
                    }
                }
            }
            this.raiseHide();
        };
        FullTableSelectorVisualizer.prototype.show = function (htr) {
            var pageIndex = htr.pageIndex;
            var bounds = new __aspxRichEdit.Rectangle().init(htr.getLayoutX(this.control.measurer, __aspxRichEdit.DocumentLayoutDetailsLevel.Character), htr.getLayoutY(__aspxRichEdit.DocumentLayoutDetailsLevel.Row), __aspxRichEdit.DragCaretListener.CARET_WIDTH, htr.row.height - htr.row.getSpacingBefore());
            if (!this.bounds || this.pageIndex != pageIndex || !bounds.equals(this.bounds)) {
                this.pageIndex = pageIndex;
                this.bounds = bounds;
                this.raiseShow();
            }
        };
        FullTableSelectorVisualizer.SIZE = 12;
        FullTableSelectorVisualizer.OFFSET = FullTableSelectorVisualizer.SIZE;
        return FullTableSelectorVisualizer;
    }(__aspxRichEdit.BaseVisualizer));
    __aspxRichEdit.FullTableSelectorVisualizer = FullTableSelectorVisualizer;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ResizeBoxVisualizer = (function (_super) {
        __extends(ResizeBoxVisualizer, _super);
        function ResizeBoxVisualizer() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ResizeBoxVisualizer.prototype.NotifySelectionChanged = function (selection) {
            if (selection.specialRunInfo.isSelected())
                this.setBox();
            else if (this.initBounds)
                this.hide();
        };
        ResizeBoxVisualizer.prototype.NotifyScrollPositionChanged = function () { };
        ResizeBoxVisualizer.prototype.NotifyFullyFormatted = function () { };
        ;
        ResizeBoxVisualizer.prototype.NotifyPagesReady = function (pageChanges) {
            var _this = this;
            var specRunInfo = this.control.selection.specialRunInfo;
            if (!specRunInfo.isSelected())
                return;
            var subDoc = specRunInfo.getParentSubDocument();
            var pos = specRunInfo.getPosition();
            if (subDoc.isMain()) {
                if (__aspxRichEdit.ListUtils.anyOf(pageChanges, function (pageChange) {
                    return pageChange.changeType == __aspxRichEdit.LayoutChangeType.Deleted ? null : new __aspxRichEdit.LayoutAnchorObjectFinder(_this.control.layout, pos, subDoc.id, pageChange.index).obj ||
                        __aspxRichEdit.ListUtils.anyOf(_this.control.layout.pages[pageChange.index].getContentIntervals(), function (interval) {
                            return interval.contains(pos) ? pageChange : null;
                        });
                }))
                    this.setBox();
            }
            else {
                if (__aspxRichEdit.ListUtils.anyOf(pageChanges, function (pageChange) {
                    return pageChange.changeType == __aspxRichEdit.LayoutChangeType.Deleted ? null :
                        __aspxRichEdit.MapUtilsKeyAsNumber.anyOf(_this.control.layout.pages[pageChange.index].otherPageAreas, function (pageArea) {
                            return pageArea.subDocument.id == subDoc.id;
                        });
                }))
                    this.setBox();
            }
        };
        ResizeBoxVisualizer.prototype.setBox = function () {
            var specRunInfo = this.control.selection.specialRunInfo;
            var pos = specRunInfo.getPosition();
            if (specRunInfo.isSelectedAnchorObject) {
                var parentSubDoc = specRunInfo.getParentSubDocument();
                var finder = new __aspxRichEdit.LayoutAnchorObjectFinder(this.control.layout, pos, parentSubDoc.id, parentSubDoc.isHeaderFooter() ? this.control.selection.pageIndex : undefined);
                if (finder.obj)
                    this.show(finder.page.index, null, null, null, finder.obj);
                return;
            }
            var subDocument = this.control.model.activeSubDocument;
            var layoutPosition = (subDocument.isMain()
                ? new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(this.control.layout, subDocument, pos, __aspxRichEdit.DocumentLayoutDetailsLevel.Box)
                : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.control.layout, subDocument, pos, this.control.selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Box))
                .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
            if (layoutPosition)
                this.show(layoutPosition.pageIndex, layoutPosition.pageArea, layoutPosition.column, layoutPosition.row, layoutPosition.box);
        };
        ResizeBoxVisualizer.prototype.reset = function () {
            this.initBounds = null;
            _super.prototype.reset.call(this);
        };
        ResizeBoxVisualizer.prototype.show = function (pageIndex, pageArea, column, row, box) {
            this.pageIndex = pageIndex;
            this.tip = box.hyperlinkTip;
            var boxType = box.getType();
            this.isTextBox = boxType == __aspxRichEdit.LayoutBoxType.AnchorTextBox;
            this.isAnchoredObject = boxType == __aspxRichEdit.LayoutBoxType.AnchorPicture || boxType == __aspxRichEdit.LayoutBoxType.AnchorTextBox;
            this.initBounds = new __aspxRichEdit.Rectangle();
            if (this.isAnchoredObject) {
                this.initBounds.copyFrom(box);
                this.rotation = boxType == __aspxRichEdit.LayoutBoxType.AnchorTextBox && this.control.model.activeSubDocument.isTextBox() ? 0 :
                    box.rotationInRadians;
            }
            else {
                var boxY = Math.max(0, row.baseLine - box.getAscent());
                this.initBounds.init(pageArea.x + column.x + row.x + box.x, pageArea.y + column.y + row.y + boxY, box.width, box.height);
                this.rotation = 0;
            }
            this.recalculate(null, null, null);
        };
        ResizeBoxVisualizer.prototype.showAtPos = function (pageIndex, position) {
            this.pageIndex = pageIndex;
            this.initBounds.x = position.x;
            this.initBounds.y = position.y;
            this.recalculate(null, null, null);
        };
        ResizeBoxVisualizer.prototype.recalculate = function (size, positionDelta, newRotation) {
            this.bounds = new __aspxRichEdit.Rectangle();
            if (size != null) {
                this.bounds.width = size.width;
                this.bounds.height = size.height;
                this.bounds.x = this.initBounds.x + positionDelta.width;
                this.bounds.y = this.initBounds.y + positionDelta.height;
            }
            else
                this.bounds.copyFrom(this.initBounds);
            if (newRotation != null)
                this.rotation = newRotation;
            this.raiseShow();
        };
        ResizeBoxVisualizer.prototype.isResizeBoxVisible = function () {
            return !!this.bounds;
        };
        ResizeBoxVisualizer.prototype.shouldCapture = function (evt) {
            return !!ResizeBoxVisualizer.shouldCaptureEvents[evt.source];
        };
        ResizeBoxVisualizer.shouldRotate = function (evt, control) {
            return ResizeBoxVisualizer.isEventSourceHasClassName(evt, __aspxRichEdit.FrameBaseListener.CLASSNAMES.ROTATION_BOX) &&
                control.model.activeSubDocument.isEditable([new __aspxRichEdit.FixedInterval(control.selection.specialRunInfo.getPosition(), 1)]);
        };
        ResizeBoxVisualizer.shouldHandleTextBoxAreaClick = function (evt) {
            return ResizeBoxVisualizer.isEventSourceHasClassName(evt, __aspxRichEdit.FrameBaseListener.CLASSNAMES.TEXTBOX_AREA);
        };
        ResizeBoxVisualizer.isEventSourceHasClassName = function (evt, className) {
            return REWebUtils.Evt.GetEventSource(evt.mouseEvent).className.indexOf(className) > -1;
        };
        ResizeBoxVisualizer.shouldCaptureEvents = new __aspxRichEdit.MapCreatorNumberAsKey()
            .add(__aspxRichEdit.MouseEventSource.ResizeBox_E, true)
            .add(__aspxRichEdit.MouseEventSource.ResizeBox_N, true)
            .add(__aspxRichEdit.MouseEventSource.ResizeBox_NE, true)
            .add(__aspxRichEdit.MouseEventSource.ResizeBox_NW, true)
            .add(__aspxRichEdit.MouseEventSource.ResizeBox_S, true)
            .add(__aspxRichEdit.MouseEventSource.ResizeBox_SE, true)
            .add(__aspxRichEdit.MouseEventSource.ResizeBox_SW, true)
            .add(__aspxRichEdit.MouseEventSource.ResizeBox_W, true)
            .get();
        return ResizeBoxVisualizer;
    }(__aspxRichEdit.BaseVisualizer));
    __aspxRichEdit.ResizeBoxVisualizer = ResizeBoxVisualizer;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ResizeTableVisualizer = (function (_super) {
        __extends(ResizeTableVisualizer, _super);
        function ResizeTableVisualizer() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ResizeTableVisualizer.prototype.init = function (pageIndex, size) {
            this.pageIndex = pageIndex;
            this.bounds = new __aspxRichEdit.Rectangle().init(0, 0, size.width, size.height);
        };
        ResizeTableVisualizer.prototype.show = function (newPosition) {
            this.bounds.x = newPosition.x;
            this.bounds.y = newPosition.y;
            this.raiseShow();
        };
        return ResizeTableVisualizer;
    }(__aspxRichEdit.BaseVisualizer));
    __aspxRichEdit.ResizeTableVisualizer = ResizeTableVisualizer;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Row;
        (function (Row) {
            var Box;
            (function (Box) {
                var BoxIterator = (function () {
                    function BoxIterator(manager, subDocumentId) {
                        this.boxWrapsHolder = new Box.BoxWrapsHolder(manager, subDocumentId);
                    }
                    Object.defineProperty(BoxIterator.prototype, "subDocument", {
                        get: function () {
                            return this.boxWrapsHolder.subDocument;
                        },
                        enumerable: true,
                        configurable: true
                    });
                    BoxIterator.prototype.allBoxesGiven = function () {
                        return this.boxWrapsHolder.flags.get(Box.IteratorFlags.DocumentEnd);
                    };
                    BoxIterator.prototype.getPosition = function () {
                        return this.boxWrapsHolder.position;
                    };
                    BoxIterator.prototype.setPosition = function (position, forceResetBoxInfos, checkStartTable) {
                        if (!forceResetBoxInfos && position == this.boxWrapsHolder.position) {
                        }
                        else {
                            this.boxWrapsHolder.setPosition(position, forceResetBoxInfos);
                        }
                        if (checkStartTable && __aspxRichEdit.Log.isEnabled) {
                            var w = this.boxWrapsHolder.getWrap();
                            if (w && w.info.tablePosition && !new __aspxRichEdit.TablePositionIndexes(0, 0).equals(w.info.tablePosition[0])) {
                            }
                        }
                    };
                    BoxIterator.prototype.documentStart = function () {
                        this.boxWrapsHolder.reset(0);
                    };
                    BoxIterator.prototype.getWrap = function (getNextWrap) {
                        if (this.boxWrapsHolder.getWrap() && getNextWrap)
                            this.boxWrapsHolder.toNextWrap();
                        return this.boxWrapsHolder.getWrap();
                    };
                    BoxIterator.prototype.getBracketInfo = function (rowStartPos, rowLength) {
                        var rowInterval = new __aspxRichEdit.FixedInterval(rowStartPos, rowLength);
                        var end = rowStartPos + rowLength;
                        var ind = Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(this.boxWrapsHolder.bracketsInfo, function (bInfo) { return bInfo.absPos; }, rowStartPos));
                        var result = [];
                        for (var bInfo = void 0; bInfo = this.boxWrapsHolder.bracketsInfo[ind]; ind++) {
                            if (bInfo.absPos > end)
                                break;
                            if (rowInterval.containsWithIntervalEnd(bInfo.absPos))
                                result.push(bInfo);
                        }
                        return result;
                    };
                    BoxIterator.prototype.getParagraphBounds = function (parIndex) {
                        return this.boxWrapsHolder.paragraphBoundsInfo[parIndex];
                    };
                    return BoxIterator;
                }());
                Box.BoxIterator = BoxIterator;
                var BracketInfo = (function () {
                    function BracketInfo(absPos, flags, color, length) {
                        this.absPos = absPos;
                        this.flags = flags;
                        this.color = color;
                        this.length = length;
                    }
                    BracketInfo.prototype.addFlagValue = function (type) {
                        this.flags.set(type, true);
                    };
                    return BracketInfo;
                }());
                Box.BracketInfo = BracketInfo;
            })(Box = Row.Box || (Row.Box = {}));
        })(Row = LayoutFormatter.Row || (LayoutFormatter.Row = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Row;
        (function (Row) {
            var Box;
            (function (Box) {
                var IteratorFlags;
                (function (IteratorFlags) {
                    IteratorFlags[IteratorFlags["None"] = 0] = "None";
                    IteratorFlags[IteratorFlags["DocumentEnd"] = 1] = "DocumentEnd";
                })(IteratorFlags = Box.IteratorFlags || (Box.IteratorFlags = {}));
                var BoxWrapsHolder = (function () {
                    function BoxWrapsHolder(manager, subDocumentId) {
                        this.manager = manager;
                        this.subDocument = manager.model.subDocuments[subDocumentId];
                        this.boxGenerator = new Box.BoxGenerator(manager, this);
                    }
                    BoxWrapsHolder.prototype.reset = function (pos) {
                        var _this = this;
                        this.wrappers = [];
                        this.wrapIndex = 0;
                        this.flags = new __aspxRichEdit.Flag(IteratorFlags.None);
                        this.boxGenerator.positionFromStartGenerate = pos;
                        this.boxGenerator.waitForMoreChunks = false;
                        this.boxGenerator.generate();
                        this.getWrap();
                        __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.BoxWrapHolder, "reset", function () { return "wrappers.length:" + _this.wrappers.length + ", subDocId: " + _this.subDocument.id; });
                    };
                    BoxWrapsHolder.prototype.getWrap = function () {
                        var _this = this;
                        var wrap = this.wrappers[this.wrapIndex];
                        if (wrap) {
                            this.currPos = wrap.box.rowOffset;
                            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.BoxWrapHolder, "getWrap", function () { return "currPos: " + _this.currPos + ", wrapInd: " + _this.wrapIndex + ", subDocId: " + _this.subDocument.id; });
                            return wrap;
                        }
                        if (this.boxGenerator.generate()) {
                            var newWrap = this.wrappers[this.wrapIndex];
                            this.currPos = newWrap.box.rowOffset;
                            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.BoxWrapHolder, "getWrap", function () { return "currPos: " + _this.currPos + ", wrapInd: " + _this.wrapIndex + ", subDocId: " + _this.subDocument.id; });
                            return newWrap;
                        }
                        var lastWrap = __aspxRichEdit.ListUtils.last(this.wrappers);
                        this.currPos = lastWrap ? lastWrap.box.getEndPosition() : this.subDocument.getDocumentEndPosition();
                        __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.BoxWrapHolder, "getWrap", function () { return "currPos: " + _this.currPos + ", wrapInd: " + _this.wrapIndex + ", subDocId: " + _this.subDocument.id; });
                        return null;
                    };
                    Object.defineProperty(BoxWrapsHolder.prototype, "position", {
                        get: function () {
                            return this.currPos;
                        },
                        enumerable: true,
                        configurable: true
                    });
                    BoxWrapsHolder.prototype.setPosition = function (pos, forceResetBoxInfos) {
                        if (!forceResetBoxInfos && this.trySetPosition(pos))
                            return;
                        this.reset(pos);
                    };
                    BoxWrapsHolder.prototype.toNextWrap = function () {
                        this.wrapIndex++;
                        this.getWrap();
                    };
                    BoxWrapsHolder.prototype.setParagraphsWidthInfo = function (wrappers) {
                        this.paragraphBoundsInfo = {};
                        var parIndex = -1;
                        var parWidthBounds = null;
                        var wordWidth;
                        var lineWidth;
                        for (var _i = 0, wrappers_2 = wrappers; _i < wrappers_2.length; _i++) {
                            var wrap = wrappers_2[_i];
                            var tblPoss = wrap.info.tablePosition;
                            if (tblPoss) {
                                if (wrap.info.paragraphIndex != parIndex) {
                                    parIndex = wrap.info.paragraphIndex;
                                    parWidthBounds = new __aspxRichEdit.MinMaxNumber(0, 0);
                                    this.paragraphBoundsInfo[parIndex] = parWidthBounds;
                                    wordWidth = 0;
                                    lineWidth = 0;
                                }
                                if (wrap.box.getType() == __aspxRichEdit.LayoutBoxType.AnchorTextBox) {
                                    this.manager.anchoredObjectsManager.textBoxContextSizeCalculators[wrap.box.objectId].paragraphMinMax = parWidthBounds;
                                    continue;
                                }
                                if (wrap.box.isLineBreak())
                                    lineWidth = 0;
                                else {
                                    if (wrap.box.getType() == __aspxRichEdit.LayoutBoxType.AnchorPicture)
                                        parWidthBounds.updateBounds(new __aspxRichEdit.MinMaxNumber(wrap.box.width, wrap.box.width));
                                    lineWidth += wrap.box.width;
                                    parWidthBounds.max = Math.max(parWidthBounds.max, lineWidth);
                                }
                                if (wrap.box.isLineBreak() || wrap.box.isWhitespace()) {
                                    wordWidth = 0;
                                }
                                else {
                                    wordWidth += wrap.box.width;
                                    parWidthBounds.min = Math.max(parWidthBounds.min, wordWidth);
                                }
                            }
                        }
                    };
                    BoxWrapsHolder.prototype.setNewWrappers = function (newLayoutBoxes, generateFrom) {
                        var _this = this;
                        if (!newLayoutBoxes.length)
                            return;
                        __aspxRichEdit.ListUtils.addListOnTail(this.wrappers, newLayoutBoxes);
                        var excessLen = this.wrappers.length - BoxWrapsHolder.MAX_BOXES_IN_LIST;
                        if (excessLen > 0) {
                            var prevWrap = this.wrappers[excessLen - 1];
                            var nextWrap = this.wrappers[excessLen];
                            if (prevWrap.box.getEndPosition() <= generateFrom && !(nextWrap && nextWrap.info.tablePosition)) {
                                this.wrappers.splice(0, excessLen);
                                this.wrapIndex = Math.max(0, this.wrapIndex - excessLen);
                            }
                        }
                        __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.BoxWrapHolder, "setNewWrappers", function () { return "wrappers.length:" + _this.wrappers.length + ", subDocId: " + _this.subDocument.id; });
                        this.setParagraphsWidthInfo(this.wrappers);
                    };
                    BoxWrapsHolder.prototype.trySetPosition = function (pos) {
                        if (!this.interval.contains(pos))
                            return false;
                        this.wrapIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.wrappers, function (w) { return w.box.rowOffset; }, pos);
                        var wrap = this.wrappers[this.wrapIndex];
                        if (pos >= wrap.box.getEndPosition()) {
                            this.currPos = this.wrappers[++this.wrapIndex].box.rowOffset;
                            return true;
                        }
                        var offsetFromStartBox = pos - wrap.box.rowOffset;
                        if (offsetFromStartBox > 0)
                            this.splitBoxByPosition(wrap, offsetFromStartBox);
                        this.currPos = this.wrappers[this.wrapIndex].box.rowOffset;
                        return true;
                    };
                    BoxWrapsHolder.prototype.splitBoxByPosition = function (wrap, offsetFromStartBox) {
                        var next = wrap.splitByPosition(this.manager.measurer, offsetFromStartBox);
                        if (!next)
                            return;
                        this.wrapIndex++;
                        this.wrappers.splice(this.wrapIndex, 0, next);
                    };
                    Object.defineProperty(BoxWrapsHolder.prototype, "interval", {
                        get: function () {
                            if (!this.wrappers.length)
                                return new __aspxRichEdit.FixedInterval(0, 0);
                            return __aspxRichEdit.FixedInterval.fromPositions(this.wrappers[0].box.rowOffset, __aspxRichEdit.ListUtils.last(this.wrappers).box.getEndPosition());
                        },
                        enumerable: true,
                        configurable: true
                    });
                    BoxWrapsHolder.AVERAGE_BOXES_ON_PAGE = 2000;
                    BoxWrapsHolder.MAX_BOXES_IN_LIST_MULTIPLIER = 3;
                    BoxWrapsHolder.MAX_BOXES_IN_LIST = BoxWrapsHolder.AVERAGE_BOXES_ON_PAGE * BoxWrapsHolder.MAX_BOXES_IN_LIST_MULTIPLIER;
                    return BoxWrapsHolder;
                }());
                Box.BoxWrapsHolder = BoxWrapsHolder;
            })(Box = Row.Box || (Row.Box = {}));
        })(Row = LayoutFormatter.Row || (LayoutFormatter.Row = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var AnchoredObjectsManager = (function () {
            function AnchoredObjectsManager(manager) {
                this.manager = manager;
                this.anchorObjectHorizontalPositionCalculator = new LayoutFormatter.AnchorObjectHorizontalPositionCalculator(this.manager);
                this.anchorObjectVerticalPositionCalculator = new LayoutFormatter.AnchorObjectVerticalPositionCalculator(this.manager);
                this.reset();
            }
            AnchoredObjectsManager.prototype.reset = function () {
                this.textBoxContextSizeCalculators = {};
            };
            return AnchoredObjectsManager;
        }());
        LayoutFormatter.AnchoredObjectsManager = AnchoredObjectsManager;
        var AnchoredTextBoxContextSizeCalculator = (function () {
            function AnchoredTextBoxContextSizeCalculator(wrap, size) {
                this.wrap = wrap;
                this.size = size;
                this.isInited = false;
            }
            AnchoredTextBoxContextSizeCalculator.prototype.calculateSize = function (boundsCalculator) {
                if (this.isInited)
                    return;
                this.isInited = true;
                this.layouSize = new __aspxRichEdit.Size(this.size.useAbsoluteWidth() ?
                    __aspxRichEdit.UnitConverter.twipsToPixels(this.size.getActualWidth()) :
                    this.size.getActualRelativeWidth(boundsCalculator), this.size.useAbsoluteHeight() ?
                    __aspxRichEdit.UnitConverter.twipsToPixels(this.size.getActualHeight()) :
                    this.size.getActualRelativeHeight(boundsCalculator));
                if (this.wrap.info.tablePosition)
                    this.paragraphMinMax.updateBounds(new __aspxRichEdit.MinMaxNumber(this.layouSize.width, this.layouSize.width));
            };
            return AnchoredTextBoxContextSizeCalculator;
        }());
        LayoutFormatter.AnchoredTextBoxContextSizeCalculator = AnchoredTextBoxContextSizeCalculator;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var RectangleRowBoundsCalculatorInfo = (function (_super) {
            __extends(RectangleRowBoundsCalculatorInfo, _super);
            function RectangleRowBoundsCalculatorInfo() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            return RectangleRowBoundsCalculatorInfo;
        }(__aspxRichEdit.Rectangle));
        LayoutFormatter.RectangleRowBoundsCalculatorInfo = RectangleRowBoundsCalculatorInfo;
        var LayoutRowBoundsCalculator = (function () {
            function LayoutRowBoundsCalculator() {
            }
            LayoutRowBoundsCalculator.prototype.getRectangleBounds = function (manager) {
                var _this = this;
                var tableFormatter = manager.activeFormatter.tableFormatter;
                if (!tableFormatter)
                    return this.rectangleBounds;
                var posInfo = manager.layout.anchorObjectsPositionInfo;
                var tableEndPos = tableFormatter.tableInfo.table.getEndPosition();
                return __aspxRichEdit.ListUtils.reducedMap(this.rectangleBounds, function (b, i) {
                    return posInfo.getPosition(_this.ancObjectsId[i]) < tableEndPos ? b : null;
                });
            };
            LayoutRowBoundsCalculator.prototype.addTableInTextObject = function (obj, horizOuterBounds) {
                this.addAnchoredObject(obj, horizOuterBounds);
            };
            LayoutRowBoundsCalculator.prototype.resetByColumn = function (objects, horizOuterBounds, ignoreFo) {
                var _this = this;
                this.rectangleBounds = [];
                this.ancObjectsId = [];
                if (!ignoreFo) {
                    var inTextObjects = __aspxRichEdit.MapUtilsKeyAsNumber.reducedMap(objects, function (obj) { return obj.levelType == __aspxRichEdit.AnchoredObjectLevelType.InText ? obj : null; });
                    __aspxRichEdit.MapUtilsKeyAsNumber.foreach(inTextObjects, function (obj) { return _this.addAnchoredObject(obj, horizOuterBounds); });
                }
            };
            LayoutRowBoundsCalculator.prototype.addAnchoredObject = function (obj, horizOuterBounds) {
                var anchorInfo = obj.anchorInfo;
                switch (anchorInfo.wrapType) {
                    case __aspxRichEdit.AnchorObjectTextWrapType.Tight:
                    case __aspxRichEdit.AnchorObjectTextWrapType.Through:
                    case __aspxRichEdit.AnchorObjectTextWrapType.Square: {
                        var polygon = obj.rectangle.polygon;
                        polygon.rotateAround(polygon.center, obj.rotationInRadians, false, true);
                        var bounds = polygon.bounds;
                        bounds.applyMarginsOutside(anchorInfo.getDistanceMargins());
                        LayoutRowBoundsCalculator.applySquareWrapSide(anchorInfo.wrapSide, bounds, horizOuterBounds);
                        this.rectangleBounds.push(bounds);
                        break;
                    }
                    case __aspxRichEdit.AnchorObjectTextWrapType.TopAndBottom: {
                        var polygon = obj.rectangle.polygon;
                        polygon.rotateAround(polygon.center, obj.rotationInRadians, false, true);
                        var bounds = polygon.bounds;
                        bounds.applyMarginsOutside(anchorInfo.getDistanceMargins());
                        bounds.setHorizontalBounds(horizOuterBounds);
                        this.rectangleBounds.push(bounds);
                        break;
                    }
                    default: throw new Error(__aspxRichEdit.Errors.InternalException);
                }
                this.ancObjectsId.push(obj.objectId);
            };
            LayoutRowBoundsCalculator.applySquareWrapSide = function (wrapSide, bounds, horizOuterBounds) {
                var intersection = __aspxRichEdit.IntervalAlgorithms.getIntersectionNonNullLength(new __aspxRichEdit.FixedInterval(bounds.x, bounds.width), horizOuterBounds);
                if (!intersection)
                    return;
                var getBounds;
                switch (wrapSide) {
                    case __aspxRichEdit.AnchorObjectTextWrapSide.Right:
                        getBounds = LayoutRowBoundsCalculator.getRightBounds;
                        break;
                    case __aspxRichEdit.AnchorObjectTextWrapSide.Left:
                        getBounds = LayoutRowBoundsCalculator.getLeftBounds;
                        break;
                    case __aspxRichEdit.AnchorObjectTextWrapSide.Largest:
                        getBounds = intersection.start - horizOuterBounds.start >= horizOuterBounds.end - intersection.end ?
                            LayoutRowBoundsCalculator.getLeftBounds :
                            LayoutRowBoundsCalculator.getRightBounds;
                        break;
                    case __aspxRichEdit.AnchorObjectTextWrapSide.Both:
                        getBounds = function (b) { return b; };
                        break;
                }
                bounds.setHorizontalBounds(getBounds(intersection, horizOuterBounds));
            };
            LayoutRowBoundsCalculator.getLeftBounds = function (intersection, horizOuterBounds) {
                return __aspxRichEdit.FixedInterval.fromPositions(intersection.start, horizOuterBounds.end);
            };
            LayoutRowBoundsCalculator.getRightBounds = function (intersection, horizOuterBounds) {
                return __aspxRichEdit.FixedInterval.fromPositions(horizOuterBounds.start, intersection.end);
            };
            return LayoutRowBoundsCalculator;
        }());
        LayoutFormatter.LayoutRowBoundsCalculator = LayoutRowBoundsCalculator;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var PageAnchoredObjectHolder = (function () {
        function PageAnchoredObjectHolder() {
            this.objects = {};
        }
        PageAnchoredObjectHolder.prototype.getObjectByModelPosition = function (layout, position, belongsToSubDocId) {
            return __aspxRichEdit.MapUtilsKeyAsNumber.elementBy(this.objects, function (obj, id) {
                return layout.anchorObjectsPositionInfo.getPosition(id) == position && obj.belongsToSubDocId === belongsToSubDocId;
            });
        };
        PageAnchoredObjectHolder.prototype.getObjectsForRenderer = function (anchorObjectsPositionInfo, objects) {
            if (objects === void 0) { objects = this.objects; }
            return __aspxRichEdit.MapUtilsKeyAsNumber.toList(objects).sort(__aspxRichEdit.CompareUtils.getLayoutAnchoredObjectBoxComparer(anchorObjectsPositionInfo));
        };
        PageAnchoredObjectHolder.prototype.getObjById = function (id) {
            return this.objects[id];
        };
        PageAnchoredObjectHolder.prototype.getTextBoxByInternalSubDocId = function (id) {
            return __aspxRichEdit.MapUtilsKeyAsNumber.elementBy(this.objects, function (obj) { return obj.getType() == __aspxRichEdit.LayoutBoxType.AnchorTextBox &&
                obj.internalSubDocId == id; });
        };
        PageAnchoredObjectHolder.prototype.isObjectExist = function (obj) {
            return !!this.objects[obj.objectId];
        };
        PageAnchoredObjectHolder.prototype.addObject = function (manager, obj) {
            this.objects[obj.objectId] = obj;
            manager.anchoredObjectsManager.anchorObjectHorizontalPositionCalculator.calculate(obj);
            manager.anchoredObjectsManager.anchorObjectVerticalPositionCalculator.calculate(obj);
            this.correctPositionDueToOtherBoxes(obj);
        };
        PageAnchoredObjectHolder.prototype.correctPositionDueToOtherBoxes = function (_obj) {
        };
        PageAnchoredObjectHolder.prototype.shallowCopy = function () {
            var obj = new PageAnchoredObjectHolder();
            obj.objects = __aspxRichEdit.MapUtilsKeyAsNumber.shallowCopy(this.objects);
            return obj;
        };
        PageAnchoredObjectHolder.prototype.calculateRendererLevels = function (anchorObjectsPositionInfo) {
            if (__aspxRichEdit.MapUtilsKeyAsNumber.isEmpty(this.objects))
                return;
            var objects = __aspxRichEdit.ListUtils.map(this.getObjectsForRenderer(anchorObjectsPositionInfo), function (obj, ind) { return new UnfoldedObjectInfo(obj, ind); });
            __aspxRichEdit.ListUtils.foreach(objects, function (obj, ind) {
                __aspxRichEdit.ListUtils.foreach(objects, function (subObj) {
                    if (subObj.intersections[obj.index])
                        obj.intersections[subObj.index] = subObj;
                }, 0, ind);
                __aspxRichEdit.ListUtils.foreach(objects, function (subObj) {
                    if (__aspxRichEdit.Polygon.collision(obj.obj.getRotatedPolygon(), subObj.obj.getRotatedPolygon()) != __aspxRichEdit.CollisionResult.None)
                        obj.intersections[subObj.index] = subObj;
                }, ind);
            });
            var groups = [];
            __aspxRichEdit.ListUtils.foreach(objects, function (obj) {
                if (!obj.group) {
                    obj.group = {};
                    obj.group[obj.index] = obj;
                    groups.push(obj.group);
                }
                __aspxRichEdit.MapUtilsKeyAsNumber.foreach(obj.intersections, function (intersObj) {
                    obj.group[intersObj.index] = intersObj;
                    intersObj.group = obj.group;
                });
            });
            __aspxRichEdit.ListUtils.foreach(groups, function (group) {
                var level = 1;
                var prevObj = null;
                var behindObjs = [];
                var frontObjs = [];
                __aspxRichEdit.ListUtils.foreach(__aspxRichEdit.MapUtilsKeyAsNumber.toList(group).sort(function (a, b) { return a.index - b.index; }), function (obj) {
                    if (prevObj && obj.intersections[prevObj.index])
                        level++;
                    obj.obj.rendererLevel = level;
                    prevObj = obj;
                    (obj.obj.anchorInfo.levelType == __aspxRichEdit.AnchoredObjectLevelType.BehindText ? behindObjs : frontObjs).push(obj);
                });
                if (behindObjs.length) {
                    var maxBehindLevel_1 = __aspxRichEdit.ListUtils.max(behindObjs, function (a, b) { return a.obj.rendererLevel - b.obj.rendererLevel; }).obj.rendererLevel;
                    __aspxRichEdit.ListUtils.foreach(behindObjs, function (obj) { return obj.obj.rendererLevel -= maxBehindLevel_1 + 1; });
                    __aspxRichEdit.ListUtils.foreach(frontObjs, function (obj) { return obj.obj.rendererLevel -= maxBehindLevel_1 - 1; });
                }
            });
        };
        return PageAnchoredObjectHolder;
    }());
    __aspxRichEdit.PageAnchoredObjectHolder = PageAnchoredObjectHolder;
    var UnfoldedObjectInfo = (function () {
        function UnfoldedObjectInfo(obj, index) {
            this.intersections = {};
            this.obj = obj;
            this.index = index;
        }
        return UnfoldedObjectInfo;
    }());
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var LayoutFormatterState;
        (function (LayoutFormatterState) {
            LayoutFormatterState[LayoutFormatterState["DocumentStart"] = 0] = "DocumentStart";
            LayoutFormatterState[LayoutFormatterState["PageStart"] = 1] = "PageStart";
            LayoutFormatterState[LayoutFormatterState["PageAreaStart"] = 2] = "PageAreaStart";
            LayoutFormatterState[LayoutFormatterState["ColumnStart"] = 3] = "ColumnStart";
            LayoutFormatterState[LayoutFormatterState["RowFormatting"] = 4] = "RowFormatting";
            LayoutFormatterState[LayoutFormatterState["ColumnEnd"] = 5] = "ColumnEnd";
            LayoutFormatterState[LayoutFormatterState["PageAreaEnd"] = 6] = "PageAreaEnd";
            LayoutFormatterState[LayoutFormatterState["PageEnd"] = 7] = "PageEnd";
            LayoutFormatterState[LayoutFormatterState["DocumentEnd"] = 8] = "DocumentEnd";
            LayoutFormatterState[LayoutFormatterState["End"] = 9] = "End";
        })(LayoutFormatterState = LayoutFormatter.LayoutFormatterState || (LayoutFormatter.LayoutFormatterState = {}));
        var TryReusePageResult;
        (function (TryReusePageResult) {
            TryReusePageResult[TryReusePageResult["CreateNewPage"] = 1] = "CreateNewPage";
            TryReusePageResult[TryReusePageResult["UseOldPage"] = 2] = "UseOldPage";
            TryReusePageResult[TryReusePageResult["RestartFromPageStartPosition"] = 3] = "RestartFromPageStartPosition";
        })(TryReusePageResult || (TryReusePageResult = {}));
        var MainFormatter = (function (_super) {
            __extends(MainFormatter, _super);
            function MainFormatter(formatterManager) {
                var _this = _super.call(this, formatterManager, __aspxRichEdit.SubDocument.MAIN_SUBDOCUMENT_ID) || this;
                _this.state = LayoutFormatterState.DocumentStart;
                _this.stateMap[LayoutFormatterState.DocumentStart] = _this.processStateDocumentStart;
                _this.stateMap[LayoutFormatterState.PageStart] = _this.processStatePageStart;
                _this.stateMap[LayoutFormatterState.PageAreaEnd] = _this.processStatePageAreaEnd;
                _this.stateMap[LayoutFormatterState.PageEnd] = _this.processStatePageEnd;
                _this.stateMap[LayoutFormatterState.DocumentEnd] = _this.processStateDocumentEnd;
                _this.stateMap[LayoutFormatterState.End] = _this.processStateEnd;
                return _this;
            }
            MainFormatter.prototype.formatNext = function () {
                do {
                    if (!this.stateMap[this.state].call(this))
                        return false;
                } while (MainFormatter.notAllowBreakOnState[this.state](this.layoutPosition));
                return true;
            };
            MainFormatter.prototype.processStateDocumentStart = function () {
                this.manager.activeFormatter = this;
                this.initDocumentStart();
                this.layoutPosition = new __aspxRichEdit.LayoutPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.None);
                this.layoutPosition.pageIndex = 0;
                this.state = LayoutFormatterState.PageStart;
                return true;
            };
            MainFormatter.prototype.processStatePageStart = function () {
                var _this = this;
                this.manager.activeFormatter = this;
                var wrap = this.rowFormatter.iterator.getWrap(false);
                if (!wrap)
                    return false;
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatter, "processStatePageStart", function () { return "SubDocId: " + _this.subDocument.id + ", LayPos: " + __aspxRichEdit.LogObjToStr.layoutPositionShort(_this.layoutPosition); });
                var pages = this.manager.layout.pages;
                var boundsCalculator = this.manager.boundsCalculator;
                boundsCalculator.initWhenPageStart();
                var prevPage = pages[this.layoutPosition.pageIndex - 1];
                var prevPageSection = !prevPage ? null : this.manager.model.getSectionByPosition(prevPage.getPosition());
                var currentPageSection = this.manager.model.sections[wrap.info.sectionIndex];
                var isFirstPageOfSection = prevPageSection != currentPageSection;
                if (this.manager.innerClientProperties.viewsSettings.isSimpleView) {
                    var widthForSimpleView = this.manager.innerClientProperties.viewsSettings.widthOfPage;
                    var section = new __aspxRichEdit.Section(currentPageSection.documentModel, currentPageSection.startLogPosition, currentPageSection.getLength(), __aspxRichEdit.SectionProperties.createSimpleSectionProperties(widthForSimpleView, __aspxRichEdit.Constants.MAX_SAFE_INTEGER));
                    section.sectionProperties.margins.copyFrom(this.manager.innerClientProperties.viewsSettings.paddings);
                    section.sectionProperties.margins.toAnotherMeasuringSystem(__aspxRichEdit.UnitConverter.pixelsToTwips);
                    boundsCalculator.init(section);
                    boundsCalculator.setHeaderBounds(0);
                    boundsCalculator.setFooterBounds(0);
                }
                else if (isFirstPageOfSection)
                    boundsCalculator.init(currentPageSection);
                boundsCalculator.calculatePageBounds(prevPage ? prevPage.getBottomBoundPosition() : 0);
                var tryReuseResult = this.manager.floatingRestartInfoHolder.isRestartByAnchorObjects ?
                    TryReusePageResult.CreateNewPage :
                    this.tryReusePage(boundsCalculator.pageBounds);
                switch (tryReuseResult) {
                    case TryReusePageResult.CreateNewPage:
                        this.createNextPage(boundsCalculator.pageBounds);
                        this.manager.floatingRestartInfoHolder.setCalculatedObjects(this.layoutPosition);
                        break;
                    case TryReusePageResult.UseOldPage:
                        break;
                    case TryReusePageResult.RestartFromPageStartPosition:
                        this.manager.invalidator.onIntervalChanged(this.subDocument, new __aspxRichEdit.FixedInterval(__aspxRichEdit.ListUtils.last(__aspxRichEdit.ListUtils.last(__aspxRichEdit.ListUtils.last(this.manager.layout.pages[this.layoutPosition.pageIndex].mainSubDocumentPageAreas).columns).tablesInfo)
                            .getTopLevelColumn().logicInfo.grid.table.getStartPosition(), 1));
                        return true;
                }
                var pageIndex = this.layoutPosition.pageIndex;
                var actualPage = this.layoutPosition.page;
                actualPage.flags.set(__aspxRichEdit.LayoutPageFlags.IsFirstPageOfSection, isFirstPageOfSection);
                actualPage.index = pageIndex;
                actualPage.layoutPageIndex = prevPage ? prevPage.layoutPageIndex + 1 : 0;
                if (prevPage && isFirstPageOfSection && ((currentPageSection.sectionProperties.startType === __aspxRichEdit.SectionStartType.EvenPage && !__aspxRichEdit.Utils.isEven(actualPage.layoutPageIndex)) ||
                    (currentPageSection.sectionProperties.startType === __aspxRichEdit.SectionStartType.OddPage && __aspxRichEdit.Utils.isEven(actualPage.layoutPageIndex))))
                    actualPage.layoutPageIndex++;
                if (!this.manager.innerClientProperties.viewsSettings.isSimpleView) {
                    this.formatOtherHeaderFooterPageArea(currentPageSection.headers, function (obj) {
                        return _this.manager.otherPageAreaFormatter.formatHeaderPageArea(actualPage, obj);
                    });
                    if (this.manager.floatingRestartInfoHolder.isRestartByAnchorObjects)
                        return true;
                    this.formatOtherHeaderFooterPageArea(currentPageSection.footers, function (obj) {
                        return _this.manager.otherPageAreaFormatter.formatFooterPageArea(actualPage, obj);
                    });
                    if (this.manager.floatingRestartInfoHolder.isRestartByAnchorObjects)
                        return true;
                }
                boundsCalculator.calculateMainPageAreaBounds(-1);
                boundsCalculator.calculateColumnBounds(__aspxRichEdit.ListUtils.last(boundsCalculator.mainPageAreasBounds));
                this.pageAreaBounds = __aspxRichEdit.ListUtils.last(boundsCalculator.mainPageAreasBounds);
                this.columnBounds = __aspxRichEdit.ListUtils.last(boundsCalculator.mainColumnsBounds);
                return true;
            };
            MainFormatter.prototype.processStatePageAreaEnd = function () {
                var _this = this;
                this.manager.activeFormatter = this;
                LayoutFormatter.BaseFormatter.correctColumnOffsets(this.layoutPosition.pageArea);
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatter, "processStatePageAreaEnd", function () { return "SubDocId: " + _this.subDocument.id + ", LayPos: " + __aspxRichEdit.LogObjToStr.layoutPositionShort(_this.layoutPosition); });
                this.layoutPosition.detailsLevel = __aspxRichEdit.DocumentLayoutDetailsLevel.Page;
                this.state = LayoutFormatterState.PageEnd;
                return true;
            };
            MainFormatter.prototype.processStatePageEnd = function () {
                var _this = this;
                this.manager.activeFormatter = this;
                var layout = this.manager.layout;
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatter, "processStatePageEnd", function () { return "SubDocId: " + _this.subDocument.id + ", LayPos: " + __aspxRichEdit.LogObjToStr.layoutPositionShort(_this.layoutPosition); });
                var createdPage = this.layoutPosition.page;
                createdPage.isValid = true;
                MainFormatter.correctPageOffsets(createdPage);
                this.state = this.lastRowInfo.row.flags.get(__aspxRichEdit.LayoutRowStateFlags.DocumentEnd) ?
                    LayoutFormatterState.DocumentEnd : LayoutFormatterState.PageStart;
                if (!this.tableFormatter) {
                    layout.validPageCount = this.layoutPosition.pageIndex + 1;
                    layout.lastMaxNumPages = Math.max(layout.lastMaxNumPages, createdPage.layoutPageIndex + 1);
                }
                createdPage.calculateContentIntervals(this.manager.layout.anchorObjectsPositionInfo, false);
                createdPage.anchoredObjectHolder.calculateRendererLevels(this.manager.layout.anchorObjectsPositionInfo);
                var pageChange = LayoutFormatter.PageChangesCollector.collectPageChanges(layout.pages, createdPage);
                this.manager.changesManager.addPageChange(pageChange);
                this.copyFlagsFromOldPage(layout.pages[createdPage.index], createdPage);
                layout.pages[createdPage.index] = createdPage;
                var tblCellInfo = __aspxRichEdit.ListUtils.last(createdPage.mainSubDocumentPageAreas[0].columns[0].rows).tableCellInfo;
                if (!tblCellInfo ||
                    tblCellInfo.parentRow.rowIndex == tblCellInfo.parentRow.parentTable.logicInfo.grid.table.rows.length - 1 &&
                        !tblCellInfo.parentRow.parentTable.isBoundWithNext())
                    this.manager.onPagesReady();
                this.layoutPosition.detailsLevel = __aspxRichEdit.DocumentLayoutDetailsLevel.None;
                this.layoutPosition.pageIndex++;
                this.layoutPosition.page = null;
                return true;
            };
            MainFormatter.prototype.processStateDocumentEnd = function () {
                var _this = this;
                this.manager.activeFormatter = this;
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatter, "processStateDocumentEnd", function () { return "SubDocId: " + _this.subDocument.id + ", LayPos: " + __aspxRichEdit.LogObjToStr.layoutPositionShort(_this.layoutPosition); });
                var layout = this.manager.layout;
                this.manager.removeRedundantHelper.removeRedundantPage(layout, layout.validPageCount);
                layout.isFullyFormatted = true;
                layout.lastMaxNumPages = __aspxRichEdit.ListUtils.last(this.manager.layout.pages).layoutPageIndex + 1;
                this.manager.layoutDependentRunCache.recalculateHeaderFooterPageAreas();
                this.manager.onPagesReady();
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatter, "processStateDocumentEnd(end)\n", __aspxRichEdit.Log.w(3, __aspxRichEdit.Log.join)("\n")(__aspxRichEdit.Log.map(function (page, index) { return "\tPage[" + index + "]Intervals: " + __aspxRichEdit.LogListHelper.level_1(__aspxRichEdit.LogObjToStr.fixedInterval, page.getContentIntervals(), "\t\t", "\t")(); }, this.manager.layout.pages)));
                this.state = LayoutFormatterState.End;
                this.manager.anchoredObjectsManager.reset();
                return false;
            };
            MainFormatter.prototype.processStateEnd = function () {
                return false;
            };
            MainFormatter.prototype.copyFlagsFromOldPage = function (oldPage, createdPage) {
                if (oldPage) {
                    var oldFlags = oldPage.flags.clone();
                    oldFlags.set(__aspxRichEdit.LayoutPageFlags.IsFirstPageOfSection, createdPage.flags.get(__aspxRichEdit.LayoutPageFlags.IsFirstPageOfSection));
                    oldFlags.set(__aspxRichEdit.LayoutPageFlags.IsIntervalsCorrect, createdPage.flags.get(__aspxRichEdit.LayoutPageFlags.IsIntervalsCorrect));
                    createdPage.flags = oldFlags;
                }
            };
            MainFormatter.prototype.createNextPage = function (pageBounds) {
                var newPage = new __aspxRichEdit.LayoutPage();
                newPage.initByAnotherRectangle(pageBounds);
                newPage.setPosition(this.rowFormatter.getPosition());
                this.state = LayoutFormatterState.PageAreaStart;
                this.layoutPosition.page = newPage;
                this.layoutPosition.pageAreaIndex = 0;
                this.layoutPosition.pageArea = null;
                this.layoutPosition.detailsLevel = __aspxRichEdit.DocumentLayoutDetailsLevel.Page;
            };
            MainFormatter.prototype.tryReusePage = function (pageBounds) {
                var pages = this.manager.layout.pages;
                var page = pages[this.layoutPosition.pageIndex];
                if (!page || !page.isValid || this.tableFormatter || !page.equals(pageBounds) || page.getPosition() != this.rowFormatter.getPosition())
                    return TryReusePageResult.CreateNewPage;
                this.layoutPosition.pageAreaIndex = page.mainSubDocumentPageAreas.length - 1;
                var pageArea = __aspxRichEdit.ListUtils.last(page.mainSubDocumentPageAreas);
                var column = pageArea.getLastColumn();
                this.lastRowInfo.setRowInfo(column.getLastRow(), page.getPosition() + pageArea.pageOffset + column.pageAreaOffset, false);
                var firstBoundWithNextCellOnPage = __aspxRichEdit.LayoutTableColumnInfo.getFirstCellInPageThatBoundWithCellPlacedInNextPage(column.tablesInfo);
                var nextBoxIteratorPosition = firstBoundWithNextCellOnPage ?
                    page.getPosition() + pageArea.pageOffset + column.pageAreaOffset + firstBoundWithNextCellOnPage.getEndPosition() :
                    page.getEndPosition();
                var nextPage = this.manager.layout.pages[page.index + 1];
                if (column.tablesInfo[0] && !__aspxRichEdit.ListUtils.last(column.tablesInfo).isLastLayoutColumnInModelTable() &&
                    (!nextPage || nextBoxIteratorPosition != nextPage.getPosition())) {
                    return TryReusePageResult.RestartFromPageStartPosition;
                }
                this.rowFormatter.setPosition(nextBoxIteratorPosition, false, !this.tableFormatter);
                this.state = LayoutFormatterState.PageEnd;
                this.layoutPosition.detailsLevel = __aspxRichEdit.DocumentLayoutDetailsLevel.Page;
                this.layoutPosition.page = page.deepCopy();
                return TryReusePageResult.UseOldPage;
            };
            MainFormatter.prototype.formatOtherHeaderFooterPageArea = function (container, format) {
                var isEvenPage = __aspxRichEdit.Utils.isEven(this.layoutPosition.page.layoutPageIndex);
                var isFirstPageOfSection = this.layoutPosition.page.flags.get(__aspxRichEdit.LayoutPageFlags.IsFirstPageOfSection);
                var actualObject = container.getActualObject(isFirstPageOfSection, isEvenPage);
                format(actualObject);
            };
            MainFormatter.prototype.setParamsForRestart = function (state, newLp, newLastRowInfo, resetTableFormatter) {
                this.state = state;
                this.layoutPosition = newLp;
                this.lastRowInfo = newLastRowInfo;
                if (resetTableFormatter)
                    this.tableFormatter = null;
            };
            MainFormatter.prototype.setBoundsForRestart = function (pageAreaBounds, columnBounds) {
                this.pageAreaBounds = pageAreaBounds;
                this.columnBounds = columnBounds;
            };
            MainFormatter.correctPageOffsets = function (page) {
                var pageAreas = page.mainSubDocumentPageAreas;
                if (!pageAreas.length)
                    return;
                var offsetFirstPageAreaFromPage = pageAreas[0].pageOffset;
                if (offsetFirstPageAreaFromPage != 0) {
                    page.setPosition(page.getPosition() + offsetFirstPageAreaFromPage);
                    for (var _i = 0, pageAreas_2 = pageAreas; _i < pageAreas_2.length; _i++) {
                        var pageArea = pageAreas_2[_i];
                        pageArea.pageOffset -= offsetFirstPageAreaFromPage;
                    }
                }
            };
            MainFormatter.notAllowBreakOnState = new __aspxRichEdit.MapCreatorNumberAsKey()
                .add(LayoutFormatterState.DocumentStart, function (_lp) { return true; })
                .add(LayoutFormatterState.PageStart, function (lp) { return lp.pageIndex == 0; })
                .add(LayoutFormatterState.PageAreaStart, function (lp) { return lp.pageAreaIndex == 0; })
                .add(LayoutFormatterState.ColumnStart, function (lp) { return lp.columnIndex == 0; })
                .add(LayoutFormatterState.RowFormatting, function (lp) { return lp.rowIndex == 0; })
                .add(LayoutFormatterState.DocumentEnd, function (_lp) { return false; })
                .add(LayoutFormatterState.PageEnd, function (_lp) { return false; })
                .add(LayoutFormatterState.PageAreaEnd, function (_lp) { return false; })
                .add(LayoutFormatterState.ColumnEnd, function (_lp) { return false; })
                .get();
            return MainFormatter;
        }(LayoutFormatter.BaseFormatter));
        LayoutFormatter.MainFormatter = MainFormatter;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var ModelChangesListener = (function () {
            function ModelChangesListener(invalidator) {
                this.invalidator = invalidator;
            }
            ModelChangesListener.prototype.NotifySimpleRunInserted = function (subDocument, logPosition, length, _characterProperties, _characterStyle, type, _text) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifySimpleRunInserted", function () { return "subDocumentId:" + subDocument.id + ", logPosition:" + logPosition + ", length:" + length + " type:" + __aspxRichEdit.RunType[type]; });
                this.invalidator.onContentInserted(subDocument, logPosition, length, false);
            };
            ModelChangesListener.prototype.NotifyParagraphInserted = function (subDocument, position, _paragraph) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyParagraphInserted", function () { return "subDocumentId:" + subDocument.id + ", position:" + position; });
                this.invalidator.onContentInserted(subDocument, position, 1, true);
            };
            ModelChangesListener.prototype.NotifySectionInserted = function (subDocument, position, section, sectionIndex) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifySectionInserted", function () { return "subDocumentId:" + subDocument.id + ", position:" + position; });
                this.invalidator.onChangedSection(section, sectionIndex);
            };
            ModelChangesListener.prototype.NotifyInlinePictureInserted = function (subDocument, position, id, scaleX, scaleY) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyInlinePictureInserted", function () { return "subDocumentId:" + subDocument.id + ", position:" + position + ", id:" + id + ", scaleX:" + scaleX + ", scaleY:" + scaleY; });
                this.invalidator.onContentInserted(subDocument, position, 1, false);
            };
            ModelChangesListener.prototype.NotifyAnchoredPictureInserted = function (subDocument, _objectId, position, id, size, anchorInfo) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyAnchoredPictureInserted", function () { return "subDocumentId:" + subDocument.id + ", position:" + position + ", id:" + id + ", scaleX:" + size.scale.width + ", scaleY:" + size.scale.height + ", anchorInfo:" + anchorInfo; });
                this.invalidator.onContentInserted(subDocument, position, 1, false);
            };
            ModelChangesListener.prototype.NotifyAnchoredTextBoxInserted = function (subDocument, _objectId, _subDocId, position, anchorInfo) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyAnchoredTextBoxInserted", function () { return "subDocumentId:" + subDocument.id + ", position:" + position + ", anchorInfo:" + anchorInfo; });
                this.invalidator.onContentInserted(subDocument, position, 1, false);
            };
            ModelChangesListener.prototype.NotifyAnchorObjectRemoved = function (subDocument, _objectId, position) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyAnchorObjectRemoved", function () { return "subDocumentId:" + subDocument.id + ", position:" + position; });
                this.invalidator.onIntervalChanged(subDocument, new __aspxRichEdit.FixedInterval(position, 1));
            };
            ModelChangesListener.prototype.NotifyAnchoredPictureSizeChanged = function (subDocument, _objectId, position, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyAnchoredPictureSizeChanged", function () { return "subDocumentId:" + subDocument.id + ", position:" + position + ", newState:\n" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemIntervalStateObject, newState, "\t", "\n")(); });
                this.invalidator.onIntervalChanged(subDocument, new __aspxRichEdit.FixedInterval(position, 1));
            };
            ModelChangesListener.prototype.NotifyAnchoredTextBoxSizeChanged = function (subDocument, _objectId, position, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyAnchoredTextBoxSizeChanged", function () { return "subDocumentId:" + subDocument.id + ", position:" + position + ", newState:\n" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemIntervalStateObject, newState, "\t", "\n")(); });
                this.invalidator.onIntervalChanged(subDocument, new __aspxRichEdit.FixedInterval(position, 1));
            };
            ModelChangesListener.prototype.NotifyAnchoredTextBoxContentMarginsChanged = function (subDocument, _objectId, position, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyAnchoredTextBoxContentMarginsChanged", function () { return "subDocumentId:" + subDocument.id + ", position:" + position + ", newState:\n" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemIntervalStateObject, newState, "\t", "\n")(); });
                this.invalidator.onIntervalChanged(subDocument, new __aspxRichEdit.FixedInterval(position, 1));
            };
            ModelChangesListener.prototype.NotifyAnchoredTextBoxPropertiesChanged = function (subDocument, _objectId, position, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyAnchoredTextBoxPropertiesChanged", function () { return "subDocumentId:" + subDocument.id + ", position:" + position + ", newState:\n" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemIntervalStateObject, newState, "\t", "\n")(); });
                this.invalidator.onIntervalChanged(subDocument, new __aspxRichEdit.FixedInterval(position, 1));
            };
            ModelChangesListener.prototype.NotifyAnchorInfoPropertyChanged = function (subDocument, _objectId, property, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyAnchorInfoPropertyChanged", function () { return "subDocumentId:" + subDocument.id + ", property:" + __aspxRichEdit.JSONAnchorInfoProperty[property] + ", newState:\n" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemIntervalStateObject, newState, "\t", "\n")(); });
                if (property === __aspxRichEdit.JSONAnchorInfoProperty.ZOrder)
                    this.invalidator.onChangedAllLayout();
                else
                    this.invalidator.onIntervalChanged(subDocument, new __aspxRichEdit.FixedInterval(newState.interval.start, 1));
            };
            ModelChangesListener.prototype.NotifyShapeChanged = function (subDocument, _objectId, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyShapePropertyChanged", function () { return "subDocumentId:" + subDocument.id + ", newState:\n" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemIntervalStateObject, newState, "\t", "\n")(); });
                this.invalidator.onIntervalChanged(subDocument, new __aspxRichEdit.FixedInterval(newState.interval.start, 1));
            };
            ModelChangesListener.prototype.NotifyShapePropertyChanged = function (subDocument, _objectId, property, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyShapePropertyChanged", function () { return "subDocumentId:" + subDocument.id + ", property:" + __aspxRichEdit.JSONShapeProperty[property] + ", newState:\n" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemIntervalStateObject, newState, "\t", "\n")(); });
                this.invalidator.onIntervalChanged(subDocument, new __aspxRichEdit.FixedInterval(newState.interval.start, 1));
            };
            ModelChangesListener.prototype.NotifyLoadInlinePictures = function (subDocument, imagesInfo) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyLoadInlinePictures", function () { return "subDocumentId:" + subDocument.id + ", imagesInfo:\n" + __aspxRichEdit.LogListHelper.level_1(__aspxRichEdit.Log.w(3, __aspxRichEdit.Log.flip(__aspxRichEdit.Log.flip(__aspxRichEdit.LogObjToStr.imagesInfo, 0, 1), 1, 2))("", "\t"), imagesInfo, "\t", "\n")(); });
            };
            ModelChangesListener.prototype.NotifyInlinePicturesUpdated = function (subDocument, updatedImagesInfo) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyInlinePicturesUpdated", function () { return "subDocumentId:" + subDocument.id + ", updatedImagesInfo:" + __aspxRichEdit.LogListHelper.level_1(__aspxRichEdit.Log.w(3, __aspxRichEdit.Log.flip(__aspxRichEdit.Log.flip(__aspxRichEdit.LogObjToStr.updatedImagesInfo, 0, 1), 1, 2))("", "\t"), updatedImagesInfo, "\t", "\n")(); });
                for (var _i = 0, updatedImagesInfo_1 = updatedImagesInfo; _i < updatedImagesInfo_1.length; _i++) {
                    var imageInfo = updatedImagesInfo_1[_i];
                    this.invalidator.onIntervalChanged(subDocument, new __aspxRichEdit.FixedInterval(imageInfo.position, 1));
                }
            };
            ModelChangesListener.prototype.NotifyIntervalRemoved = function (subDocument, position, length) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyIntervalRemoved", function () { return "subDocumentId:" + subDocument.id + ", position:" + position + ", length:" + length; });
                this.invalidator.onContentInserted(subDocument, position, -length, false);
            };
            ModelChangesListener.prototype.NotifyInlineObjectRunPropertyChanged = function (subDocument, property, position, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyInlineObjectRunPropertyChanged", function () { return "subDocumentId:" + subDocument.id + ", property:" + __aspxRichEdit.JSONInlineObjectProperty[property] + ", position:" + position + ", newState:\n" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemIntervalStateObject, newState, "\t", "\n")(); });
                var interval = newState.interval;
                this.invalidator.onIntervalChanged(subDocument, __aspxRichEdit.FixedInterval.fromPositions(Math.max(0, interval.start - 1), interval.end));
            };
            ModelChangesListener.prototype.NotifySectionMerged = function (subDocument, sectionIndex, getPropertiesFromNext) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifySectionMerged", function () { return "subDocumentId:" + subDocument.id + ", sectionIndex:" + sectionIndex + ", getPropertiesFromNext:" + getPropertiesFromNext; });
                this.invalidator.onChangedSection(subDocument.documentModel.sections[sectionIndex], sectionIndex);
            };
            ModelChangesListener.prototype.NotifyParagraphMerged = function (subDocument, position, getPropertiesFromNext) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyParagraphMerged", function () { return "subDocumentId:" + subDocument.id + ", position:" + position + ", getPropertiesFromNext:" + getPropertiesFromNext; });
                this.invalidator.onContentInserted(subDocument, position, -1, true);
            };
            ModelChangesListener.prototype.NotifyParagraphAndCharacterMergedPropertiesReset = function (subDocument, interval) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyParagraphAndCharacterMergedPropertiesReset", function () { return "subDocumentId:" + subDocument.id + ", interval:" + __aspxRichEdit.LogObjToStr.fixedInterval(interval); });
                this.invalidator.onIntervalChanged(subDocument, interval);
            };
            ModelChangesListener.prototype.NotifyTextBufferChanged = function (subDocument, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyTextBufferChanged", function () { return "subDocumentId:" + subDocument.id + ", newState:\n" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemIntervalStateObject, newState, "\t", "\n")(); });
                this.invalidator.onIntervalChanged(subDocument, newState.interval);
            };
            ModelChangesListener.prototype.NotifyCharacterFormattingChanged = function (subDocument, property, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyCharacterFormattingChanged", function () { return "subDocumentId:" + subDocument.id + ", property:" + __aspxRichEdit.JSONCharacterFormattingProperty[property] + ", newState:\n" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemIntervalStateObject, newState, "\t", "\n")(); });
                this.invalidator.onIntervalChanged(subDocument, newState.interval);
            };
            ModelChangesListener.prototype.NotifyCharacterPropertiesChanged = function (subDocument, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyCharacterPropertiesChanged", function () { return "subDocumentId:" + subDocument.id + ", newState:\n" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemIntervalStateObject, newState, "\t", "\n")(); });
                this.invalidator.onIntervalChanged(subDocument, newState.interval);
            };
            ModelChangesListener.prototype.NotifyParagraphFormattingChanged = function (subDocument, property, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyParagraphFormattingChanged", function () { return "subDocumentId:" + subDocument.id + ", property:" + __aspxRichEdit.JSONParagraphFormattingProperty[property] + ", newState:\n" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemIntervalStateObject, newState, "\t", "\n")(); });
                var interval = newState.interval;
                this.invalidator.onIntervalChanged(subDocument, __aspxRichEdit.FixedInterval.fromPositions(Math.max(0, interval.start - 1), interval.end));
            };
            ModelChangesListener.prototype.NotifyParagraphPropertiesChanged = function (subDocument, paragraphIndex, _properties, _style, _tabs, _numberingListIndex, _listLevelIndex) {
                var paragraph = subDocument.paragraphs[paragraphIndex];
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyParagraphPropertiesChanged", function () { return "subDocumentId:" + subDocument.id + ", paragraphIndex: " + paragraphIndex + "}"; });
                this.invalidator.onIntervalChanged(subDocument, paragraph.interval);
            };
            ModelChangesListener.prototype.NotifySectionFormattingChanged = function (section, sectionIndex, property, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifySectionFormattingChanged", function () { return "property:" + __aspxRichEdit.JSONSectionProperty[property] + ", newState:" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemSectionStateObject, newState, "\t", "\n")(); });
                this.invalidator.onChangedSection(section, sectionIndex);
            };
            ModelChangesListener.prototype.NotifyTabInserted = function (subDocument, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyTabInserted", function () { return "subDocumentId:" + subDocument.id + ", newState:" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemIntervalStateObject, newState, "\t", "\n")(); });
                this.invalidator.onIntervalChanged(subDocument, newState.interval);
            };
            ModelChangesListener.prototype.NotifyTabDeleted = function (subDocument, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyTabDeleted", function () { return "subDocumentId:" + subDocument.id + ", newState:" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemIntervalStateObject, newState, "\t", "\n")(); });
                this.invalidator.onIntervalChanged(subDocument, newState.interval);
            };
            ModelChangesListener.prototype.NotifyBookmarkCreated = function (subDocument, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyBookmarkCreated", function () { return "subDocumentId:" + subDocument.id + ", newState:" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemBookmarkStateObject, newState, "\t", "\n")(); });
                this.invalidator.onIntervalChanged(subDocument, newState.objects[0].bkmTempate.interval.getFixedInterval());
            };
            ModelChangesListener.prototype.NotifyBookmarkDeleted = function (subDocument, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyBookmarkDeleted", function () { return "subDocumentId:" + subDocument.id + ", newState:" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemBookmarkStateObject, newState, "\t", "\n")(); });
                this.invalidator.onIntervalChanged(subDocument, newState.objects[0].bkmTempate.interval.getFixedInterval());
            };
            ModelChangesListener.prototype.NotifyCreateStyleLink = function (paragraphStyleName) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyCreateStyleLink", "paragraphStyleName:" + paragraphStyleName);
            };
            ModelChangesListener.prototype.NotifyDeleteStyleLink = function (paragraphStyleName) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyDeleteStyleLink", "paragraphStyleName:" + paragraphStyleName);
            };
            ModelChangesListener.prototype.NotifyCharacterStyleApplied = function (subDocument, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyCharacterStyleApplied", function () { return "subDocumentId:" + subDocument.id + ", newState:" + __aspxRichEdit.LogObjToStr.historyItemIntervalState(__aspxRichEdit.LogObjToStr.historyItemIntervalStateObject, newState, "\t", "\n")(); });
                this.invalidator.onIntervalChanged(subDocument, newState.interval);
            };
            ModelChangesListener.prototype.NotifyParagraphStyleApplied = function (subDocument, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyParagraphStyleApplied. subDocumentId:" + subDocument.id + ", newState:", newState);
                this.invalidator.onIntervalChanged(subDocument, newState.interval);
            };
            ModelChangesListener.prototype.NotifyParagraphNumberingListChanged = function (subDocument, newState, oldAbstractNumberingListIndex) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyParagraphNumberingListChanged", function () { return "subDocumentId:" + subDocument.id + ", newState:" + __aspxRichEdit.LogObjToStr.historyItemIntervalState(__aspxRichEdit.LogObjToStr.historyItemIntervalStateObject, newState, "\t", "\n")() + ", oldAbstractNumberingListIndex: " + oldAbstractNumberingListIndex; });
                var intervals = [newState.interval];
                var intervalStart = newState.interval.start;
                var paragraphIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(subDocument.paragraphs, function (p) { return p.startLogPosition.value; }, intervalStart);
                var newAbstractNumberingListIndex = subDocument.paragraphs[paragraphIndex].getAbstractNumberingListIndex();
                for (var i = paragraphIndex + 1, paragraph = void 0; paragraph = subDocument.paragraphs[i]; i++) {
                    var parAbstractNumberingListIndex = paragraph.getAbstractNumberingListIndex();
                    if (parAbstractNumberingListIndex === oldAbstractNumberingListIndex || parAbstractNumberingListIndex === newAbstractNumberingListIndex)
                        intervals.push(paragraph.interval);
                }
                var mergedIntervals = __aspxRichEdit.IntervalAlgorithms.getMergedIntervals(intervals, true);
                for (var _i = 0, mergedIntervals_2 = mergedIntervals; _i < mergedIntervals_2.length; _i++) {
                    var interval = mergedIntervals_2[_i];
                    this.invalidator.onIntervalChanged(subDocument, interval);
                }
            };
            ModelChangesListener.prototype.NotifyAbstractNumberingListAdded = function (index) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyAbstractNumberingListAdded", "index:" + index);
            };
            ModelChangesListener.prototype.NotifyAbstractNumberingListDeleted = function (index) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyAbstractNumberingListDeleted", "index:" + index);
            };
            ModelChangesListener.prototype.NotifyNumberingListAdded = function (index) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyNumberingListAdded", "index:" + index);
            };
            ModelChangesListener.prototype.NotifyNumberingListDeleted = function (index) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyNumberingListDeleted", "index:" + index);
            };
            ModelChangesListener.prototype.NotifyListLevelPropertyChanged = function (property, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyListLevelPropertyChanged", "property:" + __aspxRichEdit.JSONListLevelProperty[property] + ", newState:" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemListLevelStateObject, newState, "\t", "\n")());
                this.invalidator.onListLevelChanged(newState);
            };
            ModelChangesListener.prototype.NotifyListLevelParagraphPropertyChanged = function (property, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyListLevelParagraphPropertyChanged", function () { return "property:" + __aspxRichEdit.JSONParagraphFormattingProperty[property] + ", newState:" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemListLevelUseStateObject, newState, "\t", "\n")(); });
                this.invalidator.onListLevelChanged(newState);
            };
            ModelChangesListener.prototype.NotifyListLevelCharacterPropertyChanged = function (property, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyListLevelCharacterPropertyChanged", function () { return "property:" + __aspxRichEdit.JSONCharacterFormattingProperty[property] + ", newState:" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemListLevelUseStateObject, newState, "\t", "\n")(); });
                this.invalidator.onListLevelChanged(newState);
            };
            ModelChangesListener.prototype.NotifyIOverrideListLevelChanged = function (property, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyIOverrideListLevelChanged", function () { return "property:" + __aspxRichEdit.JSONIOverrideListLevelProperty[property] + ", newState:" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemListLevelStateObject, newState, "\t", "\n")(); });
                this.invalidator.onListLevelChanged(newState);
            };
            ModelChangesListener.prototype.NotifyFieldInserted = function (subDocument, startPosition, separatorPosition, endPosition) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyFieldInserted", "subDocumentId:" + subDocument.id + ", startPosition:" + startPosition + ", separatorPosition:" + separatorPosition + ", endPosition:" + endPosition);
            };
            ModelChangesListener.prototype.NotifyFieldDeleted = function (subDocument, endPosition) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyFieldDeleted", "subDocumentId:" + subDocument.id + ", endPosition:" + endPosition);
            };
            ModelChangesListener.prototype.NotifyHyperlinkInfoChanged = function (subDocument, fieldResultInterval, _fieldCodeInterval, newHyperlinkInfo) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyHyperlinkInfoChanged", function () { return "subDocumentId:" + subDocument.id + ", fieldResultInterval:" + __aspxRichEdit.LogObjToStr.fixedInterval(fieldResultInterval) + ", newHyperlinkInfo:" + __aspxRichEdit.LogObjToStr.hyperlinkInfo(newHyperlinkInfo); });
                this.invalidator.onIntervalChanged(subDocument, fieldResultInterval);
            };
            ModelChangesListener.prototype.NotifyDefaultTabWidthChanged = function (defaultTabWidth) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyDefaultTabWidthChanged", "defaultTabWidth:" + defaultTabWidth);
                this.invalidator.onChangedAllLayout();
            };
            ModelChangesListener.prototype.NotifyPageColorChanged = function (pageColor) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyPageColorChanged", "pageColor:" + pageColor);
                this.invalidator.onChangedAllLayout();
            };
            ModelChangesListener.prototype.NotifyDifferentOddAndEvenPagesChanged = function (newValue) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyDifferentOddAndEvenPagesChanged", "newValue:" + newValue);
                this.invalidator.onChangedAllLayout();
            };
            ModelChangesListener.prototype.NotifyHeaderFooterCreated = function (isHeader, type, subDocumentInfo) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyHeaderFooterCreated", function () { return "isHeader:" + isHeader + ", type:" + __aspxRichEdit.HeaderFooterType[type] + ", subDocumentInfo:" + __aspxRichEdit.LogObjToStr.headerFooterSubDocumentInfoBase(subDocumentInfo); });
            };
            ModelChangesListener.prototype.NotifyHeaderFooterIndexChanged = function (sectionIndex, isHeader, type, newIndex, model) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyHeaderFooterIndexChanged", function () { return "sectionIndex:" + sectionIndex + ", isHeader:" + isHeader + ", type:" + __aspxRichEdit.HeaderFooterType[type] + ", newIndex:" + newIndex; });
                this.invalidator.onHeaderFooterIndexChanged(sectionIndex, type, model);
            };
            ModelChangesListener.prototype.NotifyTableCreated = function (subDocument, table) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyTableCreated", function () { return "subDocumentId:" + subDocument.id + ", tableIndex:" + table.index; });
                this.invalidator.onIntervalChanged(subDocument, table.getTopLevelParent().interval);
            };
            ModelChangesListener.prototype.NotifyTableRemoved = function (subDocument, startPosition, endPosition, nestedLevel) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyTableRemoved", function () { return "subDocumentId:" + subDocument.id + ", startPosition:" + startPosition + ", endPosition:" + endPosition + ", nestedLevel:" + nestedLevel; });
                this.invalidator.onIntervalChanged(subDocument, __aspxRichEdit.FixedInterval.fromPositions(startPosition, endPosition));
            };
            ModelChangesListener.prototype.NotifyTableStartPositionShifted = function (subDocument, table, oldPosition, newPosition) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyTableStartPositionShifted", function () { return "subDocumentId:" + subDocument.id + ", oldPosition:" + oldPosition + ", newPosition:" + newPosition + ", tableIndex:" + table.index; });
                this.invalidator.onIntervalChanged(subDocument, table.getTopLevelParent().interval);
            };
            ModelChangesListener.prototype.NotifyTableCellPropertyChanged = function (subDocument, property, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyTableCellPropertyChanged", function () { return "subDocumentId:" + subDocument.id + ", property:" + __aspxRichEdit.JSONServerTableCellProperty[property] + ", newState:\n" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemTableCellStateObject, newState, "\t", "\n")(); });
                for (var _i = 0, _a = newState.objects; _i < _a.length; _i++) {
                    var state = _a[_i];
                    this.invalidator.onIntervalChanged(subDocument, subDocument.tables[state.tableIndex].getTopLevelParent().interval);
                }
            };
            ModelChangesListener.prototype.NotifyTablePropertyChanged = function (subDocument, property, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyTablePropertyChanged", function () { return "subDocumentId:" + subDocument.id + ", property:" + __aspxRichEdit.JSONEnumTableProperty[property] + ", newState:\n" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemTableStateObject, newState, "\t", "\n")(); });
                for (var _i = 0, _a = newState.objects; _i < _a.length; _i++) {
                    var state = _a[_i];
                    this.invalidator.onIntervalChanged(subDocument, subDocument.tables[state.tableIndex].getTopLevelParent().interval);
                }
            };
            ModelChangesListener.prototype.NotifyTableRowPropertyChanged = function (subDocument, property, newState) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyTableRowPropertyChanged", function () { return "subDocumentId:" + subDocument.id + ", property:" + __aspxRichEdit.JSONServerTableRowProperty[property] + ", newState:\n" + __aspxRichEdit.LogObjToStr.historyItemState(__aspxRichEdit.LogObjToStr.historyItemTableRowStateObject, newState, "\t", "\n")(); });
                for (var _i = 0, _a = newState.objects; _i < _a.length; _i++) {
                    var state = _a[_i];
                    this.invalidator.onIntervalChanged(subDocument, subDocument.tables[state.tableIndex].getTopLevelParent().interval);
                }
            };
            ModelChangesListener.prototype.NotifyTableCellSplittedHorizontally = function (subDocument, table, rowIndex, cellIndex, rightDirection) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyTableCellSplittedHorizontally", function () { return "subDocumentId:" + subDocument.id + ", tableIndex:" + table.index + ", rowIndex:" + rowIndex + ", cellIndex:" + cellIndex + ", rightDirection:" + rightDirection; });
                this.invalidator.onIntervalChanged(subDocument, table.getTopLevelParent().interval);
            };
            ModelChangesListener.prototype.NotifyTableCellMergedHorizontally = function (subDocument, table, rowIndex, cellIndex, rightDirection) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyTableCellMergedHorizontally", function () { return "subDocumentId:" + subDocument.id + ", tableIndex:" + table.index + ", rowIndex:" + rowIndex + ", cellIndex:" + cellIndex + ", rightDirection:" + rightDirection; });
                this.invalidator.onIntervalChanged(subDocument, table.getTopLevelParent().interval);
            };
            ModelChangesListener.prototype.NotifyTableRowInserted = function (subDocument, table, rowIndex) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyTableRowInserted", function () { return "subDocumentId:" + subDocument.id + ", tableIndex:" + table.index + ", rowIndex:" + rowIndex; });
                this.invalidator.onIntervalChanged(subDocument, table.getTopLevelParent().interval);
            };
            ModelChangesListener.prototype.NotifyTableRowRemoved = function (subDocument, table, rowIndex) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyTableRowRemoved", function () { return "subDocumentId:" + subDocument.id + ", tableIndex:" + table.index + ", rowIndex:" + rowIndex; });
                this.invalidator.onIntervalChanged(subDocument, table.getTopLevelParent().interval);
            };
            ModelChangesListener.prototype.NotifyTableCellRemoved = function (subDocument, table, rowIndex, cellIndex) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyTableCellRemoved", function () { return "subDocumentId:" + subDocument.id + ", tableIndex:" + table.index + ", rowIndex:" + rowIndex + ", cellIndex:" + cellIndex; });
                this.invalidator.onIntervalChanged(subDocument, table.getTopLevelParent().interval);
            };
            ModelChangesListener.prototype.NotifyTableCellInserted = function (subDocument, table, rowIndex, cellIndex) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyTableCellInserted", function () { return "subDocumentId:" + subDocument.id + ", tableIndex:" + table.index + ", rowIndex:" + rowIndex + ", cellIndex:" + cellIndex; });
                this.invalidator.onIntervalChanged(subDocument, table.getTopLevelParent().interval);
            };
            ModelChangesListener.prototype.NotifyTableStyleChanged = function (subDocument, table, newStyle) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyTableStyleChanged", function () { return "subDocumentId:" + subDocument.id + ", tableIndex:" + table.index + ", newStyleName:" + newStyle.styleName; });
                this.invalidator.onIntervalChanged(subDocument, table.getTopLevelParent().interval);
            };
            ModelChangesListener.prototype.NotifyLoadFontInfo = function (fontInfo, fontIndex) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatterNotifier, "NotifyLoadFontInfo", function () { return "fontInfoName:" + fontInfo.name + ", fontIndex:" + fontIndex; });
            };
            return ModelChangesListener;
        }());
        LayoutFormatter.ModelChangesListener = ModelChangesListener;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var OtherPageAreaFormatter = (function () {
            function OtherPageAreaFormatter(manager) {
                this.manager = manager;
            }
            OtherPageAreaFormatter.prototype.formatOtherPageArea = function (page, subDocumentInfo, setBounds, getHeaderOrFooterPageAreaBounds, getHeaderOrFooterColumnBounds) {
                if (!subDocumentInfo) {
                    setBounds(0);
                    return;
                }
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatter, "formatHeaderOrFooterPageArea", function () { return "headerSubDocumentInfo: " + __aspxRichEdit.LogObjToStr.subDocumentInfoBase(subDocumentInfo); });
                var oldActiveFormatter = this.manager.activeFormatter;
                setBounds(-1);
                this.shiftFooterObjectByVertical(page.otherPageAreas, subDocumentInfo, page.anchoredObjectHolder, function (obj, pa) {
                    if (pa)
                        pa.y += obj.yShift;
                    obj.y += obj.yShift;
                    obj.yShift = 0;
                });
                var formatter = new LayoutFormatter.BaseFormatter(this.manager, subDocumentInfo.subDocumentId);
                formatter.initDocumentStart();
                formatter.formatPageArea(getHeaderOrFooterPageAreaBounds(), [getHeaderOrFooterColumnBounds()], page);
                var pageArea = formatter.layoutPosition.pageArea;
                if (pageArea) {
                    setBounds(__aspxRichEdit.ListUtils.last(pageArea.columns[0].rows).getBottomBoundPosition());
                    var column = pageArea.columns[0];
                    var diff_1 = pageArea.y + column.y;
                    pageArea.initByAnotherRectangle(getHeaderOrFooterPageAreaBounds());
                    diff_1 -= pageArea.y + column.y;
                    column.initByAnotherRectangle(getHeaderOrFooterColumnBounds());
                    OtherPageAreaFormatter.reduceRowHeight(column);
                    this.shiftFooterObjectByVertical(page.otherPageAreas, subDocumentInfo, page.anchoredObjectHolder, function (obj, pa) {
                        if (pa)
                            pa.y -= diff_1;
                        obj.y -= diff_1;
                        obj.yShift = diff_1;
                    });
                }
                else
                    setBounds(0);
                this.manager.activeFormatter = oldActiveFormatter;
            };
            OtherPageAreaFormatter.prototype.shiftFooterObjectByVertical = function (otherPageAreas, subDocumentInfo, pageAnchoredObjectHolder, action) {
                if (subDocumentInfo.isFooter) {
                    __aspxRichEdit.MapUtilsKeyAsNumber.foreach(pageAnchoredObjectHolder.objects, function (obj) {
                        if (obj.belongsToSubDocId == subDocumentInfo.subDocumentId &&
                            (obj.anchorInfo.isUsedVerticalAbsolutePosition() || obj.anchorInfo.isUsedVerticalRelativePosition()) &&
                            (obj.anchorInfo.verticalPositionType == __aspxRichEdit.AnchorObjectVerticalPositionType.Paragraph ||
                                obj.anchorInfo.verticalPositionType == __aspxRichEdit.AnchorObjectVerticalPositionType.Line))
                            action(obj, obj.getType() == __aspxRichEdit.LayoutBoxType.AnchorTextBox ? otherPageAreas[obj.internalSubDocId] : null);
                    });
                }
            };
            OtherPageAreaFormatter.prototype.setTextBoxContent = function (page, textBox) {
                var subDocInfo = this.manager.model.subDocuments[textBox.internalSubDocId].info;
                if (!subDocInfo.isTextBox)
                    throw new Error(__aspxRichEdit.Errors.InternalException);
                var textBoxSubDocInfo = subDocInfo;
                var margins = textBox.textBoxProperties.getContentMargins();
                var pageAreaBounds = new __aspxRichEdit.Rectangle().init(0, 0, textBox.width, textBox.height);
                var columnBounds = pageAreaBounds.clone().applyMarginsInside(margins);
                this.formatOtherPageArea(page, textBoxSubDocInfo, function (_val) { }, function () { return pageAreaBounds; }, function () { return columnBounds; });
                if (textBox.textBoxProperties.resizeShapeToFitText) {
                    var pageArea = page.otherPageAreas[textBox.internalSubDocId];
                    var column = pageArea.columns[0];
                    var bottomPos = column.getLastRow().getBottomBoundPosition();
                    var diff = column.height - bottomPos;
                    if (diff > 0) {
                        column.height -= diff;
                        pageArea.height -= diff;
                        textBox.height -= diff;
                    }
                }
            };
            OtherPageAreaFormatter.prototype.formatHeaderPageArea = function (page, headerSubDocumentInfo) {
                var boundsCalculator = this.manager.boundsCalculator;
                this.formatOtherPageArea(page, headerSubDocumentInfo, function (val) { return boundsCalculator.setHeaderBounds(val); }, function () { return boundsCalculator.headerPageAreaBounds; }, function () { return boundsCalculator.headerColumnBounds; });
            };
            OtherPageAreaFormatter.prototype.formatFooterPageArea = function (page, footerSubDocumentInfo) {
                var boundsCalculator = this.manager.boundsCalculator;
                this.formatOtherPageArea(page, footerSubDocumentInfo, function (val) { return boundsCalculator.setFooterBounds(val); }, function () { return boundsCalculator.footerPageAreaBounds; }, function () { return boundsCalculator.footerColumnBounds; });
            };
            OtherPageAreaFormatter.reduceRowHeight = function (column) {
                var colHeight = column.height;
                for (var _i = 0, _a = column.rows; _i < _a.length; _i++) {
                    var row = _a[_i];
                    if (row.y >= colHeight && !row.tableCellInfo) {
                        row.y = colHeight;
                        row.height = 0;
                    }
                }
            };
            return OtherPageAreaFormatter;
        }());
        LayoutFormatter.OtherPageAreaFormatter = OtherPageAreaFormatter;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var HeaderFooterInvalidatorHelper = (function () {
            function HeaderFooterInvalidatorHelper(model, layout, headerFooterType) {
                this.model = model;
                this.layout = layout;
                this.headerFooterType = headerFooterType;
            }
            HeaderFooterInvalidatorHelper.prototype.isNoPages = function () {
                this.startPageIndex = 0;
                this.endPageIndex = 0;
                return this.layout.pages.length == 0;
            };
            HeaderFooterInvalidatorHelper.prototype.initByPageIndex = function (initPageIndex) {
                if (this.isNoPages())
                    return;
                this.initPageIndex = Math.min(initPageIndex, this.layout.pages.length - 1);
                this.initSectionIndex = __aspxRichEdit.Section.getPageSectionIndex(this.layout.pages[this.initPageIndex], this.model.sections);
                this.calculatePageIndexes();
            };
            HeaderFooterInvalidatorHelper.prototype.initBySectionIndex = function (sectionIndex) {
                if (this.isNoPages())
                    return;
                this.initSectionIndex = sectionIndex;
                var sectionStartPosition = this.model.sections[this.initSectionIndex].startLogPosition.value;
                this.initPageIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.layout.pages, function (p) { return p.getPosition(); }, sectionStartPosition);
                this.calculatePageIndexes();
            };
            HeaderFooterInvalidatorHelper.prototype.calculatePageIndexes = function () {
                this.calcStartPageIndex();
                var moveFunc = function (ind) { return ++ind; };
                this.endPageIndex = this.getPageIndex(this.getSectionIndex(moveFunc) - this.initSectionIndex + 1, moveFunc);
                if (this.endPageIndex <= this.startPageIndex)
                    this.endPageIndex = this.startPageIndex + 1;
            };
            HeaderFooterInvalidatorHelper.prototype.calcStartPageIndex = function () {
                var moveFunc = function (ind) { return --ind; };
                var startSectionIndex = this.getSectionIndex(moveFunc);
                this.startPageIndex = this.getPageIndex(this.initSectionIndex - startSectionIndex + 1, moveFunc);
            };
            HeaderFooterInvalidatorHelper.prototype.getSectionIndex = function (getNextSectionIndex) {
                var sections = this.model.sections;
                var sectionIndex = this.initSectionIndex;
                for (var section = void 0; (section = sections[sectionIndex]) && __aspxRichEdit.SectionHeadersFooters.isLinkedToPrevious(section, this.headerFooterType); sectionIndex = getNextSectionIndex(sectionIndex))
                    ;
                return Math.max(0, sectionIndex);
            };
            HeaderFooterInvalidatorHelper.prototype.getPageIndex = function (skipSections, getNextPageIndex) {
                var pages = this.layout.pages;
                var pageIndex = this.initPageIndex;
                for (var page = void 0; page = pages[pageIndex]; pageIndex = getNextPageIndex(pageIndex)) {
                    if (page.flags.get(__aspxRichEdit.LayoutPageFlags.IsFirstPageOfSection)) {
                        if (skipSections > 0)
                            skipSections--;
                        else
                            break;
                    }
                }
                return Math.max(0, pageIndex);
            };
            return HeaderFooterInvalidatorHelper;
        }());
        LayoutFormatter.HeaderFooterInvalidatorHelper = HeaderFooterInvalidatorHelper;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var RestartFromPositionSaver_Base = (function () {
            function RestartFromPositionSaver_Base(manager) {
                this.manager = manager;
            }
            Object.defineProperty(RestartFromPositionSaver_Base.prototype, "restartPreparer", {
                get: function () {
                    return new LayoutFormatter.RestartPreparer(this.manager);
                },
                enumerable: true,
                configurable: true
            });
            RestartFromPositionSaver_Base.prototype.restartOtherSubDocument = function (subDocument, pageIndex) {
                return new RestartFromPositionSaver_OherSubDocument(this.manager, subDocument, pageIndex);
            };
            RestartFromPositionSaver_Base.prototype.restartMainSubDocumentFromPage = function (pageIndex) {
                return new RestartFromPositionSaver_MainSubDocumentFromPage(this.manager, pageIndex);
            };
            RestartFromPositionSaver_Base.prototype.restartMainSubDocumentFromRow = function (lp, modelPosition) {
                return RestartFromPositionSaver_Base.isNeedRestartFromPage(lp) ?
                    new RestartFromPositionSaver_MainSubDocumentFromPage(this.manager, lp.pageIndex) :
                    new RestartFromPositionSaver_MainSubDocumentFromRow(this.manager, lp, modelPosition);
            };
            RestartFromPositionSaver_Base.prototype.restart = function () {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.PositionSaver, "restart(from Base)", "");
            };
            RestartFromPositionSaver_Base.isNeedRestartFromPage = function (lp) {
                return lp.pageAreaIndex == 0 && lp.columnIndex == 0 && lp.rowIndex == 0;
            };
            return RestartFromPositionSaver_Base;
        }());
        LayoutFormatter.RestartFromPositionSaver_Base = RestartFromPositionSaver_Base;
        var RestartFromPositionSaver_OherSubDocument = (function (_super) {
            __extends(RestartFromPositionSaver_OherSubDocument, _super);
            function RestartFromPositionSaver_OherSubDocument(manager, subDocument, pageIndex) {
                var _this = _super.call(this, manager) || this;
                _this.subDocument = subDocument;
                _this.pageIndex = pageIndex;
                return _this;
            }
            RestartFromPositionSaver_OherSubDocument.prototype.restartOtherSubDocument = function (_subDocument, pageIndex) {
                return this.getNextState(pageIndex);
            };
            RestartFromPositionSaver_OherSubDocument.prototype.restartMainSubDocumentFromPage = function (pageIndex) {
                return this.getNextState(pageIndex);
            };
            RestartFromPositionSaver_OherSubDocument.prototype.restartMainSubDocumentFromRow = function (layoutPosition, _modelPosition) {
                return this.getNextState(layoutPosition.pageIndex);
            };
            RestartFromPositionSaver_OherSubDocument.prototype.restart = function () {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.PositionSaver, "restart(from OherSubDocument)", "pageIndex: " + this.pageIndex + ", subDocInfo:" + __aspxRichEdit.LogObjToStr.subDocumentInfoBase(this.subDocument.info));
                this.restartPreparer.restartHeaderFooterInternal(this.subDocument, this.pageIndex);
            };
            RestartFromPositionSaver_OherSubDocument.prototype.getNextState = function (pageIndex) {
                return new RestartFromPositionSaver_MainSubDocumentFromPage(this.manager, Math.min(pageIndex, this.pageIndex));
            };
            return RestartFromPositionSaver_OherSubDocument;
        }(RestartFromPositionSaver_Base));
        LayoutFormatter.RestartFromPositionSaver_OherSubDocument = RestartFromPositionSaver_OherSubDocument;
        var RestartFromPositionSaver_MainSubDocumentFromPage = (function (_super) {
            __extends(RestartFromPositionSaver_MainSubDocumentFromPage, _super);
            function RestartFromPositionSaver_MainSubDocumentFromPage(manager, pageIndex) {
                var _this = _super.call(this, manager) || this;
                _this.pageIndex = pageIndex;
                return _this;
            }
            RestartFromPositionSaver_MainSubDocumentFromPage.prototype.restartOtherSubDocument = function (_subDocument, pageIndex) {
                return this.getNextState(pageIndex);
            };
            RestartFromPositionSaver_MainSubDocumentFromPage.prototype.restartMainSubDocumentFromPage = function (pageIndex) {
                return this.getNextState(pageIndex);
            };
            RestartFromPositionSaver_MainSubDocumentFromPage.prototype.restartMainSubDocumentFromRow = function (layoutPosition, modelPosition) {
                return layoutPosition.pageIndex < this.pageIndex ?
                    new RestartFromPositionSaver_MainSubDocumentFromRow(this.manager, layoutPosition, modelPosition) :
                    this.getNextState(layoutPosition.pageIndex);
            };
            RestartFromPositionSaver_MainSubDocumentFromPage.prototype.restart = function () {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.PositionSaver, "restart(from page)", "pageIndex: " + this.pageIndex);
                this.restartPreparer.restartFromPage(this.pageIndex, true, true);
            };
            RestartFromPositionSaver_MainSubDocumentFromPage.prototype.getNextState = function (pageIndex) {
                this.pageIndex = Math.min(pageIndex, this.pageIndex);
                return this;
            };
            return RestartFromPositionSaver_MainSubDocumentFromPage;
        }(RestartFromPositionSaver_Base));
        LayoutFormatter.RestartFromPositionSaver_MainSubDocumentFromPage = RestartFromPositionSaver_MainSubDocumentFromPage;
        var RestartFromPositionSaver_AllLayout = (function (_super) {
            __extends(RestartFromPositionSaver_AllLayout, _super);
            function RestartFromPositionSaver_AllLayout() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            RestartFromPositionSaver_AllLayout.prototype.restartOtherSubDocument = function (_subDocument, _pageIndex) {
                return this;
            };
            RestartFromPositionSaver_AllLayout.prototype.restartMainSubDocumentFromPage = function (_pageIndex) {
                return this;
            };
            RestartFromPositionSaver_AllLayout.prototype.restartMainSubDocumentFromRow = function (_layoutPosition, _modelPosition) {
                return this;
            };
            RestartFromPositionSaver_AllLayout.prototype.restart = function () {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.PositionSaver, "restart(all layout)", "");
                this.restartPreparer.restartFormatingAllLayout();
            };
            return RestartFromPositionSaver_AllLayout;
        }(RestartFromPositionSaver_Base));
        LayoutFormatter.RestartFromPositionSaver_AllLayout = RestartFromPositionSaver_AllLayout;
        var RestartFromPositionSaver_MainSubDocumentFromRow = (function (_super) {
            __extends(RestartFromPositionSaver_MainSubDocumentFromRow, _super);
            function RestartFromPositionSaver_MainSubDocumentFromRow(manager, layoutPosition, modelPosition) {
                var _this = _super.call(this, manager) || this;
                _this.layoutPosition = layoutPosition;
                _this.modelPosition = modelPosition;
                return _this;
            }
            RestartFromPositionSaver_MainSubDocumentFromRow.prototype.restartOtherSubDocument = function (_subDocument, pageIndex) {
                return this.getNextState(pageIndex);
            };
            RestartFromPositionSaver_MainSubDocumentFromRow.prototype.restartMainSubDocumentFromRow = function (layoutPosition, modelPosition) {
                if (layoutPosition.pageIndex <= this.layoutPosition.pageIndex && RestartFromPositionSaver_Base.isNeedRestartFromPage(layoutPosition))
                    return new RestartFromPositionSaver_MainSubDocumentFromPage(this.manager, layoutPosition.pageIndex);
                if (modelPosition <= this.modelPosition) {
                    this.modelPosition = modelPosition;
                    this.layoutPosition = layoutPosition;
                }
                return this;
            };
            RestartFromPositionSaver_MainSubDocumentFromRow.prototype.restartMainSubDocumentFromPage = function (pageIndex) {
                return this.getNextState(pageIndex);
            };
            RestartFromPositionSaver_MainSubDocumentFromRow.prototype.restart = function () {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.PositionSaver, "restart(from row)", "modelPosition: " + this.modelPosition + ", LP:" + __aspxRichEdit.LogObjToStr.layoutPositionShort(this.layoutPosition));
                this.restartPreparer.restartFromRow(this.layoutPosition, this.modelPosition, false);
            };
            RestartFromPositionSaver_MainSubDocumentFromRow.prototype.getNextState = function (pageIndex) {
                if (pageIndex <= this.layoutPosition.pageIndex)
                    return new RestartFromPositionSaver_MainSubDocumentFromPage(this.manager, pageIndex);
                return this;
            };
            return RestartFromPositionSaver_MainSubDocumentFromRow;
        }(RestartFromPositionSaver_Base));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var RemoveContentHelper = (function () {
            function RemoveContentHelper() {
            }
            RemoveContentHelper.deleteInterval = function (layout, layoutPos, deletedInterval, pageChanges) {
                RemoveContentHelper.deleteElementContent(0, [
                    new RemoveLayoutContent(__aspxRichEdit.FixedInterval.fromPositions(0, deletedInterval.end), pageChanges),
                    new RemovePageContent(layoutPos, layout.pages),
                    new RemovePageAreaContent(layoutPos),
                    new RemoveColumnContent(layoutPos),
                    new RemoveRowContent(layoutPos)
                ], deletedInterval);
            };
            RemoveContentHelper.deleteElementContent = function (level, levelsInfo, deletedInterval) {
                var currLevelInfo = levelsInfo[level];
                currLevelInfo.contentDeleted = false;
                var elementInterval = currLevelInfo.getElementInterval();
                var elementStartPos = elementInterval.start;
                var intersection = __aspxRichEdit.IntervalAlgorithms.getIntersection(elementInterval, deletedInterval);
                var correctOffsets = false;
                if (intersection && intersection.length > 0) {
                    if (elementInterval.length == intersection.length && level > 0) {
                        levelsInfo[level - 1].addChange(levelsInfo[level].deleteElement());
                        return true;
                    }
                    if (level + 1 == levelsInfo.length) {
                        var newRowLength = elementInterval.length - intersection.length;
                        var fakeBox = new __aspxRichEdit.LayoutTextBox(null, null, __aspxRichEdit.StringUtils.mergeStringNTimes(" ", newRowLength));
                        fakeBox.rowOffset = 0;
                        var row = currLevelInfo.getElement();
                        row.boxes = [fakeBox];
                        currLevelInfo.contentDeleted = true;
                    }
                    else {
                        var lowerLevelDeletedInterval = new __aspxRichEdit.FixedInterval(intersection.start - elementStartPos, intersection.length);
                        var nextLevelInfo = levelsInfo[level + 1];
                        if (level > 0)
                            currLevelInfo.assignChanges(levelsInfo[level - 1]);
                        while (nextLevelInfo.setElement()) {
                            if (!this.deleteElementContent(level + 1, levelsInfo, lowerLevelDeletedInterval))
                                nextLevelInfo.incElementIndex();
                            if (nextLevelInfo.contentDeleted) {
                                if (level == 1)
                                    currLevelInfo.layoutPosition.page.isValid = false;
                                currLevelInfo.contentDeleted = true;
                            }
                        }
                        correctOffsets = true;
                    }
                }
                if (intersection) {
                    if (elementStartPos == intersection.start)
                        currLevelInfo.setElementOffset(deletedInterval.start);
                }
                else {
                    if (elementStartPos >= deletedInterval.end)
                        currLevelInfo.setElementOffset(Math.max(0, elementStartPos - deletedInterval.length));
                }
                if (correctOffsets)
                    currLevelInfo.correctOffsets();
                if (level == 1) {
                    var change = currLevelInfo.updatePage(!!intersection);
                    if (change) {
                        levelsInfo[0].addChange(change);
                        return true;
                    }
                }
                return false;
            };
            return RemoveContentHelper;
        }());
        LayoutFormatter.RemoveContentHelper = RemoveContentHelper;
        var RemoveExistanceContent = (function () {
            function RemoveExistanceContent() {
            }
            return RemoveExistanceContent;
        }());
        var RemoveLayoutContent = (function (_super) {
            __extends(RemoveLayoutContent, _super);
            function RemoveLayoutContent(delInterval, pageChanges) {
                var _this = _super.call(this) || this;
                _this.delInterval = delInterval;
                _this.pageChanges = pageChanges;
                return _this;
            }
            RemoveLayoutContent.prototype.setElement = function () {
                return null;
            };
            RemoveLayoutContent.prototype.incElementIndex = function () {
            };
            RemoveLayoutContent.prototype.getElementInterval = function () {
                return this.delInterval;
            };
            RemoveLayoutContent.prototype.setElementOffset = function (_newOffset) {
            };
            RemoveLayoutContent.prototype.deleteElement = function () {
                return null;
            };
            RemoveLayoutContent.prototype.correctOffsets = function () {
            };
            RemoveLayoutContent.prototype.addChange = function (change) {
                this.pageChanges.push(change);
            };
            RemoveLayoutContent.prototype.assignChanges = function (_topLevel) {
            };
            return RemoveLayoutContent;
        }(RemoveExistanceContent));
        var RemovePageContent = (function (_super) {
            __extends(RemovePageContent, _super);
            function RemovePageContent(layoutPosition, pages) {
                var _this = _super.call(this) || this;
                _this.layoutPosition = layoutPosition;
                _this.pages = pages;
                return _this;
            }
            RemovePageContent.prototype.updatePage = function (isMarkPageIntervalsAsIncorrect) {
                var page = this.layoutPosition.page;
                if (isMarkPageIntervalsAsIncorrect)
                    page.markPageIntervalsAsIncorrect();
                var pageIndex = this.layoutPosition.pageIndex;
                var prevPage = this.pages[pageIndex - 1];
                if (prevPage && page.getPosition() <= prevPage.getPosition()) {
                    page.index = pageIndex - 1;
                    page.y = page.index > 0 ? this.pages[page.index - 1].getBottomBoundPosition() : 0;
                    return this.deleteElement(page.index);
                }
                page.index = pageIndex;
                page.y = prevPage ? prevPage.getBottomBoundPosition() : 0;
                return null;
            };
            RemovePageContent.prototype.checkTableExceptionCase = function () {
                var pageIndex = this.layoutPosition.pageIndex;
                return pageIndex - 1 >= 0 && this.pages[pageIndex].getPosition() <= this.pages[pageIndex - 1].getPosition() ? this.deleteElement(pageIndex - 1) : null;
            };
            RemovePageContent.prototype.setElement = function () {
                return !!(this.layoutPosition.page = this.pages[this.layoutPosition.pageIndex]);
            };
            RemovePageContent.prototype.incElementIndex = function () {
                this.layoutPosition.pageIndex++;
            };
            RemovePageContent.prototype.getElementInterval = function () {
                var elem = this.layoutPosition.page;
                return __aspxRichEdit.FixedInterval.fromPositions(elem.getPosition(), elem.getEndPosition());
            };
            RemovePageContent.prototype.setElementOffset = function (newOffset) {
                this.layoutPosition.page.setPosition(newOffset);
            };
            RemovePageContent.prototype.deleteElement = function (index) {
                if (index === void 0) { index = this.layoutPosition.pageIndex; }
                this.pages.splice(index, 1);
                return new __aspxRichEdit.PageChange(index, __aspxRichEdit.LayoutChangeType.Deleted, [], []);
            };
            RemovePageContent.prototype.correctOffsets = function () {
                RemovePageContent.correctPageOffsets(this.layoutPosition.page);
            };
            RemovePageContent.prototype.addChange = function (change) {
                this.pageAreaChanges.push(change);
            };
            RemovePageContent.prototype.assignChanges = function (topLevel) {
                this.pageAreaChanges = [];
                topLevel.pageChanges.push(new __aspxRichEdit.PageChange(this.layoutPosition.pageIndex, __aspxRichEdit.LayoutChangeType.Updated, this.pageAreaChanges, []));
            };
            RemovePageContent.correctPageOffsets = function (page) {
                var pageAreas = page.mainSubDocumentPageAreas;
                if (!pageAreas.length)
                    return;
                var offsetFirstPageAreaFromPage = pageAreas[0].pageOffset;
                if (offsetFirstPageAreaFromPage > 0) {
                    page.setPosition(page.getPosition() + offsetFirstPageAreaFromPage);
                    for (var _i = 0, pageAreas_3 = pageAreas; _i < pageAreas_3.length; _i++) {
                        var pageArea = pageAreas_3[_i];
                        pageArea.pageOffset -= offsetFirstPageAreaFromPage;
                    }
                }
            };
            return RemovePageContent;
        }(RemoveExistanceContent));
        var RemovePageAreaContent = (function (_super) {
            __extends(RemovePageAreaContent, _super);
            function RemovePageAreaContent(layoutPosition) {
                var _this = _super.call(this) || this;
                _this.layoutPosition = layoutPosition;
                return _this;
            }
            RemovePageAreaContent.prototype.setElement = function () {
                if (this.layoutPosition.pageArea = this.layoutPosition.page.mainSubDocumentPageAreas[this.layoutPosition.pageAreaIndex])
                    return true;
                else {
                    this.layoutPosition.pageAreaIndex = 0;
                    return false;
                }
            };
            RemovePageAreaContent.prototype.incElementIndex = function () {
                this.layoutPosition.pageAreaIndex++;
            };
            RemovePageAreaContent.prototype.getElementInterval = function () {
                var elem = this.layoutPosition.pageArea;
                return __aspxRichEdit.FixedInterval.fromPositions(elem.pageOffset, elem.getEndPosition());
            };
            RemovePageAreaContent.prototype.setElementOffset = function (newOffset) {
                this.layoutPosition.pageArea.pageOffset = newOffset;
            };
            RemovePageAreaContent.prototype.deleteElement = function () {
                var index = this.layoutPosition.pageAreaIndex;
                this.layoutPosition.page.mainSubDocumentPageAreas.splice(index, 1);
                return new __aspxRichEdit.PageAreaChange(index, __aspxRichEdit.LayoutChangeType.Deleted, []);
            };
            RemovePageAreaContent.prototype.correctOffsets = function () {
                RemovePageAreaContent.correctColumnOffsets(this.layoutPosition.pageArea);
            };
            RemovePageAreaContent.prototype.addChange = function (change) {
                this.columnChanges.push(change);
            };
            RemovePageAreaContent.prototype.assignChanges = function (topLevel) {
                this.columnChanges = [];
                topLevel.pageAreaChanges.push(new __aspxRichEdit.PageAreaChange(this.layoutPosition.pageAreaIndex, __aspxRichEdit.LayoutChangeType.Updated, this.columnChanges));
            };
            RemovePageAreaContent.correctColumnOffsets = function (pageArea) {
                var columns = pageArea.columns;
                if (!columns.length)
                    return;
                var offsetFirstColumnFromPageArea = columns[0].pageAreaOffset;
                if (offsetFirstColumnFromPageArea > 0) {
                    pageArea.pageOffset += offsetFirstColumnFromPageArea;
                    for (var _i = 0, columns_2 = columns; _i < columns_2.length; _i++) {
                        var column = columns_2[_i];
                        column.pageAreaOffset -= offsetFirstColumnFromPageArea;
                    }
                }
            };
            return RemovePageAreaContent;
        }(RemoveExistanceContent));
        var RemoveColumnContent = (function (_super) {
            __extends(RemoveColumnContent, _super);
            function RemoveColumnContent(layoutPosition) {
                var _this = _super.call(this) || this;
                _this.layoutPosition = layoutPosition;
                return _this;
            }
            RemoveColumnContent.prototype.setElement = function () {
                if (this.layoutPosition.column = this.layoutPosition.pageArea.columns[this.layoutPosition.columnIndex])
                    return true;
                else {
                    this.layoutPosition.columnIndex = 0;
                    return false;
                }
            };
            RemoveColumnContent.prototype.incElementIndex = function () {
                this.layoutPosition.columnIndex++;
            };
            RemoveColumnContent.prototype.getElementInterval = function () {
                var elem = this.layoutPosition.column;
                return __aspxRichEdit.FixedInterval.fromPositions(elem.pageAreaOffset, elem.getEndPosition());
            };
            RemoveColumnContent.prototype.setElementOffset = function (newOffset) {
                this.layoutPosition.column.pageAreaOffset = newOffset;
            };
            RemoveColumnContent.prototype.deleteElement = function () {
                var index = this.layoutPosition.columnIndex;
                this.layoutPosition.pageArea.columns.splice(index, 1);
                return new __aspxRichEdit.ColumnChange(index, __aspxRichEdit.LayoutChangeType.Deleted, [], [], []);
            };
            RemoveColumnContent.prototype.correctOffsets = function () {
                RemoveColumnContent.correctRowOffsets(this.layoutPosition.column);
            };
            RemoveColumnContent.prototype.addChange = function (change) {
                this.rowChanges.push(change);
            };
            RemoveColumnContent.prototype.assignChanges = function (topLevel) {
                this.rowChanges = [];
                topLevel.columnChanges.push(new __aspxRichEdit.ColumnChange(this.layoutPosition.columnIndex, __aspxRichEdit.LayoutChangeType.Updated, this.rowChanges, [], []));
            };
            RemoveColumnContent.correctRowOffsets = function (column) {
                var rows = column.rows;
                if (!rows.length)
                    return;
                var offsetFirstRowFromColumn = rows[0].columnOffset;
                if (offsetFirstRowFromColumn > 0) {
                    column.pageAreaOffset += offsetFirstRowFromColumn;
                    for (var _i = 0, rows_2 = rows; _i < rows_2.length; _i++) {
                        var row = rows_2[_i];
                        row.columnOffset -= offsetFirstRowFromColumn;
                    }
                }
            };
            return RemoveColumnContent;
        }(RemoveExistanceContent));
        var RemoveRowContent = (function (_super) {
            __extends(RemoveRowContent, _super);
            function RemoveRowContent(layoutPosition) {
                var _this = _super.call(this) || this;
                _this.layoutPosition = layoutPosition;
                return _this;
            }
            RemoveRowContent.prototype.getElement = function () {
                return this.layoutPosition.row;
            };
            RemoveRowContent.prototype.getElementParentContainer = function () {
                return this.layoutPosition.column.rows;
            };
            RemoveRowContent.prototype.setElement = function () {
                if (this.layoutPosition.row = this.layoutPosition.column.rows[this.layoutPosition.rowIndex])
                    return true;
                else {
                    this.layoutPosition.rowIndex = 0;
                    return false;
                }
            };
            RemoveRowContent.prototype.incElementIndex = function () {
                this.layoutPosition.rowIndex++;
            };
            RemoveRowContent.prototype.getElementInterval = function () {
                var elem = this.layoutPosition.row;
                return __aspxRichEdit.FixedInterval.fromPositions(elem.columnOffset, elem.getEndPosition());
            };
            RemoveRowContent.prototype.setElementOffset = function (newOffset) {
                if (newOffset < 0)
                    throw new Error(__aspxRichEdit.Errors.InternalException);
                this.layoutPosition.row.columnOffset = newOffset;
            };
            RemoveRowContent.prototype.deleteElement = function () {
                var index = this.layoutPosition.rowIndex;
                this.getElementParentContainer().splice(index, 1);
                return new __aspxRichEdit.RowChange(index, __aspxRichEdit.LayoutChangeType.Deleted);
            };
            RemoveRowContent.prototype.correctOffsets = function () {
            };
            RemoveRowContent.prototype.addChange = function (_change) {
            };
            RemoveRowContent.prototype.assignChanges = function (_topLevel) {
            };
            return RemoveRowContent;
        }(RemoveExistanceContent));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var RestartManager = (function () {
            function RestartManager(manager) {
                this.manager = manager;
                this.reset();
            }
            RestartManager.prototype.reset = function () {
                this.layoutFormatterPositionSaver = new LayoutFormatter.RestartFromPositionSaver_Base(this.manager);
            };
            RestartManager.prototype.startFormatting = function () {
                this.layoutFormatterPositionSaver.restart();
                this.reset();
            };
            RestartManager.prototype.restartFromPage = function (pageIndex, minPosition, forceRestartFullPage) {
                var _this = this;
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.RestartManager, "restartFromPage", "pageIndex:" + pageIndex + ", minPosition:" + minPosition + ", forceRestartFullPage:" + forceRestartFullPage);
                var pos = this.manager.invalidator.extendByMultipageTables(pageIndex, minPosition, forceRestartFullPage);
                if (pos == -1) {
                    this.restartTemplate(pageIndex, function () { return _this.layoutFormatterPositionSaver.restartMainSubDocumentFromPage(pageIndex); });
                }
                else {
                    var lp = this.manager.invalidator.findLayoutPositionInAllLayout(this.manager.model.mainSubDocument, pos, __aspxRichEdit.DocumentLayoutDetailsLevel.Row, false, true);
                    if (lp.posIsStartPage() && lp.pageIndex != 0) {
                        lp.advanceToPrevRow(this.manager.layout);
                        lp.rowIndex++;
                        lp.row = null;
                    }
                    __aspxRichEdit.ListUtils.foreach(this.manager.layout.pages, function (page) { return page.invalidate(); }, lp.pageIndex, pageIndex);
                    this.restartFromRow(lp, this.manager.invalidator.getStartModelPositionOfRow(lp));
                }
            };
            RestartManager.prototype.restartFromRow = function (lp, modelPosition) {
                var _this = this;
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.RestartManager, "restartFromRow", "modelPosition:" + modelPosition + ", lp:" + __aspxRichEdit.LogObjToStr.layoutPositionShort(lp));
                this.restartTemplate(lp.pageIndex, function () { return _this.layoutFormatterPositionSaver.restartMainSubDocumentFromRow(lp, modelPosition); });
            };
            RestartManager.prototype.restartHeaderFooter = function (subDocument, pageIndex) {
                var _this = this;
                this.restartTemplate(pageIndex, function () { return _this.layoutFormatterPositionSaver.restartOtherSubDocument(subDocument, pageIndex); });
            };
            RestartManager.prototype.restartAllLayout = function () {
                var _this = this;
                this.restartTemplate(0, function () { return new LayoutFormatter.RestartFromPositionSaver_AllLayout(_this.manager); });
            };
            RestartManager.prototype.restartTemplate = function (pageIndex, getNewRestartSaver) {
                if (this.manager.layout) {
                    this.manager.layout.isFullyFormatted = false;
                    this.manager.layout.validPageCount = Math.min(this.manager.layout.validPageCount, pageIndex);
                }
                this.layoutFormatterPositionSaver = getNewRestartSaver();
                if (!this.manager.isUpdateLocked())
                    this.manager.onUpdateUnlocked(0);
            };
            return RestartManager;
        }());
        LayoutFormatter.RestartManager = RestartManager;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Row;
        (function (Row) {
            var TextRowFormatterState;
            (function (TextRowFormatterState) {
                TextRowFormatterState[TextRowFormatterState["None"] = 0] = "None";
                TextRowFormatterState[TextRowFormatterState["Base"] = 1] = "Base";
                TextRowFormatterState[TextRowFormatterState["EndedWithPageBreak"] = 2] = "EndedWithPageBreak";
                TextRowFormatterState[TextRowFormatterState["EndedWithParagraphMark"] = 3] = "EndedWithParagraphMark";
            })(TextRowFormatterState = Row.TextRowFormatterState || (Row.TextRowFormatterState = {}));
            var RowFormatter = (function () {
                function RowFormatter(formatterManager, subDocumentId) {
                    this.rowFormatting = true;
                    this.manager = formatterManager;
                    this.iterator = new Row.Box.BoxIterator(this.manager, subDocumentId);
                    this.numberingListCountersManager = new __aspxRichEdit.SubDocumentNumberingListCountersManager(this.subDocument);
                    this.stateMap = {};
                    this.stateMap[TextRowFormatterState.Base] = new Row.RowBaseFormatterState(this);
                    this.stateMap[TextRowFormatterState.EndedWithPageBreak] = new Row.RowEndedWithPageBreakState(this);
                    this.stateMap[TextRowFormatterState.EndedWithParagraphMark] = new Row.RowEndedWithParagraphMarkFormatterState(this);
                    if (RowFormatter.addBoxFunctionMap)
                        return;
                    RowFormatter.addBoxFunctionMap = {};
                    RowFormatter.addBoxFunctionMap[__aspxRichEdit.LayoutBoxType.Space] = function () { this.currentState.addSpaceBox(); };
                    RowFormatter.addBoxFunctionMap[__aspxRichEdit.LayoutBoxType.NonBreakingSpace] = function () { this.currentState.addTextBox(); };
                    RowFormatter.addBoxFunctionMap[__aspxRichEdit.LayoutBoxType.Dash] = function () { this.currentState.addPictureBox(); };
                    RowFormatter.addBoxFunctionMap[__aspxRichEdit.LayoutBoxType.Text] = function () { this.currentState.addTextBox(); };
                    RowFormatter.addBoxFunctionMap[__aspxRichEdit.LayoutBoxType.Picture] = function () { this.currentState.addPictureBox(); };
                    RowFormatter.addBoxFunctionMap[__aspxRichEdit.LayoutBoxType.ParagraphMark] = function () { this.currentState.addParagraphBox(); };
                    RowFormatter.addBoxFunctionMap[__aspxRichEdit.LayoutBoxType.LineBreak] = function () { this.currentState.addLineBreakBox(); };
                    RowFormatter.addBoxFunctionMap[__aspxRichEdit.LayoutBoxType.SectionMark] = function () { this.currentState.addSectionBox(); };
                    RowFormatter.addBoxFunctionMap[__aspxRichEdit.LayoutBoxType.PageBreak] = function () { this.currentState.addPageBreakBox(); };
                    RowFormatter.addBoxFunctionMap[__aspxRichEdit.LayoutBoxType.ColumnBreak] = function () { this.currentState.addColumnBreakBox(); };
                    RowFormatter.addBoxFunctionMap[__aspxRichEdit.LayoutBoxType.TabSpace] = function () { this.currentState.addTabulationBox(); };
                    RowFormatter.addBoxFunctionMap[__aspxRichEdit.LayoutBoxType.FieldCodeStart] = function () { this.currentState.addTextBox(); };
                    RowFormatter.addBoxFunctionMap[__aspxRichEdit.LayoutBoxType.FieldCodeEnd] = function () { this.currentState.addTextBox(); };
                    RowFormatter.addBoxFunctionMap[__aspxRichEdit.LayoutBoxType.LayoutDependent] = function () { this.currentState.addTextBox(); };
                    RowFormatter.addBoxFunctionMap[__aspxRichEdit.LayoutBoxType.AnchorTextBox] = function () { this.currentState.addAnchorObject(); };
                    RowFormatter.addBoxFunctionMap[__aspxRichEdit.LayoutBoxType.AnchorPicture] = function () { this.currentState.addAnchorObject(); };
                }
                Object.defineProperty(RowFormatter.prototype, "subDocument", {
                    get: function () { return this.iterator.subDocument; },
                    enumerable: true,
                    configurable: true
                });
                ;
                Object.defineProperty(RowFormatter.prototype, "row", {
                    get: function () { return this.result.row; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(RowFormatter.prototype, "paragraph", {
                    get: function () { return this.subDocument.paragraphs[this.result.paragraphIndex]; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(RowFormatter.prototype, "paragraphProps", {
                    get: function () { return this.paragraph.getParagraphMergedProperies(); },
                    enumerable: true,
                    configurable: true
                });
                RowFormatter.prototype.getNextBoxWrapInfo = function () { return this.iterator.getWrap(false); };
                RowFormatter.prototype.setPosition = function (position, forceResetBoxInfos, checkStartTable) { this.iterator.setPosition(position, forceResetBoxInfos, checkStartTable); };
                RowFormatter.prototype.getPosition = function () { return this.iterator.getPosition(); };
                RowFormatter.prototype.documentStart = function () { this.iterator.documentStart(); };
                RowFormatter.prototype.formatRow = function (minY, paragraphHorizontalBounds, rowSpacingBeforeApplier) {
                    this.paragraphHorizontalBounds = paragraphHorizontalBounds;
                    this.initResult();
                    __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.RowFormatter, "formatRow", "paragraphHorizontalBounds: " + __aspxRichEdit.LogObjToStr.fixedInterval(paragraphHorizontalBounds) + ", firstBoxOffset: " + this.currBox.rowOffset);
                    var prevRow = this.manager.activeFormatter.lastRowInfo.row;
                    var isFirstRowInParagraph = !prevRow || prevRow.flags.get(__aspxRichEdit.LayoutRowStateFlags.ParagraphEnd) ||
                        this.manager.activeFormatter.lastRowInfo.paragraphIndex != this.currWrapInfo.paragraphIndex;
                    var rowParagraphLeftIndent = isFirstRowInParagraph ?
                        __aspxRichEdit.UnitConverter.twipsToPixels(this.paragraphProps.getLeftIndentForFirstRow()) :
                        __aspxRichEdit.UnitConverter.twipsToPixels(this.paragraphProps.getLeftIndentForOtherRow());
                    var rowContentHorizontalBounds = __aspxRichEdit.FixedInterval.fromPositions(paragraphHorizontalBounds.start + rowParagraphLeftIndent, paragraphHorizontalBounds.end - __aspxRichEdit.UnitConverter.twipsToPixels(this.paragraphProps.rightIndent));
                    this.row.x = rowContentHorizontalBounds.start;
                    this.row.width = rowContentHorizontalBounds.length;
                    this.rowSizesManager = new Row.RowSizesManager(this, rowContentHorizontalBounds, minY, rowSpacingBeforeApplier, this.manager.activeFormatter.layoutRowBoundsCalculator.getRectangleBounds(this.manager), isFirstRowInParagraph);
                    this.tabInfo = new Row.RowTabInfo(this, paragraphHorizontalBounds.start);
                    this.wordHolder = new Row.WordHolderInfo(this);
                    this.rowFormatting = true;
                    var cycleCounter = 0;
                    while (this.rowFormatting) {
                        this.setState(TextRowFormatterState.Base);
                        this.innerFormatRow();
                        if (++cycleCounter > 10000)
                            throw new Error(__aspxRichEdit.Errors.InternalException);
                    }
                };
                RowFormatter.prototype.innerFormatRow = function () {
                    while (this.rowFormatting && this.currBox) {
                        var oldWrapTablPos = this.currWrapInfo.tablePosition;
                        RowFormatter.addBoxFunctionMap[this.currBox.getType()].call(this);
                        if (this.currWrapInfo) {
                            if (!oldWrapTablPos && this.currWrapInfo.tablePosition) {
                                this.finishRow();
                                break;
                            }
                            if (oldWrapTablPos && (!this.currWrapInfo.tablePosition || !this.currWrapInfo.equalsTablePositions(oldWrapTablPos))) {
                                this.row.flags.set(__aspxRichEdit.LayoutRowStateFlags.CellTableEnd, true);
                                this.finishRow();
                                break;
                            }
                        }
                        else {
                            if (oldWrapTablPos)
                                this.row.flags.set(__aspxRichEdit.LayoutRowStateFlags.CellTableEnd, true);
                        }
                    }
                    if (!this.currBox) {
                        if (!this.iterator.allBoxesGiven()) {
                            this.iterator.setPosition(this.startPos, false, false);
                            this.result.flags.set(Row.RowFormatterResultFlag.NotEnoughChunks, true);
                            this.rowFormatting = false;
                            return;
                        }
                        this.row.flags.set(__aspxRichEdit.LayoutRowStateFlags.DocumentEnd, true);
                    }
                    this.rowFormatting = !this.rowSizesManager.finishRow();
                };
                RowFormatter.prototype.finishRow = function () {
                    if (!this.result.row.boxes.length && !this.result.newAnchoredObjects.length)
                        throw new Error(__aspxRichEdit.Errors.InternalException);
                    this.rowFormatting = false;
                };
                RowFormatter.prototype.setState = function (state) {
                    this.currentState = this.stateMap[state];
                };
                RowFormatter.prototype.addAnchorObject = function () {
                    var ancBox = this.currBox;
                    this.setBoxInfo(true);
                    if (this.manager.activeFormatter.layoutPosition.page.anchoredObjectHolder.isObjectExist(ancBox))
                        return;
                    if (ancBox.getType() == __aspxRichEdit.LayoutBoxType.AnchorTextBox) {
                        var calculator = this.manager.anchoredObjectsManager.textBoxContextSizeCalculators[ancBox.objectId];
                        calculator.calculateSize(this.manager.boundsCalculator);
                        ancBox.setSize(calculator.layouSize);
                    }
                    this.result.newAnchoredObjects.push(ancBox);
                };
                RowFormatter.prototype.initResult = function () {
                    this.result = new Row.RowFormatterResult(this);
                    this.setBoxInfo(false);
                    if (this.currBox)
                        this.startPos = this.currBox.rowOffset;
                    this.result.paragraphIndex = this.currWrapInfo.paragraphIndex;
                    this.result.sectionIndex = this.currWrapInfo.sectionIndex;
                };
                RowFormatter.prototype.setBoxInfo = function (getNextWrap) {
                    var wrap = this.iterator.getWrap(getNextWrap);
                    if (!wrap) {
                        this.currBox = null;
                        this.currWrapInfo = null;
                        return;
                    }
                    this.currBox = wrap.box.getType() == __aspxRichEdit.LayoutBoxType.TabSpace ? wrap.box : wrap.box.clone();
                    this.currWrapInfo = wrap.info;
                    if (this.currBox.getType() == __aspxRichEdit.LayoutBoxType.LayoutDependent) {
                        this.currBox.calculateText(this.manager);
                        __aspxRichEdit.LayoutBox.initializeWithMeasurer([new Row.Box.BoxWrap(this.currBox, null)], this.manager.measurer, false);
                    }
                };
                return RowFormatter;
            }());
            Row.RowFormatter = RowFormatter;
        })(Row = LayoutFormatter.Row || (LayoutFormatter.Row = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Row;
        (function (Row) {
            var RowFormatterResultFlag;
            (function (RowFormatterResultFlag) {
                RowFormatterResultFlag[RowFormatterResultFlag["None"] = 0] = "None";
                RowFormatterResultFlag[RowFormatterResultFlag["NotEnoughChunks"] = 1] = "NotEnoughChunks";
            })(RowFormatterResultFlag = Row.RowFormatterResultFlag || (Row.RowFormatterResultFlag = {}));
            var BoxBracketsType;
            (function (BoxBracketsType) {
                BoxBracketsType[BoxBracketsType["None"] = 0] = "None";
                BoxBracketsType[BoxBracketsType["Open"] = 1] = "Open";
                BoxBracketsType[BoxBracketsType["Close"] = 2] = "Close";
            })(BoxBracketsType = Row.BoxBracketsType || (Row.BoxBracketsType = {}));
            var RowFormatterResult = (function () {
                function RowFormatterResult(rowFormatter) {
                    this.rowFormatter = rowFormatter;
                    this.newAnchoredObjects = [];
                    this.row = new __aspxRichEdit.LayoutRow();
                    this.startRowFormatting();
                }
                Object.defineProperty(RowFormatterResult.prototype, "rowStartPos", {
                    get: function () {
                        return this.rowFormatter.rowSizesManager.rowStartPos;
                    },
                    enumerable: true,
                    configurable: true
                });
                RowFormatterResult.prototype.startRowFormatting = function () {
                    this.flags = new __aspxRichEdit.Flag(RowFormatterResultFlag.None);
                    this.row.boxes = [];
                    this.rowBoxIndexStart = 0;
                    this.newAnchoredObjects = [];
                };
                RowFormatterResult.prototype.finishLogicalRow = function (currLogicRowEndPos) {
                    if (this.rowBoxIndexStart == this.row.boxes.length)
                        return;
                    this.rowFormatter.tabInfo.shiftBoxesAfterLastTab();
                    var dontJustifyLinesEndingInSoftLineBreak = this.rowFormatter.manager.model.compatibilitySettings.dontJustifyLinesEndingInSoftLineBreak;
                    Row.BoxAligner.align(this.row, this.rowFormatter.paragraphProps.alignment, currLogicRowEndPos, this.rowBoxIndexStart, dontJustifyLinesEndingInSoftLineBreak);
                    this.rowBoxIndexStart = this.row.boxes.length;
                };
                RowFormatterResult.prototype.deleteSomeAnchorObjects = function (index, posToRestart) {
                    this.newAnchoredObjects.splice(index);
                    this.rowFormatter.iterator.setPosition(posToRestart, false, false);
                };
                RowFormatterResult.prototype.finishRow = function () {
                    this.finishLogicalRow(this.rowFormatter.rowSizesManager.rowFormattingInfo.lastNonEmptyInterval.end);
                    var lastBoxOffset = __aspxRichEdit.ListUtils.last(this.row.boxes).rowOffset;
                    for (var ind = 0, anc = void 0; anc = this.newAnchoredObjects[ind]; ind++) {
                        if (anc.rowOffset > lastBoxOffset) {
                            this.deleteSomeAnchorObjects(ind, anc.rowOffset);
                            break;
                        }
                        if (anc.levelType == __aspxRichEdit.AnchoredObjectLevelType.InText) {
                            this.deleteSomeAnchorObjects(ind + 1, anc.rowOffset + 1);
                            break;
                        }
                    }
                    var paragraphs = this.rowFormatter.subDocument.paragraphs;
                    this.row.applySpacingAfter(this.row.flags.get(__aspxRichEdit.LayoutRowStateFlags.ParagraphEnd) ?
                        __aspxRichEdit.LayoutRow.getParagraphSpacingAfter(paragraphs[this.paragraphIndex], paragraphs[this.paragraphIndex + 1]) :
                        0);
                    var rowStartPos = this.rowFormatter.rowSizesManager.rowStartPos;
                    for (var _i = 0, _a = this.row.boxes; _i < _a.length; _i++) {
                        var box = _a[_i];
                        box.x -= this.row.x;
                        box.rowOffset -= rowStartPos;
                    }
                    var rowLength = this.row.boxes.length ? __aspxRichEdit.ListUtils.last(this.row.boxes).getEndPosition() : 0;
                    this.addBrackets(rowStartPos, rowLength);
                    if (this.row.numberingListBox) {
                        this.row.numberingListBox.textBox.x -= this.row.x;
                        if (this.row.numberingListBox.separatorBox)
                            this.row.numberingListBox.separatorBox.x -= this.row.x;
                    }
                    this.row.columnOffset = rowStartPos -
                        this.rowFormatter.manager.activeFormatter.layoutPosition.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Column);
                    var pictBox = this.onlyInlinePictureBox();
                    if (pictBox && pictBox.width > this.row.width) {
                        this.row.width = pictBox.width;
                    }
                };
                RowFormatterResult.prototype.onlyInlinePictureBox = function () {
                    var pictBox;
                    for (var ind = this.row.boxes.length - 1; ind >= 0; ind--) {
                        var box = this.row.boxes[ind];
                        if (box.getType() == __aspxRichEdit.LayoutBoxType.Picture) {
                            pictBox = box;
                        }
                        else if (!__aspxRichEdit.EnumUtils.isAnyOf(box.getType(), __aspxRichEdit.LayoutBoxType.ParagraphMark, __aspxRichEdit.LayoutBoxType.SectionMark, __aspxRichEdit.LayoutBoxType.LineBreak, __aspxRichEdit.LayoutBoxType.PageBreak)) {
                            return null;
                        }
                    }
                    return pictBox;
                };
                RowFormatterResult.prototype.addBracketBox = function (boxType, color, x, layoutBox) {
                    var box = new __aspxRichEdit.BookmarkBox(boxType);
                    box.x = x - (boxType == __aspxRichEdit.LayoutBookmarkBoxType.EndBox ? __aspxRichEdit.BookmarkBox.DEFAULT_BORDER_WIDTH : 0);
                    box.y = this.row.baseLine - layoutBox.getAscent() - this.row.getSpacingBefore();
                    box.width = __aspxRichEdit.BookmarkBox.DEFAULT_WIDTH;
                    box.height = layoutBox.height;
                    box.color = color;
                    this.row.bookmarkBoxes.push(box);
                };
                RowFormatterResult.prototype.addBrackets = function (rowStartPos, rowLength) {
                    var _this = this;
                    if (!this.row.boxes[0])
                        return;
                    var rowEndPos = rowStartPos + rowLength;
                    __aspxRichEdit.ListUtils.foreach(this.rowFormatter.iterator.getBracketInfo(rowStartPos, rowLength), function (info) {
                        var posOfCharInRow = info.absPos - rowStartPos;
                        var box = _this.getBracketBox(posOfCharInRow);
                        var xPos = _this.getBracketXPosition(posOfCharInRow, box);
                        if (info.flags.get(BoxBracketsType.Open) && info.absPos < rowEndPos)
                            _this.addBracketBox(__aspxRichEdit.LayoutBookmarkBoxType.StartBox, info.color, xPos, box);
                        if (info.flags.get(BoxBracketsType.Close) &&
                            (info.length != 0 && info.absPos > rowStartPos || info.length == 0 && info.absPos <= rowStartPos))
                            _this.addBracketBox(__aspxRichEdit.LayoutBookmarkBoxType.EndBox, info.color, xPos + (info.length == 0 ? __aspxRichEdit.BookmarkBox.DEFAULT_BORDER_WIDTH : 0), box);
                    });
                };
                RowFormatterResult.prototype.getBracketBox = function (posOfCharInRow) {
                    var boxes = this.row.boxes;
                    var boxIndex = Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(boxes, function (b) { return b.rowOffset; }, posOfCharInRow));
                    return boxes[boxIndex];
                };
                RowFormatterResult.prototype.getBracketXPosition = function (posOfCharInRow, box) {
                    var charOffset = __aspxRichEdit.Utils.restrictValue(posOfCharInRow - box.rowOffset, 0, box.getLength());
                    return box.x + box.getCharOffsetXInPixels(this.rowFormatter.manager.measurer, charOffset);
                };
                return RowFormatterResult;
            }());
            Row.RowFormatterResult = RowFormatterResult;
        })(Row = LayoutFormatter.Row || (LayoutFormatter.Row = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Row;
        (function (Row) {
            var RowBaseFormatterState = (function () {
                function RowBaseFormatterState(rowFormatter) {
                    this.rowFormatter = rowFormatter;
                }
                RowBaseFormatterState.prototype.addBoxAnyway = function (isFinishRow, nextState) {
                    var _this = this;
                    if (isFinishRow === void 0) { isFinishRow = false; }
                    if (nextState === void 0) { nextState = Row.TextRowFormatterState.None; }
                    var setFlags = [];
                    for (var _i = 2; _i < arguments.length; _i++) {
                        setFlags[_i - 2] = arguments[_i];
                    }
                    if (!this.rowFormatter.wordHolder.pushBoxes())
                        return;
                    if (!this.rowFormatter.rowSizesManager.addNumberingBoxes())
                        return;
                    this.rowFormatter.rowSizesManager.anywayAddBox();
                    if (this.rowFormatter.manager.innerClientProperties.viewsSettings.isSimpleView)
                        setFlags = __aspxRichEdit.ListUtils.reducedMap(setFlags, function (f) {
                            return __aspxRichEdit.EnumUtils.isAnyOf(f, __aspxRichEdit.LayoutRowStateFlags.ColumnEnd, __aspxRichEdit.LayoutRowStateFlags.PageEnd, __aspxRichEdit.LayoutRowStateFlags.SectionEnd) ? null : f;
                        });
                    __aspxRichEdit.ListUtils.foreach(setFlags, function (flag) { return _this.rowFormatter.row.flags.set(flag, true); });
                    if (nextState != Row.TextRowFormatterState.None)
                        this.rowFormatter.setState(nextState);
                    if (isFinishRow)
                        this.rowFormatter.finishRow();
                };
                RowBaseFormatterState.prototype.addAnchorObject = function () {
                    if (!this.rowFormatter.wordHolder.pushBoxes())
                        return;
                    this.rowFormatter.addAnchorObject();
                };
                RowBaseFormatterState.prototype.addTextBox = function () {
                    this.rowFormatter.wordHolder.addBox();
                };
                RowBaseFormatterState.prototype.addPictureBox = function () {
                    if (!this.rowFormatter.wordHolder.pushBoxes())
                        return;
                    if (!this.rowFormatter.rowSizesManager.addNumberingBoxes())
                        return;
                    this.rowFormatter.rowSizesManager.addBox();
                };
                RowBaseFormatterState.prototype.addSpaceBox = function () {
                    this.addBoxAnyway(false, Row.TextRowFormatterState.Base);
                };
                RowBaseFormatterState.prototype.addTabulationBox = function () {
                    if (!this.rowFormatter.wordHolder.pushBoxes())
                        return;
                    if (!this.rowFormatter.rowSizesManager.addNumberingBoxes())
                        return;
                    if (this.rowFormatter.tabInfo.addTabBox())
                        this.rowFormatter.setState(Row.TextRowFormatterState.Base);
                    else
                        this.rowFormatter.finishRow();
                };
                RowBaseFormatterState.prototype.addSectionBox = function () {
                    this.addBoxAnyway(true, Row.TextRowFormatterState.None, __aspxRichEdit.LayoutRowStateFlags.ParagraphEnd, __aspxRichEdit.LayoutRowStateFlags.SectionEnd);
                };
                RowBaseFormatterState.prototype.addLineBreakBox = function () {
                    this.addBoxAnyway(true);
                };
                RowBaseFormatterState.prototype.addPageBreakBox = function () {
                    this.addBoxAnyway(false, Row.TextRowFormatterState.EndedWithPageBreak, __aspxRichEdit.LayoutRowStateFlags.PageEnd);
                };
                RowBaseFormatterState.prototype.addColumnBreakBox = function () {
                    this.addBoxAnyway(true, Row.TextRowFormatterState.None, __aspxRichEdit.LayoutRowStateFlags.ColumnEnd);
                };
                RowBaseFormatterState.prototype.addParagraphBox = function () {
                    this.addBoxAnyway(false, Row.TextRowFormatterState.EndedWithParagraphMark, __aspxRichEdit.LayoutRowStateFlags.ParagraphEnd);
                };
                return RowBaseFormatterState;
            }());
            Row.RowBaseFormatterState = RowBaseFormatterState;
            var RowEndedWithParagraphMarkFormatterState = (function (_super) {
                __extends(RowEndedWithParagraphMarkFormatterState, _super);
                function RowEndedWithParagraphMarkFormatterState(rowFormatter) {
                    return _super.call(this, rowFormatter) || this;
                }
                RowEndedWithParagraphMarkFormatterState.prototype.addAnchorObject = function () {
                    this.rowFormatter.finishRow();
                };
                RowEndedWithParagraphMarkFormatterState.prototype.addTextBox = function () {
                    this.rowFormatter.finishRow();
                };
                RowEndedWithParagraphMarkFormatterState.prototype.addDashBox = function () {
                    this.rowFormatter.finishRow();
                };
                RowEndedWithParagraphMarkFormatterState.prototype.addPictureBox = function () {
                    this.rowFormatter.finishRow();
                };
                RowEndedWithParagraphMarkFormatterState.prototype.addSpaceBox = function () {
                    this.rowFormatter.finishRow();
                };
                RowEndedWithParagraphMarkFormatterState.prototype.addTabulationBox = function () {
                    this.rowFormatter.finishRow();
                };
                RowEndedWithParagraphMarkFormatterState.prototype.addLineBreakBox = function () {
                    this.rowFormatter.finishRow();
                };
                RowEndedWithParagraphMarkFormatterState.prototype.addPageBreakBox = function () {
                    this.rowFormatter.finishRow();
                };
                RowEndedWithParagraphMarkFormatterState.prototype.addColumnBreakBox = function () {
                    this.rowFormatter.finishRow();
                };
                RowEndedWithParagraphMarkFormatterState.prototype.addParagraphBox = function () {
                    this.rowFormatter.finishRow();
                };
                return RowEndedWithParagraphMarkFormatterState;
            }(RowBaseFormatterState));
            Row.RowEndedWithParagraphMarkFormatterState = RowEndedWithParagraphMarkFormatterState;
            var RowEndedWithPageBreakState = (function (_super) {
                __extends(RowEndedWithPageBreakState, _super);
                function RowEndedWithPageBreakState(rowFormatter) {
                    return _super.call(this, rowFormatter) || this;
                }
                RowEndedWithPageBreakState.prototype.addParagraphBox = function () {
                    this.addBoxAnyway(false, Row.TextRowFormatterState.EndedWithParagraphMark, __aspxRichEdit.LayoutRowStateFlags.ParagraphEnd);
                };
                return RowEndedWithPageBreakState;
            }(RowEndedWithParagraphMarkFormatterState));
            Row.RowEndedWithPageBreakState = RowEndedWithPageBreakState;
        })(Row = LayoutFormatter.Row || (LayoutFormatter.Row = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Row;
        (function (Row) {
            var RowTabInfo = (function () {
                function RowTabInfo(rowFormatter, paragraphHorizontalBoundsStart) {
                    this.rowFormatter = rowFormatter;
                    this.paragraphHorizontalBoundsStart = paragraphHorizontalBoundsStart;
                    var tabsInfo = this.rowFormatter.paragraph.getTabs();
                    this.defaultTabStop = __aspxRichEdit.UnitConverter.twipsToPixels(tabsInfo.defaultTabStop);
                    this.tabPositions = tabsInfo.positions;
                    for (var _i = 0, _a = this.tabPositions; _i < _a.length; _i++) {
                        var tabPosition = _a[_i];
                        tabPosition.position = __aspxRichEdit.UnitConverter.twipsToPixels(tabPosition.position);
                    }
                    if (this.rowFormatter.paragraphProps.firstLineIndentType == __aspxRichEdit.ParagraphFirstLineIndent.Hanging && !this.rowFormatter.paragraph.isInList()) {
                        var pos = __aspxRichEdit.UnitConverter.twipsToPixels(this.rowFormatter.paragraphProps.leftIndent);
                        var ind = Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(this.tabPositions, function (t) { return t.position; }, pos));
                        var tab = this.tabPositions[ind];
                        var oldTabPos = tab ? tab.position : Number.MAX_VALUE;
                        if (oldTabPos != pos)
                            this.tabPositions.splice(pos > oldTabPos ? ind + 1 : ind, 0, new __aspxRichEdit.TabInfo(pos, __aspxRichEdit.TabAlign.Left, __aspxRichEdit.TabLeaderType.None, false, false));
                    }
                    for (var _b = 0, _c = this.tabPositions; _b < _c.length; _b++) {
                        var pos = _c[_b];
                        pos.position += this.paragraphHorizontalBoundsStart;
                    }
                    this.restart();
                }
                Object.defineProperty(RowTabInfo.prototype, "row", {
                    get: function () {
                        return this.rowFormatter.row;
                    },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(RowTabInfo.prototype, "currIntervalOrLastNonEmpty", {
                    get: function () {
                        var currInterval = this.rowFormatter.rowSizesManager.rowFormattingInfo.currInterval;
                        return currInterval ? currInterval : this.rowFormatter.rowSizesManager.rowFormattingInfo.lastNonEmptyInterval;
                    },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(RowTabInfo.prototype, "currInterval", {
                    get: function () { return this.rowFormatter.rowSizesManager.rowFormattingInfo.currInterval; },
                    enumerable: true,
                    configurable: true
                });
                RowTabInfo.prototype.restart = function () {
                    this.lastTabPosition = null;
                    this.lastTabBoxIndex = -1;
                };
                RowTabInfo.prototype.shiftBoxesAfterLastTab = function () {
                    if (!this.lastTabPosition || __aspxRichEdit.EnumUtils.isAnyOf(this.lastTabPosition.alignment, __aspxRichEdit.TabAlign.Left, __aspxRichEdit.TabAlign.Numbering))
                        return;
                    var prevTabBox = this.row.boxes[this.lastTabBoxIndex];
                    var prevTabNewWidth = this.calculateActualTabWidth(prevTabBox);
                    if (prevTabNewWidth > 0) {
                        prevTabBox.width = prevTabNewWidth;
                        this.currIntervalOrLastNonEmpty.avaliableWidth -= prevTabNewWidth;
                        __aspxRichEdit.ListUtils.foreach(this.row.boxes, function (box) { return box.x += prevTabNewWidth; }, this.lastTabBoxIndex + 1);
                    }
                    this.restart();
                };
                RowTabInfo.prototype.addTabBox = function () {
                    var box = this.rowFormatter.currBox;
                    this.shiftBoxesAfterLastTab();
                    var tabPosition = this.getNextCustomTabPosition(this.currInterval.startOfFreeSpace);
                    var tabXPosRelativePage = tabPosition ? tabPosition.position : this.getNextDefaultTabPosition(this.currInterval.startOfFreeSpace);
                    if (tabXPosRelativePage > this.currInterval.end) {
                        var ind = this.rowFormatter.rowSizesManager.rowFormattingInfo.indexOfIntervalContainsPositon(tabXPosRelativePage);
                        if (ind != this.rowFormatter.rowSizesManager.rowFormattingInfo.currIndex) {
                            var mustPlaceOnThisRow = tabPosition && tabPosition.alignment == __aspxRichEdit.TabAlign.Right;
                            if (mustPlaceOnThisRow)
                                tabXPosRelativePage = this.currInterval.end;
                            else {
                                this.rowFormatter.rowSizesManager.finishLogicalRow(ind, this.currInterval.end);
                                tabPosition = this.getNextCustomTabPosition(this.currInterval.startOfFreeSpace);
                                tabXPosRelativePage = tabPosition ? tabPosition.position : this.getNextDefaultTabPosition(this.currInterval.startOfFreeSpace);
                            }
                        }
                    }
                    box.x = this.currInterval.startOfFreeSpace;
                    box.width = !tabPosition || __aspxRichEdit.EnumUtils.isAnyOf(tabPosition.alignment, __aspxRichEdit.TabAlign.Left, __aspxRichEdit.TabAlign.Numbering) ? tabXPosRelativePage - box.x : 0;
                    var tabBox = box.getLayoutTabBox(tabPosition ? tabPosition.leader : __aspxRichEdit.TabLeaderType.None);
                    if (tabBox.getRightBoundPosition() > __aspxRichEdit.ListUtils.last(this.rowFormatter.rowSizesManager.rowFormattingInfo.intervals).end) {
                        if (!this.row.isEmpty())
                            return false;
                        if (this.rowFormatter.rowSizesManager.rowFormattingInfo.isFloatingIntersectRow) {
                            this.rowFormatter.rowSizesManager.rowFormattingInfo.findNextYPos();
                            this.rowFormatter.rowSizesManager.restartAllRow();
                            return this.addTabBox();
                        }
                    }
                    this.rowFormatter.rowSizesManager.addTabBox(tabBox);
                    this.lastTabPosition = tabPosition ? tabPosition : new __aspxRichEdit.TabInfo(tabXPosRelativePage, __aspxRichEdit.TabAlign.Left, __aspxRichEdit.TabLeaderType.None, false, false);
                    this.lastTabBoxIndex = this.row.boxes.length - 1;
                    return true;
                };
                RowTabInfo.prototype.calculateActualTabWidth = function (prevTabBox) {
                    var prevTabBoxXPos = prevTabBox.x;
                    switch (this.lastTabPosition.alignment) {
                        case __aspxRichEdit.TabAlign.Decimal: {
                            var decimalSeparatorChar = __aspxRichEdit.StringUtils.getDecimalSeparator();
                            for (var i = this.lastTabBoxIndex + 1, box = void 0; box = this.row.boxes[i]; i++) {
                                var charIndex = box.getCharIndex(decimalSeparatorChar);
                                if (charIndex >= 0) {
                                    var charXOffset = box.getCharOffsetXInPixels(this.rowFormatter.manager.measurer, charIndex);
                                    return this.getFinalCustomTabWidth(prevTabBoxXPos, box.x + charXOffset - prevTabBoxXPos);
                                }
                            }
                        }
                        case __aspxRichEdit.TabAlign.Right: {
                            var lastVisibleBox = this.row.boxes[Math.max(0, Row.BoxAligner.findLastVisibleBoxIndex(this.row.boxes))];
                            var lastTextBoxRightBound = lastVisibleBox.getRightBoundPosition();
                            return this.getFinalCustomTabWidth(prevTabBoxXPos, lastTextBoxRightBound - prevTabBoxXPos);
                        }
                        case __aspxRichEdit.TabAlign.Center: {
                            var lastVisibleBox = this.row.boxes[Math.max(0, Row.BoxAligner.findLastVisibleBoxIndex(this.row.boxes))];
                            var lastTextBoxRightBound = lastVisibleBox.getRightBoundPosition();
                            return this.getFinalCustomTabWidth(prevTabBoxXPos, Math.ceil((lastTextBoxRightBound - prevTabBoxXPos) / 2));
                        }
                        case __aspxRichEdit.TabAlign.Left:
                        case __aspxRichEdit.TabAlign.Numbering:
                            return 0;
                        default:
                            throw new Error(__aspxRichEdit.Errors.InternalException);
                    }
                };
                RowTabInfo.prototype.getFinalCustomTabWidth = function (prevTabBoxXPos, textLengthBetweenTabBoxAndTabMark) {
                    return __aspxRichEdit.Utils.restrictValue(this.lastTabPosition.position - prevTabBoxXPos - textLengthBetweenTabBoxAndTabMark, 0, this.currIntervalOrLastNonEmpty.avaliableWidth);
                };
                RowTabInfo.prototype.getNextDefaultTabPosition = function (xOffsetRelativePage) {
                    return xOffsetRelativePage >= this.paragraphHorizontalBoundsStart ?
                        this.paragraphHorizontalBoundsStart +
                            this.defaultTabStop * (Math.floor((xOffsetRelativePage - this.paragraphHorizontalBoundsStart) / this.defaultTabStop) + 1) :
                        this.paragraphHorizontalBoundsStart -
                            this.defaultTabStop * Math.floor((this.paragraphHorizontalBoundsStart - xOffsetRelativePage) / this.defaultTabStop);
                };
                RowTabInfo.prototype.getNextCustomTabPosition = function (xOffsetRelativePage) {
                    return __aspxRichEdit.ListUtils.elementBy(this.tabPositions, function (tabPos) { return xOffsetRelativePage < tabPos.position; });
                };
                return RowTabInfo;
            }());
            Row.RowTabInfo = RowTabInfo;
        })(Row = LayoutFormatter.Row || (LayoutFormatter.Row = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Row;
        (function (Row) {
            var WordHolderInfo = (function () {
                function WordHolderInfo(rowFormatter) {
                    this.rowFormatter = rowFormatter;
                    this.restart();
                }
                WordHolderInfo.prototype.restart = function () {
                    this.boxes = null;
                };
                WordHolderInfo.prototype.addBox = function () {
                    if (!this.boxes)
                        this.boxes = [];
                    var box = this.rowFormatter.currBox;
                    this.boxes.push(box);
                    this.rowFormatter.setBoxInfo(true);
                };
                WordHolderInfo.prototype.pushBoxes = function () {
                    if (!this.boxes)
                        return true;
                    if (!this.rowFormatter.rowSizesManager.addNumberingBoxes())
                        return false;
                    var res = this.rowFormatter.rowSizesManager.addFullWord(this.boxes);
                    if (res) {
                        this.boxes = null;
                        return true;
                    }
                    if (res == null)
                        return false;
                    if (this.rowFormatter.row.isEmpty()) {
                        if (this.rowFormatter.rowSizesManager.rowFormattingInfo.isFloatingIntersectRow) {
                            this.rowFormatter.rowSizesManager.rowFormattingInfo.findNextYPosWhatNoIntersectFloatingObjects();
                            return this.pushBoxes();
                        }
                        var offset = this.rowFormatter.rowSizesManager.addWordByChars(this.boxes);
                        this.rowFormatter.setPosition(offset, false, false);
                    }
                    else
                        this.rowFormatter.setPosition(this.boxes[0].rowOffset, false, false);
                    this.rowFormatter.rowSizesManager.finishLogicalRow(this.rowFormatter.rowSizesManager.rowFormattingInfo.currIndex + 1, this.rowFormatter.rowSizesManager.rowFormattingInfo.currInterval.end);
                    this.rowFormatter.finishRow();
                    this.boxes = null;
                    return false;
                };
                return WordHolderInfo;
            }());
            Row.WordHolderInfo = WordHolderInfo;
        })(Row = LayoutFormatter.Row || (LayoutFormatter.Row = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var TableBackgroundInfoCreator = (function () {
                function TableBackgroundInfoCreator() {
                }
                TableBackgroundInfoCreator.createBackgroundInfos = function (colorProvider, defaultTblCellProps, grid, currTableColumnInfo, currColumnVerticalBorders, currColumnHorizontalBorders, rowInfo) {
                    var tableStyle = grid.table.style;
                    var modelRows = grid.table.rows;
                    for (var rowIndexInColumn = 0, vertRowBrds = void 0; vertRowBrds = currColumnVerticalBorders[rowIndexInColumn]; rowIndexInColumn++) {
                        var tblRowInfo = currTableColumnInfo.tableRows[rowIndexInColumn];
                        var modelRowIndex = tblRowInfo.rowIndex;
                        var rowCellSpacing = rowInfo[modelRowIndex].cellSpacing;
                        var cells = modelRows[modelRowIndex].cells;
                        var rowHorizontalBorders = currColumnHorizontalBorders[rowIndexInColumn];
                        var isRowFirstInColumn = rowIndexInColumn == 0;
                        var isRowLastInColumn = rowIndexInColumn == currColumnVerticalBorders.length - 1;
                        for (var cellIndex = 0, cellVerticalBorders = void 0; cellVerticalBorders = vertRowBrds[cellIndex]; cellIndex++) {
                            var cell = cells[cellIndex];
                            if (cell.verticalMerging == __aspxRichEdit.TableCellMergingState.Continue && rowIndexInColumn != 0)
                                continue;
                            var isCellLastInRow = cellIndex == vertRowBrds.length - 1;
                            var cellGridInfo = grid.tableCellInfos[modelRowIndex][cellIndex];
                            var lastCellRowIndex = Math.min(cellGridInfo.getStartRowIndex() + cellGridInfo.getNumRowsInCell() - modelRowIndex + rowIndexInColumn, currColumnVerticalBorders.length) - 1;
                            var cellLastBrdsLines = currColumnHorizontalBorders[lastCellRowIndex];
                            var rect = new __aspxRichEdit.Rectangle();
                            if (rowCellSpacing) {
                                var isCellFirstInRow = cellIndex == 0;
                                var leftBrdIndex = isCellFirstInRow ? 1 : 0;
                                var rightBrdIndex = cellVerticalBorders.length - (isCellLastInRow ? 2 : 1);
                                rect.x = cellVerticalBorders[leftBrdIndex].xPos + cellVerticalBorders[leftBrdIndex].borderInfo.width;
                                rect.width = cellVerticalBorders[rightBrdIndex].xPos - rect.x;
                                var topHorBrdLine = rowHorizontalBorders[isRowFirstInColumn ? 1 : 0];
                                rect.y = topHorBrdLine.yPosition + topHorBrdLine.maxWidth;
                                rect.height = cellLastBrdsLines[cellLastBrdsLines.length - (isRowLastInColumn ? 2 : 1)].yPosition - rect.y;
                            }
                            else {
                                rect.x = cellVerticalBorders[0].xPos + cellVerticalBorders[0].borderInfo.width;
                                var rightBrd = isCellLastInRow ? cellVerticalBorders[1] : vertRowBrds[cellIndex + 1][0];
                                rect.width = rightBrd.xPos - rect.x;
                                var topHorBrdLine = rowHorizontalBorders[0];
                                var botHorBrdLine = lastCellRowIndex == currColumnVerticalBorders.length - 1 ?
                                    currColumnHorizontalBorders[lastCellRowIndex][1] : currColumnHorizontalBorders[lastCellRowIndex + 1][0];
                                rect.y = topHorBrdLine.yPosition + topHorBrdLine.maxWidth;
                                rect.height = botHorBrdLine.yPosition - rect.y;
                            }
                            var getColorFromCell = cell.verticalMerging == __aspxRichEdit.TableCellMergingState.Continue ?
                                modelRows[cellGridInfo.getStartRowIndex()].cells[cellGridInfo.getCellIndex(0)] :
                                cell;
                            var cellBackgroundColor = new __aspxRichEdit.TableCellPropertiesMergerShadingInfo()
                                .getProperty(getColorFromCell.properties, tableStyle, getColorFromCell.conditionalFormatting, defaultTblCellProps).getActualColor(colorProvider);
                            tblRowInfo.backgroundInfos.push(new __aspxRichEdit.LayoutTableCellBackgroundInfo(rect, cellBackgroundColor));
                        }
                    }
                };
                return TableBackgroundInfoCreator;
            }());
            Table.TableBackgroundInfoCreator = TableBackgroundInfoCreator;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var AddRowToTableResult;
            (function (AddRowToTableResult) {
                AddRowToTableResult[AddRowToTableResult["None"] = 0] = "None";
                AddRowToTableResult[AddRowToTableResult["RowAdded"] = 1] = "RowAdded";
                AddRowToTableResult[AddRowToTableResult["TableFinished"] = 2] = "TableFinished";
                AddRowToTableResult[AddRowToTableResult["GoToNextColumn"] = 4] = "GoToNextColumn";
            })(AddRowToTableResult = Table.AddRowToTableResult || (Table.AddRowToTableResult = {}));
            var Formatter = (function () {
                function Formatter(rowFormatter, tablePositions, column, tableMaxWidth, offset, parentCell, index, avaliableHeight, parentFormatter) {
                    this.isFullyFormatted = false;
                    this.parentFormatter = parentFormatter;
                    var tblPos = tablePositions[index];
                    if (tblPos.rowIndex != 0 || tblPos.cellIndex != 0)
                        throw new Error(__aspxRichEdit.Errors.InternalException);
                    this.tableInfo = new Table.TableInfo(rowFormatter, tblPos.table, tableMaxWidth, offset.x, offset.y);
                    this.columnStart(column, false, offset.y, parentCell, avaliableHeight);
                    if (++index < tablePositions.length)
                        this.createInnerFormatter(tablePositions);
                }
                Object.defineProperty(Formatter.prototype, "needAddSomeLayoutRows", {
                    get: function () {
                        return this.columnWasEmpty &&
                            this.noReadyTableRows &&
                            this.tableInfo.currCellInfo.currLayoutTableCellInfo.isEmpty();
                    },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(Formatter.prototype, "noReadyTableRows", {
                    get: function () {
                        var formatter = this;
                        do {
                            if (formatter.tableInfo.currLayoutTableColumnInfo.tableRows.length)
                                return false;
                        } while (formatter = formatter.parentFormatter);
                        return true;
                    },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(Formatter.prototype, "columnWasEmpty", {
                    get: function () { return this.parentFormatter ? this.parentFormatter.columnWasEmpty : this._columnWasEmpty; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(Formatter.prototype, "isCurrTableCellFirstInRow", {
                    get: function () { return this.position.cellIndex == 0; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(Formatter.prototype, "isCurrTableRowIsFirstInTable", {
                    get: function () { return this.position.rowIndex == 0; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(Formatter.prototype, "currLayoutRowOffset", {
                    get: function () { return this.tableInfo.currCellInfo.getCurrLayoutRowOffset(true); },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(Formatter.prototype, "currLayoutRowContentWidth", {
                    get: function () { return this.tableInfo.currCellInfo.currLayoutRowContentWidth; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(Formatter.prototype, "nestedLevel", {
                    get: function () { return this.tableInfo.table.nestedLevel; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(Formatter.prototype, "isCurrLayoutRowIsFirstInCell", {
                    get: function () {
                        return this.tableInfo.currRowInfo.cells[this.position.cellIndex].currLayoutTableCellInfo.layoutRows.length == 0;
                    },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(Formatter.prototype, "actualFormatter", {
                    get: function () {
                        var formatter = this.tableInfo.currCellInfo.innerFormatter;
                        return formatter ? formatter.actualFormatter : this;
                    },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(Formatter.prototype, "position", {
                    get: function () { return this.tableInfo.position; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(Formatter.prototype, "grid", {
                    get: function () { return this.tableInfo.grid; },
                    enumerable: true,
                    configurable: true
                });
                Formatter.prototype.createInnerFormatter = function (tablePositions) {
                    var avaliableHeight = this.getAvaliableSpaceForCellContent();
                    var index = this.nestedLevel + 1;
                    this.tableInfo.currCellInfo.innerFormatter = new Formatter(this.tableInfo.rowFormatter, tablePositions, this.column, this.currLayoutRowContentWidth, this.currLayoutRowOffset, this.tableInfo.currCellInfo.currLayoutTableCellInfo, index, avaliableHeight, this);
                };
                Formatter.prototype.createNextCellFormatter = function () {
                    var tblPoss = this.tableInfo.rowFormatter.getNextBoxWrapInfo().info.tablePosition;
                    if (tblPoss && tblPoss.length > this.nestedLevel + 1 && !this.tableInfo.currCellInfo.innerFormatter)
                        this.createInnerFormatter(tblPoss);
                };
                Formatter.prototype.resetPosition = function (newPos, forceEndAndStartRow) {
                    __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.TableFormatter, "resetPosition", function () { return "rowIndex: " + newPos.rowIndex + ", cellIndex: " + newPos.cellIndex + ", forceEndAndStartRow: " + forceEndAndStartRow; });
                    var initNewRow = forceEndAndStartRow || newPos.rowIndex > this.tableInfo.minRowIndex;
                    if (initNewRow) {
                        this.finishRow();
                        this.tableInfo.minRowIndex = Math.max(newPos.rowIndex, this.tableInfo.minRowIndex);
                    }
                    var cellGridInfo = this.tableInfo.grid.tableCellInfos[newPos.rowIndex][newPos.cellIndex];
                    var cellIndex = cellGridInfo.getCellIndex(this.tableInfo.minRowIndex - cellGridInfo.getStartRowIndex());
                    this.position.initIndexes(this.tableInfo.minRowIndex, cellIndex).init();
                    this.tableInfo.rowFormatter.setPosition(this.tableInfo.currCellInfo.getContentModelPosition(), false, false);
                    if (initNewRow)
                        this.tableInfo.currRowInfo.initLayoutInfo(forceEndAndStartRow, this.column);
                };
                Formatter.prototype.columnStart = function (column, weNeedToGoDeeper, yPos, parentCell, avaliableHeight) {
                    if (weNeedToGoDeeper === void 0) { weNeedToGoDeeper = true; }
                    if (yPos === void 0) { yPos = 0; }
                    if (parentCell === void 0) { parentCell = null; }
                    if (avaliableHeight === void 0) { avaliableHeight = null; }
                    this.column = column;
                    this._columnWasEmpty = !this.column.rows.length;
                    this.tableInfo.initLayoutInfo(yPos, parentCell, this.column);
                    this.tableInfo.avaliableHeight = avaliableHeight === null ?
                        this.column.height - this.tableInfo.currLayoutTableColumnInfo.y :
                        avaliableHeight;
                    if (weNeedToGoDeeper)
                        for (var _i = 0, _a = this.tableInfo.rows; _i < _a.length; _i++) {
                            var rowInfo = _a[_i];
                            for (var _b = 0, _c = rowInfo.cells; _b < _c.length; _b++) {
                                var cellInfo = _c[_b];
                                if (cellInfo.innerFormatter)
                                    cellInfo.innerFormatter.columnStart(column, true, cellInfo.getCurrLayoutRowOffset(false).y, cellInfo.currLayoutTableCellInfo, this.getAvaliableSpaceForCellContent(cellInfo));
                            }
                        }
                };
                Formatter.prototype.findNextCell = function (result, info) {
                    var wrap = this.tableInfo.rowFormatter.getNextBoxWrapInfo();
                    var tblPoss;
                    if (!wrap) {
                        if (!this.tableInfo.rowFormatter.iterator.allBoxesGiven())
                            throw new Error(__aspxRichEdit.Errors.InternalException);
                        tblPoss = null;
                    }
                    else
                        tblPoss = wrap.info.tablePosition;
                    var currTblPos = tblPoss ? tblPoss[this.nestedLevel] : null;
                    if (!currTblPos ||
                        !(this.tableInfo.currCellInfo.actualTableIndexes.equals(currTblPos) && this.tableInfo.table.index == currTblPos.table.index)) {
                        this.tableInfo.currCellInfo.cellFullyFormatted();
                        this.finishCell();
                        this.setNextCell(result);
                    }
                    wrap = this.tableInfo.rowFormatter.getNextBoxWrapInfo();
                    tblPoss = wrap ? wrap.info.tablePosition : null;
                    if (tblPoss && !result.get(AddRowToTableResult.TableFinished) && !this.tableInfo.currCellInfo.innerFormatter &&
                        (tblPoss.length > info.tablePosition.length ||
                            tblPoss.length == info.tablePosition.length && __aspxRichEdit.ListUtils.last(tblPoss).table.index != __aspxRichEdit.ListUtils.last(info.tablePosition).table.index))
                        this.createInnerFormatter(tblPoss);
                };
                Formatter.prototype.isLayoutRowIsLastOnCell = function () {
                    var wrap = this.tableInfo.rowFormatter.getNextBoxWrapInfo();
                    var tblPoss;
                    if (!wrap) {
                        if (!this.tableInfo.rowFormatter.iterator.allBoxesGiven())
                            return true;
                        tblPoss = null;
                    }
                    else
                        tblPoss = wrap.info.tablePosition;
                    var nextTblPos = tblPoss ? tblPoss[this.nestedLevel] : null;
                    return !nextTblPos || !this.tableInfo.currCellInfo.actualTableIndexes.equals(nextTblPos);
                };
                Formatter.prototype.resetCaseInTextAnchorObject = function (info, obj) {
                    if (this.nestedLevel < info.tablePosition.length - 1)
                        return this.tableInfo.currCellInfo.innerFormatter.resetCaseInTextAnchorObject(info, obj);
                    else {
                        var isNeedGoToNextColumn = false;
                        if (this.tableInfo.rowFormatter.manager.activeFormatter.subDocument.isMain()) {
                            var lp = this.tableInfo.rowFormatter.manager.activeFormatter.layoutPosition;
                            isNeedGoToNextColumn = obj.getBottomBoundPosition() > lp.pageArea.y + lp.column.y + this.tableInfo.currLayoutTableColumnInfo.y +
                                this.tableInfo.avaliableHeight - this.tableInfo.currCellInfo.heightAfterContent;
                        }
                        this.resetFromRow(new __aspxRichEdit.Flag());
                        this.tableInfo.currCellInfo.minBottomPosition = obj.getBottomBoundPosition();
                        return isNeedGoToNextColumn;
                    }
                };
                Formatter.prototype.applyResultOfTopLevelFormatters = function (result, info, lowLevelFormatters) {
                    if (lowLevelFormatters === void 0) { lowLevelFormatters = []; }
                    if (this.nestedLevel < info.tablePosition.length - 1) {
                        lowLevelFormatters.push(this);
                        this.tableInfo.currCellInfo.innerFormatter.applyResultOfTopLevelFormatters(result, info, lowLevelFormatters);
                    }
                    else
                        for (var formatter = void 0; formatter = lowLevelFormatters.pop();)
                            formatter.processResultOfTopLevelFormatter(result, info);
                };
                Formatter.prototype.processResultOfTopLevelFormatter = function (result, info) {
                    var cellInfo = this.tableInfo.currCellInfo;
                    if (result.anyOf(AddRowToTableResult.TableFinished, AddRowToTableResult.GoToNextColumn)) {
                        var innerLayoutTblColInfo = cellInfo.innerFormatter.tableInfo.currLayoutTableColumnInfo;
                        if (!innerLayoutTblColInfo.isEmpty()) {
                            if (!result.get(AddRowToTableResult.TableFinished))
                                cellInfo.innerFormatter.columnEnd();
                            cellInfo.currLayoutTableCellInfo.internalTables[cellInfo.currLayoutTableCellInfo.layoutRows.length] = innerLayoutTblColInfo;
                            cellInfo.currLayoutTableCellInfo.height += cellInfo.innerFormatter.tableInfo.currLayoutTableColumnInfo.height;
                        }
                        if (result.get(AddRowToTableResult.TableFinished))
                            cellInfo.innerFormatter = null;
                        else
                            this.tableInfo.rowFormatter.setPosition(cellInfo.innerFormatter.tableInfo.table.getEndPosition(), false, false);
                        result.set(AddRowToTableResult.TableFinished, false);
                        result.set(AddRowToTableResult.GoToNextColumn, false);
                        this.findNextCell(result, info);
                    }
                };
                Formatter.prototype.addLayoutRow = function (rowResult, info) {
                    var cellInfo = this.tableInfo.currCellInfo;
                    if (this.nestedLevel < info.tablePosition.length - 1)
                        return cellInfo.innerFormatter.addLayoutRow(rowResult, info);
                    var result = new __aspxRichEdit.Flag(AddRowToTableResult.None);
                    var avalHeight = this.getAvaliableSpaceForCellContent();
                    var row = rowResult.row;
                    if (cellInfo.currLayoutTableCellInfo.internalTables[cellInfo.currLayoutTableCellInfo.layoutRows.length] &&
                        this.isLayoutRowIsLastOnCell() && row.boxes.length == 1 && row.boxes[0].getType() == __aspxRichEdit.LayoutBoxType.ParagraphMark)
                        row.height = 0;
                    if (!cellInfo.innerFormatter && (row.height <= avalHeight || this.needAddSomeLayoutRows)) {
                        row.y = Math.max(row.y, cellInfo.currLayoutTableCellInfo.getBottomBoundPosition());
                        row.tableCellInfo = cellInfo.currLayoutTableCellInfo;
                        cellInfo.currLayoutTableCellInfo.layoutRows.push(row);
                        cellInfo.currLayoutTableCellInfo.height = row.getBottomBoundPosition() - cellInfo.currLayoutTableCellInfo.y;
                        result.set(AddRowToTableResult.RowAdded, true);
                        this.tableInfo.currRowInfo.layoutRowIndexInColumn =
                            Math.min(this.tableInfo.currRowInfo.layoutRowIndexInColumn, this.column.rows.length);
                        this.tableInfo.currCellInfo.cellPartiallyFormatted(rowResult.rowStartPos + row.getLastBoxEndPositionInRow());
                    }
                    else {
                        this.cantPlaceRow(result, rowResult.rowStartPos);
                    }
                    return result;
                };
                Formatter.prototype.cantPlaceRow = function (result, cellNewStartContentPos) {
                    if (this.tableInfo.currCellInfo.currLayoutTableCellInfo.isEmpty()) {
                        this.resetFromRow(result);
                    }
                    else {
                        this.tableInfo.currCellInfo.cellPartiallyFormatted(cellNewStartContentPos);
                        this.finishCell();
                        this.setNextCell(result);
                    }
                };
                Formatter.prototype.resetFromRow = function (result) {
                    this.cancelPlaceRow();
                    var newPos = this.tableInfo.cellOrderHelper.getFirstNotFullyRenderedCell(this.tableInfo.minRowIndex);
                    this.resetPosition(newPos, true);
                    this.tableInfo.currRowInfo.initLayoutInfo(true, this.column);
                    var tablePositions = this.tableInfo.rowFormatter.iterator.getWrap(false).info.tablePosition;
                    if (this.nestedLevel + 1 < tablePositions.length)
                        this.createInnerFormatter(tablePositions);
                    result.set(AddRowToTableResult.GoToNextColumn, true);
                };
                Formatter.prototype.setNextCell = function (result) {
                    var newPos = this.tableInfo.cellOrderHelper.getNextPos(this.tableInfo.currTablePositionIndexes);
                    if (!newPos) {
                        if (this.tableInfo.cellOrderHelper.isTableFullyFormatted()) {
                            this.finishRow();
                            this.finishTable();
                            result.set(AddRowToTableResult.TableFinished, true);
                            return;
                        }
                        else {
                            result.set(AddRowToTableResult.GoToNextColumn, true);
                            var newPos_1 = this.tableInfo.cellOrderHelper.getFirstNotFullyRenderedCell(this.tableInfo.minRowIndex);
                            this.resetPosition(newPos_1, true);
                        }
                    }
                    else
                        this.resetPosition(newPos, false);
                    this.createNextCellFormatter();
                };
                Formatter.prototype.finishCell = function () {
                    var cellInfo = this.tableInfo.currCellInfo;
                    var layTblCellInfo = cellInfo.currLayoutTableCellInfo;
                    if (!layTblCellInfo || layTblCellInfo.isEmpty())
                        return;
                    if (!cellInfo.isContendFullyPlaced)
                        layTblCellInfo.boundFlags.set(__aspxRichEdit.TableCellBoundFlags.EndOnThisColumn, false);
                    this.tableInfo.currRowInfo.currLayoutTableRowInfo.rowCells.push(layTblCellInfo);
                    layTblCellInfo.height += cellInfo.heightAfterContent;
                    var lp = this.tableInfo.rowFormatter.manager.activeFormatter.layoutPosition;
                    var minHeight = cellInfo.minBottomPosition - (lp.pageArea.y + lp.column.y + layTblCellInfo.y);
                    layTblCellInfo.height = Math.max(layTblCellInfo.height, minHeight);
                };
                Formatter.prototype.cancelPlaceRow = function () {
                    this.column.rows.splice(this.tableInfo.currRowInfo.layoutRowIndexInColumn);
                    this.tableInfo.currRowInfo.currLayoutTableRowInfo.rowCells = [];
                    for (var _i = 0, _a = this.tableInfo.currRowInfo.cells; _i < _a.length; _i++) {
                        var cell = _a[_i];
                        cell.undoContentModelPosition();
                    }
                };
                Formatter.prototype.finishRow = function () {
                    var rowInfo = this.tableInfo.currRowInfo;
                    if (rowInfo.currLayoutTableRowInfo.rowCells.length) {
                        rowInfo.currLayoutTableRowInfo.rowCells.sort(function (cellA, cellB) { return cellA.cellGridIndex - cellB.cellGridIndex; });
                        this.applyBottomHorizontalBordersChangesForPrevRow();
                        this.tableInfo.currColumnHorizontalBorders.push(this.tableInfo.currRowHorizontalBorders);
                        this.tableInfo.currLayoutTableColumnInfo.tableRows.push(rowInfo.currLayoutTableRowInfo);
                        rowInfo.howManyColumnsConsiderTableRow++;
                        this.setRowHeight();
                        this.extendCellHeightToRowHeight();
                        for (var _i = 0, _a = rowInfo.cells; _i < _a.length; _i++) {
                            var cell = _a[_i];
                            if (!cell.isContendFullyPlaced)
                                cell.isStartOnThisColumn = true;
                            cell.storeContentModelPosition();
                        }
                        this.tableInfo.lastRowBottomBoundPosition = rowInfo.currLayoutTableRowInfo.getBottomBoundPosition();
                    }
                    rowInfo.clearLayoutInfo();
                };
                Formatter.prototype.columnEnd = function () {
                    if (!this.tableInfo.currLayoutTableColumnInfo.tableRows.length)
                        return;
                    this.setCellsHeight();
                    var currColumnVerticalBorders = [];
                    var currColumnVerticalCursorBorders = [];
                    Table.BorderCreator.setColumnHorizontalBorders(this.tableInfo.currLayoutTableColumnInfo, this.tableInfo.rows, this.tableInfo.currColumnHorizontalBorders, this.tableInfo.isThisColumnFirstInTable);
                    Table.BorderCreator.setColumnVerticalBorders(this.tableInfo.currLayoutTableColumnInfo, this.grid, this.tableInfo.rows, this.tableInfo.isThisColumnFirstInTable, this.tableInfo.currColumnHorizontalBorders, currColumnVerticalBorders, this.tableInfo.verticalBorders, true);
                    Table.BorderCreator.setColumnVerticalBorders(this.tableInfo.currLayoutTableColumnInfo, this.grid, this.tableInfo.rows, this.tableInfo.isThisColumnFirstInTable, this.tableInfo.currColumnHorizontalBorders, currColumnVerticalCursorBorders, this.tableInfo.verticalCursorBorders, false);
                    this.tableInfo.currLayoutTableColumnInfo.calculateFlags();
                    this.column.tablesInfo.push(this.tableInfo.currLayoutTableColumnInfo);
                    this.tableInfo.currLayoutTableColumnInfo.height = this.tableInfo.lastRowBottomBoundPosition - this.tableInfo.currLayoutTableColumnInfo.y;
                    this.setRowsVerticalBounds(currColumnVerticalBorders);
                    Table.TableBackgroundInfoCreator.createBackgroundInfos(this.tableInfo.rowFormatter.manager.model.colorProvider, this.tableInfo.defaultTblCellProps, this.grid, this.tableInfo.currLayoutTableColumnInfo, currColumnVerticalBorders, this.tableInfo.currColumnHorizontalBorders, this.tableInfo.rows);
                    this.tableInfo.currLayoutTableColumnInfo.horizontalBorders =
                        Table.BorderMerger.getFinalReducedHorizontalBorders(this.tableInfo.currColumnHorizontalBorders);
                    this.tableInfo.currLayoutTableColumnInfo.horizontalCursorBorders =
                        Table.TableHorizontalCursorBordersHelper.getHorizontalCursorBorders(this.tableInfo.currLayoutTableColumnInfo);
                    this.tableInfo.currLayoutTableColumnInfo.verticalBorders =
                        Table.BorderMerger.getFinalReducedVerticalBorders(currColumnVerticalBorders);
                    this.tableInfo.currLayoutTableColumnInfo.verticalCursorBorders =
                        Table.BorderMerger.getFinalReducedVerticalBorders(currColumnVerticalCursorBorders);
                    Table.TableAlignmentApplier.applyHorizontalAlignment(this.tableInfo.currLayoutTableColumnInfo, this.tableInfo.maxWidth);
                    Table.TableAlignmentApplier.applyCellsVerticalAlignment(this.tableInfo.defaultTblCellProps, this.grid, this.tableInfo.currLayoutTableColumnInfo, this.tableInfo.rows);
                    if (this.position.table.nestedLevel == 0)
                        for (var _i = 0, _a = this.tableInfo.currLayoutTableColumnInfo.tableRows; _i < _a.length; _i++) {
                            var row = _a[_i];
                            Table.LayoutTableSizeCompressor.tableRowContentCompress(row);
                        }
                    this.tableInfo.isThisColumnFirstInTable = false;
                };
                Formatter.prototype.finishTable = function () {
                    this.columnEnd();
                    this.tableInfo.rowFormatter.setPosition(this.tableInfo.table.getEndPosition(), false, false);
                    this.isFullyFormatted = true;
                };
                Formatter.prototype.getAvaliableSpaceForCellContent = function (cellInfo) {
                    if (cellInfo === void 0) { cellInfo = this.tableInfo.currCellInfo; }
                    return this.tableInfo.currLayoutTableColumnInfo.y + this.tableInfo.avaliableHeight -
                        cellInfo.currLayoutTableCellInfo.getBottomBoundPosition() - cellInfo.heightAfterContent;
                };
                Formatter.prototype.setCellsHeight = function () {
                    var layoutTableRows = this.tableInfo.currLayoutTableColumnInfo.tableRows;
                    for (var layoutRowIndex = 0, layTblRow = void 0; layTblRow = layoutTableRows[layoutRowIndex]; layoutRowIndex++) {
                        var currentTableRowIndex = layTblRow.rowIndex;
                        var currTableRowGridInfo = this.grid.tableCellInfos[currentTableRowIndex];
                        var cells = this.grid.table.rows[currentTableRowIndex].cells;
                        for (var cellIndex = 0, cell = void 0; cell = cells[cellIndex]; cellIndex++) {
                            if (cell.verticalMerging == __aspxRichEdit.TableCellMergingState.Continue)
                                continue;
                            var currTableCellGridInfo = currTableRowGridInfo[cellIndex];
                            var cellGridIndex = currTableCellGridInfo.getGridCellIndex();
                            var layTblCell = __aspxRichEdit.ListUtils.elementBy(layTblRow.rowCells, function (cell) { return cell.cellGridIndex == cellGridIndex; });
                            if (layTblCell)
                                layTblCell.height = Formatter.getCellHeight(layoutTableRows, layoutRowIndex, currTableCellGridInfo.getEndRowIndex());
                        }
                    }
                };
                Formatter.getCellHeight = function (layTblRows, startRowIndex, endModelRowIndex) {
                    var height = 0;
                    for (var layTblRow = void 0; (layTblRow = layTblRows[startRowIndex]) && layTblRow.rowIndex < endModelRowIndex; startRowIndex++)
                        height += layTblRow.height;
                    return height;
                };
                Formatter.prototype.setRowsVerticalBounds = function (currColumnVerticalBorders) {
                    var tableX = this.tableInfo.currLayoutTableColumnInfo.x;
                    var rows = this.tableInfo.currLayoutTableColumnInfo.tableRows;
                    for (var rowIndex = 0, row = void 0; row = rows[rowIndex]; rowIndex++) {
                        var vertRowBrds = currColumnVerticalBorders[rowIndex];
                        var lastBrdInRow = __aspxRichEdit.ListUtils.last(__aspxRichEdit.ListUtils.last(vertRowBrds));
                        var xPosForFirstBorder = vertRowBrds[0][0].xPos;
                        row.x = tableX + xPosForFirstBorder;
                        row.width = lastBrdInRow.xPos - xPosForFirstBorder;
                    }
                };
                Formatter.setRowHeightInternal = function (tableLayoutRow) {
                    tableLayoutRow.height = __aspxRichEdit.ListUtils.accumulate(tableLayoutRow.rowCells, 0, function (acc, cell) { return Math.max(acc, cell.height); });
                };
                Formatter.prototype.setRowHeightWhenRowBelongsToManyColumns = function () {
                    var rowIndex = this.tableInfo.currRowInfo.currLayoutTableRowInfo.rowIndex;
                    if (this.grid.table.rows.length - 1 == rowIndex)
                        return Formatter.setRowHeightInternal(this.tableInfo.currRowInfo.currLayoutTableRowInfo);
                    var cellGridIndexLongCells = [];
                    var height = 0;
                    var tableCellGridInfos = this.grid.tableCellGridInfos;
                    for (var _i = 0, _a = this.tableInfo.currRowInfo.currLayoutTableRowInfo.rowCells; _i < _a.length; _i++) {
                        var layoutCell = _a[_i];
                        var cellGridIndex = layoutCell.cellGridIndex;
                        if (tableCellGridInfos[rowIndex][cellGridIndex] === tableCellGridInfos[rowIndex + 1][cellGridIndex])
                            cellGridIndexLongCells.push(cellGridIndex);
                        else
                            height = Math.max(height, layoutCell.height);
                    }
                    if (height == 0)
                        return Formatter.setRowHeightInternal(this.tableInfo.currRowInfo.currLayoutTableRowInfo);
                    var rows = this.grid.table.rows;
                    if (cellGridIndexLongCells.length > 0 &&
                        !__aspxRichEdit.ListUtils.anyOf(this.grid.tableCellInfos, function (rowGridInfo, rowInd) {
                            return __aspxRichEdit.ListUtils.anyOf(rowGridInfo, function (cellGridInfo, cellInd) {
                                return rows[rowInd].cells[cellInd].verticalMerging != __aspxRichEdit.TableCellMergingState.Continue ||
                                    !__aspxRichEdit.ListUtils.anyOf(cellGridIndexLongCells, function (ind) { return ind == cellGridInfo.getGridCellIndex(); });
                            });
                        }, rowIndex + 1)) {
                        return Formatter.setRowHeightInternal(this.tableInfo.currRowInfo.currLayoutTableRowInfo);
                    }
                    this.tableInfo.currRowInfo.currLayoutTableRowInfo.height = height;
                    return;
                };
                Formatter.prototype.setRowHeight = function () {
                    var rowIndex = this.tableInfo.currRowInfo.currLayoutTableRowInfo.rowIndex;
                    if (this.tableInfo.currRowInfo.howManyColumnsConsiderTableRow > 1)
                        return this.setRowHeightWhenRowBelongsToManyColumns();
                    var height = this.tableInfo.rows[rowIndex].heightInfo;
                    var cells = this.grid.table.rows[rowIndex].cells;
                    var maxCellHeightStartAndEndOnThisRow = 0;
                    for (var cellIndex = 0, cell = void 0; cell = cells[cellIndex]; cellIndex++) {
                        if (cell.verticalMerging != __aspxRichEdit.TableCellMergingState.Continue)
                            continue;
                        var cellGridInfo = this.grid.tableCellInfos[rowIndex][cellIndex];
                        if (rowIndex == cellGridInfo.getEndRowIndex() - 1) {
                            var startRowIndexInColumn = Math.max(0, this.tableInfo.currLayoutTableColumnInfo.tableRows.length - cellGridInfo.getNumRowsInCell());
                            var firstRowInCell = this.tableInfo.currLayoutTableColumnInfo.tableRows[startRowIndexInColumn];
                            var gridCellIndex = cellGridInfo.getGridCellIndex();
                            var topCell = __aspxRichEdit.ListUtils.elementBy(firstRowInCell.rowCells, function (cell) { return cell.cellGridIndex == gridCellIndex; });
                            if (topCell)
                                maxCellHeightStartAndEndOnThisRow = Math.max(maxCellHeightStartAndEndOnThisRow, __aspxRichEdit.ListUtils.accumulate(this.tableInfo.rows, topCell.height, function (acc, rowInfo) { return acc - rowInfo.heightInfo.contentHeight; }, firstRowInCell.rowIndex, rowIndex));
                        }
                    }
                    for (var _i = 0, _a = this.tableInfo.currRowInfo.currLayoutTableRowInfo.rowCells; _i < _a.length; _i++) {
                        var layoutCellInfo = _a[_i];
                        var cellGridInfo = this.grid.tableCellGridInfos[rowIndex][layoutCellInfo.cellGridIndex];
                        var cellStartRowIndex = cellGridInfo.getStartRowIndex();
                        var cell = cells[cellGridInfo.getCellIndex(rowIndex - cellStartRowIndex)];
                        if (cell.verticalMerging == __aspxRichEdit.TableCellMergingState.None)
                            maxCellHeightStartAndEndOnThisRow = Math.max(maxCellHeightStartAndEndOnThisRow, layoutCellInfo.height);
                    }
                    switch (height.preferredHeightType) {
                        case __aspxRichEdit.TableHeightUnitType.Exact:
                            this.tableInfo.currRowInfo.currLayoutTableRowInfo.height = height.preferredHeightValue;
                            break;
                        case __aspxRichEdit.TableHeightUnitType.Auto:
                            this.tableInfo.currRowInfo.currLayoutTableRowInfo.height = Math.max(maxCellHeightStartAndEndOnThisRow, height.contentHeight);
                            break;
                        case __aspxRichEdit.TableHeightUnitType.Minimum:
                            this.tableInfo.currRowInfo.currLayoutTableRowInfo.height =
                                Math.max(maxCellHeightStartAndEndOnThisRow, height.contentHeight, height.preferredHeightValue);
                            break;
                    }
                    height.contentHeight = this.tableInfo.currRowInfo.currLayoutTableRowInfo.height;
                };
                Formatter.prototype.extendCellHeightToRowHeight = function () {
                    var rowHeight = this.tableInfo.currRowInfo.currLayoutTableRowInfo.height;
                    for (var _i = 0, _a = this.tableInfo.currRowInfo.currLayoutTableRowInfo.rowCells; _i < _a.length; _i++) {
                        var cellInfo = _a[_i];
                        cellInfo.height = Math.max(cellInfo.height, rowHeight);
                    }
                };
                Formatter.prototype.applyBottomHorizontalBordersChangesForPrevRow = function () {
                    if (this.tableInfo.currLayoutTableColumnInfo.tableRows.length == 0)
                        return;
                    var rowIndex = this.tableInfo.currRowInfo.currLayoutTableRowInfo.rowIndex;
                    var prevRowInfoRowIndex = __aspxRichEdit.ListUtils.last(this.tableInfo.currLayoutTableColumnInfo.tableRows).rowIndex;
                    var isPrevRowLastInTable = prevRowInfoRowIndex == this.grid.table.rows.length - 1;
                    var cellSpacingPrevRow = this.tableInfo.rows[prevRowInfoRowIndex].cellSpacing;
                    var prevRowHorizBorders = __aspxRichEdit.ListUtils.last(this.tableInfo.currColumnHorizontalBorders);
                    var delta = 0;
                    if (cellSpacingPrevRow > 0) {
                        var lastBrd = prevRowHorizBorders.pop();
                        var lastLastBrd = prevRowHorizBorders.pop();
                        var newBrd = this.tableInfo.bordersHelper.collectOneCellAndTableHorizontalBorders(rowIndex - 1, __aspxRichEdit.TableCellPropertiesMergerBorderBottom, rowIndex, this.tableInfo.bordersHelper.borderHorizontal, true);
                        prevRowHorizBorders.push(newBrd);
                        delta = lastLastBrd.maxWidth + lastBrd.maxWidth - newBrd.maxWidth + (isPrevRowLastInTable ? cellSpacingPrevRow : 0);
                    }
                    else
                        delta = prevRowHorizBorders.pop().maxWidth;
                    if (delta == 0)
                        return;
                    this.tableInfo.currRowInfo.currLayoutTableRowInfo.height -= delta;
                    for (var _i = 0, _a = this.tableInfo.currRowInfo.currLayoutTableRowInfo.rowCells; _i < _a.length; _i++) {
                        var tblCell = _a[_i];
                        tblCell.y -= delta;
                        for (var _b = 0, _c = tblCell.layoutRows; _b < _c.length; _b++) {
                            var row = _c[_b];
                            row.y -= delta;
                        }
                    }
                };
                Formatter.getCellMargin = function (tableStyle, cell, marginMerger) {
                    var cellProps = cell.properties;
                    var styleFormatting = cell.conditionalFormatting;
                    return marginMerger.getProperty(cellProps, tableStyle, styleFormatting, null).asNumberNoPercentType(__aspxRichEdit.UnitConverter.twipsToPixels);
                };
                return Formatter;
            }());
            Table.Formatter = Formatter;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var TableHorizontalCursorBordersHelper = (function () {
                function TableHorizontalCursorBordersHelper() {
                }
                TableHorizontalCursorBordersHelper.getHorizontalCursorBorders = function (currTableColumnInfo) {
                    var borders = [];
                    __aspxRichEdit.ListUtils.foreach(currTableColumnInfo.tableRows, function (layoutRow, layoutRowIndex) {
                        __aspxRichEdit.ListUtils.foreach(layoutRow.rowCells, function (layoutCell) {
                            borders.push(TableHorizontalCursorBordersHelper.createHorizontalCursorBorder(currTableColumnInfo, layoutCell, layoutRowIndex));
                        });
                    });
                    return TableHorizontalCursorBordersHelper.combine(borders);
                };
                TableHorizontalCursorBordersHelper.combine = function (borders) {
                    var resultBorders = [];
                    var prevBorder = borders[0];
                    resultBorders.push(prevBorder);
                    for (var brdIndex = 1, border = void 0; border = borders[brdIndex]; brdIndex++) {
                        if (prevBorder.canCombine(border))
                            prevBorder.length = border.xPos + border.length - prevBorder.xPos;
                        else {
                            prevBorder = border;
                            resultBorders.push(prevBorder);
                        }
                    }
                    return resultBorders.sort(function (a, b) { return a.yPos - b.yPos; });
                };
                TableHorizontalCursorBordersHelper.createHorizontalCursorBorder = function (currTableColumnInfo, cell, layoutRowIndex) {
                    return new Table.LayoutCursorHorizontalTableBorder(cell.x - currTableColumnInfo.x, cell.getBottomBoundPosition() - currTableColumnInfo.y - TableHorizontalCursorBordersHelper.BORDER_HALF_WIDTH, cell.width, __aspxRichEdit.LayoutBorder.getEmpty(), layoutRowIndex);
                };
                TableHorizontalCursorBordersHelper.BORDER_HALF_WIDTH = 2;
                return TableHorizontalCursorBordersHelper;
            }());
            Table.TableHorizontalCursorBordersHelper = TableHorizontalCursorBordersHelper;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var TopAndBottomMarginsForRow = (function () {
                function TopAndBottomMarginsForRow() {
                    this.topMargin = 0;
                    this.bottomMargin = 0;
                }
                TopAndBottomMarginsForRow.prototype.addCellTopMargin = function (topMargin) {
                    if (this.topMargin < topMargin)
                        this.topMargin = topMargin;
                };
                TopAndBottomMarginsForRow.prototype.addCellBottomMargin = function (bottomMargin) {
                    if (this.bottomMargin < bottomMargin)
                        this.bottomMargin = bottomMargin;
                };
                TopAndBottomMarginsForRow.prototype.sumOfBoth = function () {
                    return this.topMargin + this.bottomMargin;
                };
                return TopAndBottomMarginsForRow;
            }());
            Table.TopAndBottomMarginsForRow = TopAndBottomMarginsForRow;
            var TableRowHeightInfo = (function () {
                function TableRowHeightInfo(cantSplit, height, horizontalAlignment) {
                    this.cantSplit = cantSplit;
                    this.preferredHeightValue = __aspxRichEdit.UnitConverter.twipsToPixels(height.value);
                    this.preferredHeightType = height.type;
                    this.contentHeight = 0;
                    this.horizontalAlignment = horizontalAlignment;
                }
                return TableRowHeightInfo;
            }());
            Table.TableRowHeightInfo = TableRowHeightInfo;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var LayoutTableSizeCompressor = (function () {
                function LayoutTableSizeCompressor() {
                }
                LayoutTableSizeCompressor.tableRowContentCompress = function (row) {
                    for (var _i = 0, _a = row.rowCells; _i < _a.length; _i++) {
                        var cell = _a[_i];
                        LayoutTableSizeCompressor.cellCompress(cell, cell.rectangle);
                    }
                };
                LayoutTableSizeCompressor.tableCompress = function (tableInfo, boundsRelativeColumn) {
                    LayoutTableSizeCompressor.compress(tableInfo, boundsRelativeColumn, true, false);
                    var boundsRelativeTable = tableInfo.clone().applyXOffset(-tableInfo.x).applyYOffset(-tableInfo.y);
                    for (var _i = 0, _a = tableInfo.tableRows; _i < _a.length; _i++) {
                        var row = _a[_i];
                        LayoutTableSizeCompressor.rowCompress(row, boundsRelativeTable, boundsRelativeColumn);
                    }
                    LayoutTableSizeCompressor.compressBorders(tableInfo.horizontalBorders, boundsRelativeTable, true);
                    LayoutTableSizeCompressor.compressBorders(tableInfo.horizontalCursorBorders, boundsRelativeTable, true);
                    LayoutTableSizeCompressor.compressBorders(tableInfo.verticalBorders, boundsRelativeTable, false);
                    LayoutTableSizeCompressor.compressBorders(tableInfo.verticalCursorBorders, boundsRelativeTable, false);
                };
                LayoutTableSizeCompressor.compressBorders = function (borders, boundsRelativeTable, isHorizontal) {
                    var newBorders = [];
                    for (var _i = 0, borders_1 = borders; _i < borders_1.length; _i++) {
                        var brd = borders_1[_i];
                        if ((isHorizontal ? LayoutTableSizeCompressor.compressHorizontalBorder : LayoutTableSizeCompressor.compressVerticalBorder)(brd, boundsRelativeTable))
                            newBorders.push(brd);
                    }
                    if (borders.length != newBorders.length) {
                        borders.splice(0);
                        __aspxRichEdit.ListUtils.addListOnTail(borders, newBorders);
                    }
                };
                LayoutTableSizeCompressor.rowCompress = function (row, boundsRelativeTable, boundsRelativeColumn) {
                    LayoutTableSizeCompressor.compress(row, boundsRelativeColumn, true, false);
                    for (var _i = 0, _a = row.backgroundInfos; _i < _a.length; _i++) {
                        var bcgInfo = _a[_i];
                        LayoutTableSizeCompressor.compress(bcgInfo, boundsRelativeTable, true, false);
                    }
                    for (var _b = 0, _c = row.rowCells; _b < _c.length; _b++) {
                        var cell = _c[_b];
                        LayoutTableSizeCompressor.cellCompress(cell, boundsRelativeColumn);
                    }
                };
                LayoutTableSizeCompressor.cellCompress = function (cell, boundsRelativeColumn) {
                    LayoutTableSizeCompressor.compress(cell, boundsRelativeColumn, true, false);
                    for (var _i = 0, _a = cell.layoutRows; _i < _a.length; _i++) {
                        var layoutRow = _a[_i];
                        LayoutTableSizeCompressor.compress(layoutRow, boundsRelativeColumn, true, true);
                    }
                    boundsRelativeColumn = cell;
                    __aspxRichEdit.MapUtilsKeyAsNumber.foreach(cell.internalTables, function (tbl) { return LayoutTableSizeCompressor.tableCompress(tbl, boundsRelativeColumn); });
                };
                LayoutTableSizeCompressor.compress = function (obj, bounds, changeWhenNoIntersection, isLayoutRow) {
                    var intersection = __aspxRichEdit.Rectangle.getIntersection(obj, bounds);
                    if (intersection) {
                        if (isLayoutRow && obj.x < bounds.x)
                            obj.applyXOffsetToBoxes(obj.x - bounds.x);
                        obj.initByAnotherRectangle(intersection);
                        return true;
                    }
                    if (changeWhenNoIntersection) {
                        var deviation = new __aspxRichEdit.RectangleDeviation(bounds, new __aspxRichEdit.Point(obj.x, obj.y)).calcDeviation().deviation;
                        var devRight = deviation.get(__aspxRichEdit.HitTestDeviation.Right);
                        var devBottom = deviation.get(__aspxRichEdit.HitTestDeviation.Bottom);
                        var newObjX = devRight ? bounds.getRightBoundPosition() : obj.x;
                        var newObjY = devBottom ? bounds.getBottomBoundPosition() : obj.y;
                        obj.init(newObjX, newObjY, devRight ? 0 : Math.min(obj.getRightBoundPosition(), bounds.getRightBoundPosition()) - newObjX, devBottom ? 0 : Math.min(obj.getBottomBoundPosition(), bounds.getBottomBoundPosition()) - newObjY);
                    }
                    return false;
                };
                LayoutTableSizeCompressor.compressVerticalBorder = function (border, bounds) {
                    var horIntersection = __aspxRichEdit.IntervalAlgorithms.getIntersection(new __aspxRichEdit.FixedInterval(border.xPos, border.borderInfo.width), new __aspxRichEdit.FixedInterval(bounds.x, bounds.width));
                    if (horIntersection) {
                        var vertIntersection = __aspxRichEdit.IntervalAlgorithms.getIntersection(new __aspxRichEdit.FixedInterval(border.yPos, border.length), new __aspxRichEdit.FixedInterval(bounds.y, bounds.height));
                        if (vertIntersection) {
                            border.length = Math.min(border.yPos + border.length, bounds.getBottomBoundPosition()) - border.yPos;
                            return true;
                        }
                        if (border.yPos > bounds.getBottomBoundPosition()) {
                            border.yPos = bounds.getBottomBoundPosition();
                            border.length = 0;
                        }
                        return false;
                    }
                    border.length = Math.min(border.yPos + border.length, bounds.getBottomBoundPosition()) - border.yPos;
                    if (border.xPos < bounds.x)
                        return true;
                    border.xPos = bounds.getRightBoundPosition();
                    border.borderInfo.width = 0;
                    return false;
                };
                LayoutTableSizeCompressor.compressHorizontalBorder = function (border, bounds) {
                    var vertIntersection = __aspxRichEdit.IntervalAlgorithms.getIntersection(new __aspxRichEdit.FixedInterval(border.yPos, border.borderInfo.width), new __aspxRichEdit.FixedInterval(bounds.y, bounds.height));
                    if (vertIntersection) {
                        var horIntersection = __aspxRichEdit.IntervalAlgorithms.getIntersection(new __aspxRichEdit.FixedInterval(border.xPos, border.length), new __aspxRichEdit.FixedInterval(bounds.x, bounds.width));
                        if (horIntersection) {
                            border.length = Math.min(border.xPos + border.length, bounds.getRightBoundPosition()) - border.xPos;
                            return true;
                        }
                        if (border.xPos > bounds.getRightBoundPosition()) {
                            border.xPos = bounds.getRightBoundPosition();
                            border.length = 0;
                        }
                        return false;
                    }
                    border.length = Math.min(border.xPos + border.length, bounds.getRightBoundPosition()) - border.xPos;
                    if (border.yPos < bounds.y)
                        return true;
                    border.yPos = bounds.getBottomBoundPosition();
                    border.borderInfo.width = 0;
                    return false;
                };
                return LayoutTableSizeCompressor;
            }());
            Table.LayoutTableSizeCompressor = LayoutTableSizeCompressor;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var TableAlignmentApplier = (function () {
                function TableAlignmentApplier() {
                }
                TableAlignmentApplier.getTableAlignment = function (table) {
                    var firstRowAlignment = new __aspxRichEdit.TableRowPropertiesMergerHorizontalAlignment(table.rows[0].tablePropertiesException)
                        .getProperty(table.rows[0].properties, table.style, table.rows[0].conditionalFormatting, null);
                    var allRowAlignmentsEqual = firstRowAlignment != null && __aspxRichEdit.ListUtils.allOf(table.rows, function (row) {
                        return new __aspxRichEdit.TableRowPropertiesMergerHorizontalAlignment(row.tablePropertiesException)
                            .getProperty(row.properties, table.style, row.conditionalFormatting, null) == firstRowAlignment;
                    });
                    return allRowAlignmentsEqual ? firstRowAlignment : new __aspxRichEdit.TablePropertiesMergerHorizontalAlignment()
                        .getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, null);
                };
                TableAlignmentApplier.applyHorizontalAlignment = function (currTableColumnInfo, tableMaxWidth) {
                    var table = currTableColumnInfo.logicInfo.grid.table;
                    var tableAlignment = this.getTableAlignment(table);
                    var leftBound = currTableColumnInfo.x;
                    var rightBound = leftBound + tableMaxWidth;
                    var avalSpace = rightBound - currTableColumnInfo.getRightBoundPosition();
                    var offset;
                    switch (tableAlignment != null ? tableAlignment : __aspxRichEdit.TableRowAlignment.Left) {
                        case __aspxRichEdit.TableRowAlignment.Right:
                            offset = avalSpace;
                            break;
                        case __aspxRichEdit.TableRowAlignment.Center:
                            offset = Math.floor(avalSpace / 2);
                            break;
                        case __aspxRichEdit.TableRowAlignment.Left:
                        default:
                            offset = 0;
                            break;
                    }
                    if (offset <= 0)
                        return;
                    TableAlignmentApplier.moveAllTable(currTableColumnInfo, function (rect) { return rect.x += offset; });
                };
                TableAlignmentApplier.applyCellsVerticalAlignment = function (defaultTableCellProps, grid, currTableColumnInfo, rowInfo) {
                    var table = grid.table;
                    var tableStyle = table.style;
                    for (var _i = 0, _a = currTableColumnInfo.tableRows; _i < _a.length; _i++) {
                        var tblRow = _a[_i];
                        for (var _b = 0, _c = tblRow.rowCells; _b < _c.length; _b++) {
                            var tblCell = _c[_b];
                            if (!(tblCell.boundFlags.get(__aspxRichEdit.TableCellBoundFlags.StartOnThisColumn) && tblCell.boundFlags.get(__aspxRichEdit.TableCellBoundFlags.EndOnThisColumn)))
                                continue;
                            var cellGridInfo = grid.tableCellGridInfos[tblRow.rowIndex][tblCell.cellGridIndex];
                            var cellStartRowIndex = cellGridInfo.getStartRowIndex();
                            var cellIndex = cellGridInfo.getCellIndex(0);
                            var cell = table.rows[cellStartRowIndex].cells[cellIndex];
                            var verticalAlignmentType = new __aspxRichEdit.TableCellVerticalAlignmentMerger()
                                .getProperty(cell.properties, tableStyle, cell.conditionalFormatting, defaultTableCellProps);
                            var topAndBottomMargins = rowInfo[cellStartRowIndex].topAndBottomMargins;
                            var bottomBound = tblCell.getBottomBoundPosition() - topAndBottomMargins.bottomMargin -
                                rowInfo[tblRow.rowIndex].cellSpacing * (tblRow.rowIndex == table.rows.length - 1 ? 2 : 1);
                            var numLayoutRows = tblCell.layoutRows.length;
                            var lastInnerTable = tblCell.internalTables[numLayoutRows];
                            var rowsBottomBound = lastInnerTable ?
                                lastInnerTable.getBottomBoundPosition() :
                                tblCell.layoutRows[numLayoutRows - 1].getBottomBoundPosition();
                            var avalSpace = bottomBound - rowsBottomBound;
                            var offset;
                            switch (verticalAlignmentType) {
                                case __aspxRichEdit.TableCellVerticalAlignment.Bottom:
                                    offset = avalSpace;
                                    break;
                                case __aspxRichEdit.TableCellVerticalAlignment.Center:
                                    offset = Math.floor(avalSpace / 2);
                                    break;
                                case __aspxRichEdit.TableCellVerticalAlignment.Top:
                                default:
                                    offset = 0;
                                    break;
                            }
                            if (offset <= 0)
                                continue;
                            for (var _d = 0, _e = tblCell.layoutRows; _d < _e.length; _d++) {
                                var layoutRow = _e[_d];
                                layoutRow.y += offset;
                            }
                            for (var key in tblCell.internalTables) {
                                if (!tblCell.internalTables.hasOwnProperty(key))
                                    continue;
                                TableAlignmentApplier.moveAllTable(tblCell.internalTables[key], function (rect) { return rect.y += offset; });
                            }
                        }
                    }
                };
                TableAlignmentApplier.moveAllTable = function (tblCol, mover) {
                    mover(tblCol);
                    for (var _i = 0, _a = tblCol.tableRows; _i < _a.length; _i++) {
                        var tblRow = _a[_i];
                        mover(tblRow);
                        for (var _b = 0, _c = tblRow.rowCells; _b < _c.length; _b++) {
                            var tblCell = _c[_b];
                            mover(tblCell);
                            for (var key in tblCell.internalTables) {
                                if (!tblCell.internalTables.hasOwnProperty(key))
                                    continue;
                                TableAlignmentApplier.moveAllTable(tblCell.internalTables[key], mover);
                            }
                            for (var _d = 0, _e = tblCell.layoutRows; _d < _e.length; _d++) {
                                var layoutRow = _e[_d];
                                mover(layoutRow);
                            }
                        }
                    }
                };
                return TableAlignmentApplier;
            }());
            Table.TableAlignmentApplier = TableAlignmentApplier;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DocumentCache = (function () {
        function DocumentCache() {
            this.fontInfoCache = new __aspxRichEdit.FontInfoCache(null);
            this.mergedCharacterPropertiesCache = new __aspxRichEdit.CharacterPropertiesCache();
            this.mergedParagraphPropertiesCache = new __aspxRichEdit.ParagraphPropertiesCache();
            this.maskedCharacterPropertiesCache = new __aspxRichEdit.MaskedCharacterPropertiesCache();
            this.maskedParagraphPropertiesCache = new __aspxRichEdit.MaskedParagraphPropertiesCache();
            this.tableRowPropertiesCache = new __aspxRichEdit.TableRowPropertiesCache();
            this.tableCellPropertiesCache = new __aspxRichEdit.TableCellPropertiesCache();
            this.listLevelPropertiesCache = new __aspxRichEdit.ListLevelPropertiesCache();
            this.imageCache = new __aspxRichEdit.ImageCache();
            this.shadingInfoCache = new __aspxRichEdit.ShadingInfoCache();
            this.colorModelInfoCache = new __aspxRichEdit.ColorModelInfoCache();
            this.drawingColorModelInfoCache = new __aspxRichEdit.DrawingColorModelInfoCache();
            this.scene3DPropertiesInfoCache = new __aspxRichEdit.Scene3DPropertiesInfoCache();
            this.scene3DRotationInfoCache = new __aspxRichEdit.Scene3DRotationInfoCache();
        }
        DocumentCache.prototype.clearTemporaryCaches = function () {
            this.fontInfoCache.clearTemporaryCache();
            this.mergedCharacterPropertiesCache.clearTemporaryCache();
            this.mergedParagraphPropertiesCache.clearTemporaryCache();
            this.maskedCharacterPropertiesCache.clearTemporaryCache();
            this.maskedParagraphPropertiesCache.clearTemporaryCache();
            this.listLevelPropertiesCache.clearTemporaryCache();
            this.tableRowPropertiesCache.clearTemporaryCache();
            this.tableCellPropertiesCache.clearTemporaryCache();
            this.shadingInfoCache.clearTemporaryCache();
            this.colorModelInfoCache.clearTemporaryCache();
            this.drawingColorModelInfoCache.clearTemporaryCache();
            this.scene3DPropertiesInfoCache.clearTemporaryCache();
            this.scene3DRotationInfoCache.clearTemporaryCache();
        };
        DocumentCache.prototype.DEBUG_DISTRIBUTION_INFO = function () {
            var result = [];
            result.push("maskedCharacterPropertiesCache \t{elems:" + this.maskedCharacterPropertiesCache.count + ", maxLen:" + this.maskedCharacterPropertiesCache.DEBUG_MAX_CELL_LENGTH());
            result.push("maskedParagraphPropertiesCache \t{elems:" + this.maskedParagraphPropertiesCache.count + ", maxLen:" + this.maskedParagraphPropertiesCache.DEBUG_MAX_CELL_LENGTH());
            result.push("mergedCharacterPropertiesCache \t{elems:" + this.mergedCharacterPropertiesCache.count + ", maxLen:" + this.mergedCharacterPropertiesCache.DEBUG_MAX_CELL_LENGTH());
            result.push("mergedParagraphPropertiesCache \t{elems:" + this.mergedParagraphPropertiesCache.count + ", maxLen:" + this.mergedParagraphPropertiesCache.DEBUG_MAX_CELL_LENGTH());
            result.push("listLevelPropertiesCache \t{elems:" + this.listLevelPropertiesCache.count + ", maxLen:" + this.listLevelPropertiesCache.DEBUG_MAX_CELL_LENGTH());
            result.push("tableRowPropertiesCache \t{elems:" + this.tableRowPropertiesCache.count + ", maxLen:" + this.tableRowPropertiesCache.DEBUG_MAX_CELL_LENGTH());
            result.push("tableCellPropertiesCache \t{elems:" + this.tableCellPropertiesCache.count + ", maxLen:" + this.tableCellPropertiesCache.DEBUG_MAX_CELL_LENGTH());
            return result.join("\n");
        };
        return DocumentCache;
    }());
    __aspxRichEdit.DocumentCache = DocumentCache;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ImageCache = (function () {
        function ImageCache() {
            this.clear();
        }
        ImageCache.prototype.clear = function () {
            this.cache = {};
        };
        ImageCache.prototype.add = function (serverId, dataAsBase64) {
            this.cache[serverId] = dataAsBase64;
        };
        ImageCache.prototype.push = function (dataAsBase64) {
            var maxId = -1;
            var existingId = __aspxRichEdit.MapUtilsKeyAsNumber.indexBy(this.cache, function (el, id) {
                if (el === dataAsBase64)
                    return true;
                if (id > maxId)
                    maxId = id;
                return false;
            });
            if (existingId !== null)
                return existingId;
            var newId = Math.max(maxId, 2) + 1;
            this.cache[newId] = dataAsBase64;
            return newId;
        };
        ImageCache.prototype.getBase64 = function (serverId) {
            return this.cache[serverId];
        };
        return ImageCache;
    }());
    __aspxRichEdit.ImageCache = ImageCache;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HistoryRun = (function () {
        function HistoryRun(type, characterStyle, offsetAtStartDocument, characterProperties, text) {
            this.type = type;
            this.characterStyle = characterStyle;
            this.offsetAtStartDocument = offsetAtStartDocument;
            this.characterProperties = characterProperties;
            this.text = text;
        }
        return HistoryRun;
    }());
    __aspxRichEdit.HistoryRun = HistoryRun;
    var HistoryRunInlinePicture = (function (_super) {
        __extends(HistoryRunInlinePicture, _super);
        function HistoryRunInlinePicture(characterStyle, offsetAtStartDocument, characterProperties, id, originalWidth, originalHeight, scaleX, scaleY, lockAspectRatio, isLoaded, guid, publicAPIID) {
            var _this = _super.call(this, __aspxRichEdit.RunType.InlinePictureRun, characterStyle, offsetAtStartDocument, characterProperties, __aspxRichEdit.RichUtils.specialCharacters.ObjectMark) || this;
            _this.id = id;
            _this.originalWidth = originalWidth;
            _this.originalHeight = originalHeight;
            _this.scaleX = scaleX;
            _this.scaleY = scaleY;
            _this.lockAspectRatio = lockAspectRatio;
            _this.isLoaded = isLoaded;
            _this.guid = guid;
            _this.publicAPIID = publicAPIID;
            return _this;
        }
        return HistoryRunInlinePicture;
    }(HistoryRun));
    __aspxRichEdit.HistoryRunInlinePicture = HistoryRunInlinePicture;
    var HistoryRunFieldCodeStart = (function (_super) {
        __extends(HistoryRunFieldCodeStart, _super);
        function HistoryRunFieldCodeStart(type, characterStyle, offsetAtStartDocument, characterProperties, text, showCode, startPosition, separatorPosition, endPosition, hyperlinkInfo) {
            var _this = _super.call(this, type, characterStyle, offsetAtStartDocument, characterProperties, text) || this;
            _this.showCode = showCode;
            _this.startPosition = startPosition;
            _this.separatorPosition = separatorPosition;
            _this.endPosition = endPosition;
            _this.hyperlinkInfo = hyperlinkInfo;
            return _this;
        }
        return HistoryRunFieldCodeStart;
    }(HistoryRun));
    __aspxRichEdit.HistoryRunFieldCodeStart = HistoryRunFieldCodeStart;
    var HistoryRunFieldCodeEnd = (function (_super) {
        __extends(HistoryRunFieldCodeEnd, _super);
        function HistoryRunFieldCodeEnd() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        return HistoryRunFieldCodeEnd;
    }(HistoryRun));
    __aspxRichEdit.HistoryRunFieldCodeEnd = HistoryRunFieldCodeEnd;
    var HistoryRunFieldResultEnd = (function (_super) {
        __extends(HistoryRunFieldResultEnd, _super);
        function HistoryRunFieldResultEnd() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        return HistoryRunFieldResultEnd;
    }(HistoryRun));
    __aspxRichEdit.HistoryRunFieldResultEnd = HistoryRunFieldResultEnd;
    var HistoryRunParagraph = (function (_super) {
        __extends(HistoryRunParagraph, _super);
        function HistoryRunParagraph(type, characterStyle, offsetAtStartDocument, characterProperties, text, paragraphStyle, paragraphMaskedProperties, isInsertPropertiesAndStyleIndexToCurrentParagraph, numbericListIndex, listLevelIndex, tabs) {
            var _this = _super.call(this, type, characterStyle, offsetAtStartDocument, characterProperties, text) || this;
            _this.paragraphStyle = paragraphStyle;
            _this.paragraphMaskedProperties = paragraphMaskedProperties;
            _this.isInsertPropertiesAndStyleIndexToCurrentParagraph = isInsertPropertiesAndStyleIndexToCurrentParagraph;
            _this.numbericListIndex = numbericListIndex;
            _this.listLevelIndex = listLevelIndex;
            _this.tabs = tabs;
            return _this;
        }
        return HistoryRunParagraph;
    }(HistoryRun));
    __aspxRichEdit.HistoryRunParagraph = HistoryRunParagraph;
    var HistoryRunSection = (function (_super) {
        __extends(HistoryRunSection, _super);
        function HistoryRunSection(run, paragraph, section, offsetAtStartDocument, isInsertPropertiesAndStyleIndexToCurrentParagraph) {
            var _this = _super.call(this, __aspxRichEdit.RunType.SectionRun, run.characterStyle, offsetAtStartDocument, run.maskedCharacterProperties, __aspxRichEdit.RichUtils.specialCharacters.SectionMark, paragraph.paragraphStyle, paragraph.maskedParagraphProperties, isInsertPropertiesAndStyleIndexToCurrentParagraph, paragraph.numberingListIndex, paragraph.listLevelIndex, paragraph.tabs.clone()) || this;
            _this.sectionProperties = section.sectionProperties;
            _this.headers = section.headers.clone();
            _this.footers = section.footers.clone();
            return _this;
        }
        return HistoryRunSection;
    }(HistoryRunParagraph));
    __aspxRichEdit.HistoryRunSection = HistoryRunSection;
    var HistoryRunAnchoredPicture = (function (_super) {
        __extends(HistoryRunAnchoredPicture, _super);
        function HistoryRunAnchoredPicture(characterStyle, offsetAtStartDocument, characterProperties, id, size, scaleX, scaleY, lockAspectRatio, isLoaded, shapeInfo, anchorInfo) {
            var _this = _super.call(this, __aspxRichEdit.RunType.AnchoredPictureRun, characterStyle, offsetAtStartDocument, characterProperties, __aspxRichEdit.RichUtils.specialCharacters.ObjectMark) || this;
            _this.id = id;
            _this.size = size;
            _this.scaleX = scaleX;
            _this.scaleY = scaleY;
            _this.lockAspectRatio = lockAspectRatio;
            _this.isLoaded = isLoaded;
            _this.shapeInfo = shapeInfo;
            _this.anchorInfo = anchorInfo;
            return _this;
        }
        return HistoryRunAnchoredPicture;
    }(HistoryRun));
    __aspxRichEdit.HistoryRunAnchoredPicture = HistoryRunAnchoredPicture;
    var HistoryRunAnchoredTextBox = (function (_super) {
        __extends(HistoryRunAnchoredTextBox, _super);
        function HistoryRunAnchoredTextBox(characterStyle, offsetAtStartDocument, characterProperties, size, lockAspectRatio, shapeInfo, textBoxProperties, anchorInfo, innerSubDocument) {
            var _this = _super.call(this, __aspxRichEdit.RunType.AnchoredTextBoxRun, characterStyle, offsetAtStartDocument, characterProperties, __aspxRichEdit.RichUtils.specialCharacters.ObjectMark) || this;
            _this.size = size;
            _this.lockAspectRatio = lockAspectRatio;
            _this.shapeInfo = shapeInfo;
            _this.anchorInfo = anchorInfo;
            _this.innerSubDocument = innerSubDocument;
            _this.textBoxProperties = textBoxProperties;
            return _this;
        }
        return HistoryRunAnchoredTextBox;
    }(HistoryRun));
    __aspxRichEdit.HistoryRunAnchoredTextBox = HistoryRunAnchoredTextBox;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RunIterator = (function () {
        function RunIterator(runs, chunks, sections, indexForChunks, indexForSections) {
            this.currentRun = null;
            this.currentChunk = null;
            this.currentSection = null;
            this.runs = [];
            this.chunks = [];
            this.sections = [];
            this.currentRunIndex = 0;
            this.currentChunkIndex = 0;
            this.currentSectionIndex = 0;
            this.indexForChunks = [];
            this.indexForSections = [];
            this.runs = runs;
            this.chunks = chunks;
            this.sections = sections;
            this.indexForChunks = indexForChunks;
            this.indexForSections = indexForSections;
        }
        RunIterator.prototype.moveNext = function () {
            this.currentRun = this.runs[this.currentRunIndex];
            if (this.currentRun) {
                this.currentChunk = this.chunks[this.currentChunkIndex];
                this.currentSection = this.sections[this.currentSectionIndex];
                if (this.currentRunIndex == this.indexForChunks[this.currentChunkIndex])
                    this.currentChunkIndex++;
                if (this.currentRunIndex == this.indexForSections[this.currentSectionIndex])
                    this.currentSectionIndex++;
                this.currentRunIndex++;
                return true;
            }
            else {
                this.currentChunk = undefined;
                this.currentSection = undefined;
                return false;
            }
        };
        RunIterator.prototype.currentInterval = function () {
            if (this.currentRun)
                return new __aspxRichEdit.FixedInterval(this.currentChunk.startLogPosition.value + this.currentRun.startOffset, this.currentRun.getLength());
            else
                return new __aspxRichEdit.FixedInterval(this.chunks[0].startLogPosition.value + this.runs[0].startOffset, this.runs[0].getLength());
        };
        RunIterator.prototype.getFirstRun = function () {
            return this.runs[0];
        };
        RunIterator.prototype.getLastRun = function () {
            return this.runs[this.runs.length - 1];
        };
        RunIterator.prototype.getRunsCount = function () {
            return this.runs.length;
        };
        RunIterator.prototype.reset = function () {
            this.currentRunIndex = 0;
            this.currentChunkIndex = 0;
            this.currentSectionIndex = 0;
        };
        return RunIterator;
    }());
    __aspxRichEdit.RunIterator = RunIterator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ColorProvider = (function () {
        function ColorProvider(colorModelInfoCache) {
            this.colorModelInfoCache = colorModelInfoCache;
            this.officeTheme = new __aspxRichEdit.OfficeTheme();
            this.palette = new __aspxRichEdit.Palette();
        }
        ColorProvider.prototype.getRgbaFromModelColor = function (color) {
            return color.toRgb(this);
        };
        ColorProvider.prototype.getModelColorFromRgba = function (rgba) {
            return this.colorModelInfoCache.getItem(__aspxRichEdit.ColorModelInfo.makeByColor(rgba));
        };
        return ColorProvider;
    }());
    __aspxRichEdit.ColorProvider = ColorProvider;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ColorDistanceInfo = (function () {
        function ColorDistanceInfo(distance, colorIndex) {
            this.distance = distance;
            this.colorIndex = colorIndex;
        }
        ColorDistanceInfo.comparator = function (a, b) {
            return a.distance - b.distance;
        };
        return ColorDistanceInfo;
    }());
    var ColorDifference = (function () {
        function ColorDifference() {
        }
        ColorDifference.RGB = function (x, y) {
            return Math.sqrt(Math.pow((__aspxRichEdit.ColorHelper.getRed(x) - __aspxRichEdit.ColorHelper.getRed(y)) / 255, 2) +
                Math.pow((__aspxRichEdit.ColorHelper.getGreen(x) - __aspxRichEdit.ColorHelper.getGreen(y)) / 255, 2) +
                Math.pow((__aspxRichEdit.ColorHelper.getBlue(x) - __aspxRichEdit.ColorHelper.getBlue(y)) / 255, 2));
        };
        ColorDifference.HSB = function (x, y) {
            var xHSL = __aspxRichEdit.ColorHSL.fromColorRGB(x);
            var yHSL = __aspxRichEdit.ColorHSL.fromColorRGB(y);
            var deltaH = Math.abs(xHSL.hue - yHSL.hue);
            if (deltaH > 180.0)
                deltaH = 360.0 - deltaH;
            deltaH /= 57.3;
            var deltaB = Math.abs(xHSL.luminance - yHSL.luminance) * 3.0;
            var deltaS = Math.abs(xHSL.saturation - yHSL.saturation) * 1.5;
            return deltaB + deltaH + deltaS;
        };
        return ColorDifference;
    }());
    __aspxRichEdit.ColorDifference = ColorDifference;
    var Palette = (function () {
        function Palette() {
            this.reset();
        }
        Palette.prototype.getColorByIndex = function (index) {
            var color = this.colorTable[index];
            if (color === undefined)
                throw new Error(__aspxRichEdit.Errors.InternalException);
            return color;
        };
        Palette.prototype.setColor = function (index, color) {
            var oldColor = this.colorTable[index];
            if (oldColor !== undefined) {
                if (oldColor != color) {
                    this.isCustomIndexedColorTable = true;
                    this.colorTable[index] = color;
                }
            }
            else
                throw new Error(__aspxRichEdit.Errors.InternalException);
        };
        Palette.prototype.reset = function () {
            var sbc = __aspxRichEdit.DXSystemColors.scrollBar;
            this.colorTable = new __aspxRichEdit.MapCreatorNumberAsKey()
                .add(0, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 0, 0, 0))
                .add(1, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 255, 255, 255))
                .add(2, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 255, 0, 0))
                .add(3, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 0, 255, 0))
                .add(4, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 0, 0, 255))
                .add(5, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 255, 255, 0))
                .add(6, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 255, 0, 255))
                .add(7, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 0, 255, 255))
                .add(8, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 0, 0, 0))
                .add(9, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 255, 255, 255))
                .add(10, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 255, 0, 0))
                .add(11, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 0, 255, 0))
                .add(12, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 0, 0, 255))
                .add(13, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 255, 255, 0))
                .add(14, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 255, 0, 255))
                .add(15, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 0, 255, 255))
                .add(16, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 128, 0, 0))
                .add(17, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 0, 128, 0))
                .add(18, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 0, 0, 128))
                .add(19, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 128, 128, 0))
                .add(20, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 128, 0, 128))
                .add(21, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 0, 128, 128))
                .add(22, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 192, 192, 192))
                .add(23, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 128, 128, 128))
                .add(24, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 153, 153, 255))
                .add(25, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 153, 51, 102))
                .add(26, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 255, 255, 204))
                .add(27, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 204, 255, 255))
                .add(28, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 102, 0, 102))
                .add(29, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 255, 128, 128))
                .add(30, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 0, 102, 204))
                .add(31, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 204, 204, 255))
                .add(32, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 0, 0, 128))
                .add(33, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 255, 0, 255))
                .add(34, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 255, 255, 0))
                .add(35, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 0, 255, 255))
                .add(36, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 128, 0, 128))
                .add(37, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 128, 0, 0))
                .add(38, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 0, 128, 128))
                .add(39, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 0, 0, 255))
                .add(40, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 0, 204, 255))
                .add(41, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 204, 255, 255))
                .add(42, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 204, 255, 204))
                .add(43, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 255, 255, 153))
                .add(44, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 153, 204, 255))
                .add(45, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 255, 153, 204))
                .add(46, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 204, 153, 255))
                .add(47, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 255, 204, 153))
                .add(48, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 51, 102, 255))
                .add(49, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 51, 204, 204))
                .add(50, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 153, 204, 0))
                .add(51, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 255, 204, 0))
                .add(52, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 255, 153, 0))
                .add(53, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 255, 102, 0))
                .add(54, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 102, 102, 153))
                .add(55, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 150, 150, 150))
                .add(56, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 0, 51, 102))
                .add(57, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 51, 153, 102))
                .add(58, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 0, 51, 0))
                .add(59, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 51, 51, 0))
                .add(60, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 153, 51, 0))
                .add(61, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 153, 51, 102))
                .add(62, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 51, 51, 153))
                .add(63, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 51, 51, 51))
                .add(Palette.SystemWindowFrameColorIndex, __aspxRichEdit.DXSystemColors.windowFrame)
                .add(Palette.System3DFaceColorIndex, __aspxRichEdit.DXSystemColors.control)
                .add(Palette.System3DTextColorIndex, __aspxRichEdit.DXSystemColors.controlText)
                .add(Palette.System3DHighlightColorIndex, __aspxRichEdit.DXSystemColors.controlLight)
                .add(Palette.System3DShadowColorIndex, __aspxRichEdit.DXSystemColors.controlDark)
                .add(Palette.SystemHighlightColorIndex, __aspxRichEdit.DXSystemColors.highlight)
                .add(Palette.SystemControlTextColorIndex, __aspxRichEdit.DXSystemColors.controlText)
                .add(Palette.SystemControlScrollColorIndex, sbc)
                .add(Palette.SystemControlInverseColorIndex, __aspxRichEdit.DXColor.fromArgb(0, sbc))
                .add(Palette.SystemControlBodyColorIndex, __aspxRichEdit.DXSystemColors.window)
                .add(Palette.SystemControlFrameColorIndex, __aspxRichEdit.DXSystemColors.windowFrame)
                .add(Palette.DefaultForegroundColorIndex, __aspxRichEdit.DXSystemColors.windowText)
                .add(Palette.DefaultBackgroundColorIndex, __aspxRichEdit.DXSystemColors.window)
                .add(Palette.DefaultChartForegroundColorIndex, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 0, 0, 0))
                .add(Palette.DefaultChartBackgroundColorIndex, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 255, 255, 255))
                .add(Palette.ChartNeutralColorIndex, __aspxRichEdit.ColorHelper.constructFromArgbNumber(0, 0, 0, 0))
                .add(Palette.ToolTipFillColorIndex, __aspxRichEdit.DXSystemColors.info)
                .add(Palette.ToolTipTextColorIndex, __aspxRichEdit.DXSystemColors.infoText)
                .add(Palette.FontAutomaticColorIndex, __aspxRichEdit.DXColor.empty)
                .get();
        };
        Object.defineProperty(Palette.prototype, "defaultForegroundColor", {
            get: function () { return this.colorTable[Palette.DefaultForegroundColorIndex]; },
            set: function (val) { this.colorTable[Palette.DefaultForegroundColorIndex] = val; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Palette.prototype, "defaultBackgroundColor", {
            get: function () { return this.colorTable[Palette.DefaultBackgroundColorIndex]; },
            set: function (val) { this.colorTable[Palette.DefaultBackgroundColorIndex] = val; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Palette.prototype, "defaultChartForegroundColor", {
            get: function () { return this.colorTable[Palette.DefaultChartForegroundColorIndex]; },
            set: function (val) { this.colorTable[Palette.DefaultChartForegroundColorIndex] = val; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Palette.prototype, "defaultChartBackgroundColor", {
            get: function () { return this.colorTable[Palette.DefaultChartBackgroundColorIndex]; },
            set: function (val) { this.colorTable[Palette.DefaultChartBackgroundColorIndex] = val; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Palette.prototype, "chartNeutralColor", {
            get: function () { return this.colorTable[Palette.ChartNeutralColorIndex]; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Palette.prototype, "toolTipTextColor", {
            get: function () { return this.colorTable[Palette.ToolTipTextColorIndex]; },
            set: function (val) { this.colorTable[Palette.ToolTipTextColorIndex] = val; },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Palette.prototype, "fontAutomaticColor", {
            get: function () { return this.colorTable[Palette.FontAutomaticColorIndex]; },
            set: function (val) { this.colorTable[Palette.FontAutomaticColorIndex] = val; },
            enumerable: true,
            configurable: true
        });
        Palette.prototype.isValidColorIndex = function (index) {
            return this.colorTable[index] !== undefined;
        };
        Palette.prototype.getColorIndex = function (colorProvider, colorInfo, foreground) {
            var defaultItem = __aspxRichEdit.ColorModelInfoCache.defaultItem;
            if (defaultItem.equals(colorInfo) || colorInfo.colorType == __aspxRichEdit.ColorType.Auto)
                return foreground ? Palette.DefaultForegroundColorIndex : Palette.DefaultBackgroundColorIndex;
            if (colorInfo.colorType == __aspxRichEdit.ColorType.Index) {
                if (!this.isValidColorIndex(colorInfo.colorIndex))
                    return foreground ? Palette.DefaultForegroundColorIndex : Palette.DefaultBackgroundColorIndex;
                return colorInfo.colorIndex;
            }
            return this.getPaletteNearestColorIndex(colorInfo.toRgb(colorProvider));
        };
        Palette.prototype.getFontColorIndex = function (colorProvider, colorInfo) {
            if (colorInfo.colorType == __aspxRichEdit.ColorType.Auto)
                return Palette.FontAutomaticColorIndex;
            if (colorInfo.colorType == __aspxRichEdit.ColorType.Index) {
                if (!this.isValidColorIndex(colorInfo.colorIndex))
                    return Palette.FontAutomaticColorIndex;
                return colorInfo.colorIndex;
            }
            return this.getPaletteNearestColorIndex(colorInfo.toRgb(colorProvider));
        };
        Palette.prototype.getColorIndexByRgbColor = function (color) {
            var index = this.getExactColorIndex(color, new __aspxRichEdit.BoundaryInterval(0, Palette.FontAutomaticColorIndex + 1));
            if (index != -1)
                return index;
            if (__aspxRichEdit.ColorHelper.getAlpha(color) == 0xFF) {
                color = __aspxRichEdit.DXColor.fromArgb(0, color);
                index = this.getExactColorIndex(color, new __aspxRichEdit.BoundaryInterval(0, Palette.FontAutomaticColorIndex + 1));
                if (index != -1)
                    return index;
            }
            return Palette.DefaultForegroundColorIndex;
        };
        Palette.prototype.getExactColorIndex = function (color, indexInterval) {
            var index = __aspxRichEdit.MapUtilsKeyAsNumber.anyOf(this.colorTable, function (value, key) {
                return indexInterval.contains(key) && value == color ? key : null;
            });
            return index === null ? -1 : index;
        };
        Palette.prototype.getNearestColorIndex = function (color) {
            var nearest = this.getExactColorIndex(color, new __aspxRichEdit.BoundaryInterval(0, 64));
            if (nearest != -1)
                return nearest;
            return this.getNearestColorIndexCore(color, new __aspxRichEdit.BoundaryInterval(0, 64));
        };
        Palette.prototype.getPaletteNearestColorIndex = function (color) {
            var nearest = this.getExactColorIndex(color, new __aspxRichEdit.BoundaryInterval(8, 63));
            if (nearest != -1)
                return nearest;
            return this.getNearestColorIndexCore(color, new __aspxRichEdit.BoundaryInterval(8, 64));
        };
        Palette.prototype.isCompatibleColors = function (x, y) {
            return __aspxRichEdit.ColorHelper.isGray(x) == __aspxRichEdit.ColorHelper.isGray(y);
        };
        Palette.prototype.getColorDistance = function (x, y, rgbWeight) {
            var hsbD = ColorDifference.HSB(x, y);
            var rgbD = ColorDifference.RGB(x, y) * rgbWeight;
            return hsbD + rgbD;
        };
        Palette.prototype.getNearestColorIndexCore = function (color, indexInterval) {
            var _this = this;
            var items = [];
            __aspxRichEdit.MapUtilsKeyAsNumber.foreach(this.colorTable, function (value, key) {
                if (indexInterval.contains(key) && _this.isCompatibleColors(value, color))
                    items.push(new ColorDistanceInfo(_this.getColorDistance(color, value, 3.0), key));
            });
            items.sort(ColorDistanceInfo.comparator);
            var limit = 5;
            if (items.length > limit)
                items.splice(limit);
            var nearest = -1;
            var distance = __aspxRichEdit.Constants.MAX_SAFE_INTEGER;
            for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {
                var item = items_1[_i];
                if (nearest == -1) {
                    nearest = item.colorIndex;
                    distance = this.getColorDistance(color, this.colorTable[item.colorIndex], 1.5);
                }
                else {
                    var d = this.getColorDistance(color, this.colorTable[item.colorIndex], 1.5);
                    if (d < distance) {
                        nearest = item.colorIndex;
                        distance = d;
                    }
                }
            }
            return nearest;
        };
        Palette.BuiltInColorsCount = 8;
        Palette.DefaultForegroundColorIndex = 64;
        Palette.DefaultBackgroundColorIndex = 65;
        Palette.SystemWindowFrameColorIndex = 66;
        Palette.System3DFaceColorIndex = 67;
        Palette.System3DTextColorIndex = 68;
        Palette.System3DHighlightColorIndex = 69;
        Palette.System3DShadowColorIndex = 70;
        Palette.SystemHighlightColorIndex = 71;
        Palette.SystemControlTextColorIndex = 72;
        Palette.SystemControlScrollColorIndex = 73;
        Palette.SystemControlInverseColorIndex = 74;
        Palette.SystemControlBodyColorIndex = 75;
        Palette.SystemControlFrameColorIndex = 76;
        Palette.DefaultChartForegroundColorIndex = 77;
        Palette.DefaultChartBackgroundColorIndex = 78;
        Palette.ChartNeutralColorIndex = 79;
        Palette.ToolTipFillColorIndex = 80;
        Palette.ToolTipTextColorIndex = 81;
        Palette.FontAutomaticColorIndex = 32767;
        return Palette;
    }());
    __aspxRichEdit.Palette = Palette;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Comment = (function (_super) {
        __extends(Comment, _super);
        function Comment(positionManager, interval) {
            return _super.call(this, positionManager, interval) || this;
        }
        Comment.minCommentDate = new Date(1900, 1, 1);
        return Comment;
    }(__aspxRichEdit.BookmarkBase));
    __aspxRichEdit.Comment = Comment;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var BackdropPlane = (function () {
        function BackdropPlane(normalVector, upVector, anchorPoint) {
            if (normalVector === void 0) { normalVector = new __aspxRichEdit.Scene3DVector(); }
            if (upVector === void 0) { upVector = new __aspxRichEdit.Scene3DVector(); }
            if (anchorPoint === void 0) { anchorPoint = new __aspxRichEdit.Scene3DVector(); }
            this.normalVector = normalVector;
            this.upVector = upVector;
            this.anchorPoint = anchorPoint;
        }
        Object.defineProperty(BackdropPlane.prototype, "isDefault", {
            get: function () {
                return this.anchorPoint.isDefault && this.normalVector.isDefault && this.upVector.isDefault;
            },
            enumerable: true,
            configurable: true
        });
        BackdropPlane.prototype.clone = function () {
            return new BackdropPlane(this.normalVector.clone(), this.upVector.clone(), this.anchorPoint.clone());
        };
        BackdropPlane.prototype.equals = function (obj) {
            return obj &&
                this.normalVector.equals(obj.normalVector) &&
                this.upVector.equals(obj.upVector) &&
                this.anchorPoint.equals(obj.anchorPoint);
        };
        BackdropPlane.prototype.resetToStyle = function () {
            this.normalVector = new __aspxRichEdit.Scene3DVector(0, 0, 0);
            this.upVector = new __aspxRichEdit.Scene3DVector(0, 0, 0);
            this.anchorPoint = new __aspxRichEdit.Scene3DVector(0, 0, 0);
        };
        return BackdropPlane;
    }());
    __aspxRichEdit.BackdropPlane = BackdropPlane;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ContainerEffect = (function () {
        function ContainerEffect() {
            this.name = "";
            this.hasEffectsList = true;
            this.effects = new __aspxRichEdit.DrawingEffectCollection();
        }
        Object.defineProperty(ContainerEffect.prototype, "isEmpty", {
            get: function () {
                return this.effects.list.length == 0;
            },
            enumerable: true,
            configurable: true
        });
        ContainerEffect.prototype.clone = function () {
            var obj = new ContainerEffect();
            obj.name = this.name;
            obj.type = this.type;
            obj.hasEffectsList = this.hasEffectsList;
            obj.effects = this.effects.clone();
            return obj;
        };
        return ContainerEffect;
    }());
    __aspxRichEdit.ContainerEffect = ContainerEffect;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DrawingColor = (function () {
        function DrawingColor(color, transforms) {
            if (transforms === void 0) { transforms = new __aspxRichEdit.ColorTransformCollection(); }
            this.transforms = transforms;
            this.color = color;
        }
        DrawingColor.createByDrawingColorModel = function (colorInfo) {
            return new DrawingColor(colorInfo);
        };
        DrawingColor.createByColor = function (color) {
            var alpha = __aspxRichEdit.ColorHelper.getAlpha(color);
            return alpha == 255 ?
                new DrawingColor(__aspxRichEdit.DrawingColorModelInfo.createARGB(color)) :
                new DrawingColor(__aspxRichEdit.DrawingColorModelInfo.createRGB(color), new __aspxRichEdit.ColorTransformCollection([__aspxRichEdit.AlphaColorTransform.createFromAlpha(alpha)]));
        };
        Object.defineProperty(DrawingColor.prototype, "isEmpty", {
            get: function () { return this.transforms.transforms.length == 0 && this.color.isEmpty; },
            enumerable: true,
            configurable: true
        });
        DrawingColor.prototype.finalColor = function (colorProvider) {
            return this.toRgb(colorProvider, __aspxRichEdit.DXColor.empty);
        };
        Object.defineProperty(DrawingColor.prototype, "originalColor", {
            get: function () { return this; },
            enumerable: true,
            configurable: true
        });
        DrawingColor.prototype.setColorFromRGB = function (rgb) {
            var alpha = __aspxRichEdit.ColorHelper.getAlpha(rgb);
            if (alpha == 255)
                this.rgb = rgb;
            else {
                this.rgb = __aspxRichEdit.DXColor.fromArgb(255, rgb);
                this.transforms.add(__aspxRichEdit.AlphaColorTransform.createFromAlpha(alpha));
            }
        };
        Object.defineProperty(DrawingColor.prototype, "rgb", {
            get: function () { return this.color.rgb; },
            set: function (value) {
                if (this.color.rgb == value && this.color.colorType == __aspxRichEdit.DrawingColorType.Rgb)
                    return;
                this.color.rgb = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(DrawingColor.prototype, "system", {
            get: function () { return this.color.systemColor; },
            set: function (value) {
                if (this.color.systemColor == value && this.color.colorType == __aspxRichEdit.DrawingColorType.System)
                    return;
                this.color.systemColor = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(DrawingColor.prototype, "scheme", {
            get: function () { return this.color.schemeColor; },
            set: function (value) {
                if (this.color.schemeColor == value && this.color.colorType == __aspxRichEdit.DrawingColorType.Scheme)
                    return;
                this.color.schemeColor = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(DrawingColor.prototype, "preset", {
            get: function () { return this.color.preset; },
            set: function (value) {
                if (this.color.preset == value && this.color.colorType == __aspxRichEdit.DrawingColorType.Preset)
                    return;
                this.color.preset = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(DrawingColor.prototype, "hsl", {
            get: function () { return this.color.hsl; },
            set: function (value) {
                if (this.color.hsl.equals(value) && this.color.colorType == __aspxRichEdit.DrawingColorType.Hsl)
                    return;
                this.color.hsl = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(DrawingColor.prototype, "scRgb", {
            get: function () { return this.color.scRgb; },
            set: function (value) {
                if (this.color.scRgb.equals(value) && this.color.colorType == __aspxRichEdit.DrawingColorType.ScRgb)
                    return;
                this.color.scRgb = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(DrawingColor.prototype, "colorType", {
            get: function () { return this.color.colorType; },
            enumerable: true,
            configurable: true
        });
        DrawingColor.prototype.toRgb = function (colorProvider, styleColor) {
            return this.transforms.applyTransform(this.color.toRgb(colorProvider, styleColor));
        };
        Object.defineProperty(DrawingColor.prototype, "type", {
            get: function () { return __aspxRichEdit.DrawingBulletType.Color; },
            enumerable: true,
            configurable: true
        });
        DrawingColor.prototype.equals = function (obj) {
            return obj &&
                this.color.equals(obj.color) &&
                this.transforms.equals(obj.transforms);
        };
        DrawingColor.prototype.clear = function () {
            this.color = __aspxRichEdit.DrawingColorModelInfoCache.defaultItem;
            this.transforms.clear();
        };
        DrawingColor.prototype.clone = function () {
            return new DrawingColor(this.color.clone(), this.transforms.clone());
        };
        return DrawingColor;
    }());
    __aspxRichEdit.DrawingColor = DrawingColor;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DrawingEffectCollection = (function () {
        function DrawingEffectCollection(list) {
            if (list === void 0) { list = []; }
            this.list = list;
        }
        DrawingEffectCollection.prototype.clone = function () {
            return new DrawingEffectCollection(__aspxRichEdit.ListUtils.deepCopy(this.list));
        };
        return DrawingEffectCollection;
    }());
    __aspxRichEdit.DrawingEffectCollection = DrawingEffectCollection;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DrawingEffectStyle = (function () {
        function DrawingEffectStyle(containerEffect, scene3DProperies, shape3DProperties) {
            if (containerEffect === void 0) { containerEffect = new __aspxRichEdit.ContainerEffect(); }
            if (scene3DProperies === void 0) { scene3DProperies = new __aspxRichEdit.Scene3DProperties(); }
            if (shape3DProperties === void 0) { shape3DProperties = new __aspxRichEdit.Shape3DProperties(); }
            this.containerEffect = containerEffect;
            this.scene3DProperies = scene3DProperies;
            this.shape3DProperties = shape3DProperties;
        }
        Object.defineProperty(DrawingEffectStyle.prototype, "isDefault", {
            get: function () {
                return this.containerEffect.isEmpty && this.scene3DProperies.isDefault && this.shape3DProperties.isDefault;
            },
            enumerable: true,
            configurable: true
        });
        DrawingEffectStyle.prototype.clone = function () {
            return new DrawingEffectStyle(this.containerEffect.clone(), this.scene3DProperies.clone(), this.shape3DProperties.clone());
        };
        return DrawingEffectStyle;
    }());
    __aspxRichEdit.DrawingEffectStyle = DrawingEffectStyle;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DrawingFill = (function () {
        function DrawingFill(fillType) {
            this.fillType = fillType;
        }
        Object.defineProperty(DrawingFill.prototype, "type", {
            get: function () {
                return __aspxRichEdit.DrawingUnderlineFillType.Fill;
            },
            enumerable: true,
            configurable: true
        });
        DrawingFill.prototype.clone = function () {
            return new DrawingFill(this.fillType);
        };
        DrawingFill.prototype.equals = function (obj) {
            return obj &&
                this.fillType == obj.fillType;
        };
        DrawingFill.Automatic = new DrawingFill(__aspxRichEdit.DrawingFillType.Automatic);
        DrawingFill.None = new DrawingFill(__aspxRichEdit.DrawingFillType.None);
        DrawingFill.Group = new DrawingFill(__aspxRichEdit.DrawingFillType.Group);
        return DrawingFill;
    }());
    __aspxRichEdit.DrawingFill = DrawingFill;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DrawingTextFont = (function () {
        function DrawingTextFont() {
            this.stringArray = ["", ""];
            this.byteArray = [DrawingTextFont.DefaultCharset, DrawingTextFont.DefaultPitchFamily];
        }
        Object.defineProperty(DrawingTextFont.prototype, "typeface", {
            get: function () {
                return this.stringArray[DrawingTextFont.typefaceIndex];
            },
            set: function (value) {
                this.setStringArray(DrawingTextFont.typefaceIndex, value);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(DrawingTextFont.prototype, "panose", {
            get: function () {
                return this.stringArray[DrawingTextFont.panoseIndex];
            },
            set: function (value) {
                this.setStringArray(DrawingTextFont.panoseIndex, value);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(DrawingTextFont.prototype, "charset", {
            get: function () {
                return this.byteArray[DrawingTextFont.charsetIndex];
            },
            set: function (value) {
                this.setByteArray(DrawingTextFont.charsetIndex, value);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(DrawingTextFont.prototype, "pitchFamily", {
            get: function () {
                return this.byteArray[DrawingTextFont.pitchFamilyIndex];
            },
            set: function (value) {
                this.setByteArray(DrawingTextFont.pitchFamilyIndex, value);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(DrawingTextFont.prototype, "isDefault", {
            get: function () {
                return __aspxRichEdit.StringUtils.isNullOrEmpty(this.stringArray[DrawingTextFont.typefaceIndex]) &&
                    __aspxRichEdit.StringUtils.isNullOrEmpty(this.stringArray[DrawingTextFont.panoseIndex]) &&
                    this.byteArray[DrawingTextFont.charsetIndex] == DrawingTextFont.DefaultCharset &&
                    this.byteArray[DrawingTextFont.pitchFamilyIndex] == DrawingTextFont.DefaultPitchFamily;
            },
            enumerable: true,
            configurable: true
        });
        DrawingTextFont.prototype.copyFrom = function (value) {
            this.stringArray[DrawingTextFont.typefaceIndex] = value.stringArray[DrawingTextFont.typefaceIndex];
            this.stringArray[DrawingTextFont.panoseIndex] = value.stringArray[DrawingTextFont.panoseIndex];
            this.byteArray[DrawingTextFont.charsetIndex] = value.byteArray[DrawingTextFont.charsetIndex];
            this.byteArray[DrawingTextFont.pitchFamilyIndex] = value.byteArray[DrawingTextFont.pitchFamilyIndex];
        };
        DrawingTextFont.prototype.clone = function () {
            var result = new DrawingTextFont();
            result.copyFrom(this);
            return result;
        };
        DrawingTextFont.prototype.equals = function (other) {
            return other &&
                this.stringArray[DrawingTextFont.typefaceIndex] == other.stringArray[DrawingTextFont.typefaceIndex] &&
                this.stringArray[DrawingTextFont.panoseIndex] == other.stringArray[DrawingTextFont.panoseIndex] &&
                this.byteArray[DrawingTextFont.charsetIndex] == other.byteArray[DrawingTextFont.charsetIndex] &&
                this.byteArray[DrawingTextFont.pitchFamilyIndex] == other.byteArray[DrawingTextFont.pitchFamilyIndex];
        };
        DrawingTextFont.prototype.clear = function () {
            this.typeface = "";
            this.panose = "";
            this.charset = DrawingTextFont.DefaultCharset;
            this.pitchFamily = DrawingTextFont.DefaultPitchFamily;
        };
        Object.defineProperty(DrawingTextFont.prototype, "type", {
            get: function () {
                return __aspxRichEdit.DrawingBulletType.Typeface;
            },
            enumerable: true,
            configurable: true
        });
        DrawingTextFont.prototype.setStringArray = function (index, value) {
            if (this.stringArray[index] != value)
                this.stringArray[index] = value;
        };
        DrawingTextFont.prototype.setByteArray = function (index, value) {
            if (this.byteArray[index] != value)
                this.byteArray[index] = value;
        };
        DrawingTextFont.DefaultCharset = 1;
        DrawingTextFont.DefaultPitchFamily = 0;
        DrawingTextFont.typefaceIndex = 0;
        DrawingTextFont.panoseIndex = 1;
        DrawingTextFont.charsetIndex = 0;
        DrawingTextFont.pitchFamilyIndex = 1;
        return DrawingTextFont;
    }());
    __aspxRichEdit.DrawingTextFont = DrawingTextFont;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Outline = (function () {
        function Outline(fill) {
            if (fill === void 0) { fill = __aspxRichEdit.DrawingFill.Automatic; }
            this._fill = fill;
        }
        Object.defineProperty(Outline.prototype, "fill", {
            get: function () {
                return this.fill;
            },
            set: function (value) {
                if (value == null)
                    value = __aspxRichEdit.DrawingFill.Automatic;
                if (!this._fill.equals(value))
                    this._fill = value;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Outline.prototype, "type", {
            get: function () {
                return __aspxRichEdit.DrawingStrokeUnderlineType.Outline;
            },
            enumerable: true,
            configurable: true
        });
        Outline.prototype.clone = function () {
            return new Outline(this._fill.clone());
        };
        return Outline;
    }());
    __aspxRichEdit.Outline = Outline;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Scene3DProperties = (function () {
        function Scene3DProperties() {
            this.backdropPlane = new __aspxRichEdit.BackdropPlane();
        }
        Object.defineProperty(Scene3DProperties.prototype, "isDefault", {
            get: function () {
                return this.info == __aspxRichEdit.Scene3DPropertiesInfoCache.defaultItem &&
                    this.cameraRotationInfo == __aspxRichEdit.Scene3DRotationInfoCache.defaultItem &&
                    this.lightRigRotationInfo == __aspxRichEdit.Scene3DRotationInfoCache.defaultItem &&
                    this.backdropPlane.isDefault;
            },
            enumerable: true,
            configurable: true
        });
        Scene3DProperties.prototype.clone = function () {
            var obj = new Scene3DProperties();
            obj.backdropPlane = this.backdropPlane.clone();
            obj.info = this.info.clone();
            obj.cameraRotationInfo = this.cameraRotationInfo.clone();
            obj.lightRigRotationInfo = this.lightRigRotationInfo.clone();
            return obj;
        };
        return Scene3DProperties;
    }());
    __aspxRichEdit.Scene3DProperties = Scene3DProperties;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Scene3DVector = (function () {
        function Scene3DVector(x, y, z) {
            if (x === void 0) { x = 0; }
            if (y === void 0) { y = 0; }
            if (z === void 0) { z = 0; }
            this.x = x;
            this.y = y;
            this.z = z;
        }
        Object.defineProperty(Scene3DVector.prototype, "isDefault", {
            get: function () {
                return this.x == 0 && this.y == 0 && this.z == 0;
            },
            enumerable: true,
            configurable: true
        });
        Scene3DVector.prototype.clone = function () {
            return new Scene3DVector(this.x, this.y, this.z);
        };
        Scene3DVector.prototype.equals = function (obj) {
            return obj &&
                this.x == obj.x &&
                this.y == obj.y &&
                this.z == obj.z;
        };
        return Scene3DVector;
    }());
    __aspxRichEdit.Scene3DVector = Scene3DVector;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Shape3DProperties = (function () {
        function Shape3DProperties() {
            this.topBevel = new __aspxRichEdit.ShapeBevel3DProperties();
            this.bottomBevel = new __aspxRichEdit.ShapeBevel3DProperties();
            this.contourColor = new __aspxRichEdit.DrawingColor(__aspxRichEdit.DrawingColorModelInfo.empty);
            this.extrusionColor = new __aspxRichEdit.DrawingColor(__aspxRichEdit.DrawingColorModelInfo.empty);
            this.presetMaterial = __aspxRichEdit.PresetMaterialType.WarmMatte;
        }
        Object.defineProperty(Shape3DProperties.prototype, "isDefault", {
            get: function () {
                return this.contourColor.isEmpty && this.extrusionColor.isEmpty && this.topBevel.isDefault && this.bottomBevel.isDefault &&
                    this.presetMaterial == Shape3DProperties.defaultPresetMaterialType && this.extrusionHeight == Shape3DProperties.defaultExtrusionHeight &&
                    this.contourWidth == Shape3DProperties.defaultContourWidth && this.shapeDepth == Shape3DProperties.defaultShapeDepth;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Shape3DProperties.prototype, "type", {
            get: function () {
                return __aspxRichEdit.DrawingText3DType.Shape3D;
            },
            enumerable: true,
            configurable: true
        });
        Shape3DProperties.prototype.clone = function () {
            var obj = new Shape3DProperties();
            obj.topBevel = this.topBevel;
            obj.bottomBevel = this.bottomBevel;
            obj.contourColor = this.contourColor.clone();
            obj.extrusionColor = this.extrusionColor.clone();
            obj.presetMaterial = this.presetMaterial;
            obj.extrusionHeight = this.extrusionHeight;
            obj.contourWidth = this.contourWidth;
            obj.shapeDepth = this.shapeDepth;
            return obj;
        };
        Shape3DProperties.defaultExtrusionHeight = 0;
        Shape3DProperties.defaultContourWidth = 0;
        Shape3DProperties.defaultShapeDepth = 0;
        Shape3DProperties.defaultPresetMaterialType = __aspxRichEdit.PresetMaterialType.WarmMatte;
        return Shape3DProperties;
    }());
    __aspxRichEdit.Shape3DProperties = Shape3DProperties;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ShapeBevel3DProperties = (function () {
        function ShapeBevel3DProperties() {
            this.presetType = ShapeBevel3DProperties.defaultPresetType;
            this.width = ShapeBevel3DProperties.defaultCoordinate;
            this.height = ShapeBevel3DProperties.defaultCoordinate;
        }
        Object.defineProperty(ShapeBevel3DProperties.prototype, "isDefault", {
            get: function () {
                return this.presetType == ShapeBevel3DProperties.defaultPresetType &&
                    this.height == ShapeBevel3DProperties.defaultCoordinate &&
                    this.width == ShapeBevel3DProperties.defaultCoordinate;
            },
            enumerable: true,
            configurable: true
        });
        ShapeBevel3DProperties.defaultCoordinate = 76200;
        ShapeBevel3DProperties.defaultPresetType = __aspxRichEdit.PresetBevelType.Circle;
        return ShapeBevel3DProperties;
    }());
    __aspxRichEdit.ShapeBevel3DProperties = ShapeBevel3DProperties;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var CheckBoxState;
    (function (CheckBoxState) {
        CheckBoxState[CheckBoxState["Unchecked"] = 0] = "Unchecked";
        CheckBoxState[CheckBoxState["Checked"] = 1] = "Checked";
        CheckBoxState[CheckBoxState["Undefined"] = 25] = "Undefined";
    })(CheckBoxState = __aspxRichEdit.CheckBoxState || (__aspxRichEdit.CheckBoxState = {}));
    var CheckBoxSizeMode;
    (function (CheckBoxSizeMode) {
        CheckBoxSizeMode[CheckBoxSizeMode["Auto"] = 0] = "Auto";
        CheckBoxSizeMode[CheckBoxSizeMode["Exact"] = 1] = "Exact";
    })(CheckBoxSizeMode = __aspxRichEdit.CheckBoxSizeMode || (__aspxRichEdit.CheckBoxSizeMode = {}));
    var FormFieldTextType;
    (function (FormFieldTextType) {
        FormFieldTextType[FormFieldTextType["Auto"] = 0] = "Auto";
        FormFieldTextType[FormFieldTextType["Custom"] = 1] = "Custom";
    })(FormFieldTextType = __aspxRichEdit.FormFieldTextType || (__aspxRichEdit.FormFieldTextType = {}));
    var CheckBoxProperties = (function () {
        function CheckBoxProperties() {
        }
        CheckBoxProperties.prototype.calculateHash = function () {
            return __aspxRichEdit.MathUtils.somePrimes[0] * this.size ^
                __aspxRichEdit.MathUtils.somePrimes[1] * this.sizeType;
        };
        CheckBoxProperties.prototype.getHashCode = function () {
            return this.hash === undefined ? this.hash = this.calculateHash() : this.hash;
        };
        CheckBoxProperties.prototype.equals = function (obj) {
            return obj &&
                this.checkBoxState == obj.checkBoxState &&
                this.defaultState == obj.defaultState &&
                this.size == obj.size &&
                this.sizeType == obj.sizeType;
        };
        return CheckBoxProperties;
    }());
    __aspxRichEdit.CheckBoxProperties = CheckBoxProperties;
    var MaskedCheckBoxPropertiesMask;
    (function (MaskedCheckBoxPropertiesMask) {
        MaskedCheckBoxPropertiesMask[MaskedCheckBoxPropertiesMask["UseNone"] = 0] = "UseNone";
        MaskedCheckBoxPropertiesMask[MaskedCheckBoxPropertiesMask["UseState"] = 4] = "UseState";
        MaskedCheckBoxPropertiesMask[MaskedCheckBoxPropertiesMask["UseDefaultState"] = 8] = "UseDefaultState";
        MaskedCheckBoxPropertiesMask[MaskedCheckBoxPropertiesMask["UseSize"] = 16] = "UseSize";
        MaskedCheckBoxPropertiesMask[MaskedCheckBoxPropertiesMask["UseSizeMode"] = 32] = "UseSizeMode";
        MaskedCheckBoxPropertiesMask[MaskedCheckBoxPropertiesMask["UseAll"] = 2147483647] = "UseAll";
    })(MaskedCheckBoxPropertiesMask = __aspxRichEdit.MaskedCheckBoxPropertiesMask || (__aspxRichEdit.MaskedCheckBoxPropertiesMask = {}));
    var MaskedCheckBoxProperties = (function (_super) {
        __extends(MaskedCheckBoxProperties, _super);
        function MaskedCheckBoxProperties() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.useValue = MaskedCheckBoxPropertiesMask.UseNone;
            return _this;
        }
        MaskedCheckBoxProperties.prototype.calculateHash = function () {
            return _super.prototype.calculateHash.call(this) +
                __aspxRichEdit.MathUtils.somePrimes[15] * this.useValue;
        };
        MaskedCheckBoxProperties.prototype.getUseValue = function (value) {
            return (this.useValue & value) != 0;
        };
        MaskedCheckBoxProperties.prototype.setUseValue = function (mask, value) {
            if (value)
                this.useValue |= mask;
            else
                this.useValue &= ~mask;
        };
        MaskedCheckBoxProperties.prototype.equals = function (obj) {
            return _super.prototype.equals.call(this, obj) &&
                this.useValue == obj.useValue;
        };
        return MaskedCheckBoxProperties;
    }(CheckBoxProperties));
    __aspxRichEdit.MaskedCheckBoxProperties = MaskedCheckBoxProperties;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DateTimeFieldFormatter = (function () {
        function DateTimeFieldFormatter() {
            this.AMPMKeyword = "am/pm";
        }
        DateTimeFieldFormatter.prototype.format = function (date, formatString) {
            this.date = date;
            this.formatString = formatString;
            this.result = "";
            var index = 0;
            var formatLength = this.formatString.length;
            while (index < formatLength) {
                index += this.formatNext(index);
            }
            return this.result;
        };
        DateTimeFieldFormatter.prototype.formatNext = function (index) {
            var ch = this.formatString[index];
            var formattingItem = this.tryCreateFormattingItem(ch);
            if (formattingItem)
                return this.processAsFormattingItem(index, formattingItem);
            if (this.isKeyword(this.AMPMKeyword, index))
                return this.processAsAMPMKeyword();
            if (ch == '\'')
                return this.processAsEmbedText(index);
            return this.processAsSingleCharacter(index);
        };
        DateTimeFieldFormatter.prototype.isKeyword = function (keyword, index) {
            if (keyword.length > (this.formatString.length - index))
                return false;
            var substring = this.formatString.substr(index, keyword.length);
            return keyword.toLowerCase() === substring.toLowerCase();
        };
        DateTimeFieldFormatter.prototype.processAsAMPMKeyword = function () {
            var result = (this.date.getHours() - 12) >= 0 ? REWebUtils.CultureInfo.pm : REWebUtils.CultureInfo.am;
            this.result += result;
            return this.AMPMKeyword.length;
        };
        DateTimeFieldFormatter.prototype.processAsEmbedText = function (index) {
            var startTextIndex = index + 1;
            if (startTextIndex >= (this.formatString.length - 1))
                return 1;
            var textLength = this.getCharacterSequenceLength(this.formatString[index], startTextIndex, this.charsAreNotEqual);
            if ((textLength + startTextIndex) == this.formatString.length) {
                this.result += "'";
                return 1;
            }
            this.result += this.formatString.substr(startTextIndex, textLength);
            return textLength + 2;
        };
        DateTimeFieldFormatter.prototype.processAsSingleCharacter = function (index) {
            this.result += this.formatString[index];
            return 1;
        };
        DateTimeFieldFormatter.prototype.processAsFormattingItem = function (index, formattingItem) {
            var sequenceLength = this.getCharacterSequenceLength(this.formatString[index], index, this.charsAreEqual);
            var patternLength = formattingItem.getAvailablePatternLength(sequenceLength);
            var result = formattingItem.format(this.date, patternLength);
            this.result += result;
            return Math.min(sequenceLength, patternLength);
        };
        DateTimeFieldFormatter.prototype.getCharacterSequenceLength = function (ch, index, predicate) {
            var length = this.formatString.length;
            var nextCharIndex = index + 1;
            while (nextCharIndex < length && predicate(ch, this.formatString[nextCharIndex]))
                nextCharIndex++;
            return nextCharIndex - index;
        };
        DateTimeFieldFormatter.prototype.tryCreateFormattingItem = function (formattingChar) {
            switch (formattingChar) {
                case 'h':
                    return new Hour12FormattingItem();
                case 'H':
                    return new Hour24FormattingItem();
                case 'm':
                    return new MinuteFormattingItem();
                case 'S':
                case 's':
                    return new SecondFormattingItem();
                case 'Y':
                case 'y':
                    return new YearFormattingItem();
                case 'M':
                    return new MonthFormattingItem();
                case 'D':
                case 'd':
                    return new DayFormattingItem();
            }
            return null;
        };
        DateTimeFieldFormatter.prototype.charsAreEqual = function (ch1, ch2) {
            return ch1 === ch2;
        };
        DateTimeFieldFormatter.prototype.charsAreNotEqual = function (ch1, ch2) {
            return ch1 !== ch2;
        };
        return DateTimeFieldFormatter;
    }());
    __aspxRichEdit.DateTimeFieldFormatter = DateTimeFieldFormatter;
    var DateTimeFormattingItem = (function () {
        function DateTimeFormattingItem() {
        }
        DateTimeFormattingItem.prototype.format = function (_date, _patternLength) {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        DateTimeFormattingItem.prototype.getAvailablePatternLength = function (patternLength) {
            var count = this.patternsLength.length;
            for (var i = 0; i < count; i++) {
                if (this.patternsLength[i] >= patternLength)
                    return this.patternsLength[i];
            }
            return this.patternsLength[count - 1];
        };
        return DateTimeFormattingItem;
    }());
    var NumericFormattingItem = (function (_super) {
        __extends(NumericFormattingItem, _super);
        function NumericFormattingItem() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.patternsLength = [1, 2];
            return _this;
        }
        NumericFormattingItem.prototype.formatCore = function (value, patternLength) {
            var result = "" + value;
            if (patternLength === 2 && result.length === 1)
                return "0" + result;
            return result;
        };
        return NumericFormattingItem;
    }(DateTimeFormattingItem));
    var CombinedFormattingItem = (function (_super) {
        __extends(CombinedFormattingItem, _super);
        function CombinedFormattingItem() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.patternsLength = [1, 2, 3, 4];
            return _this;
        }
        CombinedFormattingItem.prototype.format = function (date, patternLength) {
            if (patternLength <= 2)
                return this.formatCore(this.getNumericValue(date), patternLength);
            if (patternLength === 3)
                return this.getAbbreviatedName(date);
            return this.getFullName(date);
        };
        return CombinedFormattingItem;
    }(NumericFormattingItem));
    var Hour24FormattingItem = (function (_super) {
        __extends(Hour24FormattingItem, _super);
        function Hour24FormattingItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        Hour24FormattingItem.prototype.format = function (date, patternLength) {
            return this.formatCore(date.getHours(), patternLength);
        };
        return Hour24FormattingItem;
    }(NumericFormattingItem));
    var Hour12FormattingItem = (function (_super) {
        __extends(Hour12FormattingItem, _super);
        function Hour12FormattingItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        Hour12FormattingItem.prototype.format = function (date, patternLength) {
            var hour = date.getHours() % 12;
            if (hour == 0)
                hour = 12;
            return this.formatCore(hour, patternLength);
        };
        return Hour12FormattingItem;
    }(NumericFormattingItem));
    var MinuteFormattingItem = (function (_super) {
        __extends(MinuteFormattingItem, _super);
        function MinuteFormattingItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        MinuteFormattingItem.prototype.format = function (date, patternLength) {
            return this.formatCore(date.getMinutes(), patternLength);
        };
        return MinuteFormattingItem;
    }(NumericFormattingItem));
    var SecondFormattingItem = (function (_super) {
        __extends(SecondFormattingItem, _super);
        function SecondFormattingItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SecondFormattingItem.prototype.format = function (date, patternLength) {
            return this.formatCore(date.getSeconds(), patternLength);
        };
        return SecondFormattingItem;
    }(NumericFormattingItem));
    var DayFormattingItem = (function (_super) {
        __extends(DayFormattingItem, _super);
        function DayFormattingItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DayFormattingItem.prototype.getAbbreviatedName = function (date) {
            return REWebUtils.CultureInfo.abbrDayNames[this.getDayOfWeek(date)];
        };
        DayFormattingItem.prototype.getFullName = function (date) {
            return REWebUtils.CultureInfo.dayNames[this.getDayOfWeek(date)];
        };
        DayFormattingItem.prototype.getNumericValue = function (date) {
            return date.getDate();
        };
        DayFormattingItem.prototype.getDayOfWeek = function (date) {
            return date.getDay();
        };
        return DayFormattingItem;
    }(CombinedFormattingItem));
    var MonthFormattingItem = (function (_super) {
        __extends(MonthFormattingItem, _super);
        function MonthFormattingItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        MonthFormattingItem.prototype.getAbbreviatedName = function (date) {
            return REWebUtils.CultureInfo.abbrMonthNames[date.getMonth()];
        };
        MonthFormattingItem.prototype.getFullName = function (date) {
            return REWebUtils.CultureInfo.monthNames[date.getMonth()];
        };
        MonthFormattingItem.prototype.getNumericValue = function (date) {
            return date.getMonth() + 1;
        };
        return MonthFormattingItem;
    }(CombinedFormattingItem));
    var YearFormattingItem = (function (_super) {
        __extends(YearFormattingItem, _super);
        function YearFormattingItem() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.patternsLength = [2, 4];
            return _this;
        }
        YearFormattingItem.prototype.format = function (date, patternLength) {
            var year = date.getFullYear();
            if (patternLength == 2 && year > 99) {
                var shortYear = year % 100;
                var result = "" + shortYear;
                if (result.length === 1)
                    return "0" + result;
                return result;
            }
            return "" + year;
        };
        return YearFormattingItem;
    }(DateTimeFormattingItem));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FieldNameType;
    (function (FieldNameType) {
        FieldNameType[FieldNameType["None"] = 0] = "None";
        FieldNameType[FieldNameType["CreateDate"] = 1] = "CreateDate";
        FieldNameType[FieldNameType["Date"] = 2] = "Date";
        FieldNameType[FieldNameType["DocVariable"] = 3] = "DocVariable";
        FieldNameType[FieldNameType["Hyperlink"] = 4] = "Hyperlink";
        FieldNameType[FieldNameType["If"] = 5] = "If";
        FieldNameType[FieldNameType["IncludePicture"] = 6] = "IncludePicture";
        FieldNameType[FieldNameType["MergeField"] = 7] = "MergeField";
        FieldNameType[FieldNameType["NumPages"] = 8] = "NumPages";
        FieldNameType[FieldNameType["Page"] = 9] = "Page";
        FieldNameType[FieldNameType["Seq"] = 10] = "Seq";
        FieldNameType[FieldNameType["Symbol"] = 11] = "Symbol";
        FieldNameType[FieldNameType["TC"] = 12] = "TC";
        FieldNameType[FieldNameType["TOC"] = 13] = "TOC";
        FieldNameType[FieldNameType["Formula"] = 14] = "Formula";
    })(FieldNameType = __aspxRichEdit.FieldNameType || (__aspxRichEdit.FieldNameType = {}));
    var HyperlinkInfo = (function () {
        function HyperlinkInfo(uri, anchor, tip, visited) {
            this.uri = uri ? uri : "";
            this.anchor = anchor ? anchor : "";
            this.tip = tip ? tip : "";
            this.visited = visited ? visited : false;
        }
        HyperlinkInfo.prototype.clone = function () {
            return new HyperlinkInfo(this.uri, this.anchor, this.tip, this.visited);
        };
        HyperlinkInfo.prototype.getUriPlusAnchor = function () {
            return this.uri + (this.anchor == "" ? "" : "#" + this.anchor);
        };
        return HyperlinkInfo;
    }());
    __aspxRichEdit.HyperlinkInfo = HyperlinkInfo;
    var SequenceInfo = (function () {
        function SequenceInfo(identifier, repeats, hidesResult, resets, resetsWith) {
            this.identifier = identifier;
            this.repeats = repeats;
            this.hidesResult = hidesResult;
            this.resets = resets;
            this.resetsWith = resetsWith ? resetsWith : 0;
        }
        return SequenceInfo;
    }());
    __aspxRichEdit.SequenceInfo = SequenceInfo;
    var TcInfo = (function () {
        function TcInfo(identifier, text, level) {
            this.identifier = identifier;
            this.text = text;
            this.level = level;
        }
        return TcInfo;
    }());
    __aspxRichEdit.TcInfo = TcInfo;
    var Field = (function () {
        function Field(positionManager, index, startFieldPosition, separatorPosition, endFieldPosition, showCode, hyperlinkInfo) {
            this.codeStartPosition = positionManager.registerPosition(startFieldPosition + 1);
            this.resultStartPosition = positionManager.registerPosition(separatorPosition + 1);
            this.fieldEndPosition = positionManager.registerPosition(endFieldPosition);
            this.index = index;
            this.showCode = showCode;
            this.parent = undefined;
            if (hyperlinkInfo !== undefined)
                this.hyperlinkInfo = hyperlinkInfo;
        }
        Field.prototype.destructor = function (positionManager) {
            positionManager.unregisterPosition(this.codeStartPosition);
            positionManager.unregisterPosition(this.resultStartPosition);
            positionManager.unregisterPosition(this.fieldEndPosition);
        };
        Field.addField = function (fields, newField) {
            var field;
            var fieldIndex;
            fields.splice(newField.index, 0, newField);
            for (fieldIndex = newField.index + 1; field = fields[fieldIndex]; fieldIndex++)
                field.index++;
            for (fieldIndex = newField.index - 1; field = fields[fieldIndex]; fieldIndex--) {
                if (field.getFieldEndPosition() <= newField.getFieldStartPosition())
                    break;
            }
            var resetParentFrom = Math.max(0, fieldIndex);
            for (fieldIndex = newField.index + 1; field = fields[fieldIndex]; fieldIndex++) {
                if (field.getFieldStartPosition() >= newField.getFieldEndPosition())
                    break;
            }
            var resetParentToIndex = Math.min(fields.length - 1, fieldIndex);
            for (fieldIndex = resetParentFrom; fieldIndex <= resetParentToIndex; fieldIndex++)
                fields[fieldIndex].initParent(fields);
        };
        Field.deleteFieldByIndex = function (subDocument, delFieldIndex, modelManipulator) {
            var fields = subDocument.fields;
            var delField = fields[delFieldIndex];
            for (var fieldIndex = delFieldIndex + 1, field; field = fields[fieldIndex]; fieldIndex++)
                field.index--;
            var delFieldEndPos = delField.getFieldEndPosition();
            for (var i = delFieldIndex + 1, currField; currField = fields[i]; i++) {
                if (currField.parent == delField)
                    currField.parent = delField.parent;
                if (currField.getFieldStartPosition() >= delFieldEndPos)
                    break;
            }
            fields.splice(delField.index, 1);
            delField.destructor(subDocument.positionManager);
            modelManipulator.dispatcher.notifyFieldDeleted(subDocument, delFieldEndPos);
        };
        Field.prototype.isHyperlinkField = function () {
            return this.hyperlinkInfo !== undefined;
        };
        Field.prototype.setNewHyperlinkInfo = function (hyperlinkInfo) {
            this.hyperlinkInfo = hyperlinkInfo;
        };
        Field.prototype.getHyperlinkInfo = function () {
            return this.hyperlinkInfo;
        };
        Field.prototype.getSequenceInfo = function () {
            return this.sequenceInfo;
        };
        Field.prototype.setNewSequenceInfo = function (info) {
            this.sequenceInfo = info;
        };
        Field.prototype.isSequenceField = function () {
            return this.sequenceInfo !== undefined;
        };
        Field.prototype.getTcInfo = function () {
            return this.tcInfo;
        };
        Field.prototype.setNewTcInfo = function (info) {
            this.tcInfo = info;
        };
        Field.prototype.isTcField = function () {
            return this.tcInfo !== undefined;
        };
        Field.prototype.getFieldStartPosition = function () {
            return this.codeStartPosition.value - 1;
        };
        Field.prototype.getCodeStartPosition = function () {
            return this.codeStartPosition.value;
        };
        Field.prototype.getSeparatorPosition = function () {
            return this.resultStartPosition.value - 1;
        };
        Field.prototype.getResultStartPosition = function () {
            return this.resultStartPosition.value;
        };
        Field.prototype.getResultEndPosition = function () {
            return this.fieldEndPosition.value - 1;
        };
        Field.prototype.getFieldEndPosition = function () {
            return this.fieldEndPosition.value;
        };
        Field.prototype.setParent = function (parent) {
            if (parent !== null && (parent.getFieldStartPosition() >= this.getFieldStartPosition() || parent.getFieldEndPosition() <= this.getFieldEndPosition()))
                throw new Error("Incorrect field parent");
            this.parent = parent;
        };
        Field.prototype.initParent = function (fieldList) {
            for (var i = this.index - 1, possibleParent; possibleParent = fieldList[i]; i--) {
                if (possibleParent.getFieldEndPosition() > this.getFieldEndPosition()) {
                    this.parent = possibleParent;
                    return;
                }
                if (possibleParent.parent == null)
                    break;
            }
            this.parent = null;
        };
        Field.normedBinaryIndexOf = function (fields, position) {
            return __aspxRichEdit.Utils.normedInterpolationIndexOf(fields, function (f) { return f.getCodeStartPosition(); }, position);
        };
        Field.binaryIndexOf = function (fields, position) {
            return __aspxRichEdit.Utils.binaryIndexOf(fields, function (f) { return f.getCodeStartPosition() - position; });
        };
        Field.prototype.getAbsolutelyTopLevelField = function () {
            var field = this;
            for (; field.parent; field = field.parent)
                ;
            return field;
        };
        Field.prototype.getCodeInterval = function () {
            return __aspxRichEdit.FixedInterval.fromPositions(this.getCodeStartPosition(), this.getSeparatorPosition());
        };
        Field.prototype.getCodeIntervalWithBorders = function () {
            return __aspxRichEdit.FixedInterval.fromPositions(this.getFieldStartPosition(), this.getResultStartPosition());
        };
        Field.prototype.getResultInterval = function () {
            return __aspxRichEdit.FixedInterval.fromPositions(this.getResultStartPosition(), this.getResultEndPosition());
        };
        Field.prototype.getResultIntervalWithBorders = function () {
            return __aspxRichEdit.FixedInterval.fromPositions(this.getResultStartPosition(), this.getFieldEndPosition());
        };
        Field.prototype.getAllFieldInterval = function () {
            return __aspxRichEdit.FixedInterval.fromPositions(this.getFieldStartPosition(), this.getFieldEndPosition());
        };
        Field.prototype.getAllFieldIntervalWithoutBorders = function () {
            return __aspxRichEdit.FixedInterval.fromPositions(this.getCodeStartPosition(), this.getResultEndPosition());
        };
        Field.prototype.isPlacedInCodeAreaTopLevelField = function (topLevelField) {
            return !!__aspxRichEdit.IntervalAlgorithms.getIntersection(this.getAllFieldInterval(), topLevelField.getCodeInterval());
        };
        Field.correctIntervalDueToFieldsWithoutUiChecks = function (subDocument, newInterval) {
            var fields = subDocument.fields;
            if (newInterval.length && fields.length) {
                var startFieldIndex = Math.max(0, Field.normedBinaryIndexOf(fields, newInterval.start));
                var field = fields[startFieldIndex];
                while (field.parent)
                    field = field.parent;
                startFieldIndex = field.index;
                var endFieldIndex = startFieldIndex;
                for (; (field = fields[endFieldIndex]) && (field.getFieldStartPosition() < newInterval.end); endFieldIndex++) {
                    if (__aspxRichEdit.IntervalAlgorithms.getIntersectionNonNullLength(newInterval, new __aspxRichEdit.FixedInterval(field.getFieldStartPosition(), 1)) ||
                        __aspxRichEdit.IntervalAlgorithms.getIntersectionNonNullLength(newInterval, new __aspxRichEdit.FixedInterval(field.getSeparatorPosition(), 1)) ||
                        __aspxRichEdit.IntervalAlgorithms.getIntersectionNonNullLength(newInterval, new __aspxRichEdit.FixedInterval(field.getResultEndPosition(), 1)))
                        newInterval.expand(field.getAllFieldInterval());
                }
                return __aspxRichEdit.FixedInterval.fromPositions(startFieldIndex, endFieldIndex);
            }
            else
                return new __aspxRichEdit.FixedInterval(0, 0);
        };
        Field.correctIntervalDueToFieldsCaseSelectionCollapsed = function (fields, position) {
            var visabilityInfo = FieldVisabilityInfo.getRelativeVisabilityInfo(position, fields);
            for (var i = visabilityInfo.length - 1, fieldInfo = void 0; fieldInfo = visabilityInfo[i]; i--) {
                var field = fieldInfo.field;
                if (field.getCodeInterval().containsWithIntervalEnd(position)) {
                    if (fieldInfo.showCode)
                        break;
                    else
                        position = field.getFieldStartPosition();
                }
                else {
                    var fieldResultInterval = field.getResultInterval();
                    if (fieldResultInterval.containsWithIntervalEnd(position)) {
                        if (fieldInfo.showResult) {
                            if (position == fieldResultInterval.start)
                                position = field.getFieldStartPosition();
                            else if (position == fieldResultInterval.end)
                                position = field.getFieldEndPosition();
                            break;
                        }
                        else
                            position = field.getFieldEndPosition();
                    }
                }
            }
            return position;
        };
        Field.correctIntervalDueToFields = function (subDocument, newInterval) {
            var fields = subDocument.fields;
            if (!fields.length)
                return;
            if (!newInterval.length)
                return newInterval.start = Field.correctIntervalDueToFieldsCaseSelectionCollapsed(subDocument.fields, newInterval.start);
            var indexesInterval = Field.correctIntervalDueToFieldsWithoutUiChecks(subDocument, newInterval);
            __aspxRichEdit.ListUtils.foreach(fields, function (field) {
                if (field.getResultInterval().equals(newInterval))
                    newInterval.expand(field.getAllFieldInterval());
            }, indexesInterval.start, indexesInterval.end);
        };
        Field.correctWhenPositionInStartCode = function (fields, position) {
            if (fields.length < 1)
                return position;
            var field = fields[Math.max(0, Field.normedBinaryIndexOf(fields, position))];
            if (field.getResultStartPosition() == position)
                return field.parent ? Field.correctWhenPositionInStartCode(fields, field.getFieldStartPosition()) : field.getFieldStartPosition();
            return position;
        };
        Field.jumpThroughFieldToRight = function (fields, selection) {
            if (fields.length == 0 || selection.forwardDirection)
                return;
            var interval = selection.getLastSelectedInterval();
            var position = interval.start;
            var field = fields[Math.max(0, Field.normedBinaryIndexOf(fields, position + 1))];
            if (field.getFieldStartPosition() == position)
                selection.extendLastSelection(field.getFieldEndPosition(), false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
        };
        Field.jumpThroughFieldToLeft = function (fields, selection) {
            if (fields.length == 0 || !selection.forwardDirection)
                return;
            var interval = selection.getLastSelectedInterval();
            var position = interval.end;
            var field = fields[Math.max(0, Field.normedBinaryIndexOf(fields, position))];
            if (field.getFieldEndPosition() == position)
                selection.extendLastSelection(field.getFieldStartPosition(), false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
        };
        Field.DEBUG_FIELDS_CHECKS = function (subDocument, forceCheck) {
            if (forceCheck === void 0) { forceCheck = false; }
            if (!forceCheck && !__aspxRichEdit.Log.isEnabled)
                return;
            var fields = subDocument.fields;
            for (var fieldIndex = 0, field; field = fields[fieldIndex]; fieldIndex++) {
                if (field.index != fieldIndex)
                    throw new Error("DEBUG_FIELDS_CHECKS incorrect index " + field.index + " must be " + fieldIndex);
                var chunkAndRunInfoStartCode = subDocument.getRunAndIndexesByPosition(field.getFieldStartPosition());
                if (chunkAndRunInfoStartCode.run.getType() != __aspxRichEdit.RunType.FieldCodeStartRun)
                    throw new Error("DEBUG_FIELDS_CHECKS incorrect run type");
                var chunkAndRunInfoSeparator = subDocument.getRunAndIndexesByPosition(field.getSeparatorPosition());
                if (chunkAndRunInfoSeparator.run.getType() != __aspxRichEdit.RunType.FieldCodeEndRun)
                    throw new Error("DEBUG_FIELDS_CHECKS incorrect run type");
                var chunkAndRunInfoEndField = subDocument.getRunAndIndexesByPosition(field.getResultEndPosition());
                if (chunkAndRunInfoEndField.run.getType() != __aspxRichEdit.RunType.FieldResultEndRun)
                    throw new Error("DEBUG_FIELDS_CHECKS incorrect run type");
                if (chunkAndRunInfoStartCode.getAbsoluteRunPosition() >= chunkAndRunInfoSeparator.getAbsoluteRunPosition() ||
                    chunkAndRunInfoStartCode.getAbsoluteRunPosition() >= chunkAndRunInfoEndField.getAbsoluteRunPosition() ||
                    chunkAndRunInfoSeparator.getAbsoluteRunPosition() >= chunkAndRunInfoEndField.getAbsoluteRunPosition())
                    throw new Error("DEBUG_FIELDS_CHECKS incorrect some of main positions");
                if (field.parent) {
                    var fieldInterval = field.getAllFieldInterval();
                    if (!(field.parent.getCodeInterval().containsInterval(fieldInterval) ||
                        field.parent.getResultInterval().containsInterval(fieldInterval)))
                        throw new Error("DEBUG_FIELDS_CHECKS error with intervals");
                    if (field.parent.index >= field.index)
                        throw new Error("DEBUG_FIELDS_CHECKS error with parent and current indexes");
                }
            }
            var numFieldRuns = 0;
            var it = new __aspxRichEdit.ModelIterator(subDocument, false);
            it.setPosition(0);
            do {
                if (__aspxRichEdit.EnumUtils.isAnyOf(it.run.getType(), __aspxRichEdit.RunType.FieldCodeStartRun, __aspxRichEdit.RunType.FieldCodeEndRun, __aspxRichEdit.RunType.FieldResultEndRun))
                    numFieldRuns++;
            } while (it.moveToNextRun());
            if (numFieldRuns != subDocument.fields.length * 3)
                throw new Error("DEBUG_FIELDS_CHECKS error with num runs of fields (excess runs)");
        };
        return Field;
    }());
    __aspxRichEdit.Field = Field;
    var FieldVisabilityInfo = (function () {
        function FieldVisabilityInfo(showCode, showResult, field) {
            this.showCode = showCode;
            this.showResult = showResult;
            this.field = field;
        }
        FieldVisabilityInfo.getRelativeVisabilityInfo = function (position, fields) {
            var visabilityInfo = [];
            var currFieldIndex = Field.normedBinaryIndexOf(fields, position + 1);
            if (currFieldIndex < 0)
                return [];
            var currField = fields[currFieldIndex];
            do {
                if (currField.getAllFieldIntervalWithoutBorders().containsWithIntervalEnd(position))
                    visabilityInfo.unshift(new FieldVisabilityInfo(currField.showCode, !currField.showCode, currField));
            } while (currField = currField.parent);
            var topLevelFieldInfo = visabilityInfo[0];
            for (var i = 1, fieldInfo; fieldInfo = visabilityInfo[i]; i++) {
                FieldVisabilityInfo.applyTopLevelFieldInfoVisabilityToThisFieldInfo(topLevelFieldInfo, fieldInfo);
                topLevelFieldInfo = fieldInfo;
            }
            return visabilityInfo;
        };
        FieldVisabilityInfo.applyTopLevelFieldInfoVisabilityToThisFieldInfo = function (topLevelFieldInfo, lowLevelFieldInfo) {
            var topLevelFieldAllowShowThisField = lowLevelFieldInfo.field.isPlacedInCodeAreaTopLevelField(topLevelFieldInfo.field) ? topLevelFieldInfo.showCode : topLevelFieldInfo.showResult;
            lowLevelFieldInfo.showCode = lowLevelFieldInfo.showCode && topLevelFieldAllowShowThisField;
            lowLevelFieldInfo.showResult = lowLevelFieldInfo.showResult && topLevelFieldAllowShowThisField;
        };
        FieldVisabilityInfo.prototype.clone = function () {
            return new FieldVisabilityInfo(this.showCode, this.showResult, this.field);
        };
        FieldVisabilityInfo.prototype.copyFrom = function (obj) {
            this.field = obj.field;
            this.showCode = obj.showCode;
            this.showResult = obj.showResult;
        };
        return FieldVisabilityInfo;
    }());
    __aspxRichEdit.FieldVisabilityInfo = FieldVisabilityInfo;
    var FieldsSettings = (function () {
        function FieldsSettings() {
            this.updateFieldsBeforePrint = true;
            this.updateFieldsOnPaste = true;
        }
        return FieldsSettings;
    }());
    __aspxRichEdit.FieldsSettings = FieldsSettings;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FieldContextMenuHelper = (function () {
        function FieldContextMenuHelper() {
        }
        FieldContextMenuHelper.getHyperlinkResultText = function (subDocument, field) {
            var result = "";
            var iterator = new __aspxRichEdit.ModelIterator(subDocument, true);
            iterator.setPosition(field.getResultStartPosition());
            var currFieldIndex = field.index;
            var fields = subDocument.fields;
            do {
                if (iterator.getAbsolutePosition() >= field.getResultEndPosition())
                    break;
                switch (iterator.run.getType()) {
                    case __aspxRichEdit.RunType.FieldCodeStartRun:
                        currFieldIndex++;
                        iterator.setPosition(fields[currFieldIndex].getResultStartPosition());
                        continue;
                    case __aspxRichEdit.RunType.FieldResultEndRun:
                        iterator.setPosition(fields[currFieldIndex].getFieldEndPosition());
                        continue;
                    case __aspxRichEdit.RunType.TextRun:
                        result += iterator.chunk.getRunText(iterator.run);
                }
            } while (iterator.moveToNextRun());
            return result;
        };
        FieldContextMenuHelper.showUpdateAndToogleCodeItems = function (fields, intervals) {
            if (fields.length == 0)
                return false;
            for (var intervalIndex = 0, interval; interval = intervals[intervalIndex]; intervalIndex++) {
                var intervalEnd = interval.end;
                var fieldIndex = Math.max(0, __aspxRichEdit.Field.normedBinaryIndexOf(fields, interval.start + 1));
                var field = fields[fieldIndex].getAbsolutelyTopLevelField();
                var topLevelField = field;
                for (fieldIndex = field.index; field = fields[fieldIndex]; fieldIndex++) {
                    if (field.showCode ? field.getSeparatorPosition() < interval.start : field.getResultEndPosition() < interval.start)
                        continue;
                    if (field.showCode ? field.getFieldStartPosition() >= intervalEnd : field.getResultStartPosition() > intervalEnd)
                        break;
                    return true;
                }
                if (topLevelField.getFieldStartPosition() == interval.start)
                    return true;
            }
            return false;
        };
        FieldContextMenuHelper.showCreateHyperlinkItem = function (fields, interval) {
            if (fields.length == 0)
                return true;
            var intervalEnd = interval.end;
            var fieldIndex = Math.max(0, __aspxRichEdit.Field.normedBinaryIndexOf(fields, interval.start + 1));
            var field = fields[fieldIndex].getAbsolutelyTopLevelField();
            for (fieldIndex = field.index; field = fields[fieldIndex]; fieldIndex++) {
                if (field.getFieldStartPosition() >= intervalEnd)
                    break;
                if (field.getFieldEndPosition() <= interval.start)
                    continue;
                return false;
            }
            return true;
        };
        FieldContextMenuHelper.showHyperlinkItems = function (fields, interval) {
            if (fields.length == 0)
                return null;
            var fieldIndex = Math.max(0, __aspxRichEdit.Field.normedBinaryIndexOf(fields, interval.start + 1));
            var field = fields[fieldIndex];
            if (interval.length == 0) {
                do {
                    if (field.getAllFieldIntervalWithoutBorders().containsWithIntervalEnd(interval.start))
                        return field.isHyperlinkField() ? field : null;
                    field = field.parent;
                } while (field);
                return null;
            }
            if (__aspxRichEdit.IntervalAlgorithms.getIntersection(field.getAllFieldIntervalWithoutBorders(), interval))
                return FieldContextMenuHelper.getFinalResult(fields, interval, field);
            var parent = field.parent;
            if (parent) {
                if (__aspxRichEdit.IntervalAlgorithms.getIntersection(parent.getAllFieldIntervalWithoutBorders(), interval))
                    return FieldContextMenuHelper.getFinalResult(fields, interval, parent);
                else {
                    field = FieldContextMenuHelper.getNextTopLevelField(fields, field.index);
                    if (!field)
                        return null;
                    return __aspxRichEdit.IntervalAlgorithms.getIntersection(field.getAllFieldIntervalWithoutBorders(), interval) ? FieldContextMenuHelper.getFinalResult(fields, interval, field) : null;
                }
            }
            if (interval.start <= field.getFieldStartPosition())
                return null;
            field = FieldContextMenuHelper.getNextTopLevelField(fields, field.index);
            if (!field)
                return null;
            return __aspxRichEdit.IntervalAlgorithms.getIntersection(field.getAllFieldIntervalWithoutBorders(), interval) ? FieldContextMenuHelper.getFinalResult(fields, interval, field) : null;
        };
        FieldContextMenuHelper.getNextTopLevelField = function (fields, fieldIndex) {
            var field;
            for (fieldIndex++; field = fields[fieldIndex]; fieldIndex++)
                if (!field.parent)
                    break;
            return field;
        };
        FieldContextMenuHelper.getFinalResult = function (fields, interval, field) {
            if (!field)
                return null;
            if (!field.isHyperlinkField())
                return null;
            var nextTopLevelField = FieldContextMenuHelper.getNextTopLevelField(fields, field.index);
            if (nextTopLevelField && nextTopLevelField.getCodeStartPosition() <= interval.end)
                return null;
            return field;
        };
        return FieldContextMenuHelper;
    }());
    __aspxRichEdit.FieldContextMenuHelper = FieldContextMenuHelper;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FormFieldProperties = (function () {
        function FormFieldProperties() {
        }
        FormFieldProperties.prototype.calculateHash = function () {
            return __aspxRichEdit.StringUtils.stringHashCode(this.name) ^
                __aspxRichEdit.MathUtils.somePrimes[0] * this.statusTextType;
        };
        FormFieldProperties.prototype.equals = function (obj) {
            return obj &&
                this.name == obj.name &&
                this.enabled == obj.enabled &&
                this.calculateOnExit == obj.calculateOnExit &&
                this.helpTextType == obj.helpTextType &&
                this.helpText == obj.helpText &&
                this.statusTextType == obj.statusTextType &&
                this.statusText == obj.statusText &&
                this.entryMacro == obj.entryMacro &&
                this.exitMacro == obj.exitMacro;
        };
        FormFieldProperties.prototype.getHashCode = function () {
            return this.hash === undefined ? this.hash = this.calculateHash() : this.hash;
        };
        return FormFieldProperties;
    }());
    __aspxRichEdit.FormFieldProperties = FormFieldProperties;
    var FormFieldPropertiesMask;
    (function (FormFieldPropertiesMask) {
        FormFieldPropertiesMask[FormFieldPropertiesMask["UseNone"] = 0] = "UseNone";
        FormFieldPropertiesMask[FormFieldPropertiesMask["UseName"] = 4] = "UseName";
        FormFieldPropertiesMask[FormFieldPropertiesMask["UseEnabled"] = 8] = "UseEnabled";
        FormFieldPropertiesMask[FormFieldPropertiesMask["UseCalculateOnExit"] = 16] = "UseCalculateOnExit";
        FormFieldPropertiesMask[FormFieldPropertiesMask["UseHelpTextType"] = 32] = "UseHelpTextType";
        FormFieldPropertiesMask[FormFieldPropertiesMask["UseHelpText"] = 64] = "UseHelpText";
        FormFieldPropertiesMask[FormFieldPropertiesMask["UseStatusTextType"] = 128] = "UseStatusTextType";
        FormFieldPropertiesMask[FormFieldPropertiesMask["UseStatusText"] = 256] = "UseStatusText";
        FormFieldPropertiesMask[FormFieldPropertiesMask["UseEntryMacro"] = 512] = "UseEntryMacro";
        FormFieldPropertiesMask[FormFieldPropertiesMask["UseExitMacro"] = 1024] = "UseExitMacro";
        FormFieldPropertiesMask[FormFieldPropertiesMask["UseAll"] = 2147483647] = "UseAll";
    })(FormFieldPropertiesMask = __aspxRichEdit.FormFieldPropertiesMask || (__aspxRichEdit.FormFieldPropertiesMask = {}));
    var MaskedFormFieldProperties = (function (_super) {
        __extends(MaskedFormFieldProperties, _super);
        function MaskedFormFieldProperties() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.useValue = FormFieldPropertiesMask.UseNone;
            return _this;
        }
        MaskedFormFieldProperties.prototype.calculateHash = function () {
            return _super.prototype.calculateHash.call(this) +
                __aspxRichEdit.MathUtils.somePrimes[15] * this.useValue;
        };
        MaskedFormFieldProperties.prototype.getUseValue = function (value) {
            return (this.useValue & value) != 0;
        };
        MaskedFormFieldProperties.prototype.setUseValue = function (mask, value) {
            if (value)
                this.useValue |= mask;
            else
                this.useValue &= ~mask;
        };
        MaskedFormFieldProperties.prototype.equals = function (obj) {
            return _super.prototype.equals.call(this, obj) &&
                this.useValue == obj.useValue;
        };
        return MaskedFormFieldProperties;
    }(FormFieldProperties));
    __aspxRichEdit.MaskedFormFieldProperties = MaskedFormFieldProperties;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ServerUpdateFieldType;
    (function (ServerUpdateFieldType) {
        ServerUpdateFieldType[ServerUpdateFieldType["DocVariable"] = 1] = "DocVariable";
        ServerUpdateFieldType[ServerUpdateFieldType["MergeField"] = 2] = "MergeField";
    })(ServerUpdateFieldType = __aspxRichEdit.ServerUpdateFieldType || (__aspxRichEdit.ServerUpdateFieldType = {}));
    var FieldParsersAndIntervals = (function () {
        function FieldParsersAndIntervals(interval) {
            this.interval = interval;
            this.parsers = [];
            this.updated = false;
        }
        FieldParsersAndIntervals.prototype.destructor = function (manager) {
            this.interval.destructor(manager);
        };
        return FieldParsersAndIntervals;
    }());
    var RequestInfo = (function () {
        function RequestInfo(type, data, fieldID) {
            this.type = type;
            this.data = data;
            this.fieldID = fieldID;
        }
        return RequestInfo;
    }());
    var FieldsWaitingForUpdate = (function () {
        function FieldsWaitingForUpdate(control, subDocument, intervals, updateOptions, callbackFunc, topLevelUpdate) {
            if (topLevelUpdate === void 0) { topLevelUpdate = true; }
            var _this = this;
            this.infoForFutureUpdate = [];
            this.savedSelectionIntervals = [];
            this.requests = [];
            this.callbackFunc = callbackFunc;
            this.control = control;
            this.subDocument = subDocument;
            this.updateOptions = updateOptions;
            this.fields = this.subDocument.fields;
            this.topLevelUpdate = topLevelUpdate;
            if (this.topLevelUpdate)
                this.subDocument.fieldsWaitingForUpdate = this;
            this.needCallEndUpdate = false;
            this.infoForFutureUpdate = __aspxRichEdit.ListUtils.map(intervals, function (interval) {
                return new FieldParsersAndIntervals(interval.getLinkedInterval(_this.subDocument.positionManager));
            });
            this.savedSelectionIntervals = __aspxRichEdit.ListUtils.map(intervals, function (interval) {
                return interval.getLinkedInterval(_this.subDocument.positionManager);
            });
        }
        FieldsWaitingForUpdate.prototype.addRequest = function (type, data, fieldID) {
            this.requests.push(new RequestInfo(type, data, fieldID));
        };
        FieldsWaitingForUpdate.prototype.update = function (responce) {
            if (this.fields.length == 0)
                return;
            this.updateChesks(responce);
            this.requests = [];
            this.needCallEndUpdate = !!responce;
            if (this.needCallEndUpdate)
                this.control.beginUpdate();
            else
                this.startAction();
            var countUpdatedInfos = 0;
            for (var infoIndex = 0, info; info = this.infoForFutureUpdate[infoIndex]; infoIndex++) {
                if (info.updated) {
                    countUpdatedInfos++;
                    continue;
                }
                if (info.parsers.length > 0) {
                    if (this.continueUpdateCurrentInterval(info.parsers, responce)) {
                        info.updated = true;
                        countUpdatedInfos++;
                    }
                    continue;
                }
                var fieldIndex = Math.max(0, __aspxRichEdit.Field.normedBinaryIndexOf(this.fields, info.interval.start + 1));
                var field = this.fields[fieldIndex];
                while (!field.getAllFieldInterval().containsWithIntervalEnd(info.interval.start) && field.parent)
                    field = field.parent;
                var startParent = field.parent;
                var someFieldInCurrentInfoNotUpdated = false;
                var skipAllBefore = __aspxRichEdit.Constants.MIN_SAFE_INTEGER;
                for (fieldIndex = field.index; field = this.fields[fieldIndex]; fieldIndex++) {
                    if (field.getFieldStartPosition() < skipAllBefore)
                        continue;
                    else
                        skipAllBefore = __aspxRichEdit.Constants.MIN_SAFE_INTEGER;
                    if (field.getFieldStartPosition() >= info.interval.end)
                        break;
                    if (field.getFieldEndPosition() <= info.interval.start ||
                        (field.parent != null && field.parent != startParent) ||
                        !this.subDocument.isEditable([field.getAllFieldInterval()]))
                        continue;
                    var fieldParser = __aspxRichEdit.FieldParserFabric.getParser(this.control, this.subDocument, field);
                    if (fieldParser instanceof __aspxRichEdit.FieldCodeParserToc && !this.updateOptions.updateToc) {
                        skipAllBefore = field.getFieldEndPosition();
                        fieldParser.destructor();
                        continue;
                    }
                    if (fieldParser) {
                        if (!fieldParser.update(responce)) {
                            someFieldInCurrentInfoNotUpdated = true;
                            info.parsers.push(fieldParser);
                        }
                        else
                            fieldParser.destructor();
                    }
                    else {
                        var resultInterval = field.getResultInterval();
                        if (resultInterval.length > 0) {
                            this.control.history.beginTransaction();
                            __aspxRichEdit.ModelManipulator.removeInterval(this.control, this.subDocument, resultInterval, true, false);
                            __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(this.control, this.subDocument, new __aspxRichEdit.FixedInterval(resultInterval.start, 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, this.control.selection.endOfLine, __aspxRichEdit.ModelScrollManager.DontChangeScrollPosition);
                            this.control.history.endTransaction();
                        }
                        __aspxRichEdit.FieldCodeParser.finalAction(field, this.control, this.subDocument);
                    }
                }
                if (!someFieldInCurrentInfoNotUpdated) {
                    info.updated = true;
                    countUpdatedInfos++;
                }
            }
            if (this.needCallEndUpdate) {
                this.control.endUpdate();
                this.needCallEndUpdate = false;
            }
            if (this.infoForFutureUpdate.length != countUpdatedInfos)
                this.sentRequest();
            else
                this.endAction();
        };
        FieldsWaitingForUpdate.prototype.updateChesks = function (responce) {
            if (this.requests.length > 1 && !responce ||
                this.requests.length == 0 && responce)
                throw new Error(__aspxRichEdit.Errors.InternalException);
            for (var i = 0, requestInfo; requestInfo = this.requests[i]; i++) {
                if (!responce[requestInfo.fieldID])
                    throw new Error(__aspxRichEdit.Errors.InternalException);
            }
        };
        FieldsWaitingForUpdate.prototype.startAction = function () {
            if (this.topLevelUpdate) {
                this.control.beginLoading();
                this.control.history.beginTransaction();
            }
        };
        FieldsWaitingForUpdate.prototype.endAction = function () {
            if (this.needCallEndUpdate) {
                this.control.endUpdate();
                this.needCallEndUpdate = false;
            }
            for (var i = 0, savedSelectionInterval; savedSelectionInterval = this.savedSelectionIntervals[i]; i++) {
                if (i == 0)
                    this.control.selection.deprecatedSetSelection(savedSelectionInterval.start, savedSelectionInterval.end, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes, true, true, __aspxRichEdit.ModelScrollManager.DontChangeScrollPosition);
                else
                    this.control.selection.addSelection(savedSelectionInterval.start, savedSelectionInterval.end, false, -1, true, __aspxRichEdit.ModelScrollManager.DontChangeScrollPosition);
                savedSelectionInterval.destructor(this.subDocument.positionManager);
            }
            for (var i = 0, info; info = this.infoForFutureUpdate[i]; i++)
                info.destructor(this.subDocument.positionManager);
            this.infoForFutureUpdate = [];
            if (this.topLevelUpdate) {
                this.control.history.endTransaction();
                this.control.endLoading();
                this.subDocument.fieldsWaitingForUpdate = null;
            }
            if (this.callbackFunc)
                this.callbackFunc();
            __aspxRichEdit.Field.DEBUG_FIELDS_CHECKS(this.subDocument);
        };
        FieldsWaitingForUpdate.prototype.continueUpdateCurrentInterval = function (fieldParsers, responce) {
            var allFieldUpdated = true;
            for (var parserIndex = 0, parser; parser = fieldParsers[parserIndex]; parserIndex++) {
                if (parser.update(responce)) {
                    parser.destructor();
                    fieldParsers.splice(parserIndex, 1);
                    parserIndex--;
                }
                else
                    allFieldUpdated = false;
            }
            return allFieldUpdated;
        };
        FieldsWaitingForUpdate.prototype.sentRequest = function () {
            if (!this.requests)
                throw new Error(__aspxRichEdit.Errors.InternalException);
            var jsonInfo = {};
            for (var i = 0, requestInfo; requestInfo = this.requests[i]; i++) {
                var jsonRequestInfo = {};
                jsonRequestInfo[__aspxRichEdit.JSONUpdateFieldCommandInfo.ServerUpdateFieldType] = requestInfo.type;
                jsonRequestInfo[__aspxRichEdit.JSONUpdateFieldCommandInfo.Data] = requestInfo.data;
                jsonInfo[requestInfo.fieldID] = jsonRequestInfo;
            }
            var sendData = {};
            sendData[__aspxRichEdit.JSONUpdateFieldCommand.ActiveRecord] = this.control.mailMergeOptions.activeRecordIndex;
            sendData[__aspxRichEdit.JSONUpdateFieldCommand.Info] = jsonInfo;
            this.control.serverDispatcher.pushRequest(new __aspxRichEdit.EditCommandRequest(__aspxRichEdit.CommandType.FieldUpdate, this.subDocument.id, sendData), new __aspxRichEdit.RequestParams(false, true, true));
        };
        return FieldsWaitingForUpdate;
    }());
    __aspxRichEdit.FieldsWaitingForUpdate = FieldsWaitingForUpdate;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AnchorInfo = (function () {
        function AnchorInfo() {
            this.allowOverlap = true;
            this.hidden = false;
            this.layoutTableCell = false;
            this.locked = false;
            this.isBehindDoc = false;
            this.leftDistance = 188;
            this.rightDistance = 188;
            this.topDistance = 72;
            this.bottomDistance = 72;
            this.zOrder = 0;
            this.wrapType = __aspxRichEdit.AnchorObjectTextWrapType.Square;
            this.wrapSide = __aspxRichEdit.AnchorObjectTextWrapSide.Both;
            this.horizontalPositionType = __aspxRichEdit.AnchorObjectHorizontalPositionType.Column;
            this.horizontalPositionAlignment = __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Center;
            this.verticalPositionType = __aspxRichEdit.AnchorObjectVerticalPositionType.Paragraph;
            this.verticalPositionAlignment = __aspxRichEdit.AnchorObjectVerticalPositionAlignment.None;
            this.offset = new __aspxRichEdit.Point(0, 0);
            this.percentOffset = new __aspxRichEdit.Point(0, 0);
        }
        Object.defineProperty(AnchorInfo.prototype, "levelType", {
            get: function () {
                return this.wrapType != __aspxRichEdit.AnchorObjectTextWrapType.None ? __aspxRichEdit.AnchoredObjectLevelType.InText :
                    (this.isBehindDoc ? __aspxRichEdit.AnchoredObjectLevelType.BehindText : __aspxRichEdit.AnchoredObjectLevelType.BeforeText);
            },
            enumerable: true,
            configurable: true
        });
        AnchorInfo.prototype.clone = function () {
            var anchorInfo = new AnchorInfo();
            anchorInfo.allowOverlap = this.allowOverlap;
            anchorInfo.hidden = this.hidden;
            anchorInfo.layoutTableCell = this.layoutTableCell;
            anchorInfo.locked = this.locked;
            anchorInfo.isBehindDoc = this.isBehindDoc;
            anchorInfo.leftDistance = this.leftDistance;
            anchorInfo.rightDistance = this.rightDistance;
            anchorInfo.topDistance = this.topDistance;
            anchorInfo.bottomDistance = this.bottomDistance;
            anchorInfo.zOrder = this.zOrder;
            anchorInfo.wrapType = this.wrapType;
            anchorInfo.wrapSide = this.wrapSide;
            anchorInfo.horizontalPositionType = this.horizontalPositionType;
            anchorInfo.horizontalPositionAlignment = this.horizontalPositionAlignment;
            anchorInfo.verticalPositionType = this.verticalPositionType;
            anchorInfo.verticalPositionAlignment = this.verticalPositionAlignment;
            anchorInfo.offset = this.offset.clone();
            anchorInfo.percentOffset = this.percentOffset.clone();
            return anchorInfo;
        };
        AnchorInfo.prototype.equals = function (obj) {
            if (!obj)
                return false;
            return this.allowOverlap == obj.allowOverlap &&
                this.hidden == obj.hidden &&
                this.layoutTableCell == obj.layoutTableCell &&
                this.locked == obj.locked &&
                this.isBehindDoc == obj.isBehindDoc &&
                this.leftDistance == obj.leftDistance &&
                this.rightDistance == obj.rightDistance &&
                this.topDistance == obj.topDistance &&
                this.bottomDistance == obj.bottomDistance &&
                this.zOrder == obj.zOrder &&
                this.wrapType == obj.wrapType &&
                this.wrapSide == obj.wrapSide &&
                this.horizontalPositionType == obj.horizontalPositionType &&
                this.horizontalPositionAlignment == obj.horizontalPositionAlignment &&
                this.verticalPositionType == obj.verticalPositionType &&
                this.verticalPositionAlignment == obj.verticalPositionAlignment &&
                this.offset.equals(obj.offset) &&
                this.percentOffset.equals(obj.percentOffset);
        };
        AnchorInfo.prototype.isUsedHorizontalAlignment = function () {
            if (!this.horizontalPositionAlignment)
                return false;
            switch (this.horizontalPositionAlignment) {
                case __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Left:
                case __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Center:
                case __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Right:
                    return true;
            }
            return false;
        };
        AnchorInfo.prototype.isUsedHorizontalBookLayout = function () {
            if (!this.horizontalPositionAlignment)
                return false;
            switch (this.horizontalPositionAlignment) {
                case __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Outside:
                case __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Inside:
                    return true;
            }
            return false;
        };
        AnchorInfo.prototype.isUsedHorizontalAbsolutePosition = function () {
            return !this.horizontalPositionAlignment && !this.isUsedHorizontalRelativePosition();
        };
        AnchorInfo.prototype.isUsedHorizontalRelativePosition = function () {
            return this.percentOffset.x > 0;
        };
        AnchorInfo.prototype.isUsedVerticalAlignment = function () {
            return !!this.verticalPositionAlignment;
        };
        AnchorInfo.prototype.isUsedVerticalAbsolutePosition = function () {
            return !this.isUsedVerticalAlignment() && !this.isUsedVerticalRelativePosition();
        };
        AnchorInfo.prototype.isUsedVerticalRelativePosition = function () {
            return this.percentOffset.y > 0;
        };
        AnchorInfo.prototype.getRelativeOffsetX = function (width) {
            return width * this.percentOffset.x / AnchorInfo.RELATIVE_COEFF;
        };
        AnchorInfo.prototype.getRelativeOffsetY = function (width) {
            return width * this.percentOffset.y / AnchorInfo.RELATIVE_COEFF;
        };
        AnchorInfo.prototype.getDistanceMargins = function () {
            return new __aspxRichEdit.Margins(this.leftDistance, this.rightDistance, this.topDistance, this.bottomDistance)
                .toAnotherMeasuringSystem(__aspxRichEdit.UnitConverter.twipsToPixels);
        };
        AnchorInfo.RELATIVE_COEFF = 100000;
        return AnchorInfo;
    }());
    __aspxRichEdit.AnchorInfo = AnchorInfo;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AnchorInlineBaseSize = (function () {
        function AnchorInlineBaseSize(lockAspectRatio, rotation) {
            this.lockAspectRatio = lockAspectRatio;
            this.rotation = rotation;
        }
        AnchorInlineBaseSize.prototype.clone = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        AnchorInlineBaseSize.prototype.copyFrom = function (obj) {
            this.lockAspectRatio = obj.lockAspectRatio;
            this.rotation = obj.rotation;
        };
        AnchorInlineBaseSize.prototype.getActualWidth = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        AnchorInlineBaseSize.prototype.getActualHeight = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return AnchorInlineBaseSize;
    }());
    __aspxRichEdit.AnchorInlineBaseSize = AnchorInlineBaseSize;
    var PictureSize = (function (_super) {
        __extends(PictureSize, _super);
        function PictureSize(lockAspectRatio, rotation, originalSize, scale) {
            var _this = _super.call(this, lockAspectRatio, rotation) || this;
            _this.originalSize = originalSize;
            _this.scale = scale;
            return _this;
        }
        PictureSize.prototype.getActualWidth = function () {
            return this.originalSize.width * this.scale.width / 100;
        };
        PictureSize.prototype.getActualHeight = function () {
            return this.originalSize.height * this.scale.height / 100;
        };
        PictureSize.prototype.clone = function () {
            return new PictureSize(this.lockAspectRatio, this.rotation, this.originalSize.clone(), this.scale.clone());
        };
        PictureSize.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.originalSize = obj.originalSize.clone();
            this.scale = obj.scale.clone();
        };
        return PictureSize;
    }(AnchorInlineBaseSize));
    __aspxRichEdit.PictureSize = PictureSize;
    var InlineTextBoxSize = (function (_super) {
        __extends(InlineTextBoxSize, _super);
        function InlineTextBoxSize(lockAspectRatio, rotation, absoluteSize) {
            var _this = _super.call(this, lockAspectRatio, rotation) || this;
            _this.absoluteSize = absoluteSize;
            return _this;
        }
        InlineTextBoxSize.prototype.getActualWidth = function () {
            return this.absoluteSize.width;
        };
        InlineTextBoxSize.prototype.getActualHeight = function () {
            return this.absoluteSize.height;
        };
        InlineTextBoxSize.prototype.clone = function () {
            return new InlineTextBoxSize(this.lockAspectRatio, this.rotation, this.absoluteSize);
        };
        InlineTextBoxSize.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.absoluteSize = obj.absoluteSize.clone();
        };
        return InlineTextBoxSize;
    }(AnchorInlineBaseSize));
    __aspxRichEdit.InlineTextBoxSize = InlineTextBoxSize;
    var AnchorTextBoxSize = (function (_super) {
        __extends(AnchorTextBoxSize, _super);
        function AnchorTextBoxSize(lockAspectRatio, rotation, absoluteSize, relativeSize, relativeWidthType, relativeHeightType, useAbsoluteSizeWidth, useAbsoluteSizeHeight) {
            var _this = _super.call(this, lockAspectRatio, rotation, absoluteSize) || this;
            _this.flags = new __aspxRichEdit.Flag();
            _this.relativeSize = relativeSize;
            _this.relativeWidthType = relativeWidthType;
            _this.relativeHeightType = relativeHeightType;
            _this.flags.set(useAbsoluteSizeWidth ? TextBoxSizeFlags.UseAbsoluteSizeWidth : TextBoxSizeFlags.UseRelativeSizeWidth, true);
            _this.flags.set(useAbsoluteSizeHeight ? TextBoxSizeFlags.UseAbsoluteSizeHeight : TextBoxSizeFlags.UseRelativeSizeHeight, true);
            return _this;
        }
        AnchorTextBoxSize.prototype.useAbsoluteWidth = function () {
            return this.flags.get(TextBoxSizeFlags.UseAbsoluteSizeWidth);
        };
        AnchorTextBoxSize.prototype.useAbsoluteHeight = function () {
            return this.flags.get(TextBoxSizeFlags.UseAbsoluteSizeHeight);
        };
        AnchorTextBoxSize.prototype.setUseAbsoluteWidth = function (isUsed) {
            this.flags.set(TextBoxSizeFlags.UseAbsoluteSizeWidth, isUsed);
            this.flags.set(TextBoxSizeFlags.UseRelativeSizeWidth, !isUsed);
        };
        AnchorTextBoxSize.prototype.setUseAbsoluteHeight = function (isUsed) {
            this.flags.set(TextBoxSizeFlags.UseAbsoluteSizeHeight, isUsed);
            this.flags.set(TextBoxSizeFlags.UseRelativeSizeHeight, !isUsed);
        };
        AnchorTextBoxSize.prototype.getActualWidth = function () {
            if (this.flags.get(TextBoxSizeFlags.UseRelativeSizeWidth))
                throw new Error(__aspxRichEdit.Errors.InternalException);
            return this.absoluteSize.width;
        };
        AnchorTextBoxSize.prototype.getActualHeight = function () {
            if (this.flags.get(TextBoxSizeFlags.UseRelativeSizeHeight))
                throw new Error(__aspxRichEdit.Errors.InternalException);
            return this.absoluteSize.height;
        };
        AnchorTextBoxSize.prototype.getActualRelativeHeight = function (boundsCalculator) {
            return this.relativeSize.height * this.getAbsHeight(boundsCalculator) / AnchorTextBoxSize.RELATIVE_COEFF;
        };
        AnchorTextBoxSize.prototype.getActualRelativeWidth = function (boundsCalculator) {
            return this.relativeSize.width * this.getAbsWidth(boundsCalculator) / AnchorTextBoxSize.RELATIVE_COEFF;
        };
        AnchorTextBoxSize.prototype.getAbsWidth = function (boundsCalculator) {
            switch (this.relativeWidthType) {
                case __aspxRichEdit.RelativeWidthType.Margin:
                    return boundsCalculator.pageWidth - boundsCalculator.marginLeft - boundsCalculator.marginRight;
                case __aspxRichEdit.RelativeWidthType.OutsideMargin:
                case __aspxRichEdit.RelativeWidthType.LeftMargin:
                    return boundsCalculator.marginLeft;
                case __aspxRichEdit.RelativeWidthType.InsideMargin:
                case __aspxRichEdit.RelativeWidthType.RightMargin:
                    return boundsCalculator.marginRight;
                case __aspxRichEdit.RelativeWidthType.Page:
                    return boundsCalculator.pageWidth;
                default: throw new Error(__aspxRichEdit.Errors.InternalException);
            }
        };
        AnchorTextBoxSize.prototype.getAbsHeight = function (boundsCalculator) {
            switch (this.relativeHeightType) {
                case __aspxRichEdit.RelativeHeightType.Margin:
                    return boundsCalculator.pageHeight - boundsCalculator.marginTop - boundsCalculator.marginBottom;
                case __aspxRichEdit.RelativeHeightType.InsideMargin:
                case __aspxRichEdit.RelativeHeightType.TopMargin:
                    return boundsCalculator.marginTop;
                case __aspxRichEdit.RelativeHeightType.OutsideMargin:
                case __aspxRichEdit.RelativeHeightType.BottomMargin:
                    return boundsCalculator.marginBottom;
                case __aspxRichEdit.RelativeHeightType.Page:
                    return boundsCalculator.pageHeight;
                default: throw new Error(__aspxRichEdit.Errors.InternalException);
            }
        };
        AnchorTextBoxSize.prototype.clone = function () {
            return new AnchorTextBoxSize(this.lockAspectRatio, this.rotation, this.absoluteSize.clone(), this.relativeSize.clone(), this.relativeWidthType, this.relativeHeightType, this.flags.get(TextBoxSizeFlags.UseAbsoluteSizeWidth), this.flags.get(TextBoxSizeFlags.UseAbsoluteSizeHeight));
        };
        AnchorTextBoxSize.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.relativeSize = obj.relativeSize.clone();
            this.relativeHeightType = obj.relativeHeightType;
            this.relativeWidthType = obj.relativeWidthType;
        };
        AnchorTextBoxSize.RELATIVE_COEFF = 100000;
        return AnchorTextBoxSize;
    }(InlineTextBoxSize));
    __aspxRichEdit.AnchorTextBoxSize = AnchorTextBoxSize;
    var TextBoxSizeFlags;
    (function (TextBoxSizeFlags) {
        TextBoxSizeFlags[TextBoxSizeFlags["UseAbsoluteSizeWidth"] = 2] = "UseAbsoluteSizeWidth";
        TextBoxSizeFlags[TextBoxSizeFlags["UseAbsoluteSizeHeight"] = 4] = "UseAbsoluteSizeHeight";
        TextBoxSizeFlags[TextBoxSizeFlags["UseRelativeSizeWidth"] = 8] = "UseRelativeSizeWidth";
        TextBoxSizeFlags[TextBoxSizeFlags["UseRelativeSizeHeight"] = 16] = "UseRelativeSizeHeight";
    })(TextBoxSizeFlags = __aspxRichEdit.TextBoxSizeFlags || (__aspxRichEdit.TextBoxSizeFlags = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TextBoxProperties = (function () {
        function TextBoxProperties(contentMargins) {
            this.resizeShapeToFitText = true;
            this.upright = false;
            this.verticalAlignment = __aspxRichEdit.DrawingTextAnchoringType.Top;
            this.wrapText = true;
            this.leftMargin = 0;
            this.rightMargin = 0;
            this.topMargin = 0;
            this.bottomMargin = 0;
            if (contentMargins) {
                this.leftMargin = contentMargins.left;
                this.rightMargin = contentMargins.right;
                this.topMargin = contentMargins.top;
                this.bottomMargin = contentMargins.bottom;
            }
        }
        TextBoxProperties.prototype.clone = function () {
            var textBoxProperties = new TextBoxProperties();
            textBoxProperties.resizeShapeToFitText = this.resizeShapeToFitText;
            textBoxProperties.upright = this.upright;
            textBoxProperties.verticalAlignment = this.verticalAlignment;
            textBoxProperties.wrapText = this.wrapText;
            textBoxProperties.leftMargin = this.leftMargin;
            textBoxProperties.rightMargin = this.rightMargin;
            textBoxProperties.topMargin = this.topMargin;
            textBoxProperties.bottomMargin = this.bottomMargin;
            return textBoxProperties;
        };
        TextBoxProperties.prototype.equals = function (obj) {
            if (!obj)
                return false;
            return obj.resizeShapeToFitText === this.resizeShapeToFitText &&
                obj.upright === obj.upright &&
                obj.verticalAlignment === this.verticalAlignment &&
                obj.wrapText === this.wrapText &&
                obj.leftMargin === this.leftMargin &&
                obj.rightMargin === this.rightMargin &&
                obj.topMargin === this.topMargin &&
                obj.bottomMargin === this.bottomMargin;
        };
        TextBoxProperties.prototype.getContentMargins = function () {
            return new __aspxRichEdit.Margins(this.leftMargin, this.rightMargin, this.topMargin, this.bottomMargin);
        };
        TextBoxProperties.prototype.setMarginsToAnotherMeasuringSystem = function (converter) {
            this.leftMargin = converter(this.leftMargin);
            this.rightMargin = converter(this.rightMargin);
            this.topMargin = converter(this.topMargin);
            this.bottomMargin = converter(this.bottomMargin);
            return this;
        };
        return TextBoxProperties;
    }());
    __aspxRichEdit.TextBoxProperties = TextBoxProperties;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ApplyFieldHyperlinkStyleHistoryItem = (function (_super) {
        __extends(ApplyFieldHyperlinkStyleHistoryItem, _super);
        function ApplyFieldHyperlinkStyleHistoryItem(modelManipulator, boundSubDocument, interval) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, interval) || this;
            _this.historyItems = [];
            return _this;
        }
        ApplyFieldHyperlinkStyleHistoryItem.prototype.redo = function () {
            if (ApplyFieldHyperlinkStyleHistoryItem.mask === undefined)
                throw new Error("CharacterPropertiesMask defined later than that class");
            if (this.historyItems.length > 0) {
                for (var i = 0, histItem; histItem = this.historyItems[i]; i++)
                    histItem.redo();
                return;
            }
            var charHyperlinkStyle = this.modelManipulator.model.getCharacterStyleByName(__aspxRichEdit.CharacterStyle.hyperlinkStyleName);
            var intervalEnd = this.interval.end;
            this.boundSubDocument.splitRun(this.interval.start);
            this.boundSubDocument.splitRun(intervalEnd);
            var modelIterator = new __aspxRichEdit.ModelIterator(this.boundSubDocument, false);
            modelIterator.setPosition(this.interval.start);
            var histItem;
            do {
                var run = modelIterator.run;
                var runMergedProperties = run.getCharacterMergedProperies();
                var runInterval = new __aspxRichEdit.FixedInterval(modelIterator.chunk.startLogPosition.value + run.startOffset, run.getLength());
                histItem = new __aspxRichEdit.ApplyCharacterStyleHistoryItem(this.modelManipulator, this.boundSubDocument, this.interval, charHyperlinkStyle, false);
                histItem.redo();
                this.historyItems.push(histItem);
                for (var i = 0, histInfo; histInfo = __aspxRichEdit.PropertiesWhatNeedSetWhenCreateHyperlinkField.info[i]; i++) {
                    histItem = new histInfo.historyItemType(this.modelManipulator, this.boundSubDocument, runInterval, runMergedProperties[histInfo.propertyName], true);
                    histItem.redo();
                    this.historyItems.push(histItem);
                }
                histItem = new __aspxRichEdit.FontUseValueHistoryItem(this.modelManipulator, this.boundSubDocument, runInterval, ApplyFieldHyperlinkStyleHistoryItem.mask);
                histItem.redo();
                this.historyItems.push(histItem);
            } while (runInterval.start < intervalEnd && modelIterator.moveToNextRun());
        };
        ApplyFieldHyperlinkStyleHistoryItem.prototype.undo = function () {
            for (var i = this.historyItems.length - 1, histItem; histItem = this.historyItems[i]; i--)
                histItem.undo();
            this.boundSubDocument.splitRun(this.interval.start);
            this.boundSubDocument.splitRun(this.interval.end);
            var modelIterator = new __aspxRichEdit.ModelIterator(this.boundSubDocument, false);
            modelIterator.setPosition(this.interval.start);
            do {
            } while (modelIterator.chunk.startLogPosition.value + modelIterator.run.startOffset < this.interval.end && modelIterator.moveToNextRun());
        };
        ApplyFieldHyperlinkStyleHistoryItem.mask = __aspxRichEdit.CharacterPropertiesMask.UseAll & ~(__aspxRichEdit.CharacterPropertiesMask.UseFontUnderlineType | __aspxRichEdit.CharacterPropertiesMask.UseForeColorIndex);
        return ApplyFieldHyperlinkStyleHistoryItem;
    }(__aspxRichEdit.IntervalBasedHistoryItem));
    __aspxRichEdit.ApplyFieldHyperlinkStyleHistoryItem = ApplyFieldHyperlinkStyleHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ApplyCharacterStyleHistoryItem = (function (_super) {
        __extends(ApplyCharacterStyleHistoryItem, _super);
        function ApplyCharacterStyleHistoryItem(modelManipulator, boundSubDocument, interval, style, restoreHyperlinks) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, interval) || this;
            _this.newStyle = style;
            _this.restoreHyperlinks = restoreHyperlinks;
            return _this;
        }
        ApplyCharacterStyleHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.styles.setCharacterStyle(this.boundSubDocument, this.interval, this.newStyle, this.restoreHyperlinks);
        };
        ApplyCharacterStyleHistoryItem.prototype.undo = function () {
            this.modelManipulator.styles.restoreCharacterStyle(this.boundSubDocument, this.oldState);
        };
        return ApplyCharacterStyleHistoryItem;
    }(__aspxRichEdit.IntervalBasedHistoryItem));
    __aspxRichEdit.ApplyCharacterStyleHistoryItem = ApplyCharacterStyleHistoryItem;
    var ApplyParagraphStyleHistoryItem = (function (_super) {
        __extends(ApplyParagraphStyleHistoryItem, _super);
        function ApplyParagraphStyleHistoryItem(modelManipulator, boundSubDocument, interval, style) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, interval) || this;
            _this.newStyle = style;
            return _this;
        }
        ApplyParagraphStyleHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.styles.setParagraphStyle(this.boundSubDocument, this.interval, this.newStyle);
        };
        ApplyParagraphStyleHistoryItem.prototype.undo = function () {
            this.modelManipulator.styles.restoreParagraphStyle(this.boundSubDocument, this.oldState);
        };
        return ApplyParagraphStyleHistoryItem;
    }(__aspxRichEdit.IntervalBasedHistoryItem));
    __aspxRichEdit.ApplyParagraphStyleHistoryItem = ApplyParagraphStyleHistoryItem;
    var ApplyTableStyleHistoryItem = (function (_super) {
        __extends(ApplyTableStyleHistoryItem, _super);
        function ApplyTableStyleHistoryItem(modelManipulator, boundSubDocument, tableIndex, style) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.newStyle = style;
            _this.tableIndex = tableIndex;
            return _this;
        }
        ApplyTableStyleHistoryItem.prototype.redo = function () {
            this.oldStyle = this.boundSubDocument.tables[this.tableIndex].style;
            this.modelManipulator.tables.setTableStyle(this.boundSubDocument, this.tableIndex, this.newStyle);
        };
        ApplyTableStyleHistoryItem.prototype.undo = function () {
            this.modelManipulator.tables.setTableStyle(this.boundSubDocument, this.tableIndex, this.oldStyle);
        };
        return ApplyTableStyleHistoryItem;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.ApplyTableStyleHistoryItem = ApplyTableStyleHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var BookmarkHistoryItemBase = (function (_super) {
        __extends(BookmarkHistoryItemBase, _super);
        function BookmarkHistoryItemBase(modelManipulator, boundSubDocument, bkmTemplate) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.bkmTemplate = bkmTemplate;
            return _this;
        }
        return BookmarkHistoryItemBase;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.BookmarkHistoryItemBase = BookmarkHistoryItemBase;
    var CreateBookmarkHistoryItem = (function (_super) {
        __extends(CreateBookmarkHistoryItem, _super);
        function CreateBookmarkHistoryItem(modelManipulator, boundSubDocument, bkmTemplate) {
            return _super.call(this, modelManipulator, boundSubDocument, bkmTemplate) || this;
        }
        CreateBookmarkHistoryItem.prototype.redo = function () {
            this.modelManipulator.bookmarksManipulator.createBookmark(this.boundSubDocument, this.bkmTemplate, true);
        };
        CreateBookmarkHistoryItem.prototype.undo = function () {
            this.modelManipulator.bookmarksManipulator.deleteBookmark(this.boundSubDocument, this.bkmTemplate);
        };
        return CreateBookmarkHistoryItem;
    }(BookmarkHistoryItemBase));
    __aspxRichEdit.CreateBookmarkHistoryItem = CreateBookmarkHistoryItem;
    var DeleteBookmarkHistoryItem = (function (_super) {
        __extends(DeleteBookmarkHistoryItem, _super);
        function DeleteBookmarkHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DeleteBookmarkHistoryItem.prototype.redo = function () {
            this.modelManipulator.bookmarksManipulator.deleteBookmark(this.boundSubDocument, this.bkmTemplate);
        };
        DeleteBookmarkHistoryItem.prototype.undo = function () {
            this.modelManipulator.bookmarksManipulator.createBookmark(this.boundSubDocument, this.bkmTemplate, true);
        };
        return DeleteBookmarkHistoryItem;
    }(BookmarkHistoryItemBase));
    __aspxRichEdit.DeleteBookmarkHistoryItem = DeleteBookmarkHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeFieldHyperlinkInfoHistoryItem = (function (_super) {
        __extends(ChangeFieldHyperlinkInfoHistoryItem, _super);
        function ChangeFieldHyperlinkInfoHistoryItem(modelManipulator, boundSubDocument, fieldIndex, newInfo) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.newInfo = newInfo;
            _this.fieldIndex = fieldIndex;
            return _this;
        }
        ChangeFieldHyperlinkInfoHistoryItem.prototype.redo = function () {
            this.oldInfo = this.modelManipulator.fieldsManipulator.setHyperlinkInfo(this.boundSubDocument, this.fieldIndex, this.newInfo);
        };
        ChangeFieldHyperlinkInfoHistoryItem.prototype.undo = function () {
            this.modelManipulator.fieldsManipulator.setHyperlinkInfo(this.boundSubDocument, this.fieldIndex, this.oldInfo);
        };
        return ChangeFieldHyperlinkInfoHistoryItem;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.ChangeFieldHyperlinkInfoHistoryItem = ChangeFieldHyperlinkInfoHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeRectangularObjectScaleHistoryItem = (function (_super) {
        __extends(ChangeRectangularObjectScaleHistoryItem, _super);
        function ChangeRectangularObjectScaleHistoryItem(modelManipulator, boundSubDocument, interval, scale) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, interval) || this;
            _this.scale = scale;
            return _this;
        }
        ChangeRectangularObjectScaleHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.inlineObjectManipulator.scale.setValue(this.boundSubDocument, this.interval, this.scale);
        };
        ChangeRectangularObjectScaleHistoryItem.prototype.undo = function () {
            this.modelManipulator.inlineObjectManipulator.scale.restoreValue(this.boundSubDocument, this.oldState);
        };
        return ChangeRectangularObjectScaleHistoryItem;
    }(__aspxRichEdit.IntervalBasedHistoryItem));
    __aspxRichEdit.ChangeRectangularObjectScaleHistoryItem = ChangeRectangularObjectScaleHistoryItem;
    var ChangeRectangularObjectLockAspectRatioHistoryItem = (function (_super) {
        __extends(ChangeRectangularObjectLockAspectRatioHistoryItem, _super);
        function ChangeRectangularObjectLockAspectRatioHistoryItem(modelManipulator, boundSubDocument, interval, lockAspectRatio) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, interval) || this;
            _this.lockAspectRatio = lockAspectRatio;
            return _this;
        }
        ChangeRectangularObjectLockAspectRatioHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.inlineObjectManipulator.lockAspectRatio.setValue(this.boundSubDocument, this.interval, this.lockAspectRatio);
        };
        ChangeRectangularObjectLockAspectRatioHistoryItem.prototype.undo = function () {
            this.modelManipulator.inlineObjectManipulator.lockAspectRatio.restoreValue(this.boundSubDocument, this.oldState);
        };
        return ChangeRectangularObjectLockAspectRatioHistoryItem;
    }(__aspxRichEdit.IntervalBasedHistoryItem));
    __aspxRichEdit.ChangeRectangularObjectLockAspectRatioHistoryItem = ChangeRectangularObjectLockAspectRatioHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FontUseValueHistoryItem = (function (_super) {
        __extends(FontUseValueHistoryItem, _super);
        function FontUseValueHistoryItem(modelManipulator, boundSubDocument, interval, newValue) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, interval) || this;
            _this.newValue = newValue;
            return _this;
        }
        FontUseValueHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.characterPropertiesManipulator.useValue.setValue(this.boundSubDocument, this.interval, this.newValue);
        };
        FontUseValueHistoryItem.prototype.undo = function () {
            this.modelManipulator.characterPropertiesManipulator.useValue.restoreValue(this.boundSubDocument, this.oldState);
        };
        return FontUseValueHistoryItem;
    }(__aspxRichEdit.IntervalBasedHistoryItem));
    __aspxRichEdit.FontUseValueHistoryItem = FontUseValueHistoryItem;
    var CharacterPropertiesHistoryItem = (function (_super) {
        __extends(CharacterPropertiesHistoryItem, _super);
        function CharacterPropertiesHistoryItem(modelManipulator, boundSubDocument, interval, newValue) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, interval) || this;
            _this.newValue = newValue;
            return _this;
        }
        CharacterPropertiesHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.characterPropertiesManipulator.setValue(this.boundSubDocument, this.interval, this.newValue);
        };
        CharacterPropertiesHistoryItem.prototype.undo = function () {
            this.modelManipulator.characterPropertiesManipulator.restoreValue(this.boundSubDocument, this.oldState);
        };
        return CharacterPropertiesHistoryItem;
    }(__aspxRichEdit.IntervalBasedHistoryItem));
    __aspxRichEdit.CharacterPropertiesHistoryItem = CharacterPropertiesHistoryItem;
    var CharacterPropertiesHistoryItemBase = (function (_super) {
        __extends(CharacterPropertiesHistoryItemBase, _super);
        function CharacterPropertiesHistoryItemBase(modelManipulator, boundSubDocument, interval, newValue, newUse) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, interval) || this;
            _this.newValue = newValue;
            _this.newUse = newUse;
            return _this;
        }
        CharacterPropertiesHistoryItemBase.prototype.redo = function () {
            this.oldState = this.getPropertiesManipulator().setValue(this.boundSubDocument, this.interval, this.newValue, this.newUse);
        };
        CharacterPropertiesHistoryItemBase.prototype.undo = function () {
            this.getPropertiesManipulator().restoreValue(this.boundSubDocument, this.oldState);
        };
        CharacterPropertiesHistoryItemBase.prototype.getPropertiesManipulator = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return CharacterPropertiesHistoryItemBase;
    }(__aspxRichEdit.IntervalBasedHistoryItem));
    __aspxRichEdit.CharacterPropertiesHistoryItemBase = CharacterPropertiesHistoryItemBase;
    var FontBoldHistoryItem = (function (_super) {
        __extends(FontBoldHistoryItem, _super);
        function FontBoldHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FontBoldHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.characterPropertiesManipulator.fontBold;
        };
        return FontBoldHistoryItem;
    }(CharacterPropertiesHistoryItemBase));
    __aspxRichEdit.FontBoldHistoryItem = FontBoldHistoryItem;
    var FontCapsHistoryItem = (function (_super) {
        __extends(FontCapsHistoryItem, _super);
        function FontCapsHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FontCapsHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.characterPropertiesManipulator.fontCaps;
        };
        return FontCapsHistoryItem;
    }(CharacterPropertiesHistoryItemBase));
    __aspxRichEdit.FontCapsHistoryItem = FontCapsHistoryItem;
    var FontUnderlineTypeHistoryItem = (function (_super) {
        __extends(FontUnderlineTypeHistoryItem, _super);
        function FontUnderlineTypeHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FontUnderlineTypeHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.characterPropertiesManipulator.fontUnderlineType;
        };
        return FontUnderlineTypeHistoryItem;
    }(CharacterPropertiesHistoryItemBase));
    __aspxRichEdit.FontUnderlineTypeHistoryItem = FontUnderlineTypeHistoryItem;
    var FontTextColorHistoryItem = (function (_super) {
        __extends(FontTextColorHistoryItem, _super);
        function FontTextColorHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FontTextColorHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.characterPropertiesManipulator.textColor;
        };
        return FontTextColorHistoryItem;
    }(CharacterPropertiesHistoryItemBase));
    __aspxRichEdit.FontTextColorHistoryItem = FontTextColorHistoryItem;
    var FontShadingInfoHistoryItem = (function (_super) {
        __extends(FontShadingInfoHistoryItem, _super);
        function FontShadingInfoHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FontShadingInfoHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.characterPropertiesManipulator.shadingInfo;
        };
        return FontShadingInfoHistoryItem;
    }(CharacterPropertiesHistoryItemBase));
    __aspxRichEdit.FontShadingInfoHistoryItem = FontShadingInfoHistoryItem;
    var FontHiddenHistoryItem = (function (_super) {
        __extends(FontHiddenHistoryItem, _super);
        function FontHiddenHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FontHiddenHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.characterPropertiesManipulator.fontHidden;
        };
        return FontHiddenHistoryItem;
    }(CharacterPropertiesHistoryItemBase));
    __aspxRichEdit.FontHiddenHistoryItem = FontHiddenHistoryItem;
    var FontItalicHistoryItem = (function (_super) {
        __extends(FontItalicHistoryItem, _super);
        function FontItalicHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FontItalicHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.characterPropertiesManipulator.fontItalic;
        };
        return FontItalicHistoryItem;
    }(CharacterPropertiesHistoryItemBase));
    __aspxRichEdit.FontItalicHistoryItem = FontItalicHistoryItem;
    var FontNameHistoryItem = (function (_super) {
        __extends(FontNameHistoryItem, _super);
        function FontNameHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FontNameHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.characterPropertiesManipulator.fontName;
        };
        return FontNameHistoryItem;
    }(CharacterPropertiesHistoryItemBase));
    __aspxRichEdit.FontNameHistoryItem = FontNameHistoryItem;
    var FontScriptHistoryItem = (function (_super) {
        __extends(FontScriptHistoryItem, _super);
        function FontScriptHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FontScriptHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.characterPropertiesManipulator.script;
        };
        return FontScriptHistoryItem;
    }(CharacterPropertiesHistoryItemBase));
    __aspxRichEdit.FontScriptHistoryItem = FontScriptHistoryItem;
    var FontSizeHistoryItem = (function (_super) {
        __extends(FontSizeHistoryItem, _super);
        function FontSizeHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FontSizeHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.characterPropertiesManipulator.fontSize;
        };
        return FontSizeHistoryItem;
    }(CharacterPropertiesHistoryItemBase));
    __aspxRichEdit.FontSizeHistoryItem = FontSizeHistoryItem;
    var FontStrikeoutTypeHistoryItem = (function (_super) {
        __extends(FontStrikeoutTypeHistoryItem, _super);
        function FontStrikeoutTypeHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FontStrikeoutTypeHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.characterPropertiesManipulator.fontStrikeoutType;
        };
        return FontStrikeoutTypeHistoryItem;
    }(CharacterPropertiesHistoryItemBase));
    __aspxRichEdit.FontStrikeoutTypeHistoryItem = FontStrikeoutTypeHistoryItem;
    var FontStrikeoutWordsOnlyHistoryItem = (function (_super) {
        __extends(FontStrikeoutWordsOnlyHistoryItem, _super);
        function FontStrikeoutWordsOnlyHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FontStrikeoutWordsOnlyHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.characterPropertiesManipulator.fontStrikeoutWordsOnly;
        };
        return FontStrikeoutWordsOnlyHistoryItem;
    }(CharacterPropertiesHistoryItemBase));
    __aspxRichEdit.FontStrikeoutWordsOnlyHistoryItem = FontStrikeoutWordsOnlyHistoryItem;
    var FontStrikeoutColorHistoryItem = (function (_super) {
        __extends(FontStrikeoutColorHistoryItem, _super);
        function FontStrikeoutColorHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FontStrikeoutColorHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.characterPropertiesManipulator.fontStrikeoutColor;
        };
        return FontStrikeoutColorHistoryItem;
    }(CharacterPropertiesHistoryItemBase));
    __aspxRichEdit.FontStrikeoutColorHistoryItem = FontStrikeoutColorHistoryItem;
    var FontUnderlineColorHistoryItem = (function (_super) {
        __extends(FontUnderlineColorHistoryItem, _super);
        function FontUnderlineColorHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FontUnderlineColorHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.characterPropertiesManipulator.fontUnderlineColor;
        };
        return FontUnderlineColorHistoryItem;
    }(CharacterPropertiesHistoryItemBase));
    __aspxRichEdit.FontUnderlineColorHistoryItem = FontUnderlineColorHistoryItem;
    var FontHighlightColorHistoryItem = (function (_super) {
        __extends(FontHighlightColorHistoryItem, _super);
        function FontHighlightColorHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FontHighlightColorHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.characterPropertiesManipulator.fontHighlightColor;
        };
        return FontHighlightColorHistoryItem;
    }(CharacterPropertiesHistoryItemBase));
    __aspxRichEdit.FontHighlightColorHistoryItem = FontHighlightColorHistoryItem;
    var FontUnderlineWordsOnlyHistoryItem = (function (_super) {
        __extends(FontUnderlineWordsOnlyHistoryItem, _super);
        function FontUnderlineWordsOnlyHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FontUnderlineWordsOnlyHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.characterPropertiesManipulator.fontUnderlineWordsOnly;
        };
        return FontUnderlineWordsOnlyHistoryItem;
    }(CharacterPropertiesHistoryItemBase));
    __aspxRichEdit.FontUnderlineWordsOnlyHistoryItem = FontUnderlineWordsOnlyHistoryItem;
    var FontNoProofHistoryItem = (function (_super) {
        __extends(FontNoProofHistoryItem, _super);
        function FontNoProofHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FontNoProofHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.characterPropertiesManipulator.fontNoProof;
        };
        return FontNoProofHistoryItem;
    }(CharacterPropertiesHistoryItemBase));
    __aspxRichEdit.FontNoProofHistoryItem = FontNoProofHistoryItem;
    var FontLangInfoHistoryItem = (function (_super) {
        __extends(FontLangInfoHistoryItem, _super);
        function FontLangInfoHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FontLangInfoHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.characterPropertiesManipulator.langInfo;
        };
        return FontLangInfoHistoryItem;
    }(CharacterPropertiesHistoryItemBase));
    __aspxRichEdit.FontLangInfoHistoryItem = FontLangInfoHistoryItem;
    var FontCompositeFontInfoHistoryItem = (function (_super) {
        __extends(FontCompositeFontInfoHistoryItem, _super);
        function FontCompositeFontInfoHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FontCompositeFontInfoHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.characterPropertiesManipulator.compositeFontInfo;
        };
        return FontCompositeFontInfoHistoryItem;
    }(CharacterPropertiesHistoryItemBase));
    __aspxRichEdit.FontCompositeFontInfoHistoryItem = FontCompositeFontInfoHistoryItem;
    var ResetCharacterPropertiesUseValuesHistoryItem = (function (_super) {
        __extends(ResetCharacterPropertiesUseValuesHistoryItem, _super);
        function ResetCharacterPropertiesUseValuesHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ResetCharacterPropertiesUseValuesHistoryItem.prototype.redo = function () {
            this.state = this.modelManipulator.characterPropertiesManipulator.useValue.setValue(this.boundSubDocument, this.interval, 0);
        };
        ResetCharacterPropertiesUseValuesHistoryItem.prototype.undo = function () {
            this.modelManipulator.characterPropertiesManipulator.useValue.restoreValue(this.boundSubDocument, this.state);
        };
        return ResetCharacterPropertiesUseValuesHistoryItem;
    }(__aspxRichEdit.IntervalBasedHistoryItem));
    __aspxRichEdit.ResetCharacterPropertiesUseValuesHistoryItem = ResetCharacterPropertiesUseValuesHistoryItem;
    var PropertiesWhatNeedSetWhenCreateHyperlinkField = (function () {
        function PropertiesWhatNeedSetWhenCreateHyperlinkField() {
        }
        PropertiesWhatNeedSetWhenCreateHyperlinkField.info = [
            { historyItemType: FontSizeHistoryItem, propertyName: "fontSize" },
            { historyItemType: FontBoldHistoryItem, propertyName: "fontBold" },
            { historyItemType: FontItalicHistoryItem, propertyName: "fontItalic" },
            { historyItemType: FontNameHistoryItem, propertyName: "fontInfo" },
            { historyItemType: FontScriptHistoryItem, propertyName: "script" },
            { historyItemType: FontStrikeoutTypeHistoryItem, propertyName: "fontStrikeoutType" },
            { historyItemType: FontCapsHistoryItem, propertyName: "allCaps" },
            { historyItemType: FontUnderlineWordsOnlyHistoryItem, propertyName: "underlineWordsOnly" },
            { historyItemType: FontStrikeoutWordsOnlyHistoryItem, propertyName: "strikeoutWordsOnly" },
            { historyItemType: FontNoProofHistoryItem, propertyName: "noProof" },
            { historyItemType: FontHiddenHistoryItem, propertyName: "hidden" },
            { historyItemType: FontShadingInfoHistoryItem, propertyName: "shadingInfo" },
            { historyItemType: FontStrikeoutColorHistoryItem, propertyName: "strikeoutColor" },
            { historyItemType: FontUnderlineColorHistoryItem, propertyName: "underlineColor" },
            { historyItemType: FontLangInfoHistoryItem, propertyName: "langInfo" },
        ];
        return PropertiesWhatNeedSetWhenCreateHyperlinkField;
    }());
    __aspxRichEdit.PropertiesWhatNeedSetWhenCreateHyperlinkField = PropertiesWhatNeedSetWhenCreateHyperlinkField;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var CreateStyleLinkHistoryItem = (function (_super) {
        __extends(CreateStyleLinkHistoryItem, _super);
        function CreateStyleLinkHistoryItem(modelManipulator, boundSubDocument, characterStyle, paragraphStyle) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.characterStyle = characterStyle;
            _this.paragraphStyle = paragraphStyle;
            return _this;
        }
        CreateStyleLinkHistoryItem.prototype.redo = function () {
            this.modelManipulator.styles.setLinkStyle(this.characterStyle, this.paragraphStyle);
        };
        CreateStyleLinkHistoryItem.prototype.undo = function () {
            this.modelManipulator.styles.restoreLinkStyle(this.characterStyle, this.paragraphStyle);
        };
        return CreateStyleLinkHistoryItem;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.CreateStyleLinkHistoryItem = CreateStyleLinkHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DocumentDefaultTabWidthHistoryItem = (function (_super) {
        __extends(DocumentDefaultTabWidthHistoryItem, _super);
        function DocumentDefaultTabWidthHistoryItem(modelManipulator, boundSubDocument, newDefaultTabWidth) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.newDefaultTabWidth = newDefaultTabWidth;
            return _this;
        }
        DocumentDefaultTabWidthHistoryItem.prototype.redo = function () {
            this.oldDefaultTabWidth = this.modelManipulator.documentPropertiesManipulator.setDefaultTabWidth(this.boundSubDocument, this.newDefaultTabWidth);
        };
        DocumentDefaultTabWidthHistoryItem.prototype.undo = function () {
            this.modelManipulator.documentPropertiesManipulator.setDefaultTabWidth(this.boundSubDocument, this.oldDefaultTabWidth);
        };
        return DocumentDefaultTabWidthHistoryItem;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.DocumentDefaultTabWidthHistoryItem = DocumentDefaultTabWidthHistoryItem;
    var PageColorHistoryItem = (function (_super) {
        __extends(PageColorHistoryItem, _super);
        function PageColorHistoryItem(modelManipulator, boundSubDocument, newPageColor) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.newPageColor = newPageColor;
            return _this;
        }
        PageColorHistoryItem.prototype.redo = function () {
            this.oldPageColor = this.modelManipulator.documentPropertiesManipulator.changePageColor(this.boundSubDocument, this.newPageColor);
        };
        PageColorHistoryItem.prototype.undo = function () {
            this.modelManipulator.documentPropertiesManipulator.changePageColor(this.boundSubDocument, this.oldPageColor);
        };
        return PageColorHistoryItem;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.PageColorHistoryItem = PageColorHistoryItem;
    var DifferentOddAndEvenPagesHistoryItem = (function (_super) {
        __extends(DifferentOddAndEvenPagesHistoryItem, _super);
        function DifferentOddAndEvenPagesHistoryItem(modelManipulator, boundSubDocument, newValue) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.newValue = newValue;
            return _this;
        }
        DifferentOddAndEvenPagesHistoryItem.prototype.redo = function () {
            this.oldValue = this.modelManipulator.documentPropertiesManipulator.changeDifferentOddAndEvenPages(this.boundSubDocument.documentModel, this.newValue);
        };
        DifferentOddAndEvenPagesHistoryItem.prototype.undo = function () {
            this.modelManipulator.documentPropertiesManipulator.changeDifferentOddAndEvenPages(this.boundSubDocument.documentModel, this.oldValue);
        };
        return DifferentOddAndEvenPagesHistoryItem;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.DifferentOddAndEvenPagesHistoryItem = DifferentOddAndEvenPagesHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FieldInsertHistoryItem = (function (_super) {
        __extends(FieldInsertHistoryItem, _super);
        function FieldInsertHistoryItem(control, modelManipulator, boundSubDocument, startCodePos, codePartLength, resultPartLength, showCode) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.control = control;
            _this.startFieldPos = startCodePos;
            _this.separatorPos = _this.startFieldPos + 1 + codePartLength;
            _this.endPos = _this.separatorPos + 1 + resultPartLength + 1;
            _this.showCode = showCode;
            return _this;
        }
        FieldInsertHistoryItem.prototype.redo = function () {
            var specChars = __aspxRichEdit.RichUtils.specialCharacters;
            var textManipulator = this.modelManipulator.text;
            var characterStyle = this.control.inputPosition.getCharacterStyle();
            var charProp = this.control.inputPosition.getMaskedCharacterProperties().clone();
            textManipulator.insertText(this.boundSubDocument, this.startFieldPos, specChars.FieldCodeStartRun, charProp, characterStyle, __aspxRichEdit.RunType.FieldCodeStartRun);
            textManipulator.insertText(this.boundSubDocument, this.separatorPos, specChars.FieldCodeEndRun, charProp, characterStyle, __aspxRichEdit.RunType.FieldCodeEndRun);
            textManipulator.insertText(this.boundSubDocument, this.endPos - 1, specChars.FieldResultEndRun, charProp, characterStyle, __aspxRichEdit.RunType.FieldResultEndRun);
            var fields = this.boundSubDocument.fields;
            var fieldIndex = __aspxRichEdit.Field.normedBinaryIndexOf(fields, this.startFieldPos + 1);
            var newFieldIndex = fieldIndex + 1;
            var newField = new __aspxRichEdit.Field(this.boundSubDocument.positionManager, newFieldIndex, this.startFieldPos, this.separatorPos, this.endPos, this.showCode, undefined);
            __aspxRichEdit.Field.addField(fields, newField);
            this.modelManipulator.dispatcher.notifyFieldInserted(this.boundSubDocument, this.startFieldPos, this.separatorPos, this.endPos);
            var selection = this.control.selection;
            selection.deprecatedSetSelection(this.startFieldPos + 1, this.startFieldPos + 1, true, -1, __aspxRichEdit.UpdateInputPositionProperties.No, false);
        };
        FieldInsertHistoryItem.prototype.undo = function () {
            this.modelManipulator.text.removeIntervalWithoutHistory(this.boundSubDocument, new __aspxRichEdit.FixedInterval(this.startFieldPos, 1), false);
            this.modelManipulator.text.removeIntervalWithoutHistory(this.boundSubDocument, new __aspxRichEdit.FixedInterval(this.endPos - 2, 1), false);
            this.modelManipulator.text.removeIntervalWithoutHistory(this.boundSubDocument, new __aspxRichEdit.FixedInterval(this.separatorPos - 1, 1), false);
            var selection = this.control.selection;
            selection.deprecatedSetSelection(this.startFieldPos, this.separatorPos - 1, true, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes, false);
        };
        return FieldInsertHistoryItem;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.FieldInsertHistoryItem = FieldInsertHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeHeaderFooterIndexHistoryItemBase = (function (_super) {
        __extends(ChangeHeaderFooterIndexHistoryItemBase, _super);
        function ChangeHeaderFooterIndexHistoryItemBase(modelManipulator, sectionIndex, type, newIndex, commandManager) {
            var _this = _super.call(this, modelManipulator, null) || this;
            _this.sectionIndex = sectionIndex;
            _this.type = type;
            _this.newIndex = newIndex;
            _this.commandManager = commandManager;
            return _this;
        }
        ChangeHeaderFooterIndexHistoryItemBase.prototype.redo = function () {
            this.oldIndex = this.getManipulator().changeObjectIndex(this.sectionIndex, this.type, this.newIndex);
        };
        ChangeHeaderFooterIndexHistoryItemBase.prototype.undo = function () {
            this.getManipulator().changeObjectIndex(this.sectionIndex, this.type, this.oldIndex);
            if (this.modelManipulator.model.activeSubDocument.isHeaderFooter() && this.oldIndex == -1)
                this.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToMain).execute(this.commandManager.isPublicApiCall);
        };
        return ChangeHeaderFooterIndexHistoryItemBase;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.ChangeHeaderFooterIndexHistoryItemBase = ChangeHeaderFooterIndexHistoryItemBase;
    var ChangeHeaderIndexHistoryItem = (function (_super) {
        __extends(ChangeHeaderIndexHistoryItem, _super);
        function ChangeHeaderIndexHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeHeaderIndexHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.headerManipulator;
        };
        return ChangeHeaderIndexHistoryItem;
    }(ChangeHeaderFooterIndexHistoryItemBase));
    __aspxRichEdit.ChangeHeaderIndexHistoryItem = ChangeHeaderIndexHistoryItem;
    var ChangeFooterIndexHistoryItem = (function (_super) {
        __extends(ChangeFooterIndexHistoryItem, _super);
        function ChangeFooterIndexHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ChangeFooterIndexHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.footerManipulator;
        };
        return ChangeFooterIndexHistoryItem;
    }(ChangeHeaderFooterIndexHistoryItemBase));
    __aspxRichEdit.ChangeFooterIndexHistoryItem = ChangeFooterIndexHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var History = (function () {
        function History(modelManipulator, options) {
            this.historyItems = [];
            this.currentIndex = -1;
            this.transaction = null;
            this.incrementalId = -1;
            this.transactionLevel = -1;
            this.unmodifiedIndex = -1;
            this.currTransactionId = 0;
            this.transactionMap = {};
            this.modelManipulator = modelManipulator;
            this.options = options;
        }
        History.prototype.isModified = function () {
            if (this.unmodifiedIndex == this.currentIndex)
                return false;
            var startIndex = Math.min(this.unmodifiedIndex, this.currentIndex);
            var endIndex = Math.max(this.unmodifiedIndex, this.currentIndex);
            for (var i = startIndex + 1; i <= endIndex; i++) {
                if (this.historyItems[i].changeModified())
                    return true;
            }
            return false;
        };
        History.prototype.undo = function () {
            if (!this.canUndo())
                return;
            this.historyItems[this.currentIndex].undo();
            this.currentIndex--;
        };
        History.prototype.redo = function () {
            if (!this.canRedo())
                return;
            this.currentIndex++;
            this.historyItems[this.currentIndex].redo();
        };
        History.prototype.canUndo = function () {
            return this.currentIndex >= 0 && __aspxRichEdit.ControlOptions.isEnabled(this.options.undo);
        };
        History.prototype.canRedo = function () {
            return this.currentIndex < this.historyItems.length - 1 && __aspxRichEdit.ControlOptions.isEnabled(this.options.undo);
        };
        History.prototype.beginTransaction = function () {
            this.transactionLevel++;
            if (this.transactionLevel == 0)
                this.transaction = new __aspxRichEdit.CompositionHistoryItem(this.modelManipulator, this.modelManipulator.model.activeSubDocument);
            var id = this.currTransactionId++;
            this.transactionMap[id] = this.transaction;
            return id;
        };
        History.prototype.endTransaction = function () {
            if (--this.transactionLevel >= 0)
                return;
            var transactionLength = this.transaction.historyItems.length;
            if (transactionLength > 1)
                this.addInternal(this.transaction);
            else if (transactionLength == 1)
                this.addInternal(this.transaction.historyItems.pop());
            this.transaction = null;
        };
        History.prototype.addAndRedo = function (historyItem) {
            this.add(historyItem);
            historyItem.redo();
        };
        History.prototype.add = function (historyItem) {
            if (this.transactionLevel >= 0)
                this.transaction.add(historyItem);
            else
                this.addInternal(historyItem);
        };
        History.prototype.addInternal = function (historyItem) {
            if (this.currentIndex < this.historyItems.length - 1) {
                this.historyItems.splice(this.currentIndex + 1);
                this.unmodifiedIndex = Math.min(this.unmodifiedIndex, this.currentIndex);
            }
            this.historyItems.push(historyItem);
            this.currentIndex++;
            this.deleteOldItems();
        };
        History.prototype.deleteOldItems = function () {
            var exceedItemsCount = this.historyItems.length - History.MAX_HISTORY_ITEM_COUNT;
            if (exceedItemsCount > 0 && this.currentIndex > exceedItemsCount) {
                this.historyItems.splice(0, exceedItemsCount);
                this.currentIndex -= exceedItemsCount;
            }
        };
        History.prototype.getNextId = function () {
            this.incrementalId++;
            return this.incrementalId;
        };
        History.prototype.clear = function () {
            this.currentIndex = -1;
            this.unmodifiedIndex = -1;
            this.incrementalId = -1;
            this.historyItems = [];
        };
        History.prototype.resetModified = function () {
            this.unmodifiedIndex = this.currentIndex;
        };
        History.prototype.getCurrentItemId = function () {
            if (this.currentIndex == -1)
                return -1;
            var currentItem = this.historyItems[this.currentIndex];
            if (currentItem.uniqueId == -1)
                currentItem.uniqueId = this.getNextId();
            return currentItem.uniqueId;
        };
        History.MAX_HISTORY_ITEM_COUNT = 100;
        return History;
    }());
    __aspxRichEdit.History = History;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HistoryItemState = (function () {
        function HistoryItemState() {
            var values = [];
            for (var _i = 0; _i < arguments.length; _i++) {
                values[_i] = arguments[_i];
            }
            this.objects = [];
            for (var value, i = 0; value = values[i]; i++)
                this.register(value);
        }
        HistoryItemState.prototype.register = function (object) {
            if (this.lastObject && this.lastObject.canMerge(object))
                this.lastObject.merge(object);
            else {
                this.objects.push(object);
                this.lastObject = object;
            }
            return this;
        };
        HistoryItemState.prototype.toJSON = function (withPostData) {
            var result = [];
            for (var object, i = 0; object = this.objects[i]; i++)
                result.push(object.toJSON(withPostData));
            return result;
        };
        HistoryItemState.prototype.isEmpty = function () {
            return !this.lastObject;
        };
        return HistoryItemState;
    }());
    __aspxRichEdit.HistoryItemState = HistoryItemState;
    var HistoryItemIntervalState = (function (_super) {
        __extends(HistoryItemIntervalState, _super);
        function HistoryItemIntervalState() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        Object.defineProperty(HistoryItemIntervalState.prototype, "interval", {
            get: function () {
                if (this.lastObject)
                    return __aspxRichEdit.FixedInterval.fromPositions(this.objects[0].interval.start, this.lastObject.interval.end);
                return null;
            },
            enumerable: true,
            configurable: true
        });
        return HistoryItemIntervalState;
    }(HistoryItemState));
    __aspxRichEdit.HistoryItemIntervalState = HistoryItemIntervalState;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HistoryItemIntervalStateObject = (function () {
        function HistoryItemIntervalStateObject(interval, value) {
            this.interval = interval.clone();
            this.value = value;
        }
        HistoryItemIntervalStateObject.prototype.merge = function (object) {
            this.interval.length += object.interval.length;
        };
        HistoryItemIntervalStateObject.prototype.canMerge = function (object) {
            return this.interval.end === object.interval.start && this.isEqualValue(object);
        };
        HistoryItemIntervalStateObject.prototype.isEqualValue = function (object) {
            return this.value === object.value;
        };
        HistoryItemIntervalStateObject.prototype.toJSON = function (withPostData) {
            return [this.interval.start, this.interval.length, this.getPropertyValueForJSON(this.value, withPostData)];
        };
        HistoryItemIntervalStateObject.prototype.getPropertyValueForJSON = function (value, _withPostData) {
            if (value instanceof __aspxRichEdit.FontInfo)
                return value.name;
            return value;
        };
        return HistoryItemIntervalStateObject;
    }());
    __aspxRichEdit.HistoryItemIntervalStateObject = HistoryItemIntervalStateObject;
    var HistoryItemTabStateObject = (function (_super) {
        __extends(HistoryItemTabStateObject, _super);
        function HistoryItemTabStateObject(interval, tabInfo) {
            return _super.call(this, interval, tabInfo) || this;
        }
        HistoryItemTabStateObject.prototype.isEqualValue = function (object) {
            return this.value.position == object.value.position;
        };
        HistoryItemTabStateObject.prototype.getPropertyValueForJSON = function (value) {
            return __aspxRichEdit.JSONTabConverter.convertToJSON(value);
        };
        return HistoryItemTabStateObject;
    }(HistoryItemIntervalStateObject));
    __aspxRichEdit.HistoryItemTabStateObject = HistoryItemTabStateObject;
    var HistoryItemTextBufferStateObject = (function (_super) {
        __extends(HistoryItemTextBufferStateObject, _super);
        function HistoryItemTextBufferStateObject(startPosition, text) {
            return _super.call(this, new __aspxRichEdit.FixedInterval(startPosition, text.length), text) || this;
        }
        HistoryItemTextBufferStateObject.prototype.canMerge = function (_stateValue) {
            return false;
        };
        return HistoryItemTextBufferStateObject;
    }(HistoryItemIntervalStateObject));
    __aspxRichEdit.HistoryItemTextBufferStateObject = HistoryItemTextBufferStateObject;
    var HistoryItemIntervalStyleStateObject = (function (_super) {
        __extends(HistoryItemIntervalStyleStateObject, _super);
        function HistoryItemIntervalStyleStateObject(interval, style) {
            return _super.call(this, interval, style) || this;
        }
        HistoryItemIntervalStyleStateObject.prototype.getPropertyValueForJSON = function (value) {
            return value.styleName;
        };
        return HistoryItemIntervalStyleStateObject;
    }(HistoryItemIntervalStateObject));
    __aspxRichEdit.HistoryItemIntervalStyleStateObject = HistoryItemIntervalStyleStateObject;
    var HistoryItemIntervalParagraphPropertiesStateObject = (function (_super) {
        __extends(HistoryItemIntervalParagraphPropertiesStateObject, _super);
        function HistoryItemIntervalParagraphPropertiesStateObject(interval, properties) {
            return _super.call(this, interval, properties) || this;
        }
        HistoryItemIntervalParagraphPropertiesStateObject.prototype.getPropertyValueForJSON = function (value) {
            return __aspxRichEdit.JSONMaskedParagraphPropertiesConverter.convertToJSON(value);
        };
        return HistoryItemIntervalParagraphPropertiesStateObject;
    }(HistoryItemIntervalStateObject));
    __aspxRichEdit.HistoryItemIntervalParagraphPropertiesStateObject = HistoryItemIntervalParagraphPropertiesStateObject;
    var HistoryItemIntervalCharacterPropertiesStateObject = (function (_super) {
        __extends(HistoryItemIntervalCharacterPropertiesStateObject, _super);
        function HistoryItemIntervalCharacterPropertiesStateObject(interval, properties) {
            return _super.call(this, interval, properties) || this;
        }
        HistoryItemIntervalCharacterPropertiesStateObject.prototype.getPropertyValueForJSON = function (value) {
            return __aspxRichEdit.JSONMaskedCharacterPropertiesConverter.convertToJSON(value);
        };
        return HistoryItemIntervalCharacterPropertiesStateObject;
    }(HistoryItemIntervalStateObject));
    __aspxRichEdit.HistoryItemIntervalCharacterPropertiesStateObject = HistoryItemIntervalCharacterPropertiesStateObject;
    var HistoryItemIntervalUseStateObject = (function (_super) {
        __extends(HistoryItemIntervalUseStateObject, _super);
        function HistoryItemIntervalUseStateObject(interval, value, use) {
            var _this = _super.call(this, interval, value) || this;
            _this.use = use;
            return _this;
        }
        HistoryItemIntervalUseStateObject.prototype.canMerge = function (stateValue) {
            return _super.prototype.canMerge.call(this, stateValue) && this.use === stateValue.use;
        };
        HistoryItemIntervalUseStateObject.prototype.toJSON = function () {
            return _super.prototype.toJSON.call(this).concat([this.use ? 1 : 0]);
        };
        return HistoryItemIntervalUseStateObject;
    }(HistoryItemIntervalStateObject));
    __aspxRichEdit.HistoryItemIntervalUseStateObject = HistoryItemIntervalUseStateObject;
    var HistoryItemSectionStateObject = (function () {
        function HistoryItemSectionStateObject(sectionIndex, value) {
            this.value = value;
            this.sectionIndex = sectionIndex;
        }
        HistoryItemSectionStateObject.prototype.toJSON = function () {
            return [this.sectionIndex, this.getPropertyValueForJSON(this.value)];
        };
        HistoryItemSectionStateObject.prototype.getPropertyValueForJSON = function (value) {
            if (value instanceof Array)
                return __aspxRichEdit.JSONColumnsSectionPropertiesConverter.convertToJSON(value);
            return value;
        };
        HistoryItemSectionStateObject.prototype.canMerge = function (_obj) { return false; };
        HistoryItemSectionStateObject.prototype.merge = function (_obj) { };
        return HistoryItemSectionStateObject;
    }());
    __aspxRichEdit.HistoryItemSectionStateObject = HistoryItemSectionStateObject;
    var HistoryItemListLevelStateObject = (function () {
        function HistoryItemListLevelStateObject(isAbstractNumberingList, numberingListIndex, listLevelIndex, value) {
            this.isAbstractNumberingList = isAbstractNumberingList;
            this.numberingListIndex = numberingListIndex;
            this.listLevelIndex = listLevelIndex;
            this.value = value;
        }
        HistoryItemListLevelStateObject.prototype.toJSON = function () {
            return [this.isAbstractNumberingList ? 1 : 0, this.numberingListIndex, this.listLevelIndex, this.getPropertyValueForJSON(this.value)];
        };
        HistoryItemListLevelStateObject.prototype.canMerge = function (_obj) {
            return false;
        };
        HistoryItemListLevelStateObject.prototype.merge = function (_obj) {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        HistoryItemListLevelStateObject.prototype.getPropertyValueForJSON = function (value) {
            if (value instanceof __aspxRichEdit.FontInfo)
                return value.name;
            return value;
        };
        return HistoryItemListLevelStateObject;
    }());
    __aspxRichEdit.HistoryItemListLevelStateObject = HistoryItemListLevelStateObject;
    var HistoryItemListLevelUseStateObject = (function (_super) {
        __extends(HistoryItemListLevelUseStateObject, _super);
        function HistoryItemListLevelUseStateObject(isAbstractNumberingList, numberingListIndex, listLevelIndex, value, use) {
            var _this = _super.call(this, isAbstractNumberingList, numberingListIndex, listLevelIndex, value) || this;
            _this.use = use;
            return _this;
        }
        HistoryItemListLevelUseStateObject.prototype.toJSON = function () {
            return _super.prototype.toJSON.call(this).concat([this.use ? 1 : 0]);
        };
        return HistoryItemListLevelUseStateObject;
    }(HistoryItemListLevelStateObject));
    __aspxRichEdit.HistoryItemListLevelUseStateObject = HistoryItemListLevelUseStateObject;
    var HistoryItemBookmarkStateObject = (function () {
        function HistoryItemBookmarkStateObject(bkmTempate, deleted) {
            if (deleted === void 0) { deleted = false; }
            this.bkmTempate = bkmTempate;
            this.deleted = deleted;
        }
        HistoryItemBookmarkStateObject.prototype.toJSON = function () {
            if (this.deleted)
                return [this.bkmTempate.name];
            return [this.bkmTempate.name, this.bkmTempate.start, this.bkmTempate.end];
        };
        HistoryItemBookmarkStateObject.prototype.canMerge = function (_obj) {
            return false;
        };
        HistoryItemBookmarkStateObject.prototype.merge = function (_obj) {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return HistoryItemBookmarkStateObject;
    }());
    __aspxRichEdit.HistoryItemBookmarkStateObject = HistoryItemBookmarkStateObject;
    var HistoryItemTableStateObject = (function () {
        function HistoryItemTableStateObject(tableStartPosition, tableNestedLevel, tableIndex, value) {
            this.tableIndex = tableIndex;
            this.value = value;
            this.tableStartPosition = tableStartPosition;
            this.tableNestedLevel = tableNestedLevel;
        }
        HistoryItemTableStateObject.prototype.toJSON = function () {
            return [this.tableStartPosition, this.tableNestedLevel, this.getPropertyValueForJSON(this.value)];
        };
        HistoryItemTableStateObject.prototype.canMerge = function (_obj) {
            return false;
        };
        HistoryItemTableStateObject.prototype.merge = function (_obj) {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        HistoryItemTableStateObject.prototype.getPropertyValueForJSON = function (value) {
            if (value instanceof __aspxRichEdit.TableWidthUnit)
                return [value.type, value.value];
            if (value instanceof __aspxRichEdit.TableHeightUnit)
                return [value.type, value.value];
            if (value instanceof __aspxRichEdit.BorderInfo)
                return [value.color.toJSON(), value.frame, value.offset, value.shadow, value.style, value.width];
            return value;
        };
        return HistoryItemTableStateObject;
    }());
    __aspxRichEdit.HistoryItemTableStateObject = HistoryItemTableStateObject;
    var HistoryItemTableUseStateObject = (function (_super) {
        __extends(HistoryItemTableUseStateObject, _super);
        function HistoryItemTableUseStateObject(tableStartPosition, tableNestedLevel, tableIndex, value, use) {
            var _this = _super.call(this, tableStartPosition, tableNestedLevel, tableIndex, value) || this;
            _this.use = use;
            return _this;
        }
        HistoryItemTableUseStateObject.prototype.toJSON = function () {
            return _super.prototype.toJSON.call(this).concat([this.use ? 1 : 0]);
        };
        return HistoryItemTableUseStateObject;
    }(HistoryItemTableStateObject));
    __aspxRichEdit.HistoryItemTableUseStateObject = HistoryItemTableUseStateObject;
    var HistoryItemTableComplexUseStateObject = (function (_super) {
        __extends(HistoryItemTableComplexUseStateObject, _super);
        function HistoryItemTableComplexUseStateObject(tableStartPosition, tableNestedLevel, tableIndex, value, uses) {
            var _this = _super.call(this, tableStartPosition, tableNestedLevel, tableIndex, value) || this;
            _this.uses = uses;
            return _this;
        }
        HistoryItemTableComplexUseStateObject.prototype.toJSON = function () {
            var uses = [];
            var usesLength = this.uses.length;
            for (var i = 0; i < usesLength; i++)
                uses.push(this.uses[i] ? 1 : 0);
            return _super.prototype.toJSON.call(this).concat([uses]);
        };
        HistoryItemTableComplexUseStateObject.prototype.getPropertyValueForJSON = function (value) {
            var result = [];
            var length = value.length;
            for (var i = 0; i < length; i++)
                result.push(_super.prototype.getPropertyValueForJSON.call(this, value[i]));
            return result;
        };
        return HistoryItemTableComplexUseStateObject;
    }(HistoryItemTableStateObject));
    __aspxRichEdit.HistoryItemTableComplexUseStateObject = HistoryItemTableComplexUseStateObject;
    var HistoryItemTableCellStateObject = (function () {
        function HistoryItemTableCellStateObject(tableStartPosition, tableNestedLevel, tableIndex, rowIndex, cellIndex, value) {
            this.tableIndex = tableIndex;
            this.rowIndex = rowIndex;
            this.cellIndex = cellIndex;
            this.value = value;
            this.tableStartPosition = tableStartPosition;
            this.tableNestedLevel = tableNestedLevel;
        }
        HistoryItemTableCellStateObject.prototype.toJSON = function () {
            return [this.tableStartPosition, this.tableNestedLevel, this.rowIndex, this.cellIndex, this.getPropertyValueForJSON(this.value)];
        };
        HistoryItemTableCellStateObject.prototype.canMerge = function (_obj) {
            return false;
        };
        HistoryItemTableCellStateObject.prototype.merge = function (_obj) {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        HistoryItemTableCellStateObject.prototype.getPropertyValueForJSON = function (value) {
            if (value instanceof __aspxRichEdit.TableWidthUnit)
                return [value.type, value.value];
            if (value instanceof __aspxRichEdit.TableHeightUnit)
                return [value.type, value.value];
            if (value instanceof __aspxRichEdit.BorderInfo)
                return [value.color.toJSON(), value.frame, value.offset, value.shadow, value.style, value.width];
            return value;
        };
        return HistoryItemTableCellStateObject;
    }());
    __aspxRichEdit.HistoryItemTableCellStateObject = HistoryItemTableCellStateObject;
    var HistoryItemTableCellUseStateObject = (function (_super) {
        __extends(HistoryItemTableCellUseStateObject, _super);
        function HistoryItemTableCellUseStateObject(tableStartPosition, tableNestedLevel, tableIndex, rowIndex, cellIndex, value, use) {
            var _this = _super.call(this, tableStartPosition, tableNestedLevel, tableIndex, rowIndex, cellIndex, value) || this;
            _this.use = use;
            return _this;
        }
        HistoryItemTableCellUseStateObject.prototype.toJSON = function () {
            return _super.prototype.toJSON.call(this).concat([this.use ? 1 : 0]);
        };
        return HistoryItemTableCellUseStateObject;
    }(HistoryItemTableCellStateObject));
    __aspxRichEdit.HistoryItemTableCellUseStateObject = HistoryItemTableCellUseStateObject;
    var HistoryItemTableCellComplexUseStateObject = (function (_super) {
        __extends(HistoryItemTableCellComplexUseStateObject, _super);
        function HistoryItemTableCellComplexUseStateObject(tableStartPosition, tableNestedLevel, tableIndex, rowIndex, cellIndex, value, uses) {
            var _this = _super.call(this, tableStartPosition, tableNestedLevel, tableIndex, rowIndex, cellIndex, value) || this;
            _this.uses = uses;
            return _this;
        }
        HistoryItemTableCellComplexUseStateObject.prototype.toJSON = function () {
            var uses = [];
            var usesLength = this.uses.length;
            for (var i = 0; i < usesLength; i++) {
                uses.push(this.uses[i] ? 1 : 0);
            }
            return _super.prototype.toJSON.call(this).concat([uses]);
        };
        HistoryItemTableCellComplexUseStateObject.prototype.getPropertyValueForJSON = function (value) {
            var result = [];
            var length = value.length;
            for (var i = 0; i < length; i++)
                result.push(_super.prototype.getPropertyValueForJSON.call(this, value[i]));
            return result;
        };
        return HistoryItemTableCellComplexUseStateObject;
    }(HistoryItemTableCellStateObject));
    __aspxRichEdit.HistoryItemTableCellComplexUseStateObject = HistoryItemTableCellComplexUseStateObject;
    var HistoryItemTableRowStateObject = (function () {
        function HistoryItemTableRowStateObject(tableStartPosition, tableNestedLevel, tableIndex, rowIndex, value) {
            this.tableIndex = tableIndex;
            this.rowIndex = rowIndex;
            this.value = value;
            this.tableStartPosition = tableStartPosition;
            this.tableNestedLevel = tableNestedLevel;
        }
        HistoryItemTableRowStateObject.prototype.toJSON = function () {
            return [this.tableStartPosition, this.tableNestedLevel, this.rowIndex, this.getPropertyValueForJSON(this.value)];
        };
        HistoryItemTableRowStateObject.prototype.canMerge = function (_obj) {
            return false;
        };
        HistoryItemTableRowStateObject.prototype.merge = function (_obj) {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        HistoryItemTableRowStateObject.prototype.getPropertyValueForJSON = function (value) {
            if (value instanceof __aspxRichEdit.TableWidthUnit)
                return [value.type, value.value];
            if (value instanceof __aspxRichEdit.TableHeightUnit)
                return [value.type, value.value];
            return value;
        };
        return HistoryItemTableRowStateObject;
    }());
    __aspxRichEdit.HistoryItemTableRowStateObject = HistoryItemTableRowStateObject;
    var HistoryItemTableRowUseStateObject = (function (_super) {
        __extends(HistoryItemTableRowUseStateObject, _super);
        function HistoryItemTableRowUseStateObject(tableStartPosition, tableNestedLevel, tableIndex, rowIndex, value, use) {
            var _this = _super.call(this, tableStartPosition, tableNestedLevel, tableIndex, rowIndex, value) || this;
            _this.use = use;
            return _this;
        }
        HistoryItemTableRowUseStateObject.prototype.toJSON = function () {
            return _super.prototype.toJSON.call(this).concat([this.use ? 1 : 0]);
        };
        return HistoryItemTableRowUseStateObject;
    }(HistoryItemTableRowStateObject));
    __aspxRichEdit.HistoryItemTableRowUseStateObject = HistoryItemTableRowUseStateObject;
    var HistoryItemIntervalAnchorInfoStateObject = (function (_super) {
        __extends(HistoryItemIntervalAnchorInfoStateObject, _super);
        function HistoryItemIntervalAnchorInfoStateObject(interval, properties) {
            return _super.call(this, interval, properties) || this;
        }
        HistoryItemIntervalAnchorInfoStateObject.prototype.getPropertyValueForJSON = function (value) {
            return __aspxRichEdit.JSONAnchorInfoConverter.convertToJSON(value);
        };
        return HistoryItemIntervalAnchorInfoStateObject;
    }(HistoryItemIntervalStateObject));
    __aspxRichEdit.HistoryItemIntervalAnchorInfoStateObject = HistoryItemIntervalAnchorInfoStateObject;
    var HistoryItemIntervalAnchorSizeStateObject = (function (_super) {
        __extends(HistoryItemIntervalAnchorSizeStateObject, _super);
        function HistoryItemIntervalAnchorSizeStateObject(interval, properties) {
            return _super.call(this, interval, properties) || this;
        }
        HistoryItemIntervalAnchorSizeStateObject.prototype.getPropertyValueForJSON = function (value) {
            if (value instanceof __aspxRichEdit.PictureSize)
                return __aspxRichEdit.JSONInlinePictureSizeConverterConverter.convertToJSON(value);
            if (value instanceof __aspxRichEdit.AnchorTextBoxSize)
                return __aspxRichEdit.JSONAnchorTextBoxSizeConverterConverter.convertToJSON(value);
            return value;
        };
        return HistoryItemIntervalAnchorSizeStateObject;
    }(HistoryItemIntervalStateObject));
    __aspxRichEdit.HistoryItemIntervalAnchorSizeStateObject = HistoryItemIntervalAnchorSizeStateObject;
    var HistoryItemIntervalShapeStateObject = (function (_super) {
        __extends(HistoryItemIntervalShapeStateObject, _super);
        function HistoryItemIntervalShapeStateObject(interval, properties) {
            return _super.call(this, interval, properties) || this;
        }
        HistoryItemIntervalShapeStateObject.prototype.getPropertyValueForJSON = function (value) {
            return __aspxRichEdit.JSONShapeConverter.convertToJSON(value);
        };
        return HistoryItemIntervalShapeStateObject;
    }(HistoryItemIntervalStateObject));
    __aspxRichEdit.HistoryItemIntervalShapeStateObject = HistoryItemIntervalShapeStateObject;
    var HistoryItemIntervalAnchoredTextBoxPropertiesStateObject = (function (_super) {
        __extends(HistoryItemIntervalAnchoredTextBoxPropertiesStateObject, _super);
        function HistoryItemIntervalAnchoredTextBoxPropertiesStateObject(interval, properties) {
            return _super.call(this, interval, properties) || this;
        }
        HistoryItemIntervalAnchoredTextBoxPropertiesStateObject.prototype.getPropertyValueForJSON = function (value) {
            return __aspxRichEdit.JSONTextBoxPropertiesConverter.convertToJSON(value);
        };
        return HistoryItemIntervalAnchoredTextBoxPropertiesStateObject;
    }(HistoryItemIntervalStateObject));
    __aspxRichEdit.HistoryItemIntervalAnchoredTextBoxPropertiesStateObject = HistoryItemIntervalAnchoredTextBoxPropertiesStateObject;
    var HistoryItemInlineObjectPropertiesStateObject = (function (_super) {
        __extends(HistoryItemInlineObjectPropertiesStateObject, _super);
        function HistoryItemInlineObjectPropertiesStateObject() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        HistoryItemInlineObjectPropertiesStateObject.prototype.getPropertyValueForJSON = function (value) {
            if (value instanceof __aspxRichEdit.Size)
                return [value.width, value.height];
            else
                return value;
        };
        return HistoryItemInlineObjectPropertiesStateObject;
    }(HistoryItemIntervalStateObject));
    __aspxRichEdit.HistoryItemInlineObjectPropertiesStateObject = HistoryItemInlineObjectPropertiesStateObject;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertInlinePictureHistoryItem = (function (_super) {
        __extends(InsertInlinePictureHistoryItem, _super);
        function InsertInlinePictureHistoryItem(modelManipulator, boundSubDocument, position, id, originalWidth, originalHeight, scaleX, scaleY, maskedCharacterProperties, characterStyle, lockAspectRatio) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.position = position;
            _this.id = id;
            _this.originalWidth = originalWidth;
            _this.originalHeight = originalHeight;
            _this.scaleX = scaleX;
            _this.scaleY = scaleY;
            _this.maskedCharacterProperties = maskedCharacterProperties;
            _this.characterStyle = characterStyle;
            _this.privateAPIID = -1;
            _this.lockAspectRatio = lockAspectRatio;
            return _this;
        }
        InsertInlinePictureHistoryItem.prototype.redo = function () {
            this.privateAPIID = this.modelManipulator.text.insertInlinePicture(this.boundSubDocument, this.position, this.id, this.originalWidth, this.originalHeight, this.scaleX, this.scaleY, this.lockAspectRatio, this.maskedCharacterProperties, this.characterStyle, true, this.privateAPIID);
        };
        InsertInlinePictureHistoryItem.prototype.undo = function () {
            this.modelManipulator.text.removeIntervalWithoutHistory(this.boundSubDocument, new __aspxRichEdit.FixedInterval(this.position, 1), false);
        };
        return InsertInlinePictureHistoryItem;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.InsertInlinePictureHistoryItem = InsertInlinePictureHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertParagraphHistoryItem = (function (_super) {
        __extends(InsertParagraphHistoryItem, _super);
        function InsertParagraphHistoryItem(modelManipulator, boundSubDocument, position, maskedCharacterProperties, characterStyle, maskedParagraphProperties, paragraphStyle, numberingListIndex, listLevelIndex, tabs) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.position = position;
            _this.maskedCharacterProperties = maskedCharacterProperties;
            _this.characterStyle = characterStyle;
            _this.maskedParagraphProperties = maskedParagraphProperties;
            _this.paragraphStyle = paragraphStyle;
            _this.numberingListIndex = numberingListIndex;
            _this.listLevelIndex = listLevelIndex;
            _this.tabs = tabs;
            return _this;
        }
        InsertParagraphHistoryItem.prototype.redo = function () {
            this.modelManipulator.text.insertParagraph(this.boundSubDocument, this.position, this.maskedCharacterProperties, this.characterStyle, this.maskedParagraphProperties, this.paragraphStyle, true, this.numberingListIndex, this.listLevelIndex, this.tabs);
        };
        InsertParagraphHistoryItem.prototype.undo = function () {
            this.modelManipulator.text.removeIntervalWithoutHistory(this.boundSubDocument, new __aspxRichEdit.FixedInterval(this.position, __aspxRichEdit.RichUtils.specialCharacters.ParagraphMark.length), true);
        };
        return InsertParagraphHistoryItem;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.InsertParagraphHistoryItem = InsertParagraphHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertSectionHistoryItem = (function (_super) {
        __extends(InsertSectionHistoryItem, _super);
        function InsertSectionHistoryItem(modelManipulator, boundSubDocument, position, maskedCharacterProperties, characterStyle, sectionProperties, isInsertPropertiesToCurrentSection, paragraphStyle, paragraphMaskedProperties, isInsertPropertiesAndStyleIndexToCurrentParagraph, numberingListIndex, listLevelIndex, tabs) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.position = position;
            _this.maskedCharacterProperties = maskedCharacterProperties;
            _this.characterStyle = characterStyle;
            _this.sectionProperties = sectionProperties;
            _this.isInsertPropertiesToCurrentSection = isInsertPropertiesToCurrentSection;
            _this.paragraphStyle = paragraphStyle;
            _this.paragraphMaskedProperties = paragraphMaskedProperties;
            _this.isInsertPropertiesAndStyleIndexToCurrentParagraph = isInsertPropertiesAndStyleIndexToCurrentParagraph;
            _this.numberingListIndex = numberingListIndex;
            _this.listLevelIndex = listLevelIndex;
            _this.tabs = tabs;
            return _this;
        }
        InsertSectionHistoryItem.prototype.redo = function () {
            this.modelManipulator.text.insertSection(this.boundSubDocument, this.position, this.maskedCharacterProperties, this.characterStyle, this.sectionProperties, this.isInsertPropertiesToCurrentSection, this.paragraphStyle, this.paragraphMaskedProperties, this.isInsertPropertiesAndStyleIndexToCurrentParagraph, this.numberingListIndex, this.listLevelIndex, this.tabs);
        };
        InsertSectionHistoryItem.prototype.undo = function () {
            this.modelManipulator.text.removeIntervalWithoutHistory(this.boundSubDocument, new __aspxRichEdit.FixedInterval(this.position, __aspxRichEdit.RichUtils.specialCharacters.SectionMark.length), false);
        };
        return InsertSectionHistoryItem;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.InsertSectionHistoryItem = InsertSectionHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertSubDocumentHistoryItem = (function (_super) {
        __extends(InsertSubDocumentHistoryItem, _super);
        function InsertSubDocumentHistoryItem(modelManipulator, boundSubDocument, targetPosition, sourceSubDocument, sourceInterval) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.sourceInterval = sourceInterval;
            _this.sourceSubDocument = sourceSubDocument;
            _this.targetPosition = targetPosition;
            return _this;
        }
        InsertSubDocumentHistoryItem.prototype.redo = function () {
            this.newTables = this.modelManipulator.text.insertSubDocumentInOtherSubDocument(this.boundSubDocument, this.targetPosition, this.sourceSubDocument, this.sourceInterval);
        };
        InsertSubDocumentHistoryItem.prototype.undo = function () {
            for (var i = 0, table = void 0; table = this.newTables[i]; i++)
                this.modelManipulator.tables.removeTable(this.boundSubDocument, table);
            this.modelManipulator.text.removeIntervalWithoutHistory(this.boundSubDocument, new __aspxRichEdit.FixedInterval(this.targetPosition, this.sourceInterval.length), true);
        };
        return InsertSubDocumentHistoryItem;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.InsertSubDocumentHistoryItem = InsertSubDocumentHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertTextHistoryItemBase = (function (_super) {
        __extends(InsertTextHistoryItemBase, _super);
        function InsertTextHistoryItemBase(modelManipulator, boundSubDocument, position, text, maskedCharacterProperties, characterStyle) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.position = position;
            _this.text = text;
            _this.maskedCharacterProperties = maskedCharacterProperties;
            _this.characterStyle = characterStyle;
            return _this;
        }
        InsertTextHistoryItemBase.prototype.redo = function () {
            this.modelManipulator.text.insertText(this.boundSubDocument, this.position, this.text, this.maskedCharacterProperties, this.characterStyle, this.getTextRunType());
        };
        InsertTextHistoryItemBase.prototype.undo = function () {
            this.modelManipulator.text.removeIntervalWithoutHistory(this.boundSubDocument, new __aspxRichEdit.FixedInterval(this.position, this.text.length), false);
        };
        InsertTextHistoryItemBase.prototype.getTextRunType = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return InsertTextHistoryItemBase;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.InsertTextHistoryItemBase = InsertTextHistoryItemBase;
    var InsertTextHistoryItem = (function (_super) {
        __extends(InsertTextHistoryItem, _super);
        function InsertTextHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertTextHistoryItem.prototype.getTextRunType = function () {
            return __aspxRichEdit.RunType.TextRun;
        };
        return InsertTextHistoryItem;
    }(InsertTextHistoryItemBase));
    __aspxRichEdit.InsertTextHistoryItem = InsertTextHistoryItem;
    var InsertLayoutDependentTextItem = (function (_super) {
        __extends(InsertLayoutDependentTextItem, _super);
        function InsertLayoutDependentTextItem(modelManipulator, boundSubDocument, position, maskedCharacterProperties, characterStyle) {
            return _super.call(this, modelManipulator, boundSubDocument, position, __aspxRichEdit.RichUtils.specialCharacters.LayoutDependentText, maskedCharacterProperties, characterStyle) || this;
        }
        InsertLayoutDependentTextItem.prototype.getTextRunType = function () {
            return __aspxRichEdit.RunType.LayoutDependentRun;
        };
        return InsertLayoutDependentTextItem;
    }(InsertTextHistoryItemBase));
    __aspxRichEdit.InsertLayoutDependentTextItem = InsertLayoutDependentTextItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ListLevelCharacterPropertiesHistoryItemBase = (function (_super) {
        __extends(ListLevelCharacterPropertiesHistoryItemBase, _super);
        function ListLevelCharacterPropertiesHistoryItemBase(modelManipulator, boundSubDocument, isAbstractList, listIndex, levelIndex, newValue, newUse) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.newValue = newValue;
            _this.isAbstractList = isAbstractList;
            _this.listIndex = listIndex;
            _this.levelIndex = levelIndex;
            _this.newUse = newUse;
            return _this;
        }
        ListLevelCharacterPropertiesHistoryItemBase.prototype.redo = function () {
            this.oldState = this.getManipulator().setValue(this.boundSubDocument.documentModel, this.isAbstractList, this.listIndex, this.levelIndex, this.newValue, this.newUse);
        };
        ListLevelCharacterPropertiesHistoryItemBase.prototype.undo = function () {
            this.getManipulator().restoreValue(this.boundSubDocument.documentModel, this.oldState);
        };
        ListLevelCharacterPropertiesHistoryItemBase.prototype.getManipulator = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return ListLevelCharacterPropertiesHistoryItemBase;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.ListLevelCharacterPropertiesHistoryItemBase = ListLevelCharacterPropertiesHistoryItemBase;
    var ListLevelFontBoldHistoryItem = (function (_super) {
        __extends(ListLevelFontBoldHistoryItem, _super);
        function ListLevelFontBoldHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelFontBoldHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelCharacterPropertiesManipulator.fontBold;
        };
        return ListLevelFontBoldHistoryItem;
    }(ListLevelCharacterPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelFontBoldHistoryItem = ListLevelFontBoldHistoryItem;
    var ListLevelFontCapsHistoryItem = (function (_super) {
        __extends(ListLevelFontCapsHistoryItem, _super);
        function ListLevelFontCapsHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelFontCapsHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelCharacterPropertiesManipulator.fontCaps;
        };
        return ListLevelFontCapsHistoryItem;
    }(ListLevelCharacterPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelFontCapsHistoryItem = ListLevelFontCapsHistoryItem;
    var ListLevelFontUnderlineTypeHistoryItem = (function (_super) {
        __extends(ListLevelFontUnderlineTypeHistoryItem, _super);
        function ListLevelFontUnderlineTypeHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelFontUnderlineTypeHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelCharacterPropertiesManipulator.fontUnderlineType;
        };
        return ListLevelFontUnderlineTypeHistoryItem;
    }(ListLevelCharacterPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelFontUnderlineTypeHistoryItem = ListLevelFontUnderlineTypeHistoryItem;
    var ListLevelFontTextColorHistoryItem = (function (_super) {
        __extends(ListLevelFontTextColorHistoryItem, _super);
        function ListLevelFontTextColorHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelFontTextColorHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelCharacterPropertiesManipulator.textColor;
        };
        return ListLevelFontTextColorHistoryItem;
    }(ListLevelCharacterPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelFontTextColorHistoryItem = ListLevelFontTextColorHistoryItem;
    var ListLevelFontShadingInfoHistoryItem = (function (_super) {
        __extends(ListLevelFontShadingInfoHistoryItem, _super);
        function ListLevelFontShadingInfoHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelFontShadingInfoHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelCharacterPropertiesManipulator.shadingInfo;
        };
        return ListLevelFontShadingInfoHistoryItem;
    }(ListLevelCharacterPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelFontShadingInfoHistoryItem = ListLevelFontShadingInfoHistoryItem;
    var ListLevelFontHiddenHistoryItem = (function (_super) {
        __extends(ListLevelFontHiddenHistoryItem, _super);
        function ListLevelFontHiddenHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelFontHiddenHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelCharacterPropertiesManipulator.fontHidden;
        };
        return ListLevelFontHiddenHistoryItem;
    }(ListLevelCharacterPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelFontHiddenHistoryItem = ListLevelFontHiddenHistoryItem;
    var ListLevelFontItalicHistoryItem = (function (_super) {
        __extends(ListLevelFontItalicHistoryItem, _super);
        function ListLevelFontItalicHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelFontItalicHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelCharacterPropertiesManipulator.fontItalic;
        };
        return ListLevelFontItalicHistoryItem;
    }(ListLevelCharacterPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelFontItalicHistoryItem = ListLevelFontItalicHistoryItem;
    var ListLevelFontNameHistoryItem = (function (_super) {
        __extends(ListLevelFontNameHistoryItem, _super);
        function ListLevelFontNameHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelFontNameHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelCharacterPropertiesManipulator.fontName;
        };
        return ListLevelFontNameHistoryItem;
    }(ListLevelCharacterPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelFontNameHistoryItem = ListLevelFontNameHistoryItem;
    var ListLevelFontScriptHistoryItem = (function (_super) {
        __extends(ListLevelFontScriptHistoryItem, _super);
        function ListLevelFontScriptHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelFontScriptHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelCharacterPropertiesManipulator.script;
        };
        return ListLevelFontScriptHistoryItem;
    }(ListLevelCharacterPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelFontScriptHistoryItem = ListLevelFontScriptHistoryItem;
    var ListLevelFontSizeHistoryItem = (function (_super) {
        __extends(ListLevelFontSizeHistoryItem, _super);
        function ListLevelFontSizeHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelFontSizeHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelCharacterPropertiesManipulator.fontSize;
        };
        return ListLevelFontSizeHistoryItem;
    }(ListLevelCharacterPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelFontSizeHistoryItem = ListLevelFontSizeHistoryItem;
    var ListLevelFontStrikeoutTypeHistoryItem = (function (_super) {
        __extends(ListLevelFontStrikeoutTypeHistoryItem, _super);
        function ListLevelFontStrikeoutTypeHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelFontStrikeoutTypeHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelCharacterPropertiesManipulator.fontStrikeoutType;
        };
        return ListLevelFontStrikeoutTypeHistoryItem;
    }(ListLevelCharacterPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelFontStrikeoutTypeHistoryItem = ListLevelFontStrikeoutTypeHistoryItem;
    var ListLevelFontStrikeoutWordsOnlyHistoryItem = (function (_super) {
        __extends(ListLevelFontStrikeoutWordsOnlyHistoryItem, _super);
        function ListLevelFontStrikeoutWordsOnlyHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelFontStrikeoutWordsOnlyHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelCharacterPropertiesManipulator.fontStrikeoutWordsOnly;
        };
        return ListLevelFontStrikeoutWordsOnlyHistoryItem;
    }(ListLevelCharacterPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelFontStrikeoutWordsOnlyHistoryItem = ListLevelFontStrikeoutWordsOnlyHistoryItem;
    var ListLevelFontStrikeoutColorHistoryItem = (function (_super) {
        __extends(ListLevelFontStrikeoutColorHistoryItem, _super);
        function ListLevelFontStrikeoutColorHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelFontStrikeoutColorHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelCharacterPropertiesManipulator.fontStrikeoutColor;
        };
        return ListLevelFontStrikeoutColorHistoryItem;
    }(ListLevelCharacterPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelFontStrikeoutColorHistoryItem = ListLevelFontStrikeoutColorHistoryItem;
    var ListLevelFontUnderlineColorHistoryItem = (function (_super) {
        __extends(ListLevelFontUnderlineColorHistoryItem, _super);
        function ListLevelFontUnderlineColorHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelFontUnderlineColorHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelCharacterPropertiesManipulator.fontUnderlineColor;
        };
        return ListLevelFontUnderlineColorHistoryItem;
    }(ListLevelCharacterPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelFontUnderlineColorHistoryItem = ListLevelFontUnderlineColorHistoryItem;
    var ListLevelFontUnderlineWordsOnlyHistoryItem = (function (_super) {
        __extends(ListLevelFontUnderlineWordsOnlyHistoryItem, _super);
        function ListLevelFontUnderlineWordsOnlyHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelFontUnderlineWordsOnlyHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelCharacterPropertiesManipulator.fontUnderlineWordsOnly;
        };
        return ListLevelFontUnderlineWordsOnlyHistoryItem;
    }(ListLevelCharacterPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelFontUnderlineWordsOnlyHistoryItem = ListLevelFontUnderlineWordsOnlyHistoryItem;
    var ListLevelFontNoProofHistoryItem = (function (_super) {
        __extends(ListLevelFontNoProofHistoryItem, _super);
        function ListLevelFontNoProofHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelFontNoProofHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelCharacterPropertiesManipulator.fontNoProof;
        };
        return ListLevelFontNoProofHistoryItem;
    }(ListLevelCharacterPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelFontNoProofHistoryItem = ListLevelFontNoProofHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ListLevelParagraphPropertiesHistoryItemBase = (function (_super) {
        __extends(ListLevelParagraphPropertiesHistoryItemBase, _super);
        function ListLevelParagraphPropertiesHistoryItemBase(modelManipulator, boundSubDocument, isAbstractList, listIndex, levelIndex, newValue, newUse) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.newValue = newValue;
            _this.isAbstractList = isAbstractList;
            _this.listIndex = listIndex;
            _this.levelIndex = levelIndex;
            _this.newUse = newUse;
            return _this;
        }
        ListLevelParagraphPropertiesHistoryItemBase.prototype.redo = function () {
            this.oldState = this.getManipulator().setValue(this.boundSubDocument.documentModel, this.isAbstractList, this.listIndex, this.levelIndex, this.newValue, this.newUse);
        };
        ListLevelParagraphPropertiesHistoryItemBase.prototype.undo = function () {
            this.getManipulator().restoreValue(this.boundSubDocument.documentModel, this.oldState);
        };
        ListLevelParagraphPropertiesHistoryItemBase.prototype.getManipulator = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return ListLevelParagraphPropertiesHistoryItemBase;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.ListLevelParagraphPropertiesHistoryItemBase = ListLevelParagraphPropertiesHistoryItemBase;
    var ListLevelParagraphAlignmentHistoryItem = (function (_super) {
        __extends(ListLevelParagraphAlignmentHistoryItem, _super);
        function ListLevelParagraphAlignmentHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelParagraphAlignmentHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelParagraphPropertiesManipulator.align;
        };
        return ListLevelParagraphAlignmentHistoryItem;
    }(ListLevelParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelParagraphAlignmentHistoryItem = ListLevelParagraphAlignmentHistoryItem;
    var ListLevelParagraphContextualSpacingHistoryItem = (function (_super) {
        __extends(ListLevelParagraphContextualSpacingHistoryItem, _super);
        function ListLevelParagraphContextualSpacingHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelParagraphContextualSpacingHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelParagraphPropertiesManipulator.contextualSpacing;
        };
        return ListLevelParagraphContextualSpacingHistoryItem;
    }(ListLevelParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelParagraphContextualSpacingHistoryItem = ListLevelParagraphContextualSpacingHistoryItem;
    var ListLevelParagraphAfterAutoSpacingHistoryItem = (function (_super) {
        __extends(ListLevelParagraphAfterAutoSpacingHistoryItem, _super);
        function ListLevelParagraphAfterAutoSpacingHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelParagraphAfterAutoSpacingHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelParagraphPropertiesManipulator.afterAutoSpacing;
        };
        return ListLevelParagraphAfterAutoSpacingHistoryItem;
    }(ListLevelParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelParagraphAfterAutoSpacingHistoryItem = ListLevelParagraphAfterAutoSpacingHistoryItem;
    var ListLevelParagraphShadingInfoHistoryItem = (function (_super) {
        __extends(ListLevelParagraphShadingInfoHistoryItem, _super);
        function ListLevelParagraphShadingInfoHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelParagraphShadingInfoHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelParagraphPropertiesManipulator.shadingInfo;
        };
        return ListLevelParagraphShadingInfoHistoryItem;
    }(ListLevelParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelParagraphShadingInfoHistoryItem = ListLevelParagraphShadingInfoHistoryItem;
    var ListLevelParagraphBeforeAutoSpacingHistoryItem = (function (_super) {
        __extends(ListLevelParagraphBeforeAutoSpacingHistoryItem, _super);
        function ListLevelParagraphBeforeAutoSpacingHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelParagraphBeforeAutoSpacingHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelParagraphPropertiesManipulator.beforeAutoSpacing;
        };
        return ListLevelParagraphBeforeAutoSpacingHistoryItem;
    }(ListLevelParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelParagraphBeforeAutoSpacingHistoryItem = ListLevelParagraphBeforeAutoSpacingHistoryItem;
    var ListLevelParagraphFirstLineIndentHistoryItem = (function (_super) {
        __extends(ListLevelParagraphFirstLineIndentHistoryItem, _super);
        function ListLevelParagraphFirstLineIndentHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelParagraphFirstLineIndentHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelParagraphPropertiesManipulator.firstLineIndent;
        };
        return ListLevelParagraphFirstLineIndentHistoryItem;
    }(ListLevelParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelParagraphFirstLineIndentHistoryItem = ListLevelParagraphFirstLineIndentHistoryItem;
    var ListLevelParagraphFirstLineIndentTypeHistoryItem = (function (_super) {
        __extends(ListLevelParagraphFirstLineIndentTypeHistoryItem, _super);
        function ListLevelParagraphFirstLineIndentTypeHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelParagraphFirstLineIndentTypeHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelParagraphPropertiesManipulator.firstLineIndentType;
        };
        return ListLevelParagraphFirstLineIndentTypeHistoryItem;
    }(ListLevelParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelParagraphFirstLineIndentTypeHistoryItem = ListLevelParagraphFirstLineIndentTypeHistoryItem;
    var ListLevelParagraphKeepLinesTogetherHistoryItem = (function (_super) {
        __extends(ListLevelParagraphKeepLinesTogetherHistoryItem, _super);
        function ListLevelParagraphKeepLinesTogetherHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelParagraphKeepLinesTogetherHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelParagraphPropertiesManipulator.keepLinesTogether;
        };
        return ListLevelParagraphKeepLinesTogetherHistoryItem;
    }(ListLevelParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelParagraphKeepLinesTogetherHistoryItem = ListLevelParagraphKeepLinesTogetherHistoryItem;
    var ListLevelParagraphLeftIndentHistoryItem = (function (_super) {
        __extends(ListLevelParagraphLeftIndentHistoryItem, _super);
        function ListLevelParagraphLeftIndentHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelParagraphLeftIndentHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelParagraphPropertiesManipulator.leftIndent;
        };
        return ListLevelParagraphLeftIndentHistoryItem;
    }(ListLevelParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelParagraphLeftIndentHistoryItem = ListLevelParagraphLeftIndentHistoryItem;
    var ListLevelParagraphLineSpacingHistoryItem = (function (_super) {
        __extends(ListLevelParagraphLineSpacingHistoryItem, _super);
        function ListLevelParagraphLineSpacingHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelParagraphLineSpacingHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelParagraphPropertiesManipulator.lineSpacing;
        };
        return ListLevelParagraphLineSpacingHistoryItem;
    }(ListLevelParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelParagraphLineSpacingHistoryItem = ListLevelParagraphLineSpacingHistoryItem;
    var ListLevelParagraphLineSpacingTypeHistoryItem = (function (_super) {
        __extends(ListLevelParagraphLineSpacingTypeHistoryItem, _super);
        function ListLevelParagraphLineSpacingTypeHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelParagraphLineSpacingTypeHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelParagraphPropertiesManipulator.lineSpacingType;
        };
        return ListLevelParagraphLineSpacingTypeHistoryItem;
    }(ListLevelParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelParagraphLineSpacingTypeHistoryItem = ListLevelParagraphLineSpacingTypeHistoryItem;
    var ListLevelParagraphOutlineLevelHistoryItem = (function (_super) {
        __extends(ListLevelParagraphOutlineLevelHistoryItem, _super);
        function ListLevelParagraphOutlineLevelHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelParagraphOutlineLevelHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelParagraphPropertiesManipulator.outlineLevel;
        };
        return ListLevelParagraphOutlineLevelHistoryItem;
    }(ListLevelParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelParagraphOutlineLevelHistoryItem = ListLevelParagraphOutlineLevelHistoryItem;
    var ListLevelParagraphPageBreakBeforeHistoryItem = (function (_super) {
        __extends(ListLevelParagraphPageBreakBeforeHistoryItem, _super);
        function ListLevelParagraphPageBreakBeforeHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelParagraphPageBreakBeforeHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelParagraphPropertiesManipulator.pageBreakBefore;
        };
        return ListLevelParagraphPageBreakBeforeHistoryItem;
    }(ListLevelParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelParagraphPageBreakBeforeHistoryItem = ListLevelParagraphPageBreakBeforeHistoryItem;
    var ListLevelParagraphRightIndentHistoryItem = (function (_super) {
        __extends(ListLevelParagraphRightIndentHistoryItem, _super);
        function ListLevelParagraphRightIndentHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelParagraphRightIndentHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelParagraphPropertiesManipulator.rightIndent;
        };
        return ListLevelParagraphRightIndentHistoryItem;
    }(ListLevelParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelParagraphRightIndentHistoryItem = ListLevelParagraphRightIndentHistoryItem;
    var ListLevelParagraphSpacingAfterHistoryItem = (function (_super) {
        __extends(ListLevelParagraphSpacingAfterHistoryItem, _super);
        function ListLevelParagraphSpacingAfterHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelParagraphSpacingAfterHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelParagraphPropertiesManipulator.spacingAfter;
        };
        return ListLevelParagraphSpacingAfterHistoryItem;
    }(ListLevelParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelParagraphSpacingAfterHistoryItem = ListLevelParagraphSpacingAfterHistoryItem;
    var ListLevelParagraphSpacingBeforeHistoryItem = (function (_super) {
        __extends(ListLevelParagraphSpacingBeforeHistoryItem, _super);
        function ListLevelParagraphSpacingBeforeHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelParagraphSpacingBeforeHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelParagraphPropertiesManipulator.spacingBefore;
        };
        return ListLevelParagraphSpacingBeforeHistoryItem;
    }(ListLevelParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelParagraphSpacingBeforeHistoryItem = ListLevelParagraphSpacingBeforeHistoryItem;
    var ListLevelParagraphSuppressHyphenationHistoryItem = (function (_super) {
        __extends(ListLevelParagraphSuppressHyphenationHistoryItem, _super);
        function ListLevelParagraphSuppressHyphenationHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelParagraphSuppressHyphenationHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelParagraphPropertiesManipulator.suppressHyphenation;
        };
        return ListLevelParagraphSuppressHyphenationHistoryItem;
    }(ListLevelParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelParagraphSuppressHyphenationHistoryItem = ListLevelParagraphSuppressHyphenationHistoryItem;
    var ListLevelParagraphSuppressLineNumbersHistoryItem = (function (_super) {
        __extends(ListLevelParagraphSuppressLineNumbersHistoryItem, _super);
        function ListLevelParagraphSuppressLineNumbersHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelParagraphSuppressLineNumbersHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelParagraphPropertiesManipulator.suppressLineNumbers;
        };
        return ListLevelParagraphSuppressLineNumbersHistoryItem;
    }(ListLevelParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelParagraphSuppressLineNumbersHistoryItem = ListLevelParagraphSuppressLineNumbersHistoryItem;
    var ListLevelParagraphWidowOrphanControlHistoryItem = (function (_super) {
        __extends(ListLevelParagraphWidowOrphanControlHistoryItem, _super);
        function ListLevelParagraphWidowOrphanControlHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelParagraphWidowOrphanControlHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelParagraphPropertiesManipulator.widowOrphanControl;
        };
        return ListLevelParagraphWidowOrphanControlHistoryItem;
    }(ListLevelParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelParagraphWidowOrphanControlHistoryItem = ListLevelParagraphWidowOrphanControlHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ListLevelPropertiesHistoryItemBase = (function (_super) {
        __extends(ListLevelPropertiesHistoryItemBase, _super);
        function ListLevelPropertiesHistoryItemBase(modelManipulator, boundSubDocument, isAbstractList, listIndex, levelIndex, newValue) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.newValue = newValue;
            _this.isAbstractList = isAbstractList;
            _this.listIndex = listIndex;
            _this.levelIndex = levelIndex;
            return _this;
        }
        ListLevelPropertiesHistoryItemBase.prototype.redo = function () {
            this.oldState = this.getManipulator().setValue(this.boundSubDocument.documentModel, this.isAbstractList, this.listIndex, this.levelIndex, this.newValue);
        };
        ListLevelPropertiesHistoryItemBase.prototype.undo = function () {
            this.getManipulator().restoreValue(this.boundSubDocument.documentModel, this.oldState);
        };
        ListLevelPropertiesHistoryItemBase.prototype.getManipulator = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return ListLevelPropertiesHistoryItemBase;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.ListLevelPropertiesHistoryItemBase = ListLevelPropertiesHistoryItemBase;
    var ListLevelStartHistoryItem = (function (_super) {
        __extends(ListLevelStartHistoryItem, _super);
        function ListLevelStartHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelStartHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelPropertiesManipulator.start;
        };
        return ListLevelStartHistoryItem;
    }(ListLevelPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelStartHistoryItem = ListLevelStartHistoryItem;
    var ListLevelAlignmentHistoryItem = (function (_super) {
        __extends(ListLevelAlignmentHistoryItem, _super);
        function ListLevelAlignmentHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelAlignmentHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelPropertiesManipulator.alignment;
        };
        return ListLevelAlignmentHistoryItem;
    }(ListLevelPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelAlignmentHistoryItem = ListLevelAlignmentHistoryItem;
    var ListLevelConvertPreviousLevelNumberingToDecimalHistoryItem = (function (_super) {
        __extends(ListLevelConvertPreviousLevelNumberingToDecimalHistoryItem, _super);
        function ListLevelConvertPreviousLevelNumberingToDecimalHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelConvertPreviousLevelNumberingToDecimalHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelPropertiesManipulator.convertPreviousLevelNumberingToDecimal;
        };
        return ListLevelConvertPreviousLevelNumberingToDecimalHistoryItem;
    }(ListLevelPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelConvertPreviousLevelNumberingToDecimalHistoryItem = ListLevelConvertPreviousLevelNumberingToDecimalHistoryItem;
    var ListLevelDisplayFormatStringHistoryItem = (function (_super) {
        __extends(ListLevelDisplayFormatStringHistoryItem, _super);
        function ListLevelDisplayFormatStringHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelDisplayFormatStringHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelPropertiesManipulator.displayFormatString;
        };
        return ListLevelDisplayFormatStringHistoryItem;
    }(ListLevelPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelDisplayFormatStringHistoryItem = ListLevelDisplayFormatStringHistoryItem;
    var ListLevelFormatHistoryItem = (function (_super) {
        __extends(ListLevelFormatHistoryItem, _super);
        function ListLevelFormatHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelFormatHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelPropertiesManipulator.format;
        };
        return ListLevelFormatHistoryItem;
    }(ListLevelPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelFormatHistoryItem = ListLevelFormatHistoryItem;
    var ListLevelLegacyHistoryItem = (function (_super) {
        __extends(ListLevelLegacyHistoryItem, _super);
        function ListLevelLegacyHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelLegacyHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelPropertiesManipulator.legacy;
        };
        return ListLevelLegacyHistoryItem;
    }(ListLevelPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelLegacyHistoryItem = ListLevelLegacyHistoryItem;
    var ListLevelLegacyIndentHistoryItem = (function (_super) {
        __extends(ListLevelLegacyIndentHistoryItem, _super);
        function ListLevelLegacyIndentHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelLegacyIndentHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelPropertiesManipulator.legacyIndent;
        };
        return ListLevelLegacyIndentHistoryItem;
    }(ListLevelPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelLegacyIndentHistoryItem = ListLevelLegacyIndentHistoryItem;
    var ListLevelLegacySpaceHistoryItem = (function (_super) {
        __extends(ListLevelLegacySpaceHistoryItem, _super);
        function ListLevelLegacySpaceHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelLegacySpaceHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelPropertiesManipulator.legacySpace;
        };
        return ListLevelLegacySpaceHistoryItem;
    }(ListLevelPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelLegacySpaceHistoryItem = ListLevelLegacySpaceHistoryItem;
    var ListLevelOriginalLeftIndentHistoryItem = (function (_super) {
        __extends(ListLevelOriginalLeftIndentHistoryItem, _super);
        function ListLevelOriginalLeftIndentHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelOriginalLeftIndentHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelPropertiesManipulator.originalLeftIndent;
        };
        return ListLevelOriginalLeftIndentHistoryItem;
    }(ListLevelPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelOriginalLeftIndentHistoryItem = ListLevelOriginalLeftIndentHistoryItem;
    var ListLevelRelativeRestartLevelHistoryItem = (function (_super) {
        __extends(ListLevelRelativeRestartLevelHistoryItem, _super);
        function ListLevelRelativeRestartLevelHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelRelativeRestartLevelHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelPropertiesManipulator.relativeRestartLevel;
        };
        return ListLevelRelativeRestartLevelHistoryItem;
    }(ListLevelPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelRelativeRestartLevelHistoryItem = ListLevelRelativeRestartLevelHistoryItem;
    var ListLevelSeparatorHistoryItem = (function (_super) {
        __extends(ListLevelSeparatorHistoryItem, _super);
        function ListLevelSeparatorHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelSeparatorHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelPropertiesManipulator.separator;
        };
        return ListLevelSeparatorHistoryItem;
    }(ListLevelPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelSeparatorHistoryItem = ListLevelSeparatorHistoryItem;
    var ListLevelSuppressBulletResizeHistoryItem = (function (_super) {
        __extends(ListLevelSuppressBulletResizeHistoryItem, _super);
        function ListLevelSuppressBulletResizeHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelSuppressBulletResizeHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelPropertiesManipulator.suppressBulletResize;
        };
        return ListLevelSuppressBulletResizeHistoryItem;
    }(ListLevelPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelSuppressBulletResizeHistoryItem = ListLevelSuppressBulletResizeHistoryItem;
    var ListLevelSuppressRestartHistoryItem = (function (_super) {
        __extends(ListLevelSuppressRestartHistoryItem, _super);
        function ListLevelSuppressRestartHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelSuppressRestartHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelPropertiesManipulator.suppressRestart;
        };
        return ListLevelSuppressRestartHistoryItem;
    }(ListLevelPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelSuppressRestartHistoryItem = ListLevelSuppressRestartHistoryItem;
    var ListLevelTemplateCodeHistoryItem = (function (_super) {
        __extends(ListLevelTemplateCodeHistoryItem, _super);
        function ListLevelTemplateCodeHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ListLevelTemplateCodeHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.listLevelPropertiesManipulator.templateCode;
        };
        return ListLevelTemplateCodeHistoryItem;
    }(ListLevelPropertiesHistoryItemBase));
    __aspxRichEdit.ListLevelTemplateCodeHistoryItem = ListLevelTemplateCodeHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AddAbstractNumberingListHistoryItem = (function (_super) {
        __extends(AddAbstractNumberingListHistoryItem, _super);
        function AddAbstractNumberingListHistoryItem(modelManipulator, subDocument, abstractNumberingList) {
            var _this = _super.call(this, modelManipulator, subDocument) || this;
            _this.abstractNumberingList = abstractNumberingList;
            return _this;
        }
        AddAbstractNumberingListHistoryItem.prototype.redo = function () {
            this.abstractNumberingListIndex = this.modelManipulator.numberingListManipulator.addAbstractNumberingList(this.abstractNumberingList);
        };
        AddAbstractNumberingListHistoryItem.prototype.undo = function () {
            this.modelManipulator.numberingListManipulator.deleteAbstractNumberingList(this.abstractNumberingListIndex);
        };
        return AddAbstractNumberingListHistoryItem;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.AddAbstractNumberingListHistoryItem = AddAbstractNumberingListHistoryItem;
    var AddNumberingListHistoryItem = (function (_super) {
        __extends(AddNumberingListHistoryItem, _super);
        function AddNumberingListHistoryItem(modelManipulator, subDocument, numberingList) {
            var _this = _super.call(this, modelManipulator, subDocument) || this;
            _this.numberingList = numberingList;
            return _this;
        }
        AddNumberingListHistoryItem.prototype.redo = function () {
            this.numberingListIndex = this.modelManipulator.numberingListManipulator.addNumberingList(this.numberingList);
        };
        AddNumberingListHistoryItem.prototype.undo = function () {
            this.modelManipulator.numberingListManipulator.deleteNumberingList(this.numberingListIndex);
        };
        return AddNumberingListHistoryItem;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.AddNumberingListHistoryItem = AddNumberingListHistoryItem;
    var AddParagraphToListHistoryItem = (function (_super) {
        __extends(AddParagraphToListHistoryItem, _super);
        function AddParagraphToListHistoryItem(modelManipulator, subDocument, paragraphIndex, numberingListIndex, listLevelIndex) {
            var _this = _super.call(this, modelManipulator, subDocument) || this;
            _this.paragraphIndex = paragraphIndex;
            _this.numberingListIndex = numberingListIndex;
            _this.listLevelIndex = listLevelIndex;
            return _this;
        }
        AddParagraphToListHistoryItem.prototype.redo = function () {
            var paragraph = this.boundSubDocument.paragraphs[this.paragraphIndex];
            this.useValHistItem = new __aspxRichEdit.ParagraphUseValueHistoryItem(this.modelManipulator, this.boundSubDocument, this.boundSubDocument.paragraphs[this.paragraphIndex].interval, new __aspxRichEdit.Flag(paragraph.maskedParagraphProperties.useValue)
                .set(__aspxRichEdit.ParagraphPropertiesMask.UseLeftIndent, false)
                .set(__aspxRichEdit.ParagraphPropertiesMask.UseFirstLineIndent, false).getValue());
            this.useValHistItem.redo();
            this.state = this.modelManipulator.numberingListManipulator.setParagraphNumberingList(this.boundSubDocument, this.paragraphIndex, this.numberingListIndex, this.listLevelIndex);
        };
        AddParagraphToListHistoryItem.prototype.undo = function () {
            this.useValHistItem.undo();
            this.modelManipulator.numberingListManipulator.restoreParagraphNumberingList(this.boundSubDocument, this.state);
        };
        return AddParagraphToListHistoryItem;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.AddParagraphToListHistoryItem = AddParagraphToListHistoryItem;
    var RemoveParagraphFromListHistoryItem = (function (_super) {
        __extends(RemoveParagraphFromListHistoryItem, _super);
        function RemoveParagraphFromListHistoryItem(modelManipulator, subDocument, paragraphIndex) {
            var _this = _super.call(this, modelManipulator, subDocument) || this;
            _this.paragraphIndex = paragraphIndex;
            return _this;
        }
        RemoveParagraphFromListHistoryItem.prototype.redo = function () {
            this.state = this.modelManipulator.numberingListManipulator.removeNumberingListFromParagraph(this.boundSubDocument, this.paragraphIndex);
        };
        RemoveParagraphFromListHistoryItem.prototype.undo = function () {
            this.modelManipulator.numberingListManipulator.restoreParagraphNumberingList(this.boundSubDocument, this.state);
        };
        return RemoveParagraphFromListHistoryItem;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.RemoveParagraphFromListHistoryItem = RemoveParagraphFromListHistoryItem;
    var ListLevelNewStartHistoryItem = (function (_super) {
        __extends(ListLevelNewStartHistoryItem, _super);
        function ListLevelNewStartHistoryItem(modelManipulator, boundSubDocument, listIndex, levelIndex, newValue) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.newValue = newValue;
            _this.listIndex = listIndex;
            _this.levelIndex = levelIndex;
            return _this;
        }
        ListLevelNewStartHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.numberingListManipulator.setIOverrideListLevelNewStart(this.listIndex, this.levelIndex, this.newValue);
        };
        ListLevelNewStartHistoryItem.prototype.undo = function () {
            this.modelManipulator.numberingListManipulator.restoreIOverrideListLevelNewStart(this.oldState);
        };
        return ListLevelNewStartHistoryItem;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.ListLevelNewStartHistoryItem = ListLevelNewStartHistoryItem;
    var ListLevelOverrideStartHistoryItem = (function (_super) {
        __extends(ListLevelOverrideStartHistoryItem, _super);
        function ListLevelOverrideStartHistoryItem(modelManipulator, boundSubDocument, listIndex, levelIndex, overrideStart) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.newValue = overrideStart;
            _this.listIndex = listIndex;
            _this.levelIndex = levelIndex;
            return _this;
        }
        ListLevelOverrideStartHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.numberingListManipulator.setIOverrideListLevelOverrideStart(this.listIndex, this.levelIndex, this.newValue);
        };
        ListLevelOverrideStartHistoryItem.prototype.undo = function () {
            this.modelManipulator.numberingListManipulator.restoreIOverrideListLevelOverrideStart(this.oldState);
        };
        return ListLevelOverrideStartHistoryItem;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.ListLevelOverrideStartHistoryItem = ListLevelOverrideStartHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ParagraphUseValueHistoryItem = (function (_super) {
        __extends(ParagraphUseValueHistoryItem, _super);
        function ParagraphUseValueHistoryItem(modelManipulator, boundSubDocument, interval, newValue) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, interval) || this;
            _this.newValue = newValue;
            return _this;
        }
        ParagraphUseValueHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.paragraphPropertiesManipulator.useValue.setValue(this.boundSubDocument, this.interval, this.newValue);
        };
        ParagraphUseValueHistoryItem.prototype.undo = function () {
            this.modelManipulator.paragraphPropertiesManipulator.useValue.restoreValue(this.boundSubDocument, this.oldState);
        };
        return ParagraphUseValueHistoryItem;
    }(__aspxRichEdit.IntervalBasedHistoryItem));
    __aspxRichEdit.ParagraphUseValueHistoryItem = ParagraphUseValueHistoryItem;
    var TabHistoryItemBase = (function (_super) {
        __extends(TabHistoryItemBase, _super);
        function TabHistoryItemBase(modelManipulator, boundSubDocument, interval, tabInfo) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, interval) || this;
            _this.tabInfo = tabInfo;
            return _this;
        }
        return TabHistoryItemBase;
    }(__aspxRichEdit.IntervalBasedHistoryItem));
    __aspxRichEdit.TabHistoryItemBase = TabHistoryItemBase;
    var InsertTabToParagraphHistoryItem = (function (_super) {
        __extends(InsertTabToParagraphHistoryItem, _super);
        function InsertTabToParagraphHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertTabToParagraphHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.tabManipulator.insertTabToParagraph(this.boundSubDocument, this.interval, this.tabInfo);
        };
        InsertTabToParagraphHistoryItem.prototype.undo = function () {
            this.modelManipulator.tabManipulator.restoreInsertedTabToParagraph(this.boundSubDocument, this.oldState);
        };
        return InsertTabToParagraphHistoryItem;
    }(TabHistoryItemBase));
    __aspxRichEdit.InsertTabToParagraphHistoryItem = InsertTabToParagraphHistoryItem;
    var DeleteTabAtParagraphHistoryItem = (function (_super) {
        __extends(DeleteTabAtParagraphHistoryItem, _super);
        function DeleteTabAtParagraphHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DeleteTabAtParagraphHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.tabManipulator.deleteTabAtParagraph(this.boundSubDocument, this.interval, this.tabInfo);
        };
        DeleteTabAtParagraphHistoryItem.prototype.undo = function () {
            this.modelManipulator.tabManipulator.restoreDeletedTabAtParagraph(this.boundSubDocument, this.oldState);
        };
        return DeleteTabAtParagraphHistoryItem;
    }(TabHistoryItemBase));
    __aspxRichEdit.DeleteTabAtParagraphHistoryItem = DeleteTabAtParagraphHistoryItem;
    var ParagraphPropertiesHistoryItemBase = (function (_super) {
        __extends(ParagraphPropertiesHistoryItemBase, _super);
        function ParagraphPropertiesHistoryItemBase(modelManipulator, boundSubDocument, interval, newValue, newUse) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, interval) || this;
            _this.newValue = newValue;
            _this.newUse = newUse;
            return _this;
        }
        ParagraphPropertiesHistoryItemBase.prototype.redo = function () {
            this.oldState = this.getPropertiesManipulator().setValue(this.boundSubDocument, this.interval, this.newValue, this.newUse);
        };
        ParagraphPropertiesHistoryItemBase.prototype.undo = function () {
            this.getPropertiesManipulator().restoreValue(this.boundSubDocument, this.oldState);
        };
        ParagraphPropertiesHistoryItemBase.prototype.getPropertiesManipulator = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return ParagraphPropertiesHistoryItemBase;
    }(__aspxRichEdit.IntervalBasedHistoryItem));
    __aspxRichEdit.ParagraphPropertiesHistoryItemBase = ParagraphPropertiesHistoryItemBase;
    var ParagraphAlignmentHistoryItem = (function (_super) {
        __extends(ParagraphAlignmentHistoryItem, _super);
        function ParagraphAlignmentHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphAlignmentHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.paragraphPropertiesManipulator.align;
        };
        return ParagraphAlignmentHistoryItem;
    }(ParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ParagraphAlignmentHistoryItem = ParagraphAlignmentHistoryItem;
    var ParagraphContextualSpacingHistoryItem = (function (_super) {
        __extends(ParagraphContextualSpacingHistoryItem, _super);
        function ParagraphContextualSpacingHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphContextualSpacingHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.paragraphPropertiesManipulator.contextualSpacing;
        };
        return ParagraphContextualSpacingHistoryItem;
    }(ParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ParagraphContextualSpacingHistoryItem = ParagraphContextualSpacingHistoryItem;
    var ParagraphRightToLeftHistoryItem = (function (_super) {
        __extends(ParagraphRightToLeftHistoryItem, _super);
        function ParagraphRightToLeftHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphRightToLeftHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.paragraphPropertiesManipulator.rightToLeft;
        };
        return ParagraphRightToLeftHistoryItem;
    }(ParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ParagraphRightToLeftHistoryItem = ParagraphRightToLeftHistoryItem;
    var ParagraphAfterAutoSpacingHistoryItem = (function (_super) {
        __extends(ParagraphAfterAutoSpacingHistoryItem, _super);
        function ParagraphAfterAutoSpacingHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphAfterAutoSpacingHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.paragraphPropertiesManipulator.afterAutoSpacing;
        };
        return ParagraphAfterAutoSpacingHistoryItem;
    }(ParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ParagraphAfterAutoSpacingHistoryItem = ParagraphAfterAutoSpacingHistoryItem;
    var ParagraphShadingInfoIndexHistoryItem = (function (_super) {
        __extends(ParagraphShadingInfoIndexHistoryItem, _super);
        function ParagraphShadingInfoIndexHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphShadingInfoIndexHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.paragraphPropertiesManipulator.shadingInfo;
        };
        return ParagraphShadingInfoIndexHistoryItem;
    }(ParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ParagraphShadingInfoIndexHistoryItem = ParagraphShadingInfoIndexHistoryItem;
    var ParagraphBeforeAutoSpacingHistoryItem = (function (_super) {
        __extends(ParagraphBeforeAutoSpacingHistoryItem, _super);
        function ParagraphBeforeAutoSpacingHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphBeforeAutoSpacingHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.paragraphPropertiesManipulator.beforeAutoSpacing;
        };
        return ParagraphBeforeAutoSpacingHistoryItem;
    }(ParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ParagraphBeforeAutoSpacingHistoryItem = ParagraphBeforeAutoSpacingHistoryItem;
    var ParagraphFirstLineIndentHistoryItem = (function (_super) {
        __extends(ParagraphFirstLineIndentHistoryItem, _super);
        function ParagraphFirstLineIndentHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphFirstLineIndentHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.paragraphPropertiesManipulator.firstLineIndent;
        };
        return ParagraphFirstLineIndentHistoryItem;
    }(ParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ParagraphFirstLineIndentHistoryItem = ParagraphFirstLineIndentHistoryItem;
    var ParagraphFirstLineIndentTypeHistoryItem = (function (_super) {
        __extends(ParagraphFirstLineIndentTypeHistoryItem, _super);
        function ParagraphFirstLineIndentTypeHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphFirstLineIndentTypeHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.paragraphPropertiesManipulator.firstLineIndentType;
        };
        return ParagraphFirstLineIndentTypeHistoryItem;
    }(ParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ParagraphFirstLineIndentTypeHistoryItem = ParagraphFirstLineIndentTypeHistoryItem;
    var ParagraphKeepLinesTogetherHistoryItem = (function (_super) {
        __extends(ParagraphKeepLinesTogetherHistoryItem, _super);
        function ParagraphKeepLinesTogetherHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphKeepLinesTogetherHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.paragraphPropertiesManipulator.keepLinesTogether;
        };
        return ParagraphKeepLinesTogetherHistoryItem;
    }(ParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ParagraphKeepLinesTogetherHistoryItem = ParagraphKeepLinesTogetherHistoryItem;
    var ParagraphLeftIndentHistoryItem = (function (_super) {
        __extends(ParagraphLeftIndentHistoryItem, _super);
        function ParagraphLeftIndentHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphLeftIndentHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.paragraphPropertiesManipulator.leftIndent;
        };
        return ParagraphLeftIndentHistoryItem;
    }(ParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ParagraphLeftIndentHistoryItem = ParagraphLeftIndentHistoryItem;
    var ParagraphLineSpacingHistoryItem = (function (_super) {
        __extends(ParagraphLineSpacingHistoryItem, _super);
        function ParagraphLineSpacingHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphLineSpacingHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.paragraphPropertiesManipulator.lineSpacing;
        };
        return ParagraphLineSpacingHistoryItem;
    }(ParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ParagraphLineSpacingHistoryItem = ParagraphLineSpacingHistoryItem;
    var ParagraphLineSpacingTypeHistoryItem = (function (_super) {
        __extends(ParagraphLineSpacingTypeHistoryItem, _super);
        function ParagraphLineSpacingTypeHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphLineSpacingTypeHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.paragraphPropertiesManipulator.lineSpacingType;
        };
        return ParagraphLineSpacingTypeHistoryItem;
    }(ParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ParagraphLineSpacingTypeHistoryItem = ParagraphLineSpacingTypeHistoryItem;
    var ParagraphOutlineLevelHistoryItem = (function (_super) {
        __extends(ParagraphOutlineLevelHistoryItem, _super);
        function ParagraphOutlineLevelHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphOutlineLevelHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.paragraphPropertiesManipulator.outlineLevel;
        };
        return ParagraphOutlineLevelHistoryItem;
    }(ParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ParagraphOutlineLevelHistoryItem = ParagraphOutlineLevelHistoryItem;
    var ParagraphPageBreakBeforeHistoryItem = (function (_super) {
        __extends(ParagraphPageBreakBeforeHistoryItem, _super);
        function ParagraphPageBreakBeforeHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphPageBreakBeforeHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.paragraphPropertiesManipulator.pageBreakBefore;
        };
        return ParagraphPageBreakBeforeHistoryItem;
    }(ParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ParagraphPageBreakBeforeHistoryItem = ParagraphPageBreakBeforeHistoryItem;
    var ParagraphRightIndentHistoryItem = (function (_super) {
        __extends(ParagraphRightIndentHistoryItem, _super);
        function ParagraphRightIndentHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphRightIndentHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.paragraphPropertiesManipulator.rightIndent;
        };
        return ParagraphRightIndentHistoryItem;
    }(ParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ParagraphRightIndentHistoryItem = ParagraphRightIndentHistoryItem;
    var ParagraphSpacingAfterHistoryItem = (function (_super) {
        __extends(ParagraphSpacingAfterHistoryItem, _super);
        function ParagraphSpacingAfterHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphSpacingAfterHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.paragraphPropertiesManipulator.spacingAfter;
        };
        return ParagraphSpacingAfterHistoryItem;
    }(ParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ParagraphSpacingAfterHistoryItem = ParagraphSpacingAfterHistoryItem;
    var ParagraphSpacingBeforeHistoryItem = (function (_super) {
        __extends(ParagraphSpacingBeforeHistoryItem, _super);
        function ParagraphSpacingBeforeHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphSpacingBeforeHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.paragraphPropertiesManipulator.spacingBefore;
        };
        return ParagraphSpacingBeforeHistoryItem;
    }(ParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ParagraphSpacingBeforeHistoryItem = ParagraphSpacingBeforeHistoryItem;
    var ParagraphSuppressHyphenationHistoryItem = (function (_super) {
        __extends(ParagraphSuppressHyphenationHistoryItem, _super);
        function ParagraphSuppressHyphenationHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphSuppressHyphenationHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.paragraphPropertiesManipulator.suppressHyphenation;
        };
        return ParagraphSuppressHyphenationHistoryItem;
    }(ParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ParagraphSuppressHyphenationHistoryItem = ParagraphSuppressHyphenationHistoryItem;
    var ParagraphSuppressLineNumbersHistoryItem = (function (_super) {
        __extends(ParagraphSuppressLineNumbersHistoryItem, _super);
        function ParagraphSuppressLineNumbersHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphSuppressLineNumbersHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.paragraphPropertiesManipulator.suppressLineNumbers;
        };
        return ParagraphSuppressLineNumbersHistoryItem;
    }(ParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ParagraphSuppressLineNumbersHistoryItem = ParagraphSuppressLineNumbersHistoryItem;
    var ParagraphWidowOrphanControlHistoryItem = (function (_super) {
        __extends(ParagraphWidowOrphanControlHistoryItem, _super);
        function ParagraphWidowOrphanControlHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphWidowOrphanControlHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.paragraphPropertiesManipulator.widowOrphanControl;
        };
        return ParagraphWidowOrphanControlHistoryItem;
    }(ParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ParagraphWidowOrphanControlHistoryItem = ParagraphWidowOrphanControlHistoryItem;
    var ParagraphDivIdHistoryItem = (function (_super) {
        __extends(ParagraphDivIdHistoryItem, _super);
        function ParagraphDivIdHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphDivIdHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.paragraphPropertiesManipulator.divId;
        };
        return ParagraphDivIdHistoryItem;
    }(ParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ParagraphDivIdHistoryItem = ParagraphDivIdHistoryItem;
    var ParagraphKeepWithNextHistoryItem = (function (_super) {
        __extends(ParagraphKeepWithNextHistoryItem, _super);
        function ParagraphKeepWithNextHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ParagraphKeepWithNextHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.paragraphPropertiesManipulator.keepWithNext;
        };
        return ParagraphKeepWithNextHistoryItem;
    }(ParagraphPropertiesHistoryItemBase));
    __aspxRichEdit.ParagraphKeepWithNextHistoryItem = ParagraphKeepWithNextHistoryItem;
    var ParagraphPropertiesHistoryItem = (function (_super) {
        __extends(ParagraphPropertiesHistoryItem, _super);
        function ParagraphPropertiesHistoryItem(modelManipulator, boundSubDocument, paragraphIndex, paragraphProperties, style, numberingListIndex, listLevelIndex, tabs) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.paragraphIndex = paragraphIndex;
            _this.style = style;
            _this.numberingListIndex = numberingListIndex;
            _this.listLevelIndex = listLevelIndex;
            _this.paragraphProperties = paragraphProperties;
            _this.tabs = tabs.clone();
            return _this;
        }
        ParagraphPropertiesHistoryItem.prototype.redo = function () {
            var paragraph = this.boundSubDocument.paragraphs[this.paragraphIndex];
            this.oldParagraphProperties = paragraph.maskedParagraphProperties;
            this.oldStyle = paragraph.paragraphStyle;
            this.oldNumberingListIndex = paragraph.numberingListIndex;
            this.oldListLevelIndex = paragraph.listLevelIndex;
            this.oldTabs = paragraph.tabs.clone();
            this.modelManipulator.paragraphPropertiesManipulator.changeAllProperties(this.boundSubDocument, this.paragraphIndex, this.paragraphProperties, this.style, this.tabs, this.numberingListIndex, this.listLevelIndex);
        };
        ParagraphPropertiesHistoryItem.prototype.undo = function () {
            this.modelManipulator.paragraphPropertiesManipulator.changeAllProperties(this.boundSubDocument, this.paragraphIndex, this.oldParagraphProperties, this.oldStyle, this.oldTabs, this.oldNumberingListIndex, this.oldListLevelIndex);
        };
        return ParagraphPropertiesHistoryItem;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.ParagraphPropertiesHistoryItem = ParagraphPropertiesHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var PasteHtmlDataHistoryItem = (function (_super) {
        __extends(PasteHtmlDataHistoryItem, _super);
        function PasteHtmlDataHistoryItem(modelManipulator, boundSubDocument, interval, historyRuns, tablesInfo, maskedCharacterProperties, characterStyle) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.interval = interval;
            _this.maskedCharacterProperties = maskedCharacterProperties;
            _this.characterStyle = characterStyle;
            _this.historyRuns = historyRuns;
            _this.tablesInfo = tablesInfo;
            return _this;
        }
        PasteHtmlDataHistoryItem.prototype.redo = function () {
            this.insertRuns();
            this.insertTables();
        };
        PasteHtmlDataHistoryItem.prototype.undo = function () {
            for (var _i = 0, _a = this.historyTables; _i < _a.length; _i++) {
                var table = _a[_i];
                this.modelManipulator.tables.removeTable(this.boundSubDocument, table);
            }
            this.modelManipulator.text.removeIntervalWithoutHistory(this.boundSubDocument, this.interval, false);
        };
        PasteHtmlDataHistoryItem.prototype.insertRuns = function () {
            var fields = this.boundSubDocument.fields;
            var fieldStackHistory = [];
            for (var historyRunIndex = 0, historyRun; historyRun = this.historyRuns[historyRunIndex]; historyRunIndex++) {
                switch (historyRun.type) {
                    case __aspxRichEdit.RunType.ParagraphRun:
                        var historyRunParagraph = historyRun;
                        this.modelManipulator.text.insertParagraph(this.boundSubDocument, historyRunParagraph.offsetAtStartDocument, historyRunParagraph.characterProperties, historyRunParagraph.characterStyle, historyRunParagraph.paragraphMaskedProperties, historyRunParagraph.paragraphStyle, historyRunParagraph.isInsertPropertiesAndStyleIndexToCurrentParagraph, historyRunParagraph.numbericListIndex, historyRunParagraph.listLevelIndex, historyRunParagraph.tabs.clone());
                        break;
                    case __aspxRichEdit.RunType.InlinePictureRun:
                        var historyInlinePictureRun = historyRun;
                        this.modelManipulator.text.insertInlinePicture(this.boundSubDocument, historyInlinePictureRun.offsetAtStartDocument, historyInlinePictureRun.id, historyInlinePictureRun.originalWidth, historyInlinePictureRun.originalHeight, historyInlinePictureRun.scaleX, historyInlinePictureRun.scaleY, historyInlinePictureRun.lockAspectRatio, this.maskedCharacterProperties, this.characterStyle, historyInlinePictureRun.isLoaded, historyInlinePictureRun.publicAPIID);
                        if (!historyInlinePictureRun.isLoaded) {
                            this.modelManipulator.text.loadingInlinePicturesHashtable[historyInlinePictureRun.guid] = new __aspxRichEdit.LoadingOnPasteItem(this.boundSubDocument.id, this.boundSubDocument.getRunByPosition(historyInlinePictureRun.offsetAtStartDocument), historyInlinePictureRun);
                        }
                        break;
                    case __aspxRichEdit.RunType.FieldCodeStartRun:
                        fieldStackHistory.push(historyRun);
                        this.modelManipulator.text.insertText(this.boundSubDocument, historyRun.offsetAtStartDocument, historyRun.text, historyRun.characterProperties, historyRun.characterStyle, historyRun.type);
                        break;
                    case __aspxRichEdit.RunType.FieldResultEndRun:
                        this.modelManipulator.text.insertText(this.boundSubDocument, historyRun.offsetAtStartDocument, historyRun.text, historyRun.characterProperties, historyRun.characterStyle, historyRun.type);
                        var histFieldCodeStartRun = fieldStackHistory.pop();
                        var fieldInsertIndex = 0;
                        if (fields.length > 0) {
                            fieldInsertIndex = Math.max(0, __aspxRichEdit.Field.normedBinaryIndexOf(fields, histFieldCodeStartRun.startPosition + 1));
                            if (histFieldCodeStartRun.startPosition > fields[fieldInsertIndex].getFieldStartPosition())
                                fieldInsertIndex++;
                        }
                        var field = new __aspxRichEdit.Field(this.boundSubDocument.positionManager, fieldInsertIndex, histFieldCodeStartRun.startPosition, histFieldCodeStartRun.separatorPosition, histFieldCodeStartRun.endPosition, histFieldCodeStartRun.showCode, histFieldCodeStartRun.hyperlinkInfo ? histFieldCodeStartRun.hyperlinkInfo.clone() : undefined);
                        __aspxRichEdit.Field.addField(fields, field);
                        this.modelManipulator.dispatcher.notifyFieldInserted(this.boundSubDocument, histFieldCodeStartRun.startPosition, histFieldCodeStartRun.separatorPosition, histFieldCodeStartRun.endPosition);
                        if (histFieldCodeStartRun.hyperlinkInfo) {
                            var codeInterval = __aspxRichEdit.FixedInterval.fromPositions(histFieldCodeStartRun.startPosition + 1, histFieldCodeStartRun.separatorPosition);
                            var resultInterval = __aspxRichEdit.FixedInterval.fromPositions(histFieldCodeStartRun.separatorPosition + 1, histFieldCodeStartRun.endPosition - 1);
                            this.modelManipulator.dispatcher.notifyHyperlinkInfoChanged(this.boundSubDocument, resultInterval, codeInterval, histFieldCodeStartRun.hyperlinkInfo);
                            if (resultInterval.length)
                                this.modelManipulator.styles.setCharacterStyle(this.boundSubDocument, resultInterval, this.boundSubDocument.documentModel.getCharacterStyleByName(__aspxRichEdit.CharacterStyle.hyperlinkStyleName), false);
                        }
                        break;
                    default:
                        this.modelManipulator.text.insertText(this.boundSubDocument, historyRun.offsetAtStartDocument, historyRun.text, historyRun.characterProperties, historyRun.characterStyle, historyRun.type);
                        break;
                }
            }
            __aspxRichEdit.Field.DEBUG_FIELDS_CHECKS(this.boundSubDocument);
        };
        PasteHtmlDataHistoryItem.prototype.insertTables = function () {
            this.historyTables = [];
            for (var _i = 0, _a = this.tablesInfo; _i < _a.length; _i++) {
                var tableInfo = _a[_i];
                var table = new __aspxRichEdit.Table(tableInfo.properties, this.boundSubDocument.documentModel.getDefaultTableStyle());
                table.preferredWidth = tableInfo.width;
                for (var _b = 0, _c = tableInfo.rows; _b < _c.length; _b++) {
                    var rowInfo = _c[_b];
                    var row = new __aspxRichEdit.TableRow(table, this.boundSubDocument.documentModel.cache.tableRowPropertiesCache.getItem(rowInfo.properties));
                    row.gridAfter = rowInfo.gridAfter;
                    row.gridBefore = rowInfo.gridBefore;
                    row.widthAfter = rowInfo.widthAfter;
                    row.widthBefore = rowInfo.widthBefore;
                    table.rows.push(row);
                    for (var _d = 0, _e = rowInfo.cells; _d < _e.length; _d++) {
                        var cellInfo = _e[_d];
                        var cell = new __aspxRichEdit.TableCell(row, this.boundSubDocument.documentModel.cache.tableCellPropertiesCache.getItem(cellInfo.properties));
                        cell.preferredWidth = cellInfo.preferredWidth;
                        cell.startParagraphPosition = this.boundSubDocument.positionManager.registerPosition(cellInfo.startPosition);
                        cell.endParagrapPosition = this.boundSubDocument.positionManager.registerPosition(cellInfo.endPosition);
                        cell.columnSpan = cellInfo.columnSpan;
                        cell.verticalMerging = cellInfo.firstWhenVerticallyMerged ?
                            (cellInfo.rowSpan > 1 ? __aspxRichEdit.TableCellMergingState.Restart : __aspxRichEdit.TableCellMergingState.None) :
                            __aspxRichEdit.TableCellMergingState.Continue;
                        row.cells.push(cell);
                    }
                }
                var positionToPaste = tableInfo.rows[0].cells[0].startPosition;
                this.modelManipulator.tables.pasteTable(this.boundSubDocument, table, positionToPaste);
                var insertedTable = __aspxRichEdit.Table.getTableByPosition(this.boundSubDocument.tables, positionToPaste, true);
                new __aspxRichEdit.TableNormalizator(insertedTable, function (table, rowIndex, newValue) { return table.rows[rowIndex].gridBefore = newValue; }, function (table, rowIndex, newValue) { return table.rows[rowIndex].gridAfter = newValue; }, function (table, rowIndex, newValue) { return table.rows[rowIndex].widthBefore = newValue; }, function (table, rowIndex, newValue) { return table.rows[rowIndex].widthAfter = newValue; }, function (table, rowIndex, cellIndex, newValue) { return table.rows[rowIndex].cells[cellIndex].columnSpan = newValue; }, function (table, rowIndex, cellIndex, newValue) { return table.rows[rowIndex].cells[cellIndex].verticalMerging = newValue; })
                    .normalizeAll();
                if (insertedTable)
                    this.historyTables.push(insertedTable);
            }
        };
        return PasteHtmlDataHistoryItem;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.PasteHtmlDataHistoryItem = PasteHtmlDataHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RemoveHyperlinkHistoryItem = (function (_super) {
        __extends(RemoveHyperlinkHistoryItem, _super);
        function RemoveHyperlinkHistoryItem(modelManipulator, field, control) {
            var _this = _super.call(this, modelManipulator, modelManipulator.model.activeSubDocument) || this;
            _this.control = control;
            _this.fieldIndex = field.index;
            _this.startPos = field.getFieldStartPosition();
            _this.separatorPos = field.getSeparatorPosition();
            _this.endPos = field.getFieldEndPosition();
            _this.hyperlinkInfo = field.getHyperlinkInfo().clone();
            return _this;
        }
        RemoveHyperlinkHistoryItem.prototype.redo = function () {
            var resultInterval = __aspxRichEdit.FixedInterval.fromPositions(this.separatorPos + 1, this.endPos - 1);
            if (!this.styleHistory) {
                var charDefaultStyle = this.modelManipulator.model.getCharacterStyleByName(__aspxRichEdit.CharacterStyle.defaultParagraphCharacterStyleName);
                this.styleHistory = new __aspxRichEdit.ApplyCharacterStyleHistoryItem(this.modelManipulator, this.boundSubDocument, resultInterval, charDefaultStyle, false);
            }
            this.styleHistory.redo();
            var rangeCopy = resultInterval.length ? __aspxRichEdit.ModelManipulator.createRangeCopy(this.boundSubDocument, [resultInterval]) : null;
            var fieldInterval = __aspxRichEdit.FixedInterval.fromPositions(this.startPos, this.endPos);
            this.removeOperationResult = this.modelManipulator.text.removeInterval(this.boundSubDocument, fieldInterval, false);
            if (rangeCopy)
                __aspxRichEdit.ModelManipulator.insertRangeCopy(this.control, this.boundSubDocument, rangeCopy, this.startPos);
        };
        RemoveHyperlinkHistoryItem.prototype.undo = function () {
            this.modelManipulator.text.restoreRemovedInterval(this.boundSubDocument, this.removeOperationResult);
            this.styleHistory.undo();
        };
        return RemoveHyperlinkHistoryItem;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.RemoveHyperlinkHistoryItem = RemoveHyperlinkHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RemoveIntervalHistoryItem = (function (_super) {
        __extends(RemoveIntervalHistoryItem, _super);
        function RemoveIntervalHistoryItem(modelManipulator, boundSubDocument, interval, setPropertiesSecondParagraph) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, interval) || this;
            _this.setPropertiesSecondParagraph = setPropertiesSecondParagraph;
            return _this;
        }
        RemoveIntervalHistoryItem.prototype.redo = function () {
            this.result = this.modelManipulator.text.removeInterval(this.boundSubDocument, this.interval, this.setPropertiesSecondParagraph);
        };
        RemoveIntervalHistoryItem.prototype.undo = function () {
            this.modelManipulator.text.restoreRemovedInterval(this.boundSubDocument, this.result);
        };
        return RemoveIntervalHistoryItem;
    }(__aspxRichEdit.IntervalBasedHistoryItem));
    __aspxRichEdit.RemoveIntervalHistoryItem = RemoveIntervalHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SectionPropertiesHistoryItemBase = (function (_super) {
        __extends(SectionPropertiesHistoryItemBase, _super);
        function SectionPropertiesHistoryItemBase(modelManipulator, boundSubDocument, interval, newValue) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, interval) || this;
            _this.newValue = newValue;
            return _this;
        }
        SectionPropertiesHistoryItemBase.prototype.redo = function () {
            this.oldState = this.getPropertiesManipulator().setValue(this.boundSubDocument, this.interval, this.newValue);
        };
        SectionPropertiesHistoryItemBase.prototype.undo = function () {
            this.getPropertiesManipulator().restoreValue(this.boundSubDocument, this.oldState);
        };
        SectionPropertiesHistoryItemBase.prototype.getPropertiesManipulator = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return SectionPropertiesHistoryItemBase;
    }(__aspxRichEdit.IntervalBasedHistoryItem));
    __aspxRichEdit.SectionPropertiesHistoryItemBase = SectionPropertiesHistoryItemBase;
    var SectionMarginLeftHistoryItem = (function (_super) {
        __extends(SectionMarginLeftHistoryItem, _super);
        function SectionMarginLeftHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SectionMarginLeftHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.sectionProperties.marginLeft;
        };
        return SectionMarginLeftHistoryItem;
    }(SectionPropertiesHistoryItemBase));
    __aspxRichEdit.SectionMarginLeftHistoryItem = SectionMarginLeftHistoryItem;
    var SectionMarginTopHistoryItem = (function (_super) {
        __extends(SectionMarginTopHistoryItem, _super);
        function SectionMarginTopHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SectionMarginTopHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.sectionProperties.marginTop;
        };
        return SectionMarginTopHistoryItem;
    }(SectionPropertiesHistoryItemBase));
    __aspxRichEdit.SectionMarginTopHistoryItem = SectionMarginTopHistoryItem;
    var SectionMarginRightHistoryItem = (function (_super) {
        __extends(SectionMarginRightHistoryItem, _super);
        function SectionMarginRightHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SectionMarginRightHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.sectionProperties.marginRight;
        };
        return SectionMarginRightHistoryItem;
    }(SectionPropertiesHistoryItemBase));
    __aspxRichEdit.SectionMarginRightHistoryItem = SectionMarginRightHistoryItem;
    var SectionMarginBottomHistoryItem = (function (_super) {
        __extends(SectionMarginBottomHistoryItem, _super);
        function SectionMarginBottomHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SectionMarginBottomHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.sectionProperties.marginBottom;
        };
        return SectionMarginBottomHistoryItem;
    }(SectionPropertiesHistoryItemBase));
    __aspxRichEdit.SectionMarginBottomHistoryItem = SectionMarginBottomHistoryItem;
    var SectionColumnCountHistoryItem = (function (_super) {
        __extends(SectionColumnCountHistoryItem, _super);
        function SectionColumnCountHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SectionColumnCountHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.sectionProperties.columnCount;
        };
        return SectionColumnCountHistoryItem;
    }(SectionPropertiesHistoryItemBase));
    __aspxRichEdit.SectionColumnCountHistoryItem = SectionColumnCountHistoryItem;
    var SectionSpaceHistoryItem = (function (_super) {
        __extends(SectionSpaceHistoryItem, _super);
        function SectionSpaceHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SectionSpaceHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.sectionProperties.space;
        };
        return SectionSpaceHistoryItem;
    }(SectionPropertiesHistoryItemBase));
    __aspxRichEdit.SectionSpaceHistoryItem = SectionSpaceHistoryItem;
    var SectionEqualWidthColumnsHistoryItem = (function (_super) {
        __extends(SectionEqualWidthColumnsHistoryItem, _super);
        function SectionEqualWidthColumnsHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SectionEqualWidthColumnsHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.sectionProperties.equalWidthColumns;
        };
        return SectionEqualWidthColumnsHistoryItem;
    }(SectionPropertiesHistoryItemBase));
    __aspxRichEdit.SectionEqualWidthColumnsHistoryItem = SectionEqualWidthColumnsHistoryItem;
    var SectionColumnsInfoHistoryItem = (function (_super) {
        __extends(SectionColumnsInfoHistoryItem, _super);
        function SectionColumnsInfoHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SectionColumnsInfoHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.sectionProperties.columnsInfo;
        };
        return SectionColumnsInfoHistoryItem;
    }(SectionPropertiesHistoryItemBase));
    __aspxRichEdit.SectionColumnsInfoHistoryItem = SectionColumnsInfoHistoryItem;
    var SectionPageWidthHistoryItem = (function (_super) {
        __extends(SectionPageWidthHistoryItem, _super);
        function SectionPageWidthHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SectionPageWidthHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.sectionProperties.pageWidth;
        };
        return SectionPageWidthHistoryItem;
    }(SectionPropertiesHistoryItemBase));
    __aspxRichEdit.SectionPageWidthHistoryItem = SectionPageWidthHistoryItem;
    var SectionPageHeightHistoryItem = (function (_super) {
        __extends(SectionPageHeightHistoryItem, _super);
        function SectionPageHeightHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SectionPageHeightHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.sectionProperties.pageHeight;
        };
        return SectionPageHeightHistoryItem;
    }(SectionPropertiesHistoryItemBase));
    __aspxRichEdit.SectionPageHeightHistoryItem = SectionPageHeightHistoryItem;
    var SectionStartTypeHistoryItem = (function (_super) {
        __extends(SectionStartTypeHistoryItem, _super);
        function SectionStartTypeHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SectionStartTypeHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.sectionProperties.startType;
        };
        return SectionStartTypeHistoryItem;
    }(SectionPropertiesHistoryItemBase));
    __aspxRichEdit.SectionStartTypeHistoryItem = SectionStartTypeHistoryItem;
    var SectionLandscapeHistoryItem = (function (_super) {
        __extends(SectionLandscapeHistoryItem, _super);
        function SectionLandscapeHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SectionLandscapeHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.sectionProperties.landscape;
        };
        return SectionLandscapeHistoryItem;
    }(SectionPropertiesHistoryItemBase));
    __aspxRichEdit.SectionLandscapeHistoryItem = SectionLandscapeHistoryItem;
    var SectionDifferentFirstPageHistoryItem = (function (_super) {
        __extends(SectionDifferentFirstPageHistoryItem, _super);
        function SectionDifferentFirstPageHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SectionDifferentFirstPageHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.sectionProperties.differentFirstPage;
        };
        return SectionDifferentFirstPageHistoryItem;
    }(SectionPropertiesHistoryItemBase));
    __aspxRichEdit.SectionDifferentFirstPageHistoryItem = SectionDifferentFirstPageHistoryItem;
    var SectionHeaderOffsetHistoryItem = (function (_super) {
        __extends(SectionHeaderOffsetHistoryItem, _super);
        function SectionHeaderOffsetHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SectionHeaderOffsetHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.sectionProperties.headerOffset;
        };
        return SectionHeaderOffsetHistoryItem;
    }(SectionPropertiesHistoryItemBase));
    __aspxRichEdit.SectionHeaderOffsetHistoryItem = SectionHeaderOffsetHistoryItem;
    var SectionFooterOffsetHistoryItem = (function (_super) {
        __extends(SectionFooterOffsetHistoryItem, _super);
        function SectionFooterOffsetHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SectionFooterOffsetHistoryItem.prototype.getPropertiesManipulator = function () {
            return this.modelManipulator.sectionProperties.footerOffset;
        };
        return SectionFooterOffsetHistoryItem;
    }(SectionPropertiesHistoryItemBase));
    __aspxRichEdit.SectionFooterOffsetHistoryItem = SectionFooterOffsetHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeCaseHistoryItemBase = (function (_super) {
        __extends(ChangeCaseHistoryItemBase, _super);
        function ChangeCaseHistoryItemBase(modelManipulator, boundSubDocument, layout, interval, control) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, interval) || this;
            _this.control = control;
            _this.layout = layout;
            return _this;
        }
        ChangeCaseHistoryItemBase.prototype.undo = function () {
            this.modelManipulator.textCaseManipulator.applyBufferState(this.boundSubDocument, this.oldState);
        };
        return ChangeCaseHistoryItemBase;
    }(__aspxRichEdit.IntervalBasedHistoryItem));
    __aspxRichEdit.ChangeCaseHistoryItemBase = ChangeCaseHistoryItemBase;
    var UpperCaseHistoryItem = (function (_super) {
        __extends(UpperCaseHistoryItem, _super);
        function UpperCaseHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        UpperCaseHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.textCaseManipulator.applyUpperCase(this.control, this.boundSubDocument, this.layout, this.interval);
        };
        return UpperCaseHistoryItem;
    }(ChangeCaseHistoryItemBase));
    __aspxRichEdit.UpperCaseHistoryItem = UpperCaseHistoryItem;
    var LowerCaseHistoryItem = (function (_super) {
        __extends(LowerCaseHistoryItem, _super);
        function LowerCaseHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LowerCaseHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.textCaseManipulator.applyLowerCase(this.control, this.boundSubDocument, this.layout, this.interval);
        };
        return LowerCaseHistoryItem;
    }(ChangeCaseHistoryItemBase));
    __aspxRichEdit.LowerCaseHistoryItem = LowerCaseHistoryItem;
    var CapitalizeEachWordCaseHistoryItem = (function (_super) {
        __extends(CapitalizeEachWordCaseHistoryItem, _super);
        function CapitalizeEachWordCaseHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CapitalizeEachWordCaseHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.textCaseManipulator.applyCapitalizeEachWordCase(this.control, this.boundSubDocument, this.layout, this.interval);
        };
        return CapitalizeEachWordCaseHistoryItem;
    }(ChangeCaseHistoryItemBase));
    __aspxRichEdit.CapitalizeEachWordCaseHistoryItem = CapitalizeEachWordCaseHistoryItem;
    var ToggleCaseHistoryItem = (function (_super) {
        __extends(ToggleCaseHistoryItem, _super);
        function ToggleCaseHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleCaseHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.textCaseManipulator.applyToggleCase(this.control, this.boundSubDocument, this.layout, this.interval);
        };
        return ToggleCaseHistoryItem;
    }(ChangeCaseHistoryItemBase));
    __aspxRichEdit.ToggleCaseHistoryItem = ToggleCaseHistoryItem;
    var SentenceCaseHistoryItem = (function (_super) {
        __extends(SentenceCaseHistoryItem, _super);
        function SentenceCaseHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SentenceCaseHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.textCaseManipulator.applySentenceCase(this.control, this.boundSubDocument, this.layout, this.interval);
        };
        return SentenceCaseHistoryItem;
    }(ChangeCaseHistoryItemBase));
    __aspxRichEdit.SentenceCaseHistoryItem = SentenceCaseHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var BookmarksManipulator = (function () {
        function BookmarksManipulator(manipulator) {
            this.manipulator = manipulator;
        }
        BookmarksManipulator.prototype.createBookmark = function (subDocument, bkmTemplate, isCallSort) {
            subDocument.bookmarks.push(new __aspxRichEdit.Bookmark(subDocument.positionManager, bkmTemplate, bkmTemplate.name));
            if (isCallSort)
                subDocument.bookmarks = subDocument.bookmarks.sort(__aspxRichEdit.CompareUtils.bookmarksComparer);
            this.manipulator.dispatcher.notifyBookmarkCreated(subDocument, new __aspxRichEdit.HistoryItemState()
                .register(new __aspxRichEdit.HistoryItemBookmarkStateObject(bkmTemplate)));
        };
        BookmarksManipulator.prototype.deleteBookmark = function (subDocument, bkmTemplate, bookmarkIndex) {
            if (bookmarkIndex === void 0) { bookmarkIndex = __aspxRichEdit.ListUtils.indexBy(subDocument.bookmarks, function (b) { return b.constBookmark.equals(bkmTemplate); }); }
            subDocument.bookmarks.splice(bookmarkIndex, 1)[0].destructor(subDocument.positionManager);
            this.manipulator.dispatcher.notifyBookmarkDeleted(subDocument, new __aspxRichEdit.HistoryItemState()
                .register(new __aspxRichEdit.HistoryItemBookmarkStateObject(bkmTemplate)));
        };
        BookmarksManipulator.findBookmark = function (subDocuments, name) {
            var bookmark;
            var subDocument = __aspxRichEdit.MapUtilsKeyAsNumber.elementBy(subDocuments, function (subDoc) {
                return !!(bookmark = __aspxRichEdit.ListUtils.elementBy(subDoc.bookmarks, function (bm) { return bm.name == name; }));
            });
            return subDocument ? new __aspxRichEdit.BookmarkAndSubDocument(bookmark, subDocument) : null;
        };
        BookmarksManipulator.copyBookmarksFromSubDocumentTo = function (fromSubDocument, toSubDocument, fromIntervals) {
            var bkms = [];
            __aspxRichEdit.IntervalAlgorithms.handleAffectedObjects(fromSubDocument.bookmarks, __aspxRichEdit.IntervalAlgorithms.getMergedIntervalsTemplate(fromIntervals, true, new __aspxRichEdit.BoundaryInterval(0, 0)), function (bkm, _index, interval, intersection) {
                if (intersection.length || bkm.interval.length == 0)
                    bkms.push(new __aspxRichEdit.ConstBookmark(new __aspxRichEdit.BoundaryInterval(bkm.start - interval.start, bkm.end - interval.start), bkm.name));
            }, BookmarksManipulator.findBookmarkStartIndex);
            toSubDocument.bookmarks = __aspxRichEdit.ListUtils.map(__aspxRichEdit.ListUtils.unique(bkms, __aspxRichEdit.CompareUtils.bookmarksComparer, __aspxRichEdit.CompareUtils.bookmarksComparer), function (tmlBkm) { return tmlBkm.createBookmark(toSubDocument.positionManager); });
        };
        BookmarksManipulator.prototype.deleteBookmarks = function (subDocument, interval) {
            var bookmarks = subDocument.bookmarks;
            var result = [];
            var ind = __aspxRichEdit.Utils.normedInterpolationIndexOf(bookmarks, function (b) { return b.start; }, interval.start);
            for (var currBkm = void 0; (currBkm = bookmarks[ind]) && currBkm.start >= interval.start; ind--)
                ;
            ind = Math.max(0, ind);
            for (var curr = void 0; (curr = bookmarks[ind]) && curr.interval.start <= interval.end;) {
                if (interval.containsInterval(curr.interval)) {
                    var tmpl = curr.constBookmark;
                    this.deleteBookmark(subDocument, tmpl, ind);
                    result.push(tmpl);
                }
                else
                    ind++;
            }
            return result;
        };
        BookmarksManipulator.prototype.insertBookmarksFromSubDocument = function (fromSubDocument, toSubDocument, fromInterval, modelsConstOffset) {
            var bookmarks = fromSubDocument.bookmarks;
            var ind = __aspxRichEdit.Utils.normedInterpolationIndexOf(bookmarks, function (b) { return b.start; }, fromInterval.start);
            for (var currBkm = void 0; (currBkm = bookmarks[ind]) && currBkm.start >= fromInterval.start; ind--)
                ;
            ind = Math.max(0, ind);
            for (var bkm = void 0; (bkm = bookmarks[ind]) && bkm.start <= fromInterval.end; ind++) {
                if (fromInterval.containsInterval(bkm.interval)) {
                    var template = bkm.constBookmark;
                    template.interval.start += modelsConstOffset;
                    template.interval.end += modelsConstOffset;
                    this.createBookmark(toSubDocument, template, false);
                }
            }
            toSubDocument.bookmarks = toSubDocument.bookmarks.sort(__aspxRichEdit.CompareUtils.bookmarksComparer);
        };
        BookmarksManipulator.findBookmarkStartIndex = function (pos, bookmarks) {
            var ind = __aspxRichEdit.Utils.normedInterpolationIndexOf(bookmarks, function (b) { return b.start; }, pos);
            for (var currBkm = void 0; (currBkm = bookmarks[ind]) && currBkm.start >= pos; ind--)
                ;
            return Math.max(0, ind);
        };
        return BookmarksManipulator;
    }());
    __aspxRichEdit.BookmarksManipulator = BookmarksManipulator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var CharacterPropertiesManipulator = (function () {
        function CharacterPropertiesManipulator(manipulator) {
            this.fontBold = new MaskedCharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.bold);
            this.fontItalic = new MaskedCharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.italic);
            this.fontName = new MaskedCharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.fontInfo);
            this.fontSize = new MaskedCharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.size);
            this.fontCaps = new MaskedCharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.allCaps);
            this.fontStrikeoutType = new MaskedCharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.strikeoutType);
            this.fontStrikeoutWordsOnly = new MaskedCharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.strikeoutWordsOnly);
            this.fontUnderlineType = new MaskedCharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.underlineType);
            this.fontHidden = new MaskedCharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.hidden);
            this.script = new MaskedCharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.script);
            this.fontUnderlineWordsOnly = new MaskedCharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.underlineWordsOnly);
            this.fontNoProof = new MaskedCharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.noProof);
            this.langInfo = new MaskedCharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.langInfo);
            this.compositeFontInfo = new MaskedCharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.compositeFontInfo);
            this.textColor = new MaskedCharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.textColor);
            this.shadingInfo = new MaskedCharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.shadingInfo);
            this.fontHighlightColor = new MaskedCharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.highlightColor);
            this.fontStrikeoutColor = new MaskedCharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.strikeoutColor);
            this.fontUnderlineColor = new MaskedCharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.underlineColor);
            this.useValue = new CharacterPropertiesUseValueManipulator(manipulator);
            this.manipulator = manipulator;
        }
        CharacterPropertiesManipulator.prototype.setValue = function (subDocument, interval, newValue) {
            var oldState = new __aspxRichEdit.HistoryItemIntervalState();
            if (!__aspxRichEdit.ControlOptions.isEnabled(subDocument.documentModel.options.characterFormatting))
                return oldState;
            var newState = new __aspxRichEdit.HistoryItemIntervalState();
            var iterator = subDocument.getRunIterator(interval);
            while (iterator.moveNext()) {
                var run = iterator.currentRun;
                oldState.register(new __aspxRichEdit.HistoryItemIntervalCharacterPropertiesStateObject(iterator.currentInterval(), run.maskedCharacterProperties.clone()));
                run.setCharacterProperties(newValue);
                run.onCharacterPropertiesChanged();
            }
            newState.register(new __aspxRichEdit.HistoryItemIntervalCharacterPropertiesStateObject(interval, newValue));
            this.manipulator.dispatcher.notifyCharacterPropertiesChanged(newState, subDocument);
            return oldState;
        };
        CharacterPropertiesManipulator.prototype.restoreValue = function (subDocument, state) {
            if (!__aspxRichEdit.ControlOptions.isEnabled(subDocument.documentModel.options.characterFormatting))
                return;
            for (var stateValue, i = 0; stateValue = state.objects[i]; i++) {
                var iterator = subDocument.getRunIterator(stateValue.interval);
                while (iterator.moveNext()) {
                    var run = iterator.currentRun;
                    run.setCharacterProperties(stateValue.value);
                    run.onCharacterPropertiesChanged();
                }
            }
            this.manipulator.dispatcher.notifyCharacterPropertiesChanged(state, subDocument);
        };
        return CharacterPropertiesManipulator;
    }());
    __aspxRichEdit.CharacterPropertiesManipulator = CharacterPropertiesManipulator;
    var CharacterPropertiesUseValueManipulator = (function () {
        function CharacterPropertiesUseValueManipulator(manipulator) {
            this.manipulator = manipulator;
        }
        CharacterPropertiesUseValueManipulator.prototype.setValue = function (subDocument, interval, newValue) {
            var oldState = new __aspxRichEdit.HistoryItemIntervalState();
            if (!__aspxRichEdit.ControlOptions.isEnabled(subDocument.documentModel.options.characterFormatting))
                return oldState;
            var newState = new __aspxRichEdit.HistoryItemIntervalState();
            var iterator = subDocument.getRunIterator(interval);
            while (iterator.moveNext()) {
                var run = iterator.currentRun;
                oldState.register(new __aspxRichEdit.HistoryItemIntervalStateObject(iterator.currentInterval(), run.maskedCharacterProperties.useValue));
                var properties = run.maskedCharacterProperties.clone();
                properties.useValue = newValue;
                run.setCharacterProperties(properties);
                run.onCharacterPropertiesChanged();
            }
            newState.register(new __aspxRichEdit.HistoryItemIntervalStateObject(interval, newValue));
            this.manipulator.dispatcher.notifyCharacterPropertyChanged(__aspxRichEdit.JSONCharacterFormattingProperty.UseValue, newState, subDocument);
            return oldState;
        };
        CharacterPropertiesUseValueManipulator.prototype.restoreValue = function (subDocument, state) {
            if (!__aspxRichEdit.ControlOptions.isEnabled(subDocument.documentModel.options.characterFormatting))
                return;
            for (var stateValue, i = 0; stateValue = state.objects[i]; i++) {
                var iterator = subDocument.getRunIterator(stateValue.interval);
                while (iterator.moveNext()) {
                    var run = iterator.currentRun;
                    var properties = run.maskedCharacterProperties.clone();
                    properties.useValue = stateValue.value;
                    run.setCharacterProperties(properties);
                    run.onCharacterPropertiesChanged();
                }
            }
            this.manipulator.dispatcher.notifyCharacterPropertyChanged(__aspxRichEdit.JSONCharacterFormattingProperty.UseValue, state, subDocument);
        };
        return CharacterPropertiesUseValueManipulator;
    }());
    var MaskedCharacterPropertiesManipulator = (function () {
        function MaskedCharacterPropertiesManipulator(manipulator, descriptor) {
            this.manipulator = manipulator;
            this.descriptor = descriptor;
        }
        MaskedCharacterPropertiesManipulator.prototype.setValue = function (subDocument, interval, newValue, newUse) {
            var oldState = new __aspxRichEdit.HistoryItemIntervalState();
            if (!__aspxRichEdit.ControlOptions.isEnabled(subDocument.documentModel.options.characterFormatting))
                return oldState;
            var newState = new __aspxRichEdit.HistoryItemIntervalState();
            var mask = this.descriptor.maskValue();
            var iterator = subDocument.getRunIterator(interval);
            while (iterator.moveNext()) {
                var currentInterval = iterator.currentInterval();
                var properties = iterator.currentRun.maskedCharacterProperties.clone();
                newState.register(new __aspxRichEdit.HistoryItemIntervalUseStateObject(currentInterval, newValue, newUse));
                oldState.register(new __aspxRichEdit.HistoryItemIntervalUseStateObject(currentInterval, this.descriptor.getProp(properties), properties.getUseValue(mask)));
                this.descriptor.setProp(properties, newValue);
                properties.setUseValue(mask, newUse);
                iterator.currentRun.setCharacterProperties(properties);
                if (iterator.currentRun.hasCharacterMergedProperies() && newUse) {
                    var mergedProperties = iterator.currentRun.getCharacterMergedProperies().clone();
                    this.descriptor.setProp(mergedProperties, newValue);
                    iterator.currentRun.setCharacterMergedProperies(mergedProperties);
                }
                else
                    iterator.currentRun.onCharacterPropertiesChanged();
            }
            this.manipulator.dispatcher.notifyCharacterPropertyChanged(this.descriptor.getJSONProperty(), newState, subDocument);
            return oldState;
        };
        MaskedCharacterPropertiesManipulator.prototype.restoreValue = function (subDocument, state) {
            if (!__aspxRichEdit.ControlOptions.isEnabled(subDocument.documentModel.options.characterFormatting))
                return;
            if (state.isEmpty())
                return;
            for (var i = 0, stateItem; stateItem = state.objects[i]; i++) {
                var iterator = subDocument.getRunIterator(stateItem.interval);
                while (iterator.moveNext()) {
                    var properties = iterator.currentRun.maskedCharacterProperties.clone();
                    this.descriptor.setProp(properties, stateItem.value);
                    properties.setUseValue(this.descriptor.maskValue(), stateItem.use);
                    iterator.currentRun.setCharacterProperties(properties);
                    iterator.currentRun.onCharacterPropertiesChanged();
                }
            }
            this.manipulator.dispatcher.notifyCharacterPropertyChanged(this.descriptor.getJSONProperty(), state, subDocument);
        };
        return MaskedCharacterPropertiesManipulator;
    }());
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DocumentPropertiesManipulator = (function () {
        function DocumentPropertiesManipulator(manipulator) {
            this.manipulator = manipulator;
        }
        DocumentPropertiesManipulator.prototype.setDefaultTabWidth = function (subDocument, newDefaultTabWidth) {
            var oldValue = subDocument.documentModel.defaultTabWidth;
            subDocument.documentModel.defaultTabWidth = newDefaultTabWidth;
            this.manipulator.dispatcher.notifyDefaultTabWidthChanged(newDefaultTabWidth);
            return oldValue;
        };
        DocumentPropertiesManipulator.prototype.changePageColor = function (subDocument, newPageColor) {
            var oldValue = subDocument.documentModel.pageBackColor;
            subDocument.documentModel.pageBackColor = newPageColor;
            this.manipulator.dispatcher.notifyPageColorChanged(newPageColor);
            return oldValue;
        };
        DocumentPropertiesManipulator.prototype.changeDifferentOddAndEvenPages = function (documentModel, newValue) {
            var oldValue = documentModel.differentOddAndEvenPages;
            documentModel.differentOddAndEvenPages = newValue;
            this.manipulator.dispatcher.notifyDifferentOddAndEvenPagesChanged(newValue);
            return oldValue;
        };
        return DocumentPropertiesManipulator;
    }());
    __aspxRichEdit.DocumentPropertiesManipulator = DocumentPropertiesManipulator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FieldsManipulator = (function () {
        function FieldsManipulator(dispatcher) {
            this.manipulator = dispatcher;
        }
        FieldsManipulator.prototype.setHyperlinkInfo = function (subDocument, fieldIndex, newHyperlinkInfo) {
            var field = subDocument.fields[fieldIndex];
            var oldValue = field.getHyperlinkInfo();
            field.setNewHyperlinkInfo(newHyperlinkInfo);
            this.manipulator.dispatcher.notifyHyperlinkInfoChanged(subDocument, field.getResultInterval(), field.getCodeInterval(), newHyperlinkInfo);
            return oldValue;
        };
        FieldsManipulator.prototype.continueUpdateFields = function (control, responce) {
            var subDocument = control.model.subDocuments[responce[__aspxRichEdit.JSONUpdateFieldCommand.SubDocumentId]];
            if (subDocument && subDocument.fieldsWaitingForUpdate)
                subDocument.fieldsWaitingForUpdate.update(responce[__aspxRichEdit.JSONUpdateFieldCommand.Info]);
        };
        return FieldsManipulator;
    }());
    __aspxRichEdit.FieldsManipulator = FieldsManipulator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HeaderFooterManipulatorBase = (function () {
        function HeaderFooterManipulatorBase(manipulator) {
            this.manipulator = manipulator;
        }
        HeaderFooterManipulatorBase.prototype.createObject = function (type) {
            var object = this.createObjectCore(type);
            object.headerFooterType = type;
            var objectIndex = this.getObjectsCache().push(object) - 1;
            this.manipulator.dispatcher.notifyHeaderFooterCreated(this.isHeader(), type, object);
            return objectIndex;
        };
        HeaderFooterManipulatorBase.prototype.changeObjectIndex = function (sectionIndex, type, objectIndex) {
            this.manipulator.dispatcher.notifyHeaderFooterIndexChanged(sectionIndex, this.isHeader(), type, objectIndex, this.manipulator.model);
            var section = this.manipulator.model.sections[sectionIndex];
            var oldIndex = this.getContainer(section).getObjectIndex(type);
            this.getContainer(section).setObjectIndex(type, objectIndex);
            return oldIndex;
        };
        return HeaderFooterManipulatorBase;
    }());
    __aspxRichEdit.HeaderFooterManipulatorBase = HeaderFooterManipulatorBase;
    var HeaderManipulator = (function (_super) {
        __extends(HeaderManipulator, _super);
        function HeaderManipulator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        HeaderManipulator.prototype.createObjectCore = function (_type) {
            return this.manipulator.model.createSubDocument(__aspxRichEdit.SubDocumentInfoType.Header, -1).info;
        };
        HeaderManipulator.prototype.getObjectsCache = function () {
            return this.manipulator.model.headers;
        };
        HeaderManipulator.prototype.isHeader = function () {
            return true;
        };
        HeaderManipulator.prototype.getContainer = function (section) {
            return section.headers;
        };
        return HeaderManipulator;
    }(HeaderFooterManipulatorBase));
    __aspxRichEdit.HeaderManipulator = HeaderManipulator;
    var FooterManipulator = (function (_super) {
        __extends(FooterManipulator, _super);
        function FooterManipulator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FooterManipulator.prototype.createObjectCore = function (_type) {
            return this.manipulator.model.createSubDocument(__aspxRichEdit.SubDocumentInfoType.Footer, -1).info;
        };
        FooterManipulator.prototype.getObjectsCache = function () {
            return this.manipulator.model.footers;
        };
        FooterManipulator.prototype.isHeader = function () {
            return false;
        };
        FooterManipulator.prototype.getContainer = function (section) {
            return section.footers;
        };
        return FooterManipulator;
    }(HeaderFooterManipulatorBase));
    __aspxRichEdit.FooterManipulator = FooterManipulator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InlineObjectManipulator = (function () {
        function InlineObjectManipulator(manipulator) {
            this.manipulator = manipulator;
            this.scale = new InlineObjectScaleManipulator(manipulator);
            this.lockAspectRatio = new InlineObjectLockAspectRatioManipulator(manipulator);
        }
        return InlineObjectManipulator;
    }());
    __aspxRichEdit.InlineObjectManipulator = InlineObjectManipulator;
    var InlineObjectPropertyManipulator = (function () {
        function InlineObjectPropertyManipulator(manipulator) {
            this.manipulator = manipulator;
        }
        InlineObjectPropertyManipulator.prototype.setValue = function (subDocument, interval, newValue) {
            var oldState = new __aspxRichEdit.HistoryItemIntervalState();
            var newState = new __aspxRichEdit.HistoryItemIntervalState();
            var run = subDocument.getRunByPosition(interval.start);
            oldState.register(new __aspxRichEdit.HistoryItemInlineObjectPropertiesStateObject(interval, this.getPropertyValue(run.size)));
            newState.register(new __aspxRichEdit.HistoryItemInlineObjectPropertiesStateObject(interval, newValue));
            this.setPropertyValue(run.size, newValue);
            this.manipulator.dispatcher.notifyInlineObjectRunPropertyChanged(interval, this.getJSONInlineObjectProperty(), newState, subDocument);
            return oldState;
        };
        InlineObjectPropertyManipulator.prototype.restoreValue = function (subDocument, state) {
            if (state.isEmpty())
                return;
            var stateValue = state.lastObject;
            var run = subDocument.getRunByPosition(stateValue.interval.start);
            this.setPropertyValue(run.size, stateValue.value);
            this.manipulator.dispatcher.notifyInlineObjectRunPropertyChanged(state.interval, this.getJSONInlineObjectProperty(), state, subDocument);
        };
        return InlineObjectPropertyManipulator;
    }());
    __aspxRichEdit.InlineObjectPropertyManipulator = InlineObjectPropertyManipulator;
    var InlineObjectScaleManipulator = (function (_super) {
        __extends(InlineObjectScaleManipulator, _super);
        function InlineObjectScaleManipulator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InlineObjectScaleManipulator.prototype.getPropertyValue = function (size) {
            return size.scale.clone();
        };
        InlineObjectScaleManipulator.prototype.setPropertyValue = function (size, value) {
            size.scale.width = value.width;
            size.scale.height = value.height;
        };
        InlineObjectScaleManipulator.prototype.getJSONInlineObjectProperty = function () {
            return __aspxRichEdit.JSONInlineObjectProperty.Scales;
        };
        return InlineObjectScaleManipulator;
    }(InlineObjectPropertyManipulator));
    var InlineObjectLockAspectRatioManipulator = (function (_super) {
        __extends(InlineObjectLockAspectRatioManipulator, _super);
        function InlineObjectLockAspectRatioManipulator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InlineObjectLockAspectRatioManipulator.prototype.getPropertyValue = function (size) {
            return size.lockAspectRatio;
        };
        InlineObjectLockAspectRatioManipulator.prototype.setPropertyValue = function (size, value) {
            size.lockAspectRatio = value;
        };
        InlineObjectLockAspectRatioManipulator.prototype.getJSONInlineObjectProperty = function () {
            return __aspxRichEdit.JSONInlineObjectProperty.LockAspectRatio;
        };
        return InlineObjectLockAspectRatioManipulator;
    }(InlineObjectPropertyManipulator));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ListLevelCharacterPropertiesManipulator = (function () {
        function ListLevelCharacterPropertiesManipulator(manipulator) {
            this.fontBold = new CharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.bold);
            this.fontItalic = new CharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.italic);
            this.fontName = new CharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.fontInfo);
            this.fontSize = new CharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.size);
            this.fontCaps = new CharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.allCaps);
            this.fontStrikeoutType = new CharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.strikeoutType);
            this.fontStrikeoutWordsOnly = new CharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.strikeoutWordsOnly);
            this.fontUnderlineType = new CharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.underlineType);
            this.fontHidden = new CharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.hidden);
            this.script = new CharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.script);
            this.fontUnderlineWordsOnly = new CharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.underlineWordsOnly);
            this.fontNoProof = new CharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.noProof);
            this.textColor = new CharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.textColor);
            this.shadingInfo = new CharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.shadingInfo);
            this.highlightColor = new CharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.highlightColor);
            this.fontStrikeoutColor = new CharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.strikeoutColor);
            this.fontUnderlineColor = new CharacterPropertiesManipulator(manipulator, __aspxRichEdit.CharacterPropertyDescriptor.underlineColor);
        }
        return ListLevelCharacterPropertiesManipulator;
    }());
    __aspxRichEdit.ListLevelCharacterPropertiesManipulator = ListLevelCharacterPropertiesManipulator;
    var CharacterPropertiesManipulator = (function () {
        function CharacterPropertiesManipulator(manipulator, descriptor) {
            this.manipulator = manipulator;
            this.descriptor = descriptor;
        }
        CharacterPropertiesManipulator.prototype.setValue = function (model, isAbstractList, listIndex, listLevelIndex, newValue, newUse) {
            var newState = new __aspxRichEdit.HistoryItemState();
            var oldState = new __aspxRichEdit.HistoryItemState();
            var numberingList = isAbstractList ? model.abstractNumberingLists[listIndex] : model.numberingLists[listIndex];
            var listLevel = numberingList.levels[listLevelIndex];
            var properties = listLevel.getCharacterProperties();
            if (listLevel instanceof __aspxRichEdit.NumberingListReferenceLevel) {
                var abstractNumberingListIndex = numberingList.abstractNumberingListIndex;
                oldState.register(new __aspxRichEdit.HistoryItemListLevelUseStateObject(true, abstractNumberingListIndex, listLevelIndex, this.descriptor.getProp(properties), properties.getUseValue(this.descriptor.maskValue())));
                this.setValueCore(listLevel, newValue, newUse);
                newState.register(new __aspxRichEdit.HistoryItemListLevelUseStateObject(true, abstractNumberingListIndex, listLevelIndex, newValue, newUse));
            }
            else {
                oldState.register(new __aspxRichEdit.HistoryItemListLevelUseStateObject(isAbstractList, listIndex, listLevelIndex, this.descriptor.getProp(properties), properties.getUseValue(this.descriptor.maskValue())));
                this.setValueCore(listLevel, newValue, newUse);
                newState.register(new __aspxRichEdit.HistoryItemListLevelUseStateObject(isAbstractList, listIndex, listLevelIndex, newValue, newUse));
            }
            this.manipulator.model.resetMergedFormattingCache(__aspxRichEdit.ResetFormattingCacheType.Character);
            this.manipulator.dispatcher.notifyListLevelCharacterPropertyChanged(this.descriptor.getJSONProperty(), newState);
            return oldState;
        };
        CharacterPropertiesManipulator.prototype.restoreValue = function (model, state) {
            var stateObject = state.objects[0];
            var numberingList = stateObject.isAbstractNumberingList ? model.abstractNumberingLists[stateObject.numberingListIndex] : model.numberingLists[stateObject.numberingListIndex];
            var listLevel = numberingList.levels[stateObject.listLevelIndex];
            this.setValueCore(listLevel, stateObject.value, stateObject.use);
            this.manipulator.model.resetMergedFormattingCache(__aspxRichEdit.ResetFormattingCacheType.Character);
            this.manipulator.dispatcher.notifyListLevelCharacterPropertyChanged(this.descriptor.getJSONProperty(), state);
        };
        CharacterPropertiesManipulator.prototype.setValueCore = function (level, newValue, newUse) {
            var properties = level.getCharacterProperties().clone();
            this.descriptor.setProp(properties, newValue);
            properties.setUseValue(this.descriptor.maskValue(), newUse);
            level.setCharacterProperties(properties);
            level.onCharacterPropertiesChanged();
        };
        return CharacterPropertiesManipulator;
    }());
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ListLevelParagraphPropertiesManipulator = (function () {
        function ListLevelParagraphPropertiesManipulator(manipulator) {
            this.align = new ParagraphPropertiesManipulator(manipulator, __aspxRichEdit.JSONParagraphFormattingProperty.Alignment, __aspxRichEdit.ParagraphPropertiesMask.UseAlignment, function (properties, value) { return properties.alignment = value; }, function (properties) { return properties.alignment; });
            this.contextualSpacing = new ParagraphPropertiesManipulator(manipulator, __aspxRichEdit.JSONParagraphFormattingProperty.ContextualSpacing, __aspxRichEdit.ParagraphPropertiesMask.UseContextualSpacing, function (properties, value) { return properties.contextualSpacing = value; }, function (properties) { return properties.contextualSpacing; });
            this.afterAutoSpacing = new ParagraphPropertiesManipulator(manipulator, __aspxRichEdit.JSONParagraphFormattingProperty.AfterAutoSpacing, __aspxRichEdit.ParagraphPropertiesMask.UseAfterAutoSpacing, function (properties, value) { return properties.afterAutoSpacing = value; }, function (properties) { return properties.afterAutoSpacing; });
            this.shadingInfo = new ParagraphPropertiesManipulator(manipulator, __aspxRichEdit.JSONParagraphFormattingProperty.ShadingInfo, __aspxRichEdit.ParagraphPropertiesMask.UseShadingInfoIndex, function (properties, value) { return properties.shadingInfo = value; }, function (properties) { return properties.shadingInfo; });
            this.beforeAutoSpacing = new ParagraphPropertiesManipulator(manipulator, __aspxRichEdit.JSONParagraphFormattingProperty.BeforeAutoSpacing, __aspxRichEdit.ParagraphPropertiesMask.UseBeforeAutoSpacing, function (properties, value) { return properties.beforeAutoSpacing = value; }, function (properties) { return properties.beforeAutoSpacing; });
            this.firstLineIndent = new ParagraphPropertiesManipulator(manipulator, __aspxRichEdit.JSONParagraphFormattingProperty.FirstLineIndent, __aspxRichEdit.ParagraphPropertiesMask.UseFirstLineIndent, function (properties, value) { return properties.firstLineIndent = value; }, function (properties) { return properties.firstLineIndent; });
            this.keepLinesTogether = new ParagraphPropertiesManipulator(manipulator, __aspxRichEdit.JSONParagraphFormattingProperty.KeepLinesTogether, __aspxRichEdit.ParagraphPropertiesMask.UseKeepLinesTogether, function (properties, value) { return properties.keepLinesTogether = value; }, function (properties) { return properties.keepLinesTogether; });
            this.firstLineIndentType = new ParagraphPropertiesManipulator(manipulator, __aspxRichEdit.JSONParagraphFormattingProperty.FirstLineIndentType, __aspxRichEdit.ParagraphPropertiesMask.UseFirstLineIndent, function (properties, value) { return properties.firstLineIndentType = value; }, function (properties) { return properties.firstLineIndentType; });
            this.leftIndent = new ParagraphPropertiesManipulator(manipulator, __aspxRichEdit.JSONParagraphFormattingProperty.LeftIndent, __aspxRichEdit.ParagraphPropertiesMask.UseLeftIndent, function (properties, value) { return properties.leftIndent = value; }, function (properties) { return properties.leftIndent; });
            this.lineSpacing = new ParagraphPropertiesManipulator(manipulator, __aspxRichEdit.JSONParagraphFormattingProperty.LineSpacing, __aspxRichEdit.ParagraphPropertiesMask.UseLineSpacing, function (properties, value) { return properties.lineSpacing = value; }, function (properties) { return properties.lineSpacing; });
            this.lineSpacingType = new ParagraphPropertiesManipulator(manipulator, __aspxRichEdit.JSONParagraphFormattingProperty.LineSpacingType, __aspxRichEdit.ParagraphPropertiesMask.UseLineSpacing, function (properties, value) { return properties.lineSpacingType = value; }, function (properties) { return properties.lineSpacingType; });
            this.outlineLevel = new ParagraphPropertiesManipulator(manipulator, __aspxRichEdit.JSONParagraphFormattingProperty.OutlineLevel, __aspxRichEdit.ParagraphPropertiesMask.UseOutlineLevel, function (properties, value) { return properties.outlineLevel = value; }, function (properties) { return properties.outlineLevel; });
            this.pageBreakBefore = new ParagraphPropertiesManipulator(manipulator, __aspxRichEdit.JSONParagraphFormattingProperty.PageBreakBefore, __aspxRichEdit.ParagraphPropertiesMask.UsePageBreakBefore, function (properties, value) { return properties.pageBreakBefore = value; }, function (properties) { return properties.pageBreakBefore; });
            this.rightIndent = new ParagraphPropertiesManipulator(manipulator, __aspxRichEdit.JSONParagraphFormattingProperty.RightIndent, __aspxRichEdit.ParagraphPropertiesMask.UseRightIndent, function (properties, value) { return properties.rightIndent = value; }, function (properties) { return properties.rightIndent; });
            this.spacingAfter = new ParagraphPropertiesManipulator(manipulator, __aspxRichEdit.JSONParagraphFormattingProperty.SpacingAfter, __aspxRichEdit.ParagraphPropertiesMask.UseSpacingAfter, function (properties, value) { return properties.spacingAfter = value; }, function (properties) { return properties.spacingAfter; });
            this.spacingBefore = new ParagraphPropertiesManipulator(manipulator, __aspxRichEdit.JSONParagraphFormattingProperty.SpacingBefore, __aspxRichEdit.ParagraphPropertiesMask.UseSpacingBefore, function (properties, value) { return properties.spacingBefore = value; }, function (properties) { return properties.spacingBefore; });
            this.suppressHyphenation = new ParagraphPropertiesManipulator(manipulator, __aspxRichEdit.JSONParagraphFormattingProperty.SuppressHyphenation, __aspxRichEdit.ParagraphPropertiesMask.UseSuppressHyphenation, function (properties, value) { return properties.suppressHyphenation = value; }, function (properties) { return properties.suppressHyphenation; });
            this.suppressLineNumbers = new ParagraphPropertiesManipulator(manipulator, __aspxRichEdit.JSONParagraphFormattingProperty.SuppressLineNumbers, __aspxRichEdit.ParagraphPropertiesMask.UseSuppressLineNumbers, function (properties, value) { return properties.suppressLineNumbers = value; }, function (properties) { return properties.suppressLineNumbers; });
            this.widowOrphanControl = new ParagraphPropertiesManipulator(manipulator, __aspxRichEdit.JSONParagraphFormattingProperty.WidowOrphanControl, __aspxRichEdit.ParagraphPropertiesMask.UseWidowOrphanControl, function (properties, value) { return properties.widowOrphanControl = value; }, function (properties) { return properties.widowOrphanControl; });
        }
        return ListLevelParagraphPropertiesManipulator;
    }());
    __aspxRichEdit.ListLevelParagraphPropertiesManipulator = ListLevelParagraphPropertiesManipulator;
    var ParagraphPropertiesManipulator = (function () {
        function ParagraphPropertiesManipulator(manipulator, jsonParagraphFormattingProperty, paragraphPropertiesMask, setProperty, getProperty) {
            this.manipulator = manipulator;
            this.paragraphPropertiesMask = paragraphPropertiesMask;
            this.jsonParagraphFormattingProperty = jsonParagraphFormattingProperty;
            this.setProperty = setProperty;
            this.getProperty = getProperty;
        }
        ParagraphPropertiesManipulator.prototype.setValue = function (model, isAbstractList, listIndex, listLevelIndex, newValue, newUse) {
            var newState = new __aspxRichEdit.HistoryItemState();
            var oldState = new __aspxRichEdit.HistoryItemState();
            var numberingList = isAbstractList ? model.abstractNumberingLists[listIndex] : model.numberingLists[listIndex];
            var listLevel = numberingList.levels[listLevelIndex];
            var properties = listLevel.getParagraphProperties();
            if (listLevel instanceof __aspxRichEdit.NumberingListReferenceLevel) {
                var abstractNumberingListIndex = numberingList.abstractNumberingListIndex;
                oldState.register(new __aspxRichEdit.HistoryItemListLevelUseStateObject(true, abstractNumberingListIndex, listLevelIndex, this.getProperty(properties), properties.getUseValue(this.paragraphPropertiesMask)));
                this.setValueCore(listLevel, newValue, newUse);
                newState.register(new __aspxRichEdit.HistoryItemListLevelUseStateObject(true, abstractNumberingListIndex, listLevelIndex, newValue, newUse));
            }
            else {
                oldState.register(new __aspxRichEdit.HistoryItemListLevelUseStateObject(isAbstractList, listIndex, listLevelIndex, this.getProperty(properties), properties.getUseValue(this.paragraphPropertiesMask)));
                this.setValueCore(listLevel, newValue, newUse);
                newState.register(new __aspxRichEdit.HistoryItemListLevelUseStateObject(isAbstractList, listIndex, listLevelIndex, newValue, newUse));
            }
            this.manipulator.model.resetMergedFormattingCache(__aspxRichEdit.ResetFormattingCacheType.Paragraph);
            this.manipulator.dispatcher.notifyListLevelParagraphPropertyChanged(this.jsonParagraphFormattingProperty, newState);
            return oldState;
        };
        ParagraphPropertiesManipulator.prototype.restoreValue = function (model, state) {
            var stateObject = state.objects[0];
            var numberingList = stateObject.isAbstractNumberingList ? model.abstractNumberingLists[stateObject.numberingListIndex] : model.numberingLists[stateObject.numberingListIndex];
            var listLevel = numberingList.levels[stateObject.listLevelIndex];
            this.setValueCore(listLevel, stateObject.value, stateObject.use);
            this.manipulator.model.resetMergedFormattingCache(__aspxRichEdit.ResetFormattingCacheType.Paragraph);
            this.manipulator.dispatcher.notifyListLevelParagraphPropertyChanged(this.jsonParagraphFormattingProperty, state);
        };
        ParagraphPropertiesManipulator.prototype.setValueCore = function (level, newValue, newUse) {
            var properties = level.getParagraphProperties().clone();
            this.setProperty(properties, newValue);
            properties.setUseValue(this.paragraphPropertiesMask, newUse);
            level.setParagraphProperties(properties);
            level.onParagraphPropertiesChanged();
        };
        return ParagraphPropertiesManipulator;
    }());
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ListLevelPropertiesManipulator = (function () {
        function ListLevelPropertiesManipulator(manipulator) {
            this.start = new StartListLevelPropertiesManipulator(manipulator);
            this.format = new FormatListLevelPropertiesManipulator(manipulator);
            this.alignment = new AlignmentListLevelPropertiesManipulator(manipulator);
            this.convertPreviousLevelNumberingToDecimal = new ConvertPreviousLevelNumberingToDecimalListLevelPropertiesManipulator(manipulator);
            this.separator = new SeparatorListLevelPropertiesManipulator(manipulator);
            this.suppressRestart = new SuppressRestartListLevelPropertiesManipulator(manipulator);
            this.suppressBulletResize = new SuppressBulletResizeListLevelPropertiesManipulator(manipulator);
            this.displayFormatString = new DisplayFormatStringListLevelPropertiesManipulator(manipulator);
            this.relativeRestartLevel = new RelativeRestartLevelListLevelPropertiesManipulator(manipulator);
            this.templateCode = new TemplateCodeListLevelPropertiesManipulator(manipulator);
            this.originalLeftIndent = new OriginalLeftIndentListLevelPropertiesManipulator(manipulator);
            this.legacy = new LegacyListLevelPropertiesManipulator(manipulator);
            this.legacySpace = new LegacySpaceListLevelPropertiesManipulator(manipulator);
            this.legacyIndent = new LegacyIndentListLevelPropertiesManipulator(manipulator);
        }
        return ListLevelPropertiesManipulator;
    }());
    __aspxRichEdit.ListLevelPropertiesManipulator = ListLevelPropertiesManipulator;
    var ListLevelPropertiesManipulatorBase = (function () {
        function ListLevelPropertiesManipulatorBase(dispatcher) {
            this.manipulator = dispatcher;
        }
        ListLevelPropertiesManipulatorBase.prototype.setValue = function (model, isAbstractList, listIndex, listLevelIndex, newValue) {
            var oldState = new __aspxRichEdit.HistoryItemState();
            var newState = new __aspxRichEdit.HistoryItemState();
            var numberingList = isAbstractList ? model.abstractNumberingLists[listIndex] : model.numberingLists[listIndex];
            var listLevel = numberingList.levels[listLevelIndex];
            if (listLevel instanceof __aspxRichEdit.NumberingListReferenceLevel) {
                var abstractNumberingListIndex = numberingList.abstractNumberingListIndex;
                oldState.register(new __aspxRichEdit.HistoryItemListLevelStateObject(true, abstractNumberingListIndex, listLevelIndex, this.getPropertyValue(listLevel.getListLevelProperties())));
                this.setValueCore(listLevel, newValue);
                newState.register(new __aspxRichEdit.HistoryItemListLevelStateObject(true, abstractNumberingListIndex, listLevelIndex, newValue));
            }
            else {
                oldState.register(new __aspxRichEdit.HistoryItemListLevelStateObject(isAbstractList, listIndex, listLevelIndex, this.getPropertyValue(listLevel.getListLevelProperties())));
                this.setValueCore(listLevel, newValue);
                newState.register(new __aspxRichEdit.HistoryItemListLevelStateObject(isAbstractList, listIndex, listLevelIndex, newValue));
            }
            this.manipulator.dispatcher.notifyListLevelPropertyChanged(this.getJSONListLevelProperty(), newState);
            return oldState;
        };
        ListLevelPropertiesManipulatorBase.prototype.restoreValue = function (model, state) {
            var stateObject = state.objects[0];
            var numberingList = stateObject.isAbstractNumberingList ? model.abstractNumberingLists[stateObject.numberingListIndex] : model.numberingLists[stateObject.numberingListIndex];
            var listLevel = numberingList.levels[stateObject.listLevelIndex];
            this.setValueCore(listLevel, stateObject.value);
            this.manipulator.dispatcher.notifyListLevelPropertyChanged(this.getJSONListLevelProperty(), state);
        };
        ListLevelPropertiesManipulatorBase.prototype.setValueCore = function (level, newValue) {
            var properties = level.getListLevelProperties().clone();
            this.setPropertyValue(properties, newValue);
            level.setListLevelProperties(properties);
        };
        return ListLevelPropertiesManipulatorBase;
    }());
    var StartListLevelPropertiesManipulator = (function (_super) {
        __extends(StartListLevelPropertiesManipulator, _super);
        function StartListLevelPropertiesManipulator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        StartListLevelPropertiesManipulator.prototype.setPropertyValue = function (properties, newValue) {
            properties.start = newValue;
        };
        StartListLevelPropertiesManipulator.prototype.getPropertyValue = function (properties) {
            return properties.start;
        };
        StartListLevelPropertiesManipulator.prototype.getJSONListLevelProperty = function () {
            return __aspxRichEdit.JSONListLevelProperty.Start;
        };
        return StartListLevelPropertiesManipulator;
    }(ListLevelPropertiesManipulatorBase));
    var FormatListLevelPropertiesManipulator = (function (_super) {
        __extends(FormatListLevelPropertiesManipulator, _super);
        function FormatListLevelPropertiesManipulator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FormatListLevelPropertiesManipulator.prototype.setPropertyValue = function (properties, newValue) {
            properties.format = newValue;
        };
        FormatListLevelPropertiesManipulator.prototype.getPropertyValue = function (properties) {
            return properties.format;
        };
        FormatListLevelPropertiesManipulator.prototype.getJSONListLevelProperty = function () {
            return __aspxRichEdit.JSONListLevelProperty.Format;
        };
        return FormatListLevelPropertiesManipulator;
    }(ListLevelPropertiesManipulatorBase));
    var AlignmentListLevelPropertiesManipulator = (function (_super) {
        __extends(AlignmentListLevelPropertiesManipulator, _super);
        function AlignmentListLevelPropertiesManipulator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        AlignmentListLevelPropertiesManipulator.prototype.setPropertyValue = function (properties, newValue) {
            properties.alignment = newValue;
        };
        AlignmentListLevelPropertiesManipulator.prototype.getPropertyValue = function (properties) {
            return properties.alignment;
        };
        AlignmentListLevelPropertiesManipulator.prototype.getJSONListLevelProperty = function () {
            return __aspxRichEdit.JSONListLevelProperty.Alignment;
        };
        return AlignmentListLevelPropertiesManipulator;
    }(ListLevelPropertiesManipulatorBase));
    var ConvertPreviousLevelNumberingToDecimalListLevelPropertiesManipulator = (function (_super) {
        __extends(ConvertPreviousLevelNumberingToDecimalListLevelPropertiesManipulator, _super);
        function ConvertPreviousLevelNumberingToDecimalListLevelPropertiesManipulator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ConvertPreviousLevelNumberingToDecimalListLevelPropertiesManipulator.prototype.setPropertyValue = function (properties, newValue) {
            properties.convertPreviousLevelNumberingToDecimal = newValue;
        };
        ConvertPreviousLevelNumberingToDecimalListLevelPropertiesManipulator.prototype.getPropertyValue = function (properties) {
            return properties.convertPreviousLevelNumberingToDecimal;
        };
        ConvertPreviousLevelNumberingToDecimalListLevelPropertiesManipulator.prototype.getJSONListLevelProperty = function () {
            return __aspxRichEdit.JSONListLevelProperty.ConvertPreviousLevelNumberingToDecimal;
        };
        return ConvertPreviousLevelNumberingToDecimalListLevelPropertiesManipulator;
    }(ListLevelPropertiesManipulatorBase));
    var SeparatorListLevelPropertiesManipulator = (function (_super) {
        __extends(SeparatorListLevelPropertiesManipulator, _super);
        function SeparatorListLevelPropertiesManipulator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SeparatorListLevelPropertiesManipulator.prototype.setPropertyValue = function (properties, newValue) {
            properties.separator = newValue;
        };
        SeparatorListLevelPropertiesManipulator.prototype.getPropertyValue = function (properties) {
            return properties.separator;
        };
        SeparatorListLevelPropertiesManipulator.prototype.getJSONListLevelProperty = function () {
            return __aspxRichEdit.JSONListLevelProperty.Separator;
        };
        return SeparatorListLevelPropertiesManipulator;
    }(ListLevelPropertiesManipulatorBase));
    var SuppressRestartListLevelPropertiesManipulator = (function (_super) {
        __extends(SuppressRestartListLevelPropertiesManipulator, _super);
        function SuppressRestartListLevelPropertiesManipulator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SuppressRestartListLevelPropertiesManipulator.prototype.setPropertyValue = function (properties, newValue) {
            properties.suppressRestart = newValue;
        };
        SuppressRestartListLevelPropertiesManipulator.prototype.getPropertyValue = function (properties) {
            return properties.suppressRestart;
        };
        SuppressRestartListLevelPropertiesManipulator.prototype.getJSONListLevelProperty = function () {
            return __aspxRichEdit.JSONListLevelProperty.SuppressRestart;
        };
        return SuppressRestartListLevelPropertiesManipulator;
    }(ListLevelPropertiesManipulatorBase));
    var SuppressBulletResizeListLevelPropertiesManipulator = (function (_super) {
        __extends(SuppressBulletResizeListLevelPropertiesManipulator, _super);
        function SuppressBulletResizeListLevelPropertiesManipulator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SuppressBulletResizeListLevelPropertiesManipulator.prototype.setPropertyValue = function (properties, newValue) {
            properties.suppressBulletResize = newValue;
        };
        SuppressBulletResizeListLevelPropertiesManipulator.prototype.getPropertyValue = function (properties) {
            return properties.suppressBulletResize;
        };
        SuppressBulletResizeListLevelPropertiesManipulator.prototype.getJSONListLevelProperty = function () {
            return __aspxRichEdit.JSONListLevelProperty.SuppressBulletResize;
        };
        return SuppressBulletResizeListLevelPropertiesManipulator;
    }(ListLevelPropertiesManipulatorBase));
    var DisplayFormatStringListLevelPropertiesManipulator = (function (_super) {
        __extends(DisplayFormatStringListLevelPropertiesManipulator, _super);
        function DisplayFormatStringListLevelPropertiesManipulator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DisplayFormatStringListLevelPropertiesManipulator.prototype.setPropertyValue = function (properties, newValue) {
            properties.displayFormatString = newValue;
        };
        DisplayFormatStringListLevelPropertiesManipulator.prototype.getPropertyValue = function (properties) {
            return properties.displayFormatString;
        };
        DisplayFormatStringListLevelPropertiesManipulator.prototype.getJSONListLevelProperty = function () {
            return __aspxRichEdit.JSONListLevelProperty.DisplayFormatString;
        };
        return DisplayFormatStringListLevelPropertiesManipulator;
    }(ListLevelPropertiesManipulatorBase));
    var RelativeRestartLevelListLevelPropertiesManipulator = (function (_super) {
        __extends(RelativeRestartLevelListLevelPropertiesManipulator, _super);
        function RelativeRestartLevelListLevelPropertiesManipulator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RelativeRestartLevelListLevelPropertiesManipulator.prototype.setPropertyValue = function (properties, newValue) {
            properties.relativeRestartLevel = newValue;
        };
        RelativeRestartLevelListLevelPropertiesManipulator.prototype.getPropertyValue = function (properties) {
            return properties.relativeRestartLevel;
        };
        RelativeRestartLevelListLevelPropertiesManipulator.prototype.getJSONListLevelProperty = function () {
            return __aspxRichEdit.JSONListLevelProperty.RelativeRestartLevel;
        };
        return RelativeRestartLevelListLevelPropertiesManipulator;
    }(ListLevelPropertiesManipulatorBase));
    var TemplateCodeListLevelPropertiesManipulator = (function (_super) {
        __extends(TemplateCodeListLevelPropertiesManipulator, _super);
        function TemplateCodeListLevelPropertiesManipulator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TemplateCodeListLevelPropertiesManipulator.prototype.setPropertyValue = function (properties, newValue) {
            properties.templateCode = newValue;
        };
        TemplateCodeListLevelPropertiesManipulator.prototype.getPropertyValue = function (properties) {
            return properties.templateCode;
        };
        TemplateCodeListLevelPropertiesManipulator.prototype.getJSONListLevelProperty = function () {
            return __aspxRichEdit.JSONListLevelProperty.TemplateCode;
        };
        return TemplateCodeListLevelPropertiesManipulator;
    }(ListLevelPropertiesManipulatorBase));
    var OriginalLeftIndentListLevelPropertiesManipulator = (function (_super) {
        __extends(OriginalLeftIndentListLevelPropertiesManipulator, _super);
        function OriginalLeftIndentListLevelPropertiesManipulator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        OriginalLeftIndentListLevelPropertiesManipulator.prototype.setPropertyValue = function (properties, newValue) {
            properties.originalLeftIndent = newValue;
        };
        OriginalLeftIndentListLevelPropertiesManipulator.prototype.getPropertyValue = function (properties) {
            return properties.originalLeftIndent;
        };
        OriginalLeftIndentListLevelPropertiesManipulator.prototype.getJSONListLevelProperty = function () {
            return __aspxRichEdit.JSONListLevelProperty.OriginalLeftIndent;
        };
        return OriginalLeftIndentListLevelPropertiesManipulator;
    }(ListLevelPropertiesManipulatorBase));
    var LegacyListLevelPropertiesManipulator = (function (_super) {
        __extends(LegacyListLevelPropertiesManipulator, _super);
        function LegacyListLevelPropertiesManipulator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LegacyListLevelPropertiesManipulator.prototype.setPropertyValue = function (properties, newValue) {
            properties.legacy = newValue;
        };
        LegacyListLevelPropertiesManipulator.prototype.getPropertyValue = function (properties) {
            return properties.legacy;
        };
        LegacyListLevelPropertiesManipulator.prototype.getJSONListLevelProperty = function () {
            return __aspxRichEdit.JSONListLevelProperty.Legacy;
        };
        return LegacyListLevelPropertiesManipulator;
    }(ListLevelPropertiesManipulatorBase));
    var LegacySpaceListLevelPropertiesManipulator = (function (_super) {
        __extends(LegacySpaceListLevelPropertiesManipulator, _super);
        function LegacySpaceListLevelPropertiesManipulator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LegacySpaceListLevelPropertiesManipulator.prototype.setPropertyValue = function (properties, newValue) {
            properties.legacySpace = newValue;
        };
        LegacySpaceListLevelPropertiesManipulator.prototype.getPropertyValue = function (properties) {
            return properties.legacySpace;
        };
        LegacySpaceListLevelPropertiesManipulator.prototype.getJSONListLevelProperty = function () {
            return __aspxRichEdit.JSONListLevelProperty.LegacySpace;
        };
        return LegacySpaceListLevelPropertiesManipulator;
    }(ListLevelPropertiesManipulatorBase));
    var LegacyIndentListLevelPropertiesManipulator = (function (_super) {
        __extends(LegacyIndentListLevelPropertiesManipulator, _super);
        function LegacyIndentListLevelPropertiesManipulator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LegacyIndentListLevelPropertiesManipulator.prototype.setPropertyValue = function (properties, newValue) {
            properties.legacyIndent = newValue;
        };
        LegacyIndentListLevelPropertiesManipulator.prototype.getPropertyValue = function (properties) {
            return properties.legacyIndent;
        };
        LegacyIndentListLevelPropertiesManipulator.prototype.getJSONListLevelProperty = function () {
            return __aspxRichEdit.JSONListLevelProperty.LegacyIndent;
        };
        return LegacyIndentListLevelPropertiesManipulator;
    }(ListLevelPropertiesManipulatorBase));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ModelChangesDispatcher = (function () {
        function ModelChangesDispatcher() {
            this.onModelChanged = new __aspxRichEdit.EventDispatcher();
        }
        ModelChangesDispatcher.prototype.notifyCharacterPropertyChanged = function (property, newState, subDocument) {
            this.onModelChanged.raise("NotifyCharacterFormattingChanged", subDocument, property, newState);
        };
        ModelChangesDispatcher.prototype.notifyCharacterPropertiesChanged = function (newState, subDocument) {
            this.onModelChanged.raise("NotifyCharacterPropertiesChanged", subDocument, newState);
        };
        ModelChangesDispatcher.prototype.notifyParagraphPropertyChanged = function (property, newState, subDocument) {
            this.onModelChanged.raise("NotifyParagraphFormattingChanged", subDocument, property, newState);
        };
        ModelChangesDispatcher.prototype.notifyParagraphPropertiesChanged = function (paragraphIndex, properties, style, tabs, numberingListIndex, listLevelIndex, subDocument) {
            this.onModelChanged.raise("NotifyParagraphPropertiesChanged", subDocument, paragraphIndex, properties, style, tabs, numberingListIndex, listLevelIndex);
        };
        ModelChangesDispatcher.prototype.notifySectionFormattingChanged = function (section, sectionIndex, property, newState) {
            this.onModelChanged.raise("NotifySectionFormattingChanged", section, sectionIndex, property, newState);
        };
        ModelChangesDispatcher.prototype.notifyInlineObjectRunPropertyChanged = function (interval, property, newState, subDocument) {
            this.onModelChanged.raise("NotifyInlineObjectRunPropertyChanged", subDocument, property, interval.start, newState);
        };
        ModelChangesDispatcher.prototype.notifyAnchoredPictureSizeChanged = function (interval, objectId, newState, subDocument) {
            this.onModelChanged.raise("NotifyAnchoredPictureSizeChanged", subDocument, objectId, interval.start, newState);
        };
        ModelChangesDispatcher.prototype.notifyAnchoredTextBoxSizeChanged = function (interval, objectId, newState, subDocument) {
            this.onModelChanged.raise("NotifyAnchoredTextBoxSizeChanged", subDocument, objectId, interval.start, newState);
        };
        ModelChangesDispatcher.prototype.notifyAnchoredTextBoxPropertiesChanged = function (interval, objectId, newState, subDocument) {
            this.onModelChanged.raise("NotifyAnchoredTextBoxPropertiesChanged", subDocument, objectId, interval.start, newState);
        };
        ModelChangesDispatcher.prototype.notifyAnchorInfoPropertyChanged = function (objectId, property, newState, subDocument) {
            this.onModelChanged.raise("NotifyAnchorInfoPropertyChanged", subDocument, objectId, property, newState);
        };
        ModelChangesDispatcher.prototype.notifyShapeChanged = function (objectId, newState, subDocument) {
            this.onModelChanged.raise("NotifyShapeChanged", subDocument, objectId, newState);
        };
        ModelChangesDispatcher.prototype.notifyShapePropertyChanged = function (objectId, property, newState, subDocument) {
            this.onModelChanged.raise("NotifyShapePropertyChanged", subDocument, objectId, property, newState);
        };
        ModelChangesDispatcher.prototype.notifyAnchorObjectRemoved = function (subDocument, objectId, position) {
            this.onModelChanged.raise("NotifyAnchorObjectRemoved", subDocument, objectId, position);
        };
        ModelChangesDispatcher.prototype.notifyTextBufferChanged = function (newState, subDocument) {
            this.onModelChanged.raise("NotifyTextBufferChanged", subDocument, newState);
        };
        ModelChangesDispatcher.prototype.notifyParagraphAndCharacterMergedPropertiesReset = function (subDocument, interval) {
            this.onModelChanged.raise("NotifyParagraphAndCharacterMergedPropertiesReset", subDocument, interval);
        };
        ModelChangesDispatcher.prototype.notifyCharacterStyleApplied = function (newState, subDocument) {
            this.onModelChanged.raise("NotifyCharacterStyleApplied", subDocument, newState);
        };
        ModelChangesDispatcher.prototype.notifyParagraphStyleApplied = function (newState, subDocument) {
            this.onModelChanged.raise("NotifyParagraphStyleApplied", subDocument, newState);
        };
        ModelChangesDispatcher.prototype.notifySimpleRunInserted = function (subDocument, position, length, characterProperties, characterStyle, type, text) {
            this.onModelChanged.raise("NotifySimpleRunInserted", subDocument, position, length, characterProperties, characterStyle, type, text);
        };
        ModelChangesDispatcher.prototype.notifyParagraphInserted = function (subDocument, position, paragraph) {
            this.onModelChanged.raise("NotifyParagraphInserted", subDocument, position, paragraph);
        };
        ModelChangesDispatcher.prototype.notifySectionInserted = function (subDocument, position, section, sectionIndex) {
            this.onModelChanged.raise("NotifySectionInserted", subDocument, position, section, sectionIndex);
        };
        ModelChangesDispatcher.prototype.notifyIntervalRemoved = function (subDocument, position, length) {
            this.onModelChanged.raise("NotifyIntervalRemoved", subDocument, position, length);
        };
        ModelChangesDispatcher.prototype.notifyParagraphMerged = function (subDocument, position, getPropertiesFromNext) {
            this.onModelChanged.raise("NotifyParagraphMerged", subDocument, position, getPropertiesFromNext);
        };
        ModelChangesDispatcher.prototype.notifySectionMerged = function (subDocument, sectionIndex, getPropertiesFromNext) {
            this.onModelChanged.raise("NotifySectionMerged", subDocument, sectionIndex, getPropertiesFromNext);
        };
        ModelChangesDispatcher.prototype.notifyInlinePictureInserted = function (subDocument, position, id, scaleX, scaleY) {
            this.onModelChanged.raise("NotifyInlinePictureInserted", subDocument, position, id, scaleX, scaleY);
        };
        ModelChangesDispatcher.prototype.notifyAnchoredPictureInserted = function (subDocument, objectId, position, id, size, anchorInfo) {
            this.onModelChanged.raise("NotifyAnchoredPictureInserted", subDocument, objectId, position, id, size, anchorInfo);
        };
        ModelChangesDispatcher.prototype.notifyAnchoredTextBoxInserted = function (subDocument, objectId, subDocId, position, anchorInfo) {
            this.onModelChanged.raise("NotifyAnchoredTextBoxInserted", subDocument, objectId, subDocId, position, anchorInfo);
        };
        ModelChangesDispatcher.prototype.notifyParagraphNumberingListChanged = function (subDocument, newState, oldAbstractNumberingListIndex) {
            this.onModelChanged.raise("NotifyParagraphNumberingListChanged", subDocument, newState, oldAbstractNumberingListIndex);
        };
        ModelChangesDispatcher.prototype.notifyTabInserted = function (subDocument, newState) {
            this.onModelChanged.raise("NotifyTabInserted", subDocument, newState);
        };
        ModelChangesDispatcher.prototype.notifyTabDeleted = function (subDocument, newState) {
            this.onModelChanged.raise("NotifyTabDeleted", subDocument, newState);
        };
        ModelChangesDispatcher.prototype.notifyBookmarkCreated = function (subDocument, newState) {
            this.onModelChanged.raise("NotifyBookmarkCreated", subDocument, newState);
        };
        ModelChangesDispatcher.prototype.notifyBookmarkDeleted = function (subDocument, newState) {
            this.onModelChanged.raise("NotifyBookmarkDeleted", subDocument, newState);
        };
        ModelChangesDispatcher.prototype.notifyAbstractNumberingListAdded = function (index) {
            this.onModelChanged.raise("NotifyAbstractNumberingListAdded", index);
        };
        ModelChangesDispatcher.prototype.notifyAbstractNumberingListDeleted = function (index) {
            this.onModelChanged.raise("NotifyAbstractNumberingListDeleted", index);
        };
        ModelChangesDispatcher.prototype.notifyNumberingListAdded = function (index) {
            this.onModelChanged.raise("NotifyNumberingListAdded", index);
        };
        ModelChangesDispatcher.prototype.notifyNumberingListDeleted = function (index) {
            this.onModelChanged.raise("NotifyNumberingListDeleted", index);
        };
        ModelChangesDispatcher.prototype.notifyListLevelPropertyChanged = function (property, newState) {
            this.onModelChanged.raise("NotifyListLevelPropertyChanged", property, newState);
        };
        ModelChangesDispatcher.prototype.notifyListLevelParagraphPropertyChanged = function (property, newState) {
            this.onModelChanged.raise("NotifyListLevelParagraphPropertyChanged", property, newState);
        };
        ModelChangesDispatcher.prototype.notifyListLevelCharacterPropertyChanged = function (property, newState) {
            this.onModelChanged.raise("NotifyListLevelCharacterPropertyChanged", property, newState);
        };
        ModelChangesDispatcher.prototype.notifyIOverrideListLevelChanged = function (property, newState) {
            this.onModelChanged.raise("NotifyIOverrideListLevelChanged", property, newState);
        };
        ModelChangesDispatcher.prototype.notifyCreateStyleLink = function (paragraphStyleName) {
            this.onModelChanged.raise("NotifyCreateStyleLink", paragraphStyleName);
        };
        ModelChangesDispatcher.prototype.notifyDeleteStyleLink = function (paragraphStyleName) {
            this.onModelChanged.raise("NotifyDeleteStyleLink", paragraphStyleName);
        };
        ModelChangesDispatcher.prototype.notifyLoadInlinePictures = function (subDocument, imagesToLoad) {
            this.onModelChanged.raise("NotifyLoadInlinePictures", subDocument, imagesToLoad);
        };
        ModelChangesDispatcher.prototype.notifyInlinePicturesUpdated = function (subDocument, updatedImagesInfo) {
            this.onModelChanged.raise("NotifyInlinePicturesUpdated", subDocument, updatedImagesInfo);
        };
        ModelChangesDispatcher.prototype.notifyFieldInserted = function (subDocument, startPosition, separatorPosition, endPosition) {
            this.onModelChanged.raise("NotifyFieldInserted", subDocument, startPosition, separatorPosition, endPosition);
        };
        ModelChangesDispatcher.prototype.notifyFieldDeleted = function (subDocument, endPosition) {
            this.onModelChanged.raise("NotifyFieldDeleted", subDocument, endPosition);
        };
        ModelChangesDispatcher.prototype.notifyHyperlinkInfoChanged = function (subDocument, fieldResultInterval, fieldCodeInterval, newHyperlinkInfo) {
            this.onModelChanged.raise("NotifyHyperlinkInfoChanged", subDocument, fieldResultInterval, fieldCodeInterval, newHyperlinkInfo);
        };
        ModelChangesDispatcher.prototype.notifyDefaultTabWidthChanged = function (defaultTabWidth) {
            this.onModelChanged.raise("NotifyDefaultTabWidthChanged", defaultTabWidth);
        };
        ModelChangesDispatcher.prototype.notifyPageColorChanged = function (pageColor) {
            this.onModelChanged.raise("NotifyPageColorChanged", pageColor);
        };
        ModelChangesDispatcher.prototype.notifyHeaderFooterCreated = function (isHeader, type, subDocumentInfo) {
            this.onModelChanged.raise("NotifyHeaderFooterCreated", isHeader, type, subDocumentInfo);
        };
        ModelChangesDispatcher.prototype.notifyHeaderFooterIndexChanged = function (sectionIndex, isHeader, type, newIndex, model) {
            this.onModelChanged.raise("NotifyHeaderFooterIndexChanged", sectionIndex, isHeader, type, newIndex, model);
        };
        ModelChangesDispatcher.prototype.notifyDifferentOddAndEvenPagesChanged = function (newValue) {
            this.onModelChanged.raise("NotifyDifferentOddAndEvenPagesChanged", newValue);
        };
        ModelChangesDispatcher.prototype.notifyTableCreated = function (subDocument, table) {
            this.onModelChanged.raise("NotifyTableCreated", subDocument, table);
        };
        ModelChangesDispatcher.prototype.notifyTableRemoved = function (subDocument, startPosition, endPosition, nestedLevel) {
            this.onModelChanged.raise("NotifyTableRemoved", subDocument, startPosition, endPosition, nestedLevel);
        };
        ModelChangesDispatcher.prototype.notifyTableStartPositionShifted = function (subDocument, table, oldPosition, newPosition) {
            this.onModelChanged.raise("NotifyTableStartPositionShifted", subDocument, table, oldPosition, newPosition);
        };
        ModelChangesDispatcher.prototype.notifyTableCellPropertyChanged = function (subDocument, property, newState) {
            this.onModelChanged.raise("NotifyTableCellPropertyChanged", subDocument, property, newState);
        };
        ModelChangesDispatcher.prototype.notifyTablePropertyChanged = function (subDocument, property, newState) {
            this.onModelChanged.raise("NotifyTablePropertyChanged", subDocument, property, newState);
        };
        ModelChangesDispatcher.prototype.notifyTableRowPropertyChanged = function (subDocument, property, newState) {
            this.onModelChanged.raise("NotifyTableRowPropertyChanged", subDocument, property, newState);
        };
        ModelChangesDispatcher.prototype.notifyTableCellSplittedHorizontally = function (subDocument, table, rowIndex, cellIndex, rightDirection) {
            this.onModelChanged.raise("NotifyTableCellSplittedHorizontally", subDocument, table, rowIndex, cellIndex, rightDirection);
        };
        ModelChangesDispatcher.prototype.notifyTableCellMergedHorizontally = function (subDocument, table, rowIndex, cellIndex, rightDirection) {
            this.onModelChanged.raise("NotifyTableCellMergedHorizontally", subDocument, table, rowIndex, cellIndex, rightDirection);
        };
        ModelChangesDispatcher.prototype.notifyTableRowInserted = function (subDocument, table, rowIndex) {
            this.onModelChanged.raise("NotifyTableRowInserted", subDocument, table, rowIndex);
        };
        ModelChangesDispatcher.prototype.notifyTableRowRemoved = function (subDocument, table, rowIndex) {
            this.onModelChanged.raise("NotifyTableRowRemoved", subDocument, table, rowIndex);
        };
        ModelChangesDispatcher.prototype.notifyTableCellRemoved = function (subDocument, table, rowIndex, cellIndex) {
            this.onModelChanged.raise("NotifyTableCellRemoved", subDocument, table, rowIndex, cellIndex);
        };
        ModelChangesDispatcher.prototype.notifyTableCellInserted = function (subDocument, table, rowIndex, cellIndex) {
            this.onModelChanged.raise("NotifyTableCellInserted", subDocument, table, rowIndex, cellIndex);
        };
        ModelChangesDispatcher.prototype.notifyTableStyleChanged = function (subDocument, table, newStyle) {
            this.onModelChanged.raise("NotifyTableStyleChanged", subDocument, table, newStyle);
        };
        ModelChangesDispatcher.prototype.notifyLoadFontInfo = function (fontInfo, fontIndex) {
            this.onModelChanged.raise("NotifyLoadFontInfo", fontInfo, fontIndex);
        };
        return ModelChangesDispatcher;
    }());
    __aspxRichEdit.ModelChangesDispatcher = ModelChangesDispatcher;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ImagesInfo = (function () {
        function ImagesInfo(guid, position, sourceUrl, scaleX, scaleY) {
            this.guid = guid;
            this.position = position;
            this.sourceUrl = sourceUrl;
            this.scaleX = scaleX;
            this.scaleY = scaleY;
        }
        return ImagesInfo;
    }());
    __aspxRichEdit.ImagesInfo = ImagesInfo;
    var UpdatedImagesInfo = (function () {
        function UpdatedImagesInfo(position, id, scaleX, scaleY) {
            this.position = position;
            this.id = id;
            this.scaleX = scaleX;
            this.scaleY = scaleY;
        }
        return UpdatedImagesInfo;
    }());
    __aspxRichEdit.UpdatedImagesInfo = UpdatedImagesInfo;
    var ModelManipulator = (function () {
        function ModelManipulator(model) {
            this.dispatcher = new __aspxRichEdit.ModelChangesDispatcher();
            this.model = model;
            this.characterPropertiesManipulator = new __aspxRichEdit.CharacterPropertiesManipulator(this);
            this.paragraphPropertiesManipulator = new __aspxRichEdit.ParagraphPropertiesManipulator(this);
            this.listLevelPropertiesManipulator = new __aspxRichEdit.ListLevelPropertiesManipulator(this);
            this.listLevelCharacterPropertiesManipulator = new __aspxRichEdit.ListLevelCharacterPropertiesManipulator(this);
            this.listLevelParagraphPropertiesManipulator = new __aspxRichEdit.ListLevelParagraphPropertiesManipulator(this);
            this.numberingListManipulator = new __aspxRichEdit.NumberingListManipulator(this);
            this.sectionProperties = new __aspxRichEdit.SectionPropertiesManipulator(this);
            this.text = new __aspxRichEdit.TextManipulator(this);
            this.inlineObjectManipulator = new __aspxRichEdit.InlineObjectManipulator(this);
            this.styles = new __aspxRichEdit.StylesManipulator(this);
            this.documentPropertiesManipulator = new __aspxRichEdit.DocumentPropertiesManipulator(this);
            this.fieldsManipulator = new __aspxRichEdit.FieldsManipulator(this);
            this.textCaseManipulator = new __aspxRichEdit.TextCaseManipulator(this);
            this.headerManipulator = new __aspxRichEdit.HeaderManipulator(this);
            this.footerManipulator = new __aspxRichEdit.FooterManipulator(this);
            this.tabManipulator = new __aspxRichEdit.TabsManipulator(this);
            this.bookmarksManipulator = new __aspxRichEdit.BookmarksManipulator(this);
            this.tables = new __aspxRichEdit.TablesManipulator(this);
            this.floatingObjectsManipulator = new __aspxRichEdit.FloatingObjectsManipulator(this);
            this.zOrderManipulator = new __aspxRichEdit.ZOrderManipulator(this);
            this.lastTextInsertDate = new Date(0);
        }
        ModelManipulator.addToHistorySelectionHistoryItem = function (control, subDocument, interval, upd, endOfLine, visibleModelPosition) {
            if (visibleModelPosition === void 0) { visibleModelPosition = __aspxRichEdit.ModelScrollManager.StandartScrollPosition; }
            if (control.model.activeSubDocument.id == subDocument.id)
                control.history.addAndRedo(new __aspxRichEdit.SetSelectionHistoryItem(control.modelManipulator, control.model.activeSubDocument, [interval], control.selection, upd, endOfLine, visibleModelPosition));
        };
        ModelManipulator.prototype.isAddedToPrevInsertedTextHistoryItem = function (control, interval, text, canAddToPreviousText, currDate, characterStyle, maskedCharacterProperties, scrollBehavior) {
            if (!canAddToPreviousText || interval.length != 0 || currDate.getTime() - this.lastTextInsertDate.getTime() > 2.7 * 1000)
                return false;
            var insertTextHistoryInfo = this.getPreviousInsertTextHistoryItems(control);
            if (!insertTextHistoryInfo)
                return false;
            var insertTextHistoryItem = insertTextHistoryInfo.insertTextHistoryItem;
            var setSelectionHistoryItem = insertTextHistoryInfo.setSelectionHistoryItem;
            if (setSelectionHistoryItem.intervals.length > 1 || interval.start != setSelectionHistoryItem.intervals[0].start ||
                setSelectionHistoryItem.intervals[0].length != 0 ||
                !insertTextHistoryItem.characterStyle.equalsByName(characterStyle) ||
                !insertTextHistoryItem.maskedCharacterProperties.equals(maskedCharacterProperties))
                return false;
            this.text.insertText(insertTextHistoryItem.boundSubDocument, interval.start, text, insertTextHistoryItem.maskedCharacterProperties, insertTextHistoryItem.characterStyle, __aspxRichEdit.RunType.TextRun);
            setSelectionHistoryItem.intervals[0].start += text.length;
            insertTextHistoryItem.text += text;
            var newPositionSelection = setSelectionHistoryItem.intervals[0].start;
            control.selection.deprecatedSetSelection(newPositionSelection, newPositionSelection, control.selection.endOfLine, control.selection.keepX, __aspxRichEdit.UpdateInputPositionProperties.No, true, true, scrollBehavior);
            return true;
        };
        ModelManipulator.prototype.getPreviousInsertTextHistoryItems = function (control) {
            var history = control.history;
            if (!history)
                return null;
            var historyItems = history.historyItems;
            if (history.currentIndex != historyItems.length - 1)
                return null;
            var lastHistoryItem = historyItems[historyItems.length - 1];
            if (!(lastHistoryItem instanceof __aspxRichEdit.CompositionHistoryItem))
                return null;
            var compositeHistoryItem = lastHistoryItem;
            var compositeHistoryItems = compositeHistoryItem.historyItems;
            var possibleSetSelectionHistoryItem = compositeHistoryItems[compositeHistoryItems.length - 1];
            var possibleInsertTextHistoryItem = compositeHistoryItems[compositeHistoryItems.length - 2];
            if (!(possibleInsertTextHistoryItem instanceof __aspxRichEdit.InsertTextHistoryItem) ||
                !(possibleSetSelectionHistoryItem instanceof __aspxRichEdit.SetSelectionHistoryItem))
                return null;
            return {
                insertTextHistoryItem: possibleInsertTextHistoryItem,
                setSelectionHistoryItem: possibleSetSelectionHistoryItem
            };
        };
        ModelManipulator.prototype.insertText = function (control, subDocument, interval, text, canAddToPreviousText, changeSelection, scrollBehavior) {
            if (changeSelection === void 0) { changeSelection = true; }
            if (scrollBehavior === void 0) { scrollBehavior = __aspxRichEdit.ModelScrollManager.StandartScrollPosition; }
            if (text.length == 0)
                throw new Error("Inserted run can't have length == 0");
            var documentEndPosition = subDocument.getDocumentEndPosition();
            if (interval.start >= documentEndPosition)
                throw "ModelManipulator.insertText interval.start >= documentEndPosition";
            if (interval.length > 0) {
                if (interval.end > documentEndPosition)
                    throw "ModelManipulator.insertText interval.end > documentEndPosition";
                var run = subDocument.getRunByPosition(interval.end - 1);
                if (run.isParagraphOrSectionRun() && (interval.start !== 0 || interval.end !== documentEndPosition))
                    interval.length -= 1;
            }
            var currDate = new Date();
            var characterStyle = control.inputPosition.getCharacterStyle();
            var maskedCharacterProperties = control.inputPosition.getMaskedCharacterProperties().clone();
            if (!this.isAddedToPrevInsertedTextHistoryItem(control, interval, text, canAddToPreviousText, currDate, characterStyle, maskedCharacterProperties, scrollBehavior)) {
                control.history.beginTransaction();
                if (interval.length > 0) {
                    if (changeSelection)
                        ModelManipulator.addToHistorySelectionHistoryItem(control, subDocument, new __aspxRichEdit.FixedInterval(interval.start, 0), __aspxRichEdit.UpdateInputPositionProperties.No, control.selection.endOfLine, scrollBehavior);
                    ModelManipulator.removeInterval(control, subDocument, interval, false, true);
                    maskedCharacterProperties = control.inputPosition.getMaskedCharacterProperties().clone();
                    characterStyle = control.inputPosition.getCharacterStyle();
                }
                control.history.addAndRedo(new __aspxRichEdit.InsertTextHistoryItem(control.modelManipulator, subDocument, interval.start, text, maskedCharacterProperties, characterStyle));
                if (changeSelection)
                    ModelManipulator.addToHistorySelectionHistoryItem(control, subDocument, new __aspxRichEdit.FixedInterval(interval.start + text.length, 0), __aspxRichEdit.UpdateInputPositionProperties.No, control.selection.endOfLine, scrollBehavior);
                control.history.endTransaction();
            }
            this.lastTextInsertDate = currDate;
            return new __aspxRichEdit.FixedInterval(interval.start, text.length);
        };
        ModelManipulator.prototype.insertLayoutDependentText = function (control, subDocument, interval) {
            var documentEndPosition = subDocument.getDocumentEndPosition();
            if (interval.start >= documentEndPosition)
                throw "ModelManipulator.insertLayoutDependentText interval.start >= documentEndPosition";
            if (interval.end > documentEndPosition)
                throw "ModelManipulator.insertLayoutDependentText interval.end > documentEndPosition";
            if (interval.end == documentEndPosition)
                interval.length -= 1;
            var characterStyle = control.inputPosition.getCharacterStyle();
            var maskedCharacterProperties = control.inputPosition.getMaskedCharacterProperties().clone();
            control.history.beginTransaction();
            if (interval.length > 0) {
                ModelManipulator.addToHistorySelectionHistoryItem(control, subDocument, new __aspxRichEdit.FixedInterval(interval.start, 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, control.selection.endOfLine);
                ModelManipulator.removeInterval(control, subDocument, interval, false, true);
            }
            control.history.addAndRedo(new __aspxRichEdit.InsertLayoutDependentTextItem(control.modelManipulator, subDocument, interval.start, maskedCharacterProperties, characterStyle));
            ModelManipulator.addToHistorySelectionHistoryItem(control, subDocument, new __aspxRichEdit.FixedInterval(interval.start + __aspxRichEdit.RichUtils.specialCharacters.LayoutDependentText.length, 0), __aspxRichEdit.UpdateInputPositionProperties.No, control.selection.endOfLine);
            control.history.endTransaction();
        };
        ModelManipulator.modifyLastInsertedSymbol = function (control, symbol) {
            if (symbol.length !== 1)
                throw "Updated symbol length should be equal to 1";
            var insertTextHistoryInfo = control.modelManipulator.getPreviousInsertTextHistoryItems(control);
            if (!insertTextHistoryInfo)
                throw "Last inserted history items were not found";
            insertTextHistoryInfo.insertTextHistoryItem.text = insertTextHistoryInfo.insertTextHistoryItem.text.substr(0, insertTextHistoryInfo.insertTextHistoryItem.text.length - 1) + symbol;
            control.modelManipulator.text.updateSymbol(control.model.activeSubDocument, insertTextHistoryInfo.setSelectionHistoryItem.intervals[0].start - 1, symbol);
        };
        ModelManipulator.modifyLastText = function (control, text, length) {
            if (length === 0) {
                control.beginUpdate();
                control.modelManipulator.insertText(control, control.model.activeSubDocument, control.selection.getLastSelectedInterval(), text, false);
                control.endUpdate();
            }
            else {
                var endInterval = control.selection.getLastSelectedInterval().start;
                var startInterval = endInterval - length;
                var intervalForModify = new __aspxRichEdit.FixedInterval(startInterval, endInterval - startInterval);
                var insertTextHistoryInfo = control.modelManipulator.getPreviousInsertTextHistoryItems(control);
                if (!insertTextHistoryInfo)
                    return false;
                var insertTextHistoryItem = insertTextHistoryInfo.insertTextHistoryItem;
                var setSelectionHistoryItem = insertTextHistoryInfo.setSelectionHistoryItem;
                control.modelManipulator.text.removeIntervalWithoutHistory(insertTextHistoryItem.boundSubDocument, intervalForModify, false);
                control.modelManipulator.text.insertText(insertTextHistoryItem.boundSubDocument, intervalForModify.start, text, insertTextHistoryItem.maskedCharacterProperties, insertTextHistoryItem.characterStyle, __aspxRichEdit.RunType.TextRun);
                setSelectionHistoryItem.intervals[0].start = startInterval + text.length;
                insertTextHistoryItem.text = text;
                var newPositionSelection = setSelectionHistoryItem.intervals[0].start;
                control.selection.deprecatedSetSelection(newPositionSelection, newPositionSelection, control.selection.endOfLine, control.selection.keepX, __aspxRichEdit.UpdateInputPositionProperties.No, true, true, __aspxRichEdit.ModelScrollManager.StandartScrollPosition);
                control.modelManipulator.lastTextInsertDate = new Date(0);
            }
        };
        ModelManipulator.modifyTextUnderCursor = function (control, text) {
            var subDocument = control.model.activeSubDocument;
            var position = control.selection.getLastSelectedInterval().start;
            var startInterval = __aspxRichEdit.LayoutWordBounds.getLayoutWordStartBound(control.layout, control.model.activeSubDocument, control.selection, position);
            var startIntervalLayoutPosition = (subDocument.isMain()
                ? new __aspxRichEdit.LayoutPositionMainSubDocumentCreator(control.layout, subDocument, startInterval, __aspxRichEdit.DocumentLayoutDetailsLevel.Box)
                : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(control.layout, subDocument, startInterval, control.selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Box))
                .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(control.selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
            if (startIntervalLayoutPosition.isLastBoxInRow())
                startInterval = __aspxRichEdit.LayoutWordBounds.getLayoutWordStartBound(control.layout, control.model.activeSubDocument, control.selection, position - 1);
            var endInterval = __aspxRichEdit.LayoutWordBounds.getLayoutWordEndBound(control.layout, control.model.activeSubDocument, control.selection, startInterval, false);
            var intervalForModify = new __aspxRichEdit.FixedInterval(startInterval, endInterval - startInterval);
            control.modelManipulator.insertText(control, control.model.activeSubDocument, intervalForModify, text, false);
        };
        ModelManipulator.insertInlinePicture = function (control, interval, id, originalWidth, originalHeight, scaleX, scaleY, lockAspectRatio) {
            var subDocument = control.model.activeSubDocument;
            var documentEndPosition = subDocument.getDocumentEndPosition();
            if (interval.start >= documentEndPosition)
                throw "ModelManipulator.insertInlinePicture interval.start >= documentEndPosition";
            if (interval.end > documentEndPosition)
                throw "ModelManipulator.insertInlinePicture interval.end > documentEndPosition";
            if (interval.end == documentEndPosition)
                interval.length -= 1;
            var characterStyle = control.inputPosition.getCharacterStyle();
            control.history.beginTransaction();
            if (interval.length > 0) {
                ModelManipulator.addToHistorySelectionHistoryItem(control, subDocument, new __aspxRichEdit.FixedInterval(interval.start, 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, control.selection.endOfLine);
                ModelManipulator.removeInterval(control, subDocument, interval, false, true);
            }
            control.history.addAndRedo(new __aspxRichEdit.InsertInlinePictureHistoryItem(control.modelManipulator, subDocument, interval.start, id, originalWidth, originalHeight, scaleX, scaleY, control.inputPosition.getMaskedCharacterProperties().clone(), characterStyle, lockAspectRatio));
            ModelManipulator.addToHistorySelectionHistoryItem(control, subDocument, new __aspxRichEdit.FixedInterval(interval.start + 1, 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, control.selection.endOfLine);
            control.history.endTransaction();
        };
        ModelManipulator.insertParagraph = function (control, subDocument, interval, changeSelection) {
            if (changeSelection === void 0) { changeSelection = true; }
            var documentEndPosition = subDocument.getDocumentEndPosition();
            if (interval.start >= documentEndPosition)
                throw "ModelManipulator.insertParagraph interval.start >= documentEndPosition";
            if (interval.end > documentEndPosition)
                throw "ModelManipulator.insertParagraph interval.end > documentEndPosition";
            var characterStyle = control.inputPosition.getCharacterStyle();
            var maskedCharacterProperties = control.inputPosition.getMaskedCharacterProperties().clone();
            if (interval.end == documentEndPosition)
                interval.length -= 1;
            var currentParagraph = subDocument.getRunByPosition(interval.start).paragraph;
            var nextParagraphStyle = currentParagraph.paragraphStyle ? currentParagraph.paragraphStyle.nextParagraphStyle : null;
            var needToSetNextStyle = nextParagraphStyle && (currentParagraph.getEndPosition() - 1 == interval.end);
            var needToUseCurrentParagraphLastRunAsSource = currentParagraph.isInList() && !needToSetNextStyle &&
                !interval.containsInterval(currentParagraph.interval);
            control.history.beginTransaction();
            if (interval.length > 0) {
                if (changeSelection)
                    ModelManipulator.addToHistorySelectionHistoryItem(control, subDocument, new __aspxRichEdit.FixedInterval(interval.start, 0), __aspxRichEdit.UpdateInputPositionProperties.No, false);
                ModelManipulator.removeInterval(control, subDocument, interval, false, true);
            }
            var newInterval = new __aspxRichEdit.FixedInterval(interval.start + __aspxRichEdit.RichUtils.specialCharacters.ParagraphMark.length, 0);
            if (needToUseCurrentParagraphLastRunAsSource) {
                if (interval.length > 0)
                    currentParagraph = subDocument.getRunByPosition(interval.start).paragraph;
                var paragraphLastRun = subDocument.getRunByPosition(currentParagraph.getEndPosition() - 1);
                control.history.addAndRedo(new __aspxRichEdit.InsertParagraphHistoryItem(control.modelManipulator, subDocument, interval.start, paragraphLastRun.maskedCharacterProperties.clone(), paragraphLastRun.characterStyle, undefined, undefined, undefined, undefined, undefined));
            }
            else {
                control.history.addAndRedo(new __aspxRichEdit.InsertParagraphHistoryItem(control.modelManipulator, subDocument, interval.start, maskedCharacterProperties, characterStyle, undefined, undefined, undefined, undefined, undefined));
                if (needToSetNextStyle && control.model.activeSubDocument.isEditable([new __aspxRichEdit.FixedInterval(newInterval.start, 1)]))
                    control.history.addAndRedo(new __aspxRichEdit.ApplyParagraphStyleHistoryItem(control.modelManipulator, control.modelManipulator.model.activeSubDocument, newInterval, control.model.stylesManager.addParagraphStyle(nextParagraphStyle)));
            }
            if (changeSelection)
                ModelManipulator.addToHistorySelectionHistoryItem(control, subDocument, newInterval, __aspxRichEdit.UpdateInputPositionProperties.No, false);
            control.history.endTransaction();
            return new __aspxRichEdit.FixedInterval(interval.start, 1);
        };
        ModelManipulator.insertSectionAndSetStartType = function (control, position, startType) {
            var model = control.model, subDocument = model.activeSubDocument, documentEndPosition = subDocument.getDocumentEndPosition();
            if (position >= documentEndPosition)
                throw "ModelManipulator.insertSectionAndSetStartType position >= documentEndPosition";
            var characterStyle = control.inputPosition.getCharacterStyle();
            var maskedCharacterProperties = control.inputPosition.getMaskedCharacterProperties().clone();
            var sectionProperties = control.model.activeSubDocument.getSectionByPosition(position).sectionProperties.clone();
            sectionProperties.startType = startType;
            control.history.beginTransaction();
            control.history.addAndRedo(new __aspxRichEdit.InsertSectionHistoryItem(control.modelManipulator, control.model.activeSubDocument, position, maskedCharacterProperties, characterStyle, sectionProperties, false, null, null, true, undefined, undefined, undefined));
            ModelManipulator.addToHistorySelectionHistoryItem(control, subDocument, new __aspxRichEdit.FixedInterval(position + __aspxRichEdit.RichUtils.specialCharacters.SectionMark.length, 0), __aspxRichEdit.UpdateInputPositionProperties.No, false);
            control.history.endTransaction();
        };
        ModelManipulator.insertSection = function (control, position) {
            var model = control.model, subDocument = model.activeSubDocument, documentEndPosition = subDocument.getDocumentEndPosition();
            if (position >= documentEndPosition)
                throw "ModelManipulator.insertSection position >= documentEndPosition";
            var characterStyle = control.inputPosition.getCharacterStyle();
            var maskedCharacterProperties = control.inputPosition.getMaskedCharacterProperties().clone();
            var sectionProperties = control.model.activeSubDocument.getSectionByPosition(position).sectionProperties.clone();
            control.history.beginTransaction();
            control.history.addAndRedo(new __aspxRichEdit.InsertSectionHistoryItem(control.modelManipulator, control.model.activeSubDocument, position, maskedCharacterProperties, characterStyle, sectionProperties, false, null, null, true, undefined, undefined, undefined));
            ModelManipulator.addToHistorySelectionHistoryItem(control, subDocument, new __aspxRichEdit.FixedInterval(position + __aspxRichEdit.RichUtils.specialCharacters.SectionMark.length, 0), __aspxRichEdit.UpdateInputPositionProperties.No, false);
            control.history.endTransaction();
        };
        ModelManipulator.removeInterval = function (control, subDocument, interval, removeTableIfItMatchesWithInterval, clearLastParagraphIfIntervalMatchesWholeDocument) {
            var documentEndPosition = subDocument.getDocumentEndPosition();
            if (interval.start >= documentEndPosition)
                throw "ModelManipulator.removeInterval interval.start >= documentEndPosition";
            if (interval.end > documentEndPosition)
                throw "ModelManipulator.removeInterval interval.end > documentEndPosition";
            if (interval.length === 0 || (interval.length === 1 && interval.end === documentEndPosition))
                return;
            control.history.beginTransaction();
            __aspxRichEdit.TablesManipulator.removeTablesOnInterval(control, subDocument, interval, removeTableIfItMatchesWithInterval);
            var isWholeDocumentRemoved = clearLastParagraphIfIntervalMatchesWholeDocument && interval.start === 0 && interval.length === documentEndPosition;
            if (interval.end == documentEndPosition)
                interval.length -= 1;
            var setPropertiesSecondParagraph = __aspxRichEdit.Utils.binaryIndexOf(subDocument.paragraphs, function (p) { return p.startLogPosition.value - interval.start; }) >= 0;
            control.history.addAndRedo(new __aspxRichEdit.RemoveIntervalHistoryItem(control.modelManipulator, subDocument, interval, setPropertiesSecondParagraph));
            if (isWholeDocumentRemoved) {
                control.history.addAndRedo(new __aspxRichEdit.ParagraphPropertiesHistoryItem(control.modelManipulator, subDocument, 0, __aspxRichEdit.MaskedParagraphProperties.createDefault(control.model), control.model.getDefaultParagraphStyle(), -1, -1, new __aspxRichEdit.TabProperties()));
                this.resetCharacterFormatting(control, subDocument, new __aspxRichEdit.FixedInterval(0, 1));
                control.inputPosition.reset();
            }
            control.history.endTransaction();
        };
        ModelManipulator.resetCharacterFormatting = function (control, subDocument, interval) {
            control.history.addAndRedo(new __aspxRichEdit.CharacterPropertiesHistoryItem(control.modelManipulator, subDocument, interval, __aspxRichEdit.MaskedCharacterProperties.createDefault(control.model)));
            control.history.addAndRedo(new __aspxRichEdit.ApplyCharacterStyleHistoryItem(control.modelManipulator, subDocument, interval, control.model.getDefaultCharacterStyle(), true));
        };
        ModelManipulator.copyIntervalTo = function (control, subDocument, interval, toPosition) {
            var documentEndPosition = subDocument.getDocumentEndPosition();
            if (interval.start >= documentEndPosition)
                throw "ModelManipulator.copyIntervalTo interval.start >= documentEndPosition";
            if (interval.end > documentEndPosition)
                throw "ModelManipulator.copyIntervalTo interval.end > documentEndPosition";
            if (toPosition >= documentEndPosition)
                throw "ModelManipulator.copyIntervalTo toPosition >= documentEndPosition";
            control.history.beginTransaction();
            var rangeCopy = this.createRangeCopy(subDocument, [interval]);
            this.insertRangeCopy(control, subDocument, rangeCopy, toPosition);
            control.history.endTransaction();
        };
        ModelManipulator.insertSubDocument = function (control, targetSubDocument, targetPosition, sourceSubDocument, sourceInterval) {
            var tbl = __aspxRichEdit.Table.getTableByPosition(sourceSubDocument.tables, sourceInterval.start, false);
            if (tbl && tbl.getStartPosition() == sourceInterval.start &&
                (targetSubDocument.getParagraphByPosition(targetPosition).startLogPosition.value != targetPosition ||
                    __aspxRichEdit.ListUtils.anyOf(targetSubDocument.tables, function (tbl) { return tbl.getEndPosition() == targetPosition; }))) {
                ModelManipulator.insertParagraph(control, targetSubDocument, new __aspxRichEdit.FixedInterval(targetPosition, 0));
                targetPosition++;
            }
            control.history.beginTransaction();
            control.history.addAndRedo(new __aspxRichEdit.InsertSubDocumentHistoryItem(control.modelManipulator, targetSubDocument, targetPosition, sourceSubDocument, sourceInterval));
            var targetLength = sourceInterval.length;
            if (sourceSubDocument.fields.length > 0) {
                var selection_1 = control.selection;
                var selectionStateInfo = selection_1.getSelectionState();
                ModelManipulator.addToHistorySelectionHistoryItem(control, targetSubDocument, new __aspxRichEdit.FixedInterval(targetPosition, sourceInterval.length), __aspxRichEdit.UpdateInputPositionProperties.No, selection_1.endOfLine);
                if (control.fieldsSettings.updateFieldsOnPaste)
                    control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.UpdateField).execute(control.commandManager.isPublicApiCall, new __aspxRichEdit.UpdateFieldCommandParameters(targetSubDocument, [new __aspxRichEdit.FixedInterval(targetPosition, sourceInterval.length)], function () {
                        targetLength = selection_1.getLastSelectedInterval().length;
                        selection_1.restoreSelectionState(selectionStateInfo, __aspxRichEdit.UpdateInputPositionProperties.Yes);
                        control.history.endTransaction();
                    }));
            }
            else
                control.history.endTransaction();
            return new __aspxRichEdit.FixedInterval(targetPosition, targetLength);
        };
        ModelManipulator.moveIntervalTo = function (control, subDocument, interval, toPosition) {
            var documentEndPosition = subDocument.getDocumentEndPosition();
            if (interval.start >= documentEndPosition)
                throw "ModelManipulator.moveIntervalTo interval.start >= documentEndPosition";
            if (interval.end > documentEndPosition)
                throw "ModelManipulator.moveIntervalTo interval.end > documentEndPosition";
            if (interval.end == documentEndPosition)
                interval.length -= 1;
            if (toPosition >= documentEndPosition)
                throw "ModelManipulator.moveIntervalTo toPosition >= documentEndPosition";
            control.history.beginTransaction();
            var rangeCopy = this.createRangeCopy(subDocument, [interval]);
            var insertedInterval = this.insertRangeCopy(control, subDocument, rangeCopy, toPosition);
            ModelManipulator.addToHistorySelectionHistoryItem(control, subDocument, new __aspxRichEdit.FixedInterval(interval.start, 0), __aspxRichEdit.UpdateInputPositionProperties.No, control.selection.endOfLine);
            if (toPosition < interval.start)
                ModelManipulator.removeInterval(control, subDocument, new __aspxRichEdit.FixedInterval(interval.start + insertedInterval.length, interval.length), false, true);
            else {
                ModelManipulator.removeInterval(control, subDocument, interval, false, true);
                insertedInterval.start -= interval.length;
            }
            control.history.endTransaction();
            return insertedInterval;
        };
        ModelManipulator.insertRangeCopy = function (control, subDocument, result, position) {
            var sourceInterval = new __aspxRichEdit.FixedInterval(0, result.model.activeSubDocument.getDocumentEndPosition() - (result.addedUselessParagraphMarkInEnd ? 1 : 0));
            return this.insertSubDocument(control, subDocument, position, result.model.activeSubDocument, sourceInterval);
        };
        ModelManipulator.createRangeCopy = function (subDocument, intervals) {
            if (intervals.length === 0)
                throw new Error("intervals.length should be > 0");
            if (intervals[0].length === 0)
                throw new Error("intervals[0].length should be > 0");
            return new __aspxRichEdit.CreateRangeCopyOperation(subDocument).execute(intervals);
        };
        ModelManipulator.pasteRangeCopy = function (control, subDocument, interval, rangeCopy) {
            var documentEndPosition = subDocument.getDocumentEndPosition();
            if (interval.start >= documentEndPosition)
                throw "ModelManipulator.pasteRangeCopy interval.start >= documentEndPosition";
            if (interval.length > 0) {
                if (interval.end > documentEndPosition)
                    throw "ModelManipulator.pasteRangeCopy interval.end > documentEndPosition";
                var run = subDocument.getRunByPosition(interval.end - 1);
                if (run.isParagraphOrSectionRun())
                    interval.length -= 1;
            }
            var isSubDocumentActive = control.model.activeSubDocument == subDocument;
            control.history.beginTransaction();
            if (interval.length > 0) {
                if (isSubDocumentActive)
                    ModelManipulator.addToHistorySelectionHistoryItem(control, subDocument, new __aspxRichEdit.FixedInterval(interval.start, 0), __aspxRichEdit.UpdateInputPositionProperties.No, control.selection.endOfLine);
                ModelManipulator.removeInterval(control, subDocument, interval, false, true);
            }
            var newInterval = ModelManipulator.insertRangeCopy(control, subDocument, rangeCopy, interval.start);
            if (isSubDocumentActive)
                ModelManipulator.addToHistorySelectionHistoryItem(control, subDocument, new __aspxRichEdit.FixedInterval(newInterval.end, 0), __aspxRichEdit.UpdateInputPositionProperties.No, control.selection.endOfLine);
            control.history.endTransaction();
        };
        ModelManipulator.pasteHtmlData = function (control, subDocument, interval, htmlData) {
            var documentEndPosition = subDocument.getDocumentEndPosition();
            if (interval.start >= documentEndPosition)
                throw "ModelManipulator.pasteSelection interval.start >= documentEndPosition";
            if (interval.length > 0) {
                if (interval.end > documentEndPosition)
                    throw "ModelManipulator.pasteSelection interval.end > documentEndPosition";
                var run = subDocument.getRunByPosition(interval.end - 1);
                if (run.isParagraphOrSectionRun() && (interval.start !== 0 || interval.end !== documentEndPosition))
                    interval.length -= 1;
            }
            control.history.beginTransaction();
            if (interval.length > 0) {
                ModelManipulator.addToHistorySelectionHistoryItem(control, subDocument, new __aspxRichEdit.FixedInterval(interval.start, 0), __aspxRichEdit.UpdateInputPositionProperties.No, control.selection.endOfLine);
                ModelManipulator.removeInterval(control, subDocument, interval, false, true);
            }
            var htmlPasteHelper = new __aspxRichEdit.HtmlImport.PasteHtmlHelper(control, htmlData, subDocument, interval.start);
            var intervalToPasteIn = __aspxRichEdit.FixedInterval.fromPositions(interval.start, htmlPasteHelper.position);
            control.history.addAndRedo(new __aspxRichEdit.PasteHtmlDataHistoryItem(control.modelManipulator, subDocument, intervalToPasteIn, htmlPasteHelper.historyRuns, htmlPasteHelper.tableInfo, htmlPasteHelper.inputPositionMaskedCharProps, htmlPasteHelper.characterStyle));
            ModelManipulator.addToHistorySelectionHistoryItem(control, subDocument, new __aspxRichEdit.FixedInterval(intervalToPasteIn.end, 0), __aspxRichEdit.UpdateInputPositionProperties.No, control.selection.endOfLine);
            if (htmlPasteHelper.imagesToLoad.length) {
                control.modelManipulator.dispatcher.notifyLoadInlinePictures(subDocument, htmlPasteHelper.imagesToLoad);
                if (!control.isNeedLoadPictureFromServer)
                    __aspxRichEdit.ListUtils.foreach(htmlPasteHelper.imagesToLoad, function (data) {
                        return __aspxRichEdit.HtmlImport.HtmlImgTagImporter.loadPicSize(control.modelManipulator.text, subDocument, data.guid, data.sourceUrl);
                    });
            }
            control.history.endTransaction();
        };
        ModelManipulator.getNextWordStartPosition = function (control, currentPosition) {
            var runInfo = control.model.activeSubDocument.getRunAndIndexesByPosition(currentPosition);
            var groupMask = NextPrevWordGroupMask.NoOne;
            var previousGroupDiffersFromCurrent = function (mask) {
                groupMask |= mask;
                return (groupMask & ~mask) != NextPrevWordGroupMask.NoOne;
            };
            var findDiffersGroup = false;
            var chunks = control.model.activeSubDocument.chunks;
            var currentChunkIndex = runInfo.chunkIndex;
            var currentRunIndex = runInfo.runIndex;
            var currentPositionInChunk = currentPosition - runInfo.chunk.startLogPosition.value;
            var run = runInfo.chunk.textRuns[currentRunIndex];
            var leftCharactersUnwatched = runInfo.run.startOffset + runInfo.run.getLength() - currentPositionInChunk;
            for (var currentChunk; currentChunk = chunks[currentChunkIndex]; currentChunkIndex++) {
                for (var character; character = currentChunk.textBuffer[currentPositionInChunk]; currentPositionInChunk++) {
                    if (!leftCharactersUnwatched) {
                        run = currentChunk.textRuns[++currentRunIndex];
                        leftCharactersUnwatched = run.getLength();
                    }
                    leftCharactersUnwatched--;
                    if (run.getCharacterMergedProperies().hidden)
                        continue;
                    switch (character) {
                        case __aspxRichEdit.RichUtils.specialCharacters.Space:
                        case __aspxRichEdit.RichUtils.specialCharacters.QmSpace:
                        case __aspxRichEdit.RichUtils.specialCharacters.EmSpace:
                        case __aspxRichEdit.RichUtils.specialCharacters.EnSpace:
                            previousGroupDiffersFromCurrent(NextPrevWordGroupMask.Space);
                            break;
                        case __aspxRichEdit.RichUtils.specialCharacters.TabMark:
                            findDiffersGroup = previousGroupDiffersFromCurrent(NextPrevWordGroupMask.Tab);
                            break;
                        case __aspxRichEdit.RichUtils.specialCharacters.ParagraphMark:
                            findDiffersGroup = previousGroupDiffersFromCurrent(NextPrevWordGroupMask.Paragraph);
                            break;
                        case __aspxRichEdit.RichUtils.specialCharacters.LeftSingleQuote:
                            findDiffersGroup = previousGroupDiffersFromCurrent(NextPrevWordGroupMask.LeftSingleQuote);
                            break;
                        case __aspxRichEdit.RichUtils.specialCharacters.RightSingleQuote:
                            findDiffersGroup = previousGroupDiffersFromCurrent(NextPrevWordGroupMask.RightSingleQuote);
                            break;
                        case "'":
                            findDiffersGroup = previousGroupDiffersFromCurrent(NextPrevWordGroupMask.SingleQuote);
                            break;
                        case __aspxRichEdit.RichUtils.specialCharacters.LeftDoubleQuote:
                            findDiffersGroup = previousGroupDiffersFromCurrent(NextPrevWordGroupMask.LeftDoubleQuote);
                            break;
                        case __aspxRichEdit.RichUtils.specialCharacters.RightDoubleQuote:
                            findDiffersGroup = previousGroupDiffersFromCurrent(NextPrevWordGroupMask.RightDoubleQuote);
                            break;
                        case '"':
                            findDiffersGroup = previousGroupDiffersFromCurrent(NextPrevWordGroupMask.DoubleQuote);
                            break;
                        case "(":
                        case ")":
                        case "«":
                        case "»":
                        case "<":
                        case ">":
                        case "№":
                        case "%":
                        case "!":
                        case ":":
                        case "?":
                        case "-":
                        case "+":
                        case ",":
                        case ".":
                        case "*":
                        case "=":
                        case "\\":
                        case "/":
                        case "|":
                        case ";":
                            findDiffersGroup = previousGroupDiffersFromCurrent(NextPrevWordGroupMask.PunctuationMark);
                            break;
                        default:
                            findDiffersGroup = previousGroupDiffersFromCurrent(NextPrevWordGroupMask.Others);
                            break;
                    }
                    if (findDiffersGroup)
                        return currentChunk.startLogPosition.value + currentPositionInChunk;
                }
                currentPositionInChunk = 0;
                currentRunIndex = 0;
            }
            return control.model.activeSubDocument.getDocumentEndPosition() - 1;
        };
        ModelManipulator.getPrevWordStartPosition = function (control, currentPosition) {
            if (currentPosition == 0)
                return 0;
            currentPosition--;
            var runInfo = control.model.activeSubDocument.getRunAndIndexesByPosition(currentPosition);
            var groupMask = NextPrevWordGroupMask.NoOne;
            var previousGroupDiffersFromCurrent = function (mask) {
                groupMask |= mask;
                return (groupMask & ~mask & ~NextPrevWordGroupMask.Space) != NextPrevWordGroupMask.NoOne;
            };
            var findDiffersGroup = false;
            var chunks = control.model.activeSubDocument.chunks;
            var currentChunkIndex = runInfo.chunkIndex;
            var currentRunIndex = runInfo.runIndex;
            var currentChunk = runInfo.chunk;
            var currentPositionInChunk = currentPosition - currentChunk.startLogPosition.value;
            var run = currentChunk.textRuns[currentRunIndex];
            var leftCharactersUnwatched = currentPositionInChunk - run.startOffset;
            while (true) {
                for (var character; character = currentChunk.textBuffer[currentPositionInChunk]; currentPositionInChunk--) {
                    if (leftCharactersUnwatched < 0) {
                        run = currentChunk.textRuns[--currentRunIndex];
                        leftCharactersUnwatched = run.getLength();
                    }
                    leftCharactersUnwatched--;
                    if (run.getCharacterMergedProperies().hidden)
                        continue;
                    switch (character) {
                        case __aspxRichEdit.RichUtils.specialCharacters.Space:
                        case __aspxRichEdit.RichUtils.specialCharacters.QmSpace:
                        case __aspxRichEdit.RichUtils.specialCharacters.EmSpace:
                        case __aspxRichEdit.RichUtils.specialCharacters.EnSpace:
                            findDiffersGroup = previousGroupDiffersFromCurrent(NextPrevWordGroupMask.Space);
                            break;
                        case __aspxRichEdit.RichUtils.specialCharacters.TabMark:
                            findDiffersGroup = previousGroupDiffersFromCurrent(NextPrevWordGroupMask.Tab);
                            break;
                        case __aspxRichEdit.RichUtils.specialCharacters.ParagraphMark:
                            findDiffersGroup = previousGroupDiffersFromCurrent(NextPrevWordGroupMask.Paragraph);
                            break;
                        case __aspxRichEdit.RichUtils.specialCharacters.LeftSingleQuote:
                            findDiffersGroup = previousGroupDiffersFromCurrent(NextPrevWordGroupMask.LeftSingleQuote);
                            break;
                        case __aspxRichEdit.RichUtils.specialCharacters.RightSingleQuote:
                            findDiffersGroup = previousGroupDiffersFromCurrent(NextPrevWordGroupMask.RightSingleQuote);
                            break;
                        case "'":
                            findDiffersGroup = previousGroupDiffersFromCurrent(NextPrevWordGroupMask.SingleQuote);
                            break;
                        case __aspxRichEdit.RichUtils.specialCharacters.LeftDoubleQuote:
                            findDiffersGroup = previousGroupDiffersFromCurrent(NextPrevWordGroupMask.LeftDoubleQuote);
                            break;
                        case __aspxRichEdit.RichUtils.specialCharacters.RightDoubleQuote:
                            findDiffersGroup = previousGroupDiffersFromCurrent(NextPrevWordGroupMask.RightDoubleQuote);
                            break;
                        case '"':
                            findDiffersGroup = previousGroupDiffersFromCurrent(NextPrevWordGroupMask.DoubleQuote);
                            break;
                        case "(":
                        case ")":
                        case "«":
                        case "»":
                        case "<":
                        case ">":
                        case "№":
                        case "%":
                        case "!":
                        case ":":
                        case "?":
                        case "-":
                        case "+":
                        case ",":
                        case ".":
                        case "*":
                        case "=":
                        case "\\":
                        case "/":
                        case "|":
                        case ";":
                            findDiffersGroup = previousGroupDiffersFromCurrent(NextPrevWordGroupMask.PunctuationMark);
                            break;
                        default:
                            findDiffersGroup = previousGroupDiffersFromCurrent(NextPrevWordGroupMask.Others);
                            break;
                    }
                    if (findDiffersGroup)
                        return currentChunk.startLogPosition.value + currentPositionInChunk + 1;
                }
                if (!(currentChunk = chunks[--currentChunkIndex]))
                    break;
                currentPositionInChunk = currentChunk.textBuffer.length - 1;
                currentRunIndex = currentChunk.textRuns.length;
            }
            return 0;
        };
        return ModelManipulator;
    }());
    __aspxRichEdit.ModelManipulator = ModelManipulator;
    var NextPrevWordGroupMask;
    (function (NextPrevWordGroupMask) {
        NextPrevWordGroupMask[NextPrevWordGroupMask["NoOne"] = 0] = "NoOne";
        NextPrevWordGroupMask[NextPrevWordGroupMask["Space"] = 1] = "Space";
        NextPrevWordGroupMask[NextPrevWordGroupMask["Tab"] = 2] = "Tab";
        NextPrevWordGroupMask[NextPrevWordGroupMask["Paragraph"] = 4] = "Paragraph";
        NextPrevWordGroupMask[NextPrevWordGroupMask["SingleQuote"] = 8] = "SingleQuote";
        NextPrevWordGroupMask[NextPrevWordGroupMask["LeftSingleQuote"] = 16] = "LeftSingleQuote";
        NextPrevWordGroupMask[NextPrevWordGroupMask["RightSingleQuote"] = 32] = "RightSingleQuote";
        NextPrevWordGroupMask[NextPrevWordGroupMask["LeftDoubleQuote"] = 64] = "LeftDoubleQuote";
        NextPrevWordGroupMask[NextPrevWordGroupMask["RightDoubleQuote"] = 128] = "RightDoubleQuote";
        NextPrevWordGroupMask[NextPrevWordGroupMask["DoubleQuote"] = 256] = "DoubleQuote";
        NextPrevWordGroupMask[NextPrevWordGroupMask["PunctuationMark"] = 512] = "PunctuationMark";
        NextPrevWordGroupMask[NextPrevWordGroupMask["Others"] = 1024] = "Others";
    })(NextPrevWordGroupMask || (NextPrevWordGroupMask = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var NumberingListManipulator = (function () {
        function NumberingListManipulator(manipulator) {
            this.manipulator = manipulator;
        }
        NumberingListManipulator.prototype.addAbstractNumberingList = function (abstractNumberingList) {
            var newIndex = this.manipulator.model.abstractNumberingLists.push(abstractNumberingList) - 1;
            abstractNumberingList.deleted = false;
            this.manipulator.dispatcher.notifyAbstractNumberingListAdded(newIndex);
            return newIndex;
        };
        NumberingListManipulator.prototype.deleteAbstractNumberingList = function (abstractNumberingListIndex) {
            this.manipulator.model.abstractNumberingLists[abstractNumberingListIndex].deleted = true;
            this.manipulator.model.abstractNumberingLists.splice(abstractNumberingListIndex, 1);
            this.manipulator.dispatcher.notifyAbstractNumberingListDeleted(abstractNumberingListIndex);
        };
        NumberingListManipulator.prototype.addNumberingList = function (numberingList) {
            var newIndex = this.manipulator.model.numberingLists.push(numberingList) - 1;
            numberingList.deleted = false;
            this.manipulator.dispatcher.notifyNumberingListAdded(newIndex);
            return newIndex;
        };
        NumberingListManipulator.prototype.deleteNumberingList = function (numberingListIndex) {
            this.manipulator.model.numberingLists.splice(numberingListIndex, 1);
            this.manipulator.dispatcher.notifyNumberingListDeleted(numberingListIndex);
        };
        NumberingListManipulator.prototype.setIOverrideListLevelOverrideStart = function (numberingListIndex, levelIndex, overrideStart) {
            var numberingList = this.manipulator.model.numberingLists[numberingListIndex];
            var listLevel = numberingList.levels[levelIndex];
            var newState = new __aspxRichEdit.HistoryItemState();
            var oldState = new __aspxRichEdit.HistoryItemState();
            oldState.register(new __aspxRichEdit.HistoryItemListLevelStateObject(false, numberingListIndex, levelIndex, listLevel.overrideStart));
            listLevel.overrideStart = overrideStart;
            newState.register(new __aspxRichEdit.HistoryItemListLevelStateObject(false, numberingListIndex, levelIndex, overrideStart));
            this.manipulator.dispatcher.notifyIOverrideListLevelChanged(__aspxRichEdit.JSONIOverrideListLevelProperty.OverrideStart, newState);
            return oldState;
        };
        NumberingListManipulator.prototype.restoreIOverrideListLevelOverrideStart = function (state) {
            var stateObject = state.objects[0];
            var numberingList = this.manipulator.model.numberingLists[stateObject.numberingListIndex];
            var listLevel = numberingList.levels[stateObject.listLevelIndex];
            listLevel.overrideStart = stateObject.value;
            this.manipulator.dispatcher.notifyIOverrideListLevelChanged(__aspxRichEdit.JSONIOverrideListLevelProperty.OverrideStart, stateObject.value);
        };
        NumberingListManipulator.prototype.setIOverrideListLevelNewStart = function (numberingListIndex, levelIndex, newStart) {
            var numberingList = this.manipulator.model.numberingLists[numberingListIndex];
            var listLevel = numberingList.levels[levelIndex];
            var newState = new __aspxRichEdit.HistoryItemState();
            var oldState = new __aspxRichEdit.HistoryItemState();
            oldState.register(new __aspxRichEdit.HistoryItemListLevelStateObject(false, numberingListIndex, levelIndex, listLevel.getNewStart()));
            listLevel.setNewStart(newStart);
            newState.register(new __aspxRichEdit.HistoryItemListLevelStateObject(false, numberingListIndex, levelIndex, newStart));
            this.manipulator.dispatcher.notifyIOverrideListLevelChanged(__aspxRichEdit.JSONIOverrideListLevelProperty.NewStart, newState);
            return oldState;
        };
        NumberingListManipulator.prototype.restoreIOverrideListLevelNewStart = function (state) {
            var stateObject = state.objects[0];
            var numberingList = this.manipulator.model.numberingLists[stateObject.numberingListIndex];
            var listLevel = numberingList.levels[stateObject.listLevelIndex];
            listLevel.setNewStart(stateObject.value);
            this.manipulator.dispatcher.notifyIOverrideListLevelChanged(__aspxRichEdit.JSONIOverrideListLevelProperty.NewStart, stateObject.value);
        };
        NumberingListManipulator.prototype.setParagraphNumberingList = function (subDocument, paragraphIndex, numberingIndex, listLevelIndex) {
            var oldState = new __aspxRichEdit.HistoryItemIntervalState();
            var newState = new __aspxRichEdit.HistoryItemIntervalState();
            var paragraph = subDocument.paragraphs[paragraphIndex];
            var oldAbstractNumberingListIndex = paragraph.getAbstractNumberingListIndex();
            oldState.register(new __aspxRichEdit.HistoryItemIntervalStateObject(paragraph.interval, [paragraph.numberingListIndex, paragraph.listLevelIndex]));
            newState.register(new __aspxRichEdit.HistoryItemIntervalStateObject(paragraph.interval, [numberingIndex, listLevelIndex]));
            paragraph.numberingListIndex = numberingIndex;
            paragraph.listLevelIndex = listLevelIndex;
            paragraph.resetParagraphMergedProperties();
            this.manipulator.dispatcher.notifyParagraphNumberingListChanged(subDocument, newState, oldAbstractNumberingListIndex);
            return oldState;
        };
        NumberingListManipulator.prototype.removeNumberingListFromParagraph = function (subDocument, paragraphIndex) {
            var oldState = new __aspxRichEdit.HistoryItemIntervalState();
            var newState = new __aspxRichEdit.HistoryItemIntervalState();
            var paragraph = subDocument.paragraphs[paragraphIndex];
            var oldAbstractNumberingListIndex = paragraph.getAbstractNumberingListIndex();
            var newListIndex = __aspxRichEdit.NumberingList.NumberingListNotSettedIndex;
            if (paragraph.isInStyleList())
                newListIndex = __aspxRichEdit.NumberingList.NoNumberingListIndex;
            oldState.register(new __aspxRichEdit.HistoryItemIntervalStateObject(paragraph.interval, [paragraph.numberingListIndex, paragraph.listLevelIndex]));
            paragraph.numberingListIndex = newListIndex;
            paragraph.listLevelIndex = -1;
            paragraph.resetParagraphMergedProperties();
            newState.register(new __aspxRichEdit.HistoryItemIntervalStateObject(paragraph.interval, [newListIndex, -1]));
            this.manipulator.dispatcher.notifyParagraphNumberingListChanged(subDocument, newState, oldAbstractNumberingListIndex);
            return oldState;
        };
        NumberingListManipulator.prototype.restoreParagraphNumberingList = function (subDocument, state) {
            var paragraph = subDocument.getParagraphsByInterval(state.interval)[0];
            var oldAbstractNumberingListIndex = paragraph.getAbstractNumberingListIndex();
            paragraph.numberingListIndex = state.objects[0].value[0];
            paragraph.listLevelIndex = state.objects[0].value[1];
            paragraph.resetParagraphMergedProperties();
            this.manipulator.dispatcher.notifyParagraphNumberingListChanged(subDocument, state, oldAbstractNumberingListIndex);
        };
        return NumberingListManipulator;
    }());
    __aspxRichEdit.NumberingListManipulator = NumberingListManipulator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ParagraphPropertiesManipulator = (function () {
        function ParagraphPropertiesManipulator(manipulator) {
            this.align = new MaskedParagraphPropertiesManipulator(manipulator, __aspxRichEdit.ParagraphPropertyDescriptor.alignment);
            this.contextualSpacing = new MaskedParagraphPropertiesManipulator(manipulator, __aspxRichEdit.ParagraphPropertyDescriptor.contextualSpacing);
            this.rightToLeft = new MaskedParagraphPropertiesManipulator(manipulator, __aspxRichEdit.ParagraphPropertyDescriptor.rightToLeft);
            this.afterAutoSpacing = new MaskedParagraphPropertiesManipulator(manipulator, __aspxRichEdit.ParagraphPropertyDescriptor.afterAutoSpacing);
            this.shadingInfo = new MaskedParagraphPropertiesManipulator(manipulator, __aspxRichEdit.ParagraphPropertyDescriptor.shadingInfo);
            this.beforeAutoSpacing = new MaskedParagraphPropertiesManipulator(manipulator, __aspxRichEdit.ParagraphPropertyDescriptor.beforeAutoSpacing);
            this.firstLineIndent = new MaskedParagraphPropertiesManipulator(manipulator, __aspxRichEdit.ParagraphPropertyDescriptor.firstLineIndent);
            this.keepLinesTogether = new MaskedParagraphPropertiesManipulator(manipulator, __aspxRichEdit.ParagraphPropertyDescriptor.keepLinesTogether);
            this.firstLineIndentType = new MaskedParagraphPropertiesManipulator(manipulator, __aspxRichEdit.ParagraphPropertyDescriptor.firstLineIndentType);
            this.leftIndent = new MaskedParagraphPropertiesManipulator(manipulator, __aspxRichEdit.ParagraphPropertyDescriptor.leftIndent);
            this.lineSpacing = new MaskedParagraphPropertiesManipulator(manipulator, __aspxRichEdit.ParagraphPropertyDescriptor.lineSpacing);
            this.lineSpacingType = new MaskedParagraphPropertiesManipulator(manipulator, __aspxRichEdit.ParagraphPropertyDescriptor.lineSpacingType);
            this.outlineLevel = new MaskedParagraphPropertiesManipulator(manipulator, __aspxRichEdit.ParagraphPropertyDescriptor.outlineLevel);
            this.pageBreakBefore = new MaskedParagraphPropertiesManipulator(manipulator, __aspxRichEdit.ParagraphPropertyDescriptor.pageBreakBefore);
            this.rightIndent = new MaskedParagraphPropertiesManipulator(manipulator, __aspxRichEdit.ParagraphPropertyDescriptor.rightIndent);
            this.spacingAfter = new MaskedParagraphPropertiesManipulator(manipulator, __aspxRichEdit.ParagraphPropertyDescriptor.spacingAfter);
            this.spacingBefore = new MaskedParagraphPropertiesManipulator(manipulator, __aspxRichEdit.ParagraphPropertyDescriptor.spacingBefore);
            this.suppressHyphenation = new MaskedParagraphPropertiesManipulator(manipulator, __aspxRichEdit.ParagraphPropertyDescriptor.suppressHyphenation);
            this.suppressLineNumbers = new MaskedParagraphPropertiesManipulator(manipulator, __aspxRichEdit.ParagraphPropertyDescriptor.suppressLineNumbers);
            this.widowOrphanControl = new MaskedParagraphPropertiesManipulator(manipulator, __aspxRichEdit.ParagraphPropertyDescriptor.widowOrphanControl);
            this.divId = new MaskedParagraphPropertiesManipulator(manipulator, __aspxRichEdit.ParagraphPropertyDescriptor.divId);
            this.keepWithNext = new MaskedParagraphPropertiesManipulator(manipulator, __aspxRichEdit.ParagraphPropertyDescriptor.keepWithNext);
            this.useValue = new ParagraphPropertiesUseValueManipulator(manipulator);
            this.manipulator = manipulator;
        }
        ParagraphPropertiesManipulator.prototype.changeAllProperties = function (subDocument, paragraphIndex, properties, style, tabs, numberingListIndex, listLevelIndex) {
            var paragraph = subDocument.paragraphs[paragraphIndex];
            paragraph.setParagraphProperties(properties);
            paragraph.paragraphStyle = style;
            paragraph.tabs = tabs.clone();
            paragraph.numberingListIndex = numberingListIndex;
            paragraph.listLevelIndex = listLevelIndex;
            paragraph.onParagraphPropertiesChanged();
            this.manipulator.dispatcher.notifyParagraphPropertiesChanged(paragraphIndex, properties, style, tabs, numberingListIndex, listLevelIndex, subDocument);
        };
        return ParagraphPropertiesManipulator;
    }());
    __aspxRichEdit.ParagraphPropertiesManipulator = ParagraphPropertiesManipulator;
    var ParagraphPropertiesUseValueManipulator = (function () {
        function ParagraphPropertiesUseValueManipulator(manipulator) {
            this.manipulator = manipulator;
        }
        ParagraphPropertiesUseValueManipulator.prototype.setValue = function (subDocument, interval, newValue) {
            var oldState = new __aspxRichEdit.HistoryItemIntervalState();
            if (!__aspxRichEdit.ControlOptions.isEnabled(subDocument.documentModel.options.paragraphFormatting))
                return oldState;
            var newState = new __aspxRichEdit.HistoryItemIntervalState();
            var paragraphs = subDocument.getParagraphsByInterval(interval);
            for (var i = 0, paragraph; paragraph = paragraphs[i]; i++) {
                var properties = paragraph.maskedParagraphProperties.clone();
                oldState.register(new __aspxRichEdit.HistoryItemIntervalStateObject(new __aspxRichEdit.FixedInterval(paragraph.startLogPosition.value, paragraph.length), properties.useValue));
                newState.register(new __aspxRichEdit.HistoryItemIntervalStateObject(new __aspxRichEdit.FixedInterval(paragraph.startLogPosition.value, paragraph.length), newValue));
                properties.useValue = newValue;
                paragraph.setParagraphProperties(properties);
                paragraph.onParagraphPropertiesChanged();
            }
            this.manipulator.dispatcher.notifyParagraphPropertyChanged(__aspxRichEdit.JSONParagraphFormattingProperty.UseValue, newState, subDocument);
            return oldState;
        };
        ParagraphPropertiesUseValueManipulator.prototype.restoreValue = function (subDocument, state) {
            if (!__aspxRichEdit.ControlOptions.isEnabled(subDocument.documentModel.options.paragraphFormatting))
                return;
            for (var stateValue, i = 0; stateValue = state.objects[i]; i++) {
                var paragraphs = subDocument.getParagraphsByInterval(stateValue.interval);
                for (var i = 0, paragraph; paragraph = paragraphs[i]; i++) {
                    var properties = paragraph.maskedParagraphProperties.clone();
                    properties.useValue = stateValue.value;
                    paragraph.setParagraphProperties(properties);
                    paragraph.onParagraphPropertiesChanged();
                }
            }
            this.manipulator.dispatcher.notifyParagraphPropertyChanged(__aspxRichEdit.JSONParagraphFormattingProperty.UseValue, state, subDocument);
        };
        return ParagraphPropertiesUseValueManipulator;
    }());
    var MaskedParagraphPropertiesManipulator = (function () {
        function MaskedParagraphPropertiesManipulator(manipulator, descriptor) {
            this.manipulator = manipulator;
            this.descriptor = descriptor;
        }
        MaskedParagraphPropertiesManipulator.prototype.setValue = function (subDocument, interval, newValue, newUse) {
            var oldState = new __aspxRichEdit.HistoryItemIntervalState();
            if (!__aspxRichEdit.ControlOptions.isEnabled(subDocument.documentModel.options.paragraphFormatting))
                return oldState;
            var newState = new __aspxRichEdit.HistoryItemIntervalState();
            var paragraphs = subDocument.getParagraphsByInterval(interval);
            for (var i = 0, paragraph; paragraph = paragraphs[i]; i++) {
                var currentInterval = paragraph.interval;
                var properties = paragraph.maskedParagraphProperties.clone();
                oldState.register(new __aspxRichEdit.HistoryItemIntervalUseStateObject(currentInterval, this.descriptor.getProp(properties), properties.getUseValue(this.descriptor.maskValue())));
                newState.register(new __aspxRichEdit.HistoryItemIntervalUseStateObject(currentInterval, newValue, newUse));
                this.descriptor.setProp(properties, newValue);
                properties.setUseValue(this.descriptor.maskValue(), newUse);
                paragraph.setParagraphProperties(properties);
                if (paragraph.hasParagraphMergedProperies() && newUse) {
                    var mergedProperties = paragraph.getParagraphMergedProperies().clone();
                    this.descriptor.setProp(mergedProperties, newValue);
                    paragraph.setParagraphMergedProperies(mergedProperties);
                }
                else
                    paragraph.onParagraphPropertiesChanged();
            }
            this.manipulator.dispatcher.notifyParagraphPropertyChanged(this.descriptor.getJSONProperty(), newState, subDocument);
            return oldState;
        };
        MaskedParagraphPropertiesManipulator.prototype.restoreValue = function (subDocument, state) {
            if (!__aspxRichEdit.ControlOptions.isEnabled(subDocument.documentModel.options.paragraphFormatting))
                return;
            if (state.isEmpty())
                return;
            for (var i = 0, stateItem; stateItem = state.objects[i]; i++) {
                var paragraphs = subDocument.getParagraphsByInterval(stateItem.interval);
                for (var j = 0, paragraph; paragraph = paragraphs[j]; j++) {
                    var properties = paragraph.maskedParagraphProperties.clone();
                    this.descriptor.setProp(properties, stateItem.value);
                    properties.setUseValue(this.descriptor.maskValue(), stateItem.use);
                    paragraph.setParagraphProperties(properties);
                    if (paragraph.hasParagraphMergedProperies()) {
                        var mergedProperties = paragraph.getParagraphMergedProperies().clone();
                        this.descriptor.setProp(mergedProperties, stateItem.value);
                        paragraph.setParagraphMergedProperies(mergedProperties);
                    }
                    else
                        paragraph.onParagraphPropertiesChanged();
                }
            }
            this.manipulator.dispatcher.notifyParagraphPropertyChanged(this.descriptor.getJSONProperty(), state, subDocument);
        };
        return MaskedParagraphPropertiesManipulator;
    }());
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HtmlImport;
    (function (HtmlImport) {
        var PasteHtmlHelper = (function () {
            function PasteHtmlHelper(control, htmlData, subDocument, position) {
                this.pastedListsIndices = {};
                this.fieldsMap = {};
                this.tableInfo = [];
                this.historyRuns = [];
                this.imagesToLoad = [];
                this.control = control;
                this.options = subDocument.documentModel.options;
                this.subDocument = subDocument;
                this.defaultMaskedParProps = this.subDocument.documentModel.defaultParagraphProperties.clone();
                this.defaultMaskedParProps.useValue = 0;
                this.defaultMaskedCharProps = subDocument.documentModel.defaultCharacterProperties.clone();
                this.defaultMaskedCharProps.useValue = 0;
                this.characterStyle = control.inputPosition.getCharacterStyle();
                this.position = position;
                this.inputPositionMaskedCharProps = __aspxRichEdit.ControlOptions.isEnabled(this.options.characterFormatting) ?
                    control.inputPosition.getMaskedCharacterProperties().clone() :
                    this.defaultMaskedCharProps.clone();
                this.tableInfo = __aspxRichEdit.ControlOptions.isEnabled(this.options.tables) ? htmlData.tablesInfo : [];
                if (!PasteHtmlHelper.runConverterMap) {
                    PasteHtmlHelper.runConverterMap = {};
                    PasteHtmlHelper.runConverterMap[__aspxRichEdit.RunType.TextRun] = this.convertTextRun;
                    PasteHtmlHelper.runConverterMap[__aspxRichEdit.RunType.InlinePictureRun] = this.convertInlinePictureRun;
                    PasteHtmlHelper.runConverterMap[__aspxRichEdit.RunType.ParagraphRun] = this.convertParagraphRun;
                    PasteHtmlHelper.runConverterMap[__aspxRichEdit.RunType.FieldCodeStartRun] = this.convertFieldCodeStartRun;
                    PasteHtmlHelper.runConverterMap[__aspxRichEdit.RunType.FieldCodeEndRun] = this.convertFieldCodeEndRun;
                    PasteHtmlHelper.runConverterMap[__aspxRichEdit.RunType.FieldResultEndRun] = this.convertFieldResultEndRun;
                }
                for (var _i = 0, _a = htmlData.runsInfo; _i < _a.length; _i++) {
                    var runInfo = _a[_i];
                    this.position += PasteHtmlHelper.runConverterMap[runInfo.runType].call(this, runInfo);
                }
            }
            PasteHtmlHelper.prototype.convertTextRun = function (run) {
                var maskedCharProps = __aspxRichEdit.ControlOptions.isEnabled(this.options.characterFormatting) ?
                    run.maskedCharacterProperties :
                    this.defaultMaskedCharProps.clone();
                var text = run.text;
                if (!__aspxRichEdit.ControlOptions.isEnabled(this.options.tabSymbol))
                    text = text.replace(/\t/gi, " ");
                if (this.options.tabMarker !== __aspxRichEdit.RichUtils.specialCharacters.TabMark)
                    text = text.replace(/\t/gi, this.options.tabMarker);
                this.historyRuns.push(new __aspxRichEdit.HistoryRun(__aspxRichEdit.RunType.TextRun, this.characterStyle, this.position, maskedCharProps, text));
                return text.length;
            };
            PasteHtmlHelper.prototype.convertInlinePictureRun = function (run) {
                if (!__aspxRichEdit.ControlOptions.isEnabled(this.options.inlinePictures))
                    return 0;
                var guid = "";
                var isNeedLoading = !!run.sourceUrl;
                if (isNeedLoading) {
                    guid = REWebUtils.CreateGuid();
                    this.imagesToLoad.push(new __aspxRichEdit.ImagesInfo(guid, this.position, run.sourceUrl, run.scale.width, run.scale.height));
                }
                this.historyRuns.push(new __aspxRichEdit.HistoryRunInlinePicture(this.characterStyle, this.position, this.inputPositionMaskedCharProps, run.id, run.originalSize.width, run.originalSize.height, run.scale.width, run.scale.height, run.lockAspectRatio, !isNeedLoading, guid, run.publicAPIID));
                return run.runLength;
            };
            PasteHtmlHelper.prototype.convertParagraphRun = function (run) {
                if (!__aspxRichEdit.ControlOptions.isEnabled(this.options.paragraphs))
                    return 0;
                var _a = this.insertListInfo(run), numberingListIndex = _a.numberingListIndex, listLevelIndex = _a.listLevelIndex;
                var maskedParagraphProperties = __aspxRichEdit.ControlOptions.isEnabled(this.options.paragraphFormatting) ?
                    run.maskedParagraphProperties :
                    this.defaultMaskedParProps.clone();
                this.historyRuns.push(new __aspxRichEdit.HistoryRunParagraph(run.runType, this.characterStyle, this.position, this.inputPositionMaskedCharProps, __aspxRichEdit.RichUtils.specialCharacters.ParagraphMark, undefined, maskedParagraphProperties, true, numberingListIndex, listLevelIndex, new __aspxRichEdit.TabProperties()));
                return 1;
            };
            PasteHtmlHelper.prototype.convertFieldCodeStartRun = function (run) {
                var hyperlinkInfo = run.hyperlinkInfo;
                if (!__aspxRichEdit.ControlOptions.isEnabled(this.options.fields) || (hyperlinkInfo && !__aspxRichEdit.ControlOptions.isEnabled(this.options.hyperlinks)))
                    return 0;
                var historyRun = new __aspxRichEdit.HistoryRunFieldCodeStart(run.runType, this.characterStyle, this.position, this.inputPositionMaskedCharProps, __aspxRichEdit.RichUtils.specialCharacters.FieldCodeStartRun, false, this.position, undefined, undefined, hyperlinkInfo);
                this.fieldsMap[run.id] = historyRun;
                this.historyRuns.push(historyRun);
                return 1;
            };
            PasteHtmlHelper.prototype.convertFieldCodeEndRun = function (run) {
                var histRun = this.fieldsMap[run.id];
                if (!histRun)
                    return 0;
                this.historyRuns.push(new __aspxRichEdit.HistoryRunFieldCodeEnd(run.runType, this.characterStyle, this.position, this.inputPositionMaskedCharProps, __aspxRichEdit.RichUtils.specialCharacters.FieldCodeEndRun));
                histRun.separatorPosition = this.position;
                return 1;
            };
            PasteHtmlHelper.prototype.convertFieldResultEndRun = function (run) {
                var histRun = this.fieldsMap[run.id];
                if (!histRun)
                    return 0;
                this.historyRuns.push(new __aspxRichEdit.HistoryRunFieldResultEnd(run.runType, this.characterStyle, this.position, this.inputPositionMaskedCharProps, __aspxRichEdit.RichUtils.specialCharacters.FieldResultEndRun));
                histRun.endPosition = this.position + 1;
                delete this.fieldsMap[run.id];
                return 1;
            };
            PasteHtmlHelper.prototype.insertListInfo = function (run) {
                var model = this.subDocument.documentModel;
                var modelManipulator = this.control.modelManipulator;
                var listInfo = run.listInfo;
                if (!listInfo ||
                    !__aspxRichEdit.ControlOptions.isEnabled(this.options.numberingBulleted) &&
                        !__aspxRichEdit.ControlOptions.isEnabled(this.options.numberingMultiLevel) &&
                        !__aspxRichEdit.ControlOptions.isEnabled(this.options.numberingSimple))
                    return { numberingListIndex: -1, listLevelIndex: -1 };
                if (!__aspxRichEdit.ControlOptions.isEnabled(this.options.numberingBulleted) && listInfo.listType === __aspxRichEdit.NumberingType.Bullet) {
                    var isNumberingSimpleEnabled = __aspxRichEdit.ControlOptions.isEnabled(this.options.numberingSimple);
                    listInfo.listType = isNumberingSimpleEnabled ? __aspxRichEdit.NumberingType.Simple : __aspxRichEdit.NumberingType.MultiLevel;
                    listInfo.listFormat = __aspxRichEdit.NumberingFormat.Decimal;
                    listInfo.displayFormatString = "";
                }
                if (!__aspxRichEdit.ControlOptions.isEnabled(this.options.numberingSimple) && listInfo.listType === __aspxRichEdit.NumberingType.Simple) {
                    listInfo.listType = __aspxRichEdit.ControlOptions.isEnabled(this.options.numberingBulleted) ? __aspxRichEdit.NumberingType.Bullet : __aspxRichEdit.NumberingType.MultiLevel;
                    listInfo.displayFormatString = "";
                }
                if (!__aspxRichEdit.ControlOptions.isEnabled(this.options.numberingMultiLevel) && listInfo.listType === __aspxRichEdit.NumberingType.MultiLevel) {
                    listInfo.listType = __aspxRichEdit.ControlOptions.isEnabled(this.options.numberingBulleted) ? __aspxRichEdit.NumberingType.Bullet : __aspxRichEdit.NumberingType.Simple;
                    listInfo.displayFormatString = "";
                }
                var targetListIndex = this.pastedListsIndices[listInfo.listIndex];
                if (targetListIndex === undefined) {
                    var abstractNumberingList = new __aspxRichEdit.AbstractNumberingList(model);
                    var template = __aspxRichEdit.ListUtils.elementBy(model.abstractNumberingListTemplates, function (tmpl) { return tmpl.getListType() === listInfo.listType; });
                    if (template) {
                        abstractNumberingList.copyFrom(template);
                        var numberingList = new __aspxRichEdit.NumberingList(model, modelManipulator.numberingListManipulator.addAbstractNumberingList(abstractNumberingList));
                        targetListIndex = modelManipulator.numberingListManipulator.addNumberingList(numberingList);
                        this.pastedListsIndices[listInfo.listIndex] = targetListIndex;
                    }
                }
                if (targetListIndex === undefined)
                    return { numberingListIndex: -1, listLevelIndex: -1 };
                var numberingListIndex = targetListIndex;
                var listLevelIndex = listInfo.listLevel;
                var listLevel = model.numberingLists[numberingListIndex].levels[listLevelIndex];
                modelManipulator.listLevelPropertiesManipulator.format.setValue(model, false, targetListIndex, listLevelIndex, listInfo.listFormat);
                if (listInfo.displayFormatString) {
                    modelManipulator.listLevelPropertiesManipulator.displayFormatString.setValue(model, false, targetListIndex, listLevelIndex, listInfo.displayFormatString);
                }
                if (listInfo.maskedCharacterProperties) {
                    listLevel.setCharacterProperties(listInfo.maskedCharacterProperties);
                    listLevel.onCharacterPropertiesChanged();
                }
                return { numberingListIndex: numberingListIndex, listLevelIndex: listLevelIndex };
            };
            return PasteHtmlHelper;
        }());
        HtmlImport.PasteHtmlHelper = PasteHtmlHelper;
    })(HtmlImport = __aspxRichEdit.HtmlImport || (__aspxRichEdit.HtmlImport = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SectionPropertiesManipulator = (function () {
        function SectionPropertiesManipulator(manipulator) {
            this.landscape = new SectionPropertiesLandscapeManipulator(manipulator, __aspxRichEdit.SectionPropertyDescriptor.landscape);
            this.marginBottom = new SectionPropertiesManipulatorBase(manipulator, __aspxRichEdit.SectionPropertyDescriptor.marginBottom);
            this.marginLeft = new SectionPropertiesManipulatorBase(manipulator, __aspxRichEdit.SectionPropertyDescriptor.marginLeft);
            this.marginRight = new SectionPropertiesManipulatorBase(manipulator, __aspxRichEdit.SectionPropertyDescriptor.marginRight);
            this.marginTop = new SectionPropertiesManipulatorBase(manipulator, __aspxRichEdit.SectionPropertyDescriptor.marginTop);
            this.columnCount = new SectionPropertiesManipulatorBase(manipulator, __aspxRichEdit.SectionPropertyDescriptor.columnCount);
            this.columnsInfo = new SectionPropertiesManipulatorBase(manipulator, __aspxRichEdit.SectionPropertyDescriptor.columnsInfo);
            this.equalWidthColumns = new SectionPropertiesManipulatorBase(manipulator, __aspxRichEdit.SectionPropertyDescriptor.equalWidthColumns);
            this.pageHeight = new SectionPropertiesManipulatorBase(manipulator, __aspxRichEdit.SectionPropertyDescriptor.pageHeight);
            this.pageWidth = new SectionPropertiesManipulatorBase(manipulator, __aspxRichEdit.SectionPropertyDescriptor.pageWidth);
            this.space = new SectionPropertiesManipulatorBase(manipulator, __aspxRichEdit.SectionPropertyDescriptor.space);
            this.startType = new SectionPropertiesManipulatorBase(manipulator, __aspxRichEdit.SectionPropertyDescriptor.startType);
            this.differentFirstPage = new SectionPropertiesManipulatorBase(manipulator, __aspxRichEdit.SectionPropertyDescriptor.differentFirstPage);
            this.headerOffset = new SectionPropertiesManipulatorBase(manipulator, __aspxRichEdit.SectionPropertyDescriptor.headerOffset);
            this.footerOffset = new SectionPropertiesManipulatorBase(manipulator, __aspxRichEdit.SectionPropertyDescriptor.footerOffset);
        }
        return SectionPropertiesManipulator;
    }());
    __aspxRichEdit.SectionPropertiesManipulator = SectionPropertiesManipulator;
    var SectionPropertiesManipulatorBase = (function () {
        function SectionPropertiesManipulatorBase(manipulator, descriptor) {
            this.manipulator = manipulator;
            this.descriptor = descriptor;
        }
        SectionPropertiesManipulatorBase.prototype.setValue = function (subDocument, interval, newValue) {
            var oldState = new __aspxRichEdit.HistoryItemState();
            if (!__aspxRichEdit.ControlOptions.isEnabled(subDocument.documentModel.options.sections))
                return oldState;
            var newState = new __aspxRichEdit.HistoryItemState();
            var endPosition = Math.max(interval.start, interval.end - 1);
            var sections = subDocument.documentModel.sections;
            var startSectionIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(sections, function (section) { return section.startLogPosition.value; }, interval.start);
            var endSectionIndex = interval.length ?
                __aspxRichEdit.Utils.normedInterpolationIndexOf(sections, function (section) { return section.startLogPosition.value; }, endPosition) :
                startSectionIndex;
            for (var i = startSectionIndex; i <= endSectionIndex; i++) {
                var section = sections[i];
                oldState.register(new __aspxRichEdit.HistoryItemSectionStateObject(i, this.descriptor.getProp(section.sectionProperties)));
                newState.register(new __aspxRichEdit.HistoryItemSectionStateObject(i, newValue));
                this.setPropertyValue(section.sectionProperties, newValue);
            }
            this.manipulator.dispatcher.notifySectionFormattingChanged(sections[startSectionIndex], startSectionIndex, this.descriptor.getJSONProperty(), newState);
            return oldState;
        };
        SectionPropertiesManipulatorBase.prototype.restoreValue = function (subDocument, state) {
            if (!__aspxRichEdit.ControlOptions.isEnabled(subDocument.documentModel.options.sections))
                return;
            if (state.isEmpty())
                return;
            var sections = subDocument.documentModel.sections;
            for (var i = 0, stateObject; stateObject = state.objects[i]; i++) {
                var section = sections[stateObject.sectionIndex];
                this.setPropertyValue(section.sectionProperties, stateObject.value);
            }
            var sectionIndex = state.objects[0].sectionIndex;
            this.manipulator.dispatcher.notifySectionFormattingChanged(sections[sectionIndex], sectionIndex, this.descriptor.getJSONProperty(), state);
        };
        SectionPropertiesManipulatorBase.prototype.setPropertyValue = function (properties, value) {
            this.descriptor.setProp(properties, value);
        };
        return SectionPropertiesManipulatorBase;
    }());
    var SectionPropertiesLandscapeManipulator = (function (_super) {
        __extends(SectionPropertiesLandscapeManipulator, _super);
        function SectionPropertiesLandscapeManipulator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SectionPropertiesLandscapeManipulator.prototype.setPropertyValue = function (properties, value) {
            var _a;
            if (properties.landscape !== value) {
                properties.landscape = value;
                _a = [properties.pageHeight, properties.pageWidth], properties.pageWidth = _a[0], properties.pageHeight = _a[1];
            }
        };
        return SectionPropertiesLandscapeManipulator;
    }(SectionPropertiesManipulatorBase));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var StylesManipulator = (function () {
        function StylesManipulator(manipulator) {
            this.manipulator = manipulator;
        }
        StylesManipulator.prototype.setLinkStyle = function (characterStyle, paragraphStyle) {
            this.manipulator.model.stylesManager.addCharacterStyle(characterStyle);
            this.manipulator.model.stylesManager.registerLink(characterStyle, paragraphStyle);
            this.manipulator.dispatcher.notifyCreateStyleLink(paragraphStyle.styleName);
        };
        StylesManipulator.prototype.restoreLinkStyle = function (characterStyle, paragraphStyle) {
            this.manipulator.model.stylesManager.removeLastStyle();
            this.manipulator.model.stylesManager.unregisterLink(characterStyle, paragraphStyle);
            this.manipulator.dispatcher.notifyDeleteStyleLink(paragraphStyle.styleName);
        };
        StylesManipulator.prototype.setCharacterStyle = function (subDocument, interval, style, restoreHyperlinks) {
            var oldState = new __aspxRichEdit.HistoryItemIntervalState();
            if (!__aspxRichEdit.ControlOptions.isEnabled(subDocument.documentModel.options.characterStyle))
                return oldState;
            var newState = new __aspxRichEdit.HistoryItemIntervalState();
            var iterator = subDocument.getRunIterator(interval);
            while (iterator.moveNext()) {
                var applyingStyle = style;
                var currentInterval = iterator.currentInterval();
                if (restoreHyperlinks) {
                    var field = __aspxRichEdit.FieldContextMenuHelper.showHyperlinkItems(subDocument.fields, currentInterval);
                    if (field && field.isHyperlinkField()) {
                        if (iterator.currentRun.characterStyle.styleName === __aspxRichEdit.CharacterStyle.hyperlinkStyleName)
                            continue;
                        else
                            applyingStyle = subDocument.documentModel.getCharacterStyleByName(__aspxRichEdit.CharacterStyle.hyperlinkStyleName);
                    }
                }
                oldState.register(new __aspxRichEdit.HistoryItemIntervalStyleStateObject(currentInterval, iterator.currentRun.characterStyle));
                newState.register(new __aspxRichEdit.HistoryItemIntervalStyleStateObject(currentInterval, applyingStyle));
                iterator.currentRun.characterStyle = applyingStyle;
                iterator.currentRun.onCharacterPropertiesChanged();
            }
            if (!newState.isEmpty())
                this.manipulator.dispatcher.notifyCharacterStyleApplied(newState, this.manipulator.model.activeSubDocument);
            return oldState;
        };
        StylesManipulator.prototype.restoreCharacterStyle = function (subDocument, state) {
            if (!__aspxRichEdit.ControlOptions.isEnabled(subDocument.documentModel.options.characterStyle))
                return;
            if (state.isEmpty())
                return;
            for (var stateValue, i = 0; stateValue = state.objects[i]; i++) {
                var iterator = subDocument.getRunIterator(stateValue.interval);
                while (iterator.moveNext()) {
                    iterator.currentRun.characterStyle = stateValue.value;
                    iterator.currentRun.onCharacterPropertiesChanged();
                }
            }
            this.manipulator.dispatcher.notifyCharacterStyleApplied(state, this.manipulator.model.activeSubDocument);
        };
        StylesManipulator.prototype.setParagraphStyle = function (subDocument, interval, style) {
            var oldState = new __aspxRichEdit.HistoryItemIntervalState();
            if (!__aspxRichEdit.ControlOptions.isEnabled(subDocument.documentModel.options.paragraphStyle))
                return oldState;
            var newState = new __aspxRichEdit.HistoryItemIntervalState();
            var paragraphs = subDocument.getParagraphsByInterval(interval);
            for (var paragraph, i = 0; paragraph = paragraphs[i]; i++) {
                var paragraphInterval = new __aspxRichEdit.FixedInterval(paragraph.startLogPosition.value, paragraph.length);
                oldState.register(new __aspxRichEdit.HistoryItemIntervalStyleStateObject(paragraphInterval, paragraph.paragraphStyle));
                newState.register(new __aspxRichEdit.HistoryItemIntervalStyleStateObject(paragraphInterval, style));
                paragraph.paragraphStyle = style;
                paragraph.onParagraphPropertiesChanged();
                this.resetMergedCharacterProperties(subDocument, paragraphInterval);
            }
            this.manipulator.dispatcher.notifyParagraphStyleApplied(newState, this.manipulator.model.activeSubDocument);
            return oldState;
        };
        StylesManipulator.prototype.restoreParagraphStyle = function (subDocument, state) {
            if (!__aspxRichEdit.ControlOptions.isEnabled(subDocument.documentModel.options.paragraphStyle))
                return;
            for (var stateValue, i = 0; stateValue = state.objects[i]; i++) {
                var paragraphs = subDocument.getParagraphsByInterval(stateValue.interval);
                for (var j = 0, paragraph; paragraph = paragraphs[j]; j++) {
                    paragraph.paragraphStyle = stateValue.value;
                    paragraph.onParagraphPropertiesChanged();
                    this.resetMergedCharacterProperties(subDocument, new __aspxRichEdit.FixedInterval(paragraph.startLogPosition.value, paragraph.length));
                }
            }
            this.manipulator.dispatcher.notifyParagraphStyleApplied(state, this.manipulator.model.activeSubDocument);
        };
        StylesManipulator.prototype.resetMergedCharacterProperties = function (subDocument, interval) {
            var runs = subDocument.getRunsByInterval(interval);
            for (var i = 0, run; run = runs[i]; i++)
                run.onCharacterPropertiesChanged();
        };
        StylesManipulator.applyCharacterStyle = function (history, modelManipulator, subDocument, interval, style, restoreHyperlinks) {
            history.addAndRedo(new __aspxRichEdit.FontUseValueHistoryItem(modelManipulator, subDocument, interval, 0));
            history.addAndRedo(new __aspxRichEdit.ApplyCharacterStyleHistoryItem(modelManipulator, subDocument, interval, style, restoreHyperlinks));
        };
        return StylesManipulator;
    }());
    __aspxRichEdit.StylesManipulator = StylesManipulator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableCellPropertiesManipulator = (function () {
        function TableCellPropertiesManipulator(manipulator) {
            this.cellMargins = new TableCellComplexPropertyWithUseManipulator(manipulator, __aspxRichEdit.JSONServerTableCellProperty.CellMargins, [__aspxRichEdit.TableCellPropertiesMask.UseTopMargin, __aspxRichEdit.TableCellPropertiesMask.UseRightMargin, __aspxRichEdit.TableCellPropertiesMask.UseBottomMargin, __aspxRichEdit.TableCellPropertiesMask.UseLeftMargin], function (prop, vals) { prop.cellMargins.top = vals[0]; prop.cellMargins.right = vals[1]; prop.cellMargins.bottom = vals[2]; prop.cellMargins.left = vals[3]; }, function (prop) { return [prop.cellMargins.top, prop.cellMargins.right, prop.cellMargins.bottom, prop.cellMargins.left]; });
            this.borders = new TableCellComplexPropertyWithUseManipulator(manipulator, __aspxRichEdit.JSONServerTableCellProperty.Borders, [__aspxRichEdit.TableCellPropertiesMask.UseTopBorder, __aspxRichEdit.TableCellPropertiesMask.UseRightBorder, __aspxRichEdit.TableCellPropertiesMask.UseBottomBorder, __aspxRichEdit.TableCellPropertiesMask.UseLeftBorder, __aspxRichEdit.TableCellPropertiesMask.UseTopLeftDiagonalBorder, __aspxRichEdit.TableCellPropertiesMask.UseTopRightDiagonalBorder], function (prop, vals) {
                prop.borders.topBorder = vals[0] || prop.borders.topBorder;
                prop.borders.rightBorder = vals[1] || prop.borders.rightBorder;
                prop.borders.bottomBorder = vals[2] || prop.borders.bottomBorder;
                prop.borders.leftBorder = vals[3] || prop.borders.leftBorder;
                prop.borders.topLeftDiagonalBorder = vals[4] || prop.borders.topLeftDiagonalBorder;
                prop.borders.topRightDiagonalBorder = vals[5] || prop.borders.topRightDiagonalBorder;
            }, function (prop) { return [prop.borders.topBorder, prop.borders.rightBorder, prop.borders.bottomBorder, prop.borders.leftBorder, prop.borders.topLeftDiagonalBorder, prop.borders.topRightDiagonalBorder]; });
            this.preferredWidth = new TableCellPropertiesManipulatorCore(manipulator, __aspxRichEdit.JSONServerTableCellProperty.PreferredWidth, function (cell, val) { return cell.preferredWidth = val; }, function (cell) { return cell.preferredWidth; });
            this.hideCellMark = new TableCellPropertiesWithUseManipulatorCore(manipulator, __aspxRichEdit.JSONServerTableCellProperty.HideCellMark, __aspxRichEdit.TableCellPropertiesMask.UseHideCellMark, function (prop, val) { return prop.hideCellMark = val; }, function (prop) { return prop.hideCellMark; });
            this.noWrap = new TableCellPropertiesWithUseManipulatorCore(manipulator, __aspxRichEdit.JSONServerTableCellProperty.NoWrap, __aspxRichEdit.TableCellPropertiesMask.UseNoWrap, function (prop, val) { return prop.noWrap = val; }, function (prop) { return prop.noWrap; });
            this.fitText = new TableCellPropertiesWithUseManipulatorCore(manipulator, __aspxRichEdit.JSONServerTableCellProperty.FitText, __aspxRichEdit.TableCellPropertiesMask.UseFitText, function (prop, val) { return prop.fitText = val; }, function (prop) { return prop.fitText; });
            this.textDirection = new TableCellPropertiesWithUseManipulatorCore(manipulator, __aspxRichEdit.JSONServerTableCellProperty.TextDirection, __aspxRichEdit.TableCellPropertiesMask.UseTextDirection, function (prop, val) { return prop.textDirection = val; }, function (prop) { return prop.textDirection; });
            this.verticalAlignment = new TableCellPropertiesWithUseManipulatorCore(manipulator, __aspxRichEdit.JSONServerTableCellProperty.VerticalAlignment, __aspxRichEdit.TableCellPropertiesMask.UseVerticalAlignment, function (prop, val) { return prop.verticalAlignment = val; }, function (prop) { return prop.verticalAlignment; });
            this.shadingInfo = new TableCellPropertiesWithUseManipulatorCore(manipulator, __aspxRichEdit.JSONServerTableCellProperty.BackgroundColor, __aspxRichEdit.TableCellPropertiesMask.UseShadingInfoIndex, function (prop, val) { return prop.shadingInfo = val; }, function (prop) { return prop.shadingInfo; });
            this.columnSpan = new TableCellPropertyManipulator(manipulator, __aspxRichEdit.JSONServerTableCellProperty.ColumnSpan, function (cell, val) { return cell.columnSpan = val; }, function (cell) { return cell.columnSpan; });
            this.verticalMerging = new TableCellPropertyManipulator(manipulator, __aspxRichEdit.JSONServerTableCellProperty.VerticalMerging, function (cell, val) { return cell.verticalMerging = val; }, function (cell) { return cell.verticalMerging; });
        }
        return TableCellPropertiesManipulator;
    }());
    __aspxRichEdit.TableCellPropertiesManipulator = TableCellPropertiesManipulator;
    var TableCellPropertiesManipulatorCore = (function () {
        function TableCellPropertiesManipulatorCore(manipulator, jsonTableCellProperty, setProperty, getProperty) {
            this.manipulator = manipulator;
            this.jsonTableCellProperty = jsonTableCellProperty;
            this.setProperty = setProperty;
            this.getProperty = getProperty;
        }
        TableCellPropertiesManipulatorCore.prototype.setValue = function (subDocument, tableIndex, rowIndex, cellIndex, newValue) {
            var table = subDocument.tables[tableIndex];
            var tableStartPosition = table.getStartPosition();
            var newState = new __aspxRichEdit.HistoryItemState();
            var oldState = new __aspxRichEdit.HistoryItemState();
            var row = table.rows[rowIndex];
            var cell = row.cells[cellIndex];
            oldState.register(new __aspxRichEdit.HistoryItemTableCellStateObject(tableStartPosition, table.nestedLevel, tableIndex, rowIndex, cellIndex, this.getProperty(cell)));
            this.setProperty(cell, newValue);
            newState.register(new __aspxRichEdit.HistoryItemTableCellStateObject(tableStartPosition, table.nestedLevel, tableIndex, rowIndex, cellIndex, newValue));
            this.manipulator.dispatcher.notifyTableCellPropertyChanged(subDocument, this.jsonTableCellProperty, newState);
            return oldState;
        };
        TableCellPropertiesManipulatorCore.prototype.restoreValue = function (subDocument, state) {
            var table = subDocument.tables[state.lastObject.tableIndex];
            var row = table.rows[state.lastObject.rowIndex];
            var cell = row.cells[state.lastObject.cellIndex];
            this.setProperty(cell, state.lastObject.value);
            this.manipulator.dispatcher.notifyTableCellPropertyChanged(subDocument, this.jsonTableCellProperty, state);
        };
        return TableCellPropertiesManipulatorCore;
    }());
    var TableCellPropertyManipulator = (function () {
        function TableCellPropertyManipulator(manipulator, jsonTableCellProperty, setProperty, getProperty) {
            this.manipulator = manipulator;
            this.jsonTableCellProperty = jsonTableCellProperty;
            this.setProperty = setProperty;
            this.getProperty = getProperty;
        }
        TableCellPropertyManipulator.prototype.setValue = function (subDocument, tableIndex, rowIndex, cellIndex, newValue) {
            var table = subDocument.tables[tableIndex];
            var tableStartPosition = table.getStartPosition();
            var newState = new __aspxRichEdit.HistoryItemState();
            var oldState = new __aspxRichEdit.HistoryItemState();
            var cell = table.rows[rowIndex].cells[cellIndex];
            oldState.register(new __aspxRichEdit.HistoryItemTableCellStateObject(tableStartPosition, table.nestedLevel, tableIndex, rowIndex, cellIndex, this.getProperty(cell)));
            this.setProperty(cell, newValue);
            newState.register(new __aspxRichEdit.HistoryItemTableCellStateObject(tableStartPosition, table.nestedLevel, tableIndex, rowIndex, cellIndex, newValue));
            this.manipulator.dispatcher.notifyTableCellPropertyChanged(subDocument, this.jsonTableCellProperty, newState);
            return oldState;
        };
        TableCellPropertyManipulator.prototype.restoreValue = function (subDocument, state) {
            var table = subDocument.tables[state.lastObject.tableIndex];
            var cell = table.rows[state.lastObject.rowIndex].cells[state.lastObject.cellIndex];
            this.setProperty(cell, state.lastObject.value);
            this.manipulator.dispatcher.notifyTableCellPropertyChanged(subDocument, this.jsonTableCellProperty, state);
        };
        return TableCellPropertyManipulator;
    }());
    var TableCellComplexPropertyWithUseManipulator = (function () {
        function TableCellComplexPropertyWithUseManipulator(manipulator, jsonTableCellProperty, masks, setProperties, getProperties) {
            this.manipulator = manipulator;
            this.jsonTableCellProperty = jsonTableCellProperty;
            this.setProperties = setProperties;
            this.getProperties = getProperties;
            this.masks = masks;
        }
        TableCellComplexPropertyWithUseManipulator.prototype.setValue = function (subDocument, tableIndex, rowIndex, cellIndex, newValues, newUses) {
            var table = subDocument.tables[tableIndex];
            var tableStartPosition = table.getStartPosition();
            var newState = new __aspxRichEdit.HistoryItemState();
            var oldState = new __aspxRichEdit.HistoryItemState();
            var cell = table.rows[rowIndex].cells[cellIndex];
            var properties = cell.properties;
            var oldUseValues = [];
            for (var _i = 0, _a = this.masks; _i < _a.length; _i++) {
                var mask = _a[_i];
                oldUseValues.push(properties.getUseValue(mask));
            }
            oldState.register(new __aspxRichEdit.HistoryItemTableCellComplexUseStateObject(tableStartPosition, table.nestedLevel, tableIndex, rowIndex, cellIndex, this.getProperties(properties), oldUseValues));
            this.setValuesCore(subDocument.documentModel.cache, cell, newValues, newUses);
            newState.register(new __aspxRichEdit.HistoryItemTableCellComplexUseStateObject(tableStartPosition, table.nestedLevel, tableIndex, rowIndex, cellIndex, newValues, newUses));
            this.manipulator.dispatcher.notifyTableCellPropertyChanged(subDocument, this.jsonTableCellProperty, newState);
            return oldState;
        };
        TableCellComplexPropertyWithUseManipulator.prototype.restoreValue = function (subDocument, state) {
            var table = subDocument.tables[state.lastObject.tableIndex];
            var cell = table.rows[state.lastObject.rowIndex].cells[state.lastObject.cellIndex];
            this.setValuesCore(subDocument.documentModel.cache, cell, state.lastObject.value, state.lastObject.uses);
            this.manipulator.dispatcher.notifyTableCellPropertyChanged(subDocument, this.jsonTableCellProperty, state);
        };
        TableCellComplexPropertyWithUseManipulator.prototype.setValuesCore = function (cache, cell, newValues, newUses) {
            var properties = cell.properties.clone();
            this.setProperties(properties, newValues);
            for (var i = this.masks.length - 1; i >= 0; i--) {
                if (newUses[i] !== undefined)
                    properties.setUseValue(this.masks[i], newUses[i]);
            }
            cell.properties = cache.tableCellPropertiesCache.getItem(properties);
        };
        return TableCellComplexPropertyWithUseManipulator;
    }());
    var TableCellPropertiesWithUseManipulatorCore = (function () {
        function TableCellPropertiesWithUseManipulatorCore(manipulator, jsonTableCellProperty, tableCellPropertiesMask, setProperty, getProperty) {
            this.manipulator = manipulator;
            this.tableCellPropertiesMask = tableCellPropertiesMask;
            this.jsonTableCellProperty = jsonTableCellProperty;
            this.setProperty = setProperty;
            this.getProperty = getProperty;
        }
        TableCellPropertiesWithUseManipulatorCore.prototype.setValue = function (subDocument, tableIndex, rowIndex, cellIndex, newValue, newUse) {
            var table = subDocument.tables[tableIndex];
            var tableStartPosition = table.getStartPosition();
            var newState = new __aspxRichEdit.HistoryItemState();
            var oldState = new __aspxRichEdit.HistoryItemState();
            var cell = table.rows[rowIndex].cells[cellIndex];
            var properties = cell.properties;
            oldState.register(new __aspxRichEdit.HistoryItemTableCellUseStateObject(tableStartPosition, table.nestedLevel, tableIndex, rowIndex, cellIndex, this.getProperty(properties), properties.getUseValue(this.tableCellPropertiesMask)));
            this.setValueCore(subDocument.documentModel.cache, cell, newValue, newUse);
            newState.register(new __aspxRichEdit.HistoryItemTableCellUseStateObject(tableStartPosition, table.nestedLevel, tableIndex, rowIndex, cellIndex, newValue, newUse));
            this.manipulator.dispatcher.notifyTableCellPropertyChanged(subDocument, this.jsonTableCellProperty, newState);
            return oldState;
        };
        TableCellPropertiesWithUseManipulatorCore.prototype.restoreValue = function (subDocument, state) {
            var table = subDocument.tables[state.lastObject.tableIndex];
            var cell = table.rows[state.lastObject.rowIndex].cells[state.lastObject.cellIndex];
            this.setValueCore(subDocument.documentModel.cache, cell, state.lastObject.value, state.lastObject.use);
            this.manipulator.dispatcher.notifyTableCellPropertyChanged(subDocument, this.jsonTableCellProperty, state);
        };
        TableCellPropertiesWithUseManipulatorCore.prototype.setValueCore = function (cache, cell, newValue, newUse) {
            var properties = cell.properties.clone();
            this.setProperty(properties, newValue);
            properties.setUseValue(this.tableCellPropertiesMask, newUse);
            cell.properties = cache.tableCellPropertiesCache.getItem(properties);
        };
        return TableCellPropertiesWithUseManipulatorCore;
    }());
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TablePropertiesManipulator = (function () {
        function TablePropertiesManipulator(manipulator) {
            this.cellMargins = new TableComplexPropertyWithUseManipulator(manipulator, __aspxRichEdit.JSONEnumTableProperty.CellMargins, [__aspxRichEdit.TablePropertiesMask.UseTopMargin, __aspxRichEdit.TablePropertiesMask.UseRightMargin, __aspxRichEdit.TablePropertiesMask.UseBottomMargin, __aspxRichEdit.TablePropertiesMask.UseLeftMargin], function (prop, vals) {
                prop.cellMargins.top = vals[0];
                prop.cellMargins.right = vals[1];
                prop.cellMargins.bottom = vals[2];
                prop.cellMargins.left = vals[3];
            }, function (prop) { return [prop.cellMargins.top, prop.cellMargins.right, prop.cellMargins.bottom, prop.cellMargins.left]; });
            this.cellSpacing = new TablePropertiesWithUseManipulatorCore(manipulator, __aspxRichEdit.JSONEnumTableProperty.CellSpacing, __aspxRichEdit.TablePropertiesMask.UseCellSpacing, function (prop, val) { return prop.cellSpacing = val; }, function (prop) { return prop.cellSpacing; });
            this.indent = new TablePropertiesWithUseManipulatorCore(manipulator, __aspxRichEdit.JSONEnumTableProperty.Indent, __aspxRichEdit.TablePropertiesMask.UseTableIndent, function (prop, val) { return prop.indent = val; }, function (prop) { return prop.indent; });
            this.preferredWidth = new TablePropertiesManipulatorCore(manipulator, __aspxRichEdit.JSONEnumTableProperty.PreferredWidth, function (table, val) { return table.preferredWidth = val; }, function (table) { return table.preferredWidth; });
            this.lookTypes = new TablePropertiesManipulatorCore(manipulator, __aspxRichEdit.JSONEnumTableProperty.TableLookTypes, function (table, val) { return table.lookTypes = val; }, function (table) { return table.lookTypes; });
            this.borders = new TableComplexPropertyWithUseManipulator(manipulator, __aspxRichEdit.JSONEnumTableProperty.Borders, [__aspxRichEdit.TablePropertiesMask.UseTopBorder, __aspxRichEdit.TablePropertiesMask.UseRightBorder, __aspxRichEdit.TablePropertiesMask.UseBottomBorder, __aspxRichEdit.TablePropertiesMask.UseLeftBorder, __aspxRichEdit.TablePropertiesMask.UseInsideHorizontalBorder, __aspxRichEdit.TablePropertiesMask.UseInsideVerticalBorder], function (prop, vals) {
                prop.borders.topBorder = vals[0] || prop.borders.topBorder;
                prop.borders.rightBorder = vals[1] || prop.borders.rightBorder;
                prop.borders.bottomBorder = vals[2] || prop.borders.bottomBorder;
                prop.borders.leftBorder = vals[3] || prop.borders.leftBorder;
                prop.borders.insideHorizontalBorder = vals[4] || prop.borders.insideHorizontalBorder;
                prop.borders.insideVerticalBorder = vals[5] || prop.borders.insideVerticalBorder;
            }, function (prop) { return [prop.borders.topBorder, prop.borders.rightBorder, prop.borders.bottomBorder, prop.borders.leftBorder, prop.borders.insideHorizontalBorder, prop.borders.insideVerticalBorder]; });
            this.tableStyleColumnBandSize = new TablePropertiesWithUseManipulatorCore(manipulator, __aspxRichEdit.JSONEnumTableProperty.TableStyleColBandSize, __aspxRichEdit.TablePropertiesMask.UseTableStyleColBandSize, function (prop, val) { return prop.tableStyleColumnBandSize = val; }, function (prop) { return prop.tableStyleColumnBandSize; });
            this.tableStyleRowBandSize = new TablePropertiesWithUseManipulatorCore(manipulator, __aspxRichEdit.JSONEnumTableProperty.TableStyleRowBandSize, __aspxRichEdit.TablePropertiesMask.UseTableStyleRowBandSize, function (prop, val) { return prop.tableStyleRowBandSize = val; }, function (prop) { return prop.tableStyleRowBandSize; });
            this.avoidDoubleBorders = new TablePropertiesWithUseManipulatorCore(manipulator, __aspxRichEdit.JSONEnumTableProperty.AvoidDoubleBorders, __aspxRichEdit.TablePropertiesMask.UseAvoidDoubleBorders, function (prop, val) { return prop.avoidDoubleBorders = val; }, function (prop) { return prop.avoidDoubleBorders; });
            this.layoutType = new TablePropertiesWithUseManipulatorCore(manipulator, __aspxRichEdit.JSONEnumTableProperty.LayoutType, __aspxRichEdit.TablePropertiesMask.UseTableLayout, function (prop, val) { return prop.layoutType = val; }, function (prop) { return prop.layoutType; });
            this.shadingInfo = new TablePropertiesWithUseManipulatorCore(manipulator, __aspxRichEdit.JSONEnumTableProperty.ShadingInfo, __aspxRichEdit.TablePropertiesMask.UseShadingInfoIndex, function (prop, val) { return prop.shadingInfo = val; }, function (prop) { return prop.shadingInfo; });
            this.tableRowAlignment = new TablePropertiesWithUseManipulatorCore(manipulator, __aspxRichEdit.JSONEnumTableProperty.TableRowAlignment, __aspxRichEdit.TablePropertiesMask.UseTableAlignment, function (prop, val) { return prop.tableRowAlignment = val; }, function (prop) { return prop.tableRowAlignment; });
            this.isTableOverlap = new TablePropertiesWithUseManipulatorCore(manipulator, __aspxRichEdit.JSONEnumTableProperty.IsTableOverlap, __aspxRichEdit.TablePropertiesMask.UseIsTableOverlap, function (prop, val) { return prop.isTableOverlap = val; }, function (prop) { return prop.isTableOverlap; });
        }
        return TablePropertiesManipulator;
    }());
    __aspxRichEdit.TablePropertiesManipulator = TablePropertiesManipulator;
    var TablePropertiesManipulatorCore = (function () {
        function TablePropertiesManipulatorCore(manipulator, jsonTableProperty, setProperty, getProperty) {
            this.manipulator = manipulator;
            this.jsonTableProperty = jsonTableProperty;
            this.setProperty = setProperty;
            this.getProperty = getProperty;
        }
        TablePropertiesManipulatorCore.prototype.setValue = function (subDocument, tableIndex, newValue) {
            var table = subDocument.tables[tableIndex];
            var tableStartPosition = table.getStartPosition();
            var newState = new __aspxRichEdit.HistoryItemState();
            var oldState = new __aspxRichEdit.HistoryItemState();
            oldState.register(new __aspxRichEdit.HistoryItemTableStateObject(tableStartPosition, table.nestedLevel, tableIndex, this.getProperty(table)));
            this.setProperty(table, newValue);
            newState.register(new __aspxRichEdit.HistoryItemTableStateObject(tableStartPosition, table.nestedLevel, tableIndex, newValue));
            this.manipulator.dispatcher.notifyTablePropertyChanged(subDocument, this.jsonTableProperty, newState);
            return oldState;
        };
        TablePropertiesManipulatorCore.prototype.restoreValue = function (subDocument, state) {
            var table = subDocument.tables[state.lastObject.tableIndex];
            this.setProperty(table, state.lastObject.value);
            this.manipulator.dispatcher.notifyTablePropertyChanged(subDocument, this.jsonTableProperty, state);
        };
        return TablePropertiesManipulatorCore;
    }());
    var TableComplexPropertyWithUseManipulator = (function () {
        function TableComplexPropertyWithUseManipulator(manipulator, jsonTableProperty, masks, setProperties, getProperties) {
            this.manipulator = manipulator;
            this.jsonTableProperty = jsonTableProperty;
            this.setProperties = setProperties;
            this.getProperties = getProperties;
            this.masks = masks;
        }
        TableComplexPropertyWithUseManipulator.prototype.setValue = function (subDocument, tableIndex, newValues, newUses) {
            var table = subDocument.tables[tableIndex];
            var tableStartPosition = table.getStartPosition();
            var newState = new __aspxRichEdit.HistoryItemState();
            var oldState = new __aspxRichEdit.HistoryItemState();
            var properties = table.properties;
            var oldUseValues = [];
            for (var _i = 0, _a = this.masks; _i < _a.length; _i++) {
                var mask = _a[_i];
                oldUseValues.push(properties.getUseValue(mask));
            }
            oldState.register(new __aspxRichEdit.HistoryItemTableComplexUseStateObject(tableStartPosition, table.nestedLevel, tableIndex, this.getProperties(properties), oldUseValues));
            this.setValuesCore(table, newValues, newUses);
            newState.register(new __aspxRichEdit.HistoryItemTableComplexUseStateObject(tableStartPosition, table.nestedLevel, tableIndex, newValues, newUses));
            this.manipulator.dispatcher.notifyTablePropertyChanged(subDocument, this.jsonTableProperty, newState);
            return oldState;
        };
        TableComplexPropertyWithUseManipulator.prototype.restoreValue = function (subDocument, state) {
            var table = subDocument.tables[state.lastObject.tableIndex];
            this.setValuesCore(table, state.lastObject.value, state.lastObject.uses);
            this.manipulator.dispatcher.notifyTablePropertyChanged(subDocument, this.jsonTableProperty, state);
        };
        TableComplexPropertyWithUseManipulator.prototype.setValuesCore = function (table, newValues, newUses) {
            var properties = table.properties.clone();
            this.setProperties(properties, newValues);
            for (var i = this.masks.length - 1; i >= 0; i--) {
                if (newUses[i] !== undefined)
                    properties.setUseValue(this.masks[i], newUses[i]);
            }
            table.properties = properties;
        };
        return TableComplexPropertyWithUseManipulator;
    }());
    var TablePropertiesWithUseManipulatorCore = (function () {
        function TablePropertiesWithUseManipulatorCore(manipulator, jsonTableProperty, tablePropertiesMask, setProperty, getProperty) {
            this.manipulator = manipulator;
            this.tablePropertiesMask = tablePropertiesMask;
            this.jsonTableProperty = jsonTableProperty;
            this.setProperty = setProperty;
            this.getProperty = getProperty;
        }
        TablePropertiesWithUseManipulatorCore.prototype.setValue = function (subDocument, tableIndex, newValue, newUse) {
            var table = subDocument.tables[tableIndex];
            var tableStartPosition = table.getStartPosition();
            var newState = new __aspxRichEdit.HistoryItemState();
            var oldState = new __aspxRichEdit.HistoryItemState();
            var properties = table.properties;
            oldState.register(new __aspxRichEdit.HistoryItemTableUseStateObject(tableStartPosition, table.nestedLevel, tableIndex, this.getProperty(properties), properties.getUseValue(this.tablePropertiesMask)));
            this.setValueCore(table, newValue, newUse);
            newState.register(new __aspxRichEdit.HistoryItemTableUseStateObject(tableStartPosition, table.nestedLevel, tableIndex, newValue, newUse));
            this.manipulator.dispatcher.notifyTablePropertyChanged(subDocument, this.jsonTableProperty, newState);
            return oldState;
        };
        TablePropertiesWithUseManipulatorCore.prototype.restoreValue = function (subDocument, state) {
            var table = subDocument.tables[state.lastObject.tableIndex];
            this.setValueCore(table, state.lastObject.value, state.lastObject.use);
            this.manipulator.dispatcher.notifyTablePropertyChanged(subDocument, this.jsonTableProperty, state);
        };
        TablePropertiesWithUseManipulatorCore.prototype.setValueCore = function (table, newValue, newUse) {
            var properties = table.properties.clone();
            this.setProperty(properties, newValue);
            properties.setUseValue(this.tablePropertiesMask, newUse);
            table.properties = properties;
        };
        return TablePropertiesWithUseManipulatorCore;
    }());
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableRowPropertiesManipulator = (function () {
        function TableRowPropertiesManipulator(manipulator) {
            this.cellSpacing = new TableRowPropertiesWithUseManipulatorCore(manipulator, __aspxRichEdit.JSONServerTableRowProperty.CellSpacing, __aspxRichEdit.TableRowPropertiesMask.UseCellSpacing, function (prop, val) { return prop.cellSpacing = val; }, function (prop) { return prop.cellSpacing; });
            this.cantSplit = new TableRowPropertiesWithUseManipulatorCore(manipulator, __aspxRichEdit.JSONServerTableRowProperty.CantSplit, __aspxRichEdit.TableRowPropertiesMask.UseCantSplit, function (prop, val) { return prop.cantSplit = val; }, function (prop) { return prop.cantSplit; });
            this.hideCellMark = new TableRowPropertiesWithUseManipulatorCore(manipulator, __aspxRichEdit.JSONServerTableRowProperty.HideCellMark, __aspxRichEdit.TableRowPropertiesMask.UseHideCellMark, function (prop, val) { return prop.hideCellMark = val; }, function (prop) { return prop.hideCellMark; });
            this.header = new TableRowPropertiesWithUseManipulatorCore(manipulator, __aspxRichEdit.JSONServerTableRowProperty.Header, __aspxRichEdit.TableRowPropertiesMask.UseHeader, function (prop, val) { return prop.header = val; }, function (prop) { return prop.header; });
            this.tableRowAlignment = new TableRowPropertiesWithUseManipulatorCore(manipulator, __aspxRichEdit.JSONServerTableRowProperty.TableRowAlignment, __aspxRichEdit.TableRowPropertiesMask.UseTableRowAlignment, function (prop, val) { return prop.tableRowAlignment = val; }, function (prop) { return prop.tableRowAlignment; });
            this.height = new TableRowPropertiesManipulatorCore(manipulator, __aspxRichEdit.JSONServerTableRowProperty.Height, function (row, val) { return row.height = val; }, function (prop) { return prop.height; });
            this.gridAfter = new TableRowPropertiesManipulatorCore(manipulator, __aspxRichEdit.JSONServerTableRowProperty.GridAfter, function (row, val) { return row.gridAfter = val; }, function (row) { return row.gridAfter; });
            this.gridBefore = new TableRowPropertiesManipulatorCore(manipulator, __aspxRichEdit.JSONServerTableRowProperty.GridBefore, function (row, val) { return row.gridBefore = val; }, function (row) { return row.gridBefore; });
            this.widthAfter = new TableRowPropertiesManipulatorCore(manipulator, __aspxRichEdit.JSONServerTableRowProperty.WidthAfter, function (row, val) { return row.widthAfter = val; }, function (row) { return row.widthAfter; });
            this.widthBefore = new TableRowPropertiesManipulatorCore(manipulator, __aspxRichEdit.JSONServerTableRowProperty.WidthBefore, function (row, val) { return row.widthBefore = val; }, function (row) { return row.widthBefore; });
        }
        return TableRowPropertiesManipulator;
    }());
    __aspxRichEdit.TableRowPropertiesManipulator = TableRowPropertiesManipulator;
    var TableRowPropertiesManipulatorCore = (function () {
        function TableRowPropertiesManipulatorCore(manipulator, jsonTableCellProperty, setProperty, getProperty) {
            this.manipulator = manipulator;
            this.jsonTableRowProperty = jsonTableCellProperty;
            this.setProperty = setProperty;
            this.getProperty = getProperty;
        }
        TableRowPropertiesManipulatorCore.prototype.setValue = function (subDocument, tableIndex, rowIndex, newValue) {
            var table = subDocument.tables[tableIndex];
            var tableStartPosition = table.getStartPosition();
            var newState = new __aspxRichEdit.HistoryItemState();
            var oldState = new __aspxRichEdit.HistoryItemState();
            var row = table.rows[rowIndex];
            oldState.register(new __aspxRichEdit.HistoryItemTableRowStateObject(tableStartPosition, table.nestedLevel, tableIndex, rowIndex, this.getProperty(row)));
            this.setProperty(row, newValue);
            newState.register(new __aspxRichEdit.HistoryItemTableRowStateObject(tableStartPosition, table.nestedLevel, tableIndex, rowIndex, newValue));
            this.manipulator.dispatcher.notifyTableRowPropertyChanged(subDocument, this.jsonTableRowProperty, newState);
            return oldState;
        };
        TableRowPropertiesManipulatorCore.prototype.restoreValue = function (subDocument, state) {
            var table = subDocument.tables[state.lastObject.tableIndex];
            var row = table.rows[state.lastObject.rowIndex];
            this.setProperty(row, state.lastObject.value);
            this.manipulator.dispatcher.notifyTableRowPropertyChanged(subDocument, this.jsonTableRowProperty, state);
        };
        return TableRowPropertiesManipulatorCore;
    }());
    var TableRowPropertiesWithUseManipulatorCore = (function () {
        function TableRowPropertiesWithUseManipulatorCore(manipulator, jsonTableCellProperty, tableRowPropertiesMask, setProperty, getProperty) {
            this.manipulator = manipulator;
            this.tableRowPropertiesMask = tableRowPropertiesMask;
            this.jsonTableRowProperty = jsonTableCellProperty;
            this.setProperty = setProperty;
            this.getProperty = getProperty;
        }
        TableRowPropertiesWithUseManipulatorCore.prototype.setValue = function (subDocument, tableIndex, rowIndex, newValue, newUse) {
            var table = subDocument.tables[tableIndex];
            var tableStartPosition = table.getStartPosition();
            var newState = new __aspxRichEdit.HistoryItemState();
            var oldState = new __aspxRichEdit.HistoryItemState();
            var row = table.rows[rowIndex];
            var properties = row.properties;
            oldState.register(new __aspxRichEdit.HistoryItemTableRowUseStateObject(tableStartPosition, table.nestedLevel, tableIndex, rowIndex, this.getProperty(properties), properties.getUseValue(this.tableRowPropertiesMask)));
            this.setValueCore(subDocument.documentModel.cache, row, newValue, newUse);
            newState.register(new __aspxRichEdit.HistoryItemTableRowUseStateObject(tableStartPosition, table.nestedLevel, tableIndex, rowIndex, newValue, newUse));
            this.manipulator.dispatcher.notifyTableRowPropertyChanged(subDocument, this.jsonTableRowProperty, newState);
            return oldState;
        };
        TableRowPropertiesWithUseManipulatorCore.prototype.restoreValue = function (subDocument, state) {
            var table = subDocument.tables[state.lastObject.tableIndex];
            var row = table.rows[state.lastObject.rowIndex];
            this.setValueCore(subDocument.documentModel.cache, row, state.lastObject.value, state.lastObject.use);
            this.manipulator.dispatcher.notifyTableRowPropertyChanged(subDocument, this.jsonTableRowProperty, state);
        };
        TableRowPropertiesWithUseManipulatorCore.prototype.setValueCore = function (cache, row, newValue, newUse) {
            var properties = row.properties.clone();
            this.setProperty(properties, newValue);
            properties.setUseValue(this.tableRowPropertiesMask, newUse);
            row.properties = cache.tableRowPropertiesCache.getItem(properties);
        };
        return TableRowPropertiesWithUseManipulatorCore;
    }());
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TablesManipulator = (function () {
        function TablesManipulator(manipulator) {
            this.manipulator = manipulator;
            this.cellProperties = new __aspxRichEdit.TableCellPropertiesManipulator(manipulator);
            this.tableProperties = new __aspxRichEdit.TablePropertiesManipulator(manipulator);
            this.rowProperties = new __aspxRichEdit.TableRowPropertiesManipulator(manipulator);
        }
        TablesManipulator.prototype.createTable = function (subDocument, firstParagraphIndex, rowCount, cellCount) {
            var paragraph = subDocument.paragraphs[firstParagraphIndex];
            var parentCell = __aspxRichEdit.Table.getTableCellByPosition(subDocument.tables, paragraph.startLogPosition.value);
            var newTable = new __aspxRichEdit.Table(new __aspxRichEdit.TableProperties(), subDocument.documentModel.getDefaultTableStyle());
            this.createTableStructure(subDocument, firstParagraphIndex, newTable, rowCount, cellCount);
            this.insertTableCore(newTable, subDocument.tables, subDocument.tablesByLevels, parentCell);
            this.manipulator.dispatcher.notifyTableCreated(subDocument, newTable);
            return newTable;
        };
        TablesManipulator.prototype.removeTable = function (subDocument, table) {
            var startPosition = table.getStartPosition();
            var endPosition = table.getEndPosition();
            table.destructor(subDocument.positionManager);
            this.removeTableCore(table, subDocument.tables, subDocument.tablesByLevels);
            this.manipulator.dispatcher.notifyTableRemoved(subDocument, startPosition, endPosition, table.nestedLevel);
        };
        TablesManipulator.prototype.restoreRemovedTable = function (subDocument, table, cellsRanges) {
            for (var rowIndex = 0, row = void 0; row = table.rows[rowIndex]; rowIndex++) {
                for (var cellIndex = 0, cell = void 0; cell = row.cells[cellIndex]; cellIndex++) {
                    var cellRange = cellsRanges[rowIndex][cellIndex];
                    cell.startParagraphPosition = subDocument.positionManager.registerPosition(cellRange.start);
                    cell.endParagrapPosition = subDocument.positionManager.registerPosition(cellRange.end);
                }
            }
            table.parentCell = __aspxRichEdit.Table.getTableCellByPosition(subDocument.tables, table.getStartPosition());
            this.insertTableCore(table, subDocument.tables, subDocument.tablesByLevels, table.parentCell);
            this.manipulator.dispatcher.notifyTableCreated(subDocument, table);
        };
        TablesManipulator.prototype.pasteTable = function (subDocument, patternTable, position) {
            var patternCell = __aspxRichEdit.Table.getTableCellByPosition(subDocument.tables, position);
            var newTable = new __aspxRichEdit.Table(patternTable.properties, this.manipulator.model.stylesManager.addTableStyle(patternTable.style));
            newTable.preferredWidth = patternTable.preferredWidth.clone();
            newTable.lookTypes = patternTable.lookTypes;
            for (var rowIndex = 0, patternRow = void 0; patternRow = patternTable.rows[rowIndex]; rowIndex++) {
                var newRow = new __aspxRichEdit.TableRow(newTable, subDocument.documentModel.cache.tableRowPropertiesCache.getItem(patternRow.properties.clone()));
                newRow.gridAfter = patternRow.gridAfter;
                newRow.gridBefore = patternRow.gridBefore;
                if (patternRow.tablePropertiesException)
                    newRow.tablePropertiesException = patternRow.tablePropertiesException.clone();
                newRow.widthAfter = patternRow.widthAfter.clone();
                newRow.widthBefore = patternRow.widthBefore.clone();
                newRow.height = patternRow.height.clone();
                if (patternRow.tablePropertiesException)
                    newRow.tablePropertiesException = patternRow.tablePropertiesException.clone();
                for (var cellIndex = 0, patternCell_1; patternCell_1 = patternRow.cells[cellIndex]; cellIndex++) {
                    var cellLength = patternCell_1.endParagrapPosition.value - patternCell_1.startParagraphPosition.value;
                    var newCell = new __aspxRichEdit.TableCell(newRow, subDocument.documentModel.cache.tableCellPropertiesCache.getItem(patternCell_1.properties.clone()));
                    newCell.startParagraphPosition = subDocument.positionManager.registerPosition(position);
                    position += cellLength;
                    newCell.endParagrapPosition = subDocument.positionManager.registerPosition(position);
                    newCell.columnSpan = patternCell_1.columnSpan;
                    newCell.conditionalFormatting = patternCell_1.conditionalFormatting;
                    newCell.verticalMerging = patternCell_1.verticalMerging;
                    newCell.preferredWidth = patternCell_1.preferredWidth.clone();
                    newRow.cells.push(newCell);
                }
                newTable.rows.push(newRow);
            }
            this.insertTableCore(newTable, subDocument.tables, subDocument.tablesByLevels, patternCell);
            this.manipulator.dispatcher.notifyTableCreated(subDocument, newTable);
            return newTable;
        };
        TablesManipulator.prototype.insertRow = function (subDocument, tableIndex, patternRow, targetRowIndex, cellIntervals) {
            var table = subDocument.tables[tableIndex];
            var row = new __aspxRichEdit.TableRow(table, patternRow.properties);
            if (cellIntervals.length !== patternRow.cells.length)
                throw new Error("cellIntervals.length should be equal to patternRow.cells.length");
            row.gridAfter = patternRow.gridAfter;
            row.gridBefore = patternRow.gridBefore;
            row.height = patternRow.height.clone();
            row.properties = patternRow.properties;
            row.tablePropertiesException = patternRow.tablePropertiesException;
            row.widthAfter = patternRow.widthAfter.clone();
            row.widthBefore = patternRow.widthBefore.clone();
            for (var i = 0, interval = void 0; interval = cellIntervals[i]; i++) {
                var patternCell = patternRow.cells[i];
                var cell = new __aspxRichEdit.TableCell(row, patternCell.properties);
                cell.startParagraphPosition = subDocument.positionManager.registerPosition(interval.start);
                cell.endParagrapPosition = subDocument.positionManager.registerPosition(interval.end);
                cell.columnSpan = patternCell.columnSpan;
                cell.conditionalFormatting = patternCell.conditionalFormatting;
                cell.preferredWidth = patternCell.preferredWidth.clone();
                cell.verticalMerging = patternCell.verticalMerging;
                cell.style = patternCell.style;
                row.cells.push(cell);
            }
            table.rows.splice(targetRowIndex, 0, row);
            var nextRow = table.rows[targetRowIndex + 1];
            if (nextRow) {
                subDocument.positionManager.unregisterPosition(nextRow.cells[0].startParagraphPosition);
                nextRow.cells[0].startParagraphPosition = subDocument.positionManager.registerPosition(row.getEndPosition());
            }
            this.manipulator.dispatcher.notifyTableRowInserted(subDocument, table, targetRowIndex);
        };
        TablesManipulator.prototype.removeRow = function (subDocument, tableIndex, rowIndex) {
            var table = subDocument.tables[tableIndex];
            var row = table.rows[rowIndex];
            row.destructor(subDocument.positionManager);
            var nextRow = table.rows[rowIndex + 1];
            if (nextRow) {
                var nextRowFirstCell = nextRow.cells[0];
                subDocument.positionManager.unregisterPosition(nextRowFirstCell.startParagraphPosition);
                nextRowFirstCell.startParagraphPosition = subDocument.positionManager.registerPosition(row.getStartPosition());
            }
            table.rows.splice(rowIndex, 1);
            this.manipulator.dispatcher.notifyTableRowRemoved(subDocument, table, rowIndex);
        };
        TablesManipulator.prototype.removeCell = function (subDocument, table, rowIndex, cellIndex) {
            var row = table.rows[rowIndex];
            var cell = row.cells[cellIndex];
            var nextCell = row.cells[cellIndex + 1];
            if (!nextCell && table.rows.length > rowIndex + 1)
                nextCell = table.rows[rowIndex + 1].cells[0];
            cell.destructor(subDocument.positionManager);
            if (nextCell) {
                subDocument.positionManager.unregisterPosition(nextCell.startParagraphPosition);
                nextCell.startParagraphPosition = subDocument.positionManager.registerPosition(cell.startParagraphPosition.value);
            }
            row.cells.splice(cellIndex, 1);
            this.manipulator.dispatcher.notifyTableCellRemoved(subDocument, table, rowIndex, cellIndex);
        };
        TablesManipulator.prototype.insertCell = function (subDocument, table, rowIndex, cellIndex, patternCell, length) {
            var row = table.rows[rowIndex];
            var cell = new __aspxRichEdit.TableCell(row, patternCell.properties);
            cell.columnSpan = patternCell.columnSpan;
            cell.conditionalFormatting = patternCell.conditionalFormatting;
            cell.preferredWidth = patternCell.preferredWidth.clone();
            cell.style = patternCell.style;
            cell.verticalMerging = patternCell.verticalMerging;
            var startPosition = 0;
            if (cellIndex > 0)
                startPosition = row.cells[cellIndex - 1].endParagrapPosition.value;
            else if (rowIndex > 0)
                startPosition = table.rows[rowIndex - 1].getEndPosition();
            else
                startPosition = table.getStartPosition();
            cell.startParagraphPosition = subDocument.positionManager.registerPosition(startPosition);
            cell.endParagrapPosition = subDocument.positionManager.registerPosition(startPosition + length);
            row.cells.splice(cellIndex, 0, cell);
            var nextCell = row.cells[cellIndex + 1];
            if (!nextCell && table.rows.length > rowIndex + 1)
                nextCell = table.rows[rowIndex + 1].cells[0];
            if (nextCell) {
                subDocument.positionManager.unregisterPosition(nextCell.startParagraphPosition);
                nextCell.startParagraphPosition = subDocument.positionManager.registerPosition(cell.endParagrapPosition.value);
            }
            this.manipulator.dispatcher.notifyTableCellInserted(subDocument, table, rowIndex, cellIndex);
        };
        TablesManipulator.insertParagraphToTheCellStartAndShiftContent = function (control, subDocument, cell) {
            var table = cell.parentRow.parentTable;
            __aspxRichEdit.ModelManipulator.insertParagraph(control, subDocument, new __aspxRichEdit.FixedInterval(cell.startParagraphPosition.value, 0));
            var nextTable = subDocument.tables[table.index + 1];
            var shiftingTables = [];
            while (nextTable && nextTable.nestedLevel > table.nestedLevel) {
                var nextTableStartPosition = nextTable.getStartPosition();
                if (nextTableStartPosition === cell.startParagraphPosition.value)
                    shiftingTables.push(nextTable);
                else if (nextTableStartPosition > cell.startParagraphPosition.value)
                    break;
                nextTable = subDocument.tables[nextTable.index + 1];
            }
            for (var i = shiftingTables.length - 1, shiftingTable = void 0; shiftingTable = shiftingTables[i]; i--) {
                control.history.addAndRedo(new __aspxRichEdit.ShiftTableStartPositionToTheRightHistoryItem(control.modelManipulator, subDocument, shiftingTable.index));
            }
        };
        TablesManipulator.prototype.changeTableStartPosition = function (subDocument, table, newPosition) {
            var cell = table.rows[0].cells[0];
            var oldPosition = cell.startParagraphPosition.value;
            subDocument.positionManager.unregisterPosition(cell.startParagraphPosition);
            cell.startParagraphPosition = subDocument.positionManager.registerPosition(newPosition);
            this.manipulator.dispatcher.notifyTableStartPositionShifted(subDocument, table, oldPosition, newPosition);
        };
        TablesManipulator.prototype.shiftTableStartPositionToTheRight = function (subDocument, table) {
            this.changeTableStartPosition(subDocument, table, table.rows[0].cells[0].startParagraphPosition.value + 1);
        };
        TablesManipulator.prototype.restoreShiftedTableStartPositionToTheRight = function (subDocument, table) {
            this.changeTableStartPosition(subDocument, table, table.rows[0].cells[0].startParagraphPosition.value - 1);
        };
        TablesManipulator.prototype.splitTableCellHorizontally = function (subDocument, table, rowIndex, cellIndex, rightDirection, copyProperties) {
            var row = table.rows[rowIndex];
            if (rightDirection)
                this.splitTableCellToTheRightCore(subDocument, row, cellIndex, copyProperties);
            else
                this.splitTableCellToTheLeftCore(subDocument, row, cellIndex, copyProperties);
            this.manipulator.dispatcher.notifyTableCellSplittedHorizontally(subDocument, table, rowIndex, rightDirection ? cellIndex : (cellIndex + 1), rightDirection);
        };
        TablesManipulator.prototype.restoreSplittedCellHorizontally = function (subDocument, table, rowIndex, cellIndex, rightDirection) {
            var row = table.rows[rowIndex];
            var targetCell = row.cells[cellIndex];
            var removingCell = rightDirection ? row.cells[cellIndex + 1] : row.cells[cellIndex - 1];
            if (rightDirection) {
                subDocument.positionManager.unregisterPosition(targetCell.endParagrapPosition);
                targetCell.endParagrapPosition = subDocument.positionManager.registerPosition(removingCell.endParagrapPosition.value);
                removingCell.destructor(subDocument.positionManager);
                row.cells.splice(cellIndex + 1, 1);
            }
            else {
                subDocument.positionManager.unregisterPosition(targetCell.startParagraphPosition);
                targetCell.startParagraphPosition = subDocument.positionManager.registerPosition(removingCell.startParagraphPosition.value);
                removingCell.destructor(subDocument.positionManager);
                row.cells.splice(cellIndex - 1, 1);
            }
            this.manipulator.dispatcher.notifyTableCellMergedHorizontally(subDocument, table, rowIndex, rightDirection ? cellIndex : (cellIndex - 1), rightDirection);
        };
        TablesManipulator.prototype.splitTableCellToTheLeftCore = function (subDocument, row, splittingCellIndex, copyProperties) {
            if (splittingCellIndex < 0)
                throw new Error("splittingCellIndex should be > 0");
            var splittingCell = row.cells[splittingCellIndex];
            var movingParagraph = subDocument.getParagraphByPosition(splittingCell.startParagraphPosition.value);
            var newTableCell = new __aspxRichEdit.TableCell(row, copyProperties ?
                splittingCell.properties : subDocument.documentModel.cache.tableCellPropertiesCache.getItem(new __aspxRichEdit.TableCellProperties()));
            newTableCell.preferredWidth = splittingCell.preferredWidth.clone();
            row.cells.splice(splittingCellIndex, 0, newTableCell);
            newTableCell.startParagraphPosition = subDocument.positionManager.registerPosition(movingParagraph.startLogPosition.value);
            newTableCell.endParagrapPosition = subDocument.positionManager.registerPosition(movingParagraph.getEndPosition());
            subDocument.positionManager.unregisterPosition(splittingCell.startParagraphPosition);
            splittingCell.startParagraphPosition = subDocument.positionManager.registerPosition(movingParagraph.getEndPosition());
        };
        TablesManipulator.prototype.splitTableCellToTheRightCore = function (subDocument, row, splittingCellIndex, copyProperties) {
            if (splittingCellIndex < 0)
                throw new Error("splittingCellIndex should be > 0");
            var splittingCell = row.cells[splittingCellIndex];
            var movingParagraph = subDocument.getParagraphByPosition(splittingCell.endParagrapPosition.value - 1);
            var newTableCell = new __aspxRichEdit.TableCell(row, copyProperties ?
                splittingCell.properties : subDocument.documentModel.cache.tableCellPropertiesCache.getItem(new __aspxRichEdit.TableCellProperties()));
            newTableCell.preferredWidth = splittingCell.preferredWidth.clone();
            row.cells.splice(splittingCellIndex + 1, 0, newTableCell);
            newTableCell.startParagraphPosition = subDocument.positionManager.registerPosition(movingParagraph.startLogPosition.value);
            newTableCell.endParagrapPosition = subDocument.positionManager.registerPosition(movingParagraph.getEndPosition());
            subDocument.positionManager.unregisterPosition(splittingCell.endParagrapPosition);
            splittingCell.endParagrapPosition = subDocument.positionManager.registerPosition(movingParagraph.startLogPosition.value);
        };
        TablesManipulator.prototype.setTableStyle = function (subDocument, tableIndex, style) {
            var table = subDocument.tables[tableIndex];
            table.style = style;
            TablesManipulator.resetParagraphCharacterMergedProperties(subDocument, tableIndex);
            this.manipulator.dispatcher.notifyTableStyleChanged(subDocument, table, style);
        };
        TablesManipulator.removeTableWithContent = function (control, subDocument, table) {
            this.removeNestedTablesByParentTable(control, subDocument, table);
            control.history.addAndRedo(new __aspxRichEdit.RemoveTableHistoryItem(control.modelManipulator, subDocument, table.index));
            control.history.addAndRedo(new __aspxRichEdit.RemoveIntervalHistoryItem(control.modelManipulator, subDocument, __aspxRichEdit.FixedInterval.fromPositions(table.getStartPosition(), table.getEndPosition()), false));
        };
        TablesManipulator.removeTableCellWithContent = function (control, subDocument, table, rowIndex, cellIndex) {
            var cell = table.rows[rowIndex].cells[cellIndex];
            this.removeNestedTablesByParentCell(control, subDocument, cell);
            control.history.addAndRedo(new __aspxRichEdit.RemoveTableCellHistoryItem(control.modelManipulator, subDocument, table.index, rowIndex, cellIndex));
            control.history.addAndRedo(new __aspxRichEdit.RemoveIntervalHistoryItem(control.modelManipulator, subDocument, cell.interval, false));
        };
        TablesManipulator.removeTableRowWithContent = function (control, subDocument, table, rowIndex) {
            var row = table.rows[rowIndex];
            this.removeNestedTables(control, subDocument, row);
            this.updateVerticalMergingState(control, subDocument, table, rowIndex);
            control.history.addAndRedo(new __aspxRichEdit.RemoveTableRowHistoryItem(control.modelManipulator, subDocument, table.index, rowIndex));
            control.history.addAndRedo(new __aspxRichEdit.RemoveIntervalHistoryItem(control.modelManipulator, subDocument, __aspxRichEdit.FixedInterval.fromPositions(row.getStartPosition(), row.getEndPosition()), false));
        };
        TablesManipulator.updateVerticalMergingState = function (control, subDocument, table, rowIndex) {
            var row = table.rows[rowIndex];
            for (var cellIndex = row.cells.length - 1, cell = void 0; cell = row.cells[cellIndex]; cellIndex--) {
                if (cell.verticalMerging !== __aspxRichEdit.TableCellMergingState.None) {
                    var columnIndex = __aspxRichEdit.TableCellUtils.getStartColumnIndex(cell);
                    var nextRow = table.rows[rowIndex + 1];
                    var nextRowCellIndex = nextRow ? __aspxRichEdit.TableCellUtils.getCellIndexByColumnIndex(nextRow, columnIndex) : -1;
                    var nextRowCell = nextRow ? nextRow.cells[nextRowCellIndex] : null;
                    if (cell.verticalMerging == __aspxRichEdit.TableCellMergingState.Restart) {
                        if (nextRowCell) {
                            var afterNextRow = table.rows[rowIndex + 2];
                            var afterNextRowCell = afterNextRow ? afterNextRow.cells[__aspxRichEdit.TableCellUtils.getCellIndexByEndColumnIndex(afterNextRow, columnIndex)] : null;
                            if (afterNextRowCell && afterNextRowCell.verticalMerging === __aspxRichEdit.TableCellMergingState.Continue)
                                control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(control.modelManipulator, subDocument, table.index, rowIndex + 1, nextRowCellIndex, __aspxRichEdit.TableCellMergingState.Restart));
                            else
                                control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(control.modelManipulator, subDocument, table.index, rowIndex + 1, nextRowCellIndex, __aspxRichEdit.TableCellMergingState.None));
                        }
                    }
                    else if (cell.verticalMerging == __aspxRichEdit.TableCellMergingState.Continue && rowIndex > 0) {
                        var prevRow = table.rows[rowIndex - 1];
                        var prevRowCellIndex = __aspxRichEdit.TableCellUtils.getCellIndexByColumnIndex(prevRow, columnIndex);
                        var prevRowCell = prevRow.cells[prevRowCellIndex];
                        if (prevRowCell && prevRowCell.verticalMerging === __aspxRichEdit.TableCellMergingState.Restart) {
                            if (!nextRowCell || nextRowCell.verticalMerging !== __aspxRichEdit.TableCellMergingState.Continue)
                                control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(control.modelManipulator, subDocument, table.index, rowIndex - 1, prevRowCellIndex, __aspxRichEdit.TableCellMergingState.None));
                        }
                    }
                }
            }
        };
        TablesManipulator.removeNestedTables = function (control, subDocument, row) {
            var nextNestedTable = subDocument.tables[row.parentTable.index + 1];
            var nestedTables = [];
            while (nextNestedTable && nextNestedTable.nestedLevel > row.parentTable.nestedLevel) {
                if (this.isNestedTableInRow(nextNestedTable, row))
                    nestedTables.push(nextNestedTable);
                nextNestedTable = subDocument.tables[nextNestedTable.index + 1];
            }
            for (var i = nestedTables.length - 1, nestedTable = void 0; nestedTable = nestedTables[i]; i--)
                control.history.addAndRedo(new __aspxRichEdit.RemoveTableHistoryItem(control.modelManipulator, subDocument, nestedTable.index));
        };
        TablesManipulator.isNestedTableInRow = function (table, parentRow) {
            return table.parentCell && (table.parentCell.parentRow === parentRow || this.isNestedTableInRow(table.parentCell.parentRow.parentTable, parentRow));
        };
        TablesManipulator.removeNestedTablesByParentTable = function (control, subDocument, parentTable) {
            var nextNestedTable = subDocument.tables[parentTable.index + 1];
            var nestedTables = [];
            while (nextNestedTable && nextNestedTable.nestedLevel > parentTable.nestedLevel) {
                if (this.isNestedTableInTable(nextNestedTable, parentTable))
                    nestedTables.push(nextNestedTable);
                nextNestedTable = subDocument.tables[nextNestedTable.index + 1];
            }
            for (var i = nestedTables.length - 1, nestedTable = void 0; nestedTable = nestedTables[i]; i--)
                control.history.addAndRedo(new __aspxRichEdit.RemoveTableHistoryItem(control.modelManipulator, subDocument, nestedTable.index));
        };
        TablesManipulator.removeNestedTablesByParentCell = function (control, subDocument, parentCell) {
            var nextNestedTable = subDocument.tables[parentCell.parentRow.parentTable.index + 1];
            var nestedTables = [];
            while (nextNestedTable && nextNestedTable.nestedLevel > parentCell.parentRow.parentTable.nestedLevel) {
                if (this.isNestedTableInCell(nextNestedTable, parentCell))
                    nestedTables.push(nextNestedTable);
                nextNestedTable = subDocument.tables[nextNestedTable.index + 1];
            }
            for (var i = nestedTables.length - 1, nestedTable = void 0; nestedTable = nestedTables[i]; i--)
                control.history.addAndRedo(new __aspxRichEdit.RemoveTableHistoryItem(control.modelManipulator, subDocument, nestedTable.index));
        };
        TablesManipulator.isNestedTableInCell = function (table, parentCell) {
            return table.parentCell && (table.parentCell === parentCell || this.isNestedTableInCell(table.parentCell.parentRow.parentTable, parentCell));
        };
        TablesManipulator.isNestedTableInTable = function (table, parentTable) {
            return table.parentCell && (table.parentCell.parentRow.parentTable === parentTable || this.isNestedTableInTable(table.parentCell.parentRow.parentTable, parentTable));
        };
        TablesManipulator.normalizeVerticalSpans = function (control, subDocument, table) {
            var rowCount = table.rows.length;
            if (rowCount === 1) {
                var row = table.rows[0];
                for (var cellIndex = 0, cell = void 0; cell = row.cells[cellIndex]; cellIndex++) {
                    if (cell.verticalMerging !== __aspxRichEdit.TableCellMergingState.None)
                        control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(control.modelManipulator, subDocument, table.index, 0, cellIndex, __aspxRichEdit.TableCellMergingState.None));
                }
                return;
            }
            for (var rowIndex = 0; rowIndex < rowCount; rowIndex++) {
                var row = table.rows[rowIndex];
                var columnIndex = row.gridBefore;
                for (var cellIndex = 0, cell = void 0; cell = row.cells[cellIndex]; cellIndex++) {
                    switch (cell.verticalMerging) {
                        case __aspxRichEdit.TableCellMergingState.Restart:
                            if (rowIndex == rowCount - 1)
                                control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, __aspxRichEdit.TableCellMergingState.None));
                            else {
                                var bottomCellIndex = __aspxRichEdit.TableCellUtils.getCellIndexByColumnIndex(table.rows[rowIndex + 1], columnIndex);
                                var bottomCell = table.rows[rowIndex + 1].cells[bottomCellIndex];
                                if (!bottomCell || bottomCell.verticalMerging !== __aspxRichEdit.TableCellMergingState.Continue)
                                    control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, __aspxRichEdit.TableCellMergingState.None));
                            }
                            break;
                        case __aspxRichEdit.TableCellMergingState.Continue:
                            if (rowIndex === 0)
                                control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, __aspxRichEdit.TableCellMergingState.None));
                            else {
                                var topCellIndex = __aspxRichEdit.TableCellUtils.getCellIndexByColumnIndex(table.rows[rowIndex - 1], columnIndex);
                                var topCell = table.rows[rowIndex - 1].cells[topCellIndex];
                                if (!topCell || topCell.verticalMerging === __aspxRichEdit.TableCellMergingState.None) {
                                    if (rowIndex == rowCount - 1)
                                        control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, __aspxRichEdit.TableCellMergingState.None));
                                    else {
                                        var bottomCellIndex = __aspxRichEdit.TableCellUtils.getCellIndexByColumnIndex(table.rows[rowIndex + 1], columnIndex);
                                        var bottomCell = table.rows[rowIndex + 1].cells[bottomCellIndex];
                                        if (bottomCell && bottomCell.verticalMerging == __aspxRichEdit.TableCellMergingState.Continue)
                                            control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, __aspxRichEdit.TableCellMergingState.Restart));
                                        else
                                            control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(control.modelManipulator, subDocument, table.index, rowIndex, cellIndex, __aspxRichEdit.TableCellMergingState.None));
                                    }
                                }
                            }
                            break;
                    }
                    columnIndex += cell.columnSpan;
                }
            }
        };
        TablesManipulator.normalizeTableGrid = function (control, subDocument, table) {
            var maxEndColumnIndex = -1;
            for (var i = 0, row = void 0; row = table.rows[i]; i++) {
                maxEndColumnIndex = Math.max(maxEndColumnIndex, row.getTotalCellsInRowConsiderGrid() - 1);
            }
            for (var i = 0, row = void 0; row = table.rows[i]; i++) {
                var currentEndColumnIndex = row.getTotalCellsInRowConsiderGrid() - 1;
                var gridAfterDelta = maxEndColumnIndex - currentEndColumnIndex;
                if (gridAfterDelta != 0)
                    control.history.addAndRedo(new __aspxRichEdit.TableRowGridAfterHistoryItem(control.modelManipulator, subDocument, table.index, i, row.gridAfter + gridAfterDelta));
            }
        };
        TablesManipulator.normalizeCellColumnSpans = function (control, subDocument, table, canNormalizeWidthBeforeAndWidthAfter) {
            this.normalizeRowsGridBefore(table, canNormalizeWidthBeforeAndWidthAfter, function (t, ri, val) { return control.history.addAndRedo(new __aspxRichEdit.TableRowGridBeforeHistoryItem(control.modelManipulator, subDocument, t.index, ri, val)); }, function (t, ri, val) { return control.history.addAndRedo(new __aspxRichEdit.TableRowGridAfterHistoryItem(control.modelManipulator, subDocument, t.index, ri, val)); }, function (t, ri, val) { return control.history.addAndRedo(new __aspxRichEdit.TableRowWidthBeforeHistoryItem(control.modelManipulator, subDocument, t.index, ri, val)); }, function (t, ri, val) { return control.history.addAndRedo(new __aspxRichEdit.TableRowWidthAfterHistoryItem(control.modelManipulator, subDocument, t.index, ri, val)); });
            var intervals = __aspxRichEdit.LayoutFormatter.Table.ColumnWidthEngine.Calculator.getIntervals(table);
            for (var i = table.rows.length - 1; i >= 0; i--) {
                this.normalizeTableRow(table, i, intervals.slice(0), function (t, ri, val) { return control.history.addAndRedo(new __aspxRichEdit.TableRowGridBeforeHistoryItem(control.modelManipulator, subDocument, t.index, ri, val)); }, function (t, ri, val) { return control.history.addAndRedo(new __aspxRichEdit.TableRowGridAfterHistoryItem(control.modelManipulator, subDocument, t.index, ri, val)); }, function (t, ri, ci, val) { return control.history.addAndRedo(new __aspxRichEdit.TableCellColumnSpanHistoryItem(control.modelManipulator, subDocument, t.index, ri, ci, val)); });
            }
        };
        TablesManipulator.normalizeCellColumnSpansWithoutHistory = function (table, canNormalizeWidthBeforeAndWidthAfter) {
            this.normalizeRowsGridBefore(table, canNormalizeWidthBeforeAndWidthAfter, function (t, ri, val) { return t.rows[ri].gridBefore = val; }, function (t, ri, val) { return t.rows[ri].gridAfter = val; }, function (t, ri, val) { return t.rows[ri].widthBefore = val; }, function (t, ri, val) { return t.rows[ri].widthAfter = val; });
            var intervals = __aspxRichEdit.LayoutFormatter.Table.ColumnWidthEngine.Calculator.getIntervals(table);
            for (var i = table.rows.length - 1; i >= 0; i--) {
                this.normalizeTableRow(table, i, intervals.slice(0), function (t, ri, val) { return t.rows[ri].gridBefore = val; }, function (t, ri, val) { return t.rows[ri].gridAfter = val; }, function (t, ri, ci, val) { return t.rows[ri].cells[ci].columnSpan = val; });
            }
        };
        TablesManipulator.normalizeTableRow = function (table, rowIndex, intervals, setGridBefore, setGridAfter, setColumnSpan) {
            var row = table.rows[rowIndex];
            var span = this.calculateNewSpan(row.gridBefore, intervals);
            if (row.gridBefore != span)
                setGridBefore(table, rowIndex, span);
            for (var i = 0, cell = void 0; cell = row.cells[i]; i++) {
                span = this.calculateNewSpan(cell.columnSpan, intervals);
                if (cell.columnSpan !== span)
                    setColumnSpan(table, rowIndex, i, span);
            }
            span = this.calculateNewSpan(row.gridAfter, intervals);
            if (row.gridAfter !== span)
                setGridAfter(table, rowIndex, span);
        };
        TablesManipulator.calculateNewSpan = function (oldSpan, intervals) {
            var result = 0;
            var totalSum = 0;
            while (totalSum < oldSpan) {
                totalSum += intervals[0].colSpan;
                result++;
                intervals.splice(0, 1);
            }
            return result;
        };
        TablesManipulator.normalizeRowsGridBefore = function (table, canNormalizeWidthBeforeAndWidthAfter, setGridBefore, setGridAfter, setWidthBefore, setWidthAfter) {
            var minGridBefore = table.rows[0].gridBefore;
            var minGridAfter = table.rows[0].gridAfter;
            for (var i = 1, row = void 0; row = table.rows[i]; i++) {
                minGridBefore = Math.min(minGridBefore, row.gridBefore);
                minGridAfter = Math.min(minGridAfter, row.gridAfter);
            }
            if (minGridBefore == 0 && minGridAfter == 0)
                return;
            for (var i = 0, row = void 0; row = table.rows[i]; i++) {
                if (minGridBefore !== 0)
                    setGridBefore(table, i, row.gridBefore - minGridBefore);
                if (row.gridBefore === 0 && (row.widthBefore.type != __aspxRichEdit.TableWidthUnitType.Nil || row.widthBefore.value != 0) && canNormalizeWidthBeforeAndWidthAfter)
                    setWidthBefore(table, i, __aspxRichEdit.TableWidthUnit.createDefault());
                if (minGridAfter != 0)
                    setGridAfter(table, i, row.gridAfter - minGridAfter);
                if (row.gridAfter == 0 && (row.widthAfter.type != __aspxRichEdit.TableWidthUnitType.Nil || row.widthAfter.value != 0) && canNormalizeWidthBeforeAndWidthAfter)
                    setWidthAfter(table, i, __aspxRichEdit.TableWidthUnit.createDefault());
            }
        };
        TablesManipulator.normalizeTableCellWidth = function (control, subDocument, table) {
            var maxWidth = 5000;
            for (var i = 0, row = void 0; row = table.rows[i]; i++) {
                var totalWidth = 0;
                var tableCellPreferredWidths = [];
                for (var j = 0, cell = void 0; cell = row.cells[j]; j++) {
                    var tableCellPreferredWidth = cell.preferredWidth;
                    tableCellPreferredWidths.push(tableCellPreferredWidth);
                    if (tableCellPreferredWidth.type === __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent)
                        totalWidth += tableCellPreferredWidth.value;
                    else {
                        totalWidth = 0;
                        break;
                    }
                }
                if (totalWidth <= maxWidth)
                    continue;
                for (var j = 0; j < row.cells.length; j++) {
                    var newValue = tableCellPreferredWidths[j].value * maxWidth / totalWidth;
                    var newWidth = tableCellPreferredWidths[j].clone();
                    newWidth.value = newValue;
                    control.history.addAndRedo(new __aspxRichEdit.TableCellPreferredWidthHistoryItem(control.modelManipulator, subDocument, table.index, i, j, newWidth));
                }
            }
        };
        TablesManipulator.prototype.createTableStructure = function (subDocument, paragraphIndex, newTable, rowCount, cellCount) {
            var paragraph = subDocument.paragraphs[paragraphIndex];
            for (var rowIndex = 0; rowIndex < rowCount; rowIndex++) {
                var row = new __aspxRichEdit.TableRow(newTable, subDocument.documentModel.cache.tableRowPropertiesCache.getItem(new __aspxRichEdit.TableRowProperties()));
                newTable.rows.push(row);
                for (var cellIndex = 0; cellIndex < cellCount; cellIndex++) {
                    var cell = new __aspxRichEdit.TableCell(row, subDocument.documentModel.cache.tableCellPropertiesCache.getItem(new __aspxRichEdit.TableCellProperties()));
                    row.cells.push(cell);
                    cell.startParagraphPosition = subDocument.positionManager.registerPosition(paragraph.startLogPosition.value);
                    cell.endParagrapPosition = subDocument.positionManager.registerPosition(paragraph.getEndPosition());
                    paragraph = subDocument.paragraphs[++paragraphIndex];
                }
            }
        };
        TablesManipulator.fullCellWidth = function (widths, startSpan, cellSpan) {
            return __aspxRichEdit.ListUtils.accumulate(widths, 0, function (acc, w) { return acc + w; }, startSpan, startSpan + cellSpan);
        };
        TablesManipulator.initializeColumnWidthsWhenInsertTable = function (control, subDocument, table, avaliableSpace) {
            control.history.addAndRedo(new __aspxRichEdit.TablePreferredWidthHistoryItem(control.modelManipulator, subDocument, table.index, __aspxRichEdit.TableWidthUnit.create(0, __aspxRichEdit.TableWidthUnitType.Auto)));
            var widths = TablesManipulator.distributeWidthsToAllColumns(table, avaliableSpace);
            this.forEachCell(table, function (pos, cellSpan) {
                control.history.addAndRedo(new __aspxRichEdit.TableCellPreferredWidthHistoryItem(control.modelManipulator, subDocument, table.index, pos.rowIndex, pos.cellIndex, __aspxRichEdit.TableWidthUnit.create(TablesManipulator.fullCellWidth(widths, cellSpan, pos.cell.columnSpan), __aspxRichEdit.TableWidthUnitType.ModelUnits)));
            });
        };
        TablesManipulator.validateTableIndent = function (control, subDocument, table) {
            var paragraphIndex = subDocument.getParagraphIndexByPosition(table.getStartPosition());
            var paragraph = subDocument.paragraphs[paragraphIndex];
            var leftIndent = paragraph.getParagraphMergedProperies().leftIndent;
            var firstLineIndent = paragraph.getParagraphMergedProperies().firstLineIndent;
            var firstLineIndentType = paragraph.getParagraphMergedProperies().firstLineIndentType;
            if (leftIndent === 0 && firstLineIndent === 0 && firstLineIndentType === __aspxRichEdit.ParagraphFirstLineIndent.None)
                return;
            var endParagraphIndex = subDocument.getParagraphIndexByPosition(table.getEndPosition() - 1);
            for (; paragraphIndex <= endParagraphIndex; paragraphIndex++) {
                paragraph = subDocument.paragraphs[paragraphIndex];
                control.history.addAndRedo(new __aspxRichEdit.ParagraphLeftIndentHistoryItem(control.modelManipulator, subDocument, paragraph.interval, 0, true));
                control.history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentHistoryItem(control.modelManipulator, subDocument, paragraph.interval, 0, true));
                control.history.addAndRedo(new __aspxRichEdit.ParagraphFirstLineIndentTypeHistoryItem(control.modelManipulator, subDocument, paragraph.interval, __aspxRichEdit.ParagraphFirstLineIndent.None, true));
            }
        };
        TablesManipulator.tryJoinTables = function (control, subDocument, table) {
            var paragraphIndex = subDocument.getParagraphIndexByPosition(table.getStartPosition());
            if (paragraphIndex === 0)
                return;
            var previousParagraph = subDocument.paragraphs[paragraphIndex - 1];
            var previousParagraphCell = __aspxRichEdit.Table.getTableCellByPosition(subDocument.tables, previousParagraph.startLogPosition.value);
            if (!previousParagraphCell || table.nestedLevel !== previousParagraphCell.parentRow.parentTable.nestedLevel)
                return;
            this.joinTablesCore(control, [previousParagraphCell.parentRow.parentTable, table]);
        };
        TablesManipulator.joinTablesCore = function (_control, tables) {
            if (tables.length < 2)
                throw new Error("tables.length should be > 2");
        };
        TablesManipulator.forEachCell = function (table, func) {
            var pos = new __aspxRichEdit.TablePosition(table, -1, -1);
            while (pos.moveToNextRow()) {
                var cellSpan = pos.row.gridBefore;
                while (pos.moveToNextCell()) {
                    func(pos, cellSpan);
                    cellSpan += pos.cell.columnSpan;
                }
            }
        };
        TablesManipulator.distributeWidthsToAllColumns = function (table, width) {
            var count = TablesManipulator.findTotalColumnsCountInTable(table);
            var colWidth = Math.max(Math.ceil(width / count), 1);
            var result = __aspxRichEdit.ListUtils.initByValue(count - 1, colWidth);
            result.push(Math.max(1, Math.ceil(width - colWidth * (count - 1))));
            return result;
        };
        TablesManipulator.findTotalColumnsCountInTable = function (table) {
            return __aspxRichEdit.ListUtils.minMaxExtended(table.rows, function (row) { return row.getTotalCellsInRowConsiderGrid(); }).maxValue;
        };
        TablesManipulator.prototype.removeTableCore = function (table, tables, tablesByLevels) {
            var position = table.getStartPosition();
            tablesByLevels[table.nestedLevel].splice(__aspxRichEdit.Utils.binaryIndexOf(tablesByLevels[table.nestedLevel], function (t) { return t.getStartPosition() - position; }), 1);
            tables.splice(table.index, 1);
            this.advanceTablesIndices(tables, table.index, -1);
        };
        TablesManipulator.prototype.insertTableCore = function (table, tables, tablesByLevels, parentCell) {
            table.nestedLevel = parentCell ? parentCell.parentRow.parentTable.nestedLevel + 1 : 0;
            table.parentCell = parentCell;
            var position = table.getStartPosition();
            if (!tablesByLevels[table.nestedLevel])
                tablesByLevels[table.nestedLevel] = [];
            var indexInNestedLevel = __aspxRichEdit.Utils.normedInterpolationIndexOf(tablesByLevels[table.nestedLevel], function (t) { return t.getStartPosition(); }, position);
            tablesByLevels[table.nestedLevel].splice(indexInNestedLevel + 1, 0, table);
            if (!parentCell)
                table.index = Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(tables, function (t) { return t.getStartPosition(); }, position) + 1);
            else {
                var parentTable = parentCell.parentRow.parentTable;
                var index = parentTable.index + 1;
                for (var nextTable = void 0; nextTable = tables[index]; index++) {
                    if (nextTable.getStartPosition() >= position)
                        break;
                }
                table.index = index;
            }
            tables.splice(table.index, 0, table);
            this.advanceTablesIndices(tables, table.index + 1, 1);
        };
        TablesManipulator.prototype.advanceTablesIndices = function (tables, startIndex, shift) {
            for (var i = startIndex, table; table = tables[i]; i++) {
                table.index += shift;
            }
        };
        TablesManipulator.normalizeVerticalMerging = function (control, subDocument, table, rowIndex, cellIndex) {
            var row = table.rows[rowIndex];
            for (var nextCellIndex = cellIndex + 1, nextCell = void 0; nextCell = row.cells[nextCellIndex]; nextCellIndex++) {
                if (nextCell.verticalMerging === __aspxRichEdit.TableCellMergingState.None)
                    continue;
                var nextCellVerticalMerging = nextCell.verticalMerging;
                var firstCellInMergingGroupPosition = __aspxRichEdit.Table.getFirstCellPositionInVerticalMergingGroup(__aspxRichEdit.TablePosition.createAndInit(table, rowIndex, nextCellIndex).init());
                var startColumnIndex = __aspxRichEdit.TableCellUtils.getStartColumnIndex(firstCellInMergingGroupPosition.cell);
                var verticalSpanCellPositions = __aspxRichEdit.TableCellUtils.getVerticalSpanCellPositions(firstCellInMergingGroupPosition, startColumnIndex);
                control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(control.modelManipulator, subDocument, table.index, rowIndex, nextCellIndex, __aspxRichEdit.TableCellMergingState.None));
                if (nextCellVerticalMerging === __aspxRichEdit.TableCellMergingState.Restart) {
                    if (verticalSpanCellPositions.length > 2)
                        control.history.addAndRedo(__aspxRichEdit.TableCellVerticalMergingHistoryItem.fromPosition(control.modelManipulator, subDocument, verticalSpanCellPositions[1], __aspxRichEdit.TableCellMergingState.Restart));
                    else {
                        control.history.addAndRedo(__aspxRichEdit.TableCellVerticalMergingHistoryItem.fromPosition(control.modelManipulator, subDocument, verticalSpanCellPositions[0], __aspxRichEdit.TableCellMergingState.None));
                        control.history.addAndRedo(__aspxRichEdit.TableCellVerticalMergingHistoryItem.fromPosition(control.modelManipulator, subDocument, verticalSpanCellPositions[1], __aspxRichEdit.TableCellMergingState.None));
                    }
                }
                else {
                    var nextCellIndexInMergingGroup = __aspxRichEdit.TablePosition.indexOfCell(verticalSpanCellPositions, nextCell);
                    if (nextCellIndexInMergingGroup === 1)
                        control.history.addAndRedo(__aspxRichEdit.TableCellVerticalMergingHistoryItem.fromPosition(control.modelManipulator, subDocument, verticalSpanCellPositions[0], __aspxRichEdit.TableCellMergingState.None));
                    if (verticalSpanCellPositions.length - 2 === nextCellIndexInMergingGroup)
                        control.history.addAndRedo(__aspxRichEdit.TableCellVerticalMergingHistoryItem.fromPosition(control.modelManipulator, subDocument, verticalSpanCellPositions[verticalSpanCellPositions.length - 1], __aspxRichEdit.TableCellMergingState.None));
                    else if (verticalSpanCellPositions.length - 1 !== nextCellIndexInMergingGroup)
                        control.history.addAndRedo(__aspxRichEdit.TableCellVerticalMergingHistoryItem.fromPosition(control.modelManipulator, subDocument, verticalSpanCellPositions[nextCellIndexInMergingGroup + 1], __aspxRichEdit.TableCellMergingState.Restart));
                }
            }
        };
        TablesManipulator.normalizeRows = function (control, subDocument, table) {
            for (var i = table.rows.length - 1, row = void 0; row = table.rows[i]; i--) {
                if (this.areAllCellsHasVerticalMerge(row)) {
                    var height = row.height;
                    if (height.type !== __aspxRichEdit.TableHeightUnitType.Auto && i > 0) {
                        var prevRowHeight = table.rows[i - 1].height;
                        control.history.addAndRedo(new __aspxRichEdit.TableRowHeightHistoryItem(control.modelManipulator, subDocument, table.index, i - 1, __aspxRichEdit.TableHeightUnit.create(prevRowHeight.value + height.value, height.type)));
                    }
                    this.removeTableRowWithContent(control, subDocument, table, i);
                }
            }
        };
        TablesManipulator.areAllCellsHasVerticalMerge = function (row) {
            for (var i = 0, cell = void 0; cell = row.cells[i]; i++) {
                if (cell.verticalMerging !== __aspxRichEdit.TableCellMergingState.Continue)
                    return false;
            }
            return true;
        };
        TablesManipulator.mergeTwoTableCellsHorizontally = function (control, subDocument, cellPosition) {
            new __aspxRichEdit.MergeTwoTableCellsHorizontallyOperation(control, subDocument).execute(cellPosition, true);
        };
        TablesManipulator.mergeTwoTableCellsVertically = function (control, subDocument, cellPosition) {
            new __aspxRichEdit.MergeTwoTableCellsVerticallyOperation(control, subDocument).execute(cellPosition, true);
        };
        TablesManipulator.insertCellToTheRight = function (control, subDocument, table, rowIndex, cellIndex, canNormalizeTable, canNormalizeVerticalMerging, canCopyProperties) {
            if (canNormalizeTable === void 0) { canNormalizeTable = true; }
            if (canNormalizeVerticalMerging === void 0) { canNormalizeVerticalMerging = true; }
            if (canCopyProperties === void 0) { canCopyProperties = true; }
            new __aspxRichEdit.InsertTableCellToTheRightOperation(control, subDocument).execute(table, rowIndex, cellIndex, canNormalizeTable, canNormalizeVerticalMerging, canCopyProperties);
        };
        TablesManipulator.insertCellToTheLeft = function (control, subDocument, table, rowIndex, cellIndex, canNormalizeTable, canNormalizeVerticalMerging, canCopyProperties) {
            if (canNormalizeTable === void 0) { canNormalizeTable = true; }
            if (canNormalizeVerticalMerging === void 0) { canNormalizeVerticalMerging = true; }
            if (canCopyProperties === void 0) { canCopyProperties = true; }
            new __aspxRichEdit.InsertTableCellToTheLeftOperation(control, subDocument).execute(table, rowIndex, cellIndex, canNormalizeTable, canNormalizeVerticalMerging, canCopyProperties);
        };
        TablesManipulator.insertRowBelow = function (control, subDocument, table, rowIndex) {
            new __aspxRichEdit.InsertTableRowBelowOperation(control, subDocument).execute(table, rowIndex);
        };
        TablesManipulator.insertRowAbove = function (control, subDocument, table, rowIndex) {
            new __aspxRichEdit.InsertTableRowAboveOperation(control, subDocument).execute(table, rowIndex);
        };
        TablesManipulator.insertTable = function (control, subDocument, rowCount, cellCount, position, availableWidth) {
            if (rowCount < 1 || cellCount < 1)
                throw new Error("rowCount and cellCount must be greater than 0");
            control.history.beginTransaction();
            var targetParagraphIndex = subDocument.getParagraphIndexByPosition(position);
            var targetParagraph = subDocument.paragraphs[targetParagraphIndex];
            if (targetParagraph.startLogPosition.value !== position || __aspxRichEdit.Utils.binaryIndexOf(subDocument.tables, function (t) { return t.getEndPosition() - position; }) >= 0) {
                __aspxRichEdit.ModelManipulator.insertParagraph(control, subDocument, new __aspxRichEdit.FixedInterval(position, 0));
                position++;
                targetParagraphIndex++;
            }
            var newParagraphCount = rowCount * cellCount;
            for (var i = 0; i < newParagraphCount; i++)
                __aspxRichEdit.ModelManipulator.insertParagraph(control, subDocument, new __aspxRichEdit.FixedInterval(position + i, 0));
            control.history.addAndRedo(new __aspxRichEdit.CreateTableHistoryItem(control.modelManipulator, subDocument, targetParagraphIndex, rowCount, cellCount));
            var table = __aspxRichEdit.Table.getTableByPosition(subDocument.tables, position, true);
            TablesManipulator.initializeColumnWidthsWhenInsertTable(control, subDocument, table, availableWidth);
            TablesManipulator.validateTableIndent(control, subDocument, table);
            control.history.addAndRedo(new __aspxRichEdit.TableLookTypesHistoryItem(control.modelManipulator, subDocument, table.index, __aspxRichEdit.TableLookTypes.ApplyFirstRow | __aspxRichEdit.TableLookTypes.ApplyFirstColumn | __aspxRichEdit.TableLookTypes.DoNotApplyColumnBanding));
            TablesManipulator.tryJoinTables(control, subDocument, table);
            __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(control, subDocument, new __aspxRichEdit.FixedInterval(table.getStartPosition(), 0), __aspxRichEdit.UpdateInputPositionProperties.No, false);
            control.history.endTransaction();
            return table;
        };
        TablesManipulator.removeTablesOnInterval = function (control, subDocument, interval, removeTableIfItMatchesWithInterval) {
            var intervalEnd = interval.end;
            var startTableIndex = Math.max(__aspxRichEdit.Utils.normedInterpolationIndexOf(subDocument.tables, function (t) { return t.getStartPosition(); }, interval.start), 0);
            while (startTableIndex > 0 && subDocument.tables[startTableIndex].nestedLevel > 0)
                startTableIndex--;
            var tablesForRemoving = [];
            for (var tableIndex = startTableIndex, table = void 0; table = subDocument.tables[tableIndex]; tableIndex++) {
                var tableStartPosition = table.getStartPosition();
                if (intervalEnd <= tableStartPosition)
                    break;
                var tableEndPosition = table.getEndPosition();
                var tblInterval = table.interval;
                if (tableStartPosition === interval.start && tableEndPosition === intervalEnd) {
                    if (removeTableIfItMatchesWithInterval)
                        tablesForRemoving.push(table);
                }
                else if (interval.containsInterval(tblInterval))
                    tablesForRemoving.push(table);
            }
            for (var i = tablesForRemoving.length - 1; i >= 0; i--)
                control.history.addAndRedo(new __aspxRichEdit.RemoveTableHistoryItem(control.modelManipulator, subDocument, tablesForRemoving[i].index));
        };
        TablesManipulator.resetParagraphCharacterMergedProperties = function (subDocument, tableIndex) {
            var table = subDocument.tables[tableIndex];
            var tableStartPosition = table.getStartPosition();
            var tableEndPosition = table.getEndPosition();
            var modelIterator = new __aspxRichEdit.ModelIterator(subDocument, false);
            modelIterator.setPosition(tableStartPosition);
            var currPar = null;
            do {
                var run = modelIterator.run;
                if (currPar != run.paragraph) {
                    currPar = run.paragraph;
                    if (currPar.startLogPosition.value >= tableEndPosition)
                        break;
                    currPar.resetParagraphMergedProperties();
                }
                run.resetCharacterMergedProperties();
            } while (modelIterator.moveToNextRun());
        };
        return TablesManipulator;
    }());
    __aspxRichEdit.TablesManipulator = TablesManipulator;
    var TableNormalizator = (function () {
        function TableNormalizator(table, setGridBefore, setGridAfter, setWidthBefore, setWidthAfter, setCellSpan, setVerticalMerging) {
            this.setGridBefore = setGridBefore;
            this.setGridAfter = setGridAfter;
            this.setWidthBefore = setWidthBefore;
            this.setWidthAfter = setWidthAfter;
            this.setCellSpan = setCellSpan;
            this.setVerticalMerging = setVerticalMerging;
            this.table = table;
            this.tableCellGridInfos = [];
            this.tableCellInfos = [];
            __aspxRichEdit.LayoutFormatter.Table.Grid.fillGridInfo(this.table, this.tableCellGridInfos, this.tableCellInfos);
        }
        TableNormalizator.prototype.normalizeAll = function () {
            this.transformTableToSquare();
            this.normalizeAllHorizontalSpans();
            this.normalizeWidthBeforeAfter();
            this.normalizeVerticalSpans();
            return this;
        };
        TableNormalizator.prototype.transformTableToSquare = function () {
            var rows = this.table.rows;
            var logicalCells = __aspxRichEdit.ListUtils.minMaxExtended(rows, function (row) { return row.getTotalCellsInRowConsiderGrid(); }).maxValue;
            for (var rowIndex = 0, row = void 0; row = rows[rowIndex]; rowIndex++)
                if (logicalCells != row.getTotalCellsInRowConsiderGrid())
                    this.setGridAfter(this.table, rowIndex, logicalCells);
            return this;
        };
        TableNormalizator.prototype.normalizeAllHorizontalSpans = function () {
            var _this = this;
            var rowsIndexesInterval = new __aspxRichEdit.FixedInterval(0, this.tableCellGridInfos.length);
            var _loop_8 = function (gridCellIndex) {
                if (__aspxRichEdit.ListUtils.allOfOnInterval(rowsIndexesInterval, function (rowIndex) {
                    var info = _this.tableCellGridInfos[rowIndex][gridCellIndex];
                    return info ? gridCellIndex < info.getGridCellIndexEnd(_this.table) - 1 : true;
                })) {
                    __aspxRichEdit.ListUtils.foreachOnInterval(rowsIndexesInterval, function (rowIndex) {
                        var info = _this.tableCellGridInfos[rowIndex][gridCellIndex];
                        if (info) {
                            var cellIndex = info.getCellIndexAbs(rowIndex);
                            _this.setCellSpan(_this.table, rowIndex, cellIndex, _this.table.rows[rowIndex].cells[cellIndex].columnSpan - 1);
                        }
                        else {
                            var row = _this.table.rows[rowIndex];
                            if (gridCellIndex < row.gridBefore)
                                _this.setGridBefore(_this.table, rowIndex, row.gridBefore - 1);
                            else
                                _this.setGridAfter(_this.table, rowIndex, row.gridAfter - 1);
                        }
                    });
                }
            };
            for (var gridCellIndex = this.tableCellGridInfos[0].length - 2; gridCellIndex >= 0; --gridCellIndex) {
                _loop_8(gridCellIndex);
            }
            return this;
        };
        TableNormalizator.prototype.normalizeWidthBeforeAfter = function () {
            var rows = this.table.rows;
            for (var rowIndex = 0, row = void 0; row = rows[rowIndex]; rowIndex++) {
                TableNormalizator.setWidthBeforeAfter(this.table, rowIndex, row.gridBefore, row.widthBefore, this.setWidthBefore);
                TableNormalizator.setWidthBeforeAfter(this.table, rowIndex, row.gridAfter, row.widthAfter, this.setWidthAfter);
            }
        };
        TableNormalizator.prototype.normalizeVerticalSpans = function () {
            var _this = this;
            var rows = this.table.rows;
            __aspxRichEdit.ListUtils.foreach(rows, function (row, rowIndex) {
                __aspxRichEdit.ListUtils.foreach(row.cells, function (cell, cellIndex) {
                    var info = _this.tableCellInfos[rowIndex][cellIndex];
                    var mustBe = info.getNumRowsInCell() == 1 ? __aspxRichEdit.TableCellMergingState.None : (info.getStartRowIndex() == rowIndex ? __aspxRichEdit.TableCellMergingState.Restart : __aspxRichEdit.TableCellMergingState.Continue);
                    if (cell.verticalMerging != mustBe)
                        _this.setVerticalMerging(_this.table, rowIndex, cellIndex, mustBe);
                });
            });
        };
        TableNormalizator.setWidthBeforeAfter = function (table, rowIndex, gridNum, width, setWidth) {
            if (gridNum == 0 && (width.type != __aspxRichEdit.TableWidthUnitType.Nil || width.value != 0))
                setWidth(table, rowIndex, __aspxRichEdit.TableWidthUnit.createDefault());
        };
        return TableNormalizator;
    }());
    __aspxRichEdit.TableNormalizator = TableNormalizator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TabsManipulator = (function () {
        function TabsManipulator(manipulator) {
            this.manipulator = manipulator;
        }
        TabsManipulator.prototype.insertTabToParagraph = function (subDocument, interval, tabInfo) {
            var paragraphs = subDocument.getParagraphsByInterval(interval);
            var oldState = new __aspxRichEdit.HistoryItemIntervalState();
            var newState = new __aspxRichEdit.HistoryItemIntervalState();
            for (var _i = 0, paragraphs_2 = paragraphs; _i < paragraphs_2.length; _i++) {
                var paragraph = paragraphs_2[_i];
                if (this.addTab(paragraph.tabs, tabInfo.clone())) {
                    var parInterval = paragraph.interval;
                    oldState.register(new __aspxRichEdit.HistoryItemTabStateObject(parInterval, tabInfo.clone()));
                    newState.register(new __aspxRichEdit.HistoryItemTabStateObject(parInterval, tabInfo.clone()));
                }
            }
            if (newState.lastObject)
                this.manipulator.dispatcher.notifyTabInserted(subDocument, newState);
            return oldState;
        };
        TabsManipulator.prototype.deleteTabAtParagraph = function (subDocument, interval, tabInfo) {
            var paragraphs = subDocument.getParagraphsByInterval(interval);
            var oldState = new __aspxRichEdit.HistoryItemIntervalState();
            var newState = new __aspxRichEdit.HistoryItemIntervalState();
            for (var _i = 0, paragraphs_3 = paragraphs; _i < paragraphs_3.length; _i++) {
                var paragraph = paragraphs_3[_i];
                var tabs = paragraph.getTabs();
                if (__aspxRichEdit.Utils.binaryIndexOf(tabs.positions, function (t) { return t.position - tabInfo.position; }) > -1) {
                    this.deleteTab(paragraph.tabs, tabInfo);
                    var parInterval = paragraph.interval;
                    oldState.register(new __aspxRichEdit.HistoryItemTabStateObject(parInterval, tabInfo.clone()));
                    newState.register(new __aspxRichEdit.HistoryItemTabStateObject(parInterval, tabInfo.clone()));
                    if (__aspxRichEdit.Utils.binaryIndexOf(paragraph.paragraphStyle.tabs.tabsInfo, function (t) { return t.position - tabInfo.position; }) > -1) {
                        tabInfo.deleted = true;
                        this.addTab(paragraph.tabs, tabInfo.clone());
                    }
                }
            }
            this.manipulator.dispatcher.notifyTabDeleted(subDocument, newState);
            return oldState;
        };
        TabsManipulator.prototype.restoreInsertedTabToParagraph = function (subDocument, state) {
            if (state.isEmpty())
                return;
            for (var _i = 0, _a = state.objects; _i < _a.length; _i++) {
                var stateObject = _a[_i];
                var tabInfo = stateObject.value;
                var paragraphs = subDocument.getParagraphsByInterval(stateObject.interval);
                for (var _b = 0, paragraphs_4 = paragraphs; _b < paragraphs_4.length; _b++) {
                    var paragraph = paragraphs_4[_b];
                    this.deleteTab(paragraph.tabs, tabInfo);
                }
            }
            this.manipulator.dispatcher.notifyTabDeleted(subDocument, state);
        };
        TabsManipulator.prototype.restoreDeletedTabAtParagraph = function (subDocument, state) {
            if (state.isEmpty())
                return;
            for (var _i = 0, _a = state.objects; _i < _a.length; _i++) {
                var stateObject = _a[_i];
                var tabInfo = stateObject.value;
                var paragraphs = subDocument.getParagraphsByInterval(stateObject.interval);
                for (var _b = 0, paragraphs_5 = paragraphs; _b < paragraphs_5.length; _b++) {
                    var paragraph = paragraphs_5[_b];
                    this.addTab(paragraph.tabs, tabInfo.clone());
                }
            }
            this.manipulator.dispatcher.notifyTabInserted(subDocument, state);
        };
        TabsManipulator.prototype.deleteTab = function (tabProps, tabInfo) {
            var index = tabProps.indexOf(tabInfo);
            if (index < 0)
                return false;
            tabProps.deleteByIndex(index);
            return true;
        };
        TabsManipulator.prototype.addTab = function (tabProps, tabInfo) {
            var index = tabProps.indexOf(tabInfo);
            if (index >= 0 && tabInfo.equals(tabProps.tabsInfo[index]))
                return false;
            tabProps.add(tabInfo);
            return true;
        };
        return TabsManipulator;
    }());
    __aspxRichEdit.TabsManipulator = TabsManipulator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TextCaseManipulator = (function () {
        function TextCaseManipulator(manipulator) {
            this.manipulator = manipulator;
        }
        TextCaseManipulator.prototype.applyUpperCase = function (control, subDocument, layout, interval) {
            return (new UpperCaseModifier(control, subDocument, this.manipulator, layout, interval)).modify();
        };
        TextCaseManipulator.prototype.applyLowerCase = function (control, subDocument, layout, interval) {
            return (new LowerCaseModifier(control, subDocument, this.manipulator, layout, interval)).modify();
        };
        TextCaseManipulator.prototype.applyCapitalizeEachWordCase = function (control, subDocument, layout, interval) {
            return (new CapitalizeEachWordCaseModifier(control, subDocument, this.manipulator, layout, interval)).modify();
        };
        TextCaseManipulator.prototype.applyToggleCase = function (control, subDocument, layout, interval) {
            return (new ToggleCaseModifier(control, subDocument, this.manipulator, layout, interval)).modify();
        };
        TextCaseManipulator.prototype.applySentenceCase = function (control, subDocument, layout, interval) {
            return (new SentenceCaseModifier(control, subDocument, this.manipulator, layout, interval)).modify();
        };
        TextCaseManipulator.prototype.applyBufferState = function (subDocument, oldState) {
            var chunks = subDocument.chunks;
            for (var i = 0, stateValue; stateValue = oldState.objects[i]; i++) {
                var oldText = stateValue.value;
                var oldTextPosition = stateValue.interval.start;
                var chunkIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(chunks, function (c) { return c.startLogPosition.value; }, oldTextPosition);
                for (var chunk; oldText.length > 0 && (chunk = chunks[chunkIndex]); chunkIndex++) {
                    var currPosForInsertInThisChunk = oldTextPosition - chunk.startLogPosition.value;
                    var chunkTextBefore = chunk.textBuffer.substr(0, currPosForInsertInThisChunk);
                    var chunkTextAfter = chunk.textBuffer.substr(currPosForInsertInThisChunk + oldText.length);
                    var lengthInsertedText = chunk.textBuffer.length - currPosForInsertInThisChunk - chunkTextAfter.length;
                    chunk.textBuffer = [chunkTextBefore, oldText.substr(0, lengthInsertedText), chunkTextAfter].join("");
                    oldTextPosition += lengthInsertedText;
                    oldText = oldText.substr(lengthInsertedText);
                }
            }
            if (!oldState.isEmpty())
                this.manipulator.dispatcher.notifyTextBufferChanged(oldState, subDocument);
        };
        return TextCaseManipulator;
    }());
    __aspxRichEdit.TextCaseManipulator = TextCaseManipulator;
    var TextCaseModifierBase = (function () {
        function TextCaseModifierBase(control, subDocument, dispatcher, layout, interval) {
            this.control = control;
            this.subDocument = subDocument;
            this.layout = layout;
            this.interval = interval;
            this.dispatcher = dispatcher;
        }
        TextCaseModifierBase.prototype.modify = function () {
            this.newState = new __aspxRichEdit.HistoryItemIntervalState();
            this.oldState = new __aspxRichEdit.HistoryItemIntervalState();
            var sentences = __aspxRichEdit.SentenceStructureBuilder.getBuilder(this.control, this.subDocument, this.layout, this.interval, true).sentences;
            for (var sentenceIndex = 0, sentence; sentence = sentences[sentenceIndex]; sentenceIndex++)
                this.modifyCore(sentence);
            this.dispatcher.textCaseManipulator.applyBufferState(this.subDocument, this.newState);
            if (!this.newState.isEmpty())
                this.dispatcher.dispatcher.notifyTextBufferChanged(this.newState, this.subDocument);
            return this.oldState;
        };
        return TextCaseModifierBase;
    }());
    var TextCaseSimpleModifier = (function (_super) {
        __extends(TextCaseSimpleModifier, _super);
        function TextCaseSimpleModifier() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TextCaseSimpleModifier.prototype.modifyCore = function (sentence) {
            for (var wordIndex = 0, wordInfo; wordInfo = sentence.words[wordIndex]; wordIndex++) {
                for (var wordPartIndex = 0, wordPart; wordPart = wordInfo.parts[wordPartIndex]; wordPartIndex++) {
                    if (wordPart.position < this.interval.start)
                        continue;
                    if (wordPart.position >= this.interval.end)
                        return;
                    switch (wordPart.type) {
                        case __aspxRichEdit.LayoutBoxType.Text:
                            this.oldState.register(new __aspxRichEdit.HistoryItemTextBufferStateObject(wordPart.position, wordPart.text));
                            var newText = this.applyModifier(wordIndex, wordPartIndex, wordPart.text);
                            this.newState.register(new __aspxRichEdit.HistoryItemTextBufferStateObject(wordPart.position, newText));
                            break;
                    }
                }
            }
        };
        return TextCaseSimpleModifier;
    }(TextCaseModifierBase));
    var LowerCaseModifier = (function (_super) {
        __extends(LowerCaseModifier, _super);
        function LowerCaseModifier() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LowerCaseModifier.prototype.applyModifier = function (_wordIndex, _wordPartIndex, text) {
            return text.toLowerCase();
        };
        return LowerCaseModifier;
    }(TextCaseSimpleModifier));
    var UpperCaseModifier = (function (_super) {
        __extends(UpperCaseModifier, _super);
        function UpperCaseModifier() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        UpperCaseModifier.prototype.applyModifier = function (_wordIndex, _wordPartIndex, text) {
            return text.toUpperCase();
        };
        return UpperCaseModifier;
    }(TextCaseSimpleModifier));
    var CapitalizeEachWordCaseModifier = (function (_super) {
        __extends(CapitalizeEachWordCaseModifier, _super);
        function CapitalizeEachWordCaseModifier() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CapitalizeEachWordCaseModifier.prototype.applyModifier = function (_wordIndex, wordPartIndex, text) {
            return wordPartIndex == 0 ? text[0].toUpperCase() + text.substr(1).toLowerCase() : text.toLowerCase();
        };
        return CapitalizeEachWordCaseModifier;
    }(TextCaseSimpleModifier));
    var ToggleCaseModifier = (function (_super) {
        __extends(ToggleCaseModifier, _super);
        function ToggleCaseModifier() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ToggleCaseModifier.prototype.applyModifier = function (_wordIndex, _wordPartIndex, text) {
            var result = "";
            for (var i = 0; i < text.length; i++) {
                var char = text[i];
                var lowerChar = char.toLowerCase();
                result += lowerChar === char ? char.toUpperCase() : lowerChar;
            }
            return result;
        };
        return ToggleCaseModifier;
    }(TextCaseSimpleModifier));
    var SentenceCaseModifier = (function (_super) {
        __extends(SentenceCaseModifier, _super);
        function SentenceCaseModifier() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SentenceCaseModifier.prototype.applyModifier = function (wordIndex, wordPartIndex, text) {
            return wordIndex == 0 && wordPartIndex == 0 ? text[0].toUpperCase() + text.substr(1).toLowerCase() : text.toLowerCase();
        };
        return SentenceCaseModifier;
    }(TextCaseSimpleModifier));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var OnLoadingFontInfoItem = (function () {
        function OnLoadingFontInfoItem(subDocument, applyNewFontOnIntervalsAfterLoad, fontInfo) {
            this.fontInfo = fontInfo;
            this.subDocuments = [subDocument];
            this.applyNewFontOnIntervalsAfterLoad = [this.getLinkedIntervals(subDocument, applyNewFontOnIntervalsAfterLoad)];
        }
        OnLoadingFontInfoItem.prototype.addRequest = function (subDocument, applyNewFontOnIntervalsAfterLoad) {
            var intervals = this.getLinkedIntervals(subDocument, applyNewFontOnIntervalsAfterLoad);
            var index = __aspxRichEdit.ListUtils.indexOf(this.subDocuments, subDocument);
            if (index < 0) {
                this.subDocuments.push(subDocument);
                this.applyNewFontOnIntervalsAfterLoad.push(intervals);
            }
            else
                __aspxRichEdit.ListUtils.addListOnTail(this.applyNewFontOnIntervalsAfterLoad[index], intervals);
        };
        OnLoadingFontInfoItem.prototype.applyFont = function (control, dispatcher) {
            var _this = this;
            __aspxRichEdit.ListUtils.foreach(this.subDocuments, function (subDocument, index) {
                var resetInterval = null;
                var mergedFixedIntervals = __aspxRichEdit.IntervalAlgorithms.getMergedIntervals(__aspxRichEdit.ListUtils.map(_this.applyNewFontOnIntervalsAfterLoad[index], function (interval) { return interval.getFixedInterval(); }), true);
                for (var _i = 0, mergedFixedIntervals_1 = mergedFixedIntervals; _i < mergedFixedIntervals_1.length; _i++) {
                    var interval = mergedFixedIntervals_1[_i];
                    if (interval.length > 0) {
                        control.modelManipulator.characterPropertiesManipulator.fontName.setValue(subDocument, interval, _this.fontInfo, true);
                        var changed = subDocument.resetMergedFormattingCache(__aspxRichEdit.ResetFormattingCacheType.All, interval);
                        resetInterval = resetInterval ? resetInterval.expand(changed) : changed;
                    }
                }
                if (resetInterval)
                    dispatcher.notifyParagraphAndCharacterMergedPropertiesReset(subDocument, resetInterval);
            });
            this.destructor();
        };
        OnLoadingFontInfoItem.prototype.getLinkedIntervals = function (subDocument, intervals) {
            return __aspxRichEdit.ListUtils.map(intervals, function (fixedInterval) {
                return fixedInterval.getLinkedInterval(subDocument.positionManager);
            });
        };
        OnLoadingFontInfoItem.prototype.destructor = function () {
            var _this = this;
            __aspxRichEdit.ListUtils.foreach(this.subDocuments, function (subDoc, index) {
                for (var _i = 0, _a = _this.applyNewFontOnIntervalsAfterLoad[index]; _i < _a.length; _i++) {
                    var int = _a[_i];
                    int.destructor(subDoc.positionManager);
                }
            });
        };
        return OnLoadingFontInfoItem;
    }());
    var LoadingOnPasteItem = (function () {
        function LoadingOnPasteItem(subDocumentId, run, historyRun) {
            this.subDocumentId = subDocumentId;
            this.run = run;
            this.historyRun = historyRun;
        }
        return LoadingOnPasteItem;
    }());
    __aspxRichEdit.LoadingOnPasteItem = LoadingOnPasteItem;
    var TextManipulator = (function () {
        function TextManipulator(manipulator) {
            this.loadingInlinePicturesHashtable = {};
            this.loadingFontInfosHashtable = {};
            this.manipulator = manipulator;
            this.chunkSizeCorrector = new __aspxRichEdit.ChunkSizeCorrector();
        }
        TextManipulator.prototype.removeInterval = function (subDocument, interval, setPropertiesSecondParagraph) {
            var operation = new __aspxRichEdit.RemoveIntervalOperation(this.manipulator, subDocument);
            return operation.execute(interval, setPropertiesSecondParagraph, true);
        };
        TextManipulator.prototype.removeIntervalWithoutHistory = function (subDocument, interval, setPropertiesSecondParagraph) {
            var operation = new __aspxRichEdit.RemoveIntervalOperation(this.manipulator, subDocument);
            operation.execute(interval, setPropertiesSecondParagraph, false);
        };
        TextManipulator.prototype.insertText = function (subDocument, insertPositionAtStartDocument, text, maskedCharacterProperties, characterStyle, runType) {
            if (!!maskedCharacterProperties == false)
                throw new Error("In insertText need set clearly maskedCharacterProperties");
            var insertedRun = this.insertRunInternal(subDocument, insertPositionAtStartDocument, runType, text, maskedCharacterProperties, characterStyle);
            var textRun = subDocument.chunks[insertedRun.chunkIndex].textRuns[insertedRun.runIndex];
            textRun.paragraph.length += text.length;
            this.chunkSizeCorrector.correctChunkSizeAtInsertPosition(subDocument, insertPositionAtStartDocument);
            this.manipulator.dispatcher.notifySimpleRunInserted(subDocument, insertPositionAtStartDocument, text.length, textRun.maskedCharacterProperties, textRun.characterStyle, runType, text);
        };
        TextManipulator.prototype.insertInlinePicture = function (subDocument, insertPositionAtStartDocument, id, originalWidth, originalHeight, scaleX, scaleY, lockAspectRatio, maskedCharacterProperties, characterStyle, isLoaded, publicAPIID) {
            if (!!maskedCharacterProperties == false)
                throw new Error("In insertInlinePicture need set clearly maskedCharacterProperties");
            var insertedRun = this.insertRunInternal(subDocument, insertPositionAtStartDocument, __aspxRichEdit.RunType.InlinePictureRun, __aspxRichEdit.RichUtils.specialCharacters.ObjectMark, maskedCharacterProperties, characterStyle);
            var pictureRun = subDocument.chunks[insertedRun.chunkIndex].textRuns[insertedRun.runIndex];
            pictureRun.id = id;
            pictureRun.size.lockAspectRatio = lockAspectRatio;
            pictureRun.size.originalSize.width = originalWidth;
            pictureRun.size.originalSize.height = originalHeight;
            pictureRun.size.scale.width = scaleX;
            pictureRun.size.scale.height = scaleY;
            pictureRun.isLoaded = isLoaded;
            if (publicAPIID >= 0)
                pictureRun.publicAPIId = publicAPIID;
            subDocument.chunks[insertedRun.chunkIndex].textRuns[insertedRun.runIndex].paragraph.length++;
            this.manipulator.dispatcher.notifyInlinePictureInserted(subDocument, insertPositionAtStartDocument, id, scaleX, scaleY);
            return pictureRun.publicAPIId;
        };
        TextManipulator.prototype.insertAnchoredPicture = function (subDocument, insertPositionAtStartDocument, id, size, maskedCharacterProperties, characterStyle, isLoaded, shapeInfo, anchorInfo) {
            if (subDocument.isTextBox())
                return this.insertInlinePicture(subDocument, insertPositionAtStartDocument, id, size.originalSize.width, size.originalSize.height, size.scale.width, size.scale.height, size.lockAspectRatio, maskedCharacterProperties, characterStyle, isLoaded, -1);
            if (!!maskedCharacterProperties == false)
                throw new Error("In insertAnchoredPicture need set clearly maskedCharacterProperties");
            var insertedRun = this.insertRunInternal(subDocument, insertPositionAtStartDocument, __aspxRichEdit.RunType.AnchoredPictureRun, __aspxRichEdit.RichUtils.specialCharacters.ObjectMark, maskedCharacterProperties, characterStyle);
            var pictureRun = subDocument.chunks[insertedRun.chunkIndex].textRuns[insertedRun.runIndex];
            pictureRun.id = id;
            pictureRun.size = size;
            pictureRun.isLoaded = isLoaded;
            if (!isLoaded) {
                __aspxRichEdit.MapUtilsKeyAsString.elementBy(this.loadingInlinePicturesHashtable, function (item) { return item.historyRun.offsetAtStartDocument == insertPositionAtStartDocument &&
                    item.subDocumentId == subDocument.id; }).run = pictureRun;
            }
            pictureRun.shape.copyFrom(shapeInfo);
            if (anchorInfo)
                pictureRun.anchorInfo = anchorInfo.clone();
            if (anchorInfo)
                anchorInfo.zOrder = pictureRun.anchorInfo.zOrder;
            subDocument.chunks[insertedRun.chunkIndex].textRuns[insertedRun.runIndex].paragraph.length++;
            this.manipulator.dispatcher.notifyAnchoredPictureInserted(subDocument, pictureRun.anchoredObjectID, insertPositionAtStartDocument, id, size, anchorInfo);
            var interval = new __aspxRichEdit.FixedInterval(insertPositionAtStartDocument, 1);
            this.manipulator.floatingObjectsManipulator.shape.fillColor.setValue(subDocument, interval, shapeInfo.fillColor);
            this.manipulator.floatingObjectsManipulator.shape.outlineColor.setValue(subDocument, interval, shapeInfo.outlineColor);
            this.manipulator.floatingObjectsManipulator.shape.outlineWidth.setValue(subDocument, interval, shapeInfo.outlineWidth);
            return pictureRun.anchoredObjectID;
        };
        TextManipulator.prototype.insertAnchoredTextBox = function (subDocument, insertPositionAtStartDocument, size, maskedCharacterProperties, characterStyle, shapeInfo, textBoxProperties, anchorInfo, innerSubDocument) {
            if (subDocument.isTextBox())
                throw new Error("TextBox can not be inserted into another TextBox");
            if (!!maskedCharacterProperties == false)
                throw new Error("In insertTextBox need set clearly maskedCharacterProperties");
            var insertedRun = this.insertRunInternal(subDocument, insertPositionAtStartDocument, __aspxRichEdit.RunType.AnchoredTextBoxRun, __aspxRichEdit.RichUtils.specialCharacters.ObjectMark, maskedCharacterProperties, characterStyle);
            var textBoxRun = subDocument.chunks[insertedRun.chunkIndex].textRuns[insertedRun.runIndex];
            textBoxRun.size.copyFrom(size);
            textBoxRun.shape.copyFrom(shapeInfo);
            textBoxRun.anchorInfo = anchorInfo.clone();
            var textBoxSubDoc = innerSubDocument ? innerSubDocument : this.manipulator.model.createSubDocument(__aspxRichEdit.SubDocumentInfoType.TextBox, subDocument.id);
            textBoxRun.subDocId = textBoxSubDoc.id;
            subDocument.chunks[insertedRun.chunkIndex].textRuns[insertedRun.runIndex].paragraph.length++;
            this.manipulator.dispatcher.notifyAnchoredTextBoxInserted(subDocument, textBoxRun.anchoredObjectID, textBoxRun.subDocId, insertPositionAtStartDocument, anchorInfo);
            var interval = new __aspxRichEdit.FixedInterval(insertPositionAtStartDocument, 1);
            this.manipulator.floatingObjectsManipulator.textBoxSize.setValue(subDocument, interval, size);
            this.manipulator.floatingObjectsManipulator.shape.fillColor.setValue(subDocument, interval, shapeInfo.fillColor);
            this.manipulator.floatingObjectsManipulator.shape.outlineColor.setValue(subDocument, interval, shapeInfo.outlineColor);
            this.manipulator.floatingObjectsManipulator.shape.outlineWidth.setValue(subDocument, interval, shapeInfo.outlineWidth);
            this.manipulator.floatingObjectsManipulator.textBoxProperties.setValue(subDocument, interval, textBoxProperties);
            return textBoxRun;
        };
        TextManipulator.prototype.applyImagesLoadedOnPaste = function (subDocument, loadedImagesInfo) {
            var updatedImagesInfo = [];
            for (var guid in loadedImagesInfo) {
                if (!loadedImagesInfo.hasOwnProperty(guid))
                    continue;
                if (this.loadingInlinePicturesHashtable[guid]) {
                    var historyRun = this.loadingInlinePicturesHashtable[guid].historyRun;
                    if (historyRun) {
                        var imageInfo = loadedImagesInfo[guid];
                        var serverId = imageInfo[__aspxRichEdit.JSONInlinePictureCommandsImageInfo.ImageCacheId];
                        var originalWidth = imageInfo[__aspxRichEdit.JSONInlinePictureCommandsImageInfo.OriginalWidth];
                        var originalHeight = imageInfo[__aspxRichEdit.JSONInlinePictureCommandsImageInfo.OriginalHeight];
                        var base64 = imageInfo[__aspxRichEdit.JSONInlinePictureCommandsImageInfo.Base64Encoded];
                        var pictureRun = this.loadingInlinePicturesHashtable[guid].run;
                        pictureRun.isLoaded = true;
                        pictureRun.id = serverId;
                        pictureRun.size.originalSize.width = originalWidth;
                        pictureRun.size.originalSize.height = originalHeight;
                        historyRun.id = serverId;
                        historyRun.originalHeight = originalHeight;
                        historyRun.originalWidth = originalWidth;
                        var position = historyRun.offsetAtStartDocument;
                        if (subDocument.getRunByPosition(position) != pictureRun) {
                            var chunkIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(subDocument.chunks, function (c) { return c.startLogPosition.value; }, pictureRun.paragraph.startLogPosition.value);
                            for (var i = chunkIndex, chunk; chunk = subDocument.chunks[i]; i++) {
                                if (chunk.textRuns.indexOf(pictureRun) > -1) {
                                    position = chunk.startLogPosition.value + pictureRun.startOffset;
                                    break;
                                }
                            }
                        }
                        var minimalSize = __aspxRichEdit.LayoutFormatter.ColumnCalculator.findMinimalColumnSize(subDocument.documentModel.getSectionByPosition(position).sectionProperties);
                        var scale = 100 * Math.min(__aspxRichEdit.UnitConverter.pixelsToTwips(minimalSize.width) / Math.max(1, originalWidth), __aspxRichEdit.UnitConverter.pixelsToTwips(minimalSize.height) / Math.max(1, originalHeight));
                        var currentScale = Math.min(pictureRun.size.scale.width, pictureRun.size.scale.height);
                        var resultScale = Math.max(1, Math.min(currentScale, scale, 100));
                        pictureRun.size.scale.width = resultScale;
                        pictureRun.size.scale.height = resultScale;
                        historyRun.scaleX = resultScale;
                        historyRun.scaleY = resultScale;
                        if (base64)
                            this.manipulator.model.cache.imageCache.add(serverId, base64);
                        updatedImagesInfo.push(new __aspxRichEdit.UpdatedImagesInfo(position, pictureRun.id, resultScale, resultScale));
                    }
                }
            }
            if (updatedImagesInfo.length)
                this.manipulator.dispatcher.notifyInlinePicturesUpdated(subDocument, updatedImagesInfo);
        };
        TextManipulator.prototype.loadFontInfo = function (fontInfo, subDocument, applyNewFontOnIntervalsAfterLoad) {
            var existingInfo = __aspxRichEdit.MapUtilsKeyAsNumber.elementBy(this.loadingFontInfosHashtable, function (info) { return info.fontInfo.name == fontInfo.name; });
            if (existingInfo) {
                existingInfo.addRequest(subDocument, applyNewFontOnIntervalsAfterLoad);
                return;
            }
            var fontCache = this.manipulator.model.cache.fontInfoCache;
            var fontIndex = fontCache.count;
            this.loadingFontInfosHashtable[fontIndex] = new OnLoadingFontInfoItem(subDocument, applyNewFontOnIntervalsAfterLoad, fontInfo);
            this.manipulator.dispatcher.notifyLoadFontInfo(fontInfo, fontIndex);
            fontInfo.isLoad = false;
            fontCache.getItem(fontInfo);
        };
        TextManipulator.prototype.applyFontInfoLoadedOnPaste = function (control, newFontInfo, rawFontInfos) {
            var onLoadingFontInfoItem = this.loadingFontInfosHashtable[newFontInfo.index];
            if (newFontInfo.isLoad || !onLoadingFontInfoItem)
                return;
            delete this.loadingFontInfosHashtable[newFontInfo.index];
            control.measurer.clearCache();
            var rawFontInfo = __aspxRichEdit.MapUtilsKeyAsNumber.anyOf(rawFontInfos, function (property, index) {
                return index == newFontInfo.index ? property : null;
            });
            __aspxRichEdit.JSONFontInfoConverter.convertFromJSON(rawFontInfo, newFontInfo);
            onLoadingFontInfoItem.applyFont(control, this.manipulator.dispatcher);
            var ribbonBar = control.barManager.getRibbonBar();
            if (ribbonBar) {
                var fontRibbonItem = ribbonBar.getItem(__aspxRichEdit.RichEditClientCommand.ChangeFontName);
                if (fontRibbonItem) {
                    var fontComboBox = fontRibbonItem.getEditor();
                    if (fontComboBox && !fontComboBox.FindItemByValue(newFontInfo.name))
                        fontComboBox.AddItem(newFontInfo.name, newFontInfo.name);
                }
            }
        };
        TextManipulator.prototype.insertParagraph = function (subDocument, insertPositionAtStartDocument, maskedCharacterProperties, characterStyle, paragraphMaskedProperties, paragraphStyle, isInsertPropertiesAndStyleIndexToCurrentParagraph, numberingListIndex, listLevelIndex, tabs) {
            if (!!maskedCharacterProperties == false)
                throw new Error("In insertParagraph need set clearly maskedCharacterProperties");
            if (this.insertParagraphInEnd(subDocument, insertPositionAtStartDocument, maskedCharacterProperties, characterStyle)) {
                this.manipulator.dispatcher.notifyParagraphInserted(subDocument, insertPositionAtStartDocument, __aspxRichEdit.ListUtils.last(subDocument.paragraphs));
                return;
            }
            var insertedRun = this.insertRunInternal(subDocument, insertPositionAtStartDocument, __aspxRichEdit.RunType.ParagraphRun, __aspxRichEdit.RichUtils.specialCharacters.ParagraphMark, maskedCharacterProperties, characterStyle);
            var currentRun = subDocument.chunks[insertedRun.chunkIndex].textRuns[insertedRun.runIndex];
            var oldParagraphIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(subDocument.paragraphs, function (p) { return p.startLogPosition.value; }, insertPositionAtStartDocument + 1);
            var oldParagraph = subDocument.paragraphs[oldParagraphIndex];
            subDocument.positionManager.unregisterPosition(oldParagraph.startLogPosition);
            var newParagraph = new __aspxRichEdit.Paragraph(subDocument, null, 1, null, null);
            newParagraph.onParagraphPropertiesChanged();
            this.applyParagraphProperties(newParagraph, oldParagraph, !isInsertPropertiesAndStyleIndexToCurrentParagraph, paragraphStyle, paragraphMaskedProperties, numberingListIndex, listLevelIndex, tabs);
            currentRun.paragraph = newParagraph;
            subDocument.paragraphs.splice(oldParagraphIndex, 0, newParagraph);
            var indexRun = insertedRun.runIndex - 1;
            completeExecuteAllCycles: for (var indexChunk = insertedRun.chunkIndex, chunk; chunk = subDocument.chunks[indexChunk]; indexChunk--) {
                for (var run; run = chunk.textRuns[indexRun]; indexRun--) {
                    if (run.isParagraphOrSectionRun())
                        break completeExecuteAllCycles;
                    run.paragraph = newParagraph;
                    run.onCharacterPropertiesChanged();
                    newParagraph.length += run.getLength();
                    oldParagraph.length -= run.getLength();
                }
                if (indexChunk > 0)
                    indexRun = subDocument.chunks[indexChunk - 1].textRuns.length - 1;
            }
            newParagraph.startLogPosition = subDocument.positionManager.registerPosition(run != undefined ? chunk.startLogPosition.value + run.startOffset + 1 : 0);
            oldParagraph.startLogPosition = subDocument.positionManager.registerPosition(insertPositionAtStartDocument + 1);
            indexRun = insertedRun.runIndex + 1;
            completeExecuteAllCycles: for (var indexChunk = insertedRun.chunkIndex, chunk; chunk = subDocument.chunks[indexChunk]; indexChunk++) {
                for (var run; run = chunk.textRuns[indexRun]; indexRun++) {
                    run.onCharacterPropertiesChanged();
                    if (run.isParagraphOrSectionRun())
                        break completeExecuteAllCycles;
                }
                indexRun = 0;
            }
            this.manipulator.dispatcher.notifyParagraphInserted(subDocument, insertPositionAtStartDocument, newParagraph);
        };
        TextManipulator.prototype.insertSection = function (subDocument, insertPositionAtStartDocument, maskedCharacterProperties, characterStyle, sectionProperties, isInsertPropertiesToCurrentSection, paragraphStyle, paragraphMaskedProperties, isInsertPropertiesAndStyleIndexToCurrentParagraph, numberingListIndex, listLevelIndex, tabs) {
            if (!!maskedCharacterProperties == false)
                throw new Error("In insertSection need set clearly maskedCharacterProperties");
            if (!subDocument.isMain())
                throw new Error("Section cannot be inserted in a non-main subDocument");
            var oldSectionIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(subDocument.documentModel.sections, function (s) { return s.startLogPosition.value; }, insertPositionAtStartDocument);
            var oldSection = subDocument.documentModel.sections[oldSectionIndex];
            var lengthNewSection = insertPositionAtStartDocument - oldSection.startLogPosition.value + 1;
            var insertedRun = this.insertRunInternal(subDocument, insertPositionAtStartDocument, __aspxRichEdit.RunType.SectionRun, __aspxRichEdit.RichUtils.specialCharacters.SectionMark, maskedCharacterProperties, characterStyle);
            var oldParagraphIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(subDocument.paragraphs, function (p) { return p.startLogPosition.value; }, insertPositionAtStartDocument);
            var oldParagraph = subDocument.paragraphs[oldParagraphIndex];
            var newLengthOldParagraph = insertPositionAtStartDocument - oldParagraph.startLogPosition.value + 1;
            var newLengthNewParagraph = oldParagraph.length - newLengthOldParagraph + 1;
            var newParagraphStartPosition = subDocument.positionManager.registerPosition(insertPositionAtStartDocument + 1);
            var newParagraph = new __aspxRichEdit.Paragraph(subDocument, newParagraphStartPosition, newLengthNewParagraph, null, null);
            oldParagraph.length = newLengthOldParagraph;
            subDocument.paragraphs.splice(oldParagraphIndex + 1, 0, newParagraph);
            this.applyParagraphProperties(newParagraph, oldParagraph, isInsertPropertiesAndStyleIndexToCurrentParagraph, paragraphStyle, paragraphMaskedProperties, numberingListIndex, listLevelIndex, tabs);
            var indexRun = insertedRun.runIndex + 1;
            completeExecuteAllCycles: for (var indexChunk = insertedRun.chunkIndex, chunk; chunk = subDocument.chunks[indexChunk]; indexChunk++) {
                for (var run; run = chunk.textRuns[indexRun]; indexRun++) {
                    run.paragraph = newParagraph;
                    run.onCharacterPropertiesChanged();
                    if (run.isParagraphOrSectionRun())
                        break completeExecuteAllCycles;
                }
                indexRun = 0;
            }
            indexRun = insertedRun.runIndex - 1;
            completeExecuteAllCycles: for (var indexChunk = insertedRun.chunkIndex, chunk; chunk = subDocument.chunks[indexChunk]; indexChunk--) {
                for (var run; run = chunk.textRuns[indexRun]; indexRun--) {
                    if (run.isParagraphOrSectionRun())
                        break completeExecuteAllCycles;
                    run.onCharacterPropertiesChanged();
                }
                if (indexChunk > 0)
                    indexRun = subDocument.chunks[indexChunk - 1].textRuns.length - 1;
            }
            subDocument.positionManager.unregisterPosition(oldSection.startLogPosition);
            var newSectionProperties;
            if (sectionProperties) {
                if (isInsertPropertiesToCurrentSection)
                    newSectionProperties = sectionProperties;
                else {
                    newSectionProperties = oldSection.sectionProperties;
                    oldSection.sectionProperties = sectionProperties;
                }
            }
            else
                newSectionProperties = oldSection.sectionProperties;
            var newSection = new __aspxRichEdit.Section(subDocument.documentModel, subDocument.positionManager.registerPosition(oldSection.startLogPosition.value), lengthNewSection, newSectionProperties);
            newSection.headers = oldSection.headers;
            newSection.headers.section = newSection;
            newSection.footers = oldSection.footers;
            newSection.footers.section = newSection;
            oldSection.headers = new __aspxRichEdit.SectionHeaders(oldSection);
            oldSection.footers = new __aspxRichEdit.SectionFooters(oldSection);
            oldSection.startLogPosition = subDocument.positionManager.registerPosition(insertPositionAtStartDocument + 1);
            oldSection.setLength(subDocument, oldSection.getLength() - lengthNewSection - 1 + 1);
            subDocument.documentModel.sections.splice(oldSectionIndex, 0, newSection);
            this.manipulator.dispatcher.notifySectionInserted(subDocument, insertPositionAtStartDocument, newSection, oldSectionIndex);
        };
        TextManipulator.prototype.applyParagraphProperties = function (newParagraph, oldParagraph, copyPropertiesToOldParagraph, paragraphStyle, paragraphMaskedProperties, numberingListIndex, listLevelIndex, tabs) {
            if (paragraphMaskedProperties) {
                if (copyPropertiesToOldParagraph) {
                    oldParagraph.onParagraphPropertiesChanged();
                    newParagraph.setParagraphProperties(oldParagraph.maskedParagraphProperties);
                    oldParagraph.setParagraphProperties(paragraphMaskedProperties);
                }
                else {
                    newParagraph.setParagraphProperties(paragraphMaskedProperties);
                }
            }
            else
                newParagraph.setParagraphProperties(oldParagraph.maskedParagraphProperties);
            if (paragraphStyle) {
                if (copyPropertiesToOldParagraph) {
                    newParagraph.paragraphStyle = oldParagraph.paragraphStyle;
                    oldParagraph.paragraphStyle = paragraphStyle;
                }
                else {
                    newParagraph.paragraphStyle = paragraphStyle;
                }
            }
            else
                newParagraph.paragraphStyle = oldParagraph.paragraphStyle;
            if (numberingListIndex !== undefined) {
                if (copyPropertiesToOldParagraph) {
                    newParagraph.numberingListIndex = oldParagraph.numberingListIndex;
                    newParagraph.listLevelIndex = oldParagraph.listLevelIndex;
                    oldParagraph.numberingListIndex = numberingListIndex;
                    oldParagraph.listLevelIndex = listLevelIndex;
                }
                else {
                    newParagraph.numberingListIndex = numberingListIndex;
                    newParagraph.listLevelIndex = listLevelIndex;
                }
            }
            else {
                newParagraph.numberingListIndex = oldParagraph.numberingListIndex;
                newParagraph.listLevelIndex = oldParagraph.listLevelIndex;
            }
            if (tabs) {
                if (copyPropertiesToOldParagraph) {
                    newParagraph.tabs = oldParagraph.tabs.clone();
                    oldParagraph.tabs = tabs;
                }
                else {
                    newParagraph.tabs = tabs;
                }
            }
            else
                newParagraph.tabs = oldParagraph.tabs.clone();
        };
        TextManipulator.prototype.updateSymbol = function (subDocument, position, symbol) {
            if (symbol.length !== 1)
                throw new Error("symbol length should be equal to 1");
            var state = new __aspxRichEdit.HistoryItemIntervalState();
            var chunkIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(subDocument.chunks, function (c) { return c.startLogPosition.value; }, position);
            var chunk = subDocument.chunks[chunkIndex];
            var chunkRelativePosition = position - chunk.startLogPosition.value;
            var oldSymbol = chunk.textBuffer.substr(chunkRelativePosition, 1);
            state.register(new __aspxRichEdit.HistoryItemTextBufferStateObject(position, symbol));
            chunk.textBuffer = chunk.textBuffer.substr(0, chunkRelativePosition) + symbol + chunk.textBuffer.substr(chunkRelativePosition + 1);
            this.manipulator.dispatcher.notifyTextBufferChanged(state, subDocument);
            return oldSymbol;
        };
        TextManipulator.prototype.restoreRemovedInterval = function (subDocument, removeOperationResult) {
            new __aspxRichEdit.RestoreRemovedIntervalOperation(this.manipulator, subDocument).execute(removeOperationResult);
        };
        TextManipulator.prototype.unpackHistoryRunsToModel = function (subDocument, historyRuns) {
            var fields = subDocument.fields;
            var fieldStackHistory = [];
            for (var historyRunIndex = 0, historyRun; historyRun = historyRuns[historyRunIndex]; historyRunIndex++) {
                switch (historyRun.type) {
                    case __aspxRichEdit.RunType.ParagraphRun:
                        if (!(historyRun instanceof __aspxRichEdit.HistoryRunParagraph))
                            throw new Error("In unpackHistoryRunsToModel type text run = TextRunType.ParagraphRun, but type historyRun != HistoryRunParagraph. historyRun.offsetAtStartDocument = " +
                                historyRun.offsetAtStartDocument + ", historyRun.text = " + historyRun.text);
                        var historyRunParagraph = historyRun;
                        this.insertParagraph(subDocument, historyRunParagraph.offsetAtStartDocument, historyRunParagraph.characterProperties, historyRunParagraph.characterStyle, historyRunParagraph.paragraphMaskedProperties, historyRunParagraph.paragraphStyle, historyRunParagraph.isInsertPropertiesAndStyleIndexToCurrentParagraph, historyRunParagraph.numbericListIndex, historyRunParagraph.listLevelIndex, historyRunParagraph.tabs.clone());
                        break;
                    case __aspxRichEdit.RunType.SectionRun:
                        if (!(historyRun instanceof __aspxRichEdit.HistoryRunSection))
                            throw new Error("In unpackHistoryRunsToModel type text run = TextRunType.SectionRun, but type historyRun != HistoryRunSection. historyRun.offsetAtStartDocument = " +
                                historyRun.offsetAtStartDocument + ", historyRun.text = " + historyRun.text);
                        var historyRunSection = historyRun;
                        this.insertSection(subDocument, historyRunSection.offsetAtStartDocument, historyRunSection.characterProperties, historyRunSection.characterStyle, historyRunSection.sectionProperties, true, historyRunSection.paragraphStyle, historyRunSection.paragraphMaskedProperties, historyRunSection.isInsertPropertiesAndStyleIndexToCurrentParagraph, historyRunSection.numbericListIndex, historyRunSection.listLevelIndex, historyRunSection.tabs.clone());
                        break;
                    case __aspxRichEdit.RunType.InlinePictureRun:
                        if (!(historyRun instanceof __aspxRichEdit.HistoryRunInlinePicture))
                            throw new Error("In unpackHistoryRunsToModel type text run = TextRunType.InlinePictureRun, but type historyRun != HistoryRunInlinePicture. historyRun.offsetAtStartDocument = " +
                                historyRun.offsetAtStartDocument + ", historyRun.text = " + historyRun.text);
                        var inlineHistoryRun = historyRun;
                        this.insertInlinePicture(subDocument, historyRun.offsetAtStartDocument, inlineHistoryRun.id, inlineHistoryRun.originalWidth, inlineHistoryRun.originalHeight, inlineHistoryRun.scaleX, inlineHistoryRun.scaleY, inlineHistoryRun.lockAspectRatio, historyRun.characterProperties, historyRun.characterStyle, true, inlineHistoryRun.publicAPIID);
                        break;
                    case __aspxRichEdit.RunType.FieldCodeStartRun:
                        if (!(historyRun instanceof __aspxRichEdit.HistoryRunFieldCodeStart))
                            throw new Error("In unpackHistoryRunsToModel type text run = TextRunType.HistoryRunFieldCodeStart, but type historyRun != HistoryRunFieldCodeStart. historyRun.offsetAtStartDocument = " +
                                historyRun.offsetAtStartDocument + ", historyRun.text = " + historyRun.text);
                        fieldStackHistory.push(historyRun);
                        this.insertText(subDocument, historyRun.offsetAtStartDocument, historyRun.text, historyRun.characterProperties, historyRun.characterStyle, historyRun.type);
                        break;
                    case __aspxRichEdit.RunType.FieldResultEndRun:
                        this.insertText(subDocument, historyRun.offsetAtStartDocument, historyRun.text, historyRun.characterProperties, historyRun.characterStyle, historyRun.type);
                        var histFieldCodeStartRun = fieldStackHistory.pop();
                        var fieldInsertIndex = 0;
                        if (fields.length > 0) {
                            fieldInsertIndex = Math.max(0, __aspxRichEdit.Field.normedBinaryIndexOf(fields, histFieldCodeStartRun.startPosition + 1));
                            if (histFieldCodeStartRun.startPosition > fields[fieldInsertIndex].getFieldStartPosition())
                                fieldInsertIndex++;
                        }
                        var newField = new __aspxRichEdit.Field(subDocument.positionManager, fieldInsertIndex, histFieldCodeStartRun.startPosition, histFieldCodeStartRun.separatorPosition, histFieldCodeStartRun.endPosition, histFieldCodeStartRun.showCode, histFieldCodeStartRun.hyperlinkInfo ? histFieldCodeStartRun.hyperlinkInfo.clone() : undefined);
                        __aspxRichEdit.Field.addField(fields, newField);
                        this.manipulator.dispatcher.notifyFieldInserted(subDocument, histFieldCodeStartRun.startPosition, histFieldCodeStartRun.separatorPosition, histFieldCodeStartRun.endPosition);
                        if (histFieldCodeStartRun.hyperlinkInfo)
                            this.manipulator.dispatcher.notifyHyperlinkInfoChanged(subDocument, __aspxRichEdit.FixedInterval.fromPositions(histFieldCodeStartRun.separatorPosition + 1, histFieldCodeStartRun.endPosition - 1), __aspxRichEdit.FixedInterval.fromPositions(histFieldCodeStartRun.startPosition + 1, histFieldCodeStartRun.separatorPosition), histFieldCodeStartRun.hyperlinkInfo);
                        break;
                    default:
                        this.insertText(subDocument, historyRun.offsetAtStartDocument, historyRun.text, historyRun.characterProperties, historyRun.characterStyle, historyRun.type);
                        break;
                }
            }
        };
        TextManipulator.prototype.insertSubDocumentInOtherSubDocument = function (targetSubDocument, targetPosition, sourceSubDocument, sourceInterval) {
            var fromDocumentModel = sourceSubDocument.documentModel, toDocumentModel = targetSubDocument.documentModel, constRunIterator = sourceSubDocument.getConstRunIterator(sourceInterval), toCurrentPosition = targetPosition, fromFieldIndexesWhatNeedCopyInfo = [], fromFields = sourceSubDocument.fields, toFields = targetSubDocument.fields;
            var modelsConstOffset = targetPosition - sourceInterval.start;
            while (constRunIterator.moveNext()) {
                var currentRun = constRunIterator.currentRun;
                switch (currentRun.getType()) {
                    case __aspxRichEdit.RunType.FieldCodeStartRun:
                        var fromGlobPos = constRunIterator.currentChunk.startLogPosition.value + currentRun.startOffset;
                        fromFieldIndexesWhatNeedCopyInfo.push(__aspxRichEdit.Field.normedBinaryIndexOf(sourceSubDocument.fields, fromGlobPos + 1));
                    case __aspxRichEdit.RunType.FieldCodeEndRun:
                    case __aspxRichEdit.RunType.FieldResultEndRun:
                    case __aspxRichEdit.RunType.TextRun:
                    case __aspxRichEdit.RunType.LayoutDependentRun:
                        var insertedText = constRunIterator.currentChunk.getRunText(currentRun);
                        var insertedMaskedCharacterProperties = toDocumentModel.cache.maskedCharacterPropertiesCache.getItem(currentRun.maskedCharacterProperties);
                        var insertedCharacterStyle = toDocumentModel.stylesManager.addCharacterStyle(currentRun.characterStyle);
                        this.insertText(targetSubDocument, toCurrentPosition, insertedText, insertedMaskedCharacterProperties, insertedCharacterStyle, currentRun.getType() == __aspxRichEdit.RunType.LayoutDependentRun && targetSubDocument.isMain() ? __aspxRichEdit.RunType.TextRun : currentRun.getType());
                        break;
                    case __aspxRichEdit.RunType.InlinePictureRun:
                        var currentPictureRun = currentRun;
                        if (!(currentPictureRun instanceof __aspxRichEdit.InlinePictureRun))
                            throw new Error("In TexManipulator.insertPartSubDocumentInOtherSubDocument currentPictureRun not have type InlinePictureRun");
                        this.insertInlinePicture(targetSubDocument, toCurrentPosition, currentPictureRun.id, currentPictureRun.size.originalSize.width, currentPictureRun.size.originalSize.height, currentPictureRun.size.scale.width, currentPictureRun.size.scale.height, currentPictureRun.size.lockAspectRatio, toDocumentModel.cache.maskedCharacterPropertiesCache.getItem(currentPictureRun.maskedCharacterProperties), toDocumentModel.stylesManager.addCharacterStyle(currentPictureRun.characterStyle), true, currentPictureRun.publicAPIId);
                        break;
                    case __aspxRichEdit.RunType.AnchoredPictureRun: {
                        var currentAnchoredPictureRun = currentRun;
                        if (!(currentAnchoredPictureRun instanceof __aspxRichEdit.AnchoredPictureRun))
                            throw new Error("In TexManipulator.insertPartSubDocumentInOtherSubDocument currentAnchoredPictureRun not have type AnchoredPictureRun");
                        this.insertAnchoredPicture(targetSubDocument, toCurrentPosition, currentAnchoredPictureRun.id, currentAnchoredPictureRun.size, toDocumentModel.cache.maskedCharacterPropertiesCache.getItem(currentAnchoredPictureRun.maskedCharacterProperties), toDocumentModel.stylesManager.addCharacterStyle(currentAnchoredPictureRun.characterStyle), true, currentAnchoredPictureRun.shape.clone(), currentAnchoredPictureRun.anchorInfo.clone());
                        break;
                    }
                    case __aspxRichEdit.RunType.InlineTextBoxRun:
                        break;
                    case __aspxRichEdit.RunType.AnchoredTextBoxRun: {
                        if (targetSubDocument.isTextBox()) {
                            var insertedMaskedCharacterProperties_1 = toDocumentModel.cache.maskedCharacterPropertiesCache.getItem(currentRun.maskedCharacterProperties);
                            var insertedCharacterStyle_1 = toDocumentModel.stylesManager.addCharacterStyle(currentRun.characterStyle);
                            this.insertText(targetSubDocument, toCurrentPosition, " ", insertedMaskedCharacterProperties_1, insertedCharacterStyle_1, __aspxRichEdit.RunType.TextRun);
                            break;
                        }
                        var currentAnchoredTextBoxRun = currentRun;
                        var newAnchoredTextBox = this.insertAnchoredTextBox(targetSubDocument, toCurrentPosition, currentAnchoredTextBoxRun.size.clone(), toDocumentModel.cache.maskedCharacterPropertiesCache.getItem(currentAnchoredTextBoxRun.maskedCharacterProperties), toDocumentModel.stylesManager.addCharacterStyle(currentAnchoredTextBoxRun.characterStyle), currentAnchoredTextBoxRun.shape.clone(), currentAnchoredTextBoxRun.textBoxProperties.clone(), currentAnchoredTextBoxRun.anchorInfo.clone());
                        var sourceSubDoc = this.manipulator.model.subDocuments[currentAnchoredTextBoxRun.subDocId];
                        var targetSubDoc = this.manipulator.model.subDocuments[newAnchoredTextBox.subDocId];
                        this.insertSubDocumentInOtherSubDocument(targetSubDoc, 0, sourceSubDoc, new __aspxRichEdit.FixedInterval(0, sourceSubDoc.getDocumentEndPosition()));
                        this.removeInterval(targetSubDoc, new __aspxRichEdit.FixedInterval(targetSubDoc.getDocumentEndPosition() - 2, 1), false);
                        break;
                    }
                    case __aspxRichEdit.RunType.ParagraphRun:
                        var toNumberingListIndex = -1;
                        var toListLevelIndex = currentRun.paragraph.listLevelIndex;
                        if (currentRun.paragraph.numberingListIndex >= 0) {
                            var fromNumberingList = fromDocumentModel.numberingLists[currentRun.paragraph.numberingListIndex];
                            toNumberingListIndex = toDocumentModel.getNumberingListIndexById(fromNumberingList.getId());
                            if (toNumberingListIndex < 0) {
                                var toAbstractNumberingListIndex = toDocumentModel.getAbstractNumberingListIndexById(fromDocumentModel.abstractNumberingLists[fromNumberingList.abstractNumberingListIndex].getId());
                                if (toAbstractNumberingListIndex < 0) {
                                    var toAbstractNumberingList = new __aspxRichEdit.AbstractNumberingList(toDocumentModel);
                                    toAbstractNumberingList.copyFrom(fromDocumentModel.abstractNumberingLists[fromNumberingList.abstractNumberingListIndex]);
                                    toAbstractNumberingListIndex = this.manipulator.numberingListManipulator.addAbstractNumberingList(toAbstractNumberingList);
                                }
                                var toNumberingList = new __aspxRichEdit.NumberingList(toDocumentModel, toAbstractNumberingListIndex);
                                toNumberingList.copyFrom(fromNumberingList);
                                toNumberingListIndex = this.manipulator.numberingListManipulator.addNumberingList(toNumberingList);
                            }
                        }
                        if (toNumberingListIndex < 0) {
                            var toParagraph = targetSubDocument.getParagraphByPosition(toCurrentPosition);
                            var toParagraphNumberingListIndex = toParagraph.getNumberingListIndex();
                            if (toParagraphNumberingListIndex >= 0) {
                                if (targetPosition === toParagraph.startLogPosition.value) {
                                    toNumberingListIndex = toParagraphNumberingListIndex;
                                    toListLevelIndex = toParagraph.getListLevelIndex();
                                }
                            }
                        }
                        this.insertParagraph(targetSubDocument, toCurrentPosition, toDocumentModel.cache.maskedCharacterPropertiesCache.getItem(currentRun.maskedCharacterProperties), toDocumentModel.stylesManager.addCharacterStyle(currentRun.characterStyle), toDocumentModel.cache.maskedParagraphPropertiesCache.getItem(currentRun.paragraph.maskedParagraphProperties), currentRun.paragraph.paragraphStyle, true, toNumberingListIndex, toListLevelIndex, currentRun.paragraph.tabs.clone());
                        break;
                    case __aspxRichEdit.RunType.SectionRun:
                        this.insertSection(targetSubDocument, toCurrentPosition, toDocumentModel.cache.maskedCharacterPropertiesCache.getItem(currentRun.maskedCharacterProperties), toDocumentModel.stylesManager.addCharacterStyle(currentRun.characterStyle), constRunIterator.currentSection.sectionProperties.clone(), true, currentRun.paragraph.paragraphStyle, toDocumentModel.cache.maskedParagraphPropertiesCache.getItem(currentRun.paragraph.maskedParagraphProperties), true, currentRun.paragraph.numberingListIndex, currentRun.paragraph.listLevelIndex, currentRun.paragraph.tabs.clone());
                        break;
                    default: throw new Error("In TextManipulator.insertPartSubDocumentInOtherSubDocument need insert some inknown paragraphRunType = " + currentRun.getType());
                }
                toCurrentPosition += currentRun.getLength();
            }
            var newTables = [];
            for (var i = 0, table = void 0; table = sourceSubDocument.tables[i]; i++)
                newTables.push(this.manipulator.tables.pasteTable(targetSubDocument, table, targetPosition + table.getStartPosition()));
            if (fromFieldIndexesWhatNeedCopyInfo.length > 0) {
                var toStartCodePosFirstField = modelsConstOffset + fromFields[fromFieldIndexesWhatNeedCopyInfo[0]].getCodeStartPosition();
                var toFieldIndex = __aspxRichEdit.Field.normedBinaryIndexOf(toFields, toStartCodePosFirstField);
                if (toFieldIndex < 0 || toFields[toFieldIndex].getCodeStartPosition() < toStartCodePosFirstField)
                    toFieldIndex++;
                while (fromFieldIndexesWhatNeedCopyInfo.length > 0) {
                    var fromField = sourceSubDocument.fields[fromFieldIndexesWhatNeedCopyInfo.shift()];
                    var newField = new __aspxRichEdit.Field(targetSubDocument.positionManager, toFieldIndex, fromField.getFieldStartPosition() + modelsConstOffset, fromField.getSeparatorPosition() + modelsConstOffset, fromField.getFieldEndPosition() + modelsConstOffset, fromField.showCode, fromField.isHyperlinkField() ? fromField.getHyperlinkInfo().clone() : undefined);
                    __aspxRichEdit.Field.addField(toFields, newField);
                    toFieldIndex++;
                    this.manipulator.dispatcher.notifyFieldInserted(targetSubDocument, newField.getFieldStartPosition(), newField.getSeparatorPosition(), newField.getFieldEndPosition());
                    if (newField.isHyperlinkField())
                        this.manipulator.dispatcher.notifyHyperlinkInfoChanged(targetSubDocument, newField.getResultInterval(), newField.getCodeInterval(), newField.getHyperlinkInfo());
                }
            }
            this.manipulator.bookmarksManipulator.insertBookmarksFromSubDocument(sourceSubDocument, targetSubDocument, sourceInterval, modelsConstOffset);
            return newTables;
        };
        TextManipulator.prototype.insertRunInternal = function (subDocument, insertPositionAtStartDocument, type, text, characterProperties, characterStyle) {
            var lastCharacterIndex = subDocument.getDocumentEndPosition();
            if (insertPositionAtStartDocument >= lastCharacterIndex)
                insertPositionAtStartDocument--;
            var chunkIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(subDocument.chunks, function (c) { return c.startLogPosition.value; }, insertPositionAtStartDocument);
            var chunk = subDocument.chunks[chunkIndex];
            var startOffsetAtChunk = insertPositionAtStartDocument - chunk.startLogPosition.value;
            var currentRunIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(chunk.textRuns, function (r) { return r.startOffset; }, startOffsetAtChunk);
            var currentRun = chunk.textRuns[currentRunIndex];
            var sectionIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(subDocument.documentModel.sections, function (s) { return s.startLogPosition.value; }, insertPositionAtStartDocument);
            subDocument.documentModel.sections[sectionIndex].setLength(subDocument, subDocument.documentModel.sections[sectionIndex].getLength() + text.length);
            chunk.textBuffer = [chunk.textBuffer.substr(0, startOffsetAtChunk), text, chunk.textBuffer.substr(startOffsetAtChunk)].join('');
            if (startOffsetAtChunk != currentRun.startOffset) {
                if (type == __aspxRichEdit.RunType.TextRun && currentRun.getType() == __aspxRichEdit.RunType.TextRun && currentRun.characterStyle.equalsByName(characterStyle) &&
                    currentRun.maskedCharacterProperties.equals(characterProperties)) {
                    currentRun.incLength(text.length);
                    TextManipulator.moveRunsInChunk(chunk, currentRunIndex + 1, text.length);
                    subDocument.positionManager.advance(insertPositionAtStartDocument + 1, text.length);
                    return { chunkIndex: chunkIndex, runIndex: currentRunIndex };
                }
                chunk.splitRun(currentRunIndex, startOffsetAtChunk - currentRun.startOffset);
                currentRunIndex++;
                currentRun = chunk.textRuns[currentRunIndex];
            }
            subDocument.positionManager.advance(insertPositionAtStartDocument + 1, text.length);
            var newTextRun;
            var prevRun = chunk.textRuns[currentRunIndex - 1];
            if (prevRun && type == __aspxRichEdit.RunType.TextRun && prevRun.getType() == __aspxRichEdit.RunType.TextRun && prevRun.characterStyle.equalsByName(characterStyle) &&
                prevRun.maskedCharacterProperties.equals(characterProperties)) {
                prevRun.incLength(text.length);
                TextManipulator.moveRunsInChunk(chunk, currentRunIndex, text.length);
                return { chunkIndex: chunkIndex, runIndex: currentRunIndex - 1 };
            }
            else {
                if (type == __aspxRichEdit.RunType.TextRun && currentRun.getType() == __aspxRichEdit.RunType.TextRun && currentRun.characterStyle.equalsByName(characterStyle) &&
                    currentRun.maskedCharacterProperties.equals(characterProperties)) {
                    currentRun.incLength(text.length);
                    TextManipulator.moveRunsInChunk(chunk, currentRunIndex + 1, text.length);
                    return { chunkIndex: chunkIndex, runIndex: currentRunIndex };
                }
                else {
                    newTextRun = RunTemplateCreatorHelper.createRun[type](startOffsetAtChunk, text.length, currentRun.paragraph, characterStyle, characterProperties);
                    chunk.textRuns.splice(currentRunIndex, 0, newTextRun);
                    TextManipulator.moveRunsInChunk(chunk, currentRunIndex + 1, text.length);
                    return { chunkIndex: chunkIndex, runIndex: currentRunIndex };
                }
            }
        };
        TextManipulator.moveRunsInChunk = function (chunk, startRunIndex, offset) {
            for (var i = startRunIndex, run; run = chunk.textRuns[i]; i++)
                run.startOffset += offset;
        };
        TextManipulator.prototype.insertParagraphInEnd = function (subDocument, insertPositionAtStartDocument, characterProperties, characterStyle) {
            var lastChunk = subDocument.chunks[subDocument.chunks.length - 1];
            var offsetAtStartDocumentLastSymbol = lastChunk.startLogPosition.value + lastChunk.textBuffer.length;
            if (insertPositionAtStartDocument >= offsetAtStartDocumentLastSymbol) {
                insertPositionAtStartDocument = offsetAtStartDocumentLastSymbol;
                var prevParagraph = subDocument.paragraphs[subDocument.paragraphs.length - 1];
                var newParagraph = new __aspxRichEdit.Paragraph(subDocument, subDocument.positionManager.registerPosition(insertPositionAtStartDocument), 1, prevParagraph.paragraphStyle, prevParagraph.maskedParagraphProperties);
                var newTextRun = new __aspxRichEdit.ParagraphRun(insertPositionAtStartDocument - lastChunk.startLogPosition.value, newParagraph, characterStyle, characterProperties);
                subDocument.paragraphs.push(newParagraph);
                lastChunk.textRuns.push(newTextRun);
                lastChunk.textBuffer = lastChunk.textBuffer + __aspxRichEdit.RichUtils.specialCharacters.ParagraphMark;
                var lastSection = subDocument.documentModel.sections[subDocument.documentModel.sections.length - 1];
                lastSection.setLength(subDocument, lastSection.getLength() + 1);
                return true;
            }
            return false;
        };
        return TextManipulator;
    }());
    __aspxRichEdit.TextManipulator = TextManipulator;
    var RunTemplateCreatorHelper = (function () {
        function RunTemplateCreatorHelper() {
        }
        RunTemplateCreatorHelper.createRun = new __aspxRichEdit.MapCreatorNumberAsKey()
            .add(__aspxRichEdit.RunType.TextRun, function (startOffset, length, paragraph, characterStyle, maskedCharacterProperties) {
            return new __aspxRichEdit.TextRun(startOffset, length, paragraph, characterStyle, maskedCharacterProperties);
        })
            .add(__aspxRichEdit.RunType.ParagraphRun, function (startOffset, _length, paragraph, characterStyle, maskedCharacterProperties) {
            return new __aspxRichEdit.ParagraphRun(startOffset, paragraph, characterStyle, maskedCharacterProperties);
        })
            .add(__aspxRichEdit.RunType.SectionRun, function (startOffset, _length, paragraph, characterStyle, maskedCharacterProperties) {
            return new __aspxRichEdit.SectionRun(startOffset, paragraph, characterStyle, maskedCharacterProperties);
        })
            .add(__aspxRichEdit.RunType.FieldCodeStartRun, function (startOffset, _length, paragraph, characterStyle, maskedCharacterProperties) {
            return new __aspxRichEdit.FieldCodeStartRun(startOffset, paragraph, characterStyle, maskedCharacterProperties);
        })
            .add(__aspxRichEdit.RunType.FieldCodeEndRun, function (startOffset, _length, paragraph, characterStyle, maskedCharacterProperties) {
            return new __aspxRichEdit.FieldCodeEndRun(startOffset, paragraph, characterStyle, maskedCharacterProperties);
        })
            .add(__aspxRichEdit.RunType.FieldResultEndRun, function (startOffset, _length, paragraph, characterStyle, maskedCharacterProperties) {
            return new __aspxRichEdit.FieldResultEndRun(startOffset, paragraph, characterStyle, maskedCharacterProperties);
        })
            .add(__aspxRichEdit.RunType.AnchoredPictureRun, function (startOffset, _length, paragraph, characterStyle, maskedCharacterProperties) {
            return new __aspxRichEdit.AnchoredPictureRun(startOffset, paragraph, characterStyle, maskedCharacterProperties, new __aspxRichEdit.Shape(), -1, new __aspxRichEdit.PictureSize(true, 0, new __aspxRichEdit.Size(0, 0), new __aspxRichEdit.Size(0, 0)), new __aspxRichEdit.AnchorInfo(), false, -1);
        })
            .add(__aspxRichEdit.RunType.AnchoredTextBoxRun, function (startOffset, _length, paragraph, characterStyle, maskedCharacterProperties) {
            return new __aspxRichEdit.AnchoredTextBoxRun(startOffset, paragraph, characterStyle, maskedCharacterProperties, new __aspxRichEdit.Shape(), -1, new __aspxRichEdit.AnchorTextBoxSize(true, 0, new __aspxRichEdit.Size(0, 0), new __aspxRichEdit.Size(0, 0), __aspxRichEdit.RelativeWidthType.Page, __aspxRichEdit.RelativeHeightType.Page, true, true), new __aspxRichEdit.AnchorInfo(), -1, new __aspxRichEdit.TextBoxProperties());
        })
            .add(__aspxRichEdit.RunType.InlinePictureRun, function (startOffset, _length, paragraph, characterStyle, maskedCharacterProperties) {
            return new __aspxRichEdit.InlinePictureRun(startOffset, paragraph, characterStyle, maskedCharacterProperties, new __aspxRichEdit.Shape(), -1, new __aspxRichEdit.PictureSize(true, 0, new __aspxRichEdit.Size(0, 0), new __aspxRichEdit.Size(0, 0)), false, -1);
        })
            .add(__aspxRichEdit.RunType.InlineTextBoxRun, function (startOffset, _length, paragraph, characterStyle, maskedCharacterProperties) {
            return new __aspxRichEdit.InlineTextBoxRun(startOffset, paragraph, characterStyle, maskedCharacterProperties, new __aspxRichEdit.Shape(), -1, new __aspxRichEdit.InlineTextBoxSize(true, 0, new __aspxRichEdit.Size(0, 0)), new __aspxRichEdit.TextBoxProperties());
        })
            .add(__aspxRichEdit.RunType.LayoutDependentRun, function (startOffset, _length, paragraph, characterStyle, maskedCharacterProperties) {
            return new __aspxRichEdit.LayoutDependentRun(startOffset, paragraph, characterStyle, maskedCharacterProperties);
        })
            .add(__aspxRichEdit.RunType.FootNoteRun, function (startOffset, _length, paragraph, characterStyle, maskedCharacterProperties) {
            return new __aspxRichEdit.FootNoteRun(startOffset, paragraph, characterStyle, maskedCharacterProperties);
        })
            .add(__aspxRichEdit.RunType.EndNoteRun, function (startOffset, _length, paragraph, characterStyle, maskedCharacterProperties) {
            return new __aspxRichEdit.EndNoteRun(startOffset, paragraph, characterStyle, maskedCharacterProperties);
        })
            .get();
        return RunTemplateCreatorHelper;
    }());
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AlphabetBasedNumberConverter = (function (_super) {
        __extends(AlphabetBasedNumberConverter, _super);
        function AlphabetBasedNumberConverter(alphabet) {
            var _this = _super.call(this) || this;
            _this.minValue = 0;
            _this.maxValue = 780;
            _this.alphabet = alphabet;
            return _this;
        }
        AlphabetBasedNumberConverter.prototype.convertNumberCore = function (value) {
            if (value == 0)
                return "";
            value--;
            var alphabetSize = this.alphabet.length;
            var count = Math.floor(value / alphabetSize + 1);
            var symbol = this.alphabet[value % alphabetSize];
            return Array(count + 1).join(symbol);
        };
        return AlphabetBasedNumberConverter;
    }(__aspxRichEdit.OrdinalBasedNumberConverter));
    __aspxRichEdit.AlphabetBasedNumberConverter = AlphabetBasedNumberConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var BulletNumberConverter = (function (_super) {
        __extends(BulletNumberConverter, _super);
        function BulletNumberConverter() {
            var _this = _super.call(this) || this;
            _this.type = __aspxRichEdit.NumberingFormat.Bullet;
            return _this;
        }
        BulletNumberConverter.prototype.convertNumberCore = function (_value) {
            return "•";
        };
        return BulletNumberConverter;
    }(__aspxRichEdit.OrdinalBasedNumberConverter));
    __aspxRichEdit.BulletNumberConverter = BulletNumberConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DecimalEnclosedParenthesesNumberConverter = (function (_super) {
        __extends(DecimalEnclosedParenthesesNumberConverter, _super);
        function DecimalEnclosedParenthesesNumberConverter() {
            var _this = _super.call(this) || this;
            _this.type = __aspxRichEdit.NumberingFormat.DecimalEnclosedParentheses;
            return _this;
        }
        DecimalEnclosedParenthesesNumberConverter.prototype.convertNumberCore = function (value) {
            return REWebUtils.Formatter.Format("({0})", value);
        };
        return DecimalEnclosedParenthesesNumberConverter;
    }(__aspxRichEdit.OrdinalBasedNumberConverter));
    __aspxRichEdit.DecimalEnclosedParenthesesNumberConverter = DecimalEnclosedParenthesesNumberConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DecimalNumberConverter = (function (_super) {
        __extends(DecimalNumberConverter, _super);
        function DecimalNumberConverter() {
            var _this = _super.call(this) || this;
            _this.type = __aspxRichEdit.NumberingFormat.Decimal;
            return _this;
        }
        DecimalNumberConverter.prototype.convertNumberCore = function (value) {
            return value.toString();
        };
        return DecimalNumberConverter;
    }(__aspxRichEdit.OrdinalBasedNumberConverter));
    __aspxRichEdit.DecimalNumberConverter = DecimalNumberConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DecimalZeroNumberConverter = (function (_super) {
        __extends(DecimalZeroNumberConverter, _super);
        function DecimalZeroNumberConverter() {
            var _this = _super.call(this) || this;
            _this.type = __aspxRichEdit.NumberingFormat.DecimalZero;
            return _this;
        }
        DecimalZeroNumberConverter.prototype.convertNumberCore = function (value) {
            if (value < 10)
                return REWebUtils.Formatter.Format("0{0}", value);
            else
                return value.toString();
        };
        return DecimalZeroNumberConverter;
    }(__aspxRichEdit.OrdinalBasedNumberConverter));
    __aspxRichEdit.DecimalZeroNumberConverter = DecimalZeroNumberConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DigitType;
    (function (DigitType) {
        DigitType[DigitType["Zero"] = 0] = "Zero";
        DigitType[DigitType["SingleNumeral"] = 1] = "SingleNumeral";
        DigitType[DigitType["Single"] = 2] = "Single";
        DigitType[DigitType["Teen"] = 3] = "Teen";
        DigitType[DigitType["Tenth"] = 4] = "Tenth";
        DigitType[DigitType["Hundred"] = 5] = "Hundred";
        DigitType[DigitType["Thousand"] = 6] = "Thousand";
        DigitType[DigitType["Million"] = 7] = "Million";
        DigitType[DigitType["Billion"] = 8] = "Billion";
        DigitType[DigitType["Trillion"] = 9] = "Trillion";
        DigitType[DigitType["Quadrillion"] = 10] = "Quadrillion";
        DigitType[DigitType["Quintillion"] = 11] = "Quintillion";
        DigitType[DigitType["Separator"] = 12] = "Separator";
    })(DigitType = __aspxRichEdit.DigitType || (__aspxRichEdit.DigitType = {}));
    var DigitInfo = (function () {
        function DigitInfo(provider, value, type) {
            this.provider = provider;
            this.value = value;
            this.type = type;
        }
        DigitInfo.prototype.convertToString = function () {
            var numerics = this.getNumerics();
            return numerics[this.value];
        };
        DigitInfo.prototype.getNumerics = function () {
            return [];
        };
        return DigitInfo;
    }());
    __aspxRichEdit.DigitInfo = DigitInfo;
    var SeparatorDigitInfo = (function (_super) {
        __extends(SeparatorDigitInfo, _super);
        function SeparatorDigitInfo(provider, value) {
            return _super.call(this, provider, value, DigitType.Separator) || this;
        }
        SeparatorDigitInfo.prototype.getNumerics = function () {
            return this.provider.separator;
        };
        return SeparatorDigitInfo;
    }(DigitInfo));
    __aspxRichEdit.SeparatorDigitInfo = SeparatorDigitInfo;
    var QuintillionDigitInfo = (function (_super) {
        __extends(QuintillionDigitInfo, _super);
        function QuintillionDigitInfo(provider, value) {
            return _super.call(this, provider, value, DigitType.Quintillion) || this;
        }
        QuintillionDigitInfo.prototype.getNumerics = function () {
            return this.provider.quintillion;
        };
        return QuintillionDigitInfo;
    }(DigitInfo));
    __aspxRichEdit.QuintillionDigitInfo = QuintillionDigitInfo;
    var QuadrillionDigitInfo = (function (_super) {
        __extends(QuadrillionDigitInfo, _super);
        function QuadrillionDigitInfo(provider, value) {
            return _super.call(this, provider, value, DigitType.Quadrillion) || this;
        }
        QuadrillionDigitInfo.prototype.getNumerics = function () {
            return this.provider.quadrillion;
        };
        return QuadrillionDigitInfo;
    }(DigitInfo));
    __aspxRichEdit.QuadrillionDigitInfo = QuadrillionDigitInfo;
    var TrillionDigitInfo = (function (_super) {
        __extends(TrillionDigitInfo, _super);
        function TrillionDigitInfo(provider, value) {
            return _super.call(this, provider, value, DigitType.Trillion) || this;
        }
        TrillionDigitInfo.prototype.getNumerics = function () {
            return this.provider.trillion;
        };
        return TrillionDigitInfo;
    }(DigitInfo));
    __aspxRichEdit.TrillionDigitInfo = TrillionDigitInfo;
    var BillionDigitInfo = (function (_super) {
        __extends(BillionDigitInfo, _super);
        function BillionDigitInfo(provider, value) {
            return _super.call(this, provider, value, DigitType.Billion) || this;
        }
        BillionDigitInfo.prototype.getNumerics = function () {
            return this.provider.billion;
        };
        return BillionDigitInfo;
    }(DigitInfo));
    __aspxRichEdit.BillionDigitInfo = BillionDigitInfo;
    var MillionDigitInfo = (function (_super) {
        __extends(MillionDigitInfo, _super);
        function MillionDigitInfo(provider, value) {
            return _super.call(this, provider, value, DigitType.Million) || this;
        }
        MillionDigitInfo.prototype.getNumerics = function () {
            return this.provider.million;
        };
        return MillionDigitInfo;
    }(DigitInfo));
    __aspxRichEdit.MillionDigitInfo = MillionDigitInfo;
    var ThousandDigitInfo = (function (_super) {
        __extends(ThousandDigitInfo, _super);
        function ThousandDigitInfo(provider, value) {
            return _super.call(this, provider, value, DigitType.Million) || this;
        }
        ThousandDigitInfo.prototype.getNumerics = function () {
            return this.provider.thousands;
        };
        return ThousandDigitInfo;
    }(DigitInfo));
    __aspxRichEdit.ThousandDigitInfo = ThousandDigitInfo;
    var HundredDigitInfo = (function (_super) {
        __extends(HundredDigitInfo, _super);
        function HundredDigitInfo(provider, value) {
            return _super.call(this, provider, value - 1, DigitType.Hundred) || this;
        }
        HundredDigitInfo.prototype.getNumerics = function () {
            return this.provider.hundreds;
        };
        return HundredDigitInfo;
    }(DigitInfo));
    __aspxRichEdit.HundredDigitInfo = HundredDigitInfo;
    var TenthsDigitInfo = (function (_super) {
        __extends(TenthsDigitInfo, _super);
        function TenthsDigitInfo(provider, value) {
            return _super.call(this, provider, value - 2, DigitType.Tenth) || this;
        }
        TenthsDigitInfo.prototype.getNumerics = function () {
            return this.provider.tenths;
        };
        return TenthsDigitInfo;
    }(DigitInfo));
    __aspxRichEdit.TenthsDigitInfo = TenthsDigitInfo;
    var TeensDigitInfo = (function (_super) {
        __extends(TeensDigitInfo, _super);
        function TeensDigitInfo(provider, value) {
            return _super.call(this, provider, value, DigitType.Teen) || this;
        }
        TeensDigitInfo.prototype.getNumerics = function () {
            return this.provider.teens;
        };
        return TeensDigitInfo;
    }(DigitInfo));
    __aspxRichEdit.TeensDigitInfo = TeensDigitInfo;
    var SingleDigitInfo = (function (_super) {
        __extends(SingleDigitInfo, _super);
        function SingleDigitInfo(provider, value) {
            return _super.call(this, provider, value - 1, DigitType.Single) || this;
        }
        SingleDigitInfo.prototype.getNumerics = function () {
            return this.provider.singles;
        };
        return SingleDigitInfo;
    }(DigitInfo));
    __aspxRichEdit.SingleDigitInfo = SingleDigitInfo;
    var ZeroDigitInfo = (function (_super) {
        __extends(ZeroDigitInfo, _super);
        function ZeroDigitInfo(provider) {
            return _super.call(this, provider, 9, DigitType.Zero) || this;
        }
        ZeroDigitInfo.prototype.getNumerics = function () {
            return this.provider.singles;
        };
        return ZeroDigitInfo;
    }(DigitInfo));
    __aspxRichEdit.ZeroDigitInfo = ZeroDigitInfo;
    var DescriptiveEnglishNumberConverter = (function (_super) {
        __extends(DescriptiveEnglishNumberConverter, _super);
        function DescriptiveEnglishNumberConverter() {
            var _this = _super.call(this) || this;
            _this.minValue = 0;
            return _this;
        }
        DescriptiveEnglishNumberConverter.prototype.convertNumberCore = function (value) {
            var digits = this.generateDigits(value);
            return this.convertDigitsToString(digits);
        };
        DescriptiveEnglishNumberConverter.prototype.generateDigits = function (value) {
            var digits = [];
            digits = this.generateDigitsCore(digits, value);
            if (digits.length == 0)
                this.addZero(digits);
            return digits;
        };
        DescriptiveEnglishNumberConverter.prototype.generateDigitsCore = function (digits, value) {
            var currentValue = value;
            if (Math.floor(currentValue / 1000000000000000000) != 0)
                this.generateQuintillionDigits(digits, Math.floor(currentValue / 1000000000000000000));
            currentValue = currentValue % 1000000000000000000;
            if (Math.floor(currentValue / 1000000000000000) != 0)
                this.generateQuadrillionDigits(digits, Math.floor(currentValue / 1000000000000000));
            currentValue = currentValue % 1000000000000000;
            if (Math.floor(currentValue / 1000000000000) != 0)
                this.generateTrillionDigits(digits, Math.floor(currentValue / 1000000000000));
            currentValue = currentValue % 1000000000000;
            if (Math.floor(currentValue / 1000000000) != 0)
                this.generateBillionDigits(digits, Math.floor(currentValue / 1000000000));
            currentValue = currentValue % 1000000000;
            if (Math.floor(currentValue / 1000000) != 0)
                this.generateMillionDigits(digits, Math.floor(currentValue / 1000000));
            currentValue = currentValue % 1000000;
            if (Math.floor(currentValue / 1000) != 0)
                this.generateThousandDigits(digits, Math.floor(currentValue / 1000));
            currentValue = currentValue % 1000;
            if (Math.floor(currentValue / 100) != 0)
                this.generateHundredDigits(digits, Math.floor(currentValue / 100));
            currentValue = currentValue % 100;
            if (currentValue == 0)
                return digits;
            if (currentValue >= 20)
                this.generateTenthsDigits(digits, currentValue);
            else {
                if (currentValue >= 10)
                    this.generateTeensDigits(digits, currentValue % 10);
                else
                    this.generateSinglesDigits(digits, currentValue);
            }
            return digits;
        };
        DescriptiveEnglishNumberConverter.prototype.convertDigitsToString = function (digits) {
            var result = "";
            for (var i = 0; i < digits.length; i++)
                result += digits[i].convertToString();
            if (result.length > 0)
                result = result[0].toUpperCase() + result.substring(1);
            return result;
        };
        DescriptiveEnglishNumberConverter.prototype.addZero = function (digits) {
            digits.push(new ZeroDigitInfo(new __aspxRichEdit.CardinalEnglishNumericsProvider()));
        };
        DescriptiveEnglishNumberConverter.prototype.generateQuintillionDigits = function (digits, value) {
            this.generateDigitsCore(digits, value);
            if (digits.length)
                digits.push(new SeparatorDigitInfo(new __aspxRichEdit.CardinalEnglishNumericsProvider(), 0));
            digits.push(new QuintillionDigitInfo(new __aspxRichEdit.CardinalEnglishNumericsProvider(), 0));
        };
        DescriptiveEnglishNumberConverter.prototype.generateQuadrillionDigits = function (digits, value) {
            this.generateDigitsCore(digits, value);
            if (digits.length)
                digits.push(new SeparatorDigitInfo(new __aspxRichEdit.CardinalEnglishNumericsProvider(), 0));
            digits.push(new QuadrillionDigitInfo(new __aspxRichEdit.CardinalEnglishNumericsProvider(), 0));
        };
        DescriptiveEnglishNumberConverter.prototype.generateTrillionDigits = function (digits, value) {
            this.generateDigitsCore(digits, value);
            if (digits.length)
                digits.push(new SeparatorDigitInfo(new __aspxRichEdit.CardinalEnglishNumericsProvider(), 0));
            digits.push(new TrillionDigitInfo(new __aspxRichEdit.CardinalEnglishNumericsProvider(), 0));
        };
        DescriptiveEnglishNumberConverter.prototype.generateBillionDigits = function (digits, value) {
            this.generateDigitsCore(digits, value);
            if (digits.length)
                digits.push(new SeparatorDigitInfo(new __aspxRichEdit.CardinalEnglishNumericsProvider(), 0));
            digits.push(new BillionDigitInfo(new __aspxRichEdit.CardinalEnglishNumericsProvider(), 0));
        };
        DescriptiveEnglishNumberConverter.prototype.generateMillionDigits = function (digits, value) {
            this.generateDigitsCore(digits, value);
            if (digits.length)
                digits.push(new SeparatorDigitInfo(new __aspxRichEdit.CardinalEnglishNumericsProvider(), 0));
            digits.push(new MillionDigitInfo(new __aspxRichEdit.CardinalEnglishNumericsProvider(), 0));
        };
        DescriptiveEnglishNumberConverter.prototype.generateThousandDigits = function (digits, value) {
            this.generateDigitsCore(digits, value);
            if (digits.length)
                digits.push(new SeparatorDigitInfo(new __aspxRichEdit.CardinalEnglishNumericsProvider(), 0));
            digits.push(new ThousandDigitInfo(new __aspxRichEdit.CardinalEnglishNumericsProvider(), 0));
        };
        DescriptiveEnglishNumberConverter.prototype.generateHundredDigits = function (digits, value) {
            if (digits.length)
                digits.push(new SeparatorDigitInfo(new __aspxRichEdit.CardinalEnglishNumericsProvider(), 0));
            digits.push(new HundredDigitInfo(new __aspxRichEdit.CardinalEnglishNumericsProvider(), value));
        };
        DescriptiveEnglishNumberConverter.prototype.generateTenthsDigits = function (digits, value) {
            if (digits.length)
                digits.push(new SeparatorDigitInfo(new __aspxRichEdit.CardinalEnglishNumericsProvider(), 0));
            digits.push(new TenthsDigitInfo(new __aspxRichEdit.CardinalEnglishNumericsProvider(), Math.floor(value / 10)));
            this.generateSinglesDigits(digits, value % 10);
        };
        DescriptiveEnglishNumberConverter.prototype.generateTeensDigits = function (digits, value) {
            if (digits.length)
                digits.push(new SeparatorDigitInfo(new __aspxRichEdit.CardinalEnglishNumericsProvider(), 0));
            digits.push(new TeensDigitInfo(new __aspxRichEdit.CardinalEnglishNumericsProvider(), value));
        };
        DescriptiveEnglishNumberConverter.prototype.generateSinglesDigits = function (digits, value) {
            if (value == 0)
                return;
            if (digits.length != 0) {
                if (digits[digits.length - 1].type == DigitType.Tenth)
                    digits.push(new SeparatorDigitInfo(new __aspxRichEdit.CardinalEnglishNumericsProvider(), 1));
                else
                    digits.push(new SeparatorDigitInfo(new __aspxRichEdit.CardinalEnglishNumericsProvider(), 0));
            }
            digits.push(new SingleDigitInfo(new __aspxRichEdit.CardinalEnglishNumericsProvider(), value));
        };
        return DescriptiveEnglishNumberConverter;
    }(__aspxRichEdit.OrdinalBasedNumberConverter));
    __aspxRichEdit.DescriptiveEnglishNumberConverter = DescriptiveEnglishNumberConverter;
    var DescriptiveCardinalEnglishNumberConverter = (function (_super) {
        __extends(DescriptiveCardinalEnglishNumberConverter, _super);
        function DescriptiveCardinalEnglishNumberConverter() {
            var _this = _super.call(this) || this;
            _this.type = __aspxRichEdit.NumberingFormat.CardinalText;
            return _this;
        }
        return DescriptiveCardinalEnglishNumberConverter;
    }(DescriptiveEnglishNumberConverter));
    __aspxRichEdit.DescriptiveCardinalEnglishNumberConverter = DescriptiveCardinalEnglishNumberConverter;
    var DescriptiveOrdinalEnglishNumberConverter = (function (_super) {
        __extends(DescriptiveOrdinalEnglishNumberConverter, _super);
        function DescriptiveOrdinalEnglishNumberConverter() {
            var _this = _super.call(this) || this;
            _this.type = __aspxRichEdit.NumberingFormat.OrdinalText;
            return _this;
        }
        DescriptiveOrdinalEnglishNumberConverter.prototype.generateDigits = function (value) {
            var digits = _super.prototype.generateDigits.call(this, value);
            digits[digits.length - 1].provider = new __aspxRichEdit.OrdinalEnglishNumericsProvider();
            return digits;
        };
        return DescriptiveOrdinalEnglishNumberConverter;
    }(DescriptiveEnglishNumberConverter));
    __aspxRichEdit.DescriptiveOrdinalEnglishNumberConverter = DescriptiveOrdinalEnglishNumberConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HexNumberConverter = (function (_super) {
        __extends(HexNumberConverter, _super);
        function HexNumberConverter() {
            var _this = _super.call(this) || this;
            _this.type = __aspxRichEdit.NumberingFormat.Hex;
            return _this;
        }
        HexNumberConverter.prototype.convertNumberCore = function (value) {
            return value.toString(16);
        };
        return HexNumberConverter;
    }(__aspxRichEdit.OrdinalBasedNumberConverter));
    __aspxRichEdit.HexNumberConverter = HexNumberConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var UpperLatinLetterNumberConverter = (function (_super) {
        __extends(UpperLatinLetterNumberConverter, _super);
        function UpperLatinLetterNumberConverter() {
            var _this = _super.call(this, ['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']) || this;
            _this.type = __aspxRichEdit.NumberingFormat.UpperLetter;
            return _this;
        }
        return UpperLatinLetterNumberConverter;
    }(__aspxRichEdit.AlphabetBasedNumberConverter));
    __aspxRichEdit.UpperLatinLetterNumberConverter = UpperLatinLetterNumberConverter;
    var LowerLatinLetterNumberConverter = (function (_super) {
        __extends(LowerLatinLetterNumberConverter, _super);
        function LowerLatinLetterNumberConverter() {
            var _this = _super.call(this, ['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']) || this;
            _this.type = __aspxRichEdit.NumberingFormat.LowerLetter;
            return _this;
        }
        return LowerLatinLetterNumberConverter;
    }(__aspxRichEdit.AlphabetBasedNumberConverter));
    __aspxRichEdit.LowerLatinLetterNumberConverter = LowerLatinLetterNumberConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var NumberInDashNumberConverter = (function (_super) {
        __extends(NumberInDashNumberConverter, _super);
        function NumberInDashNumberConverter() {
            var _this = _super.call(this) || this;
            _this.type = __aspxRichEdit.NumberingFormat.NumberInDash;
            return _this;
        }
        NumberInDashNumberConverter.prototype.convertNumberCore = function (value) {
            return REWebUtils.Formatter.Format("- {0} -", value);
        };
        return NumberInDashNumberConverter;
    }(__aspxRichEdit.OrdinalBasedNumberConverter));
    __aspxRichEdit.NumberInDashNumberConverter = NumberInDashNumberConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var NumericsProvider = (function () {
        function NumericsProvider(separator, singlesNumeral, singles, teens, tenths, hundreds, thousands, million, billion, trillion, quadrillion, quintillion) {
            this.separator = separator;
            this.singlesNumeral = singlesNumeral;
            this.singles = singles;
            this.teens = teens;
            this.tenths = tenths;
            this.hundreds = hundreds;
            this.thousands = thousands;
            this.million = million;
            this.billion = billion;
            this.trillion = trillion;
            this.quadrillion = quadrillion;
            this.quintillion = quintillion;
        }
        return NumericsProvider;
    }());
    __aspxRichEdit.NumericsProvider = NumericsProvider;
    var OrdinalEnglishNumericsProvider = (function (_super) {
        __extends(OrdinalEnglishNumericsProvider, _super);
        function OrdinalEnglishNumericsProvider() {
            return _super.call(this, [" ", "-"], ["first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth", "ninth", "zeroth"], ["first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth", "ninth", "zeroth"], ["tenth", "eleventh", "twelfth", "thirteenth", "fourteenth", "fifteenth", "sixteenth", "seventeenth", "eighteenth", "nineteenth"], ["twentieth", "thirtieth", "fortieth", "fiftieth", "sixtieth", "seventieth", "eightieth", "ninetieth"], ["one hundredth", "two hundredth", "three hundredth", "four hundredth", "five hundredth", "six hundredth", "seven hundredth", "eight hundredth", "nine hundredth"], ["thousandth"], ["millionth"], ["billionth"], ["trillionth"], ["quadrillionth"], ["quintillionth"]) || this;
        }
        return OrdinalEnglishNumericsProvider;
    }(NumericsProvider));
    __aspxRichEdit.OrdinalEnglishNumericsProvider = OrdinalEnglishNumericsProvider;
    var CardinalEnglishNumericsProvider = (function (_super) {
        __extends(CardinalEnglishNumericsProvider, _super);
        function CardinalEnglishNumericsProvider() {
            return _super.call(this, [" ", "-"], ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "zero"], ["one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "zero"], ["ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen"], ["twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"], ["one hundred", "two hundred", "three hundred", "four hundred", "five hundred", "six hundred", "seven hundred", "eight hundred", "nine hundred"], ["thousand"], ["million"], ["billion"], ["trillion"], ["quadrillion"], ["quintillion"]) || this;
        }
        return CardinalEnglishNumericsProvider;
    }(NumericsProvider));
    __aspxRichEdit.CardinalEnglishNumericsProvider = CardinalEnglishNumericsProvider;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RomanNumberConverter = (function (_super) {
        __extends(RomanNumberConverter, _super);
        function RomanNumberConverter() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RomanNumberConverter.prototype.convertNumberCore = function (value) {
            var result = "";
            for (var i = this.romans.length - 1; i >= 0; i--) {
                while (value >= this.arabics[i]) {
                    value -= this.arabics[i];
                    result += this.romans[i];
                }
            }
            return result;
        };
        return RomanNumberConverter;
    }(__aspxRichEdit.OrdinalBasedNumberConverter));
    __aspxRichEdit.RomanNumberConverter = RomanNumberConverter;
    var UpperRomanNumberConverterClassic = (function (_super) {
        __extends(UpperRomanNumberConverterClassic, _super);
        function UpperRomanNumberConverterClassic() {
            var _this = _super.call(this) || this;
            _this.type = __aspxRichEdit.NumberingFormat.UpperRoman;
            _this.arabics = [1, 4, 5, 9, 10, 40, 50, 90, 100, 400, 500, 900, 1000];
            _this.romans = ["I", "IV", "V", "IX", "X", "XL", "L", "XC", "C", "CD", "D", "CM", "M"];
            return _this;
        }
        return UpperRomanNumberConverterClassic;
    }(RomanNumberConverter));
    __aspxRichEdit.UpperRomanNumberConverterClassic = UpperRomanNumberConverterClassic;
    var LowerRomanNumberConverterClassic = (function (_super) {
        __extends(LowerRomanNumberConverterClassic, _super);
        function LowerRomanNumberConverterClassic() {
            var _this = _super.call(this) || this;
            _this.type = __aspxRichEdit.NumberingFormat.LowerRoman;
            _this.arabics = [1, 4, 5, 9, 10, 40, 50, 90, 100, 400, 500, 900, 1000];
            _this.romans = ["i", "iv", "v", "ix", "x", "xl", "l", "xc", "c", "cd", "d", "cm", "m"];
            return _this;
        }
        return LowerRomanNumberConverterClassic;
    }(RomanNumberConverter));
    __aspxRichEdit.LowerRomanNumberConverterClassic = LowerRomanNumberConverterClassic;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ListLevel = (function () {
        function ListLevel(documentModel, maskedCharacterProperties, maskedParagraphProperties, listLevelProperties) {
            this.documentModel = documentModel;
            this.setCharacterProperties(maskedCharacterProperties);
            this.setParagraphProperties(maskedParagraphProperties);
            this.setListLevelProperties(listLevelProperties);
        }
        ListLevel.prototype.getListLevelProperties = function () {
            return this.listLevelProperties;
        };
        ListLevel.prototype.setListLevelProperties = function (properties) {
            this.listLevelProperties = this.documentModel.cache.listLevelPropertiesCache.getItem(properties);
        };
        ListLevel.prototype.getCharacterProperties = function () {
            return this.maskedCharacterProperties;
        };
        ListLevel.prototype.getParagraphProperties = function () {
            return this.maskedParagraphProperties;
        };
        ListLevel.prototype.setParagraphProperties = function (properties) {
            this.maskedParagraphProperties = this.documentModel.cache.maskedParagraphPropertiesCache.getItem(properties);
        };
        ListLevel.prototype.onParagraphPropertiesChanged = function () {
            this.resetParagraphMergedProperties();
        };
        ListLevel.prototype.resetParagraphMergedProperties = function () {
            this.mergedParagraphProperties = null;
        };
        ListLevel.prototype.getParagraphMergedProperies = function () {
            if (!this.hasParagraphMergedProperies()) {
                var merger = new __aspxRichEdit.ParagraphPropertiesMerger();
                merger.mergeMaskedParagraphProperties(this.maskedParagraphProperties);
                merger.mergeMaskedParagraphProperties(this.documentModel.defaultParagraphProperties);
                this.mergedParagraphProperties = merger.getMergedProperties();
            }
            return this.mergedParagraphProperties;
        };
        ListLevel.prototype.setParagraphMergedProperies = function (properties) {
            this.mergedParagraphProperties = this.documentModel.cache.mergedParagraphPropertiesCache.getItem(properties);
        };
        ListLevel.prototype.hasParagraphMergedProperies = function () {
            return !!this.mergedParagraphProperties;
        };
        ListLevel.prototype.setCharacterProperties = function (properties) {
            this.maskedCharacterProperties = this.documentModel.cache.maskedCharacterPropertiesCache.getItem(properties);
        };
        ListLevel.prototype.onCharacterPropertiesChanged = function () {
            this.resetCharacterMergedProperties();
        };
        ListLevel.prototype.resetCharacterMergedProperties = function () {
            this.mergedCharacterProperties = null;
        };
        ListLevel.prototype.getCharacterMergedProperies = function () {
            if (!this.hasCharacterMergedProperies()) {
                var merger = new __aspxRichEdit.CharacterPropertiesMerger();
                merger.mergeCharacterProperties(this.maskedCharacterProperties);
                merger.mergeCharacterProperties(this.documentModel.defaultCharacterProperties);
                this.mergedCharacterProperties = merger.getMergedProperties();
            }
            return this.mergedCharacterProperties;
        };
        ListLevel.prototype.setCharacterMergedProperies = function (properties) {
            this.mergedCharacterProperties = this.documentModel.cache.mergedCharacterPropertiesCache.getItem(properties);
        };
        ListLevel.prototype.hasCharacterMergedProperies = function () {
            return !!this.mergedCharacterProperties;
        };
        ListLevel.prototype.equals = function (obj) {
            if (obj === this)
                return true;
            if (!obj.getCharacterProperties().equals(this.getCharacterProperties()))
                return false;
            if (!obj.getParagraphProperties().equals(this.getParagraphProperties()))
                return false;
            if (!obj.getListLevelProperties().equals(this.getListLevelProperties()))
                return false;
            return true;
        };
        ListLevel.prototype.externallyEquals = function (obj) {
            if (obj === this)
                return true;
            var result = obj.getListLevelProperties().displayFormatString == this.getListLevelProperties().displayFormatString &&
                obj.getListLevelProperties().format == this.getListLevelProperties().format &&
                obj.getListLevelProperties().start == this.getListLevelProperties().start &&
                obj.getCharacterProperties().fontBold == this.getCharacterProperties().fontBold &&
                obj.getCharacterProperties().fontItalic == this.getCharacterProperties().fontItalic &&
                obj.getCharacterProperties().fontSize == this.getCharacterProperties().fontSize &&
                obj.getCharacterProperties().textColor.equals(this.getCharacterProperties().textColor) &&
                obj.getCharacterProperties().fontInfo.equals(this.getCharacterProperties().fontInfo);
            return result;
        };
        ListLevel.prototype.copyFrom = function (obj) {
            this.setListLevelProperties(obj.getListLevelProperties());
            this.setCharacterProperties(obj.getCharacterProperties());
            this.setParagraphProperties(obj.getParagraphProperties());
            this.onCharacterPropertiesChanged();
            this.onParagraphPropertiesChanged();
        };
        return ListLevel;
    }());
    __aspxRichEdit.ListLevel = ListLevel;
    var NumberingListReferenceLevel = (function () {
        function NumberingListReferenceLevel(owner, level) {
            this.overrideStart = false;
            this.newStart = 1;
            this.owner = owner;
            this.level = level;
            this.documentModel = owner.documentModel;
        }
        NumberingListReferenceLevel.prototype.getListLevelProperties = function () {
            return this.getOwnerLevel().getListLevelProperties();
        };
        NumberingListReferenceLevel.prototype.setListLevelProperties = function (properties) {
            this.getOwnerLevel().setListLevelProperties(properties);
        };
        NumberingListReferenceLevel.prototype.getCharacterProperties = function () {
            return this.getOwnerLevel().getCharacterProperties();
        };
        NumberingListReferenceLevel.prototype.getParagraphProperties = function () {
            return this.getOwnerLevel().getParagraphProperties();
        };
        NumberingListReferenceLevel.prototype.setParagraphProperties = function (properties) {
            this.getOwnerLevel().setParagraphProperties(properties);
        };
        NumberingListReferenceLevel.prototype.onParagraphPropertiesChanged = function () {
            this.getOwnerLevel().onParagraphPropertiesChanged();
        };
        NumberingListReferenceLevel.prototype.getParagraphMergedProperies = function () {
            return this.getOwnerLevel().getParagraphMergedProperies();
        };
        NumberingListReferenceLevel.prototype.setParagraphMergedProperies = function (properties) {
            this.getOwnerLevel().setParagraphMergedProperies(properties);
        };
        NumberingListReferenceLevel.prototype.hasParagraphMergedProperies = function () {
            return this.getOwnerLevel().hasParagraphMergedProperies();
        };
        NumberingListReferenceLevel.prototype.resetParagraphMergedProperties = function () {
            this.getOwnerLevel().resetParagraphMergedProperties();
        };
        NumberingListReferenceLevel.prototype.setCharacterProperties = function (properties) {
            this.getOwnerLevel().setCharacterProperties(properties);
        };
        NumberingListReferenceLevel.prototype.onCharacterPropertiesChanged = function () {
            this.getOwnerLevel().onCharacterPropertiesChanged();
        };
        NumberingListReferenceLevel.prototype.getCharacterMergedProperies = function () {
            return this.getOwnerLevel().getCharacterMergedProperies();
        };
        NumberingListReferenceLevel.prototype.setCharacterMergedProperies = function (properties) {
            this.getOwnerLevel().setCharacterMergedProperies(properties);
        };
        NumberingListReferenceLevel.prototype.hasCharacterMergedProperies = function () {
            return this.getOwnerLevel().hasCharacterMergedProperies();
        };
        NumberingListReferenceLevel.prototype.resetCharacterMergedProperties = function () {
            this.getOwnerLevel().resetCharacterMergedProperties();
        };
        NumberingListReferenceLevel.prototype.getNewStart = function () {
            return this.newStart;
        };
        NumberingListReferenceLevel.prototype.setNewStart = function (newStart) {
            this.newStart = newStart;
        };
        NumberingListReferenceLevel.prototype.getOwnerLevel = function () {
            return this.owner.getAbstractNumberingList().levels[this.level];
        };
        NumberingListReferenceLevel.prototype.equals = function (obj) {
            return this.getOwnerLevel().equals(obj.getOwnerLevel());
        };
        NumberingListReferenceLevel.prototype.externallyEquals = function (obj) {
            return this.getOwnerLevel().externallyEquals(obj.getOwnerLevel());
        };
        NumberingListReferenceLevel.prototype.copyFrom = function (obj) {
            if (!(obj instanceof NumberingListReferenceLevel))
                throw new Error("Source level should have equal type");
            this.newStart = obj.newStart;
            this.overrideStart = obj.overrideStart;
        };
        return NumberingListReferenceLevel;
    }());
    __aspxRichEdit.NumberingListReferenceLevel = NumberingListReferenceLevel;
    var OverrideListLevel = (function (_super) {
        __extends(OverrideListLevel, _super);
        function OverrideListLevel() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.overrideStart = false;
            return _this;
        }
        OverrideListLevel.prototype.getNewStart = function () {
            return this.getListLevelProperties().start;
        };
        OverrideListLevel.prototype.setNewStart = function (newStart) {
            var properties = this.getListLevelProperties().clone();
            properties.start = newStart;
            this.setListLevelProperties(properties);
        };
        OverrideListLevel.prototype.copyFrom = function (obj) {
            if (!(obj instanceof OverrideListLevel))
                throw new Error("Source level should have equal type");
            _super.prototype.copyFrom.call(this, obj);
            this.overrideStart = obj.overrideStart;
        };
        return OverrideListLevel;
    }(ListLevel));
    __aspxRichEdit.OverrideListLevel = OverrideListLevel;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var NumberingListBase = (function () {
        function NumberingListBase(documentModel, levelCount) {
            this.innerId = -1;
            this.levels = [];
            this.documentModel = documentModel;
            this.initLevels(levelCount);
        }
        NumberingListBase.prototype.getId = function () {
            if (this.innerId === -1)
                this.innerId = this.generateNewId();
            return this.innerId;
        };
        NumberingListBase.prototype.generateNewId = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        NumberingListBase.prototype.initLevels = function (levelCount) {
            for (var i = 0; i < levelCount; i++) {
                var listLevel = this.createLevel(i);
                this.levels.push(listLevel);
            }
        };
        NumberingListBase.prototype.createLevel = function (_index) {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        NumberingListBase.prototype.getLevelType = function (listLevelIndex) {
            if (this.isBulletListLevel(this.levels[listLevelIndex]))
                return NumberingType.Bullet;
            else if (!this.isHybridList())
                return NumberingType.MultiLevel;
            else
                return NumberingType.Simple;
        };
        NumberingListBase.prototype.getListType = function () {
            if (!this.isHybridList())
                return NumberingType.MultiLevel;
            if (this.isBulletListLevel(this.levels[0]))
                return NumberingType.Bullet;
            else
                return NumberingType.Simple;
        };
        NumberingListBase.prototype.equals = function (obj) {
            for (var i = 0, level; level = obj.levels[i]; i++) {
                if (!level.equals(this.levels[i]))
                    return false;
            }
            return true;
        };
        NumberingListBase.prototype.externallyEquals = function (obj) {
            if (this.getListType() !== obj.getListType())
                return false;
            var depth = this.getListType() == NumberingType.MultiLevel ? __aspxRichEdit.NumberingListFormPreviewHelper.depth : 1;
            for (var i = 0; i < depth; i++) {
                if (!this.levels[i].externallyEquals(obj.levels[i]))
                    return false;
            }
            return true;
        };
        NumberingListBase.prototype.copyFrom = function (obj) {
            this.innerId = obj.innerId;
            this.copyLevelsFrom(obj.levels);
        };
        NumberingListBase.prototype.isHybridList = function () {
            for (var i = 0, listLevel; listLevel = this.levels[i]; i++) {
                if (listLevel.getListLevelProperties().templateCode !== 0)
                    return true;
            }
            return false;
        };
        NumberingListBase.prototype.isBulletListLevel = function (level) {
            return level.getListLevelProperties().displayFormatString.length === 1;
        };
        NumberingListBase.NoNumberingListIndex = -2;
        NumberingListBase.NumberingListNotSettedIndex = -1;
        return NumberingListBase;
    }());
    __aspxRichEdit.NumberingListBase = NumberingListBase;
    var AbstractNumberingList = (function (_super) {
        __extends(AbstractNumberingList, _super);
        function AbstractNumberingList(documentModel) {
            return _super.call(this, documentModel, 9) || this;
        }
        AbstractNumberingList.prototype.generateNewId = function () {
            return this.documentModel.abstractNumberingListsIdProvider.getNextId();
        };
        AbstractNumberingList.prototype.createLevel = function (_index) {
            var characterProperties = __aspxRichEdit.MaskedCharacterProperties.createDefault(this.documentModel);
            var paragraphProperties = __aspxRichEdit.MaskedParagraphProperties.createDefault(this.documentModel);
            return new __aspxRichEdit.ListLevel(this.documentModel, characterProperties, paragraphProperties, new __aspxRichEdit.ListLevelProperties());
        };
        AbstractNumberingList.prototype.copyLevelsFrom = function (levels) {
            for (var i = 0, level; level = this.levels[i]; i++) {
                level.copyFrom(levels[i]);
            }
        };
        return AbstractNumberingList;
    }(NumberingListBase));
    __aspxRichEdit.AbstractNumberingList = AbstractNumberingList;
    var NumberingList = (function (_super) {
        __extends(NumberingList, _super);
        function NumberingList(documentModel, abstractNumberingListIndex) {
            var _this = _super.call(this, documentModel, 9) || this;
            if (abstractNumberingListIndex < 0 || abstractNumberingListIndex >= documentModel.abstractNumberingLists.length)
                throw new Error("abstractNumberingListIndex should be positive and less than length of the abstractNumberingLists array");
            _this.abstractNumberingListIndex = abstractNumberingListIndex;
            return _this;
        }
        NumberingList.prototype.getAbstractNumberingList = function () {
            return this.documentModel.abstractNumberingLists[this.abstractNumberingListIndex];
        };
        NumberingList.prototype.generateNewId = function () {
            return this.documentModel.numberingListsIdProvider.getNextId();
        };
        NumberingList.prototype.createLevel = function (index) {
            return new __aspxRichEdit.NumberingListReferenceLevel(this, index);
        };
        NumberingList.prototype.copyLevelsFrom = function (levels) {
            for (var i = 0; i < this.levels.length; i++) {
                var sourceLevel = levels[i];
                if (this.levels[i].constructor !== sourceLevel.constructor) {
                    if (sourceLevel instanceof __aspxRichEdit.OverrideListLevel)
                        this.levels[i] = new __aspxRichEdit.OverrideListLevel(this.documentModel, sourceLevel.getCharacterProperties(), sourceLevel.getParagraphProperties(), sourceLevel.getListLevelProperties());
                    else
                        this.levels[i] = new __aspxRichEdit.NumberingListReferenceLevel(this, i);
                }
                this.levels[i].copyFrom(sourceLevel);
            }
        };
        return NumberingList;
    }(NumberingListBase));
    __aspxRichEdit.NumberingList = NumberingList;
    var NumberingType;
    (function (NumberingType) {
        NumberingType[NumberingType["MultiLevel"] = 0] = "MultiLevel";
        NumberingType[NumberingType["Simple"] = 1] = "Simple";
        NumberingType[NumberingType["Bullet"] = 2] = "Bullet";
    })(NumberingType = __aspxRichEdit.NumberingType || (__aspxRichEdit.NumberingType = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var NumberingListCountersCalculator = (function () {
        function NumberingListCountersCalculator(list) {
            this.counters = [];
            this.usedListIndecies = {};
            this.currentParagraphIndex = -1;
            this.list = list;
            for (var i = 0, listLevel; listLevel = this.list.levels[i]; i++) {
                this.counters.push(listLevel.getListLevelProperties().start - 1);
            }
        }
        NumberingListCountersCalculator.prototype.calculateCounters = function (paragraph) {
            this.currentParagraphIndex = -1;
            return this.calculateNextCounters(paragraph);
        };
        NumberingListCountersCalculator.prototype.calculateNextCounters = function (paragraph) {
            var paragraphs = paragraph.subDocument.paragraphs;
            if (paragraphs[this.currentParagraphIndex] !== paragraph) {
                var abstractNumberingList = paragraph.getAbstractNumberingList();
                for (var i = this.currentParagraphIndex + 1, currentParagraph; currentParagraph = paragraph.subDocument.paragraphs[i]; i++) {
                    this.currentParagraphIndex++;
                    if (this.shouldAdvanceListLevelCounters(currentParagraph, abstractNumberingList))
                        this.advanceListLevelCounters(currentParagraph, currentParagraph.getListLevelIndex());
                    if (currentParagraph === paragraph)
                        break;
                }
            }
            return this.getActualRangeCounters(paragraph.getListLevelIndex());
        };
        NumberingListCountersCalculator.prototype.getLastCounters = function (paragraph) {
            return this.getActualRangeCounters(paragraph.getListLevelIndex());
        };
        NumberingListCountersCalculator.prototype.shouldAdvanceListLevelCounters = function (paragraph, abstractNumberingList) {
            return paragraph.getAbstractNumberingList() === abstractNumberingList;
        };
        NumberingListCountersCalculator.prototype.advanceListLevelCounters = function (paragraph, listLevelIndex) {
            var numberingListIndex = paragraph.getNumberingListIndex();
            var numberingList = paragraph.subDocument.documentModel.numberingLists[numberingListIndex];
            var level = numberingList.levels[listLevelIndex];
            if (level.overrideStart && !this.usedListIndecies[numberingListIndex]) {
                this.usedListIndecies[numberingListIndex] = true;
                this.counters[listLevelIndex] = level.getNewStart();
            }
            else
                this.counters[listLevelIndex]++;
            this.advanceSkippedLevelCounters(listLevelIndex);
            this.restartNextLevelCounters(listLevelIndex);
        };
        NumberingListCountersCalculator.prototype.advanceSkippedLevelCounters = function (listLevelIndex) {
            for (var i = 0; i < listLevelIndex; i++) {
                var listLevel = this.list.levels[i];
                if (this.counters[i] == listLevel.getListLevelProperties().start - 1)
                    this.counters[i]++;
            }
        };
        NumberingListCountersCalculator.prototype.restartNextLevelCounters = function (listLevelIndex) {
            var restartedLevels = [];
            restartedLevels[listLevelIndex] = true;
            var countersLength = this.counters.length;
            for (var i = listLevelIndex + 1; i < countersLength; i++) {
                var listLevelProperties = this.list.levels[i].getListLevelProperties();
                if (!listLevelProperties.suppressRestart) {
                    var restartLevel = i - listLevelProperties.relativeRestartLevel - 1;
                    if (restartLevel >= 0 && restartLevel < countersLength && restartedLevels[restartLevel]) {
                        this.counters[i] = listLevelProperties.start - 1;
                        restartedLevels[i] = true;
                    }
                }
            }
        };
        NumberingListCountersCalculator.prototype.getActualRangeCounters = function (listLevelIndex) {
            var rangeCounters = [];
            for (var i = 0; i <= listLevelIndex; i++)
                rangeCounters[i] = this.counters[i];
            return rangeCounters;
        };
        return NumberingListCountersCalculator;
    }());
    __aspxRichEdit.NumberingListCountersCalculator = NumberingListCountersCalculator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ListIdProviderBase = (function () {
        function ListIdProviderBase(documentModel) {
            this.documentModel = documentModel;
        }
        ListIdProviderBase.prototype.getNextId = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return ListIdProviderBase;
    }());
    __aspxRichEdit.ListIdProviderBase = ListIdProviderBase;
    var NumberingListIdProvider = (function (_super) {
        __extends(NumberingListIdProvider, _super);
        function NumberingListIdProvider() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.lastId = 0;
            return _this;
        }
        NumberingListIdProvider.prototype.getNextId = function () {
            this.lastId++;
            return this.lastId;
        };
        return NumberingListIdProvider;
    }(ListIdProviderBase));
    __aspxRichEdit.NumberingListIdProvider = NumberingListIdProvider;
    var AbstractNumberingListIdProvider = (function (_super) {
        __extends(AbstractNumberingListIdProvider, _super);
        function AbstractNumberingListIdProvider() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.map = {};
            return _this;
        }
        AbstractNumberingListIdProvider.prototype.getMap = function () {
            if (!this.map) {
                for (var i = 0, list; list = this.documentModel.abstractNumberingLists[i]; i++)
                    this.map[list.innerId] = true;
            }
            return this.map;
        };
        AbstractNumberingListIdProvider.prototype.getNextId = function () {
            var id = -1;
            var map = this.getMap();
            do {
                id = __aspxRichEdit.Utils.getRandomInt(0, __aspxRichEdit.Constants.MAX_SAFE_INT32);
            } while (map[id]);
            map[id] = true;
            return id;
        };
        return AbstractNumberingListIdProvider;
    }(ListIdProviderBase));
    __aspxRichEdit.AbstractNumberingListIdProvider = AbstractNumberingListIdProvider;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var NumberingListIndexCalculator = (function () {
        function NumberingListIndexCalculator(subDocument, targetType, startIndex) {
            this.subDocument = subDocument;
            this.targetType = targetType;
            this.startIndex = startIndex;
        }
        NumberingListIndexCalculator.prototype.getTargetListInfo = function (paragraphIndices) {
            if (this.startIndex === 1)
                return null;
            var targetParagraph;
            var startParagraphIndex = paragraphIndices[0];
            for (var i = startParagraphIndex - 1; i >= 0; i--) {
                if (this.hasSameParagraphType(i)) {
                    var targetParagraph = this.subDocument.paragraphs[i];
                    if (this.startIndex > 1) {
                        var listCounters = this.subDocument.documentModel.getRangeListCounters(targetParagraph);
                        if (listCounters.length !== 1 || listCounters[0] !== this.startIndex - 1)
                            return null;
                    }
                    break;
                }
            }
            if (!targetParagraph && this.hasSameParagraphType(startParagraphIndex + 1))
                targetParagraph = this.subDocument.paragraphs[startParagraphIndex + 1];
            if (targetParagraph) {
                return {
                    listIndex: targetParagraph.getNumberingListIndex(),
                    listlevelIndex: Math.max(0, targetParagraph.getListLevelIndex())
                };
            }
            return null;
        };
        NumberingListIndexCalculator.prototype.hasSameParagraphType = function (paragraphIndex) {
            var paragraph = this.subDocument.paragraphs[paragraphIndex];
            return paragraph && paragraph.isInList() && paragraph.getNumberingList().getListType() === this.targetType;
        };
        return NumberingListIndexCalculator;
    }());
    __aspxRichEdit.NumberingListIndexCalculator = NumberingListIndexCalculator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var NumberingListStyle = (function (_super) {
        __extends(NumberingListStyle, _super);
        function NumberingListStyle(styleName, localizedName, deleted, hidden, semihidden, isDefault, numberingListIndex) {
            var _this = _super.call(this, styleName, localizedName, deleted, hidden, semihidden, isDefault) || this;
            _this.numberingListIndex = numberingListIndex;
            return _this;
        }
        NumberingListStyle.prototype.clone = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return NumberingListStyle;
    }(__aspxRichEdit.StyleBase));
    __aspxRichEdit.NumberingListStyle = NumberingListStyle;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SubDocumentNumberingListCountersManager = (function () {
        function SubDocumentNumberingListCountersManager(subDocument) {
            this.calculators = {};
            this.currentParagraphIndex = -1;
            this.subDocument = subDocument;
        }
        SubDocumentNumberingListCountersManager.prototype.calculateCounters = function (paragraphIndex) {
            if (paragraphIndex < this.currentParagraphIndex)
                this.reset();
            this.currentParagraphIndex = paragraphIndex;
            var paragraph = this.subDocument.paragraphs[paragraphIndex];
            var abstractNumberingListIndex = paragraph.getAbstractNumberingListIndex();
            var calculator = this.getCalculator(abstractNumberingListIndex);
            return calculator.calculateNextCounters(paragraph);
        };
        SubDocumentNumberingListCountersManager.prototype.getCalculator = function (abstractNumberingListIndex) {
            if (!this.calculators[abstractNumberingListIndex])
                this.calculators[abstractNumberingListIndex] = new __aspxRichEdit.NumberingListCountersCalculator(this.subDocument.documentModel.abstractNumberingLists[abstractNumberingListIndex]);
            return this.calculators[abstractNumberingListIndex];
        };
        SubDocumentNumberingListCountersManager.prototype.reset = function () {
            this.calculators = {};
            this.currentParagraphIndex = -1;
        };
        return SubDocumentNumberingListCountersManager;
    }());
    __aspxRichEdit.SubDocumentNumberingListCountersManager = SubDocumentNumberingListCountersManager;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ParagraphStyle = (function (_super) {
        __extends(ParagraphStyle, _super);
        function ParagraphStyle(styleName, localizedName, deleted, hidden, semihidden, isDefault, maskedCharacterProperties, maskedParagraphProperties, tabs, autoUpdate, numberingListIndex, listLevelIndex, base64EncodedImage) {
            var _this = _super.call(this, styleName, localizedName, deleted, hidden, semihidden, isDefault, base64EncodedImage) || this;
            _this.linkedStyle = null;
            _this.nextParagraphStyle = null;
            _this.maskedCharacterProperties = maskedCharacterProperties;
            _this.maskedParagraphProperties = maskedParagraphProperties;
            _this.tabs = tabs;
            _this.autoUpdate = autoUpdate;
            _this.numberingListIndex = numberingListIndex;
            _this.listLevelIndex = listLevelIndex;
            return _this;
        }
        ParagraphStyle.prototype.getNumberingListIndex = function () {
            if (this.numberingListIndex >= 0 || this.numberingListIndex === __aspxRichEdit.NumberingList.NoNumberingListIndex || !this.parent)
                return this.numberingListIndex;
            else
                return this.parent.getNumberingListIndex();
        };
        ParagraphStyle.prototype.getListLevelIndex = function () {
            if (this.listLevelIndex >= 0 || this.listLevelIndex === __aspxRichEdit.NumberingList.NoNumberingListIndex || !this.parent)
                return this.listLevelIndex;
            else
                return this.parent.getListLevelIndex();
        };
        ParagraphStyle.prototype.clone = function () {
            var style = new ParagraphStyle(this.styleName, this.localizedName, this.deleted, this.hidden, this.semihidden, this.isDefault, this.maskedCharacterProperties, this.maskedParagraphProperties, this.tabs.clone(), this.autoUpdate, this.numberingListIndex, this.listLevelIndex, this.base64EncodedImage);
            style.parent = this.parent;
            style.linkedStyle = this.linkedStyle;
            style.nextParagraphStyle = this.nextParagraphStyle;
            style.primary = this.primary;
            return style;
        };
        ParagraphStyle.normalStyleName = "Normal";
        ParagraphStyle.headingStyleName = "heading";
        ParagraphStyle.tocStyleName = "toc";
        return ParagraphStyle;
    }(__aspxRichEdit.StyleBase));
    __aspxRichEdit.ParagraphStyle = ParagraphStyle;
    var TabProperties = (function () {
        function TabProperties() {
            this.tabsInfo = [];
        }
        TabProperties.prototype.clone = function () {
            var tabProperties = new TabProperties();
            for (var i = 0, tab; tab = this.tabsInfo[i]; i++)
                tabProperties.tabsInfo.push(tab.clone());
            return tabProperties;
        };
        TabProperties.prototype.equals = function (obj) {
            for (var i = 0, tab; tab = this.tabsInfo[i]; i++)
                if (!tab.equals(obj.tabsInfo[i]))
                    return false;
            return true;
        };
        TabProperties.prototype.sort = function () {
            this.tabsInfo.sort(function (a, b) { return a.position - b.position; });
        };
        TabProperties.prototype.indexOf = function (tabInfo) {
            return __aspxRichEdit.Utils.binaryIndexOf(this.tabsInfo, function (t) { return t.position - tabInfo.position; });
        };
        TabProperties.prototype.add = function (tabInfo) {
            this.tabsInfo.push(tabInfo);
            this.sort();
        };
        TabProperties.prototype.deleteByIndex = function (index) {
            this.tabsInfo.splice(index, 1);
        };
        TabProperties.prototype.setTabs = function (tabProp) {
            this.tabsInfo = tabProp.tabsInfo;
            this.tabsInfo.sort(function (a, b) { return a.position - b.position; });
        };
        return TabProperties;
    }());
    __aspxRichEdit.TabProperties = TabProperties;
    var TabInfo = (function () {
        function TabInfo(position, alignment, leader, deleted, isDefault) {
            this.position = position;
            this.alignment = alignment;
            this.leader = leader;
            this.isDefault = isDefault;
            this.deleted = deleted;
        }
        TabInfo.prototype.clone = function () {
            return new TabInfo(this.position, this.alignment, this.leader, this.deleted, this.isDefault);
        };
        TabInfo.prototype.equals = function (obj) {
            if (!obj)
                return false;
            return this.alignment == obj.alignment &&
                this.leader == obj.leader &&
                this.position == obj.position &&
                this.deleted == obj.deleted &&
                this.isDefault == obj.isDefault;
        };
        return TabInfo;
    }());
    __aspxRichEdit.TabInfo = TabInfo;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var CharacterPropertiesMerger = (function (_super) {
        __extends(CharacterPropertiesMerger, _super);
        function CharacterPropertiesMerger() {
            return _super.call(this, new __aspxRichEdit.MaskedCharacterProperties(), __aspxRichEdit.CharacterPropertyDescriptor.ALL_FIELDS) || this;
        }
        CharacterPropertiesMerger.prototype.mergeCharacterProperties = function (maskedCharacterProperties) {
            this.mergeAll(maskedCharacterProperties);
        };
        CharacterPropertiesMerger.prototype.mergeMergedCharacterProperties = function (mergedCharacterProperties) {
            var maskedCharacterProperties = new __aspxRichEdit.MaskedCharacterProperties();
            maskedCharacterProperties.copyFrom(mergedCharacterProperties);
            maskedCharacterProperties.useValue = __aspxRichEdit.CharacterPropertiesMask.UseAll;
            this.mergeAll(maskedCharacterProperties);
        };
        CharacterPropertiesMerger.prototype.mergeCharacterStyle = function (characterStyle) {
            var currentCharacterStyle = characterStyle;
            while (currentCharacterStyle) {
                this.mergeAll(currentCharacterStyle.maskedCharacterProperties);
                currentCharacterStyle = currentCharacterStyle.parent;
            }
        };
        CharacterPropertiesMerger.prototype.mergeParagraphStyle = function (paragraphStyle) {
            var currentParagraphStyle = paragraphStyle;
            while (currentParagraphStyle) {
                this.mergeAll(currentParagraphStyle.maskedCharacterProperties);
                currentParagraphStyle = currentParagraphStyle.parent;
            }
        };
        CharacterPropertiesMerger.prototype.mergeTableStyles = function (tableCell) {
            var tableStyle = tableCell.parentRow.parentTable.style;
            var fakeContainer = new __aspxRichEdit.MaskedCharacterProperties();
            fakeContainer.useValue = __aspxRichEdit.CharacterPropertiesMask.UseNone;
            this.mergeTableProperties(__aspxRichEdit.CharacterPropertyDescriptor.hidden, function () { return new __aspxRichEdit.TableStyleCharacterPropertiesMergerHidden().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.CharacterPropertyDescriptor.script, function () { return new __aspxRichEdit.TableStyleCharacterPropertiesMergerScript().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.CharacterPropertyDescriptor.allCaps, function () { return new __aspxRichEdit.TableStyleCharacterPropertiesMergerAllCaps().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.CharacterPropertyDescriptor.noProof, function () { return new __aspxRichEdit.TableStyleCharacterPropertiesMergerNoProof().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.CharacterPropertyDescriptor.bold, function () { return new __aspxRichEdit.TableStyleCharacterPropertiesMergerFontBold().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.CharacterPropertyDescriptor.fontInfo, function () { return new __aspxRichEdit.TableStyleCharacterPropertiesMergerFontName().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.CharacterPropertyDescriptor.size, function () { return new __aspxRichEdit.TableStyleCharacterPropertiesMergerFontSize().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.CharacterPropertyDescriptor.italic, function () { return new __aspxRichEdit.TableStyleCharacterPropertiesMergerFontItalic().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.CharacterPropertyDescriptor.strikeoutType, function () { return new __aspxRichEdit.TableStyleCharacterPropertiesMergerFontStrikeoutType().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.CharacterPropertyDescriptor.underlineType, function () { return new __aspxRichEdit.TableStyleCharacterPropertiesMergerFontUnderlineType().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.CharacterPropertyDescriptor.strikeoutWordsOnly, function () { return new __aspxRichEdit.TableStyleCharacterPropertiesMergerStrikeoutWordsOnly().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.CharacterPropertyDescriptor.underlineWordsOnly, function () { return new __aspxRichEdit.TableStyleCharacterPropertiesMergerUnderlineWordsOnly().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.CharacterPropertyDescriptor.textColor, function () { return new __aspxRichEdit.TableStyleCharacterPropertiesMergerTextColor().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.CharacterPropertyDescriptor.shadingInfo, function () { return new __aspxRichEdit.TableStyleCharacterPropertiesMergerShadingInfo().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.CharacterPropertyDescriptor.highlightColor, function () { return new __aspxRichEdit.TableStyleCharacterPropertiesMergerHighlightColor().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.CharacterPropertyDescriptor.strikeoutColor, function () { return new __aspxRichEdit.TableStyleCharacterPropertiesMergerStrikeoutColor().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.CharacterPropertyDescriptor.underlineColor, function () { return new __aspxRichEdit.TableStyleCharacterPropertiesMergerUnderlineColor().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
        };
        CharacterPropertiesMerger.prototype.getMergedProperties = function () {
            var result = new __aspxRichEdit.CharacterProperties();
            result.copyFrom(this.innerProperties);
            return result;
        };
        return CharacterPropertiesMerger;
    }(__aspxRichEdit.PropertiesMergerBase));
    __aspxRichEdit.CharacterPropertiesMerger = CharacterPropertiesMerger;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ParagraphPropertiesMerger = (function (_super) {
        __extends(ParagraphPropertiesMerger, _super);
        function ParagraphPropertiesMerger() {
            return _super.call(this, new __aspxRichEdit.MaskedParagraphProperties(), ParagraphPropertiesMerger.fields) || this;
        }
        ParagraphPropertiesMerger.prototype.mergeMaskedParagraphProperties = function (maskedParagraphProperties) {
            this.merge(maskedParagraphProperties);
        };
        ParagraphPropertiesMerger.prototype.mergeParagraphStyle = function (paragraphStyle) {
            var currentParagraphStyle = paragraphStyle;
            while (currentParagraphStyle) {
                this.merge(currentParagraphStyle.maskedParagraphProperties);
                currentParagraphStyle = currentParagraphStyle.parent;
            }
        };
        ParagraphPropertiesMerger.prototype.mergeTableStyle = function (tableCell) {
            var tableStyle = tableCell.parentRow.parentTable.style;
            var fakeContainer = new __aspxRichEdit.MaskedParagraphProperties();
            fakeContainer.useValue = __aspxRichEdit.ParagraphPropertiesMask.UseNone;
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.alignment, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerAlignment().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.shadingInfo, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerShadingInfo().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.leftIndent, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerLeftIndent().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.rightIndent, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerRightIndent().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.topBorder, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerTopBorder().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.keepWithNext, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerKeepWithNext().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.outlineLevel, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerOutlineLevel().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.spacingAfter, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerSpacingAfter().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.leftBorder, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerLeftBorder().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.spacingBefore, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerSpacingBefore().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.rightBorder, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerRightBorder().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.bottomBorder, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerBottomBorder().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.betweenBorder, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerBetweenBorder().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.pageBreakBefore, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerPageBreakBefore().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.afterAutoSpacing, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerAfterAutoSpacing().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.keepLinesTogether, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerKeepLinesTogether().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.beforeAutoSpacing, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerBeforeAutoSpacing().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.contextualSpacing, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerContextualSpacing().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.widowOrphanControl, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerWidowOrphanControl().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.suppressHyphenation, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerSuppressHyphenation().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.suppressLineNumbers, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerSuppressLineNumbers().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.firstLineIndent, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerFirstLineIndent().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.firstLineIndentType, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerFirstLineIndentType().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.lineSpacing, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerLineSpacing().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.lineSpacingType, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerLineSpacingType().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.divId, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerDivId().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
            this.mergeTableProperties(__aspxRichEdit.ParagraphPropertyDescriptor.rightToLeft, function () { return new __aspxRichEdit.TableStyleParagraphPropertiesMergerRightToLeft().getProperty(fakeContainer, tableStyle, tableCell.conditionalFormatting, null); });
        };
        ParagraphPropertiesMerger.prototype.getMergedProperties = function () {
            var result = new __aspxRichEdit.ParagraphProperties();
            result.copyFrom(this.innerProperties);
            return result;
        };
        ParagraphPropertiesMerger.prototype.merge = function (properties) {
            var _this = this;
            if (!properties)
                return;
            this.mergeAll(properties);
            this.mergeInternal(properties, __aspxRichEdit.ParagraphPropertiesMask.UseFirstLineIndent, function () {
                _this.innerProperties.firstLineIndent = properties.firstLineIndent;
                _this.innerProperties.firstLineIndentType = properties.firstLineIndentType;
            });
            this.mergeInternal(properties, __aspxRichEdit.ParagraphPropertiesMask.UseLineSpacing, function () {
                _this.innerProperties.lineSpacing = properties.lineSpacing;
                _this.innerProperties.lineSpacingType = properties.lineSpacingType;
            });
        };
        ParagraphPropertiesMerger.fields = __aspxRichEdit.ListUtils.reducedMap(__aspxRichEdit.ParagraphPropertyDescriptor.ALL_FIELDS, function (f) {
            return __aspxRichEdit.EnumUtils.isAnyOf(f.maskValue(), __aspxRichEdit.ParagraphPropertiesMask.UseFirstLineIndent, __aspxRichEdit.ParagraphPropertiesMask.UseLineSpacing) ? null : f;
        });
        return ParagraphPropertiesMerger;
    }(__aspxRichEdit.PropertiesMergerBase));
    __aspxRichEdit.ParagraphPropertiesMerger = ParagraphPropertiesMerger;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SectionHeadersFooters = (function () {
        function SectionHeadersFooters(section) {
            this.indices = {};
            this.section = section;
            this.setObjectIndex(__aspxRichEdit.HeaderFooterType.Even, SectionHeadersFooters.INVALID_INDEX);
            this.setObjectIndex(__aspxRichEdit.HeaderFooterType.Odd, SectionHeadersFooters.INVALID_INDEX);
            this.setObjectIndex(__aspxRichEdit.HeaderFooterType.First, SectionHeadersFooters.INVALID_INDEX);
        }
        SectionHeadersFooters.prototype.getObject = function (type) {
            var index = this.getObjectIndex(type);
            return this.getObjectsCache()[index];
        };
        SectionHeadersFooters.prototype.getObjectIndex = function (type) {
            return this.indices[type];
        };
        SectionHeadersFooters.prototype.setObjectIndex = function (type, objectIndex) {
            this.indices[type] = objectIndex;
        };
        SectionHeadersFooters.prototype.getActualObject = function (firstPageOfSection, isEvenPage) {
            var type = SectionHeadersFooters.getActualObjectType(this.section, firstPageOfSection, isEvenPage);
            var index = this.getObjectIndex(type);
            return this.getObjectsCache()[index];
        };
        SectionHeadersFooters.prototype.copyFrom = function (source) {
            this.indices = {};
            this.setObjectIndex(__aspxRichEdit.HeaderFooterType.Even, source.getObjectIndex(__aspxRichEdit.HeaderFooterType.Even));
            this.setObjectIndex(__aspxRichEdit.HeaderFooterType.Odd, source.getObjectIndex(__aspxRichEdit.HeaderFooterType.Odd));
            this.setObjectIndex(__aspxRichEdit.HeaderFooterType.First, source.getObjectIndex(__aspxRichEdit.HeaderFooterType.First));
        };
        SectionHeadersFooters.prototype.isLinkedToPrevious = function (type) {
            var previousSection = this.section.documentModel.getPreviousSection(this.section);
            return previousSection && this.getContainer(previousSection).getObjectIndex(type) === this.getObjectIndex(type);
        };
        SectionHeadersFooters.prototype.canLinkToPrevious = function () {
            return !!this.section.documentModel.getPreviousSection(this.section);
        };
        SectionHeadersFooters.getActualObjectType = function (section, firstPageOfSection, isEvenPage) {
            if (firstPageOfSection && section.sectionProperties.differentFirstPage)
                return __aspxRichEdit.HeaderFooterType.First;
            return isEvenPage && section.documentModel.differentOddAndEvenPages ? __aspxRichEdit.HeaderFooterType.Even : __aspxRichEdit.HeaderFooterType.Odd;
        };
        SectionHeadersFooters.isLinkedToPrevious = function (section, headerFooterType) {
            return section.headers.isLinkedToPrevious(headerFooterType) || section.footers.isLinkedToPrevious(headerFooterType);
        };
        SectionHeadersFooters.INVALID_INDEX = -1;
        return SectionHeadersFooters;
    }());
    __aspxRichEdit.SectionHeadersFooters = SectionHeadersFooters;
    var SectionHeaders = (function (_super) {
        __extends(SectionHeaders, _super);
        function SectionHeaders() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SectionHeaders.prototype.getContainer = function (section) {
            return section.headers;
        };
        SectionHeaders.prototype.getObjectsCache = function () {
            return this.section.documentModel.headers;
        };
        SectionHeaders.prototype.clone = function () {
            var clone = new SectionHeaders(this.section);
            clone.copyFrom(this);
            return clone;
        };
        return SectionHeaders;
    }(SectionHeadersFooters));
    __aspxRichEdit.SectionHeaders = SectionHeaders;
    var SectionFooters = (function (_super) {
        __extends(SectionFooters, _super);
        function SectionFooters() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SectionFooters.prototype.getContainer = function (section) {
            return section.footers;
        };
        SectionFooters.prototype.getObjectsCache = function () {
            return this.section.documentModel.footers;
        };
        SectionFooters.prototype.clone = function () {
            var clone = new SectionFooters(this.section);
            clone.copyFrom(this);
            return clone;
        };
        return SectionFooters;
    }(SectionHeadersFooters));
    __aspxRichEdit.SectionFooters = SectionFooters;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Section = (function () {
        function Section(documentModel, startLogPosition, length, sectionProperties) {
            this.documentModel = documentModel;
            this.startLogPosition = startLogPosition;
            this.length = length;
            this.sectionProperties = sectionProperties;
            this.headers = new __aspxRichEdit.SectionHeaders(this);
            this.footers = new __aspxRichEdit.SectionFooters(this);
        }
        Section.prototype.getLength = function () {
            return this.length;
        };
        Section.prototype.setLength = function (subDocument, newLength) {
            if (subDocument.isMain())
                this.length = newLength;
        };
        Section.prototype.getEndPosition = function () {
            return this.startLogPosition.value + this.length;
        };
        Section.getPageSectionIndex = function (layoutPage, sections) {
            var layoutPageStartPosition = layoutPage.getPosition();
            return __aspxRichEdit.Utils.normedInterpolationIndexOf(sections, function (s) { return s.startLogPosition.value; }, layoutPageStartPosition);
        };
        Object.defineProperty(Section.prototype, "interval", {
            get: function () { return new __aspxRichEdit.FixedInterval(this.startLogPosition.value, this.length); },
            enumerable: true,
            configurable: true
        });
        return Section;
    }());
    __aspxRichEdit.Section = Section;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Shape = (function () {
        function Shape(fillColor, outlineColor, outlineWidth) {
            if (fillColor === void 0) { fillColor = __aspxRichEdit.ColorHelper.NO_COLOR; }
            if (outlineColor === void 0) { outlineColor = __aspxRichEdit.ColorHelper.NO_COLOR; }
            if (outlineWidth === void 0) { outlineWidth = 0; }
            this.fillColor = __aspxRichEdit.ColorHelper.NO_COLOR;
            this.outlineColor = __aspxRichEdit.ColorHelper.NO_COLOR;
            this.outlineWidth = 0;
            this.fillColor = fillColor;
            this.outlineColor = outlineColor;
            this.outlineWidth = outlineWidth;
        }
        Shape.prototype.clone = function () {
            return new Shape(this.fillColor, this.outlineColor, this.outlineWidth);
        };
        Shape.prototype.copyFrom = function (obj) {
            this.fillColor = obj.fillColor;
            this.outlineColor = obj.outlineColor;
            this.outlineWidth = obj.outlineWidth;
        };
        Shape.prototype.toAnotherMeasuringSystem = function (converter) {
            this.outlineWidth = converter(this.outlineWidth);
            return this;
        };
        Shape.prototype.equals = function (obj) {
            if (!obj)
                return false;
            return this.fillColor == obj.fillColor &&
                this.outlineColor == obj.outlineColor &&
                this.outlineWidth == obj.outlineWidth;
        };
        return Shape;
    }());
    __aspxRichEdit.Shape = Shape;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableCellUtils = (function () {
        function TableCellUtils() {
        }
        TableCellUtils.getCellIndexByColumnIndex = function (row, startColumnIndex) {
            var columnIndex = row.gridBefore;
            for (var i = 0, cell = void 0; cell = row.cells[i]; i++) {
                if (startColumnIndex >= columnIndex && startColumnIndex < columnIndex + cell.columnSpan)
                    return i;
                columnIndex += cell.columnSpan;
            }
            return -1;
        };
        TableCellUtils.getCellIndexByEndColumnIndex = function (row, endColumnIndex) {
            var cellIndexByColumnIndex = this.getCellIndexByColumnIndex(row, endColumnIndex);
            if (cellIndexByColumnIndex < 0)
                return -1;
            var cellByColumnIndex = row.cells[cellIndexByColumnIndex];
            if (this.getStartColumnIndex(cellByColumnIndex) + cellByColumnIndex.columnSpan - 1 <= endColumnIndex)
                return cellIndexByColumnIndex;
            if (cellIndexByColumnIndex != 0)
                return cellIndexByColumnIndex - 1;
            return -1;
        };
        TableCellUtils.getStartColumnIndex = function (cell) {
            var columnIndex = cell.parentRow.gridBefore;
            var row = cell.parentRow;
            for (var i = 0, currentCell = void 0; currentCell = row.cells[i]; i++) {
                if (currentCell === cell)
                    break;
                columnIndex += currentCell.columnSpan;
            }
            return columnIndex;
        };
        TableCellUtils.getEndColumnIndex = function (cell) {
            return this.getStartColumnIndex(cell) + cell.columnSpan - 1;
        };
        TableCellUtils.getColumnCount = function (table) {
            var row = table.rows[0];
            var result = row.gridBefore + row.gridAfter;
            for (var cellIndex = 0, cell = void 0; cell = row.cells[cellIndex]; cellIndex++) {
                result += cell.columnSpan;
            }
            return result;
        };
        TableCellUtils.getCellIndicesByColumnsRange = function (row, interval) {
            var indices = [];
            var startColumnIndex = interval.start;
            while (startColumnIndex < interval.end) {
                var cellIndex = this.getCellIndexByColumnIndex(row, startColumnIndex);
                var cell = row.cells[cellIndex];
                if (!cell)
                    return indices;
                indices.push(cellIndex);
                startColumnIndex += startColumnIndex - this.getStartColumnIndex(cell) + cell.columnSpan;
            }
            return indices;
        };
        TableCellUtils.getColumnsRangeBySelectedRow = function (gridInfoManager, rowInfo) {
            var rowGridInfo = gridInfoManager.tableCellInfos[rowInfo.rowIndex];
            var lastCellInfo = __aspxRichEdit.ListUtils.last(rowInfo.cells);
            return new __aspxRichEdit.BoundaryInterval(rowGridInfo[rowInfo.cells[0].cellIndex].getGridCellIndex(), rowGridInfo[lastCellInfo.cellIndex].getGridCellIndex() + lastCellInfo.cell.columnSpan);
        };
        TableCellUtils.getColumnsRangeBySelectedCells = function (data) {
            return __aspxRichEdit.ListUtils.accumulate(data.rows, null, function (acc, rowInfo) {
                var currRowInterval = TableCellUtils.getColumnsRangeBySelectedRow(data.info.gridInfoManager, rowInfo);
                return acc ? new __aspxRichEdit.BoundaryInterval(Math.max(currRowInterval.start, acc.start), Math.min(currRowInterval.end, acc.end)) : currRowInterval;
            });
        };
        TableCellUtils.getAbsoluteCellIndexInRow = function (row, columnIndex) {
            if (!row.cells.length)
                throw new Error("Empty row");
            columnIndex -= row.gridBefore;
            var cellIndex = 0;
            var cellsCount = row.cells.length;
            while (columnIndex > 0 && cellIndex < cellsCount) {
                var currentCell = row.cells[cellIndex];
                columnIndex -= currentCell.columnSpan;
                if (columnIndex >= 0)
                    cellIndex++;
            }
            return cellIndex;
        };
        TableCellUtils.getVerticalSpanCellPositions = function (restartCellPosition, patternCellStartColumnIndex) {
            var positions = [];
            positions.push(restartCellPosition);
            if (restartCellPosition.cell.verticalMerging !== __aspxRichEdit.TableCellMergingState.Restart)
                return positions;
            var table = restartCellPosition.table;
            for (var rowIndex = restartCellPosition.rowIndex + 1, nextRow = void 0; nextRow = table.rows[rowIndex]; rowIndex++) {
                var nextRowCellIndex = this.getCellIndexByColumnIndex(nextRow, patternCellStartColumnIndex);
                var nextCell = nextRow.cells[nextRowCellIndex];
                if (nextCell && nextCell.verticalMerging === __aspxRichEdit.TableCellMergingState.Continue)
                    positions.push(__aspxRichEdit.TablePosition.createAndInit(table, rowIndex, nextRowCellIndex));
                else
                    break;
            }
            return positions;
        };
        TableCellUtils.getSameTableCells = function (firstCell, lastCell) {
            var rightOrder = firstCell.parentRow.parentTable.nestedLevel >= lastCell.parentRow.parentTable.nestedLevel;
            var topLevelCell = rightOrder ? firstCell : lastCell;
            var lowLevelCell = rightOrder ? lastCell : firstCell;
            while (topLevelCell.parentRow.parentTable.nestedLevel > lowLevelCell.parentRow.parentTable.nestedLevel)
                topLevelCell = topLevelCell.parentRow.parentTable.parentCell;
            while (true) {
                if (topLevelCell.parentRow.parentTable === lowLevelCell.parentRow.parentTable)
                    return {
                        firstCell: rightOrder ? topLevelCell : lowLevelCell,
                        lastCell: rightOrder ? lowLevelCell : topLevelCell
                    };
                topLevelCell = topLevelCell.parentRow.parentTable.parentCell;
                lowLevelCell = lowLevelCell.parentRow.parentTable.parentCell;
                if (!topLevelCell || !lowLevelCell)
                    return null;
            }
        };
        return TableCellUtils;
    }());
    __aspxRichEdit.TableCellUtils = TableCellUtils;
    var TableConditionalFormattingCalculator = (function () {
        function TableConditionalFormattingCalculator() {
        }
        TableConditionalFormattingCalculator.updateTable = function (control, table) {
            var tableStyleColumnBandSize = new __aspxRichEdit.TablePropertiesMergerStyleColumnBandSize().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, control.model.defaultTableProperties);
            var tableStyleRowBandSize = new __aspxRichEdit.TablePropertiesMergerStyleRowBandSize().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, control.model.defaultTableProperties);
            for (var rowIndex = 0, row = void 0; row = table.rows[rowIndex]; rowIndex++) {
                var rowConditionalFormatting = this.getRowConditionalFormatting(table.lookTypes, tableStyleRowBandSize, table, rowIndex);
                ;
                if (row.conditionalFormatting !== rowConditionalFormatting)
                    control.history.addAndRedo(new __aspxRichEdit.TableRowConditionalFormattingHistoryItem(control.modelManipulator, control.model.activeSubDocument, table.index, rowIndex, rowConditionalFormatting));
                for (var cellIndex = 0, cell = void 0; cell = row.cells[cellIndex]; cellIndex++) {
                    var cellConditionalFormatting = rowConditionalFormatting | this.getCellConditionalFormatting(table.lookTypes, tableStyleColumnBandSize, table, rowIndex, cellIndex);
                    if (cell.conditionalFormatting !== cellConditionalFormatting)
                        control.history.addAndRedo(new __aspxRichEdit.TableCellConditionalFormattingHistoryItem(control.modelManipulator, control.model.activeSubDocument, table.index, rowIndex, cellIndex, cellConditionalFormatting));
                }
            }
        };
        TableConditionalFormattingCalculator.updateTableWithoutHistory = function (model, table) {
            var tableStyleColumnBandSize = new __aspxRichEdit.TablePropertiesMergerStyleColumnBandSize().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, model.defaultTableProperties);
            var tableStyleRowBandSize = new __aspxRichEdit.TablePropertiesMergerStyleRowBandSize().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, model.defaultTableProperties);
            for (var rowIndex = 0, row = void 0; row = table.rows[rowIndex]; rowIndex++) {
                row.conditionalFormatting = this.getRowConditionalFormatting(table.lookTypes, tableStyleRowBandSize, table, rowIndex);
                ;
                for (var cellIndex = 0, cell = void 0; cell = row.cells[cellIndex]; cellIndex++)
                    cell.conditionalFormatting = row.conditionalFormatting | TableConditionalFormattingCalculator.getCellConditionalFormatting(table.lookTypes, tableStyleColumnBandSize, table, rowIndex, cellIndex);
            }
        };
        TableConditionalFormattingCalculator.getRowConditionalFormatting = function (tableLook, tableStyleRowBandSize, table, rowIndex) {
            var result = __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable;
            if (tableLook & __aspxRichEdit.TableLookTypes.ApplyFirstRow) {
                if (rowIndex === 0)
                    result |= __aspxRichEdit.ConditionalTableStyleFormatting.FirstRow;
            }
            if (tableLook & __aspxRichEdit.TableLookTypes.ApplyLastRow) {
                if (rowIndex === table.rows.length - 1)
                    result |= __aspxRichEdit.ConditionalTableStyleFormatting.LastRow;
            }
            if (!(tableLook & __aspxRichEdit.TableLookTypes.DoNotApplyRowBanding) && !(result & __aspxRichEdit.ConditionalTableStyleFormatting.FirstRow || result & __aspxRichEdit.ConditionalTableStyleFormatting.LastRow)) {
                if (tableLook & __aspxRichEdit.TableLookTypes.ApplyFirstRow)
                    rowIndex--;
                if (Math.floor(rowIndex / tableStyleRowBandSize) % 2 == 0)
                    result |= __aspxRichEdit.ConditionalTableStyleFormatting.OddRowBanding;
                else
                    result |= __aspxRichEdit.ConditionalTableStyleFormatting.EvenRowBanding;
            }
            return result;
        };
        TableConditionalFormattingCalculator.getCellConditionalFormatting = function (tableLook, tableStyleColumnBandSize, table, rowIndex, cellIndex) {
            var result = __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable;
            var row = table.rows[rowIndex];
            if (tableLook & __aspxRichEdit.TableLookTypes.ApplyFirstColumn) {
                if (cellIndex === 0)
                    result |= __aspxRichEdit.ConditionalTableStyleFormatting.FirstColumn;
            }
            if (tableLook & __aspxRichEdit.TableLookTypes.ApplyLastColumn) {
                if (cellIndex === row.cells.length - 1)
                    result |= __aspxRichEdit.ConditionalTableStyleFormatting.LastColumn;
            }
            if (tableLook & __aspxRichEdit.TableLookTypes.ApplyFirstRow && rowIndex === 0) {
                if (tableLook & __aspxRichEdit.TableLookTypes.ApplyFirstColumn && cellIndex === 0)
                    result |= __aspxRichEdit.ConditionalTableStyleFormatting.TopLeftCell;
                if (tableLook & __aspxRichEdit.TableLookTypes.ApplyLastColumn && cellIndex === row.cells.length - 1)
                    result |= __aspxRichEdit.ConditionalTableStyleFormatting.TopRightCell;
            }
            else if (tableLook & __aspxRichEdit.TableLookTypes.ApplyLastRow && rowIndex === table.rows.length - 1) {
                if (tableLook & __aspxRichEdit.TableLookTypes.ApplyFirstColumn && cellIndex === 0)
                    result |= __aspxRichEdit.ConditionalTableStyleFormatting.BottomLeftCell;
                if (tableLook & __aspxRichEdit.TableLookTypes.ApplyLastColumn && cellIndex === row.cells.length - 1)
                    result |= __aspxRichEdit.ConditionalTableStyleFormatting.BottomRightCell;
            }
            if (!(tableLook & __aspxRichEdit.TableLookTypes.DoNotApplyColumnBanding) && !(result & __aspxRichEdit.ConditionalTableStyleFormatting.FirstColumn || result & __aspxRichEdit.ConditionalTableStyleFormatting.LastColumn)) {
                if (tableLook & __aspxRichEdit.TableLookTypes.ApplyFirstColumn)
                    cellIndex--;
                if (Math.floor(cellIndex / tableStyleColumnBandSize) % 2 == 0)
                    result |= __aspxRichEdit.ConditionalTableStyleFormatting.OddColumnBanding;
                else
                    result |= __aspxRichEdit.ConditionalTableStyleFormatting.EvenColumnBanding;
            }
            return result;
        };
        return TableConditionalFormattingCalculator;
    }());
    __aspxRichEdit.TableConditionalFormattingCalculator = TableConditionalFormattingCalculator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var CultureInfo = (function () {
        function CultureInfo(name) {
            this.name = name;
        }
        return CultureInfo;
    }());
    __aspxRichEdit.CultureInfo = CultureInfo;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var OfficeTheme = (function () {
        function OfficeTheme() {
            this.name = "";
            this.colors = new __aspxRichEdit.ThemeDrawingColorCollection();
            this.fontScheme = new __aspxRichEdit.ThemeFontScheme();
            this.formatScheme = new __aspxRichEdit.ThemeFormatScheme();
        }
        Object.defineProperty(OfficeTheme.prototype, "isValidate", {
            get: function () {
                return !__aspxRichEdit.StringUtils.isNullOrEmpty(this.name) && this.colors.isValidate && this.fontScheme.isValidate && this.formatScheme.isValidate;
            },
            enumerable: true,
            configurable: true
        });
        OfficeTheme.prototype.copyFrom = function (sourceObj) {
            this.name = sourceObj.name;
            this.colors.copyFrom(sourceObj.colors);
            this.fontScheme.copyFrom(sourceObj.fontScheme);
            this.formatScheme.copyFrom(sourceObj.formatScheme);
        };
        OfficeTheme.prototype.clear = function () {
            this.name = "";
            this.colors.clear();
            this.fontScheme.clear();
            this.formatScheme.clear();
        };
        OfficeTheme.prototype.clone = function () {
            var result = new OfficeTheme();
            result.copyFrom(this);
            return result;
        };
        return OfficeTheme;
    }());
    __aspxRichEdit.OfficeTheme = OfficeTheme;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ThemeDrawingColorCollection = (function () {
        function ThemeDrawingColorCollection() {
            this.name = "";
            this.innerCollection = {};
        }
        ThemeDrawingColorCollection.prototype.tryGetDrawingColor = function (themeColorIndex) {
            return this.innerCollection[themeColorIndex];
        };
        ThemeDrawingColorCollection.prototype.setDrawingColor = function (themeColorIndex, value) {
            this.innerCollection[themeColorIndex] = value;
        };
        Object.defineProperty(ThemeDrawingColorCollection.prototype, "Light1", {
            get: function () { return this.tryGetDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.Light1); },
            set: function (value) { this.setDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.Light1, value); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ThemeDrawingColorCollection.prototype, "Light2", {
            get: function () { return this.tryGetDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.Light2); },
            set: function (value) { this.setDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.Light2, value); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ThemeDrawingColorCollection.prototype, "Dark1", {
            get: function () { return this.tryGetDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.Dark1); },
            set: function (value) { this.setDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.Dark1, value); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ThemeDrawingColorCollection.prototype, "Dark2", {
            get: function () { return this.tryGetDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.Dark1); },
            set: function (value) { this.setDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.Dark1, value); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ThemeDrawingColorCollection.prototype, "Accent1", {
            get: function () { return this.tryGetDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.Accent1); },
            set: function (value) { this.setDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.Accent1, value); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ThemeDrawingColorCollection.prototype, "Accent2", {
            get: function () { return this.tryGetDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.Accent2); },
            set: function (value) { this.setDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.Accent2, value); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ThemeDrawingColorCollection.prototype, "Accent3", {
            get: function () { return this.tryGetDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.Accent3); },
            set: function (value) { this.setDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.Accent3, value); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ThemeDrawingColorCollection.prototype, "Accent4", {
            get: function () { return this.tryGetDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.Accent4); },
            set: function (value) { this.setDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.Accent4, value); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ThemeDrawingColorCollection.prototype, "Accent5", {
            get: function () { return this.tryGetDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.Accent5); },
            set: function (value) { this.setDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.Accent5, value); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ThemeDrawingColorCollection.prototype, "Accent6", {
            get: function () { return this.tryGetDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.Accent6); },
            set: function (value) { this.setDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.Accent6, value); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ThemeDrawingColorCollection.prototype, "Hyperlink", {
            get: function () { return this.tryGetDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.Hyperlink); },
            set: function (value) { this.setDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.Hyperlink, value); },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(ThemeDrawingColorCollection.prototype, "FollowedHyperlink", {
            get: function () { return this.tryGetDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.FollowedHyperlink); },
            set: function (value) { this.setDrawingColor(__aspxRichEdit.ThemeColorIndexConstants.FollowedHyperlink, value); },
            enumerable: true,
            configurable: true
        });
        ThemeDrawingColorCollection.prototype.isValidate = function () { return this.checkValidation(); };
        ThemeDrawingColorCollection.prototype.getColorByThemeColorIndex = function (colorProvider, themeColorIndex) {
            var drawingColor = this.tryGetDrawingColor(themeColorIndex);
            if (drawingColor == null)
                throw new Error(__aspxRichEdit.Errors.InternalException);
            return drawingColor.finalColor(colorProvider);
        };
        ThemeDrawingColorCollection.prototype.getColorBySchemeColorValues = function (colorProvider, value) {
            return this.getColorByThemeColorIndex(colorProvider, ThemeDrawingColorCollection.schemeColorValuesToThemeColorIndexTranslationTable[value]);
        };
        ThemeDrawingColorCollection.prototype.copyFrom = function (sourceObj) {
            this.clear();
            this.name = sourceObj.name;
            this.innerCollection = __aspxRichEdit.MapUtilsKeyAsNumber.map(sourceObj.innerCollection, function (val) { return val; });
        };
        ThemeDrawingColorCollection.prototype.clear = function () {
            this.name = "";
            __aspxRichEdit.MapUtilsKeyAsNumber.clear(this.innerCollection);
        };
        ThemeDrawingColorCollection.prototype.checkValidation = function () {
            return this.name != null &&
                __aspxRichEdit.MapUtilsKeyAsNumber.mapLength(this.innerCollection) == 12 &&
                this.innerCollection[__aspxRichEdit.ThemeColorIndexConstants.Dark1] !== undefined &&
                this.innerCollection[__aspxRichEdit.ThemeColorIndexConstants.Light1] !== undefined &&
                this.innerCollection[__aspxRichEdit.ThemeColorIndexConstants.Dark2] !== undefined &&
                this.innerCollection[__aspxRichEdit.ThemeColorIndexConstants.Light2] !== undefined &&
                this.innerCollection[__aspxRichEdit.ThemeColorIndexConstants.Accent1] !== undefined &&
                this.innerCollection[__aspxRichEdit.ThemeColorIndexConstants.Accent2] !== undefined &&
                this.innerCollection[__aspxRichEdit.ThemeColorIndexConstants.Accent3] !== undefined &&
                this.innerCollection[__aspxRichEdit.ThemeColorIndexConstants.Accent4] !== undefined &&
                this.innerCollection[__aspxRichEdit.ThemeColorIndexConstants.Accent5] !== undefined &&
                this.innerCollection[__aspxRichEdit.ThemeColorIndexConstants.Accent6] !== undefined &&
                this.innerCollection[__aspxRichEdit.ThemeColorIndexConstants.Hyperlink] !== undefined &&
                this.innerCollection[__aspxRichEdit.ThemeColorIndexConstants.FollowedHyperlink] !== undefined;
        };
        ThemeDrawingColorCollection.schemeColorValuesToThemeColorIndexTranslationTable = new __aspxRichEdit.MapCreatorNumberAsKey()
            .add(__aspxRichEdit.SchemeColorValues.Background1, __aspxRichEdit.ThemeColorIndexConstants.Light1)
            .add(__aspxRichEdit.SchemeColorValues.Background2, __aspxRichEdit.ThemeColorIndexConstants.Light2)
            .add(__aspxRichEdit.SchemeColorValues.Text1, __aspxRichEdit.ThemeColorIndexConstants.Dark1)
            .add(__aspxRichEdit.SchemeColorValues.Text2, __aspxRichEdit.ThemeColorIndexConstants.Dark2)
            .add(__aspxRichEdit.SchemeColorValues.Light1, __aspxRichEdit.ThemeColorIndexConstants.Light1)
            .add(__aspxRichEdit.SchemeColorValues.Light2, __aspxRichEdit.ThemeColorIndexConstants.Light2)
            .add(__aspxRichEdit.SchemeColorValues.Dark1, __aspxRichEdit.ThemeColorIndexConstants.Dark1)
            .add(__aspxRichEdit.SchemeColorValues.Dark2, __aspxRichEdit.ThemeColorIndexConstants.Dark2)
            .add(__aspxRichEdit.SchemeColorValues.Accent1, __aspxRichEdit.ThemeColorIndexConstants.Accent1)
            .add(__aspxRichEdit.SchemeColorValues.Accent2, __aspxRichEdit.ThemeColorIndexConstants.Accent2)
            .add(__aspxRichEdit.SchemeColorValues.Accent3, __aspxRichEdit.ThemeColorIndexConstants.Accent3)
            .add(__aspxRichEdit.SchemeColorValues.Accent4, __aspxRichEdit.ThemeColorIndexConstants.Accent4)
            .add(__aspxRichEdit.SchemeColorValues.Accent5, __aspxRichEdit.ThemeColorIndexConstants.Accent5)
            .add(__aspxRichEdit.SchemeColorValues.Accent6, __aspxRichEdit.ThemeColorIndexConstants.Accent6)
            .add(__aspxRichEdit.SchemeColorValues.Hyperlink, __aspxRichEdit.ThemeColorIndexConstants.Hyperlink)
            .add(__aspxRichEdit.SchemeColorValues.FollowedHyperlink, __aspxRichEdit.ThemeColorIndexConstants.FollowedHyperlink)
            .get();
        return ThemeDrawingColorCollection;
    }());
    __aspxRichEdit.ThemeDrawingColorCollection = ThemeDrawingColorCollection;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ThemeFontScheme = (function () {
        function ThemeFontScheme() {
            this.name = "";
            this.minorFont = new __aspxRichEdit.ThemeFontSchemePart();
            this.majorFont = new __aspxRichEdit.ThemeFontSchemePart();
        }
        Object.defineProperty(ThemeFontScheme.prototype, "isValidate", {
            get: function () { return !__aspxRichEdit.StringUtils.isNullOrEmpty(this.name) && this.minorFont.isValid && this.majorFont.isValid; },
            enumerable: true,
            configurable: true
        });
        ThemeFontScheme.prototype.getTypeface = function (schemeStyle, currentUICulture) {
            if (schemeStyle == __aspxRichEdit.XlFontSchemeStyles.None)
                return "";
            if (schemeStyle == __aspxRichEdit.XlFontSchemeStyles.Minor)
                return this.minorFont.getTypeface(currentUICulture);
            return this.majorFont.getTypeface(currentUICulture);
        };
        ThemeFontScheme.prototype.copyFrom = function (sourceObj) {
            this.name = sourceObj.name;
            this.majorFont.copyFrom(sourceObj.majorFont);
            this.minorFont.copyFrom(sourceObj.minorFont);
        };
        ThemeFontScheme.prototype.clear = function () {
            this.name = "";
            this.majorFont.clear();
            this.minorFont.clear();
        };
        return ThemeFontScheme;
    }());
    __aspxRichEdit.ThemeFontScheme = ThemeFontScheme;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ThemeFontSchemePart = (function () {
        function ThemeFontSchemePart() {
            this.supplementalFonts = {};
            this.isValid = false;
            this.latin = new __aspxRichEdit.DrawingTextFont();
            this.eastAsian = new __aspxRichEdit.DrawingTextFont();
            this.complexScript = new __aspxRichEdit.DrawingTextFont();
        }
        ThemeFontSchemePart.prototype.addSupplementalFont = function (script, typeface) {
            if (!__aspxRichEdit.StringUtils.isNullOrEmpty(script) && !this.supplementalFonts[script] !== undefined)
                this.supplementalFonts[script] = typeface;
        };
        ThemeFontSchemePart.prototype.copyFrom = function (value) {
            var _this = this;
            this.latin.copyFrom(value.latin);
            this.eastAsian.copyFrom(value.eastAsian);
            this.complexScript.copyFrom(value.complexScript);
            this.isValid = value.isValid;
            __aspxRichEdit.MapUtilsKeyAsString.clear(this.supplementalFonts);
            __aspxRichEdit.MapUtilsKeyAsString.foreach(value.supplementalFonts, function (value, key) { return _this.addSupplementalFont[key] = value; });
        };
        ThemeFontSchemePart.prototype.getTypeface = function (currentUICulture) {
            var name = currentUICulture.name;
            var script = ThemeFontSchemePart.cultureNameToScriptTable[name];
            if (script !== undefined) {
                if (this.supplementalFonts[script] !== undefined)
                    return this.supplementalFonts[script];
            }
            return this.getDefaultTypeface();
        };
        ThemeFontSchemePart.prototype.clear = function () {
            this.latin.clear();
            this.eastAsian.clear();
            this.complexScript.clear();
            __aspxRichEdit.MapUtilsKeyAsString.clear(this.supplementalFonts);
            this.isValid = false;
        };
        ThemeFontSchemePart.prototype.getDefaultTypeface = function () {
            return this.latin.typeface;
        };
        ThemeFontSchemePart.cultureNameToScriptTable = new __aspxRichEdit.MapCreatorStringAsKey()
            .add("ar-LY", "Arab")
            .add("ar-DZ", "Arab")
            .add("ar-MA", "Arab")
            .add("ar-TN", "Arab")
            .add("ar-OM", "Arab")
            .add("ar-YE", "Arab")
            .add("ar-SY", "Arab")
            .add("ar-JO", "Arab")
            .add("ar-LB", "Arab")
            .add("ar-KW", "Arab")
            .add("ar-AE", "Arab")
            .add("ar-BH", "Arab")
            .add("ar-QA", "Arab")
            .add("ar-SA", "Arab")
            .add("ur-PK", "Arab")
            .add("fa-IR", "Arab")
            .add("ps-AF", "Arab")
            .add("prs-AF", "Arab")
            .add("ar-IQ", "Arab")
            .add("ar-EG", "Arab")
            .add("hy-AM", "Armn")
            .add("bn-IN", "Beng")
            .add("as-IN", "Beng")
            .add("bn-BD", "Beng")
            .add("iu-Cans-CA", "Cans")
            .add("sr-Cyrl-BA", "Cyrl")
            .add("bs-Cyrl-BA", "Cyrl")
            .add("sr-Cyrl-RS", "Cyrl")
            .add("sr-Cyrl-ME", "Cyrl")
            .add("bg-BG", "Cyrl")
            .add("ru-RU", "Cyrl")
            .add("uk-UA", "Cyrl")
            .add("be-BY", "Cyrl")
            .add("tg-Cyrl-TJ", "Cyrl")
            .add("mk-MK", "Cyrl")
            .add("kk-KZ", "Cyrl")
            .add("ky-KG", "Cyrl")
            .add("tt-RU", "Cyrl")
            .add("mn-MN", "Cyrl")
            .add("ba-RU", "Cyrl")
            .add("sah-RU", "Cyrl")
            .add("az-Cyrl-AZ", "Cyrl")
            .add("uz-Cyrl-UZ", "Cyrl")
            .add("sr-Cyrl-CS", "Cyrl")
            .add("hi-IN", "Deva")
            .add("mr-IN", "Deva")
            .add("sa-IN", "Deva")
            .add("kok-IN", "Deva")
            .add("ne-NP", "Deva")
            .add("am-ET", "Ethi")
            .add("ka-GE", "Geor")
            .add("el-GR", "Grek")
            .add("gu-IN", "Gujr")
            .add("pa-IN", "Guru")
            .add("ko-KR", "Hang")
            .add("zh-SG", "Hans")
            .add("zh-CN", "Hans")
            .add("zh-MO", "Hant")
            .add("zh-TW", "Hant")
            .add("zh-HK", "Hant")
            .add("he-IL", "Hebr")
            .add("ja-JP", "Jpan")
            .add("km-KH", "Khmr")
            .add("kn-IN", "Knda")
            .add("lo-LA", "Laoo")
            .add("de-LU", "Latn")
            .add("en-CA", "Latn")
            .add("es-GT", "Latn")
            .add("fr-CH", "Latn")
            .add("hr-BA", "Latn")
            .add("smj-NO", "Latn")
            .add("de-LI", "Latn")
            .add("en-NZ", "Latn")
            .add("es-CR", "Latn")
            .add("fr-LU", "Latn")
            .add("bs-Latn-BA", "Latn")
            .add("smj-SE", "Latn")
            .add("en-IE", "Latn")
            .add("es-PA", "Latn")
            .add("fr-MC", "Latn")
            .add("sr-Latn-BA", "Latn")
            .add("sma-NO", "Latn")
            .add("en-ZA", "Latn")
            .add("es-DO", "Latn")
            .add("sma-SE", "Latn")
            .add("en-JM", "Latn")
            .add("es-VE", "Latn")
            .add("sms-FI", "Latn")
            .add("en-029", "Latn")
            .add("es-CO", "Latn")
            .add("sr-Latn-RS", "Latn")
            .add("smn-FI", "Latn")
            .add("en-BZ", "Latn")
            .add("es-PE", "Latn")
            .add("en-TT", "Latn")
            .add("es-AR", "Latn")
            .add("sr-Latn-ME", "Latn")
            .add("en-ZW", "Latn")
            .add("es-EC", "Latn")
            .add("en-PH", "Latn")
            .add("es-CL", "Latn")
            .add("es-UY", "Latn")
            .add("es-PY", "Latn")
            .add("en-IN", "Latn")
            .add("es-BO", "Latn")
            .add("ca-ES", "Latn")
            .add("cs-CZ", "Latn")
            .add("da-DK", "Latn")
            .add("de-DE", "Latn")
            .add("en-US", "Latn")
            .add("es-ES", "Latn")
            .add("fi-FI", "Latn")
            .add("fr-FR", "Latn")
            .add("hu-HU", "Latn")
            .add("is-IS", "Latn")
            .add("it-IT", "Latn")
            .add("nl-NL", "Latn")
            .add("nb-NO", "Latn")
            .add("pl-PL", "Latn")
            .add("pt-BR", "Latn")
            .add("rm-CH", "Latn")
            .add("ro-RO", "Latn")
            .add("hr-HR", "Latn")
            .add("sk-SK", "Latn")
            .add("sq-AL", "Latn")
            .add("sv-SE", "Latn")
            .add("tr-TR", "Latn")
            .add("id-ID", "Latn")
            .add("sl-SI", "Latn")
            .add("et-EE", "Latn")
            .add("lv-LV", "Latn")
            .add("lt-LT", "Latn")
            .add("az-Latn-AZ", "Latn")
            .add("eu-ES", "Latn")
            .add("hsb-DE", "Latn")
            .add("tn-ZA", "Latn")
            .add("xh-ZA", "Latn")
            .add("zu-ZA", "Latn")
            .add("af-ZA", "Latn")
            .add("fo-FO", "Latn")
            .add("mt-MT", "Latn")
            .add("se-NO", "Latn")
            .add("ms-MY", "Latn")
            .add("en-MY", "Latn")
            .add("es-SV", "Latn")
            .add("sw-KE", "Latn")
            .add("tk-TM", "Latn")
            .add("uz-Latn-UZ", "Latn")
            .add("cy-GB", "Latn")
            .add("gl-ES", "Latn")
            .add("fy-NL", "Latn")
            .add("fil-PH", "Latn")
            .add("ha-Latn-NG", "Latn")
            .add("yo-NG", "Latn")
            .add("quz-BO", "Latn")
            .add("nso-ZA", "Latn")
            .add("lb-LU", "Latn")
            .add("kl-GL", "Latn")
            .add("ig-NG", "Latn")
            .add("arn-CL", "Latn")
            .add("moh-CA", "Latn")
            .add("br-FR", "Latn")
            .add("en-SG", "Latn")
            .add("es-HN", "Latn")
            .add("mi-NZ", "Latn")
            .add("oc-FR", "Latn")
            .add("co-FR", "Latn")
            .add("gsw-FR", "Latn")
            .add("qut-GT", "Latn")
            .add("rw-RW", "Latn")
            .add("wo-SN", "Latn")
            .add("gd-GB", "Latn")
            .add("es-NI", "Latn")
            .add("es-PR", "Latn")
            .add("es-US", "Latn")
            .add("de-CH", "Latn")
            .add("en-GB", "Latn")
            .add("es-MX", "Latn")
            .add("fr-BE", "Latn")
            .add("it-CH", "Latn")
            .add("nl-BE", "Latn")
            .add("nn-NO", "Latn")
            .add("pt-PT", "Latn")
            .add("sr-Latn-CS", "Latn")
            .add("sv-FI", "Latn")
            .add("dsb-DE", "Latn")
            .add("se-SE", "Latn")
            .add("ga-IE", "Latn")
            .add("ms-BN", "Latn")
            .add("iu-Latn-CA", "Latn")
            .add("tzm-Latn-DZ", "Latn")
            .add("quz-EC", "Latn")
            .add("de-AT", "Latn")
            .add("en-AU", "Latn")
            .add("fr-CA", "Latn")
            .add("se-FI", "Latn")
            .add("quz-PE", "Latn")
            .add("ml-IN", "Mlym")
            .add("mn-Mong-CN", "Mong")
            .add("or-IN", "Orya")
            .add("si-LK", "Sinh")
            .add("syr-SY", "Syrc")
            .add("ta-IN", "Taml")
            .add("te-IN", "Telu")
            .add("dv-MV", "Thaa")
            .add("th-TH", "Thai")
            .add("bo-CN", "Tibt")
            .add("ug-CN", "Uigh")
            .add("vi-VN", "Viet")
            .add("ii-CN", "Yiii")
            .get();
        return ThemeFontSchemePart;
    }());
    __aspxRichEdit.ThemeFontSchemePart = ThemeFontSchemePart;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ThemeFormatScheme = (function () {
        function ThemeFormatScheme() {
            this.backgroundFillStyleList = [];
            this.fillStyleList = [];
            this.lineStyleList = [];
            this.effectStyleList = [];
            this.name = "";
        }
        Object.defineProperty(ThemeFormatScheme.prototype, "isValidate", {
            get: function () {
                return this.checkValidation();
            },
            enumerable: true,
            configurable: true
        });
        ThemeFormatScheme.prototype.getOutlineByType = function (type) {
            return this.getElementByType(type, this.lineStyleList);
        };
        ThemeFormatScheme.prototype.getOutlineByIndex = function (index) {
            return this.getElementByIndex(index, this.lineStyleList);
        };
        ThemeFormatScheme.prototype.getFillByType = function (type) {
            return this.getElementByType(type, this.fillStyleList);
        };
        ThemeFormatScheme.prototype.getFillByIndex = function (index) {
            var backgroundIndex = 1000;
            if (index < backgroundIndex)
                return this.getElementByIndex(index, this.fillStyleList);
            return this.getElementByIndex(index - backgroundIndex, this.backgroundFillStyleList);
        };
        ThemeFormatScheme.prototype.getEffectStyle = function (type) {
            return this.getElementByType(type, this.effectStyleList);
        };
        ThemeFormatScheme.prototype.getElementByType = function (type, items) {
            if (type == __aspxRichEdit.StyleMatrixElementType.Subtle)
                return items[0];
            if (type == __aspxRichEdit.StyleMatrixElementType.Moderate)
                return items[1];
            if (type == __aspxRichEdit.StyleMatrixElementType.Intense)
                return items[2];
            return null;
        };
        ThemeFormatScheme.prototype.getElementByIndex = function (index, items) {
            var count = items.length;
            return index < 1 || count == 0 ? null : items[Math.min(index, count) - 1];
        };
        ThemeFormatScheme.prototype.checkValidation = function () {
            return this.backgroundFillStyleList.length >= 3 && this.fillStyleList.length >= 3 && this.lineStyleList.length >= 3 && this.effectStyleList.length >= 3;
        };
        ThemeFormatScheme.prototype.copyFrom = function (obj) {
            this.clear();
            this.name = obj.name;
            this.backgroundFillStyleList = __aspxRichEdit.ListUtils.map(obj.backgroundFillStyleList, function (e) { return e.clone(); });
            this.fillStyleList = __aspxRichEdit.ListUtils.map(obj.fillStyleList, function (e) { return e.clone(); });
            this.lineStyleList = __aspxRichEdit.ListUtils.map(obj.lineStyleList, function (e) { return e.clone(); });
            this.effectStyleList = __aspxRichEdit.ListUtils.map(obj.effectStyleList, function (e) { return e.clone(); });
        };
        ThemeFormatScheme.prototype.clear = function () {
            this.name = "";
            __aspxRichEdit.ListUtils.clear(this.backgroundFillStyleList);
            __aspxRichEdit.ListUtils.clear(this.fillStyleList);
            __aspxRichEdit.ListUtils.clear(this.lineStyleList);
            __aspxRichEdit.ListUtils.clear(this.effectStyleList);
        };
        return ThemeFormatScheme;
    }());
    __aspxRichEdit.ThemeFormatScheme = ThemeFormatScheme;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var MouseHandler = (function (_super) {
        __extends(MouseHandler, _super);
        function MouseHandler(control, boxVisualizerManager) {
            return _super.call(this, control, __aspxRichEdit.MouseHandlerDefaultState, boxVisualizerManager) || this;
        }
        MouseHandler.prototype.onMouseDoubleClick = function (evt) {
            this.state.onMouseDoubleClick(evt);
        };
        MouseHandler.prototype.onMouseDown = function (evt) {
            this.state.onMouseDown(evt);
        };
        MouseHandler.prototype.onMouseUp = function (evt) {
            this.state.onMouseUp(evt);
        };
        MouseHandler.prototype.onMouseMove = function (evt) {
            this.state.onMouseMove(evt);
        };
        MouseHandler.prototype.onMouseWheel = function (evt) {
            this.state.onMouseWheel(evt);
        };
        MouseHandler.prototype.onShortcut = function (shortcutCode) {
            this.state.onShortcut(shortcutCode);
        };
        MouseHandler.prototype.setCursorPointer = function (pointer) {
            this.control.viewManager.canvasManager.setCursorPointer(pointer);
        };
        MouseHandler.prototype.restoreCursorPointer = function () {
            this.control.viewManager.canvasManager.setCursorPointer(CursorPointer.Auto);
        };
        MouseHandler.LEFT_AREA_COMMANDS_OFFSET = 20;
        MouseHandler.WAIT_FOR_DBLCLICK_INTERVAL = 300;
        return MouseHandler;
    }(__aspxRichEdit.ManipulatorHandlerBase));
    __aspxRichEdit.MouseHandler = MouseHandler;
    var CursorPointer;
    (function (CursorPointer) {
        CursorPointer[CursorPointer["Default"] = 0] = "Default";
        CursorPointer[CursorPointer["Move"] = 1] = "Move";
        CursorPointer[CursorPointer["Copy"] = 2] = "Copy";
        CursorPointer[CursorPointer["NoDrop"] = 3] = "NoDrop";
        CursorPointer[CursorPointer["EResize"] = 4] = "EResize";
        CursorPointer[CursorPointer["NResize"] = 5] = "NResize";
        CursorPointer[CursorPointer["SResize"] = 6] = "SResize";
        CursorPointer[CursorPointer["WResize"] = 7] = "WResize";
        CursorPointer[CursorPointer["SEResize"] = 8] = "SEResize";
        CursorPointer[CursorPointer["SWResize"] = 9] = "SWResize";
        CursorPointer[CursorPointer["NWResize"] = 10] = "NWResize";
        CursorPointer[CursorPointer["NEResize"] = 11] = "NEResize";
        CursorPointer[CursorPointer["EWResize"] = 12] = "EWResize";
        CursorPointer[CursorPointer["NSResize"] = 13] = "NSResize";
        CursorPointer[CursorPointer["Auto"] = 14] = "Auto";
    })(CursorPointer = __aspxRichEdit.CursorPointer || (__aspxRichEdit.CursorPointer = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Scroller = (function () {
        function Scroller(control) {
            this.timerId = null;
            this.control = control;
        }
        Scroller.prototype.start = function (offset) {
            var _this = this;
            this.stop();
            var coeff = Math.exp(__aspxRichEdit.Utils.reflectionOfPointOnInterval(__aspxRichEdit.Utils.restrictValue(Math.abs(offset), 23, 300), __aspxRichEdit.FixedInterval.fromPositions(23, 301), __aspxRichEdit.FixedInterval.fromPositions(-2, 1.7)));
            var stepByPixel = (offset > 0 ? Math.max(offset, 23) : Math.min(offset, -23)) * coeff / Scroller.STEPS;
            var currPos = this.control.viewManager.canvasScrollManager.scrollTop;
            this.timerId = setInterval(function () {
                currPos += stepByPixel;
                _this.control.viewManager.canvasScrollManager.scrollTop = currPos;
            }, 0);
        };
        Scroller.prototype.stop = function () {
            if (this.timerId !== null) {
                clearTimeout(this.timerId);
                this.timerId = null;
            }
        };
        Scroller.STEPS = 8;
        return Scroller;
    }());
    var MouseHandlerAutoScrollState = (function (_super) {
        __extends(MouseHandlerAutoScrollState, _super);
        function MouseHandlerAutoScrollState(handler) {
            var _this = _super.call(this, handler) || this;
            _this.scroller = new Scroller(_this.handler.control);
            return _this;
        }
        MouseHandlerAutoScrollState.prototype.onMouseDoubleClick = function (_evt) {
        };
        MouseHandlerAutoScrollState.prototype.onMouseDown = function (evt) {
            this.absStartPoint = evt.absolutePoint;
            this.handler.boxVisualizerManager.autoScrollVisualizer.show(new __aspxRichEdit.Rectangle().initByCenter(evt.absolutePoint, __aspxRichEdit.AutoScrollListener.HALF_SIZE));
        };
        MouseHandlerAutoScrollState.prototype.onMouseUp = function (_evt) {
            this.handler.switchToDefaultState();
        };
        MouseHandlerAutoScrollState.prototype.onMouseMove = function (evt) {
            var offset = evt.absolutePoint.y - this.absStartPoint.y;
            if (Math.abs(offset) > __aspxRichEdit.AutoScrollListener.HALF_SIZE)
                this.scroller.start(offset + (offset > 0 ? -1 : 1) * __aspxRichEdit.AutoScrollListener.HALF_SIZE);
            else
                this.scroller.stop();
        };
        MouseHandlerAutoScrollState.prototype.onMouseWheel = function (_evt) {
        };
        MouseHandlerAutoScrollState.prototype.onShortcut = function (_shortcutCode) {
        };
        MouseHandlerAutoScrollState.prototype.finish = function () {
            this.scroller.stop();
            this.handler.boxVisualizerManager.autoScrollVisualizer.hide();
        };
        return MouseHandlerAutoScrollState;
    }(__aspxRichEdit.MouseHandlerStateBase));
    __aspxRichEdit.MouseHandlerAutoScrollState = MouseHandlerAutoScrollState;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var MouseHandlerDefaultState = (function (_super) {
        __extends(MouseHandlerDefaultState, _super);
        function MouseHandlerDefaultState() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        MouseHandlerDefaultState.prototype.onMouseDoubleClick = function (evt) {
            var htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.Max, this.handler.control.model.activeSubDocument);
            if (htr.exactlyDetailLevel == __aspxRichEdit.DocumentLayoutDetailsLevel.None)
                return;
            if (this.isLeftAreaOffset(htr, evt)) {
                this.handler.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.SelectParagraph)
                    .execute(this.handler.control.commandManager.isPublicApiCall, htr.getPosition());
                return;
            }
            var activeSubDocument = this.handler.control.model.activeSubDocument;
            if (htr.exactlyDetailLevel < __aspxRichEdit.DocumentLayoutDetailsLevel.PageArea) {
                if (activeSubDocument.isMain()) {
                    if (htr.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.PageArea] & __aspxRichEdit.HitTestDeviation.Top) {
                        this.handler.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.InsertHeader).execute(this.handler.control.commandManager.isPublicApiCall, htr.pageIndex);
                        return;
                    }
                    if (htr.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.PageArea] & __aspxRichEdit.HitTestDeviation.Bottom) {
                        this.handler.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.InsertFooter).execute(this.handler.control.commandManager.isPublicApiCall, htr.pageIndex);
                        return;
                    }
                }
                else if (this.shouldActivateMainArea(activeSubDocument, htr)) {
                    this.handler.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToMain).execute(this.handler.control.commandManager.isPublicApiCall);
                    return;
                }
            }
            if (htr.exactlyDetailLevel >= __aspxRichEdit.DocumentLayoutDetailsLevel.PageArea) {
                var position = htr.getRelatedSubDocumentPagePosition() + htr.pageArea.pageOffset + htr.column.pageAreaOffset + htr.row.columnOffset + htr.box.rowOffset + htr.charOffset;
                if (htr.boxIndex == htr.row.boxes.length - 1 && htr.charOffset == htr.box.getLength())
                    position--;
                var selection = this.handler.control.selection;
                var startInterval = __aspxRichEdit.LayoutWordBounds.getLayoutWordStartBound(this.handler.control.layout, activeSubDocument, selection, position);
                var endInterval = __aspxRichEdit.LayoutWordBounds.getLayoutWordEndBound(this.handler.control.layout, activeSubDocument, selection, position, true);
                if (endInterval <= startInterval)
                    return;
                if (evt.modifiers & REWebUtils.ModifierKey.Ctrl)
                    selection.addSelection(startInterval, endInterval, false, -1);
                else
                    selection.deprecatedSetSelection(startInterval, endInterval, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
                this.handler.switchState(new __aspxRichEdit.MouseHandlerParagraphSelectState(this.handler, evt, startInterval));
            }
        };
        MouseHandlerDefaultState.prototype.shouldActivateMainArea = function (activeSubDocument, htr) {
            return (activeSubDocument.isHeader() && !!(htr.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.PageArea] & __aspxRichEdit.HitTestDeviation.Bottom)) ||
                (activeSubDocument.isFooter() && !!(htr.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.PageArea] & __aspxRichEdit.HitTestDeviation.Top));
        };
        MouseHandlerDefaultState.prototype.changeActiveSubDocument = function (evt) {
            var control = this.handler.control;
            var activeSubDocument = control.model.activeSubDocument;
            if (!activeSubDocument.isHeaderFooter())
                return false;
            var htr = control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.PageArea, null, true);
            if (htr.exactlyDetailLevel == __aspxRichEdit.DocumentLayoutDetailsLevel.None)
                return false;
            if (htr.pageArea.subDocument.isHeaderFooter()) {
                if (htr.pageArea.subDocument.id != activeSubDocument.id || control.selection.pageIndex != htr.pageIndex) {
                    control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToHeaderFooterByPageIndex)
                        .execute(control.commandManager.isPublicApiCall, new __aspxRichEdit.ChangeActiveSubDocumentToHeaderFooterByPageIndexCommandParameters(control, htr.pageIndex, htr.pageArea.subDocument.isHeader()));
                    return true;
                }
                return false;
            }
            if (htr.pageArea.subDocument.isMain()) {
                if (htr.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.PageArea] & __aspxRichEdit.HitTestDeviation.Top) {
                    control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToHeaderFooterByPageIndex)
                        .execute(control.commandManager.isPublicApiCall, new __aspxRichEdit.ChangeActiveSubDocumentToHeaderFooterByPageIndexCommandParameters(control, htr.pageIndex, true));
                    return true;
                }
                if (htr.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.PageArea] & __aspxRichEdit.HitTestDeviation.Bottom) {
                    control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToHeaderFooterByPageIndex)
                        .execute(control.commandManager.isPublicApiCall, new __aspxRichEdit.ChangeActiveSubDocumentToHeaderFooterByPageIndexCommandParameters(control, htr.pageIndex, false));
                    return true;
                }
                return false;
            }
            return false;
        };
        MouseHandlerDefaultState.prototype.onMouseDown = function (evt) {
            var _this = this;
            var activeSubDocument = this.handler.control.model.activeSubDocument;
            this.handler.control.barManager.onCanvasMouseDown();
            if (evt.middleButtonPressed) {
                this.handler.switchState(new __aspxRichEdit.MouseHandlerAutoScrollState(this.handler));
                this.handler.state.onMouseDown(evt);
                return;
            }
            if (this.changeActiveSubDocument(evt))
                return;
            if (MouseHandlerDefaultState.canHandleFullTableSelection(evt)) {
                this.handler.control.selection.setSelection(new __aspxRichEdit.SetSelectionParams()
                    .setInterval(this.handler.control.selection.tableInfo.table.interval));
                return;
            }
            if (__aspxRichEdit.ResizeColumnTableHelper.canHandleResize(evt) && !this.handler.control.readOnly) {
                var htr_1 = this.handler.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.PageArea, null);
                if (htr_1.pageArea.subDocument == activeSubDocument) {
                    this.handler.switchState(new __aspxRichEdit.MouseHandlerDragTableColumnState(this.handler));
                    this.handler.state.onMouseDown(evt);
                    return;
                }
            }
            if (__aspxRichEdit.ResizeRowTableHelper.canHandleResize(evt) && !this.handler.control.readOnly) {
                var htr_2 = this.handler.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.PageArea, null);
                if (htr_2.pageArea.subDocument == activeSubDocument) {
                    this.handler.switchState(new __aspxRichEdit.MouseHandlerDragTableRowState(this.handler));
                    this.handler.state.onMouseDown(evt);
                    return;
                }
            }
            if (this.shouldProcessResizeBoxVisualizer(evt))
                if (this.resizeRotationChecker(function () {
                    if (activeSubDocument.isTextBox())
                        MouseHandlerHelper.selectParentsTextBox(_this.handler.control);
                    _this.beginResizeBoxMouseHandler(evt);
                }))
                    return;
            if (__aspxRichEdit.ResizeBoxVisualizer.shouldRotate(evt, this.handler.control))
                if (this.resizeRotationChecker(function () {
                    if (activeSubDocument.isTextBox())
                        MouseHandlerHelper.selectParentsTextBox(_this.handler.control);
                    _this.beginRotate(evt);
                }))
                    return;
            var htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.Max, activeSubDocument);
            if (htr.exactlyDetailLevel == __aspxRichEdit.DocumentLayoutDetailsLevel.None && !htr.floatingObject)
                return;
            if (!__aspxRichEdit.ResizeBoxVisualizer.shouldHandleTextBoxAreaClick(evt) && activeSubDocument.isTextBox()) {
                MouseHandlerHelper.changeActiveSubDocumentToParent(this.handler.control);
                htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.Max, this.handler.control.model.activeSubDocument);
            }
            if (htr.floatingObject && htr.floatingObject.belongsToSubDocId == this.handler.control.model.activeSubDocument.id) {
                var box = htr.floatingObject;
                this.selectFloatingObject(box);
                if (box.getType() == __aspxRichEdit.LayoutBoxType.AnchorTextBox &&
                    __aspxRichEdit.HitTestManager.isPointInTexBoxArea(evt.layoutPoint, box, activeSubDocument.isTextBox() ? 0 : box.rotationInRadians)) {
                    this.handler.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToTextBox).execute(this.handler.control.commandManager.isPublicApiCall);
                    this.handler.boxVisualizerManager.resizeBoxVisualizer.show(htr.pageIndex, null, null, null, box);
                    htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.Max, this.handler.control.model.activeSubDocument);
                }
                else {
                    if (this.resizeRotationChecker(function () {
                        var dragFloatingObjectState = new __aspxRichEdit.MouseHandlerDragFloatingObjectState(_this.handler, evt);
                        _this.handler.switchState(new __aspxRichEdit.MouseHandlerBeginDragHelperState(evt.layoutPoint, _this.handler, dragFloatingObjectState));
                    }))
                        return;
                    else {
                        var specRunInfo = this.handler.control.selection.specialRunInfo;
                        if (specRunInfo.isPictureSelected() && specRunInfo.isSelectedAnchorObject) {
                            this.handler.control.selection.setSelection(new __aspxRichEdit.SetSelectionParams()
                                .setInterval(new __aspxRichEdit.FixedInterval(specRunInfo.getPicturePosition(), 1)));
                            return;
                        }
                    }
                }
            }
            if (REWebUtils.Browser.TouchUI && htr.subDocument.isMain() && htr.exactlyDetailLevel < __aspxRichEdit.DocumentLayoutDetailsLevel.PageArea) {
                if (htr.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.PageArea] & __aspxRichEdit.HitTestDeviation.Top || htr.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.PageArea] & __aspxRichEdit.HitTestDeviation.Bottom)
                    this.handler.control.viewManager.canvasScrollManager.waitForDblClick();
            }
            if (evt.button === __aspxRichEdit.MouseButton.Right && this.handler.control.selection.getLastSelectedInterval().contains(htr.getPosition()))
                return;
            if (this.shouldSelectEntireTableColumn(htr))
                this.beginSelectEntireTableColumn(htr, evt);
            else if (this.shouldSelectEntireTableRow(htr))
                this.beginSelectEntireTableRow(htr, evt);
            else if (this.shouldBeginDragExistingSelection(htr, evt))
                this.beginDragExistingSelection(evt, true);
            else if (this.shouldSelectEntireTableCell(htr, evt)) {
                if (this.shouldSelectPicture(htr, !!(evt.modifiers & REWebUtils.ModifierKey.Ctrl)))
                    this.selectImage(evt, htr);
                else
                    this.beginSelectEntireTableCell(htr, evt);
            }
            else if (this.isLeftAreaOffset(htr, evt)) {
                if (evt.modifiers & REWebUtils.ModifierKey.Ctrl && this.handler.control.selection.isCollapsed())
                    this.handler.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.SelectAll).execute(this.handler.control.commandManager.isPublicApiCall, htr.getPosition());
                else
                    this.beginLineSelection(htr, evt);
            }
            else if (this.shouldSelectPicture(htr, !!(evt.modifiers & REWebUtils.ModifierKey.Ctrl)))
                this.selectImage(evt, htr);
            else if (htr.exactlyDetailLevel >= __aspxRichEdit.DocumentLayoutDetailsLevel.Character && evt.modifiers & REWebUtils.ModifierKey.Ctrl)
                this.beginCharacterMultiSelection(htr);
            else if (htr.exactlyDetailLevel >= __aspxRichEdit.DocumentLayoutDetailsLevel.Page)
                this.beginCharacterSelection(evt, htr, !!(evt.modifiers & REWebUtils.ModifierKey.Shift));
        };
        MouseHandlerDefaultState.prototype.onMouseUp = function (evt) {
            if ((evt.button === __aspxRichEdit.MouseButton.Right || evt.button === __aspxRichEdit.MouseButton.Left && REWebUtils.Browser.MacOSPlatform && (evt.modifiers & REWebUtils.ModifierKey.Ctrl))
                && !evt.middleButtonPressed && evt.layoutPoint) {
                this.handler.control.popupMenuManager.showByMouseClick(evt.absolutePoint);
            }
            if (evt.modifiers & REWebUtils.ModifierKey.Ctrl) {
                var field = this.handler.getHyperlinkFieldResult(evt);
                if (field) {
                    if (!this.handler.control.clientSideEvents.raiseHyperlinkClick(evt.mouseEvent, field.getHyperlinkInfo()))
                        this.handler.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.OpenHyperlink).execute(this.handler.control.commandManager.isPublicApiCall, field);
                }
            }
        };
        MouseHandlerDefaultState.canHandleFullTableSelection = function (evt) {
            return REWebUtils.Evt.GetEventSource(evt.mouseEvent).className.indexOf(__aspxRichEdit.DocumentRenderer.CLASSNAMES.FULL_TABLE_SELECTOR) > -1;
        };
        MouseHandlerDefaultState.prototype.shouldSelectEntireTableColumn = function (htr) {
            if (!htr.row)
                return false;
            if (!htr.row.tableCellInfo)
                return false;
            return !!(htr.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.TableCell] & __aspxRichEdit.HitTestDeviation.Top);
        };
        MouseHandlerDefaultState.prototype.shouldSelectEntireTableRow = function (htr) {
            if (!htr.row)
                return false;
            if (!htr.row.tableCellInfo)
                return false;
            return !!(htr.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.TableCell] & __aspxRichEdit.HitTestDeviation.Left);
        };
        MouseHandlerDefaultState.prototype.shouldSelectEntireTableCell = function (htr, evt) {
            if (!htr.row)
                return false;
            if (!htr.row.tableCellInfo)
                return false;
            if (htr.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.TableCell])
                return false;
            if (evt.modifiers & REWebUtils.ModifierKey.Shift)
                return false;
            return true;
        };
        MouseHandlerDefaultState.prototype.beginSelectEntireTableColumn = function (htr, evt) {
            var shouldAddSelection = evt.modifiers & REWebUtils.ModifierKey.Ctrl;
            var cmd = this.handler.control.commandManager.getCommand(shouldAddSelection ? __aspxRichEdit.RichEditClientCommand.ExtendSelectTableColumn : __aspxRichEdit.RichEditClientCommand.SelectTableColumn);
            var table = htr.row.tableCellInfo.parentRow.parentTable.logicInfo.grid.table;
            var cellGridIndex = htr.row.tableCellInfo.cellGridIndex;
            cmd.execute(this.handler.control.commandManager.isPublicApiCall, { table: table, columnIndices: [cellGridIndex] });
            var selectionState = new __aspxRichEdit.MouseHandlerContinueSelectionByTableColumnsState(this.handler, htr.row.tableCellInfo.parentRow.parentTable, cellGridIndex, htr.column.x + htr.pageArea.x);
            var dragState = new __aspxRichEdit.MouseHandlerBeginDragHelperState(evt.layoutPoint, this.handler, selectionState);
            this.handler.switchState(dragState);
        };
        MouseHandlerDefaultState.prototype.beginSelectEntireTableRow = function (htr, evt) {
            var shouldAddSelection = evt.modifiers & REWebUtils.ModifierKey.Ctrl;
            var cmd = this.handler.control.commandManager.getCommand(shouldAddSelection ? __aspxRichEdit.RichEditClientCommand.ExtendSelectTableRow : __aspxRichEdit.RichEditClientCommand.SelectTableRow);
            var table = htr.row.tableCellInfo.parentRow.parentTable.logicInfo.grid.table;
            var rowIndex = htr.row.tableCellInfo.parentRow.rowIndex;
            cmd.execute(this.handler.control.commandManager.isPublicApiCall, new __aspxRichEdit.SelectTableRowCommandOptions(this.handler.control, table, [rowIndex], true));
            var selectionState = new __aspxRichEdit.MouseHandlerContinueSelectionByTableRowsState(this.handler, htr.row.tableCellInfo.parentRow.parentTable, rowIndex);
            var dragState = new __aspxRichEdit.MouseHandlerBeginDragHelperState(evt.layoutPoint, this.handler, selectionState);
            this.handler.switchState(dragState);
        };
        MouseHandlerDefaultState.prototype.beginSelectEntireTableCell = function (htr, evt) {
            var shouldAddSelection = !!(evt.modifiers & REWebUtils.ModifierKey.Ctrl);
            var position = this.getPosition(htr);
            if (shouldAddSelection || (evt.button & __aspxRichEdit.MouseButton.Right))
                this.handler.control.selection.addSelection(position, position, false, -1);
            else
                this.handler.control.selection.deprecatedSetSelection(position, position, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
            var rowIndex = htr.row.tableCellInfo.parentRow.rowIndex;
            var gridCellIndex = htr.row.tableCellInfo.cellGridIndex;
            var selectionState = new __aspxRichEdit.MouseHandlerContinueSelectionByTableCellsState(this.handler, htr.row.tableCellInfo.parentRow.parentTable, rowIndex, gridCellIndex, this.getPosition(htr));
            var dragState = new __aspxRichEdit.MouseHandlerBeginDragHelperState(evt.layoutPoint, this.handler, selectionState);
            this.handler.switchState(dragState);
        };
        MouseHandlerDefaultState.prototype.beginCharacterMultiSelection = function (htr) {
            var position = htr.getPosition();
            this.handler.switchState(new __aspxRichEdit.MouseHandlerBeginMultiselectionState(this.handler, position));
        };
        MouseHandlerDefaultState.prototype.isLeftAreaOffset = function (htr, evt) {
            if (htr) {
                if (htr.exactlyDetailLevel >= __aspxRichEdit.DocumentLayoutDetailsLevel.Page &&
                    htr.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.Column] & __aspxRichEdit.HitTestDeviation.Left &&
                    evt.layoutPoint.x <= htr.pageArea.x + htr.column.x - __aspxRichEdit.MouseHandler.LEFT_AREA_COMMANDS_OFFSET)
                    return true;
                if (htr.detailsLevel >= __aspxRichEdit.DocumentLayoutDetailsLevel.Box && htr.box == htr.row.boxes[0] &&
                    htr.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.Box] & __aspxRichEdit.HitTestDeviation.Left &&
                    evt.layoutPoint.x <= htr.pageArea.x + htr.column.x + htr.row.x + htr.box.x - __aspxRichEdit.MouseHandler.LEFT_AREA_COMMANDS_OFFSET) {
                    var h = this.handler.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.Max, null);
                    if (h.floatingObject && h.floatingObject.isInText())
                        return true;
                }
            }
            return false;
        };
        MouseHandlerDefaultState.prototype.shouldProcessResizeBoxVisualizer = function (evt) {
            return this.handler.boxVisualizerManager.resizeBoxVisualizer.shouldCapture(evt) &&
                this.handler.control.model.activeSubDocument.isEditable([new __aspxRichEdit.FixedInterval(this.handler.control.selection.specialRunInfo.getPosition(), 1)]);
        };
        MouseHandlerDefaultState.prototype.beginResizeBoxMouseHandler = function (evt) {
            this.handler.switchState(new __aspxRichEdit.MouseHandlerResizeBoxState(this.handler));
            this.handler.state.onMouseDown(evt);
        };
        MouseHandlerDefaultState.prototype.beginRotate = function (evt) {
            this.handler.switchState(new __aspxRichEdit.MouseHandlerRotateBoxState(this.handler));
            this.handler.state.onMouseDown(evt);
        };
        MouseHandlerDefaultState.prototype.beginCharacterSelection = function (evt, htr, extendSelection) {
            this.setStartSelection(htr, extendSelection);
            this.handler.switchState(new __aspxRichEdit.MouseHandlerBeginDragHelperState(evt.layoutPoint, this.handler, new __aspxRichEdit.MouseHandlerContinueSelectionByCharactersState(this.handler)));
        };
        MouseHandlerDefaultState.prototype.setStartSelection = function (htr, extendSelection) {
            this.handler.control.inputController.setEditableDocumentContent("");
            var selection = this.handler.control.selection;
            var position = this.getPosition(htr);
            var endOfLine = position === htr.getRelatedSubDocumentPagePosition() + htr.pageArea.pageOffset + htr.column.pageAreaOffset + htr.row.getEndPosition();
            if (extendSelection)
                selection.extendLastSelection(position, endOfLine, -1, __aspxRichEdit.UpdateInputPositionProperties.No);
            else
                selection.deprecatedSetSelection(position, position, endOfLine, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
        };
        MouseHandlerDefaultState.prototype.getPosition = function (htr) {
            var position = htr.getRelatedSubDocumentPagePosition() + htr.pageArea.pageOffset + htr.column.pageAreaOffset + htr.row.columnOffset;
            if (htr.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.Box] & __aspxRichEdit.HitTestDeviation.Right) {
                var lastVisibleBoxInRow = htr.row.getLastVisibleBox();
                if (lastVisibleBoxInRow)
                    position += lastVisibleBoxInRow.getEndPosition();
            }
            else {
                position += htr.box.rowOffset + htr.charOffset;
                if (htr.boxIndex == htr.row.boxes.length - 1 && htr.charOffset == htr.box.getLength() && !htr.box.isVisible())
                    position -= 1;
            }
            return position;
        };
        MouseHandlerDefaultState.prototype.beginLineSelection = function (htr, evt) {
            var lineStart = htr.getRelatedSubDocumentPagePosition() + htr.pageArea.pageOffset + htr.column.pageAreaOffset + htr.row.columnOffset;
            if (evt.modifiers & REWebUtils.ModifierKey.Shift)
                this.handler.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ExtendSelectLineNoUpdateControlState).execute(this.handler.control.commandManager.isPublicApiCall, lineStart);
            else if (evt.modifiers & REWebUtils.ModifierKey.Ctrl)
                this.handler.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.AddSelectedLineCommandNoUpdateControlState).execute(this.handler.control.commandManager.isPublicApiCall, lineStart);
            else
                this.handler.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.SelectLineNoUpdateControlState).execute(this.handler.control.commandManager.isPublicApiCall, lineStart);
            this.handler.switchState(new __aspxRichEdit.MouseHandlerBeginDragHelperState(evt.layoutPoint, this.handler, new __aspxRichEdit.MouseHandlerContinueSelectionByLinesState(this.handler)));
        };
        MouseHandlerDefaultState.prototype.shouldSelectPicture = function (htr, ctrlPressed) {
            if (htr.exactlyDetailLevel < __aspxRichEdit.DocumentLayoutDetailsLevel.Box)
                return false;
            return htr.box.getType() == __aspxRichEdit.LayoutBoxType.Picture && !ctrlPressed;
        };
        MouseHandlerDefaultState.prototype.shouldBeginDragExistingSelection = function (htr, evt) {
            if (!(evt.modifiers & REWebUtils.ModifierKey.Shift) &&
                __aspxRichEdit.ControlOptions.isEnabled(this.handler.control.options.drag) && !this.handler.control.selection.isCollapsed() &&
                htr.exactlyDetailLevel >= __aspxRichEdit.DocumentLayoutDetailsLevel.Box) {
                var position_1 = htr.getPosition();
                return __aspxRichEdit.ListUtils.anyOf(this.handler.control.selection.intervals, function (interval) { return interval.contains(position_1); });
            }
            return false;
        };
        MouseHandlerDefaultState.prototype.selectImage = function (evt, htr) {
            var position = htr.getPosition() - htr.charOffset;
            var selection = this.handler.control.selection;
            selection.deprecatedSetSelection(position, position + 1, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
            if (__aspxRichEdit.ControlOptions.isEnabled(this.handler.control.options.drag))
                this.beginDragExistingSelection(evt, false);
        };
        MouseHandlerDefaultState.prototype.beginDragExistingSelection = function (evt, resetSelectionOnMouseUp) {
            var dragState = new __aspxRichEdit.MouseHandlerDragContentState(this.handler);
            var state = new __aspxRichEdit.MouseHandlerBeginContentDragHelperState(evt.layoutPoint, this.handler, dragState);
            state.resetSelectionOnMouseUp = resetSelectionOnMouseUp;
            this.handler.switchState(state);
        };
        MouseHandlerDefaultState.prototype.selectFloatingObject = function (box) {
            var pos = this.handler.control.layout.anchorObjectsPositionInfo.getPosition(box.objectId);
            this.handler.control.selection.setSelection(new __aspxRichEdit.SetSelectionParams().setInterval(new __aspxRichEdit.FixedInterval(pos, 1)));
        };
        return MouseHandlerDefaultState;
    }(__aspxRichEdit.MouseHandlerStateBase));
    __aspxRichEdit.MouseHandlerDefaultState = MouseHandlerDefaultState;
    var MouseHandlerHelper = (function () {
        function MouseHandlerHelper() {
        }
        MouseHandlerHelper.selectParentsTextBox = function (control) {
            var textBoxPosition = control.selection.specialRunInfo.getTextBoxPosition();
            if (textBoxPosition > -1) {
                this.changeActiveSubDocumentToParent(control);
                control.selection.setSelection(new __aspxRichEdit.SetSelectionParams().setInterval(new __aspxRichEdit.FixedInterval(textBoxPosition, 1)));
            }
        };
        MouseHandlerHelper.changeActiveSubDocumentToParent = function (control) {
            var selection = control.selection;
            var parentActiveSubDocument = selection.specialRunInfo.getParentSubDocument();
            if (!parentActiveSubDocument)
                return;
            if (parentActiveSubDocument.isMain())
                control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToMain).execute(control.commandManager.isPublicApiCall);
            else
                control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToHeaderFooterByPageIndex)
                    .execute(control.commandManager.isPublicApiCall, new __aspxRichEdit.ChangeActiveSubDocumentToHeaderFooterByPageIndexCommandParameters(control, selection.pageIndex, parentActiveSubDocument.isHeader()));
        };
        return MouseHandlerHelper;
    }());
    __aspxRichEdit.MouseHandlerHelper = MouseHandlerHelper;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var MouseHandlerDragResizeTableBase = (function (_super) {
        __extends(MouseHandlerDragResizeTableBase, _super);
        function MouseHandlerDragResizeTableBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        MouseHandlerDragResizeTableBase.prototype.onMouseDown = function (evt) {
            this.helper = new (this.getHelperConstructor())(this.handler.control, this.handler.boxVisualizerManager.resizeTableVisualizer, evt);
        };
        MouseHandlerDragResizeTableBase.prototype.onMouseMove = function (evt) {
            this.helper.move(evt);
        };
        MouseHandlerDragResizeTableBase.prototype.onMouseUp = function (evt) {
            this.helper.end(evt);
            this.handler.switchToDefaultState();
        };
        MouseHandlerDragResizeTableBase.prototype.getHelperConstructor = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return MouseHandlerDragResizeTableBase;
    }(__aspxRichEdit.MouseHandlerStateBase));
    __aspxRichEdit.MouseHandlerDragResizeTableBase = MouseHandlerDragResizeTableBase;
    var MouseHandlerDragTableRowState = (function (_super) {
        __extends(MouseHandlerDragTableRowState, _super);
        function MouseHandlerDragTableRowState() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        MouseHandlerDragTableRowState.prototype.getHelperConstructor = function () {
            return __aspxRichEdit.ResizeRowTableHelper;
        };
        return MouseHandlerDragTableRowState;
    }(MouseHandlerDragResizeTableBase));
    __aspxRichEdit.MouseHandlerDragTableRowState = MouseHandlerDragTableRowState;
    var MouseHandlerDragTableColumnState = (function (_super) {
        __extends(MouseHandlerDragTableColumnState, _super);
        function MouseHandlerDragTableColumnState() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        MouseHandlerDragTableColumnState.prototype.getHelperConstructor = function () {
            return __aspxRichEdit.ResizeColumnTableHelper;
        };
        return MouseHandlerDragTableColumnState;
    }(MouseHandlerDragResizeTableBase));
    __aspxRichEdit.MouseHandlerDragTableColumnState = MouseHandlerDragTableColumnState;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var MouseHandlerDragFloatingObjectState = (function (_super) {
        __extends(MouseHandlerDragFloatingObjectState, _super);
        function MouseHandlerDragFloatingObjectState(handler, evt) {
            var _this = _super.call(this, handler) || this;
            _this.dragFloatingObjectsHelper = new __aspxRichEdit.DragFloatingObjectsHelper(_this.handler.control, _this.handler.boxVisualizerManager.resizeBoxVisualizer);
            _this.dragFloatingObjectsHelper.start(evt);
            return _this;
        }
        MouseHandlerDragFloatingObjectState.prototype.onMouseMove = function (evt) {
            this.dragFloatingObjectsHelper.move(evt);
        };
        MouseHandlerDragFloatingObjectState.prototype.commitDrag = function (evt) {
            this.dragFloatingObjectsHelper.end(evt);
        };
        MouseHandlerDragFloatingObjectState.prototype.onShortcut = function (shortcutCode) {
            if (shortcutCode === REWebUtils.KeyCode.Esc)
                this.dragFloatingObjectsHelper.rollback();
            _super.prototype.onShortcut.call(this, shortcutCode);
        };
        return MouseHandlerDragFloatingObjectState;
    }(__aspxRichEdit.MouseHandlerCancellableDragStateBase));
    __aspxRichEdit.MouseHandlerDragFloatingObjectState = MouseHandlerDragFloatingObjectState;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var MouseHandlerParagraphSelectState = (function (_super) {
        __extends(MouseHandlerParagraphSelectState, _super);
        function MouseHandlerParagraphSelectState(handler, evt, startSelectedWordInterval) {
            var _this = _super.call(this, handler) || this;
            _this.layoutPoint = evt.layoutPoint;
            _this.startSelectedWordInterval = startSelectedWordInterval;
            _this.timerId = setTimeout(function () {
                _this.handler.switchToDefaultState();
                _this.timerId = null;
            }, MouseHandlerParagraphSelectState.TIMEOUT);
            return _this;
        }
        MouseHandlerParagraphSelectState.prototype.onMouseDoubleClick = function (evt) {
            this.handler.switchToDefaultState();
            this.handler.state.onMouseDoubleClick(evt);
        };
        MouseHandlerParagraphSelectState.prototype.onMouseDown = function (evt) {
            if (evt.layoutPoint.equals(this.layoutPoint)) {
                this.handler.control.selection.setSelection(new __aspxRichEdit.SetSelectionParams()
                    .setInterval(this.handler.control.model.activeSubDocument.getParagraphByPosition(this.startSelectedWordInterval).interval));
                this.handler.switchToDefaultState();
            }
            else {
                this.handler.switchToDefaultState();
                this.handler.state.onMouseDown(evt);
            }
        };
        MouseHandlerParagraphSelectState.prototype.onMouseUp = function (evt) {
            this.handler.switchToDefaultState();
            this.handler.state.onMouseUp(evt);
        };
        MouseHandlerParagraphSelectState.prototype.onMouseMove = function (evt) {
            this.handler.switchToDefaultState();
            this.handler.state.onMouseMove(evt);
        };
        MouseHandlerParagraphSelectState.prototype.onMouseWheel = function (evt) {
            this.handler.switchToDefaultState();
            this.handler.state.onMouseWheel(evt);
        };
        MouseHandlerParagraphSelectState.prototype.onShortcut = function (shortcutCode) {
            this.handler.switchToDefaultState();
            this.handler.state.onShortcut(shortcutCode);
        };
        MouseHandlerParagraphSelectState.prototype.finish = function () {
            if (this.timerId !== null)
                clearTimeout(this.timerId);
        };
        MouseHandlerParagraphSelectState.TIMEOUT = 450;
        return MouseHandlerParagraphSelectState;
    }(__aspxRichEdit.MouseHandlerStateBase));
    __aspxRichEdit.MouseHandlerParagraphSelectState = MouseHandlerParagraphSelectState;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var MouseHandlerResizeBoxState = (function (_super) {
        __extends(MouseHandlerResizeBoxState, _super);
        function MouseHandlerResizeBoxState() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        MouseHandlerResizeBoxState.prototype.start = function () {
            this.resizeBoxHelper = new __aspxRichEdit.ResizeBoxHelper(this.handler.control, this.handler.boxVisualizerManager.resizeBoxVisualizer);
        };
        MouseHandlerResizeBoxState.prototype.onMouseDown = function (evt) {
            this.resizeBoxHelper.start(evt);
            this.setCursor();
        };
        MouseHandlerResizeBoxState.prototype.onMouseMove = function (evt) {
            this.resizeBoxHelper.move(evt);
        };
        MouseHandlerResizeBoxState.prototype.onMouseUp = function (evt) {
            _super.prototype.onMouseUp.call(this, evt);
            this.resizeBoxHelper.end(evt);
        };
        MouseHandlerResizeBoxState.prototype.setCursor = function () {
            if (this.resizeBoxHelper.lockH)
                this.handler.setCursorPointer(__aspxRichEdit.CursorPointer.SResize);
            else if (this.resizeBoxHelper.lockV)
                this.handler.setCursorPointer(__aspxRichEdit.CursorPointer.WResize);
            else if (this.resizeBoxHelper.sideH && this.resizeBoxHelper.sideV)
                this.handler.setCursorPointer(__aspxRichEdit.CursorPointer.SEResize);
            else if (this.resizeBoxHelper.sideH && !this.resizeBoxHelper.sideV)
                this.handler.setCursorPointer(__aspxRichEdit.CursorPointer.NEResize);
            else if (!this.resizeBoxHelper.sideH && this.resizeBoxHelper.sideV)
                this.handler.setCursorPointer(__aspxRichEdit.CursorPointer.SWResize);
            else if (!this.resizeBoxHelper.sideH && !this.resizeBoxHelper.sideV)
                this.handler.setCursorPointer(__aspxRichEdit.CursorPointer.NWResize);
        };
        MouseHandlerResizeBoxState.prototype.finish = function () {
            this.handler.setCursorPointer(__aspxRichEdit.CursorPointer.Auto);
        };
        return MouseHandlerResizeBoxState;
    }(__aspxRichEdit.MouseHandlerCancellableDragStateBase));
    __aspxRichEdit.MouseHandlerResizeBoxState = MouseHandlerResizeBoxState;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var MouseHandlerRotateBoxState = (function (_super) {
        __extends(MouseHandlerRotateBoxState, _super);
        function MouseHandlerRotateBoxState() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        MouseHandlerRotateBoxState.prototype.onMouseDown = function (evt) {
            this.rotateBoxHelper = new __aspxRichEdit.RotateBoxHelper(this.handler.control, this.handler.boxVisualizerManager.resizeBoxVisualizer);
            this.rotateBoxHelper.start(evt);
        };
        MouseHandlerRotateBoxState.prototype.onMouseMove = function (evt) {
            this.rotateBoxHelper.move(evt);
        };
        MouseHandlerRotateBoxState.prototype.onMouseUp = function (evt) {
            _super.prototype.onMouseUp.call(this, evt);
            this.rotateBoxHelper.end(evt);
        };
        return MouseHandlerRotateBoxState;
    }(__aspxRichEdit.MouseHandlerCancellableDragStateBase));
    __aspxRichEdit.MouseHandlerRotateBoxState = MouseHandlerRotateBoxState;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var MouseHandlerContinueSelectionByRangesState = (function (_super) {
        __extends(MouseHandlerContinueSelectionByRangesState, _super);
        function MouseHandlerContinueSelectionByRangesState() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        MouseHandlerContinueSelectionByRangesState.prototype.onMouseMove = function (evt) {
            var htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.Character, this.handler.control.model.activeSubDocument);
            if (htr.exactlyDetailLevel > __aspxRichEdit.DocumentLayoutDetailsLevel.None)
                this.continueSelection(htr, evt);
        };
        MouseHandlerContinueSelectionByRangesState.prototype.onMouseUp = function (_evt) {
            this.stopProcessing();
        };
        MouseHandlerContinueSelectionByRangesState.prototype.start = function () {
            this.handler.control.barManager.beginUpdate();
            this.handler.control.horizontalRulerControl.beginUpdate();
        };
        MouseHandlerContinueSelectionByRangesState.prototype.finish = function () {
            this.handler.control.inputPosition.reset();
            this.handler.control.barManager.endUpdate();
            this.handler.control.horizontalRulerControl.endUpdate();
            this.handler.control.barManager.updateItemsState([]);
            this.handler.control.horizontalRulerControl.update();
        };
        MouseHandlerContinueSelectionByRangesState.prototype.stopProcessing = function () {
            this.handler.switchToDefaultState();
        };
        MouseHandlerContinueSelectionByRangesState.prototype.continueSelection = function (htr, _evt) {
            var command = this.getExtendSelectionCommand();
            var parameter = this.getExtendSelectionCommandParameter(htr);
            command.execute(this.handler.control.commandManager.isPublicApiCall, parameter);
        };
        MouseHandlerContinueSelectionByRangesState.prototype.getExtendSelectionCommand = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        MouseHandlerContinueSelectionByRangesState.prototype.getExtendSelectionCommandParameter = function (_htr) {
            return undefined;
        };
        return MouseHandlerContinueSelectionByRangesState;
    }(__aspxRichEdit.MouseHandlerStateBase));
    __aspxRichEdit.MouseHandlerContinueSelectionByRangesState = MouseHandlerContinueSelectionByRangesState;
    var MouseHandlerBeginMultiselectionState = (function (_super) {
        __extends(MouseHandlerBeginMultiselectionState, _super);
        function MouseHandlerBeginMultiselectionState(handler, startPosition) {
            var _this = _super.call(this, handler) || this;
            _this.startPosition = startPosition;
            return _this;
        }
        MouseHandlerBeginMultiselectionState.prototype.onMouseUp = function (evt) {
            this.handler.switchToDefaultState();
            this.handler.state.onMouseUp(evt);
        };
        MouseHandlerBeginMultiselectionState.prototype.onMouseMove = function (evt) {
            this.updateSelection(evt);
        };
        MouseHandlerBeginMultiselectionState.prototype.onMouseWheel = function (evt) {
            this.updateSelection(evt);
        };
        MouseHandlerBeginMultiselectionState.prototype.updateSelection = function (evt) {
            var htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.Max, this.handler.control.model.activeSubDocument);
            if (htr.exactlyDetailLevel > __aspxRichEdit.DocumentLayoutDetailsLevel.None) {
                var newPosition = htr.getPosition();
                if (newPosition !== this.startPosition) {
                    this.handler.control.selection.addSelection(this.startPosition, newPosition, false, -1);
                    this.handler.switchState(new MouseHandlerContinueSelectionByCharactersState(this.handler));
                }
            }
        };
        return MouseHandlerBeginMultiselectionState;
    }(__aspxRichEdit.MouseHandlerStateBase));
    __aspxRichEdit.MouseHandlerBeginMultiselectionState = MouseHandlerBeginMultiselectionState;
    var MouseHandlerContinueSelectionByCharactersState = (function (_super) {
        __extends(MouseHandlerContinueSelectionByCharactersState, _super);
        function MouseHandlerContinueSelectionByCharactersState() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.prevLayoutPoint = new __aspxRichEdit.LayoutPoint(-1, -1, -1);
            return _this;
        }
        MouseHandlerContinueSelectionByCharactersState.prototype.extendToPoints = function (selection, posintA, pointB) {
            var savedFD = selection.forwardDirection;
            selection.forwardDirection = true;
            selection.extendLastSelection(posintA, false, -1, __aspxRichEdit.UpdateInputPositionProperties.No);
            selection.forwardDirection = false;
            selection.extendLastSelection(pointB, false, -1, __aspxRichEdit.UpdateInputPositionProperties.No);
            selection.forwardDirection = savedFD;
        };
        MouseHandlerContinueSelectionByCharactersState.prototype.isForwardMouseDirection = function (evt) {
            var currLp = evt.layoutPoint;
            return currLp.pageIndex > this.prevLayoutPoint.pageIndex || currLp.y > this.prevLayoutPoint.y || currLp.x > this.prevLayoutPoint.x;
        };
        MouseHandlerContinueSelectionByCharactersState.prototype.extendForward = function (selection, pos) {
            var lastSelectedInterval = selection.lastSelectedInterval;
            var lastParagraphInterval = this.handler.control.model.activeSubDocument.getParagraphByPosition(Math.max(0, Math.max(pos, lastSelectedInterval.end) - 1)).interval;
            if (lastParagraphInterval.length > 1 && (lastParagraphInterval.end - 1 == pos || lastParagraphInterval.end == pos) && lastSelectedInterval.contains(lastParagraphInterval.start)) {
                selection.extendLastSelection(Math.max(lastParagraphInterval.end, lastSelectedInterval.end), false, -1, __aspxRichEdit.UpdateInputPositionProperties.No);
                return true;
            }
            return false;
        };
        MouseHandlerContinueSelectionByCharactersState.prototype.extendBackward = function (selection, pos) {
            var lastSelectedInterval = selection.lastSelectedInterval;
            var firstParagraphInterval = this.handler.control.model.activeSubDocument.getParagraphByPosition(Math.min(pos, lastSelectedInterval.start)).interval;
            var needToExtend = false;
            var bounds = new __aspxRichEdit.MinMaxNumber(lastSelectedInterval.start, lastSelectedInterval.end);
            if (firstParagraphInterval.length > 1 && firstParagraphInterval.start == pos && lastSelectedInterval.containsWithIntervalEnd(firstParagraphInterval.end - 1) && !lastSelectedInterval.containsWithIntervalEnd(firstParagraphInterval.end)) {
                bounds.min = Math.min(bounds.min, firstParagraphInterval.start);
                bounds.max = Math.max(bounds.max, firstParagraphInterval.end);
                needToExtend = true;
            }
            if (lastSelectedInterval.end > firstParagraphInterval.end && !selection.forwardDirection) {
                var lastParInterval = this.handler.control.model.activeSubDocument.getParagraphByPosition(Math.max(pos, lastSelectedInterval.end)).interval;
                if (lastParInterval.length > 1 && lastSelectedInterval.contains(lastParInterval.start) && lastSelectedInterval.end == lastParInterval.end - 1) {
                    bounds.min = Math.min(bounds.min, lastParInterval.start);
                    bounds.max = Math.max(bounds.max, lastParInterval.end);
                    needToExtend = true;
                }
            }
            if (needToExtend) {
                this.extendToPoints(selection, bounds.max, bounds.min);
                return true;
            }
            return false;
        };
        MouseHandlerContinueSelectionByCharactersState.prototype.extendSelectionToFullParagraph = function (evt, pos) {
            var selection = this.handler.control.selection;
            if (this.isForwardMouseDirection(evt)) {
                if (this.extendForward(selection, pos))
                    return true;
            }
            else {
                if (this.extendBackward(selection, pos))
                    return true;
            }
            return false;
        };
        MouseHandlerContinueSelectionByCharactersState.prototype.continueSelection = function (htr, evt, isTableCell) {
            if (isTableCell === void 0) { isTableCell = false; }
            var pos = htr.getPosition();
            if (isTableCell || !this.extendSelectionToFullParagraph(evt, pos))
                this.handler.control.selection.extendLastSelection(pos, false, -1, __aspxRichEdit.UpdateInputPositionProperties.No);
            this.prevLayoutPoint = evt.layoutPoint.clone();
        };
        return MouseHandlerContinueSelectionByCharactersState;
    }(MouseHandlerContinueSelectionByRangesState));
    __aspxRichEdit.MouseHandlerContinueSelectionByCharactersState = MouseHandlerContinueSelectionByCharactersState;
    var MouseHandlerContinueSelectionByLinesState = (function (_super) {
        __extends(MouseHandlerContinueSelectionByLinesState, _super);
        function MouseHandlerContinueSelectionByLinesState() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        MouseHandlerContinueSelectionByLinesState.prototype.getExtendSelectionCommand = function () {
            return this.handler.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ExtendSelectLineNoUpdateControlState);
        };
        MouseHandlerContinueSelectionByLinesState.prototype.getExtendSelectionCommandParameter = function (htr) {
            return htr.getRelatedSubDocumentPagePosition() + htr.pageArea.pageOffset + htr.column.pageAreaOffset + htr.row.columnOffset;
        };
        return MouseHandlerContinueSelectionByLinesState;
    }(MouseHandlerContinueSelectionByRangesState));
    __aspxRichEdit.MouseHandlerContinueSelectionByLinesState = MouseHandlerContinueSelectionByLinesState;
    var MouseHandlerContinueSelectionByTableColumnsState = (function (_super) {
        __extends(MouseHandlerContinueSelectionByTableColumnsState, _super);
        function MouseHandlerContinueSelectionByTableColumnsState(handler, table, startColumnIndex, columnOffsetX) {
            var _this = _super.call(this, handler) || this;
            _this.table = table;
            _this.startColumnIndex = startColumnIndex;
            _this.lastColumnIndex = startColumnIndex;
            _this.columnOffsetX = columnOffsetX;
            return _this;
        }
        MouseHandlerContinueSelectionByTableColumnsState.prototype.onMouseMove = function (evt) {
            if (evt.layoutPoint.isEmpty())
                return;
            var relativeX = evt.layoutPoint.x - this.columnOffsetX - this.table.x;
            var columnIndex = Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(this.table.logicInfo.grid.columns.positions, function (posX) { return posX; }, relativeX));
            if (columnIndex !== this.lastColumnIndex) {
                var shouldExtend = evt.modifiers & REWebUtils.ModifierKey.Ctrl;
                var cmd = this.handler.control.commandManager.getCommand(shouldExtend ? __aspxRichEdit.RichEditClientCommand.ExtendSelectTableColumn : __aspxRichEdit.RichEditClientCommand.SelectTableColumn);
                var columnIndices = [];
                var startColumnIndex = Math.min(this.startColumnIndex, columnIndex);
                var endColumnIndex = Math.max(this.startColumnIndex, columnIndex);
                for (var i = startColumnIndex; i <= endColumnIndex; i++)
                    columnIndices.push(i);
                cmd.execute(this.handler.control.commandManager.isPublicApiCall, { table: this.table.logicInfo.grid.table, columnIndices: columnIndices });
                this.lastColumnIndex = columnIndex;
            }
        };
        return MouseHandlerContinueSelectionByTableColumnsState;
    }(MouseHandlerContinueSelectionByRangesState));
    __aspxRichEdit.MouseHandlerContinueSelectionByTableColumnsState = MouseHandlerContinueSelectionByTableColumnsState;
    var MouseHandlerContinueSelectionByTableRowsState = (function (_super) {
        __extends(MouseHandlerContinueSelectionByTableRowsState, _super);
        function MouseHandlerContinueSelectionByTableRowsState(handler, table, startRowIndex) {
            var _this = _super.call(this, handler) || this;
            _this.table = table;
            _this.startRowIndex = startRowIndex;
            _this.lastRowIndex = startRowIndex;
            return _this;
        }
        MouseHandlerContinueSelectionByTableRowsState.prototype.onMouseMove = function (evt) {
            var htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.Character, this.handler.control.model.activeSubDocument);
            if (htr.exactlyDetailLevel == __aspxRichEdit.DocumentLayoutDetailsLevel.None)
                return;
            var shouldExtend = evt.modifiers & REWebUtils.ModifierKey.Ctrl;
            var position = htr.getPosition();
            var modelTable = this.table.logicInfo.grid.table;
            var rowIndex;
            var shouldContinue = false;
            var forwardDirection;
            if (position < modelTable.getStartPosition()) {
                rowIndex = 0;
                shouldContinue = true;
                forwardDirection = false;
            }
            else if (position > modelTable.getEndPosition()) {
                rowIndex = modelTable.rows.length - 1;
                shouldContinue = true;
                forwardDirection = true;
            }
            else {
                rowIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(modelTable.rows, function (r) { return r.getStartPosition(); }, position);
                forwardDirection = rowIndex >= this.startRowIndex;
            }
            var selection = this.handler.control.selection;
            if (this.lastRowIndex !== rowIndex || (!shouldContinue && (selection.intervals[0].start < modelTable.getStartPosition() || selection.intervals[selection.intervals.length - 1].end > modelTable.getEndPosition()))) {
                var cmd = this.handler.control.commandManager.getCommand(shouldExtend ? __aspxRichEdit.RichEditClientCommand.ExtendSelectTableRow : __aspxRichEdit.RichEditClientCommand.SelectTableRow);
                var rowIndices = [];
                var startRowIndex = Math.min(this.startRowIndex, rowIndex);
                var endRowIndex = Math.max(this.startRowIndex, rowIndex);
                for (var i = startRowIndex; i <= endRowIndex; i++)
                    rowIndices.push(i);
                if (rowIndex < this.startRowIndex)
                    rowIndices = rowIndices.reverse();
                cmd.execute(this.handler.control.commandManager.isPublicApiCall, new __aspxRichEdit.SelectTableRowCommandOptions(this.handler.control, this.table.logicInfo.grid.table, rowIndices, forwardDirection));
                this.lastRowIndex = rowIndex;
            }
            if (shouldContinue)
                this.continueSelection(htr, evt);
        };
        return MouseHandlerContinueSelectionByTableRowsState;
    }(MouseHandlerContinueSelectionByCharactersState));
    __aspxRichEdit.MouseHandlerContinueSelectionByTableRowsState = MouseHandlerContinueSelectionByTableRowsState;
    var MouseHandlerContinueSelectionByTableCellsState = (function (_super) {
        __extends(MouseHandlerContinueSelectionByTableCellsState, _super);
        function MouseHandlerContinueSelectionByTableCellsState(handler, startTable, startRowIndex, startGridCellIndex, startPosition) {
            var _this = _super.call(this, handler) || this;
            var modelRow = startTable.logicInfo.grid.table.rows[startRowIndex];
            var cellIndex = startTable.logicInfo.grid.tableCellGridInfos[startRowIndex][startGridCellIndex].getCellIndexAbs(startRowIndex);
            _this.startCell = modelRow.cells[cellIndex];
            _this.lastCell = _this.startCell;
            _this.startParentCell = _this.startCell;
            _this.startPosition = startPosition;
            while (_this.startParentCell.parentRow.parentTable.parentCell)
                _this.startParentCell = _this.startParentCell.parentRow.parentTable.parentCell;
            return _this;
        }
        MouseHandlerContinueSelectionByTableCellsState.prototype.onMouseMove = function (evt) {
            var htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.Character, this.handler.control.model.activeSubDocument);
            if (htr.exactlyDetailLevel == __aspxRichEdit.DocumentLayoutDetailsLevel.None)
                return;
            var selection = this.handler.control.selection;
            var extendSelection = !!(evt.modifiers & REWebUtils.ModifierKey.Ctrl);
            if (!htr.row.tableCellInfo) {
                this.selectWholeInterval(htr, evt, extendSelection);
                return;
            }
            var modelTable = htr.row.tableCellInfo.parentRow.parentTable.logicInfo.grid.table;
            var modelRow = modelTable.rows[htr.row.tableCellInfo.parentRow.rowIndex];
            var modelCell = modelRow.cells[__aspxRichEdit.TableCellUtils.getCellIndexByColumnIndex(modelRow, htr.row.tableCellInfo.cellGridIndex)];
            var sameTableCells = __aspxRichEdit.TableCellUtils.getSameTableCells(this.startCell, modelCell);
            if (!sameTableCells) {
                this.selectWholeInterval(htr, evt, extendSelection);
                return;
            }
            if (this.startCell === sameTableCells.lastCell) {
                if (!extendSelection &&
                    (selection.intervals.length !== 1 ||
                        (selection.intervals[0].start !== this.startPosition && selection.intervals[0].end !== this.startPosition)))
                    this.handler.control.selection.deprecatedSetSelection(this.startPosition, htr.getPosition(), false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
                else {
                    var noExtend = htr.row.tableCellInfo && htr.row.tableCellInfo.boundFlags.get(__aspxRichEdit.TableCellBoundFlags.EndOnThisColumn) &&
                        __aspxRichEdit.ListUtils.last(htr.row.tableCellInfo.layoutRows) == htr.row && htr.exactlyDetailLevel >= __aspxRichEdit.DocumentLayoutDetailsLevel.TableCell &&
                        (htr.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.Character] & __aspxRichEdit.HitTestDeviation.Right) &&
                        htr.isLastBoxInRow() && htr.charOffset == htr.box.getLength();
                    if (!noExtend)
                        this.continueSelection(htr, evt, true);
                }
                this.lastCell = this.startCell;
                return;
            }
            if (this.lastCell === sameTableCells.lastCell)
                return;
            var commandParameters = {
                firstCell: sameTableCells.firstCell,
                lastCell: sameTableCells.lastCell,
                extendSelection: extendSelection
            };
            this.handler.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.SelectTableCellsRange)
                .execute(this.handler.control.commandManager.isPublicApiCall, commandParameters);
            this.lastCell = sameTableCells.lastCell;
        };
        MouseHandlerContinueSelectionByTableCellsState.prototype.selectWholeInterval = function (htr, evt, extendSelection) {
            var selection = this.handler.control.selection;
            var position = htr.getPosition();
            var startPosition = position >= this.startCell.endParagrapPosition.value ? this.startParentCell.parentRow.getStartPosition() : this.startParentCell.parentRow.getEndPosition();
            if (selection.intervals.length > 1) {
                if (extendSelection)
                    selection.addSelection(startPosition, position, true, -1);
                else
                    selection.deprecatedSetSelection(startPosition, position, true, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
            }
            else
                this.continueSelection(htr, evt);
        };
        return MouseHandlerContinueSelectionByTableCellsState;
    }(MouseHandlerContinueSelectionByCharactersState));
    __aspxRichEdit.MouseHandlerContinueSelectionByTableCellsState = MouseHandlerContinueSelectionByTableCellsState;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TouchHandler = (function (_super) {
        __extends(TouchHandler, _super);
        function TouchHandler(control, boxVisualizerManager) {
            return _super.call(this, control, __aspxRichEdit.TouchHandlerDefaultState, boxVisualizerManager) || this;
        }
        TouchHandler.prototype.onTouchStart = function (evt) {
            this.state.onTouchStart(evt);
        };
        TouchHandler.prototype.onDoubleTap = function (evt) {
            this.state.onDoubleTap(evt);
        };
        TouchHandler.prototype.onTouchEnd = function (evt) {
            this.state.onTouchEnd(evt);
        };
        TouchHandler.prototype.onTouchMove = function (evt) {
            return this.state.onTouchMove(evt);
        };
        TouchHandler.prototype.onGestureStart = function (_evt) {
            this.switchToDefaultState();
        };
        return TouchHandler;
    }(__aspxRichEdit.ManipulatorHandlerBase));
    __aspxRichEdit.TouchHandler = TouchHandler;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    __aspxRichEdit.TOUCH_RADIUS_HANDLE = 20;
    var TouchHandlerDefaultState = (function (_super) {
        __extends(TouchHandlerDefaultState, _super);
        function TouchHandlerDefaultState() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TouchHandlerDefaultState.prototype.onTouchStart = function (evt) {
            var _this = this;
            var activeSubDocument = this.handler.control.model.activeSubDocument;
            if (this.shouldProcessResizeBoxVisualizer(evt)) {
                if (this.resizeRotationChecker(function () {
                    if (activeSubDocument.isTextBox())
                        __aspxRichEdit.MouseHandlerHelper.selectParentsTextBox(_this.handler.control);
                    _this.beginResizeBoxTouchHandler(evt);
                }))
                    return;
            }
            if (__aspxRichEdit.ResizeBoxVisualizer.shouldRotate(evt, this.handler.control)) {
                if (this.resizeRotationChecker(function () {
                    if (activeSubDocument.isTextBox())
                        __aspxRichEdit.MouseHandlerHelper.selectParentsTextBox(_this.handler.control);
                    _this.handler.switchState(new __aspxRichEdit.TouchHandlerRotateBoxState(_this.handler));
                    _this.handler.state.onTouchStart(evt);
                }))
                    return;
            }
            var htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.Max, activeSubDocument);
            if (htr.exactlyDetailLevel == __aspxRichEdit.DocumentLayoutDetailsLevel.None)
                return;
            if (!__aspxRichEdit.ResizeBoxVisualizer.shouldHandleTextBoxAreaClick(evt) && activeSubDocument.isTextBox()) {
                __aspxRichEdit.MouseHandlerHelper.changeActiveSubDocumentToParent(this.handler.control);
                htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.Max, this.handler.control.model.activeSubDocument);
            }
            if (htr.floatingObject && htr.floatingObject.belongsToSubDocId == this.handler.control.model.activeSubDocument.id) {
                var box = htr.floatingObject;
                var pos = this.handler.control.layout.anchorObjectsPositionInfo.getPosition(box.objectId);
                var newInterval = new __aspxRichEdit.FixedInterval(pos, 1);
                var isObjectAlreadySelected_1 = this.handler.control.selection.intervals.length == 1 && this.handler.control.selection.intervals[0].equals(newInterval);
                this.handler.control.selection.setSelection(new __aspxRichEdit.SetSelectionParams().setInterval(newInterval));
                if (box.getType() == __aspxRichEdit.LayoutBoxType.AnchorTextBox &&
                    __aspxRichEdit.HitTestManager.isPointInTexBoxArea(evt.layoutPoint, box, activeSubDocument.isTextBox() ? 0 : box.rotationInRadians)) {
                    this.handler.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToTextBox)
                        .execute(this.handler.control.commandManager.isPublicApiCall);
                    this.handler.boxVisualizerManager.resizeBoxVisualizer.show(htr.pageIndex, null, null, null, box);
                    htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.Max, this.handler.control.model.activeSubDocument);
                }
                else {
                    if (this.resizeRotationChecker(function () {
                        if (isObjectAlreadySelected_1) {
                            _this.handler.switchState(new __aspxRichEdit.TouchHandlerDragFloatingObjectState(_this.handler));
                            _this.handler.state.onTouchStart(evt);
                        }
                    }))
                        return;
                    else {
                        var specRunInfo = this.handler.control.selection.specialRunInfo;
                        if (specRunInfo.isPictureSelected() && specRunInfo.isSelectedAnchorObject) {
                            this.handler.control.selection.setSelection(new __aspxRichEdit.SetSelectionParams()
                                .setInterval(new __aspxRichEdit.FixedInterval(specRunInfo.getPicturePosition(), 1)));
                            return;
                        }
                    }
                }
            }
            if (!this.handler.control.selection.isCollapsed() && (this.isAreaToLeftOfText(htr, evt) || this.isAreaToRightOfText(htr, evt)))
                this.collapseSelection(htr);
            else
                this.handler.switchState(this.getNextState(evt));
        };
        TouchHandlerDefaultState.prototype.onTouchMove = function (_evt) {
            return true;
        };
        TouchHandlerDefaultState.prototype.onDoubleTap = function (evt) {
            var htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.Max, this.handler.control.model.activeSubDocument);
            if (htr.exactlyDetailLevel >= __aspxRichEdit.DocumentLayoutDetailsLevel.Box)
                this.handler.switchState(new __aspxRichEdit.TouchHandlerSelectWordUnderCursorState(this.handler, evt));
            else
                this.handler.switchState(new __aspxRichEdit.TouchHandlerChangeActiveSubDocument(this.handler, evt.layoutPoint));
        };
        TouchHandlerDefaultState.prototype.getLayoutPosition = function (logPosition) {
            var subDocument = this.handler.control.model.activeSubDocument;
            return subDocument.isMain()
                ? __aspxRichEdit.LayoutPositionMainSubDocumentCreator.ensureLayoutPosition(this.handler.control, this.handler.control.layout, subDocument, logPosition, __aspxRichEdit.DocumentLayoutDetailsLevel.Character, new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(this.handler.control.selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false))
                : new __aspxRichEdit.LayoutPositionOtherSubDocumentCreator(this.handler.control.layout, subDocument, logPosition, this.handler.control.selection.pageIndex, __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                    .create(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(this.handler.control.selection.endOfLine), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
        };
        TouchHandlerDefaultState.prototype.getNextState = function (evt) {
            var lpStart = this.getLayoutPosition(this.handler.control.selection.intervals[0].start);
            if (this.canExtendSelection(evt.layoutPoint, lpStart))
                return new __aspxRichEdit.TouchHandlerContinueSelectionState(this.handler);
            for (var i = 0, interval = void 0; interval = this.handler.control.selection.intervals[i]; i++) {
                if (this.canExtendSelectionOnOneSide(evt.layoutPoint, interval))
                    return new __aspxRichEdit.TouchHandlerContinueSelectionOnOneSideState(this.handler, this.isHitPoints(evt.layoutPoint, lpStart.getPositionRelativePage(this.handler.control.measurer), lpStart.row.height));
            }
            return new __aspxRichEdit.TouchHandlerBeginTapProcessingState(this.handler, evt);
        };
        TouchHandlerDefaultState.prototype.canExtendSelection = function (mousePoint, lpStart) {
            return this.handler.control.focusManager.isInFocus &&
                this.handler.control.selection.isCollapsed() &&
                this.isHitPoints(mousePoint, lpStart.getPositionRelativePage(this.handler.control.measurer), lpStart.row.height);
        };
        TouchHandlerDefaultState.prototype.canExtendSelectionOnOneSide = function (mousePoint, selectionInterval) {
            return this.handler.control.focusManager.isInFocus && this.isLeftOrRightEdge(mousePoint, selectionInterval);
        };
        TouchHandlerDefaultState.prototype.isLeftOrRightEdge = function (mousePoint, selectionInterval) {
            var lpStart = this.getLayoutPosition(selectionInterval.start);
            var lpEnd = this.getLayoutPosition(selectionInterval.end);
            return this.isHitPoints(mousePoint, lpStart.getPositionRelativePage(this.handler.control.measurer), lpStart.row.height) ||
                this.isHitPoints(mousePoint, lpEnd.getPositionRelativePage(this.handler.control.measurer), lpEnd.row.height);
        };
        TouchHandlerDefaultState.prototype.isHitPoints = function (mousePoint, selectionPoint, height) {
            var hitX = Math.abs(mousePoint.x - selectionPoint.x) < __aspxRichEdit.TOUCH_RADIUS_HANDLE;
            var hitY = false;
            if (mousePoint.y < selectionPoint.y)
                hitY = Math.abs(mousePoint.y - selectionPoint.y) < __aspxRichEdit.TOUCH_RADIUS_HANDLE;
            else
                hitY = (mousePoint.y - selectionPoint.y) < (__aspxRichEdit.TOUCH_RADIUS_HANDLE + height);
            return hitX && hitY;
        };
        TouchHandlerDefaultState.prototype.shouldProcessResizeBoxVisualizer = function (evt) {
            if (this.handler.boxVisualizerManager.resizeBoxVisualizer.shouldCapture(evt) &&
                this.handler.control.model.activeSubDocument.isEditable([new __aspxRichEdit.FixedInterval(this.handler.control.selection.specialRunInfo.getPosition(), 1)])) {
                this.beginResizeBoxTouchHandler(evt);
                return true;
            }
            return false;
        };
        TouchHandlerDefaultState.prototype.beginResizeBoxTouchHandler = function (evt) {
            this.handler.switchState(new __aspxRichEdit.TouchHandlerResizeBoxState(this.handler));
            this.handler.state.onTouchStart(evt);
        };
        TouchHandlerDefaultState.prototype.isAreaToLeftOfText = function (htr, evt) {
            return htr.exactlyDetailLevel == __aspxRichEdit.DocumentLayoutDetailsLevel.PageArea &&
                htr.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.Column] & __aspxRichEdit.HitTestDeviation.Left &&
                evt.layoutPoint.x <= htr.pageArea.x + htr.column.x;
        };
        TouchHandlerDefaultState.prototype.isAreaToRightOfText = function (htr, evt) {
            return htr.exactlyDetailLevel == __aspxRichEdit.DocumentLayoutDetailsLevel.PageArea &&
                htr.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.Column] & __aspxRichEdit.HitTestDeviation.Right &&
                evt.layoutPoint.x >= htr.pageArea.x + htr.column.x + htr.column.width;
        };
        TouchHandlerDefaultState.prototype.collapseSelection = function (htr) {
            var selection = this.handler.control.selection;
            var position = htr.row.getLastVisibleBox().getEndPosition();
            selection.deprecatedSetSelection(position, position, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
        };
        return TouchHandlerDefaultState;
    }(__aspxRichEdit.TouchHandlerStateBase));
    __aspxRichEdit.TouchHandlerDefaultState = TouchHandlerDefaultState;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TouchHandlerDragContentState = (function (_super) {
        __extends(TouchHandlerDragContentState, _super);
        function TouchHandlerDragContentState(handler) {
            return _super.call(this, handler) || this;
        }
        TouchHandlerDragContentState.prototype.finish = function () {
            this.handler.boxVisualizerManager.dragCaretVisualizer.hide();
        };
        TouchHandlerDragContentState.prototype.onTouchMove = function (evt) {
            this.continueDrag(evt);
            return false;
        };
        TouchHandlerDragContentState.prototype.onTouchEnd = function (evt) {
            this.commitDrag(evt);
            this.handler.switchToDefaultState();
        };
        TouchHandlerDragContentState.prototype.continueDrag = function (evt) {
            var htr = this.calculateHitTest(evt);
            if (htr.exactlyDetailLevel >= __aspxRichEdit.DocumentLayoutDetailsLevel.Character)
                this.handler.boxVisualizerManager.dragCaretVisualizer.show(htr);
        };
        TouchHandlerDragContentState.prototype.commitDrag = function (evt) {
            var htr = this.calculateHitTest(evt);
            if (htr.exactlyDetailLevel >= __aspxRichEdit.DocumentLayoutDetailsLevel.Character) {
                var subDocument = this.handler.control.model.activeSubDocument;
                var interval = new __aspxRichEdit.FixedInterval(htr.getPosition(), 0);
                __aspxRichEdit.Field.correctIntervalDueToFields(subDocument, interval);
                var commandId = __aspxRichEdit.RichEditClientCommand.DragMoveContent;
                this.handler.control.commandManager.getCommand(commandId).execute(this.handler.control.commandManager.isPublicApiCall, interval.start);
            }
        };
        TouchHandlerDragContentState.prototype.calculateHitTest = function (evt) {
            var htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.Character, this.handler.control.model.activeSubDocument);
            if (htr.exactlyDetailLevel > __aspxRichEdit.DocumentLayoutDetailsLevel.None)
                htr.correctAsVisibleBox();
            return htr;
        };
        return TouchHandlerDragContentState;
    }(__aspxRichEdit.TouchHandlerStateBase));
    __aspxRichEdit.TouchHandlerDragContentState = TouchHandlerDragContentState;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TouchHandlerDragFloatingObjectState = (function (_super) {
        __extends(TouchHandlerDragFloatingObjectState, _super);
        function TouchHandlerDragFloatingObjectState() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TouchHandlerDragFloatingObjectState.prototype.onTouchStart = function (evt) {
            this.dragFloatingObjectsHelper = new __aspxRichEdit.DragFloatingObjectsHelper(this.handler.control, this.handler.boxVisualizerManager.resizeBoxVisualizer);
            this.dragFloatingObjectsHelper.start(evt);
        };
        TouchHandlerDragFloatingObjectState.prototype.onTouchMove = function (evt) {
            this.dragFloatingObjectsHelper.move(evt);
            return false;
        };
        TouchHandlerDragFloatingObjectState.prototype.onTouchEnd = function (evt) {
            this.dragFloatingObjectsHelper.end(evt);
            this.handler.switchToDefaultState();
        };
        return TouchHandlerDragFloatingObjectState;
    }(__aspxRichEdit.TouchHandlerStateBase));
    __aspxRichEdit.TouchHandlerDragFloatingObjectState = TouchHandlerDragFloatingObjectState;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TouchHandlerResizeBoxState = (function (_super) {
        __extends(TouchHandlerResizeBoxState, _super);
        function TouchHandlerResizeBoxState() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TouchHandlerResizeBoxState.prototype.start = function () {
            this.resizeBoxHelper = new __aspxRichEdit.ResizeBoxHelper(this.handler.control, this.handler.boxVisualizerManager.resizeBoxVisualizer);
        };
        TouchHandlerResizeBoxState.prototype.onTouchStart = function (evt) {
            this.resizeBoxHelper.start(evt);
        };
        TouchHandlerResizeBoxState.prototype.onTouchMove = function (evt) {
            this.resizeBoxHelper.move(evt);
            return false;
        };
        TouchHandlerResizeBoxState.prototype.onTouchEnd = function (evt) {
            this.resizeBoxHelper.end(evt);
            this.handler.switchToDefaultState();
        };
        return TouchHandlerResizeBoxState;
    }(__aspxRichEdit.TouchHandlerStateBase));
    __aspxRichEdit.TouchHandlerResizeBoxState = TouchHandlerResizeBoxState;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TouchHandlerRotateBoxState = (function (_super) {
        __extends(TouchHandlerRotateBoxState, _super);
        function TouchHandlerRotateBoxState() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TouchHandlerRotateBoxState.prototype.onTouchStart = function (evt) {
            this.rotateBoxHelper = new __aspxRichEdit.RotateBoxHelper(this.handler.control, this.handler.boxVisualizerManager.resizeBoxVisualizer);
            this.rotateBoxHelper.start(evt);
        };
        TouchHandlerRotateBoxState.prototype.onTouchMove = function (evt) {
            this.rotateBoxHelper.move(evt);
            return false;
        };
        TouchHandlerRotateBoxState.prototype.onTouchEnd = function (evt) {
            this.rotateBoxHelper.end(evt);
            this.handler.switchToDefaultState();
        };
        return TouchHandlerRotateBoxState;
    }(__aspxRichEdit.TouchHandlerStateBase));
    __aspxRichEdit.TouchHandlerRotateBoxState = TouchHandlerRotateBoxState;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TouchHandlerSelectionStateBase = (function (_super) {
        __extends(TouchHandlerSelectionStateBase, _super);
        function TouchHandlerSelectionStateBase() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TouchHandlerSelectionStateBase.prototype.onTouchEnd = function (evt) {
            this.handler.switchToDefaultState();
            this.setLastLayoutPosition();
            this.captureInputFocus(evt);
            this.showPopupMenu();
        };
        return TouchHandlerSelectionStateBase;
    }(__aspxRichEdit.TouchHandlerStateBase));
    __aspxRichEdit.TouchHandlerSelectionStateBase = TouchHandlerSelectionStateBase;
    var TouchHandlerChangeActiveSubDocument = (function (_super) {
        __extends(TouchHandlerChangeActiveSubDocument, _super);
        function TouchHandlerChangeActiveSubDocument(handler, point) {
            var _this = _super.call(this, handler) || this;
            var htr = _this.handler.control.hitTestManager.calculate(point, __aspxRichEdit.DocumentLayoutDetailsLevel.Max, _this.handler.control.model.activeSubDocument);
            var activeSubDocument = _this.handler.control.model.activeSubDocument;
            if (activeSubDocument.isMain()) {
                if (htr.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.PageArea] & __aspxRichEdit.HitTestDeviation.Top) {
                    _this.handler.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.InsertHeader).execute(_this.handler.control.commandManager.isPublicApiCall, htr.pageIndex);
                    return _this;
                }
                else if (htr.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.PageArea] & __aspxRichEdit.HitTestDeviation.Bottom) {
                    _this.handler.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.InsertFooter).execute(_this.handler.control.commandManager.isPublicApiCall, htr.pageIndex);
                    return _this;
                }
            }
            else if (_this.shouldActivateMainArea(activeSubDocument, htr)) {
                _this.handler.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToMain).execute(_this.handler.control.commandManager.isPublicApiCall);
            }
            _this.handler.switchToDefaultState();
            return _this;
        }
        TouchHandlerChangeActiveSubDocument.prototype.shouldActivateMainArea = function (activeSubDocument, htr) {
            return (activeSubDocument.isHeader() && !!(htr.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.PageArea] & __aspxRichEdit.HitTestDeviation.Bottom)) ||
                (activeSubDocument.isFooter() && !!(htr.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.PageArea] & __aspxRichEdit.HitTestDeviation.Top));
        };
        TouchHandlerChangeActiveSubDocument.prototype.onTouchStart = function (evt) {
            this.handler.switchToDefaultState();
            this.handler.state.onTouchStart(evt);
        };
        TouchHandlerChangeActiveSubDocument.prototype.onDoubleTap = function (evt) {
            var htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.Max, this.handler.control.model.activeSubDocument);
            var activeSubDocument = this.handler.control.model.activeSubDocument;
            if (this.shouldActivateMainArea(activeSubDocument, htr)) {
                this.handler.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeActiveSubDocumentToMain).execute(this.handler.control.commandManager.isPublicApiCall);
            }
            this.handler.switchToDefaultState();
        };
        return TouchHandlerChangeActiveSubDocument;
    }(__aspxRichEdit.TouchHandlerStateBase));
    __aspxRichEdit.TouchHandlerChangeActiveSubDocument = TouchHandlerChangeActiveSubDocument;
    var TouchHandlerSelectWordUnderCursorState = (function (_super) {
        __extends(TouchHandlerSelectWordUnderCursorState, _super);
        function TouchHandlerSelectWordUnderCursorState(handler, evt) {
            var _this = _super.call(this, handler) || this;
            _this.selectWordUnderCursor(evt);
            return _this;
        }
        TouchHandlerSelectWordUnderCursorState.prototype.onTouchStart = function (evt) {
            this.selectWordUnderCursor(evt);
        };
        TouchHandlerSelectWordUnderCursorState.prototype.onTouchMove = function (evt) {
            this.selectWordUnderCursor(evt);
            return false;
        };
        TouchHandlerSelectWordUnderCursorState.prototype.selectWordUnderCursor = function (evt) {
            var activeSubDocument = this.handler.control.model.activeSubDocument;
            var htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.Max, this.handler.control.model.activeSubDocument);
            if (htr.exactlyDetailLevel > __aspxRichEdit.DocumentLayoutDetailsLevel.None) {
                var position = htr.getRelatedSubDocumentPagePosition() + htr.pageArea.pageOffset + htr.column.pageAreaOffset + htr.row.columnOffset + htr.box.rowOffset + htr.charOffset;
                var startInterval = __aspxRichEdit.LayoutWordBounds.getLayoutWordStartBound(this.handler.control.layout, activeSubDocument, this.handler.control.selection, position);
                var endInterval = __aspxRichEdit.LayoutWordBounds.getLayoutWordEndBound(this.handler.control.layout, activeSubDocument, this.handler.control.selection, position, false);
                if (endInterval > startInterval)
                    this.handler.control.selection.deprecatedSetSelection(startInterval, endInterval, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
            }
        };
        return TouchHandlerSelectWordUnderCursorState;
    }(TouchHandlerSelectionStateBase));
    __aspxRichEdit.TouchHandlerSelectWordUnderCursorState = TouchHandlerSelectWordUnderCursorState;
    var TouchHandlerContinueSelectionStateBase = (function (_super) {
        __extends(TouchHandlerContinueSelectionStateBase, _super);
        function TouchHandlerContinueSelectionStateBase(handler) {
            return _super.call(this, handler) || this;
        }
        TouchHandlerContinueSelectionStateBase.prototype.onTouchMove = function (evt) {
            this.handler.control.viewManager.selection.touchSelectionCircleElementsManager.setVisibilityTouchBars(false);
            evt.layoutPoint.y -= __aspxRichEdit.TOUCH_RADIUS_HANDLE;
            var htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.Character, this.handler.control.model.activeSubDocument);
            if (htr.exactlyDetailLevel > __aspxRichEdit.DocumentLayoutDetailsLevel.None)
                this.extendSelection(htr);
            return false;
        };
        TouchHandlerContinueSelectionStateBase.prototype.onTouchEnd = function (evt) {
            _super.prototype.onTouchEnd.call(this, evt);
            this.handler.control.viewManager.selection.touchSelectionCircleElementsManager.setVisibilityTouchBars(true);
            this.setEditableDocumentContent();
        };
        TouchHandlerContinueSelectionStateBase.prototype.extendSelection = function (_htr) {
        };
        return TouchHandlerContinueSelectionStateBase;
    }(TouchHandlerSelectionStateBase));
    __aspxRichEdit.TouchHandlerContinueSelectionStateBase = TouchHandlerContinueSelectionStateBase;
    var TouchHandlerContinueSelectionState = (function (_super) {
        __extends(TouchHandlerContinueSelectionState, _super);
        function TouchHandlerContinueSelectionState() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TouchHandlerContinueSelectionState.prototype.onTouchMove = function (evt) {
            this.handler.control.viewManager.selection.touchSelectionCircleElementsManager.setVisibilityTouchBars(false);
            evt.layoutPoint.y -= __aspxRichEdit.TOUCH_RADIUS_HANDLE;
            var htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.Character, this.handler.control.model.activeSubDocument);
            if (htr.exactlyDetailLevel > __aspxRichEdit.DocumentLayoutDetailsLevel.None) {
                if (!this.startPosition) {
                    this.setLastLayoutPosition();
                    this.startPosition = this.lastLayoutPosition;
                }
                this.extendSelection(htr);
            }
            return false;
        };
        TouchHandlerContinueSelectionState.prototype.onTouchEnd = function (evt) {
            this.captureInputFocus(evt);
            this.setLastLayoutPosition();
            if (!this.startPosition)
                this.startPosition = this.lastLayoutPosition;
            if (this.startPosition.equals(this.lastLayoutPosition))
                this.showPopupMenu();
            this.handler.switchToDefaultState();
            this.handler.control.viewManager.selection.touchSelectionCircleElementsManager.setVisibilityTouchBars(true);
            this.setEditableDocumentContent();
        };
        TouchHandlerContinueSelectionState.prototype.extendSelection = function (htr) {
            var position = this.getLayoutPosition(htr);
            var endOfLine = position === (htr.pageArea.subDocument.isMain() ? htr.page.getPosition() : 0)
                + htr.pageArea.pageOffset + htr.column.pageAreaOffset + htr.row.getEndPosition();
            this.handler.control.selection.deprecatedSetSelection(position, position, endOfLine, -1, __aspxRichEdit.UpdateInputPositionProperties.No);
        };
        TouchHandlerContinueSelectionState.prototype.getLayoutPosition = function (htr) {
            var position = (htr.pageArea.subDocument.isMain() ? htr.page.getPosition() : 0) + htr.pageArea.pageOffset + htr.column.pageAreaOffset + htr.row.columnOffset;
            if (htr.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.Row] & __aspxRichEdit.HitTestDeviation.Right) {
                var lastVisibleBoxInRow = htr.row.getLastVisibleBox();
                if (lastVisibleBoxInRow)
                    position += lastVisibleBoxInRow.getEndPosition();
            }
            else {
                position += htr.box.rowOffset + htr.charOffset;
                if (htr.boxIndex == htr.row.boxes.length - 1 && htr.charOffset == htr.box.getLength() && !htr.box.isVisible())
                    position -= 1;
            }
            return position;
        };
        return TouchHandlerContinueSelectionState;
    }(TouchHandlerContinueSelectionStateBase));
    __aspxRichEdit.TouchHandlerContinueSelectionState = TouchHandlerContinueSelectionState;
    var TouchHandlerContinueSelectionOnOneSideState = (function (_super) {
        __extends(TouchHandlerContinueSelectionOnOneSideState, _super);
        function TouchHandlerContinueSelectionOnOneSideState(handler, isDragLeftEdge) {
            if (isDragLeftEdge === void 0) { isDragLeftEdge = true; }
            var _this = _super.call(this, handler) || this;
            _this.isDragLeftEdge = false;
            _this.isDragLeftEdge = isDragLeftEdge;
            return _this;
        }
        TouchHandlerContinueSelectionOnOneSideState.prototype.extendSelection = function (htr) {
            this.handler.control.selection.extendLastSelectionOnOneSide(Math.min(htr.getPosition(), htr.subDocument.getDocumentEndPosition() - 1), false, this.isDragLeftEdge);
        };
        return TouchHandlerContinueSelectionOnOneSideState;
    }(TouchHandlerContinueSelectionStateBase));
    __aspxRichEdit.TouchHandlerContinueSelectionOnOneSideState = TouchHandlerContinueSelectionOnOneSideState;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TouchHandlerWaitingStateBase = (function (_super) {
        __extends(TouchHandlerWaitingStateBase, _super);
        function TouchHandlerWaitingStateBase(handler, interval, action) {
            var _this = _super.call(this, handler) || this;
            _this.action = action;
            _this.timerID = setTimeout(function () {
                _this.timerID = -1;
                _this.action();
            }, interval);
            return _this;
        }
        TouchHandlerWaitingStateBase.prototype.onTouchEnd = function (_evt) {
            this.finish();
        };
        TouchHandlerWaitingStateBase.prototype.onTouchMove = function (_evt) {
            this.finish();
            this.handler.switchToDefaultState();
            return true;
        };
        TouchHandlerWaitingStateBase.prototype.finish = function () {
            if (this.timerID != -1)
                clearTimeout(this.timerID);
        };
        TouchHandlerWaitingStateBase.prototype.handleTap = function (evt) {
            var htr = this.handler.control.hitTestManager.calculate(evt.layoutPoint, __aspxRichEdit.DocumentLayoutDetailsLevel.Character, this.handler.control.model.activeSubDocument);
            if (htr.exactlyDetailLevel > __aspxRichEdit.DocumentLayoutDetailsLevel.None && this.shouldSelectPicture(htr))
                this.selectImage(htr);
            else if (htr.exactlyDetailLevel > __aspxRichEdit.DocumentLayoutDetailsLevel.None) {
                this.setLastLayoutPosition();
                var position = this.getLayoutPosition(htr);
                var endOfLine = position === (htr.pageArea.subDocument.isMain() ? htr.page.getPosition() : 0)
                    + htr.pageArea.pageOffset + htr.column.pageAreaOffset + htr.row.getEndPosition();
                this.handler.control.selection.deprecatedSetSelection(position, position, endOfLine, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
                this.setEditableDocumentContent();
                this.captureInputFocus(evt);
                this.handler.control.viewManager.selection.touchSelectionCircleElementsManager.setVisibilityTouchBars(true);
            }
        };
        TouchHandlerWaitingStateBase.prototype.getLayoutPosition = function (htr) {
            var position = (htr.pageArea.subDocument.isMain() ? htr.page.getPosition() : 0) + htr.pageArea.pageOffset + htr.column.pageAreaOffset + htr.row.columnOffset;
            if (htr.deviations[__aspxRichEdit.DocumentLayoutDetailsLevel.Row] & __aspxRichEdit.HitTestDeviation.Right) {
                var lastVisibleBoxInRow = htr.row.getLastVisibleBox();
                if (lastVisibleBoxInRow)
                    position += lastVisibleBoxInRow.getEndPosition();
            }
            else {
                position += htr.box.rowOffset + htr.charOffset;
                if (htr.boxIndex == htr.row.boxes.length - 1 && htr.charOffset == htr.box.getLength() && !htr.box.isVisible())
                    position -= 1;
            }
            return position;
        };
        TouchHandlerWaitingStateBase.prototype.shouldSelectPicture = function (htr) {
            if (htr.exactlyDetailLevel < __aspxRichEdit.DocumentLayoutDetailsLevel.Box)
                return false;
            return htr.box instanceof __aspxRichEdit.LayoutPictureBox;
        };
        TouchHandlerWaitingStateBase.prototype.selectImage = function (htr) {
            var position = htr.getPosition() - htr.charOffset;
            var selection = this.handler.control.selection;
            selection.deprecatedSetSelection(position, position + 1, false, -1, __aspxRichEdit.UpdateInputPositionProperties.Yes);
            this.handler.control.viewManager.selection.touchSelectionCircleElementsManager.setVisibilityTouchBars(false);
        };
        TouchHandlerWaitingStateBase.prototype.beginDragExistingSelection = function () {
            var dragState = new __aspxRichEdit.TouchHandlerDragContentState(this.handler);
            var state = new __aspxRichEdit.TouchHandlerBeginDragHelperState(this.handler, dragState);
            this.handler.switchState(state);
        };
        return TouchHandlerWaitingStateBase;
    }(__aspxRichEdit.TouchHandlerStateBase));
    __aspxRichEdit.TouchHandlerWaitingStateBase = TouchHandlerWaitingStateBase;
    var TouchHandlerBeginTapProcessingState = (function (_super) {
        __extends(TouchHandlerBeginTapProcessingState, _super);
        function TouchHandlerBeginTapProcessingState(handler, evt) {
            var _this = _super.call(this, handler, 500, function () {
                if (_this.handler.boxVisualizerManager.resizeBoxVisualizer.isResizeBoxVisible())
                    _this.beginDragExistingSelection();
                else
                    handler.switchState(new TouchHandlerBeginWaitForLongTapState(handler, evt));
            }) || this;
            return _this;
        }
        TouchHandlerBeginTapProcessingState.prototype.onTouchStart = function (evt) {
            this.finish();
            this.handler.switchState(new __aspxRichEdit.TouchHandlerSelectWordUnderCursorState(this.handler, evt));
        };
        TouchHandlerBeginTapProcessingState.prototype.onTouchEnd = function (evt) {
            this.handleTap(evt);
            this.finish();
            this.handler.switchToDefaultState();
        };
        return TouchHandlerBeginTapProcessingState;
    }(TouchHandlerWaitingStateBase));
    __aspxRichEdit.TouchHandlerBeginTapProcessingState = TouchHandlerBeginTapProcessingState;
    var TouchHandlerBeginWaitForLongTapState = (function (_super) {
        __extends(TouchHandlerBeginWaitForLongTapState, _super);
        function TouchHandlerBeginWaitForLongTapState(handler, evt) {
            var _this = _super.call(this, handler, 100, function () {
                _this.handleTap(evt);
                _this.showPopupMenu();
                _this.finish();
                _this.handler.switchToDefaultState();
            }) || this;
            return _this;
        }
        return TouchHandlerBeginWaitForLongTapState;
    }(TouchHandlerWaitingStateBase));
    __aspxRichEdit.TouchHandlerBeginWaitForLongTapState = TouchHandlerBeginWaitForLongTapState;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Ruler;
    (function (Ruler) {
        var DisplayControlBase = (function () {
            function DisplayControlBase() {
                this.visible = true;
                this.rootElement = this.createRootElement();
            }
            DisplayControlBase.prototype.initialize = function () {
                this.initializeInternal();
                this.afterInitialize();
            };
            DisplayControlBase.prototype.initializeInternal = function () {
                this.createControlHierarchy();
                this.prepareControlHierarchy();
            };
            DisplayControlBase.prototype.afterInitialize = function () {
            };
            DisplayControlBase.prototype.createControlHierarchy = function () {
            };
            DisplayControlBase.prototype.prepareControlHierarchy = function () {
            };
            DisplayControlBase.prototype.createRootElement = function () {
                return document.createElement("DIV");
            };
            DisplayControlBase.prototype.getHtmlRootElement = function () {
                return this.rootElement;
            };
            DisplayControlBase.prototype.setVisible = function (visible) {
                this.visible = visible;
                this.getHtmlRootElement().style.display = visible ? "" : "none";
            };
            DisplayControlBase.prototype.getVisible = function () {
                return this.visible;
            };
            return DisplayControlBase;
        }());
        Ruler.DisplayControlBase = DisplayControlBase;
        var TabAlignBoxControl = (function (_super) {
            __extends(TabAlignBoxControl, _super);
            function TabAlignBoxControl(settings) {
                var _this = _super.call(this) || this;
                _this.align = __aspxRichEdit.TabAlign.Left;
                _this.enable = false;
                _this.settings = settings;
                return _this;
            }
            TabAlignBoxControl.prototype.afterInitialize = function () {
                var _this = this;
                REWebUtils.Evt.AttachEventToElement(this.innerSquareElement, REWebUtils.TouchUIHelper.touchMouseDownEventName, function (evt) { return _this.onMouseDown(evt); });
            };
            TabAlignBoxControl.prototype.createControlHierarchy = function () {
                _super.prototype.createControlHierarchy.call(this);
                this.innerSquareElement = document.createElement("DIV");
                this.rootElement.appendChild(this.innerSquareElement);
                this.alignElement = document.createElement("DIV");
                this.innerSquareElement.appendChild(this.alignElement);
            };
            TabAlignBoxControl.prototype.prepareControlHierarchy = function () {
                _super.prototype.prepareControlHierarchy.call(this);
                this.getHtmlRootElement().className = Ruler.TAB_ALIGN_BOX_PART_HANDLE_CLASS_NAME;
                this.alignElement.className = Ruler.RulerUtils.getSpriteClassName(this.align, this.settings);
            };
            TabAlignBoxControl.prototype.adjust = function (offset, size) {
                this.innerSquareElement.style.width = size + "px";
                this.innerSquareElement.style.height = size + "px";
                this.innerSquareElement.style.top = offset + "px";
                this.innerSquareElement.style.left = offset + "px";
                this.getHtmlRootElement().style.width = size + 2 * offset + "px";
                this.getHtmlRootElement().style.height = size + 2 * offset + "px";
                this.adjustAlignElement();
            };
            TabAlignBoxControl.prototype.setEnable = function (enable) {
                this.enable = enable;
            };
            TabAlignBoxControl.prototype.adjustAlignElement = function () {
                var size = this.innerSquareElement.offsetWidth;
                this.alignElement.style.top = (size - this.alignElement.offsetHeight) / 2 + "px";
                this.alignElement.style.left = (size - this.alignElement.offsetWidth) / 2 + "px";
                this.alignElement.title = this.settings.titles[Ruler.RulerUtils.getTabTitlePropertyName(this.align)];
            };
            TabAlignBoxControl.prototype.onMouseDown = function (evt) {
                if (!this.enable) {
                    this.align++;
                    if (this.align > __aspxRichEdit.TabAlign.Decimal)
                        this.align = __aspxRichEdit.TabAlign.Left;
                    this.alignElement.className = Ruler.RulerUtils.getSpriteClassName(this.align, this.settings);
                    this.adjustAlignElement();
                    REWebUtils.Evt.PreventEvent(evt);
                }
            };
            return TabAlignBoxControl;
        }(DisplayControlBase));
        Ruler.TabAlignBoxControl = TabAlignBoxControl;
        var PureDragDisplayControl = (function (_super) {
            __extends(PureDragDisplayControl, _super);
            function PureDragDisplayControl(settings) {
                var _this = _super.call(this) || this;
                _this.settings = settings;
                return _this;
            }
            PureDragDisplayControl.prototype.setPosition = function (_value, _snapTo) {
                if (_snapTo === void 0) { _snapTo = Ruler.SnapTo.LeftSide; }
            };
            PureDragDisplayControl.prototype.canHandle = function (source) {
                return source == this.getHandleElement();
            };
            PureDragDisplayControl.prototype.getHandleElement = function () {
                return this.getHtmlRootElement();
            };
            return PureDragDisplayControl;
        }(DisplayControlBase));
        Ruler.PureDragDisplayControl = PureDragDisplayControl;
        var DragDisplayControl = (function (_super) {
            __extends(DragDisplayControl, _super);
            function DragDisplayControl(settings) {
                var _this = _super.call(this, settings) || this;
                _this.position = 0;
                _this.shadowElements = [];
                return _this;
            }
            DragDisplayControl.prototype.afterInitialize = function () {
                _super.prototype.afterInitialize.call(this);
                if (this.hasShadow())
                    this.createShadowElements();
            };
            DragDisplayControl.prototype.createShadowElements = function () {
                var _this = this;
                __aspxRichEdit.ListUtils.foreach(this.getClonedElements(), function (element) {
                    var cloneElement = element.cloneNode(true);
                    cloneElement.style.display = "none";
                    REWebUtils.SetElementOpacity(cloneElement, 0.5);
                    _this.shadowElements.push(cloneElement);
                    _this.getHtmlRootElement().parentNode.appendChild(cloneElement);
                });
            };
            DragDisplayControl.prototype.setPosition = function (value) {
                var elements = this.getMovableElements();
                value = this.getCorrectedValue(value);
                if (this.position != value)
                    for (var i = 0; i < elements.length; i++)
                        this.setPositionInternal(elements[i], value);
            };
            DragDisplayControl.prototype.setPositionInternal = function (element, value) {
                this.position = value;
                element.style[this.getMovableStyleName()] = this.position + "px";
            };
            DragDisplayControl.prototype.getCorrectedValue = function (value) {
                return value;
            };
            DragDisplayControl.prototype.getMovableElements = function () {
                return [];
            };
            DragDisplayControl.prototype.getMovableStyleName = function () {
                return "left";
            };
            DragDisplayControl.prototype.hasShadow = function () {
                return false;
            };
            DragDisplayControl.prototype.showShadow = function () {
                var _this = this;
                __aspxRichEdit.ListUtils.foreach(this.shadowElements, function (element) {
                    element.style.display = "";
                    element.style[_this.getMovableStyleName()] = _this.position.toString() + "px";
                });
            };
            DragDisplayControl.prototype.hideShadow = function () {
                __aspxRichEdit.ListUtils.foreach(this.shadowElements, function (element) { element.style.display = "none"; });
            };
            DragDisplayControl.prototype.getClonedElements = function () {
                return [this.getHtmlRootElement()];
            };
            return DragDisplayControl;
        }(PureDragDisplayControl));
        Ruler.DragDisplayControl = DragDisplayControl;
        var AdvancedDragDisplayControl = (function (_super) {
            __extends(AdvancedDragDisplayControl, _super);
            function AdvancedDragDisplayControl(settins) {
                return _super.call(this, settins) || this;
            }
            AdvancedDragDisplayControl.prototype.prepareControlHierarchy = function () {
                _super.prototype.prepareControlHierarchy.call(this);
                this.setTitle();
            };
            AdvancedDragDisplayControl.prototype.setTitle = function () {
                this.getTitleElement().title = this.getTitle();
            };
            AdvancedDragDisplayControl.prototype.getTitleElement = function () {
                return null;
            };
            AdvancedDragDisplayControl.prototype.getTitle = function () {
                return "";
            };
            return AdvancedDragDisplayControl;
        }(DragDisplayControl));
        Ruler.AdvancedDragDisplayControl = AdvancedDragDisplayControl;
        var DragHandleBase = (function (_super) {
            __extends(DragHandleBase, _super);
            function DragHandleBase(settings, divisionContol) {
                var _this = _super.call(this, settings) || this;
                _this.heightOfProtrudingPart = 0;
                _this.leftCorrection = 0;
                _this.divisionContol = divisionContol;
                return _this;
            }
            DragHandleBase.prototype.prepareControlHierarchy = function () {
                _super.prototype.prepareControlHierarchy.call(this);
                this.getHtmlRootElement().className = this.getClassName();
                this.adjustByTop();
            };
            DragHandleBase.prototype.adjustByTop = function () {
                var mainElementHeight = this.getHtmlRootElement().offsetHeight;
                var divisionsControlHeight = this.divisionContol.getHeight();
                this.getHtmlRootElement().style.marginTop = (this.getIsTopPosition() ? -(divisionsControlHeight - mainElementHeight) : divisionsControlHeight) / 2 + "px";
            };
            DragHandleBase.prototype.afterInitialize = function () {
                _super.prototype.afterInitialize.call(this);
                this.leftCorrection = Math.round(this.getHtmlRootElement().offsetWidth / 2);
                this.heightOfProtrudingPart = this.getHtmlRootElement().offsetHeight - this.divisionContol.getHeight() / 2;
            };
            DragHandleBase.prototype.getTitleElement = function () {
                return this.getHtmlRootElement();
            };
            DragHandleBase.prototype.getMovableStyleName = function () {
                return "left";
            };
            DragHandleBase.prototype.getCorrectedValue = function (value) {
                return Ruler.RULLER_NUMBER_CORRECTION + value - this.leftCorrection;
            };
            DragHandleBase.prototype.getMovableElements = function () {
                return [this.getHtmlRootElement()];
            };
            DragHandleBase.prototype.getHeightOfProtrudingPart = function () {
                return this.heightOfProtrudingPart;
            };
            DragHandleBase.prototype.getIsTopPosition = function () {
                return true;
            };
            DragHandleBase.prototype.getClassName = function () {
                return "";
            };
            DragHandleBase.prototype.hasShadow = function () {
                return true;
            };
            return DragHandleBase;
        }(AdvancedDragDisplayControl));
        Ruler.DragHandleBase = DragHandleBase;
        var FirstLineIndentDragHandleControl = (function (_super) {
            __extends(FirstLineIndentDragHandleControl, _super);
            function FirstLineIndentDragHandleControl() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            FirstLineIndentDragHandleControl.prototype.getTitle = function () {
                return this.settings.titles.firstLineIndent;
            };
            FirstLineIndentDragHandleControl.prototype.getClassName = function () {
                return this.settings.styles.firstLineIndentImage.spriteCssClass + " " + this.settings.styles.firstLineIndent.className;
            };
            return FirstLineIndentDragHandleControl;
        }(DragHandleBase));
        Ruler.FirstLineIndentDragHandleControl = FirstLineIndentDragHandleControl;
        var RightIndentDragHandleControl = (function (_super) {
            __extends(RightIndentDragHandleControl, _super);
            function RightIndentDragHandleControl() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            RightIndentDragHandleControl.prototype.getMovableStyleName = function () {
                return "right";
            };
            RightIndentDragHandleControl.prototype.getIsTopPosition = function () {
                return false;
            };
            RightIndentDragHandleControl.prototype.getTitle = function () {
                return this.settings.titles.rightIndent;
            };
            RightIndentDragHandleControl.prototype.getClassName = function () {
                return this.settings.styles.rightIndentImage.spriteCssClass + " " + this.settings.styles.rightIndent.className;
            };
            return RightIndentDragHandleControl;
        }(DragHandleBase));
        Ruler.RightIndentDragHandleControl = RightIndentDragHandleControl;
        var LeftIndentDragHandleControl = (function (_super) {
            __extends(LeftIndentDragHandleControl, _super);
            function LeftIndentDragHandleControl() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            LeftIndentDragHandleControl.prototype.createControlHierarchy = function () {
                _super.prototype.createControlHierarchy.call(this);
                this.topElement = document.createElement("DIV");
                this.topElement.className = this.settings.styles.leftIndentImage.spriteCssClass;
                this.bodyElement = document.createElement("DIV");
                this.bodyElement.className = Ruler.LEFT_INDENT_DRAG_HANDLE_BODY;
                this.rootElement.appendChild(this.topElement);
                this.rootElement.appendChild(this.bodyElement);
            };
            LeftIndentDragHandleControl.prototype.prepareControlHierarchy = function () {
                _super.prototype.prepareControlHierarchy.call(this);
                var mainElementWidth = this.topElement.offsetWidth;
                this.bodyElement.style.width = mainElementWidth + "px";
                var style = this.getHtmlRootElement().style;
                style.height = this.topElement.offsetHeight + this.bodyElement.offsetHeight + "px";
                style.width = mainElementWidth + "px";
                style.marginTop = this.divisionContol.getHeight() / 2 + "px";
                this.bodyElement.title = this.getTitleElement().title = this.settings.titles.leftIndent;
                this.topElement.title = this.getTitleElement().title = this.settings.titles.hangingIndent;
            };
            LeftIndentDragHandleControl.prototype.canHandleLeftIden = function (source) {
                return this.topElement == source;
            };
            LeftIndentDragHandleControl.prototype.canHadleHangingIndent = function (source) {
                return this.bodyElement == source;
            };
            LeftIndentDragHandleControl.prototype.getClassName = function () {
                return this.settings.styles.leftIndent.className;
            };
            return LeftIndentDragHandleControl;
        }(DragHandleBase));
        Ruler.LeftIndentDragHandleControl = LeftIndentDragHandleControl;
        var TabDragHandleControl = (function (_super) {
            __extends(TabDragHandleControl, _super);
            function TabDragHandleControl(settings, divisionContol, align) {
                var _this = _super.call(this, settings, divisionContol) || this;
                _this.align = __aspxRichEdit.TabAlign.Left;
                _this.align = align;
                return _this;
            }
            TabDragHandleControl.prototype.afterInitialize = function () {
                _super.prototype.afterInitialize.call(this);
                this.setCorrection();
            };
            TabDragHandleControl.prototype.setCorrection = function () {
                switch (this.align) {
                    case __aspxRichEdit.TabAlign.Left:
                        this.leftCorrection = 0;
                        break;
                    case __aspxRichEdit.TabAlign.Right:
                        this.leftCorrection = this.getHtmlRootElement().offsetWidth;
                        break;
                    case __aspxRichEdit.TabAlign.Center:
                    case __aspxRichEdit.TabAlign.Decimal:
                        this.leftCorrection = Math.round(this.getHtmlRootElement().offsetWidth / 2);
                        break;
                }
            };
            TabDragHandleControl.prototype.adjustByTop = function () {
                this.getHtmlRootElement().style.marginTop = (this.divisionContol.getHeight() - this.getHtmlRootElement().offsetHeight) + "px";
            };
            TabDragHandleControl.prototype.getClassName = function () {
                return this.settings.styles.tab.className + " " + Ruler.RulerUtils.getSpriteClassName(this.align, this.settings);
            };
            TabDragHandleControl.prototype.getTitle = function () {
                return this.settings.titles[Ruler.RulerUtils.getTabTitlePropertyName(this.align)];
            };
            TabDragHandleControl.prototype.changeAlign = function (align) {
                if (this.align != align) {
                    this.align = align;
                    this.shadowElements[0].className = this.getClassName();
                    this.getHtmlRootElement().className = this.getClassName();
                    this.setTitle();
                    this.setCorrection();
                }
            };
            return TabDragHandleControl;
        }(DragHandleBase));
        Ruler.TabDragHandleControl = TabDragHandleControl;
        var MarginControlBase = (function (_super) {
            __extends(MarginControlBase, _super);
            function MarginControlBase(settins, divisionsHelper) {
                var _this = _super.call(this, settins) || this;
                _this.divisionsHelper = divisionsHelper;
                return _this;
            }
            MarginControlBase.prototype.createControlHierarchy = function () {
                _super.prototype.createControlHierarchy.call(this);
                this.marginPanelElement = document.createElement("DIV");
                this.handlePanelElement = document.createElement("DIV");
                this.rootElement.appendChild(this.marginPanelElement);
                this.rootElement.appendChild(this.handlePanelElement);
            };
            MarginControlBase.prototype.prepareControlHierarchy = function () {
                _super.prototype.prepareControlHierarchy.call(this);
                this.marginPanelElement.className = this.getMarginElementClassName();
                this.handlePanelElement.className = this.getHandlePanelElementClassName();
            };
            MarginControlBase.prototype.createRootElement = function () {
                return document.createDocumentFragment();
            };
            MarginControlBase.prototype.getHandleElement = function () {
                return this.handlePanelElement;
            };
            MarginControlBase.prototype.getTitleElement = function () {
                return this.handlePanelElement;
            };
            MarginControlBase.prototype.getMovableElements = function () {
                return [this.marginPanelElement, this.handlePanelElement];
            };
            MarginControlBase.prototype.getMarginElementClassName = function () {
                return "";
            };
            MarginControlBase.prototype.getHandlePanelElementClassName = function () {
                return "";
            };
            MarginControlBase.prototype.setMoveCursorVisibility = function (visible) {
                this.handlePanelElement.style.cursor = visible ? "" : "default";
            };
            return MarginControlBase;
        }(AdvancedDragDisplayControl));
        Ruler.MarginControlBase = MarginControlBase;
        var LeftMarginDragHandleControl = (function (_super) {
            __extends(LeftMarginDragHandleControl, _super);
            function LeftMarginDragHandleControl(settins, divisionHelper, maxPageWidth) {
                var _this = _super.call(this, settins, divisionHelper) || this;
                _this.initialLeft = 0;
                _this.maxPageWidth = 0;
                _this.maxPageWidth = maxPageWidth;
                return _this;
            }
            LeftMarginDragHandleControl.prototype.prepareControlHierarchy = function () {
                _super.prototype.prepareControlHierarchy.call(this);
                var width = this.maxPageWidth;
                this.marginPanelElement.style.width = width + "px";
                this.handlePanelElement.style.width = width + "px";
            };
            LeftMarginDragHandleControl.prototype.afterInitialize = function () {
                _super.prototype.afterInitialize.call(this);
                this.initialLeft = -(Math.ceil(this.maxPageWidth / this.divisionsHelper.getUnitSize() * this.divisionsHelper.getUnitSize()) - Ruler.RULLER_NUMBER_CORRECTION);
            };
            LeftMarginDragHandleControl.prototype.getCorrectedValue = function (value) {
                return this.initialLeft + value;
            };
            LeftMarginDragHandleControl.prototype.getMovableStyleName = function () {
                return "left";
            };
            LeftMarginDragHandleControl.prototype.getTitle = function () {
                return this.settings.titles.marginLeft;
            };
            LeftMarginDragHandleControl.prototype.getMarginElementClassName = function () {
                return Ruler.DIVISION_MARGIN_LEFT_CLASS_NAME;
            };
            LeftMarginDragHandleControl.prototype.getHandlePanelElementClassName = function () {
                return Ruler.DIVISION_MARGIN_LEFT_CURSOR_CLASS_NAME;
            };
            return LeftMarginDragHandleControl;
        }(MarginControlBase));
        Ruler.LeftMarginDragHandleControl = LeftMarginDragHandleControl;
        var RightMarginDragHandleControl = (function (_super) {
            __extends(RightMarginDragHandleControl, _super);
            function RightMarginDragHandleControl() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            RightMarginDragHandleControl.prototype.getCorrectedValue = function (value) {
                return Ruler.RULLER_NUMBER_CORRECTION + value;
            };
            RightMarginDragHandleControl.prototype.getMovableStyleName = function () {
                return "width";
            };
            RightMarginDragHandleControl.prototype.getTitle = function () {
                return this.settings.titles.marginRight;
            };
            RightMarginDragHandleControl.prototype.getMarginElementClassName = function () {
                return Ruler.DIVISION_MARGIN_RIGHT_CLASS_NAME;
            };
            RightMarginDragHandleControl.prototype.getHandlePanelElementClassName = function () {
                return Ruler.DIVISION_MARGIN_RIGHT_CURSOR_CLASS_NAME;
            };
            return RightMarginDragHandleControl;
        }(MarginControlBase));
        Ruler.RightMarginDragHandleControl = RightMarginDragHandleControl;
        var DivisionsControl = (function (_super) {
            __extends(DivisionsControl, _super);
            function DivisionsControl(settings, divisionsHelper, maxPageWidth) {
                var _this = _super.call(this, settings) || this;
                _this.height = 0;
                _this.initialLeft = 0;
                _this.unitCount = 0;
                _this.divisionLeftPosition = 0;
                _this.maxPageWidth = 0;
                _this.maxPageWidth = maxPageWidth;
                _this.divisionsHelper = divisionsHelper;
                return _this;
            }
            DivisionsControl.prototype.afterInitialize = function () {
                this.initialLeft = -(this.unitCount * this.divisionsHelper.getUnitSize() - Ruler.RULLER_NUMBER_CORRECTION);
            };
            DivisionsControl.prototype.createControlHierarchy = function () {
                this.unitCount = Math.ceil(this.maxPageWidth / this.divisionsHelper.getUnitSize());
                this.getHtmlRootElement().className = Ruler.DIVISION_CONTAINER_CLASS_NAME;
                this.getHtmlRootElement().style.width = this.divisionsHelper.getUnitSize() * (this.unitCount * 2 + 1) + "px";
                if (REWebUtils.Browser.IE && REWebUtils.Browser.MajorVersion <= 9)
                    this.getHtmlRootElement().offsetParent;
                this.height = this.getHtmlRootElement().offsetHeight;
                this.createDivisionElements();
            };
            DivisionsControl.prototype.createDivisionElements = function () {
                for (var i = this.unitCount; i > 0; i--)
                    this.rootElement.appendChild(this.createDivision(i));
                for (var j = 0; j <= this.unitCount; j++)
                    this.rootElement.appendChild(this.createDivision(j));
            };
            DivisionsControl.prototype.createDivision = function (numb) {
                var fragment = document.createDocumentFragment();
                var map = this.divisionsHelper.getUnitMap();
                for (var i = 0; i < map.length; i++) {
                    switch (map[i]) {
                        case Ruler.DivisionType.Number:
                            fragment.appendChild(this.createNumberDivision(Ruler.DIVISION_NUMBER_CLASS_NAME, numb));
                            break;
                        case Ruler.DivisionType.Major:
                            fragment.appendChild(this.createSimpleDivision(Ruler.DIVISION_MAJOR_CLASS_NAME, Ruler.MAJOR_TOP_AND_BOTTOM_MARGIN));
                            break;
                        case Ruler.DivisionType.Minor:
                            fragment.appendChild(this.createSimpleDivision(Ruler.DIVISION_MINOR_CLASS_NAME, Ruler.MINOR_TOP_AND_BOTTOM_MARGIN));
                            break;
                    }
                }
                return fragment;
            };
            DivisionsControl.prototype.createSimpleDivision = function (className, topAndBottomMargin) {
                if (!topAndBottomMargin)
                    topAndBottomMargin = 0;
                var stepSize = this.divisionsHelper.getStepSize();
                var element = document.createElement("DIV");
                element.style.left = this.divisionLeftPosition + "px";
                element.style.width = stepSize + "px";
                element.style.height = this.height - topAndBottomMargin * 2 + "px";
                element.style.marginTop = topAndBottomMargin + "px";
                element.style.marginBottom = topAndBottomMargin + "px";
                element.className = className;
                this.divisionLeftPosition += stepSize;
                return element;
            };
            DivisionsControl.prototype.createNumberDivision = function (className, numb) {
                var element = this.createSimpleDivision(className, null);
                if (numb != 0) {
                    var numberElement = document.createElement("DIV");
                    numberElement.innerHTML = numb.toString();
                    element.appendChild(numberElement);
                }
                return element;
            };
            DivisionsControl.prototype.getMovableStyleName = function () {
                return "left";
            };
            DivisionsControl.prototype.getMovableElements = function () {
                return [this.getHtmlRootElement()];
            };
            DivisionsControl.prototype.getCorrectedValue = function (value) {
                return this.initialLeft + value;
            };
            DivisionsControl.prototype.getHeight = function () {
                return this.height;
            };
            return DivisionsControl;
        }(DragDisplayControl));
        Ruler.DivisionsControl = DivisionsControl;
        var LineDisplayControl = (function (_super) {
            __extends(LineDisplayControl, _super);
            function LineDisplayControl(viewElement, settings) {
                var _this = _super.call(this, settings) || this;
                _this.isTableColumnLineView = false;
                _this.borderWidth = 0;
                _this.rulerControlLeft = 0;
                _this.rulerControlWidth = 0;
                _this.viewElementLeft = 0;
                _this.viewElement = viewElement;
                return _this;
            }
            LineDisplayControl.prototype.createControlHierarchy = function () {
                this.getHtmlRootElement().className = this.settings.styles.line.className;
            };
            LineDisplayControl.prototype.afterInitialize = function () {
                this.borderWidth = REWebUtils.GetHorizontalBordersWidth(this.getHtmlRootElement());
            };
            LineDisplayControl.prototype.setPosition = function (value, snapTo) {
                if (snapTo == Ruler.SnapTo.RightSide)
                    value = this.rulerControlLeft + this.rulerControlWidth - Ruler.RULLER_NUMBER_CORRECTION - value;
                else if (snapTo == Ruler.SnapTo.LeftSide)
                    value = this.rulerControlLeft + Ruler.RULLER_NUMBER_CORRECTION + value - this.borderWidth;
                this.getHtmlRootElement().style.left = this.viewElementLeft + value + "px";
            };
            LineDisplayControl.prototype.setEnableTableColumnLine = function (enable) {
                if (this.isTableColumnLineView != enable) {
                    this.isTableColumnLineView = enable;
                    var element = this.getHtmlRootElement();
                    if (enable)
                        element.className += Ruler.TABLE_COLUMN_SEPARATOR_RULER_LINE_CLASS_NAME;
                    else
                        element.className = element.className.replace(Ruler.TABLE_COLUMN_SEPARATOR_RULER_LINE_CLASS_NAME, "");
                }
            };
            LineDisplayControl.prototype.show = function () {
                this.rulerControlLeft = this.rulerControlElement.offsetLeft;
                this.rulerControlWidth = this.rulerControlElement.offsetWidth;
                this.viewElementLeft = this.viewElement.offsetLeft;
                var style = this.getHtmlRootElement().style;
                style.top = this.viewElement.offsetTop + "px";
                style.height = this.viewElement.clientHeight + "px";
                style.display = "block";
            };
            LineDisplayControl.prototype.hide = function () {
                this.getHtmlRootElement().style.display = "";
            };
            return LineDisplayControl;
        }(PureDragDisplayControl));
        Ruler.LineDisplayControl = LineDisplayControl;
        var TableColumnSeparatorDragDisplayControl = (function (_super) {
            __extends(TableColumnSeparatorDragDisplayControl, _super);
            function TableColumnSeparatorDragDisplayControl() {
                var _this = _super !== null && _super.apply(this, arguments) || this;
                _this.corectionValue = 0;
                _this.marginLeft = 0;
                _this.marginRight = 0;
                return _this;
            }
            TableColumnSeparatorDragDisplayControl.prototype.createControlHierarchy = function () {
                var rootElement = this.getHtmlRootElement();
                rootElement.className = Ruler.TABLE_COLUMN_SEPARATOR_HANDLE_CLASS_NAME;
                this.separatorElement = document.createElement("DIV");
                this.separatorElement.className = this.settings.styles.columnSeparatorImage.spriteCssClass;
                rootElement.appendChild(this.separatorElement);
            };
            TableColumnSeparatorDragDisplayControl.prototype.afterInitialize = function () {
                this.corectionValue = Math.floor(this.separatorElement.offsetWidth / 2);
            };
            TableColumnSeparatorDragDisplayControl.prototype.setMargins = function (marginLeft, marginRight) {
                if (this.marginLeft != marginLeft || this.marginRight != marginRight) {
                    this.marginLeft = marginLeft;
                    this.marginRight = marginRight;
                    this.getHtmlRootElement().style.width = this.marginLeft + this.marginRight + "px";
                    this.separatorElement.style.left = this.marginRight - this.corectionValue + "px";
                }
            };
            TableColumnSeparatorDragDisplayControl.prototype.setPosition = function (value) {
                if (this.position != value)
                    this.setPositionInternal(this.getHtmlRootElement(), this.getCorrectedValue(value));
            };
            TableColumnSeparatorDragDisplayControl.prototype.getCorrectedValue = function (value) {
                return value - this.marginRight + Ruler.RULLER_NUMBER_CORRECTION;
            };
            TableColumnSeparatorDragDisplayControl.prototype.getHandleElement = function () {
                return this.separatorElement;
            };
            return TableColumnSeparatorDragDisplayControl;
        }(DragDisplayControl));
        Ruler.TableColumnSeparatorDragDisplayControl = TableColumnSeparatorDragDisplayControl;
        var ColumnDragHandleControl = (function (_super) {
            __extends(ColumnDragHandleControl, _super);
            function ColumnDragHandleControl() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            ColumnDragHandleControl.prototype.createControlHierarchy = function () {
                _super.prototype.createControlHierarchy.call(this);
                this.leftElement = document.createElement("DIV");
                this.rightElement = document.createElement("DIV");
                this.rootElement.appendChild(this.leftElement);
                this.rootElement.appendChild(this.rightElement);
            };
            ColumnDragHandleControl.prototype.prepareControlHierarchy = function () {
                _super.prototype.prepareControlHierarchy.call(this);
                this.getHtmlRootElement().className = Ruler.COLUMN_HANDLE_CLASS_NAME;
                this.leftElement.className = Ruler.COLUMN_LEFT_PART_HANDLE_CLASS_NAME;
                this.rightElement.className = Ruler.COLUMN_RIGHT_PART_HANDLE_CLASS_NAME;
            };
            ColumnDragHandleControl.prototype.setWidth = function (value) {
                this.getHtmlRootElement().style.left = Ruler.RULLER_NUMBER_CORRECTION + value + "px";
            };
            ColumnDragHandleControl.prototype.setSpacing = function (value) {
                this.getHtmlRootElement().style.width = value + "px";
            };
            ColumnDragHandleControl.prototype.isWidthHandled = function (source) {
                return source == this.leftElement;
            };
            ColumnDragHandleControl.prototype.isSpacingHandled = function (source) {
                return source == this.rightElement;
            };
            ColumnDragHandleControl.prototype.canHandle = function (source) {
                return source == this.getHandleElement() || this.isWidthHandled(source) || this.isSpacingHandled(source);
            };
            return ColumnDragHandleControl;
        }(PureDragDisplayControl));
        Ruler.ColumnDragHandleControl = ColumnDragHandleControl;
    })(Ruler = __aspxRichEdit.Ruler || (__aspxRichEdit.Ruler = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Ruler;
    (function (Ruler) {
        var DivisionInfo = (function () {
            function DivisionInfo(map, unitSize) {
                this.map = map;
                this.unitSize = unitSize;
                this.stepSize = this.unitSize / this.map.length;
            }
            return DivisionInfo;
        }());
        Ruler.DivisionInfo = DivisionInfo;
        var DivisionsUnitHelper = (function () {
            function DivisionsUnitHelper(unitType) {
                this.currentUnitType = unitType;
                this.inchInfo = new DivisionInfo([0, 1, 1, 1, 2, 1, 1, 1], __aspxRichEdit.UnitConverter.inchesToPixels(1));
                this.centimeterInfo = new DivisionInfo([0, 1, 2, 1], __aspxRichEdit.UnitConverter.centimeterToPixel(1));
            }
            DivisionsUnitHelper.prototype.getUnitMap = function () {
                return this.currentUnitType == __aspxRichEdit.RichEditUnit.Inch ? this.inchInfo.map : this.centimeterInfo.map;
            };
            DivisionsUnitHelper.prototype.getUnitSize = function () {
                return this.currentUnitType == __aspxRichEdit.RichEditUnit.Inch ? this.inchInfo.unitSize : this.centimeterInfo.unitSize;
            };
            DivisionsUnitHelper.prototype.getStepSize = function () {
                return this.currentUnitType == __aspxRichEdit.RichEditUnit.Inch ? this.inchInfo.stepSize : this.centimeterInfo.stepSize;
            };
            return DivisionsUnitHelper;
        }());
        Ruler.DivisionsUnitHelper = DivisionsUnitHelper;
    })(Ruler = __aspxRichEdit.Ruler || (__aspxRichEdit.Ruler = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Ruler;
    (function (Ruler) {
        var ListenerManagerBase = (function () {
            function ListenerManagerBase() {
                this.canHandle = true;
            }
            return ListenerManagerBase;
        }());
        Ruler.ListenerManagerBase = ListenerManagerBase;
        var MouseEventsManagerClass = (function (_super) {
            __extends(MouseEventsManagerClass, _super);
            function MouseEventsManagerClass() {
                var _this = _super.call(this) || this;
                _this.canMouseMoveHandle = false;
                _this.touchID = -1;
                _this.listeners = [];
                REWebUtils.Evt.AttachEventToElement(document.documentElement, REWebUtils.TouchUIHelper.touchMouseDownEventName, function (evt) { return _this.onMouseDown(evt); });
                REWebUtils.Evt.AttachEventToElement(document.documentElement, REWebUtils.TouchUIHelper.touchMouseMoveEventName, function (evt) { return _this.onMouseMove(evt); });
                REWebUtils.Evt.AttachEventToElement(document.documentElement, REWebUtils.TouchUIHelper.touchMouseUpEventName, function (evt) { return _this.onMouseUp(evt); });
                REWebUtils.Evt.AttachEventToElement(document.documentElement, "dblclick", function (evt) { return _this.onDoubleClick(evt); });
                if (!REWebUtils.Browser.TouchUI)
                    REWebUtils.Evt.AttachEventToElement(document.documentElement, "keydown", function (evt) { return _this.onKeyBoardEvent(evt); });
                return _this;
            }
            MouseEventsManagerClass.prototype.onDoubleClick = function (evt) {
                this.listener = this.getCurrentListener(evt);
                if (this.listener && this.listener.canHandleDoubleClick(REWebUtils.Evt.GetEventSource(evt)))
                    this.listener.onDoubleClick(evt);
                this.listener = null;
            };
            MouseEventsManagerClass.prototype.onKeyBoardEvent = function (evt) {
                if (this.canMouseMoveHandle && REWebUtils.Evt.GetKeyCode(evt) == REWebUtils.KeyCode.Esc) {
                    this.listener.onEscPress();
                    this.reset();
                }
            };
            MouseEventsManagerClass.prototype.onMouseDown = function (evt) {
                if (!this.canHandle)
                    return;
                if (REWebUtils.Browser.TouchUI)
                    this.touchID = this.getChangedTouchesIdentifier(evt);
                this.startX = REWebUtils.Evt.GetEventX(evt);
                this.listener = this.getCurrentListener(evt);
                if (REWebUtils.Evt.IsLeftButtonPressed(evt) && this.listener) {
                    this.canMouseMoveHandle = true;
                    this.listener.onMouseDown(evt);
                    REWebUtils.Evt.PreventEventAndBubble(evt);
                }
            };
            MouseEventsManagerClass.prototype.onMouseMove = function (evt) {
                if (!this.listener || REWebUtils.Browser.TouchUI && this.touchID != this.getChangedTouchesIdentifier(evt))
                    return;
                if (this.canMouseMoveHandle) {
                    this.listener.onMouseMove(REWebUtils.Evt.GetEventX(evt) - this.startX, REWebUtils.Evt.GetEventSource(evt));
                    REWebUtils.Evt.PreventEventAndBubble(evt);
                }
            };
            MouseEventsManagerClass.prototype.onMouseUp = function (_evt) {
                if (this.listener) {
                    this.listener.onMouseUp();
                    this.reset();
                }
            };
            MouseEventsManagerClass.prototype.reset = function () {
                this.listener = null;
                this.canMouseMoveHandle = false;
                this.touchID = -1;
            };
            MouseEventsManagerClass.prototype.getCurrentListener = function (evt) {
                for (var i = 0; i < this.listeners.length; i++)
                    if (this.listeners[i].canHandle(REWebUtils.Evt.GetEventSource(evt)))
                        return this.listeners[i];
                return null;
            };
            MouseEventsManagerClass.prototype.addListener = function (rulerControl) {
                this.listeners.push(rulerControl);
            };
            MouseEventsManagerClass.prototype.getChangedTouchesIdentifier = function (evt) {
                return !REWebUtils.Browser.MSTouchUI ? evt.changedTouches[0].identifier : this.touchID;
            };
            return MouseEventsManagerClass;
        }(ListenerManagerBase));
        Ruler.MouseEventsManagerClass = MouseEventsManagerClass;
        var ListenerScrollStruct = (function () {
            function ListenerScrollStruct(view) {
                this.listeners = [];
                this.view = view;
            }
            return ListenerScrollStruct;
        }());
        Ruler.ListenerScrollStruct = ListenerScrollStruct;
        var ViewElementScrollManagerClass = (function (_super) {
            __extends(ViewElementScrollManagerClass, _super);
            function ViewElementScrollManagerClass() {
                var _this = _super !== null && _super.apply(this, arguments) || this;
                _this.controls = [];
                return _this;
            }
            ViewElementScrollManagerClass.prototype.onScroll = function (index) {
                if (!this.canHandle)
                    return;
                var listeners = this.controls[index].listeners;
                for (var i = 0; i < listeners.length; i++)
                    listeners[i].onScroll();
            };
            ViewElementScrollManagerClass.prototype.addListener = function (owner, viewElement) {
                var _this = this;
                var listenerObj = null;
                for (var i = 0; i < this.controls.length; i++)
                    if (this.controls[i].view == viewElement)
                        listenerObj = this.controls[i];
                if (!listenerObj) {
                    listenerObj = new ListenerScrollStruct(viewElement);
                    this.controls.push(listenerObj);
                    REWebUtils.Evt.AttachEventToElement(listenerObj.view, "scroll", function (_evt) { return _this.onScroll(_this.controls.length - 1); });
                }
                listenerObj.listeners.push(owner);
            };
            return ViewElementScrollManagerClass;
        }(ListenerManagerBase));
        Ruler.ViewElementScrollManagerClass = ViewElementScrollManagerClass;
        Ruler.MouseEventsManager = new MouseEventsManagerClass();
        Ruler.ViewElementScrollManager = new ViewElementScrollManagerClass();
    })(Ruler = __aspxRichEdit.Ruler || (__aspxRichEdit.Ruler = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Ruler;
    (function (Ruler) {
        var PositionManager = (function () {
            function PositionManager(ruler) {
                this.marginLeftValue = 0;
                this.marginRightValue = 0;
                this.firstLineIndentValue = 0;
                this.rightIndentValue = 0;
                this.leftIndentValue = 0;
                this.divisionPositionValue = 0;
                this.prevMarginLeftValue = 0;
                this.prevMarginRightValue = 0;
                this.prevFirstLineIndentValue = 0;
                this.prevRightIndentValue = 0;
                this.prevLeftIndentValue = 0;
                this.prevDivisionPositionValue = 0;
                this.prevTableColumnSeparatorPositionValue = 0;
                this.rightIndentExtremeValue = 0;
                this.leftIndentExtremeValue = 0;
                this.tableColumnSeparatorIndex = 0;
                this.tableColumnSeparators = [];
                this.activeTableColumnIndex = 0;
                this.tableCellMarginLeftValue = 0;
                this.tableDisplayMarginLeftAdditionValue = 0;
                this.tableDisplayLeftIdenAdditionValue = 0;
                this.tableDisplaySeparatorAdditionValue = 0;
                this.tableDisplayMarginRightAdditionValue = 0;
                this.tableColumnMinValue = 0;
                this.tableColumnMaxValue = 0;
                this.tabValues = [];
                this.dragTabIndex = 0;
                this.tabAction = Ruler.TabAction.None;
                this.isDeleteTab = false;
                this.columnValues = [];
                this.equalWidth = true;
                this.activeColumnIndex = 0;
                this.dragColumnIndex = 0;
                this.linePositionValue = 0;
                this.snapToValue = Ruler.SnapTo.LeftSide;
                this.leftIndentRelativeValue = 0;
                this.firstLineIndentRelativeValue = 0;
                this.rightIndentRelativeValue = 0;
                this.isRightDirection = true;
                this.unitSize = 0;
                this.ruler = ruler;
                this.unitSize = this.ruler.divisionsUnitHelper.getStepSize();
            }
            PositionManager.prototype.start = function (action, dragColumnIndex, dragTabIndex, tableColumnDivisonIndex, tabAction) {
                if (action == Ruler.RulerAction.None)
                    return;
                this.action = action;
                this.tabAction = tabAction;
                this.prevFirstLineIndentValue = this.firstLineIndentValue;
                this.prevLeftIndentValue = this.leftIndentValue;
                this.prevRightIndentValue = this.rightIndentValue;
                this.prevMarginLeftValue = this.marginLeftValue;
                this.prevMarginRightValue = this.marginRightValue;
                this.prevDivisionPositionValue = this.divisionPositionValue;
                this.tableColumnSeparatorIndex = tableColumnDivisonIndex;
                this.dragColumnIndex = dragColumnIndex;
                if (this.tableColumnSeparatorIndex != -1)
                    this.prevTableColumnSeparatorPositionValue = this.tableColumnSeparators[this.tableColumnSeparatorIndex].position;
                __aspxRichEdit.ListUtils.foreach(this.columnValues, function (column) {
                    column.prevWidth = column.width;
                    column.prevSpace = column.space;
                });
                this.dragTabIndex = dragTabIndex;
                __aspxRichEdit.ListUtils.foreach(this.tabValues, function (tab) { tab.prevValue = tab.value; });
                switch (this.action) {
                    case Ruler.RulerAction.MarginLeft:
                        this.linePositionValue = this.marginLeftValue;
                        this.snapToValue = Ruler.SnapTo.LeftSide;
                        break;
                    case Ruler.RulerAction.MarginRight:
                        this.linePositionValue = this.marginRightValue;
                        this.snapToValue = Ruler.SnapTo.RightSide;
                        break;
                    case Ruler.RulerAction.FirstLineIndent:
                        this.linePositionValue = this.firstLineIndentValue;
                        this.snapToValue = Ruler.SnapTo.LeftSide;
                        this.ruler.firstLineIndentDragControl.showShadow();
                        break;
                    case Ruler.RulerAction.LeftIndent:
                        this.linePositionValue = this.leftIndentValue;
                        this.snapToValue = Ruler.SnapTo.LeftSide;
                        this.ruler.leftIndentDragControl.showShadow();
                        break;
                    case Ruler.RulerAction.HangingLeftIndent:
                        this.linePositionValue = this.leftIndentValue;
                        this.snapToValue = Ruler.SnapTo.LeftSide;
                        this.ruler.firstLineIndentDragControl.showShadow();
                        this.ruler.leftIndentDragControl.showShadow();
                        break;
                    case Ruler.RulerAction.RightIndent:
                        this.linePositionValue = this.rightIndentValue;
                        this.snapToValue = Ruler.SnapTo.RightSide;
                        this.ruler.rightIndentDragControl.showShadow();
                        break;
                    case Ruler.RulerAction.ColumntMove:
                        if (!this.equalWidth)
                            this.linePositionValue = this.getColumnWidth() + this.getColumnSpace() / 2;
                        break;
                    case Ruler.RulerAction.TableColumnSeparator:
                        this.ruler.lineControl.setEnableTableColumnLine(true);
                        this.linePositionValue = this.tableColumnSeparators[this.tableColumnSeparatorIndex].position;
                        break;
                    case Ruler.RulerAction.ColumnWidth:
                        this.snapToValue = Ruler.SnapTo.LeftSide;
                        this.linePositionValue = this.getColumnWidth();
                        break;
                    case Ruler.RulerAction.ColumnSpace:
                        this.snapToValue = Ruler.SnapTo.LeftSide;
                        this.linePositionValue = this.getColumnWidth() + this.getColumnSpace();
                        break;
                    case Ruler.RulerAction.Tab:
                        this.snapToValue = Ruler.SnapTo.LeftSide;
                        this.linePositionValue = this.tabValues.length ? this.tabValues[this.dragTabIndex].value : 0;
                        if (this.ruler.tabDragControls[this.dragTabIndex])
                            this.ruler.tabDragControls[this.dragTabIndex].showShadow();
                        break;
                }
                if (!this.equalWidth || this.action != Ruler.RulerAction.ColumntMove)
                    this.ruler.lineControl.show();
                this.ruler.leftMarginDragControl.setMoveCursorVisibility(true);
                this.ruler.rightMarginDragControl.setMoveCursorVisibility(true);
                this.updateDisplayControls(true);
            };
            PositionManager.prototype.move = function (distance) {
                this.isRightDirection = distance > -1;
                switch (this.action) {
                    case Ruler.RulerAction.MarginLeft:
                        this.moveMarginLeft(distance);
                        break;
                    case Ruler.RulerAction.MarginRight:
                        this.moveMarginRight(distance);
                        break;
                    case Ruler.RulerAction.FirstLineIndent:
                        this.moveFirstLineIndent(distance);
                        break;
                    case Ruler.RulerAction.LeftIndent:
                        this.moveLeftIndent(distance);
                        break;
                    case Ruler.RulerAction.HangingLeftIndent:
                        this.moveHangingLeftIndent(distance);
                        break;
                    case Ruler.RulerAction.RightIndent:
                        this.moveRightIndent(distance);
                        break;
                    case Ruler.RulerAction.Tab:
                        this.moveTab(distance);
                        break;
                    case Ruler.RulerAction.ColumntMove:
                        this.moveColumnMove(distance);
                        break;
                    case Ruler.RulerAction.ColumnWidth:
                        this.moveColumnWidth(distance);
                        break;
                    case Ruler.RulerAction.ColumnSpace:
                        this.moveColumnSpace(distance);
                        break;
                    case Ruler.RulerAction.TableColumnSeparator:
                        this.moveTableColumnSeparator(distance);
                        break;
                }
                this.updateDisplayControls();
            };
            PositionManager.prototype.reset = function () {
                switch (this.action) {
                    case Ruler.RulerAction.MarginLeft:
                        this.marginLeftValue = this.prevMarginLeftValue;
                        this.divisionPositionValue = this.prevDivisionPositionValue;
                        this.leftIndentValue = this.prevLeftIndentValue;
                        this.firstLineIndentValue = this.prevFirstLineIndentValue;
                        __aspxRichEdit.ListUtils.foreach(this.tabValues, function (tab) { tab.value = tab.prevValue; });
                    case Ruler.RulerAction.Tab:
                        __aspxRichEdit.ListUtils.foreach(this.tabValues, function (tab) { tab.value = tab.prevValue; });
                        break;
                    case Ruler.RulerAction.MarginRight:
                        this.marginRightValue = this.prevMarginRightValue;
                        this.rightIndentValue = this.prevRightIndentValue;
                        break;
                    case Ruler.RulerAction.FirstLineIndent:
                        this.firstLineIndentValue = this.prevFirstLineIndentValue;
                        break;
                    case Ruler.RulerAction.LeftIndent:
                        this.leftIndentValue = this.prevLeftIndentValue;
                        break;
                    case Ruler.RulerAction.HangingLeftIndent:
                        this.leftIndentValue = this.prevLeftIndentValue;
                        this.firstLineIndentValue = this.prevFirstLineIndentValue;
                        break;
                    case Ruler.RulerAction.RightIndent:
                        this.marginRightValue = this.prevMarginRightValue;
                        break;
                }
                this.ruler.lineControl.setEnableTableColumnLine(false);
                this.updateDisplayControls();
                this.hideControls();
                this.action = Ruler.RulerAction.None;
            };
            PositionManager.prototype.applyInfo = function (info) {
                var _this = this;
                var localColumns = [];
                this.tableColumnSeparators = info.columnSeparators.items;
                this.activeTableColumnIndex = info.columnSeparators.index;
                if (info.columnSeparators.hasItems) {
                    this.tableCellMarginLeftValue = info.columnSeparators.currItem.leftMargin;
                }
                this.tableColumnMinValue = info.columnSeparators.minValue;
                this.tableColumnMaxValue = info.columnSeparators.maxValue;
                this.tableDisplayMarginLeftAdditionValue = 0;
                this.tableDisplayMarginRightAdditionValue = 0;
                this.marginLeftValue = info.marginLeft;
                this.marginRightValue = info.marginRight;
                this.leftIndentExtremeValue = this.marginLeftValue;
                this.rightIndentExtremeValue = this.marginRightValue;
                this.equalWidth = info.equalWidth;
                this.activeColumnIndex = info.columnActiveIndex;
                this.columnValues = [];
                if (info.columns.length > 0)
                    __aspxRichEdit.ListUtils.foreach(info.columns, function (column, index) {
                        var width = (index == 0) ? _this.marginLeftValue + column.width : localColumns[index - 1].width + localColumns[index - 1].space + column.width;
                        localColumns.push(new ColumnValues(width, column.space));
                    });
                if (this.tableColumnSeparators.length == 0)
                    this.columnValues = localColumns;
                this.divisionPositionValue = info.marginLeft;
                this.leftIndentValue = info.marginLeft + info.leftIndent;
                this.firstLineIndentValue = info.marginLeft + info.firstLineIndent;
                this.rightIndentValue = info.marginRight + info.rightIndent;
                this.leftIndentRelativeValue = info.leftIndent;
                this.firstLineIndentRelativeValue = info.firstLineIndent;
                this.rightIndentRelativeValue = info.rightIndent;
                this.correctDragHandlesRelativeColumns();
                if (this.tableColumnSeparators.length > 1) {
                    if (info.columns.length > 0 && this.activeColumnIndex > 0) {
                        var currentColumnValue = localColumns[this.activeColumnIndex - 1];
                        this.marginLeftValue = currentColumnValue.width + currentColumnValue.space + this.tableColumnSeparators[0].position;
                        this.leftIndentExtremeValue = currentColumnValue.width + currentColumnValue.space;
                        this.divisionPositionValue = this.leftIndentExtremeValue;
                    }
                    else
                        this.leftIndentExtremeValue = info.marginLeft;
                    this.leftIndentExtremeValue += this.tableCellMarginLeftValue + info.columnSeparators.currItem.position;
                    this.tableDisplayLeftIdenAdditionValue = this.tableColumnSeparators[this.activeTableColumnIndex].position + this.tableCellMarginLeftValue;
                    this.tableDisplayMarginLeftAdditionValue = this.tableColumnSeparators[0].position + this.tableColumnSeparators[0].leftMargin;
                    this.tableDisplaySeparatorAdditionValue = this.tableColumnSeparators[0].position;
                    var lastItemIndex = info.columnSeparators.items.length - 1;
                    this.tableDisplayMarginRightAdditionValue = this.convertLeftPosToRightPos(info.columnSeparators.items[lastItemIndex].position) + info.columnSeparators.items[lastItemIndex - 1].rightMargin - this.marginRightValue;
                    this.leftIndentValue = this.leftIndentExtremeValue + info.leftIndent;
                    this.firstLineIndentValue = this.leftIndentExtremeValue + info.firstLineIndent;
                    if (this.activeTableColumnIndex < this.tableColumnSeparators.length - 1) {
                        this.rightIndentExtremeValue = this.convertLeftPosToRightPos(info.columnSeparators.items[this.activeTableColumnIndex + 1].position) + info.columnSeparators.items[this.activeTableColumnIndex].rightMargin;
                        this.rightIndentValue = this.rightIndentExtremeValue + info.rightIndent;
                    }
                    __aspxRichEdit.ListUtils.foreach(this.tableColumnSeparators, function (item, index) { return _this.tableColumnSeparators[index].position = _this.marginLeftValue + item.position; });
                    if (this.tableColumnMinValue != -1 && this.tableColumnMaxValue != -1) {
                        this.tableColumnMinValue += this.marginLeftValue;
                        this.tableColumnMaxValue += this.marginLeftValue;
                    }
                }
                this.isDeleteTab = false;
                this.tabValues = [];
                if (info.tabs.length > 0)
                    __aspxRichEdit.ListUtils.foreach(info.tabs, function (position) { _this.appendTabInfo(_this.divisionPositionValue + position); });
                this.updateDisplayControls();
            };
            PositionManager.prototype.convertLeftPosToRightPos = function (value) {
                return this.ruler.width - this.marginLeftValue - value;
            };
            PositionManager.prototype.getInfo = function () {
                var _this = this;
                var info = new PositionsInfoChanged();
                info.action = this.action;
                info.columns = [];
                switch (this.action) {
                    case Ruler.RulerAction.MarginLeft:
                        info.marginLeftChanged = this.prevMarginLeftValue != this.marginLeftValue;
                        if (info.marginLeftChanged)
                            info.marginLeft = this.marginLeftValue;
                        break;
                    case Ruler.RulerAction.MarginRight:
                        info.marginRightChanged = this.prevMarginRightValue != this.marginRightValue;
                        if (info.marginRightChanged)
                            info.marginRight = this.marginRightValue;
                        break;
                    case Ruler.RulerAction.FirstLineIndent:
                    case Ruler.RulerAction.LeftIndent:
                    case Ruler.RulerAction.HangingLeftIndent:
                        info.leftIndentChanged = this.prevLeftIndentValue != this.leftIndentValue || this.prevFirstLineIndentValue != this.firstLineIndentValue;
                        if (info.leftIndentChanged) {
                            info.firstLineIndent = this.firstLineIndentValue - this.leftIndentExtremeValue;
                            info.leftIndent = this.leftIndentValue - this.leftIndentExtremeValue;
                        }
                        break;
                    case Ruler.RulerAction.RightIndent:
                        info.rightIndentChanged = this.prevRightIndentValue != this.rightIndentValue;
                        if (info.rightIndentChanged)
                            info.rightIndent = this.rightIndentValue - this.rightIndentExtremeValue;
                        break;
                    case Ruler.RulerAction.Tab:
                        if (this.tabValues[this.dragTabIndex] !== undefined) {
                            info.newTabPosition = this.tabValues[this.dragTabIndex].value - this.divisionPositionValue;
                            info.oldTabPosition = this.tabValues[this.dragTabIndex].prevValue - this.divisionPositionValue;
                            if (this.isExistTab())
                                this.isDeleteTab = true;
                            if (this.isDeleteTab && this.tabAction == Ruler.TabAction.Insert)
                                info.oldTabPosition = -1;
                            info.tabAction = this.isDeleteTab ? Ruler.TabAction.Delete : this.tabAction;
                        }
                        break;
                    case Ruler.RulerAction.ColumntMove:
                    case Ruler.RulerAction.ColumnWidth:
                    case Ruler.RulerAction.ColumnSpace:
                        var columnsAllDistance = 0;
                        __aspxRichEdit.ListUtils.foreach(this.columnValues, function (column, index) {
                            var width = (index == 0) ? column.width - _this.marginLeftValue : column.width - (_this.getColumnWidth(index - 1) + _this.getColumnSpace(index - 1));
                            info.columns.push(new ColumnSectionProperties(width, column.space));
                            columnsAllDistance += width + column.space;
                        });
                        info.columns.push(new ColumnSectionProperties(this.ruler.width - this.marginLeftValue - this.marginRightValue - columnsAllDistance, 0));
                        break;
                    case Ruler.RulerAction.TableColumnSeparator:
                        info.oldTableColumnPosition = this.prevTableColumnSeparatorPositionValue - this.marginLeftValue;
                        info.newTableColumnPosition = this.tableColumnSeparators[this.tableColumnSeparatorIndex].position - this.marginLeftValue;
                        break;
                }
                this.hideControls();
                this.action = Ruler.RulerAction.None;
                return info;
            };
            PositionManager.prototype.appendTabInfo = function (tabPosition) {
                this.tabValues.push(new TabValues(tabPosition));
            };
            PositionManager.prototype.isExistTab = function () {
                var _this = this;
                var currentTabValue = this.tabValues[this.dragTabIndex].value;
                var isExist = false;
                __aspxRichEdit.ListUtils.foreach(this.tabValues, function (obj, index) {
                    if (index != _this.dragTabIndex && obj.value == currentTabValue)
                        isExist = true;
                });
                return isExist;
            };
            PositionManager.prototype.hideControls = function () {
                this.ruler.lineControl.hide();
                this.ruler.leftMarginDragControl.setMoveCursorVisibility(true);
                this.ruler.rightMarginDragControl.setMoveCursorVisibility(true);
                if (this.action == Ruler.RulerAction.LeftIndent || this.action == Ruler.RulerAction.HangingLeftIndent)
                    this.ruler.leftIndentDragControl.hideShadow();
                if (this.action == Ruler.RulerAction.FirstLineIndent || this.action == Ruler.RulerAction.HangingLeftIndent)
                    this.ruler.firstLineIndentDragControl.hideShadow();
                if (this.action == Ruler.RulerAction.RightIndent)
                    this.ruler.rightIndentDragControl.hideShadow();
                if (this.action == Ruler.RulerAction.Tab && this.ruler.tabDragControls[this.dragTabIndex])
                    this.ruler.tabDragControls[this.dragTabIndex].hideShadow();
            };
            PositionManager.prototype.moveMarginLeft = function (distance) {
                distance = this.getCorrectedMarginLeftDistance(distance);
                this.marginLeftValue = this.prevMarginLeftValue + distance;
                this.divisionPositionValue = this.marginLeftValue;
                this.leftIndentValue = this.prevLeftIndentValue + distance;
                this.firstLineIndentValue = this.prevFirstLineIndentValue + distance;
                this.correctEqualWidthColumns();
                this.correctTabs();
                this.linePositionValue = this.marginLeftValue;
            };
            PositionManager.prototype.moveMarginRight = function (distance) {
                distance = this.getCorrectedMarginRightDistance(distance);
                this.marginRightValue = this.prevMarginRightValue - distance;
                this.rightIndentValue = this.prevRightIndentValue - distance;
                this.correctEqualWidthColumns();
                this.linePositionValue = this.marginRightValue;
            };
            PositionManager.prototype.moveFirstLineIndent = function (distance) {
                distance = this.getCorrectedFirstLineIndentDistance(distance);
                this.firstLineIndentValue = this.prevFirstLineIndentValue + distance;
                this.linePositionValue = this.firstLineIndentValue;
            };
            PositionManager.prototype.moveLeftIndent = function (distance) {
                distance = this.getCorrectedLeftIndentDistance(distance);
                this.leftIndentValue = this.prevLeftIndentValue + distance;
                this.linePositionValue = this.leftIndentValue;
            };
            PositionManager.prototype.moveHangingLeftIndent = function (distance) {
                distance = this.getCorrectedHangingLeftIndentDistance(distance);
                this.leftIndentValue = this.prevLeftIndentValue + distance;
                this.firstLineIndentValue = this.prevFirstLineIndentValue + distance;
                this.linePositionValue = this.leftIndentValue;
            };
            PositionManager.prototype.moveRightIndent = function (distance) {
                distance = this.getCorrectedRightIndentIndentDistance(distance);
                this.rightIndentValue = this.prevRightIndentValue - distance;
                this.linePositionValue = this.rightIndentValue;
            };
            PositionManager.prototype.moveTab = function (distance) {
                distance = this.getCorrectedTabDistance(distance);
                if (this.tabValues[this.dragTabIndex]) {
                    this.tabValues[this.dragTabIndex].value = this.tabValues[this.dragTabIndex].prevValue + distance;
                    this.linePositionValue = this.tabValues[this.dragTabIndex] !== undefined ? this.tabValues[this.dragTabIndex].value : 0;
                }
            };
            PositionManager.prototype.moveColumnMove = function (distance) {
                var minColumnPosition = 0;
                var maxColumnPosition = 0;
                if (!this.equalWidth) {
                    this.columnValues[this.dragColumnIndex].width = this.getColumnPrevWidth() + distance;
                    if (this.dragColumnIndex != 0 && this.dragColumnIndex < this.columnValues.length - 1) {
                        minColumnPosition = this.getColumnWidth(this.dragColumnIndex - 1) + this.getColumnSpace(this.dragColumnIndex - 1) + Ruler.MINIMUN_DISTANCE_BETWEEN_COLUMNS;
                        maxColumnPosition = this.getColumnWidth(this.dragColumnIndex + 1) - Ruler.MINIMUN_DISTANCE_BETWEEN_COLUMNS;
                    }
                    else if (this.dragColumnIndex == 0) {
                        minColumnPosition = this.prevMarginLeftValue + Ruler.MINIMUN_DISTANCE_BETWEEN_COLUMNS;
                        maxColumnPosition = this.columnValues.length > 1 ? this.getColumnWidth(this.dragColumnIndex + 1) : this.ruler.width - this.prevMarginRightValue;
                        maxColumnPosition -= Ruler.MINIMUN_DISTANCE_BETWEEN_COLUMNS;
                    }
                    else if (this.dragColumnIndex == this.columnValues.length - 1) {
                        minColumnPosition = this.getColumnWidth(this.dragColumnIndex - 1) + this.getColumnSpace(this.dragColumnIndex - 1) + Ruler.MINIMUN_DISTANCE_BETWEEN_COLUMNS;
                        maxColumnPosition = this.ruler.width - this.prevMarginRightValue - Ruler.MINIMUN_DISTANCE_BETWEEN_COLUMNS;
                    }
                    if (this.columnValues[this.dragColumnIndex].width < minColumnPosition)
                        this.columnValues[this.dragColumnIndex].width = minColumnPosition;
                    else if ((this.columnValues[this.dragColumnIndex].width + this.columnValues[this.dragColumnIndex].space) > maxColumnPosition)
                        this.columnValues[this.dragColumnIndex].width = maxColumnPosition - this.getColumnSpace();
                    this.correctDragHandlesRelativeColumns();
                    this.linePositionValue = this.getColumnWidth() + this.getColumnSpace() / 2;
                }
            };
            PositionManager.prototype.moveColumnWidth = function (distance) {
                var minColumnPosition = 0;
                var maxColumnPosition = 0;
                if (this.equalWidth)
                    this.moveColumnsWithEqualWidth(distance);
                else {
                    this.columnValues[this.dragColumnIndex].width = this.getColumnPrevWidth() + distance;
                    maxColumnPosition = this.columnValues[this.dragColumnIndex].prevWidth + this.columnValues[this.dragColumnIndex].prevSpace - Ruler.MINIMUN_DISTANCE_BETWEEN_COLUMNS;
                    if (this.dragColumnIndex != 0 && this.dragColumnIndex < this.columnValues.length - 1)
                        minColumnPosition = this.getColumnWidth(this.dragColumnIndex - 1) + this.getColumnSpace(this.dragColumnIndex - 1) + Ruler.MINIMUN_DISTANCE_BETWEEN_COLUMNS;
                    else if (this.dragColumnIndex == 0)
                        minColumnPosition = this.prevMarginLeftValue + Ruler.MINIMUN_DISTANCE_BETWEEN_COLUMNS;
                    else if (this.dragColumnIndex == this.columnValues.length - 1)
                        minColumnPosition = this.getColumnWidth(this.dragColumnIndex - 1) + this.getColumnSpace(this.dragColumnIndex - 1) + Ruler.MINIMUN_DISTANCE_BETWEEN_COLUMNS;
                    if (this.columnValues[this.dragColumnIndex].width < minColumnPosition)
                        this.columnValues[this.dragColumnIndex].width = minColumnPosition;
                    else if (this.columnValues[this.dragColumnIndex].width > maxColumnPosition)
                        this.columnValues[this.dragColumnIndex].width = maxColumnPosition;
                    var prevSpacePosition = this.getColumnPrevWidth() + this.getColumnPrevSpace();
                    this.columnValues[this.dragColumnIndex].space = prevSpacePosition - this.getColumnWidth();
                }
                this.correctDragHandlesRelativeColumns();
                this.linePositionValue = this.getColumnWidth();
            };
            PositionManager.prototype.moveColumnSpace = function (distance) {
                var minColumnPosition = 0;
                var maxColumnPosition = 0;
                if (this.equalWidth)
                    this.moveColumnsWithEqualWidth(distance);
                else {
                    this.columnValues[this.dragColumnIndex].space = this.getColumnPrevSpace() + distance;
                    var spacePosition = this.getColumnWidth() + this.getColumnSpace();
                    minColumnPosition = this.getColumnWidth() + Ruler.MINIMUN_DISTANCE_BETWEEN_COLUMNS;
                    if (this.dragColumnIndex != 0 && this.dragColumnIndex < this.columnValues.length - 1)
                        maxColumnPosition = this.getColumnWidth(this.dragColumnIndex + 1);
                    else if (this.dragColumnIndex == 0)
                        maxColumnPosition = this.columnValues.length > 1 ? this.getColumnWidth(this.dragColumnIndex + 1) : this.ruler.width - this.prevMarginRightValue;
                    else if (this.dragColumnIndex == this.columnValues.length - 1)
                        maxColumnPosition = this.ruler.width - this.prevMarginRightValue;
                    maxColumnPosition -= Ruler.MINIMUN_DISTANCE_BETWEEN_COLUMNS;
                    if (spacePosition < minColumnPosition)
                        this.columnValues[this.dragColumnIndex].space = Ruler.MINIMUN_DISTANCE_BETWEEN_COLUMNS;
                    else if (spacePosition > maxColumnPosition)
                        this.columnValues[this.dragColumnIndex].space = maxColumnPosition - this.getColumnPrevWidth();
                }
                this.correctDragHandlesRelativeColumns();
                this.linePositionValue = this.getColumnWidth() + this.getColumnSpace();
            };
            PositionManager.prototype.moveTableColumnSeparator = function (distance) {
                distance = this.getCalculatedDistance(distance, this.prevTableColumnSeparatorPositionValue, this.marginLeftValue);
                var leftExtremeValue = Ruler.TABLE_COLUMN_SEPARATOR_MARGIN;
                var rightExtremeValue = this.ruler.width;
                if (this.tableColumnSeparatorIndex > 0)
                    leftExtremeValue = this.tableColumnSeparators[this.tableColumnSeparatorIndex - 1].position + Ruler.TABLE_COLUMN_SEPARATOR_MARGIN;
                if (this.tableColumnSeparatorIndex < this.tableColumnSeparators.length - 1)
                    rightExtremeValue = this.tableColumnSeparators[this.tableColumnSeparatorIndex + 1].position - Ruler.TABLE_COLUMN_SEPARATOR_MARGIN;
                if (this.tableColumnMinValue > -1)
                    leftExtremeValue = this.tableColumnMinValue + Ruler.TABLE_COLUMN_SEPARATOR_MARGIN;
                if (this.tableColumnMaxValue > -1)
                    rightExtremeValue = this.tableColumnMaxValue - Ruler.TABLE_COLUMN_SEPARATOR_MARGIN;
                var pos = this.prevTableColumnSeparatorPositionValue + distance;
                if (pos > leftExtremeValue && pos < rightExtremeValue) {
                    this.tableColumnSeparators[this.tableColumnSeparatorIndex].position = pos;
                    this.linePositionValue = pos;
                }
            };
            PositionManager.prototype.getColumnWidth = function (index) {
                if (index === void 0) { index = -1; }
                if (index == -1)
                    index = this.dragColumnIndex;
                return this.columnValues[index].width;
            };
            PositionManager.prototype.getColumnSpace = function (index) {
                if (index === void 0) { index = -1; }
                if (index == -1)
                    index = this.dragColumnIndex;
                return this.columnValues[index].space;
            };
            PositionManager.prototype.getColumnPrevWidth = function (index) {
                if (index === void 0) { index = -1; }
                if (index == -1)
                    index = this.dragColumnIndex;
                return this.columnValues[index].prevWidth;
            };
            PositionManager.prototype.getColumnPrevSpace = function (index) {
                if (index === void 0) { index = -1; }
                if (index == -1)
                    index = this.dragColumnIndex;
                return this.columnValues[index].prevSpace;
            };
            PositionManager.prototype.correctTabs = function () {
                var difference = this.marginLeftValue - this.prevMarginLeftValue;
                __aspxRichEdit.ListUtils.foreach(this.tabValues, function (tab) { tab.value = tab.prevValue + difference; });
            };
            PositionManager.prototype.correctEqualWidthColumns = function () {
                var _this = this;
                if (this.columnValues.length) {
                    var freeDistance = this.ruler.width - this.marginLeftValue - this.marginRightValue - this.getColumnSpace(0) * this.columnValues.length;
                    var columnWidth = freeDistance / (this.columnValues.length + 1);
                    __aspxRichEdit.ListUtils.foreach(this.columnValues, function (column, index) {
                        var width = (index == 0) ? _this.marginLeftValue + columnWidth : _this.columnValues[index - 1].width + _this.columnValues[0].space + columnWidth;
                        column.width = width;
                    });
                }
                this.correctDragHandlesRelativeColumns();
            };
            PositionManager.prototype.correctDragHandlesRelativeColumns = function () {
                if (this.columnValues.length) {
                    if (this.activeColumnIndex != 0) {
                        var currentColumnValue = this.columnValues[this.activeColumnIndex - 1];
                        this.leftIndentExtremeValue = currentColumnValue.width + currentColumnValue.space;
                        this.divisionPositionValue = this.leftIndentExtremeValue;
                        this.leftIndentValue = this.leftIndentExtremeValue + this.leftIndentRelativeValue;
                        this.firstLineIndentValue = this.leftIndentExtremeValue + this.firstLineIndentRelativeValue;
                    }
                    if (this.activeColumnIndex != this.columnValues.length) {
                        this.rightIndentExtremeValue = this.ruler.width - this.columnValues[this.activeColumnIndex].width;
                        this.rightIndentValue = this.rightIndentExtremeValue + this.rightIndentRelativeValue;
                    }
                }
            };
            PositionManager.prototype.moveColumnsWithEqualWidth = function (distance) {
                var _this = this;
                var width = this.getColumnPrevWidth(0) - this.marginLeftValue;
                var space = this.getColumnPrevSpace(0);
                var spaceCount = this.columnValues.length;
                var widthCount = this.columnValues.length + 1;
                var visibleWidth = this.ruler.width - this.marginLeftValue - this.marginRightValue;
                var indexDragColumn = this.dragColumnIndex + 1;
                var mousePosition = 0;
                if (this.action == Ruler.RulerAction.ColumnWidth) {
                    if (this.dragColumnIndex == 0) {
                        width = width + distance;
                        space = (visibleWidth - width * widthCount) / spaceCount;
                    }
                    else {
                        var mousePosition = indexDragColumn * (width + space) - space + distance;
                        width = (spaceCount * mousePosition - (indexDragColumn - 1) * visibleWidth) / (spaceCount - indexDragColumn + 1);
                        space = (mousePosition - width) / (indexDragColumn - 1) - width;
                    }
                }
                else {
                    mousePosition = indexDragColumn * (width + space) + distance;
                    width = visibleWidth - (mousePosition / indexDragColumn) * this.columnValues.length;
                    space = mousePosition / indexDragColumn - width;
                }
                var maxSpace = visibleWidth / spaceCount - Ruler.MINIMUN_DISTANCE_BETWEEN_COLUMNS;
                if (space < Ruler.MINIMUN_DISTANCE_BETWEEN_COLUMNS)
                    space = Ruler.MINIMUN_DISTANCE_BETWEEN_COLUMNS;
                else if (space > maxSpace)
                    space = maxSpace;
                width = (visibleWidth - space * spaceCount) / widthCount;
                __aspxRichEdit.ListUtils.foreach(this.columnValues, function (column, index) {
                    column.space = space;
                    column.width = (index == 0) ? _this.marginLeftValue + width : _this.columnValues[index - 1].width + space + width;
                });
            };
            PositionManager.prototype.updateDisplayControls = function (skipHandles) {
                var _this = this;
                if (skipHandles === void 0) { skipHandles = false; }
                if (!skipHandles) {
                    this.ruler.leftMarginDragControl.setPosition(this.marginLeftValue + this.tableDisplayMarginLeftAdditionValue);
                    this.ruler.rightMarginDragControl.setPosition(this.marginRightValue + this.tableDisplayMarginRightAdditionValue);
                    this.ruler.divisionsControl.setPosition(this.divisionPositionValue + this.tableDisplaySeparatorAdditionValue);
                    if (this.ruler.leftIndentDragControl) {
                        this.ruler.firstLineIndentDragControl.setPosition(this.firstLineIndentValue);
                        this.ruler.leftIndentDragControl.setPosition(this.leftIndentValue);
                    }
                    if (this.ruler.rightIndentDragControl)
                        this.ruler.rightIndentDragControl.setPosition(this.rightIndentValue);
                    this.ruler.columnControls.setCount(this.columnValues.length);
                    this.ruler.columnControls.foreach(function (columnDragHandle, index) {
                        columnDragHandle.setWidth(_this.columnValues[index].width);
                        columnDragHandle.setSpacing(_this.columnValues[index].space);
                    });
                    if (this.action == Ruler.RulerAction.Tab && this.ruler.tabDragControls[this.dragTabIndex])
                        this.ruler.tabDragControls[this.dragTabIndex].setVisible(!this.isDeleteTab);
                    __aspxRichEdit.ListUtils.foreach(this.ruler.tabDragControls, function (tabDragHandle, index) {
                        if (tabDragHandle.getVisible() && _this.tabValues[index])
                            tabDragHandle.setPosition(_this.tabValues[index].value);
                    });
                    this.ruler.tableColumnSeparatorControls.setCount(this.tableColumnSeparators.length);
                    var rightMargin = 0;
                    for (var i = 0; i < this.tableColumnSeparators.length; i++) {
                        var item = this.tableColumnSeparators[i];
                        this.ruler.tableColumnSeparatorControls.getItem(i).setMargins(item.leftMargin, rightMargin);
                        rightMargin = item.rightMargin;
                        this.ruler.tableColumnSeparatorControls.getItem(i).setPosition(item.position);
                    }
                }
                if (!(this.action == Ruler.RulerAction.Tab && this.isDeleteTab))
                    this.ruler.lineControl.setPosition(this.linePositionValue, this.snapToValue);
            };
            PositionManager.prototype.getCalculatedDistance = function (distance, prevValue, startPointValue) {
                if (startPointValue === void 0) { startPointValue = 0; }
                var currentValue = prevValue - startPointValue + distance;
                currentValue = this.getConvertedByStepValue(currentValue, distance);
                return (currentValue + startPointValue) - prevValue;
            };
            PositionManager.prototype.getCalculatedRevertedDistance = function (distance, prevValue) {
                var currentValue = (this.ruler.width - prevValue) - this.marginLeftValue + distance;
                currentValue = this.ruler.width - (this.getConvertedByStepValue(currentValue, distance) + this.marginLeftValue);
                distance = -(currentValue - prevValue);
                if (this.isRightDirection && (prevValue - distance) > prevValue)
                    distance = 0;
                else if (!this.isRightDirection && (prevValue - distance) < prevValue)
                    distance = 0;
                return distance;
            };
            PositionManager.prototype.getConvertedByStepValue = function (value, distance) {
                var count = value / this.unitSize;
                count = distance > 0 ? Math.floor(count) : Math.ceil(count);
                return count * this.unitSize;
            };
            PositionManager.prototype.getCorrectedMarginLeftDistance = function (distance) {
                distance = this.getCalculatedDistance(distance, this.prevMarginLeftValue);
                var leftSideMaxValue = Math.max(this.prevMarginLeftValue + distance, this.prevLeftIndentValue + distance, this.prevFirstLineIndentValue + distance);
                var rightSideMaxValue = Math.max(this.marginRightValue, this.rightIndentValue);
                var currentMarginLeftValue = this.prevMarginLeftValue + distance;
                if (this.isRightDirection && currentMarginLeftValue <= this.prevMarginLeftValue)
                    distance = 0;
                if (!this.isRightDirection && currentMarginLeftValue > this.prevMarginLeftValue)
                    distance = 0;
                if (this.prevMarginLeftValue + distance < 0)
                    distance = -this.prevMarginLeftValue;
                else if (this.ruler.width - leftSideMaxValue < rightSideMaxValue + Ruler.MINIMUN_DISTANCE_BETWEEN_HANDLE)
                    distance -= rightSideMaxValue + leftSideMaxValue + Ruler.MINIMUN_DISTANCE_BETWEEN_HANDLE - this.ruler.width;
                return distance;
            };
            PositionManager.prototype.getCorrectedMarginRightDistance = function (distance) {
                distance = this.getCalculatedRevertedDistance(distance, this.prevMarginRightValue);
                var leftSideMaxValue = Math.max(this.marginLeftValue, this.leftIndentValue, this.firstLineIndentValue);
                var rightSideMaxValue = Math.max(this.prevMarginRightValue - distance, this.prevRightIndentValue - distance);
                if (this.prevMarginRightValue - distance < 0)
                    distance = this.prevMarginRightValue;
                else if (this.ruler.width - leftSideMaxValue < rightSideMaxValue + Ruler.MINIMUN_DISTANCE_BETWEEN_HANDLE)
                    distance += rightSideMaxValue + leftSideMaxValue + Ruler.MINIMUN_DISTANCE_BETWEEN_HANDLE - this.ruler.width;
                return distance;
            };
            PositionManager.prototype.getCorrectedRightIndentIndentDistance = function (distance) {
                var leftSideMaxValue = Math.max(this.marginLeftValue, this.leftIndentValue, this.firstLineIndentValue);
                distance = this.getCalculatedRevertedDistance(distance, this.prevRightIndentValue + this.tableDisplayMarginRightAdditionValue);
                if (this.prevRightIndentValue - distance < 0)
                    distance = this.prevRightIndentValue;
                else if (this.ruler.width - leftSideMaxValue < this.prevRightIndentValue - distance + Ruler.MINIMUN_DISTANCE_BETWEEN_HANDLE)
                    distance += this.prevRightIndentValue - distance + leftSideMaxValue + Ruler.MINIMUN_DISTANCE_BETWEEN_HANDLE - this.ruler.width;
                return distance;
            };
            PositionManager.prototype.getCorrectedFirstLineIndentDistance = function (distance) {
                var rightSideMaxValue = Math.max(this.marginRightValue, this.rightIndentValue);
                distance = this.getCalculatedDistance(distance, this.prevFirstLineIndentValue, this.marginLeftValue + this.tableDisplayLeftIdenAdditionValue);
                if (this.prevFirstLineIndentValue + distance < 0)
                    distance = -this.prevFirstLineIndentValue;
                else if (this.ruler.width - (this.prevFirstLineIndentValue + distance) < rightSideMaxValue + Ruler.MINIMUN_DISTANCE_BETWEEN_HANDLE)
                    distance -= rightSideMaxValue + this.prevFirstLineIndentValue + distance + Ruler.MINIMUN_DISTANCE_BETWEEN_HANDLE - this.ruler.width;
                return distance;
            };
            PositionManager.prototype.getCorrectedLeftIndentDistance = function (distance) {
                var rightSideMaxValue = Math.max(this.marginRightValue, this.rightIndentValue);
                distance = this.getCalculatedDistance(distance, this.prevLeftIndentValue, this.marginLeftValue + this.tableDisplayLeftIdenAdditionValue);
                if (this.prevLeftIndentValue + distance < 0)
                    distance = -this.prevLeftIndentValue;
                else if (this.ruler.width - (this.prevLeftIndentValue + distance) < rightSideMaxValue + Ruler.MINIMUN_DISTANCE_BETWEEN_HANDLE)
                    distance -= rightSideMaxValue + this.prevLeftIndentValue + distance + Ruler.MINIMUN_DISTANCE_BETWEEN_HANDLE - this.ruler.width;
                return distance;
            };
            PositionManager.prototype.getCorrectedHangingLeftIndentDistance = function (distance) {
                distance = this.getCalculatedDistance(distance, this.prevLeftIndentValue, this.marginLeftValue + this.tableDisplayLeftIdenAdditionValue);
                var leftSideMaxValue = Math.max(this.prevLeftIndentValue + distance, this.prevFirstLineIndentValue + distance);
                var rightSideMaxValue = Math.max(this.marginRightValue, this.rightIndentValue);
                var leftSideMinValue = Math.min(this.prevLeftIndentValue + distance, this.prevFirstLineIndentValue + distance);
                if (leftSideMinValue < 0)
                    distance = -Math.min(this.prevLeftIndentValue, this.prevFirstLineIndentValue);
                else if (this.ruler.width - leftSideMaxValue < rightSideMaxValue + Ruler.MINIMUN_DISTANCE_BETWEEN_HANDLE)
                    distance -= rightSideMaxValue + leftSideMaxValue + Ruler.MINIMUN_DISTANCE_BETWEEN_HANDLE - this.ruler.width;
                return distance;
            };
            PositionManager.prototype.getCorrectedTabDistance = function (distance) {
                if (this.tabValues[this.dragTabIndex] !== undefined) {
                    var currentTabValue = this.tabValues[this.dragTabIndex].prevValue - this.marginLeftValue + distance;
                    var leftSideMaxValue = Math.max(this.marginLeftValue, this.leftIndentValue, this.firstLineIndentValue);
                    var rightSideMaxValue = Math.max(this.marginRightValue, this.rightIndentValue);
                    distance = this.getCalculatedDistance(distance, this.tabValues[this.dragTabIndex].prevValue, this.marginLeftValue);
                    currentTabValue = this.tabValues[this.dragTabIndex].prevValue + distance;
                    if (this.isRightDirection && currentTabValue <= this.tabValues[this.dragTabIndex].prevValue)
                        distance = 0;
                    if (!this.isRightDirection && currentTabValue > this.tabValues[this.dragTabIndex].prevValue)
                        distance = 0;
                    if (currentTabValue < leftSideMaxValue)
                        distance = leftSideMaxValue - this.tabValues[this.dragTabIndex].prevValue;
                    else if (currentTabValue > this.ruler.width - rightSideMaxValue)
                        distance = this.ruler.width - rightSideMaxValue - this.tabValues[this.dragTabIndex].prevValue;
                    return distance;
                }
                else
                    return 0;
            };
            return PositionManager;
        }());
        Ruler.PositionManager = PositionManager;
        var PositionsInfo = (function () {
            function PositionsInfo() {
                this.tabs = [];
                this.columns = [];
            }
            return PositionsInfo;
        }());
        Ruler.PositionsInfo = PositionsInfo;
        var PositionsInfoChanged = (function (_super) {
            __extends(PositionsInfoChanged, _super);
            function PositionsInfoChanged() {
                var _this = _super !== null && _super.apply(this, arguments) || this;
                _this.marginLeftChanged = false;
                _this.marginRightChanged = false;
                _this.leftIndentChanged = false;
                _this.rightIndentChanged = false;
                _this.tableColumnChanged = false;
                _this.action = Ruler.RulerAction.None;
                return _this;
            }
            return PositionsInfoChanged;
        }(PositionsInfo));
        Ruler.PositionsInfoChanged = PositionsInfoChanged;
        var ColumnSectionProperties = (function () {
            function ColumnSectionProperties(width, space) {
                this.width = width;
                this.space = space;
            }
            return ColumnSectionProperties;
        }());
        Ruler.ColumnSectionProperties = ColumnSectionProperties;
        var ColumnValues = (function () {
            function ColumnValues(width, space) {
                this.width = 0;
                this.space = 0;
                this.prevWidth = 0;
                this.prevSpace = 0;
                this.width = width;
                this.space = space;
            }
            return ColumnValues;
        }());
        Ruler.ColumnValues = ColumnValues;
        var TabValues = (function () {
            function TabValues(value) {
                this.value = 0;
                this.prevValue = 0;
                this.value = value;
            }
            return TabValues;
        }());
        Ruler.TabValues = TabValues;
    })(Ruler = __aspxRichEdit.Ruler || (__aspxRichEdit.Ruler = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Ruler;
    (function (Ruler) {
        var RulerControlBase = (function (_super) {
            __extends(RulerControlBase, _super);
            function RulerControlBase(core, settings, richEditMainElement, viewElement) {
                var _this = _super.call(this) || this;
                _this.visible = true;
                _this.enable = true;
                _this.initialized = false;
                _this.isTestMode = false;
                _this.settings = settings;
                _this.richEditMainElement = richEditMainElement;
                _this.richEditViewElement = viewElement;
                _this.core = core;
                _this.uiType = core.uiUnitConverter;
                return _this;
            }
            RulerControlBase.prototype.initialize = function (testMode) {
                this.isTestMode = testMode;
                this.inputPosition = this.core.inputPosition;
                this.commandManager = this.core.commandManager;
                this.initializeCore();
            };
            RulerControlBase.prototype.initializeCore = function () {
                if (this.isTestMode)
                    return;
                if (!this.initialized && this.richEditViewElement.offsetWidth) {
                    this.initialized = true;
                    this.lineControl = this.createLineControl(this.richEditViewElement, this.settings);
                    this.addChild(this.lineControl);
                    this.lineControl.initialize();
                    this.rulerDisplayControl = this.createDisplayControl(this.lineControl, this.richEditViewElement, this.commandManager, this.settings, this.uiType.getUnits());
                    this.addChild(this.rulerDisplayControl);
                    this.rulerDisplayControl.initialize();
                    this.lineControl.rulerControlElement = this.rulerDisplayControl.controlElement;
                    Ruler.MouseEventsManager.addListener(this.rulerDisplayControl);
                    Ruler.ViewElementScrollManager.addListener(this.rulerDisplayControl, this.richEditViewElement);
                }
                this.setVisible(this.settings.visibility != Ruler.RulerVisibility.Hidden &&
                    !(this.core.innerClientProperties.viewsSettings.isSimpleView && this.settings.visibility == Ruler.RulerVisibility.Auto));
            };
            RulerControlBase.prototype.isReadOnly = function () {
                return this.core.readOnly != __aspxRichEdit.ReadOnlyMode.None;
            };
            RulerControlBase.prototype.NotifySelectionChanged = function (_selection) {
                this.update();
            };
            RulerControlBase.prototype.NotifyScrollPositionChanged = function () { };
            RulerControlBase.prototype.addChild = function (child) {
                this.richEditMainElement.insertBefore(child.rootElement, this.richEditViewElement);
            };
            RulerControlBase.prototype.update = function () {
                if (this.rulerDisplayControl && !this.isUpdateLocked() && !this.core.isClosed()) {
                    var pageWidth = 0;
                    if (this.core.innerClientProperties.viewsSettings.isSimpleView) {
                        pageWidth = this.core.innerClientProperties.viewsSettings.widthOfPage;
                        if (this.core.selection.specialRunInfo.isTextBoxSelected()) {
                            var subDocId = this.core.selection.specialRunInfo.getParentSubDocument().id;
                            var pos = this.core.selection.specialRunInfo.getPosition();
                            var page = this.core.layout.pages[this.core.selection.pageIndex];
                            if (page) {
                                var layoutTextBox = page.anchoredObjectHolder.getObjectByModelPosition(this.core.layout, pos, subDocId);
                                if (layoutTextBox && layoutTextBox.x + layoutTextBox.width > this.core.innerClientProperties.viewsSettings.widthOfPage)
                                    pageWidth = layoutTextBox.x + layoutTextBox.width + Ruler.MINIMUN_DISTANCE_BETWEEN_COLUMNS;
                            }
                        }
                    }
                    else
                        pageWidth = __aspxRichEdit.UnitConverter.twipsToPixels(this.inputPosition.getMergedSectionPropertiesRaw().pageWidth);
                    this.rulerDisplayControl.update(pageWidth);
                }
            };
            RulerControlBase.prototype.adjust = function () {
                if (!this.initialized && this.inputPosition) {
                    this.initializeCore();
                    if (this.initialized)
                        this.update();
                }
                if (this.rulerDisplayControl)
                    this.rulerDisplayControl.adjust();
            };
            RulerControlBase.prototype.setEnable = function (enable) {
                this.enable = enable;
                var _t = this.enable;
                this.enable = _t;
                Ruler.MouseEventsManager.canHandle = enable;
            };
            RulerControlBase.prototype.setVisible = function (visible) {
                if (this.rulerDisplayControl && this.visible != visible) {
                    this.visible = visible;
                    this.rulerDisplayControl.setVisible(this.visible);
                    Ruler.MouseEventsManager.canHandle = visible;
                    Ruler.ViewElementScrollManager.canHandle = visible;
                }
            };
            RulerControlBase.prototype.getVisible = function () {
                return this.visible;
            };
            RulerControlBase.prototype.getHeight = function () {
                if (this.rulerDisplayControl)
                    return this.rulerDisplayControl.getDisplayHeight();
                return 0;
            };
            RulerControlBase.prototype.getWidth = function () {
                if (this.rulerDisplayControl)
                    return this.rulerDisplayControl.getDisplayWidth();
                return 0;
            };
            RulerControlBase.prototype.getTabPositions = function () {
                var info = __aspxRichEdit.RichUtils.getSelectedParagraphs(this.core.selection.intervals, this.core.model.activeSubDocument);
                var tabs = [];
                __aspxRichEdit.ListUtils.foreach(info.paragraphs[0].getTabs().positions, function (tab) {
                    var newTab = tab.clone();
                    newTab.position = __aspxRichEdit.UnitConverter.twipsToPixelsF(tab.position);
                    tabs.push(newTab);
                });
                return tabs;
            };
            RulerControlBase.prototype.onViewTypeChanged = function () {
                if (this.settings.visibility == Ruler.RulerVisibility.Auto)
                    this.setVisible(!this.core.innerClientProperties.viewsSettings.isSimpleView);
            };
            ;
            return RulerControlBase;
        }(__aspxRichEdit.BatchUpdatableObject));
        Ruler.RulerControlBase = RulerControlBase;
        var HorizontalRulerControl = (function (_super) {
            __extends(HorizontalRulerControl, _super);
            function HorizontalRulerControl(core, settings, richEditMainElement, viewElement) {
                return _super.call(this, core, settings, richEditMainElement, viewElement) || this;
            }
            HorizontalRulerControl.prototype.createLineControl = function (viewElement, settings) {
                return new Ruler.LineDisplayControl(viewElement, settings);
            };
            HorizontalRulerControl.prototype.createDisplayControl = function (lineControl, viewElement, commandManager, settings, uiType) {
                return new Ruler.RulerDisplayControl(this, lineControl, viewElement, commandManager, settings, uiType);
            };
            HorizontalRulerControl.prototype.onUpdateUnlocked = function () {
            };
            return HorizontalRulerControl;
        }(RulerControlBase));
        Ruler.HorizontalRulerControl = HorizontalRulerControl;
        var VerticalRulerControl = (function (_super) {
            __extends(VerticalRulerControl, _super);
            function VerticalRulerControl(core, settings, richEditMainElement, viewElement) {
                return _super.call(this, core, settings, richEditMainElement, viewElement) || this;
            }
            VerticalRulerControl.prototype.createLineControl = function (_viewElement, _settings) {
                throw new Error(__aspxRichEdit.Errors.NotImplemented);
            };
            VerticalRulerControl.prototype.createDisplayControl = function (_lineControl, _viewElement, _commandManager, _settings, _uiType) {
                throw new Error(__aspxRichEdit.Errors.NotImplemented);
            };
            VerticalRulerControl.prototype.onUpdateUnlocked = function () {
            };
            return VerticalRulerControl;
        }(RulerControlBase));
        Ruler.VerticalRulerControl = VerticalRulerControl;
        var RulerSettings = (function () {
            function RulerSettings() {
            }
            return RulerSettings;
        }());
        Ruler.RulerSettings = RulerSettings;
        var RulerTitles = (function () {
            function RulerTitles() {
            }
            return RulerTitles;
        }());
        Ruler.RulerTitles = RulerTitles;
        var RulerStyles = (function () {
            function RulerStyles() {
            }
            return RulerStyles;
        }());
        Ruler.RulerStyles = RulerStyles;
        var RulerTabImages = (function () {
            function RulerTabImages() {
            }
            return RulerTabImages;
        }());
        Ruler.RulerTabImages = RulerTabImages;
        var RulerStyleInfo = (function () {
            function RulerStyleInfo() {
            }
            return RulerStyleInfo;
        }());
        Ruler.RulerStyleInfo = RulerStyleInfo;
        var RulerSpriteInfo = (function () {
            function RulerSpriteInfo() {
            }
            return RulerSpriteInfo;
        }());
        Ruler.RulerSpriteInfo = RulerSpriteInfo;
    })(Ruler = __aspxRichEdit.Ruler || (__aspxRichEdit.Ruler = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Ruler;
    (function (Ruler) {
        var ListDisplayControl = (function () {
            function ListDisplayControl(factoryMethod, parent) {
                this.list = [];
                this.factoryMethod = factoryMethod;
                this.parent = parent;
            }
            ListDisplayControl.prototype.setCount = function (count) {
                var difference = this.list.length - count;
                if (difference > 0)
                    while (difference--)
                        this.parent.removeChild(this.list.pop());
                else {
                    difference = Math.abs(difference);
                    while (difference--)
                        this.list.push(this.factoryMethod());
                }
            };
            ListDisplayControl.prototype.getCount = function () {
                return this.list.length;
            };
            ListDisplayControl.prototype.createItem = function (item) {
                if (item === void 0) { item = null; }
                this.list.push(item || this.factoryMethod());
            };
            ListDisplayControl.prototype.getItem = function (index) {
                return this.list[index];
            };
            ListDisplayControl.prototype.foreach = function (callback) {
                for (var i = 0, item; item = this.list[i]; i++)
                    if (item.getVisible())
                        callback(item, i);
            };
            return ListDisplayControl;
        }());
        Ruler.ListDisplayControl = ListDisplayControl;
        var RulerDisplayControlBase = (function (_super) {
            __extends(RulerDisplayControlBase, _super);
            function RulerDisplayControlBase(ruler, lineControl, commandManager, settings, uiUnit) {
                var _this = _super.call(this) || this;
                _this.canHandleScroll = false;
                _this.ruler = ruler;
                _this.lineControl = lineControl;
                _this.commandManager = commandManager;
                _this.settings = settings;
                _this.divisionsUnitHelper = new Ruler.DivisionsUnitHelper(uiUnit);
                return _this;
            }
            RulerDisplayControlBase.prototype.update = function (_pageWidth) {
            };
            RulerDisplayControlBase.prototype.adjust = function () {
            };
            RulerDisplayControlBase.prototype.getDisplayWidth = function () {
                return 0;
            };
            RulerDisplayControlBase.prototype.getDisplayHeight = function () {
                return 0;
            };
            RulerDisplayControlBase.prototype.setVisible = function (_visible) {
            };
            RulerDisplayControlBase.prototype.addChild = function (child) {
                this.controlElement.appendChild(child.rootElement);
            };
            RulerDisplayControlBase.prototype.removeChild = function (child) {
                this.controlElement.removeChild(child.rootElement);
                child = null;
            };
            RulerDisplayControlBase.prototype.onScroll = function () {
                if (this.canHandleScroll)
                    this.onScrollInternal();
            };
            RulerDisplayControlBase.prototype.onScrollInternal = function () {
            };
            RulerDisplayControlBase.prototype.canHandle = function (_source) {
                return false;
            };
            RulerDisplayControlBase.prototype.onMouseDown = function (_evt) {
            };
            RulerDisplayControlBase.prototype.onMouseMove = function (_distance, _source) {
                if (_source === void 0) { _source = null; }
            };
            RulerDisplayControlBase.prototype.onMouseUp = function () {
            };
            RulerDisplayControlBase.prototype.onDoubleClick = function (_evt) {
            };
            RulerDisplayControlBase.prototype.canHandleDoubleClick = function (_source) {
                return false;
            };
            RulerDisplayControlBase.prototype.onEscPress = function () {
            };
            RulerDisplayControlBase.prototype.startTableResizing = function (_position, _divisionIndex) {
            };
            return RulerDisplayControlBase;
        }(Ruler.DisplayControlBase));
        Ruler.RulerDisplayControlBase = RulerDisplayControlBase;
        var RulerDisplayControl = (function (_super) {
            __extends(RulerDisplayControl, _super);
            function RulerDisplayControl(ruler, lineControl, viewElement, commandManager, settings, uiUnitType) {
                var _this = _super.call(this, ruler, lineControl, commandManager, settings, uiUnitType) || this;
                _this.initialMarginLeftElement = 0;
                _this.leftMaringEnable = true;
                _this.rightMarginEnable = true;
                _this.leftIndentEnable = true;
                _this.rightIndentEnable = true;
                _this.columnsEnable = true;
                _this.tableIndex = -1;
                _this.tabDragControls = [];
                _this.width = 0;
                _this.viewElement = viewElement;
                return _this;
            }
            RulerDisplayControl.prototype.createControlHierarchy = function () {
                var _this = this;
                var maxPageWidth = __aspxRichEdit.UnitConverter.twipsToPixels(__aspxRichEdit.PaperSizeConverter.calculatePaperSize(__aspxRichEdit.PaperKind.PrcEnvelopeNumber10Rotated).width);
                this.getHtmlRootElement().className = this.settings.styles.wrapper.className;
                this.controlElement = document.createElement("DIV");
                this.controlElement.className = this.settings.styles.control.className;
                if (REWebUtils.Browser.MSTouchUI)
                    this.controlElement.className += " " + REWebUtils.TouchUIHelper.msTouchDraggableClassName;
                this.rootElement.appendChild(this.controlElement);
                this.tabAlignControl = new Ruler.TabAlignBoxControl(this.settings);
                this.rootElement.appendChild(this.tabAlignControl.rootElement);
                this.tabAlignControl.initialize();
                this.divisionsControl = new Ruler.DivisionsControl(this.settings, this.divisionsUnitHelper, maxPageWidth);
                this.addChild(this.divisionsControl);
                this.divisionsControl.initialize();
                this.leftMarginDragControl = new Ruler.LeftMarginDragHandleControl(this.settings, this.divisionsUnitHelper, maxPageWidth);
                this.leftMarginDragControl.initialize();
                this.addChild(this.leftMarginDragControl);
                this.rightMarginDragControl = new Ruler.RightMarginDragHandleControl(this.settings, this.divisionsUnitHelper);
                this.rightMarginDragControl.initialize();
                this.addChild(this.rightMarginDragControl);
                if (this.settings.showLeftIndent) {
                    this.leftIndentDragControl = new Ruler.LeftIndentDragHandleControl(this.settings, this.divisionsControl);
                    this.addChild(this.leftIndentDragControl);
                    this.leftIndentDragControl.initialize();
                    this.firstLineIndentDragControl = new Ruler.FirstLineIndentDragHandleControl(this.settings, this.divisionsControl);
                    this.addChild(this.firstLineIndentDragControl);
                    this.firstLineIndentDragControl.initialize();
                }
                if (this.settings.showRightIndent) {
                    this.rightIndentDragControl = new Ruler.RightIndentDragHandleControl(this.settings, this.divisionsControl);
                    this.addChild(this.rightIndentDragControl);
                    this.rightIndentDragControl.initialize();
                }
                this.columnControls = new ListDisplayControl(function () {
                    var column = new Ruler.ColumnDragHandleControl(_this.settings);
                    column.initialize();
                    _this.addChild(column);
                    return column;
                }, this);
                this.tableColumnSeparatorControls = new ListDisplayControl(function () {
                    var displayControl = new Ruler.TableColumnSeparatorDragDisplayControl(_this.settings);
                    _this.addChild(displayControl);
                    displayControl.initialize();
                    return displayControl;
                }, this);
                this.positionManager = new Ruler.PositionManager(this);
            };
            RulerDisplayControl.prototype.prepareControlHierarchy = function () {
                this.controlElement.style.visibility = "visible";
                this.controlElement.style.height = this.divisionsControl.getHeight() + "px";
                if (this.settings.showLeftIndent) {
                    this.controlElement.style.paddingBottom = this.leftIndentDragControl.getHeightOfProtrudingPart() + "px",
                        this.controlElement.style.paddingTop = this.firstLineIndentDragControl.getHeightOfProtrudingPart() + "px";
                }
                var divisionOffsetTop = this.divisionsControl.getHtmlRootElement().offsetTop;
                divisionOffsetTop += this.controlElement.offsetTop;
                this.tabAlignControl.adjust(divisionOffsetTop, this.divisionsControl.getHeight());
            };
            RulerDisplayControl.prototype.canHandle = function (source) {
                return REWebUtils.GetIsParent(this.controlElement, source);
            };
            RulerDisplayControl.prototype.canHandleDoubleClick = function (source) {
                return REWebUtils.GetIsParent(this.controlElement, source);
            };
            RulerDisplayControl.prototype.onDoubleClick = function (evt) {
                var source = REWebUtils.Evt.GetEventSource(evt);
                if (this.rightMarginDragControl.canHandle(source) || this.leftMarginDragControl.canHandle(source))
                    this.getCommand(__aspxRichEdit.RichEditClientCommand.ShowPageSetupForm).execute(this.commandManager.isPublicApiCall);
                else
                    this.getCommand(__aspxRichEdit.RichEditClientCommand.ShowTabsForm).execute(this.commandManager.isPublicApiCall);
            };
            RulerDisplayControl.prototype.onMouseDown = function (evt) {
                var source = REWebUtils.Evt.GetEventSource(evt);
                var columnIndex = -1;
                var tabIndex = -1;
                var tabAction = Ruler.TabAction.Move;
                var tableColumnIndex = -1;
                var action = Ruler.RulerAction.None;
                if (this.leftIndentEnable && this.firstLineIndentDragControl && this.firstLineIndentDragControl.canHandle(source))
                    action = Ruler.RulerAction.FirstLineIndent;
                else if (this.leftIndentEnable && this.leftIndentDragControl && this.leftIndentDragControl.canHandleLeftIden(source))
                    action = Ruler.RulerAction.LeftIndent;
                else if (this.leftIndentEnable && this.leftIndentDragControl && this.leftIndentDragControl.canHadleHangingIndent(source))
                    action = Ruler.RulerAction.HangingLeftIndent;
                else if (this.rightIndentEnable && this.rightIndentDragControl && this.rightIndentDragControl.canHandle(source))
                    action = Ruler.RulerAction.RightIndent;
                else if (this.leftMaringEnable && this.leftMarginDragControl.canHandle(source))
                    action = Ruler.RulerAction.MarginLeft;
                else if (this.rightMarginEnable && this.rightMarginDragControl.canHandle(source))
                    action = Ruler.RulerAction.MarginRight;
                if (this.columnsEnable)
                    this.columnControls.foreach(function (column, index) {
                        if (column.canHandle(source)) {
                            action = Ruler.RulerAction.ColumntMove;
                            if (column.isSpacingHandled(source))
                                action = Ruler.RulerAction.ColumnSpace;
                            else if (column.isWidthHandled(source))
                                action = Ruler.RulerAction.ColumnWidth;
                            columnIndex = index;
                        }
                    });
                this.tableColumnSeparatorControls.foreach(function (tableColumn, index) {
                    if (tableColumn.canHandle(source)) {
                        action = Ruler.RulerAction.TableColumnSeparator;
                        tableColumnIndex = index;
                    }
                });
                if (this.settings.showTabs)
                    __aspxRichEdit.ListUtils.foreach(this.tabDragControls, function (tab, index) {
                        if (tab.canHandle(source)) {
                            action = Ruler.RulerAction.Tab;
                            tabIndex = index;
                        }
                    });
                if (!this.ruler.isReadOnly() && action == Ruler.RulerAction.None && this.settings.showTabs && this.isTabMarkZone(evt)) {
                    action = Ruler.RulerAction.Tab;
                    tabAction = Ruler.TabAction.Insert;
                    for (tabIndex = 0; tabIndex < this.tabDragControls.length; tabIndex++) {
                        if (!this.tabDragControls[tabIndex].getVisible()) {
                            this.tabDragControls[tabIndex].setVisible(true);
                            this.tabDragControls[tabIndex].changeAlign(this.tabAlignControl.align);
                            var position = REWebUtils.Evt.GetEventX(evt) - REWebUtils.GetAbsolutePositionX(this.controlElement) - Ruler.RULLER_NUMBER_CORRECTION;
                            this.tabDragControls[tabIndex].setPosition(position);
                            this.positionManager.appendTabInfo(position);
                            break;
                        }
                    }
                }
                if (this.ruler.isReadOnly())
                    action = Ruler.RulerAction.None;
                this.positionManager.start(action, columnIndex, tabIndex, tableColumnIndex, tabAction);
            };
            RulerDisplayControl.prototype.onMouseUp = function () {
                this.applyChanges();
                this.positionManager.reset();
            };
            RulerDisplayControl.prototype.onMouseMove = function (distance, source) {
                if (source === void 0) { source = null; }
                this.positionManager.isDeleteTab = this.positionManager.action == Ruler.RulerAction.Tab && !REWebUtils.GetIsParent(this.getHtmlRootElement(), source);
                this.positionManager.move(distance);
            };
            RulerDisplayControl.prototype.onEscPress = function () {
                this.positionManager.reset();
            };
            RulerDisplayControl.prototype.onScrollInternal = function () {
                if (this.ruler.core.innerClientProperties.viewsSettings.isSimpleView) {
                    var paddingLeft = REWebUtils.PxToInt(REWebUtils.GetCurrentStyle(this.viewElement).paddingLeft);
                    this.controlElement.style.left = paddingLeft - this.viewElement.scrollLeft - Ruler.RULLER_NUMBER_CORRECTION + "px";
                }
                else
                    this.controlElement.style.left = this.initialMarginLeftElement - this.viewElement.scrollLeft + "px";
            };
            RulerDisplayControl.prototype.getCommand = function (commandName) {
                return this.commandManager.getCommand(commandName);
            };
            RulerDisplayControl.prototype.getCommandSate = function (commandName) {
                var command = this.commandManager.getCommand(commandName);
                if (command)
                    return command.getState();
                return null;
            };
            RulerDisplayControl.prototype.applyChanges = function () {
                var info = this.positionManager.getInfo();
                switch (info.action) {
                    case Ruler.RulerAction.MarginLeft:
                        if (info.marginLeftChanged)
                            this.getCommand(__aspxRichEdit.RichEditClientCommand.RulerSectionMarginLeft).execute(this.commandManager.isPublicApiCall, info.marginLeft);
                        break;
                    case Ruler.RulerAction.MarginRight:
                        if (info.marginRightChanged)
                            this.getCommand(__aspxRichEdit.RichEditClientCommand.RulerSectionMarginRight).execute(this.commandManager.isPublicApiCall, info.marginRight);
                        break;
                    case Ruler.RulerAction.FirstLineIndent:
                    case Ruler.RulerAction.LeftIndent:
                    case Ruler.RulerAction.HangingLeftIndent:
                        if (info.leftIndentChanged) {
                            this.getCommand(__aspxRichEdit.RichEditClientCommand.RulerParagraphLeftIndents).execute(this.commandManager.isPublicApiCall, new __aspxRichEdit.RulerParagraphLeftIndentsCommandValue(null, info.leftIndent, info.firstLineIndent));
                        }
                        break;
                    case Ruler.RulerAction.RightIndent:
                        if (info.rightIndentChanged)
                            this.getCommand(__aspxRichEdit.RichEditClientCommand.RulerParagraphRightIndent).execute(this.commandManager.isPublicApiCall, info.rightIndent);
                        break;
                    case Ruler.RulerAction.Tab:
                        this.applyTabChanges(info);
                        break;
                    case Ruler.RulerAction.ColumnSpace:
                    case Ruler.RulerAction.ColumnWidth:
                    case Ruler.RulerAction.ColumntMove:
                        this.getCommand(__aspxRichEdit.RichEditClientCommand.RulerSectionColumnsSettings).execute(this.commandManager.isPublicApiCall, info.columns);
                        break;
                    case Ruler.RulerAction.TableColumnSeparator:
                        this.getCommand(__aspxRichEdit.RichEditClientCommand.RulerChangeTableColumnWidth).execute(this.commandManager.isPublicApiCall, new __aspxRichEdit.RulerChangeTableColumnWidthCommandParameters(this.tableIndex, info.newTableColumnPosition - info.oldTableColumnPosition, null, info.oldTableColumnPosition, true));
                        break;
                }
            };
            RulerDisplayControl.prototype.applyTabChanges = function (info) {
                switch (info.tabAction) {
                    case Ruler.TabAction.Delete:
                        if (info.oldTabPosition == -1)
                            this.initializeDragHandles();
                        else
                            this.getCommand(__aspxRichEdit.RichEditClientCommand.DeleteTabRuler).execute(this.commandManager.isPublicApiCall, info.oldTabPosition);
                        break;
                    case Ruler.TabAction.Insert:
                        this.getCommand(__aspxRichEdit.RichEditClientCommand.InsertTabRuler).execute(this.commandManager.isPublicApiCall, { position: info.newTabPosition, align: this.tabAlignControl.align });
                        break;
                    case Ruler.TabAction.Move:
                        this.getCommand(__aspxRichEdit.RichEditClientCommand.MoveTabRuler).execute(this.commandManager.isPublicApiCall, { start: info.oldTabPosition, end: info.newTabPosition });
                        break;
                }
            };
            RulerDisplayControl.prototype.initializeDragHandles = function () {
                var isSimpleView = this.ruler.core.innerClientProperties.viewsSettings.isSimpleView && this.ruler.core.model.activeSubDocument.isMain();
                var info = new Ruler.PositionsInfo();
                this.tabAlignControl.setEnable(this.ruler.isReadOnly());
                var state = this.getCommandSate(__aspxRichEdit.RichEditClientCommand.RulerSectionMarginLeft);
                if (state) {
                    this.leftMaringEnable = state.enabled;
                    info.marginLeft = isSimpleView ? this.ruler.core.innerClientProperties.viewsSettings.paddings.left : state.value;
                }
                state = this.getCommandSate(__aspxRichEdit.RichEditClientCommand.RulerSectionMarginRight);
                if (state) {
                    this.rightMarginEnable = state.enabled;
                    info.marginRight = isSimpleView ? this.ruler.core.innerClientProperties.viewsSettings.paddings.right : state.value;
                }
                state = this.getCommandSate(__aspxRichEdit.RichEditClientCommand.RulerParagraphLeftIndents);
                if (state) {
                    this.leftIndentEnable = state.enabled;
                    info.leftIndent = state.value.hanging;
                    info.firstLineIndent = state.value.firstLine;
                }
                state = this.getCommandSate(__aspxRichEdit.RichEditClientCommand.RulerParagraphRightIndent);
                if (state) {
                    this.rightIndentEnable = state.enabled;
                    info.rightIndent = state.value.hanging;
                }
                state = this.getCommandSate(__aspxRichEdit.RichEditClientCommand.RulerSectionColumnsSettings);
                if (state) {
                    this.columnsEnable = state.enabled;
                    var columnProperties = state.value;
                    info.columns = [];
                    info.equalWidth = state.equalWidth;
                    info.columnActiveIndex = state.activeIndex;
                    columnProperties.pop();
                    if (columnProperties.length && !isSimpleView)
                        __aspxRichEdit.ListUtils.foreach(columnProperties, function (column) { info.columns.push(new Ruler.ColumnSectionProperties(column.width, column.space)); });
                }
                state = this.getCommandSate(__aspxRichEdit.RichEditClientCommand.RulerTableColumnSeparators);
                if (state && state.enabled) {
                    info.columnSeparators = state.value;
                    this.tableIndex = state.value.tableIndex;
                }
                if (!info.columnSeparators)
                    info.columnSeparators = new __aspxRichEdit.TableColumnSeparatorStruct();
                this.initializeTabDragHanles(info);
                this.positionManager.applyInfo(info);
            };
            RulerDisplayControl.prototype.initializeTabDragHanles = function (info) {
                var _this = this;
                var tabPositions = [];
                this.settings.showTabs = this.getCommandSate(__aspxRichEdit.RichEditClientCommand.InsertTabRuler).enabled;
                if (this.settings.showTabs)
                    tabPositions = this.ruler.getTabPositions();
                var difference = this.tabDragControls.length - tabPositions.length;
                if (difference > 0)
                    for (var i = 0; i < difference; i++)
                        this.tabDragControls[this.tabDragControls.length - 1 - i].setVisible(false);
                __aspxRichEdit.ListUtils.foreach(tabPositions, function (tabPosition, index) {
                    info.tabs.push(tabPosition.position);
                    if (_this.tabDragControls[index]) {
                        _this.tabDragControls[index].setVisible(true);
                        _this.tabDragControls[index].changeAlign(tabPosition.alignment);
                    }
                    else
                        _this.tabDragControls.push(_this.createTabDragHandle(tabPosition.alignment));
                });
                if (difference <= 0)
                    this.tabDragControls.push(this.createTabDragHandle(__aspxRichEdit.TabAlign.Left, false));
            };
            RulerDisplayControl.prototype.createTabDragHandle = function (align, visible) {
                if (visible === void 0) { visible = true; }
                var tabControl = new Ruler.TabDragHandleControl(this.settings, this.divisionsControl, align);
                this.addChild(tabControl);
                tabControl.initialize();
                tabControl.setVisible(visible);
                return tabControl;
            };
            RulerDisplayControl.prototype.isTabMarkZone = function (evt) {
                return REWebUtils.Evt.GetEventY(evt) - REWebUtils.GetAbsolutePositionY(this.controlElement) >= Ruler.RULLER_TABMARK_Y_POSITION;
            };
            RulerDisplayControl.prototype.update = function (pageWidth) {
                this.tabAlignControl.setVisible(!this.ruler.core.innerClientProperties.viewsSettings.isSimpleView);
                this.setWidth(pageWidth);
                this.initializeDragHandles();
            };
            RulerDisplayControl.prototype.adjust = function () {
                var viewWidth = this.viewElement.clientWidth;
                if (viewWidth > this.width)
                    this.initialMarginLeftElement = (viewWidth - this.width - Ruler.RULLER_NUMBER_CORRECTION * 2) / 2;
                else {
                    var paddingLeft = REWebUtils.PxToInt(REWebUtils.GetCurrentStyle(this.viewElement).paddingLeft);
                    if (this.ruler.core.innerClientProperties.viewsSettings.isSimpleView)
                        this.initialMarginLeftElement = paddingLeft - this.viewElement.scrollLeft - Ruler.RULLER_NUMBER_CORRECTION;
                    else {
                        var pageAreaBorderWidth = (this.viewElement.scrollWidth - paddingLeft - this.width) / 2;
                        this.initialMarginLeftElement = paddingLeft + pageAreaBorderWidth - Ruler.RULLER_NUMBER_CORRECTION;
                    }
                }
                this.controlElement.style.left = Math.round(this.initialMarginLeftElement) + "px";
                this.canHandleScroll = this.viewElement.scrollWidth > this.viewElement.offsetWidth;
            };
            RulerDisplayControl.prototype.setVisible = function (visible) {
                this.getHtmlRootElement().style.display = visible ? "block" : "none";
            };
            RulerDisplayControl.prototype.setWidth = function (value) {
                if (this.width != value) {
                    this.width = value;
                    this.controlElement.style.width = this.width + Ruler.RULLER_NUMBER_CORRECTION * 2 + "px";
                    this.adjust();
                }
            };
            RulerDisplayControl.prototype.getDisplayWidth = function () {
                return this.getHtmlRootElement().offsetWidth;
            };
            RulerDisplayControl.prototype.getDisplayHeight = function () {
                return this.getHtmlRootElement().offsetHeight;
            };
            return RulerDisplayControl;
        }(RulerDisplayControlBase));
        Ruler.RulerDisplayControl = RulerDisplayControl;
    })(Ruler = __aspxRichEdit.Ruler || (__aspxRichEdit.Ruler = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Ruler;
    (function (Ruler) {
        var DivisionType;
        (function (DivisionType) {
            DivisionType[DivisionType["Number"] = 0] = "Number";
            DivisionType[DivisionType["Minor"] = 1] = "Minor";
            DivisionType[DivisionType["Major"] = 2] = "Major";
        })(DivisionType = Ruler.DivisionType || (Ruler.DivisionType = {}));
        var RulerAction;
        (function (RulerAction) {
            RulerAction[RulerAction["None"] = 0] = "None";
            RulerAction[RulerAction["MarginLeft"] = 1] = "MarginLeft";
            RulerAction[RulerAction["MarginRight"] = 2] = "MarginRight";
            RulerAction[RulerAction["FirstLineIndent"] = 3] = "FirstLineIndent";
            RulerAction[RulerAction["RightIndent"] = 4] = "RightIndent";
            RulerAction[RulerAction["LeftIndent"] = 5] = "LeftIndent";
            RulerAction[RulerAction["HangingLeftIndent"] = 6] = "HangingLeftIndent";
            RulerAction[RulerAction["ColumntMove"] = 7] = "ColumntMove";
            RulerAction[RulerAction["ColumnSpace"] = 8] = "ColumnSpace";
            RulerAction[RulerAction["ColumnWidth"] = 9] = "ColumnWidth";
            RulerAction[RulerAction["Tab"] = 10] = "Tab";
            RulerAction[RulerAction["TableColumnSeparator"] = 11] = "TableColumnSeparator";
        })(RulerAction = Ruler.RulerAction || (Ruler.RulerAction = {}));
        var TabAction;
        (function (TabAction) {
            TabAction[TabAction["None"] = 0] = "None";
            TabAction[TabAction["Insert"] = 1] = "Insert";
            TabAction[TabAction["Delete"] = 2] = "Delete";
            TabAction[TabAction["Move"] = 3] = "Move";
        })(TabAction = Ruler.TabAction || (Ruler.TabAction = {}));
        var SnapTo;
        (function (SnapTo) {
            SnapTo[SnapTo["LeftSide"] = 0] = "LeftSide";
            SnapTo[SnapTo["RightSide"] = 1] = "RightSide";
        })(SnapTo = Ruler.SnapTo || (Ruler.SnapTo = {}));
        var RulerVisibility;
        (function (RulerVisibility) {
            RulerVisibility[RulerVisibility["Auto"] = 0] = "Auto";
            RulerVisibility[RulerVisibility["Visible"] = 1] = "Visible";
            RulerVisibility[RulerVisibility["Hidden"] = 2] = "Hidden";
        })(RulerVisibility = Ruler.RulerVisibility || (Ruler.RulerVisibility = {}));
        Ruler.RICH_EDIT_CLASS_NAME_PREFIX = "dxre-";
        Ruler.RULER_CLASS_NAME = Ruler.RICH_EDIT_CLASS_NAME_PREFIX + "ruler";
        Ruler.DIVISION_CONTAINER_CLASS_NAME = Ruler.RULER_CLASS_NAME + "Divisions";
        Ruler.LEFT_INDENT_DRAG_HANDLE_BODY = Ruler.RICH_EDIT_CLASS_NAME_PREFIX + "leftIndentDragHandleBody";
        Ruler.DIVISION_CLASS_NAME = "Division";
        Ruler.DIVISION_MINOR_CLASS_NAME = Ruler.RULER_CLASS_NAME + "Minor" + Ruler.DIVISION_CLASS_NAME;
        Ruler.DIVISION_MAJOR_CLASS_NAME = Ruler.RULER_CLASS_NAME + "Major" + Ruler.DIVISION_CLASS_NAME;
        Ruler.DIVISION_NUMBER_CLASS_NAME = Ruler.RULER_CLASS_NAME + "Number" + Ruler.DIVISION_CLASS_NAME;
        Ruler.DIVISION_MARGIN_LEFT_CURSOR_CLASS_NAME = Ruler.RULER_CLASS_NAME + "MarginLeftHandlePanel";
        Ruler.DIVISION_MARGIN_RIGHT_CURSOR_CLASS_NAME = Ruler.RULER_CLASS_NAME + "MarginRightHandlePanel";
        Ruler.DIVISION_MARGIN_LEFT_CLASS_NAME = Ruler.RULER_CLASS_NAME + "MarginLeftPanel";
        Ruler.DIVISION_MARGIN_RIGHT_CLASS_NAME = Ruler.RULER_CLASS_NAME + "MarginRightPanel";
        Ruler.COLUMN_HANDLE_CLASS_NAME = Ruler.RICH_EDIT_CLASS_NAME_PREFIX + "columnHandle";
        Ruler.COLUMN_LEFT_PART_HANDLE_CLASS_NAME = Ruler.RICH_EDIT_CLASS_NAME_PREFIX + "columnHandleLeftPart";
        Ruler.COLUMN_RIGHT_PART_HANDLE_CLASS_NAME = Ruler.RICH_EDIT_CLASS_NAME_PREFIX + "columnHandleRightPart";
        Ruler.TAB_ALIGN_BOX_PART_HANDLE_CLASS_NAME = Ruler.RICH_EDIT_CLASS_NAME_PREFIX + "rulertabAlignBox";
        Ruler.TABLE_COLUMN_SEPARATOR_HANDLE_CLASS_NAME = Ruler.RICH_EDIT_CLASS_NAME_PREFIX + "rulerTableColumnSeparatorHandle";
        Ruler.TABLE_COLUMN_SEPARATOR_RULER_LINE_CLASS_NAME = " table";
        Ruler.MINOR_TOP_AND_BOTTOM_MARGIN = 4;
        Ruler.MAJOR_TOP_AND_BOTTOM_MARGIN = 2;
        Ruler.MINIMUN_DISTANCE_BETWEEN_HANDLE = 7;
        Ruler.MINIMUN_DISTANCE_BETWEEN_COLUMNS = 35;
        Ruler.RULLER_NUMBER_CORRECTION = 5;
        Ruler.RULLER_TABMARK_Y_POSITION = 6;
        Ruler.TABLE_COLUMN_SEPARATOR_MARGIN = 15;
        var RulerUtils = (function () {
            function RulerUtils() {
            }
            RulerUtils.getTabTitlePropertyName = function (align) {
                var alignString = "";
                switch (align) {
                    case __aspxRichEdit.TabAlign.Left:
                        alignString = "Left";
                        break;
                    case __aspxRichEdit.TabAlign.Right:
                        alignString = "Right";
                        break;
                    case __aspxRichEdit.TabAlign.Center:
                        alignString = "Center";
                        break;
                    case __aspxRichEdit.TabAlign.Decimal:
                        alignString = "Decimal";
                        break;
                }
                return "tab" + alignString;
            };
            RulerUtils.getSpriteClassName = function (tabAlign, settings) {
                switch (tabAlign) {
                    case __aspxRichEdit.TabAlign.Left:
                        return settings.styles.tabImages.left.spriteCssClass;
                    case __aspxRichEdit.TabAlign.Right:
                        return settings.styles.tabImages.right.spriteCssClass;
                    case __aspxRichEdit.TabAlign.Center:
                        return settings.styles.tabImages.center.spriteCssClass;
                    case __aspxRichEdit.TabAlign.Decimal:
                        return settings.styles.tabImages.decimal.spriteCssClass;
                }
                return "";
            };
            return RulerUtils;
        }());
        Ruler.RulerUtils = RulerUtils;
    })(Ruler = __aspxRichEdit.Ruler || (__aspxRichEdit.Ruler = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var MathUtils = (function () {
        function MathUtils() {
        }
        MathUtils.NumberUtils = function (str) {
            str = MathUtils.Utf8Encode(str);
            var x;
            var y;
            var crc = 0;
            crc = crc ^ (-1);
            var strLen = str.length;
            for (var i = 0; i < strLen; i++) {
                y = (crc ^ str.charCodeAt(i)) & 0xFF;
                x = parseInt("0x" + MathUtils.table.substr(y * 9, 8));
                crc = (crc >>> 8) ^ x;
            }
            return crc ^ (-1);
        };
        MathUtils.round = function (value, digits) {
            if (digits === void 0) { digits = 0; }
            var factor = Math.pow(10, digits);
            return Math.round(value * factor) / factor;
        };
        MathUtils.Utf8Encode = function (str) {
            str = str.replace(/\r\n/g, "\n");
            var utfText = "";
            var strLen = str.length;
            for (var i = 0; i < strLen; i++) {
                var c = str.charCodeAt(i);
                if (c < 128) {
                    utfText += String.fromCharCode(c);
                }
                else if (c > 128 && c < 2048) {
                    utfText += String.fromCharCode((c >> 6) | 192);
                    utfText += String.fromCharCode((c & 63) | 128);
                }
                else {
                    utfText += String.fromCharCode((c >> 12) | 224);
                    utfText += String.fromCharCode(((c >> 6) & 63) | 128);
                    utfText += String.fromCharCode((c & 63) | 128);
                }
            }
            return utfText;
        };
        MathUtils.somePrimes = [1009, 1013,
            1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069,
            1087, 1091, 1093, 1097, 1103, 1109, 1117, 1123, 1129, 1151,
            1153, 1163, 1171, 1181, 1187, 1193, 1201, 1213, 1217, 1223,
            1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291,
            1297, 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373,
            1381, 1399, 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451,
            1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, 1511,
            1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583,
            1597, 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657,
            1663, 1667, 1669, 1693, 1697, 1699, 1709, 1721, 1723, 1733,
            1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, 1801, 1811,
            1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889,
            1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987,
            1993, 1997, 1999, 2003];
        MathUtils.table = "00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F 63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 A2677172 3C03E4D1 4B04D447 D20D85FD A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC 51DE003A C8D75180 BFD06116 21B4F4B5 56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 B10BE924 2F6F7C87 58684C11 C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 06B6B51F 9FBFE4A5 E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 E6635C01 6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE A3BC0074 D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 DA60B8D0 44042D73 33031DE5 AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 5768B525 206F85B3 B966D409 CE61E49F 5EDEF90E 29D9C998 B0D09822 C7D7A8B4 59B33D17 2EB40D81 B7BD5C3B C0BA6CAD EDB88320 9ABFB3B6 03B6E20C 74B1D29A EAD54739 9DD277AF 04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E 7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27 7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D 806567CB 196C3671 6E6B06E7 FED41B76 89D32BE0 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 60B08ED5 D6D6A3E8 A1D1937E 38D8C2C4 4FDFF252 D1BB67F1 A6BC5767 3FB506DD 48B2364B D80D2BDA AF0A1B4C 36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79 CB61B38C BC66831A 256FD2A0 5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92 5CB36A04 C2D7FFA7 B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 EB0E363F 72076785 05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D 7CDCEFB7 0BDBDF21 86D3D2D4 F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 18B74777 88085AE6 FF0F6A70 66063BCA 11010B5C 8F659EFF F862AE69 616BFFD3 166CCF45 A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 D06016F7 4969474D 3E6E77DB AED16A4A D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F 30B5FFE9 BDBDF21C CABAC28A 53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E C4614AB8 5D681B02 2A6F2B94 B40BBE37 C30C8EA1 5A05DF1B 2D02EF8D";
        return MathUtils;
    }());
    __aspxRichEdit.MathUtils = MathUtils;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Stack = (function () {
        function Stack() {
            this.list = [];
            this._count = 0;
        }
        Stack.prototype.push = function (val) {
            this.list.push(val);
            this.last = val;
            this._count++;
        };
        Stack.prototype.pop = function () {
            this._count--;
            var result = this.list.pop();
            this.last = this.list[this.list.length - 1];
            return result;
        };
        Stack.prototype.peek = function () {
            return this.last;
        };
        Object.defineProperty(Stack.prototype, "count", {
            get: function () { return this._count; },
            enumerable: true,
            configurable: true
        });
        return Stack;
    }());
    __aspxRichEdit.Stack = Stack;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var StrongEventDispatcher = (function () {
        function StrongEventDispatcher() {
            this.listeners = [];
        }
        StrongEventDispatcher.prototype.add = function (listener) {
            if (!listener)
                throw new Error(__aspxRichEdit.Errors.NotImplemented);
            if (!this.hasEventListener(listener))
                this.listeners.push(listener);
        };
        StrongEventDispatcher.prototype.remove = function (listener) {
            var index = __aspxRichEdit.ListUtils.indexOf(this.listeners, listener);
            if (index >= 0)
                this.listeners.splice(index, 1);
        };
        StrongEventDispatcher.prototype.hasEventListener = function (listener) {
            return __aspxRichEdit.ListUtils.indexOf(this.listeners, listener) >= 0;
        };
        return StrongEventDispatcher;
    }());
    __aspxRichEdit.StrongEventDispatcher = StrongEventDispatcher;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var CCF_Array = (function (_super) {
            __extends(CCF_Array, _super);
            function CCF_Array() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            CCF_Array.prototype.isHandleObject = function (obj) {
                return __aspxRichEdit.Utils.isArray(obj);
            };
            CCF_Array.prototype.getShortDescription = function (_config) {
                if (!this.curr.length)
                    return new ChromeCustomFormatters.DivElement().setText("[]");
                var list = this.getList();
                list.unshift(new __aspxRichEdit.Pair("", new ChromeCustomFormatters.SpanElement().setText(this.curr.length ? "(" + this.curr.length + ")" : "").setColor(ChromeCustomFormatters.BaseFormatter.blackColor)));
                return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsLine().setStdNumElements().setBoundChars("[", "]"));
            };
            CCF_Array.prototype.availableFullDescription = function (_config) {
                return true;
            };
            CCF_Array.prototype.getFullDescription = function (_config) {
                return this.stdShow(new ChromeCustomFormatters.StdProps(this.getList()).showAsColumn());
            };
            CCF_Array.prototype.getList = function () {
                return __aspxRichEdit.ListUtils.map(this.curr, function (val, ind) { return new __aspxRichEdit.Pair(ind.toString(), val); });
            };
            CCF_Array._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_Array());
            return CCF_Array;
        }(ChromeCustomFormatters.BaseFormatter));
        ChromeCustomFormatters.CCF_Array = CCF_Array;
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_ElementFormatter = (function (_super) {
                __extends(CCF_ElementFormatter, _super);
                function CCF_ElementFormatter() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_ElementFormatter.prototype.isHandleObject = function (obj) {
                    return obj instanceof ChromeCustomFormatters.BaseElement;
                };
                CCF_ElementFormatter.prototype.getShortDescription = function (_config) {
                    return this.curr;
                };
                CCF_ElementFormatter._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_ElementFormatter());
                return CCF_ElementFormatter;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_ElementFormatter = CCF_ElementFormatter;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var BaseElement = (function () {
            function BaseElement() {
            }
            BaseElement.prototype.toList = function () {
                var result = [this.getTypeAsString()];
                this.fillResult(result);
                return result;
            };
            ;
            BaseElement.fillClassesPart = function (result, elem) {
                if (elem.classes.length || elem.styles.length) {
                    var classStyleObject = {};
                    if (elem.classes.length)
                        classStyleObject["class"] = elem.classes.join(", ");
                    if (elem.styles.length)
                        classStyleObject["style"] = elem.styles.join("; ");
                    result.push(classStyleObject);
                }
            };
            BaseElement.fillTextPart = function (result, elem) {
                if (elem.text.length)
                    result.push(elem.text.join(" "));
            };
            BaseElement.fillNodesPart = function (result, elem) {
                if (elem.nodes.length)
                    for (var _i = 0, _a = elem.nodes; _i < _a.length; _i++) {
                        var node = _a[_i];
                        result.push(node.toList());
                    }
            };
            return BaseElement;
        }());
        ChromeCustomFormatters.BaseElement = BaseElement;
        var DivElement = (function (_super) {
            __extends(DivElement, _super);
            function DivElement() {
                var _this = _super !== null && _super.apply(this, arguments) || this;
                _this.styles = [];
                _this.classes = [];
                _this.nodes = [];
                _this.text = [];
                return _this;
            }
            DivElement.prototype.getTypeAsString = function () { return "div"; };
            DivElement.prototype.setText = function (text) {
                this.text.push(text);
                return this;
            };
            DivElement.prototype.setStyle = function (styleStr) {
                this.styles.push(styleStr);
                return this;
            };
            DivElement.prototype.setInlineBlockType = function () {
                return this.setStyle("display: inline-block");
            };
            DivElement.prototype.setClass = function (classStr) {
                this.classes.push(classStr);
                return this;
            };
            DivElement.prototype.setNode = function (node) {
                this.nodes.push(node);
                return this;
            };
            DivElement.prototype.fillResult = function (result) {
                BaseElement.fillClassesPart(result, this);
                BaseElement.fillTextPart(result, this);
                BaseElement.fillNodesPart(result, this);
            };
            DivElement.prototype.setColor = function (color) {
                this.setStyle("color: " + color);
                return this;
            };
            return DivElement;
        }(BaseElement));
        ChromeCustomFormatters.DivElement = DivElement;
        var SpanElement = (function (_super) {
            __extends(SpanElement, _super);
            function SpanElement() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            SpanElement.prototype.getTypeAsString = function () { return "span"; };
            return SpanElement;
        }(DivElement));
        ChromeCustomFormatters.SpanElement = SpanElement;
        var LiElement = (function (_super) {
            __extends(LiElement, _super);
            function LiElement() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            LiElement.prototype.getTypeAsString = function () { return "li"; };
            return LiElement;
        }(DivElement));
        ChromeCustomFormatters.LiElement = LiElement;
        var OlElement = (function (_super) {
            __extends(OlElement, _super);
            function OlElement() {
                var _this = _super !== null && _super.apply(this, arguments) || this;
                _this.styles = [];
                _this.classes = [];
                _this.nodes = [];
                return _this;
            }
            OlElement.prototype.getTypeAsString = function () { return "ol"; };
            OlElement.prototype.setStyle = function (styleStr) {
                this.styles.push(styleStr);
                return this;
            };
            OlElement.prototype.setClass = function (classStr) {
                this.classes.push(classStr);
                return this;
            };
            OlElement.prototype.setNode = function (node) {
                this.nodes.push(node);
                return this;
            };
            OlElement.prototype.fillResult = function (result) {
                if (!this.nodes.length)
                    throw new Error(__aspxRichEdit.Errors.InternalException);
                BaseElement.fillClassesPart(result, this);
                BaseElement.fillNodesPart(result, this);
            };
            return OlElement;
        }(BaseElement));
        ChromeCustomFormatters.OlElement = OlElement;
        var TableElement = (function (_super) {
            __extends(TableElement, _super);
            function TableElement() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            TableElement.prototype.getTypeAsString = function () { return "table"; };
            return TableElement;
        }(OlElement));
        ChromeCustomFormatters.TableElement = TableElement;
        var TrElement = (function (_super) {
            __extends(TrElement, _super);
            function TrElement() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            TrElement.prototype.getTypeAsString = function () { return "tr"; };
            return TrElement;
        }(OlElement));
        ChromeCustomFormatters.TrElement = TrElement;
        var TdElement = (function (_super) {
            __extends(TdElement, _super);
            function TdElement() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            TdElement.prototype.getTypeAsString = function () { return "td"; };
            return TdElement;
        }(DivElement));
        ChromeCustomFormatters.TdElement = TdElement;
        var ObjectElement = (function (_super) {
            __extends(ObjectElement, _super);
            function ObjectElement() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            ObjectElement.prototype.getTypeAsString = function () { return "object"; };
            ObjectElement.prototype.setObjectData = function (obj, config) {
                this.obj = obj;
                this.config = config;
                return this;
            };
            ObjectElement.prototype.fillResult = function (result) {
                var objData = {};
                objData["object"] = this.obj;
                objData["config"] = this.config;
                result.push(objData);
            };
            return ObjectElement;
        }(BaseElement));
        ChromeCustomFormatters.ObjectElement = ObjectElement;
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_ServerCommandRequest = (function (_super) {
                __extends(CCF_ServerCommandRequest, _super);
                function CCF_ServerCommandRequest() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_ServerCommandRequest.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.ServerCommandRequest;
                };
                CCF_ServerCommandRequest.prototype.getShortDescription = function (_config) {
                    var list = [
                        new __aspxRichEdit.Pair("type", __aspxRichEdit.CommandType[this.curr.type] + "(" + this.curr.type + ")")
                    ];
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsLine());
                };
                CCF_ServerCommandRequest.prototype.availableFullDescription = function (_config) {
                    return true;
                };
                CCF_ServerCommandRequest.prototype.getFullDescription = function (_config) {
                    var list = [
                        new __aspxRichEdit.Pair("type", __aspxRichEdit.CommandType[this.curr.type] + "(" + this.curr.type + ")"),
                        new __aspxRichEdit.Pair("subDocId", this.curr.subDocumentId),
                        new __aspxRichEdit.Pair("id", this.curr.id),
                        new __aspxRichEdit.Pair("processOnCallback", this.curr.processOnCallback),
                        new __aspxRichEdit.Pair("params", this.curr.params)
                    ];
                    if (this.curr instanceof __aspxRichEdit.EditCommandRequest) {
                        list.push(new __aspxRichEdit.Pair("editIncId", this.curr.editIncId));
                        if (this.curr instanceof __aspxRichEdit.EditTextBufferCommandRequest)
                            list.push(new __aspxRichEdit.Pair("text", this.curr.text));
                        if (this.curr instanceof __aspxRichEdit.ClientServerTextBufferChangedCommandRequest)
                            list.push(new __aspxRichEdit.Pair("text", this.curr.state));
                    }
                    else
                        list.push(new __aspxRichEdit.Pair("fontInfoCacheLength", this.curr.fontInfoCacheLength));
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsColumn());
                };
                CCF_ServerCommandRequest._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_ServerCommandRequest());
                return CCF_ServerCommandRequest;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_ServerCommandRequest = CCF_ServerCommandRequest;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var ShortString = (function () {
            function ShortString(str, shortLen) {
                if (shortLen === void 0) { shortLen = ShortString.SHORT_LEN; }
                this.str = str;
                this.setLen(shortLen);
            }
            Object.defineProperty(ShortString.prototype, "fullString", {
                get: function () { return new ChromeCustomFormatters.SpanElement().setText("\"" + this.str + "\"").setColor(ChromeCustomFormatters.BaseFormatter.stringColor); },
                enumerable: true,
                configurable: true
            });
            Object.defineProperty(ShortString.prototype, "shortString", {
                get: function () {
                    if (!this.canShowAsShort())
                        return this.fullString;
                    return new ChromeCustomFormatters.SpanElement()
                        .setNode(new ChromeCustomFormatters.SpanElement().setText("\"" + this.str.substr(0, this.halfOfShortLen) + "").setColor(ChromeCustomFormatters.BaseFormatter.stringColor))
                        .setNode(new ChromeCustomFormatters.SpanElement().setText("~").setColor(ChromeCustomFormatters.BaseFormatter.blackColor))
                        .setNode(new ChromeCustomFormatters.SpanElement().setText(this.str.substring(this.str.length - this.halfOfShortLen) + "\"").setColor(ChromeCustomFormatters.BaseFormatter.stringColor));
                },
                enumerable: true,
                configurable: true
            });
            ShortString.prototype.setLen = function (shortLen) {
                this.halfOfShortLen = Math.floor(shortLen / 2);
                return this;
            };
            ShortString.prototype.canShowAsShort = function () {
                return this.str.length > this.halfOfShortLen * 2;
            };
            ShortString.SHORT_LEN = 14;
            return ShortString;
        }());
        ChromeCustomFormatters.ShortString = ShortString;
        var CCF_ShortString = (function (_super) {
            __extends(CCF_ShortString, _super);
            function CCF_ShortString() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            CCF_ShortString.prototype.isHandleObject = function (obj) {
                return obj instanceof ShortString;
            };
            CCF_ShortString.prototype.getShortDescription = function (_config) {
                return this.stdShow(new ChromeCustomFormatters.StdProps([new __aspxRichEdit.Pair("", this.curr.shortString)]).showAsLine().setBoundChars("", ""));
            };
            CCF_ShortString.prototype.availableFullDescription = function (_config) {
                return this.curr.canShowAsShort();
            };
            CCF_ShortString.prototype.getFullDescription = function (_config) {
                return this.stdShow(new ChromeCustomFormatters.StdProps([new __aspxRichEdit.Pair("", this.curr.fullString)]).showAsColumn());
            };
            CCF_ShortString._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_ShortString());
            return CCF_ShortString;
        }(ChromeCustomFormatters.BaseFormatter));
        ChromeCustomFormatters.CCF_ShortString = CCF_ShortString;
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var XDirectionAdaptor = (function () {
        function XDirectionAdaptor() {
        }
        XDirectionAdaptor.prototype.isXDirection = function () {
            return true;
        };
        return XDirectionAdaptor;
    }());
    __aspxRichEdit.XDirectionAdaptor = XDirectionAdaptor;
    var PointDirectionAdaptorX = (function (_super) {
        __extends(PointDirectionAdaptorX, _super);
        function PointDirectionAdaptorX() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        PointDirectionAdaptorX.prototype.init = function (obj) {
            this.obj = obj;
            return this;
        };
        Object.defineProperty(PointDirectionAdaptorX.prototype, "position", {
            get: function () {
                return this.obj.x;
            },
            set: function (x) {
                this.obj.x = x;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(PointDirectionAdaptorX.prototype, "anotherPosition", {
            get: function () {
                return this.obj.y;
            },
            set: function (y) {
                this.obj.y = y;
            },
            enumerable: true,
            configurable: true
        });
        return PointDirectionAdaptorX;
    }(XDirectionAdaptor));
    __aspxRichEdit.PointDirectionAdaptorX = PointDirectionAdaptorX;
    var SizeDirectionAdaptorX = (function (_super) {
        __extends(SizeDirectionAdaptorX, _super);
        function SizeDirectionAdaptorX() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SizeDirectionAdaptorX.prototype.init = function (obj) {
            this.obj = obj;
            return this;
        };
        Object.defineProperty(SizeDirectionAdaptorX.prototype, "length", {
            get: function () {
                return this.obj.width;
            },
            set: function (width) {
                this.obj.width = width;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(SizeDirectionAdaptorX.prototype, "anotherLength", {
            get: function () {
                return this.obj.height;
            },
            set: function (height) {
                this.obj.height = height;
            },
            enumerable: true,
            configurable: true
        });
        return SizeDirectionAdaptorX;
    }(XDirectionAdaptor));
    __aspxRichEdit.SizeDirectionAdaptorX = SizeDirectionAdaptorX;
    var RectangleDirectionAdaptorX = (function (_super) {
        __extends(RectangleDirectionAdaptorX, _super);
        function RectangleDirectionAdaptorX() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RectangleDirectionAdaptorX.prototype.init = function (obj) {
            this.obj = obj;
            return this;
        };
        Object.defineProperty(RectangleDirectionAdaptorX.prototype, "length", {
            get: function () {
                return this.obj.width;
            },
            set: function (width) {
                this.obj.width = width;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RectangleDirectionAdaptorX.prototype, "anotherLength", {
            get: function () {
                return this.obj.height;
            },
            set: function (height) {
                this.obj.height = height;
            },
            enumerable: true,
            configurable: true
        });
        return RectangleDirectionAdaptorX;
    }(PointDirectionAdaptorX));
    __aspxRichEdit.RectangleDirectionAdaptorX = RectangleDirectionAdaptorX;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var YDirectionAdaptor = (function () {
        function YDirectionAdaptor() {
        }
        YDirectionAdaptor.prototype.isXDirection = function () {
            return false;
        };
        return YDirectionAdaptor;
    }());
    __aspxRichEdit.YDirectionAdaptor = YDirectionAdaptor;
    var PointDirectionAdaptorY = (function (_super) {
        __extends(PointDirectionAdaptorY, _super);
        function PointDirectionAdaptorY() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        PointDirectionAdaptorY.prototype.init = function (obj) {
            this.obj = obj;
            return this;
        };
        Object.defineProperty(PointDirectionAdaptorY.prototype, "position", {
            get: function () {
                return this.obj.y;
            },
            set: function (y) {
                this.obj.y = y;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(PointDirectionAdaptorY.prototype, "anotherPosition", {
            get: function () {
                return this.obj.x;
            },
            set: function (x) {
                this.obj.x = x;
            },
            enumerable: true,
            configurable: true
        });
        return PointDirectionAdaptorY;
    }(YDirectionAdaptor));
    __aspxRichEdit.PointDirectionAdaptorY = PointDirectionAdaptorY;
    var SizeDirectionAdaptorY = (function (_super) {
        __extends(SizeDirectionAdaptorY, _super);
        function SizeDirectionAdaptorY() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SizeDirectionAdaptorY.prototype.init = function (obj) {
            this.obj = obj;
            return this;
        };
        Object.defineProperty(SizeDirectionAdaptorY.prototype, "length", {
            get: function () {
                return this.obj.height;
            },
            set: function (height) {
                this.obj.height = height;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(SizeDirectionAdaptorY.prototype, "anotherLength", {
            get: function () {
                return this.obj.width;
            },
            set: function (width) {
                this.obj.width = width;
            },
            enumerable: true,
            configurable: true
        });
        return SizeDirectionAdaptorY;
    }(YDirectionAdaptor));
    __aspxRichEdit.SizeDirectionAdaptorY = SizeDirectionAdaptorY;
    var RectangleDirectionAdaptorY = (function (_super) {
        __extends(RectangleDirectionAdaptorY, _super);
        function RectangleDirectionAdaptorY() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RectangleDirectionAdaptorY.prototype.init = function (obj) {
            this.obj = obj;
            return this;
        };
        Object.defineProperty(RectangleDirectionAdaptorY.prototype, "length", {
            get: function () {
                return this.obj.height;
            },
            set: function (height) {
                this.obj.height = height;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(RectangleDirectionAdaptorY.prototype, "anotherLength", {
            get: function () {
                return this.obj.width;
            },
            set: function (width) {
                this.obj.width = width;
            },
            enumerable: true,
            configurable: true
        });
        return RectangleDirectionAdaptorY;
    }(PointDirectionAdaptorY));
    __aspxRichEdit.RectangleDirectionAdaptorY = RectangleDirectionAdaptorY;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var REWebUtils;
(function (REWebUtils) {
    var Attr = (function () {
        function Attr() {
        }
        Attr.SetAttribute = function (obj, attrName, value) {
            if (obj.setAttribute) {
                if (Attr.isSourceResetRequired() && attrName.toLowerCase() === "src")
                    obj.setAttribute(attrName, "");
                obj.setAttribute(attrName, value);
            }
            else if (obj.setProperty)
                obj.setProperty(attrName, value, "");
        };
        Attr.GetAttribute = function (obj, attrName) {
            if (obj.getAttribute)
                return obj.getAttribute(attrName);
            else if (obj.getPropertyValue) {
                if (REWebUtils.Browser.Firefox) {
                    try {
                        return obj.getPropertyValue(attrName);
                    }
                    catch (e) {
                        return obj[attrName];
                    }
                }
                return obj.getPropertyValue(attrName);
            }
            return null;
        };
        Attr.GetTabIndexAttributeName = function () {
            return REWebUtils.Browser.IE ? "tabIndex" : "tabindex";
        };
        Attr.ChangeStyleAttribute = function (obj, attrName, newValue) {
            Attr.ChangeAttributeExtended(obj.style, attrName, obj, "saved" + attrName, newValue);
        };
        Attr.ChangeAttributeExtended = function (obj, attrName, savedObj, savedAttrName, newValue) {
            Attr.SaveAttribute(obj, attrName, savedObj, savedAttrName);
            Attr.SetAttribute(obj, attrName, newValue);
        };
        Attr.SaveAttribute = function (obj, attrName, savedObj, savedAttrName) {
            if (!Attr.IsExistsAttribute(savedObj, savedAttrName)) {
                var oldValue = Attr.IsExistsAttribute(obj, attrName) ? Attr.GetAttribute(obj, attrName) : Attr.EmptyObject;
                Attr.SetAttribute(savedObj, savedAttrName, oldValue);
            }
        };
        Attr.RestoreAttributeExtended = function (obj, attrName, savedObj, savedAttrName) {
            if (Attr.IsExistsAttribute(savedObj, savedAttrName)) {
                var oldValue = Attr.GetAttribute(savedObj, savedAttrName);
                if (oldValue != Attr.EmptyObject)
                    Attr.SetAttribute(obj, attrName, oldValue);
                else
                    Attr.RemoveAttribute(obj, attrName);
                Attr.RemoveAttribute(savedObj, savedAttrName);
                return true;
            }
            return false;
        };
        Attr.RemoveAttribute = function (obj, attrName) {
            if (obj.removeAttribute)
                obj.removeAttribute(attrName);
            else if (obj.removeProperty)
                obj.removeProperty(attrName);
        };
        Attr.IsExistsAttribute = function (obj, attrName) {
            var value = Attr.GetAttribute(obj, attrName);
            return (value != null) && (value !== "");
        };
        Attr.isSourceResetRequired = function () {
            return REWebUtils.Browser.IE && REWebUtils.Browser.MajorVersion >= 11;
        };
        Attr.EmptyObject = {};
        Attr.RestoreStyleAttribute = function (obj, attrName) {
            return Attr.RestoreAttributeExtended(obj.style, attrName, obj, "saved" + attrName);
        };
        return Attr;
    }());
    REWebUtils.Attr = Attr;
})(REWebUtils || (REWebUtils = {}));
var REWebUtils;
(function (REWebUtils) {
    var CultureInfo = (function () {
        function CultureInfo() {
        }
        CultureInfo.twoDigitYearMax = 2029;
        CultureInfo.ts = ":";
        CultureInfo.ds = "/";
        CultureInfo.am = "AM";
        CultureInfo.pm = "PM";
        CultureInfo.monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""];
        CultureInfo.genMonthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ""];
        CultureInfo.abbrMonthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ""];
        CultureInfo.abbrDayNames = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
        CultureInfo.dayNames = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
        CultureInfo.invariantCultureDecimalPoint = ".";
        CultureInfo.numDecimalPoint = ".";
        CultureInfo.numPrec = 2;
        CultureInfo.numGroupSeparator = ",";
        CultureInfo.numGroups = [3];
        CultureInfo.numNegPattern = 1;
        CultureInfo.numPosInf = "Infinity";
        CultureInfo.numNegInf = "-Infinity";
        CultureInfo.numNan = "NaN";
        CultureInfo.currency = "$";
        CultureInfo.currDecimalPoint = ".";
        CultureInfo.currPrec = 2;
        CultureInfo.currGroupSeparator = ",";
        CultureInfo.currGroups = [3];
        CultureInfo.currPosPattern = 0;
        CultureInfo.currNegPattern = 0;
        CultureInfo.percentPattern = 0;
        CultureInfo.shortTime = "h:mm tt";
        CultureInfo.longTime = "h:mm:ss tt";
        CultureInfo.shortDate = "M/d/yyyy";
        CultureInfo.longDate = "dddd, MMMM d, yyyy";
        CultureInfo.monthDay = "MMMM d";
        CultureInfo.yearMonth = "MMMM yyyy";
        return CultureInfo;
    }());
    REWebUtils.CultureInfo = CultureInfo;
})(REWebUtils || (REWebUtils = {}));
REWebUtils.CultureInfo.genMonthNames = REWebUtils.CultureInfo.monthNames;
var REWebUtils;
(function (REWebUtils) {
    var Data = (function () {
        function Data() {
        }
        Data.ArrayInsert = function (array, element, position) {
            if (0 <= position && position < array.length) {
                for (var i = array.length; i > position; i--)
                    array[i] = array[i - 1];
                array[position] = element;
            }
            else
                array.push(element);
        };
        Data.ArrayRemove = function (array, element) {
            var index = Data.ArrayIndexOf(array, element);
            if (index > -1)
                Data.ArrayRemoveAt(array, index);
        };
        Data.ArrayRemoveAt = function (array, index) {
            if (index >= 0 && index < array.length) {
                for (var i = index; i < array.length - 1; i++)
                    array[i] = array[i + 1];
                array.pop();
            }
        };
        Data.ArrayClear = function (array) {
            while (array.length > 0)
                array.pop();
        };
        Data.ArrayIndexOf = function (array, element, comparer) {
            if (!comparer) {
                for (var i = 0; i < array.length; i++) {
                    if (array[i] == element)
                        return i;
                }
            }
            else {
                for (var i = 0; i < array.length; i++) {
                    if (comparer(array[i], element))
                        return i;
                }
            }
            return -1;
        };
        Data.ArrayContains = function (array, element) {
            return Data.ArrayIndexOf(array, element) >= 0;
        };
        Data.ArrayEqual = function (array1, array2) {
            var count1 = array1.length;
            var count2 = array2.length;
            if (count1 != count2)
                return false;
            for (var i = 0; i < count1; i++)
                if (array1[i] != array2[i])
                    return false;
            return true;
        };
        Data.ArraySame = function (array1, array2) {
            if (array1.length !== array2.length)
                return false;
            return array1.every(function (elem) { return Data.ArrayContains(array2, elem); });
        };
        Data.ArrayGetIntegerEdgeValues = function (array) {
            var arrayToSort = Data.CollectionToArray(array);
            Data.ArrayIntegerAscendingSort(arrayToSort);
            return {
                start: arrayToSort[0],
                end: arrayToSort[arrayToSort.length - 1]
            };
        };
        Data.ArrayIntegerAscendingSort = function (array) {
            Data.ArrayIntegerSort(array, false);
        };
        Data.ArrayIntegerSort = function (array, desc) {
            array.sort(function (i1, i2) {
                var res = 0;
                if (i1 > i2)
                    res = 1;
                else if (i1 < i2)
                    res = -1;
                if (desc)
                    res *= -1;
                return res;
            });
        };
        Data.CollectionsUnionToArray = function (firstCollection, secondCollection) {
            var result = [];
            var firstCollectionLength = firstCollection.length;
            var secondCollectionLength = secondCollection.length;
            for (var i = 0; i < firstCollectionLength + secondCollectionLength; i++) {
                if (i < firstCollectionLength)
                    result.push(firstCollection[i]);
                else
                    result.push(secondCollection[i - firstCollectionLength]);
            }
            return result;
        };
        Data.CollectionToArray = function (collection) {
            var array = [];
            for (var i = 0; i < collection.length; i++)
                array.push(collection[i]);
            return array;
        };
        Data.CreateHashTableFromArray = function (array) {
            var hash = [];
            for (var i = 0; i < array.length; i++)
                hash[array[i]] = 1;
            return hash;
        };
        Data.CreateIndexHashTableFromArray = function (array) {
            var hash = [];
            for (var i = 0; i < array.length; i++)
                hash[array[i]] = i;
            return hash;
        };
        Data.ArrayToHash = function (array, getKeyFunc, getValueFunc) {
            if (!(array instanceof Array))
                return {};
            return array.reduce(function (map, element, index) {
                var key = getKeyFunc(element, index);
                var value = getValueFunc(element, index);
                map[key] = value;
                return map;
            }, {});
        };
        Data.Sum = function (array, getValueFunc) {
            if (!(array instanceof Array))
                return 0;
            return array.reduce(function (prevValue, item) {
                var value = getValueFunc ? getValueFunc(item) : item;
                if (!REWebUtils.IsNumber(value))
                    value = 0;
                return prevValue + value;
            }, 0);
        };
        Data.Min = function (array, getValueFunc) { return Data.CalculateArrayMinMax(array, getValueFunc, false); };
        ;
        Data.Max = function (array, getValueFunc) { return Data.CalculateArrayMinMax(array, getValueFunc, true); };
        ;
        Data.NearestLeftBinarySearchComparer = function (array, index, value) {
            var arrayElement = array[index];
            var leftPoint = arrayElement < value;
            var lastLeftPoint = leftPoint && index == array.length - 1;
            var nearestLeftPoint = lastLeftPoint || (leftPoint && array[index + 1] >= value);
            if (nearestLeftPoint)
                return 0;
            else
                return arrayElement < value ? -1 : 1;
        };
        Data.ArrayBinarySearch = function (array, value, binarySearchComparer, startIndex, length) {
            if (!binarySearchComparer)
                binarySearchComparer = Data.defaultBinarySearchComparer;
            if (!REWebUtils.IsExists(startIndex))
                startIndex = 0;
            if (!REWebUtils.IsExists(length))
                length = array.length - startIndex;
            var endIndex = (startIndex + length) - 1;
            while (startIndex <= endIndex) {
                var middle = (startIndex + ((endIndex - startIndex) >> 1));
                var compareResult = binarySearchComparer(array, middle, value);
                if (compareResult == 0)
                    return middle;
                if (compareResult < 0)
                    startIndex = middle + 1;
                else
                    endIndex = middle - 1;
            }
            return -(startIndex + 1);
        };
        Data.ArrayFlatten = function (arrayOfArrays) {
            return [].concat.apply([], arrayOfArrays);
        };
        Data.GetDistinctArray = function (array) {
            var resultArray = [];
            for (var i = 0; i < array.length; i++) {
                var currentEntry = array[i];
                if (Data.ArrayIndexOf(resultArray, currentEntry) == -1) {
                    resultArray.push(currentEntry);
                }
            }
            return resultArray;
        };
        Data.ForEach = function (arr, callback) {
            if (Array.prototype.forEach) {
                Array.prototype.forEach.call(arr, callback);
            }
            else {
                for (var i = 0, len = arr.length; i < len; i++) {
                    callback(arr[i], i, arr);
                }
            }
        };
        Data.MergeHashTables = function (target, object) {
            if (!object || typeof (object) == "string")
                return target;
            if (!target)
                target = {};
            for (var key in object)
                if (key && !(key in target))
                    target[key] = object[key];
            return target;
        };
        Data.Range = function (count, start) {
            count = parseInt(count) || 0;
            start = parseInt(start) || 0;
            if (count < 0)
                count = 0;
            if (start < 0)
                start = 0;
            return Array.apply(null, Array(count)).map(function (_val, i) { return start + i; });
        };
        Data.CalculateArrayMinMax = function (array, getValueFunc, isMax) {
            if (!(array instanceof Array))
                return 0;
            var startValue = isMax ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY;
            return array.reduce(function (prevValue, item) {
                var value = getValueFunc ? getValueFunc(item) : item;
                if (!REWebUtils.IsNumber(value))
                    value = startValue;
                var func = isMax ? Math.max : Math.min;
                return func(value, prevValue);
            }, startValue);
        };
        Data.defaultBinarySearchComparer = function (array, index, value) {
            var arrayElement = array[index];
            if (arrayElement == value)
                return 0;
            else
                return arrayElement < value ? -1 : 1;
        };
        return Data;
    }());
    REWebUtils.Data = Data;
})(REWebUtils || (REWebUtils = {}));
var REWebUtils;
(function (REWebUtils) {
    var DateFormatter = (function () {
        function DateFormatter() {
            this.date = new Date(2000, 0, 1);
            this.mask = "";
            this.specifiers = {};
            this.spPositions = [];
            this.parserKeys = [];
            this.knownSpecifiers = ["d", "M", "y", "H", "h", "m", "s", "f", "F", "g", "t"];
            this.savedYear = -1;
            this.isYearParsed = false;
            this.parsedMonth = -1;
            this.replacers = {
                "d": this.ReplaceDay,
                "M": this.ReplaceMonth,
                "y": this.ReplaceYear,
                "H": this.ReplaceHours23,
                "h": this.ReplaceHours12,
                "m": this.ReplaceMinutes,
                "s": this.ReplaceSeconds,
                "F": this.ReplaceMsTrimmed,
                "f": this.ReplaceMs,
                "g": this.ReplaceEra,
                "t": this.ReplaceAmPm
            };
            this.parsers = {
                "d": this.ParseDay,
                "M": this.ParseMonth,
                "y": this.ParseYear,
                "H": this.ParseHours,
                "h": this.ParseHours,
                "m": this.ParseMinutes,
                "s": this.ParseSeconds,
                "F": this.ParseMs,
                "f": this.ParseMs,
                "g": this.ParseEra,
                "t": this.ParseAmPm
            };
        }
        DateFormatter.prototype.Format = function (date) {
            this.date = date;
            var sp;
            var pos;
            var replacerKey;
            var result = this.mask;
            for (var i = 0; i < this.spPositions.length; i++) {
                pos = this.spPositions[i];
                sp = this.specifiers[pos];
                replacerKey = sp.substr(0, 1);
                if (this.replacers[replacerKey]) {
                    result = result.substr(0, pos) + this.replacers[replacerKey].call(this, sp.length) + result.substr(pos + sp.length);
                }
            }
            return result;
        };
        DateFormatter.prototype.Parse = function (str, rememberParserKeys) {
            var now = new Date();
            this.savedYear = now.getFullYear();
            this.isYearParsed = false;
            this.parsedMonth = -1;
            this.date = new Date(2000, 0, now.getDate());
            this.strToParse = str;
            this.catchNumbers(str);
            var parserKey;
            var sp;
            var pos;
            var parseResult;
            var error = false;
            this.hasAmPm = false;
            for (var i = 0; i < this.spPositions.length; i++) {
                pos = this.spPositions[i];
                sp = this.specifiers[pos];
                parserKey = sp.substr(0, 1);
                if (this.parsers[parserKey]) {
                    if (rememberParserKeys)
                        this.parserKeys.push(parserKey);
                    parseResult = this.parsers[parserKey].call(this, sp.length);
                    if (!parseResult) {
                        error = true;
                        break;
                    }
                }
            }
            if (error)
                return false;
            if (this.hasAmPm) {
                if (!this.fixHours())
                    return false;
            }
            if (!this.isYearParsed)
                this.date.setYear(this.savedYear);
            if (this.parsedMonth < 0)
                this.parsedMonth = now.getMonth();
            this.ApplyMonth();
            return this.date;
        };
        DateFormatter.ExpandPredefinedFormat = function (format) {
            switch (format) {
                case "d":
                    return REWebUtils.CultureInfo.shortDate;
                case "D":
                    return REWebUtils.CultureInfo.longDate;
                case "t":
                    return REWebUtils.CultureInfo.shortTime;
                case "T":
                    return REWebUtils.CultureInfo.longTime;
                case "g":
                    return REWebUtils.CultureInfo.shortDate + " " + REWebUtils.CultureInfo.shortTime;
                case "f":
                    return REWebUtils.CultureInfo.longDate + " " + REWebUtils.CultureInfo.shortTime;
                case "G":
                    return REWebUtils.CultureInfo.shortDate + " " + REWebUtils.CultureInfo.longTime;
                case "F":
                case "U":
                    return REWebUtils.CultureInfo.longDate + " " + REWebUtils.CultureInfo.longTime;
                case "M":
                case "m":
                    return REWebUtils.CultureInfo.monthDay;
                case "Y":
                case "y":
                    return REWebUtils.CultureInfo.yearMonth;
                case "O":
                case "o":
                    return "yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffff";
                case "R":
                case "r":
                    return "ddd, dd MMM yyyy HH':'mm':'ss 'GMT'";
                case "s":
                    return "yyyy'-'MM'-'dd'T'HH':'mm':'ss";
                case "u":
                    return "yyyy'-'MM'-'dd HH':'mm':'ss'Z'";
            }
            return format;
        };
        DateFormatter.prototype.HasYear = function () { return this.HasParserKey("y"); };
        DateFormatter.prototype.HasMonth = function () { return this.HasParserKey("M"); };
        DateFormatter.prototype.HasDay = function () { return this.HasParserKey("d"); };
        DateFormatter.prototype.HasHours = function () { return this.HasParserKey("h") || this.HasParserKey("H"); };
        DateFormatter.prototype.HasMinutes = function () { return this.HasParserKey("m"); };
        DateFormatter.prototype.HasSeconds = function () { return this.HasParserKey("s"); };
        DateFormatter.prototype.HasMilliseconds = function () { return this.HasParserKey("f") || this.HasParserKey("F"); };
        DateFormatter.prototype.HasParserKey = function (key) { return REWebUtils.Data.ArrayIndexOf(this.parserKeys, key) !== -1; };
        DateFormatter.prototype.ApplyMonth = function () {
            var trial;
            var day = this.date.getDate();
            while (true) {
                trial = new Date();
                trial.setTime(this.date.getTime());
                trial.setMonth(this.parsedMonth);
                if (trial.getMonth() == this.parsedMonth)
                    break;
                --day;
                this.date.setDate(day);
            }
            REWebUtils.DateUtils.FixTimezoneGap(this.date, trial);
            this.date = trial;
        };
        DateFormatter.prototype.SetFormatString = function (mask) {
            if (mask.length == 2 && mask.charAt(0) == "%")
                mask = mask.charAt(1);
            var stringContainsDateSeparator = mask && mask.indexOf(REWebUtils.CultureInfo.ds) !== -1;
            this.specifiers = {};
            this.spPositions = [];
            this.mask = "";
            var subt = 0;
            var pos = 0;
            var startPos = 0;
            var ch;
            var prevCh = "";
            var skip = false;
            var backslash = false;
            var sp = "";
            while (true) {
                ch = mask.charAt(pos);
                if (ch == "") {
                    if (sp.length > 0)
                        this.RegisterSpecifier(startPos, sp, stringContainsDateSeparator);
                    break;
                }
                if (ch == "\\" && !backslash) {
                    backslash = true;
                    subt++;
                }
                else {
                    if (!backslash && (ch == "'" || ch == '"')) {
                        skip = !skip;
                        subt++;
                    }
                    else {
                        if (!skip) {
                            if (ch == "/")
                                ch = REWebUtils.CultureInfo.ds;
                            else if (ch == ":")
                                ch = REWebUtils.CultureInfo.ts;
                            else if (this.IsKnownSpecifier(ch)) {
                                if (prevCh.length == 0)
                                    prevCh = ch;
                                if (ch == prevCh)
                                    sp += ch;
                                else {
                                    if (sp.length > 0)
                                        this.RegisterSpecifier(startPos, sp, stringContainsDateSeparator);
                                    sp = ch;
                                    startPos = pos - subt;
                                }
                            }
                        }
                        this.mask += ch;
                    }
                    backslash = false;
                }
                prevCh = ch;
                pos++;
            }
            this.spPositions.reverse();
        };
        DateFormatter.prototype.RegisterSpecifier = function (pos, sp, stringContainsDateSeparator) {
            if (REWebUtils.CultureInfo.ds.length > 1 && this.mask && !stringContainsDateSeparator) {
                var dateParts = this.mask.split(REWebUtils.CultureInfo.ds);
                if (dateParts) {
                    if (dateParts.length > 0 && dateParts[dateParts.length - 1] == "")
                        dateParts.pop();
                    pos += (dateParts.length - 1) * (REWebUtils.CultureInfo.ds.length - 1);
                }
            }
            this.spPositions.push(pos);
            this.specifiers[pos] = sp;
        };
        DateFormatter.prototype.ReplaceDay = function (length) {
            if (length < 3) {
                var value = this.date.getDate().toString();
                return length == 2 ? this.padLeft(value, 2) : value;
            }
            else if (length == 3) {
                return REWebUtils.CultureInfo.abbrDayNames[this.date.getDay()];
            }
            else {
                return REWebUtils.CultureInfo.dayNames[this.date.getDay()];
            }
        };
        DateFormatter.prototype.ReplaceMonth = function (length) {
            var value = 1 + this.date.getMonth();
            switch (length) {
                case 1:
                    return value.toString();
                case 2:
                    return this.padLeft(value.toString(), 2);
                case 3:
                    return REWebUtils.CultureInfo.abbrMonthNames[value - 1];
                default:
                    for (var i in this.specifiers) {
                        if (this.specifiers.hasOwnProperty(i)) {
                            var spec = this.specifiers[i];
                            if (spec == "d" || spec == "dd")
                                return REWebUtils.CultureInfo.genMonthNames[value - 1];
                        }
                    }
                    return REWebUtils.CultureInfo.monthNames[value - 1];
            }
        };
        DateFormatter.prototype.ReplaceYear = function (length) {
            var value = this.date.getFullYear();
            if (length <= 2)
                value = value % 100;
            return this.padLeft(value.toString(), length);
        };
        DateFormatter.prototype.ReplaceHours23 = function (length) {
            var value = this.date.getHours().toString();
            return length > 1 ? this.padLeft(value, 2) : value;
        };
        DateFormatter.prototype.ReplaceHours12 = function (length) {
            var value = this.date.getHours() % 12;
            if (value == 0)
                value = 12;
            var strValue = value.toString();
            return length > 1 ? this.padLeft(strValue, 2) : strValue;
        };
        DateFormatter.prototype.ReplaceMinutes = function (length) {
            var value = this.date.getMinutes().toString();
            return length > 1 ? this.padLeft(value, 2) : value;
        };
        DateFormatter.prototype.ReplaceSeconds = function (length) {
            var value = this.date.getSeconds().toString();
            return length > 1 ? this.padLeft(value, 2) : value;
        };
        DateFormatter.prototype.ReplaceMsTrimmed = function (length) {
            return this.formatMs(length, true);
        };
        DateFormatter.prototype.ReplaceMs = function (length) {
            return this.formatMs(length, false);
        };
        DateFormatter.prototype.ReplaceEra = function (_length) {
            return "A.D.";
        };
        DateFormatter.prototype.ReplaceAmPm = function (length) {
            var value = this.date.getHours() < 12 ? REWebUtils.CultureInfo.am : REWebUtils.CultureInfo.pm;
            return length < 2 ? value.charAt(0) : value;
        };
        DateFormatter.prototype.catchNumbers = function (str) {
            this.parseNumbers = [];
            var regex = /\d+/g;
            var match;
            for (;;) {
                match = regex.exec(str);
                if (!match)
                    break;
                this.parseNumbers.push(this.parseDecInt(match[0]));
            }
            var spCount = 0;
            var now = new Date();
            for (var i in this.specifiers) {
                if (this.specifiers.hasOwnProperty(i)) {
                    var sp = this.specifiers[i];
                    if (sp.constructor != String || !this.IsNumericSpecifier(sp))
                        continue;
                    spCount++;
                    if (this.parseNumbers.length < spCount) {
                        var defaultValue = 0;
                        if (sp.charAt(0) == "y")
                            defaultValue = now.getFullYear();
                        this.parseNumbers.push(defaultValue);
                    }
                }
            }
            var excess = this.parseNumbers.length - spCount;
            if (excess > 0)
                this.parseNumbers.splice(spCount, excess);
            this.currentParseNumber = this.parseNumbers.length - 1;
        };
        DateFormatter.prototype.popParseNumber = function () {
            return this.parseNumbers[this.currentParseNumber--];
        };
        DateFormatter.prototype.findAbbrMonth = function () {
            return this.findMonthCore(REWebUtils.CultureInfo.abbrMonthNames);
        };
        DateFormatter.prototype.findFullMonth = function () {
            return this.findMonthCore(REWebUtils.CultureInfo.genMonthNames);
        };
        DateFormatter.prototype.findMonthCore = function (monthNames) {
            var inputLower = this.strToParse.toLowerCase();
            for (var i = 0; i < monthNames.length; i++) {
                var monthName = monthNames[i].toLowerCase();
                if (monthName.length > 0 && inputLower.indexOf(monthName) > -1) {
                    var empty = "";
                    for (var j = 0; j < monthName.length; j++)
                        empty += " ";
                    this.strToParse = this.strToParse.replace(new RegExp(monthName, "gi"), empty);
                    return 1 + i;
                }
            }
            return false;
        };
        DateFormatter.prototype.ParseDay = function (length) {
            if (length < 3) {
                var value = this.popParseNumber();
                if (value < 1 || value > 31)
                    return false;
                this.date.setDate(value);
            }
            return true;
        };
        DateFormatter.prototype.ParseMonth = function (length) {
            var value;
            switch (length) {
                case 1:
                case 2:
                    value = this.popParseNumber();
                    break;
                case 3:
                    value = this.findAbbrMonth();
                    break;
                default:
                    value = this.findFullMonth();
                    break;
            }
            if (value < 1 || value > 12)
                return false;
            this.parsedMonth = value - 1;
            return true;
        };
        DateFormatter.prototype.ParseYear = function (_length) {
            var value = this.popParseNumber();
            if (value > 9999)
                return false;
            if (value < 100)
                value = REWebUtils.DateUtils.ExpandTwoDigitYear(value);
            this.date.setFullYear(value);
            this.isYearParsed = true;
            return true;
        };
        DateFormatter.prototype.ParseHours = function (_length) {
            var value = this.popParseNumber();
            if (value > 23)
                return false;
            this.date.setHours(value);
            return true;
        };
        DateFormatter.prototype.ParseMinutes = function (_length) {
            var value = this.parseMinSecCore();
            if (value == -1)
                return false;
            this.date.setMinutes(value);
            return true;
        };
        DateFormatter.prototype.ParseSeconds = function (_length) {
            var value = this.parseMinSecCore();
            if (value == -1)
                return false;
            this.date.setSeconds(value);
            return true;
        };
        DateFormatter.prototype.ParseMs = function (length) {
            if (length > 3)
                length = 3;
            var thr = 1;
            for (var i = 0; i < length; i++)
                thr *= 10;
            thr -= 1;
            var value = this.popParseNumber();
            while (value > thr)
                value /= 10;
            this.date.setMilliseconds(Math.round(value));
            return true;
        };
        DateFormatter.prototype.ParseEra = function (_length) {
            return true;
        };
        DateFormatter.prototype.ParseAmPm = function (_length) {
            this.hasAmPm = REWebUtils.CultureInfo.am.length > 0 && REWebUtils.CultureInfo.pm.length > 0;
            return true;
        };
        DateFormatter.prototype.parseDecInt = function (str) {
            return parseInt(str, 10);
        };
        DateFormatter.prototype.padLeft = function (str, length) {
            while (str.length < length)
                str = "0" + str;
            return str;
        };
        DateFormatter.prototype.formatMs = function (length, trim) {
            var numVal = Math.floor(this.date.getMilliseconds() * Math.pow(10, length - 3));
            var value = this.padLeft(numVal.toString(), length);
            if (trim) {
                var pos = value.length - 1;
                var req = false;
                while (value.charAt(pos) == "0") {
                    req = true;
                    pos--;
                }
                if (req)
                    value = value.substring(0, pos + 1);
            }
            return value;
        };
        DateFormatter.prototype.parseMinSecCore = function () {
            var value = this.popParseNumber();
            return value > 59 ? -1 : value;
        };
        DateFormatter.prototype.fixHours = function () {
            var state = this.getAmPmState(this.strToParse, false);
            if (!state)
                return true;
            var h = this.date.getHours();
            switch (state) {
                case "P":
                    if (h > 12)
                        return false;
                    if (h < 12)
                        this.date.setHours(12 + h);
                    break;
                case "A":
                    if (h == 12)
                        this.date.setHours(0);
            }
            return true;
        };
        DateFormatter.prototype.getAmPmState = function (str, skipCorrection) {
            var am = REWebUtils.CultureInfo.am.charAt(0).toLowerCase();
            var pm = REWebUtils.CultureInfo.pm.charAt(0).toLowerCase();
            var amMatches = new RegExp(am, "gi").exec(str);
            var pmMatches = new RegExp(pm, "gi").exec(str);
            var amCount = amMatches ? amMatches.length : 0;
            var pmCount = pmMatches ? pmMatches.length : 0;
            var hasAm = amCount > 0;
            var hasPm = pmCount > 0;
            if (hasAm !== hasPm && amCount < 2 && pmCount < 2)
                return hasAm ? "A" : "P";
            if (!skipCorrection) {
                str = str.replace(new RegExp(this.getDayMonthNameReplacePattern(), "gi"), "");
                return this.getAmPmState(str, true);
            }
            return null;
        };
        DateFormatter.prototype.getDayMonthNameReplacePattern = function () {
            if (!this.dayMonthNameReplacePattern)
                return this.createDayMonthNameReplacePattern();
            return this.dayMonthNameReplacePattern;
        };
        DateFormatter.prototype.createDayMonthNameReplacePattern = function () {
            var parts = [];
            parts.push("(?:");
            parts.push(this.createReplacePattern(REWebUtils.CultureInfo.monthNames));
            parts.push(this.createReplacePattern(REWebUtils.CultureInfo.genMonthNames));
            parts.push(this.createReplacePattern(REWebUtils.CultureInfo.abbrMonthNames));
            parts.push(this.createReplacePattern(REWebUtils.CultureInfo.abbrDayNames));
            parts.push(this.createReplacePattern(REWebUtils.CultureInfo.dayNames));
            parts.push(")");
            return parts.join("");
        };
        DateFormatter.prototype.createReplacePattern = function (names) {
            return names && names.length > 0 ? "\\b" + names.join("\\b|\\b") + "\\b" : "";
        };
        DateFormatter.prototype.IsNumericSpecifier = function (sp) {
            var ch = sp.charAt(0);
            if (ch == "g" || ch == "t" || ((ch == "M" || ch == "d") && sp.length > 2))
                return false;
            return true;
        };
        DateFormatter.prototype.IsKnownSpecifier = function (sp) {
            if (sp.length > 1)
                sp = sp.charAt(0);
            for (var i = 0; i < this.knownSpecifiers.length; i++) {
                if (this.knownSpecifiers[i] == sp)
                    return true;
            }
            return false;
        };
        return DateFormatter;
    }());
    REWebUtils.DateFormatter = DateFormatter;
    var DateUtils = (function () {
        function DateUtils() {
        }
        DateUtils.FixTimezoneGap = function (oldDate, newDate) {
            var diff = newDate.getHours() - oldDate.getHours();
            if (diff == 0)
                return;
            var sign = (diff == 1 || diff == -23) ? -1 : 1;
            var trial = new Date(newDate.getTime() + sign * 3600000);
            var isDateChangedAsExpected = newDate.getHours() - trial.getHours() === diff;
            if (isDateChangedAsExpected && (sign > 0 || trial.getDate() == newDate.getDate()))
                newDate.setTime(trial.getTime());
        };
        DateUtils.ExpandTwoDigitYear = function (value) {
            value += 1900;
            if (value + 99 < REWebUtils.CultureInfo.twoDigitYearMax)
                value += 100;
            return value;
        };
        DateUtils.ToUtcTime = function (date) {
            var result = new Date();
            result.setTime(date.valueOf() + REWebUtils.DateUtils.GetTimeZoneOffset(date));
            return result;
        };
        DateUtils.GetTimeZoneOffset = function (date) {
            var utcFullYear = date.getUTCFullYear();
            var utcDate = new Date(utcFullYear, date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());
            if (utcFullYear < 100)
                utcDate.setFullYear(utcFullYear);
            return utcDate.valueOf() - date.valueOf();
        };
        return DateUtils;
    }());
    REWebUtils.DateUtils = DateUtils;
})(REWebUtils || (REWebUtils = {}));
var REWebUtils;
(function (REWebUtils) {
    var Formatter = (function () {
        function Formatter() {
        }
        Formatter.Format = function (pattern) {
            var args = [];
            for (var _i = 1; _i < arguments.length; _i++) {
                args[_i - 1] = arguments[_i];
            }
            var bag = [];
            var pos = 0;
            var savedPos = 0;
            while (pos < pattern.length) {
                var ch = pattern.charAt(pos);
                pos++;
                if (ch == '{') {
                    bag.push(pattern.substr(savedPos, pos - savedPos - 1));
                    if (pattern.charAt(pos) == "{") {
                        savedPos = pos;
                        pos++;
                        continue;
                    }
                    var spec = Formatter.ParseSpec(pattern, pos);
                    var pos = spec.pos;
                    var arg = args[spec.index];
                    var argString;
                    if (arg == null) {
                        argString = "";
                    }
                    else if (typeof arg == "number") {
                        argString = REWebUtils.NumberFormatter.Format(spec.format, arg);
                    }
                    else if (arg.constructor == Date) {
                        if (spec.format != Formatter.activeDateFormat) {
                            Formatter.activeDateFormat = spec.format;
                            if (spec.format == "")
                                spec.format = "G";
                            if (spec.format.length == 1)
                                spec.format = REWebUtils.DateFormatter.ExpandPredefinedFormat(spec.format);
                            Formatter.GetDateFormatter().SetFormatString(spec.format);
                        }
                        if (Formatter.activeDateFormat == "U")
                            arg = REWebUtils.DateUtils.ToUtcTime(arg);
                        argString = Formatter.GetDateFormatter().Format(arg);
                    }
                    else {
                        argString = String(arg);
                        if (spec.format != "" && argString.length > 0) {
                            var num = Number(argString.replace(",", "."));
                            if (!isNaN(num))
                                argString = REWebUtils.NumberFormatter.Format(spec.format, num);
                        }
                    }
                    var padLen = spec.width - argString.length;
                    if (padLen > 0) {
                        if (spec.left)
                            bag.push(argString);
                        for (var i = 0; i < padLen; i++)
                            bag.push(" ");
                        if (!spec.left)
                            bag.push(argString);
                    }
                    else {
                        bag.push(argString);
                    }
                    savedPos = pos;
                }
                else if (ch == "}" && pos < pattern.length && pattern.charAt(pos) == "}") {
                    bag.push(pattern.substr(savedPos, pos - savedPos - 1));
                    savedPos = pos;
                    pos++;
                }
                else if (ch == "}") {
                    return "";
                }
            }
            if (savedPos < pattern.length)
                bag.push(pattern.substr(savedPos));
            return bag.join("");
        };
        Formatter.ParseSpec = function (format, pos) {
            var result = {
                index: -1,
                left: false,
                width: 0,
                format: "",
                pos: 0
            };
            var savedPos, ch;
            savedPos = pos;
            while (true) {
                ch = format.charAt(pos);
                if (ch < "0" || ch > "9")
                    break;
                pos++;
            }
            if (pos > savedPos)
                result.index = Number(format.substr(savedPos, pos - savedPos));
            if (format.charAt(pos) == ",") {
                pos++;
                while (true) {
                    ch = format.charAt(pos);
                    if (ch != " " && ch != "\t")
                        break;
                    pos++;
                }
                result.left = format.charAt(pos) == "-";
                if (result.left)
                    pos++;
                savedPos = pos;
                while (true) {
                    ch = format.charAt(pos);
                    if (ch < "0" || ch > "9")
                        break;
                    pos++;
                }
                if (pos > savedPos)
                    result.width = Number(format.substr(savedPos, pos - savedPos));
            }
            if (format.charAt(pos) == ":") {
                pos++;
                savedPos = pos;
                while (format.charAt(pos) != "}")
                    pos++;
                result.format = format.substr(savedPos, pos - savedPos);
            }
            pos++;
            result.pos = pos;
            return result;
        };
        ;
        Formatter.GetDateFormatter = function () {
            if (!Formatter.__dateFormatter)
                Formatter.__dateFormatter = new REWebUtils.DateFormatter();
            return Formatter.__dateFormatter;
        };
        Formatter.activeDateFormat = null;
        return Formatter;
    }());
    REWebUtils.Formatter = Formatter;
    ;
})(REWebUtils || (REWebUtils = {}));
var REWebUtils;
(function (REWebUtils) {
    var NumberFormatter = (function () {
        function NumberFormatter() {
        }
        NumberFormatter.Format = function (format, value) {
            if (isNaN(value))
                return REWebUtils.CultureInfo.numNan;
            if (!isFinite(value)) {
                return value > 0
                    ? REWebUtils.CultureInfo.numPosInf
                    : REWebUtils.CultureInfo.numNegInf;
            }
            NumberFormatter.FillFormatInfo(format);
            if (NumberFormatter.spec == "X")
                return NumberFormatter.FormatHex(value);
            NumberFormatter.FillDigitInfo(value);
            switch (NumberFormatter.spec) {
                case "C":
                    return NumberFormatter.FormatCurrency();
                case "D":
                    return NumberFormatter.FormatDecimal();
                case "E":
                    return NumberFormatter.FormatExp();
                case "F":
                    return NumberFormatter.FormatFixed();
                case "G":
                    return NumberFormatter.FormatGeneral();
                case "N":
                    return NumberFormatter.FormatNumber();
                case "P":
                    return NumberFormatter.FormatPercent();
                default:
                    if (NumberFormatter.custom)
                        return NumberFormatter.FormatCustom(format);
                    return "?";
            }
        };
        NumberFormatter.FormatCurrency = function () {
            if (NumberFormatter.prec < 0)
                NumberFormatter.prec = REWebUtils.CultureInfo.currPrec;
            NumberFormatter.Round(NumberFormatter.prec);
            var bag = [];
            if (NumberFormatter.positive) {
                switch (REWebUtils.CultureInfo.currPosPattern) {
                    case 0:
                        bag.push(REWebUtils.CultureInfo.currency);
                        break;
                    case 2:
                        bag.push(REWebUtils.CultureInfo.currency, " ");
                        break;
                }
            }
            else {
                switch (REWebUtils.CultureInfo.currNegPattern) {
                    case 0:
                        bag.push("(", REWebUtils.CultureInfo.currency);
                        break;
                    case 1:
                        bag.push("-", REWebUtils.CultureInfo.currency);
                        break;
                    case 2:
                        bag.push(REWebUtils.CultureInfo.currency, "-");
                        break;
                    case 3:
                        bag.push(REWebUtils.CultureInfo.currency);
                        break;
                    case 4:
                        bag.push("(");
                        break;
                    case 5:
                    case 8:
                        bag.push("-");
                        break;
                    case 9:
                        bag.push("-", REWebUtils.CultureInfo.currency, " ");
                        break;
                    case 11:
                        bag.push(REWebUtils.CultureInfo.currency, " ");
                        break;
                    case 12:
                        bag.push(REWebUtils.CultureInfo.currency, " -");
                        break;
                    case 14:
                        bag.push("(", REWebUtils.CultureInfo.currency, " ");
                        break;
                    case 15:
                        bag.push("(");
                        break;
                }
            }
            NumberFormatter.AppendGroupedInteger(bag, REWebUtils.CultureInfo.currGroups, REWebUtils.CultureInfo.currGroupSeparator);
            if (NumberFormatter.prec > 0) {
                bag.push(REWebUtils.CultureInfo.currDecimalPoint);
                NumberFormatter.AppendDigits(bag, NumberFormatter.pointPos, NumberFormatter.pointPos + NumberFormatter.prec);
            }
            if (NumberFormatter.positive) {
                switch (REWebUtils.CultureInfo.currPosPattern) {
                    case 1:
                        bag.push(REWebUtils.CultureInfo.currency);
                        break;
                    case 3:
                        bag.push(" ", REWebUtils.CultureInfo.currency);
                        break;
                }
            }
            else {
                switch (REWebUtils.CultureInfo.currNegPattern) {
                    case 0:
                    case 14:
                        bag.push(")");
                        break;
                    case 3:
                        bag.push("-");
                        break;
                    case 4:
                        bag.push(REWebUtils.CultureInfo.currency, ")");
                        break;
                    case 5:
                        bag.push(REWebUtils.CultureInfo.currency);
                        break;
                    case 6:
                        bag.push("-", REWebUtils.CultureInfo.currency);
                        break;
                    case 7:
                        bag.push(REWebUtils.CultureInfo.currency, "-");
                        break;
                    case 8:
                        bag.push(" ", REWebUtils.CultureInfo.currency);
                        break;
                    case 10:
                        bag.push(" ", REWebUtils.CultureInfo.currency, "-");
                        break;
                    case 11:
                        bag.push("-");
                        break;
                    case 13:
                        bag.push("- ", REWebUtils.CultureInfo.currency);
                        break;
                    case 15:
                        bag.push(" ", REWebUtils.CultureInfo.currency, ")");
                        break;
                }
            }
            return bag.join("");
        };
        NumberFormatter.FormatDecimal = function () {
            if (NumberFormatter.prec < NumberFormatter.pointPos)
                NumberFormatter.prec = NumberFormatter.pointPos;
            if (NumberFormatter.prec < 1)
                return "0";
            var bag = [];
            if (!NumberFormatter.positive)
                bag.push("-");
            NumberFormatter.AppendDigits(bag, NumberFormatter.pointPos - NumberFormatter.prec, NumberFormatter.pointPos);
            return bag.join("");
        };
        NumberFormatter.FormatExp = function () {
            if (NumberFormatter.prec < 0)
                NumberFormatter.prec = 6;
            NumberFormatter.Round(1 - NumberFormatter.pointPos + NumberFormatter.prec);
            return NumberFormatter.FormatExpCore(3);
        };
        NumberFormatter.FormatExpCore = function (minExpDigits) {
            var bag = [];
            if (!NumberFormatter.positive)
                bag.push("-");
            NumberFormatter.AppendDigits(bag, 0, 1);
            if (NumberFormatter.prec > 0) {
                bag.push(REWebUtils.CultureInfo.numDecimalPoint);
                NumberFormatter.AppendDigits(bag, 1, 1 + NumberFormatter.prec);
            }
            bag.push(NumberFormatter.upper ? "E" : "e");
            var order = NumberFormatter.pointPos - 1;
            if (order >= 0) {
                bag.push("+");
            }
            else {
                bag.push("-");
                order = -order;
            }
            var orderStr = String(order);
            for (var i = orderStr.length; i < minExpDigits; i++)
                bag.push(0);
            bag.push(orderStr);
            return bag.join("");
        };
        NumberFormatter.FormatFixed = function () {
            if (NumberFormatter.prec < 0)
                NumberFormatter.prec = REWebUtils.CultureInfo.numPrec;
            NumberFormatter.Round(NumberFormatter.prec);
            var bag = [];
            if (!NumberFormatter.positive)
                bag.push("-");
            if (NumberFormatter.pointPos < 1)
                bag.push(0);
            else
                NumberFormatter.AppendDigits(bag, 0, NumberFormatter.pointPos);
            if (NumberFormatter.prec > 0) {
                bag.push(REWebUtils.CultureInfo.numDecimalPoint);
                NumberFormatter.AppendDigits(bag, NumberFormatter.pointPos, NumberFormatter.pointPos + NumberFormatter.prec);
            }
            return bag.join("");
        };
        NumberFormatter.FormatGeneral = function () {
            var hasFrac = NumberFormatter.pointPos < NumberFormatter.digits.length;
            var allowExp;
            if (NumberFormatter.prec < 0) {
                allowExp = hasFrac;
                NumberFormatter.prec = hasFrac ? 15 : 10;
            }
            else {
                allowExp = true;
                if (NumberFormatter.prec < 1)
                    NumberFormatter.prec = hasFrac ? 15 : 10;
                NumberFormatter.Round(NumberFormatter.prec - NumberFormatter.pointPos);
            }
            if (allowExp) {
                if (NumberFormatter.pointPos > NumberFormatter.prec || NumberFormatter.pointPos <= -4) {
                    NumberFormatter.prec = NumberFormatter.digits.length - 1;
                    return NumberFormatter.FormatExpCore(2);
                }
            }
            NumberFormatter.prec = Math.min(NumberFormatter.prec, Math.max(1, NumberFormatter.digits.length)) - NumberFormatter.pointPos;
            return NumberFormatter.FormatFixed();
        };
        NumberFormatter.FormatNumber = function () {
            if (NumberFormatter.prec < 0)
                NumberFormatter.prec = REWebUtils.CultureInfo.numPrec;
            NumberFormatter.Round(NumberFormatter.prec);
            var bag = [];
            if (!NumberFormatter.positive) {
                switch (REWebUtils.CultureInfo.numNegPattern) {
                    case 0:
                        bag.push("(");
                        break;
                    case 1:
                        bag.push("-");
                        break;
                    case 2:
                        bag.push("- ");
                        break;
                }
            }
            NumberFormatter.AppendGroupedInteger(bag, REWebUtils.CultureInfo.numGroups, REWebUtils.CultureInfo.numGroupSeparator);
            if (NumberFormatter.prec > 0) {
                bag.push(REWebUtils.CultureInfo.numDecimalPoint);
                NumberFormatter.AppendDigits(bag, NumberFormatter.pointPos, NumberFormatter.pointPos + NumberFormatter.prec);
            }
            if (!NumberFormatter.positive) {
                switch (REWebUtils.CultureInfo.numNegPattern) {
                    case 0:
                        bag.push(")");
                        break;
                    case 3:
                        bag.push("-");
                        break;
                    case 4:
                        bag.push(" -");
                        break;
                }
            }
            return bag.join("");
        };
        NumberFormatter.FormatPercent = function () {
            if (NumberFormatter.prec < 0)
                NumberFormatter.prec = REWebUtils.CultureInfo.numPrec;
            if (NumberFormatter.digits.length > 0)
                NumberFormatter.pointPos += 2;
            NumberFormatter.Round(NumberFormatter.prec);
            var bag = [];
            if (!NumberFormatter.positive)
                bag.push("-");
            if (REWebUtils.CultureInfo.percentPattern == 2)
                bag.push("%");
            NumberFormatter.AppendGroupedInteger(bag, REWebUtils.CultureInfo.numGroups, REWebUtils.CultureInfo.numGroupSeparator);
            if (NumberFormatter.prec > 0) {
                bag.push(REWebUtils.CultureInfo.numDecimalPoint);
                NumberFormatter.AppendDigits(bag, NumberFormatter.pointPos, NumberFormatter.pointPos + NumberFormatter.prec);
            }
            switch (REWebUtils.CultureInfo.percentPattern) {
                case 0:
                    bag.push(" %");
                    break;
                case 1:
                    bag.push("%");
                    break;
            }
            return bag.join("");
        };
        NumberFormatter.FormatHex = function (value) {
            var result = value.toString(16);
            if (result.indexOf("(") > -1)
                return result;
            result = NumberFormatter.upper ? result.toUpperCase() : result.toLowerCase();
            if (NumberFormatter.prec <= result.length)
                return result;
            var bag = [];
            for (var i = result.length; i < NumberFormatter.prec; i++)
                bag.push(0);
            bag.push(result);
            return bag.join("");
        };
        NumberFormatter.FormatCustom = function (format) {
            var sectionList = NumberFormatter.GetCustomFormatSections(format);
            var section = NumberFormatter.SelectCustomFormatSection(sectionList);
            if (section == "")
                return NumberFormatter.positive ? "" : "-";
            var info = NumberFormatter.ParseCustomFormatSection(section);
            var lists = NumberFormatter.CreateCustomFormatLists(info);
            if (sectionList.length > 2 && section != sectionList[2]) {
                var zero = lists.i.concat(lists.f).join("").split("0").join("") == "";
                if (zero) {
                    section = sectionList[2];
                    info = NumberFormatter.ParseCustomFormatSection(section);
                    lists = NumberFormatter.CreateCustomFormatLists(info);
                }
            }
            return NumberFormatter.FormatCustomCore(section, info, lists);
        };
        NumberFormatter.GetCustomFormatSections = function (format) {
            var sections = [];
            var escaping = false;
            var quote = "";
            var length = 0;
            var prevPos = 0;
            for (var i = 0; i < format.length; i++) {
                var ch = format.charAt(i);
                if (!escaping && quote == "" && ch == ";") {
                    sections.push(format.substr(prevPos, length));
                    length = 0;
                    prevPos = i + 1;
                    if (sections.length > 2)
                        break;
                }
                else {
                    if (escaping)
                        escaping = false;
                    else if (ch == quote)
                        quote = quote == "" ? ch : "";
                    else if (ch == "\\")
                        escaping = true;
                    else if (ch == "'" || ch == '"')
                        quote = ch;
                    ++length;
                }
            }
            if (length > 0)
                sections.push(format.substr(prevPos, length));
            if (sections.length < 1)
                sections.push(format);
            return sections;
        };
        NumberFormatter.SelectCustomFormatSection = function (sections) {
            if (!NumberFormatter.positive && sections.length > 1 && sections[1] != "") {
                NumberFormatter.positive = true;
                return sections[1];
            }
            if (NumberFormatter.digits.length < 1 && sections.length > 2 && sections[2] != "")
                return sections[2];
            return sections[0];
        };
        NumberFormatter.CreateCustomFormatInfo = function () {
            return {
                pointPos: -1,
                grouping: false,
                exp: false,
                expShowPlus: false,
                percent: false,
                scaling: 0,
                intDigits: 0,
                fracDigits: 0,
                expDigits: 0,
                intSharps: 0,
                fracSharps: 0,
                expSharps: 0
            };
        };
        NumberFormatter.ParseCustomFormatSection = function (section) {
            var quote = "";
            var area = "i";
            var canParseIntSharps = true;
            var result = NumberFormatter.CreateCustomFormatInfo();
            var groupSeparators = 0;
            for (var i = 0; i < section.length; i++) {
                var ch = section.charAt(i);
                if (ch == quote) {
                    quote = "";
                    continue;
                }
                if (quote != "")
                    continue;
                if (area == "e" && ch != "0" && ch != "#") {
                    area = result.pointPos < 0 ? "i" : "f";
                    i--;
                    continue;
                }
                switch (ch) {
                    case "\\":
                        i++;
                        continue;
                    case "'":
                    case '"':
                        quote = ch;
                        continue;
                    case "#":
                    case "0":
                        if (ch == "#") {
                            switch (area) {
                                case "i":
                                    if (canParseIntSharps)
                                        result.intSharps++;
                                    break;
                                case "f":
                                    result.fracSharps++;
                                    break;
                                case "e":
                                    result.expSharps++;
                                    break;
                            }
                        }
                        else {
                            canParseIntSharps = false;
                            switch (area) {
                                case "f":
                                    result.fracSharps = 0;
                                    break;
                                case "e":
                                    result.expSharps = 0;
                                    break;
                            }
                        }
                        switch (area) {
                            case "i":
                                result.intDigits++;
                                if (groupSeparators > 0)
                                    result.grouping = true;
                                groupSeparators = 0;
                                break;
                            case "f":
                                result.fracDigits++;
                                break;
                            case "e":
                                result.expDigits++;
                                break;
                        }
                        break;
                    case "e":
                    case "E":
                        if (result.exp)
                            break;
                        result.exp = true;
                        area = "e";
                        if (i < section.length - 1) {
                            var next = section.charAt(1 + i);
                            if (next == "+" || next == "-") {
                                if (next == "+")
                                    result.expShowPlus = true;
                                i++;
                            }
                            else if (next != "0" && next != "#") {
                                result.exp = false;
                                if (result.pointPos < 0)
                                    area = "i";
                            }
                        }
                        break;
                    case ".":
                        area = "f";
                        if (result.pointPos < 0)
                            result.pointPos = i;
                        break;
                    case "%":
                        result.percent = true;
                        break;
                    case ",":
                        if (area == "i" && result.intDigits > 0)
                            groupSeparators++;
                        break;
                    default:
                        break;
                }
            }
            if (result.expDigits < 1)
                result.exp = false;
            else
                result.intSharps = 0;
            if (result.fracDigits < 1)
                result.pointPos = -1;
            result.scaling = 3 * groupSeparators;
            return result;
        };
        NumberFormatter.CreateCustomFormatLists = function (info) {
            var intList = [];
            var fracList = [];
            var expList = [];
            if (NumberFormatter.digits.length > 0) {
                if (info.percent)
                    NumberFormatter.pointPos += 2;
                NumberFormatter.pointPos -= info.scaling;
            }
            var expPositive = true;
            if (info.exp && (info.intDigits > 0 || info.fracDigits > 0)) {
                var diff = 0;
                if (NumberFormatter.digits.length > 0) {
                    NumberFormatter.Round(info.intDigits + info.fracDigits - NumberFormatter.pointPos);
                    diff -= NumberFormatter.pointPos - info.intDigits;
                    NumberFormatter.pointPos = info.intDigits;
                }
                expPositive = diff <= 0;
                expList = String(diff < 0 ? -diff : diff).split("");
            }
            else {
                NumberFormatter.Round(info.fracDigits);
            }
            if (NumberFormatter.digits.length < 1 || NumberFormatter.pointPos < 1)
                intList = [0];
            else
                NumberFormatter.AppendDigits(intList, 0, NumberFormatter.pointPos);
            NumberFormatter.AppendDigits(fracList, NumberFormatter.pointPos, NumberFormatter.digits.length);
            if (info.exp) {
                while (intList.length < info.intDigits)
                    intList.unshift(0);
                while (expList.length < info.expDigits - info.expSharps)
                    expList.unshift(0);
                if (expPositive && info.expShowPlus)
                    expList.unshift("+");
                else if (!expPositive)
                    expList.unshift("-");
            }
            else {
                while (intList.length < info.intDigits - info.intSharps)
                    intList.unshift(0);
                if (info.intSharps >= info.intDigits) {
                    var zero = true;
                    for (var i = 0; i < intList.length; i++) {
                        if (intList[i] != 0) {
                            zero = false;
                            break;
                        }
                    }
                    if (zero)
                        intList = [];
                }
            }
            while (fracList.length < info.fracDigits - info.fracSharps)
                fracList.push(0);
            return {
                i: intList,
                f: fracList,
                e: expList
            };
        };
        NumberFormatter.FormatCustomCore = function (section, info, lists) {
            var intLen = 0;
            var total = 0;
            var groupIndex = 0;
            var counter = 0;
            var groupSize = 0;
            if (info.grouping && REWebUtils.CultureInfo.numGroups.length > 0) {
                intLen = lists.i.length;
                for (var i = 0; i < REWebUtils.CultureInfo.numGroups.length; i++) {
                    if (total + REWebUtils.CultureInfo.numGroups[i] <= intLen) {
                        total += REWebUtils.CultureInfo.numGroups[i];
                        groupIndex = i;
                    }
                }
                groupSize = REWebUtils.CultureInfo.numGroups[groupIndex];
                var fraction = intLen > total ? intLen - total : 0;
                if (groupSize == 0) {
                    while (groupIndex >= 0 && REWebUtils.CultureInfo.numGroups[groupIndex] == 0)
                        groupIndex--;
                    groupSize = fraction > 0 ? fraction : REWebUtils.CultureInfo.numGroups[groupIndex];
                }
                if (fraction == 0) {
                    counter = groupSize;
                }
                else {
                    groupIndex += Math.floor(fraction / groupSize);
                    counter = fraction % groupSize;
                    if (counter == 0)
                        counter = groupSize;
                    else
                        groupIndex++;
                }
            }
            else {
                info.grouping = false;
            }
            var bag = [];
            var area = "i";
            var intSharps = 0;
            var intListIndex = 0;
            var fracListIndex = 0;
            var savedCh = "";
            for (var i = 0; i < section.length; i++) {
                var ch = section.charAt(i);
                if (ch == savedCh) {
                    savedCh = "";
                    continue;
                }
                if (savedCh != "") {
                    bag.push(ch);
                    continue;
                }
                switch (ch) {
                    case "\\":
                        ++i;
                        if (i < section.length)
                            bag.push(section.charAt(i));
                        continue;
                    case "'":
                    case '"':
                        savedCh = ch;
                        continue;
                    case "#":
                    case "0":
                        if (area == "i") {
                            intSharps++;
                            if (ch == "0" || info.intDigits - intSharps < lists.i.length + intListIndex) {
                                while (info.intDigits - intSharps + intListIndex < lists.i.length) {
                                    bag.push(lists.i[intListIndex]);
                                    intListIndex++;
                                    if (info.grouping && --intLen > 0 && --counter == 0) {
                                        bag.push(REWebUtils.CultureInfo.numGroupSeparator);
                                        if (--groupIndex < REWebUtils.CultureInfo.numGroups.length && groupIndex >= 0)
                                            groupSize = REWebUtils.CultureInfo.numGroups[groupIndex];
                                        counter = groupSize;
                                    }
                                }
                            }
                        }
                        else if (area == "f") {
                            if (fracListIndex < lists.f.length) {
                                bag.push(lists.f[fracListIndex]);
                                fracListIndex++;
                            }
                        }
                        break;
                    case "e":
                    case "E":
                        if (lists.e == null || !info.exp) {
                            bag.push(ch);
                            break;
                        }
                        for (var q = i + 1; q < section.length; q++) {
                            if (q == i + 1 && (section.charAt(q) == "+" || section.charAt(q) == "-"))
                                continue;
                            if (section.charAt(q) == "0" || section.charAt(q) == "#")
                                continue;
                            break;
                        }
                        i = q - 1;
                        area = info.pointPos < 0 ? "i" : "f";
                        bag.push(ch);
                        bag = bag.concat(lists.e);
                        lists.e = null;
                        break;
                    case ".":
                        if (info.pointPos == i && lists.f.length > 0)
                            bag.push(REWebUtils.CultureInfo.numDecimalPoint);
                        area = "f";
                        break;
                    case ",":
                        break;
                    default:
                        bag.push(ch);
                        break;
                }
            }
            if (!NumberFormatter.positive)
                bag.unshift("-");
            return bag.join("");
        };
        NumberFormatter.FillDigitInfo = function (value) {
            NumberFormatter.positive = true;
            if (value < 0) {
                value = -value;
                NumberFormatter.positive = false;
            }
            NumberFormatter.digits = [];
            NumberFormatter.pointPos = 0;
            if (value == 0 || !isFinite(value) || isNaN(value)) {
                NumberFormatter.pointPos = 1;
                return;
            }
            var list = String(value).split("e");
            var str = list[0];
            if (list.length > 1) {
                NumberFormatter.pointPos = Number(list[1]);
            }
            var frac = false;
            var decimalCount = 0;
            for (var i = 0; i < str.length; i++) {
                var ch = str.charAt(i);
                if (ch == ".") {
                    frac = true;
                }
                else {
                    if (frac)
                        decimalCount++;
                    if (ch != "0" || NumberFormatter.digits.length > 0)
                        NumberFormatter.digits.push(Number(ch));
                }
            }
            NumberFormatter.pointPos += NumberFormatter.digits.length - decimalCount;
        };
        NumberFormatter.FillFormatInfo = function (format) {
            NumberFormatter.upper = true;
            NumberFormatter.custom = false;
            NumberFormatter.prec = -1;
            var spec;
            if (format == null || format.length < 1)
                spec = "G";
            else
                spec = format.charAt(0);
            if (spec >= "a" && spec <= "z") {
                spec = spec.toUpperCase();
                NumberFormatter.upper = false;
            }
            if (spec >= "A" && spec <= "Z") {
                if (format != null && format.length > 1) {
                    var prec = Number(format.substr(1));
                    if (!isNaN(prec))
                        NumberFormatter.prec = prec;
                    else
                        NumberFormatter.custom = true;
                }
            }
            else {
                NumberFormatter.custom = true;
            }
            NumberFormatter.spec = NumberFormatter.custom ? "0" : spec;
        };
        NumberFormatter.Round = function (shift) {
            var amount = NumberFormatter.digits.length - NumberFormatter.pointPos - shift;
            if (amount <= 0)
                return;
            var cutPos = NumberFormatter.pointPos + shift;
            if (cutPos < 0) {
                NumberFormatter.digits = [];
                NumberFormatter.pointPos = 0;
                return;
            }
            var digit = NumberFormatter.digits[cutPos];
            if (digit > 4) {
                for (var i = 0; i < amount; i++) {
                    var index = cutPos - 1 - i;
                    if (index < 0) {
                        NumberFormatter.digits.unshift(0);
                        NumberFormatter.pointPos++;
                        cutPos++;
                        index++;
                    }
                    digit = NumberFormatter.digits[index];
                    if (digit < 9) {
                        NumberFormatter.digits[index] = 1 + digit;
                        break;
                    }
                    else {
                        NumberFormatter.digits[index] = 0;
                        amount++;
                    }
                }
            }
            for (var i = cutPos - 1; i >= 0; i--) {
                if (NumberFormatter.digits[i] > 0)
                    break;
                cutPos--;
            }
            NumberFormatter.digits.splice(cutPos, NumberFormatter.digits.length - cutPos);
        };
        NumberFormatter.AppendGroupedInteger = function (list, groups, separator) {
            if (NumberFormatter.pointPos < 1) {
                list.push(0);
                return;
            }
            var total = 0;
            var groupIndex = 0;
            for (var i = 0; i < groups.length; i++) {
                if (total + groups[i] <= NumberFormatter.pointPos) {
                    total += groups[i];
                    groupIndex = i;
                }
                else
                    break;
            }
            if (groups.length > 0 && total > 0) {
                var counter;
                var groupSize = groups[groupIndex];
                var fraction = NumberFormatter.pointPos > total ? NumberFormatter.pointPos - total : 0;
                if (groupSize == 0) {
                    while (groupIndex >= 0 && groups[groupIndex] == 0)
                        groupIndex--;
                    groupSize = fraction > 0 ? fraction : groups[groupIndex];
                }
                if (fraction == 0) {
                    counter = groupSize;
                }
                else {
                    groupIndex += Math.floor(fraction / groupSize);
                    counter = fraction % groupSize;
                    if (counter == 0)
                        counter = groupSize;
                    else
                        groupIndex++;
                }
                var i = 0;
                while (true) {
                    if (NumberFormatter.pointPos - i <= counter || counter == 0) {
                        NumberFormatter.AppendDigits(list, i, NumberFormatter.pointPos);
                        break;
                    }
                    NumberFormatter.AppendDigits(list, i, i + counter);
                    list.push(separator);
                    i += counter;
                    groupIndex--;
                    if (groupIndex < groups.length && groupIndex >= 0)
                        groupSize = groups[groupIndex];
                    counter = groupSize;
                }
            }
            else {
                NumberFormatter.AppendDigits(list, 0, NumberFormatter.pointPos);
            }
        };
        NumberFormatter.AppendDigits = function (list, start, end) {
            for (var i = start; i < end; i++) {
                if (i < 0 || i >= NumberFormatter.digits.length)
                    list.push(0);
                else
                    list.push(NumberFormatter.digits[i]);
            }
        };
        NumberFormatter.positive = true;
        NumberFormatter.digits = null;
        NumberFormatter.pointPos = 0;
        NumberFormatter.spec = "";
        NumberFormatter.prec = -1;
        NumberFormatter.upper = true;
        NumberFormatter.custom = false;
        return NumberFormatter;
    }());
    REWebUtils.NumberFormatter = NumberFormatter;
})(REWebUtils || (REWebUtils = {}));
var REWebUtils;
(function (REWebUtils) {
    var OfficeBuffer = (function () {
        function OfficeBuffer() {
        }
        OfficeBuffer.isBrowserSupportExtendedClientBuffer = function () {
            return REWebUtils.Browser.WebKitFamily || (REWebUtils.Browser.Firefox && REWebUtils.Browser.MajorVersion >= 50) || (REWebUtils.Browser.Edge && REWebUtils.Browser.MajorVersion >= 14);
        };
        OfficeBuffer.isBufferContainText = function (items) {
            if (this.isBrowserSupportExtendedClientBuffer()) {
                var len = items.length;
                while (len--) {
                    if (items[len].type.indexOf("text/plain") >= 0)
                        return true;
                }
            }
            return false;
        };
        OfficeBuffer.getBufferImage = function (items) {
            var len = items.length;
            while (len--) {
                if (items[len].type.indexOf("image") >= 0)
                    return items[len].getAsFile();
            }
            return null;
        };
        return OfficeBuffer;
    }());
    REWebUtils.OfficeBuffer = OfficeBuffer;
})(REWebUtils || (REWebUtils = {}));
var REWebUtils;
(function (REWebUtils) {
    var OfficeHandlerUtils = (function () {
        function OfficeHandlerUtils() {
        }
        OfficeHandlerUtils.getHandlerResourceUrl = function (pageUrl) {
            var url = pageUrl ? pageUrl : document.URL;
            if (url.indexOf("?") != -1)
                url = url.substring(0, url.indexOf("?"));
            if (url.indexOf("#") != -1)
                url = url.substring(0, url.indexOf("#"));
            if (/.*\.aspx$/.test(url))
                url = url.substring(0, url.lastIndexOf("/") + 1);
            else if (url.lastIndexOf("/") != url.length - 1)
                url += "/";
            return url;
        };
        return OfficeHandlerUtils;
    }());
    REWebUtils.OfficeHandlerUtils = OfficeHandlerUtils;
})(REWebUtils || (REWebUtils = {}));
var REWebUtils;
(function (REWebUtils) {
    var PopupUtils = (function () {
        function PopupUtils() {
        }
        PopupUtils.PreventContextMenu = function (evt) {
            if (evt.stopPropagation)
                evt.stopPropagation();
            if (evt.preventDefault)
                evt.preventDefault();
            if (REWebUtils.Browser.WebKitFamily)
                evt.returnValue = false;
        };
        return PopupUtils;
    }());
    REWebUtils.PopupUtils = PopupUtils;
})(REWebUtils || (REWebUtils = {}));
var REWebUtils;
(function (REWebUtils) {
    var Url = (function () {
        function Url() {
        }
        Url.Navigate = function (url, target) {
            var javascriptPrefix = "javascript:";
            if (!url || url === "")
                return;
            else if (url.indexOf(javascriptPrefix) != -1)
                eval(url.substr(javascriptPrefix.length));
            else {
                try {
                    if (target != "")
                        Url.navigateTo(url, target);
                    else
                        location.href = url;
                }
                catch (e) {
                }
            }
        };
        Url.navigateTo = function (url, target) {
            var lowerCaseTarget = target.toLowerCase();
            if ("_top" == lowerCaseTarget)
                top.location.href = url;
            else if ("_self" == lowerCaseTarget)
                location.href = url;
            else if ("_search" == lowerCaseTarget)
                Url.openInNewWindow(url);
            else if ("_media" == lowerCaseTarget)
                Url.openInNewWindow(url);
            else if ("_parent" == lowerCaseTarget)
                window.parent.location.href = url;
            else if ("_blank" == lowerCaseTarget)
                Url.openInNewWindow(url);
            else {
                var frame = Url.getFrame(top.frames, target);
                if (frame != null)
                    frame.location.href = url;
                else
                    Url.openInNewWindow(url);
            }
        };
        Url.openInNewWindow = function (url) {
            if (REWebUtils.Browser.Safari)
                Url.openInNewWindowViaIframe(url);
            else {
                var newWindow = window.open();
                newWindow.opener = null;
                newWindow.location = url;
            }
        };
        Url.openInNewWindowViaIframe = function (url) {
            var iframe = document.createElement('iframe');
            iframe.style.display = 'none';
            document.body.appendChild(iframe);
            var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
            var openArgs = '"' + url + '"';
            var script = iframeDoc.createElement('script');
            script.type = 'text/javascript';
            script.text = 'window.parent = null; ' +
                'window.top = null;' +
                'window.frameElement = null;' +
                'var child = window.open(' + openArgs + ');' +
                'child.opener = null';
            iframeDoc.body.appendChild(script);
            document.body.removeChild(iframe);
        };
        Url.getFrame = function (frames, name) {
            if (frames[name])
                return frames[name];
            for (var i = 0; i < frames.length; i++) {
                try {
                    var frame = frames[i];
                    if (frame.name == name)
                        return frame;
                    frame = Url.getFrame(frame.frames, name);
                    if (frame != null)
                        return frame;
                }
                catch (e) {
                }
            }
            return null;
        };
        return Url;
    }());
    REWebUtils.Url = Url;
})(REWebUtils || (REWebUtils = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var PrintLayoutViewCanvasListener = (function (_super) {
        __extends(PrintLayoutViewCanvasListener, _super);
        function PrintLayoutViewCanvasListener(viewManager, renderer) {
            var _this = _super.call(this, viewManager, renderer) || this;
            _this.handledPageIndexes = [];
            return _this;
        }
        PrintLayoutViewCanvasListener.prototype.onPagesReady = function (pageChanges) {
            var _this = this;
            var updatedTypePageChanges = [];
            var otherTypePageChanges = [];
            for (var _i = 0, pageChanges_3 = pageChanges; _i < pageChanges_3.length; _i++) {
                var pageChange = pageChanges_3[_i];
                if (pageChange.changeType == __aspxRichEdit.LayoutChangeType.Updated)
                    updatedTypePageChanges.push(pageChange);
                else
                    otherTypePageChanges.push(pageChange);
            }
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.CanvasManager, "onPagesReady - handled pages", __aspxRichEdit.LogListHelper.level_1(function (index) { return "" + index; }, this.handledPageIndexes, "\t", "\t"));
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.CanvasManager, "onPagesReady - pageFlags\n", __aspxRichEdit.LogListHelper.level_1(function (page) { return "" + __aspxRichEdit.Log.mask(__aspxRichEdit.LayoutPageFlags, page.flags.getValue()); }, this.viewManager.layout.pages, "\t", "\n"));
            if (otherTypePageChanges.length > 0) {
                for (var _a = 0, otherTypePageChanges_1 = otherTypePageChanges; _a < otherTypePageChanges_1.length; _a++) {
                    var pageChange = otherTypePageChanges_1[_a];
                    var pageIndex = pageChange.index;
                    var layoutPage = this.viewManager.layout.pages[pageIndex];
                    switch (pageChange.changeType) {
                        case __aspxRichEdit.LayoutChangeType.Inserted:
                            this.viewManager.renderer.renderPage(layoutPage, pageIndex, false);
                            layoutPage.flags.set(__aspxRichEdit.LayoutPageFlags.ContentRendered, false);
                            this.viewManager.adjust(false);
                            break;
                        case __aspxRichEdit.LayoutChangeType.Deleted:
                            this.renderer.removePage(pageIndex);
                            break;
                        case __aspxRichEdit.LayoutChangeType.Replaced:
                            if (layoutPage.flags.get(__aspxRichEdit.LayoutPageFlags.ContentRendered))
                                layoutPage.flags.set(__aspxRichEdit.LayoutPageFlags.NeedDeleteContent, true);
                            this.renderer.renderPage(layoutPage, pageIndex, false);
                            layoutPage.flags.set(__aspxRichEdit.LayoutPageFlags.ContentRendered, false);
                            break;
                        default: throw new Error(__aspxRichEdit.Errors.NotImplemented);
                    }
                }
                this.updateVisiblePages();
                this.viewManager.canvasScrollManager.updateScrollVisibility();
            }
            for (var _b = 0, updatedTypePageChanges_1 = updatedTypePageChanges; _b < updatedTypePageChanges_1.length; _b++) {
                var pageChange = updatedTypePageChanges_1[_b];
                var layoutPage = this.layout.pages[pageChange.index];
                if (!layoutPage.flags.get(__aspxRichEdit.LayoutPageFlags.ContentRendered))
                    continue;
                __aspxRichEdit.CanvasListener.mergeInnerPageChanges(pageChange);
                this.renderer.applyPageChange(layoutPage, pageChange);
                this.viewManager.changeActiveSubDocumentRenderer.updatePage(this.viewManager.selection.layoutSelection, layoutPage.index);
            }
            this.handleDeferredPagesOperations();
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.DiplayPageInfo, "", function () { return __aspxRichEdit.ListUtils.map(pageChanges, function (p) { if (p.changeType == __aspxRichEdit.LayoutChangeType.Deleted)
                __aspxRichEdit.PageVisibleInfoHelper.hidePageVisibleInfoElement(p.index);
            else
                __aspxRichEdit.PageVisibleInfoHelper.showPageVisibleInfoElement(_this.viewManager.cache, function () { return "pageIndex=" + p.index; }, p.index); }); });
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.DiplayTableBoundsInfo, "", function () { return __aspxRichEdit.ListUtils.map(pageChanges, function (p) { if (p.changeType == __aspxRichEdit.LayoutChangeType.Deleted)
                __aspxRichEdit.Log.visualizerManager.hide(__aspxRichEdit.DebugVisualizerType.TableBounds, p.index);
            else
                __aspxRichEdit.Log.visualizerManager.show(__aspxRichEdit.DebugVisualizerType.TableBounds, _this.layout, p.index); }); });
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.DiplayLayoutBoundsInfo, "", function () { return __aspxRichEdit.ListUtils.map(pageChanges, function (p) { if (p.changeType == __aspxRichEdit.LayoutChangeType.Deleted)
                __aspxRichEdit.Log.visualizerManager.hide(__aspxRichEdit.DebugVisualizerType.LayoutBounds, p.index);
            else
                __aspxRichEdit.Log.visualizerManager.show(__aspxRichEdit.DebugVisualizerType.LayoutBounds, _this.layout, p.index); }); });
        };
        PrintLayoutViewCanvasListener.prototype.updateVisiblePages = function () {
            var pages = this.layout.pages;
            this.viewManager.scroll.updatePageIndexesInfo(pages);
            var renderInterval = this.viewManager.scroll.renderPageIndexInterval();
            for (var _i = 0, _a = this.handledPageIndexes; _i < _a.length; _i++) {
                var pageIndex = _a[_i];
                if (!renderInterval.contains(pageIndex)) {
                    var page = pages[pageIndex];
                    if (page) {
                        page.flags.set(__aspxRichEdit.LayoutPageFlags.NeedDeleteContent, true);
                        page.flags.set(__aspxRichEdit.LayoutPageFlags.MustBeRendered, false);
                    }
                }
            }
            var endPageIndex = Math.min(renderInterval.end - 1, this.layout.pages.length - 1);
            for (var pageIndex = renderInterval.start; pageIndex <= endPageIndex; pageIndex++) {
                var page = pages[pageIndex];
                if (!page.flags.get(__aspxRichEdit.LayoutPageFlags.ContentRendered)) {
                    page.flags.set(__aspxRichEdit.LayoutPageFlags.NeedRenderContent, true);
                    page.flags.set(__aspxRichEdit.LayoutPageFlags.MustBeRendered, true);
                    this.handledPageIndexes.push(pageIndex);
                }
            }
        };
        PrintLayoutViewCanvasListener.prototype.handleDeferredPagesOperations = function () {
            var pages = this.layout.pages;
            var visiblePages = [];
            this.handledPageIndexes.sort(__aspxRichEdit.CompareUtils.numberCmpFunc);
            var prevPageIndex = -1;
            for (var _i = 0, _a = this.handledPageIndexes; _i < _a.length; _i++) {
                var pageIndex = _a[_i];
                if (pageIndex == prevPageIndex)
                    continue;
                var page = pages[pageIndex];
                if (!page)
                    continue;
                this.handlePageFlags(page);
                if (page.flags.get(__aspxRichEdit.LayoutPageFlags.MustBeRendered))
                    visiblePages.push(pageIndex);
                prevPageIndex = pageIndex;
            }
            this.handledPageIndexes = visiblePages;
        };
        PrintLayoutViewCanvasListener.prototype.handlePageFlags = function (page) {
            var isNeedDeleteContent = page.flags.get(__aspxRichEdit.LayoutPageFlags.NeedDeleteContent);
            if (page.index >= this.layout.validPageCount) {
                if (isNeedDeleteContent) {
                    __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.CanvasManager, "handleDeferredPagesOperations", "pageIndex: " + page.index + " content deleted");
                    this.renderer.renderPage(page, page.index, false);
                    page.flags.set(__aspxRichEdit.LayoutPageFlags.ContentRendered, false);
                    page.flags.set(__aspxRichEdit.LayoutPageFlags.NeedDeleteContent, false);
                    page.flags.set(__aspxRichEdit.LayoutPageFlags.IsSelectionRendered, false);
                    page.flags.set(__aspxRichEdit.LayoutPageFlags.IsMisspelledSelectionRendered, false);
                }
                return;
            }
            var isContentRendered = page.flags.get(__aspxRichEdit.LayoutPageFlags.ContentRendered);
            var isNeedRenderContent = page.flags.get(__aspxRichEdit.LayoutPageFlags.NeedRenderContent);
            var callRender = isNeedDeleteContent || isNeedRenderContent;
            if (callRender) {
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.CanvasManager, "handlePageFlags", "pageIndex: " + page.index + " content " + (isNeedRenderContent ? "rendered" : "deleted"));
                this.renderer.renderPage(page, page.index, isNeedRenderContent);
                this.viewManager.changeActiveSubDocumentRenderer.updatePage(this.viewManager.selection.layoutSelection, page.index);
            }
            page.flags.set(__aspxRichEdit.LayoutPageFlags.ContentRendered, isNeedRenderContent || !callRender && isContentRendered);
            page.flags.set(__aspxRichEdit.LayoutPageFlags.NeedDeleteContent, false);
            page.flags.set(__aspxRichEdit.LayoutPageFlags.NeedRenderContent, false);
            if (callRender) {
                page.flags.set(__aspxRichEdit.LayoutPageFlags.IsSelectionRendered, false);
                page.flags.set(__aspxRichEdit.LayoutPageFlags.IsMisspelledSelectionRendered, false);
            }
        };
        PrintLayoutViewCanvasListener.prototype.updateVisibleParts = function () {
            this.updateVisiblePages();
            this.handleDeferredPagesOperations();
        };
        PrintLayoutViewCanvasListener.prototype.onCanvasScroll = function () {
            this.updateVisibleParts();
            for (var _i = 0, _a = this.handledPageIndexes; _i < _a.length; _i++) {
                var visiblePageIndex = _a[_i];
                this.viewManager.selection.renderAllPageSelection(this.layout, visiblePageIndex, false);
                this.viewManager.searchSelection.renderAllPageSelection(this.layout, visiblePageIndex, false);
                this.viewManager.misspelledSelection.renderAllPageSelection(this.layout, visiblePageIndex, false);
                this.viewManager.rangePermission.renderAllPageSelection(this.layout, visiblePageIndex, false);
            }
        };
        return PrintLayoutViewCanvasListener;
    }(__aspxRichEdit.CanvasListener));
    __aspxRichEdit.PrintLayoutViewCanvasListener = PrintLayoutViewCanvasListener;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SimpleViewChangesDataBase = (function () {
        function SimpleViewChangesDataBase(rows, tables, parFrames) {
            this.rows = rows;
            this.tables = tables;
            this.parFrames = parFrames;
        }
        return SimpleViewChangesDataBase;
    }());
    __aspxRichEdit.SimpleViewChangesDataBase = SimpleViewChangesDataBase;
    var SimpleViewChangesData = (function (_super) {
        __extends(SimpleViewChangesData, _super);
        function SimpleViewChangesData(rows, tables, parFrames, ancPictureObjs, ancTextBoxObjs) {
            var _this = _super.call(this, rows, tables, parFrames) || this;
            _this.ancPictureObjs = ancPictureObjs;
            _this.ancTextBoxObjs = ancTextBoxObjs;
            return _this;
        }
        return SimpleViewChangesData;
    }(SimpleViewChangesDataBase));
    __aspxRichEdit.SimpleViewChangesData = SimpleViewChangesData;
    var VisibleCanvasObjectsInfo = (function (_super) {
        __extends(VisibleCanvasObjectsInfo, _super);
        function VisibleCanvasObjectsInfo() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        return VisibleCanvasObjectsInfo;
    }(SimpleViewChangesData));
    __aspxRichEdit.VisibleCanvasObjectsInfo = VisibleCanvasObjectsInfo;
    var RenderedCanvasObjectsInfo = (function (_super) {
        __extends(RenderedCanvasObjectsInfo, _super);
        function RenderedCanvasObjectsInfo() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        return RenderedCanvasObjectsInfo;
    }(SimpleViewChangesData));
    __aspxRichEdit.RenderedCanvasObjectsInfo = RenderedCanvasObjectsInfo;
    var SimpleViewCanvasListener = (function (_super) {
        __extends(SimpleViewCanvasListener, _super);
        function SimpleViewCanvasListener() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SimpleViewCanvasListener.prototype.onPagesReady = function (pageChanges) {
            if (pageChanges.length > 1 && !__aspxRichEdit.ListUtils.allOf(pageChanges, function (c) { return c.changeType == __aspxRichEdit.LayoutChangeType.Deleted; }, 1))
                throw new Error(__aspxRichEdit.Errors.InternalException);
            if (this.layout.pages.length > 1)
                throw new Error(__aspxRichEdit.Errors.InternalException);
            var pageChange = pageChanges[0];
            if (pageChange) {
                var layoutPage = this.layout.pages[0];
                switch (pageChange.changeType) {
                    case __aspxRichEdit.LayoutChangeType.Inserted: {
                        if (!this.viewManager.sizes.isInitialized()) {
                            this.renderer.renderPage(layoutPage, 0, false);
                            this.viewManager.adjust(false);
                        }
                        this.renderer.pageInserted(layoutPage, this.getCurrentIndexes());
                        break;
                    }
                    case __aspxRichEdit.LayoutChangeType.Replaced: {
                        this.renderer.removePageContent(0);
                        this.renderer.renderPage(layoutPage, 0, false);
                        this.viewManager.adjust(false);
                        this.renderer.pageInserted(layoutPage, this.getCurrentIndexes());
                        break;
                    }
                    case __aspxRichEdit.LayoutChangeType.Updated: {
                        __aspxRichEdit.CanvasListener.mergeInnerPageChanges(pageChange);
                        this.renderer.pageUpdated(pageChange, this.getCurrentIndexes());
                        break;
                    }
                    case __aspxRichEdit.LayoutChangeType.Deleted: {
                        this.renderer.removePage(0);
                        break;
                    }
                }
            }
        };
        SimpleViewCanvasListener.prototype.getCurrentIndexes = function () {
            var layoutPage = this.layout.pages[0];
            var visibleInterval = this.viewManager.scroll.getVisibleInterval();
            var column = layoutPage.mainSubDocumentPageAreas[0].columns[0];
            var layoutRows = column.rows;
            var rI = this.determineVisibleObjectsForRows(layoutRows, visibleInterval);
            var tI = this.determineVisibleObjectsForTables(column.tablesInfo, visibleInterval);
            var pfI = this.determineVisibleObjects(column.paragraphFrames, visibleInterval);
            var ancPic = __aspxRichEdit.MapUtilsKeyAsNumber.reducedMap(layoutPage.anchoredObjectHolder.objects, function (fo, _id) {
                return fo.getType() == __aspxRichEdit.LayoutBoxType.AnchorPicture && __aspxRichEdit.IntervalAlgorithms.getIntersectionNonNullLength(fo.vertivalInterval, visibleInterval) ? fo : null;
            });
            var ancTB = __aspxRichEdit.MapUtilsKeyAsNumber.reducedMap(layoutPage.anchoredObjectHolder.objects, function (fo, _id) {
                return fo.getType() == __aspxRichEdit.LayoutBoxType.AnchorTextBox && __aspxRichEdit.IntervalAlgorithms.getIntersectionNonNullLength(fo.vertivalInterval, visibleInterval) ? fo : null;
            });
            return new VisibleCanvasObjectsInfo(rI, tI, pfI, ancPic, ancTB);
        };
        SimpleViewCanvasListener.prototype.determineVisibleObjects = function (objects, visibleInterval) {
            if (!objects.length)
                return new __aspxRichEdit.BoundaryInterval(-1, -1);
            var startIndex = Math.max(0, __aspxRichEdit.ListUtils.reverseIndexBy(objects, function (obj) { return !__aspxRichEdit.IntervalAlgorithms.getIntersection(obj.vertivalInterval, visibleInterval); }, __aspxRichEdit.Utils.normedInterpolationIndexOf(objects, function (obj) { return obj.y; }, visibleInterval.start) - 1));
            var minEndIndex = Math.max(startIndex, __aspxRichEdit.Utils.normedInterpolationIndexOf(objects, function (obj) { return obj.y; }, visibleInterval.end));
            for (var obj = void 0; obj = objects[minEndIndex]; minEndIndex++) {
                if (!__aspxRichEdit.IntervalAlgorithms.getIntersection(obj.vertivalInterval, visibleInterval)) {
                    minEndIndex++;
                    break;
                }
            }
            return new __aspxRichEdit.BoundaryInterval(startIndex, minEndIndex);
        };
        SimpleViewCanvasListener.prototype.determineVisibleObjectsForTables = function (objects, visibleInterval) {
            if (!objects.length)
                return new __aspxRichEdit.BoundaryInterval(-1, -1);
            var startIndex = Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(objects, function (obj) { return obj.y; }, visibleInterval.start));
            for (var obj = void 0; obj = objects[startIndex]; startIndex--) {
                if (!obj.logicInfo.grid.table.nestedLevel && !__aspxRichEdit.IntervalAlgorithms.getIntersection(obj.vertivalInterval, visibleInterval))
                    break;
            }
            startIndex = Math.max(0, startIndex);
            var minEndIndex = Math.max(startIndex, __aspxRichEdit.Utils.normedInterpolationIndexOf(objects, function (obj) { return obj.y; }, visibleInterval.end));
            for (var obj = void 0; obj = objects[minEndIndex]; minEndIndex++) {
                if (!__aspxRichEdit.IntervalAlgorithms.getIntersection(obj.vertivalInterval, visibleInterval)) {
                    minEndIndex++;
                    break;
                }
            }
            return new __aspxRichEdit.BoundaryInterval(startIndex, minEndIndex);
        };
        SimpleViewCanvasListener.prototype.determineVisibleObjectsForRows = function (rows, visibleInterval) {
            if (!rows.length)
                return new __aspxRichEdit.BoundaryInterval(-1, -1);
            var startIndex = Math.max(0, __aspxRichEdit.ListUtils.reverseIndexBy(rows, function (obj) { return obj.getBottomBoundPosition() < visibleInterval.start && !obj.tableCellInfo; }, __aspxRichEdit.Utils.normedInterpolationIndexOf(rows, function (obj) { return obj.y; }, visibleInterval.start) - 1));
            var endIndex = Math.max(startIndex, __aspxRichEdit.Utils.normedInterpolationIndexOf(rows, function (obj) { return obj.y; }, visibleInterval.end));
            for (var row = void 0; row = rows[endIndex]; endIndex++) {
                if (row.y > visibleInterval.end && !row.tableCellInfo) {
                    endIndex++;
                    break;
                }
            }
            return new __aspxRichEdit.BoundaryInterval(startIndex, endIndex);
        };
        SimpleViewCanvasListener.prototype.updateVisibleParts = function () {
            if (this.layout.pages.length)
                this.renderer.pageScrolled(this.layout.pages[0], this.getCurrentIndexes());
        };
        SimpleViewCanvasListener.prototype.onCanvasScroll = function () {
            this.updateVisibleParts();
        };
        return SimpleViewCanvasListener;
    }(__aspxRichEdit.CanvasListener));
    __aspxRichEdit.SimpleViewCanvasListener = SimpleViewCanvasListener;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Renderer;
    (function (Renderer) {
        var ChangeActiveSubDocument;
        (function (ChangeActiveSubDocument) {
            var FloatingPictureRenderer = (function (_super) {
                __extends(FloatingPictureRenderer, _super);
                function FloatingPictureRenderer() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                FloatingPictureRenderer.prototype.handlePageHide = function (_pageIndex) {
                    return true;
                };
                FloatingPictureRenderer.prototype.handlePageRender = function (pageIndex, _force) {
                    var _this = this;
                    var cacheElement = this.renderer.cache[pageIndex];
                    var layoutPage = this.renderer.layout.pages[pageIndex];
                    if (!cacheElement || !layoutPage)
                        return false;
                    var subDocumentId = this.newSubDocumentInfo.subDocumentId;
                    __aspxRichEdit.MapUtilsKeyAsNumber.foreach(cacheElement.anchoredPicture, function (ancPicNode, picId) {
                        var belongsTo = layoutPage.anchoredObjectHolder.getObjById(picId).belongsToSubDocId;
                        if (belongsTo == subDocumentId ||
                            (_this.newSubDocumentInfo.isTextBox && _this.newSubDocumentInfo.parentSubDocumentId == belongsTo))
                            REWebUtils.RemoveClassNameFromElement(ancPicNode, __aspxRichEdit.DocumentRenderer.CLASSNAMES.BLACKOUT);
                        else
                            REWebUtils.AddClassNameToElement(ancPicNode, __aspxRichEdit.DocumentRenderer.CLASSNAMES.BLACKOUT);
                    });
                    return true;
                };
                return FloatingPictureRenderer;
            }(ChangeActiveSubDocument.BaseRenderer));
            ChangeActiveSubDocument.FloatingPictureRenderer = FloatingPictureRenderer;
        })(ChangeActiveSubDocument = Renderer.ChangeActiveSubDocument || (Renderer.ChangeActiveSubDocument = {}));
    })(Renderer = __aspxRichEdit.Renderer || (__aspxRichEdit.Renderer = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Renderer;
    (function (Renderer) {
        var ChangeActiveSubDocument;
        (function (ChangeActiveSubDocument) {
            var HeaderFooterLabelsRenderer = (function (_super) {
                __extends(HeaderFooterLabelsRenderer, _super);
                function HeaderFooterLabelsRenderer(renderer, stringResources) {
                    var _this = _super.call(this, renderer) || this;
                    _this.stringResources = stringResources;
                    _this.elementsMap = {};
                    return _this;
                }
                HeaderFooterLabelsRenderer.prototype.handlePageHide = function (pageIndex) {
                    var elem = this.elementsMap[pageIndex];
                    if (elem) {
                        elem.hide();
                        delete this.elementsMap[pageIndex];
                    }
                    return true;
                };
                HeaderFooterLabelsRenderer.prototype.handlePageRender = function (pageIndex, force) {
                    var layoutPage = this.renderer.layout.pages[pageIndex];
                    var cacheElement = this.renderer.cache[pageIndex];
                    if (!cacheElement || !layoutPage)
                        return false;
                    var layoutPageAreas = layoutPage.getLayoutOtherPageAreasInfo();
                    var documentModel = this.getDocumentModel();
                    if (!documentModel)
                        return false;
                    var oldElems = this.elementsMap[pageIndex];
                    var deleteOldElems = true;
                    if (this.isHeaderFooterActive(layoutPage)) {
                        if (!oldElems || force) {
                            var container = __aspxRichEdit.DocumentRenderer.getServiceContainerCore(cacheElement.page);
                            var sectionIndex = __aspxRichEdit.Section.getPageSectionIndex(layoutPage, documentModel.sections);
                            var section = documentModel.sections[sectionIndex];
                            var infoTexts = this.getInfoTexts(sectionIndex, section, layoutPage, layoutPageAreas, documentModel);
                            var elements = this.elementsMap[pageIndex] = new HeaderFooterElements();
                            deleteOldElems = false;
                            this.updateElementInfo(infoTexts.headerInfo, container, layoutPageAreas.headerPageArea, elements.headerInfoElement, HeaderFooterLabelsRenderer.getHeaderInfoTopPosition);
                            this.updateElementInfo(infoTexts.footerInfo, container, layoutPageAreas.footerPageArea, elements.footerInfoElement, HeaderFooterLabelsRenderer.getFooterInfoTopPosition);
                        }
                        else
                            oldElems = null;
                    }
                    if (oldElems) {
                        oldElems.hide();
                        if (deleteOldElems)
                            delete this.elementsMap[pageIndex];
                    }
                    return true;
                };
                HeaderFooterLabelsRenderer.prototype.getDocumentModel = function () {
                    var page = this.renderer.layout.pages[0];
                    if (!page)
                        return null;
                    var pa = page.mainSubDocumentPageAreas[0] || __aspxRichEdit.MapUtilsKeyAsNumber.anyOf(page.otherPageAreas, function (pa) { return pa; });
                    return pa ? pa.subDocument.documentModel : null;
                };
                HeaderFooterLabelsRenderer.prototype.getInfoTexts = function (sectionIndex, section, layoutPage, layoutHeaderFooterPageAreas, documentModel) {
                    var result = new HeaderFooterInfoTexts();
                    if (section.sectionProperties.differentFirstPage && layoutPage.flags.get(__aspxRichEdit.LayoutPageFlags.IsFirstPageOfSection)) {
                        result.headerInfo.push(this.stringResources.firstPageHeader);
                        result.footerInfo.push(this.stringResources.firstPageFooter);
                    }
                    else if (!documentModel.differentOddAndEvenPages) {
                        result.headerInfo.push(this.stringResources.header);
                        result.footerInfo.push(this.stringResources.footer);
                    }
                    else if (__aspxRichEdit.Utils.isEven(layoutPage.layoutPageIndex)) {
                        result.headerInfo.push(this.stringResources.evenPageHeader);
                        result.footerInfo.push(this.stringResources.evenPageFooter);
                    }
                    else {
                        result.headerInfo.push(this.stringResources.oddPageHeader);
                        result.footerInfo.push(this.stringResources.oddPageFooter);
                    }
                    if (documentModel.sections.length > 1) {
                        var sectionLabel = " -Section " + (sectionIndex + 1) + "-";
                        result.headerInfo[0] += sectionLabel;
                        result.footerInfo[0] += sectionLabel;
                    }
                    if (layoutHeaderFooterPageAreas.headerPageArea && section.headers.isLinkedToPrevious(layoutHeaderFooterPageAreas.headerPageArea.subDocument.info.headerFooterType))
                        result.headerInfo.push(this.stringResources.sameAsPrevious);
                    if (layoutHeaderFooterPageAreas.footerPageArea && section.footers.isLinkedToPrevious(layoutHeaderFooterPageAreas.footerPageArea.subDocument.info.headerFooterType))
                        result.footerInfo.push(this.stringResources.sameAsPrevious);
                    return result;
                };
                HeaderFooterLabelsRenderer.prototype.updateElementInfo = function (infoTexts, container, pageArea, infoElement, getTopPosition) {
                    if (!pageArea)
                        return;
                    var sameAsPrevInfoText = infoTexts[1];
                    infoElement.innerHTML = "<b>" + infoTexts[0] + "</b>" + (sameAsPrevInfoText ? "<b>" + sameAsPrevInfoText + "</b>" : "");
                    container.appendChild(infoElement);
                    infoElement.style.top = getTopPosition(pageArea, infoElement) + "px";
                };
                HeaderFooterLabelsRenderer.getHeaderInfoTopPosition = function (pageArea, _element) {
                    return pageArea.y + pageArea.height + 1;
                };
                HeaderFooterLabelsRenderer.getFooterInfoTopPosition = function (pageArea, element) {
                    return pageArea.y - element.offsetHeight - 1;
                };
                return HeaderFooterLabelsRenderer;
            }(ChangeActiveSubDocument.BaseRenderer));
            ChangeActiveSubDocument.HeaderFooterLabelsRenderer = HeaderFooterLabelsRenderer;
            var HeaderFooterInfoTexts = (function () {
                function HeaderFooterInfoTexts() {
                    this.headerInfo = [];
                    this.footerInfo = [];
                }
                return HeaderFooterInfoTexts;
            }());
            var HeaderFooterElements = (function () {
                function HeaderFooterElements() {
                    this.headerInfoElement = __aspxRichEdit.DocumentRenderer.renderContainer(__aspxRichEdit.DocumentRenderer.CLASSNAMES.HEADER_INFO);
                    this.footerInfoElement = __aspxRichEdit.DocumentRenderer.renderContainer(__aspxRichEdit.DocumentRenderer.CLASSNAMES.FOOTER_INFO);
                }
                HeaderFooterElements.prototype.hide = function () {
                    __aspxRichEdit.HTMLUtils.hideNode(this.headerInfoElement);
                    __aspxRichEdit.HTMLUtils.hideNode(this.footerInfoElement);
                };
                return HeaderFooterElements;
            }());
        })(ChangeActiveSubDocument = Renderer.ChangeActiveSubDocument || (Renderer.ChangeActiveSubDocument = {}));
    })(Renderer = __aspxRichEdit.Renderer || (__aspxRichEdit.Renderer = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Renderer;
    (function (Renderer) {
        var ChangeActiveSubDocument;
        (function (ChangeActiveSubDocument) {
            var MainHeaderFooterRenderer = (function (_super) {
                __extends(MainHeaderFooterRenderer, _super);
                function MainHeaderFooterRenderer() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                MainHeaderFooterRenderer.prototype.handlePageHide = function (_pageIndex) {
                    return true;
                };
                MainHeaderFooterRenderer.prototype.activateElement = function (pageAreaElement) {
                    if (!pageAreaElement)
                        return false;
                    var pageColor = this.renderer.layout.pageColor;
                    REWebUtils.RemoveClassNameFromElement(pageAreaElement, __aspxRichEdit.DocumentRenderer.CLASSNAMES.BLACKOUT);
                    pageAreaElement.style.backgroundColor = __aspxRichEdit.ColorHelper.colorToHash(__aspxRichEdit.ColorHelper.isEmptyBgColor(pageColor) ?
                        __aspxRichEdit.ColorHelper.LIGHT_COLOR : pageColor);
                    return true;
                };
                MainHeaderFooterRenderer.prototype.deactivateElement = function (pageAreaElement) {
                    REWebUtils.AddClassNameToElement(pageAreaElement, __aspxRichEdit.DocumentRenderer.CLASSNAMES.BLACKOUT);
                    pageAreaElement.style.backgroundColor = "";
                };
                return MainHeaderFooterRenderer;
            }(ChangeActiveSubDocument.BaseRenderer));
            ChangeActiveSubDocument.MainHeaderFooterRenderer = MainHeaderFooterRenderer;
            var HeaderFooterRenderer = (function (_super) {
                __extends(HeaderFooterRenderer, _super);
                function HeaderFooterRenderer() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                HeaderFooterRenderer.prototype.handlePageRender = function (pageIndex, _force) {
                    var _this = this;
                    var cacheElement = this.renderer.cache[pageIndex];
                    var layoutPage = this.renderer.layout.pages[pageIndex];
                    if (!cacheElement || !layoutPage)
                        return false;
                    __aspxRichEdit.MapUtilsKeyAsNumber.foreach(cacheElement.otherAreas, function (paElement, elemSubDocId) {
                        var pa = layoutPage.otherPageAreas[elemSubDocId];
                        if (pa && pa.subDocument.isHeaderFooter())
                            if (_this.isHeaderFooterActive(layoutPage))
                                _this.activateElement(paElement);
                            else
                                _this.deactivateElement(paElement);
                    });
                };
                return HeaderFooterRenderer;
            }(MainHeaderFooterRenderer));
            ChangeActiveSubDocument.HeaderFooterRenderer = HeaderFooterRenderer;
            var MainRenderer = (function (_super) {
                __extends(MainRenderer, _super);
                function MainRenderer() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                MainRenderer.prototype.handlePageRender = function (pageIndex, _force) {
                    var cacheElement = this.renderer.cache[pageIndex];
                    return cacheElement &&
                        this.applyToMainPageAreas(cacheElement, this.isActive() ? this.activateElement : this.deactivateElement);
                };
                MainRenderer.prototype.applyToMainPageAreas = function (cacheElement, applier) {
                    if (!__aspxRichEdit.DocumentRenderer.isPageElementConsiderAllContainers(cacheElement.page))
                        return false;
                    var mainPageAreasElements = __aspxRichEdit.DocumentRenderer.getMainPageAreaContainerCore(cacheElement.page).childNodes;
                    for (var paIndex = 0, paNode = void 0; paNode = mainPageAreasElements[paIndex]; paIndex++)
                        applier.call(this, paNode);
                    return true;
                };
                MainRenderer.prototype.isActive = function () {
                    if (this.newSubDocumentInfo.isMain)
                        return true;
                    if (!this.newSubDocumentInfo.isTextBox)
                        return false;
                    return this.newSubDocumentInfo.parentSubDocumentId == 0;
                };
                return MainRenderer;
            }(MainHeaderFooterRenderer));
            ChangeActiveSubDocument.MainRenderer = MainRenderer;
        })(ChangeActiveSubDocument = Renderer.ChangeActiveSubDocument || (Renderer.ChangeActiveSubDocument = {}));
    })(Renderer = __aspxRichEdit.Renderer || (__aspxRichEdit.Renderer = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Renderer;
    (function (Renderer) {
        var ChangeActiveSubDocument;
        (function (ChangeActiveSubDocument) {
            var RendererManager = (function () {
                function RendererManager(viewManager, stringResources) {
                    this.viewManager = viewManager;
                    this.renderers = [
                        new ChangeActiveSubDocument.FloatingPictureRenderer(this),
                        new ChangeActiveSubDocument.TextBoxRenderer(this),
                        new ChangeActiveSubDocument.HeaderFooterRenderer(this),
                        new ChangeActiveSubDocument.MainRenderer(this),
                        new ChangeActiveSubDocument.HeaderFooterLabelsRenderer(this, stringResources),
                    ];
                }
                Object.defineProperty(RendererManager.prototype, "cache", {
                    get: function () { return this.viewManager.cache; },
                    enumerable: true,
                    configurable: true
                });
                ;
                Object.defineProperty(RendererManager.prototype, "canvas", {
                    get: function () { return this.viewManager.canvas; },
                    enumerable: true,
                    configurable: true
                });
                ;
                Object.defineProperty(RendererManager.prototype, "layout", {
                    get: function () { return this.viewManager.layout; },
                    enumerable: true,
                    configurable: true
                });
                ;
                Object.defineProperty(RendererManager.prototype, "scroll", {
                    get: function () { return this.viewManager.scroll; },
                    enumerable: true,
                    configurable: true
                });
                ;
                Object.defineProperty(RendererManager.prototype, "canvasScrollManager", {
                    get: function () { return this.viewManager.canvasScrollManager; },
                    enumerable: true,
                    configurable: true
                });
                ;
                RendererManager.prototype.init = function () {
                    for (var _i = 0, _a = this.renderers; _i < _a.length; _i++) {
                        var r = _a[_i];
                        r.init();
                    }
                };
                RendererManager.prototype.update = function (layoutSelection) {
                    var pageIndex = layoutSelection.pageIndex;
                    var currSubDocInfo = layoutSelection.subDocumentInfo;
                    for (var _i = 0, _a = this.renderers; _i < _a.length; _i++) {
                        var r = _a[_i];
                        r.update(currSubDocInfo, pageIndex);
                    }
                };
                RendererManager.prototype.updatePage = function (layoutSelection, whatPageIndexUpdate) {
                    var pageIndex = layoutSelection.pageIndex;
                    var currSubDocInfo = layoutSelection.subDocumentInfo;
                    for (var _i = 0, _a = this.renderers; _i < _a.length; _i++) {
                        var r = _a[_i];
                        r.updatePage(whatPageIndexUpdate, currSubDocInfo, pageIndex);
                    }
                };
                return RendererManager;
            }());
            ChangeActiveSubDocument.RendererManager = RendererManager;
        })(ChangeActiveSubDocument = Renderer.ChangeActiveSubDocument || (Renderer.ChangeActiveSubDocument = {}));
    })(Renderer = __aspxRichEdit.Renderer || (__aspxRichEdit.Renderer = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Renderer;
    (function (Renderer) {
        var ChangeActiveSubDocument;
        (function (ChangeActiveSubDocument) {
            var TextBoxRenderer = (function (_super) {
                __extends(TextBoxRenderer, _super);
                function TextBoxRenderer() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                TextBoxRenderer.prototype.handlePageHide = function (_pageIndex) {
                    return true;
                };
                TextBoxRenderer.prototype.handlePageRender = function (pageIndex) {
                    var _this = this;
                    var cacheElement = this.renderer.cache[pageIndex];
                    var layoutPage = this.renderer.layout.pages[pageIndex];
                    if (!cacheElement || !layoutPage)
                        return false;
                    var activeSubDocumentId = this.newSubDocumentInfo.subDocumentId;
                    __aspxRichEdit.MapUtilsKeyAsNumber.foreach(cacheElement.otherAreas, function (paNode, textBoxSubDocId) {
                        var obj = layoutPage.anchoredObjectHolder.getTextBoxByInternalSubDocId(textBoxSubDocId);
                        if (obj) {
                            var isTextBoxActive = textBoxSubDocId == activeSubDocumentId;
                            var bgNode = cacheElement.textBoxBgElements[textBoxSubDocId];
                            var renderLevel = layoutPage.anchoredObjectHolder.getTextBoxByInternalSubDocId(textBoxSubDocId).rendererLevel;
                            if (isTextBoxActive) {
                                if (obj.rotationInRadians == 0)
                                    REWebUtils.RemoveClassNameFromElement(paNode, __aspxRichEdit.ZIndexHelper.getClassName(renderLevel, __aspxRichEdit.zIndexCssClassType.TextBox));
                                else
                                    REWebUtils.AddClassNameToElement(paNode, __aspxRichEdit.ZIndexHelper.getClassName(renderLevel, __aspxRichEdit.zIndexCssClassType.TextBox));
                                REWebUtils.AddClassNameToElement(paNode, __aspxRichEdit.DocumentRenderer.CLASSNAMES.SELECTED_TEXTBOX);
                                REWebUtils.AddClassNameToElement(bgNode, __aspxRichEdit.DocumentRenderer.CLASSNAMES.SELECTED_TEXTBOX);
                            }
                            else {
                                REWebUtils.RemoveClassNameFromElement(paNode, __aspxRichEdit.DocumentRenderer.CLASSNAMES.SELECTED_TEXTBOX);
                                REWebUtils.RemoveClassNameFromElement(bgNode, __aspxRichEdit.DocumentRenderer.CLASSNAMES.SELECTED_TEXTBOX);
                                REWebUtils.AddClassNameToElement(paNode, __aspxRichEdit.ZIndexHelper.getClassName(renderLevel, __aspxRichEdit.zIndexCssClassType.TextBox));
                            }
                            if (isTextBoxActive || obj.belongsToSubDocId == activeSubDocumentId ||
                                (_this.newSubDocumentInfo.isTextBox &&
                                    _this.newSubDocumentInfo.parentSubDocumentId == obj.belongsToSubDocId))
                                REWebUtils.RemoveClassNameFromElement(paNode, __aspxRichEdit.DocumentRenderer.CLASSNAMES.BLACKOUT);
                            else
                                REWebUtils.AddClassNameToElement(paNode, __aspxRichEdit.DocumentRenderer.CLASSNAMES.BLACKOUT);
                        }
                    });
                    return true;
                };
                return TextBoxRenderer;
            }(ChangeActiveSubDocument.BaseRenderer));
            ChangeActiveSubDocument.TextBoxRenderer = TextBoxRenderer;
        })(ChangeActiveSubDocument = Renderer.ChangeActiveSubDocument || (Renderer.ChangeActiveSubDocument = {}));
    })(Renderer = __aspxRichEdit.Renderer || (__aspxRichEdit.Renderer = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SimpleViewRenderer = (function (_super) {
        __extends(SimpleViewRenderer, _super);
        function SimpleViewRenderer() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.rowIndexInterval = new __aspxRichEdit.BoundaryInterval(0, 0);
            _this.paragraphFramesIndexInterval = new __aspxRichEdit.BoundaryInterval(0, 0);
            _this.tableIndexInterval = new __aspxRichEdit.BoundaryInterval(0, 0);
            _this.updateDataChunk = new __aspxRichEdit.VisibleCanvasObjectsInfo(new __aspxRichEdit.FixedInterval(0, 0), new __aspxRichEdit.FixedInterval(0, 0), new __aspxRichEdit.FixedInterval(0, 0), {}, {});
            return _this;
        }
        SimpleViewRenderer.prototype.pageInserted = function (layoutPage, updateDataChunk) {
            this.updateDataChunk = updateDataChunk;
            this.renderPage(layoutPage, 0, true);
            this.correctPageSizeDueToAnchoredObjects(layoutPage);
        };
        SimpleViewRenderer.prototype.renderPageContentGetFloatingObjects = function (page) {
            var foMap = __aspxRichEdit.MapUtilsKeyAsNumber.shallowCopy(this.updateDataChunk.ancPictureObjs);
            __aspxRichEdit.MapUtilsKeyAsNumber.foreach(this.updateDataChunk.ancTextBoxObjs, function (tb, key) { return foMap[key] = tb; });
            return page.anchoredObjectHolder.getObjectsForRenderer(this.viewManager.layout.anchorObjectsPositionInfo, foMap);
        };
        SimpleViewRenderer.prototype.collectScrollChanges = function (oldInterval, newInterval, isAddUpdateChange, getConstructor) {
            var changes = [];
            var iter = new __aspxRichEdit.SparseIntervals(__aspxRichEdit.IntervalAlgorithms.getMergedIntervalsTemplate([oldInterval, newInterval], true, new __aspxRichEdit.BoundaryInterval(0, 0)))
                .getNativeIterator();
            for (var canvasElementIndex = 0; iter.moveNext();) {
                if (oldInterval.contains(iter.index)) {
                    if (newInterval.contains(iter.index)) {
                        if (isAddUpdateChange)
                            changes.push(new getConstructor(iter.index, canvasElementIndex, __aspxRichEdit.LayoutChangeType.Updated));
                        canvasElementIndex++;
                    }
                    else {
                        if (iter.index < newInterval.start)
                            changes.push(new getConstructor(iter.index, canvasElementIndex, __aspxRichEdit.LayoutChangeType.Deleted));
                        else
                            do
                                changes.push(new getConstructor(iter.index, newInterval.length, __aspxRichEdit.LayoutChangeType.Deleted));
                            while (iter.moveNext());
                    }
                }
                else
                    changes.push(new getConstructor(iter.index, canvasElementIndex++, __aspxRichEdit.LayoutChangeType.Inserted));
            }
            return changes;
        };
        SimpleViewRenderer.prototype.collectScrollChangesMap = function (oldObjects, newObjects, isAddUpdateChange, isTextBoxes, getConstructor) {
            var list = [];
            __aspxRichEdit.MapUtilsKeyAsNumber.foreach(oldObjects, function (obj) { return list.push(obj.objectId); });
            __aspxRichEdit.MapUtilsKeyAsNumber.foreach(newObjects, function (obj) { return list.push(obj.objectId); });
            list = __aspxRichEdit.ListUtils.uniqueNumber(list);
            var changes = [];
            __aspxRichEdit.ListUtils.foreach(list, function (objectId) {
                if (oldObjects[objectId] !== undefined) {
                    if (newObjects[objectId] !== undefined) {
                        if (isAddUpdateChange)
                            changes.push(new getConstructor(isTextBoxes ? newObjects[objectId].internalSubDocId : objectId, __aspxRichEdit.LayoutChangeType.Updated));
                    }
                    else
                        changes.push(new getConstructor(isTextBoxes ? oldObjects[objectId].internalSubDocId : objectId, __aspxRichEdit.LayoutChangeType.Deleted));
                }
                else
                    changes.push(new getConstructor(isTextBoxes ? newObjects[objectId].internalSubDocId : objectId, __aspxRichEdit.LayoutChangeType.Inserted));
            });
            return changes;
        };
        SimpleViewRenderer.prototype.collectAllScrollChanges = function (newUpdateDataChunk, isAddUpdateChange) {
            return new __aspxRichEdit.RenderedCanvasObjectsInfo(this.collectScrollChanges(this.updateDataChunk.rows, newUpdateDataChunk.rows, isAddUpdateChange, __aspxRichEdit.RowChangeSV), this.collectScrollChanges(this.updateDataChunk.tables, newUpdateDataChunk.tables, isAddUpdateChange, __aspxRichEdit.TableChangeSV), this.collectScrollChanges(this.updateDataChunk.parFrames, newUpdateDataChunk.parFrames, isAddUpdateChange, __aspxRichEdit.ParagraphFrameChangeSV), this.collectScrollChangesMap(this.updateDataChunk.ancPictureObjs, newUpdateDataChunk.ancPictureObjs, isAddUpdateChange, false, __aspxRichEdit.AnchoredPictureChange), this.collectScrollChangesMap(this.updateDataChunk.ancTextBoxObjs, newUpdateDataChunk.ancTextBoxObjs, isAddUpdateChange, true, __aspxRichEdit.PageAreaChange));
        };
        SimpleViewRenderer.prototype.pageScrolled = function (layoutPage, newUpdateDataChunk) {
            var changes = this.collectAllScrollChanges(newUpdateDataChunk, false);
            var pc = this.makePageChange(changes);
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.SimpleViewRenderer, "mergedPageChanges - Changes\n", __aspxRichEdit.LogListHelper.level_1(function (change) { return __aspxRichEdit.LogObjToStr.pageChange(change, ""); }, [pc], "", "\n"));
            this.applyPageChange(layoutPage, pc);
            this.updateDataChunk = newUpdateDataChunk;
        };
        SimpleViewRenderer.prototype.applyFormatterChanges = function (formatterChanges, scrollChanges) {
            if (!scrollChanges.length || !formatterChanges.length)
                return;
            var mm = __aspxRichEdit.ListUtils.minMaxExtended(scrollChanges, function (v) { return v.layoutIndex; });
            var visibleObjectsInterval = new __aspxRichEdit.BoundaryInterval(mm.minValue, mm.maxValue + 1);
            var isObjectMustBeReplaced = __aspxRichEdit.ListUtils.accumulate(formatterChanges, {}, function (acc, c) {
                if (c.changeType == __aspxRichEdit.LayoutChangeType.Replaced && visibleObjectsInterval.contains(c.layoutIndex))
                    acc[c.layoutIndex] = true;
                return acc;
            });
            for (var _i = 0, scrollChanges_1 = scrollChanges; _i < scrollChanges_1.length; _i++) {
                var scrollChange = scrollChanges_1[_i];
                if (isObjectMustBeReplaced[scrollChange.layoutIndex] && scrollChange.changeType != __aspxRichEdit.LayoutChangeType.Inserted)
                    scrollChange.changeType = __aspxRichEdit.LayoutChangeType.Replaced;
            }
        };
        SimpleViewRenderer.prototype.applyFormatterChangesMap = function (formatterChanges, scrollChanges) {
            var map = __aspxRichEdit.ListUtils.accumulate(scrollChanges, {}, function (acc, c) {
                acc[c.layoutIndex] = c;
                return acc;
            });
            __aspxRichEdit.ListUtils.foreach(formatterChanges, function (fc) {
                var scrollChange = map[fc.layoutIndex];
                if (scrollChange && !__aspxRichEdit.EnumUtils.isAnyOf(scrollChange.changeType, __aspxRichEdit.LayoutChangeType.Deleted, __aspxRichEdit.LayoutChangeType.Inserted))
                    if (scrollChange && scrollChange.changeType != __aspxRichEdit.LayoutChangeType.Deleted)
                        scrollChange.changeType = __aspxRichEdit.LayoutChangeType.Replaced;
                if (fc.changeType == __aspxRichEdit.LayoutChangeType.Updated && fc instanceof __aspxRichEdit.PageAreaChange)
                    if (scrollChange && scrollChange instanceof __aspxRichEdit.PageAreaChange && scrollChange.changeType == __aspxRichEdit.LayoutChangeType.Updated)
                        scrollChange.columnChanges = fc.columnChanges;
            });
        };
        SimpleViewRenderer.prototype.makePageChange = function (changes) {
            var cc = [new __aspxRichEdit.ColumnChange(0, __aspxRichEdit.LayoutChangeType.Updated, changes.rows, changes.tables, changes.parFrames)];
            var pac = [new __aspxRichEdit.PageAreaChange(0, __aspxRichEdit.LayoutChangeType.Updated, cc)];
            var pc = new __aspxRichEdit.PageChange(0, __aspxRichEdit.LayoutChangeType.Updated, pac, changes.ancTextBoxObjs);
            pc.anchoredPictureChanges = changes.ancPictureObjs;
            return pc;
        };
        SimpleViewRenderer.prototype.pageUpdated = function (pageChange, newUpdateDataChunk) {
            var changes = this.collectAllScrollChanges(newUpdateDataChunk, true);
            if (pageChange.mainPageAreaChanges.length) {
                this.applyFormatterChanges(pageChange.mainPageAreaChanges[0].columnChanges[0].rowChanges, changes.rows);
                this.applyFormatterChanges(pageChange.mainPageAreaChanges[0].columnChanges[0].paragraphFrameChanges, changes.parFrames);
                this.applyFormatterChanges(pageChange.mainPageAreaChanges[0].columnChanges[0].tableChanges, changes.tables);
            }
            this.applyFormatterChangesMap(pageChange.anchoredPictureChanges, changes.ancPictureObjs);
            this.applyFormatterChangesMap(pageChange.otherPageAreaChanges, changes.ancTextBoxObjs);
            var pc = this.makePageChange(changes);
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.SimpleViewRenderer, "mergedPageChanges - Changes\n", __aspxRichEdit.LogListHelper.level_1(function (change) { return __aspxRichEdit.LogObjToStr.pageChange(change, ""); }, [pc], "", "\n"));
            this.applyPageChange(this.viewManager.layout.pages[0], pc);
            this.updateDataChunk = newUpdateDataChunk;
            this.correctPageSizeDueToAnchoredObjects(this.viewManager.layout.pages[0]);
        };
        SimpleViewRenderer.prototype.renderColumn = function (column, level, isMainPageArea) {
            var _this = this;
            var columnElement = __aspxRichEdit.DocumentRenderer.renderContainer(__aspxRichEdit.DocumentRenderer.CLASSNAMES.COLUMN);
            __aspxRichEdit.HTMLUtils.setStyleSizeAndPosition(columnElement.style, column);
            var rowsContainer = columnElement.appendChild(__aspxRichEdit.DocumentRenderer.renderContainer(__aspxRichEdit.DocumentRenderer.CLASSNAMES.ROWS_CONTAINER));
            var paragraphFramesContainer = columnElement.appendChild(__aspxRichEdit.DocumentRenderer.renderContainer(__aspxRichEdit.DocumentRenderer.CLASSNAMES.PARAGRAPHFRAMES_CONTAINER));
            var tablesContainer = columnElement.appendChild(__aspxRichEdit.DocumentRenderer.renderContainer(__aspxRichEdit.DocumentRenderer.CLASSNAMES.TABLES_CONTAINER));
            var bounds = isMainPageArea ?
                this.updateDataChunk :
                new __aspxRichEdit.SimpleViewChangesDataBase(new __aspxRichEdit.BoundaryInterval(0, column.rows.length), new __aspxRichEdit.BoundaryInterval(0, column.tablesInfo.length), new __aspxRichEdit.BoundaryInterval(0, column.paragraphFrames.length));
            __aspxRichEdit.ListUtils.foreach(column.rows, function (row) { return rowsContainer.appendChild(_this.renderRow(row, level)); }, bounds.rows.start, bounds.rows.end);
            __aspxRichEdit.ListUtils.foreach(column.paragraphFrames, function (pf) { return paragraphFramesContainer.appendChild(__aspxRichEdit.DocumentRenderer.renderParagraphFrame(pf, level)); }, bounds.parFrames.start, bounds.parFrames.end);
            __aspxRichEdit.ListUtils.foreach(column.tablesInfo, function (t) {
                return tablesContainer.appendChild(__aspxRichEdit.DocumentRenderer.renderTable(t, level, _this.viewManager.innerClientProperties.showTableGridLines));
            }, bounds.tables.start, bounds.tables.end);
            return columnElement;
        };
        SimpleViewRenderer.prototype.correctPageSizeDueToAnchoredObjects = function (layoutPage) {
            var page = this.viewManager.cache[0].page;
            var maxWidth = layoutPage.width;
            __aspxRichEdit.MapUtilsKeyAsNumber.foreach(layoutPage.anchoredObjectHolder.objects, function (obj) {
                var rightmostPosition = obj.x - obj.shape.outlineWidth + obj.width;
                maxWidth = Math.max(maxWidth, page.clientWidth + (rightmostPosition - page.clientWidth));
            });
            if (page.offsetWidth != maxWidth)
                page.style.width = maxWidth + __aspxRichEdit.Ruler.MINIMUN_DISTANCE_BETWEEN_COLUMNS + "px";
        };
        return SimpleViewRenderer;
    }(__aspxRichEdit.DocumentRenderer));
    __aspxRichEdit.SimpleViewRenderer = SimpleViewRenderer;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var MisspelledSelectionRenderer = (function (_super) {
        __extends(MisspelledSelectionRenderer, _super);
        function MisspelledSelectionRenderer() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.layoutPageFlag = __aspxRichEdit.LayoutPageFlags.IsMisspelledSelectionRendered;
            return _this;
        }
        MisspelledSelectionRenderer.prototype.renderAllPageSelection = function (layout, pageIndex, force) {
            _super.prototype.renderAllPageSelection.call(this, layout, pageIndex, force);
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.SelectionRenderer, "renderAllPageMisspelledSelection", "pageIndex: " + pageIndex);
        };
        MisspelledSelectionRenderer.prototype.closeDocument = function () {
            this.getLayoutSelectionInfo().reset();
        };
        MisspelledSelectionRenderer.prototype.getLayoutSelectionInfo = function () {
            return this.layoutSelection.misspelledInfo;
        };
        MisspelledSelectionRenderer.prototype.getContainer = function (pageElement) {
            return __aspxRichEdit.DocumentRenderer.getMisspelledSelectionContainerCore(pageElement);
        };
        return MisspelledSelectionRenderer;
    }(__aspxRichEdit.SelectionRendererBase));
    __aspxRichEdit.MisspelledSelectionRenderer = MisspelledSelectionRenderer;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RangePermissionRenderer = (function (_super) {
        __extends(RangePermissionRenderer, _super);
        function RangePermissionRenderer() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.layoutPageFlag = __aspxRichEdit.LayoutPageFlags.IsRangePermissionsRendered;
            return _this;
        }
        RangePermissionRenderer.prototype.renderAllPageSelection = function (layout, pageIndex, force) {
            _super.prototype.renderAllPageSelection.call(this, layout, pageIndex, force);
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.SelectionRenderer, "renderAllPageRangePermissions", "pageIndex: " + pageIndex);
        };
        RangePermissionRenderer.prototype.renderItem = function (item, ancObjHolder) {
            var selectionElement = _super.prototype.renderItem.call(this, item, ancObjHolder);
            selectionElement.style.backgroundColor = item.color;
            return selectionElement;
        };
        RangePermissionRenderer.prototype.closeDocument = function () {
            this.getLayoutSelectionInfo().reset();
        };
        RangePermissionRenderer.prototype.getLayoutSelectionInfo = function () {
            return this.layoutSelection.rangePermissionInfo;
        };
        RangePermissionRenderer.prototype.getContainer = function (pageElement) {
            return __aspxRichEdit.DocumentRenderer.getRangePermissionsContainerCore(pageElement);
        };
        return RangePermissionRenderer;
    }(__aspxRichEdit.SelectionRendererBase));
    __aspxRichEdit.RangePermissionRenderer = RangePermissionRenderer;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SearchSelectionRenderer = (function (_super) {
        __extends(SearchSelectionRenderer, _super);
        function SearchSelectionRenderer() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.layoutPageFlag = __aspxRichEdit.LayoutPageFlags.IsSearchSelectionRendered;
            return _this;
        }
        SearchSelectionRenderer.prototype.renderAllPageSelection = function (layout, pageIndex, force) {
            _super.prototype.renderAllPageSelection.call(this, layout, pageIndex, force);
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.SelectionRenderer, "renderAllPageSearchSelection", "pageIndex: " + pageIndex);
        };
        SearchSelectionRenderer.prototype.closeDocument = function () {
            this.getLayoutSelectionInfo().reset();
        };
        SearchSelectionRenderer.prototype.getLayoutSelectionInfo = function () {
            return this.layoutSelection.searchInfo;
        };
        SearchSelectionRenderer.prototype.getContainer = function (pageElement) {
            return __aspxRichEdit.DocumentRenderer.getSearchSelectionContainerCore(pageElement);
        };
        return SearchSelectionRenderer;
    }(__aspxRichEdit.SelectionRendererBase));
    __aspxRichEdit.SearchSelectionRenderer = SearchSelectionRenderer;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var CHANGE_BLINK_CURSOR_DELAY = 350;
    var SelectionRenderer = (function (_super) {
        __extends(SelectionRenderer, _super);
        function SelectionRenderer(cache, layoutSelection) {
            var _this = _super.call(this, cache, layoutSelection) || this;
            _this.layoutPageFlag = __aspxRichEdit.LayoutPageFlags.IsSelectionRendered;
            _this.processIdChangeCursorToBlink = null;
            _this.touchSelectionCircleElementsManager = new __aspxRichEdit.TouchSelectionCircleElementsManager(cache, layoutSelection);
            return _this;
        }
        SelectionRenderer.prototype.applySelectionChanges = function (layout) {
            this.switchCursorToBlinkState();
            _super.prototype.applySelectionChanges.call(this, layout);
            this.touchSelectionCircleElementsManager.update();
        };
        SelectionRenderer.prototype.renderAllPageSelection = function (layout, pageIndex, force) {
            this.switchCursorToBlinkState();
            _super.prototype.renderAllPageSelection.call(this, layout, pageIndex, force);
            __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.SelectionRenderer, "renderAllPageSelection", "pageIndex: " + pageIndex);
            this.touchSelectionCircleElementsManager.update();
        };
        SelectionRenderer.prototype.closeDocument = function () {
            this.switchCursorToBlinkState();
            this.getLayoutSelectionInfo().reset();
            this.layoutSelection.pageIndex = -1;
            this.layoutSelection.subDocumentInfo = null;
        };
        SelectionRenderer.prototype.renderItem = function (item, ancObjHolder) {
            var _this = this;
            if (item instanceof __aspxRichEdit.LayoutSelectionFloatingObjectItem) {
                var selectionElement_1 = __aspxRichEdit.DocumentRenderer.renderContainer(item.baseClassName);
                __aspxRichEdit.HTMLUtils.setStyleSizeAndPosition(selectionElement_1.style, item);
                return selectionElement_1;
            }
            var selectionElement = _super.prototype.renderItem.call(this, item, ancObjHolder);
            if (item.isCursor()) {
                this.processIdChangeCursorToBlink = setTimeout(function () {
                    REWebUtils.RemoveClassNameFromElement(selectionElement, __aspxRichEdit.DocumentRenderer.CLASSNAMES.CURSOR_NO_BLINK_CLASS_NAME);
                    _this.processIdChangeCursorToBlink = null;
                }, CHANGE_BLINK_CURSOR_DELAY);
            }
            return selectionElement;
        };
        SelectionRenderer.prototype.getLayoutSelectionInfo = function () {
            return this.layoutSelection.selectionInfo;
        };
        SelectionRenderer.prototype.getContainer = function (pageElement) {
            return __aspxRichEdit.DocumentRenderer.getSelectionContainerCore(pageElement);
        };
        SelectionRenderer.prototype.switchCursorToBlinkState = function () {
            if (this.processIdChangeCursorToBlink === null) {
                clearTimeout(this.processIdChangeCursorToBlink);
                this.processIdChangeCursorToBlink = null;
            }
        };
        return SelectionRenderer;
    }(__aspxRichEdit.SelectionRendererBase));
    __aspxRichEdit.SelectionRenderer = SelectionRenderer;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TouchSelectionCircleElementsManager = (function () {
        function TouchSelectionCircleElementsManager(cache, layoutSelection) {
            this.firstElement = __aspxRichEdit.DocumentRenderer.renderContainer(TouchSelectionCircleElementsManager.BAR_CLASS_NAME);
            this.secondElement = __aspxRichEdit.DocumentRenderer.renderContainer(TouchSelectionCircleElementsManager.BAR_CLASS_NAME);
            this.layoutSelection = layoutSelection;
            this.cache = cache;
        }
        TouchSelectionCircleElementsManager.prototype.getSecondElement = function () {
            return this.secondElement;
        };
        TouchSelectionCircleElementsManager.prototype.update = function () {
            if (!REWebUtils.Browser.TouchUI || this.layoutSelection.firstPageIndexWithSelection < 0 || !this.cache.length)
                return;
            if (!this.isCreated()) {
                var serviceContainer = __aspxRichEdit.DocumentRenderer.getServiceContainerCore(this.cache[this.layoutSelection.firstPageIndexWithSelection].page);
                serviceContainer.appendChild(this.firstElement);
                serviceContainer.appendChild(this.secondElement);
                this.radius = this.firstElement.offsetWidth / 2;
            }
            var firstSelectionItem = this.layoutSelection.selectionInfo.pageInfos[this.layoutSelection.firstPageIndexWithSelection].oldItems[0];
            __aspxRichEdit.HTMLUtils.setStylePosition(this.firstElement.style, new __aspxRichEdit.Point(firstSelectionItem.x - this.radius, firstSelectionItem.getBottomBoundPosition()));
            var lastSelectionItem = __aspxRichEdit.ListUtils.last(this.layoutSelection.selectionInfo.pageInfos[this.layoutSelection.lastPageIndexWithSelection].oldItems);
            __aspxRichEdit.HTMLUtils.setStylePosition(this.secondElement.style, new __aspxRichEdit.Point(lastSelectionItem.getRightBoundPosition() - this.radius, lastSelectionItem.getBottomBoundPosition()));
        };
        TouchSelectionCircleElementsManager.prototype.setVisibilityTouchBars = function (visible) {
            this.setVisible(this.firstElement, visible);
            this.setVisible(this.secondElement, visible);
        };
        TouchSelectionCircleElementsManager.prototype.setVisible = function (element, visible) {
            if (this.isElementVisible(element) != visible)
                element.style.display = visible ? "" : "none";
        };
        TouchSelectionCircleElementsManager.prototype.isElementVisible = function (element) {
            return element.style.display != "none";
        };
        TouchSelectionCircleElementsManager.prototype.isCreated = function () {
            var serviceContainer = __aspxRichEdit.DocumentRenderer.getServiceContainerCore(this.cache[this.layoutSelection.firstPageIndexWithSelection].page);
            return !!REWebUtils.GetChildNodesByClassName(serviceContainer, TouchSelectionCircleElementsManager.BAR_CLASS_NAME).length;
        };
        TouchSelectionCircleElementsManager.BAR_CLASS_NAME = "dxreSelBar";
        return TouchSelectionCircleElementsManager;
    }());
    __aspxRichEdit.TouchSelectionCircleElementsManager = TouchSelectionCircleElementsManager;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONEnumTableCell;
    (function (JSONEnumTableCell) {
        JSONEnumTableCell[JSONEnumTableCell["StyleIndex"] = 0] = "StyleIndex";
        JSONEnumTableCell[JSONEnumTableCell["TableCellPropertiesIndex"] = 1] = "TableCellPropertiesIndex";
        JSONEnumTableCell[JSONEnumTableCell["ColumnSpan"] = 2] = "ColumnSpan";
        JSONEnumTableCell[JSONEnumTableCell["PreferredWidth"] = 3] = "PreferredWidth";
        JSONEnumTableCell[JSONEnumTableCell["VerticalMerging"] = 4] = "VerticalMerging";
        JSONEnumTableCell[JSONEnumTableCell["StartParagraphPosition"] = 5] = "StartParagraphPosition";
        JSONEnumTableCell[JSONEnumTableCell["EndParagraphPosition"] = 6] = "EndParagraphPosition";
    })(JSONEnumTableCell = __aspxRichEdit.JSONEnumTableCell || (__aspxRichEdit.JSONEnumTableCell = {}));
    var JSONEnumTableCellProperty;
    (function (JSONEnumTableCellProperty) {
        JSONEnumTableCellProperty[JSONEnumTableCellProperty["CellMargins"] = 0] = "CellMargins";
        JSONEnumTableCellProperty[JSONEnumTableCellProperty["Borders"] = 1] = "Borders";
        JSONEnumTableCellProperty[JSONEnumTableCellProperty["HideCellMark"] = 2] = "HideCellMark";
        JSONEnumTableCellProperty[JSONEnumTableCellProperty["NoWrap"] = 3] = "NoWrap";
        JSONEnumTableCellProperty[JSONEnumTableCellProperty["FitText"] = 4] = "FitText";
        JSONEnumTableCellProperty[JSONEnumTableCellProperty["TextDirection"] = 5] = "TextDirection";
        JSONEnumTableCellProperty[JSONEnumTableCellProperty["VerticalAlignment"] = 6] = "VerticalAlignment";
        JSONEnumTableCellProperty[JSONEnumTableCellProperty["ShadingInfo"] = 7] = "ShadingInfo";
        JSONEnumTableCellProperty[JSONEnumTableCellProperty["ShadingInfoIndex"] = 8] = "ShadingInfoIndex";
        JSONEnumTableCellProperty[JSONEnumTableCellProperty["UseValue"] = 9] = "UseValue";
    })(JSONEnumTableCellProperty = __aspxRichEdit.JSONEnumTableCellProperty || (__aspxRichEdit.JSONEnumTableCellProperty = {}));
    var JSONEnumClientTableCellInfo;
    (function (JSONEnumClientTableCellInfo) {
        JSONEnumClientTableCellInfo[JSONEnumClientTableCellInfo["StartCellPosition"] = 0] = "StartCellPosition";
        JSONEnumClientTableCellInfo[JSONEnumClientTableCellInfo["EndCellPosition"] = 1] = "EndCellPosition";
        JSONEnumClientTableCellInfo[JSONEnumClientTableCellInfo["CellIndex"] = 2] = "CellIndex";
        JSONEnumClientTableCellInfo[JSONEnumClientTableCellInfo["CellInfo"] = 3] = "CellInfo";
        JSONEnumClientTableCellInfo[JSONEnumClientTableCellInfo["RightDirection"] = 4] = "RightDirection";
    })(JSONEnumClientTableCellInfo = __aspxRichEdit.JSONEnumClientTableCellInfo || (__aspxRichEdit.JSONEnumClientTableCellInfo = {}));
    var JSONEnumClientTableCellFormatting;
    (function (JSONEnumClientTableCellFormatting) {
        JSONEnumClientTableCellFormatting[JSONEnumClientTableCellFormatting["ColumnSpan"] = 0] = "ColumnSpan";
        JSONEnumClientTableCellFormatting[JSONEnumClientTableCellFormatting["CellProperties"] = 1] = "CellProperties";
        JSONEnumClientTableCellFormatting[JSONEnumClientTableCellFormatting["PreferredWidth"] = 2] = "PreferredWidth";
        JSONEnumClientTableCellFormatting[JSONEnumClientTableCellFormatting["VerticalMerging"] = 3] = "VerticalMerging";
    })(JSONEnumClientTableCellFormatting = __aspxRichEdit.JSONEnumClientTableCellFormatting || (__aspxRichEdit.JSONEnumClientTableCellFormatting = {}));
    var JSONServerTableCellProperty;
    (function (JSONServerTableCellProperty) {
        JSONServerTableCellProperty[JSONServerTableCellProperty["CellMargins"] = 0] = "CellMargins";
        JSONServerTableCellProperty[JSONServerTableCellProperty["PreferredWidth"] = 1] = "PreferredWidth";
        JSONServerTableCellProperty[JSONServerTableCellProperty["Borders"] = 2] = "Borders";
        JSONServerTableCellProperty[JSONServerTableCellProperty["HideCellMark"] = 3] = "HideCellMark";
        JSONServerTableCellProperty[JSONServerTableCellProperty["NoWrap"] = 4] = "NoWrap";
        JSONServerTableCellProperty[JSONServerTableCellProperty["FitText"] = 5] = "FitText";
        JSONServerTableCellProperty[JSONServerTableCellProperty["TextDirection"] = 6] = "TextDirection";
        JSONServerTableCellProperty[JSONServerTableCellProperty["VerticalAlignment"] = 7] = "VerticalAlignment";
        JSONServerTableCellProperty[JSONServerTableCellProperty["BackgroundColor"] = 8] = "BackgroundColor";
        JSONServerTableCellProperty[JSONServerTableCellProperty["ForegroundColor"] = 9] = "ForegroundColor";
        JSONServerTableCellProperty[JSONServerTableCellProperty["Shading"] = 10] = "Shading";
        JSONServerTableCellProperty[JSONServerTableCellProperty["UseValue"] = 11] = "UseValue";
        JSONServerTableCellProperty[JSONServerTableCellProperty["ColumnSpan"] = 12] = "ColumnSpan";
        JSONServerTableCellProperty[JSONServerTableCellProperty["VerticalMerging"] = 13] = "VerticalMerging";
    })(JSONServerTableCellProperty = __aspxRichEdit.JSONServerTableCellProperty || (__aspxRichEdit.JSONServerTableCellProperty = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONEnumTable;
    (function (JSONEnumTable) {
        JSONEnumTable[JSONEnumTable["StyleIndex"] = 0] = "StyleIndex";
        JSONEnumTable[JSONEnumTable["NestedLevel"] = 1] = "NestedLevel";
        JSONEnumTable[JSONEnumTable["TableProperties"] = 2] = "TableProperties";
        JSONEnumTable[JSONEnumTable["Index"] = 3] = "Index";
        JSONEnumTable[JSONEnumTable["PreferredWidth"] = 4] = "PreferredWidth";
        JSONEnumTable[JSONEnumTable["LookTypes"] = 5] = "LookTypes";
        JSONEnumTable[JSONEnumTable["ParentCell"] = 6] = "ParentCell";
        JSONEnumTable[JSONEnumTable["Rows"] = 7] = "Rows";
    })(JSONEnumTable = __aspxRichEdit.JSONEnumTable || (__aspxRichEdit.JSONEnumTable = {}));
    var JSONEnumTableProperty;
    (function (JSONEnumTableProperty) {
        JSONEnumTableProperty[JSONEnumTableProperty["CellMargins"] = 0] = "CellMargins";
        JSONEnumTableProperty[JSONEnumTableProperty["CellSpacing"] = 1] = "CellSpacing";
        JSONEnumTableProperty[JSONEnumTableProperty["Indent"] = 2] = "Indent";
        JSONEnumTableProperty[JSONEnumTableProperty["PreferredWidth"] = 3] = "PreferredWidth";
        JSONEnumTableProperty[JSONEnumTableProperty["Borders"] = 4] = "Borders";
        JSONEnumTableProperty[JSONEnumTableProperty["TableStyleColBandSize"] = 5] = "TableStyleColBandSize";
        JSONEnumTableProperty[JSONEnumTableProperty["TableStyleRowBandSize"] = 6] = "TableStyleRowBandSize";
        JSONEnumTableProperty[JSONEnumTableProperty["IsTableOverlap"] = 7] = "IsTableOverlap";
        JSONEnumTableProperty[JSONEnumTableProperty["AvoidDoubleBorders"] = 8] = "AvoidDoubleBorders";
        JSONEnumTableProperty[JSONEnumTableProperty["LayoutType"] = 9] = "LayoutType";
        JSONEnumTableProperty[JSONEnumTableProperty["TableLookTypes"] = 10] = "TableLookTypes";
        JSONEnumTableProperty[JSONEnumTableProperty["ShadingInfo"] = 11] = "ShadingInfo";
        JSONEnumTableProperty[JSONEnumTableProperty["TableRowAlignment"] = 12] = "TableRowAlignment";
        JSONEnumTableProperty[JSONEnumTableProperty["BottomFromText"] = 13] = "BottomFromText";
        JSONEnumTableProperty[JSONEnumTableProperty["LeftFromText"] = 14] = "LeftFromText";
        JSONEnumTableProperty[JSONEnumTableProperty["TopFromText"] = 15] = "TopFromText";
        JSONEnumTableProperty[JSONEnumTableProperty["RightFromText"] = 16] = "RightFromText";
        JSONEnumTableProperty[JSONEnumTableProperty["TableHorizontalPosition"] = 17] = "TableHorizontalPosition";
        JSONEnumTableProperty[JSONEnumTableProperty["TableVerticalPosition"] = 18] = "TableVerticalPosition";
        JSONEnumTableProperty[JSONEnumTableProperty["HorizontalAlignMode"] = 19] = "HorizontalAlignMode";
        JSONEnumTableProperty[JSONEnumTableProperty["VerticalAlignMode"] = 20] = "VerticalAlignMode";
        JSONEnumTableProperty[JSONEnumTableProperty["HorizontalAnchorType"] = 21] = "HorizontalAnchorType";
        JSONEnumTableProperty[JSONEnumTableProperty["VerticalAnchorType"] = 22] = "VerticalAnchorType";
        JSONEnumTableProperty[JSONEnumTableProperty["TextWrapping"] = 23] = "TextWrapping";
        JSONEnumTableProperty[JSONEnumTableProperty["UseValue"] = 24] = "UseValue";
        JSONEnumTableProperty[JSONEnumTableProperty["ShadingInfoIndex"] = 25] = "ShadingInfoIndex";
    })(JSONEnumTableProperty = __aspxRichEdit.JSONEnumTableProperty || (__aspxRichEdit.JSONEnumTableProperty = {}));
    var JSONEnumTableParentCellInfo;
    (function (JSONEnumTableParentCellInfo) {
        JSONEnumTableParentCellInfo[JSONEnumTableParentCellInfo["CellIndex"] = 0] = "CellIndex";
        JSONEnumTableParentCellInfo[JSONEnumTableParentCellInfo["RowIndex"] = 1] = "RowIndex";
        JSONEnumTableParentCellInfo[JSONEnumTableParentCellInfo["TableIndex"] = 2] = "TableIndex";
    })(JSONEnumTableParentCellInfo = __aspxRichEdit.JSONEnumTableParentCellInfo || (__aspxRichEdit.JSONEnumTableParentCellInfo = {}));
    var JSONEnumClientTableInfo;
    (function (JSONEnumClientTableInfo) {
        JSONEnumClientTableInfo[JSONEnumClientTableInfo["TablePosition"] = 0] = "TablePosition";
        JSONEnumClientTableInfo[JSONEnumClientTableInfo["Position"] = 1] = "Position";
        JSONEnumClientTableInfo[JSONEnumClientTableInfo["Rows"] = 2] = "Rows";
        JSONEnumClientTableInfo[JSONEnumClientTableInfo["TableInfo"] = 3] = "TableInfo";
    })(JSONEnumClientTableInfo = __aspxRichEdit.JSONEnumClientTableInfo || (__aspxRichEdit.JSONEnumClientTableInfo = {}));
    var JSONEnumClientTableFormatting;
    (function (JSONEnumClientTableFormatting) {
        JSONEnumClientTableFormatting[JSONEnumClientTableFormatting["TableProperties"] = 0] = "TableProperties";
        JSONEnumClientTableFormatting[JSONEnumClientTableFormatting["StyleName"] = 1] = "StyleName";
        JSONEnumClientTableFormatting[JSONEnumClientTableFormatting["PreferredWidth"] = 2] = "PreferredWidth";
        JSONEnumClientTableFormatting[JSONEnumClientTableFormatting["LookTypes"] = 3] = "LookTypes";
    })(JSONEnumClientTableFormatting = __aspxRichEdit.JSONEnumClientTableFormatting || (__aspxRichEdit.JSONEnumClientTableFormatting = {}));
    var JSONEnumClientTablePosition;
    (function (JSONEnumClientTablePosition) {
        JSONEnumClientTablePosition[JSONEnumClientTablePosition["ParagraphStartPosition"] = 0] = "ParagraphStartPosition";
        JSONEnumClientTablePosition[JSONEnumClientTablePosition["NestedLevel"] = 1] = "NestedLevel";
    })(JSONEnumClientTablePosition = __aspxRichEdit.JSONEnumClientTablePosition || (__aspxRichEdit.JSONEnumClientTablePosition = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONEnumTableRow;
    (function (JSONEnumTableRow) {
        JSONEnumTableRow[JSONEnumTableRow["GridBefore"] = 0] = "GridBefore";
        JSONEnumTableRow[JSONEnumTableRow["GridAfter"] = 1] = "GridAfter";
        JSONEnumTableRow[JSONEnumTableRow["WidthAfter"] = 2] = "WidthAfter";
        JSONEnumTableRow[JSONEnumTableRow["WidthBefore"] = 3] = "WidthBefore";
        JSONEnumTableRow[JSONEnumTableRow["TableRowPropertiesIndex"] = 4] = "TableRowPropertiesIndex";
        JSONEnumTableRow[JSONEnumTableRow["TablePropertiesException"] = 5] = "TablePropertiesException";
        JSONEnumTableRow[JSONEnumTableRow["Height"] = 6] = "Height";
        JSONEnumTableRow[JSONEnumTableRow["Cells"] = 7] = "Cells";
    })(JSONEnumTableRow = __aspxRichEdit.JSONEnumTableRow || (__aspxRichEdit.JSONEnumTableRow = {}));
    var JSONEnumTableRowProperty;
    (function (JSONEnumTableRowProperty) {
        JSONEnumTableRowProperty[JSONEnumTableRowProperty["CellSpacing"] = 0] = "CellSpacing";
        JSONEnumTableRowProperty[JSONEnumTableRowProperty["Header"] = 1] = "Header";
        JSONEnumTableRowProperty[JSONEnumTableRowProperty["HideCellMark"] = 2] = "HideCellMark";
        JSONEnumTableRowProperty[JSONEnumTableRowProperty["CantSplit"] = 3] = "CantSplit";
        JSONEnumTableRowProperty[JSONEnumTableRowProperty["TableRowAlignment"] = 4] = "TableRowAlignment";
        JSONEnumTableRowProperty[JSONEnumTableRowProperty["UseValue"] = 5] = "UseValue";
        JSONEnumTableRowProperty[JSONEnumTableRowProperty["DivId"] = 6] = "DivId";
    })(JSONEnumTableRowProperty = __aspxRichEdit.JSONEnumTableRowProperty || (__aspxRichEdit.JSONEnumTableRowProperty = {}));
    var JSONEnumClientTableRowInfo;
    (function (JSONEnumClientTableRowInfo) {
        JSONEnumClientTableRowInfo[JSONEnumClientTableRowInfo["RowIndex"] = 0] = "RowIndex";
        JSONEnumClientTableRowInfo[JSONEnumClientTableRowInfo["Cells"] = 1] = "Cells";
        JSONEnumClientTableRowInfo[JSONEnumClientTableRowInfo["RowInfo"] = 2] = "RowInfo";
    })(JSONEnumClientTableRowInfo = __aspxRichEdit.JSONEnumClientTableRowInfo || (__aspxRichEdit.JSONEnumClientTableRowInfo = {}));
    var JSONEnumClientTableRowFormatting;
    (function (JSONEnumClientTableRowFormatting) {
        JSONEnumClientTableRowFormatting[JSONEnumClientTableRowFormatting["Height"] = 0] = "Height";
        JSONEnumClientTableRowFormatting[JSONEnumClientTableRowFormatting["GridBefore"] = 1] = "GridBefore";
        JSONEnumClientTableRowFormatting[JSONEnumClientTableRowFormatting["GridAfter"] = 2] = "GridAfter";
        JSONEnumClientTableRowFormatting[JSONEnumClientTableRowFormatting["WidthAfter"] = 3] = "WidthAfter";
        JSONEnumClientTableRowFormatting[JSONEnumClientTableRowFormatting["WidthBefore"] = 4] = "WidthBefore";
        JSONEnumClientTableRowFormatting[JSONEnumClientTableRowFormatting["TableRowProperties"] = 5] = "TableRowProperties";
        JSONEnumClientTableRowFormatting[JSONEnumClientTableRowFormatting["TablePropertiesException"] = 6] = "TablePropertiesException";
    })(JSONEnumClientTableRowFormatting = __aspxRichEdit.JSONEnumClientTableRowFormatting || (__aspxRichEdit.JSONEnumClientTableRowFormatting = {}));
    var JSONServerTableRowProperty;
    (function (JSONServerTableRowProperty) {
        JSONServerTableRowProperty[JSONServerTableRowProperty["Height"] = 0] = "Height";
        JSONServerTableRowProperty[JSONServerTableRowProperty["CellSpacing"] = 1] = "CellSpacing";
        JSONServerTableRowProperty[JSONServerTableRowProperty["Header"] = 2] = "Header";
        JSONServerTableRowProperty[JSONServerTableRowProperty["HideCellMark"] = 3] = "HideCellMark";
        JSONServerTableRowProperty[JSONServerTableRowProperty["CantSplit"] = 4] = "CantSplit";
        JSONServerTableRowProperty[JSONServerTableRowProperty["TableRowAlignment"] = 5] = "TableRowAlignment";
        JSONServerTableRowProperty[JSONServerTableRowProperty["UseValue"] = 6] = "UseValue";
        JSONServerTableRowProperty[JSONServerTableRowProperty["GridAfter"] = 7] = "GridAfter";
        JSONServerTableRowProperty[JSONServerTableRowProperty["GridBefore"] = 8] = "GridBefore";
        JSONServerTableRowProperty[JSONServerTableRowProperty["WidthAfter"] = 9] = "WidthAfter";
        JSONServerTableRowProperty[JSONServerTableRowProperty["WidthBefore"] = 10] = "WidthBefore";
        JSONServerTableRowProperty[JSONServerTableRowProperty["DivId"] = 11] = "DivId";
    })(JSONServerTableRowProperty = __aspxRichEdit.JSONServerTableRowProperty || (__aspxRichEdit.JSONServerTableRowProperty = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONTableHeightUnitProperty;
    (function (JSONTableHeightUnitProperty) {
        JSONTableHeightUnitProperty[JSONTableHeightUnitProperty["Type"] = 0] = "Type";
        JSONTableHeightUnitProperty[JSONTableHeightUnitProperty["Value"] = 1] = "Value";
    })(JSONTableHeightUnitProperty = __aspxRichEdit.JSONTableHeightUnitProperty || (__aspxRichEdit.JSONTableHeightUnitProperty = {}));
    var JSONTableWidthUnitProperty;
    (function (JSONTableWidthUnitProperty) {
        JSONTableWidthUnitProperty[JSONTableWidthUnitProperty["Type"] = 0] = "Type";
        JSONTableWidthUnitProperty[JSONTableWidthUnitProperty["Value"] = 1] = "Value";
    })(JSONTableWidthUnitProperty = __aspxRichEdit.JSONTableWidthUnitProperty || (__aspxRichEdit.JSONTableWidthUnitProperty = {}));
    var JSONTableCellMarginsProperty;
    (function (JSONTableCellMarginsProperty) {
        JSONTableCellMarginsProperty[JSONTableCellMarginsProperty["Top"] = 0] = "Top";
        JSONTableCellMarginsProperty[JSONTableCellMarginsProperty["Left"] = 1] = "Left";
        JSONTableCellMarginsProperty[JSONTableCellMarginsProperty["Right"] = 2] = "Right";
        JSONTableCellMarginsProperty[JSONTableCellMarginsProperty["Bottom"] = 3] = "Bottom";
    })(JSONTableCellMarginsProperty = __aspxRichEdit.JSONTableCellMarginsProperty || (__aspxRichEdit.JSONTableCellMarginsProperty = {}));
    var JSONTableBordersProperty;
    (function (JSONTableBordersProperty) {
        JSONTableBordersProperty[JSONTableBordersProperty["TopBorder"] = 0] = "TopBorder";
        JSONTableBordersProperty[JSONTableBordersProperty["LeftBorder"] = 1] = "LeftBorder";
        JSONTableBordersProperty[JSONTableBordersProperty["RightBorder"] = 2] = "RightBorder";
        JSONTableBordersProperty[JSONTableBordersProperty["BottomBorder"] = 3] = "BottomBorder";
        JSONTableBordersProperty[JSONTableBordersProperty["InsideHorizontalBorder"] = 4] = "InsideHorizontalBorder";
        JSONTableBordersProperty[JSONTableBordersProperty["InsideVerticalBorder"] = 5] = "InsideVerticalBorder";
    })(JSONTableBordersProperty = __aspxRichEdit.JSONTableBordersProperty || (__aspxRichEdit.JSONTableBordersProperty = {}));
    var JSONTableCellBordersProperty;
    (function (JSONTableCellBordersProperty) {
        JSONTableCellBordersProperty[JSONTableCellBordersProperty["TopBorder"] = 0] = "TopBorder";
        JSONTableCellBordersProperty[JSONTableCellBordersProperty["LeftBorder"] = 1] = "LeftBorder";
        JSONTableCellBordersProperty[JSONTableCellBordersProperty["RightBorder"] = 2] = "RightBorder";
        JSONTableCellBordersProperty[JSONTableCellBordersProperty["BottomBorder"] = 3] = "BottomBorder";
        JSONTableCellBordersProperty[JSONTableCellBordersProperty["TopLeftDiagonalBorder"] = 4] = "TopLeftDiagonalBorder";
        JSONTableCellBordersProperty[JSONTableCellBordersProperty["TopRightDiagonalBorder"] = 5] = "TopRightDiagonalBorder";
    })(JSONTableCellBordersProperty = __aspxRichEdit.JSONTableCellBordersProperty || (__aspxRichEdit.JSONTableCellBordersProperty = {}));
    var JSONTableConditionalStyleProperty;
    (function (JSONTableConditionalStyleProperty) {
        JSONTableConditionalStyleProperty[JSONTableConditionalStyleProperty["TableProperties"] = 0] = "TableProperties";
        JSONTableConditionalStyleProperty[JSONTableConditionalStyleProperty["TableRowPropertiesIndex"] = 1] = "TableRowPropertiesIndex";
        JSONTableConditionalStyleProperty[JSONTableConditionalStyleProperty["TableCellPropertiesIndex"] = 2] = "TableCellPropertiesIndex";
        JSONTableConditionalStyleProperty[JSONTableConditionalStyleProperty["MaskedParagraphPropertiesCacheIndex"] = 3] = "MaskedParagraphPropertiesCacheIndex";
        JSONTableConditionalStyleProperty[JSONTableConditionalStyleProperty["MaskedCharacterPropertiesCacheIndex"] = 4] = "MaskedCharacterPropertiesCacheIndex";
        JSONTableConditionalStyleProperty[JSONTableConditionalStyleProperty["Tabs"] = 5] = "Tabs";
    })(JSONTableConditionalStyleProperty = __aspxRichEdit.JSONTableConditionalStyleProperty || (__aspxRichEdit.JSONTableConditionalStyleProperty = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONListLevelPropertiesConverter = (function () {
        function JSONListLevelPropertiesConverter() {
        }
        JSONListLevelPropertiesConverter.convertFromJSON = function (obj) {
            var result = new __aspxRichEdit.ListLevelProperties();
            result.start = obj[__aspxRichEdit.JSONListLevelProperty.Start];
            result.format = obj[__aspxRichEdit.JSONListLevelProperty.Format];
            result.convertPreviousLevelNumberingToDecimal = !!obj[__aspxRichEdit.JSONListLevelProperty.ConvertPreviousLevelNumberingToDecimal];
            result.suppressBulletResize = !!obj[__aspxRichEdit.JSONListLevelProperty.SuppressBulletResize];
            result.suppressRestart = !!obj[__aspxRichEdit.JSONListLevelProperty.SuppressRestart];
            result.alignment = obj[__aspxRichEdit.JSONListLevelProperty.Alignment];
            result.displayFormatString = obj[__aspxRichEdit.JSONListLevelProperty.DisplayFormatString];
            result.relativeRestartLevel = obj[__aspxRichEdit.JSONListLevelProperty.RelativeRestartLevel];
            result.separator = obj[__aspxRichEdit.JSONListLevelProperty.Separator];
            result.templateCode = obj[__aspxRichEdit.JSONListLevelProperty.TemplateCode];
            result.originalLeftIndent = obj[__aspxRichEdit.JSONListLevelProperty.OriginalLeftIndent];
            result.legacy = !!obj[__aspxRichEdit.JSONListLevelProperty.Legacy];
            result.legacySpace = obj[__aspxRichEdit.JSONListLevelProperty.LegacySpace];
            result.legacyIndent = obj[__aspxRichEdit.JSONListLevelProperty.LegacyIndent];
            return result;
        };
        JSONListLevelPropertiesConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONListLevelProperty.Start] = source.start;
            result[__aspxRichEdit.JSONListLevelProperty.Format] = source.format;
            result[__aspxRichEdit.JSONListLevelProperty.ConvertPreviousLevelNumberingToDecimal] = __aspxRichEdit.Utils.boolToInt(source.convertPreviousLevelNumberingToDecimal);
            result[__aspxRichEdit.JSONListLevelProperty.SuppressBulletResize] = __aspxRichEdit.Utils.boolToInt(source.suppressBulletResize);
            result[__aspxRichEdit.JSONListLevelProperty.SuppressRestart] = __aspxRichEdit.Utils.boolToInt(source.suppressRestart);
            result[__aspxRichEdit.JSONListLevelProperty.Alignment] = source.alignment;
            result[__aspxRichEdit.JSONListLevelProperty.DisplayFormatString] = source.displayFormatString;
            result[__aspxRichEdit.JSONListLevelProperty.RelativeRestartLevel] = source.relativeRestartLevel;
            result[__aspxRichEdit.JSONListLevelProperty.Separator] = source.separator;
            result[__aspxRichEdit.JSONListLevelProperty.TemplateCode] = source.templateCode;
            result[__aspxRichEdit.JSONListLevelProperty.OriginalLeftIndent] = source.originalLeftIndent;
            result[__aspxRichEdit.JSONListLevelProperty.Legacy] = __aspxRichEdit.Utils.boolToInt(source.legacy);
            result[__aspxRichEdit.JSONListLevelProperty.LegacySpace] = source.legacySpace;
            result[__aspxRichEdit.JSONListLevelProperty.LegacyIndent] = source.legacyIndent;
            return result;
        };
        return JSONListLevelPropertiesConverter;
    }());
    __aspxRichEdit.JSONListLevelPropertiesConverter = JSONListLevelPropertiesConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONNumberingListImporter = (function () {
        function JSONNumberingListImporter() {
        }
        JSONNumberingListImporter.importAbstractNumberingLists = function (documentModel, content) {
            for (var _i = 0, content_5 = content; _i < content_5.length; _i++) {
                var jsonNumbList = content_5[_i];
                documentModel.abstractNumberingLists.push(JSONNumberingListImporter.getAbstractNumbertingList(documentModel, jsonNumbList));
            }
        };
        JSONNumberingListImporter.importNumberingLists = function (documentModel, content) {
            for (var _i = 0, content_6 = content; _i < content_6.length; _i++) {
                var jsonNumbList = content_6[_i];
                documentModel.numberingLists.push(JSONNumberingListImporter.getNumberingList(documentModel, jsonNumbList));
            }
        };
        JSONNumberingListImporter.importAbstractNumberingListTemplates = function (documentModel, content) {
            if (!content)
                return;
            for (var _i = 0, content_7 = content; _i < content_7.length; _i++) {
                var jsonNumbList = content_7[_i];
                documentModel.abstractNumberingListTemplates.push(JSONNumberingListImporter.getAbstractNumbertingList(documentModel, jsonNumbList));
            }
        };
        JSONNumberingListImporter.getAbstractNumbertingList = function (documentModel, content) {
            var abstractNumberingList = new __aspxRichEdit.AbstractNumberingList(documentModel);
            abstractNumberingList.deleted = !!content[__aspxRichEdit.JSONAbstractNumberingListProperty.Deleted];
            abstractNumberingList.innerId = content[__aspxRichEdit.JSONAbstractNumberingListProperty.Id];
            abstractNumberingList.levels = JSONNumberingListImporter.getAbstractNumberingListLevels(documentModel, content[__aspxRichEdit.JSONAbstractNumberingListProperty.Levels]);
            return abstractNumberingList;
        };
        JSONNumberingListImporter.getNumberingList = function (documentModel, content) {
            var numberingList = new __aspxRichEdit.NumberingList(documentModel, content[__aspxRichEdit.JSONNumberingListProperty.AlIndex]);
            numberingList.deleted = false;
            numberingList.innerId = content[__aspxRichEdit.JSONNumberingListProperty.Id];
            numberingList.levels = JSONNumberingListImporter.getNumberingListLevels(documentModel, content[__aspxRichEdit.JSONNumberingListProperty.Levels], numberingList);
            return numberingList;
        };
        JSONNumberingListImporter.getAbstractNumberingListLevels = function (documentModel, content) {
            var result = [];
            for (var i = 0, obj; obj = content[i]; i++) {
                var maskedCharacterProperties = documentModel.cache.maskedCharacterPropertiesCache.getItemByJsonKey(obj[__aspxRichEdit.JSONNumberingListLevelProperty.CharacterPropertiesIndex]);
                var maskedParagraphProperties = documentModel.cache.maskedParagraphPropertiesCache.getItemByJsonKey(obj[__aspxRichEdit.JSONNumberingListLevelProperty.ParagraphPropertiesIndex]);
                var listLevelProperties = documentModel.cache.listLevelPropertiesCache.getItemByJsonKey(obj[__aspxRichEdit.JSONNumberingListLevelProperty.ListLevelPropertiesIndex]);
                result.push(new __aspxRichEdit.ListLevel(documentModel, maskedCharacterProperties, maskedParagraphProperties, listLevelProperties));
            }
            return result;
        };
        JSONNumberingListImporter.getNumberingListLevels = function (documentModel, content, numberingList) {
            var result = [];
            for (var _i = 0, content_8 = content; _i < content_8.length; _i++) {
                var obj = content_8[_i];
                var listLevel = void 0;
                if (obj[__aspxRichEdit.JSONNumberingOverrideListLevelProperty.Level] === undefined) {
                    var maskedCharacterProperties = documentModel.cache.maskedCharacterPropertiesCache.getItemByJsonKey(obj[__aspxRichEdit.JSONNumberingListLevelProperty.CharacterPropertiesIndex]);
                    var maskedParagraphProperties = documentModel.cache.maskedParagraphPropertiesCache.getItemByJsonKey(obj[__aspxRichEdit.JSONNumberingListLevelProperty.ParagraphPropertiesIndex]);
                    var listLevelProperties = documentModel.cache.listLevelPropertiesCache.getItemByJsonKey(obj[__aspxRichEdit.JSONNumberingListLevelProperty.ListLevelPropertiesIndex]);
                    listLevel = new __aspxRichEdit.OverrideListLevel(documentModel, maskedCharacterProperties, maskedParagraphProperties, listLevelProperties);
                }
                else {
                    listLevel = new __aspxRichEdit.NumberingListReferenceLevel(numberingList, obj[__aspxRichEdit.JSONNumberingOverrideListLevelProperty.Level]);
                }
                listLevel.setNewStart(obj[__aspxRichEdit.JSONNumberingOverrideListLevelProperty.NewStart]);
                listLevel.overrideStart = !!obj[__aspxRichEdit.JSONNumberingOverrideListLevelProperty.OverrideStart];
                result.push(listLevel);
            }
            return result;
        };
        return JSONNumberingListImporter;
    }());
    __aspxRichEdit.JSONNumberingListImporter = JSONNumberingListImporter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONColumnsSectionPropertiesConverter = (function () {
        function JSONColumnsSectionPropertiesConverter() {
        }
        JSONColumnsSectionPropertiesConverter.convertFromJSON = function (jsonColumns) {
            var result = [];
            for (var _i = 0, jsonColumns_1 = jsonColumns; _i < jsonColumns_1.length; _i++) {
                var jsonColumn = jsonColumns_1[_i];
                result.push(new __aspxRichEdit.SectionColumnProperties(jsonColumn[__aspxRichEdit.JSONColumnInfoProperty.Width], jsonColumn[__aspxRichEdit.JSONColumnInfoProperty.Space]));
            }
            return result;
        };
        JSONColumnsSectionPropertiesConverter.convertToJSON = function (columns) {
            var result = [];
            for (var _i = 0, columns_3 = columns; _i < columns_3.length; _i++) {
                var column = columns_3[_i];
                var jsonColumn = {};
                jsonColumn[__aspxRichEdit.JSONColumnInfoProperty.Width] = column.width;
                jsonColumn[__aspxRichEdit.JSONColumnInfoProperty.Space] = column.space;
                result.push(jsonColumn);
            }
            return result;
        };
        return JSONColumnsSectionPropertiesConverter;
    }());
    __aspxRichEdit.JSONColumnsSectionPropertiesConverter = JSONColumnsSectionPropertiesConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONSectionPropertiesConverter = (function () {
        function JSONSectionPropertiesConverter() {
        }
        JSONSectionPropertiesConverter.convertFromJSON = function (obj) {
            var result = new __aspxRichEdit.SectionProperties();
            result.marginLeft = obj[__aspxRichEdit.JSONSectionProperty.MarginLeft];
            result.marginTop = obj[__aspxRichEdit.JSONSectionProperty.MarginTop];
            result.marginRight = obj[__aspxRichEdit.JSONSectionProperty.MarginRight];
            result.marginBottom = obj[__aspxRichEdit.JSONSectionProperty.MarginBottom];
            result.columnCount = obj[__aspxRichEdit.JSONSectionProperty.ColumnCount];
            result.space = obj[__aspxRichEdit.JSONSectionProperty.Space];
            result.columnsInfo = __aspxRichEdit.JSONColumnsSectionPropertiesConverter.convertFromJSON(obj[__aspxRichEdit.JSONSectionProperty.ColumnsInfo]);
            result.pageWidth = obj[__aspxRichEdit.JSONSectionProperty.PageWidth];
            result.pageHeight = obj[__aspxRichEdit.JSONSectionProperty.PageHeight];
            result.startType = obj[__aspxRichEdit.JSONSectionProperty.StartType];
            result.landscape = !!obj[__aspxRichEdit.JSONSectionProperty.Landscape];
            result.equalWidthColumns = !!obj[__aspxRichEdit.JSONSectionProperty.EqualWidthColumns];
            result.differentFirstPage = !!obj[__aspxRichEdit.JSONSectionProperty.DifferentFirstPage];
            result.headerOffset = obj[__aspxRichEdit.JSONSectionProperty.HeaderOffset];
            result.footerOffset = obj[__aspxRichEdit.JSONSectionProperty.FooterOffset];
            if (!result.equalWidthColumns)
                while (result.columnCount > result.columnsInfo.length)
                    result.columnsInfo.push(new __aspxRichEdit.SectionColumnProperties(0, 0));
            return result;
        };
        JSONSectionPropertiesConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONSectionProperty.MarginLeft] = source.marginLeft;
            result[__aspxRichEdit.JSONSectionProperty.MarginTop] = source.marginTop;
            result[__aspxRichEdit.JSONSectionProperty.MarginRight] = source.marginRight;
            result[__aspxRichEdit.JSONSectionProperty.MarginBottom] = source.marginBottom;
            result[__aspxRichEdit.JSONSectionProperty.ColumnCount] = source.columnCount;
            result[__aspxRichEdit.JSONSectionProperty.Space] = source.space;
            result[__aspxRichEdit.JSONSectionProperty.ColumnsInfo] = __aspxRichEdit.JSONColumnsSectionPropertiesConverter.convertToJSON(source.columnsInfo);
            result[__aspxRichEdit.JSONSectionProperty.PageWidth] = source.pageWidth;
            result[__aspxRichEdit.JSONSectionProperty.PageHeight] = source.pageHeight;
            result[__aspxRichEdit.JSONSectionProperty.StartType] = source.startType;
            result[__aspxRichEdit.JSONSectionProperty.Landscape] = __aspxRichEdit.Utils.boolToInt(source.landscape);
            result[__aspxRichEdit.JSONSectionProperty.EqualWidthColumns] = __aspxRichEdit.Utils.boolToInt(source.equalWidthColumns);
            result[__aspxRichEdit.JSONSectionProperty.DifferentFirstPage] = __aspxRichEdit.Utils.boolToInt(source.differentFirstPage);
            result[__aspxRichEdit.JSONSectionProperty.HeaderOffset] = source.headerOffset;
            result[__aspxRichEdit.JSONSectionProperty.FooterOffset] = source.footerOffset;
            return result;
        };
        return JSONSectionPropertiesConverter;
    }());
    __aspxRichEdit.JSONSectionPropertiesConverter = JSONSectionPropertiesConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONAnchorInfoConverter = (function () {
        function JSONAnchorInfoConverter() {
        }
        JSONAnchorInfoConverter.convertFromJSON = function (obj) {
            var result = new __aspxRichEdit.AnchorInfo();
            result.allowOverlap = !!obj[__aspxRichEdit.JSONAnchorInfoProperty.AllowOverlap];
            result.hidden = !!obj[__aspxRichEdit.JSONAnchorInfoProperty.Hidden];
            result.layoutTableCell = !!obj[__aspxRichEdit.JSONAnchorInfoProperty.LayoutTableCell];
            result.locked = !!obj[__aspxRichEdit.JSONAnchorInfoProperty.Locked];
            result.isBehindDoc = !!obj[__aspxRichEdit.JSONAnchorInfoProperty.IsBehindDoc];
            result.leftDistance = obj[__aspxRichEdit.JSONAnchorInfoProperty.LeftDistance];
            result.rightDistance = obj[__aspxRichEdit.JSONAnchorInfoProperty.RightDistance];
            result.topDistance = obj[__aspxRichEdit.JSONAnchorInfoProperty.TopDistance];
            result.bottomDistance = obj[__aspxRichEdit.JSONAnchorInfoProperty.BottomDistance];
            result.zOrder = obj[__aspxRichEdit.JSONAnchorInfoProperty.ZOrder];
            result.wrapType = obj[__aspxRichEdit.JSONAnchorInfoProperty.WrapType];
            result.wrapSide = obj[__aspxRichEdit.JSONAnchorInfoProperty.WrapSide];
            result.horizontalPositionType = obj[__aspxRichEdit.JSONAnchorInfoProperty.HorizontalPositionType];
            result.horizontalPositionAlignment = obj[__aspxRichEdit.JSONAnchorInfoProperty.HorizontalPositionAlignment];
            result.verticalPositionType = obj[__aspxRichEdit.JSONAnchorInfoProperty.VerticalPositionType];
            result.verticalPositionAlignment = obj[__aspxRichEdit.JSONAnchorInfoProperty.VerticalPositionAlignment];
            result.offset = new __aspxRichEdit.Point(obj[__aspxRichEdit.JSONAnchorInfoProperty.OffsetX], obj[__aspxRichEdit.JSONAnchorInfoProperty.OffsetY]);
            result.percentOffset = new __aspxRichEdit.Point(obj[__aspxRichEdit.JSONAnchorInfoProperty.PercentOffsetX], obj[__aspxRichEdit.JSONAnchorInfoProperty.PercentOffsetY]);
            return result;
        };
        JSONAnchorInfoConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONAnchorInfoProperty.AllowOverlap] = __aspxRichEdit.Utils.boolToInt(source.allowOverlap);
            result[__aspxRichEdit.JSONAnchorInfoProperty.Hidden] = __aspxRichEdit.Utils.boolToInt(source.hidden);
            result[__aspxRichEdit.JSONAnchorInfoProperty.LayoutTableCell] = __aspxRichEdit.Utils.boolToInt(source.layoutTableCell);
            result[__aspxRichEdit.JSONAnchorInfoProperty.Locked] = __aspxRichEdit.Utils.boolToInt(source.locked);
            result[__aspxRichEdit.JSONAnchorInfoProperty.IsBehindDoc] = __aspxRichEdit.Utils.boolToInt(source.isBehindDoc);
            result[__aspxRichEdit.JSONAnchorInfoProperty.LeftDistance] = source.leftDistance;
            result[__aspxRichEdit.JSONAnchorInfoProperty.RightDistance] = source.rightDistance;
            result[__aspxRichEdit.JSONAnchorInfoProperty.TopDistance] = source.topDistance;
            result[__aspxRichEdit.JSONAnchorInfoProperty.BottomDistance] = source.bottomDistance;
            result[__aspxRichEdit.JSONAnchorInfoProperty.ZOrder] = source.zOrder;
            result[__aspxRichEdit.JSONAnchorInfoProperty.WrapType] = source.wrapType;
            result[__aspxRichEdit.JSONAnchorInfoProperty.WrapSide] = source.wrapSide;
            result[__aspxRichEdit.JSONAnchorInfoProperty.HorizontalPositionType] = source.horizontalPositionType;
            result[__aspxRichEdit.JSONAnchorInfoProperty.HorizontalPositionAlignment] = source.horizontalPositionAlignment;
            result[__aspxRichEdit.JSONAnchorInfoProperty.VerticalPositionType] = source.verticalPositionType;
            result[__aspxRichEdit.JSONAnchorInfoProperty.VerticalPositionAlignment] = source.verticalPositionAlignment;
            result[__aspxRichEdit.JSONAnchorInfoProperty.OffsetX] = source.offset.x;
            result[__aspxRichEdit.JSONAnchorInfoProperty.OffsetY] = source.offset.y;
            result[__aspxRichEdit.JSONAnchorInfoProperty.PercentOffsetX] = source.percentOffset.x;
            result[__aspxRichEdit.JSONAnchorInfoProperty.PercentOffsetY] = source.percentOffset.y;
            return result;
        };
        return JSONAnchorInfoConverter;
    }());
    __aspxRichEdit.JSONAnchorInfoConverter = JSONAnchorInfoConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONSubDocumentImporter = (function () {
        function JSONSubDocumentImporter() {
        }
        JSONSubDocumentImporter.importSubDocument = function (subDocument, documentProtectionSettings, content, customRunAction) {
            __aspxRichEdit.JSONTableImporter.importTables(subDocument, content[__aspxRichEdit.JSONEnumLoadPieceTable.Tables]);
            JSONSubDocumentImporter.importFields(subDocument, content[__aspxRichEdit.JSONEnumLoadPieceTable.Fields]);
            JSONSubDocumentImporter.importBookmarks(subDocument, content[__aspxRichEdit.JSONEnumLoadPieceTable.Bookmarks]);
            JSONSubDocumentImporter.importParagraphs(subDocument, content[__aspxRichEdit.JSONEnumLoadPieceTable.Paragraphs]);
            JSONSubDocumentImporter.importChunks(subDocument, content[__aspxRichEdit.JSONEnumLoadPieceTable.Chunks], customRunAction);
            JSONSubDocumentImporter.importRangePermissions(subDocument, documentProtectionSettings, content[__aspxRichEdit.JSONEnumLoadPieceTable.RangePermissions]);
        };
        JSONSubDocumentImporter.importFields = function (subDocument, jsonFields) {
            if (!jsonFields)
                return;
            for (var fieldIndex = 0, jsonField; jsonField = jsonFields[fieldIndex]; fieldIndex++) {
                var hyperlinkInfo = undefined;
                var uri = jsonField[__aspxRichEdit.JSONFieldProperty.Uri];
                var anchor = jsonField[__aspxRichEdit.JSONFieldProperty.Anchor];
                if (uri !== undefined || anchor !== undefined)
                    hyperlinkInfo = new __aspxRichEdit.HyperlinkInfo(uri, anchor, jsonField[__aspxRichEdit.JSONFieldProperty.Tip], !!jsonField[__aspxRichEdit.JSONFieldProperty.Visited]);
                subDocument.fields.push(new __aspxRichEdit.Field(subDocument.positionManager, fieldIndex, jsonField[__aspxRichEdit.JSONFieldProperty.StartPos], jsonField[__aspxRichEdit.JSONFieldProperty.SeparatorPos], jsonField[__aspxRichEdit.JSONFieldProperty.EndPos], false, hyperlinkInfo));
            }
            subDocument.fields.sort(function (a, b) { return a.getCodeStartPosition() - b.getCodeStartPosition(); });
            for (var fieldIndex = 0, field; field = subDocument.fields[fieldIndex]; fieldIndex++) {
                field.index = fieldIndex;
                field.initParent(subDocument.fields);
            }
        };
        JSONSubDocumentImporter.importBookmarks = function (subDocument, content) {
            if (!content)
                return;
            __aspxRichEdit.ListUtils.foreach(content, function (jsonBookmark) {
                var start = parseInt(jsonBookmark[__aspxRichEdit.JSONBookmarkProperty.StartPos]);
                var len = parseInt(jsonBookmark[__aspxRichEdit.JSONBookmarkProperty.Length]);
                var name = jsonBookmark[__aspxRichEdit.JSONBookmarkProperty.Name];
                subDocument.bookmarks.push(new __aspxRichEdit.Bookmark(subDocument.positionManager, new __aspxRichEdit.FixedInterval(start, len), name));
            });
            subDocument.bookmarks = subDocument.bookmarks.sort(__aspxRichEdit.CompareUtils.bookmarksComparer);
        };
        JSONSubDocumentImporter.importRangePermissions = function (subDocument, documentProtectionSettings, content) {
            if (!content)
                return;
            subDocument.rangePermissions = !subDocument.documentModel.isDocumentProtectionEnabled ?
                [] :
                __aspxRichEdit.ListUtils.reducedMap(content, function (jsonRangePermissions) {
                    var start = parseInt(jsonRangePermissions[__aspxRichEdit.JSONRangePermissionProperty.Start]);
                    var len = parseInt(jsonRangePermissions[__aspxRichEdit.JSONRangePermissionProperty.Length]) + 1;
                    var rangePermission = new __aspxRichEdit.RangePermission(subDocument.positionManager, new __aspxRichEdit.FixedInterval(start, len), jsonRangePermissions[__aspxRichEdit.JSONRangePermissionProperty.UserName], jsonRangePermissions[__aspxRichEdit.JSONRangePermissionProperty.Group]);
                    return rangePermission.isGranted(documentProtectionSettings) ? rangePermission : null;
                });
        };
        JSONSubDocumentImporter.importParagraphs = function (subDocument, jsonParagraphs) {
            if (!jsonParagraphs)
                return;
            var paragraphs = subDocument.paragraphs;
            var parStyles = subDocument.documentModel.paragraphStyles;
            var positionManager = subDocument.positionManager;
            for (var _i = 0, jsonParagraphs_1 = jsonParagraphs; _i < jsonParagraphs_1.length; _i++) {
                var jsonParagraph = jsonParagraphs_1[_i];
                var paragraph = new __aspxRichEdit.Paragraph(subDocument, positionManager.registerPosition(jsonParagraph[__aspxRichEdit.JSONParagraphProperty.LogPosition]), jsonParagraph[__aspxRichEdit.JSONParagraphProperty.Length], parStyles[jsonParagraph[__aspxRichEdit.JSONParagraphProperty.ParagraphStyleIndex]], null, jsonParagraph[__aspxRichEdit.JSONParagraphProperty.MaskedParagraphPropertiesIndex]);
                paragraph.numberingListIndex = jsonParagraph[__aspxRichEdit.JSONParagraphProperty.ListIndex];
                paragraph.listLevelIndex = jsonParagraph[__aspxRichEdit.JSONParagraphProperty.ListLevelIndex];
                paragraph.tabs.setTabs(__aspxRichEdit.JSONTabConverter.convertFromJSONToTabProperties(jsonParagraph[__aspxRichEdit.JSONParagraphProperty.Tabs]));
                paragraphs.push(paragraph);
            }
        };
        JSONSubDocumentImporter.importChunks = function (subDocument, jsonChunks, customRunAction) {
            if (!jsonChunks)
                return;
            var charStyles = subDocument.documentModel.characterStyles;
            var maskedCharacterPropertiesCache = subDocument.documentModel.cache.maskedCharacterPropertiesCache;
            for (var key in JSONSubDocumentImporter.runTypeToRunImporter) {
                if (!JSONSubDocumentImporter.runTypeToRunImporter.hasOwnProperty(key))
                    continue;
                JSONSubDocumentImporter.runTypeToRunImporter[key].init(maskedCharacterPropertiesCache, charStyles, customRunAction);
            }
            var chunks = subDocument.chunks;
            var paragraphs = subDocument.paragraphs;
            var firstChunkPosition = jsonChunks[0][__aspxRichEdit.JSONChunkProperty.StartPos];
            var currParagraphIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(paragraphs, function (p) { return p.startLogPosition.value; }, firstChunkPosition);
            var currParagraph = paragraphs[currParagraphIndex];
            var currParagraphEndPos = currParagraph.getEndPosition();
            for (var _i = 0, jsonChunks_1 = jsonChunks; _i < jsonChunks_1.length; _i++) {
                var jsonChunk = jsonChunks_1[_i];
                var currChunkPosition = jsonChunk[__aspxRichEdit.JSONChunkProperty.StartPos];
                var chunk = new __aspxRichEdit.Chunk(subDocument.positionManager.registerPosition(currChunkPosition), jsonChunk[__aspxRichEdit.JSONChunkProperty.TextBuffer], !!jsonChunk[__aspxRichEdit.JSONChunkProperty.IsLast]);
                chunks.push(chunk);
                for (var _a = 0, _b = jsonChunk[__aspxRichEdit.JSONChunkProperty.Runs]; _a < _b.length; _a++) {
                    var jsonRun = _b[_a];
                    var runOffset = jsonRun[__aspxRichEdit.JSONRunBaseProperty.Offset];
                    if (currChunkPosition + runOffset >= currParagraphEndPos) {
                        currParagraph = paragraphs[++currParagraphIndex];
                        currParagraphEndPos = currParagraph.getEndPosition();
                    }
                    chunk.textRuns.push(JSONSubDocumentImporter.runTypeToRunImporter[jsonRun[__aspxRichEdit.JSONRunBaseProperty.Type]]
                        .getRun(currParagraph, runOffset, jsonRun));
                }
            }
        };
        JSONSubDocumentImporter.runTypeToRunImporter = new __aspxRichEdit.MapCreatorNumberAsKey()
            .add(__aspxRichEdit.RunType.TextRun, new __aspxRichEdit.TextRunImporter())
            .add(__aspxRichEdit.RunType.ParagraphRun, new __aspxRichEdit.SimpleRunImporter(__aspxRichEdit.ParagraphRun))
            .add(__aspxRichEdit.RunType.SectionRun, new __aspxRichEdit.SimpleRunImporter(__aspxRichEdit.SectionRun))
            .add(__aspxRichEdit.RunType.FieldCodeStartRun, new __aspxRichEdit.SimpleRunImporter(__aspxRichEdit.FieldCodeStartRun))
            .add(__aspxRichEdit.RunType.FieldCodeEndRun, new __aspxRichEdit.SimpleRunImporter(__aspxRichEdit.FieldCodeEndRun))
            .add(__aspxRichEdit.RunType.FieldResultEndRun, new __aspxRichEdit.SimpleRunImporter(__aspxRichEdit.FieldResultEndRun))
            .add(__aspxRichEdit.RunType.AnchoredPictureRun, new __aspxRichEdit.AnchoredPictureRunImporter())
            .add(__aspxRichEdit.RunType.AnchoredTextBoxRun, new __aspxRichEdit.AnchoredTextBoxRunImporter())
            .add(__aspxRichEdit.RunType.InlinePictureRun, new __aspxRichEdit.InlinePictureRunImporter())
            .add(__aspxRichEdit.RunType.InlineTextBoxRun, new __aspxRichEdit.InlineTextBoxRunImporter())
            .add(__aspxRichEdit.RunType.LayoutDependentRun, new __aspxRichEdit.SimpleRunImporter(__aspxRichEdit.LayoutDependentRun))
            .add(__aspxRichEdit.RunType.FootNoteRun, new __aspxRichEdit.SimpleRunImporter(__aspxRichEdit.FootNoteRun))
            .add(__aspxRichEdit.RunType.EndNoteRun, new __aspxRichEdit.SimpleRunImporter(__aspxRichEdit.EndNoteRun))
            .get();
        return JSONSubDocumentImporter;
    }());
    __aspxRichEdit.JSONSubDocumentImporter = JSONSubDocumentImporter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONTextBoxContentMarginsConverter = (function () {
        function JSONTextBoxContentMarginsConverter() {
        }
        JSONTextBoxContentMarginsConverter.convertFromJSON = function (obj) {
            return new __aspxRichEdit.Margins(obj[__aspxRichEdit.JSONTextBoxContentMargins.Left], obj[__aspxRichEdit.JSONTextBoxContentMargins.Right], obj[__aspxRichEdit.JSONTextBoxContentMargins.Top], obj[__aspxRichEdit.JSONTextBoxContentMargins.Bottom]);
        };
        JSONTextBoxContentMarginsConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONTextBoxContentMargins.Left] = source.left;
            result[__aspxRichEdit.JSONTextBoxContentMargins.Right] = source.right;
            result[__aspxRichEdit.JSONTextBoxContentMargins.Top] = source.top;
            result[__aspxRichEdit.JSONTextBoxContentMargins.Bottom] = source.bottom;
            return result;
        };
        return JSONTextBoxContentMarginsConverter;
    }());
    __aspxRichEdit.JSONTextBoxContentMarginsConverter = JSONTextBoxContentMarginsConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONTextBoxPropertiesConverter = (function () {
        function JSONTextBoxPropertiesConverter() {
        }
        JSONTextBoxPropertiesConverter.convertFromJSON = function (obj) {
            var result = new __aspxRichEdit.TextBoxProperties();
            result.resizeShapeToFitText = !!obj[__aspxRichEdit.JSONTextBoxProperties.ResizeShapeToFitText];
            result.upright = !!obj[__aspxRichEdit.JSONTextBoxProperties.Upright];
            result.verticalAlignment = obj[__aspxRichEdit.JSONTextBoxProperties.VerticalAlignment];
            result.wrapText = !!obj[__aspxRichEdit.JSONTextBoxProperties.WrapText];
            result.leftMargin = obj[__aspxRichEdit.JSONTextBoxProperties.LeftMargin];
            result.rightMargin = obj[__aspxRichEdit.JSONTextBoxProperties.RightMargin];
            result.topMargin = obj[__aspxRichEdit.JSONTextBoxProperties.TopMargin];
            result.bottomMargin = obj[__aspxRichEdit.JSONTextBoxProperties.BottomMargin];
            return result;
        };
        JSONTextBoxPropertiesConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONTextBoxProperties.ResizeShapeToFitText] = __aspxRichEdit.Utils.boolToInt(source.resizeShapeToFitText);
            result[__aspxRichEdit.JSONTextBoxProperties.Upright] = __aspxRichEdit.Utils.boolToInt(source.upright);
            result[__aspxRichEdit.JSONTextBoxProperties.VerticalAlignment] = source.verticalAlignment;
            result[__aspxRichEdit.JSONTextBoxProperties.WrapText] = __aspxRichEdit.Utils.boolToInt(source.wrapText);
            result[__aspxRichEdit.JSONTextBoxProperties.LeftMargin] = source.leftMargin;
            result[__aspxRichEdit.JSONTextBoxProperties.RightMargin] = source.rightMargin;
            result[__aspxRichEdit.JSONTextBoxProperties.TopMargin] = source.topMargin;
            result[__aspxRichEdit.JSONTextBoxProperties.BottomMargin] = source.bottomMargin;
            return result;
        };
        return JSONTextBoxPropertiesConverter;
    }());
    __aspxRichEdit.JSONTextBoxPropertiesConverter = JSONTextBoxPropertiesConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONTableBordersConverter = (function () {
        function JSONTableBordersConverter() {
        }
        JSONTableBordersConverter.convertFromJSON = function (obj, colorModelInfoCache) {
            var result = new __aspxRichEdit.TableBorders();
            result.topBorder = __aspxRichEdit.JSONBorderInfoConverter.convertFromJSON(obj[__aspxRichEdit.JSONTableBordersProperty.TopBorder], colorModelInfoCache);
            result.leftBorder = __aspxRichEdit.JSONBorderInfoConverter.convertFromJSON(obj[__aspxRichEdit.JSONTableBordersProperty.LeftBorder], colorModelInfoCache);
            result.rightBorder = __aspxRichEdit.JSONBorderInfoConverter.convertFromJSON(obj[__aspxRichEdit.JSONTableBordersProperty.RightBorder], colorModelInfoCache);
            result.bottomBorder = __aspxRichEdit.JSONBorderInfoConverter.convertFromJSON(obj[__aspxRichEdit.JSONTableBordersProperty.BottomBorder], colorModelInfoCache);
            result.insideHorizontalBorder = __aspxRichEdit.JSONBorderInfoConverter.convertFromJSON(obj[__aspxRichEdit.JSONTableBordersProperty.InsideHorizontalBorder], colorModelInfoCache);
            result.insideVerticalBorder = __aspxRichEdit.JSONBorderInfoConverter.convertFromJSON(obj[__aspxRichEdit.JSONTableBordersProperty.InsideVerticalBorder], colorModelInfoCache);
            return result;
        };
        JSONTableBordersConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONTableBordersProperty.TopBorder] = __aspxRichEdit.JSONBorderInfoConverter.convertToJSON(source.topBorder);
            result[__aspxRichEdit.JSONTableBordersProperty.LeftBorder] = __aspxRichEdit.JSONBorderInfoConverter.convertToJSON(source.leftBorder);
            result[__aspxRichEdit.JSONTableBordersProperty.RightBorder] = __aspxRichEdit.JSONBorderInfoConverter.convertToJSON(source.rightBorder);
            result[__aspxRichEdit.JSONTableBordersProperty.BottomBorder] = __aspxRichEdit.JSONBorderInfoConverter.convertToJSON(source.bottomBorder);
            result[__aspxRichEdit.JSONTableBordersProperty.InsideHorizontalBorder] = __aspxRichEdit.JSONBorderInfoConverter.convertToJSON(source.insideHorizontalBorder);
            result[__aspxRichEdit.JSONTableBordersProperty.InsideVerticalBorder] = __aspxRichEdit.JSONBorderInfoConverter.convertToJSON(source.insideVerticalBorder);
            return result;
        };
        return JSONTableBordersConverter;
    }());
    __aspxRichEdit.JSONTableBordersConverter = JSONTableBordersConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONTableCellBordersConverter = (function () {
        function JSONTableCellBordersConverter() {
        }
        JSONTableCellBordersConverter.convertFromJSON = function (obj, colorModelInfoCache) {
            var result = new __aspxRichEdit.TableCellBorders();
            result.topBorder = __aspxRichEdit.JSONBorderInfoConverter.convertFromJSON(obj[__aspxRichEdit.JSONTableCellBordersProperty.TopBorder], colorModelInfoCache);
            result.leftBorder = __aspxRichEdit.JSONBorderInfoConverter.convertFromJSON(obj[__aspxRichEdit.JSONTableCellBordersProperty.LeftBorder], colorModelInfoCache);
            result.rightBorder = __aspxRichEdit.JSONBorderInfoConverter.convertFromJSON(obj[__aspxRichEdit.JSONTableCellBordersProperty.RightBorder], colorModelInfoCache);
            result.bottomBorder = __aspxRichEdit.JSONBorderInfoConverter.convertFromJSON(obj[__aspxRichEdit.JSONTableCellBordersProperty.BottomBorder], colorModelInfoCache);
            result.topLeftDiagonalBorder = __aspxRichEdit.JSONBorderInfoConverter.convertFromJSON(obj[__aspxRichEdit.JSONTableCellBordersProperty.TopLeftDiagonalBorder], colorModelInfoCache);
            result.topRightDiagonalBorder = __aspxRichEdit.JSONBorderInfoConverter.convertFromJSON(obj[__aspxRichEdit.JSONTableCellBordersProperty.TopRightDiagonalBorder], colorModelInfoCache);
            return result;
        };
        JSONTableCellBordersConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONTableCellBordersProperty.TopBorder] = __aspxRichEdit.JSONBorderInfoConverter.convertToJSON(source.topBorder);
            result[__aspxRichEdit.JSONTableCellBordersProperty.LeftBorder] = __aspxRichEdit.JSONBorderInfoConverter.convertToJSON(source.leftBorder);
            result[__aspxRichEdit.JSONTableCellBordersProperty.RightBorder] = __aspxRichEdit.JSONBorderInfoConverter.convertToJSON(source.rightBorder);
            result[__aspxRichEdit.JSONTableCellBordersProperty.BottomBorder] = __aspxRichEdit.JSONBorderInfoConverter.convertToJSON(source.bottomBorder);
            result[__aspxRichEdit.JSONTableCellBordersProperty.TopLeftDiagonalBorder] = __aspxRichEdit.JSONBorderInfoConverter.convertToJSON(source.topLeftDiagonalBorder);
            result[__aspxRichEdit.JSONTableCellBordersProperty.TopRightDiagonalBorder] = __aspxRichEdit.JSONBorderInfoConverter.convertToJSON(source.topRightDiagonalBorder);
            return result;
        };
        return JSONTableCellBordersConverter;
    }());
    __aspxRichEdit.JSONTableCellBordersConverter = JSONTableCellBordersConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONTableCellMarginsConverter = (function () {
        function JSONTableCellMarginsConverter() {
        }
        JSONTableCellMarginsConverter.convertFromJSON = function (obj) {
            var result = new __aspxRichEdit.TableCellMargins();
            result.top = __aspxRichEdit.JSONTableWidthUnitConverter.convertFromJSON(obj[__aspxRichEdit.JSONTableCellMarginsProperty.Top]);
            result.left = __aspxRichEdit.JSONTableWidthUnitConverter.convertFromJSON(obj[__aspxRichEdit.JSONTableCellMarginsProperty.Left]);
            result.right = __aspxRichEdit.JSONTableWidthUnitConverter.convertFromJSON(obj[__aspxRichEdit.JSONTableCellMarginsProperty.Right]);
            result.bottom = __aspxRichEdit.JSONTableWidthUnitConverter.convertFromJSON(obj[__aspxRichEdit.JSONTableCellMarginsProperty.Bottom]);
            return result;
        };
        JSONTableCellMarginsConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONTableCellMarginsProperty.Top] = __aspxRichEdit.JSONTableWidthUnitConverter.convertToJSON(source.top);
            result[__aspxRichEdit.JSONTableCellMarginsProperty.Left] = __aspxRichEdit.JSONTableWidthUnitConverter.convertToJSON(source.left);
            result[__aspxRichEdit.JSONTableCellMarginsProperty.Right] = __aspxRichEdit.JSONTableWidthUnitConverter.convertToJSON(source.right);
            result[__aspxRichEdit.JSONTableCellMarginsProperty.Bottom] = __aspxRichEdit.JSONTableWidthUnitConverter.convertToJSON(source.bottom);
            return result;
        };
        return JSONTableCellMarginsConverter;
    }());
    __aspxRichEdit.JSONTableCellMarginsConverter = JSONTableCellMarginsConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONTableCellPropertiesConverter = (function () {
        function JSONTableCellPropertiesConverter() {
        }
        JSONTableCellPropertiesConverter.convertFromJSON = function (obj, colorModelInfoCache, shadingInfoCache) {
            var result = new __aspxRichEdit.TableCellProperties();
            result.cellMargins = __aspxRichEdit.JSONTableCellMarginsConverter.convertFromJSON(obj[__aspxRichEdit.JSONEnumTableCellProperty.CellMargins]);
            result.borders = __aspxRichEdit.JSONTableCellBordersConverter.convertFromJSON(obj[__aspxRichEdit.JSONEnumTableCellProperty.Borders], colorModelInfoCache);
            result.hideCellMark = !!obj[__aspxRichEdit.JSONEnumTableCellProperty.HideCellMark];
            result.noWrap = !!obj[__aspxRichEdit.JSONEnumTableCellProperty.NoWrap];
            result.fitText = !!obj[__aspxRichEdit.JSONEnumTableCellProperty.FitText];
            result.textDirection = obj[__aspxRichEdit.JSONEnumTableCellProperty.TextDirection];
            result.verticalAlignment = obj[__aspxRichEdit.JSONEnumTableCellProperty.VerticalAlignment];
            result.shadingInfo = shadingInfoCache.getItemByJsonKey(obj[__aspxRichEdit.JSONEnumTableCellProperty.ShadingInfoIndex]);
            result.mask = obj[__aspxRichEdit.JSONEnumTableCellProperty.UseValue];
            return result;
        };
        JSONTableCellPropertiesConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONEnumTableCellProperty.CellMargins] = __aspxRichEdit.JSONTableCellMarginsConverter.convertToJSON(source.cellMargins);
            result[__aspxRichEdit.JSONEnumTableCellProperty.Borders] = __aspxRichEdit.JSONTableCellBordersConverter.convertToJSON(source.borders);
            result[__aspxRichEdit.JSONEnumTableCellProperty.HideCellMark] = __aspxRichEdit.Utils.boolToInt(source.hideCellMark);
            result[__aspxRichEdit.JSONEnumTableCellProperty.NoWrap] = __aspxRichEdit.Utils.boolToInt(source.noWrap);
            result[__aspxRichEdit.JSONEnumTableCellProperty.FitText] = __aspxRichEdit.Utils.boolToInt(source.fitText);
            result[__aspxRichEdit.JSONEnumTableCellProperty.TextDirection] = source.textDirection;
            result[__aspxRichEdit.JSONEnumTableCellProperty.VerticalAlignment] = source.verticalAlignment;
            result[__aspxRichEdit.JSONEnumTableCellProperty.ShadingInfo] = __aspxRichEdit.JSONShadingInfoConverter.convertToJSON(source.shadingInfo);
            result[__aspxRichEdit.JSONEnumTableCellProperty.UseValue] = source.mask;
            return result;
        };
        return JSONTableCellPropertiesConverter;
    }());
    __aspxRichEdit.JSONTableCellPropertiesConverter = JSONTableCellPropertiesConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONTableConditionalStyleConverter = (function () {
        function JSONTableConditionalStyleConverter() {
        }
        JSONTableConditionalStyleConverter.convertFromJSON = function (obj, cache) {
            var tableProperties = __aspxRichEdit.JSONTablePropertiesConverter.convertFromJSON(obj[__aspxRichEdit.JSONTableConditionalStyleProperty.TableProperties], cache.colorModelInfoCache, cache.shadingInfoCache);
            var tableRowProperties = cache.tableRowPropertiesCache.getItemByJsonKey(obj[__aspxRichEdit.JSONTableConditionalStyleProperty.TableRowPropertiesIndex]);
            var tableCellProperties = cache.tableCellPropertiesCache.getItemByJsonKey(obj[__aspxRichEdit.JSONTableConditionalStyleProperty.TableCellPropertiesIndex]);
            var maskedParagraphProperties = cache.maskedParagraphPropertiesCache.getItemByJsonKey(obj[__aspxRichEdit.JSONTableConditionalStyleProperty.MaskedParagraphPropertiesCacheIndex]);
            var maskedCharacterProperties = cache.maskedCharacterPropertiesCache.getItemByJsonKey(obj[__aspxRichEdit.JSONTableConditionalStyleProperty.MaskedCharacterPropertiesCacheIndex]);
            return new __aspxRichEdit.TableConditionalStyle(tableProperties, tableRowProperties, tableCellProperties, maskedParagraphProperties, maskedCharacterProperties, __aspxRichEdit.JSONTabConverter.convertFromJSONToTabProperties(obj[__aspxRichEdit.JSONTableConditionalStyleProperty.Tabs]));
        };
        JSONTableConditionalStyleConverter.convertStylesFromJSON = function (jsonCondStyles, cache) {
            return __aspxRichEdit.MapUtilsKeyAsNumber.map(jsonCondStyles, function (obj) { return JSONTableConditionalStyleConverter.convertFromJSON(obj, cache); });
        };
        JSONTableConditionalStyleConverter.convertToJSON = function (documentModel, tableConditionalStyle) {
            var maskedParagraphPropertiesCache = documentModel.cache.maskedParagraphPropertiesCache;
            var maskedCharacterPropertiesCache = documentModel.cache.maskedCharacterPropertiesCache;
            var tableRowPropertiesCache = documentModel.cache.tableRowPropertiesCache;
            var tableCellPropertiesCache = documentModel.cache.tableCellPropertiesCache;
            var jsonTableConditionalStyle = {};
            jsonTableConditionalStyle[__aspxRichEdit.JSONTableConditionalStyleProperty.TableProperties] =
                __aspxRichEdit.JSONTablePropertiesConverter.convertToJSON(tableConditionalStyle.tableProperties);
            jsonTableConditionalStyle[__aspxRichEdit.JSONTableConditionalStyleProperty.TableRowPropertiesIndex] =
                tableRowPropertiesCache.indexOf(tableConditionalStyle.tableRowProperties);
            jsonTableConditionalStyle[__aspxRichEdit.JSONTableConditionalStyleProperty.TableCellPropertiesIndex] =
                tableCellPropertiesCache.indexOf(tableConditionalStyle.tableCellProperties);
            jsonTableConditionalStyle[__aspxRichEdit.JSONTableConditionalStyleProperty.MaskedParagraphPropertiesCacheIndex] =
                maskedParagraphPropertiesCache.indexOf(tableConditionalStyle.maskedParagraphProperties);
            jsonTableConditionalStyle[__aspxRichEdit.JSONTableConditionalStyleProperty.MaskedCharacterPropertiesCacheIndex] =
                maskedCharacterPropertiesCache.indexOf(tableConditionalStyle.maskedCharacterProperties);
            jsonTableConditionalStyle[__aspxRichEdit.JSONTableConditionalStyleProperty.Tabs] =
                __aspxRichEdit.JSONTabConverter.convertFromTabPropertiesToJSON(tableConditionalStyle.tabs);
            return jsonTableConditionalStyle;
        };
        JSONTableConditionalStyleConverter.convertStylesToJSON = function (documentModel, tableConditionalStyles) {
            var jsonTableConditionalStyles = {};
            for (var typeId in tableConditionalStyles) {
                if (tableConditionalStyles.hasOwnProperty(typeId)) {
                    jsonTableConditionalStyles[typeId] =
                        JSONTableConditionalStyleConverter.convertToJSON(documentModel, tableConditionalStyles[typeId]);
                }
            }
            return jsonTableConditionalStyles;
        };
        return JSONTableConditionalStyleConverter;
    }());
    __aspxRichEdit.JSONTableConditionalStyleConverter = JSONTableConditionalStyleConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONTableImporter = (function () {
        function JSONTableImporter() {
        }
        JSONTableImporter.importTables = function (subDocument, jsonTables) {
            if (!jsonTables)
                return;
            var tablesMap = {};
            var subDocumentTables = subDocument.tables;
            for (var _i = 0, jsonTables_1 = jsonTables; _i < jsonTables_1.length; _i++) {
                var jsonTable = jsonTables_1[_i];
                var newTable = new __aspxRichEdit.Table(__aspxRichEdit.JSONTablePropertiesConverter.convertFromJSON(jsonTable[__aspxRichEdit.JSONEnumTable.TableProperties], subDocument.documentModel.cache.colorModelInfoCache, subDocument.documentModel.cache.shadingInfoCache), subDocument.documentModel.tableStyles[jsonTable[__aspxRichEdit.JSONEnumTable.StyleIndex]]);
                subDocumentTables.push(newTable);
                newTable.index = jsonTable[__aspxRichEdit.JSONEnumTable.Index];
                tablesMap[newTable.index] = newTable;
                newTable.nestedLevel = jsonTable[__aspxRichEdit.JSONEnumTable.NestedLevel];
                newTable.preferredWidth = __aspxRichEdit.JSONTableWidthUnitConverter.convertFromJSON(jsonTable[__aspxRichEdit.JSONEnumTable.PreferredWidth]);
                newTable.lookTypes = jsonTable[__aspxRichEdit.JSONEnumTable.LookTypes];
                var parentCellContent = jsonTable[__aspxRichEdit.JSONEnumTable.ParentCell];
                newTable.parentCell = parentCellContent ? JSONTableImporter.getParentCell(parentCellContent, tablesMap) : null;
                for (var _a = 0, _b = jsonTable[__aspxRichEdit.JSONEnumTable.Rows]; _a < _b.length; _a++) {
                    var jsonRow = _b[_a];
                    newTable.rows.push(JSONTableImporter.importTableRow(jsonRow, subDocument, newTable));
                }
                __aspxRichEdit.TableConditionalFormattingCalculator.updateTableWithoutHistory(subDocument.documentModel, newTable);
            }
            __aspxRichEdit.Table.sort(subDocumentTables);
            __aspxRichEdit.Table.fillTableByLevels(subDocument);
        };
        JSONTableImporter.importTableRow = function (jsonRow, subDocument, parentTable) {
            var rowProps = subDocument.documentModel.cache.tableRowPropertiesCache.getItemByJsonKey(jsonRow[__aspxRichEdit.JSONEnumTableRow.TableRowPropertiesIndex]);
            var newTableRow = new __aspxRichEdit.TableRow(parentTable, rowProps);
            newTableRow.gridBefore = jsonRow[__aspxRichEdit.JSONEnumTableRow.GridBefore];
            newTableRow.gridAfter = jsonRow[__aspxRichEdit.JSONEnumTableRow.GridAfter];
            newTableRow.widthBefore = __aspxRichEdit.JSONTableWidthUnitConverter.convertFromJSON(jsonRow[__aspxRichEdit.JSONEnumTableRow.WidthBefore]);
            newTableRow.widthAfter = __aspxRichEdit.JSONTableWidthUnitConverter.convertFromJSON(jsonRow[__aspxRichEdit.JSONEnumTableRow.WidthAfter]);
            newTableRow.height = __aspxRichEdit.JSONTableHeightUnitConverter.convertFromJSON(jsonRow[__aspxRichEdit.JSONEnumTableRow.Height]);
            newTableRow.tablePropertiesException = __aspxRichEdit.JSONTablePropertiesConverter.convertFromJSON(jsonRow[__aspxRichEdit.JSONEnumTableRow.TablePropertiesException], subDocument.documentModel.cache.colorModelInfoCache, subDocument.documentModel.cache.shadingInfoCache);
            for (var _i = 0, _a = jsonRow[__aspxRichEdit.JSONEnumTableRow.Cells]; _i < _a.length; _i++) {
                var rawCell = _a[_i];
                newTableRow.cells.push(JSONTableImporter.importTableCell(rawCell, subDocument, newTableRow));
            }
            return newTableRow;
        };
        JSONTableImporter.importTableCell = function (jsonCell, subDocument, parentRow) {
            var cellProps = subDocument.documentModel.cache.tableCellPropertiesCache.getItemByJsonKey(jsonCell[__aspxRichEdit.JSONEnumTableCell.TableCellPropertiesIndex]);
            var newTableCell = new __aspxRichEdit.TableCell(parentRow, cellProps);
            newTableCell.style = null;
            newTableCell.columnSpan = jsonCell[__aspxRichEdit.JSONEnumTableCell.ColumnSpan];
            newTableCell.preferredWidth = __aspxRichEdit.JSONTableWidthUnitConverter.convertFromJSON(jsonCell[__aspxRichEdit.JSONEnumTableCell.PreferredWidth]);
            newTableCell.verticalMerging = jsonCell[__aspxRichEdit.JSONEnumTableCell.VerticalMerging];
            newTableCell.startParagraphPosition = subDocument.positionManager.registerPosition(jsonCell[__aspxRichEdit.JSONEnumTableCell.StartParagraphPosition]);
            newTableCell.endParagrapPosition = subDocument.positionManager.registerPosition(jsonCell[__aspxRichEdit.JSONEnumTableCell.EndParagraphPosition]);
            return newTableCell;
        };
        JSONTableImporter.getParentCell = function (content, tablesMap) {
            var tableIndex = content[__aspxRichEdit.JSONEnumTableParentCellInfo.TableIndex];
            var table = tablesMap[tableIndex];
            return table.rows[content[__aspxRichEdit.JSONEnumTableParentCellInfo.RowIndex]].cells[content[__aspxRichEdit.JSONEnumTableParentCellInfo.CellIndex]];
        };
        return JSONTableImporter;
    }());
    __aspxRichEdit.JSONTableImporter = JSONTableImporter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONTablePropertiesConverter = (function () {
        function JSONTablePropertiesConverter() {
        }
        JSONTablePropertiesConverter.convertFromJSON = function (obj, colorModelInfoCache, shadingInfoCache) {
            var result = new __aspxRichEdit.TableProperties();
            result.cellMargins = __aspxRichEdit.JSONTableCellMarginsConverter.convertFromJSON(obj[__aspxRichEdit.JSONEnumTableProperty.CellMargins]);
            result.cellSpacing = __aspxRichEdit.JSONTableWidthUnitConverter.convertFromJSON(obj[__aspxRichEdit.JSONEnumTableProperty.CellSpacing]);
            result.indent = __aspxRichEdit.JSONTableWidthUnitConverter.convertFromJSON(obj[__aspxRichEdit.JSONEnumTableProperty.Indent]);
            result.borders = __aspxRichEdit.JSONTableBordersConverter.convertFromJSON(obj[__aspxRichEdit.JSONEnumTableProperty.Borders], colorModelInfoCache);
            result.tableStyleColumnBandSize = obj[__aspxRichEdit.JSONEnumTableProperty.TableStyleColBandSize];
            result.tableStyleRowBandSize = obj[__aspxRichEdit.JSONEnumTableProperty.TableStyleRowBandSize];
            result.isTableOverlap = !!obj[__aspxRichEdit.JSONEnumTableProperty.IsTableOverlap];
            result.avoidDoubleBorders = !!obj[__aspxRichEdit.JSONEnumTableProperty.AvoidDoubleBorders];
            result.layoutType = obj[__aspxRichEdit.JSONEnumTableProperty.LayoutType];
            result.shadingInfo = shadingInfoCache.getItemByJsonKey(obj[__aspxRichEdit.JSONEnumTableProperty.ShadingInfoIndex]);
            result.tableRowAlignment = obj[__aspxRichEdit.JSONEnumTableProperty.TableRowAlignment];
            result.bottomFromText = obj[__aspxRichEdit.JSONEnumTableProperty.BottomFromText];
            result.leftFromText = obj[__aspxRichEdit.JSONEnumTableProperty.LeftFromText];
            result.topFromText = obj[__aspxRichEdit.JSONEnumTableProperty.TopFromText];
            result.rightFromText = obj[__aspxRichEdit.JSONEnumTableProperty.RightFromText];
            result.tableHorizontalPosition = obj[__aspxRichEdit.JSONEnumTableProperty.TableHorizontalPosition];
            result.tableVerticalPosition = obj[__aspxRichEdit.JSONEnumTableProperty.TableVerticalPosition];
            result.horizontalAlignMode = obj[__aspxRichEdit.JSONEnumTableProperty.HorizontalAlignMode];
            result.verticalAlignMode = obj[__aspxRichEdit.JSONEnumTableProperty.VerticalAlignMode];
            result.horizontalAnchorType = obj[__aspxRichEdit.JSONEnumTableProperty.HorizontalAnchorType];
            result.verticalAnchorType = obj[__aspxRichEdit.JSONEnumTableProperty.VerticalAnchorType];
            result.textWrapping = obj[__aspxRichEdit.JSONEnumTableProperty.TextWrapping];
            result.mask = obj[__aspxRichEdit.JSONEnumTableProperty.UseValue];
            return result;
        };
        JSONTablePropertiesConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONEnumTableProperty.CellMargins] = __aspxRichEdit.JSONTableCellMarginsConverter.convertToJSON(source.cellMargins);
            result[__aspxRichEdit.JSONEnumTableProperty.CellSpacing] = __aspxRichEdit.JSONTableWidthUnitConverter.convertToJSON(source.cellSpacing);
            result[__aspxRichEdit.JSONEnumTableProperty.Indent] = __aspxRichEdit.JSONTableWidthUnitConverter.convertToJSON(source.indent);
            result[__aspxRichEdit.JSONEnumTableProperty.Borders] = __aspxRichEdit.JSONTableBordersConverter.convertToJSON(source.borders);
            result[__aspxRichEdit.JSONEnumTableProperty.TableStyleColBandSize] = source.tableStyleColumnBandSize;
            result[__aspxRichEdit.JSONEnumTableProperty.TableStyleRowBandSize] = source.tableStyleRowBandSize;
            result[__aspxRichEdit.JSONEnumTableProperty.IsTableOverlap] = __aspxRichEdit.Utils.boolToInt(source.isTableOverlap);
            result[__aspxRichEdit.JSONEnumTableProperty.AvoidDoubleBorders] = __aspxRichEdit.Utils.boolToInt(source.avoidDoubleBorders);
            result[__aspxRichEdit.JSONEnumTableProperty.LayoutType] = source.layoutType;
            result[__aspxRichEdit.JSONEnumTableProperty.ShadingInfo] = __aspxRichEdit.JSONShadingInfoConverter.convertToJSON(source.shadingInfo);
            result[__aspxRichEdit.JSONEnumTableProperty.TableRowAlignment] = source.tableRowAlignment;
            result[__aspxRichEdit.JSONEnumTableProperty.BottomFromText] = source.bottomFromText;
            result[__aspxRichEdit.JSONEnumTableProperty.LeftFromText] = source.leftFromText;
            result[__aspxRichEdit.JSONEnumTableProperty.TopFromText] = source.topFromText;
            result[__aspxRichEdit.JSONEnumTableProperty.RightFromText] = source.rightFromText;
            result[__aspxRichEdit.JSONEnumTableProperty.TableHorizontalPosition] = source.tableHorizontalPosition;
            result[__aspxRichEdit.JSONEnumTableProperty.TableVerticalPosition] = source.tableVerticalPosition;
            result[__aspxRichEdit.JSONEnumTableProperty.HorizontalAlignMode] = source.horizontalAlignMode;
            result[__aspxRichEdit.JSONEnumTableProperty.VerticalAlignMode] = source.verticalAlignMode;
            result[__aspxRichEdit.JSONEnumTableProperty.HorizontalAnchorType] = source.horizontalAnchorType;
            result[__aspxRichEdit.JSONEnumTableProperty.VerticalAnchorType] = source.verticalAnchorType;
            result[__aspxRichEdit.JSONEnumTableProperty.TextWrapping] = source.textWrapping;
            result[__aspxRichEdit.JSONEnumTableProperty.UseValue] = source.mask;
            return result;
        };
        return JSONTablePropertiesConverter;
    }());
    __aspxRichEdit.JSONTablePropertiesConverter = JSONTablePropertiesConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONTableRowPropertiesConverter = (function () {
        function JSONTableRowPropertiesConverter() {
        }
        JSONTableRowPropertiesConverter.convertFromJSON = function (obj) {
            var result = new __aspxRichEdit.TableRowProperties();
            result.cellSpacing = __aspxRichEdit.JSONTableWidthUnitConverter.convertFromJSON(obj[__aspxRichEdit.JSONEnumTableRowProperty.CellSpacing]);
            result.header = !!obj[__aspxRichEdit.JSONEnumTableRowProperty.Header];
            result.hideCellMark = !!obj[__aspxRichEdit.JSONEnumTableRowProperty.HideCellMark];
            result.cantSplit = !!obj[__aspxRichEdit.JSONEnumTableRowProperty.CantSplit];
            result.tableRowAlignment = obj[__aspxRichEdit.JSONEnumTableRowProperty.TableRowAlignment];
            result.mask = obj[__aspxRichEdit.JSONEnumTableRowProperty.UseValue];
            result.divId = obj[__aspxRichEdit.JSONEnumTableRowProperty.DivId];
            return result;
        };
        JSONTableRowPropertiesConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONEnumTableRowProperty.CellSpacing] = __aspxRichEdit.JSONTableWidthUnitConverter.convertToJSON(source.cellSpacing);
            result[__aspxRichEdit.JSONEnumTableRowProperty.Header] = __aspxRichEdit.Utils.boolToInt(source.header);
            result[__aspxRichEdit.JSONEnumTableRowProperty.HideCellMark] = __aspxRichEdit.Utils.boolToInt(source.hideCellMark);
            result[__aspxRichEdit.JSONEnumTableRowProperty.CantSplit] = __aspxRichEdit.Utils.boolToInt(source.cantSplit);
            result[__aspxRichEdit.JSONEnumTableRowProperty.TableRowAlignment] = source.tableRowAlignment;
            result[__aspxRichEdit.JSONEnumTableRowProperty.UseValue] = source.mask;
            result[__aspxRichEdit.JSONEnumTableRowProperty.DivId] = source.divId;
            return result;
        };
        return JSONTableRowPropertiesConverter;
    }());
    __aspxRichEdit.JSONTableRowPropertiesConverter = JSONTableRowPropertiesConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONTableHeightUnitConverter = (function () {
        function JSONTableHeightUnitConverter() {
        }
        JSONTableHeightUnitConverter.convertFromJSON = function (obj) {
            var result = new __aspxRichEdit.TableHeightUnit();
            result.type = obj[__aspxRichEdit.JSONTableHeightUnitProperty.Type];
            result.value = obj[__aspxRichEdit.JSONTableHeightUnitProperty.Value];
            return result;
        };
        JSONTableHeightUnitConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONTableHeightUnitProperty.Type] = source.type;
            result[__aspxRichEdit.JSONTableHeightUnitProperty.Value] = source.value;
            return result;
        };
        return JSONTableHeightUnitConverter;
    }());
    __aspxRichEdit.JSONTableHeightUnitConverter = JSONTableHeightUnitConverter;
    var JSONTableWidthUnitConverter = (function () {
        function JSONTableWidthUnitConverter() {
        }
        JSONTableWidthUnitConverter.convertFromJSON = function (obj) {
            var result = new __aspxRichEdit.TableWidthUnit();
            result.type = obj[__aspxRichEdit.JSONTableWidthUnitProperty.Type];
            result.value = obj[__aspxRichEdit.JSONTableWidthUnitProperty.Value];
            return result;
        };
        JSONTableWidthUnitConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONTableWidthUnitProperty.Type] = source.type;
            result[__aspxRichEdit.JSONTableWidthUnitProperty.Value] = source.value;
            return result;
        };
        return JSONTableWidthUnitConverter;
    }());
    __aspxRichEdit.JSONTableWidthUnitConverter = JSONTableWidthUnitConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutBookmarkBoxType;
    (function (LayoutBookmarkBoxType) {
        LayoutBookmarkBoxType[LayoutBookmarkBoxType["StartBox"] = 0] = "StartBox";
        LayoutBookmarkBoxType[LayoutBookmarkBoxType["EndBox"] = 1] = "EndBox";
    })(LayoutBookmarkBoxType = __aspxRichEdit.LayoutBookmarkBoxType || (__aspxRichEdit.LayoutBookmarkBoxType = {}));
    var BookmarkBox = (function (_super) {
        __extends(BookmarkBox, _super);
        function BookmarkBox(boxType) {
            var _this = _super.call(this) || this;
            _this.boxType = LayoutBookmarkBoxType.StartBox;
            _this.color = "";
            _this.boxType = boxType;
            return _this;
        }
        BookmarkBox.prototype.equals = function (obj) {
            return _super.prototype.equals.call(this, obj) &&
                this.color == obj.color &&
                this.boxType == obj.boxType;
        };
        BookmarkBox.DEFAULT_WIDTH = 3;
        BookmarkBox.DEFAULT_BORDER_WIDTH = 2;
        return BookmarkBox;
    }(__aspxRichEdit.Rectangle));
    __aspxRichEdit.BookmarkBox = BookmarkBox;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutAnchoredPictureBox = (function (_super) {
        __extends(LayoutAnchoredPictureBox, _super);
        function LayoutAnchoredPictureBox(characterProperties, colorInfo, belongsToSubDocId, anchorInfo, shape, objectId, rotationInRadians, pictureId, isLoaded) {
            var _this = _super.call(this, characterProperties, colorInfo, belongsToSubDocId, anchorInfo, shape, objectId, rotationInRadians) || this;
            _this.pictureId = pictureId;
            _this.isLoaded = isLoaded;
            return _this;
        }
        LayoutAnchoredPictureBox.prototype.getType = function () {
            return __aspxRichEdit.LayoutBoxType.AnchorPicture;
        };
        LayoutAnchoredPictureBox.prototype.clone = function () {
            var newObject = new LayoutAnchoredPictureBox(this.characterProperties, this.colorInfo, this.belongsToSubDocId, this.anchorInfo, this.shape, this.objectId, this.rotationInRadians, this.pictureId, this.isLoaded);
            newObject.copyFrom(this);
            return newObject;
        };
        LayoutAnchoredPictureBox.prototype.renderGetContent = function (renderer) {
            return __aspxRichEdit.DocumentRenderer.renderPictureBoxContent(this.height, this.width, this.pictureId, this.isLoaded, renderer, this.hyperlinkTip);
        };
        return LayoutAnchoredPictureBox;
    }(__aspxRichEdit.LayoutAnchoredObjectBox));
    __aspxRichEdit.LayoutAnchoredPictureBox = LayoutAnchoredPictureBox;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutAnchoredTextBox = (function (_super) {
        __extends(LayoutAnchoredTextBox, _super);
        function LayoutAnchoredTextBox(characterProperties, colorInfo, belongsToSubDocId, anchorInfo, shape, objectId, rotationInRadians, internalSubDocId, textBoxProperties) {
            var _this = _super.call(this, characterProperties, colorInfo, belongsToSubDocId, anchorInfo, shape, objectId, rotationInRadians) || this;
            _this.internalSubDocId = internalSubDocId;
            _this.textBoxProperties = textBoxProperties;
            return _this;
        }
        LayoutAnchoredTextBox.prototype.getType = function () {
            return __aspxRichEdit.LayoutBoxType.AnchorTextBox;
        };
        LayoutAnchoredTextBox.prototype.clone = function () {
            var newObject = new LayoutAnchoredTextBox(this.characterProperties, this.colorInfo, this.belongsToSubDocId, this.anchorInfo, this.shape, this.objectId, this.rotationInRadians, this.internalSubDocId, this.textBoxProperties);
            newObject.copyFrom(this);
            return newObject;
        };
        LayoutAnchoredTextBox.prototype.renderGetContent = function (_renderer) {
            throw Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return LayoutAnchoredTextBox;
    }(__aspxRichEdit.LayoutAnchoredObjectBox));
    __aspxRichEdit.LayoutAnchoredTextBox = LayoutAnchoredTextBox;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutColumnBreakBox = (function (_super) {
        __extends(LayoutColumnBreakBox, _super);
        function LayoutColumnBreakBox() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutColumnBreakBox.prototype.clone = function () {
            var newObj = new LayoutColumnBreakBox(this.characterProperties, this.colorInfo);
            newObj.copyFrom(this);
            return newObj;
        };
        LayoutColumnBreakBox.prototype.getType = function () {
            return __aspxRichEdit.LayoutBoxType.ColumnBreak;
        };
        LayoutColumnBreakBox.prototype.getHiddenText = function () {
            return "........Column Break........";
        };
        LayoutColumnBreakBox.prototype.isLineBreak = function () {
            return true;
        };
        return LayoutColumnBreakBox;
    }(__aspxRichEdit.LayoutPageBreakBox));
    __aspxRichEdit.LayoutColumnBreakBox = LayoutColumnBreakBox;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutDashBox = (function (_super) {
        __extends(LayoutDashBox, _super);
        function LayoutDashBox(characterProperties, colorInfo, text) {
            var _this = _super.call(this, characterProperties, colorInfo) || this;
            _this.text = text;
            return _this;
        }
        LayoutDashBox.prototype.equals = function (obj) {
            return _super.prototype.equals.call(this, obj) &&
                this.text == obj.text;
        };
        LayoutDashBox.prototype.getType = function () {
            return __aspxRichEdit.LayoutBoxType.Dash;
        };
        LayoutDashBox.prototype.clone = function () {
            var newObj = new LayoutDashBox(this.characterProperties, this.colorInfo, this.text);
            newObj.copyFrom(this);
            return newObj;
        };
        LayoutDashBox.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.text = obj.text;
        };
        LayoutDashBox.prototype.renderGetContent = function (_renderer) {
            return this.text;
        };
        LayoutDashBox.prototype.pushInfoForMeasure = function (info, _showHiddenSymbols) {
            info.push(new __aspxRichEdit.MeasureInfoNonText(this.text, this.characterProperties));
        };
        LayoutDashBox.prototype.popInfoForMeasure = function (info, _showHiddenSymbols) {
            this.setSize(info.pop().resultSize);
        };
        LayoutDashBox.prototype.isVisible = function () {
            return true;
        };
        LayoutDashBox.prototype.isVisibleForRowAlign = function () {
            return true;
        };
        LayoutDashBox.prototype.renderIsWordBox = function () {
            return true;
        };
        LayoutDashBox.prototype.isWhitespace = function () {
            return false;
        };
        LayoutDashBox.prototype.isLineBreak = function () {
            return false;
        };
        return LayoutDashBox;
    }(__aspxRichEdit.LayoutBox));
    __aspxRichEdit.LayoutDashBox = LayoutDashBox;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFieldCodeEndBox = (function (_super) {
        __extends(LayoutFieldCodeEndBox, _super);
        function LayoutFieldCodeEndBox() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutFieldCodeEndBox.prototype.clone = function () {
            var newObj = new LayoutFieldCodeEndBox(this.characterProperties, this.colorInfo);
            newObj.copyFrom(this);
            return newObj;
        };
        LayoutFieldCodeEndBox.prototype.getType = function () {
            return __aspxRichEdit.LayoutBoxType.FieldCodeEnd;
        };
        LayoutFieldCodeEndBox.prototype.getBoxChar = function () {
            return "}";
        };
        return LayoutFieldCodeEndBox;
    }(__aspxRichEdit.LayoutFieldCodeStartBox));
    __aspxRichEdit.LayoutFieldCodeEndBox = LayoutFieldCodeEndBox;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFieldResultEndBox = (function (_super) {
        __extends(LayoutFieldResultEndBox, _super);
        function LayoutFieldResultEndBox() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutFieldResultEndBox.prototype.getType = function () {
            return __aspxRichEdit.LayoutBoxType.FieldResultEnd;
        };
        LayoutFieldResultEndBox.prototype.clone = function () {
            throw new Error(__aspxRichEdit.Errors.InternalException);
        };
        LayoutFieldResultEndBox.prototype.isWhitespace = function () {
            throw new Error(__aspxRichEdit.Errors.InternalException);
        };
        LayoutFieldResultEndBox.prototype.renderGetContent = function (_renderer) {
            throw new Error(__aspxRichEdit.Errors.InternalException);
        };
        LayoutFieldResultEndBox.prototype.pushInfoForMeasure = function (_info, _showHiddenSymbols) { };
        LayoutFieldResultEndBox.prototype.popInfoForMeasure = function (_info, _showHiddenSymbols) { };
        LayoutFieldResultEndBox.prototype.isLineBreak = function () {
            throw new Error(__aspxRichEdit.Errors.InternalException);
        };
        return LayoutFieldResultEndBox;
    }(__aspxRichEdit.LayoutBox));
    __aspxRichEdit.LayoutFieldResultEndBox = LayoutFieldResultEndBox;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutLineBreakBox = (function (_super) {
        __extends(LayoutLineBreakBox, _super);
        function LayoutLineBreakBox(characterProperties, colorInfo) {
            var _this = _super.call(this, characterProperties, colorInfo) || this;
            if (!LayoutLineBreakBox.renderCharacterProperties && characterProperties) {
                LayoutLineBreakBox.renderCharacterProperties = new __aspxRichEdit.CharacterProperties();
                LayoutLineBreakBox.renderCharacterProperties.fontSize = 8;
                LayoutLineBreakBox.renderCharacterProperties.fontInfo = _this.characterProperties.fontInfo.clone();
                LayoutLineBreakBox.renderCharacterProperties.fontInfo.measurer = _this.characterProperties.fontInfo.measurer;
                LayoutLineBreakBox.renderCharacterProperties.fontInfo.name = "Arial";
                LayoutLineBreakBox.renderCharacterProperties.fontInfo.cssString = "Arial";
                LayoutLineBreakBox.renderCharacterProperties.fontInfo.scriptMultiplier = 0.65;
            }
            return _this;
        }
        LayoutLineBreakBox.prototype.equals = function (obj) {
            return _super.prototype.equals.call(this, obj) &&
                this.lineBreakSymbol == obj.lineBreakSymbol;
        };
        LayoutLineBreakBox.prototype.clone = function () {
            var newObj = new LayoutLineBreakBox(this.characterProperties, this.colorInfo);
            newObj.copyFrom(this);
            return newObj;
        };
        LayoutLineBreakBox.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.lineBreakSymbol = obj.lineBreakSymbol;
        };
        LayoutLineBreakBox.prototype.getType = function () {
            return __aspxRichEdit.LayoutBoxType.LineBreak;
        };
        LayoutLineBreakBox.prototype.pushInfoForMeasure = function (info, _showHiddenSymbols) {
            info.push(new __aspxRichEdit.MeasureInfoNonText("a", this.characterProperties));
        };
        LayoutLineBreakBox.prototype.popInfoForMeasure = function (info, showHiddenSymbols) {
            this.lineBreakSymbol = showHiddenSymbols ? __aspxRichEdit.RichUtils.specialCharacters.HiddenLineBreak : "&nbsp;";
            this.renderGetCharacterProperties();
            this.setSize(info.pop().resultSize);
        };
        LayoutLineBreakBox.prototype.renderGetContent = function (_renderer) {
            return this.lineBreakSymbol;
        };
        LayoutLineBreakBox.prototype.renderNoStrikeoutAndNoUnderlineIfBoxInEndRow = function () {
            return true;
        };
        LayoutLineBreakBox.prototype.renderGetCharacterProperties = function () {
            LayoutLineBreakBox.renderCharacterProperties.hidden = this.characterProperties.hidden;
            return new __aspxRichEdit.LayoutRenderCharacterProperties(LayoutLineBreakBox.renderCharacterProperties, this.colorInfo);
        };
        LayoutLineBreakBox.prototype.isWhitespace = function () {
            return false;
        };
        LayoutLineBreakBox.prototype.isLineBreak = function () {
            return true;
        };
        return LayoutLineBreakBox;
    }(__aspxRichEdit.LayoutBox));
    __aspxRichEdit.LayoutLineBreakBox = LayoutLineBreakBox;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutNonBreakingSpaceBox = (function (_super) {
        __extends(LayoutNonBreakingSpaceBox, _super);
        function LayoutNonBreakingSpaceBox() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutNonBreakingSpaceBox.prototype.equals = function (obj) {
            return _super.prototype.equals.call(this, obj) &&
                this.spaceWidth == obj.spaceWidth &&
                this.hiddenSpaceWidth == obj.hiddenSpaceWidth;
        };
        LayoutNonBreakingSpaceBox.prototype.clone = function () {
            var newObj = new LayoutNonBreakingSpaceBox(this.characterProperties, this.colorInfo);
            newObj.copyFrom(this);
            return newObj;
        };
        LayoutNonBreakingSpaceBox.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.spaceWidth = obj.spaceWidth;
            this.hiddenSpaceWidth = obj.hiddenSpaceWidth;
        };
        LayoutNonBreakingSpaceBox.prototype.getType = function () {
            return __aspxRichEdit.LayoutBoxType.NonBreakingSpace;
        };
        LayoutNonBreakingSpaceBox.prototype.pushInfoForMeasure = function (info, showHiddenSymbols) {
            info.push(new __aspxRichEdit.MeasureInfoNonText("&nbsp;", this.characterProperties));
            if (showHiddenSymbols)
                info.push(new __aspxRichEdit.MeasureInfoNonText(LayoutNonBreakingSpaceBox.SYMBOL, this.characterProperties));
        };
        LayoutNonBreakingSpaceBox.prototype.popInfoForMeasure = function (info, showHiddenSymbols) {
            this.hiddenSpaceWidth = showHiddenSymbols ? info.pop().resultSize.width : 0;
            var elem = info.pop();
            this.setSize(elem.resultSize);
            this.spaceWidth = elem.resultSize.width;
        };
        LayoutNonBreakingSpaceBox.prototype.isVisible = function () {
            return true;
        };
        LayoutNonBreakingSpaceBox.prototype.isVisibleForRowAlign = function () {
            return true;
        };
        LayoutNonBreakingSpaceBox.prototype.renderGetContent = function (_renderer) {
            var numNbsps = Math.ceil((this.width - this.hiddenSpaceWidth) / Math.max(1, this.spaceWidth));
            return (this.hiddenSpaceWidth > 0 ? LayoutNonBreakingSpaceBox.SYMBOL : "") +
                __aspxRichEdit.StringUtils.mergeStringNTimes("&nbsp;", numNbsps);
        };
        LayoutNonBreakingSpaceBox.prototype.renderIsWordBox = function () {
            return true;
        };
        LayoutNonBreakingSpaceBox.prototype.isWhitespace = function () {
            return true;
        };
        LayoutNonBreakingSpaceBox.prototype.isLineBreak = function () {
            return false;
        };
        LayoutNonBreakingSpaceBox.SYMBOL = "˚";
        return LayoutNonBreakingSpaceBox;
    }(__aspxRichEdit.LayoutBox));
    __aspxRichEdit.LayoutNonBreakingSpaceBox = LayoutNonBreakingSpaceBox;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutNumberingListBox = (function (_super) {
        __extends(LayoutNumberingListBox, _super);
        function LayoutNumberingListBox(characterProperties, colorInfo, text, separatorChar, cache) {
            var _this = _super.call(this, characterProperties, colorInfo) || this;
            _this.textBox = new __aspxRichEdit.LayoutTextBox(characterProperties, colorInfo, text);
            if (separatorChar != '\u0000') {
                var separatorCharacterProperties = characterProperties.clone();
                separatorCharacterProperties.fontInfo = characterProperties.fontInfo.clone();
                separatorCharacterProperties.fontInfo.measurer = characterProperties.fontInfo.measurer;
                separatorCharacterProperties.fontInfo.name = "Arial";
                separatorCharacterProperties.fontInfo.cssString = "Arial";
                switch (separatorChar) {
                    case __aspxRichEdit.RichUtils.specialCharacters.TabMark:
                        _this.separatorBox = new __aspxRichEdit.LayoutTabSpaceBoxJustForBoxIterator(cache ? cache.getItem(separatorCharacterProperties) : null, colorInfo);
                        break;
                    case __aspxRichEdit.RichUtils.specialCharacters.Space:
                    case __aspxRichEdit.RichUtils.specialCharacters.EmSpace:
                    case __aspxRichEdit.RichUtils.specialCharacters.EnSpace:
                        _this.separatorBox = new __aspxRichEdit.LayoutSpaceBox(cache ? cache.getItem(separatorCharacterProperties) : null, colorInfo);
                        break;
                    default:
                        break;
                }
            }
            return _this;
        }
        LayoutNumberingListBox.prototype.equals = function (obj) {
            return obj &&
                _super.prototype.equals.call(this, obj) &&
                this.textBox.equals(obj.textBox) &&
                (!this.separatorBox && !obj.separatorBox || this.separatorBox && obj.separatorBox && this.separatorBox.equals(obj.separatorBox));
        };
        LayoutNumberingListBox.prototype.clone = function () {
            var newObj = new LayoutNumberingListBox(this.characterProperties, this.colorInfo, "0", '\u0000', null);
            if (newObj.separatorBox)
                newObj.separatorBox.characterProperties = this.separatorBox.characterProperties;
            newObj.copyFrom(this);
            return newObj;
        };
        LayoutNumberingListBox.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.textBox = (obj.textBox.clone());
            this.separatorBox = obj.separatorBox.clone();
        };
        LayoutNumberingListBox.prototype.getType = function () {
            return __aspxRichEdit.LayoutBoxType.NumberingList;
        };
        LayoutNumberingListBox.prototype.pushInfoForMeasure = function (info, showHiddenSymbols) {
            this.textBox.pushInfoForMeasure(info, showHiddenSymbols);
            if (this.separatorBox)
                this.separatorBox.pushInfoForMeasure(info, showHiddenSymbols);
        };
        LayoutNumberingListBox.prototype.popInfoForMeasure = function (info, showHiddenSymbols) {
            if (this.separatorBox) {
                this.separatorBox.popInfoForMeasure(info, showHiddenSymbols);
                if (this.separatorBox instanceof __aspxRichEdit.LayoutTabSpaceBoxJustForBoxIterator)
                    this.separatorBox = this.separatorBox.getLayoutTabBox(__aspxRichEdit.TabLeaderType.None);
            }
            this.textBox.popInfoForMeasure(info, showHiddenSymbols);
        };
        LayoutNumberingListBox.prototype.isWhitespace = function () {
            throw new Error(__aspxRichEdit.Errors.InternalException);
        };
        LayoutNumberingListBox.prototype.renderGetContent = function (_renderer) {
            throw new Error(__aspxRichEdit.Errors.InternalException);
        };
        ;
        LayoutNumberingListBox.prototype.isLineBreak = function () {
            throw new Error(__aspxRichEdit.Errors.InternalException);
        };
        return LayoutNumberingListBox;
    }(__aspxRichEdit.LayoutBox));
    __aspxRichEdit.LayoutNumberingListBox = LayoutNumberingListBox;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutParagraphMarkBox = (function (_super) {
        __extends(LayoutParagraphMarkBox, _super);
        function LayoutParagraphMarkBox() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutParagraphMarkBox.prototype.equals = function (obj) {
            return _super.prototype.equals.call(this, obj) &&
                this.paragraphMarkSymbol == obj.paragraphMarkSymbol;
        };
        LayoutParagraphMarkBox.prototype.clone = function () {
            var newObj = new LayoutParagraphMarkBox(this.characterProperties, this.colorInfo);
            newObj.copyFrom(this);
            return newObj;
        };
        LayoutParagraphMarkBox.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.paragraphMarkSymbol = obj.paragraphMarkSymbol;
        };
        LayoutParagraphMarkBox.prototype.getType = function () {
            return __aspxRichEdit.LayoutBoxType.ParagraphMark;
        };
        LayoutParagraphMarkBox.prototype.pushInfoForMeasure = function (info, _showHiddenSymbols) {
            info.push(new __aspxRichEdit.MeasureInfoNonText(__aspxRichEdit.RichUtils.specialCharacters.HiddenParagraphMark, this.characterProperties));
        };
        LayoutParagraphMarkBox.prototype.popInfoForMeasure = function (info, showHiddenSymbols) {
            this.paragraphMarkSymbol = showHiddenSymbols ? __aspxRichEdit.RichUtils.specialCharacters.HiddenParagraphMark : "&nbsp;";
            this.setSize(info.pop().resultSize);
        };
        LayoutParagraphMarkBox.prototype.renderGetContent = function (_renderer) {
            return this.paragraphMarkSymbol;
        };
        LayoutParagraphMarkBox.prototype.renderNoStrikeoutAndNoUnderlineIfBoxInEndRow = function () {
            return true;
        };
        LayoutParagraphMarkBox.prototype.isWhitespace = function () {
            return false;
        };
        LayoutParagraphMarkBox.prototype.isLineBreak = function () {
            return true;
        };
        return LayoutParagraphMarkBox;
    }(__aspxRichEdit.LayoutBox));
    __aspxRichEdit.LayoutParagraphMarkBox = LayoutParagraphMarkBox;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutPictureBox = (function (_super) {
        __extends(LayoutPictureBox, _super);
        function LayoutPictureBox(characterProperties, colorInfo, id, width, height, isLoaded) {
            if (isLoaded === void 0) { isLoaded = true; }
            var _this = _super.call(this, characterProperties, colorInfo) || this;
            _this.id = id;
            _this.width = width;
            _this.height = height;
            _this.isLoaded = isLoaded;
            return _this;
        }
        LayoutPictureBox.prototype.equals = function (obj) {
            return _super.prototype.equals.call(this, obj) &&
                this.id == obj.id &&
                this.isLoaded == obj.isLoaded;
        };
        LayoutPictureBox.prototype.clone = function () {
            var newObj = new LayoutPictureBox(this.characterProperties, this.colorInfo, this.id, this.width, this.height, this.isLoaded);
            newObj.copyFrom(this);
            return newObj;
        };
        LayoutPictureBox.prototype.getType = function () {
            return __aspxRichEdit.LayoutBoxType.Picture;
        };
        LayoutPictureBox.prototype.pushInfoForMeasure = function (_info, _showHiddenSymbols) { };
        LayoutPictureBox.prototype.popInfoForMeasure = function (_info, _showHiddenSymbols) { };
        LayoutPictureBox.prototype.getAscent = function () {
            return this.height;
        };
        LayoutPictureBox.prototype.getDescent = function () {
            return 0;
        };
        LayoutPictureBox.prototype.isVisible = function () {
            return true;
        };
        LayoutPictureBox.prototype.isVisibleForRowAlign = function () {
            return true;
        };
        LayoutPictureBox.prototype.renderGetContent = function (renderer) {
            return __aspxRichEdit.DocumentRenderer.renderPictureBoxContent(this.height, this.width, this.id, this.isLoaded, renderer, this.hyperlinkTip);
        };
        LayoutPictureBox.prototype.isWhitespace = function () {
            return false;
        };
        LayoutPictureBox.prototype.isLineBreak = function () {
            return false;
        };
        return LayoutPictureBox;
    }(__aspxRichEdit.LayoutBox));
    __aspxRichEdit.LayoutPictureBox = LayoutPictureBox;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutSectionMarkBox = (function (_super) {
        __extends(LayoutSectionMarkBox, _super);
        function LayoutSectionMarkBox() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutSectionMarkBox.prototype.clone = function () {
            var newObj = new LayoutSectionMarkBox(this.characterProperties, this.colorInfo);
            newObj.copyFrom(this);
            return newObj;
        };
        LayoutSectionMarkBox.prototype.getType = function () {
            return __aspxRichEdit.LayoutBoxType.SectionMark;
        };
        LayoutSectionMarkBox.prototype.getHiddenText = function () {
            return "::::::::Section Break::::::::";
        };
        return LayoutSectionMarkBox;
    }(__aspxRichEdit.LayoutPageBreakBox));
    __aspxRichEdit.LayoutSectionMarkBox = LayoutSectionMarkBox;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutSpaceBox = (function (_super) {
        __extends(LayoutSpaceBox, _super);
        function LayoutSpaceBox() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutSpaceBox.prototype.equals = function (obj) {
            return _super.prototype.equals.call(this, obj) &&
                this.spaceWidth == obj.spaceWidth &&
                this.hiddenSpaceWidth == obj.hiddenSpaceWidth;
        };
        LayoutSpaceBox.prototype.clone = function () {
            var newObj = new LayoutSpaceBox(this.characterProperties, this.colorInfo);
            newObj.copyFrom(this);
            return newObj;
        };
        LayoutSpaceBox.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.spaceWidth = obj.spaceWidth;
            this.hiddenSpaceWidth = obj.hiddenSpaceWidth;
        };
        LayoutSpaceBox.prototype.getType = function () {
            return __aspxRichEdit.LayoutBoxType.Space;
        };
        LayoutSpaceBox.prototype.pushInfoForMeasure = function (info, showHiddenSymbols) {
            info.push(new __aspxRichEdit.MeasureInfoNonText("&nbsp;", this.characterProperties));
            if (showHiddenSymbols)
                info.push(new __aspxRichEdit.MeasureInfoNonText(__aspxRichEdit.RichUtils.specialCharacters.HiddenSpace, this.characterProperties));
        };
        LayoutSpaceBox.prototype.popInfoForMeasure = function (info, showHiddenSymbols) {
            this.hiddenSpaceWidth = showHiddenSymbols ? info.pop().resultSize.width : 0;
            var elem = info.pop();
            this.setSize(elem.resultSize);
            this.spaceWidth = elem.resultSize.width;
        };
        LayoutSpaceBox.prototype.isVisible = function () {
            return true;
        };
        LayoutSpaceBox.prototype.renderGetContent = function (_renderer) {
            var numNbsps = Math.ceil((this.width - this.hiddenSpaceWidth) / Math.max(1, this.spaceWidth));
            return (this.hiddenSpaceWidth > 0 ? __aspxRichEdit.RichUtils.specialCharacters.HiddenSpace : "") +
                __aspxRichEdit.StringUtils.mergeStringNTimes("&nbsp;", numNbsps);
        };
        LayoutSpaceBox.prototype.renderNoStrikeoutAndNoUnderlineIfBoxInEndRow = function () {
            return true;
        };
        LayoutSpaceBox.prototype.isWhitespace = function () {
            return true;
        };
        LayoutSpaceBox.prototype.isLineBreak = function () {
            return false;
        };
        return LayoutSpaceBox;
    }(__aspxRichEdit.LayoutBox));
    __aspxRichEdit.LayoutSpaceBox = LayoutSpaceBox;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutPositionAdvanceBackwardHelper = (function (_super) {
        __extends(LayoutPositionAdvanceBackwardHelper, _super);
        function LayoutPositionAdvanceBackwardHelper() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutPositionAdvanceBackwardHelper.prototype.advance = function () {
            if (this.lp.charOffset != 0) {
                __aspxRichEdit.LayoutPositionDiscardHelper.onEndCharLevel(this.lp);
                return true;
            }
            return this.finalHandle(this.advanceBoxSimple(false, false) ? true : this.moveToPrevRow());
        };
        LayoutPositionAdvanceBackwardHelper.prototype.moveToPrevRow = function () {
            var oldCell = this.lp.row.tableCellInfo;
            if (!oldCell) {
                if (!this.advanceRowSimple(true, false))
                    return false;
                var cellInfo = this.lp.row.tableCellInfo;
                if (!cellInfo)
                    return true;
                this.setOnLastCellOnTable(cellInfo.parentRow.parentTable.logicInfo);
                return true;
            }
            if (this.advanceRowSimple(false, false)) {
                var newCell = this.lp.row.tableCellInfo;
                if (newCell) {
                    if (newCell == oldCell || oldCell.parentRow.parentTable.parentCell == newCell)
                        return true;
                    if (newCell.parentRow.parentTable.parentCell == oldCell) {
                        this.setOnLastCellOnTable(newCell.parentRow.parentTable.logicInfo);
                        return true;
                    }
                }
            }
            return this.moveToPrevCell(oldCell);
        };
        LayoutPositionAdvanceBackwardHelper.prototype.setOnLastCellOnTable = function (logicInfo) {
            var grid = logicInfo.grid;
            var rowIndex = grid.tableCellInfos.length - 1;
            var cellIndex = grid.tableCellInfos[rowIndex].length - 1;
            var prevTableCellGridInfo = __aspxRichEdit.LayoutPositionBaseAdvanceHelper.getNextTableCellGridInfo(false, grid, null, rowIndex, cellIndex);
            this.setRowByGridInfo(false, logicInfo, prevTableCellGridInfo, false, false);
        };
        LayoutPositionAdvanceBackwardHelper.prototype.moveToPrevCell = function (cell) {
            var logicInfo = cell.parentRow.parentTable.logicInfo;
            var grid = logicInfo.grid;
            var rowIndex = cell.parentRow.rowIndex;
            var info = grid.tableCellGridInfos[rowIndex][cell.cellGridIndex];
            if (!cell.boundFlags.get(__aspxRichEdit.TableCellBoundFlags.StartOnThisColumn)) {
                this.setRowByGridInfo(false, logicInfo, info, false, true);
                return true;
            }
            var prevTableCellGridInfo = __aspxRichEdit.LayoutPositionBaseAdvanceHelper.getNextTableCellGridInfo(false, grid, info, rowIndex, info.getCellIndex(rowIndex - info.getStartRowIndex()) - 1);
            if (prevTableCellGridInfo) {
                var moveToNext = prevTableCellGridInfo.getEndRowIndex() - 1 >= rowIndex;
                var tmpLp = this.lp.clone();
                if (!this.setRowByGridInfo(false, logicInfo, prevTableCellGridInfo, moveToNext, false)) {
                    this.lp.copyFrom(tmpLp);
                    if (moveToNext)
                        this.setRowByGridInfo(false, logicInfo, prevTableCellGridInfo, false, true);
                    else
                        throw new Error(__aspxRichEdit.Errors.InternalException);
                }
                return true;
            }
            var parentTbl = cell.parentRow.parentTable;
            var parentCell = parentTbl.parentCell;
            if (parentCell) {
                var indInternalTable = __aspxRichEdit.MapUtilsKeyAsNumber.indexBy(parentCell.internalTables, function (tbl) { return tbl == parentTbl; });
                var row = parentCell.layoutRows[indInternalTable - 1];
                if (row) {
                    this.setLayoutRow(row.indexInColumn, false);
                    return true;
                }
                if (cell.boundFlags.get(__aspxRichEdit.TableCellBoundFlags.StartOnThisColumn))
                    return this.moveToPrevCell(parentCell);
                var parentRow = parentCell.parentRow;
                var logicInfo_1 = parentRow.parentTable.logicInfo;
                var info_1 = logicInfo_1.grid.tableCellGridInfos[parentRow.rowIndex][parentCell.cellGridIndex];
                this.setRowByGridInfo(false, logicInfo_1, info_1, false, true);
                return true;
            }
            this.lp.copyFrom(this.oldLp);
            return this.advanceRowSimple(true, false);
        };
        return LayoutPositionAdvanceBackwardHelper;
    }(__aspxRichEdit.LayoutPositionBaseAdvanceHelper));
    __aspxRichEdit.LayoutPositionAdvanceBackwardHelper = LayoutPositionAdvanceBackwardHelper;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutPositionAdvanceForwardHelper = (function (_super) {
        __extends(LayoutPositionAdvanceForwardHelper, _super);
        function LayoutPositionAdvanceForwardHelper() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutPositionAdvanceForwardHelper.prototype.advance = function () {
            return this.finalHandle(this.advanceBoxSimple(false, true) ? true : this.moveToNextRow());
        };
        LayoutPositionAdvanceForwardHelper.prototype.moveToNextRow = function () {
            var oldCell = this.lp.row.tableCellInfo;
            if (!oldCell)
                return this.advanceRowSimple(true, true);
            if (this.advanceRowSimple(false, true)) {
                var newCell = this.lp.row.tableCellInfo;
                if (newCell && (newCell == oldCell || newCell.parentRow.parentTable.parentCell == oldCell))
                    return true;
            }
            return this.moveToNextCell(oldCell);
        };
        LayoutPositionAdvanceForwardHelper.prototype.moveToNextCell = function (cell) {
            var logicInfo = cell.parentRow.parentTable.logicInfo;
            var grid = logicInfo.grid;
            var rowIndex = cell.parentRow.rowIndex;
            var info = grid.tableCellGridInfos[rowIndex][cell.cellGridIndex];
            if (!cell.boundFlags.get(__aspxRichEdit.TableCellBoundFlags.EndOnThisColumn)) {
                this.setRowByGridInfo(true, logicInfo, info, true, true);
                return true;
            }
            var nextTableCellGridInfo = __aspxRichEdit.LayoutPositionBaseAdvanceHelper.getNextTableCellGridInfo(true, grid, info, info.getStartRowIndex(), info.getCellIndex(0) + 1);
            if (nextTableCellGridInfo) {
                var moveToPrev = nextTableCellGridInfo.getStartRowIndex() <= rowIndex;
                var tmpLp = this.lp.clone();
                if (!this.setRowByGridInfo(true, logicInfo, nextTableCellGridInfo, !moveToPrev, false)) {
                    this.lp.copyFrom(tmpLp);
                    if (!moveToPrev)
                        this.setRowByGridInfo(true, logicInfo, nextTableCellGridInfo, true, true);
                    else
                        throw new Error(__aspxRichEdit.Errors.InternalException);
                }
                return true;
            }
            var parentTbl = cell.parentRow.parentTable;
            var parentCell = parentTbl.parentCell;
            if (parentCell) {
                var indInternalTable = __aspxRichEdit.MapUtilsKeyAsNumber.indexBy(parentCell.internalTables, function (tbl) { return tbl == parentTbl; });
                var row = parentCell.layoutRows[indInternalTable];
                if (row) {
                    this.setLayoutRow(row.indexInColumn, true);
                    return true;
                }
                return this.toNextRowAfterTable(parentTbl);
                ;
            }
            this.lp.copyFrom(this.oldLp);
            return this.toNextRowAfterTable(cell.parentRow.parentTable);
        };
        LayoutPositionAdvanceForwardHelper.prototype.toNextRowAfterTable = function (table) {
            var logicInfo = table.logicInfo;
            var prevLp = this.lp.clone();
            var sameTable = __aspxRichEdit.ListUtils.elementBy(this.lp.column.tablesInfo, function (tbl) { return tbl.logicInfo == logicInfo; });
            while (this.advanceColumnSimple(true, true)) {
                var tmpSameTable = __aspxRichEdit.ListUtils.elementBy(this.lp.column.tablesInfo, function (tbl) { return tbl.logicInfo == logicInfo; });
                if (!tmpSameTable)
                    break;
                prevLp = this.lp.clone();
                sameTable = tmpSameTable;
            }
            this.lp.copyFrom(prevLp);
            var rowInd = __aspxRichEdit.ListUtils.accumulate(__aspxRichEdit.ListUtils.last(sameTable.tableRows).rowCells, -1, function (acc, cell) {
                return Math.max(__aspxRichEdit.ListUtils.last(cell.layoutRows).indexInColumn, acc);
            }) + 1;
            var layoutRow = this.lp.column.rows[rowInd];
            if (layoutRow) {
                var parentCell = sameTable.parentCell;
                if (!parentCell)
                    return this.setLayoutRow(rowInd, true);
                if (layoutRow.tableCellInfo == parentCell)
                    return this.setLayoutRow(rowInd, true);
                var lInfo = parentCell.parentRow.parentTable.logicInfo;
                var info = lInfo.grid.tableCellGridInfos[parentCell.parentRow.rowIndex][parentCell.cellGridIndex];
                if (parentCell.boundFlags.get(__aspxRichEdit.TableCellBoundFlags.EndOnThisColumn)) {
                    this.setLayoutRow(rowInd, true);
                    return true;
                }
                this.setRowByGridInfo(true, lInfo, info, true, true);
                return true;
            }
            if (!this.advanceColumnSimple(true, true))
                return false;
            this.setLayoutRow(0, true);
            return true;
        };
        return LayoutPositionAdvanceForwardHelper;
    }(__aspxRichEdit.LayoutPositionBaseAdvanceHelper));
    __aspxRichEdit.LayoutPositionAdvanceForwardHelper = LayoutPositionAdvanceForwardHelper;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Row;
        (function (Row) {
            var Box;
            (function (Box) {
                var BoxGenerator = (function () {
                    function BoxGenerator(manager, boxesHolder) {
                        this.positionFromStartGenerate = -1;
                        this.waitForMoreChunks = false;
                        this.manager = manager;
                        this.boxWrapsHolder = boxesHolder;
                    }
                    Object.defineProperty(BoxGenerator.prototype, "colorProvider", {
                        get: function () { return this.manager.model.colorProvider; },
                        enumerable: true,
                        configurable: true
                    });
                    BoxGenerator.prototype.addNewBoxInfo = function (box, offsetCharAtStartRun) {
                        if (offsetCharAtStartRun === void 0) { offsetCharAtStartRun = this.modelIterator.charOffset; }
                        box.rowOffset = this.getAbsolutePosition(offsetCharAtStartRun) - box.getLength();
                        var boxMustBeHidden = box.characterProperties.hidden && !this.manager.innerClientProperties.showHiddenSymbols &&
                            this.isLastParagraphBoxInSubDocumentVisible(box) && this.isTableCellConsiderAtLeastOneBox(this.currWrapInfo, box);
                        if (boxMustBeHidden ||
                            BoxGenerator.isFieldHideElement(this.currWrapInfo, box) ||
                            this.currWrapInfo.tablePosition && (__aspxRichEdit.ListUtils.anyOf(this.currWrapInfo.tablePosition, function (tblPos) { return tblPos.cell.verticalMerging == __aspxRichEdit.TableCellMergingState.Continue; }) ||
                                __aspxRichEdit.EnumUtils.isAnyOf(box.getType(), __aspxRichEdit.LayoutBoxType.SectionMark, __aspxRichEdit.LayoutBoxType.PageBreak, __aspxRichEdit.LayoutBoxType.ColumnBreak))) {
                            return null;
                        }
                        var newWrap = new Box.BoxWrap(box, this.currWrapInfo);
                        this.addToBoxFieldInfo(newWrap);
                        this.newWrappers.push(newWrap);
                        return newWrap;
                    };
                    BoxGenerator.prototype.generate = function () {
                        if (!this.init())
                            return false;
                        var generateFrom = this.modelIterator.getAbsolutePosition();
                        this.updateBracketsInfo();
                        if (!this.waitForMoreChunks)
                            this.newWrappers = [];
                        this.offsetStartWordAtStartRun = this.modelIterator.charOffset;
                        this.currBoxInfoType = __aspxRichEdit.LayoutBoxType.Text;
                        this.waitForMoreChunks = false;
                        this.createNewBoxes();
                        if (this.waitForMoreChunks)
                            return false;
                        __aspxRichEdit.LayoutBox.initializeWithMeasurer(this.newWrappers, this.manager.measurer, this.manager.innerClientProperties.showHiddenSymbols);
                        this.boxWrapsHolder.setNewWrappers(this.newWrappers, generateFrom);
                        return this.newWrappers.length > 0;
                    };
                    BoxGenerator.prototype.updateBracketsInfo = function () {
                        this.boxWrapsHolder.bracketsInfo = [];
                        var bkmSettings = this.boxWrapsHolder.manager.bookmarksSettings;
                        var docProtSettings = this.boxWrapsHolder.manager.documentProtectionSettings;
                        if (bkmSettings.visibility == __aspxRichEdit.BookmarksVisibility.Visible)
                            this.collectObjectBrackets(this.subDocument.bookmarks, bkmSettings.color, function (bookmark) { return !bookmark.isHidden(); });
                        if (this.boxWrapsHolder.manager.documentProtectionSettings.rangeVisibility == __aspxRichEdit.BookmarksVisibility.Visible)
                            this.collectObjectBrackets(this.subDocument.rangePermissions, docProtSettings.rangeHighlightBracketsColor, function () { return true; });
                        var cmp = function (a, b) {
                            var diff = a.absPos - b.absPos;
                            return diff ? diff : (a.color == b.color ? 0 : -1);
                        };
                        this.boxWrapsHolder.bracketsInfo = __aspxRichEdit.ListUtils.merge(this.boxWrapsHolder.bracketsInfo, cmp, function (a, b) { return cmp(a, b) == 0; }, function (to, from) { return to.flags.set(from.flags.getValue(), true); });
                    };
                    BoxGenerator.prototype.collectObjectBrackets = function (objects, color, shouldDrawn) {
                        var brInfo = this.boxWrapsHolder.bracketsInfo;
                        __aspxRichEdit.ListUtils.foreach(objects, function (obj) {
                            if (shouldDrawn(obj)) {
                                brInfo.push(new Box.BracketInfo(obj.start, new __aspxRichEdit.Flag(Row.BoxBracketsType.Open), color, obj.interval.length));
                                brInfo.push(new Box.BracketInfo(obj.end, new __aspxRichEdit.Flag(Row.BoxBracketsType.Close), color, obj.interval.length));
                            }
                        });
                    };
                    Object.defineProperty(BoxGenerator.prototype, "subDocument", {
                        get: function () {
                            return this.boxWrapsHolder.subDocument;
                        },
                        enumerable: true,
                        configurable: true
                    });
                    Object.defineProperty(BoxGenerator.prototype, "chunks", {
                        get: function () {
                            return this.subDocument.chunks;
                        },
                        enumerable: true,
                        configurable: true
                    });
                    BoxGenerator.prototype.init = function () {
                        var pos = this.positionFromStartGenerate;
                        if (this.subDocument.isMain() && __aspxRichEdit.ListUtils.last(this.chunks).getEndPosition() == pos)
                            return false;
                        if (pos == -1)
                            return true;
                        this.modelIterator = new __aspxRichEdit.ModelIterator(this.subDocument, false);
                        this.modelIterator.setPosition(pos);
                        if (pos >= this.modelIterator.chunk.getEndPosition())
                            return false;
                        this.paragraphIterator = new Box.ParagraphIterator(this.subDocument.paragraphs);
                        this.sectionIterator = new Box.SectionIterator(this.manager.model.sections);
                        this.tableIterator = new Box.TableIterator(this.subDocument.tables);
                        this.fieldIterator = new Box.FieldIterator(this.subDocument.fields);
                        this.paragraphIterator.init(pos);
                        this.sectionIterator.init(pos);
                        this.tableIterator.init(pos);
                        this.fieldIterator.init(pos);
                        this.currWrapInfo = new Box.BoxWrapInfo(this.paragraphIterator.index, this.sectionIterator.index, this.tableIterator.generateInfo(pos), this.fieldIterator.generateInfo(pos));
                        this.positionFromStartGenerate = -1;
                        var lastChunk = __aspxRichEdit.ListUtils.last(this.chunks);
                        this.lastModelPosition = __aspxRichEdit.ListUtils.last(this.chunks).isLast || !this.subDocument.isMain() ?
                            lastChunk.getEndPosition() - 1 : Number.MAX_VALUE;
                        return true;
                    };
                    BoxGenerator.prototype.isLastParagraphBoxInSubDocumentVisible = function (box) {
                        if (box.rowOffset != this.lastModelPosition)
                            return true;
                        var lastWrap = __aspxRichEdit.ListUtils.last(this.newWrappers);
                        return lastWrap && lastWrap.box.getType() == __aspxRichEdit.LayoutBoxType.ParagraphMark;
                    };
                    BoxGenerator.prototype.isTableCellConsiderAtLeastOneBox = function (info, box) {
                        if (!info.tablePosition || box.getType() != __aspxRichEdit.LayoutBoxType.ParagraphMark ||
                            __aspxRichEdit.ListUtils.last(info.tablePosition).cell.endParagrapPosition.value - 1 != box.rowOffset)
                            return true;
                        for (var wrapIndex = this.newWrappers.length - 1, wrap = void 0; wrap = this.newWrappers[wrapIndex]; wrapIndex--) {
                            if (!wrap || !wrap.info.tablePosition || wrap.info.tablePosition.length < info.tablePosition.length)
                                break;
                            if (wrap.info.tablePosition.length == info.tablePosition.length)
                                return wrap.box.getType() == __aspxRichEdit.LayoutBoxType.ParagraphMark &&
                                    __aspxRichEdit.ListUtils.allOf2(info.tablePosition, wrap.info.tablePosition, function (tInfoA, tInfoB) { return tInfoA.equals(tInfoB); });
                        }
                        return false;
                    };
                    BoxGenerator.isFieldHideElement = function (info, box) {
                        var fieldsInfo = info.fieldsInfo;
                        return fieldsInfo &&
                            (__aspxRichEdit.ListUtils.anyOf(fieldsInfo, function (info) {
                                return !info.field.showCode && info.isInCodePart ||
                                    info.field.showCode && !info.isInCodePart;
                            }) || box.getType() == __aspxRichEdit.LayoutBoxType.FieldResultEnd);
                    };
                    BoxGenerator.prototype.addToBoxFieldInfo = function (wrap) {
                        var fieldsInfo = wrap.info.fieldsInfo;
                        if (!fieldsInfo)
                            return;
                        var lowLevelFieldInfo = __aspxRichEdit.ListUtils.last(fieldsInfo);
                        if (lowLevelFieldInfo.field.isHyperlinkField() && !lowLevelFieldInfo.isInCodePart &&
                            this.boxWrapsHolder.manager.model.activeSubDocument === this.subDocument) {
                            var hyperlinkInfo = lowLevelFieldInfo.field.getHyperlinkInfo();
                            if (hyperlinkInfo.tip != "")
                                wrap.box.hyperlinkTip = hyperlinkInfo.tip;
                            else if (hyperlinkInfo.uri != "")
                                wrap.box.hyperlinkTip = hyperlinkInfo.uri + (hyperlinkInfo.anchor == "" ? "" : "#" + hyperlinkInfo.anchor);
                            else if (hyperlinkInfo.anchor != "")
                                wrap.box.hyperlinkTip = hyperlinkInfo.anchor[0] == "_" ?
                                    ASPxClientRichEdit.CommonLabels.CurrentDocumentHyperlinkTooltip : "#" + hyperlinkInfo.anchor;
                            else
                                wrap.box.hyperlinkTip = "";
                        }
                        if (__aspxRichEdit.ListUtils.anyOf(fieldsInfo, function (info) { return info.isInCodePart; }))
                            wrap.box.fieldLevel = fieldsInfo.length;
                        if (wrap.box.getType() == __aspxRichEdit.LayoutBoxType.LayoutDependent)
                            wrap.box.setType(BoxGenerator.MapFieldCodeToLayoutDependentBoxType[REWebUtils.Str.Trim(this.subDocument.getText(lowLevelFieldInfo.field.getCodeInterval()).split("\\")[0]).toUpperCase()]);
                    };
                    BoxGenerator.prototype.getAbsolutePosition = function (offsetCharAtStartRun) {
                        return this.chunk.startLogPosition.value + this.run.startOffset + offsetCharAtStartRun;
                    };
                    Object.defineProperty(BoxGenerator.prototype, "run", {
                        get: function () {
                            return this.modelIterator.run;
                        },
                        enumerable: true,
                        configurable: true
                    });
                    Object.defineProperty(BoxGenerator.prototype, "chunk", {
                        get: function () {
                            return this.modelIterator.chunk;
                        },
                        enumerable: true,
                        configurable: true
                    });
                    BoxGenerator.prototype.createNewBoxes = function () {
                        while (this.newWrappers.length < BoxGenerator.MAX_NUM_NEW_BOXES || this.currWrapInfo.tablePosition) {
                            if (this.modelIterator.charOffset >= this.run.getLength())
                                if (!this.getNextRun()) {
                                    if (this.chunk.isLast)
                                        this.boxWrapsHolder.flags.set(Box.IteratorFlags.DocumentEnd, true);
                                    else {
                                        this.waitForMoreChunks = !!this.currWrapInfo.tablePosition;
                                    }
                                    return;
                                }
                            this.parseByChar();
                        }
                    };
                    BoxGenerator.prototype.parseByChar = function () {
                        var currChar = this.modelIterator.getCurrentChar();
                        switch (currChar) {
                            case __aspxRichEdit.RichUtils.specialCharacters.Space:
                            case __aspxRichEdit.RichUtils.specialCharacters.NonBreakingSpace:
                            case __aspxRichEdit.RichUtils.specialCharacters.TabMark:
                            case __aspxRichEdit.RichUtils.specialCharacters.LineBreak:
                            case __aspxRichEdit.RichUtils.specialCharacters.PageBreak:
                            case __aspxRichEdit.RichUtils.specialCharacters.ColumnBreak:
                                this.makeBreakBox(currChar);
                                break;
                            case __aspxRichEdit.RichUtils.specialCharacters.Dash:
                            case __aspxRichEdit.RichUtils.specialCharacters.EmDash:
                            case __aspxRichEdit.RichUtils.specialCharacters.EnDash:
                                this.makeDashBox();
                                break;
                            default: this.parseByRunType();
                        }
                    };
                    BoxGenerator.prototype.parseByRunType = function () {
                        switch (this.run.getType()) {
                            case __aspxRichEdit.RunType.ParagraphRun:
                            case __aspxRichEdit.RunType.SectionRun:
                                this.makeParagraphAndSectionBox();
                                break;
                            case __aspxRichEdit.RunType.InlinePictureRun:
                                this.makeInlinePictureBox();
                                break;
                            case __aspxRichEdit.RunType.InlineTextBoxRun: throw new Error(__aspxRichEdit.Errors.NotImplemented);
                            case __aspxRichEdit.RunType.AnchoredPictureRun:
                                this.makeAnchoredPictureRun();
                                break;
                            case __aspxRichEdit.RunType.AnchoredTextBoxRun:
                                this.makeAnchoredTextBoxRun();
                                break;
                            case __aspxRichEdit.RunType.FieldCodeStartRun:
                                this.makeFieldCodeStartRun();
                                break;
                            case __aspxRichEdit.RunType.FieldCodeEndRun:
                                this.makeFieldCodeEndRun();
                                break;
                            case __aspxRichEdit.RunType.FieldResultEndRun:
                                this.makeFieldResultEndRun();
                                break;
                            case __aspxRichEdit.RunType.LayoutDependentRun:
                                this.makeLayoutDependentRun();
                                break;
                            default: this.makeDefault();
                        }
                    };
                    BoxGenerator.prototype.makeBreakBox = function (currChar) {
                        this.currWordToBox();
                        this.modelIterator.charOffset++;
                        this.addNewBoxInfo(BoxGenerator.modelCharToLayoutBoxConverter[currChar](this.run.getCharacterMergedProperies(), this.colorProvider));
                        this.offsetStartWordAtStartRun = this.modelIterator.charOffset;
                    };
                    BoxGenerator.prototype.makeDashBox = function () {
                        if (this.currBoxInfoType != __aspxRichEdit.LayoutBoxType.Dash) {
                            this.currWordToBox();
                            this.currBoxInfoType = __aspxRichEdit.LayoutBoxType.Dash;
                            this.offsetStartWordAtStartRun = this.modelIterator.charOffset;
                        }
                        this.modelIterator.charOffset++;
                    };
                    BoxGenerator.prototype.makeParagraphAndSectionBox = function () {
                        this.modelIterator.charOffset++;
                        var charProps = this.run.getCharacterMergedProperies();
                        this.addNewBoxInfo(this.run.getType() == __aspxRichEdit.RunType.ParagraphRun ?
                            new __aspxRichEdit.LayoutParagraphMarkBox(charProps, charProps.getLayoutColorInfo(this.colorProvider)) :
                            new __aspxRichEdit.LayoutSectionMarkBox(charProps, charProps.getLayoutColorInfo(this.colorProvider)));
                        this.offsetStartWordAtStartRun = this.modelIterator.charOffset;
                    };
                    BoxGenerator.prototype.makeInlinePictureBox = function () {
                        var inlinePictureRun = this.run;
                        this.modelIterator.charOffset++;
                        var charProps = inlinePictureRun.getCharacterMergedProperies();
                        this.addNewBoxInfo(new __aspxRichEdit.LayoutPictureBox(charProps, charProps.getLayoutColorInfo(this.colorProvider), inlinePictureRun.id, __aspxRichEdit.UnitConverter.twipsToPixels(inlinePictureRun.getActualWidth()), __aspxRichEdit.UnitConverter.twipsToPixels(inlinePictureRun.getActualHeight()), inlinePictureRun.isLoaded));
                        this.offsetStartWordAtStartRun = this.modelIterator.charOffset;
                    };
                    BoxGenerator.prototype.makeAnchoredPictureRun = function () {
                        var anchorPictureRun = this.run;
                        if (anchorPictureRun.anchorInfo.hidden)
                            return;
                        this.modelIterator.charOffset++;
                        var charProps = anchorPictureRun.getCharacterMergedProperies();
                        this.addNewBoxInfo(new __aspxRichEdit.LayoutAnchoredPictureBox(charProps, charProps.getLayoutColorInfo(this.colorProvider), this.subDocument.id, anchorPictureRun.anchorInfo.clone(), anchorPictureRun.shape.clone().toAnotherMeasuringSystem(__aspxRichEdit.UnitConverter.twipsToPixels), anchorPictureRun.anchoredObjectID, __aspxRichEdit.UnitConverter.modelUnitsToRadians(anchorPictureRun.size.rotation), anchorPictureRun.id, anchorPictureRun.isLoaded).init(0, 0, __aspxRichEdit.UnitConverter.twipsToPixels(anchorPictureRun.getActualWidth()), __aspxRichEdit.UnitConverter.twipsToPixels(anchorPictureRun.getActualHeight())));
                        this.offsetStartWordAtStartRun = this.modelIterator.charOffset;
                    };
                    BoxGenerator.prototype.makeAnchoredTextBoxRun = function () {
                        var anchorTextBox = this.run;
                        if (anchorTextBox.anchorInfo.hidden)
                            return;
                        this.modelIterator.charOffset++;
                        var charProps = anchorTextBox.getCharacterMergedProperies();
                        var textBoxWrap = this.addNewBoxInfo(new __aspxRichEdit.LayoutAnchoredTextBox(anchorTextBox.getCharacterMergedProperies(), charProps.getLayoutColorInfo(this.colorProvider), this.subDocument.id, anchorTextBox.anchorInfo.clone(), anchorTextBox.shape.clone().toAnotherMeasuringSystem(__aspxRichEdit.UnitConverter.twipsToPixels), anchorTextBox.anchoredObjectID, __aspxRichEdit.UnitConverter.modelUnitsToRadians(anchorTextBox.size.rotation), anchorTextBox.subDocId, anchorTextBox.textBoxProperties.clone().setMarginsToAnotherMeasuringSystem(__aspxRichEdit.UnitConverter.twipsToPixels)));
                        if (textBoxWrap)
                            this.manager.anchoredObjectsManager.textBoxContextSizeCalculators[anchorTextBox.anchoredObjectID] =
                                new LayoutFormatter.AnchoredTextBoxContextSizeCalculator(textBoxWrap, anchorTextBox.size);
                        this.offsetStartWordAtStartRun = this.modelIterator.charOffset;
                    };
                    BoxGenerator.prototype.makeFieldCodeStartRun = function () {
                        this.modelIterator.charOffset++;
                        var charProps = this.run.getCharacterMergedProperies();
                        this.addNewBoxInfo(new __aspxRichEdit.LayoutFieldCodeStartBox(charProps, charProps.getLayoutColorInfo(this.colorProvider)));
                        this.offsetStartWordAtStartRun = this.modelIterator.charOffset;
                    };
                    BoxGenerator.prototype.makeFieldCodeEndRun = function () {
                        this.modelIterator.charOffset++;
                        var charProps = this.run.getCharacterMergedProperies();
                        this.addNewBoxInfo(new __aspxRichEdit.LayoutFieldCodeEndBox(charProps, charProps.getLayoutColorInfo(this.colorProvider)));
                        this.offsetStartWordAtStartRun = this.modelIterator.charOffset;
                    };
                    BoxGenerator.prototype.makeFieldResultEndRun = function () {
                        this.modelIterator.charOffset++;
                        var charProps = this.run.getCharacterMergedProperies();
                        this.addNewBoxInfo(new __aspxRichEdit.LayoutFieldResultEndBox(charProps, charProps.getLayoutColorInfo(this.colorProvider)));
                        this.offsetStartWordAtStartRun = this.modelIterator.charOffset;
                    };
                    BoxGenerator.prototype.makeLayoutDependentRun = function () {
                        this.modelIterator.charOffset++;
                        var charProps = this.run.getCharacterMergedProperies();
                        this.addNewBoxInfo(new __aspxRichEdit.LayoutDependentTextBox(this.run.getCharacterMergedProperies(), charProps.getLayoutColorInfo(this.colorProvider), this.modelIterator.getRunText()));
                        this.offsetStartWordAtStartRun = this.modelIterator.charOffset;
                    };
                    BoxGenerator.prototype.makeDefault = function () {
                        if (this.currBoxInfoType == __aspxRichEdit.LayoutBoxType.Dash) {
                            this.currWordToBox();
                            this.offsetStartWordAtStartRun = this.modelIterator.charOffset;
                        }
                        this.modelIterator.charOffset++;
                    };
                    BoxGenerator.prototype.currWordToBox = function () {
                        var maxBoxLength = this.currBoxInfoType == __aspxRichEdit.LayoutBoxType.Text ? BoxGenerator.MAX_BOX_LENGTH : 1;
                        if (this.modelIterator.charOffset > this.offsetStartWordAtStartRun) {
                            var currRunTextStart = this.offsetStartWordAtStartRun;
                            do {
                                var currBoxLength = Math.min(maxBoxLength, this.modelIterator.charOffset - currRunTextStart);
                                var word = this.modelIterator.getRunText(currRunTextStart, currBoxLength);
                                currRunTextStart += currBoxLength;
                                var charProps = this.run.getCharacterMergedProperies();
                                if (this.currBoxInfoType == __aspxRichEdit.LayoutBoxType.Text)
                                    this.addNewBoxInfo(new __aspxRichEdit.LayoutTextBox(charProps, charProps.getLayoutColorInfo(this.colorProvider), word), currRunTextStart);
                                else
                                    this.addNewBoxInfo(new __aspxRichEdit.LayoutDashBox(charProps, charProps.getLayoutColorInfo(this.colorProvider), word), currRunTextStart);
                            } while (currRunTextStart < this.modelIterator.charOffset);
                        }
                        this.currBoxInfoType = __aspxRichEdit.LayoutBoxType.Text;
                    };
                    BoxGenerator.prototype.getNextRun = function () {
                        this.currWordToBox();
                        var prevRun = this.modelIterator.run;
                        if (!this.modelIterator.moveToNextRun())
                            return false;
                        var newPos = this.modelIterator.getAbsolutePosition();
                        var isNeedUpdateWrapInfo = false;
                        if (this.paragraphIterator.update(newPos)) {
                            if (this.subDocument.isMain())
                                this.sectionIterator.update(newPos);
                            this.tableIterator.update(newPos);
                            isNeedUpdateWrapInfo = true;
                        }
                        if (this.fieldIterator.update(newPos) || prevRun.getType() == __aspxRichEdit.RunType.FieldCodeEndRun)
                            isNeedUpdateWrapInfo = true;
                        if (isNeedUpdateWrapInfo) {
                            this.currWrapInfo = new Box.BoxWrapInfo(this.paragraphIterator.index, this.sectionIterator.index, this.tableIterator.generateInfo(newPos), this.fieldIterator.generateInfo(newPos));
                        }
                        this.offsetStartWordAtStartRun = 0;
                        return true;
                    };
                    BoxGenerator.MapFieldCodeToLayoutDependentBoxType = new __aspxRichEdit.MapCreatorStringAsKey()
                        .add("PAGE", __aspxRichEdit.LayoutDependentBoxType.Page)
                        .add("NUMPAGES", __aspxRichEdit.LayoutDependentBoxType.Numpages)
                        .get();
                    BoxGenerator.MAX_BOX_LENGTH = 50;
                    BoxGenerator.modelCharToLayoutBoxConverter = new __aspxRichEdit.MapCreatorStringAsKey()
                        .add(__aspxRichEdit.RichUtils.specialCharacters.LineBreak, function (charProp, colorProvider) { return new __aspxRichEdit.LayoutLineBreakBox(charProp, charProp.getLayoutColorInfo(colorProvider)); })
                        .add(__aspxRichEdit.RichUtils.specialCharacters.Space, function (charProp, colorProvider) { return new __aspxRichEdit.LayoutSpaceBox(charProp, charProp.getLayoutColorInfo(colorProvider)); })
                        .add(__aspxRichEdit.RichUtils.specialCharacters.TabMark, function (charProp, colorProvider) { return new __aspxRichEdit.LayoutTabSpaceBoxJustForBoxIterator(charProp, charProp.getLayoutColorInfo(colorProvider)); })
                        .add(__aspxRichEdit.RichUtils.specialCharacters.PageBreak, function (charProp, colorProvider) { return new __aspxRichEdit.LayoutPageBreakBox(charProp, charProp.getLayoutColorInfo(colorProvider)); })
                        .add(__aspxRichEdit.RichUtils.specialCharacters.ColumnBreak, function (charProp, colorProvider) { return new __aspxRichEdit.LayoutColumnBreakBox(charProp, charProp.getLayoutColorInfo(colorProvider)); })
                        .add(__aspxRichEdit.RichUtils.specialCharacters.NonBreakingSpace, function (charProp, colorProvider) { return new __aspxRichEdit.LayoutNonBreakingSpaceBox(charProp, charProp.getLayoutColorInfo(colorProvider)); })
                        .get();
                    BoxGenerator.MAX_NUM_NEW_BOXES = Box.BoxWrapsHolder.AVERAGE_BOXES_ON_PAGE;
                    return BoxGenerator;
                }());
                Box.BoxGenerator = BoxGenerator;
            })(Box = Row.Box || (Row.Box = {}));
        })(Row = LayoutFormatter.Row || (LayoutFormatter.Row = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Row;
        (function (Row) {
            var Box;
            (function (Box) {
                var OneDimensionItertor = (function () {
                    function OneDimensionItertor(objects) {
                        this.objects = objects;
                    }
                    OneDimensionItertor.prototype.init = function (pos) {
                        var _this = this;
                        this.index = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.objects, function (o) { return _this.getPosition(o); }, pos);
                        this.updateNextObjPos();
                    };
                    OneDimensionItertor.prototype.update = function (newPosition) {
                        if (newPosition < this.nextObjPosition)
                            return false;
                        while (this.getPosition(this.objects[++this.index]) < newPosition)
                            ;
                        this.updateNextObjPos();
                        return true;
                    };
                    OneDimensionItertor.prototype.updateNextObjPos = function () {
                        var nextObj = this.objects[this.index + 1];
                        this.nextObjPosition = nextObj ? this.getPosition(nextObj) : Number.MAX_VALUE;
                    };
                    return OneDimensionItertor;
                }());
                Box.OneDimensionItertor = OneDimensionItertor;
                var ParagraphIterator = (function (_super) {
                    __extends(ParagraphIterator, _super);
                    function ParagraphIterator() {
                        return _super !== null && _super.apply(this, arguments) || this;
                    }
                    ParagraphIterator.prototype.getPosition = function (o) {
                        return o.startLogPosition.value;
                    };
                    return ParagraphIterator;
                }(OneDimensionItertor));
                Box.ParagraphIterator = ParagraphIterator;
                var SectionIterator = (function (_super) {
                    __extends(SectionIterator, _super);
                    function SectionIterator() {
                        return _super !== null && _super.apply(this, arguments) || this;
                    }
                    SectionIterator.prototype.getPosition = function (o) {
                        return o.startLogPosition.value;
                    };
                    return SectionIterator;
                }(OneDimensionItertor));
                Box.SectionIterator = SectionIterator;
            })(Box = Row.Box || (Row.Box = {}));
        })(Row = LayoutFormatter.Row || (LayoutFormatter.Row = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Row;
        (function (Row) {
            var Box;
            (function (Box) {
                var RecursiveObjectsIterator = (function () {
                    function RecursiveObjectsIterator(objects) {
                        this.objects = objects;
                    }
                    RecursiveObjectsIterator.prototype.init = function (pos) {
                        var _this = this;
                        this.indexes = [];
                        var index = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.objects, function (o) { return _this.getStartPosition(o); }, pos);
                        if (index < 0) {
                            this.setNextInfos(0, pos);
                            return;
                        }
                        var obj = this.objects[index];
                        while (pos >= this.getEndPosition(obj)) {
                            var parent_1 = this.getParent(obj);
                            if (!parent_1) {
                                this.setNextInfos(index + 1, pos);
                                return;
                            }
                            obj = parent_1;
                        }
                        this.collectIndexes(this.getIndex(obj), pos);
                    };
                    RecursiveObjectsIterator.prototype.collectIndexes = function (index, pos) {
                        var insertPos = this.indexes.length;
                        var ind = this.correctBounds(index, pos);
                        var obj = this.objects[ind];
                        var leftBoundIndex = this.indexes.length ? __aspxRichEdit.ListUtils.last(this.indexes) : -1;
                        while (true) {
                            this.indexes.splice(insertPos, 0, ind);
                            var parent_2 = this.getParent(obj);
                            if (!parent_2 || this.getIndex(parent_2) == leftBoundIndex)
                                break;
                            ind = this.getIndex(parent_2);
                            obj = parent_2;
                        }
                        this.setNextInfos(__aspxRichEdit.ListUtils.last(this.indexes) + 1, pos);
                    };
                    RecursiveObjectsIterator.prototype.update = function (newPosition) {
                        if (!this.objects.length)
                            return false;
                        var indexesDeleted = this.popLastIndexes(newPosition);
                        if (newPosition >= this.nextObjPosition) {
                            this.nextObjIndex = this.correctBounds(this.nextObjIndex, newPosition);
                            this.collectIndexes(this.nextObjIndex, newPosition);
                            return true;
                        }
                        return indexesDeleted;
                    };
                    RecursiveObjectsIterator.prototype.setNextInfos = function (ind, pos) {
                        this.nextObjIndex = ind;
                        var obj = this.objects[ind];
                        if (!obj || this.getStartPosition(obj) >= pos)
                            this.nextObjPosition = obj ? this.getStartPosition(obj) : Number.MAX_VALUE;
                        else
                            this.setNextInfos(ind + 1, pos);
                    };
                    RecursiveObjectsIterator.prototype.popLastIndexes = function (newPosition) {
                        if (!this.indexes.length || newPosition < this.getEndPosition(this.objects[__aspxRichEdit.ListUtils.last(this.indexes)]))
                            return false;
                        this.indexes.pop();
                        this.popLastIndexes(newPosition);
                        return true;
                    };
                    return RecursiveObjectsIterator;
                }());
                Box.RecursiveObjectsIterator = RecursiveObjectsIterator;
                var TableIterator = (function (_super) {
                    __extends(TableIterator, _super);
                    function TableIterator() {
                        return _super !== null && _super.apply(this, arguments) || this;
                    }
                    TableIterator.prototype.getStartPosition = function (o) {
                        return o.getStartPosition();
                    };
                    TableIterator.prototype.getEndPosition = function (o) {
                        return o.getEndPosition();
                    };
                    TableIterator.prototype.getParent = function (obj) {
                        return obj.getParentTable();
                    };
                    TableIterator.prototype.getIndex = function (obj) {
                        return obj.index;
                    };
                    TableIterator.prototype.correctBounds = function (objIndex, pos) {
                        return __aspxRichEdit.Table.correctBoundTable(this.objects, objIndex, pos, function (i) { return ++i; }).index;
                    };
                    TableIterator.prototype.generateInfo = function (pos) {
                        var _this = this;
                        if (!this.indexes.length)
                            return null;
                        return __aspxRichEdit.ListUtils.map(this.indexes, function (ind) {
                            var table = _this.objects[ind];
                            var rowIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(table.rows, function (r) { return r.getStartPosition(); }, pos);
                            var cellIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(table.rows[rowIndex].cells, function (c) { return c.startParagraphPosition.value; }, pos);
                            return new __aspxRichEdit.TablePosition(table, rowIndex, cellIndex).init();
                        });
                    };
                    return TableIterator;
                }(RecursiveObjectsIterator));
                Box.TableIterator = TableIterator;
                var FieldIterator = (function (_super) {
                    __extends(FieldIterator, _super);
                    function FieldIterator() {
                        return _super !== null && _super.apply(this, arguments) || this;
                    }
                    FieldIterator.prototype.getStartPosition = function (o) {
                        return o.getFieldStartPosition();
                    };
                    FieldIterator.prototype.getEndPosition = function (o) {
                        return o.getFieldEndPosition();
                    };
                    FieldIterator.prototype.getParent = function (obj) {
                        return obj.parent;
                    };
                    FieldIterator.prototype.getIndex = function (obj) {
                        return obj.index;
                    };
                    FieldIterator.prototype.correctBounds = function (objIndex, _pos) {
                        return objIndex;
                    };
                    FieldIterator.prototype.generateInfo = function (pos) {
                        var _this = this;
                        if (!this.indexes.length)
                            return null;
                        return __aspxRichEdit.ListUtils.map(this.indexes, function (ind) { return Box.BoxWrapFieldInfo.make(_this.objects[ind], pos); });
                    };
                    return FieldIterator;
                }(RecursiveObjectsIterator));
                Box.FieldIterator = FieldIterator;
            })(Box = Row.Box || (Row.Box = {}));
        })(Row = LayoutFormatter.Row || (LayoutFormatter.Row = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ColumnChange = (function (_super) {
        __extends(ColumnChange, _super);
        function ColumnChange(index, changeType, rowChanges, tableChanges, paragraphFrameChanges) {
            if (changeType === void 0) { changeType = __aspxRichEdit.LayoutChangeType.Updated; }
            if (rowChanges === void 0) { rowChanges = []; }
            if (tableChanges === void 0) { tableChanges = []; }
            if (paragraphFrameChanges === void 0) { paragraphFrameChanges = []; }
            var _this = _super.call(this, index, changeType) || this;
            _this.rowChanges = rowChanges;
            _this.tableChanges = tableChanges;
            _this.paragraphFrameChanges = paragraphFrameChanges;
            return _this;
        }
        ColumnChange.prototype.summarizeChanges = function (change) {
            this.rowChanges = this.rowChanges.concat(change.rowChanges);
            this.tableChanges = this.tableChanges.concat(change.tableChanges);
            this.paragraphFrameChanges = this.paragraphFrameChanges.concat(change.paragraphFrameChanges);
        };
        ColumnChange.prototype.reduceChanges = function () {
            this.rowChanges = __aspxRichEdit.ListUtils.reducedMap(this.rowChanges, function (change) { return change.reduceChanges(); });
            this.tableChanges = __aspxRichEdit.ListUtils.reducedMap(this.tableChanges, function (change) { return change.reduceChanges(); });
            this.paragraphFrameChanges = __aspxRichEdit.ListUtils.reducedMap(this.paragraphFrameChanges, function (change) { return change.reduceChanges(); });
            return this.changeType == __aspxRichEdit.LayoutChangeType.Updated &&
                !this.rowChanges.length && !this.tableChanges.length && !this.paragraphFrameChanges.length ?
                null : this;
        };
        return ColumnChange;
    }(__aspxRichEdit.LayoutChangeBase));
    __aspxRichEdit.ColumnChange = ColumnChange;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var PageAreaChange = (function (_super) {
        __extends(PageAreaChange, _super);
        function PageAreaChange(index, changeType, columnChanges) {
            if (changeType === void 0) { changeType = __aspxRichEdit.LayoutChangeType.Updated; }
            if (columnChanges === void 0) { columnChanges = []; }
            var _this = _super.call(this, index, changeType) || this;
            _this.columnChanges = columnChanges;
            return _this;
        }
        PageAreaChange.prototype.summarizeChanges = function (change) {
            this.columnChanges = this.columnChanges.concat(change.columnChanges);
        };
        PageAreaChange.prototype.reduceChanges = function () {
            this.columnChanges = __aspxRichEdit.ListUtils.reducedMap(this.columnChanges, function (change) { return change.reduceChanges(); });
            return this.changeType == __aspxRichEdit.LayoutChangeType.Updated && !this.columnChanges.length ? null : this;
        };
        return PageAreaChange;
    }(__aspxRichEdit.LayoutChangeBase));
    __aspxRichEdit.PageAreaChange = PageAreaChange;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var PageChange = (function (_super) {
        __extends(PageChange, _super);
        function PageChange(index, changeType, pageAreaChanges, otherPageAreaChanges) {
            if (changeType === void 0) { changeType = __aspxRichEdit.LayoutChangeType.Updated; }
            if (pageAreaChanges === void 0) { pageAreaChanges = []; }
            if (otherPageAreaChanges === void 0) { otherPageAreaChanges = []; }
            var _this = _super.call(this, index, changeType) || this;
            _this.mainPageAreaChanges = pageAreaChanges;
            _this.otherPageAreaChanges = otherPageAreaChanges;
            _this.anchoredPictureChanges = [];
            return _this;
        }
        PageChange.prototype.summarizeChanges = function (change) {
            __aspxRichEdit.ListUtils.addListOnTail(this.mainPageAreaChanges, change.mainPageAreaChanges);
            __aspxRichEdit.ListUtils.addListOnTail(this.otherPageAreaChanges, change.otherPageAreaChanges);
            __aspxRichEdit.ListUtils.addListOnTail(this.anchoredPictureChanges, change.anchoredPictureChanges);
        };
        PageChange.prototype.emptyOrInvalid = function () {
            if (this.changeType != __aspxRichEdit.LayoutChangeType.Updated || this.otherPageAreaChanges.length > 0 || this.anchoredPictureChanges.length > 0)
                return false;
            for (var _i = 0, _a = this.mainPageAreaChanges; _i < _a.length; _i++) {
                var pageAreaChange = _a[_i];
                if (pageAreaChange.changeType != __aspxRichEdit.LayoutChangeType.Updated)
                    return false;
                for (var _b = 0, _c = pageAreaChange.columnChanges; _b < _c.length; _b++) {
                    var columnChange = _c[_b];
                    if (columnChange.changeType != __aspxRichEdit.LayoutChangeType.Updated || columnChange.rowChanges.length != 0 ||
                        columnChange.paragraphFrameChanges.length != 0 || columnChange.tableChanges.length != 0)
                        return false;
                }
            }
            return true;
        };
        PageChange.prototype.reduceChanges = function () {
            this.mainPageAreaChanges = __aspxRichEdit.ListUtils.reducedMap(this.mainPageAreaChanges, function (change) { return change.reduceChanges(); });
            this.otherPageAreaChanges = __aspxRichEdit.ListUtils.reducedMap(this.otherPageAreaChanges, function (change) { return change.reduceChanges(); });
            this.anchoredPictureChanges = __aspxRichEdit.ListUtils.reducedMap(this.anchoredPictureChanges, function (change) { return change.reduceChanges(); });
            return this;
        };
        return PageChange;
    }(__aspxRichEdit.LayoutChangeBase));
    __aspxRichEdit.PageChange = PageChange;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var ChangesManager = (function () {
            function ChangesManager() {
                this.reset();
            }
            ChangesManager.prototype.reset = function () {
                this.pageChanges = [];
            };
            ChangesManager.prototype.addPageChange = function (pageChange) {
                if (pageChange)
                    this.pageChanges.push(pageChange);
            };
            ChangesManager.prototype.getPageChanges = function () {
                return this.pageChanges;
            };
            ChangesManager.prototype.getMergedPageChanges = function () {
                if (!this.pageChanges.length)
                    return [];
                var mergedPageChanges = new __aspxRichEdit.LayoutPageChangesMerger().merge(this.pageChanges);
                __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.LayoutFormatter, "mergedPageChanges - Changes\n", __aspxRichEdit.LogListHelper.level_1(function (change) { return __aspxRichEdit.LogObjToStr.pageChange(change, ""); }, mergedPageChanges, "", "\n"));
                return mergedPageChanges;
            };
            return ChangesManager;
        }());
        LayoutFormatter.ChangesManager = ChangesManager;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangesMerger = (function () {
        function ChangesMerger() {
        }
        ChangesMerger.prototype.merge = function (changes) {
            this.resultChanges = [];
            this.infos = [];
            this.fillTo(0);
            for (var _i = 0, changes_1 = changes; _i < changes_1.length; _i++) {
                var change = changes_1[_i];
                switch (change.changeType) {
                    case __aspxRichEdit.LayoutChangeType.Inserted:
                        this.handleInsertedChange(change);
                        break;
                    case __aspxRichEdit.LayoutChangeType.Deleted:
                        this.handleDeletedChange(change);
                        break;
                    case __aspxRichEdit.LayoutChangeType.Replaced:
                        this.handleReplacedChange(change, ChangesMergerInfoType.Replaced);
                        break;
                    case __aspxRichEdit.LayoutChangeType.Updated:
                        this.handleReplacedChange(change, ChangesMergerInfoType.Updated);
                        break;
                }
            }
            this.collectFinalChanges();
            return this.resultChanges;
        };
        ChangesMerger.prototype.fillTo = function (lastIndex) {
            while (this.infos.length <= lastIndex)
                this.infos.push(new ChangesMergerInfo(ChangesMergerInfoType.None, null, 0));
        };
        ChangesMerger.prototype.handleDeletedChange = function (change) {
            this.fillTo(change.index);
            var delPageInfo = this.infos.splice(change.index + 1, 1)[0];
            this.infos[change.index].numElemsDeletedAfterThis += 1 + (delPageInfo ? delPageInfo.numElemsDeletedAfterThis : 0);
        };
        ChangesMerger.prototype.handleInsertedChange = function (change) {
            this.fillTo(change.index);
            var prevPageInfo = this.infos[change.index];
            this.infos.splice(change.index + 1, 0, prevPageInfo.numElemsDeletedAfterThis ?
                new ChangesMergerInfo(ChangesMergerInfoType.Replaced, this.changeConstructor(change.index, __aspxRichEdit.LayoutChangeType.Replaced), prevPageInfo.numElemsDeletedAfterThis - 1) :
                new ChangesMergerInfo(ChangesMergerInfoType.Inserted, change, 0));
            prevPageInfo.numElemsDeletedAfterThis = 0;
        };
        ChangesMerger.prototype.handleReplacedChange = function (change, infoType) {
            this.fillTo(change.index + 1);
            var info = this.infos[change.index + 1];
            switch (info.type) {
                case ChangesMergerInfoType.Inserted:
                case ChangesMergerInfoType.Replaced:
                    break;
                case ChangesMergerInfoType.None:
                case ChangesMergerInfoType.Updated:
                    if (infoType == ChangesMergerInfoType.Updated && info.type == ChangesMergerInfoType.Updated) {
                        info.change.summarizeChanges(change);
                    }
                    else {
                        info.type = infoType;
                        info.change = change;
                    }
                    break;
            }
        };
        ChangesMerger.prototype.collectFinalChanges = function () {
            for (var infoIndex = 0, info = void 0; info = this.infos[infoIndex]; infoIndex++) {
                switch (info.type) {
                    case ChangesMergerInfoType.Inserted:
                    case ChangesMergerInfoType.Replaced:
                    case ChangesMergerInfoType.Updated:
                        info.change.index = infoIndex - 1;
                        this.resultChanges.push(info.change);
                        break;
                    case ChangesMergerInfoType.None:
                        break;
                }
                for (; info.numElemsDeletedAfterThis; info.numElemsDeletedAfterThis--)
                    this.resultChanges.push(this.changeConstructor(infoIndex, __aspxRichEdit.LayoutChangeType.Deleted));
            }
        };
        return ChangesMerger;
    }());
    __aspxRichEdit.ChangesMerger = ChangesMerger;
    var LayoutPageChangesMerger = (function (_super) {
        __extends(LayoutPageChangesMerger, _super);
        function LayoutPageChangesMerger() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutPageChangesMerger.prototype.changeConstructor = function (index, changeType) {
            return new __aspxRichEdit.PageChange(index, changeType, [], []);
        };
        return LayoutPageChangesMerger;
    }(ChangesMerger));
    __aspxRichEdit.LayoutPageChangesMerger = LayoutPageChangesMerger;
    var LayoutPageAreaChangesMerger = (function (_super) {
        __extends(LayoutPageAreaChangesMerger, _super);
        function LayoutPageAreaChangesMerger() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutPageAreaChangesMerger.prototype.changeConstructor = function (index, changeType) {
            return new __aspxRichEdit.PageAreaChange(index, changeType, []);
        };
        return LayoutPageAreaChangesMerger;
    }(ChangesMerger));
    __aspxRichEdit.LayoutPageAreaChangesMerger = LayoutPageAreaChangesMerger;
    var LayoutColumnChangesMerger = (function (_super) {
        __extends(LayoutColumnChangesMerger, _super);
        function LayoutColumnChangesMerger() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutColumnChangesMerger.prototype.changeConstructor = function (index, changeType) {
            return new __aspxRichEdit.ColumnChange(index, changeType, [], [], []);
        };
        return LayoutColumnChangesMerger;
    }(ChangesMerger));
    __aspxRichEdit.LayoutColumnChangesMerger = LayoutColumnChangesMerger;
    var LayoutRowChangesMerger = (function (_super) {
        __extends(LayoutRowChangesMerger, _super);
        function LayoutRowChangesMerger() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutRowChangesMerger.prototype.changeConstructor = function (index, changeType) {
            return new __aspxRichEdit.RowChange(index, changeType);
        };
        return LayoutRowChangesMerger;
    }(ChangesMerger));
    __aspxRichEdit.LayoutRowChangesMerger = LayoutRowChangesMerger;
    var LayoutTableChangesMerger = (function (_super) {
        __extends(LayoutTableChangesMerger, _super);
        function LayoutTableChangesMerger() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutTableChangesMerger.prototype.changeConstructor = function (index, changeType) {
            return new __aspxRichEdit.TableChange(index, changeType);
        };
        return LayoutTableChangesMerger;
    }(ChangesMerger));
    __aspxRichEdit.LayoutTableChangesMerger = LayoutTableChangesMerger;
    var LayoutParagraphFrameChangesMerger = (function (_super) {
        __extends(LayoutParagraphFrameChangesMerger, _super);
        function LayoutParagraphFrameChangesMerger() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LayoutParagraphFrameChangesMerger.prototype.changeConstructor = function (index, changeType) {
            return new __aspxRichEdit.ParagraphFrameChange(index, changeType);
        };
        return LayoutParagraphFrameChangesMerger;
    }(ChangesMerger));
    __aspxRichEdit.LayoutParagraphFrameChangesMerger = LayoutParagraphFrameChangesMerger;
    var ChangesMergerInfo = (function () {
        function ChangesMergerInfo(type, change, numElemsDeletedAfterThis) {
            this.type = type;
            this.change = change;
            this.numElemsDeletedAfterThis = numElemsDeletedAfterThis;
        }
        return ChangesMergerInfo;
    }());
    var ChangesMergerInfoType;
    (function (ChangesMergerInfoType) {
        ChangesMergerInfoType[ChangesMergerInfoType["Replaced"] = 0] = "Replaced";
        ChangesMergerInfoType[ChangesMergerInfoType["Inserted"] = 1] = "Inserted";
        ChangesMergerInfoType[ChangesMergerInfoType["Updated"] = 2] = "Updated";
        ChangesMergerInfoType[ChangesMergerInfoType["None"] = 3] = "None";
    })(ChangesMergerInfoType || (ChangesMergerInfoType = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var PageChangesCollector = (function () {
            function PageChangesCollector() {
            }
            PageChangesCollector.collectHeaderFooterChanges = function (pageIndex, oldPageAreas, newPageAreas) {
                return new __aspxRichEdit.PageChange(pageIndex, __aspxRichEdit.LayoutChangeType.Updated, [], PageChangesCollector.collectMapChanges(oldPageAreas, newPageAreas, __aspxRichEdit.PageAreaChange, function (_a, _b) { return true; }, PageChangesCollector.collectColumnsChanges));
            };
            PageChangesCollector.collectPageChanges = function (layoutPages, newPage) {
                var oldPage = layoutPages[newPage.index];
                if (oldPage) {
                    var change = __aspxRichEdit.MapUtilsKeyAsNumber.anyOf(newPage.anchoredObjectHolder.objects, function (newObj, id) {
                        var oldObj = oldPage.anchoredObjectHolder.objects[id];
                        return oldObj && newObj.rendererLevel != oldObj.rendererLevel ? new __aspxRichEdit.PageChange(newPage.index, __aspxRichEdit.LayoutChangeType.Replaced) : null;
                    });
                    if (change)
                        return change;
                }
                return PageChangesCollector.makeChange(oldPage, newPage, newPage.index, __aspxRichEdit.PageChange, function (a, b) { return a.equals(b) && a.layoutPageIndex == b.layoutPageIndex; }, function (pChange, oldPage, newPage) {
                    pChange.mainPageAreaChanges = PageChangesCollector.collectListChanges(oldPage.mainSubDocumentPageAreas, newPage.mainSubDocumentPageAreas, __aspxRichEdit.PageAreaChange, function (_a, _b) { return true; }, PageChangesCollector.collectColumnsChanges);
                    pChange.anchoredPictureChanges = PageChangesCollector.collectMapChanges(PageChangesCollector.getOnlyPictureObjects(oldPage.anchoredObjectHolder.objects), PageChangesCollector.getOnlyPictureObjects(newPage.anchoredObjectHolder.objects), __aspxRichEdit.AnchoredPictureChange, function (a, b) { return a.equals(b); }, function (_change, _a, _b) { });
                    pChange.otherPageAreaChanges = PageChangesCollector.collectMapChanges(oldPage.otherPageAreas, newPage.otherPageAreas, __aspxRichEdit.PageAreaChange, function (a, b) {
                        return a.subDocument.isTextBox() ?
                            oldPage.anchoredObjectHolder.getTextBoxByInternalSubDocId(a.subDocument.id)
                                .equals(newPage.anchoredObjectHolder.getTextBoxByInternalSubDocId(b.subDocument.id)) : true;
                    }, PageChangesCollector.collectColumnsChanges);
                }).reduceChanges();
            };
            PageChangesCollector.getOnlyPictureObjects = function (objs) {
                return __aspxRichEdit.MapUtilsKeyAsNumber.reducedMap(objs, function (o) { return o.getType() == __aspxRichEdit.LayoutBoxType.AnchorPicture ? o : null; });
            };
            PageChangesCollector.collectColumnsChanges = function (paChange, oldPA, newPA) {
                var tableCellsComparer = new LayoutFormatter.TableCellsComparer();
                paChange.columnChanges = PageChangesCollector.collectListChanges(oldPA.columns, newPA.columns, __aspxRichEdit.ColumnChange, function (_a, _b) { return true; }, function (colChange, oldCol, newCol) {
                    colChange.rowChanges = PageChangesCollector.collectListChanges(oldCol.rows, newCol.rows, __aspxRichEdit.RowChange, function (a, b) { return PageChangesCollector.isLayoutRowEquivalent(a, b, tableCellsComparer); }, function (_rowChange, _oldRow, _newRow) { });
                    colChange.paragraphFrameChanges = LayoutFormatter.ParagraphFrameChangesCollector.collect(oldCol.paragraphFrames, newCol.paragraphFrames);
                    colChange.tableChanges = PageChangesCollector.collectListChanges(oldCol.tablesInfo, newCol.tablesInfo, __aspxRichEdit.TableChange, function (a, b) { return a === b; }, function (_tableChange, _oldTblColInfo, _newTblColInfo) { });
                });
            };
            PageChangesCollector.collectListChanges = function (oldObjects, newObjects, changeConctructor, equals, fillChange) {
                var changes = [];
                for (var ind = 0, newObj = void 0; newObj = newObjects[ind]; ind++)
                    changes.push(PageChangesCollector.makeChange(oldObjects[ind], newObj, ind, changeConctructor, function (a, b) { return a.equals(b) && equals(a, b); }, fillChange));
                __aspxRichEdit.ListUtils.reverseForeach(oldObjects, function (_oldObj, ind) { return changes.push(new changeConctructor(ind, __aspxRichEdit.LayoutChangeType.Deleted)); }, oldObjects.length - 1, newObjects.length);
                return changes;
            };
            PageChangesCollector.collectMapChanges = function (oldObjects, newObjects, changeConctructor, equals, fillChange) {
                var changes = [];
                var tmpOldObj = __aspxRichEdit.MapUtilsKeyAsNumber.map(oldObjects, function (obj) { return obj; });
                __aspxRichEdit.MapUtilsKeyAsNumber.foreach(newObjects, function (newObj, id) {
                    changes.push(PageChangesCollector.makeChange(tmpOldObj[id], newObj, id, changeConctructor, function (a, b) { return a.equals(b) && equals(a, b); }, fillChange));
                    delete tmpOldObj[id];
                });
                __aspxRichEdit.MapUtilsKeyAsNumber.foreach(tmpOldObj, function (_oldObj, ind) { return changes.push(new changeConctructor(ind, __aspxRichEdit.LayoutChangeType.Deleted)); });
                return changes;
            };
            PageChangesCollector.makeChange = function (oldObj, newObj, index, changeConctructor, equals, fillChange) {
                if (!oldObj) {
                    return new changeConctructor(index, __aspxRichEdit.LayoutChangeType.Inserted);
                }
                if (equals(oldObj, newObj)) {
                    var change = new changeConctructor(index, __aspxRichEdit.LayoutChangeType.Updated);
                    fillChange(change, oldObj, newObj);
                    return change;
                }
                return new changeConctructor(index, __aspxRichEdit.LayoutChangeType.Replaced);
            };
            PageChangesCollector.isLayoutRowEquivalent = function (rowA, rowB, tableCellsComparer) {
                if (rowA.x != rowB.x || rowA.y != rowB.y || rowA.width != rowB.width || rowA.columnOffset != rowB.columnOffset ||
                    rowA.height != rowB.height || rowA.baseLine != rowB.baseLine || rowA.boxes.length != rowB.boxes.length ||
                    rowA.bookmarkBoxes.length != rowB.bookmarkBoxes.length ||
                    (rowA.tableCellInfo ? rowA.indexInColumn != rowB.indexInColumn : false))
                    return false;
                return __aspxRichEdit.ListUtils.anyOf2(rowA.boxes, rowB.boxes, function (boxA, boxB) { return !boxA.equals(boxB); }) ||
                    __aspxRichEdit.ListUtils.anyOf2(rowA.bookmarkBoxes, rowB.bookmarkBoxes, function (boxA, boxB) { return !boxA.equals(boxB); }) ||
                    !(rowA.numberingListBox ? rowA.numberingListBox.equals(rowB.numberingListBox) : !rowB.numberingListBox) ?
                    false :
                    tableCellsComparer.isEquivalent(rowA, rowB);
            };
            return PageChangesCollector;
        }());
        LayoutFormatter.PageChangesCollector = PageChangesCollector;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var ParagraphFrameCollector = (function () {
            function ParagraphFrameCollector() {
            }
            ParagraphFrameCollector.collect = function (colorProvider, newColumn, pageAreaOffset, paragraphs) {
                return ParagraphFrameCollector.collectNewParFrames(colorProvider, paragraphs, newColumn.rows, pageAreaOffset + newColumn.pageAreaOffset);
            };
            ParagraphFrameCollector.collectNewParFrames = function (colorProvider, paragraphs, rows, columnPos) {
                var parFrames = [];
                var firstRowStartPos = columnPos + rows[0].columnOffset;
                var parIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(paragraphs, function (p) { return p.startLogPosition.value; }, firstRowStartPos);
                var paragraph = paragraphs[parIndex];
                var parInterval = paragraph.interval;
                var prevParIndex = parIndex - 1;
                var parProps = paragraphs[parIndex].getParagraphMergedProperies();
                var parFrame;
                var prevParColor;
                for (var rowIndex = 0, prevRow = void 0, row = void 0; row = rows[rowIndex]; rowIndex++) {
                    var rowPos = columnPos + row.columnOffset;
                    while (true) {
                        if (parInterval.contains(rowPos)) {
                            if (parIndex != prevParIndex || parProps.firstLineIndentType != __aspxRichEdit.ParagraphFirstLineIndent.None) {
                                parFrame = new __aspxRichEdit.ParagraphFrame();
                                parFrames.push(parFrame);
                                parFrame.paragraphColor = parProps.shadingInfo.getActualColor(colorProvider);
                                parFrame.x = row.x;
                                parFrame.width = row.getRightBoundPosition() - __aspxRichEdit.UnitConverter.twipsToPixels(parProps.rightIndent) - parFrame.x;
                                parFrame.y = row.y;
                                parFrame.height = row.height;
                                if (rowIndex == 0 ||
                                    prevRow && prevRow.tableCellInfo && !row.tableCellInfo ||
                                    row.tableCellInfo && row.tableCellInfo.layoutRows[0] == row ||
                                    (prevParColor == __aspxRichEdit.ColorHelper.NO_COLOR || prevParColor == __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR)) {
                                    parFrame.y += row.getSpacingBefore();
                                    parFrame.height -= row.getSpacingBefore();
                                }
                                if (ParagraphFrameCollector.isRemoveSpacingAfter(colorProvider, row, rows[rowIndex + 1], paragraphs, parIndex))
                                    parFrame.height -= row.getSpacingAfter();
                                prevParColor = parFrame.paragraphColor;
                            }
                            else {
                                parFrame.height = row.getBottomBoundPosition() - parFrame.y;
                                if (ParagraphFrameCollector.isRemoveSpacingAfter(colorProvider, row, rows[rowIndex + 1], paragraphs, parIndex))
                                    parFrame.height -= row.getSpacingAfter();
                            }
                            prevParIndex = parIndex;
                            break;
                        }
                        else {
                            parIndex++;
                            paragraph = paragraphs[parIndex];
                            parInterval = paragraph.interval;
                            parProps = paragraph.getParagraphMergedProperies();
                        }
                    }
                    prevRow = row;
                }
                return ParagraphFrameCollector.mergeParagraphFrames(parFrames);
            };
            ParagraphFrameCollector.isRemoveSpacingAfter = function (colorProvider, row, nextRow, paragraphs, parIndex) {
                var nextParColor;
                return (!nextRow ||
                    row.flags.get(__aspxRichEdit.LayoutRowStateFlags.ParagraphEnd) && (!row.tableCellInfo && nextRow.tableCellInfo ||
                        row.tableCellInfo && __aspxRichEdit.ListUtils.last(row.tableCellInfo.layoutRows) == row ||
                        ((nextParColor = paragraphs[parIndex + 1].getParagraphMergedProperies().shadingInfo.getActualColor(colorProvider)) == __aspxRichEdit.ColorHelper.NO_COLOR ||
                            nextParColor == __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR)));
            };
            ParagraphFrameCollector.mergeParagraphFrames = function (paragraphFrames) {
                var mergedParFrames = [];
                var currParFrame;
                for (var parFrameIndex = 0, paragraphFrame = void 0; paragraphFrame = paragraphFrames[parFrameIndex]; parFrameIndex++) {
                    if (paragraphFrame.paragraphColor == __aspxRichEdit.ColorHelper.NO_COLOR || paragraphFrame.paragraphColor == __aspxRichEdit.ColorHelper.AUTOMATIC_COLOR) {
                        currParFrame = null;
                        continue;
                    }
                    if (currParFrame &&
                        paragraphFrame.paragraphColor == currParFrame.paragraphColor &&
                        paragraphFrame.x == currParFrame.x &&
                        paragraphFrame.width == currParFrame.width &&
                        Math.abs(paragraphFrame.y - currParFrame.getBottomBoundPosition()) < 2) {
                        currParFrame.height = paragraphFrame.getBottomBoundPosition() - currParFrame.y;
                    }
                    else {
                        currParFrame = paragraphFrame;
                        mergedParFrames.push(currParFrame);
                    }
                }
                return mergedParFrames;
            };
            return ParagraphFrameCollector;
        }());
        LayoutFormatter.ParagraphFrameCollector = ParagraphFrameCollector;
        var ParagraphFrameChangesCollector = (function () {
            function ParagraphFrameChangesCollector() {
            }
            ParagraphFrameChangesCollector.collect = function (oldParFrames, newParFrames) {
                var changes = [];
                for (var frameIndex = 0; frameIndex < newParFrames.length; frameIndex++) {
                    var newParFrame = newParFrames[frameIndex];
                    var oldParFrame = oldParFrames[frameIndex];
                    if (!oldParFrame)
                        changes.push(new __aspxRichEdit.ParagraphFrameChange(frameIndex, __aspxRichEdit.LayoutChangeType.Inserted));
                    else {
                        if (!newParFrame.equals(oldParFrame))
                            changes.push(new __aspxRichEdit.ParagraphFrameChange(frameIndex, __aspxRichEdit.LayoutChangeType.Replaced));
                    }
                }
                for (var frameIndex = newParFrames.length; frameIndex < oldParFrames.length; frameIndex++)
                    changes.push(new __aspxRichEdit.ParagraphFrameChange(newParFrames.length, __aspxRichEdit.LayoutChangeType.Deleted));
                return changes;
            };
            return ParagraphFrameChangesCollector;
        }());
        LayoutFormatter.ParagraphFrameChangesCollector = ParagraphFrameChangesCollector;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var TableCellsComparer = (function () {
            function TableCellsComparer() {
                this.cache = {};
            }
            TableCellsComparer.prototype.reset = function () {
                this.cache = {};
            };
            TableCellsComparer.prototype.isEquivalent = function (layoutRowA, layoutRowB) {
                var tableCellA = layoutRowA.tableCellInfo;
                var tableCellB = layoutRowB.tableCellInfo;
                if (!tableCellA && !tableCellB)
                    return true;
                if (tableCellA && !tableCellB || !tableCellA && tableCellB)
                    return false;
                return this.isCellsEquivalent(tableCellA, tableCellB) &&
                    TableCellsComparer.rowsEqualIndex(tableCellA, layoutRowA, tableCellB, layoutRowB);
            };
            TableCellsComparer.prototype.isCellsEquivalent = function (tableCellA, tableCellB) {
                var keyA = TableCellsComparer.getKey(tableCellA);
                var keyB = TableCellsComparer.getKey(tableCellB);
                var cache = this.cache[keyA];
                if (!cache)
                    cache = this.cache[keyA] = {};
                var cacheCellsEquivalent = cache[keyB];
                return cacheCellsEquivalent === undefined ? cache[keyB] = TableCellsComparer.compareCells(tableCellA, tableCellB) : cacheCellsEquivalent;
            };
            TableCellsComparer.compareCells = function (tableCellA, tableCellB) {
                var tableRowA = tableCellA.parentRow;
                var tableRowB = tableCellB.parentRow;
                var tableA = tableRowA.parentTable;
                var tableB = tableRowB.parentTable;
                return tableA.logicInfo.grid.table == tableB.logicInfo.grid.table &&
                    tableRowA.rowIndex == tableRowB.rowIndex &&
                    tableCellA.cellGridIndex == tableCellB.cellGridIndex &&
                    tableCellA.layoutRows.length == tableCellB.layoutRows.length &&
                    TableCellsComparer.equalLengthAndPosition(tableRowA.rowCells, tableCellA, tableRowB.rowCells, tableCellB) &&
                    TableCellsComparer.equalLengthAndPosition(tableA.tableRows, tableRowA, tableB.tableRows, tableRowB);
            };
            TableCellsComparer.equalLengthAndPosition = function (listA, elemA, listB, elemB) {
                return listA.length == listB.length &&
                    __aspxRichEdit.ListUtils.indexOf(listA, elemA) == __aspxRichEdit.ListUtils.indexOf(listB, elemB);
            };
            TableCellsComparer.getKey = function (tableCellA) {
                var row = tableCellA.parentRow;
                return row.parentTable.logicInfo.grid.table.index << (16 * 2) | row.rowIndex << 16 | tableCellA.cellGridIndex;
            };
            TableCellsComparer.rowsEqualIndex = function (tableCellA, layoutRowA, tableCellB, layoutRowB) {
                return __aspxRichEdit.ListUtils.indexOf(tableCellA.layoutRows, layoutRowA) == __aspxRichEdit.ListUtils.indexOf(tableCellB.layoutRows, layoutRowB);
            };
            return TableCellsComparer;
        }());
        LayoutFormatter.TableCellsComparer = TableCellsComparer;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var AnchorObjectPositionCalculatorBase = (function () {
            function AnchorObjectPositionCalculatorBase(manager) {
                this.manager = manager;
            }
            Object.defineProperty(AnchorObjectPositionCalculatorBase.prototype, "anchorInfo", {
                get: function () {
                    return this.obj.anchorInfo;
                },
                enumerable: true,
                configurable: true
            });
            AnchorObjectPositionCalculatorBase.prototype.init = function (obj) {
                this.lp = this.manager.activeFormatter.layoutPosition;
                this.obj = obj;
                this.isRelativeCell = !!this.manager.activeFormatter.tableFormatter;
            };
            return AnchorObjectPositionCalculatorBase;
        }());
        LayoutFormatter.AnchorObjectPositionCalculatorBase = AnchorObjectPositionCalculatorBase;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var AnchorObjectHorizontalPositionCalculator = (function (_super) {
            __extends(AnchorObjectHorizontalPositionCalculator, _super);
            function AnchorObjectHorizontalPositionCalculator() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            AnchorObjectHorizontalPositionCalculator.prototype.calculate = function (obj) {
                this.init(obj);
                this.isRelativeCell = this.isRelativeCell && obj.anchorInfo.layoutTableCell;
                this.obj.x = this.getX();
                this.correctInTextAnchorPosition();
            };
            Object.defineProperty(AnchorObjectHorizontalPositionCalculator.prototype, "leftCellMargin", {
                get: function () { return this.manager.activeFormatter.tableFormatter.actualFormatter.tableInfo.currCellInfo.marginLeft; },
                enumerable: true,
                configurable: true
            });
            Object.defineProperty(AnchorObjectHorizontalPositionCalculator.prototype, "rightCellMargin", {
                get: function () { return this.manager.activeFormatter.tableFormatter.actualFormatter.tableInfo.currCellInfo.marginRight; },
                enumerable: true,
                configurable: true
            });
            AnchorObjectHorizontalPositionCalculator.prototype.getX = function () {
                if (this.anchorInfo.isUsedHorizontalAlignment())
                    return this.alignment(this.anchorInfo.horizontalPositionType, this.anchorInfo.horizontalPositionAlignment);
                if (this.anchorInfo.isUsedHorizontalAbsolutePosition())
                    return __aspxRichEdit.UnitConverter.twipsToPixels(this.anchorInfo.offset.x) + this.absolute();
                if (this.anchorInfo.isUsedHorizontalBookLayout())
                    return this.bookLayout();
                if (this.anchorInfo.isUsedHorizontalRelativePosition())
                    return this.relative();
                throw new Error(__aspxRichEdit.Errors.InternalException);
            };
            AnchorObjectHorizontalPositionCalculator.prototype.relativeColumnPos = function () {
                return this.lp.pageArea.x + this.lp.column.x;
            };
            AnchorObjectHorizontalPositionCalculator.prototype.correctInTextAnchorPosition = function () {
                if (!this.isRelativeCell || !this.obj.isInText())
                    return;
                var leftBounds = this.relativeColumnPos() + this.lp.row.tableCellInfo.x;
                this.obj.x = Math.max(this.obj.x, leftBounds);
                var rightBound = this.relativeColumnPos() + this.lp.row.tableCellInfo.getRightBoundPosition();
                var leftOffset = this.obj.getRightBoundPosition() - rightBound;
                if (leftOffset > 0) {
                    var avalLeftOffset = this.obj.x - leftBounds;
                    this.obj.x -= Math.min(leftOffset, avalLeftOffset);
                }
            };
            AnchorObjectHorizontalPositionCalculator.prototype.alignment = function (type, alignment) {
                switch (type) {
                    case __aspxRichEdit.AnchorObjectHorizontalPositionType.Character:
                        return this.getAlignPosition(alignment, 0);
                    case __aspxRichEdit.AnchorObjectHorizontalPositionType.Column:
                        return this.isRelativeCell ?
                            this.relativeColumnPos() + this.lp.row.tableCellInfo.x +
                                this.getAlignPosition(alignment, this.lp.row.tableCellInfo.width - this.leftCellMargin - this.rightCellMargin) :
                            this.relativeColumnPos() + this.getAlignPosition(alignment, this.lp.column.width);
                    case __aspxRichEdit.AnchorObjectHorizontalPositionType.Page:
                        return this.isRelativeCell ?
                            this.relativeColumnPos() + this.lp.row.tableCellInfo.x + this.getAlignPosition(alignment, this.lp.row.tableCellInfo.width) :
                            this.getAlignPosition(alignment, this.manager.boundsCalculator.pageWidth);
                    case __aspxRichEdit.AnchorObjectHorizontalPositionType.Margin:
                        return this.isRelativeCell ?
                            this.relativeColumnPos() + this.lp.row.tableCellInfo.x + this.leftCellMargin +
                                this.getAlignPosition(alignment, this.lp.row.tableCellInfo.width - this.leftCellMargin - this.rightCellMargin) :
                            this.manager.boundsCalculator.marginLeft + this.getAlignPosition(alignment, this.lp.pageArea.width);
                    case __aspxRichEdit.AnchorObjectHorizontalPositionType.LeftMargin:
                    case __aspxRichEdit.AnchorObjectHorizontalPositionType.InsideMargin:
                        return this.isRelativeCell ?
                            this.relativeColumnPos() + this.lp.row.tableCellInfo.x + this.getAlignPosition(alignment, this.leftCellMargin) :
                            this.getAlignPosition(alignment, this.manager.boundsCalculator.marginLeft);
                    case __aspxRichEdit.AnchorObjectHorizontalPositionType.RightMargin:
                    case __aspxRichEdit.AnchorObjectHorizontalPositionType.OutsideMargin:
                        return this.isRelativeCell ?
                            this.relativeColumnPos() + this.lp.row.tableCellInfo.getRightBoundPosition() - this.rightCellMargin +
                                this.getAlignPosition(__aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Right, this.rightCellMargin) :
                            this.manager.boundsCalculator.pageWidth - this.manager.boundsCalculator.marginRight +
                                this.getAlignPosition(alignment, this.manager.boundsCalculator.marginRight);
                    default:
                        throw new Error(__aspxRichEdit.Errors.InternalException);
                }
            };
            AnchorObjectHorizontalPositionCalculator.prototype.getAlignPosition = function (alignment, width) {
                switch (alignment) {
                    case __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Left:
                        return 0;
                    case __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Center:
                        return width / 2 - this.obj.width / 2;
                    case __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Right:
                        return width - this.obj.width;
                    default:
                        throw new Error(__aspxRichEdit.Errors.InternalException);
                }
            };
            AnchorObjectHorizontalPositionCalculator.prototype.absolute = function () {
                switch (this.anchorInfo.horizontalPositionType) {
                    case __aspxRichEdit.AnchorObjectHorizontalPositionType.Page:
                        return this.isRelativeCell ? this.relativeColumnPos() + this.lp.row.tableCellInfo.x : 0;
                    case __aspxRichEdit.AnchorObjectHorizontalPositionType.Column:
                        return this.isRelativeCell ? this.relativeColumnPos() + this.lp.row.tableCellInfo.x : this.relativeColumnPos();
                    case __aspxRichEdit.AnchorObjectHorizontalPositionType.Character: {
                        var rowAbsPos_1 = this.lp.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Row);
                        var ancBoxAbsPos = this.obj.rowOffset;
                        var boxIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.lp.row.boxes, function (box) { return rowAbsPos_1 + box.rowOffset; }, ancBoxAbsPos);
                        var box = this.lp.row.boxes[boxIndex];
                        if (!box)
                            return this.lp.getLayoutX(null, __aspxRichEdit.DocumentLayoutDetailsLevel.Row);
                        var symbolCount = Math.max(0, ancBoxAbsPos - rowAbsPos_1 - box.rowOffset);
                        return this.lp.getLayoutX(null, __aspxRichEdit.DocumentLayoutDetailsLevel.Row) + box.x +
                            box.getCharOffsetXInPixels(this.manager.measurer, symbolCount);
                    }
                    case __aspxRichEdit.AnchorObjectHorizontalPositionType.Margin:
                        return this.isRelativeCell ? this.relativeColumnPos() + this.lp.row.tableCellInfo.x + this.leftCellMargin :
                            this.manager.boundsCalculator.marginLeft;
                    case __aspxRichEdit.AnchorObjectHorizontalPositionType.LeftMargin:
                    case __aspxRichEdit.AnchorObjectHorizontalPositionType.OutsideMargin:
                        return this.isRelativeCell ? this.relativeColumnPos() + this.lp.row.tableCellInfo.x + this.leftCellMargin :
                            0;
                    case __aspxRichEdit.AnchorObjectHorizontalPositionType.RightMargin:
                    case __aspxRichEdit.AnchorObjectHorizontalPositionType.InsideMargin:
                        return this.isRelativeCell ? this.relativeColumnPos() +
                            this.lp.row.tableCellInfo.getRightBoundPosition() - this.rightCellMargin :
                            this.manager.boundsCalculator.pageWidth - this.manager.boundsCalculator.marginRight;
                    default:
                        throw new Error(__aspxRichEdit.Errors.InternalException);
                }
            };
            AnchorObjectHorizontalPositionCalculator.prototype.bookLayout = function () {
                return this.alignment(this.anchorInfo.horizontalPositionType, AnchorObjectHorizontalPositionCalculator.mapBookLayoutALignmentType[this.anchorInfo.horizontalPositionAlignment]);
            };
            AnchorObjectHorizontalPositionCalculator.prototype.relative = function () {
                var type = this.anchorInfo.horizontalPositionType;
                switch (type) {
                    case __aspxRichEdit.AnchorObjectHorizontalPositionType.Page:
                        return this.isRelativeCell ?
                            this.relativeColumnPos() + this.lp.row.tableCellInfo.x + this.anchorInfo.getRelativeOffsetX(this.lp.row.tableCellInfo.width) :
                            this.anchorInfo.getRelativeOffsetX(this.manager.boundsCalculator.pageWidth);
                    case __aspxRichEdit.AnchorObjectHorizontalPositionType.Margin:
                        return this.isRelativeCell ?
                            this.relativeColumnPos() + this.lp.row.tableCellInfo.x + this.leftCellMargin +
                                this.anchorInfo.getRelativeOffsetX(this.lp.row.tableCellInfo.width - this.leftCellMargin - this.rightCellMargin) :
                            this.manager.boundsCalculator.marginLeft +
                                this.anchorInfo.getRelativeOffsetX(this.manager.boundsCalculator.pageWidth - this.manager.boundsCalculator.marginLeft - this.manager.boundsCalculator.marginRight);
                    case __aspxRichEdit.AnchorObjectHorizontalPositionType.LeftMargin:
                    case __aspxRichEdit.AnchorObjectHorizontalPositionType.InsideMargin:
                        return this.isRelativeCell ?
                            this.relativeColumnPos() + this.lp.row.tableCellInfo.x + this.anchorInfo.getRelativeOffsetX(this.leftCellMargin) :
                            this.anchorInfo.getRelativeOffsetX(this.manager.boundsCalculator.marginLeft);
                    case __aspxRichEdit.AnchorObjectHorizontalPositionType.RightMargin:
                    case __aspxRichEdit.AnchorObjectHorizontalPositionType.OutsideMargin:
                        return this.isRelativeCell ?
                            this.relativeColumnPos() + this.lp.row.tableCellInfo.getRightBoundPosition() - this.rightCellMargin +
                                this.anchorInfo.getRelativeOffsetX(this.rightCellMargin) :
                            this.manager.boundsCalculator.pageWidth - this.manager.boundsCalculator.marginRight +
                                this.anchorInfo.getRelativeOffsetX(this.manager.boundsCalculator.marginRight);
                    default: throw new Error(__aspxRichEdit.Errors.InternalException);
                }
            };
            AnchorObjectHorizontalPositionCalculator.mapBookLayoutALignmentType = new __aspxRichEdit.MapCreatorNumberAsKey()
                .add(__aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Inside, __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Left)
                .add(__aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Outside, __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Right)
                .get();
            return AnchorObjectHorizontalPositionCalculator;
        }(LayoutFormatter.AnchorObjectPositionCalculatorBase));
        LayoutFormatter.AnchorObjectHorizontalPositionCalculator = AnchorObjectHorizontalPositionCalculator;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var AnchorObjectVerticalPositionCalculator = (function (_super) {
            __extends(AnchorObjectVerticalPositionCalculator, _super);
            function AnchorObjectVerticalPositionCalculator() {
                return _super !== null && _super.apply(this, arguments) || this;
            }
            AnchorObjectVerticalPositionCalculator.prototype.calculate = function (obj) {
                this.init(obj);
                this.obj.y = this.getY();
                this.correctInTextAnchorPosition();
            };
            Object.defineProperty(AnchorObjectVerticalPositionCalculator.prototype, "topCellMargin", {
                get: function () {
                    return this.manager.activeFormatter.tableFormatter.actualFormatter.tableInfo.currRowInfo.topAndBottomMargins.topMargin;
                },
                enumerable: true,
                configurable: true
            });
            AnchorObjectVerticalPositionCalculator.prototype.getY = function () {
                if (this.anchorInfo.isUsedVerticalAbsolutePosition())
                    return __aspxRichEdit.UnitConverter.twipsToPixels(this.anchorInfo.offset.y) + this.absolute();
                if (this.anchorInfo.isUsedVerticalAlignment())
                    return this.alignment();
                if (this.anchorInfo.isUsedVerticalRelativePosition())
                    return this.relative();
                throw new Error(__aspxRichEdit.Errors.InternalException);
            };
            AnchorObjectVerticalPositionCalculator.prototype.relativeColumnPos = function () {
                return this.lp.pageArea.y + this.lp.column.y;
            };
            AnchorObjectVerticalPositionCalculator.prototype.correctInTextAnchorPosition = function () {
                if (!this.isRelativeCell || !this.obj.isInText())
                    return;
                var topBounds = this.relativeColumnPos() + this.lp.row.tableCellInfo.y;
                this.obj.y = Math.max(this.obj.y, topBounds);
            };
            AnchorObjectVerticalPositionCalculator.prototype.getRowWhatStartParagraph = function () {
                var paragraphStartPosition = this.lp.pageArea.subDocument
                    .paragraphs[this.manager.activeFormatter.rowFormatter.result.paragraphIndex].startLogPosition.value;
                var rows = this.lp.column.rows;
                var parRelativeColumnOffset = paragraphStartPosition - this.lp.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Column);
                var rowInd = this.lp.rowIndex;
                var rowWhatStartParagraph = rowInd >= rows.length ? this.lp.row : rows[rowInd];
                for (var row = void 0, rowIndex = rowInd - 1; (row = rows[rowIndex]) &&
                    row.columnOffset >= parRelativeColumnOffset; rowIndex--)
                    rowWhatStartParagraph = row;
                return rowWhatStartParagraph;
            };
            AnchorObjectVerticalPositionCalculator.prototype.absolute = function () {
                switch (this.anchorInfo.verticalPositionType) {
                    case __aspxRichEdit.AnchorObjectVerticalPositionType.Page:
                        return this.isRelativeCell ? this.relativeColumnPos() + this.lp.row.tableCellInfo.y + this.topCellMargin : 0;
                    case __aspxRichEdit.AnchorObjectVerticalPositionType.Paragraph:
                        return this.relativeColumnPos() + this.getRowWhatStartParagraph().y;
                    case __aspxRichEdit.AnchorObjectVerticalPositionType.Line:
                        return this.relativeColumnPos() + this.lp.row.y;
                    case __aspxRichEdit.AnchorObjectVerticalPositionType.Margin:
                        return this.isRelativeCell ? this.relativeColumnPos() + this.lp.row.tableCellInfo.y + this.topCellMargin :
                            this.manager.boundsCalculator.marginTop;
                    case __aspxRichEdit.AnchorObjectVerticalPositionType.TopMargin:
                    case __aspxRichEdit.AnchorObjectVerticalPositionType.InsideMargin:
                        return this.isRelativeCell ? this.relativeColumnPos() + this.lp.row.tableCellInfo.y + this.topCellMargin : 0;
                    case __aspxRichEdit.AnchorObjectVerticalPositionType.BottomMargin:
                    case __aspxRichEdit.AnchorObjectVerticalPositionType.OutsideMargin:
                        return this.isRelativeCell ? this.relativeColumnPos() + this.lp.row.tableCellInfo.y + this.topCellMargin :
                            this.manager.boundsCalculator.pageHeight - this.manager.boundsCalculator.marginBottom;
                    default:
                        throw new Error(__aspxRichEdit.Errors.InternalException);
                }
            };
            AnchorObjectVerticalPositionCalculator.prototype.alignment = function () {
                switch (this.anchorInfo.verticalPositionType) {
                    case __aspxRichEdit.AnchorObjectVerticalPositionType.Page:
                        return this.isRelativeCell ?
                            this.relativeColumnPos() + this.lp.row.tableCellInfo.y + this.topCellMargin :
                            this.getAlignPosition(this.manager.boundsCalculator.pageHeight);
                    case __aspxRichEdit.AnchorObjectVerticalPositionType.Line:
                        return this.lp.getLayoutY(__aspxRichEdit.DocumentLayoutDetailsLevel.Column) + this.lp.row.y +
                            this.getAlignPosition(this.lp.row.height);
                    case __aspxRichEdit.AnchorObjectVerticalPositionType.Paragraph:
                        return this.relativeColumnPos() + this.getRowWhatStartParagraph().y;
                    case __aspxRichEdit.AnchorObjectVerticalPositionType.Margin:
                        return this.isRelativeCell ?
                            this.relativeColumnPos() + this.lp.row.tableCellInfo.y + this.topCellMargin :
                            this.manager.boundsCalculator.marginTop +
                                this.getAlignPosition(this.manager.boundsCalculator.pageHeight - this.manager.boundsCalculator.marginTop -
                                    this.manager.boundsCalculator.marginBottom);
                    case __aspxRichEdit.AnchorObjectVerticalPositionType.TopMargin:
                    case __aspxRichEdit.AnchorObjectVerticalPositionType.InsideMargin:
                        return this.isRelativeCell ?
                            this.relativeColumnPos() + this.lp.row.tableCellInfo.y + this.topCellMargin :
                            this.getAlignPosition(this.manager.boundsCalculator.marginTop);
                    case __aspxRichEdit.AnchorObjectVerticalPositionType.BottomMargin:
                    case __aspxRichEdit.AnchorObjectVerticalPositionType.OutsideMargin:
                        return this.isRelativeCell ?
                            this.relativeColumnPos() + this.lp.row.tableCellInfo.y + this.topCellMargin :
                            this.manager.boundsCalculator.pageHeight - this.manager.boundsCalculator.marginBottom +
                                this.getAlignPosition(this.manager.boundsCalculator.marginBottom);
                    default:
                        throw new Error(__aspxRichEdit.Errors.InternalException);
                }
            };
            AnchorObjectVerticalPositionCalculator.prototype.getAlignPosition = function (height) {
                var alignment = this.anchorInfo.verticalPositionAlignment;
                switch (alignment) {
                    case __aspxRichEdit.AnchorObjectVerticalPositionAlignment.Top:
                    case __aspxRichEdit.AnchorObjectVerticalPositionAlignment.Inside:
                        return 0;
                    case __aspxRichEdit.AnchorObjectVerticalPositionAlignment.Center:
                        return height / 2 - this.obj.height / 2;
                    case __aspxRichEdit.AnchorObjectVerticalPositionAlignment.Bottom:
                    case __aspxRichEdit.AnchorObjectVerticalPositionAlignment.Outside:
                        return height - this.obj.height;
                    default:
                        throw new Error(__aspxRichEdit.Errors.InternalException);
                }
            };
            AnchorObjectVerticalPositionCalculator.prototype.relative = function () {
                switch (this.anchorInfo.verticalPositionType) {
                    case __aspxRichEdit.AnchorObjectVerticalPositionType.Page:
                        return this.isRelativeCell ?
                            this.relativeColumnPos() + this.lp.row.tableCellInfo.y + this.topCellMargin :
                            this.anchorInfo.getRelativeOffsetY(this.manager.boundsCalculator.pageHeight);
                    case __aspxRichEdit.AnchorObjectVerticalPositionType.Margin:
                        return this.isRelativeCell ?
                            this.relativeColumnPos() + this.lp.row.tableCellInfo.y + this.topCellMargin :
                            this.manager.boundsCalculator.marginTop +
                                this.anchorInfo.getRelativeOffsetY(this.manager.boundsCalculator.pageHeight - this.manager.boundsCalculator.marginTop - this.manager.boundsCalculator.marginBottom);
                    case __aspxRichEdit.AnchorObjectVerticalPositionType.TopMargin:
                    case __aspxRichEdit.AnchorObjectVerticalPositionType.InsideMargin:
                        return this.isRelativeCell ?
                            this.relativeColumnPos() + this.lp.row.tableCellInfo.y + this.topCellMargin :
                            this.anchorInfo.getRelativeOffsetY(this.manager.boundsCalculator.marginTop);
                    case __aspxRichEdit.AnchorObjectVerticalPositionType.BottomMargin:
                    case __aspxRichEdit.AnchorObjectVerticalPositionType.OutsideMargin:
                        return this.isRelativeCell ?
                            this.relativeColumnPos() + this.lp.row.tableCellInfo.y + this.topCellMargin :
                            this.manager.boundsCalculator.pageHeight - this.manager.boundsCalculator.marginBottom +
                                this.anchorInfo.getRelativeOffsetY(this.manager.boundsCalculator.marginBottom);
                    default:
                        throw new Error(__aspxRichEdit.Errors.InternalException);
                }
            };
            return AnchorObjectVerticalPositionCalculator;
        }(LayoutFormatter.AnchorObjectPositionCalculatorBase));
        LayoutFormatter.AnchorObjectVerticalPositionCalculator = AnchorObjectVerticalPositionCalculator;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var BoundsCalculator = (function () {
            function BoundsCalculator() {
            }
            BoundsCalculator.prototype.init = function (section) {
                this.section = section;
                var sectionProperties = this.section.sectionProperties;
                this.equalWidthColumns = sectionProperties.equalWidthColumns;
                this.columnCount = sectionProperties.columnCount;
                this.space = __aspxRichEdit.UnitConverter.twipsToPixels(sectionProperties.space);
                this.marginTop = __aspxRichEdit.UnitConverter.twipsToPixels(sectionProperties.marginTop);
                this.marginRight = __aspxRichEdit.UnitConverter.twipsToPixels(sectionProperties.marginRight);
                this.marginBottom = __aspxRichEdit.UnitConverter.twipsToPixels(sectionProperties.marginBottom);
                this.marginLeft = __aspxRichEdit.UnitConverter.twipsToPixels(sectionProperties.marginLeft);
                this.pageWidth = __aspxRichEdit.UnitConverter.twipsToPixels(sectionProperties.pageWidth);
                this.pageHeight = __aspxRichEdit.UnitConverter.twipsToPixels(sectionProperties.pageHeight);
                this.headerOffset = __aspxRichEdit.UnitConverter.twipsToPixels(sectionProperties.headerOffset);
                this.footerOffset = __aspxRichEdit.UnitConverter.twipsToPixels(sectionProperties.footerOffset);
                this.columnsInfo = __aspxRichEdit.ListUtils.map(sectionProperties.columnsInfo, function (columnProps) { return columnProps.clone().applyConverter(__aspxRichEdit.UnitConverter.twipsToPixels); });
                this.avaliablePageHeight = this.pageHeight - (this.marginTop + this.marginBottom);
                this.availableHeaderFooterWidth = this.pageWidth - this.marginLeft - this.marginRight;
            };
            BoundsCalculator.prototype.initWhenPageStart = function () {
                this.mainPageAreasBounds = [];
                this.mainColumnsBounds = [];
            };
            BoundsCalculator.prototype.setHeaderBounds = function (currHeight) {
                if (currHeight == 0) {
                    this.headerPageAreaBounds = null;
                    this.headerColumnBounds = null;
                    return;
                }
                var height = currHeight == -1 ? Number.MAX_VALUE :
                    Math.max(this.marginTop - this.headerOffset, Math.min(Math.floor(this.pageHeight * BoundsCalculator.MAX_HEADER_FOOTER_HEIGHT_COEFF), currHeight));
                this.headerPageAreaBounds = new __aspxRichEdit.Rectangle().init(this.marginLeft, this.headerOffset, this.availableHeaderFooterWidth, height);
                this.headerColumnBounds = new __aspxRichEdit.Rectangle().init(0, 0, this.headerPageAreaBounds.width, this.headerPageAreaBounds.height);
            };
            BoundsCalculator.prototype.setFooterBounds = function (currHeight) {
                if (currHeight == 0) {
                    this.footerPageAreaBounds = null;
                    this.footerColumnBounds = null;
                    return;
                }
                if (currHeight == -1) {
                    this.footerPageAreaBounds = new __aspxRichEdit.Rectangle().init(this.marginLeft, this.pageHeight - this.footerOffset, this.availableHeaderFooterWidth, Number.MAX_VALUE);
                    this.footerColumnBounds = new __aspxRichEdit.Rectangle().init(0, 0, this.footerPageAreaBounds.width, this.footerPageAreaBounds.height);
                }
                else {
                    currHeight = Math.min(Math.round(this.pageHeight * BoundsCalculator.MAX_HEADER_FOOTER_HEIGHT_COEFF), currHeight);
                    var pageAreaHeight = Math.max(this.marginBottom - this.footerOffset, currHeight);
                    this.footerPageAreaBounds = new __aspxRichEdit.Rectangle().init(this.marginLeft, this.pageHeight - pageAreaHeight - this.footerOffset, this.availableHeaderFooterWidth, pageAreaHeight);
                    this.footerColumnBounds = new __aspxRichEdit.Rectangle().init(0, pageAreaHeight - currHeight, this.footerPageAreaBounds.width, currHeight);
                }
            };
            BoundsCalculator.prototype.calculateMainPageAreaBounds = function (previousMainPageAreaHeight) {
                var y;
                if (previousMainPageAreaHeight > 0) {
                    var previousPageAreaBounds = this.mainPageAreasBounds[this.mainPageAreasBounds.length - 1];
                    for (var _i = 0, _a = this.mainColumnsBounds[this.mainColumnsBounds.length - 1]; _i < _a.length; _i++) {
                        var colBound = _a[_i];
                        colBound.height = previousMainPageAreaHeight;
                    }
                    previousPageAreaBounds.height = previousMainPageAreaHeight;
                    y = previousPageAreaBounds.getBottomBoundPosition();
                }
                else
                    y = Math.max(this.marginTop, this.headerPageAreaBounds ? this.headerPageAreaBounds.getBottomBoundPosition() : 0);
                var height = Math.min(this.pageHeight - this.marginBottom, this.footerPageAreaBounds ? this.footerPageAreaBounds.y : Number.MAX_VALUE) - y;
                this.mainPageAreasBounds.push(new __aspxRichEdit.Rectangle().init(this.marginLeft, y, this.availableHeaderFooterWidth, height));
            };
            BoundsCalculator.prototype.calculateColumnBounds = function (pageAreaBounds) {
                if (this.equalWidthColumns) {
                    var oneColumnWidth_1 = Math.floor((this.availableHeaderFooterWidth - (this.columnCount - 1) * this.space) / this.columnCount);
                    var colWidthPlusSpace_1 = oneColumnWidth_1 + this.space;
                    this.mainColumnsBounds.push(__aspxRichEdit.ListUtils.initByCallback(this.columnCount, function (columnIndex) {
                        return new __aspxRichEdit.Rectangle().init(colWidthPlusSpace_1 * columnIndex, 0, oneColumnWidth_1, pageAreaBounds.height);
                    }));
                }
                else {
                    var currXPos_1 = 0;
                    this.mainColumnsBounds.push(__aspxRichEdit.ListUtils.map(this.columnsInfo, function (columnInfo) {
                        var rect = new __aspxRichEdit.Rectangle().init(currXPos_1, 0, Math.max(1, columnInfo.width), pageAreaBounds.height);
                        currXPos_1 += columnInfo.width + columnInfo.space;
                        return rect;
                    }));
                }
            };
            BoundsCalculator.prototype.calculatePageBounds = function (y) {
                this.pageBounds = new __aspxRichEdit.Rectangle().init(0, y, this.pageWidth, this.pageHeight);
            };
            BoundsCalculator.MAX_HEADER_FOOTER_HEIGHT_COEFF = 0.48;
            return BoundsCalculator;
        }());
        LayoutFormatter.BoundsCalculator = BoundsCalculator;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var ColumnCalculator = (function () {
            function ColumnCalculator() {
            }
            ColumnCalculator.generateSectionColumns = function (properties) {
                var availablePageWidth = properties.pageWidth - (properties.marginLeft + properties.marginRight + properties.space * (properties.columnCount - 1));
                var availablePageHeight = properties.pageHeight - (properties.marginTop + properties.marginBottom);
                var columnOffsetX = properties.marginLeft;
                var sectionColumns = [];
                for (var i = 0; i < properties.columnCount; i++) {
                    var columnWidth = Math.max(properties.equalWidthColumns ? Math.floor(availablePageWidth / (properties.columnCount - i)) : properties.columnsInfo[i].width, 1);
                    var column = new __aspxRichEdit.Rectangle().init(__aspxRichEdit.UnitConverter.twipsToPixels(columnOffsetX), __aspxRichEdit.UnitConverter.twipsToPixels(properties.marginTop), Math.max(__aspxRichEdit.UnitConverter.twipsToPixels(columnWidth), 1), __aspxRichEdit.UnitConverter.twipsToPixels(availablePageHeight));
                    sectionColumns.push(column);
                    columnOffsetX += columnWidth + (properties.equalWidthColumns ? properties.space : properties.columnsInfo[i].space);
                    availablePageWidth -= columnWidth;
                }
                return sectionColumns;
            };
            ColumnCalculator.findMinimalColumnSize = function (properties) {
                return __aspxRichEdit.ListUtils.min(ColumnCalculator.generateSectionColumns(properties), function (a, b) { return a.width - b.width; }).size;
            };
            return ColumnCalculator;
        }());
        LayoutFormatter.ColumnCalculator = ColumnCalculator;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var FloatingRestartInfoHolder = (function () {
            function FloatingRestartInfoHolder() {
                this.anchorRestartFromPageIndex = -1;
                this.oldAnchorObjectsFromPage = {};
                this.oldOtherTextBoxPageAreas = {};
                this.init();
            }
            FloatingRestartInfoHolder.prototype.init = function () {
                this.anchorRestartFromPageIndex = -1;
                this.oldAnchorObjectsFromPage = {};
                this.oldOtherTextBoxPageAreas = {};
            };
            FloatingRestartInfoHolder.prototype.storeInfo = function (lp) {
                this.anchorRestartFromPageIndex = lp.pageIndex;
                this.oldAnchorObjectsFromPage = lp.page.anchoredObjectHolder.objects;
                this.oldOtherTextBoxPageAreas = __aspxRichEdit.MapUtilsKeyAsNumber.reducedMap(lp.page.otherPageAreas, function (pa) {
                    return pa.subDocument.isTextBox() ? pa : null;
                });
            };
            Object.defineProperty(FloatingRestartInfoHolder.prototype, "isRestartByAnchorObjects", {
                get: function () {
                    return this.anchorRestartFromPageIndex != -1;
                },
                enumerable: true,
                configurable: true
            });
            FloatingRestartInfoHolder.prototype.setCalculatedObjects = function (lp) {
                if (this.isRestartByAnchorObjects) {
                    if (this.anchorRestartFromPageIndex == lp.pageIndex) {
                        lp.page.anchoredObjectHolder.objects = this.oldAnchorObjectsFromPage;
                        __aspxRichEdit.MapUtilsKeyAsNumber.foreach(this.oldOtherTextBoxPageAreas, function (textBoxPA) {
                            return lp.page.otherPageAreas[textBoxPA.subDocument.id] = textBoxPA;
                        });
                    }
                    this.init();
                }
            };
            return FloatingRestartInfoHolder;
        }());
        LayoutFormatter.FloatingRestartInfoHolder = FloatingRestartInfoHolder;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var LastRowInfo = (function () {
            function LastRowInfo(paragraphs) {
                this._row = null;
                this._startPosition = 0;
                this._paragraphIndex = -1;
                this.paragraphs = paragraphs;
            }
            LastRowInfo.prototype.reset = function (rowFormatter) {
                this._row = null;
                this._startPosition = rowFormatter.getPosition();
                this._paragraphIndex = -1;
                this.isParIndexSet = true;
            };
            LastRowInfo.prototype.recalculateParagraphIndex = function (now) {
                this.isParIndexSet = false;
                if (now)
                    this.calculateParagraphIndex();
            };
            LastRowInfo.prototype.setRowInfo = function (row, columnFullOffset, isNowRecalcParIndex) {
                this._row = row;
                this._startPosition = columnFullOffset + row.columnOffset;
                this.recalculateParagraphIndex(isNowRecalcParIndex);
            };
            LastRowInfo.prototype.setFullRowInfo = function (row, rowStartPos, parIndex) {
                this._row = row;
                this._startPosition = rowStartPos;
                this._paragraphIndex = parIndex;
                this.isParIndexSet = true;
            };
            LastRowInfo.prototype.setFullRowInfoAndCalculateParagraph = function (row, rowStartPos, calcImmediately) {
                this._row = row;
                this._startPosition = rowStartPos;
                this.recalculateParagraphIndex(calcImmediately);
            };
            Object.defineProperty(LastRowInfo.prototype, "row", {
                get: function () {
                    return this._row;
                },
                enumerable: true,
                configurable: true
            });
            Object.defineProperty(LastRowInfo.prototype, "startPosition", {
                get: function () {
                    return this._startPosition;
                },
                enumerable: true,
                configurable: true
            });
            Object.defineProperty(LastRowInfo.prototype, "paragraphIndex", {
                get: function () {
                    if (!this.isParIndexSet)
                        this.calculateParagraphIndex();
                    return this._paragraphIndex;
                },
                enumerable: true,
                configurable: true
            });
            LastRowInfo.prototype.calculateParagraphIndex = function () {
                this._paragraphIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.paragraphs, function (p) { return p.startLogPosition.value; }, this._startPosition);
                this.isParIndexSet = true;
            };
            LastRowInfo.prototype.isNextRowFirstInParagraph = function () {
                return !this._row || this._row.flags.get(__aspxRichEdit.LayoutRowStateFlags.ParagraphEnd);
            };
            return LastRowInfo;
        }());
        LayoutFormatter.LastRowInfo = LastRowInfo;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var LayoutDependentRunCache = (function () {
            function LayoutDependentRunCache(manager) {
                this.manager = manager;
                this.reset();
            }
            LayoutDependentRunCache.prototype.reset = function () {
                this.cache = {};
            };
            LayoutDependentRunCache.prototype.add = function (pageIndex, subDocId) {
                var val = this.cache[pageIndex];
                if (!val)
                    this.cache[pageIndex] = [subDocId];
                else if (!__aspxRichEdit.ListUtils.anyOf(val, function (v) { return v == subDocId; }))
                    val.push(subDocId);
            };
            LayoutDependentRunCache.prototype.recalculateHeaderFooterPageAreas = function () {
                var _this = this;
                var pages = this.manager.layout.pages;
                __aspxRichEdit.MapUtilsKeyAsNumber.foreach(this.cache, function (listOfSubDocId, pageIndex) {
                    var page = pages[pageIndex];
                    if (!page)
                        return;
                    var oldPageAreas = __aspxRichEdit.MapUtilsKeyAsNumber.shallowCopy(page.otherPageAreas);
                    __aspxRichEdit.ListUtils.foreach(listOfSubDocId, function (subDocId) {
                        var pageArea = page.otherPageAreas[subDocId];
                        if (!pageArea || !pageArea.subDocument.isHeaderFooter())
                            return;
                        if (pageArea.subDocument.isHeader())
                            _this.manager.otherPageAreaFormatter.formatHeaderPageArea(page, pageArea.subDocument.info);
                        else
                            _this.manager.otherPageAreaFormatter.formatFooterPageArea(page, pageArea.subDocument.info);
                    });
                    _this.manager.changesManager.addPageChange(LayoutFormatter.PageChangesCollector.collectHeaderFooterChanges(pageIndex, oldPageAreas, page.otherPageAreas));
                });
            };
            return LayoutDependentRunCache;
        }());
        LayoutFormatter.LayoutDependentRunCache = LayoutDependentRunCache;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var RemoveRedundantHelper = (function () {
            function RemoveRedundantHelper(changesManager) {
                this.changesManager = changesManager;
            }
            RemoveRedundantHelper.removeRendundant = function (fromIndex, list, pushChange) {
                var result = fromIndex < list.length;
                for (var index = list.length - 1; index >= fromIndex; index--) {
                    list.pop();
                    pushChange(index);
                }
                return result;
            };
            RemoveRedundantHelper.prototype.removeRedundantPage = function (layout, firstRendundantPageIndex) {
                var _this = this;
                return RemoveRedundantHelper.removeRendundant(firstRendundantPageIndex, layout.pages, function (index) { return _this.changesManager.addPageChange(new __aspxRichEdit.PageChange(index, __aspxRichEdit.LayoutChangeType.Deleted, [], [])); });
            };
            RemoveRedundantHelper.prototype.removeRedundantPageAreas = function (page, firstRendundantPageAreaIndex, pageChange) {
                return RemoveRedundantHelper.removeRendundant(firstRendundantPageAreaIndex, page.mainSubDocumentPageAreas, function (index) { return pageChange.mainPageAreaChanges.push(new __aspxRichEdit.PageAreaChange(index, __aspxRichEdit.LayoutChangeType.Deleted, [])); });
            };
            RemoveRedundantHelper.prototype.removeRedundantColumnsFromArea = function (pageArea, firstRedundantColumnIndex, pageAreaChange) {
                return RemoveRedundantHelper.removeRendundant(firstRedundantColumnIndex, pageArea.columns, function (index) { return pageAreaChange.columnChanges.push(new __aspxRichEdit.ColumnChange(index, __aspxRichEdit.LayoutChangeType.Deleted, [], [], [])); });
            };
            RemoveRedundantHelper.prototype.removeRedundantRowsFromColumn = function (column, firstRendundantRowIndex, columnChange) {
                return RemoveRedundantHelper.removeRendundant(firstRendundantRowIndex, column.rows, function (index) { return columnChange.rowChanges.push(new __aspxRichEdit.RowChange(index, __aspxRichEdit.LayoutChangeType.Deleted)); });
            };
            RemoveRedundantHelper.prototype.removeRedundantTableInfosFromColumn = function (column, firstRendundantTableIndex, columnChange) {
                return RemoveRedundantHelper.removeRendundant(firstRendundantTableIndex, column.tablesInfo, function (index) { return columnChange.tableChanges.push(new __aspxRichEdit.TableChange(index, __aspxRichEdit.LayoutChangeType.Deleted)); });
            };
            return RemoveRedundantHelper;
        }());
        LayoutFormatter.RemoveRedundantHelper = RemoveRedundantHelper;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var RestartPreparer = (function () {
            function RestartPreparer(manager) {
                this.manager = manager;
            }
            RestartPreparer.prototype.restartCommonPart = function (modelPosition) {
                if (this.manager.mainFormatter.rowFormatter.getPosition() < modelPosition)
                    return false;
                this.manager.mainFormatter.rowFormatter.numberingListCountersManager.reset();
                this.manager.mainFormatter.rowFormatter.setPosition(modelPosition, true, true);
                return true;
            };
            RestartPreparer.prototype.restartFromPage = function (pageIndex, isRestartNow, resetTableFormatter) {
                var modelPosition = __aspxRichEdit.LayoutPage.getPrevPageLastPostion(this.manager.layout.pages, pageIndex);
                if (!this.restartCommonPart(modelPosition))
                    return;
                var newLp = new __aspxRichEdit.LayoutPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.None);
                newLp.pageIndex = pageIndex;
                var newLastRowInfo = new LayoutFormatter.LastRowInfo(this.manager.mainFormatter.rowFormatter.subDocument.paragraphs);
                var prevPage = this.manager.layout.pages[pageIndex - 1];
                if (!prevPage)
                    newLastRowInfo.reset(this.manager.mainFormatter.rowFormatter);
                else {
                    var pageArea = __aspxRichEdit.ListUtils.last(prevPage.mainSubDocumentPageAreas);
                    var column = pageArea.getLastColumn();
                    newLastRowInfo.setRowInfo(column.getLastRow(), prevPage.getPosition() + pageArea.pageOffset + column.pageAreaOffset, false);
                }
                var boundsCalculator = this.manager.boundsCalculator;
                boundsCalculator.init(this.manager.model.getSectionByPosition(modelPosition));
                this.manager.mainFormatter.setParamsForRestart(LayoutFormatter.LayoutFormatterState.PageStart, newLp, newLastRowInfo, resetTableFormatter);
                if (isRestartNow)
                    this.manager.runFormatting(pageIndex);
            };
            RestartPreparer.prototype.restartHeaderFooterInternal = function (subDocument, pageIndex) {
                var page = this.manager.layout.pages[pageIndex];
                this.manager.changesManager.addPageChange(new __aspxRichEdit.PageChange(pageIndex, __aspxRichEdit.LayoutChangeType.Updated, [], []));
                if (subDocument.isHeader())
                    this.manager.otherPageAreaFormatter.formatHeaderPageArea(page, subDocument.info);
                else
                    this.manager.otherPageAreaFormatter.formatFooterPageArea(page, subDocument.info);
                this.manager.onPagesReady();
                this.restartFromPage(pageIndex, true, true);
            };
            RestartPreparer.prototype.restartFormatingAllLayout = function () {
                while (this.manager.layout.pages.shift())
                    this.manager.changesManager.addPageChange(new __aspxRichEdit.PageChange(0, __aspxRichEdit.LayoutChangeType.Deleted, [], []));
                this.manager.layout.setEmptyLayout(this.manager.model.pageBackColor);
                this.manager.mainFormatter.rowFormatter.setPosition(0, true, true);
                this.manager.mainFormatter.rowFormatter.numberingListCountersManager.reset();
                var newLastRow = new LayoutFormatter.LastRowInfo(this.manager.mainFormatter.rowFormatter.subDocument.paragraphs);
                newLastRow.reset(this.manager.mainFormatter.rowFormatter);
                this.manager.mainFormatter.setParamsForRestart(LayoutFormatter.LayoutFormatterState.DocumentStart, null, newLastRow, true);
                this.manager.runFormatting(0);
            };
            RestartPreparer.prototype.restartByAnchoredObject = function (page) {
                var pageIndex = page.index;
                var subDocument = this.manager.mainFormatter.subDocument;
                if (!subDocument.tables.length)
                    return this.restartFromPage(pageIndex, false, true);
                var lp = new __aspxRichEdit.LayoutPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Page);
                lp.pageIndex = pageIndex;
                lp.page = page;
                var table = this.manager.invalidator.isPageStartWithMultipageTable(page);
                if (!table) {
                    if (!this.manager.mainFormatter.tableFormatter || this.manager.activeFormatter.subDocument.isMain())
                        return this.restartFromPage(pageIndex, false, true);
                    return this.restartFromPage(pageIndex, false, false);
                }
                labelEnd: for (lp.pageAreaIndex = 0; lp.pageArea = lp.page.mainSubDocumentPageAreas[lp.pageAreaIndex]; lp.pageAreaIndex++) {
                    for (lp.columnIndex = 0; lp.column = lp.pageArea.columns[lp.columnIndex]; lp.columnIndex++) {
                        for (lp.rowIndex = 0; lp.row = lp.column.rows[lp.rowIndex]; lp.rowIndex++) {
                            if (!lp.row.tableCellInfo ||
                                lp.row.tableCellInfo.parentRow.parentTable.getTopLevelColumn().logicInfo.grid.table.index != table.index)
                                break labelEnd;
                        }
                    }
                }
                if (!lp.pageArea || !lp.column || !lp.row)
                    return this.restartFromPage(pageIndex, false, true);
                this.restartFromRow(lp, this.manager.invalidator.getStartModelPositionOfRow(lp), false, false);
                this.manager.floatingRestartInfoHolder.init();
            };
            RestartPreparer.prototype.restartFromRow = function (lp, modelPosition, isRestartNow, removePrevAncObjects) {
                if (removePrevAncObjects === void 0) { removePrevAncObjects = true; }
                if (lp.isFirstRowOnPage())
                    return this.restartFromPage(lp.page.index, isRestartNow, true);
                var mainFormatter = this.manager.mainFormatter;
                var newLastRowInfo = new LayoutFormatter.LastRowInfo(mainFormatter.rowFormatter.subDocument.paragraphs);
                var prevRowLP = lp.clone();
                if (prevRowLP.advanceToPrevRow(this.manager.layout)) {
                    newLastRowInfo.setRowInfo(prevRowLP.row, lp.getLogPosition(__aspxRichEdit.DocumentLayoutDetailsLevel.Column) + prevRowLP.row.columnOffset, true);
                }
                else {
                    newLastRowInfo.setRowInfo(null, 0, true);
                }
                if (!this.restartCommonPart(modelPosition))
                    return;
                var pageChange = this.createNewLayoutPage(lp, modelPosition);
                if (removePrevAncObjects) {
                    var ancPosInfo_1 = this.manager.layout.anchorObjectsPositionInfo;
                    var rowPos_1 = this.manager.invalidator.getStartModelPositionOfRow(lp);
                    lp.page.anchoredObjectHolder.objects = __aspxRichEdit.MapUtilsKeyAsNumber.reducedMap(lp.page.anchoredObjectHolder.objects, function (obj) {
                        if (ancPosInfo_1.getPosition(obj.objectId) >= rowPos_1) {
                            if (obj.getType() == __aspxRichEdit.LayoutBoxType.AnchorTextBox) {
                                var id = obj.internalSubDocId;
                                delete lp.page.otherPageAreas[id];
                                pageChange.otherPageAreaChanges.push(new __aspxRichEdit.PageAreaChange(id, __aspxRichEdit.LayoutChangeType.Deleted));
                            }
                            else
                                pageChange.anchoredPictureChanges.push(new __aspxRichEdit.AnchoredPictureChange(obj.objectId, __aspxRichEdit.LayoutChangeType.Deleted));
                            return null;
                        }
                        else
                            return obj;
                    });
                }
                this.setBoundsCalculatorState(modelPosition, lp.page, lp.pageIndex);
                var boundsCalculator = this.manager.boundsCalculator;
                var pageAreaBounds = __aspxRichEdit.ListUtils.last(boundsCalculator.mainPageAreasBounds);
                var columnsBounds = __aspxRichEdit.ListUtils.last(boundsCalculator.mainColumnsBounds);
                mainFormatter.setBoundsForRestart(pageAreaBounds, columnsBounds);
                var bounds = new __aspxRichEdit.FixedInterval(lp.pageArea.x + columnsBounds[lp.columnIndex].x, columnsBounds[lp.columnIndex].width);
                mainFormatter.layoutRowBoundsCalculator.resetByColumn(lp.page.anchoredObjectHolder.objects, bounds, false);
                mainFormatter.setParamsForRestart(LayoutFormatter.LayoutFormatterState.RowFormatting, lp, newLastRowInfo, true);
                if (isRestartNow)
                    this.manager.runFormatting(lp.page.index);
            };
            RestartPreparer.prototype.setBoundsCalculatorState = function (modelPosition, page, pageIndex) {
                var boundsCalculator = this.manager.boundsCalculator;
                boundsCalculator.init(this.manager.model.getSectionByPosition(modelPosition));
                var prevPage = this.manager.layout.pages[pageIndex - 1];
                boundsCalculator.calculatePageBounds(prevPage ? prevPage.getBottomBoundPosition() : 0);
                var layoutOtherPageAreasInfo = page.getLayoutOtherPageAreasInfo();
                if (layoutOtherPageAreasInfo.headerPageArea)
                    boundsCalculator.setHeaderBounds(layoutOtherPageAreasInfo.headerPageArea.columns[0].height);
                if (layoutOtherPageAreasInfo.footerPageArea)
                    boundsCalculator.setFooterBounds(layoutOtherPageAreasInfo.footerPageArea.columns[0].height);
                boundsCalculator.calculateMainPageAreaBounds(-1);
                boundsCalculator.calculateColumnBounds(boundsCalculator.mainPageAreasBounds[boundsCalculator.mainPageAreasBounds.length - 1]);
            };
            RestartPreparer.prototype.createNewLayoutPage = function (lp, modelPosition) {
                var pageChange = new __aspxRichEdit.PageChange(lp.pageIndex, __aspxRichEdit.LayoutChangeType.Updated, [], []);
                lp.page = lp.page.deepCopy();
                lp.pageArea = lp.page.mainSubDocumentPageAreas[lp.pageAreaIndex];
                lp.column = lp.pageArea.columns[lp.columnIndex];
                lp.row = lp.column.rows[lp.rowIndex];
                this.manager.removeRedundantHelper.removeRedundantPageAreas(lp.page, lp.pageAreaIndex + 1, pageChange);
                var pageAreaChange = new __aspxRichEdit.PageAreaChange(lp.pageAreaIndex, __aspxRichEdit.LayoutChangeType.Updated);
                pageChange.mainPageAreaChanges.push(pageAreaChange);
                this.manager.removeRedundantHelper.removeRedundantColumnsFromArea(lp.pageArea, lp.columnIndex + 1, pageAreaChange);
                var columnChange = new __aspxRichEdit.ColumnChange(lp.columnIndex, __aspxRichEdit.LayoutChangeType.Updated);
                pageAreaChange.columnChanges.push(columnChange);
                this.manager.removeRedundantHelper.removeRedundantRowsFromColumn(lp.column, lp.rowIndex, columnChange);
                var tblIndex = __aspxRichEdit.ListUtils.indexBy(lp.column.tablesInfo, function (tbl) { return tbl.logicInfo.grid.table.getStartPosition() >= modelPosition; });
                this.manager.removeRedundantHelper.removeRedundantTableInfosFromColumn(lp.column, tblIndex == -1 ? lp.column.tablesInfo.length : tblIndex, columnChange);
                return pageChange;
            };
            return RestartPreparer;
        }());
        LayoutFormatter.RestartPreparer = RestartPreparer;
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Row;
        (function (Row) {
            var RowIntervalInfo = (function (_super) {
                __extends(RowIntervalInfo, _super);
                function RowIntervalInfo(start, length, avaliableWidth) {
                    if (avaliableWidth === void 0) { avaliableWidth = length; }
                    var _this = _super.call(this, start, length) || this;
                    _this.avaliableWidth = avaliableWidth;
                    return _this;
                }
                Object.defineProperty(RowIntervalInfo.prototype, "busyWidth", {
                    get: function () {
                        return this.length - this.avaliableWidth;
                    },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(RowIntervalInfo.prototype, "startOfFreeSpace", {
                    get: function () {
                        return this.start + this.busyWidth;
                    },
                    enumerable: true,
                    configurable: true
                });
                RowIntervalInfo.prototype.isConsiderBoxes = function () {
                    return this.avaliableWidth != this.length;
                };
                return RowIntervalInfo;
            }(__aspxRichEdit.FixedInterval));
            Row.RowIntervalInfo = RowIntervalInfo;
            var RowFormattingInfo = (function () {
                function RowFormattingInfo(minY, height, outerHorizontalRowContentBounds, boundsOfAnchoredOblectsOnThisColumn) {
                    this.intervals = [];
                    this.currIndex = 0;
                    this.minY = minY;
                    this.height = Math.max(1, height);
                    this.outerHorizontalRowContentBounds = outerHorizontalRowContentBounds;
                    this.boundsOfAnchoredOblectsOnThisColumn = boundsOfAnchoredOblectsOnThisColumn;
                    this.lastNonEmptyIntervalIndex = 0;
                }
                Object.defineProperty(RowFormattingInfo.prototype, "isFloatingIntersectRow", {
                    get: function () { return !!this.intersectsObjects.length; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(RowFormattingInfo.prototype, "lastNonEmptyInterval", {
                    get: function () { return this.intervals[this.lastNonEmptyIntervalIndex]; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(RowFormattingInfo.prototype, "currInterval", {
                    get: function () {
                        return this.intervals[this.currIndex];
                    },
                    enumerable: true,
                    configurable: true
                });
                RowFormattingInfo.prototype.indexOfFreeInterval = function (width) {
                    return __aspxRichEdit.ListUtils.indexBy(this.intervals, function (curr) { return curr.avaliableWidth >= width; }, this.currIndex);
                };
                RowFormattingInfo.prototype.indexOfIntervalContainsPositon = function (pos) {
                    var ind = __aspxRichEdit.ListUtils.indexBy(this.intervals, function (curr) { return curr.start > pos || pos < curr.end; }, this.currIndex + 1);
                    return ind < 0 ? this.intervals.length - 1 : ind;
                };
                RowFormattingInfo.prototype.calculate = function () {
                    this.setIntersectObjects();
                    var busyIntervals = __aspxRichEdit.IntervalAlgorithms.getMergedIntervals(__aspxRichEdit.ListUtils.map(this.intersectsObjects, function (objBnds) { return new __aspxRichEdit.FixedInterval(objBnds.x, objBnds.width); }), true);
                    var freeIntervals = __aspxRichEdit.IntervalAlgorithms.reflectIntervals(busyIntervals, this.outerHorizontalRowContentBounds);
                    if (freeIntervals.length) {
                        this.intervals = __aspxRichEdit.ListUtils.map(freeIntervals, function (curr) { return new RowIntervalInfo(curr.start, curr.length); });
                        return;
                    }
                    this.resetMinY(__aspxRichEdit.ListUtils.min);
                    __aspxRichEdit.Log.print(__aspxRichEdit.LogSource.RowFormatter, "RowFormattingInfo.calculate ", "minY:" + this.minY + ", height:" + this.height + ", currIndex: " + this.currIndex + " intervals:\n" + __aspxRichEdit.Log.join("\n", __aspxRichEdit.ListUtils.map(this.intervals, function (curr) { return __aspxRichEdit.LogObjToStr.fixedInterval(curr); })));
                };
                RowFormattingInfo.prototype.canIncrementHeightTo = function (newHeight) {
                    var _this = this;
                    var contentBounds = __aspxRichEdit.ListUtils.map(this.intervals, function (c) { return new __aspxRichEdit.Rectangle().init(c.start, _this.minY, c.busyWidth, newHeight); });
                    return !__aspxRichEdit.ListUtils.anyOf(this.boundsOfAnchoredOblectsOnThisColumn, function (ancBound) {
                        return __aspxRichEdit.ListUtils.anyOf(contentBounds, function (contentBound) { return __aspxRichEdit.Rectangle.getNonDegenerateIntersection(contentBound, ancBound); });
                    });
                };
                RowFormattingInfo.prototype.findNextYPos = function () {
                    this.resetMinY(__aspxRichEdit.ListUtils.min);
                };
                RowFormattingInfo.prototype.findNextYPosWhatNoIntersectFloatingObjects = function () {
                    while (this.isFloatingIntersectRow)
                        this.resetMinY(__aspxRichEdit.ListUtils.max);
                    this.currIndex = 0;
                };
                RowFormattingInfo.prototype.setIntersectObjects = function () {
                    var initRect = new __aspxRichEdit.Rectangle()
                        .init(this.outerHorizontalRowContentBounds.start, this.minY, this.outerHorizontalRowContentBounds.length, this.height);
                    this.intersectsObjects = __aspxRichEdit.ListUtils.reducedMap(this.boundsOfAnchoredOblectsOnThisColumn, function (objBnds) {
                        return __aspxRichEdit.Rectangle.getNonDegenerateIntersection(initRect, objBnds) ? objBnds : null;
                    });
                };
                RowFormattingInfo.prototype.resetMinY = function (getVal) {
                    this.minY = getVal(this.intersectsObjects, function (a, b) { return a.getBottomBoundPosition() - b.getBottomBoundPosition(); }).getBottomBoundPosition();
                    this.calculate();
                };
                return RowFormattingInfo;
            }());
            Row.RowFormattingInfo = RowFormattingInfo;
        })(Row = LayoutFormatter.Row || (LayoutFormatter.Row = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Row;
        (function (Row) {
            var RowHeightCalculator = (function () {
                function RowHeightCalculator(rowFormatter, rowSpacingBeforeApplier) {
                    this.rowFormatter = rowFormatter;
                    this.rowSpacingBeforeApplier = rowSpacingBeforeApplier;
                    this.lineSpacingCalculator = Row.LineSpacingCalculator.create(this.rowFormatter.paragraphProps.lineSpacing, this.rowFormatter.paragraphProps.lineSpacingType);
                    this.currState = new Row.RowHeightState(0, 0, 0, 0);
                    this.currState.height = 0;
                    this.currState.baseLine = 0;
                    this.currState.spacingBefore = 0;
                    this.applyState(this.getState(this.rowFormatter.currBox));
                }
                Object.defineProperty(RowHeightCalculator.prototype, "row", {
                    get: function () {
                        return this.rowFormatter.row;
                    },
                    enumerable: true,
                    configurable: true
                });
                RowHeightCalculator.prototype.getState = function (box) {
                    var info;
                    switch (box.getType()) {
                        case __aspxRichEdit.LayoutBoxType.Text:
                        case __aspxRichEdit.LayoutBoxType.FieldCodeStart:
                        case __aspxRichEdit.LayoutBoxType.FieldCodeEnd:
                        case __aspxRichEdit.LayoutBoxType.Dash: {
                            info = new Row.RowHeightState(Math.max(box.height, this.currState.maxBoxHeight), Math.max(box.getAscent(), this.currState.maxAscent), Math.max(box.getDescent(), this.currState.maxDescent), this.currState.maxPictureBoxHeight);
                            break;
                        }
                        case __aspxRichEdit.LayoutBoxType.Picture: {
                            info = new Row.RowHeightState(Math.max(box.height, this.currState.maxBoxHeight), this.currState.maxAscent, this.currState.maxDescent, Math.max(box.height, this.currState.maxPictureBoxHeight));
                            break;
                        }
                        default:
                            return this.currState;
                    }
                    return this.calcNewState(info);
                };
                RowHeightCalculator.prototype.calcNewState = function (newInfo) {
                    if (this.currState.equalHeights(newInfo) || newInfo.maxBoxHeight == 0)
                        return this.currState;
                    this.calcRowParams(newInfo.maxBoxHeight, newInfo.maxAscent, newInfo.maxDescent, newInfo.maxPictureBoxHeight);
                    newInfo.initFromRow(this.row);
                    return newInfo;
                };
                RowHeightCalculator.prototype.applyState = function (state) {
                    this.currState = state;
                };
                RowHeightCalculator.prototype.T584234 = function () {
                    var _this = this;
                    var row = this.row;
                    if (row.boxes.length && row.boxes[0].getType() == __aspxRichEdit.LayoutBoxType.Picture &&
                        __aspxRichEdit.ListUtils.allOf(row.boxes, function (b) { return RowHeightCalculator.affectedBoxesT584234[b.getType()]; }, 1)) {
                        var prevBox = row.boxes[0];
                        var applied = false;
                        for (var boxIndex = 2, box = void 0; box = row.boxes[boxIndex]; boxIndex++) {
                            if (box.getType() == __aspxRichEdit.LayoutBoxType.Picture &&
                                prevBox.getType() != __aspxRichEdit.LayoutBoxType.Picture && RowHeightCalculator.affectedBoxesT584234[prevBox.getType()]) {
                                applied = true;
                                this.applyT584234Height(prevBox);
                            }
                            prevBox = box;
                        }
                        if (!applied) {
                            __aspxRichEdit.ListUtils.reverseForeach(row.boxes, function (b) {
                                if (b.getType() != __aspxRichEdit.LayoutBoxType.Picture) {
                                    _this.applyT584234Height(b);
                                }
                            });
                        }
                    }
                };
                RowHeightCalculator.prototype.applyT584234Height = function (b) {
                    var info = new Row.RowHeightState(Math.max(b.height, this.currState.maxBoxHeight), Math.max(b.getAscent(), this.currState.maxAscent), Math.max(b.getDescent(), this.currState.maxDescent), this.currState.maxPictureBoxHeight);
                    this.applyState(this.calcNewState(info));
                };
                RowHeightCalculator.prototype.setFinalRowParams = function () {
                    var row = this.row;
                    if (this.currState.maxBoxHeight != 0) {
                        this.T584234();
                        this.currState.applyToRow(row);
                        return true;
                    }
                    var lastBox = __aspxRichEdit.ListUtils.last(row.boxes);
                    if (!lastBox && __aspxRichEdit.ListUtils.anyOf(this.rowFormatter.result.newAnchoredObjects, function (obj) { return obj.levelType == __aspxRichEdit.AnchoredObjectLevelType.InText; }))
                        return true;
                    this.calcRowParams(lastBox.height, lastBox.getAscent(), lastBox.getDescent(), this.currState.maxPictureBoxHeight);
                    this.currState.initFromRow(this.row);
                    return false;
                };
                RowHeightCalculator.prototype.calcRowParams = function (maxBoxHeight, maxAscent, maxDescent, maxPictureBoxHeight) {
                    var row = this.row;
                    row.rollbackSpacingBefore();
                    row.height = this.lineSpacingCalculator.calculate(maxBoxHeight, maxAscent, maxDescent, maxPictureBoxHeight);
                    switch (this.rowFormatter.paragraphProps.lineSpacingType) {
                        case __aspxRichEdit.ParagraphLineSpacingType.AtLeast:
                        case __aspxRichEdit.ParagraphLineSpacingType.Exactly:
                            row.baseLine = row.height - maxDescent;
                            break;
                        default:
                            row.baseLine = Math.max(maxAscent, maxPictureBoxHeight);
                    }
                    this.rowSpacingBeforeApplier.apply(this.row, this.rowFormatter.result.paragraphIndex);
                };
                RowHeightCalculator.affectedBoxesT584234 = new __aspxRichEdit.MapCreatorNumberAsKey()
                    .add(__aspxRichEdit.LayoutBoxType.LineBreak, true)
                    .add(__aspxRichEdit.LayoutBoxType.ParagraphMark, true)
                    .add(__aspxRichEdit.LayoutBoxType.TabSpace, true)
                    .add(__aspxRichEdit.LayoutBoxType.Space, true)
                    .add(__aspxRichEdit.LayoutBoxType.Picture, true)
                    .get();
                return RowHeightCalculator;
            }());
            Row.RowHeightCalculator = RowHeightCalculator;
        })(Row = LayoutFormatter.Row || (LayoutFormatter.Row = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Row;
        (function (Row) {
            var RowHeightState = (function () {
                function RowHeightState(maxBoxHeight, maxAscent, maxDescent, maxPictureBoxHeight) {
                    this.maxBoxHeight = maxBoxHeight;
                    this.maxAscent = maxAscent;
                    this.maxDescent = maxDescent;
                    this.maxPictureBoxHeight = maxPictureBoxHeight;
                }
                RowHeightState.prototype.initFromRow = function (row) {
                    this.height = row.height;
                    this.baseLine = row.baseLine;
                    this.spacingBefore = row.getSpacingBefore();
                };
                RowHeightState.prototype.applyToRow = function (row) {
                    row.rollbackSpacingBefore();
                    row.applySpacingBefore(this.spacingBefore);
                    row.height = this.height;
                    row.baseLine = this.baseLine;
                };
                RowHeightState.prototype.getFullRowHeight = function () {
                    return this.height + this.spacingBefore;
                };
                RowHeightState.prototype.equalHeights = function (obj) {
                    return this.maxBoxHeight == obj.maxBoxHeight &&
                        this.maxAscent == obj.maxAscent &&
                        this.maxDescent == obj.maxDescent &&
                        this.maxPictureBoxHeight == obj.maxPictureBoxHeight;
                };
                return RowHeightState;
            }());
            Row.RowHeightState = RowHeightState;
        })(Row = LayoutFormatter.Row || (LayoutFormatter.Row = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Row;
        (function (Row) {
            var RowSizesManager = (function () {
                function RowSizesManager(rowFormatter, outerHorizontalRowContentBounds, minY, rowSpacingBeforeApplier, boundsOfAnchoredOblectsOnThisColumn, isFirstRowInParagraph) {
                    this.rowFormatter = rowFormatter;
                    this.row = this.rowFormatter.row;
                    this.rowStartPos = this.rowFormatter.currBox.rowOffset;
                    this.heightCalculator = new Row.RowHeightCalculator(this.rowFormatter, rowSpacingBeforeApplier);
                    if (isFirstRowInParagraph && this.rowFormatter.paragraph.isInList())
                        this.addNumberingListBoxes();
                    this.rowFormattingInfo = new Row.RowFormattingInfo(minY, this.heightCalculator.currState.getFullRowHeight(), outerHorizontalRowContentBounds, boundsOfAnchoredOblectsOnThisColumn);
                    this.rowFormattingInfo.calculate();
                }
                RowSizesManager.prototype.addNumberingListBoxes = function () {
                    var paragraph = this.rowFormatter.paragraph;
                    var charProp = paragraph.getNumerationCharacterProperties();
                    this.row.numberingListBox = new __aspxRichEdit.LayoutNumberingListBox(charProp, charProp.getLayoutColorInfo(this.rowFormatter.manager.model.colorProvider), paragraph.getNumberingListTextCore(this.rowFormatter.numberingListCountersManager.calculateCounters(this.rowFormatter.result.paragraphIndex)), paragraph.getNumberingListSeparatorChar(), this.rowFormatter.manager.model.cache.mergedCharacterPropertiesCache);
                    __aspxRichEdit.LayoutBox.initializeWithMeasurer([new Row.Box.BoxWrap(this.row.numberingListBox, null)], this.rowFormatter.manager.measurer, this.rowFormatter.manager.innerClientProperties.showHiddenSymbols);
                    var boxes = [this.row.numberingListBox.textBox];
                    var separatorBox = this.row.numberingListBox.separatorBox;
                    if (separatorBox)
                        boxes.push(separatorBox);
                    for (var _i = 0, boxes_2 = boxes; _i < boxes_2.length; _i++) {
                        var box = boxes_2[_i];
                        this.heightCalculator.applyState(this.heightCalculator.getState(box));
                    }
                };
                RowSizesManager.prototype.addFullWord = function (boxes) {
                    var _this = this;
                    var wordWidth = __aspxRichEdit.ListUtils.accumulate(boxes, 0, function (width, box) { return width + box.width; });
                    var currIntervalEndPos = this.rowFormattingInfo.currInterval.end;
                    var indexOfFreeInterval = this.rowFormattingInfo.indexOfFreeInterval(wordWidth);
                    if (indexOfFreeInterval < 0)
                        return false;
                    var oldHeightState = this.heightCalculator.currState;
                    __aspxRichEdit.ListUtils.foreach(boxes, function (box) { return _this.heightCalculator.applyState(_this.heightCalculator.getState(box)); });
                    var newHeightState = this.heightCalculator.currState;
                    var newHeight = newHeightState.getFullRowHeight();
                    this.rowFormattingInfo.intervals[indexOfFreeInterval].avaliableWidth -= wordWidth;
                    if (newHeight != this.rowFormattingInfo.height && !this.rowFormattingInfo.canIncrementHeightTo(newHeight)) {
                        this.rowFormattingInfo.height = newHeight;
                        this.heightCalculator.currState = oldHeightState;
                        this.restartAllRow();
                        return null;
                    }
                    this.heightCalculator.applyState(newHeightState);
                    if (this.rowFormattingInfo.currIndex != indexOfFreeInterval)
                        this.finishLogicalRow(indexOfFreeInterval, currIntervalEndPos);
                    var x = this.rowFormattingInfo.currInterval.startOfFreeSpace - wordWidth;
                    for (var _i = 0, boxes_3 = boxes; _i < boxes_3.length; _i++) {
                        var box = boxes_3[_i];
                        box.x = x;
                        x += box.width;
                        this.row.boxes.push(box);
                        this.rowFormattingInfo.lastNonEmptyIntervalIndex = this.rowFormattingInfo.currIndex;
                    }
                    return true;
                };
                RowSizesManager.prototype.addWordByChars = function (boxes) {
                    var isAddAtLeastOneChar = true;
                    var viewsSettings = this.rowFormatter.manager.innerClientProperties.viewsSettings;
                    for (var _i = 0, boxes_4 = boxes; _i < boxes_4.length; _i++) {
                        var box = boxes_4[_i];
                        if (this.rowFormattingInfo.currInterval.avaliableWidth >= box.width) {
                            box.x = this.rowFormattingInfo.currInterval.startOfFreeSpace;
                            this.rowFormattingInfo.currInterval.avaliableWidth -= box.width;
                            this.row.boxes.push(box);
                            this.rowFormattingInfo.lastNonEmptyIntervalIndex = this.rowFormattingInfo.currIndex;
                            this.heightCalculator.applyState(this.heightCalculator.getState(box));
                        }
                        else {
                            var newBox = box.splitByWidth(this.rowFormatter.manager.measurer, this.rowFormattingInfo.currInterval.avaliableWidth, isAddAtLeastOneChar);
                            if (newBox) {
                                newBox.x = this.rowFormattingInfo.currInterval.startOfFreeSpace;
                                this.row.boxes.push(newBox);
                                this.rowFormattingInfo.lastNonEmptyIntervalIndex = this.rowFormattingInfo.currIndex;
                                this.heightCalculator.applyState(this.heightCalculator.getState(newBox));
                                return newBox.getEndPosition();
                            }
                            return box.rowOffset;
                        }
                        isAddAtLeastOneChar = false;
                    }
                    if (viewsSettings.isSimpleView)
                        return boxes[boxes.length - 1].getEndPosition();
                    throw new Error(__aspxRichEdit.Errors.InternalException);
                };
                RowSizesManager.prototype.addTabBox = function (box) {
                    this.row.boxes.push(box);
                    this.rowFormattingInfo.currInterval.avaliableWidth -= box.width;
                    this.rowFormattingInfo.lastNonEmptyIntervalIndex = this.rowFormattingInfo.currIndex;
                    this.rowFormatter.setBoxInfo(true);
                };
                RowSizesManager.prototype.addBox = function () {
                    var currIntervalEndPos = this.rowFormattingInfo.currInterval.end;
                    var box = this.rowFormatter.currBox;
                    var indexOfFreeInterval = this.rowFormattingInfo.indexOfFreeInterval(box.width);
                    if (indexOfFreeInterval < 0) {
                        if (this.row.isEmpty()) {
                            if (this.rowFormattingInfo.isFloatingIntersectRow) {
                                this.rowFormattingInfo.findNextYPos();
                                this.rowFormattingInfo.currIndex = 0;
                                this.addBox();
                            }
                            else {
                                box.x = this.rowFormattingInfo.intervals[0].startOfFreeSpace;
                                this.rowFormattingInfo.intervals[0].avaliableWidth -= Math.min(box.width, this.rowFormattingInfo.intervals[0].avaliableWidth);
                                this.addBoxIgnoreWidth();
                            }
                        }
                        else
                            this.rowFormatter.finishRow();
                        return;
                    }
                    this.rowFormattingInfo.intervals[indexOfFreeInterval].avaliableWidth -= box.width;
                    var newHeightState = this.heightCalculator.getState(box);
                    var newHeight = newHeightState.getFullRowHeight();
                    if (newHeight != this.rowFormattingInfo.height && !this.rowFormattingInfo.canIncrementHeightTo(newHeight)) {
                        this.rowFormattingInfo.intervals[indexOfFreeInterval].avaliableWidth += box.width;
                        this.rowFormattingInfo.height = newHeight;
                        this.restartAllRow();
                        return;
                    }
                    this.rowFormattingInfo.height = newHeight;
                    this.heightCalculator.applyState(newHeightState);
                    if (this.rowFormattingInfo.currIndex != indexOfFreeInterval)
                        this.finishLogicalRow(indexOfFreeInterval, currIntervalEndPos);
                    box.x = this.rowFormattingInfo.currInterval.startOfFreeSpace - box.width;
                    this.row.boxes.push(box);
                    this.rowFormattingInfo.lastNonEmptyIntervalIndex = this.rowFormattingInfo.currIndex;
                    this.rowFormatter.setBoxInfo(true);
                };
                RowSizesManager.prototype.addBoxIgnoreWidth = function () {
                    var box = this.rowFormatter.currBox;
                    this.row.boxes.push(box);
                    this.rowFormattingInfo.lastNonEmptyIntervalIndex = this.rowFormattingInfo.currIndex;
                    this.heightCalculator.applyState(this.heightCalculator.getState(box));
                    this.rowFormatter.setBoxInfo(true);
                };
                RowSizesManager.prototype.anywayAddBox = function () {
                    var box = this.rowFormatter.currBox;
                    box.x = this.rowFormattingInfo.currInterval.startOfFreeSpace;
                    this.rowFormattingInfo.currInterval.avaliableWidth -= box.width;
                    if (this.rowFormattingInfo.currInterval.avaliableWidth < 0)
                        this.rowFormattingInfo.currInterval.avaliableWidth = 0;
                    this.row.boxes.push(box);
                    this.rowFormattingInfo.lastNonEmptyIntervalIndex = this.rowFormattingInfo.currIndex;
                    this.rowFormatter.setBoxInfo(true);
                };
                RowSizesManager.prototype.restartAllRow = function () {
                    this.rowFormatter.setPosition(this.rowStartPos, false, true);
                    this.rowFormatter.setBoxInfo(false);
                    this.rowFormattingInfo.calculate();
                    this.rowFormattingInfo.currIndex = 0;
                    this.rowFormatter.result.startRowFormatting();
                    this.rowFormatter.wordHolder.restart();
                    this.rowFormatter.tabInfo.restart();
                };
                RowSizesManager.prototype.finishLogicalRow = function (nextIndex, prevRowEndPos) {
                    if (this.rowFormattingInfo.currInterval.isConsiderBoxes())
                        this.rowFormatter.result.finishLogicalRow(prevRowEndPos);
                    this.rowFormattingInfo.currIndex = nextIndex;
                };
                RowSizesManager.prototype.finishRow = function () {
                    this.row.y = this.rowFormattingInfo.minY;
                    if (this.heightCalculator.setFinalRowParams() ||
                        this.rowFormattingInfo.canIncrementHeightTo(this.heightCalculator.currState.getFullRowHeight())) {
                        this.rowFormatter.result.finishRow();
                        return true;
                    }
                    this.rowFormattingInfo.height = this.heightCalculator.currState.getFullRowHeight();
                    this.restartAllRow();
                    return false;
                };
                RowSizesManager.prototype.addNumberingBoxes = function () {
                    return !!this.row.boxes.length || !this.row.numberingListBox || this.tryPlaceNumberingBoxes();
                };
                RowSizesManager.prototype.getTabEndPos = function (isFirstIteration, textBoxEndPos) {
                    var customTabPos = this.rowFormatter.tabInfo.getNextCustomTabPosition(textBoxEndPos);
                    if (this.rowFormatter.paragraphProps.firstLineIndentType == __aspxRichEdit.ParagraphFirstLineIndent.Hanging) {
                        var rightBound = this.rowFormatter.paragraphHorizontalBounds.start +
                            __aspxRichEdit.UnitConverter.twipsToPixels(this.rowFormatter.paragraphProps.leftIndent);
                        return customTabPos && isFirstIteration && rightBound > textBoxEndPos &&
                            __aspxRichEdit.FixedInterval.fromPositions(textBoxEndPos, rightBound).contains(customTabPos.position) ?
                            customTabPos.position :
                            rightBound;
                    }
                    else
                        return customTabPos ? customTabPos.position : this.rowFormatter.tabInfo.getNextDefaultTabPosition(textBoxEndPos);
                };
                RowSizesManager.prototype.tryPlaceNumberingBoxes = function () {
                    for (var isFirstIteration = true; true; isFirstIteration = false) {
                        if (!this.placeNumberingTextBox(this.row.numberingListBox.textBox))
                            return false;
                        var separatorBox = this.row.numberingListBox.separatorBox;
                        if (!separatorBox)
                            return true;
                        var textBoxEndPos = this.row.numberingListBox.textBox.getRightBoundPosition();
                        separatorBox.x = textBoxEndPos;
                        if (separatorBox.getType() == __aspxRichEdit.LayoutBoxType.TabSpace) {
                            var tabEndPosition = this.getTabEndPos(isFirstIteration, textBoxEndPos);
                            var canPlace = !this.rowFormattingInfo.isFloatingIntersectRow ||
                                this.rowFormattingInfo.currInterval.containsWithIntervalEnd(tabEndPosition);
                            if (canPlace) {
                                separatorBox.width = tabEndPosition - textBoxEndPos;
                                this.rowFormattingInfo.currInterval.avaliableWidth -= separatorBox.width;
                                this.rowFormattingInfo.lastNonEmptyIntervalIndex = this.rowFormattingInfo.currIndex;
                                return true;
                            }
                        }
                        else {
                            if (separatorBox.width <= this.rowFormattingInfo.currInterval.avaliableWidth) {
                                this.rowFormattingInfo.currInterval.avaliableWidth -= separatorBox.width;
                                this.rowFormattingInfo.lastNonEmptyIntervalIndex = this.rowFormattingInfo.currIndex;
                                return true;
                            }
                        }
                        this.finishLogicalRow(this.rowFormatter.rowSizesManager.rowFormattingInfo.currIndex + 1, this.rowFormatter.rowSizesManager.rowFormattingInfo.currInterval.end);
                    }
                };
                RowSizesManager.prototype.placeNumberingTextBox = function (box) {
                    if (this.rowFormattingInfo.isFloatingIntersectRow) {
                        var currIntervalEndPos = this.rowFormattingInfo.currInterval ? this.rowFormattingInfo.currInterval.end : -1;
                        var indexOfFreeInterval = this.rowFormattingInfo.indexOfFreeInterval(box.width);
                        if (indexOfFreeInterval < 0) {
                            this.rowFormattingInfo.findNextYPos();
                            this.rowFormattingInfo.currIndex = 0;
                            this.restartAllRow();
                            return false;
                        }
                        if (this.rowFormattingInfo.currIndex != indexOfFreeInterval)
                            this.finishLogicalRow(indexOfFreeInterval, currIntervalEndPos);
                    }
                    box.x = this.rowFormattingInfo.currInterval.startOfFreeSpace;
                    this.rowFormattingInfo.currInterval.avaliableWidth -= box.width;
                    this.rowFormattingInfo.lastNonEmptyIntervalIndex = this.rowFormattingInfo.currIndex;
                    return true;
                };
                return RowSizesManager;
            }());
            Row.RowSizesManager = RowSizesManager;
        })(Row = LayoutFormatter.Row || (LayoutFormatter.Row = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Row;
        (function (Row) {
            var BoxAligner = (function () {
                function BoxAligner() {
                }
                BoxAligner.findLastVisibleBoxIndex = function (boxes) {
                    return __aspxRichEdit.ListUtils.reverseIndexBy(boxes, function (box) { return box.isVisibleForRowAlign(); });
                };
                BoxAligner.align = function (row, alignment, endXPosition, fromBoxIndex, dontJustifyLinesEndingInSoftLineBreak) {
                    switch (alignment) {
                        case __aspxRichEdit.ParagraphAlignment.Right:
                            BoxAligner.alignRightCenter(BoxAligner.getBoxes(row, fromBoxIndex), endXPosition, 1);
                            break;
                        case __aspxRichEdit.ParagraphAlignment.Center:
                            BoxAligner.alignRightCenter(BoxAligner.getBoxes(row, fromBoxIndex), endXPosition, 2);
                            break;
                        case __aspxRichEdit.ParagraphAlignment.Justify:
                            BoxAligner.alignJustify(BoxAligner.getBoxes(row, fromBoxIndex), endXPosition, dontJustifyLinesEndingInSoftLineBreak);
                            break;
                        case __aspxRichEdit.ParagraphAlignment.Left:
                        case __aspxRichEdit.ParagraphAlignment.Unspecified:
                            break;
                        default:
                            throw new Error(__aspxRichEdit.Errors.InternalException);
                    }
                };
                BoxAligner.getBoxes = function (row, fromBoxIndex) {
                    if (fromBoxIndex)
                        return row.boxes.slice(fromBoxIndex);
                    if (!row.numberingListBox)
                        return row.boxes;
                    var boxes = row.boxes.slice();
                    if (row.numberingListBox.separatorBox)
                        boxes.unshift(row.numberingListBox.separatorBox);
                    boxes.unshift(row.numberingListBox.textBox);
                    return boxes;
                };
                BoxAligner.alignRightCenter = function (boxes, endXPosition, divider) {
                    var avaliableWidth = BoxAligner.calculateFreeSpace(boxes, BoxAligner.findLastVisibleBoxIndex(boxes), endXPosition);
                    if (divider > 1)
                        avaliableWidth = Math.floor(avaliableWidth / divider);
                    if (avaliableWidth > 0)
                        for (var _i = 0, boxes_5 = boxes; _i < boxes_5.length; _i++) {
                            var box = boxes_5[_i];
                            box.x += avaliableWidth;
                        }
                };
                BoxAligner.alignJustify = function (boxes, endXPosition, dontJustifyLinesEndingInSoftLineBreak) {
                    switch (__aspxRichEdit.ListUtils.last(boxes).getType()) {
                        case __aspxRichEdit.LayoutBoxType.ParagraphMark:
                        case __aspxRichEdit.LayoutBoxType.ColumnBreak:
                        case __aspxRichEdit.LayoutBoxType.PageBreak:
                        case __aspxRichEdit.LayoutBoxType.SectionMark:
                            return;
                        case __aspxRichEdit.LayoutBoxType.LineBreak:
                            if (dontJustifyLinesEndingInSoftLineBreak)
                                return;
                    }
                    var prevBox = boxes[boxes.length - 2];
                    var lastVisibleBoxIndex = BoxAligner.findLastVisibleBoxIndex(boxes);
                    if (prevBox && (prevBox.getType() == __aspxRichEdit.LayoutBoxType.ParagraphMark || prevBox.getType() == __aspxRichEdit.LayoutBoxType.PageBreak) ||
                        prevBox && prevBox.getType() == __aspxRichEdit.LayoutBoxType.PageBreak ||
                        lastVisibleBoxIndex < 0)
                        return;
                    var firstNonSpaceBoxIndex = BoxAligner.firstNonSpaceBoxIndex(boxes);
                    if (firstNonSpaceBoxIndex < 0)
                        return;
                    var totalSpaceWidth = 0;
                    for (var i = firstNonSpaceBoxIndex + 1; i <= lastVisibleBoxIndex; i++) {
                        var box = boxes[i];
                        var boxType = box.getType();
                        if (boxType == __aspxRichEdit.LayoutBoxType.Space || boxType == __aspxRichEdit.LayoutBoxType.NonBreakingSpace)
                            totalSpaceWidth += box.width;
                    }
                    var freeSpace = BoxAligner.calculateFreeSpace(boxes, lastVisibleBoxIndex, endXPosition);
                    if (totalSpaceWidth == 0 || freeSpace <= 0)
                        return;
                    var leftX = boxes[firstNonSpaceBoxIndex].getRightBoundPosition();
                    for (var i = firstNonSpaceBoxIndex + 1; i <= lastVisibleBoxIndex; i++) {
                        var box = boxes[i];
                        box.x = leftX;
                        var boxType = box.getType();
                        if (boxType == __aspxRichEdit.LayoutBoxType.Space || boxType == __aspxRichEdit.LayoutBoxType.NonBreakingSpace)
                            box.width += (freeSpace * box.width) / totalSpaceWidth;
                        leftX += box.width;
                    }
                    for (var i = lastVisibleBoxIndex + 1, box = void 0; box = boxes[i]; i++) {
                        box.x = leftX;
                        leftX += box.width;
                    }
                };
                BoxAligner.calculateFreeSpace = function (boxes, lastVisibleBoxIndex, rightBoundsPosition) {
                    return rightBoundsPosition - (lastVisibleBoxIndex >= 0 ? boxes[lastVisibleBoxIndex].getRightBoundPosition() : boxes[0].x);
                };
                BoxAligner.firstNonSpaceBoxIndex = function (boxes) {
                    var lastNonSpace = -1;
                    for (var i = boxes.length - 1; i >= 0; i--)
                        switch (boxes[i].getType()) {
                            case __aspxRichEdit.LayoutBoxType.TabSpace: return lastNonSpace;
                            case __aspxRichEdit.LayoutBoxType.Space:
                            case __aspxRichEdit.LayoutBoxType.NonBreakingSpace:
                                break;
                            default: lastNonSpace = i;
                        }
                    return lastNonSpace;
                };
                return BoxAligner;
            }());
            Row.BoxAligner = BoxAligner;
        })(Row = LayoutFormatter.Row || (LayoutFormatter.Row = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Row;
        (function (Row) {
            var LineSpacingCalculator = (function () {
                function LineSpacingCalculator() {
                }
                LineSpacingCalculator.create = function (lineSpacing, lineSpacingType) {
                    switch (lineSpacingType) {
                        case __aspxRichEdit.ParagraphLineSpacingType.AtLeast:
                            return new AtLeastSpacingCalculator(Math.max(1, __aspxRichEdit.UnitConverter.twipsToPixels(lineSpacing)));
                        case __aspxRichEdit.ParagraphLineSpacingType.Double:
                            return new DoubleSpacingCalculator();
                        case __aspxRichEdit.ParagraphLineSpacingType.Exactly:
                            return new ExactlySpacingCalculator(Math.max(1, __aspxRichEdit.UnitConverter.twipsToPixels(lineSpacing)));
                        case __aspxRichEdit.ParagraphLineSpacingType.Multiple:
                            return new MultipleSpacingCalculator(lineSpacing !== 0 ? lineSpacing : 1);
                        case __aspxRichEdit.ParagraphLineSpacingType.Sesquialteral:
                            return new SesquialteralSpacingCalculator();
                        case __aspxRichEdit.ParagraphLineSpacingType.Single:
                        default:
                            return new SingleSpacingCalculator();
                    }
                };
                LineSpacingCalculator.prototype.calculate = function (rowHeight, maxAscent, maxDescent, maxPictureHeight) {
                    var maxTextHeight = maxAscent + maxDescent;
                    if (maxTextHeight == 0)
                        return rowHeight;
                    var rowTextSpacing = this.calculateSpacing(maxTextHeight);
                    if (!maxPictureHeight || maxAscent > maxPictureHeight)
                        return rowTextSpacing;
                    else {
                        if (maxDescent == 0)
                            return rowHeight;
                        else
                            return this.calculateSpacingInlineObjectCase(maxTextHeight, rowTextSpacing, maxPictureHeight, maxDescent);
                    }
                };
                return LineSpacingCalculator;
            }());
            Row.LineSpacingCalculator = LineSpacingCalculator;
            var MultipleSpacingCalculator = (function (_super) {
                __extends(MultipleSpacingCalculator, _super);
                function MultipleSpacingCalculator(multiplier) {
                    var _this = _super.call(this) || this;
                    if (multiplier <= 0)
                        throw new Error(__aspxRichEdit.Errors.ArgumentException("multiplier", multiplier));
                    _this.multiplier = multiplier;
                    return _this;
                }
                MultipleSpacingCalculator.prototype.calculateSpacing = function (maxTextHeight) {
                    return maxTextHeight * this.multiplier;
                };
                MultipleSpacingCalculator.prototype.calculateSpacingInlineObjectCase = function (maxTextHeight, rowTextSpacing, maxPictureHeight, maxDescent) {
                    return maxPictureHeight + maxDescent + (rowTextSpacing - maxTextHeight);
                };
                return MultipleSpacingCalculator;
            }(LineSpacingCalculator));
            Row.MultipleSpacingCalculator = MultipleSpacingCalculator;
            var SingleSpacingCalculator = (function (_super) {
                __extends(SingleSpacingCalculator, _super);
                function SingleSpacingCalculator() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                SingleSpacingCalculator.prototype.calculateSpacing = function (maxTextHeight) {
                    return maxTextHeight;
                };
                SingleSpacingCalculator.prototype.calculateSpacingInlineObjectCase = function (_maxTextHeight, _rowTextSpacing, maxPictureHeight, maxDescent) {
                    return maxPictureHeight + maxDescent;
                };
                return SingleSpacingCalculator;
            }(LineSpacingCalculator));
            Row.SingleSpacingCalculator = SingleSpacingCalculator;
            var DoubleSpacingCalculator = (function (_super) {
                __extends(DoubleSpacingCalculator, _super);
                function DoubleSpacingCalculator() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                DoubleSpacingCalculator.prototype.calculateSpacing = function (maxTextHeight) {
                    return 2 * maxTextHeight;
                };
                DoubleSpacingCalculator.prototype.calculateSpacingInlineObjectCase = function (maxTextHeight, rowTextSpacing, maxPictureHeight, maxDescent) {
                    return maxPictureHeight + maxDescent + (rowTextSpacing - maxTextHeight);
                };
                return DoubleSpacingCalculator;
            }(LineSpacingCalculator));
            Row.DoubleSpacingCalculator = DoubleSpacingCalculator;
            var SesquialteralSpacingCalculator = (function (_super) {
                __extends(SesquialteralSpacingCalculator, _super);
                function SesquialteralSpacingCalculator() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                SesquialteralSpacingCalculator.prototype.calculateSpacing = function (maxTextHeight) {
                    return 3 * maxTextHeight / 2;
                };
                SesquialteralSpacingCalculator.prototype.calculateSpacingInlineObjectCase = function (maxTextHeight, rowTextSpacing, maxPictureHeight, maxDescent) {
                    return maxPictureHeight + maxDescent + (rowTextSpacing - maxTextHeight);
                };
                return SesquialteralSpacingCalculator;
            }(LineSpacingCalculator));
            Row.SesquialteralSpacingCalculator = SesquialteralSpacingCalculator;
            var ExactlySpacingCalculator = (function (_super) {
                __extends(ExactlySpacingCalculator, _super);
                function ExactlySpacingCalculator(lineSpacing) {
                    var _this = _super.call(this) || this;
                    _this.lineSpacing = lineSpacing;
                    return _this;
                }
                ExactlySpacingCalculator.prototype.calculateSpacing = function (_maxTextHeight) {
                    throw new Error(__aspxRichEdit.Errors.NotImplemented);
                };
                ExactlySpacingCalculator.prototype.calculateSpacingInlineObjectCase = function (_maxTextHeight, _rowTextSpacing, _maxPictureHeight, _maxDescent) {
                    throw new Error(__aspxRichEdit.Errors.NotImplemented);
                };
                ExactlySpacingCalculator.prototype.calculate = function (_rowHeight, _maxAscent, _maxDescent, _maxPictureHeight) {
                    return this.lineSpacing;
                };
                return ExactlySpacingCalculator;
            }(LineSpacingCalculator));
            Row.ExactlySpacingCalculator = ExactlySpacingCalculator;
            var AtLeastSpacingCalculator = (function (_super) {
                __extends(AtLeastSpacingCalculator, _super);
                function AtLeastSpacingCalculator(lineSpacing) {
                    var _this = _super.call(this) || this;
                    if (lineSpacing <= 0)
                        throw new Error(__aspxRichEdit.Errors.ArgumentException("lineSpacing", lineSpacing));
                    _this.lineSpacing = lineSpacing;
                    return _this;
                }
                AtLeastSpacingCalculator.prototype.calculate = function (rowHeight, maxAscent, maxDescent, maxPictureHeight) {
                    var result = _super.prototype.calculate.call(this, rowHeight, maxAscent, maxDescent, maxPictureHeight);
                    return Math.max(result, this.lineSpacing);
                };
                return AtLeastSpacingCalculator;
            }(SingleSpacingCalculator));
            Row.AtLeastSpacingCalculator = AtLeastSpacingCalculator;
        })(Row = LayoutFormatter.Row || (LayoutFormatter.Row = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Row;
        (function (Row) {
            var TableRowSpacingBeforeApplier = (function () {
                function TableRowSpacingBeforeApplier(lastRow, paragraphs, isFirstRowInCell, isFirstCellInRow, isFirstRowInTable) {
                    this.lastRow = lastRow;
                    this.paragraphs = paragraphs;
                    this.isFirstRowInCell = isFirstRowInCell;
                    this.isFirstCellInRow = isFirstCellInRow;
                    this.isFirstRowInTable = isFirstRowInTable;
                }
                TableRowSpacingBeforeApplier.prototype.apply = function (row, rowParagraphIndex) {
                    row.applySpacingBefore(this.lastRow && !this.lastRow.flags.get(__aspxRichEdit.LayoutRowStateFlags.ParagraphEnd) ? 0 :
                        __aspxRichEdit.LayoutRow.getParagraphSpacingBefore(this.paragraphs[rowParagraphIndex], this.paragraphs[rowParagraphIndex - 1], this.isFirstRowInCell, this.isFirstCellInRow, this.isFirstRowInTable));
                };
                return TableRowSpacingBeforeApplier;
            }());
            Row.TableRowSpacingBeforeApplier = TableRowSpacingBeforeApplier;
            var RowSpacingBeforeApplier = (function () {
                function RowSpacingBeforeApplier(lastRow, paragraphs, isFirstRowOnColumn, lastRowParagraphIndex) {
                    this.lastRow = lastRow;
                    this.paragraphs = paragraphs;
                    this.isFirstRowOnColumn = isFirstRowOnColumn;
                    this.lastRowParagraphIndex = lastRowParagraphIndex;
                }
                RowSpacingBeforeApplier.prototype.apply = function (row, rowParagraphIndex) {
                    if (!this.lastRow || this.lastRow.flags.get(__aspxRichEdit.LayoutRowStateFlags.SectionEnd) || (this.lastRow.tableCellInfo && !this.isFirstRowOnColumn)) {
                        row.applySpacingBefore(__aspxRichEdit.LayoutRow.getParagraphSpacingBefore(this.paragraphs[rowParagraphIndex], null, false, false, false));
                    }
                    else if (rowParagraphIndex == this.lastRowParagraphIndex || this.isFirstRowOnColumn) {
                        row.applySpacingBefore(0);
                    }
                    else
                        row.applySpacingBefore(__aspxRichEdit.LayoutRow.getParagraphSpacingBefore(this.paragraphs[rowParagraphIndex], this.paragraphs[rowParagraphIndex - 1], false, false, false));
                };
                return RowSpacingBeforeApplier;
            }());
            Row.RowSpacingBeforeApplier = RowSpacingBeforeApplier;
        })(Row = LayoutFormatter.Row || (LayoutFormatter.Row = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var TableBorderInfoProvider = (function () {
                function TableBorderInfoProvider(model, table, converter) {
                    this.cellSpacings = __aspxRichEdit.ListUtils.map(table.rows, function (row) { return new __aspxRichEdit.TableRowPropertiesMergerCellSpacing(model, table, row.tablePropertiesException)
                        .getProperty(row.properties, table.style, row.conditionalFormatting, model.defaultTableRowProperties)
                        .asNumberNoPercentType(converter); });
                    this.leftBorder = new __aspxRichEdit.TablePropertiesMergerBorderLeft().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, model.defaultTableProperties);
                    this.rightBorder = new __aspxRichEdit.TablePropertiesMergerBorderRight().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, model.defaultTableProperties);
                    this.bottomBorder = new __aspxRichEdit.TablePropertiesMergerBorderBottom().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, model.defaultTableProperties);
                    this.topBorder = new __aspxRichEdit.TablePropertiesMergerBorderTop().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, model.defaultTableProperties);
                    this.horizontalBorder = new __aspxRichEdit.TablePropertiesMergerBorderHorizontal().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, model.defaultTableProperties);
                    this.verticalBorder = new __aspxRichEdit.TablePropertiesMergerBorderVertical().getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, model.defaultTableProperties);
                    this.leftBorder = TableBorderInfoProvider.borderConvertToPixels(this.leftBorder, converter);
                    this.rightBorder = TableBorderInfoProvider.borderConvertToPixels(this.rightBorder, converter);
                    this.topBorder = TableBorderInfoProvider.borderConvertToPixels(this.topBorder, converter);
                    this.bottomBorder = TableBorderInfoProvider.borderConvertToPixels(this.bottomBorder, converter);
                    this.horizontalBorder = TableBorderInfoProvider.borderConvertToPixels(this.horizontalBorder, converter);
                    this.verticalBorder = TableBorderInfoProvider.borderConvertToPixels(this.verticalBorder, converter);
                }
                TableBorderInfoProvider.borderConvertToPixels = function (brdInfo, converter) {
                    if (!brdInfo)
                        return null;
                    var newBrd = brdInfo.clone();
                    newBrd.width = converter(newBrd.width);
                    return newBrd;
                };
                return TableBorderInfoProvider;
            }());
            Table.TableBorderInfoProvider = TableBorderInfoProvider;
            var BorderHelper = (function () {
                function BorderHelper(tableInfo, model) {
                    this.colorProvider = model.colorProvider;
                    this.tableInfo = tableInfo;
                    this.tblbrdProvider = new TableBorderInfoProvider(model, tableInfo.table, __aspxRichEdit.UnitConverter.twipsToPixels);
                }
                BorderHelper.prototype.rowCellSpacing = function (rowIndex) {
                    return this.tblbrdProvider.cellSpacings[rowIndex];
                };
                Object.defineProperty(BorderHelper.prototype, "borderHorizontal", {
                    get: function () {
                        return this.tblbrdProvider.horizontalBorder;
                    },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(BorderHelper.prototype, "grid", {
                    get: function () { return this.tableInfo.grid; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(BorderHelper.prototype, "tblStyle", {
                    get: function () { return this.tableInfo.table.style; },
                    enumerable: true,
                    configurable: true
                });
                BorderHelper.prototype.getVerticalBorders = function () {
                    var _this = this;
                    var verticalBorders = [];
                    var rows = this.grid.table.rows;
                    var tblInfos = this.grid.tableCellInfos;
                    for (var rowIndex = 0, row; row = rows[rowIndex]; rowIndex++) {
                        var cellSpacing = this.rowCellSpacing(rowIndex);
                        var rowBorders = [];
                        var lastRowCellIndex = row.cells.length - 1;
                        var cells = row.cells;
                        verticalBorders.push(rowBorders);
                        for (var cellIndex = 0, cell; cell = cells[cellIndex]; cellIndex++) {
                            var cellBorders = [];
                            rowBorders.push(cellBorders);
                            var cellInfo = tblInfos[rowIndex][cellIndex];
                            var cellForBorders = cellInfo.getStartRowIndex() != rowIndex ? rows[cellInfo.getStartRowIndex()].cells[cellInfo.getCellIndex(0)] : cell;
                            if (cellSpacing > 0) {
                                if (cellIndex == 0) {
                                    cellBorders.push(this.mergeVerticalBorders(null, null, null, null, true, this.tblbrdProvider.leftBorder, function (borderWidth) {
                                        return Math.floor(_this.grid.columns.positions[cellInfo.getGridCellIndex()] - borderWidth / 2);
                                    }));
                                    cellBorders.push(this.mergeVerticalBorders(cellForBorders, __aspxRichEdit.TableCellPropertiesMergerBorderLeft, null, null, false, this.tblbrdProvider.leftBorder, function (_borderWidth) {
                                        return Math.floor(_this.grid.columns.positions[cellInfo.getGridCellIndex()] + cellSpacing * 2);
                                    }));
                                }
                                else
                                    cellBorders.push(this.mergeVerticalBorders(cellForBorders, __aspxRichEdit.TableCellPropertiesMergerBorderLeft, null, null, false, this.tblbrdProvider.verticalBorder, function (_borderWidth) {
                                        return Math.floor(_this.grid.columns.positions[cellInfo.getGridCellIndex()] + cellSpacing);
                                    }));
                                cellBorders.push(this.mergeVerticalBorders(cellForBorders, __aspxRichEdit.TableCellPropertiesMergerBorderRight, null, null, false, this.tblbrdProvider.verticalBorder, function (borderWidth) {
                                    return Math.floor(_this.grid.columns.positions[cellInfo.getGridCellIndex() + cell.columnSpan] - cellSpacing * (cellIndex == cells.length - 1 ? 2 : 1) - borderWidth);
                                }));
                                if (cellIndex == lastRowCellIndex)
                                    cellBorders.push(this.mergeVerticalBorders(null, null, null, null, true, this.tblbrdProvider.rightBorder, function (borderWidth) {
                                        return Math.floor(_this.getCellEndGridPosition(rowIndex, cellIndex) - borderWidth / 2);
                                    }));
                            }
                            else {
                                if (cellIndex == 0)
                                    cellBorders.push(this.mergeVerticalBorders(cellForBorders, __aspxRichEdit.TableCellPropertiesMergerBorderLeft, null, null, true, this.tblbrdProvider.leftBorder, function (borderWidth) {
                                        return Math.floor(_this.grid.columns.positions[cellInfo.getGridCellIndex()] - borderWidth / 2);
                                    }));
                                else {
                                    var leftCell = cells[cellIndex - 1];
                                    var leftCellForBorders = void 0;
                                    if (leftCell.verticalMerging != __aspxRichEdit.TableCellMergingState.Continue)
                                        leftCellForBorders = leftCell;
                                    else {
                                        var leftCellInfo = tblInfos[rowIndex][cellIndex - 1];
                                        leftCellForBorders = rows[leftCellInfo.getStartRowIndex()].cells[leftCellInfo.getCellIndex(0)];
                                    }
                                    cellBorders.push(this.mergeVerticalBorders(cellForBorders, __aspxRichEdit.TableCellPropertiesMergerBorderLeft, leftCellForBorders, __aspxRichEdit.TableCellPropertiesMergerBorderRight, false, this.tblbrdProvider.verticalBorder, function (_borderWidth) {
                                        return Math.floor(_this.grid.columns.positions[cellInfo.getGridCellIndex()]);
                                    }));
                                }
                                if (cellIndex == lastRowCellIndex)
                                    cellBorders.push(this.mergeVerticalBorders(cellForBorders, __aspxRichEdit.TableCellPropertiesMergerBorderRight, null, null, true, this.tblbrdProvider.rightBorder, function (borderWidth) {
                                        return Math.floor(_this.getCellEndGridPosition(rowIndex, cellIndex) - borderWidth / 2);
                                    }));
                            }
                        }
                    }
                    return verticalBorders;
                };
                BorderHelper.prototype.getVerticalCursorBorders = function () {
                    var verticalBorders = [];
                    var rows = this.grid.table.rows;
                    var tblInfos = this.grid.tableCellInfos;
                    for (var rowIndex = 0, row; row = rows[rowIndex]; rowIndex++) {
                        var rowBorders = [];
                        var lastRowCellIndex = row.cells.length - 1;
                        verticalBorders.push(rowBorders);
                        for (var cellIndex = 0; cellIndex < row.cells.length; cellIndex++) {
                            var cellBorders = [];
                            rowBorders.push(cellBorders);
                            if (this.rowCellSpacing(rowIndex) > 0)
                                this.populateVerticalCursorBordersWithSpacing(cellIndex, rowIndex, lastRowCellIndex, this.rowCellSpacing(rowIndex), cellBorders, tblInfos[rowIndex][cellIndex]);
                            else
                                this.populateVerticalCursorBorders(cellIndex, rowIndex, lastRowCellIndex, cellBorders, tblInfos[rowIndex][cellIndex]);
                        }
                    }
                    return verticalBorders;
                };
                BorderHelper.prototype.populateVerticalCursorBordersWithSpacing = function (cellIndex, rowIndex, lastRowCellIndex, cellSpacing, cellBorders, cellInfo) {
                    if (cellIndex == 0)
                        cellBorders.push(this.createVerticalCursorBorder(this.grid.columns.positions[cellInfo.getGridCellIndex()]));
                    else
                        cellBorders.push(this.createVerticalCursorBorder(this.grid.columns.positions[cellInfo.getGridCellIndex()], cellSpacing));
                    if (cellIndex == lastRowCellIndex)
                        cellBorders.push(this.createVerticalCursorBorder(this.grid.columns.positions[this.getCellGridColumnIndex(rowIndex, cellIndex)]));
                };
                BorderHelper.prototype.populateVerticalCursorBorders = function (cellIndex, rowIndex, lastRowCellIndex, cellBorders, cellInfo) {
                    if (cellIndex == 0)
                        cellBorders.push(this.createVerticalCursorBorder(this.grid.columns.positions[cellInfo.getGridCellIndex()]));
                    else
                        cellBorders.push(this.createVerticalCursorBorder(this.grid.columns.positions[cellInfo.getGridCellIndex()]));
                    if (cellIndex == lastRowCellIndex)
                        cellBorders.push(this.createVerticalCursorBorder(this.grid.columns.positions[this.getCellGridColumnIndex(rowIndex, cellIndex)]));
                };
                BorderHelper.prototype.getCellGridColumnIndex = function (rowIndex, cellIndex) {
                    var cellGridStartPos = this.grid.tableCellInfos[rowIndex][cellIndex].getGridCellIndex();
                    var cellGridColumnEndIndex = cellGridStartPos + this.grid.table.rows[rowIndex].cells[cellIndex].columnSpan;
                    return cellGridColumnEndIndex;
                };
                BorderHelper.prototype.createVerticalCursorBorder = function (modelXPos, cellSpacing) {
                    if (cellSpacing === void 0) { cellSpacing = -1; }
                    var DEFAULT_CURSOR_BORDER_WIDTH = 4;
                    var size = cellSpacing != -1 ? cellSpacing : DEFAULT_CURSOR_BORDER_WIDTH;
                    return new Table.LayoutCursorVerticalTableBorder(Math.floor(modelXPos - size / 2), 0, 0, new __aspxRichEdit.BorderInfo().getLayoutBorder(this.colorProvider));
                };
                BorderHelper.prototype.mergeVerticalBorders = function (cellA, mergerCellA, cellB, mergerCellB, isOutsideCellBorders, tableBorderInfo, getX) {
                    var brd = BorderHelper.mergeThreeBorders(this.colorProvider, cellA, mergerCellA, cellB, mergerCellB, isOutsideCellBorders, tableBorderInfo, this.tblStyle, __aspxRichEdit.UnitConverter.twipsToPixels);
                    var tableVerticalBorder = new Table.LayoutTableBorder(0, 0, 0, brd ? brd.getLayoutBorder(this.colorProvider) : null);
                    if (tableVerticalBorder.borderInfo)
                        tableVerticalBorder.xPos = getX(tableVerticalBorder.borderInfo.width);
                    return tableVerticalBorder;
                };
                BorderHelper.prototype.getHorizontalBordersByRow = function (rowIndex, isRowFirstInLayoutColumn, isRowLastInLayoutColumn) {
                    var linesInRow = [];
                    if (this.rowCellSpacing(rowIndex) > 0) {
                        if (isRowFirstInLayoutColumn || rowIndex == 0)
                            linesInRow.push(this.collectTableHorizontalBorders(this.tblbrdProvider.topBorder, rowIndex));
                        linesInRow.push(this.collectOneCellAndTableHorizontalBorders(rowIndex, __aspxRichEdit.TableCellPropertiesMergerBorderTop, rowIndex - 1, this.tblbrdProvider.horizontalBorder, !isRowFirstInLayoutColumn));
                        linesInRow.push(this.collectOneCellAndTableHorizontalBorders(rowIndex, __aspxRichEdit.TableCellPropertiesMergerBorderBottom, rowIndex + 1, this.tblbrdProvider.horizontalBorder, !isRowLastInLayoutColumn));
                        if (isRowLastInLayoutColumn)
                            linesInRow.push(this.collectTableHorizontalBorders(this.tblbrdProvider.bottomBorder, rowIndex));
                    }
                    else {
                        if (isRowFirstInLayoutColumn || rowIndex == 0)
                            linesInRow.push(this.collectOneCellAndTableHorizontalBorders(rowIndex, __aspxRichEdit.TableCellPropertiesMergerBorderTop, rowIndex - 1, this.tblbrdProvider.topBorder, false));
                        else
                            linesInRow.push(this.collectThreeBorders(rowIndex, __aspxRichEdit.TableCellPropertiesMergerBorderTop, __aspxRichEdit.TableCellPropertiesMergerBorderBottom, this.tblbrdProvider.horizontalBorder));
                        if (isRowLastInLayoutColumn)
                            linesInRow.push(this.collectOneCellAndTableHorizontalBorders(rowIndex, __aspxRichEdit.TableCellPropertiesMergerBorderBottom, rowIndex + 1, this.tblbrdProvider.bottomBorder, false));
                    }
                    return linesInRow;
                };
                BorderHelper.prototype.collectTableHorizontalBorders = function (tableBorderInfo, rowIndex) {
                    var cells = this.grid.table.rows[rowIndex].cells;
                    var lastCellIndex = cells.length - 1;
                    var lastCell = cells[lastCellIndex];
                    var firstCellGridInfo = this.grid.tableCellInfos[rowIndex][0];
                    var lastCellGridInfo = this.grid.tableCellInfos[rowIndex][lastCellIndex];
                    var horizBorder = new Table.LayoutTableHorizontalBorder();
                    horizBorder.borderInfo = tableBorderInfo.getLayoutBorder(this.colorProvider);
                    horizBorder.xPosition = Math.floor(this.grid.columns.positions[firstCellGridInfo.getGridCellIndex()]);
                    horizBorder.length = Math.ceil(this.grid.columns.positions[lastCellGridInfo.getGridCellIndex() + lastCell.columnSpan]) - horizBorder.xPosition;
                    var horizBordersInfo = new Table.HorizontalLineBordersInfo(true);
                    horizBordersInfo.borders.push(horizBorder);
                    horizBordersInfo.updateWidth(tableBorderInfo ? tableBorderInfo.width : 0);
                    return horizBordersInfo;
                };
                BorderHelper.prototype.collectOneCellAndTableHorizontalBorders = function (cellBorderRowIndex, getCurrCellBorderMerger, tableBorderRowIndex, tableBorderInfo, isTableBorderRowIndexValid) {
                    var rows = this.grid.table.rows;
                    var cells = rows[cellBorderRowIndex].cells;
                    var rowCellSpacing = this.rowCellSpacing(cellBorderRowIndex);
                    var horizBordersInfo = new Table.HorizontalLineBordersInfo(true);
                    for (var cellIndex = 0, cell = void 0; cell = cells[cellIndex]; cellIndex++) {
                        var currCellGridTableInfo = this.grid.tableCellInfos[cellBorderRowIndex][cellIndex];
                        var currCellGridStartIndex = currCellGridTableInfo.getGridCellIndex();
                        var tableCellGridTableInfo = isTableBorderRowIndexValid ?
                            this.grid.tableCellGridInfos[tableBorderRowIndex][currCellGridStartIndex] :
                            null;
                        if (currCellGridTableInfo == tableCellGridTableInfo)
                            continue;
                        var currCellXPosition = Math.floor(this.grid.columns.positions[currCellGridStartIndex] + rowCellSpacing * (cellIndex == 0 ? 2 : 1));
                        var currCellEndGridColumn = Math.ceil(this.grid.columns.positions[currCellGridStartIndex + cell.columnSpan] - rowCellSpacing * (cellIndex == cells.length - 1 ? 2 : 1));
                        var currCellBorder = getCurrCellBorderMerger ?
                            TableBorderInfoProvider.borderConvertToPixels((new getCurrCellBorderMerger(cell.parentRow.tablePropertiesException, !isTableBorderRowIndexValid))
                                .getProperty(cell.properties, this.tblStyle, cell.conditionalFormatting, null), __aspxRichEdit.UnitConverter.twipsToPixels) :
                            null;
                        var horizBorder = new Table.LayoutTableHorizontalBorder();
                        horizBorder.xPosition = currCellXPosition;
                        horizBorder.length = currCellEndGridColumn - currCellXPosition;
                        var brd = (currCellBorder ? currCellBorder : tableBorderInfo);
                        horizBorder.borderInfo = brd ? brd.getLayoutBorder(this.colorProvider) : null;
                        horizBordersInfo.borders.push(horizBorder);
                        horizBordersInfo.updateWidth(horizBorder.borderInfo ? horizBorder.borderInfo.width : 0);
                    }
                    return horizBordersInfo;
                };
                BorderHelper.prototype.collectThreeBorders = function (rowIndex, getCurrCellBorderMerger, getTopCellBorderMerger, tableBorderInfo) {
                    var horizBordersInfo = new Table.HorizontalLineBordersInfo(true);
                    var gridColumnsNum = this.grid.columns.numColumns;
                    var prevRowIndex = rowIndex - 1;
                    var gridInfosPrevRow = this.grid.tableCellGridInfos[prevRowIndex];
                    var gridInfosCurrRow = this.grid.tableCellGridInfos[rowIndex];
                    var prevRowCells = this.grid.table.rows[prevRowIndex].cells;
                    var currRowCells = this.grid.table.rows[rowIndex].cells;
                    for (var cellGridIndex = 0; cellGridIndex < gridColumnsNum; cellGridIndex++) {
                        var prevCellInfo = gridInfosPrevRow[cellGridIndex];
                        var currCellInfo = gridInfosCurrRow[cellGridIndex];
                        if (!prevCellInfo && !currCellInfo ||
                            prevCellInfo && prevRowIndex != prevCellInfo.getStartRowIndex() + prevCellInfo.getNumRowsInCell() - 1)
                            continue;
                        var prevCell = prevCellInfo ? prevRowCells[prevCellInfo.getCellIndex(prevRowIndex - prevCellInfo.getStartRowIndex())] : null;
                        var currCell = currCellInfo ? currRowCells[currCellInfo.getCellIndex(rowIndex - currCellInfo.getStartRowIndex())] : null;
                        var horizBorder = new Table.LayoutTableHorizontalBorder();
                        horizBorder.xPosition = Math.floor(this.grid.columns.positions[cellGridIndex]);
                        horizBorder.length = Math.ceil(this.grid.columns.width[cellGridIndex]);
                        var brd = BorderHelper.mergeThreeBorders(this.colorProvider, currCell, getCurrCellBorderMerger, prevCell, getTopCellBorderMerger, false, tableBorderInfo, this.tblStyle, __aspxRichEdit.UnitConverter.twipsToPixels);
                        horizBorder.borderInfo = brd ? brd.getLayoutBorder(this.colorProvider) : null;
                        horizBordersInfo.updateWidth(horizBorder.borderInfo ? horizBorder.borderInfo.width : 0);
                        horizBordersInfo.borders.push(horizBorder);
                    }
                    return horizBordersInfo;
                };
                BorderHelper.prototype.getCellEndGridPosition = function (rowIndex, cellIndex) {
                    var cellGridStartPos = this.grid.tableCellInfos[rowIndex][cellIndex].getGridCellIndex();
                    var cellGridColumnEndIndex = cellGridStartPos + this.grid.table.rows[rowIndex].cells[cellIndex].columnSpan;
                    return Math.ceil(this.grid.columns.positions[cellGridColumnEndIndex]);
                };
                BorderHelper.mergeThreeBorders = function (colorProvider, cellA, mergerCellA, cellB, mergerCellB, isOutsideCellBorders, tableBorderInfo, tblStyle, converter) {
                    var tblBrd;
                    if (cellA && cellB) {
                        tblBrd = __aspxRichEdit.TableBorderCalculator.getPowerfulBorder(colorProvider, TableBorderInfoProvider.borderConvertToPixels((new mergerCellA(cellA.parentRow.tablePropertiesException, isOutsideCellBorders))
                            .getProperty(cellA.properties, tblStyle, cellA.conditionalFormatting, null), converter), TableBorderInfoProvider.borderConvertToPixels((new mergerCellB(cellB.parentRow.tablePropertiesException, isOutsideCellBorders))
                            .getProperty(cellB.properties, tblStyle, cellB.conditionalFormatting, null), converter));
                    }
                    else {
                        var cell = cellA || cellB;
                        if (cell)
                            tblBrd = TableBorderInfoProvider.borderConvertToPixels((new (mergerCellA || mergerCellB)(cell.parentRow.tablePropertiesException, isOutsideCellBorders))
                                .getProperty(cell.properties, tblStyle, cell.conditionalFormatting, null), converter);
                    }
                    if (!tblBrd)
                        tblBrd = tableBorderInfo;
                    return tblBrd;
                };
                BorderHelper.getLeftBorder = function (colorProvider, pos, siblingCell, tblBrdProv, converter) {
                    return BorderHelper.getRightLeftBorder(colorProvider, pos, siblingCell, tblBrdProv, converter, pos.cellIndex == 0, __aspxRichEdit.TableCellPropertiesMergerBorderLeft, __aspxRichEdit.TableCellPropertiesMergerBorderRight);
                };
                BorderHelper.getRightBorder = function (colorProvider, pos, siblingCell, tblBrdProv, converter) {
                    return BorderHelper.getRightLeftBorder(colorProvider, pos, siblingCell, tblBrdProv, converter, pos.cellIndex == pos.row.cells.length - 1, __aspxRichEdit.TableCellPropertiesMergerBorderRight, __aspxRichEdit.TableCellPropertiesMergerBorderLeft);
                };
                BorderHelper.getRightLeftBorder = function (colorProvider, pos, siblingCell, tblBrdProv, converter, isOutsideBorder, currentMerger, siblingMerger) {
                    var tableStyle = pos.table.style;
                    return tblBrdProv.cellSpacings[pos.rowIndex] > 0 ?
                        LayoutFormatter.Table.BorderHelper.mergeThreeBorders(colorProvider, pos.cell, currentMerger, null, null, isOutsideBorder, isOutsideBorder ? tblBrdProv.leftBorder : tblBrdProv.verticalBorder, tableStyle, converter) :
                        (isOutsideBorder ?
                            LayoutFormatter.Table.BorderHelper.mergeThreeBorders(colorProvider, pos.cell, currentMerger, null, null, isOutsideBorder, tblBrdProv.leftBorder, tableStyle, converter) :
                            LayoutFormatter.Table.BorderHelper.mergeThreeBorders(colorProvider, pos.cell, currentMerger, siblingCell, siblingMerger, isOutsideBorder, tblBrdProv.verticalBorder, tableStyle, converter));
                };
                return BorderHelper;
            }());
            Table.BorderHelper = BorderHelper;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var BorderMerger = (function () {
                function BorderMerger() {
                }
                BorderMerger.getFinalReducedVerticalBorders = function (vertBorders) {
                    var resultBorders = [];
                    var allVerticalBorders = [];
                    for (var _i = 0, vertBorders_1 = vertBorders; _i < vertBorders_1.length; _i++) {
                        var rowBorders = vertBorders_1[_i];
                        for (var _a = 0, rowBorders_1 = rowBorders; _a < rowBorders_1.length; _a++) {
                            var cellBorders = rowBorders_1[_a];
                            for (var _b = 0, cellBorders_1 = cellBorders; _b < cellBorders_1.length; _b++) {
                                var border = cellBorders_1[_b];
                                allVerticalBorders.push(border);
                            }
                        }
                    }
                    allVerticalBorders.sort(function (a, b) {
                        var xPosDiff = a.xPos - b.xPos;
                        if (Math.abs(xPosDiff) > 1)
                            return xPosDiff;
                        var yPosDiff = a.yPos - b.yPos;
                        if (yPosDiff != 0)
                            return yPosDiff;
                        return 0;
                    });
                    var prevBorder = allVerticalBorders[0];
                    resultBorders.push(prevBorder);
                    for (var brdIndex = 1, border = void 0; border = allVerticalBorders[brdIndex]; brdIndex++) {
                        if (prevBorder.canCombineVertical(border))
                            prevBorder.length = border.yPos + border.length - prevBorder.yPos;
                        else {
                            prevBorder = border;
                            resultBorders.push(prevBorder);
                        }
                    }
                    return resultBorders;
                };
                BorderMerger.getFinalReducedHorizontalBorders = function (horBorders) {
                    var resultBorders = [];
                    for (var _i = 0, horBorders_1 = horBorders; _i < horBorders_1.length; _i++) {
                        var horLines = horBorders_1[_i];
                        for (var _a = 0, horLines_1 = horLines; _a < horLines_1.length; _a++) {
                            var line = horLines_1[_a];
                            var borders = line.borders;
                            var prevBorder = borders[0].getLayoutTableBorder(line);
                            resultBorders.push(prevBorder);
                            for (var brdIndex = 1, border = void 0; border = borders[brdIndex]; brdIndex++) {
                                if (Math.abs(prevBorder.xPos + prevBorder.length - border.xPosition) < 2 && prevBorder.borderInfo.equals(border.borderInfo))
                                    prevBorder.length = border.xPosition + border.length - prevBorder.xPos;
                                else {
                                    prevBorder = border.getLayoutTableBorder(line);
                                    resultBorders.push(prevBorder);
                                }
                            }
                        }
                    }
                    return resultBorders;
                };
                return BorderMerger;
            }());
            Table.BorderMerger = BorderMerger;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var BorderCreator = (function () {
                function BorderCreator() {
                }
                BorderCreator.setColumnHorizontalBorders = function (currTableColumnInfo, rowInfo, currColumnHorizontalBorders, isThisColumnFirstInTable) {
                    var tblRows = currTableColumnInfo.tableRows;
                    var columnInfoYOffset = currTableColumnInfo.y;
                    for (var tblRowIndex = 0, tblRow = void 0; tblRow = tblRows[tblRowIndex]; tblRowIndex++) {
                        var isThisRowFirstInColumn = tblRowIndex == 0;
                        var isThisRowLastInColumn = tblRowIndex == tblRows.length - 1;
                        var rowCellSpacing = rowInfo[tblRow.rowIndex].cellSpacing;
                        var rowBrd = currColumnHorizontalBorders[tblRowIndex];
                        if (rowCellSpacing > 0) {
                            var endIndex = void 0;
                            if (isThisRowFirstInColumn) {
                                rowBrd[0].yPosition = tblRow.y;
                                rowBrd[0].isOffsetFromTop = true;
                                rowBrd[1].yPosition = rowBrd[0].yPosition + rowBrd[0].maxWidth + rowCellSpacing * (isThisColumnFirstInTable ? 2 : 1) + rowBrd[1].maxWidth;
                                rowBrd[1].isOffsetFromTop = false;
                                endIndex = 3;
                            }
                            else {
                                rowBrd[0].yPosition = tblRow.y + rowCellSpacing + rowBrd[0].maxWidth;
                                rowBrd[0].isOffsetFromTop = false;
                                endIndex = 2;
                            }
                            if (isThisRowLastInColumn) {
                                rowBrd[endIndex].yPosition = tblRow.getBottomBoundPosition() - rowBrd[endIndex].maxWidth;
                                rowBrd[endIndex].isOffsetFromTop = true;
                                rowBrd[endIndex - 1].yPosition = rowBrd[endIndex].yPosition - rowCellSpacing * 2 - rowBrd[endIndex - 1].maxWidth;
                                rowBrd[endIndex - 1].isOffsetFromTop = true;
                            }
                            else {
                                rowBrd[endIndex - 1].yPosition = tblRow.getBottomBoundPosition() - rowCellSpacing - rowBrd[endIndex - 1].maxWidth;
                                rowBrd[endIndex - 1].isOffsetFromTop = true;
                            }
                        }
                        else {
                            rowBrd[0].yPosition = tblRow.y;
                            rowBrd[0].isOffsetFromTop = true;
                            if (isThisRowLastInColumn) {
                                rowBrd[1].yPosition = tblRow.getBottomBoundPosition() - rowBrd[1].maxWidth;
                                rowBrd[1].isOffsetFromTop = true;
                            }
                        }
                        for (var _i = 0, rowBrd_1 = rowBrd; _i < rowBrd_1.length; _i++) {
                            var brd = rowBrd_1[_i];
                            brd.yPosition -= columnInfoYOffset;
                        }
                    }
                };
                BorderCreator.setColumnVerticalBorders = function (currTableColumnInfo, grid, rowInfo, isThisColumnFirstInTable, currColumnHorizontalBorders, newVerticalBorders, verticalBorders, considerSpacing) {
                    var tblRows = currTableColumnInfo.tableRows;
                    var rows = grid.table.rows;
                    for (var tblRowIndex = 0, tblRow = void 0; tblRow = tblRows[tblRowIndex]; tblRowIndex++) {
                        var isRowFirstInColumn = tblRowIndex == 0;
                        var isRowLastInColumn = tblRowIndex == tblRows.length - 1;
                        var horRowBorders = currColumnHorizontalBorders[tblRowIndex];
                        var nextHorRowBorders = currColumnHorizontalBorders[tblRowIndex + 1];
                        var lastHorBorderLineIndex = horRowBorders.length - 1;
                        var rowBorders = [];
                        newVerticalBorders.push(rowBorders);
                        var rowIndex = tblRow.rowIndex;
                        var cells = rows[rowIndex].cells;
                        var rowCellSpacing = considerSpacing ? rowInfo[rowIndex].cellSpacing : 0;
                        for (var cellIndex = 0; cellIndex < cells.length; cellIndex++) {
                            var isFirstCellInRow = cellIndex == 0;
                            var isLastCellInRow = cellIndex == cells.length - 1;
                            var cellGridInfo = grid.tableCellInfos[rowIndex][cellIndex];
                            var isThisCellMergedByTop = !isRowFirstInColumn && cellGridInfo.getStartRowIndex() != rowIndex;
                            var isThisCellMergedByBottom = !isRowLastInColumn && cellGridInfo.getStartRowIndex() + cellGridInfo.getNumRowsInCell() - 1 != rowIndex;
                            var cellBorders = [];
                            rowBorders.push(cellBorders);
                            for (var _i = 0, _a = verticalBorders[rowIndex][cellIndex]; _i < _a.length; _i++) {
                                var brd = _a[_i];
                                cellBorders.push(brd.clone());
                            }
                            var topCellBordersLine = void 0;
                            var bottomCellBordersLine = void 0;
                            if (rowCellSpacing > 0) {
                                topCellBordersLine = horRowBorders[isRowFirstInColumn ? 1 : 0];
                                bottomCellBordersLine = horRowBorders[lastHorBorderLineIndex - (isRowLastInColumn ? 1 : 0)];
                            }
                            else {
                                topCellBordersLine = horRowBorders[0];
                                bottomCellBordersLine = isRowLastInColumn ? horRowBorders[lastHorBorderLineIndex] : nextHorRowBorders[0];
                            }
                            var yPos = topCellBordersLine.yPosition + (topCellBordersLine.isOffsetFromTop ? topCellBordersLine.maxWidth : 0);
                            var yEndPos = bottomCellBordersLine.yPosition - (bottomCellBordersLine.isOffsetFromTop ? 0 : bottomCellBordersLine.maxWidth);
                            for (var vertCellBorderIndex = 0, vertCellBorder = void 0; vertCellBorder = cellBorders[vertCellBorderIndex]; vertCellBorderIndex++) {
                                var isFirstBorderInCell = vertCellBorderIndex == 0;
                                var isLastBorderInCell = vertCellBorderIndex == cellBorders.length - 1;
                                var isBoundBorder = isFirstCellInRow && isFirstBorderInCell || isLastBorderInCell && isLastCellInRow;
                                vertCellBorder.yPos = yPos;
                                if (isBoundBorder || isThisCellMergedByTop)
                                    vertCellBorder.yPos -= rowCellSpacing * (isThisColumnFirstInTable && isRowFirstInColumn ? 2 : 1) + topCellBordersLine.maxWidth;
                                vertCellBorder.length = yEndPos - vertCellBorder.yPos;
                                if (isBoundBorder || isThisCellMergedByBottom)
                                    vertCellBorder.length += rowCellSpacing * (isRowLastInColumn ? 2 : 1) + bottomCellBordersLine.maxWidth;
                            }
                        }
                    }
                };
                return BorderCreator;
            }());
            Table.BorderCreator = BorderCreator;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var HorizontalLineBordersInfo = (function () {
                function HorizontalLineBordersInfo(isOffsetFromTop) {
                    this.borders = [];
                    this.maxWidth = 0;
                    this.isOffsetFromTop = isOffsetFromTop;
                }
                HorizontalLineBordersInfo.prototype.updateWidth = function (width) {
                    if (width > this.maxWidth)
                        this.maxWidth = width;
                };
                HorizontalLineBordersInfo.prototype.clone = function () {
                    var result = new HorizontalLineBordersInfo(this.isOffsetFromTop);
                    result.copyFrom(this);
                    return result;
                };
                HorizontalLineBordersInfo.prototype.copyFrom = function (obj) {
                    this.isOffsetFromTop = obj.isOffsetFromTop;
                    this.yPosition = obj.yPosition;
                    this.maxWidth = obj.maxWidth;
                    this.borders = [];
                    for (var _i = 0, _a = this.borders; _i < _a.length; _i++) {
                        var brd = _a[_i];
                        this.borders.push(brd.clone());
                    }
                };
                return HorizontalLineBordersInfo;
            }());
            Table.HorizontalLineBordersInfo = HorizontalLineBordersInfo;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var LayoutTableBorder = (function () {
                function LayoutTableBorder(xPos, yPos, length, borderInfo) {
                    this.xPos = xPos;
                    this.yPos = yPos;
                    this.length = length;
                    this.borderInfo = borderInfo;
                }
                LayoutTableBorder.prototype.clone = function () {
                    return new LayoutTableBorder(this.xPos, this.yPos, this.length, this.borderInfo.clone());
                };
                LayoutTableBorder.prototype.copyFrom = function (obj) {
                    this.xPos = obj.xPos;
                    this.yPos = obj.yPos;
                    this.length = obj.length;
                    this.borderInfo = obj.borderInfo.clone();
                };
                LayoutTableBorder.prototype.canCombineVertical = function (border) {
                    return Math.abs(this.xPos - border.xPos) < 2 && Math.abs(this.yPos + this.length - border.yPos) < 2 && this.borderInfo.equals(border.borderInfo);
                };
                return LayoutTableBorder;
            }());
            Table.LayoutTableBorder = LayoutTableBorder;
            var LayoutCursorHorizontalTableBorder = (function (_super) {
                __extends(LayoutCursorHorizontalTableBorder, _super);
                function LayoutCursorHorizontalTableBorder(xPos, yPos, length, borderInfo, layoutRowIndex) {
                    var _this = _super.call(this, xPos, yPos, length, borderInfo) || this;
                    _this.layoutRowIndex = layoutRowIndex;
                    return _this;
                }
                LayoutCursorHorizontalTableBorder.prototype.clone = function () {
                    return new LayoutCursorHorizontalTableBorder(this.xPos, this.yPos, this.length, this.borderInfo.clone(), this.layoutRowIndex);
                };
                LayoutCursorHorizontalTableBorder.prototype.copyFrom = function (obj) {
                    _super.prototype.copyFrom.call(this, obj);
                    this.layoutRowIndex = obj.layoutRowIndex;
                };
                LayoutCursorHorizontalTableBorder.prototype.canCombine = function (border) {
                    var limitX = Math.abs(this.xPos + this.length - border.xPos);
                    var limitY = Math.abs(this.yPos - border.yPos);
                    return limitX < 3 && limitY < 3 && this.layoutRowIndex == border.layoutRowIndex;
                };
                return LayoutCursorHorizontalTableBorder;
            }(LayoutTableBorder));
            Table.LayoutCursorHorizontalTableBorder = LayoutCursorHorizontalTableBorder;
            var LayoutCursorVerticalTableBorder = (function (_super) {
                __extends(LayoutCursorVerticalTableBorder, _super);
                function LayoutCursorVerticalTableBorder() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                LayoutCursorVerticalTableBorder.prototype.clone = function () {
                    return new LayoutCursorVerticalTableBorder(this.xPos, this.yPos, this.length, this.borderInfo.clone());
                };
                LayoutCursorVerticalTableBorder.prototype.copyFrom = function (obj) {
                    _super.prototype.copyFrom.call(this, obj);
                };
                return LayoutCursorVerticalTableBorder;
            }(LayoutTableBorder));
            Table.LayoutCursorVerticalTableBorder = LayoutCursorVerticalTableBorder;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var LayoutTableHorizontalBorder = (function () {
                function LayoutTableHorizontalBorder() {
                }
                LayoutTableHorizontalBorder.prototype.clone = function () {
                    var result = new LayoutTableHorizontalBorder();
                    result.copyFrom(this);
                    return result;
                };
                LayoutTableHorizontalBorder.prototype.copyFrom = function (obj) {
                    this.length = obj.length;
                    this.xPosition = obj.xPosition;
                    this.borderInfo = obj.borderInfo.clone();
                };
                LayoutTableHorizontalBorder.prototype.getLayoutTableBorder = function (line) {
                    return new Table.LayoutTableBorder(this.xPosition, line.yPosition - (line.isOffsetFromTop ? 0 : this.borderInfo.width), this.length, this.borderInfo);
                };
                return LayoutTableHorizontalBorder;
            }());
            Table.LayoutTableHorizontalBorder = LayoutTableHorizontalBorder;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var CellGridInfoManager = (function () {
                function CellGridInfoManager(table) {
                    this.tableCellGridInfos = [];
                    this.tableCellInfos = [];
                    Grid.fillGridInfo(table, this.tableCellGridInfos, this.tableCellInfos);
                }
                CellGridInfoManager.prototype.gridInfosByTablePosition = function (tblPos) {
                    return this.tableCellInfos[tblPos.rowIndex][tblPos.cellIndex];
                };
                return CellGridInfoManager;
            }());
            Table.CellGridInfoManager = CellGridInfoManager;
            var Grid = (function () {
                function Grid(table) {
                    this.table = table;
                    this.tableCellGridInfos = [];
                    this.tableCellInfos = [];
                    Grid.fillGridInfo(table, this.tableCellGridInfos, this.tableCellInfos);
                }
                Grid.getGrid = function (table, boxIterator, avaliableSpacing) {
                    var subDocument = boxIterator.subDocument;
                    var grid = new Grid(table);
                    var cache = {};
                    cache[table.index] = new Table.TablePropertiesCache(subDocument.documentModel, table, grid);
                    var endPos = table.getEndPosition();
                    for (var i = table.index + 1, innerTable = void 0; (innerTable = subDocument.tables[i]) && innerTable.getStartPosition() < endPos; i++)
                        cache[innerTable.index] = new Table.TablePropertiesCache(subDocument.documentModel, innerTable, new Grid(innerTable));
                    grid.columns = new (cache[table.index].layoutType == __aspxRichEdit.TableLayoutType.Autofit ? Table.GridCalculatorAuto : Table.GridCalculatorFixed)(grid, cache, boxIterator, avaliableSpacing).getColumns();
                    return grid;
                };
                Grid.fillGridInfo = function (table, tableCellGridInfos, tableCellInfos) {
                    var rows = table.rows;
                    for (var rowIndex = 0, row = void 0; row = rows[rowIndex]; rowIndex++) {
                        var tableCellGridInfo = [];
                        var tableCellInfo = [];
                        tableCellGridInfos.push(tableCellGridInfo);
                        tableCellInfos.push(tableCellInfo);
                        var currColSpan = row.gridBefore;
                        for (var spacingIndex = currColSpan; spacingIndex > 0; spacingIndex--)
                            tableCellGridInfo.push(null);
                        for (var cellIndex = 0, cell = void 0; cell = row.cells[cellIndex]; cellIndex++) {
                            var currCellGridInfo = cell.verticalMerging != __aspxRichEdit.TableCellMergingState.Continue ?
                                new Table.CellGridInfo(rowIndex, currColSpan, [cellIndex]) :
                                tableCellGridInfos[rowIndex - 1][currColSpan].addCellIndex(cellIndex);
                            tableCellInfo.push(currCellGridInfo);
                            for (var spacingIndex = cell.columnSpan; spacingIndex > 0; spacingIndex--)
                                tableCellGridInfo.push(currCellGridInfo);
                            currColSpan += cell.columnSpan;
                        }
                    }
                };
                return Grid;
            }());
            Table.Grid = Grid;
            var Columns = (function () {
                function Columns(intervalsInfo) {
                    this.width = __aspxRichEdit.ListUtils.map(intervalsInfo, function (curr) { return curr.width; });
                    this.numColumns = this.width.length;
                    var pos = 0;
                    this.positions = __aspxRichEdit.ListUtils.map(intervalsInfo, function (curr) { return pos += curr.width; });
                    this.positions.unshift(0);
                    if (__aspxRichEdit.ListUtils.anyOf(this.positions, function (p) { return isNaN(p) || p < 0; }))
                        throw new Error(__aspxRichEdit.Errors.InternalException);
                }
                return Columns;
            }());
            Table.Columns = Columns;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var CellGridInfo = (function () {
                function CellGridInfo(rowIndex, gridCellIndex, cellIndexes) {
                    this.rowIndex = rowIndex;
                    this.gridCellIndex = gridCellIndex;
                    this.cellIndexes = cellIndexes;
                }
                Object.defineProperty(CellGridInfo.prototype, "rowIndexesInterval", {
                    get: function () {
                        return new __aspxRichEdit.FixedInterval(this.rowIndex, this.cellIndexes.length);
                    },
                    enumerable: true,
                    configurable: true
                });
                CellGridInfo.prototype.getStartRowIndex = function () {
                    return this.rowIndex;
                };
                CellGridInfo.prototype.getCellIndex = function (rowIndexInCell) {
                    return this.cellIndexes[rowIndexInCell];
                };
                CellGridInfo.prototype.getCellIndexAbs = function (rowIndexInTable) {
                    return this.cellIndexes[rowIndexInTable - this.rowIndex];
                };
                CellGridInfo.prototype.getNumRowsInCell = function () {
                    return this.cellIndexes.length;
                };
                CellGridInfo.prototype.getGridCellIndex = function () {
                    return this.gridCellIndex;
                };
                CellGridInfo.prototype.getGridCellIndexEnd = function (table) {
                    return this.gridCellIndex + this.getColumnSpan(table);
                };
                CellGridInfo.prototype.addCellIndex = function (index) {
                    this.cellIndexes.push(index);
                    return this;
                };
                CellGridInfo.prototype.intersectRow = function (rowIndex) {
                    return rowIndex >= this.rowIndex && rowIndex < this.getEndRowIndex();
                };
                CellGridInfo.prototype.getEndRowIndex = function () {
                    return this.rowIndex + this.cellIndexes.length;
                };
                CellGridInfo.prototype.getLastRowIndex = function () {
                    return this.getEndRowIndex() - 1;
                };
                CellGridInfo.prototype.getColumnSpan = function (table) {
                    return table.rows[this.getStartRowIndex()].cells[this.getCellIndex(0)].columnSpan;
                };
                CellGridInfo.prototype.intersectGridColumn = function (columnIndex, columnSpan) {
                    return columnIndex >= this.gridCellIndex && columnIndex < this.gridCellIndex + columnSpan;
                };
                return CellGridInfo;
            }());
            Table.CellGridInfo = CellGridInfo;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var CellInfo = (function () {
                function CellInfo(cellIndex, rowInfo) {
                    this._isStartOnThisColumn = false;
                    this.cellIndex = cellIndex;
                    this.rowInfo = rowInfo;
                    this.actualCellInfo = this.getActuallCellInfo();
                    this.init();
                }
                CellInfo.prototype.getContentModelPosition = function () {
                    var formatter = this.innerFormatter;
                    return formatter ? formatter.tableInfo.currCellInfo.getContentModelPosition() : this.contentModelPosition;
                };
                Object.defineProperty(CellInfo.prototype, "xContentInterval", {
                    get: function () {
                        return this.actualCellInfo._xContentInterval;
                    },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(CellInfo.prototype, "xInterval", {
                    get: function () {
                        return this.actualCellInfo._xInterval;
                    },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(CellInfo.prototype, "currLayoutRowContentWidth", {
                    get: function () {
                        return this.innerFormatter ?
                            this.innerFormatter.tableInfo.currCellInfo.currLayoutRowContentWidth :
                            this.actualCellInfo.xContentInterval.length;
                    },
                    enumerable: true,
                    configurable: true
                });
                CellInfo.prototype.getCurrLayoutRowOffset = function (considerInnerFormatter) {
                    return (considerInnerFormatter && this.innerFormatter) ?
                        this.innerFormatter.tableInfo.currCellInfo.getCurrLayoutRowOffset(true) :
                        new __aspxRichEdit.Point(this.xContentInterval.start, this.currLayoutTableCellInfo.getBottomBoundPosition());
                };
                Object.defineProperty(CellInfo.prototype, "isSomeLayoutRowsPlaced", {
                    get: function () { return this.cell.startParagraphPosition.value != this.contentModelPosition; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(CellInfo.prototype, "heightBeforeContent", {
                    get: function () { return this.actualCellInfo._heightBeforeContent; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(CellInfo.prototype, "heightAfterContent", {
                    get: function () { return this.actualCellInfo._heightAfterContent; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(CellInfo.prototype, "tableInfo", {
                    get: function () { return this.rowInfo.tableInfo; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(CellInfo.prototype, "cell", {
                    get: function () { return this.rowInfo.row.cells[this.cellIndex]; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(CellInfo.prototype, "isContendFullyPlaced", {
                    get: function () { return this.actualCellInfo._contentModelPosition == this.actualCellInfo.cell.endParagrapPosition.value; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(CellInfo.prototype, "currLayoutTableCellInfo", {
                    get: function () { return this.actualCellInfo._currLayoutTableCellInfo; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(CellInfo.prototype, "contentModelPosition", {
                    get: function () { return this.actualCellInfo._contentModelPosition; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(CellInfo.prototype, "actualTableIndexes", {
                    get: function () {
                        return new __aspxRichEdit.TablePositionIndexes(this.actualCellInfo.rowInfo.rowIndex, this.actualCellInfo.cellIndex);
                    },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(CellInfo.prototype, "minBottomPosition", {
                    get: function () { return this.actualCellInfo._minBottomPosition; },
                    set: function (val) { this.actualCellInfo._minBottomPosition = Math.max(val, this.actualCellInfo._minBottomPosition); },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(CellInfo.prototype, "innerFormatter", {
                    get: function () { return this.actualCellInfo._innerFormatter; },
                    set: function (val) { this.actualCellInfo._innerFormatter = val; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(CellInfo.prototype, "isStartOnThisColumn", {
                    set: function (val) { this.actualCellInfo._isStartOnThisColumn = val; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(CellInfo.prototype, "marginLeft", {
                    get: function () { return this.actualCellInfo._marginLeft; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(CellInfo.prototype, "marginRight", {
                    get: function () { return this.actualCellInfo._marginRight; },
                    enumerable: true,
                    configurable: true
                });
                CellInfo.prototype.getActuallCellInfo = function () {
                    if (this.cell.verticalMerging != __aspxRichEdit.TableCellMergingState.Continue)
                        return this;
                    var cellGridInfo = this.tableInfo.grid.tableCellInfos[this.rowInfo.rowIndex][this.cellIndex];
                    return this.tableInfo.rows[cellGridInfo.getStartRowIndex()].cells[cellGridInfo.getCellIndex(0)];
                };
                CellInfo.prototype.cellFullyFormatted = function () {
                    this.cellPartiallyFormatted(this.actualCellInfo.cell.endParagrapPosition.value);
                };
                CellInfo.prototype.cellPartiallyFormatted = function (endPos) {
                    this.actualCellInfo._contentModelPosition = endPos;
                };
                CellInfo.prototype.undoContentModelPosition = function () {
                    this.actualCellInfo._contentModelPosition = this.actualCellInfo._savedContentModelPosition;
                };
                CellInfo.prototype.storeContentModelPosition = function () {
                    this.actualCellInfo._savedContentModelPosition = this.actualCellInfo._contentModelPosition;
                };
                CellInfo.prototype.init = function () {
                    var cell = this.cell;
                    if (cell.verticalMerging == __aspxRichEdit.TableCellMergingState.Continue) {
                        this._xInterval = null;
                        this._xContentInterval = null;
                        this._heightBeforeContent = null;
                        this._heightAfterContent = null;
                        this._marginLeft = null;
                        this._marginRight = null;
                        this._savedContentModelPosition = this._contentModelPosition = null;
                        return;
                    }
                    var rowIndex = this.rowInfo.rowIndex;
                    var isFirstCellInRow = this.cellIndex == 0;
                    var isLastCellInRow = this.rowInfo.row.cells.length - 1 == this.cellIndex;
                    var cellInfo = this.tableInfo.grid.tableCellInfos[rowIndex][this.cellIndex];
                    var rowCellSpacing = this.rowInfo.cellSpacing;
                    this._marginLeft = Table.Formatter.getCellMargin(this.tableInfo.tableStyle, cell, new __aspxRichEdit.TableCellPropertiesMergerMarginLeft(this.tableInfo.table, this.tableInfo.model, cell.parentRow.tablePropertiesException));
                    this._marginRight = Table.Formatter.getCellMargin(this.tableInfo.tableStyle, cell, new __aspxRichEdit.TableCellPropertiesMergerMarginRight(this.tableInfo.table, this.tableInfo.model, cell.parentRow.tablePropertiesException));
                    var cellStartXPosition = this.tableInfo.xPositionStart +
                        this.tableInfo.grid.columns.positions[cellInfo.getGridCellIndex()];
                    var cellEndXPosition = this.tableInfo.xPositionStart +
                        this.tableInfo.grid.columns.positions[cellInfo.getGridCellIndex() + cell.columnSpan];
                    var verticalBordersCurrCell = this.tableInfo.verticalBorders[rowIndex][this.cellIndex];
                    var brdCellLeft = verticalBordersCurrCell[rowCellSpacing > 0 && isFirstCellInRow ? 1 : 0];
                    var cellStartContentXPosition = Math.max(cellStartXPosition + this._marginLeft +
                        rowCellSpacing * (isFirstCellInRow ? 2 : 1), brdCellLeft.borderInfo ? this.tableInfo.xPositionStart + brdCellLeft.xPos + brdCellLeft.borderInfo.width : -Number.MAX_VALUE);
                    var brdCellRight;
                    if (rowCellSpacing > 0 || isLastCellInRow)
                        brdCellRight = verticalBordersCurrCell[verticalBordersCurrCell.length - (rowCellSpacing > 0 && isLastCellInRow ? 2 : 1)];
                    else
                        brdCellRight = this.tableInfo.verticalBorders[rowIndex][this.cellIndex + 1][0];
                    var cellEndContentXPosition = Math.min(cellEndXPosition -
                        (this._marginRight + rowCellSpacing * (isLastCellInRow ? 2 : 1)), brdCellRight.borderInfo ? this.tableInfo.xPositionStart + brdCellRight.xPos : __aspxRichEdit.Constants.MAX_SAFE_INTEGER);
                    this._xInterval = __aspxRichEdit.FixedInterval.fromPositions(cellStartXPosition, cellEndXPosition);
                    this._xContentInterval = __aspxRichEdit.FixedInterval.fromPositions(cellStartContentXPosition, cellEndContentXPosition);
                    this._savedContentModelPosition = this._contentModelPosition = cell.startParagraphPosition.value;
                };
                CellInfo.prototype.initLayoutInfo = function () {
                    this.actualCellInfo._minBottomPosition = 0;
                    var rowCellSpacing = this.rowInfo.cellSpacing;
                    var horBrdLastIndex = this.tableInfo.currRowHorizontalBorders.length - 1;
                    this.actualCellInfo._heightBeforeContent = this.tableInfo.currRowHorizontalBorders[0].maxWidth +
                        this.rowInfo.topAndBottomMargins.topMargin;
                    this.actualCellInfo._heightAfterContent = this.tableInfo.currRowHorizontalBorders[horBrdLastIndex].maxWidth +
                        this.rowInfo.topAndBottomMargins.bottomMargin;
                    if (rowCellSpacing > 0) {
                        this.actualCellInfo._heightBeforeContent +=
                            rowCellSpacing * (this.tableInfo.isThisColumnFirstInTable ? 2 : 1) +
                                (this.tableInfo.isThisTableRowFirstInColumn ? this.tableInfo.currRowHorizontalBorders[1].maxWidth : 0);
                        this.actualCellInfo._heightAfterContent +=
                            this.tableInfo.currRowHorizontalBorders[horBrdLastIndex - 1].maxWidth +
                                (this.tableInfo.isCurrRowLastInTable ? 2 : 1) * rowCellSpacing;
                    }
                    this.actualCellInfo._currLayoutTableCellInfo = new __aspxRichEdit.LayoutTableCellInfo(this.rowInfo.currLayoutTableRowInfo, new __aspxRichEdit.Rectangle().init(this.xInterval.start, this.tableInfo.currRowInfo.currLayoutTableRowInfo.y, this.xInterval.length, this.actualCellInfo._heightBeforeContent), this.tableInfo.grid.tableCellInfos[this.rowInfo.rowIndex][this.cellIndex].getGridCellIndex(), this.xContentInterval.length);
                    if (this.actualCellInfo._isStartOnThisColumn)
                        this.currLayoutTableCellInfo.boundFlags.set(__aspxRichEdit.TableCellBoundFlags.StartOnThisColumn, false);
                };
                CellInfo.prototype.clearLayoutInfo = function () {
                    this.actualCellInfo._heightAfterContent = null;
                    this.actualCellInfo._heightBeforeContent = null;
                    this.actualCellInfo._currLayoutTableCellInfo = null;
                };
                return CellInfo;
            }());
            Table.CellInfo = CellInfo;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var CellOrderHelper = (function () {
                function CellOrderHelper(tableInfo) {
                    this.tableInfo = tableInfo;
                }
                CellOrderHelper.prototype.getFirstNotFullyRenderedCell = function (startRowIndex) {
                    var _this = this;
                    var pos = __aspxRichEdit.ListUtils.anyOf(this.tableInfo.rows, function (_, rowInd) {
                        return _this.getNextPositionOnRow(rowInd, 0, false, true, function () { return true; });
                    }, startRowIndex);
                    if (__aspxRichEdit.ListUtils.allOf(this.tableInfo.table.rows[startRowIndex].cells, function (_cell, cellIndex) {
                        var cellInfo = _this.tableInfo.rows[startRowIndex].cells[cellIndex];
                        return cellInfo.isContendFullyPlaced ||
                            startRowIndex < _this.tableInfo.grid.tableCellInfos[startRowIndex][cellIndex].getEndRowIndex() - 1 &&
                                cellInfo.isSomeLayoutRowsPlaced;
                    }))
                        return this.getFirstNotFullyRenderedCell(startRowIndex + 1);
                    return pos;
                };
                CellOrderHelper.prototype.getNextPos = function (currTblPos) {
                    var _this = this;
                    var info = this.tableInfo.grid.tableCellInfos[currTblPos.rowIndex][currTblPos.cellIndex];
                    var nextGridCellIndex = info.getGridCellIndex() + info.getColumnSpan(this.tableInfo.grid.table);
                    var ind = this.getNextPositionOnRow(currTblPos.rowIndex, nextGridCellIndex, false, false, function () { return true; });
                    if (ind)
                        return ind;
                    if (this.getNextPositionOnRow(currTblPos.rowIndex, 0, true, true, function (info) { return info.getEndRowIndex() - 1 == currTblPos.rowIndex; }))
                        return null;
                    var res = __aspxRichEdit.ListUtils.anyOf(this.tableInfo.rows, function (_, rowInd) { return _this.getNextPositionOnRow(rowInd, 0, false, false, function (info) { return info.getStartRowIndex() == rowInd; }); }, currTblPos.rowIndex + 1);
                    if (res && res.rowIndex > currTblPos.rowIndex + 1) {
                        var prevRowIndex = res.rowIndex - 1;
                        var cells = this.tableInfo.rows[prevRowIndex].cells;
                        var cantMoveToNextRow = false;
                        for (var cellIndex = 0, cellInfo = void 0; cellInfo = cells[cellIndex]; cellIndex++) {
                            var cellGridInfo = this.tableInfo.grid.tableCellInfos[prevRowIndex][cellIndex];
                            if (cellGridInfo.getLastRowIndex() > prevRowIndex) {
                                cantMoveToNextRow = false;
                                break;
                            }
                            else if (cellGridInfo.getLastRowIndex() == prevRowIndex) {
                                if (!cellInfo.isContendFullyPlaced)
                                    cantMoveToNextRow = true;
                            }
                        }
                        if (cantMoveToNextRow)
                            return null;
                    }
                    return res;
                };
                CellOrderHelper.prototype.isTableFullyFormatted = function () {
                    return !this.getNextPositionOnRow(this.tableInfo.rows.length - 1, 0, true, true, function () { return true; });
                };
                CellOrderHelper.prototype.getNextPositionOnRow = function (rowIndex, startGridCellIndex, isConsiderGridBeforeAndAfter, isSkipConsiderRenderInThisColumn, handleCell) {
                    var numCells = this.tableInfo.grid.columns.positions.length - 1;
                    var cellInfos = this.tableInfo.grid.tableCellGridInfos[rowIndex];
                    var table = this.tableInfo.grid.table;
                    for (var cellGridIndex = startGridCellIndex; cellGridIndex < numCells;) {
                        var info = cellInfos[cellGridIndex];
                        if (info) {
                            if (handleCell(info)) {
                                if (!this.isCellContendFullyPlaced(info) && (isSkipConsiderRenderInThisColumn || !this.cellRenderedOnThisColumn(info)))
                                    return new __aspxRichEdit.TablePositionIndexes(rowIndex, info.getCellIndex(rowIndex - info.getStartRowIndex()));
                            }
                            cellGridIndex += info.getColumnSpan(table);
                        }
                        else {
                            if (isConsiderGridBeforeAndAfter) {
                                var rowGridInfo = this.tableInfo.grid.tableCellGridInfos[rowIndex - 1];
                                if (rowGridInfo) {
                                    var elem = rowGridInfo[cellGridIndex];
                                    if (elem && !this.isCellContendFullyPlaced(elem) && (isSkipConsiderRenderInThisColumn || !this.cellRenderedOnThisColumn(info)))
                                        return new __aspxRichEdit.TablePositionIndexes(rowIndex - 1, info.getCellIndex(rowIndex - 1 - info.getStartRowIndex()));
                                }
                            }
                            cellGridIndex++;
                        }
                    }
                    return null;
                };
                CellOrderHelper.prototype.isCellContendFullyPlaced = function (info) {
                    var rowIndex = info.getStartRowIndex();
                    var cellIndex = info.getCellIndex(0);
                    var cellInfo = this.tableInfo.rows[rowIndex].cells[cellIndex];
                    return cellInfo.isContendFullyPlaced;
                };
                CellOrderHelper.prototype.cellRenderedOnThisColumn = function (info) {
                    var cellGridIndex = info.getGridCellIndex();
                    var minRowIndex = info.getStartRowIndex();
                    var rows = this.tableInfo.currLayoutTableColumnInfo.tableRows;
                    for (var layoutRowIndex = rows.length - 1, row = void 0; (row = rows[layoutRowIndex]) && row.rowIndex >= minRowIndex; layoutRowIndex--)
                        if (row.getCellIndexByExactlyCellGridIndex(cellGridIndex) >= 0)
                            return true;
                    return false;
                };
                return CellOrderHelper;
            }());
            Table.CellOrderHelper = CellOrderHelper;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var RowInfo = (function () {
                function RowInfo(tableInfo, rowIndex) {
                    this.cells = [];
                    this.tableInfo = tableInfo;
                    this.rowIndex = rowIndex;
                    this.howManyColumnsConsiderTableRow = 0;
                    this.init();
                }
                Object.defineProperty(RowInfo.prototype, "row", {
                    get: function () { return this.tableInfo.table.rows[this.rowIndex]; },
                    enumerable: true,
                    configurable: true
                });
                RowInfo.prototype.init = function () {
                    var row = this.row;
                    var cantSplit = new __aspxRichEdit.TableRowPropertiesMergerCantSplit().getProperty(row.properties, this.tableInfo.tableStyle, row.conditionalFormatting, this.tableInfo.defaultTblRowProps);
                    var horizontalAlignment = new __aspxRichEdit.TableRowPropertiesMergerHorizontalAlignment(row.tablePropertiesException)
                        .getProperty(row.properties, this.tableInfo.tableStyle, row.conditionalFormatting, this.tableInfo.defaultTblRowProps);
                    this.heightInfo = new Table.TableRowHeightInfo(cantSplit, row.height, horizontalAlignment);
                    this.cellSpacing = new __aspxRichEdit.TableRowPropertiesMergerCellSpacing(this.tableInfo.model, this.tableInfo.table, row.tablePropertiesException)
                        .getProperty(row.properties, this.tableInfo.tableStyle, row.conditionalFormatting, this.tableInfo.defaultTblRowProps)
                        .asNumberNoPercentType(__aspxRichEdit.UnitConverter.twipsToPixels);
                    this.topAndBottomMargins = new Table.TopAndBottomMarginsForRow();
                    for (var _i = 0, _a = row.cells; _i < _a.length; _i++) {
                        var cell = _a[_i];
                        if (cell.verticalMerging == __aspxRichEdit.TableCellMergingState.Continue)
                            continue;
                        this.topAndBottomMargins.addCellTopMargin(Table.Formatter.getCellMargin(this.tableInfo.tableStyle, cell, new __aspxRichEdit.TableCellPropertiesMergerMarginTop(this.tableInfo.table, this.tableInfo.model, cell.parentRow.tablePropertiesException)));
                        this.topAndBottomMargins.addCellBottomMargin(Table.Formatter.getCellMargin(this.tableInfo.tableStyle, cell, new __aspxRichEdit.TableCellPropertiesMergerMarginBottom(this.tableInfo.table, this.tableInfo.model, cell.parentRow.tablePropertiesException)));
                    }
                };
                RowInfo.prototype.initLayoutInfo = function (isFirstRowInColumn, column) {
                    var prevTblRow = __aspxRichEdit.ListUtils.last(this.tableInfo.currLayoutTableColumnInfo.tableRows);
                    this.currLayoutTableRowInfo = new __aspxRichEdit.LayoutTableRowInfo(this.tableInfo.currLayoutTableColumnInfo, new __aspxRichEdit.Rectangle().init(this.tableInfo.xPositionStart, prevTblRow ? prevTblRow.getBottomBoundPosition() : this.tableInfo.currLayoutTableColumnInfo.y, 0, 0), this.tableInfo.minRowIndex);
                    this.tableInfo.currRowHorizontalBorders = this.tableInfo.bordersHelper.getHorizontalBordersByRow(this.currLayoutTableRowInfo.rowIndex, this.tableInfo.isThisTableRowFirstInColumn || isFirstRowInColumn, true);
                    for (var _i = 0, _a = this.cells; _i < _a.length; _i++) {
                        var cell = _a[_i];
                        cell.initLayoutInfo();
                    }
                    this.layoutRowIndexInColumn = column.rows.length;
                };
                RowInfo.prototype.clearLayoutInfo = function () {
                    this.currLayoutTableRowInfo = null;
                    this.tableInfo.currRowHorizontalBorders = null;
                    for (var _i = 0, _a = this.cells; _i < _a.length; _i++) {
                        var cell = _a[_i];
                        cell.clearLayoutInfo();
                    }
                };
                return RowInfo;
            }());
            Table.RowInfo = RowInfo;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var TableInfo = (function () {
                function TableInfo(rowFormatter, table, tableMaxWidth, xPosition, yOffset) {
                    var _this = this;
                    this.minRowIndex = 0;
                    this.verticalBorders = [];
                    this.verticalCursorBorders = [];
                    this.isThisColumnFirstInTable = true;
                    this.rowFormatter = rowFormatter;
                    this.model = this.rowFormatter.manager.model;
                    this.maxWidth = tableMaxWidth;
                    this.position = new __aspxRichEdit.TablePosition(table, 0, 0).init();
                    this.bordersHelper = new Table.BorderHelper(this, this.model);
                    this.init(xPosition, yOffset);
                    this.rows = __aspxRichEdit.ListUtils.map(this.table.rows, function (_row, rowIndex) { return new Table.RowInfo(_this, rowIndex); });
                    this.verticalBorders = this.bordersHelper.getVerticalBorders();
                    this.verticalCursorBorders = this.bordersHelper.getVerticalCursorBorders();
                    var _loop_9 = function (rowInfo) {
                        rowInfo.cells = __aspxRichEdit.ListUtils.map(rowInfo.row.cells, function (_cell, cellIndex) { return new Table.CellInfo(cellIndex, rowInfo); });
                    };
                    for (var _i = 0, _a = this.rows; _i < _a.length; _i++) {
                        var rowInfo = _a[_i];
                        _loop_9(rowInfo);
                    }
                    this.cellOrderHelper = new Table.CellOrderHelper(this);
                }
                Object.defineProperty(TableInfo.prototype, "table", {
                    get: function () { return this.position.table; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(TableInfo.prototype, "tableStyle", {
                    get: function () { return this.table.style; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(TableInfo.prototype, "tblProps", {
                    get: function () { return this.table.properties; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(TableInfo.prototype, "defaultTblProps", {
                    get: function () { return this.model.defaultTableProperties; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(TableInfo.prototype, "defaultTblRowProps", {
                    get: function () { return this.model.defaultTableRowProperties; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(TableInfo.prototype, "defaultTblCellProps", {
                    get: function () { return this.model.defaultTableCellProperties; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(TableInfo.prototype, "currRowInfo", {
                    get: function () { return this.rows[this.position.rowIndex]; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(TableInfo.prototype, "currCellInfo", {
                    get: function () { return this.currRowInfo.cells[this.position.cellIndex]; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(TableInfo.prototype, "isThisTableRowFirstInColumn", {
                    get: function () { return this.currLayoutTableColumnInfo.tableRows.length == 0; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(TableInfo.prototype, "isCurrRowLastInTable", {
                    get: function () { return this.position.rowIndex == this.grid.table.rows.length - 1; },
                    enumerable: true,
                    configurable: true
                });
                Object.defineProperty(TableInfo.prototype, "currTablePositionIndexes", {
                    get: function () {
                        var actCellInfo = this.currCellInfo;
                        return new __aspxRichEdit.TablePositionIndexes(actCellInfo.rowInfo.rowIndex, actCellInfo.cellIndex);
                    },
                    enumerable: true,
                    configurable: true
                });
                TableInfo.prototype.init = function (xPosition, yOffset) {
                    var firstCellLeftMargin = 0;
                    var isRtfFile = true;
                    if (this.table.nestedLevel == 0 && isRtfFile && !this.rowFormatter.manager.innerClientProperties.viewsSettings.isSimpleView) {
                        var firstRow = this.table.rows[0];
                        var firstCell = firstRow.cells[0];
                        firstCellLeftMargin = new __aspxRichEdit.TableCellPropertiesMergerMarginLeft(this.table, this.model, firstRow.tablePropertiesException)
                            .getProperty(firstCell.properties, this.tableStyle, firstCell.conditionalFormatting, null)
                            .asNumberNoPercentType(__aspxRichEdit.UnitConverter.twipsToPixels);
                    }
                    var diff = this.T671794(yOffset);
                    if (diff.widthDiff != 0)
                        firstCellLeftMargin = 0;
                    this.maxWidth = this.maxWidth + firstCellLeftMargin + diff.widthDiff;
                    this.grid = Table.Grid.getGrid(this.table, this.rowFormatter.iterator, this.maxWidth);
                    var tableIndent = new __aspxRichEdit.TablePropertiesMergerIndent()
                        .getProperty(this.tblProps, this.tableStyle, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, this.defaultTblProps)
                        .asNumberNoPercentType(__aspxRichEdit.UnitConverter.twipsToPixels);
                    this.xPositionStart = xPosition + tableIndent - firstCellLeftMargin + diff.xDiff;
                };
                TableInfo.prototype.T671794 = function (yOffset) {
                    var lp = this.rowFormatter.manager.activeFormatter.layoutPosition;
                    var diff = 0;
                    if (this.table.nestedLevel == 0 && lp.pageArea.subDocument.isMain()) {
                        var empiricalOffset_1 = __aspxRichEdit.UnitConverter.inchesToPixels(0.07);
                        var expectedTableHeight_1 = this.rowFormatter.iterator.getWrap(false).box.height * this.table.rows.length;
                        yOffset += lp.pageArea.y + lp.column.y;
                        __aspxRichEdit.MapUtilsKeyAsNumber.foreach(lp.page.anchoredObjectHolder.objects, function (ancObj) {
                            if (ancObj.isInText() && __aspxRichEdit.IntervalAlgorithms.getIntersectionNonNullLength(new __aspxRichEdit.FixedInterval(ancObj.y, ancObj.height), new __aspxRichEdit.FixedInterval(yOffset, expectedTableHeight_1))) {
                                diff = Math.max(diff, ancObj.getRightBoundPosition() - (lp.pageArea.x + lp.column.x) + empiricalOffset_1);
                            }
                        });
                    }
                    return { xDiff: diff, widthDiff: -diff };
                };
                TableInfo.prototype.initLayoutInfo = function (yPos, parentCell, column) {
                    this.currColumnHorizontalBorders = [];
                    var logicInfo = this.currLayoutTableColumnInfo ?
                        this.currLayoutTableColumnInfo.logicInfo :
                        new __aspxRichEdit.LayoutTableInfo(new __aspxRichEdit.TablePropertiesMergerShadingInfo()
                            .getProperty(this.tblProps, this.tableStyle, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, this.defaultTblProps)
                            .getActualColor(this.model.colorProvider), this.grid);
                    this.currLayoutTableColumnInfo = new __aspxRichEdit.LayoutTableColumnInfo(parentCell, logicInfo, new __aspxRichEdit.Rectangle().init(this.xPositionStart, yPos, __aspxRichEdit.ListUtils.last(this.grid.columns.positions), 0));
                    this.rows[this.minRowIndex].initLayoutInfo(true, column);
                };
                return TableInfo;
            }());
            Table.TableInfo = TableInfo;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var CharacterPropertiesCache = (function (_super) {
        __extends(CharacterPropertiesCache, _super);
        function CharacterPropertiesCache() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        CharacterPropertiesCache.prototype.resetSizes = function () {
            __aspxRichEdit.MapUtilsKeyAsNumber.foreach(this.hashtable, function (list) {
                return __aspxRichEdit.ListUtils.foreach(list, function (prop) { return prop.clearSizes(); });
            });
        };
        return CharacterPropertiesCache;
    }(__aspxRichEdit.HashBasedCache));
    __aspxRichEdit.CharacterPropertiesCache = CharacterPropertiesCache;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var DrawingColorModelInfoCache = (function (_super) {
        __extends(DrawingColorModelInfoCache, _super);
        function DrawingColorModelInfoCache() {
            var _this = _super.call(this) || this;
            _this.getItem(__aspxRichEdit.DrawingColorModelInfo.empty);
            return _this;
        }
        DrawingColorModelInfoCache.defaultItem = new __aspxRichEdit.DrawingColorModelInfo();
        return DrawingColorModelInfoCache;
    }(__aspxRichEdit.HashBasedCache));
    __aspxRichEdit.DrawingColorModelInfoCache = DrawingColorModelInfoCache;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ListLevelPropertiesCache = (function (_super) {
        __extends(ListLevelPropertiesCache, _super);
        function ListLevelPropertiesCache() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        return ListLevelPropertiesCache;
    }(__aspxRichEdit.HashBasedCache));
    __aspxRichEdit.ListLevelPropertiesCache = ListLevelPropertiesCache;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var MaskedCharacterPropertiesCache = (function (_super) {
        __extends(MaskedCharacterPropertiesCache, _super);
        function MaskedCharacterPropertiesCache() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        return MaskedCharacterPropertiesCache;
    }(__aspxRichEdit.HashBasedCache));
    __aspxRichEdit.MaskedCharacterPropertiesCache = MaskedCharacterPropertiesCache;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var MaskedParagraphPropertiesCache = (function (_super) {
        __extends(MaskedParagraphPropertiesCache, _super);
        function MaskedParagraphPropertiesCache() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        return MaskedParagraphPropertiesCache;
    }(__aspxRichEdit.HashBasedCache));
    __aspxRichEdit.MaskedParagraphPropertiesCache = MaskedParagraphPropertiesCache;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ParagraphPropertiesCache = (function (_super) {
        __extends(ParagraphPropertiesCache, _super);
        function ParagraphPropertiesCache() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        return ParagraphPropertiesCache;
    }(__aspxRichEdit.HashBasedCache));
    __aspxRichEdit.ParagraphPropertiesCache = ParagraphPropertiesCache;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Scene3DPropertiesInfoCache = (function (_super) {
        __extends(Scene3DPropertiesInfoCache, _super);
        function Scene3DPropertiesInfoCache() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        Scene3DPropertiesInfoCache.defaultItem = new __aspxRichEdit.Scene3DPropertiesInfo();
        return Scene3DPropertiesInfoCache;
    }(__aspxRichEdit.HashBasedCache));
    __aspxRichEdit.Scene3DPropertiesInfoCache = Scene3DPropertiesInfoCache;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Scene3DRotationInfoCache = (function (_super) {
        __extends(Scene3DRotationInfoCache, _super);
        function Scene3DRotationInfoCache() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        Scene3DRotationInfoCache.defaultItem = new __aspxRichEdit.Scene3DRotationInfo();
        return Scene3DRotationInfoCache;
    }(__aspxRichEdit.HashBasedCache));
    __aspxRichEdit.Scene3DRotationInfoCache = Scene3DRotationInfoCache;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableCellPropertiesCache = (function (_super) {
        __extends(TableCellPropertiesCache, _super);
        function TableCellPropertiesCache() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        return TableCellPropertiesCache;
    }(__aspxRichEdit.HashBasedCache));
    __aspxRichEdit.TableCellPropertiesCache = TableCellPropertiesCache;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TablePropertiesCache = (function (_super) {
        __extends(TablePropertiesCache, _super);
        function TablePropertiesCache() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        return TablePropertiesCache;
    }(__aspxRichEdit.HashBasedCache));
    __aspxRichEdit.TablePropertiesCache = TablePropertiesCache;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableRowPropertiesCache = (function (_super) {
        __extends(TableRowPropertiesCache, _super);
        function TableRowPropertiesCache() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        return TableRowPropertiesCache;
    }(__aspxRichEdit.HashBasedCache));
    __aspxRichEdit.TableRowPropertiesCache = TableRowPropertiesCache;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AlphaColorTransform = (function (_super) {
        __extends(AlphaColorTransform, _super);
        function AlphaColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        AlphaColorTransform.createFromAlpha = function (alpha) {
            return new AlphaColorTransform(Math.floor(alpha * __aspxRichEdit.DrawingValueConstants.ThousandthOfPercentage / 255.0));
        };
        AlphaColorTransform.prototype.applyTransform = function (color) {
            return __aspxRichEdit.DXColor.fromArgb(this.toIntValue(this.value / __aspxRichEdit.DrawingValueConstants.ThousandthOfPercentage), color);
        };
        AlphaColorTransform.prototype.clone = function () {
            return new AlphaColorTransform(this.value);
        };
        return AlphaColorTransform;
    }(__aspxRichEdit.ColorTransformValueBase));
    __aspxRichEdit.AlphaColorTransform = AlphaColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AlphaModulationColorTransform = (function (_super) {
        __extends(AlphaModulationColorTransform, _super);
        function AlphaModulationColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        AlphaModulationColorTransform.prototype.clone = function () {
            return new AlphaModulationColorTransform(this.value);
        };
        AlphaModulationColorTransform.prototype.applyTransform = function (color) {
            var normalAlpha = this.toDoubleValue(__aspxRichEdit.ColorHelper.getAlpha(color)) * this.value / __aspxRichEdit.DrawingValueConstants.ThousandthOfPercentage;
            return __aspxRichEdit.DXColor.fromArgb(this.toIntValue(normalAlpha), color);
        };
        return AlphaModulationColorTransform;
    }(__aspxRichEdit.ColorTransformValueBase));
    __aspxRichEdit.AlphaModulationColorTransform = AlphaModulationColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AlphaOffsetColorTransform = (function (_super) {
        __extends(AlphaOffsetColorTransform, _super);
        function AlphaOffsetColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        AlphaOffsetColorTransform.prototype.clone = function () {
            return new AlphaOffsetColorTransform(this.value);
        };
        AlphaOffsetColorTransform.prototype.applyTransform = function (color) {
            var normalAlpha = this.toDoubleValue(__aspxRichEdit.ColorHelper.getAlpha(color)) + this.value / __aspxRichEdit.DrawingValueConstants.ThousandthOfPercentage;
            return __aspxRichEdit.DXColor.fromArgb(this.toIntValue(normalAlpha), color);
        };
        return AlphaOffsetColorTransform;
    }(__aspxRichEdit.ColorTransformValueBase));
    __aspxRichEdit.AlphaOffsetColorTransform = AlphaOffsetColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var BlueColorTransform = (function (_super) {
        __extends(BlueColorTransform, _super);
        function BlueColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        BlueColorTransform.prototype.clone = function () {
            return new BlueColorTransform(this.value);
        };
        BlueColorTransform.prototype.applyTransform = function (color) {
            return __aspxRichEdit.DXColor.fromRgb(__aspxRichEdit.ColorHelper.getRed(color), __aspxRichEdit.ColorHelper.getGreen(color), this.getRGBFromValue());
        };
        return BlueColorTransform;
    }(__aspxRichEdit.ColorTransformValueBase));
    __aspxRichEdit.BlueColorTransform = BlueColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var BlueModulationColorTransform = (function (_super) {
        __extends(BlueModulationColorTransform, _super);
        function BlueModulationColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        BlueModulationColorTransform.prototype.clone = function () {
            return new BlueModulationColorTransform(this.value);
        };
        BlueModulationColorTransform.prototype.applyTransform = function (color) {
            return __aspxRichEdit.DXColor.fromRgb(__aspxRichEdit.ColorHelper.getRed(color), __aspxRichEdit.ColorHelper.getGreen(color), this.applyRGBModulation(__aspxRichEdit.ColorHelper.getBlue(color)));
        };
        return BlueModulationColorTransform;
    }(__aspxRichEdit.ColorTransformValueBase));
    __aspxRichEdit.BlueModulationColorTransform = BlueModulationColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var BlueOffsetColorTransform = (function (_super) {
        __extends(BlueOffsetColorTransform, _super);
        function BlueOffsetColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        BlueOffsetColorTransform.prototype.clone = function () {
            return new BlueOffsetColorTransform(this.value);
        };
        BlueOffsetColorTransform.prototype.applyTransform = function (color) {
            return __aspxRichEdit.DXColor.fromRgb(__aspxRichEdit.ColorHelper.getRed(color), __aspxRichEdit.ColorHelper.getGreen(color), this.applyRGBOffset(__aspxRichEdit.ColorHelper.getBlue(color)));
        };
        return BlueOffsetColorTransform;
    }(__aspxRichEdit.ColorTransformValueBase));
    __aspxRichEdit.BlueOffsetColorTransform = BlueOffsetColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ColorTransformCollection = (function () {
        function ColorTransformCollection(transforms) {
            if (transforms === void 0) { transforms = []; }
            this.transforms = transforms;
        }
        ColorTransformCollection.prototype.applyTransform = function (color) {
            for (var _i = 0, _a = this.transforms; _i < _a.length; _i++) {
                var transform = _a[_i];
                transform.applyTransform(color);
            }
            return color;
        };
        ColorTransformCollection.prototype.add = function (transf) {
            this.transforms.push(transf);
        };
        ColorTransformCollection.prototype.equals = function (obj) {
            return obj &&
                __aspxRichEdit.ListUtils.allOf2(this.transforms, obj.transforms, function (a, b) { return a.equals(b); });
        };
        ColorTransformCollection.prototype.clear = function () {
            this.transforms = [];
        };
        ColorTransformCollection.prototype.clone = function () {
            return new ColorTransformCollection(__aspxRichEdit.ListUtils.deepCopy(this.transforms));
        };
        return ColorTransformCollection;
    }());
    __aspxRichEdit.ColorTransformCollection = ColorTransformCollection;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ComplementColorTransform = (function (_super) {
        __extends(ComplementColorTransform, _super);
        function ComplementColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ComplementColorTransform.prototype.clone = function () {
            return new ComplementColorTransform();
        };
        ComplementColorTransform.prototype.applyTransform = function (color) {
            return __aspxRichEdit.ColorHSL.fromColorRGB(color).getComplementColor().toRgb();
        };
        ComplementColorTransform.prototype.equals = function (obj) {
            return obj &&
                obj instanceof ComplementColorTransform;
        };
        return ComplementColorTransform;
    }(__aspxRichEdit.ColorTransformBase));
    __aspxRichEdit.ComplementColorTransform = ComplementColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GammaColorTransform = (function (_super) {
        __extends(GammaColorTransform, _super);
        function GammaColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GammaColorTransform.prototype.clone = function () {
            return new GammaColorTransform();
        };
        GammaColorTransform.prototype.applyTransform = function (color) {
            return this.applyDefaultGamma(color);
        };
        GammaColorTransform.prototype.equals = function (obj) {
            return obj &&
                obj instanceof GammaColorTransform;
        };
        return GammaColorTransform;
    }(__aspxRichEdit.ColorTransformBase));
    __aspxRichEdit.GammaColorTransform = GammaColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GrayscaleColorTransform = (function (_super) {
        __extends(GrayscaleColorTransform, _super);
        function GrayscaleColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GrayscaleColorTransform.prototype.clone = function () {
            return new GrayscaleColorTransform();
        };
        GrayscaleColorTransform.prototype.applyTransform = function (color) {
            var gray = Math.round(0.3 * __aspxRichEdit.ColorHelper.getRed(color) + 0.59 * __aspxRichEdit.ColorHelper.getGreen(color) + 0.11 * __aspxRichEdit.ColorHelper.getBlue(color) + 0.5);
            return __aspxRichEdit.DXColor.fromRgb(gray, gray, gray);
        };
        GrayscaleColorTransform.prototype.equals = function (obj) {
            return obj &&
                obj instanceof GrayscaleColorTransform;
        };
        return GrayscaleColorTransform;
    }(__aspxRichEdit.ColorTransformBase));
    __aspxRichEdit.GrayscaleColorTransform = GrayscaleColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GreenColorTransform = (function (_super) {
        __extends(GreenColorTransform, _super);
        function GreenColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GreenColorTransform.prototype.clone = function () {
            return new GreenColorTransform(this.value);
        };
        GreenColorTransform.prototype.applyTransform = function (color) {
            return __aspxRichEdit.DXColor.fromRgb(__aspxRichEdit.ColorHelper.getRed(color), this.getRGBFromValue(), __aspxRichEdit.ColorHelper.getBlue(color));
        };
        return GreenColorTransform;
    }(__aspxRichEdit.ColorTransformValueBase));
    __aspxRichEdit.GreenColorTransform = GreenColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GreenModulationColorTransform = (function (_super) {
        __extends(GreenModulationColorTransform, _super);
        function GreenModulationColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GreenModulationColorTransform.prototype.clone = function () {
            return new GreenModulationColorTransform(this.value);
        };
        GreenModulationColorTransform.prototype.applyTransform = function (color) {
            return __aspxRichEdit.DXColor.fromRgb(__aspxRichEdit.ColorHelper.getRed(color), this.applyRGBModulation(__aspxRichEdit.ColorHelper.getGreen(color)), __aspxRichEdit.ColorHelper.getBlue(color));
        };
        return GreenModulationColorTransform;
    }(__aspxRichEdit.ColorTransformValueBase));
    __aspxRichEdit.GreenModulationColorTransform = GreenModulationColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GreenOffsetColorTransform = (function (_super) {
        __extends(GreenOffsetColorTransform, _super);
        function GreenOffsetColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        GreenOffsetColorTransform.prototype.clone = function () {
            return new GreenOffsetColorTransform(this.value);
        };
        GreenOffsetColorTransform.prototype.applyTransform = function (color) {
            return __aspxRichEdit.DXColor.fromRgb(__aspxRichEdit.ColorHelper.getRed(color), this.applyRGBOffset(__aspxRichEdit.ColorHelper.getGreen(color)), __aspxRichEdit.ColorHelper.getBlue(color));
        };
        return GreenOffsetColorTransform;
    }(__aspxRichEdit.ColorTransformValueBase));
    __aspxRichEdit.GreenOffsetColorTransform = GreenOffsetColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HueColorTransform = (function (_super) {
        __extends(HueColorTransform, _super);
        function HueColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        HueColorTransform.prototype.clone = function () {
            return new HueColorTransform(this.value);
        };
        HueColorTransform.prototype.applyTransform = function (color) {
            return __aspxRichEdit.ColorHSL.fromColorRGB(color).applyHue(this.value).toRgb();
        };
        return HueColorTransform;
    }(__aspxRichEdit.ColorTransformValueBase));
    __aspxRichEdit.HueColorTransform = HueColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HueModulationColorTransform = (function (_super) {
        __extends(HueModulationColorTransform, _super);
        function HueModulationColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        HueModulationColorTransform.prototype.clone = function () {
            return new HueModulationColorTransform(this.value);
        };
        HueModulationColorTransform.prototype.applyTransform = function (color) {
            return __aspxRichEdit.ColorHSL.fromColorRGB(color).applyHueMod(this.value).toRgb();
        };
        return HueModulationColorTransform;
    }(__aspxRichEdit.ColorTransformValueBase));
    __aspxRichEdit.HueModulationColorTransform = HueModulationColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var HueOffsetColorTransform = (function (_super) {
        __extends(HueOffsetColorTransform, _super);
        function HueOffsetColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        HueOffsetColorTransform.prototype.clone = function () {
            return new HueOffsetColorTransform(this.value);
        };
        HueOffsetColorTransform.prototype.applyTransform = function (color) {
            return __aspxRichEdit.ColorHSL.fromColorRGB(color).applyHueOffset(this.value).toRgb();
        };
        return HueOffsetColorTransform;
    }(__aspxRichEdit.ColorTransformValueBase));
    __aspxRichEdit.HueOffsetColorTransform = HueOffsetColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InverseColorTransform = (function (_super) {
        __extends(InverseColorTransform, _super);
        function InverseColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InverseColorTransform.prototype.clone = function () {
            return new InverseColorTransform();
        };
        InverseColorTransform.prototype.applyTransform = function (color) {
            var r = this.toIntValue(this.applyDefaultGamma(1 - (this.applyInverseDefaultGamma(this.toDoubleValue(__aspxRichEdit.ColorHelper.getRed(color))))));
            var g = this.toIntValue(this.applyDefaultGamma(1 - (this.applyInverseDefaultGamma(this.toDoubleValue(__aspxRichEdit.ColorHelper.getGreen(color))))));
            var b = this.toIntValue(this.applyDefaultGamma(1 - (this.applyInverseDefaultGamma(this.toDoubleValue(__aspxRichEdit.ColorHelper.getBlue(color))))));
            return __aspxRichEdit.DXColor.fromRgb(r, g, b);
        };
        InverseColorTransform.prototype.equals = function (obj) {
            return obj &&
                obj instanceof InverseColorTransform;
        };
        return InverseColorTransform;
    }(__aspxRichEdit.ColorTransformBase));
    __aspxRichEdit.InverseColorTransform = InverseColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InverseGammaColorTransform = (function (_super) {
        __extends(InverseGammaColorTransform, _super);
        function InverseGammaColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InverseGammaColorTransform.prototype.clone = function () {
            return new InverseGammaColorTransform();
        };
        InverseGammaColorTransform.prototype.applyTransform = function (color) {
            return this.applyInverseDefaultGamma(color);
        };
        InverseGammaColorTransform.prototype.equals = function (obj) {
            return obj &&
                obj instanceof InverseGammaColorTransform;
        };
        return InverseGammaColorTransform;
    }(__aspxRichEdit.ColorTransformBase));
    __aspxRichEdit.InverseGammaColorTransform = InverseGammaColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LuminanceColorTransform = (function (_super) {
        __extends(LuminanceColorTransform, _super);
        function LuminanceColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LuminanceColorTransform.prototype.clone = function () {
            return new LuminanceColorTransform(this.value);
        };
        LuminanceColorTransform.prototype.applyTransform = function (color) {
            return __aspxRichEdit.ColorHSL.fromColorRGB(color).applyLuminance(this.value).toRgb();
        };
        return LuminanceColorTransform;
    }(__aspxRichEdit.ColorTransformValueBase));
    __aspxRichEdit.LuminanceColorTransform = LuminanceColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LuminanceModulationColorTransform = (function (_super) {
        __extends(LuminanceModulationColorTransform, _super);
        function LuminanceModulationColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LuminanceModulationColorTransform.prototype.clone = function () {
            return new LuminanceModulationColorTransform(this.value);
        };
        LuminanceModulationColorTransform.prototype.applyTransform = function (color) {
            return __aspxRichEdit.ColorHSL.fromColorRGB(color).applyLuminanceMod(this.value).toRgb();
        };
        return LuminanceModulationColorTransform;
    }(__aspxRichEdit.ColorTransformValueBase));
    __aspxRichEdit.LuminanceModulationColorTransform = LuminanceModulationColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LuminanceOffsetColorTransform = (function (_super) {
        __extends(LuminanceOffsetColorTransform, _super);
        function LuminanceOffsetColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LuminanceOffsetColorTransform.prototype.clone = function () {
            return new LuminanceOffsetColorTransform(this.value);
        };
        LuminanceOffsetColorTransform.prototype.applyTransform = function (color) {
            return __aspxRichEdit.ColorHSL.fromColorRGB(color).applyLuminanceOffset(this.value).toRgb();
        };
        return LuminanceOffsetColorTransform;
    }(__aspxRichEdit.ColorTransformValueBase));
    __aspxRichEdit.LuminanceOffsetColorTransform = LuminanceOffsetColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RedColorTransform = (function (_super) {
        __extends(RedColorTransform, _super);
        function RedColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RedColorTransform.prototype.clone = function () {
            return new RedColorTransform(this.value);
        };
        RedColorTransform.prototype.applyTransform = function (color) {
            return __aspxRichEdit.DXColor.fromRgb(this.getRGBFromValue(), __aspxRichEdit.ColorHelper.getGreen(color), __aspxRichEdit.ColorHelper.getBlue(color));
        };
        return RedColorTransform;
    }(__aspxRichEdit.ColorTransformValueBase));
    __aspxRichEdit.RedColorTransform = RedColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RedModulationColorTransform = (function (_super) {
        __extends(RedModulationColorTransform, _super);
        function RedModulationColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RedModulationColorTransform.prototype.clone = function () {
            return new RedModulationColorTransform(this.value);
        };
        RedModulationColorTransform.prototype.applyTransform = function (color) {
            return __aspxRichEdit.DXColor.fromRgb(this.applyRGBModulation(__aspxRichEdit.ColorHelper.getRed(color)), __aspxRichEdit.ColorHelper.getGreen(color), __aspxRichEdit.ColorHelper.getBlue(color));
        };
        return RedModulationColorTransform;
    }(__aspxRichEdit.ColorTransformValueBase));
    __aspxRichEdit.RedModulationColorTransform = RedModulationColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RedOffsetColorTransform = (function (_super) {
        __extends(RedOffsetColorTransform, _super);
        function RedOffsetColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RedOffsetColorTransform.prototype.clone = function () {
            return new RedOffsetColorTransform(this.value);
        };
        RedOffsetColorTransform.prototype.applyTransform = function (color) {
            return __aspxRichEdit.DXColor.fromRgb(this.applyRGBOffset(__aspxRichEdit.ColorHelper.getRed(color)), __aspxRichEdit.ColorHelper.getGreen(color), __aspxRichEdit.ColorHelper.getBlue(color));
        };
        return RedOffsetColorTransform;
    }(__aspxRichEdit.ColorTransformValueBase));
    __aspxRichEdit.RedOffsetColorTransform = RedOffsetColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SaturationColorTransform = (function (_super) {
        __extends(SaturationColorTransform, _super);
        function SaturationColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SaturationColorTransform.prototype.clone = function () {
            return new SaturationColorTransform(this.value);
        };
        SaturationColorTransform.prototype.applyTransform = function (color) {
            return __aspxRichEdit.ColorHSL.fromColorRGB(color).applySaturation(this.value).toRgb();
        };
        return SaturationColorTransform;
    }(__aspxRichEdit.ColorTransformValueBase));
    __aspxRichEdit.SaturationColorTransform = SaturationColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SaturationModulationColorTransform = (function (_super) {
        __extends(SaturationModulationColorTransform, _super);
        function SaturationModulationColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SaturationModulationColorTransform.prototype.clone = function () {
            return new SaturationModulationColorTransform(this.value);
        };
        SaturationModulationColorTransform.prototype.applyTransform = function (color) {
            return __aspxRichEdit.ColorHSL.fromColorRGB(color).applySaturationMod(this.value).toRgb();
        };
        return SaturationModulationColorTransform;
    }(__aspxRichEdit.ColorTransformValueBase));
    __aspxRichEdit.SaturationModulationColorTransform = SaturationModulationColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SaturationOffsetColorTransform = (function (_super) {
        __extends(SaturationOffsetColorTransform, _super);
        function SaturationOffsetColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        SaturationOffsetColorTransform.prototype.clone = function () {
            return new SaturationOffsetColorTransform(this.value);
        };
        SaturationOffsetColorTransform.prototype.applyTransform = function (color) {
            return __aspxRichEdit.ColorHSL.fromColorRGB(color).applySaturationOffset(this.value).toRgb();
        };
        return SaturationOffsetColorTransform;
    }(__aspxRichEdit.ColorTransformValueBase));
    __aspxRichEdit.SaturationOffsetColorTransform = SaturationOffsetColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ShadeColorTransform = (function (_super) {
        __extends(ShadeColorTransform, _super);
        function ShadeColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ShadeColorTransform.prototype.clone = function () {
            return new ShadeColorTransform(this.value);
        };
        ShadeColorTransform.prototype.applyTransform = function (color) {
            var normalShade = this.value / __aspxRichEdit.DrawingValueConstants.ThousandthOfPercentage;
            var r = this.applyRGBModulationCore(__aspxRichEdit.ColorHelper.getRed(color), normalShade);
            var g = this.applyRGBModulationCore(__aspxRichEdit.ColorHelper.getGreen(color), normalShade);
            var b = this.applyRGBModulationCore(__aspxRichEdit.ColorHelper.getBlue(color), normalShade);
            return __aspxRichEdit.DXColor.fromRgb(r, g, b);
        };
        return ShadeColorTransform;
    }(__aspxRichEdit.ColorTransformValueBase));
    __aspxRichEdit.ShadeColorTransform = ShadeColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TintColorTransform = (function (_super) {
        __extends(TintColorTransform, _super);
        function TintColorTransform() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TintColorTransform.prototype.clone = function () {
            return new TintColorTransform(this.value);
        };
        TintColorTransform.prototype.applyTransform = function (color) {
            var normalTint = 1 - this.value / __aspxRichEdit.DrawingValueConstants.ThousandthOfPercentage;
            var r = this.toIntValue(this.applyDefaultGamma(this.applyTintCore(this.applyInverseDefaultGamma(this.toDoubleValue(__aspxRichEdit.ColorHelper.getRed(color))), normalTint)));
            var g = this.toIntValue(this.applyDefaultGamma(this.applyTintCore(this.applyInverseDefaultGamma(this.toDoubleValue(__aspxRichEdit.ColorHelper.getGreen(color))), normalTint)));
            var b = this.toIntValue(this.applyDefaultGamma(this.applyTintCore(this.applyInverseDefaultGamma(this.toDoubleValue(__aspxRichEdit.ColorHelper.getBlue(color))), normalTint)));
            return __aspxRichEdit.DXColor.fromRgb(r, g, b);
        };
        TintColorTransform.prototype.applyTintCore = function (normalRgb, normalTint) {
            return normalTint > 0 ? normalRgb * (1 - normalTint) + normalTint : normalRgb * (1 + normalTint);
        };
        return TintColorTransform;
    }(__aspxRichEdit.ColorTransformValueBase));
    __aspxRichEdit.TintColorTransform = TintColorTransform;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FieldCodeParserDate = (function (_super) {
        __extends(FieldCodeParserDate, _super);
        function FieldCodeParserDate() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FieldCodeParserDate.prototype.fillResult = function () {
            var dateFormatter = new __aspxRichEdit.DateTimeFieldFormatter();
            var currDate = new Date();
            var dateText;
            var dateFormatSwitches = [];
            for (var i = 0, switchInfo; switchInfo = this.switchInfoList[i]; i++)
                if (switchInfo.type == __aspxRichEdit.FieldSwitchType.DateAndTime)
                    dateFormatSwitches.push(switchInfo);
            switch (dateFormatSwitches.length) {
                case 0:
                    dateText = dateFormatter.format(currDate, this.getDefaultFormat());
                    break;
                case 1:
                    dateText = dateFormatter.format(currDate, dateFormatSwitches[0].arg);
                    break;
                default:
                    break;
            }
            if (dateText) {
                this.setInputPositionState();
                this.control.modelManipulator.insertText(this.control, this.subDocument, this.getTopField().getResultInterval(), dateText, false, true, __aspxRichEdit.ModelScrollManager.DontChangeScrollPosition);
            }
            return true;
        };
        FieldCodeParserDate.prototype.getDefaultFormat = function () {
            return "M/d/yyyy";
        };
        return FieldCodeParserDate;
    }(__aspxRichEdit.FieldCodeParserClientUpdatingBase));
    __aspxRichEdit.FieldCodeParserDate = FieldCodeParserDate;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FieldCodeParserDocVariable = (function (_super) {
        __extends(FieldCodeParserDocVariable, _super);
        function FieldCodeParserDocVariable() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.switchInfoList = [];
            _this.parameterInfoList = [];
            return _this;
        }
        FieldCodeParserDocVariable.prototype.getMailMergeType = function () {
            return __aspxRichEdit.FieldMailMergeType.NonMailMerge;
        };
        FieldCodeParserDocVariable.prototype.getServerUpdateFieldType = function () {
            return __aspxRichEdit.ServerUpdateFieldType.DocVariable;
        };
        FieldCodeParserDocVariable.prototype.handleSwitch = function (newSwitch) {
            this.switchInfoList.push(newSwitch);
            return true;
        };
        FieldCodeParserDocVariable.prototype.handleParameter = function (newParameter) {
            this.parameterInfoList.push(newParameter);
            return true;
        };
        FieldCodeParserDocVariable.prototype.parseCodeCurrentFieldInternal = function (responce) {
            if (responce && this.fieldID != undefined && responce[this.fieldID]) {
                if (this.applyResponse(responce[this.fieldID]))
                    this.parserState = __aspxRichEdit.FieldCodeParserState.resultPartCreated;
                else
                    this.parserState = __aspxRichEdit.FieldCodeParserState.end;
                return true;
            }
            if (!this.parseSwitchesAndArgs(true)) {
                this.parserState = __aspxRichEdit.FieldCodeParserState.end;
                return true;
            }
            if (this.insertDefaultText()) {
                this.parserState = __aspxRichEdit.FieldCodeParserState.end;
                return true;
            }
            if (!this.placeRequest()) {
                this.parserState = __aspxRichEdit.FieldCodeParserState.end;
                return true;
            }
            return false;
        };
        FieldCodeParserDocVariable.prototype.insertDefaultText = function () {
            return false;
        };
        FieldCodeParserDocVariable.prototype.placeRequest = function () {
            if (this.parameterInfoList.length < 1)
                return false;
            this.fieldID = FieldCodeParserDocVariable.updateFieldID++;
            this.subDocument.fieldsWaitingForUpdate.addRequest(this.getServerUpdateFieldType(), this.getRequestData(), this.fieldID);
            return true;
        };
        FieldCodeParserDocVariable.prototype.getRequestData = function () {
            var jsonParameters = [];
            for (var i = 1, paramInfo; paramInfo = this.parameterInfoList[i]; i++) {
                var jsonParamInfo = {};
                jsonParamInfo[__aspxRichEdit.JSONUpdateFieldCommandDocVariableParameters.PureText] = paramInfo.text;
                jsonParamInfo[__aspxRichEdit.JSONUpdateFieldCommandDocVariableParameters.IntervalStart] = paramInfo.interval.start;
                jsonParamInfo[__aspxRichEdit.JSONUpdateFieldCommandDocVariableParameters.IntervalEnd] = paramInfo.interval.end;
                jsonParameters.push(jsonParamInfo);
            }
            var jsonData = {};
            jsonData[__aspxRichEdit.JSONUpdateFieldCommandDocVariableInfo.FieldName] = this.parameterInfoList[0].text;
            jsonData[__aspxRichEdit.JSONUpdateFieldCommandDocVariableInfo.Parameters] = jsonParameters;
            return jsonData;
        };
        FieldCodeParserDocVariable.prototype.applyResponse = function (response) {
            var fieldResultInterval = this.getTopField().getResultInterval();
            this.setInputPositionState();
            var simpleText = response[__aspxRichEdit.JSONUpdateFieldCommandResult.SimpleText];
            if (simpleText !== undefined) {
                if (simpleText !== null)
                    if (simpleText !== "")
                        this.control.modelManipulator.insertText(this.control, this.subDocument, fieldResultInterval, simpleText, false, true, __aspxRichEdit.ModelScrollManager.DontChangeScrollPosition);
                    else
                        __aspxRichEdit.ModelManipulator.removeInterval(this.control, this.subDocument, fieldResultInterval, false, true);
                return true;
            }
            else {
                __aspxRichEdit.ServerDispatcherResponseProcessor.insertDocumentModelFromServer(this.control, response, this.getTopField().getResultStartPosition(), this.subDocument.id, fieldResultInterval);
                return true;
            }
        };
        FieldCodeParserDocVariable.updateFieldID = 0;
        return FieldCodeParserDocVariable;
    }(__aspxRichEdit.FieldCodeParser));
    __aspxRichEdit.FieldCodeParserDocVariable = FieldCodeParserDocVariable;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FieldCodeParserHyperlink = (function (_super) {
        __extends(FieldCodeParserHyperlink, _super);
        function FieldCodeParserHyperlink() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FieldCodeParserHyperlink.prototype.parseCodeCurrentFieldInternal = function (_responce) {
            if (this.parseSwitchesAndArgs(true))
                this.fillResult();
            else
                __aspxRichEdit.FieldCodeParserHelper.deleteFieldResultFromModel(this.control, this.subDocument, this.getTopField());
            this.parserState = __aspxRichEdit.FieldCodeParserState.end;
            return true;
        };
        FieldCodeParserHyperlink.prototype.fillResult = function () {
            var field = this.getTopField();
            var text = this.parameterInfoList[0] ? this.parameterInfoList[0].text : "";
            var newHyperlinkInfo = this.updateHyperlinkInfo(field, text);
            if (!newHyperlinkInfo) {
                __aspxRichEdit.FieldCodeParserHelper.deleteFieldResultFromModel(this.control, this.subDocument, this.getTopField());
                return true;
            }
            var modelManipulator = this.control.modelManipulator;
            var resultInterval = field.getResultInterval();
            if (resultInterval.length == 0) {
                var resultText = text.length > 0 ? text : "#" + newHyperlinkInfo.anchor;
                var newResultInterval = new __aspxRichEdit.FixedInterval(resultInterval.start, resultText.length);
                var selectionEnd = newResultInterval.end;
                this.setInputPositionState();
                modelManipulator.insertText(this.control, this.subDocument, resultInterval, resultText, false);
                this.control.history.addAndRedo(new __aspxRichEdit.ApplyFieldHyperlinkStyleHistoryItem(modelManipulator, this.subDocument, newResultInterval));
                this.control.selection.deprecatedSetSelection(selectionEnd + 1, selectionEnd + 1, false, -1, __aspxRichEdit.UpdateInputPositionProperties.No);
            }
            this.control.history.addAndRedo(new __aspxRichEdit.ChangeFieldHyperlinkInfoHistoryItem(modelManipulator, this.subDocument, field.index, newHyperlinkInfo));
            return true;
        };
        FieldCodeParserHyperlink.prototype.updateHyperlinkInfo = function (field, text) {
            var newHyperlinkInfo = field.isHyperlinkField() ? field.getHyperlinkInfo().clone() : new __aspxRichEdit.HyperlinkInfo("", "", "", false);
            newHyperlinkInfo.visited = false;
            var tipSwitch;
            var bookmarkSwitch;
            for (var i = 0, switchInfo; switchInfo = this.switchInfoList[i]; i++)
                if (switchInfo.type == __aspxRichEdit.FieldSwitchType.FieldSpecific) {
                    switch (switchInfo.name.toLocaleUpperCase()) {
                        case "O":
                            tipSwitch = switchInfo;
                            break;
                        case "L":
                            bookmarkSwitch = switchInfo;
                            break;
                    }
                }
            newHyperlinkInfo.tip = tipSwitch ? tipSwitch.arg : "";
            var splitted = text.split("#");
            if (splitted.length > 2)
                return null;
            if (splitted.length == 1) {
                newHyperlinkInfo.uri = splitted[0];
                newHyperlinkInfo.anchor = bookmarkSwitch ? bookmarkSwitch.arg : "";
                if (newHyperlinkInfo.uri == "" && newHyperlinkInfo.anchor == "")
                    return null;
            }
            else {
                newHyperlinkInfo.uri = splitted[0];
                newHyperlinkInfo.anchor = splitted[1];
            }
            return newHyperlinkInfo;
        };
        return FieldCodeParserHyperlink;
    }(__aspxRichEdit.FieldCodeParserClientUpdatingBase));
    __aspxRichEdit.FieldCodeParserHyperlink = FieldCodeParserHyperlink;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FieldCodeParserMailMerge = (function (_super) {
        __extends(FieldCodeParserMailMerge, _super);
        function FieldCodeParserMailMerge() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FieldCodeParserMailMerge.prototype.getMailMergeType = function () {
            return __aspxRichEdit.FieldMailMergeType.MailMerge;
        };
        FieldCodeParserMailMerge.prototype.getServerUpdateFieldType = function () {
            return __aspxRichEdit.ServerUpdateFieldType.MergeField;
        };
        FieldCodeParserMailMerge.prototype.insertDefaultText = function () {
            if (this.control.mailMergeOptions.isEnabled && this.control.mailMergeOptions.viewMergedData)
                return false;
            var defaultText = REWebUtils.Formatter.Format("<<{0}>>", this.parameterInfoList[0].text);
            this.setInputPositionState();
            this.control.modelManipulator.insertText(this.control, this.subDocument, this.getTopField().getResultInterval(), defaultText, false, true, __aspxRichEdit.ModelScrollManager.DontChangeScrollPosition);
            return true;
        };
        FieldCodeParserMailMerge.prototype.getRequestData = function () {
            var params = {};
            params[__aspxRichEdit.JSONUpdateFieldCommandDocVariableInfo.FieldName] = this.parameterInfoList[0].text;
            return params;
        };
        FieldCodeParserMailMerge.prototype.applyResponse = function (response) {
            var fieldResultInterval = this.getTopField().getResultInterval();
            this.setInputPositionState();
            var simpleText = response[__aspxRichEdit.JSONUpdateFieldCommandResult.SimpleText];
            if (simpleText !== null) {
                if (simpleText !== "")
                    this.control.modelManipulator.insertText(this.control, this.subDocument, fieldResultInterval, simpleText.replace(/\r\n/g, __aspxRichEdit.RichUtils.specialCharacters.LineBreak), false, true, __aspxRichEdit.ModelScrollManager.DontChangeScrollPosition);
                else
                    __aspxRichEdit.ModelManipulator.removeInterval(this.control, this.subDocument, fieldResultInterval, false, true);
                return true;
            }
            return false;
        };
        return FieldCodeParserMailMerge;
    }(__aspxRichEdit.FieldCodeParserDocVariable));
    __aspxRichEdit.FieldCodeParserMailMerge = FieldCodeParserMailMerge;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FieldCodeParserNumPages = (function (_super) {
        __extends(FieldCodeParserNumPages, _super);
        function FieldCodeParserNumPages() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FieldCodeParserNumPages.prototype.fillResult = function () {
            this.setInputPositionState();
            if (this.subDocument.isMain()) {
                var numPagesText = this.control.layout.lastMaxNumPages.toString();
                this.control.modelManipulator.insertText(this.control, this.subDocument, this.getTopField().getResultInterval(), numPagesText, false, true, __aspxRichEdit.ModelScrollManager.DontChangeScrollPosition);
            }
            else
                this.control.modelManipulator.insertLayoutDependentText(this.control, this.subDocument, this.getTopField().getResultInterval());
            return true;
        };
        return FieldCodeParserNumPages;
    }(__aspxRichEdit.FieldCodeParserClientUpdatingBase));
    __aspxRichEdit.FieldCodeParserNumPages = FieldCodeParserNumPages;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FieldCodeParserPage = (function (_super) {
        __extends(FieldCodeParserPage, _super);
        function FieldCodeParserPage() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FieldCodeParserPage.prototype.fillResult = function () {
            var pos = this.getPosition();
            if (pos == null)
                return true;
            this.setInputPositionState();
            if (this.subDocument.isMain()) {
                var layoutPosition = __aspxRichEdit.LayoutPositionMainSubDocumentCreator.ensureLayoutPosition(this.control, this.control.layout, this.subDocument, pos, __aspxRichEdit.DocumentLayoutDetailsLevel.Page, new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true));
                var pageText = this.getFormattedResult(layoutPosition.pageIndex + 1);
                this.control.modelManipulator.insertText(this.control, this.subDocument, this.getTopField().getResultInterval(), pageText, false, true, __aspxRichEdit.ModelScrollManager.DontChangeScrollPosition);
            }
            else
                this.control.modelManipulator.insertLayoutDependentText(this.control, this.subDocument, this.getTopField().getResultInterval());
            return true;
        };
        FieldCodeParserPage.prototype.getPosition = function () {
            var field = this.getTopField();
            return field.showCode ? field.getCodeStartPosition() : field.getResultStartPosition();
        };
        return FieldCodeParserPage;
    }(__aspxRichEdit.FieldCodeParserClientUpdatingBase));
    __aspxRichEdit.FieldCodeParserPage = FieldCodeParserPage;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FieldCodeParserPageRef = (function (_super) {
        __extends(FieldCodeParserPageRef, _super);
        function FieldCodeParserPageRef() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FieldCodeParserPageRef.prototype.fillResult = function () {
            var pos = this.getPosition();
            if (pos == null)
                return true;
            var resultAsLink = false;
            for (var i = 0, switchInfo = void 0; switchInfo = this.switchInfoList[i]; i++)
                if (switchInfo.type == __aspxRichEdit.FieldSwitchType.FieldSpecific && switchInfo.name.toUpperCase() == "H")
                    resultAsLink = true;
            this.control.history.beginTransaction();
            this.setInputPositionState();
            if (this.subDocument.isMain()) {
                var layoutPosition = __aspxRichEdit.LayoutPositionMainSubDocumentCreator.ensureLayoutPosition(this.control, this.control.layout, this.subDocument, pos, __aspxRichEdit.DocumentLayoutDetailsLevel.Page, new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(true));
                var pageText = this.getFormattedResult(layoutPosition.pageIndex + 1);
                this.control.modelManipulator.insertText(this.control, this.subDocument, this.getTopField().getResultInterval(), pageText, false, true, __aspxRichEdit.ModelScrollManager.DontChangeScrollPosition);
                if (resultAsLink)
                    this.createLocalHyperLink(this.getTopField().getResultInterval(), this.getBookmarkName());
            }
            else
                this.control.modelManipulator.insertLayoutDependentText(this.control, this.subDocument, this.getTopField().getResultInterval());
            this.control.history.endTransaction();
            return true;
        };
        FieldCodeParserPageRef.prototype.getPosition = function () {
            var bookmark = this.findBookmark(this.getBookmarkName());
            return bookmark ? bookmark.start : null;
        };
        FieldCodeParserPageRef.prototype.getBookmarkName = function () {
            return this.parameterInfoList[0] ? this.parameterInfoList[0].text : "";
        };
        FieldCodeParserPageRef.prototype.findBookmark = function (name) {
            name = name.toUpperCase();
            for (var _i = 0, _a = this.subDocument.bookmarks; _i < _a.length; _i++) {
                var bm = _a[_i];
                if (bm.name.toUpperCase() == name)
                    return bm;
            }
            return null;
        };
        return FieldCodeParserPageRef;
    }(__aspxRichEdit.FieldCodeParserClientUpdatingBase));
    __aspxRichEdit.FieldCodeParserPageRef = FieldCodeParserPageRef;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FieldCodeParserSeq = (function (_super) {
        __extends(FieldCodeParserSeq, _super);
        function FieldCodeParserSeq() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FieldCodeParserSeq.prototype.fillResult = function () {
            var field = this.getTopField();
            var sequenceInfo = this.updateSequenceInfo(field);
            if (!sequenceInfo || sequenceInfo.hidesResult) {
                __aspxRichEdit.FieldCodeParserHelper.deleteFieldResultFromModel(this.control, this.subDocument, this.getTopField());
                return true;
            }
            var currentValue = 0;
            for (var i = 0; i <= field.index; i++) {
                var currentField = this.subDocument.fields[i];
                var currentInfo = currentField.getSequenceInfo();
                if (currentInfo && currentInfo.identifier == sequenceInfo.identifier) {
                    if (!currentInfo.repeats)
                        currentValue++;
                    if (currentInfo.resets)
                        currentValue = currentInfo.resetsWith;
                }
            }
            var resultText = this.getFormattedResult(currentValue);
            this.setInputPositionState();
            this.control.modelManipulator.insertText(this.control, this.subDocument, this.getTopField().getResultInterval(), resultText, false, true, __aspxRichEdit.ModelScrollManager.DontChangeScrollPosition);
            return true;
        };
        FieldCodeParserSeq.prototype.updateSequenceInfo = function (field) {
            var repeatsSwitch, hidesResultSwitch, resetsSwitch;
            for (var i = 0, switchInfo = void 0; switchInfo = this.switchInfoList[i]; i++)
                if (switchInfo.type == __aspxRichEdit.FieldSwitchType.FieldSpecific) {
                    switch (switchInfo.name.toLocaleUpperCase()) {
                        case "C":
                            repeatsSwitch = switchInfo;
                            break;
                        case "H":
                            hidesResultSwitch = switchInfo;
                            break;
                        case "R":
                            resetsSwitch = switchInfo;
                            break;
                    }
                }
            var identifier = !!this.parameterInfoList[0] ? this.parameterInfoList[0].text : "";
            var sequenceInfo = new __aspxRichEdit.SequenceInfo(identifier, !!repeatsSwitch, !!hidesResultSwitch, !!resetsSwitch, resetsSwitch ? Number(resetsSwitch.arg) : 0);
            field.setNewSequenceInfo(sequenceInfo);
            return sequenceInfo;
        };
        FieldCodeParserSeq.prototype.needUpdateInfo = function () {
            return true;
        };
        FieldCodeParserSeq.prototype.updateInfoCore = function () {
            this.updateSequenceInfo(this.getTopField());
        };
        return FieldCodeParserSeq;
    }(__aspxRichEdit.FieldCodeParserClientUpdatingBase));
    __aspxRichEdit.FieldCodeParserSeq = FieldCodeParserSeq;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FieldCodeParserTc = (function (_super) {
        __extends(FieldCodeParserTc, _super);
        function FieldCodeParserTc() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FieldCodeParserTc.prototype.fillResult = function () {
            var field = this.getTopField();
            this.updateTcInfo(field);
            return true;
        };
        FieldCodeParserTc.prototype.updateTcInfo = function (field) {
            var identifierSwitch, levelSwitch;
            for (var i = 0, switchInfo = void 0; switchInfo = this.switchInfoList[i]; i++)
                if (switchInfo.type == __aspxRichEdit.FieldSwitchType.FieldSpecific) {
                    switch (switchInfo.name.toLocaleUpperCase()) {
                        case "F":
                            identifierSwitch = switchInfo;
                            break;
                        case "L":
                            levelSwitch = switchInfo;
                            break;
                    }
                }
            if (identifierSwitch && identifierSwitch.arg) {
                var text = !!this.parameterInfoList[0] ? this.parameterInfoList[0].text : "";
                var tcInfo = new __aspxRichEdit.TcInfo(identifierSwitch.arg, text, levelSwitch ? Number(levelSwitch.arg) : 1);
                field.setNewTcInfo(tcInfo);
            }
        };
        FieldCodeParserTc.prototype.needUpdateInfo = function () {
            return true;
        };
        FieldCodeParserTc.prototype.updateInfoCore = function () {
            this.updateTcInfo(this.getTopField());
        };
        return FieldCodeParserTc;
    }(__aspxRichEdit.FieldCodeParserClientUpdatingBase));
    __aspxRichEdit.FieldCodeParserTc = FieldCodeParserTc;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FieldCodeParserTime = (function (_super) {
        __extends(FieldCodeParserTime, _super);
        function FieldCodeParserTime() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FieldCodeParserTime.prototype.getDefaultFormat = function () {
            return "H:mm";
        };
        return FieldCodeParserTime;
    }(__aspxRichEdit.FieldCodeParserDate));
    __aspxRichEdit.FieldCodeParserTime = FieldCodeParserTime;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FieldCodeParserToc = (function (_super) {
        __extends(FieldCodeParserToc, _super);
        function FieldCodeParserToc() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        FieldCodeParserToc.prototype.fillResult = function () {
            this.control.history.beginTransaction();
            var params = this.getTocParserParams();
            var tocElements = this.createTocElements(params);
            this.setInputPositionState();
            this.resetParagraphTabs();
            if (tocElements.length > 0)
                this.createToc(tocElements, params);
            else
                this.insertNoTocText();
            this.control.history.endTransaction();
            return true;
        };
        FieldCodeParserToc.prototype.createTocElements = function (params) {
            if (params.fromTc)
                return this.createTocElementsByTc(params);
            if (params.fromSeq)
                return this.createTocElementsBySeq(params);
            return this.createTocElementsByOutlineLevel(params);
        };
        FieldCodeParserToc.prototype.createTocElementsByTc = function (params) {
            var tocElements = [];
            for (var i = 0, field = void 0; field = this.subDocument.fields[i]; i++)
                if (field.isTcField()) {
                    var tcInfo = field.getTcInfo();
                    if (tcInfo.identifier.toUpperCase() == params.tcIdentifier.toUpperCase() &&
                        (!params.useSpecifiedTcLevels || (tcInfo.level >= params.tcLevelStart && tcInfo.level <= params.tcLevelEnd))) {
                        var bookmarkName = this.getBookmarkName(field.getAllFieldInterval());
                        if (this.isValidHeading(tcInfo.text))
                            tocElements.push(new TocElement(bookmarkName, tcInfo.text, tcInfo.level));
                    }
                }
            return tocElements;
        };
        FieldCodeParserToc.prototype.createTocElementsBySeq = function (params) {
            var tocElements = [];
            for (var i = 0, field = void 0; field = this.subDocument.fields[i]; i++)
                if (field.isSequenceField()) {
                    var seqInfo = field.getSequenceInfo();
                    if (seqInfo.identifier.toUpperCase() == params.seqIdentifier.toUpperCase()) {
                        var paragraph = this.subDocument.getParagraphByPosition(field.getCodeStartPosition());
                        var paragraphInterval = paragraph.interval;
                        paragraphInterval.length -= 1;
                        var text = this.subDocument.getSimpleText(paragraphInterval).trim();
                        var bookmarkName = this.getBookmarkName(paragraphInterval);
                        if (this.isValidHeading(text))
                            tocElements.push(new TocElement(bookmarkName, text, 1));
                    }
                }
            return tocElements;
        };
        FieldCodeParserToc.prototype.createTocElementsByOutlineLevel = function (params) {
            var tocElements = [];
            for (var i = 0, paragraph = void 0; paragraph = this.subDocument.paragraphs[i]; i++) {
                var level = params.fromOutlineLevel ?
                    paragraph.getParagraphMergedProperies().outlineLevel :
                    paragraph.paragraphStyle.maskedParagraphProperties.outlineLevel;
                if (level > 0 && (!params.useSpecifiedLevels || (level >= params.specifiedLevelStart && level <= params.specifiedLevelEnd))) {
                    var paragraphInterval = paragraph.interval;
                    paragraphInterval.length -= 1;
                    var bookmarkName = this.getBookmarkName(paragraphInterval);
                    var text = this.subDocument.getSimpleText(paragraph.interval).trim();
                    if (this.isValidHeading(text))
                        tocElements.push(new TocElement(bookmarkName, text, level));
                }
            }
            return tocElements;
        };
        FieldCodeParserToc.prototype.createToc = function (tocElements, params) {
            if (!params.useCustomSeparator)
                this.insertTabInfo();
            var fieldsForUpdate = [];
            for (var i = 0, tocElement = void 0; tocElement = tocElements[i]; i++) {
                var startPos = this.interval.start;
                this.insertHeading(tocElement);
                if (!params.omitsPageNumbers || tocElement.level < params.omitsPageNumbersStart || tocElement.level > params.omitsPageNumbersEnd) {
                    this.insertSeparator(params);
                    fieldsForUpdate.push(this.insetPageRef(tocElement));
                }
                if (params.asHyperlink)
                    this.createLocalHyperLink(__aspxRichEdit.FixedInterval.fromPositions(startPos, this.interval.end), tocElement.bookmarkName);
                this.setParagraphStyle(tocElement);
                if (tocElements[i + 1])
                    __aspxRichEdit.ModelManipulator.insertParagraph(this.control, this.subDocument, this.interval);
            }
            if (fieldsForUpdate.length > 0) {
                var intervalsForUpdate_1 = [];
                __aspxRichEdit.ListUtils.foreach(fieldsForUpdate, function (field) {
                    intervalsForUpdate_1.push(field.getAllFieldInterval());
                });
                (new __aspxRichEdit.FieldsWaitingForUpdate(this.control, this.subDocument, intervalsForUpdate_1, new __aspxRichEdit.UpdateFieldsOptions(), null, false)).update(null);
            }
        };
        FieldCodeParserToc.prototype.insertNoTocText = function () {
            this.control.modelManipulator.insertText(this.control, this.subDocument, this.interval, ASPxClientRichEdit.CommonLabels.NoTocEntriesFound, false, true, __aspxRichEdit.ModelScrollManager.DontChangeScrollPosition);
            var normalStyleName = __aspxRichEdit.StylesManager.paragraphPrefix + __aspxRichEdit.ParagraphStyle.normalStyleName;
            this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeStyle).execute(this.control.commandManager.isPublicApiCall, normalStyleName);
        };
        FieldCodeParserToc.prototype.resetParagraphTabs = function () {
            var paragraphIndex = this.subDocument.getParagraphIndexByPosition(this.interval.start);
            var paragraph = this.subDocument.paragraphs[paragraphIndex];
            var tabs = paragraph.getTabs();
            var tab;
            while (tab = tabs.positions.pop())
                this.control.history.addAndRedo(new __aspxRichEdit.DeleteTabAtParagraphHistoryItem(this.control.modelManipulator, this.subDocument, paragraph.interval, tab));
        };
        FieldCodeParserToc.prototype.setParagraphStyle = function (tocElement) {
            var styleName = REWebUtils.Formatter.Format("{0}{1} {2}", __aspxRichEdit.StylesManager.paragraphPrefix, __aspxRichEdit.ParagraphStyle.tocStyleName, tocElement.level);
            this.control.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ChangeStyle).execute(this.control.commandManager.isPublicApiCall, styleName);
        };
        FieldCodeParserToc.prototype.insertHeading = function (tocElement) {
            this.control.modelManipulator.insertText(this.control, this.subDocument, this.interval, tocElement.text, false, true, __aspxRichEdit.ModelScrollManager.DontChangeScrollPosition);
        };
        FieldCodeParserToc.prototype.insertSeparator = function (params) {
            var separator = params.useCustomSeparator ? params.separator : __aspxRichEdit.RichUtils.specialCharacters.TabMark;
            this.control.modelManipulator.insertText(this.control, this.subDocument, this.interval, separator, true);
        };
        FieldCodeParserToc.prototype.insertTabInfo = function () {
            var interval = this.interval;
            var sectionProperties = this.control.model.getSectionByPosition(interval.start).sectionProperties;
            var tabPosition = sectionProperties.pageWidth - sectionProperties.marginLeft - sectionProperties.marginRight;
            var tabInfo = new __aspxRichEdit.TabInfo(tabPosition, __aspxRichEdit.TabAlign.Right, __aspxRichEdit.TabLeaderType.Dots, false, false);
            this.control.history.addAndRedo(new __aspxRichEdit.InsertTabToParagraphHistoryItem(this.control.modelManipulator, this.subDocument, interval, tabInfo));
        };
        FieldCodeParserToc.prototype.insetPageRef = function (tocElement) {
            var interval = this.interval;
            this.control.history.addAndRedo(new __aspxRichEdit.FieldInsertHistoryItem(this.control, this.control.modelManipulator, this.subDocument, interval.start, 0, interval.length, false));
            var fieldIndex = __aspxRichEdit.Field.normedBinaryIndexOf(this.subDocument.fields, interval.start + 1);
            var field = this.subDocument.fields[fieldIndex];
            var code = REWebUtils.Formatter.Format("PAGEREF \"{0}\" \\h", tocElement.bookmarkName);
            this.control.modelManipulator.insertText(this.control, this.subDocument, field.getCodeInterval(), code, true);
            return field;
        };
        FieldCodeParserToc.prototype.getTocParserParams = function () {
            var params = new TocParserParameters();
            for (var i = 0, switchInfo = void 0; switchInfo = this.switchInfoList[i]; i++)
                if (switchInfo.type == __aspxRichEdit.FieldSwitchType.FieldSpecific) {
                    switch (switchInfo.name.toLocaleUpperCase()) {
                        case "H":
                            params.asHyperlink = true;
                            break;
                        case "F":
                            params.tcIdentifier = switchInfo.arg;
                            params.fromTc = !!params.tcIdentifier;
                            break;
                        case "C":
                            params.seqIdentifier = switchInfo.arg;
                            params.fromSeq = !!params.seqIdentifier;
                            break;
                        case "U":
                            params.fromOutlineLevel = true;
                            break;
                        case "P":
                            params.useCustomSeparator = true;
                            params.separator = switchInfo.arg;
                            break;
                        case "O":
                            var oArg = new RangedArg(switchInfo.arg);
                            params.useSpecifiedLevels = oArg.isValid();
                            params.specifiedLevelStart = oArg.getStart();
                            params.specifiedLevelEnd = oArg.getEnd();
                            break;
                        case "L":
                            var lArg = new RangedArg(switchInfo.arg);
                            params.useSpecifiedTcLevels = lArg.isValid();
                            params.tcLevelStart = lArg.getStart();
                            params.tcLevelEnd = lArg.getEnd();
                            break;
                        case "N":
                            params.omitsPageNumbers = true;
                            var nArg = new RangedArg(switchInfo.arg);
                            if (nArg.isValid()) {
                                params.omitsPageNumbersStart = nArg.getStart();
                                params.omitsPageNumbersEnd = nArg.getEnd();
                            }
                            else {
                                params.omitsPageNumbersStart = 1;
                                params.omitsPageNumbersEnd = 9;
                            }
                            break;
                    }
                }
            return params;
        };
        FieldCodeParserToc.prototype.isValidHeading = function (text) {
            if (!text)
                return false;
            for (var i = 0, char = void 0; char = text[i]; i++)
                if (!__aspxRichEdit.RichUtils.isWhitespace.test(char))
                    return true;
            return false;
        };
        Object.defineProperty(FieldCodeParserToc.prototype, "interval", {
            get: function () {
                var pos = this.getTopField().getResultInterval().end;
                return new __aspxRichEdit.FixedInterval(pos, 0);
            },
            enumerable: true,
            configurable: true
        });
        FieldCodeParserToc.prototype.getBookmarkName = function (interval) {
            var bookmark = __aspxRichEdit.ListUtils.elementBy(this.subDocument.bookmarks, function (bm) { return bm.isToc() &&
                bm.start == interval.start && bm.end == interval.end; });
            return bookmark ? bookmark.name : this.createNewBookmark(interval);
        };
        FieldCodeParserToc.prototype.createNewBookmark = function (interval) {
            var name = this.generateNewBookmarkName();
            this.control.history.addAndRedo(new __aspxRichEdit.CreateBookmarkHistoryItem(this.control.modelManipulator, this.subDocument, new __aspxRichEdit.ConstBookmark(interval, name)));
            return name;
        };
        FieldCodeParserToc.prototype.generateNewBookmarkName = function () {
            while (true) {
                var name_2 = REWebUtils.Formatter.Format("_Toc{0}", __aspxRichEdit.Utils.getRandomInt(0, 10000000000));
                for (var i = 0, bookmark = void 0; bookmark = this.subDocument.bookmarks[i]; i++)
                    if (bookmark.name.toUpperCase() == name_2.toUpperCase())
                        continue;
                return name_2;
            }
        };
        return FieldCodeParserToc;
    }(__aspxRichEdit.FieldCodeParserClientUpdatingBase));
    __aspxRichEdit.FieldCodeParserToc = FieldCodeParserToc;
    var TocParserParameters = (function () {
        function TocParserParameters() {
            this.asHyperlink = false;
            this.fromOutlineLevel = false;
            this.fromTc = false;
            this.fromSeq = false;
            this.useCustomSeparator = false;
            this.useSpecifiedLevels = false;
            this.omitsPageNumbers = false;
            this.useSpecifiedTcLevels = false;
        }
        return TocParserParameters;
    }());
    __aspxRichEdit.TocParserParameters = TocParserParameters;
    var TocElement = (function () {
        function TocElement(bookmarkName, text, level) {
            this.bookmarkName = bookmarkName;
            this.text = text;
            this.level = level;
        }
        return TocElement;
    }());
    __aspxRichEdit.TocElement = TocElement;
    var RangedArg = (function () {
        function RangedArg(arg) {
            this.start = Number(arg.split('-')[0]);
            this.end = Number(arg.split('-')[1]);
        }
        RangedArg.prototype.getStart = function () {
            return this.isValid() ? this.start : null;
        };
        RangedArg.prototype.getEnd = function () {
            return this.isValid() ? this.end : null;
        };
        RangedArg.prototype.isValid = function () {
            return this.start != NaN && this.end != NaN && this.start >= 0 && this.end >= 0 && this.end >= this.start;
        };
        return RangedArg;
    }());
    __aspxRichEdit.RangedArg = RangedArg;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AnchorInfoPropertyHistoryItem = (function (_super) {
        __extends(AnchorInfoPropertyHistoryItem, _super);
        function AnchorInfoPropertyHistoryItem(modelManipulator, boundSubDocument, interval, newValue, propertyManipulator) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, interval) || this;
            _this.newValue = newValue;
            _this.propertyManipulator = propertyManipulator;
            return _this;
        }
        AnchorInfoPropertyHistoryItem.prototype.redo = function () {
            this.oldState = this.propertyManipulator.setValue(this.boundSubDocument, this.interval, this.newValue);
        };
        AnchorInfoPropertyHistoryItem.prototype.undo = function () {
            this.propertyManipulator.restoreValue(this.boundSubDocument, this.oldState);
        };
        return AnchorInfoPropertyHistoryItem;
    }(__aspxRichEdit.IntervalBasedHistoryItem));
    __aspxRichEdit.AnchorInfoPropertyHistoryItem = AnchorInfoPropertyHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeAnchoredPictureSizeHistoryItem = (function (_super) {
        __extends(ChangeAnchoredPictureSizeHistoryItem, _super);
        function ChangeAnchoredPictureSizeHistoryItem(modelManipulator, boundSubDocument, interval, size) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, interval) || this;
            _this.size = size;
            return _this;
        }
        ChangeAnchoredPictureSizeHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.floatingObjectsManipulator.pictureSize.setValue(this.boundSubDocument, this.interval, this.size);
        };
        ChangeAnchoredPictureSizeHistoryItem.prototype.undo = function () {
            this.modelManipulator.floatingObjectsManipulator.pictureSize.restoreValue(this.boundSubDocument, this.oldState);
        };
        return ChangeAnchoredPictureSizeHistoryItem;
    }(__aspxRichEdit.IntervalBasedHistoryItem));
    __aspxRichEdit.ChangeAnchoredPictureSizeHistoryItem = ChangeAnchoredPictureSizeHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeAnchoredTextBoxSizeHistoryItem = (function (_super) {
        __extends(ChangeAnchoredTextBoxSizeHistoryItem, _super);
        function ChangeAnchoredTextBoxSizeHistoryItem(modelManipulator, boundSubDocument, interval, size) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, interval) || this;
            _this.size = size;
            return _this;
        }
        ChangeAnchoredTextBoxSizeHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.floatingObjectsManipulator.textBoxSize.setValue(this.boundSubDocument, this.interval, this.size);
        };
        ChangeAnchoredTextBoxSizeHistoryItem.prototype.undo = function () {
            this.modelManipulator.floatingObjectsManipulator.textBoxSize.restoreValue(this.boundSubDocument, this.oldState);
        };
        return ChangeAnchoredTextBoxSizeHistoryItem;
    }(__aspxRichEdit.IntervalBasedHistoryItem));
    __aspxRichEdit.ChangeAnchoredTextBoxSizeHistoryItem = ChangeAnchoredTextBoxSizeHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChangeTextBoxPropertiesHistoryItem = (function (_super) {
        __extends(ChangeTextBoxPropertiesHistoryItem, _super);
        function ChangeTextBoxPropertiesHistoryItem(modelManipulator, boundSubDocument, interval, textBoxProperties) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, interval) || this;
            _this.textBoxProperties = textBoxProperties;
            return _this;
        }
        ChangeTextBoxPropertiesHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.floatingObjectsManipulator.textBoxProperties.setValue(this.boundSubDocument, this.interval, this.textBoxProperties);
        };
        ChangeTextBoxPropertiesHistoryItem.prototype.undo = function () {
            this.modelManipulator.floatingObjectsManipulator.textBoxProperties.restoreValue(this.boundSubDocument, this.oldState);
        };
        return ChangeTextBoxPropertiesHistoryItem;
    }(__aspxRichEdit.IntervalBasedHistoryItem));
    __aspxRichEdit.ChangeTextBoxPropertiesHistoryItem = ChangeTextBoxPropertiesHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertAnchoredObjectHistoryItemBase = (function (_super) {
        __extends(InsertAnchoredObjectHistoryItemBase, _super);
        function InsertAnchoredObjectHistoryItemBase(modelManipulator, boundSubDocument, position, maskedCharacterProperties, characterStyle, shape, anchorInfo) {
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.position = position;
            _this.maskedCharacterProperties = maskedCharacterProperties;
            _this.characterStyle = characterStyle;
            _this.shape = shape;
            _this.anchorInfo = anchorInfo;
            return _this;
        }
        InsertAnchoredObjectHistoryItemBase.prototype.undo = function () {
            this.modelManipulator.text.removeIntervalWithoutHistory(this.boundSubDocument, new __aspxRichEdit.FixedInterval(this.position, 1), false);
        };
        return InsertAnchoredObjectHistoryItemBase;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.InsertAnchoredObjectHistoryItemBase = InsertAnchoredObjectHistoryItemBase;
    var InsertAnchoredPictureHistoryItem = (function (_super) {
        __extends(InsertAnchoredPictureHistoryItem, _super);
        function InsertAnchoredPictureHistoryItem(modelManipulator, boundSubDocument, position, id, size, maskedCharacterProperties, characterStyle, shape, anchorInfo, isLoaded) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, position, maskedCharacterProperties, characterStyle, shape, anchorInfo) || this;
            _this.id = id;
            _this.size = size;
            _this.isLoaded = isLoaded;
            return _this;
        }
        InsertAnchoredPictureHistoryItem.prototype.redo = function () {
            this.modelManipulator.text.insertAnchoredPicture(this.boundSubDocument, this.position, this.id, this.size, this.maskedCharacterProperties, this.characterStyle, this.isLoaded, this.shape, this.anchorInfo);
            this.isLoaded = true;
        };
        return InsertAnchoredPictureHistoryItem;
    }(InsertAnchoredObjectHistoryItemBase));
    __aspxRichEdit.InsertAnchoredPictureHistoryItem = InsertAnchoredPictureHistoryItem;
    var InsertAnchoredTextBoxHistoryItem = (function (_super) {
        __extends(InsertAnchoredTextBoxHistoryItem, _super);
        function InsertAnchoredTextBoxHistoryItem(modelManipulator, boundSubDocument, position, size, maskedCharacterProperties, characterStyle, shape, textBoxProperties, anchorInfo, innerSubDocument) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, position, maskedCharacterProperties, characterStyle, shape, anchorInfo) || this;
            _this.size = size;
            _this.textBoxProperties = textBoxProperties;
            _this.innerSubDocument = innerSubDocument;
            return _this;
        }
        InsertAnchoredTextBoxHistoryItem.prototype.redo = function () {
            this.modelManipulator.text.insertAnchoredTextBox(this.boundSubDocument, this.position, this.size, this.maskedCharacterProperties, this.characterStyle, this.shape, this.textBoxProperties, this.anchorInfo, this.innerSubDocument);
        };
        return InsertAnchoredTextBoxHistoryItem;
    }(InsertAnchoredObjectHistoryItemBase));
    __aspxRichEdit.InsertAnchoredTextBoxHistoryItem = InsertAnchoredTextBoxHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ShapePropertyHistoryItem = (function (_super) {
        __extends(ShapePropertyHistoryItem, _super);
        function ShapePropertyHistoryItem(modelManipulator, boundSubDocument, interval, newValue, propertyManipulator) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, interval) || this;
            _this.newValue = newValue;
            _this.propertyManipulator = propertyManipulator;
            return _this;
        }
        ShapePropertyHistoryItem.prototype.redo = function () {
            this.oldState = this.propertyManipulator.setValue(this.boundSubDocument, this.interval, this.newValue);
        };
        ShapePropertyHistoryItem.prototype.undo = function () {
            this.propertyManipulator.restoreValue(this.boundSubDocument, this.oldState);
        };
        return ShapePropertyHistoryItem;
    }(__aspxRichEdit.IntervalBasedHistoryItem));
    __aspxRichEdit.ShapePropertyHistoryItem = ShapePropertyHistoryItem;
    var ShapeHistoryItem = (function (_super) {
        __extends(ShapeHistoryItem, _super);
        function ShapeHistoryItem(modelManipulator, boundSubDocument, interval, newValue) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, interval) || this;
            _this.newValue = newValue;
            return _this;
        }
        ShapeHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.floatingObjectsManipulator.shape.setValue(this.boundSubDocument, this.interval, this.newValue);
        };
        ShapeHistoryItem.prototype.undo = function () {
            this.modelManipulator.floatingObjectsManipulator.shape.restoreValue(this.boundSubDocument, this.oldState);
        };
        return ShapeHistoryItem;
    }(__aspxRichEdit.IntervalBasedHistoryItem));
    __aspxRichEdit.ShapeHistoryItem = ShapeHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SetSelectionHistoryItem = (function (_super) {
        __extends(SetSelectionHistoryItem, _super);
        function SetSelectionHistoryItem(modelManipulator, boundSubDocument, intervals, selection, upd, endOfLine, visibleModelPosition) {
            if (visibleModelPosition === void 0) { visibleModelPosition = __aspxRichEdit.ModelScrollManager.StandartScrollPosition; }
            var _this = _super.call(this, modelManipulator, boundSubDocument) || this;
            _this.selection = selection;
            _this.upd = upd;
            _this.endOfLine = endOfLine;
            _this.visibleModelPosition = visibleModelPosition;
            _this.forwardDirection = selection.forwardDirection;
            _this.oldIntervals = selection.getIntervalsClone();
            _this.oldEndOfLine = selection.endOfLine;
            _this.intervals = intervals;
            return _this;
        }
        SetSelectionHistoryItem.prototype.redo = function () {
            this.setSelection(this.intervals, this.endOfLine);
        };
        SetSelectionHistoryItem.prototype.undo = function () {
            if (this.selection.model.activeSubDocument === this.boundSubDocument)
                this.setSelection(this.oldIntervals, this.oldEndOfLine);
        };
        SetSelectionHistoryItem.prototype.setSelection = function (intervals, endOfLine) {
            for (var i = 0, interval; interval = intervals[i]; i++) {
                var start = this.forwardDirection ? interval.start : interval.end;
                var end = this.forwardDirection ? interval.end : interval.start;
                if (i === 0)
                    this.selection.deprecatedSetSelection(start, end, endOfLine, -1, this.upd, true, true, this.visibleModelPosition);
                else
                    this.selection.addSelection(start, end, endOfLine, -1, true, this.visibleModelPosition);
            }
            this.upd = __aspxRichEdit.UpdateInputPositionProperties.Yes;
        };
        return SetSelectionHistoryItem;
    }(__aspxRichEdit.HistoryItem));
    __aspxRichEdit.SetSelectionHistoryItem = SetSelectionHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ShiftTableStartPositionToTheRightHistoryItem = (function (_super) {
        __extends(ShiftTableStartPositionToTheRightHistoryItem, _super);
        function ShiftTableStartPositionToTheRightHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        ShiftTableStartPositionToTheRightHistoryItem.prototype.redo = function () {
            this.modelManipulator.tables.shiftTableStartPositionToTheRight(this.boundSubDocument, this.getTable());
        };
        ShiftTableStartPositionToTheRightHistoryItem.prototype.undo = function () {
            this.modelManipulator.tables.restoreShiftedTableStartPositionToTheRight(this.boundSubDocument, this.getTable());
        };
        return ShiftTableStartPositionToTheRightHistoryItem;
    }(__aspxRichEdit.TableBasedHistoryItem));
    __aspxRichEdit.ShiftTableStartPositionToTheRightHistoryItem = ShiftTableStartPositionToTheRightHistoryItem;
    var TableRowConditionalFormattingHistoryItem = (function (_super) {
        __extends(TableRowConditionalFormattingHistoryItem, _super);
        function TableRowConditionalFormattingHistoryItem(modelManipulator, boundSubDocument, tableIndex, rowIndex, formatting) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, tableIndex) || this;
            _this.formatting = formatting;
            _this.rowIndex = rowIndex;
            return _this;
        }
        TableRowConditionalFormattingHistoryItem.prototype.redo = function () {
            var row = this.getTable().rows[this.rowIndex];
            this.oldFormatting = row.conditionalFormatting;
            row.conditionalFormatting = this.formatting;
        };
        TableRowConditionalFormattingHistoryItem.prototype.undo = function () {
            this.getTable().rows[this.rowIndex].conditionalFormatting = this.oldFormatting;
        };
        return TableRowConditionalFormattingHistoryItem;
    }(__aspxRichEdit.TableBasedHistoryItem));
    __aspxRichEdit.TableRowConditionalFormattingHistoryItem = TableRowConditionalFormattingHistoryItem;
    var TableCellConditionalFormattingHistoryItem = (function (_super) {
        __extends(TableCellConditionalFormattingHistoryItem, _super);
        function TableCellConditionalFormattingHistoryItem(modelManipulator, boundSubDocument, tableIndex, rowIndex, cellIndex, formatting) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, tableIndex) || this;
            _this.formatting = formatting;
            _this.rowIndex = rowIndex;
            _this.cellIndex = cellIndex;
            return _this;
        }
        TableCellConditionalFormattingHistoryItem.prototype.redo = function () {
            var cell = this.getTable().rows[this.rowIndex].cells[this.cellIndex];
            this.oldFormatting = cell.conditionalFormatting;
            cell.conditionalFormatting = this.formatting;
        };
        TableCellConditionalFormattingHistoryItem.prototype.undo = function () {
            this.getTable().rows[this.rowIndex].cells[this.cellIndex].conditionalFormatting = this.oldFormatting;
        };
        return TableCellConditionalFormattingHistoryItem;
    }(__aspxRichEdit.TableBasedHistoryItem));
    __aspxRichEdit.TableCellConditionalFormattingHistoryItem = TableCellConditionalFormattingHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertTableRowHistoryItem = (function (_super) {
        __extends(InsertTableRowHistoryItem, _super);
        function InsertTableRowHistoryItem(modelManipulator, boundSubDocument, tableIndex, patternRow, targetRowIndex, cellIntervals) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, tableIndex) || this;
            _this.targetRowIndex = targetRowIndex;
            _this.cellIntervals = cellIntervals;
            _this.patternRow = patternRow;
            return _this;
        }
        InsertTableRowHistoryItem.prototype.redo = function () {
            this.modelManipulator.tables.insertRow(this.boundSubDocument, this.tableIndex, this.patternRow, this.targetRowIndex, this.cellIntervals);
        };
        InsertTableRowHistoryItem.prototype.undo = function () {
            this.modelManipulator.tables.removeRow(this.boundSubDocument, this.tableIndex, this.targetRowIndex);
        };
        return InsertTableRowHistoryItem;
    }(__aspxRichEdit.TableBasedHistoryItem));
    __aspxRichEdit.InsertTableRowHistoryItem = InsertTableRowHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RemoveTableCellHistoryItem = (function (_super) {
        __extends(RemoveTableCellHistoryItem, _super);
        function RemoveTableCellHistoryItem(modelManipulator, subDocument, tableIndex, rowIndex, cellIndex) {
            var _this = _super.call(this, modelManipulator, subDocument, tableIndex) || this;
            _this.rowIndex = rowIndex;
            _this.cellIndex = cellIndex;
            _this.cell = _this.getTable().rows[rowIndex].cells[cellIndex];
            _this.length = _this.cell.interval.length;
            return _this;
        }
        RemoveTableCellHistoryItem.prototype.redo = function () {
            this.modelManipulator.tables.removeCell(this.boundSubDocument, this.getTable(), this.rowIndex, this.cellIndex);
        };
        RemoveTableCellHistoryItem.prototype.undo = function () {
            this.modelManipulator.tables.insertCell(this.boundSubDocument, this.getTable(), this.rowIndex, this.cellIndex, this.cell, this.length);
        };
        return RemoveTableCellHistoryItem;
    }(__aspxRichEdit.TableBasedHistoryItem));
    __aspxRichEdit.RemoveTableCellHistoryItem = RemoveTableCellHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RemoveTableHistoryItem = (function (_super) {
        __extends(RemoveTableHistoryItem, _super);
        function RemoveTableHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        RemoveTableHistoryItem.prototype.redo = function () {
            this.table = this.getTable();
            this.cellsRanges = __aspxRichEdit.TableBasedHistoryItem.getTableCellsRanges(this.table);
            this.modelManipulator.tables.removeTable(this.boundSubDocument, this.table);
        };
        RemoveTableHistoryItem.prototype.undo = function () {
            this.modelManipulator.tables.restoreRemovedTable(this.boundSubDocument, this.table, this.cellsRanges);
        };
        return RemoveTableHistoryItem;
    }(__aspxRichEdit.TableBasedHistoryItem));
    __aspxRichEdit.RemoveTableHistoryItem = RemoveTableHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RemoveTableRowHistoryItem = (function (_super) {
        __extends(RemoveTableRowHistoryItem, _super);
        function RemoveTableRowHistoryItem(modelManipulator, subDocument, tableIndex, rowIndex) {
            var _this = _super.call(this, modelManipulator, subDocument, tableIndex) || this;
            _this.rowIndex = rowIndex;
            return _this;
        }
        RemoveTableRowHistoryItem.prototype.redo = function () {
            var table = this.getTable();
            this.oldRow = table.rows[this.rowIndex];
            this.cellIntervals = __aspxRichEdit.TableBasedHistoryItem.getRowCellsRanges(this.oldRow);
            this.modelManipulator.tables.removeRow(this.boundSubDocument, table.index, this.rowIndex);
        };
        RemoveTableRowHistoryItem.prototype.undo = function () {
            this.modelManipulator.tables.insertRow(this.boundSubDocument, this.getTable().index, this.oldRow, this.rowIndex, this.cellIntervals);
        };
        return RemoveTableRowHistoryItem;
    }(__aspxRichEdit.TableBasedHistoryItem));
    __aspxRichEdit.RemoveTableRowHistoryItem = RemoveTableRowHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var SplitTableCellToTheLeftHistoryItem = (function (_super) {
        __extends(SplitTableCellToTheLeftHistoryItem, _super);
        function SplitTableCellToTheLeftHistoryItem(modelManipulator, boundSubDocument, tableIndex, rowIndex, cellIndex, copyProperties) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, tableIndex) || this;
            _this.rowIndex = rowIndex;
            _this.cellIndex = cellIndex;
            _this.copyProperties = copyProperties;
            return _this;
        }
        SplitTableCellToTheLeftHistoryItem.prototype.redo = function () {
            this.modelManipulator.tables.splitTableCellHorizontally(this.boundSubDocument, this.getTable(), this.rowIndex, this.cellIndex, false, this.copyProperties);
        };
        SplitTableCellToTheLeftHistoryItem.prototype.undo = function () {
            this.modelManipulator.tables.restoreSplittedCellHorizontally(this.boundSubDocument, this.getTable(), this.rowIndex, this.cellIndex + 1, false);
        };
        return SplitTableCellToTheLeftHistoryItem;
    }(__aspxRichEdit.TableBasedHistoryItem));
    __aspxRichEdit.SplitTableCellToTheLeftHistoryItem = SplitTableCellToTheLeftHistoryItem;
    var SplitTableCellToTheRightHistoryItem = (function (_super) {
        __extends(SplitTableCellToTheRightHistoryItem, _super);
        function SplitTableCellToTheRightHistoryItem(modelManipulator, boundSubDocument, tableIndex, rowIndex, cellIndex, copyProperties) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, tableIndex) || this;
            _this.rowIndex = rowIndex;
            _this.cellIndex = cellIndex;
            _this.copyProperties = copyProperties;
            return _this;
        }
        SplitTableCellToTheRightHistoryItem.prototype.redo = function () {
            this.modelManipulator.tables.splitTableCellHorizontally(this.boundSubDocument, this.getTable(), this.rowIndex, this.cellIndex, true, this.copyProperties);
        };
        SplitTableCellToTheRightHistoryItem.prototype.undo = function () {
            this.modelManipulator.tables.restoreSplittedCellHorizontally(this.boundSubDocument, this.getTable(), this.rowIndex, this.cellIndex, true);
        };
        return SplitTableCellToTheRightHistoryItem;
    }(__aspxRichEdit.TableBasedHistoryItem));
    __aspxRichEdit.SplitTableCellToTheRightHistoryItem = SplitTableCellToTheRightHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableCellPropertiesHistoryItemBase = (function (_super) {
        __extends(TableCellPropertiesHistoryItemBase, _super);
        function TableCellPropertiesHistoryItemBase(modelManipulator, boundSubDocument, tableIndex, rowIndex, cellIndex, newValue) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, tableIndex) || this;
            _this.newValue = newValue;
            _this.rowIndex = rowIndex;
            _this.cellIndex = cellIndex;
            return _this;
        }
        return TableCellPropertiesHistoryItemBase;
    }(__aspxRichEdit.TableBasedHistoryItem));
    __aspxRichEdit.TableCellPropertiesHistoryItemBase = TableCellPropertiesHistoryItemBase;
    var TableCellColumnSpanHistoryItem = (function (_super) {
        __extends(TableCellColumnSpanHistoryItem, _super);
        function TableCellColumnSpanHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellColumnSpanHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.tables.cellProperties.columnSpan.setValue(this.boundSubDocument, this.tableIndex, this.rowIndex, this.cellIndex, this.newValue);
        };
        TableCellColumnSpanHistoryItem.prototype.undo = function () {
            this.modelManipulator.tables.cellProperties.columnSpan.restoreValue(this.boundSubDocument, this.oldState);
        };
        return TableCellColumnSpanHistoryItem;
    }(TableCellPropertiesHistoryItemBase));
    __aspxRichEdit.TableCellColumnSpanHistoryItem = TableCellColumnSpanHistoryItem;
    var TableCellVerticalMergingHistoryItem = (function (_super) {
        __extends(TableCellVerticalMergingHistoryItem, _super);
        function TableCellVerticalMergingHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellVerticalMergingHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.tables.cellProperties.verticalMerging.setValue(this.boundSubDocument, this.tableIndex, this.rowIndex, this.cellIndex, this.newValue);
        };
        TableCellVerticalMergingHistoryItem.prototype.undo = function () {
            this.modelManipulator.tables.cellProperties.verticalMerging.restoreValue(this.boundSubDocument, this.oldState);
        };
        TableCellVerticalMergingHistoryItem.fromPosition = function (modelManipulator, boundSubDocument, position, value) {
            return new TableCellVerticalMergingHistoryItem(modelManipulator, boundSubDocument, position.table.index, position.rowIndex, position.cellIndex, value);
        };
        return TableCellVerticalMergingHistoryItem;
    }(TableCellPropertiesHistoryItemBase));
    __aspxRichEdit.TableCellVerticalMergingHistoryItem = TableCellVerticalMergingHistoryItem;
    var TableCellPropertiesUseHistoryItemBase = (function (_super) {
        __extends(TableCellPropertiesUseHistoryItemBase, _super);
        function TableCellPropertiesUseHistoryItemBase(modelManipulator, boundSubDocument, tableIndex, rowIndex, cellIndex, newValues, newUse) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, tableIndex, rowIndex, cellIndex, newValues) || this;
            _this.newUse = newUse;
            return _this;
        }
        TableCellPropertiesUseHistoryItemBase.prototype.redo = function () {
            this.oldState = this.getManipulator().setValue(this.boundSubDocument, this.tableIndex, this.rowIndex, this.cellIndex, this.newValue, this.newUse);
        };
        TableCellPropertiesUseHistoryItemBase.prototype.undo = function () {
            this.getManipulator().restoreValue(this.boundSubDocument, this.oldState);
        };
        TableCellPropertiesUseHistoryItemBase.prototype.getManipulator = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return TableCellPropertiesUseHistoryItemBase;
    }(TableCellPropertiesHistoryItemBase));
    __aspxRichEdit.TableCellPropertiesUseHistoryItemBase = TableCellPropertiesUseHistoryItemBase;
    var TableCellPropertiesComplexUseHistoryItemBase = (function (_super) {
        __extends(TableCellPropertiesComplexUseHistoryItemBase, _super);
        function TableCellPropertiesComplexUseHistoryItemBase(modelManipulator, boundSubDocument, tableIndex, rowIndex, cellIndex, newValues, newUses) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, tableIndex, rowIndex, cellIndex, newValues) || this;
            if (newValues.length !== newUses.length)
                throw new Error("newValues.length should be equal to newUses.length");
            _this.newUses = newUses;
            return _this;
        }
        TableCellPropertiesComplexUseHistoryItemBase.prototype.redo = function () {
            this.oldState = this.getManipulator().setValue(this.boundSubDocument, this.tableIndex, this.rowIndex, this.cellIndex, this.newValue, this.newUses);
        };
        TableCellPropertiesComplexUseHistoryItemBase.prototype.undo = function () {
            this.getManipulator().restoreValue(this.boundSubDocument, this.oldState);
        };
        TableCellPropertiesComplexUseHistoryItemBase.prototype.getManipulator = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return TableCellPropertiesComplexUseHistoryItemBase;
    }(TableCellPropertiesHistoryItemBase));
    __aspxRichEdit.TableCellPropertiesComplexUseHistoryItemBase = TableCellPropertiesComplexUseHistoryItemBase;
    var TableCellCellMarginsHistoryItem = (function (_super) {
        __extends(TableCellCellMarginsHistoryItem, _super);
        function TableCellCellMarginsHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellCellMarginsHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.cellProperties.cellMargins;
        };
        return TableCellCellMarginsHistoryItem;
    }(TableCellPropertiesComplexUseHistoryItemBase));
    __aspxRichEdit.TableCellCellMarginsHistoryItem = TableCellCellMarginsHistoryItem;
    var TableCellBordersHistoryItem = (function (_super) {
        __extends(TableCellBordersHistoryItem, _super);
        function TableCellBordersHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellBordersHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.cellProperties.borders;
        };
        return TableCellBordersHistoryItem;
    }(TableCellPropertiesComplexUseHistoryItemBase));
    __aspxRichEdit.TableCellBordersHistoryItem = TableCellBordersHistoryItem;
    var TableCellPreferredWidthHistoryItem = (function (_super) {
        __extends(TableCellPreferredWidthHistoryItem, _super);
        function TableCellPreferredWidthHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellPreferredWidthHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.tables.cellProperties.preferredWidth.setValue(this.boundSubDocument, this.tableIndex, this.rowIndex, this.cellIndex, this.newValue);
        };
        TableCellPreferredWidthHistoryItem.prototype.undo = function () {
            this.modelManipulator.tables.cellProperties.preferredWidth.restoreValue(this.boundSubDocument, this.oldState);
        };
        return TableCellPreferredWidthHistoryItem;
    }(TableCellPropertiesHistoryItemBase));
    __aspxRichEdit.TableCellPreferredWidthHistoryItem = TableCellPreferredWidthHistoryItem;
    var TableCellHideCellMarkHistoryItem = (function (_super) {
        __extends(TableCellHideCellMarkHistoryItem, _super);
        function TableCellHideCellMarkHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellHideCellMarkHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.cellProperties.hideCellMark;
        };
        return TableCellHideCellMarkHistoryItem;
    }(TableCellPropertiesUseHistoryItemBase));
    __aspxRichEdit.TableCellHideCellMarkHistoryItem = TableCellHideCellMarkHistoryItem;
    var TableCellNoWrapHistoryItem = (function (_super) {
        __extends(TableCellNoWrapHistoryItem, _super);
        function TableCellNoWrapHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellNoWrapHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.cellProperties.noWrap;
        };
        return TableCellNoWrapHistoryItem;
    }(TableCellPropertiesUseHistoryItemBase));
    __aspxRichEdit.TableCellNoWrapHistoryItem = TableCellNoWrapHistoryItem;
    var TableCellFitTextHistoryItem = (function (_super) {
        __extends(TableCellFitTextHistoryItem, _super);
        function TableCellFitTextHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellFitTextHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.cellProperties.fitText;
        };
        return TableCellFitTextHistoryItem;
    }(TableCellPropertiesUseHistoryItemBase));
    __aspxRichEdit.TableCellFitTextHistoryItem = TableCellFitTextHistoryItem;
    var TableCellTextDirectionHistoryItem = (function (_super) {
        __extends(TableCellTextDirectionHistoryItem, _super);
        function TableCellTextDirectionHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellTextDirectionHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.cellProperties.textDirection;
        };
        return TableCellTextDirectionHistoryItem;
    }(TableCellPropertiesUseHistoryItemBase));
    __aspxRichEdit.TableCellTextDirectionHistoryItem = TableCellTextDirectionHistoryItem;
    var TableCellVerticalAlignmentHistoryItem = (function (_super) {
        __extends(TableCellVerticalAlignmentHistoryItem, _super);
        function TableCellVerticalAlignmentHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellVerticalAlignmentHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.cellProperties.verticalAlignment;
        };
        return TableCellVerticalAlignmentHistoryItem;
    }(TableCellPropertiesUseHistoryItemBase));
    __aspxRichEdit.TableCellVerticalAlignmentHistoryItem = TableCellVerticalAlignmentHistoryItem;
    var TableCellShadingInfoHistoryItem = (function (_super) {
        __extends(TableCellShadingInfoHistoryItem, _super);
        function TableCellShadingInfoHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellShadingInfoHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.cellProperties.shadingInfo;
        };
        return TableCellShadingInfoHistoryItem;
    }(TableCellPropertiesUseHistoryItemBase));
    __aspxRichEdit.TableCellShadingInfoHistoryItem = TableCellShadingInfoHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TablePropertiesHistoryItemBase = (function (_super) {
        __extends(TablePropertiesHistoryItemBase, _super);
        function TablePropertiesHistoryItemBase(modelManipulator, boundSubDocument, tableIndex, newValue) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, tableIndex) || this;
            _this.newValue = newValue;
            return _this;
        }
        return TablePropertiesHistoryItemBase;
    }(__aspxRichEdit.TableBasedHistoryItem));
    __aspxRichEdit.TablePropertiesHistoryItemBase = TablePropertiesHistoryItemBase;
    var TablePropertiesUseHistoryItemBase = (function (_super) {
        __extends(TablePropertiesUseHistoryItemBase, _super);
        function TablePropertiesUseHistoryItemBase(modelManipulator, boundSubDocument, tableIndex, newValues, newUse) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, tableIndex, newValues) || this;
            _this.newUse = newUse;
            return _this;
        }
        TablePropertiesUseHistoryItemBase.prototype.redo = function () {
            this.oldState = this.getManipulator().setValue(this.boundSubDocument, this.tableIndex, this.newValue, this.newUse);
        };
        TablePropertiesUseHistoryItemBase.prototype.undo = function () {
            this.getManipulator().restoreValue(this.boundSubDocument, this.oldState);
        };
        TablePropertiesUseHistoryItemBase.prototype.getManipulator = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return TablePropertiesUseHistoryItemBase;
    }(TablePropertiesHistoryItemBase));
    __aspxRichEdit.TablePropertiesUseHistoryItemBase = TablePropertiesUseHistoryItemBase;
    var TablePropertiesComplexUseHistoryItemBase = (function (_super) {
        __extends(TablePropertiesComplexUseHistoryItemBase, _super);
        function TablePropertiesComplexUseHistoryItemBase(modelManipulator, boundSubDocument, tableIndex, newValues, newUses) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, tableIndex, newValues) || this;
            if (newValues.length !== newUses.length)
                throw new Error("newValues.length should be equal to newUses.length");
            _this.newUses = newUses;
            return _this;
        }
        TablePropertiesComplexUseHistoryItemBase.prototype.redo = function () {
            this.oldState = this.getManipulator().setValue(this.boundSubDocument, this.tableIndex, this.newValue, this.newUses);
        };
        TablePropertiesComplexUseHistoryItemBase.prototype.undo = function () {
            this.getManipulator().restoreValue(this.boundSubDocument, this.oldState);
        };
        TablePropertiesComplexUseHistoryItemBase.prototype.getManipulator = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return TablePropertiesComplexUseHistoryItemBase;
    }(TablePropertiesHistoryItemBase));
    __aspxRichEdit.TablePropertiesComplexUseHistoryItemBase = TablePropertiesComplexUseHistoryItemBase;
    var TableCellMarginsHistoryItem = (function (_super) {
        __extends(TableCellMarginsHistoryItem, _super);
        function TableCellMarginsHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellMarginsHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.tableProperties.cellMargins;
        };
        return TableCellMarginsHistoryItem;
    }(TablePropertiesComplexUseHistoryItemBase));
    __aspxRichEdit.TableCellMarginsHistoryItem = TableCellMarginsHistoryItem;
    var TableCellSpacingHistoryItem = (function (_super) {
        __extends(TableCellSpacingHistoryItem, _super);
        function TableCellSpacingHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellSpacingHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.tableProperties.cellSpacing;
        };
        return TableCellSpacingHistoryItem;
    }(TablePropertiesUseHistoryItemBase));
    __aspxRichEdit.TableCellSpacingHistoryItem = TableCellSpacingHistoryItem;
    var TableIndentHistoryItem = (function (_super) {
        __extends(TableIndentHistoryItem, _super);
        function TableIndentHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableIndentHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.tableProperties.indent;
        };
        return TableIndentHistoryItem;
    }(TablePropertiesUseHistoryItemBase));
    __aspxRichEdit.TableIndentHistoryItem = TableIndentHistoryItem;
    var TablePreferredWidthHistoryItem = (function (_super) {
        __extends(TablePreferredWidthHistoryItem, _super);
        function TablePreferredWidthHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TablePreferredWidthHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.tables.tableProperties.preferredWidth.setValue(this.boundSubDocument, this.tableIndex, this.newValue);
        };
        TablePreferredWidthHistoryItem.prototype.undo = function () {
            this.modelManipulator.tables.tableProperties.preferredWidth.restoreValue(this.boundSubDocument, this.oldState);
        };
        return TablePreferredWidthHistoryItem;
    }(TablePropertiesHistoryItemBase));
    __aspxRichEdit.TablePreferredWidthHistoryItem = TablePreferredWidthHistoryItem;
    var TableBordersHistoryItem = (function (_super) {
        __extends(TableBordersHistoryItem, _super);
        function TableBordersHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableBordersHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.tableProperties.borders;
        };
        return TableBordersHistoryItem;
    }(TablePropertiesComplexUseHistoryItemBase));
    __aspxRichEdit.TableBordersHistoryItem = TableBordersHistoryItem;
    var TableTableStyleColumnBandSizeHistoryItem = (function (_super) {
        __extends(TableTableStyleColumnBandSizeHistoryItem, _super);
        function TableTableStyleColumnBandSizeHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableTableStyleColumnBandSizeHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.tableProperties.tableStyleColumnBandSize;
        };
        return TableTableStyleColumnBandSizeHistoryItem;
    }(TablePropertiesUseHistoryItemBase));
    __aspxRichEdit.TableTableStyleColumnBandSizeHistoryItem = TableTableStyleColumnBandSizeHistoryItem;
    var TableTableStyleRowBandSizeHistoryItem = (function (_super) {
        __extends(TableTableStyleRowBandSizeHistoryItem, _super);
        function TableTableStyleRowBandSizeHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableTableStyleRowBandSizeHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.tableProperties.tableStyleRowBandSize;
        };
        return TableTableStyleRowBandSizeHistoryItem;
    }(TablePropertiesUseHistoryItemBase));
    __aspxRichEdit.TableTableStyleRowBandSizeHistoryItem = TableTableStyleRowBandSizeHistoryItem;
    var TableAvoidDoubleBordersHistoryItem = (function (_super) {
        __extends(TableAvoidDoubleBordersHistoryItem, _super);
        function TableAvoidDoubleBordersHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableAvoidDoubleBordersHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.tableProperties.avoidDoubleBorders;
        };
        return TableAvoidDoubleBordersHistoryItem;
    }(TablePropertiesUseHistoryItemBase));
    __aspxRichEdit.TableAvoidDoubleBordersHistoryItem = TableAvoidDoubleBordersHistoryItem;
    var TableLayoutTypeHistoryItem = (function (_super) {
        __extends(TableLayoutTypeHistoryItem, _super);
        function TableLayoutTypeHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableLayoutTypeHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.tableProperties.layoutType;
        };
        return TableLayoutTypeHistoryItem;
    }(TablePropertiesUseHistoryItemBase));
    __aspxRichEdit.TableLayoutTypeHistoryItem = TableLayoutTypeHistoryItem;
    var TableLookTypesHistoryItem = (function (_super) {
        __extends(TableLookTypesHistoryItem, _super);
        function TableLookTypesHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableLookTypesHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.tables.tableProperties.lookTypes.setValue(this.boundSubDocument, this.tableIndex, this.newValue);
            __aspxRichEdit.TablesManipulator.resetParagraphCharacterMergedProperties(this.boundSubDocument, this.tableIndex);
        };
        TableLookTypesHistoryItem.prototype.undo = function () {
            this.modelManipulator.tables.tableProperties.lookTypes.restoreValue(this.boundSubDocument, this.oldState);
            __aspxRichEdit.TablesManipulator.resetParagraphCharacterMergedProperties(this.boundSubDocument, this.tableIndex);
        };
        return TableLookTypesHistoryItem;
    }(TablePropertiesHistoryItemBase));
    __aspxRichEdit.TableLookTypesHistoryItem = TableLookTypesHistoryItem;
    var TableShadingInfoHistoryItem = (function (_super) {
        __extends(TableShadingInfoHistoryItem, _super);
        function TableShadingInfoHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableShadingInfoHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.tableProperties.shadingInfo;
        };
        return TableShadingInfoHistoryItem;
    }(TablePropertiesUseHistoryItemBase));
    __aspxRichEdit.TableShadingInfoHistoryItem = TableShadingInfoHistoryItem;
    var TableTableRowAlignmentHistoryItem = (function (_super) {
        __extends(TableTableRowAlignmentHistoryItem, _super);
        function TableTableRowAlignmentHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableTableRowAlignmentHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.tableProperties.tableRowAlignment;
        };
        return TableTableRowAlignmentHistoryItem;
    }(TablePropertiesUseHistoryItemBase));
    __aspxRichEdit.TableTableRowAlignmentHistoryItem = TableTableRowAlignmentHistoryItem;
    var TableIsTableOverlapHistoryItem = (function (_super) {
        __extends(TableIsTableOverlapHistoryItem, _super);
        function TableIsTableOverlapHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableIsTableOverlapHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.tableProperties.isTableOverlap;
        };
        return TableIsTableOverlapHistoryItem;
    }(TablePropertiesUseHistoryItemBase));
    __aspxRichEdit.TableIsTableOverlapHistoryItem = TableIsTableOverlapHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableRowPropertiesHistoryItemBase = (function (_super) {
        __extends(TableRowPropertiesHistoryItemBase, _super);
        function TableRowPropertiesHistoryItemBase(modelManipulator, boundSubDocument, tableIndex, rowIndex, newValue) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, tableIndex) || this;
            _this.newValue = newValue;
            _this.rowIndex = rowIndex;
            return _this;
        }
        return TableRowPropertiesHistoryItemBase;
    }(__aspxRichEdit.TableBasedHistoryItem));
    __aspxRichEdit.TableRowPropertiesHistoryItemBase = TableRowPropertiesHistoryItemBase;
    var TableRowGridAfterHistoryItem = (function (_super) {
        __extends(TableRowGridAfterHistoryItem, _super);
        function TableRowGridAfterHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableRowGridAfterHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.tables.rowProperties.gridAfter.setValue(this.boundSubDocument, this.tableIndex, this.rowIndex, this.newValue);
        };
        TableRowGridAfterHistoryItem.prototype.undo = function () {
            this.modelManipulator.tables.rowProperties.gridAfter.restoreValue(this.boundSubDocument, this.oldState);
        };
        return TableRowGridAfterHistoryItem;
    }(TableRowPropertiesHistoryItemBase));
    __aspxRichEdit.TableRowGridAfterHistoryItem = TableRowGridAfterHistoryItem;
    var TableRowGridBeforeHistoryItem = (function (_super) {
        __extends(TableRowGridBeforeHistoryItem, _super);
        function TableRowGridBeforeHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableRowGridBeforeHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.tables.rowProperties.gridBefore.setValue(this.boundSubDocument, this.tableIndex, this.rowIndex, this.newValue);
        };
        TableRowGridBeforeHistoryItem.prototype.undo = function () {
            this.modelManipulator.tables.rowProperties.gridBefore.restoreValue(this.boundSubDocument, this.oldState);
        };
        return TableRowGridBeforeHistoryItem;
    }(TableRowPropertiesHistoryItemBase));
    __aspxRichEdit.TableRowGridBeforeHistoryItem = TableRowGridBeforeHistoryItem;
    var TableRowWidthAfterHistoryItem = (function (_super) {
        __extends(TableRowWidthAfterHistoryItem, _super);
        function TableRowWidthAfterHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableRowWidthAfterHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.tables.rowProperties.widthAfter.setValue(this.boundSubDocument, this.tableIndex, this.rowIndex, this.newValue);
        };
        TableRowWidthAfterHistoryItem.prototype.undo = function () {
            this.modelManipulator.tables.rowProperties.widthAfter.restoreValue(this.boundSubDocument, this.oldState);
        };
        return TableRowWidthAfterHistoryItem;
    }(TableRowPropertiesHistoryItemBase));
    __aspxRichEdit.TableRowWidthAfterHistoryItem = TableRowWidthAfterHistoryItem;
    var TableRowWidthBeforeHistoryItem = (function (_super) {
        __extends(TableRowWidthBeforeHistoryItem, _super);
        function TableRowWidthBeforeHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableRowWidthBeforeHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.tables.rowProperties.widthBefore.setValue(this.boundSubDocument, this.tableIndex, this.rowIndex, this.newValue);
        };
        TableRowWidthBeforeHistoryItem.prototype.undo = function () {
            this.modelManipulator.tables.rowProperties.widthBefore.restoreValue(this.boundSubDocument, this.oldState);
        };
        return TableRowWidthBeforeHistoryItem;
    }(TableRowPropertiesHistoryItemBase));
    __aspxRichEdit.TableRowWidthBeforeHistoryItem = TableRowWidthBeforeHistoryItem;
    var TableRowPropertiesUseHistoryItemBase = (function (_super) {
        __extends(TableRowPropertiesUseHistoryItemBase, _super);
        function TableRowPropertiesUseHistoryItemBase(modelManipulator, boundSubDocument, tableIndex, rowIndex, newValues, newUse) {
            var _this = _super.call(this, modelManipulator, boundSubDocument, tableIndex, rowIndex, newValues) || this;
            _this.newUse = newUse;
            return _this;
        }
        TableRowPropertiesUseHistoryItemBase.prototype.redo = function () {
            this.oldState = this.getManipulator().setValue(this.boundSubDocument, this.tableIndex, this.rowIndex, this.newValue, this.newUse);
        };
        TableRowPropertiesUseHistoryItemBase.prototype.undo = function () {
            this.getManipulator().restoreValue(this.boundSubDocument, this.oldState);
        };
        TableRowPropertiesUseHistoryItemBase.prototype.getManipulator = function () {
            throw new Error(__aspxRichEdit.Errors.NotImplemented);
        };
        return TableRowPropertiesUseHistoryItemBase;
    }(TableRowPropertiesHistoryItemBase));
    __aspxRichEdit.TableRowPropertiesUseHistoryItemBase = TableRowPropertiesUseHistoryItemBase;
    var TableRowHeightHistoryItem = (function (_super) {
        __extends(TableRowHeightHistoryItem, _super);
        function TableRowHeightHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableRowHeightHistoryItem.prototype.redo = function () {
            this.oldState = this.modelManipulator.tables.rowProperties.height.setValue(this.boundSubDocument, this.tableIndex, this.rowIndex, this.newValue);
        };
        TableRowHeightHistoryItem.prototype.undo = function () {
            this.modelManipulator.tables.rowProperties.height.restoreValue(this.boundSubDocument, this.oldState);
        };
        return TableRowHeightHistoryItem;
    }(TableRowPropertiesHistoryItemBase));
    __aspxRichEdit.TableRowHeightHistoryItem = TableRowHeightHistoryItem;
    var TableRowCellSpacingHistoryItem = (function (_super) {
        __extends(TableRowCellSpacingHistoryItem, _super);
        function TableRowCellSpacingHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableRowCellSpacingHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.rowProperties.cellSpacing;
        };
        return TableRowCellSpacingHistoryItem;
    }(TableRowPropertiesUseHistoryItemBase));
    __aspxRichEdit.TableRowCellSpacingHistoryItem = TableRowCellSpacingHistoryItem;
    var TableRowCantSplitHistoryItem = (function (_super) {
        __extends(TableRowCantSplitHistoryItem, _super);
        function TableRowCantSplitHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableRowCantSplitHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.rowProperties.cantSplit;
        };
        return TableRowCantSplitHistoryItem;
    }(TableRowPropertiesUseHistoryItemBase));
    __aspxRichEdit.TableRowCantSplitHistoryItem = TableRowCantSplitHistoryItem;
    var TableRowHideCellMarkHistoryItem = (function (_super) {
        __extends(TableRowHideCellMarkHistoryItem, _super);
        function TableRowHideCellMarkHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableRowHideCellMarkHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.rowProperties.hideCellMark;
        };
        return TableRowHideCellMarkHistoryItem;
    }(TableRowPropertiesUseHistoryItemBase));
    __aspxRichEdit.TableRowHideCellMarkHistoryItem = TableRowHideCellMarkHistoryItem;
    var TableRowHeaderHistoryItem = (function (_super) {
        __extends(TableRowHeaderHistoryItem, _super);
        function TableRowHeaderHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableRowHeaderHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.rowProperties.header;
        };
        return TableRowHeaderHistoryItem;
    }(TableRowPropertiesUseHistoryItemBase));
    __aspxRichEdit.TableRowHeaderHistoryItem = TableRowHeaderHistoryItem;
    var TableRowTableRowAlignmentHistoryItem = (function (_super) {
        __extends(TableRowTableRowAlignmentHistoryItem, _super);
        function TableRowTableRowAlignmentHistoryItem() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableRowTableRowAlignmentHistoryItem.prototype.getManipulator = function () {
            return this.modelManipulator.tables.rowProperties.tableRowAlignment;
        };
        return TableRowTableRowAlignmentHistoryItem;
    }(TableRowPropertiesUseHistoryItemBase));
    __aspxRichEdit.TableRowTableRowAlignmentHistoryItem = TableRowTableRowAlignmentHistoryItem;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var AnchorInfoManipulator = (function () {
        function AnchorInfoManipulator(manipulator) {
            this.allowOverlap = new AnchorInfoPropertyManipulator(manipulator, __aspxRichEdit.JSONAnchorInfoProperty.AllowOverlap, function (prop, val) { return prop.allowOverlap = val; }, function (prop) { return prop.allowOverlap; });
            this.hidden = new AnchorInfoPropertyManipulator(manipulator, __aspxRichEdit.JSONAnchorInfoProperty.Hidden, function (prop, val) { return prop.hidden = val; }, function (prop) { return prop.hidden; });
            this.layoutTableCell = new AnchorInfoPropertyManipulator(manipulator, __aspxRichEdit.JSONAnchorInfoProperty.LayoutTableCell, function (prop, val) { return prop.layoutTableCell = val; }, function (prop) { return prop.layoutTableCell; });
            this.locked = new AnchorInfoPropertyManipulator(manipulator, __aspxRichEdit.JSONAnchorInfoProperty.Locked, function (prop, val) { return prop.locked = val; }, function (prop) { return prop.locked; });
            this.isBehindDoc = new AnchorInfoPropertyManipulator(manipulator, __aspxRichEdit.JSONAnchorInfoProperty.IsBehindDoc, function (prop, val) { return prop.isBehindDoc = val; }, function (prop) { return prop.isBehindDoc; });
            this.leftDistance = new AnchorInfoPropertyManipulator(manipulator, __aspxRichEdit.JSONAnchorInfoProperty.LeftDistance, function (prop, val) { return prop.leftDistance = val; }, function (prop) { return prop.leftDistance; });
            this.rightDistance = new AnchorInfoPropertyManipulator(manipulator, __aspxRichEdit.JSONAnchorInfoProperty.RightDistance, function (prop, val) { return prop.rightDistance = val; }, function (prop) { return prop.rightDistance; });
            this.topDistance = new AnchorInfoPropertyManipulator(manipulator, __aspxRichEdit.JSONAnchorInfoProperty.TopDistance, function (prop, val) { return prop.topDistance = val; }, function (prop) { return prop.topDistance; });
            this.bottomDistance = new AnchorInfoPropertyManipulator(manipulator, __aspxRichEdit.JSONAnchorInfoProperty.BottomDistance, function (prop, val) { return prop.bottomDistance = val; }, function (prop) { return prop.bottomDistance; });
            this.zOrder = new AnchorInfoPropertyManipulator(manipulator, __aspxRichEdit.JSONAnchorInfoProperty.ZOrder, function (prop, val) { return prop.zOrder = val; }, function (prop) { return prop.zOrder; });
            this.wrapType = new AnchorInfoPropertyManipulator(manipulator, __aspxRichEdit.JSONAnchorInfoProperty.WrapType, function (prop, val) { return prop.wrapType = val; }, function (prop) { return prop.wrapType; });
            this.wrapSide = new AnchorInfoPropertyManipulator(manipulator, __aspxRichEdit.JSONAnchorInfoProperty.WrapSide, function (prop, val) { return prop.wrapSide = val; }, function (prop) { return prop.wrapSide; });
            this.horizontalPositionType = new AnchorInfoPropertyManipulator(manipulator, __aspxRichEdit.JSONAnchorInfoProperty.HorizontalPositionType, function (prop, val) { return prop.horizontalPositionType = val; }, function (prop) { return prop.horizontalPositionType; });
            this.horizontalPositionAlignment = new AnchorInfoPropertyManipulator(manipulator, __aspxRichEdit.JSONAnchorInfoProperty.HorizontalPositionAlignment, function (prop, val) { return prop.horizontalPositionAlignment = val; }, function (prop) { return prop.horizontalPositionAlignment; });
            this.verticalPositionType = new AnchorInfoPropertyManipulator(manipulator, __aspxRichEdit.JSONAnchorInfoProperty.VerticalPositionType, function (prop, val) { return prop.verticalPositionType = val; }, function (prop) { return prop.verticalPositionType; });
            this.verticalPositionAlignment = new AnchorInfoPropertyManipulator(manipulator, __aspxRichEdit.JSONAnchorInfoProperty.VerticalPositionAlignment, function (prop, val) { return prop.verticalPositionAlignment = val; }, function (prop) { return prop.verticalPositionAlignment; });
            this.offsetX = new AnchorInfoPropertyManipulator(manipulator, __aspxRichEdit.JSONAnchorInfoProperty.OffsetX, function (prop, val) { return prop.offset.x = val; }, function (prop) { return prop.offset.x; });
            this.offsetY = new AnchorInfoPropertyManipulator(manipulator, __aspxRichEdit.JSONAnchorInfoProperty.OffsetY, function (prop, val) { return prop.offset.y = val; }, function (prop) { return prop.offset.y; });
            this.percentOffsetX = new AnchorInfoPropertyManipulator(manipulator, __aspxRichEdit.JSONAnchorInfoProperty.PercentOffsetX, function (prop, val) { return prop.percentOffset.x = val; }, function (prop) { return prop.percentOffset.x; });
            this.percentOffsetY = new AnchorInfoPropertyManipulator(manipulator, __aspxRichEdit.JSONAnchorInfoProperty.PercentOffsetY, function (prop, val) { return prop.percentOffset.y = val; }, function (prop) { return prop.percentOffset.y; });
            this.manipulator = manipulator;
        }
        return AnchorInfoManipulator;
    }());
    __aspxRichEdit.AnchorInfoManipulator = AnchorInfoManipulator;
    var AnchorInfoPropertyManipulator = (function () {
        function AnchorInfoPropertyManipulator(manipulator, jsonAnchorInfoProperty, setPropertyValue, getPropertyValue) {
            this.manipulator = manipulator;
            this.jsonAnchorInfoProperty = jsonAnchorInfoProperty;
            this.setPropertyValue = setPropertyValue;
            this.getPropertyValue = getPropertyValue;
        }
        AnchorInfoPropertyManipulator.prototype.setValue = function (subDocument, interval, newValue) {
            var oldState = new __aspxRichEdit.HistoryItemIntervalState();
            var newState = new __aspxRichEdit.HistoryItemIntervalState();
            var run = subDocument.getRunByPosition(interval.start);
            var anchoredRun = run.getType() == __aspxRichEdit.RunType.AnchoredPictureRun ? run : run;
            var anchorInfo = anchoredRun.anchorInfo.clone();
            oldState.register(new __aspxRichEdit.HistoryItemIntervalStateObject(interval, this.getPropertyValue(anchorInfo)));
            this.setPropertyValue(anchorInfo, newValue);
            anchoredRun.anchorInfo = anchorInfo;
            newState.register(new __aspxRichEdit.HistoryItemIntervalStateObject(interval, newValue));
            this.manipulator.dispatcher.notifyAnchorInfoPropertyChanged(anchoredRun.anchoredObjectID, this.jsonAnchorInfoProperty, newState, subDocument);
            return oldState;
        };
        AnchorInfoPropertyManipulator.prototype.restoreValue = function (subDocument, state) {
            if (state.isEmpty())
                return;
            var stateValue = state.lastObject;
            var run = subDocument.getRunByPosition(stateValue.interval.start);
            var anchoredRun = run.getType() == __aspxRichEdit.RunType.AnchoredPictureRun ? run : run;
            this.setPropertyValue(anchoredRun.anchorInfo, stateValue.value);
            this.manipulator.dispatcher.notifyAnchorInfoPropertyChanged(anchoredRun.anchoredObjectID, this.jsonAnchorInfoProperty, state, subDocument);
        };
        return AnchorInfoPropertyManipulator;
    }());
    __aspxRichEdit.AnchorInfoPropertyManipulator = AnchorInfoPropertyManipulator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var FloatingObjectsManipulator = (function () {
        function FloatingObjectsManipulator(manipulator) {
            this.manipulator = manipulator;
            this.anchorInfo = new __aspxRichEdit.AnchorInfoManipulator(manipulator);
            this.shape = new __aspxRichEdit.ShapeManipulator(manipulator);
            this.textBoxSize = new AnchorTextBoxSizeManipulator(manipulator);
            this.pictureSize = new AnchorPictureSizeManipulator(manipulator);
            this.textBoxProperties = new __aspxRichEdit.TextBoxPropertiesManipulator(manipulator);
        }
        FloatingObjectsManipulator.insertAnchoredPicture = function (control, interval, id, size, shape, anchorInfo, isLoaded) {
            var subDocument = control.model.activeSubDocument;
            var documentEndPosition = subDocument.getDocumentEndPosition();
            if (interval.start >= documentEndPosition)
                throw "FloatingObjectsManipulator.insertAnchoredPicture interval.start >= documentEndPosition";
            if (interval.end > documentEndPosition)
                throw "FloatingObjectsManipulator.insertAnchoredPicture interval.end > documentEndPosition";
            if (interval.end == documentEndPosition)
                interval.length -= 1;
            var characterStyle = control.inputPosition.getCharacterStyle();
            control.history.beginTransaction();
            if (interval.length > 0) {
                __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(control, subDocument, new __aspxRichEdit.FixedInterval(interval.start, 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, control.selection.endOfLine);
                __aspxRichEdit.ModelManipulator.removeInterval(control, subDocument, interval, false, true);
            }
            control.history.addAndRedo(new __aspxRichEdit.InsertAnchoredPictureHistoryItem(control.modelManipulator, subDocument, interval.start, id, size, control.inputPosition.getMaskedCharacterProperties().clone(), characterStyle, shape, anchorInfo, isLoaded));
            __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(control, subDocument, new __aspxRichEdit.FixedInterval(interval.start, 1), __aspxRichEdit.UpdateInputPositionProperties.Yes, control.selection.endOfLine);
            control.history.endTransaction();
        };
        FloatingObjectsManipulator.insertAnchoredTextbox = function (control, subDocument, interval, size, shape, textBoxProperties, anchorInfo, innerSubDocument) {
            var documentEndPosition = subDocument.getDocumentEndPosition();
            if (interval.start >= documentEndPosition)
                throw "FloatingObjectsManipulator.insertAnchoredTextbox interval.start >= documentEndPosition";
            if (interval.end > documentEndPosition)
                throw "FloatingObjectsManipulator.insertAnchoredTextbox interval.end > documentEndPosition";
            if (interval.end == documentEndPosition)
                interval.length -= 1;
            var characterStyle = control.inputPosition.getCharacterStyle();
            control.history.beginTransaction();
            if (interval.length > 0) {
                __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(control, subDocument, new __aspxRichEdit.FixedInterval(interval.start, 0), __aspxRichEdit.UpdateInputPositionProperties.Yes, control.selection.endOfLine);
                __aspxRichEdit.ModelManipulator.removeInterval(control, subDocument, interval, false, true);
            }
            control.history.addAndRedo(new __aspxRichEdit.InsertAnchoredTextBoxHistoryItem(control.modelManipulator, subDocument, interval.start, size, control.inputPosition.getMaskedCharacterProperties().clone(), characterStyle, shape, textBoxProperties, anchorInfo, innerSubDocument));
            __aspxRichEdit.ModelManipulator.addToHistorySelectionHistoryItem(control, subDocument, new __aspxRichEdit.FixedInterval(interval.start, 1), __aspxRichEdit.UpdateInputPositionProperties.Yes, control.selection.endOfLine);
            control.history.endTransaction();
        };
        return FloatingObjectsManipulator;
    }());
    __aspxRichEdit.FloatingObjectsManipulator = FloatingObjectsManipulator;
    var AnchorSizeManipulatorBase = (function () {
        function AnchorSizeManipulatorBase(manipulator) {
            this.manipulator = manipulator;
        }
        AnchorSizeManipulatorBase.prototype.setValue = function (subDocument, interval, newValue) {
            var oldState = new __aspxRichEdit.HistoryItemIntervalState();
            var newState = new __aspxRichEdit.HistoryItemIntervalState();
            var run = subDocument.getRunByPosition(interval.start);
            var anchoredRun = run;
            oldState.register(new __aspxRichEdit.HistoryItemIntervalAnchorSizeStateObject(interval, anchoredRun.size.clone()));
            anchoredRun.size = newValue;
            newState.register(new __aspxRichEdit.HistoryItemIntervalAnchorSizeStateObject(interval, newValue));
            this.notify(newState.interval, anchoredRun.anchoredObjectID, newState, subDocument);
            return oldState;
        };
        AnchorSizeManipulatorBase.prototype.restoreValue = function (subDocument, state) {
            var stateValue = state.lastObject;
            var run = subDocument.getRunByPosition(stateValue.interval.start);
            var anchoredRun = run;
            anchoredRun.size = stateValue.value;
            this.notify(state.interval, anchoredRun.anchoredObjectID, state, subDocument);
        };
        return AnchorSizeManipulatorBase;
    }());
    __aspxRichEdit.AnchorSizeManipulatorBase = AnchorSizeManipulatorBase;
    var AnchorTextBoxSizeManipulator = (function (_super) {
        __extends(AnchorTextBoxSizeManipulator, _super);
        function AnchorTextBoxSizeManipulator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        AnchorTextBoxSizeManipulator.prototype.setValue = function (subDocument, interval, newValue) {
            return _super.prototype.setValue.call(this, subDocument, interval, newValue);
        };
        AnchorTextBoxSizeManipulator.prototype.notify = function (interval, objectId, newState, subDocument) {
            this.manipulator.dispatcher.notifyAnchoredTextBoxSizeChanged(interval, objectId, newState, subDocument);
        };
        return AnchorTextBoxSizeManipulator;
    }(AnchorSizeManipulatorBase));
    __aspxRichEdit.AnchorTextBoxSizeManipulator = AnchorTextBoxSizeManipulator;
    var AnchorPictureSizeManipulator = (function (_super) {
        __extends(AnchorPictureSizeManipulator, _super);
        function AnchorPictureSizeManipulator() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        AnchorPictureSizeManipulator.prototype.setValue = function (subDocument, interval, newValue) {
            return _super.prototype.setValue.call(this, subDocument, interval, newValue);
        };
        AnchorPictureSizeManipulator.prototype.notify = function (interval, objectId, newState, subDocument) {
            this.manipulator.dispatcher.notifyAnchoredPictureSizeChanged(interval, objectId, newState, subDocument);
        };
        return AnchorPictureSizeManipulator;
    }(AnchorSizeManipulatorBase));
    __aspxRichEdit.AnchorPictureSizeManipulator = AnchorPictureSizeManipulator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ShapeManipulator = (function () {
        function ShapeManipulator(manipulator) {
            this.fillColor = new ShapePropertyManipulator(manipulator, __aspxRichEdit.JSONShapeProperty.FillColor, function (prop, val) { return prop.fillColor = val; }, function (prop) { return prop.fillColor; });
            this.outlineColor = new ShapePropertyManipulator(manipulator, __aspxRichEdit.JSONShapeProperty.OutlineColor, function (prop, val) { return prop.outlineColor = val; }, function (prop) { return prop.outlineColor; });
            this.outlineWidth = new ShapePropertyManipulator(manipulator, __aspxRichEdit.JSONShapeProperty.OutlineWidth, function (prop, val) { return prop.outlineWidth = val; }, function (prop) { return prop.outlineWidth; });
            this.manipulator = manipulator;
        }
        ShapeManipulator.prototype.setValue = function (subDocument, interval, newValue) {
            var oldState = new __aspxRichEdit.HistoryItemIntervalState();
            var newState = new __aspxRichEdit.HistoryItemIntervalState();
            var run = subDocument.getRunByPosition(interval.start);
            var anchoredRun = run;
            oldState.register(new __aspxRichEdit.HistoryItemIntervalShapeStateObject(interval, anchoredRun.shape.clone()));
            anchoredRun.shape = newValue;
            newState.register(new __aspxRichEdit.HistoryItemIntervalShapeStateObject(interval, newValue));
            this.manipulator.dispatcher.notifyShapeChanged(anchoredRun.anchoredObjectID, newState, subDocument);
            return oldState;
        };
        ShapeManipulator.prototype.restoreValue = function (subDocument, state) {
            var stateValue = state.lastObject;
            var run = subDocument.getRunByPosition(stateValue.interval.start);
            var anchoredRun = run;
            anchoredRun.shape = stateValue.value;
            this.manipulator.dispatcher.notifyShapeChanged(anchoredRun.anchoredObjectID, state, subDocument);
        };
        return ShapeManipulator;
    }());
    __aspxRichEdit.ShapeManipulator = ShapeManipulator;
    var ShapePropertyManipulator = (function () {
        function ShapePropertyManipulator(manipulator, jsonShapeProperty, setPropertyValue, getPropertyValue) {
            this.manipulator = manipulator;
            this.jsonShapeProperty = jsonShapeProperty;
            this.setPropertyValue = setPropertyValue;
            this.getPropertyValue = getPropertyValue;
        }
        ShapePropertyManipulator.prototype.setValue = function (subDocument, interval, newValue) {
            var oldState = new __aspxRichEdit.HistoryItemIntervalState();
            var newState = new __aspxRichEdit.HistoryItemIntervalState();
            var run = subDocument.getRunByPosition(interval.start);
            var anchoredRun = run;
            var shape = anchoredRun.shape.clone();
            oldState.register(new __aspxRichEdit.HistoryItemIntervalStateObject(interval, this.getPropertyValue(shape)));
            this.setPropertyValue(shape, newValue);
            anchoredRun.shape = shape;
            newState.register(new __aspxRichEdit.HistoryItemIntervalStateObject(interval, newValue));
            this.manipulator.dispatcher.notifyShapePropertyChanged(anchoredRun.anchoredObjectID, this.jsonShapeProperty, newState, subDocument);
            return oldState;
        };
        ShapePropertyManipulator.prototype.restoreValue = function (subDocument, state) {
            if (state.isEmpty())
                return;
            var stateValue = state.lastObject;
            var run = subDocument.getRunByPosition(stateValue.interval.start);
            var anchoredRun = run;
            this.setPropertyValue(anchoredRun.shape, stateValue.value);
            this.manipulator.dispatcher.notifyShapePropertyChanged(anchoredRun.anchoredObjectID, this.jsonShapeProperty, state, subDocument);
        };
        return ShapePropertyManipulator;
    }());
    __aspxRichEdit.ShapePropertyManipulator = ShapePropertyManipulator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TextBoxPropertiesManipulator = (function () {
        function TextBoxPropertiesManipulator(manipulator) {
            this.manipulator = manipulator;
        }
        TextBoxPropertiesManipulator.prototype.setValue = function (subDocument, interval, newValue) {
            var oldState = new __aspxRichEdit.HistoryItemIntervalState();
            var newState = new __aspxRichEdit.HistoryItemIntervalState();
            var run = subDocument.getRunByPosition(interval.start);
            oldState.register(new __aspxRichEdit.HistoryItemIntervalAnchoredTextBoxPropertiesStateObject(interval, run.textBoxProperties.clone()));
            run.textBoxProperties = newValue;
            newState.register(new __aspxRichEdit.HistoryItemIntervalAnchoredTextBoxPropertiesStateObject(interval, newValue));
            this.manipulator.dispatcher.notifyAnchoredTextBoxPropertiesChanged(newState.interval, run.anchoredObjectID, newState, subDocument);
            return oldState;
        };
        TextBoxPropertiesManipulator.prototype.restoreValue = function (subDocument, state) {
            var stateValue = state.lastObject;
            var run = subDocument.getRunByPosition(stateValue.interval.start);
            run.textBoxProperties = stateValue.value;
            this.manipulator.dispatcher.notifyAnchoredTextBoxPropertiesChanged(state.interval, run.anchoredObjectID, state, subDocument);
        };
        return TextBoxPropertiesManipulator;
    }());
    __aspxRichEdit.TextBoxPropertiesManipulator = TextBoxPropertiesManipulator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var PosAndAncInfo = (function () {
        function PosAndAncInfo(anchorInfo, position) {
            this.anchorInfo = anchorInfo;
            this.position = position;
        }
        return PosAndAncInfo;
    }());
    __aspxRichEdit.PosAndAncInfo = PosAndAncInfo;
    var ZOrderManipulator = (function () {
        function ZOrderManipulator(manipulator) {
            this.manipulator = manipulator;
        }
        ZOrderManipulator.getNewZOrder = function (subDoc) {
            var objects = this.getFloatingObjects(subDoc);
            return objects.length ? __aspxRichEdit.ListUtils.last(objects).anchorInfo.zOrder + ZOrderManipulator.STEP : ZOrderManipulator.STEP;
        };
        ZOrderManipulator.getFloatingObjects = function (subDoc) {
            var anchorInfos = [];
            var iterator = new __aspxRichEdit.ModelIterator(subDoc, false);
            iterator.setPosition(0);
            do {
                if (__aspxRichEdit.EnumUtils.isAnyOf(iterator.run.getType(), __aspxRichEdit.RunType.AnchoredPictureRun, __aspxRichEdit.RunType.AnchoredTextBoxRun))
                    anchorInfos.push(new PosAndAncInfo(iterator.run.anchorInfo, iterator.getAbsolutePosition()));
            } while (iterator.moveToNextRun());
            return anchorInfos.sort(__aspxRichEdit.CompareUtils.getLayoutAnchoredObjectBoxComparer(null));
        };
        ZOrderManipulator.setNewZOrder = function (control, subDocument, position, newZOrder) {
            var modelManipulator = control.modelManipulator;
            control.history.addAndRedo(new __aspxRichEdit.AnchorInfoPropertyHistoryItem(modelManipulator, subDocument, new __aspxRichEdit.FixedInterval(position, 1), newZOrder, modelManipulator.floatingObjectsManipulator.anchorInfo.zOrder));
        };
        ZOrderManipulator.bringToFront = function (control, position) {
            var subDocument = control.selection.specialRunInfo.getParentSubDocument();
            var objects = this.getFloatingObjects(subDocument);
            if (__aspxRichEdit.ListUtils.last(objects).position == position)
                return true;
            var newZOrder = __aspxRichEdit.ListUtils.last(objects).anchorInfo.zOrder + ZOrderManipulator.STEP;
            ZOrderManipulator.setNewZOrder(control, subDocument, position, newZOrder);
            return true;
        };
        ZOrderManipulator.sendToBack = function (control, position) {
            var subDocument = control.selection.specialRunInfo.getParentSubDocument();
            var objects = this.getFloatingObjects(subDocument);
            var firstObject = objects[0];
            if (firstObject.position == position)
                return true;
            var minZOrder = firstObject.anchorInfo.zOrder;
            if (minZOrder > 0) {
                ZOrderManipulator.setNewZOrder(control, subDocument, position, Math.floor(minZOrder / 2));
                return true;
            }
            var objInd = __aspxRichEdit.ListUtils.indexBy(objects, function (elem) { return elem.position == position; });
            objects.splice(objInd, 1);
            control.history.beginTransaction();
            ZOrderManipulator.setNewZOrder(control, subDocument, position, 1);
            ZOrderManipulator.advanceOrder(control, subDocument, objects, 0, 2, false);
            control.history.endTransaction();
            return true;
        };
        ZOrderManipulator.bringForward = function (control, position) {
            var subDocument = control.selection.specialRunInfo.getParentSubDocument();
            var objects = this.getFloatingObjects(subDocument);
            if (__aspxRichEdit.ListUtils.last(objects).position == position)
                return true;
            var objInd = __aspxRichEdit.ListUtils.indexBy(objects, function (elem) { return elem.position == position; });
            var newZValue = objects[objInd + 1].anchorInfo.zOrder + 1;
            control.history.beginTransaction();
            ZOrderManipulator.setNewZOrder(control, subDocument, position, newZValue);
            ZOrderManipulator.advanceOrder(control, subDocument, objects, objInd + 2, newZValue + 1, objects[objInd].anchorInfo.levelType == __aspxRichEdit.AnchoredObjectLevelType.BehindText);
            control.history.endTransaction();
            return true;
        };
        ZOrderManipulator.sendBackward = function (control, position) {
            var subDocument = control.selection.specialRunInfo.getParentSubDocument();
            var objects = this.getFloatingObjects(subDocument);
            if (objects[0].position == position)
                return true;
            var objInd = __aspxRichEdit.ListUtils.indexBy(objects, function (elem) { return elem.position == position; });
            var newZValue = objects[objInd - 1].anchorInfo.zOrder + 1;
            var obj = objects.splice(objInd, 1)[0];
            control.history.beginTransaction();
            ZOrderManipulator.setNewZOrder(control, subDocument, position, newZValue);
            ZOrderManipulator.advanceOrder(control, subDocument, objects, objInd - 1, newZValue + 1, obj.anchorInfo.levelType == __aspxRichEdit.AnchoredObjectLevelType.BehindText);
            control.history.endTransaction();
        };
        ZOrderManipulator.advanceOrder = function (control, subDocument, objects, fromIndex, minValue, advanceOnlyBehindText) {
            for (var ind = fromIndex, obj = objects[fromIndex], nextObj = void 0; obj; ind++) {
                nextObj = objects[ind];
                if (obj.anchorInfo.zOrder >= minValue || advanceOnlyBehindText && obj.anchorInfo.levelType != __aspxRichEdit.AnchoredObjectLevelType.BehindText)
                    break;
                var interval = __aspxRichEdit.FixedInterval.fromPositions(minValue, nextObj ? nextObj.anchorInfo.zOrder : obj.anchorInfo.zOrder + ZOrderManipulator.STEP * 2).normalizeLength();
                minValue = Math.floor(interval.center);
                ZOrderManipulator.setNewZOrder(control, subDocument, obj.position, minValue);
                minValue++;
                obj = nextObj;
            }
        };
        ZOrderManipulator.STEP = 1024;
        return ZOrderManipulator;
    }());
    __aspxRichEdit.ZOrderManipulator = ZOrderManipulator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChunkSizeCorrector = (function () {
        function ChunkSizeCorrector() {
            this.maxChunkSize = 4096;
            this.maxRunSizeCoeff = 0.25;
            this.maxRunSize = Math.floor(this.maxRunSizeCoeff * this.maxChunkSize);
        }
        ChunkSizeCorrector.prototype.correctChunkSizeAtChunkIndex = function (subDocument, chunkIndex) {
            this.subDocument = subDocument;
            this.chunks = subDocument.chunks;
            this.originChunk = this.chunks[chunkIndex];
            this.originChunkIndex = chunkIndex;
            this.originChunkRuns = this.originChunk.textRuns;
            this.startCorrect();
        };
        ChunkSizeCorrector.prototype.correctChunkSizeAtInsertPosition = function (subDocument, insertPosition) {
            this.subDocument = subDocument;
            this.chunks = subDocument.chunks;
            var originRunInfo = this.subDocument.getRunAndIndexesByPosition(insertPosition);
            this.originChunk = originRunInfo.chunk;
            this.originChunkRuns = originRunInfo.chunk.textRuns;
            this.originChunkIndex = originRunInfo.chunkIndex;
            this.startCorrect();
        };
        ChunkSizeCorrector.prototype.startCorrect = function () {
            if (this.originChunk.textBuffer.length <= this.maxChunkSize)
                return;
            this.needMoveLength = this.originChunk.textBuffer.length - this.maxChunkSize;
            if (this.needMoveLength < this.maxChunkSize) {
                if (this.isMoveToPrevChunk())
                    return;
                if (this.isMoveToNextChunk())
                    return;
            }
            this.moveToNewNextChunks();
        };
        ChunkSizeCorrector.prototype.isMoveToPrevChunk = function () {
            var prevChunk = this.chunks[this.originChunkIndex - 1];
            if (!prevChunk)
                return false;
            var runIndexFrom = 0;
            var run;
            var totallyMoveLength = 0;
            for (; run = this.originChunkRuns[runIndexFrom]; runIndexFrom++) {
                if (run.getLength() > this.maxRunSize) {
                    this.originChunk.splitRun(runIndexFrom, this.maxRunSize);
                }
                totallyMoveLength += run.getLength();
                if (totallyMoveLength >= this.needMoveLength)
                    break;
            }
            if (totallyMoveLength + prevChunk.textBuffer.length > this.maxChunkSize)
                return false;
            var prevChunkOffset = prevChunk.textBuffer.length;
            for (; runIndexFrom >= 0; runIndexFrom--) {
                run = this.originChunkRuns.shift();
                prevChunk.textRuns.push(run);
                run.startOffset = prevChunkOffset;
                prevChunkOffset += run.getLength();
            }
            prevChunk.textBuffer += this.originChunk.textBuffer.substr(0, totallyMoveLength);
            this.originChunk.textBuffer = this.originChunk.textBuffer.substr(totallyMoveLength);
            this.subDocument.positionManager.unregisterPosition(this.originChunk.startLogPosition);
            this.originChunk.startLogPosition = this.subDocument.positionManager.registerPosition(this.originChunk.startLogPosition.value + totallyMoveLength);
            __aspxRichEdit.TextManipulator.moveRunsInChunk(this.originChunk, 0, -totallyMoveLength);
            return true;
        };
        ChunkSizeCorrector.prototype.isMoveToNextChunk = function () {
            var nextChunk = this.chunks[this.originChunkIndex + 1];
            if (!nextChunk)
                return false;
            var runIndexFrom = this.originChunkRuns.length - 1;
            var run;
            var totallyMoveLength = 0;
            for (; run = this.originChunkRuns[runIndexFrom]; runIndexFrom--) {
                while (run.getLength() > this.maxRunSize) {
                    this.originChunk.splitRun(runIndexFrom, this.maxRunSize);
                    run = this.originChunkRuns[++runIndexFrom];
                }
                totallyMoveLength += run.getLength();
                if (totallyMoveLength >= this.needMoveLength)
                    break;
            }
            if (totallyMoveLength + nextChunk.textBuffer.length > this.maxChunkSize)
                return false;
            __aspxRichEdit.TextManipulator.moveRunsInChunk(nextChunk, 0, totallyMoveLength);
            var offsetFirstRun = totallyMoveLength;
            for (runIndexFrom = this.originChunkRuns.length - runIndexFrom; runIndexFrom > 0; runIndexFrom--) {
                run = this.originChunkRuns.pop();
                nextChunk.textRuns.unshift(run);
                offsetFirstRun -= run.getLength();
                run.startOffset = offsetFirstRun;
            }
            var startMovedPosition = this.originChunk.textBuffer.length - totallyMoveLength;
            nextChunk.textBuffer = this.originChunk.textBuffer.substring(startMovedPosition) + nextChunk.textBuffer;
            this.originChunk.textBuffer = this.originChunk.textBuffer.substring(0, startMovedPosition);
            this.subDocument.positionManager.unregisterPosition(nextChunk.startLogPosition);
            nextChunk.startLogPosition = this.subDocument.positionManager.registerPosition(nextChunk.startLogPosition.value - totallyMoveLength);
            return true;
        };
        ChunkSizeCorrector.prototype.moveToNewNextChunks = function () {
            var runIndexFrom = this.originChunkRuns.length - 1;
            var run;
            var totallyMoveLength = 0;
            for (; run = this.originChunkRuns[runIndexFrom]; runIndexFrom--) {
                while (run.getLength() > this.maxRunSize) {
                    this.originChunk.splitRun(runIndexFrom, this.maxRunSize);
                    run = this.originChunkRuns[++runIndexFrom];
                }
                totallyMoveLength += run.getLength();
                if (totallyMoveLength >= this.needMoveLength)
                    break;
            }
            var newChunk = undefined;
            var runOffset = 0;
            var indexInsertNewChunk = this.originChunkIndex + 1;
            var chunkStartPosition = this.originChunk.startLogPosition.value + this.originChunkRuns[runIndexFrom].startOffset;
            for (var currRunIndex = runIndexFrom; run = this.originChunkRuns[currRunIndex]; currRunIndex++) {
                if (newChunk == undefined || runOffset + run.getLength() > this.maxChunkSize) {
                    if (newChunk)
                        newChunk.textBuffer = this.originChunk.textBuffer.substr(newChunk.startLogPosition.value - this.originChunk.startLogPosition.value, runOffset);
                    newChunk = new __aspxRichEdit.Chunk(this.subDocument.positionManager.registerPosition(chunkStartPosition), "", false);
                    this.chunks.splice(indexInsertNewChunk, 0, newChunk);
                    indexInsertNewChunk++;
                    runOffset = 0;
                }
                newChunk.textRuns.push(run);
                run.startOffset = runOffset;
                chunkStartPosition += run.getLength();
                runOffset += run.getLength();
            }
            newChunk.textBuffer = this.originChunk.textBuffer.substr(newChunk.startLogPosition.value - this.originChunk.startLogPosition.value, runOffset);
            var originPrevRun = this.originChunkRuns[runIndexFrom - 1];
            this.originChunk.textBuffer = this.originChunk.textBuffer.substring(0, originPrevRun.startOffset + originPrevRun.getLength());
            this.originChunkRuns.splice(runIndexFrom);
            this.originChunk.isLast = false;
            this.chunks[this.chunks.length - 1].isLast = true;
        };
        return ChunkSizeCorrector;
    }());
    __aspxRichEdit.ChunkSizeCorrector = ChunkSizeCorrector;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var CreateRangeCopyOperation = (function () {
        function CreateRangeCopyOperation(subDocument) {
            this.oldFieldStartIndex = -1;
            this.newOffsetAtStartChunk = 0;
            this.additionalParagraphRunPositions = {};
            this.subDocument = subDocument;
            this.documentModel = subDocument.documentModel;
        }
        CreateRangeCopyOperation.prototype.execute = function (intervals) {
            var newDocumentModel = this.initNewDocumentModel();
            var newSubDocument = newDocumentModel.activeSubDocument;
            for (var _i = 0, intervals_3 = intervals; _i < intervals_3.length; _i++) {
                var interval = intervals_3[_i];
                this.copyMainContent(interval, newDocumentModel);
            }
            __aspxRichEdit.BookmarksManipulator.copyBookmarksFromSubDocumentTo(this.subDocument, newSubDocument, intervals);
            newSubDocument.getLastChunk().isLast = true;
            this.copyTables(newSubDocument, intervals);
            var addedUselessParagraphMarkInEnd = this.tryAppendAdditionalParagraphRunInTheEnd(newSubDocument, false);
            return new RangeCopy(newDocumentModel, addedUselessParagraphMarkInEnd);
        };
        CreateRangeCopyOperation.prototype.copyMainContent = function (interval, newDocumentModel) {
            var newSubDocument = newDocumentModel.activeSubDocument;
            var constRunIterator = this.subDocument.getConstRunIterator(interval);
            var numberingListCache = {};
            var abstractNumberingListCache = {};
            while (constRunIterator.moveNext()) {
                var oldCurrentRun = constRunIterator.currentRun;
                if (this.oldCurrentSection != constRunIterator.currentSection) {
                    this.oldCurrentSection = constRunIterator.currentSection;
                    this.newCurrentSection = this.appendNewSection(newSubDocument);
                }
                if (this.oldCurrentParagraph != oldCurrentRun.paragraph) {
                    this.oldCurrentParagraph = oldCurrentRun.paragraph;
                    this.newCurrentParagraph = this.appendNewParagraph(newSubDocument, abstractNumberingListCache, numberingListCache);
                }
                if (this.oldCurrentChunk != constRunIterator.currentChunk) {
                    this.oldCurrentChunk = constRunIterator.currentChunk;
                    this.newCurrentChunk = this.appendNewChunk(newSubDocument);
                    this.newOffsetAtStartChunk = 0;
                }
                this.newCurrentParagraph.length += oldCurrentRun.getLength();
                this.newCurrentSection.setLength(newSubDocument, this.newCurrentSection.getLength() + oldCurrentRun.getLength());
                this.newCurrentChunk.textBuffer += this.oldCurrentChunk.getTextInChunk(oldCurrentRun.startOffset, oldCurrentRun.getLength());
                if (oldCurrentRun.getType() == __aspxRichEdit.RunType.FieldCodeStartRun)
                    this.appendField(newSubDocument, oldCurrentRun, interval);
                this.newCurrentChunk.textRuns.push(oldCurrentRun.createSimularity(this.newOffsetAtStartChunk, oldCurrentRun.getLength(), this.newCurrentParagraph, newDocumentModel.stylesManager.addCharacterStyle(oldCurrentRun.characterStyle), newDocumentModel.cache.maskedCharacterPropertiesCache.getItem(oldCurrentRun.maskedCharacterProperties)));
                this.newOffsetAtStartChunk += oldCurrentRun.getLength();
            }
        };
        CreateRangeCopyOperation.prototype.appendField = function (newSubDocument, oldCurrentRun, interval) {
            var oldFieldStartIndex = this.oldFieldStartIndex;
            var oldSubDocument = this.subDocument;
            if (oldFieldStartIndex < 0) {
                var oldFieldStartCodeRunOffset = this.oldCurrentChunk.startLogPosition.value + oldCurrentRun.startOffset;
                oldFieldStartIndex = __aspxRichEdit.Field.normedBinaryIndexOf(oldSubDocument.fields, oldFieldStartCodeRunOffset + 1);
            }
            else
                oldFieldStartIndex++;
            var oldField = oldSubDocument.fields[oldFieldStartIndex];
            var newField = new __aspxRichEdit.Field(newSubDocument.positionManager, newSubDocument.fields.length, oldField.getFieldStartPosition() - interval.start, oldField.getSeparatorPosition() - interval.start, oldField.getFieldEndPosition() - interval.start, oldField.showCode, oldField.getHyperlinkInfo() ? oldField.getHyperlinkInfo().clone() : undefined);
            newSubDocument.fields.push(newField);
            newField.initParent(newSubDocument.fields);
            this.oldFieldStartIndex = oldFieldStartIndex;
        };
        CreateRangeCopyOperation.prototype.appendParagraphMarkInTheEnd = function (newSubDocument, lastRun, sectionEnd) {
            this.newCurrentParagraph.length += 1;
            this.newCurrentSection.setLength(newSubDocument, this.newCurrentSection.getLength() + 1);
            var text = sectionEnd ? __aspxRichEdit.RichUtils.specialCharacters.SectionMark : __aspxRichEdit.RichUtils.specialCharacters.ParagraphMark;
            var runType = sectionEnd ? __aspxRichEdit.SectionRun : __aspxRichEdit.ParagraphRun;
            this.newCurrentChunk.textBuffer += text;
            this.newCurrentChunk.textRuns.push(new runType(lastRun.startOffset + lastRun.getLength(), this.newCurrentParagraph, newSubDocument.getLastRun().characterStyle, newSubDocument.getLastRun().maskedCharacterProperties));
            this.newOffsetAtStartChunk++;
        };
        CreateRangeCopyOperation.prototype.appendNewChunk = function (newSubDocument) {
            var newCurrentChunkAbsolutePosition = newSubDocument.chunks.length ? newSubDocument.getLastChunk().getEndPosition() : 0, newCurrentChunkPosition = newSubDocument.positionManager.registerPosition(newCurrentChunkAbsolutePosition), newCurrentChunk = new __aspxRichEdit.Chunk(newCurrentChunkPosition, "", false);
            newSubDocument.chunks.push(newCurrentChunk);
            return newCurrentChunk;
        };
        CreateRangeCopyOperation.prototype.appendNewSection = function (newSubDocument) {
            this.tryAppendAdditionalParagraphRunInTheEnd(newSubDocument, true);
            var lastSection = newSubDocument.documentModel.sections[newSubDocument.documentModel.sections.length - 1];
            var newCurrentSectionAbsolutePosition = lastSection ? lastSection.getEndPosition() : 0, newCurrentSectionPosition = newSubDocument.positionManager.registerPosition(newCurrentSectionAbsolutePosition);
            var newCurrentSection = new __aspxRichEdit.Section(newSubDocument.documentModel, newCurrentSectionPosition, 0, this.oldCurrentSection.sectionProperties.clone());
            newSubDocument.documentModel.sections.push(newCurrentSection);
            return newCurrentSection;
        };
        CreateRangeCopyOperation.prototype.appendNewParagraph = function (newSubDocument, abstractNumberingListCache, numberingListCache) {
            this.tryAppendAdditionalParagraphRunInTheEnd(newSubDocument, false);
            var oldCurrentParagraph = this.oldCurrentParagraph;
            var oldDocumentModel = oldCurrentParagraph.subDocument.documentModel;
            var lastParagraph = newSubDocument.paragraphs[newSubDocument.paragraphs.length - 1];
            var newCurrentParagraphAbsolutePosition = lastParagraph ? lastParagraph.getEndPosition() : 0;
            var newCurrentParagraphPosition = newSubDocument.positionManager.registerPosition(newCurrentParagraphAbsolutePosition);
            var newCurrentParagraphStyle = newSubDocument.documentModel.stylesManager.addParagraphStyle(oldCurrentParagraph.paragraphStyle);
            var newCurrentMaskedParagraphProperties = newSubDocument.documentModel.cache.maskedParagraphPropertiesCache.getItem(oldCurrentParagraph.maskedParagraphProperties);
            var newCurrentParagraph = new __aspxRichEdit.Paragraph(newSubDocument, newCurrentParagraphPosition, 0, newCurrentParagraphStyle, newCurrentMaskedParagraphProperties);
            var newCurrentParagraphNumberingListIndex = -1, newAbstractNumberingListIndex = -1;
            if (oldCurrentParagraph.numberingListIndex >= 0) {
                var oldNumberingList = oldDocumentModel.numberingLists[oldCurrentParagraph.numberingListIndex];
                newCurrentParagraphNumberingListIndex = numberingListCache[oldNumberingList.getId()];
                if (newCurrentParagraphNumberingListIndex === undefined) {
                    var oldAbstractNumberingList = oldDocumentModel.abstractNumberingLists[oldNumberingList.abstractNumberingListIndex];
                    newAbstractNumberingListIndex = abstractNumberingListCache[oldAbstractNumberingList.getId()];
                    if (newAbstractNumberingListIndex === undefined) {
                        var newAbstractNumberingList = new __aspxRichEdit.AbstractNumberingList(newSubDocument.documentModel);
                        newAbstractNumberingList.copyFrom(oldAbstractNumberingList);
                        newAbstractNumberingListIndex = newSubDocument.documentModel.abstractNumberingLists.push(newAbstractNumberingList) - 1;
                        abstractNumberingListCache[oldAbstractNumberingList.getId()] = newAbstractNumberingListIndex;
                    }
                    var newNumberingList = new __aspxRichEdit.NumberingList(newSubDocument.documentModel, newAbstractNumberingListIndex);
                    newNumberingList.copyFrom(oldNumberingList);
                    newCurrentParagraphNumberingListIndex = newSubDocument.documentModel.numberingLists.push(newNumberingList) - 1;
                    numberingListCache[oldNumberingList.getId()] = newCurrentParagraphNumberingListIndex;
                }
            }
            newCurrentParagraph.listLevelIndex = oldCurrentParagraph.listLevelIndex;
            newCurrentParagraph.numberingListIndex = newCurrentParagraphNumberingListIndex;
            newSubDocument.paragraphs.push(newCurrentParagraph);
            return newCurrentParagraph;
        };
        CreateRangeCopyOperation.prototype.tryAppendAdditionalParagraphRunInTheEnd = function (newSubDocument, sectionEnd) {
            var lastChunk = newSubDocument.getLastChunk();
            if (!lastChunk)
                return;
            var lastRun = lastChunk.textRuns[lastChunk.textRuns.length - 1];
            if (!lastRun)
                return;
            if (!lastRun.isParagraphOrSectionRun()) {
                this.appendParagraphMarkInTheEnd(newSubDocument, lastRun, sectionEnd);
                this.additionalParagraphRunPositions[lastChunk.getEndPosition() - 1] = true;
                return true;
            }
            return false;
        };
        CreateRangeCopyOperation.prototype.initNewDocumentModel = function () {
            var newDocumentModel = new __aspxRichEdit.DocumentModel(this.documentModel.options, 0);
            newDocumentModel.defaultCharacterProperties = newDocumentModel.cache.maskedCharacterPropertiesCache.getItem(this.documentModel.defaultCharacterProperties);
            newDocumentModel.defaultParagraphProperties = newDocumentModel.cache.maskedParagraphPropertiesCache.getItem(this.documentModel.defaultParagraphProperties);
            newDocumentModel.defaultTableProperties = this.documentModel.defaultTableProperties.clone();
            newDocumentModel.defaultTableRowProperties = newDocumentModel.cache.tableRowPropertiesCache.getItem(this.documentModel.defaultTableRowProperties);
            newDocumentModel.defaultTableCellProperties = newDocumentModel.cache.tableCellPropertiesCache.getItem(this.documentModel.defaultTableCellProperties);
            return newDocumentModel;
        };
        CreateRangeCopyOperation.prototype.copyTables = function (newSubDocument, intervals) {
            var tables = this.subDocument.tables;
            if (!tables.length)
                return;
            var pos = intervals[0].start;
            var startTableIndex = Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(tables, function (t) { return t.getStartPosition(); }, pos));
            startTableIndex = __aspxRichEdit.Table.correctBoundTable(tables, startTableIndex, pos, function (index) { return --index; }).index;
            var nestedLevel = -1;
            var endSelectionPosition = intervals[0].end;
            var prevLength = 0;
            for (var i = startTableIndex, table = void 0; table = this.subDocument.tables[i]; i++) {
                if (table.nestedLevel != nestedLevel)
                    nestedLevel = table.nestedLevel > nestedLevel ? nestedLevel + 1 : -1;
                var tableStartPosition = table.getStartPosition();
                var tableInterval = table.interval;
                while (intervals.length > 0 && tableStartPosition >= intervals[0].end) {
                    if (this.additionalParagraphRunPositions[intervals[0].end])
                        prevLength++;
                    prevLength += intervals[0].length;
                    intervals.shift();
                }
                if (!intervals.length)
                    break;
                if (__aspxRichEdit.IntervalAlgorithms.getIntersectionNonNullLength(table.interval, intervals[0])) {
                    if (intervals[0].containsInterval(tableInterval)) {
                        this.appendWholeTable(newSubDocument, table, intervals[0].start - prevLength, nestedLevel);
                    }
                    else {
                        var selectedCellInfos = this.getSelectedCells(table, intervals.slice(0), prevLength);
                        if (this.canCopyParticallyTable(selectedCellInfos))
                            this.appendParticallyTable(newSubDocument, selectedCellInfos, nestedLevel);
                        else
                            nestedLevel = -1;
                    }
                }
                else if (tableStartPosition >= endSelectionPosition)
                    break;
            }
        };
        CreateRangeCopyOperation.prototype.appendWholeTable = function (newSubDocument, table, positionDelta, newNestedLevel) {
            var newTable = this.createTable(newSubDocument, table, newNestedLevel, positionDelta);
            newTable.preferredWidth = table.preferredWidth.clone();
            newTable.lookTypes = table.lookTypes;
            for (var i = 0, row = void 0; row = table.rows[i]; i++) {
                var newRow = new __aspxRichEdit.TableRow(newTable, newSubDocument.documentModel.cache.tableRowPropertiesCache.getItem(row.properties.clone()));
                newTable.rows.push(newRow);
                newRow.height = row.height.clone();
                if (row.tablePropertiesException)
                    newRow.tablePropertiesException = row.tablePropertiesException.clone();
                newRow.gridBefore = row.gridBefore;
                newRow.gridAfter = row.gridAfter;
                newRow.widthAfter = row.widthAfter.clone();
                newRow.widthBefore = row.widthBefore.clone();
                for (var j = 0, cell = void 0; cell = row.cells[j]; j++) {
                    var newCell = this.cloneTableCell(newSubDocument, newRow, cell);
                    newCell.verticalMerging = cell.verticalMerging;
                    newCell.startParagraphPosition = newSubDocument.positionManager.registerPosition(cell.startParagraphPosition.value - positionDelta);
                    newCell.endParagrapPosition = newSubDocument.positionManager.registerPosition(cell.endParagrapPosition.value - positionDelta);
                    newRow.cells.push(newCell);
                }
            }
        };
        CreateRangeCopyOperation.prototype.appendParticallyTable = function (newSubDocument, selectedCellInfos, newNestedLevel) {
            var minLeftColumnIndex = Number.MAX_VALUE;
            var maxRightColumnIndex = 0;
            var table = selectedCellInfos[0][0].cell.parentRow.parentTable;
            for (var i = 0, horCells = void 0; horCells = selectedCellInfos[i]; i++) {
                var leftColumnIndex = __aspxRichEdit.TableCellUtils.getStartColumnIndex(horCells[0].cell);
                var rightColumnIndex = __aspxRichEdit.TableCellUtils.getEndColumnIndex(horCells[horCells.length - 1].cell);
                minLeftColumnIndex = Math.min(minLeftColumnIndex, leftColumnIndex);
                maxRightColumnIndex = Math.max(maxRightColumnIndex, rightColumnIndex);
            }
            var newStartPosition = selectedCellInfos[0][0].cell.startParagraphPosition.value - selectedCellInfos[0][0].positionDelta;
            var newTable = this.createTable(newSubDocument, table, newNestedLevel, newStartPosition);
            newTable.preferredWidth = __aspxRichEdit.TableWidthUnit.create(0, __aspxRichEdit.TableWidthUnitType.Auto);
            for (var i = 0, horCellInfos = void 0; horCellInfos = selectedCellInfos[i]; i++) {
                var leftColumnIndex = __aspxRichEdit.TableCellUtils.getStartColumnIndex(horCellInfos[0].cell);
                var rightColumnIndex = __aspxRichEdit.TableCellUtils.getEndColumnIndex(horCellInfos[horCellInfos.length - 1].cell);
                var row = horCellInfos[0].cell.parentRow;
                var newRow = new __aspxRichEdit.TableRow(newTable, newSubDocument.documentModel.cache.tableRowPropertiesCache.getItem(row.properties.clone()));
                newTable.rows.push(newRow);
                newRow.height = row.height.clone();
                newRow.gridBefore = leftColumnIndex - minLeftColumnIndex;
                newRow.gridAfter = maxRightColumnIndex - rightColumnIndex;
                for (var j = 0, cellInfo = void 0; cellInfo = horCellInfos[j]; j++) {
                    var newCell = this.cloneTableCell(newSubDocument, newRow, cellInfo.cell);
                    newCell.startParagraphPosition = newSubDocument.positionManager.registerPosition(cellInfo.cell.startParagraphPosition.value - cellInfo.positionDelta);
                    newCell.endParagrapPosition = newSubDocument.positionManager.registerPosition(cellInfo.cell.endParagrapPosition.value - cellInfo.positionDelta);
                    newRow.cells.push(newCell);
                }
            }
            __aspxRichEdit.TablesManipulator.normalizeCellColumnSpansWithoutHistory(newTable, true);
        };
        CreateRangeCopyOperation.prototype.canCopyParticallyTable = function (selectedCellInfos) {
            if (selectedCellInfos.length === 0)
                return false;
            var prevRowEndPosition = selectedCellInfos[0][0].cell.parentRow.getEndPosition();
            var prevLeftColumnIndex = __aspxRichEdit.TableCellUtils.getStartColumnIndex(selectedCellInfos[0][0].cell);
            var prevRightColumnIndex = __aspxRichEdit.TableCellUtils.getEndColumnIndex(selectedCellInfos[0][selectedCellInfos[0].length - 1].cell);
            for (var i = 0, horCells = void 0; horCells = selectedCellInfos[i]; i++) {
                var prevCellEndPosition = horCells[0].cell.endParagrapPosition.value;
                for (var j = 1, cellInfo = void 0; cellInfo = horCells[j]; j++) {
                    if (cellInfo.cell.startParagraphPosition.value !== prevCellEndPosition)
                        return false;
                    prevCellEndPosition = cellInfo.cell.endParagrapPosition.value;
                }
                if (i > 0) {
                    if (horCells[0].cell.parentRow.getStartPosition() !== prevRowEndPosition)
                        return false;
                    var leftColumnIndex = __aspxRichEdit.TableCellUtils.getStartColumnIndex(horCells[0].cell);
                    var rightColumnIndex = __aspxRichEdit.TableCellUtils.getEndColumnIndex(horCells[horCells.length - 1].cell);
                    if (rightColumnIndex < prevLeftColumnIndex || leftColumnIndex > prevRightColumnIndex)
                        return false;
                    prevRowEndPosition = horCells[0].cell.parentRow.getEndPosition();
                }
            }
            return true;
        };
        CreateRangeCopyOperation.prototype.cloneTableCell = function (newSubDocument, newRow, sourceCell) {
            var newCell = new __aspxRichEdit.TableCell(newRow, newSubDocument.documentModel.cache.tableCellPropertiesCache.getItem(sourceCell.properties.clone()));
            newCell.columnSpan = sourceCell.columnSpan;
            newCell.conditionalFormatting = sourceCell.conditionalFormatting;
            newCell.preferredWidth = sourceCell.preferredWidth.clone();
            newCell.style = sourceCell.style;
            return newCell;
        };
        CreateRangeCopyOperation.prototype.createTable = function (newSubDocument, oldTable, newNestedLevel, newDocumentStartPosition) {
            var newTableStyle = newSubDocument.documentModel.stylesManager.addTableStyle(oldTable.style);
            var newTable = new __aspxRichEdit.Table(oldTable.properties.clone(), newTableStyle);
            newTable.nestedLevel = newNestedLevel;
            if (newNestedLevel > 0) {
                var newStartPosition = oldTable.getStartPosition() - newDocumentStartPosition;
                newTable.parentCell = __aspxRichEdit.Table.getTableCellByPosition(newSubDocument.tables, newStartPosition);
            }
            newTable.index = newSubDocument.tables.push(newTable) - 1;
            (newSubDocument.tablesByLevels[newNestedLevel] || (newSubDocument.tablesByLevels[newNestedLevel] = [])).push(newTable);
            return newTable;
        };
        CreateRangeCopyOperation.prototype.getSelectedCells = function (table, intervals, prevLength) {
            var currentIntervalIndex = 0;
            var maxIntervalIndex = intervals.length - 1;
            var selectedCellInfos = [];
            for (var rowIndex = 0, row = void 0; row = table.rows[rowIndex]; rowIndex++) {
                var horCells = [];
                for (var cellIndex = 0, cell = void 0; cell = row.cells[cellIndex]; cellIndex++) {
                    while (currentIntervalIndex <= maxIntervalIndex && intervals[currentIntervalIndex].end < cell.endParagrapPosition.value) {
                        if (this.additionalParagraphRunPositions[intervals[currentIntervalIndex].end])
                            prevLength++;
                        prevLength += intervals[currentIntervalIndex].length;
                        currentIntervalIndex++;
                    }
                    if (currentIntervalIndex > maxIntervalIndex)
                        break;
                    if (intervals[currentIntervalIndex].containsInterval(cell.interval)) {
                        horCells.push(new TableCellInfo(cell, intervals[currentIntervalIndex].start - prevLength));
                    }
                }
                if (horCells.length)
                    selectedCellInfos.push(horCells);
                if (currentIntervalIndex > maxIntervalIndex)
                    break;
            }
            return selectedCellInfos;
        };
        return CreateRangeCopyOperation;
    }());
    __aspxRichEdit.CreateRangeCopyOperation = CreateRangeCopyOperation;
    var RangeCopy = (function () {
        function RangeCopy(model, addedUselessParagraphMarkInEnd) {
            this.model = model;
            this.addedUselessParagraphMarkInEnd = addedUselessParagraphMarkInEnd;
        }
        return RangeCopy;
    }());
    __aspxRichEdit.RangeCopy = RangeCopy;
    var TableCellInfo = (function () {
        function TableCellInfo(cell, positionDelta) {
            this.cell = cell;
            this.positionDelta = positionDelta;
        }
        return TableCellInfo;
    }());
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertTableCellOperationBase = (function () {
        function InsertTableCellOperationBase(control, subDocument) {
            this.control = control;
            this.subDocument = subDocument;
        }
        InsertTableCellOperationBase.prototype.execute = function (table, rowIndex, cellIndex, canNormalizeTable, canNormalizeVerticalMerging, canCopyProperties) {
            var row = table.rows[rowIndex];
            var cell = row.cells[cellIndex];
            var patternCellStartColumnIndex = __aspxRichEdit.TableCellUtils.getStartColumnIndex(cell);
            var restartCellPosition = __aspxRichEdit.Table.getFirstCellPositionInVerticalMergingGroup(__aspxRichEdit.TablePosition.createAndInit(table, rowIndex, cellIndex));
            var verticalSpanCellsPositions = __aspxRichEdit.TableCellUtils.getVerticalSpanCellPositions(restartCellPosition, patternCellStartColumnIndex);
            for (var i = verticalSpanCellsPositions.length - 1, pos = void 0; pos = verticalSpanCellsPositions[i]; i--) {
                if (canNormalizeVerticalMerging)
                    __aspxRichEdit.TablesManipulator.normalizeVerticalMerging(this.control, this.subDocument, table, pos.rowIndex, pos.cellIndex);
                this.insertTableCellCore(this.subDocument, pos, canCopyProperties);
            }
            if (canNormalizeTable) {
                this.normalizeTableGridAfter(table);
                __aspxRichEdit.TablesManipulator.normalizeCellColumnSpans(this.control, this.subDocument, table, true);
            }
        };
        InsertTableCellOperationBase.prototype.normalizeTableGridAfter = function (table) {
            var maxEndColumnIndex = 0;
            var endColumnIndices = [];
            for (var rowIndex = 0, row = void 0; row = table.rows[rowIndex]; rowIndex++) {
                var lastCell = row.cells[row.cells.length - 1];
                var currentEndColumnIndex = __aspxRichEdit.TableCellUtils.getEndColumnIndex(lastCell) + row.gridAfter;
                endColumnIndices.push(currentEndColumnIndex);
                maxEndColumnIndex = Math.max(maxEndColumnIndex, currentEndColumnIndex);
            }
            for (var rowIndex = 0, row = void 0; row = table.rows[rowIndex]; rowIndex++) {
                var currentEndColumnIndex = endColumnIndices[rowIndex];
                var delta = maxEndColumnIndex - currentEndColumnIndex;
                if (delta > 0)
                    this.control.history.addAndRedo(new __aspxRichEdit.TableRowGridAfterHistoryItem(this.control.modelManipulator, this.subDocument, table.index, rowIndex, row.gridAfter + delta));
            }
        };
        return InsertTableCellOperationBase;
    }());
    __aspxRichEdit.InsertTableCellOperationBase = InsertTableCellOperationBase;
    var InsertTableCellToTheLeftOperation = (function (_super) {
        __extends(InsertTableCellToTheLeftOperation, _super);
        function InsertTableCellToTheLeftOperation() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertTableCellToTheLeftOperation.prototype.insertTableCellCore = function (subDocument, pos, copyProperties) {
            __aspxRichEdit.TablesManipulator.insertParagraphToTheCellStartAndShiftContent(this.control, subDocument, pos.cell);
            this.control.history.addAndRedo(new __aspxRichEdit.SplitTableCellToTheLeftHistoryItem(this.control.modelManipulator, subDocument, pos.table.index, pos.rowIndex, pos.cellIndex, copyProperties));
            if (pos.cell.verticalMerging !== __aspxRichEdit.TableCellMergingState.None)
                this.control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(this.control.modelManipulator, subDocument, pos.table.index, pos.rowIndex, pos.cellIndex, pos.cell.verticalMerging));
        };
        return InsertTableCellToTheLeftOperation;
    }(InsertTableCellOperationBase));
    __aspxRichEdit.InsertTableCellToTheLeftOperation = InsertTableCellToTheLeftOperation;
    var InsertTableCellToTheRightOperation = (function (_super) {
        __extends(InsertTableCellToTheRightOperation, _super);
        function InsertTableCellToTheRightOperation() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertTableCellToTheRightOperation.prototype.insertTableCellCore = function (subDocument, pos, copyProperties) {
            __aspxRichEdit.ModelManipulator.insertParagraph(this.control, subDocument, new __aspxRichEdit.FixedInterval(pos.cell.endParagrapPosition.value - 1, 0));
            this.control.history.addAndRedo(new __aspxRichEdit.SplitTableCellToTheRightHistoryItem(this.control.modelManipulator, subDocument, pos.table.index, pos.rowIndex, pos.cellIndex, copyProperties));
            if (pos.cell.verticalMerging !== __aspxRichEdit.TableCellMergingState.None)
                this.control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(this.control.modelManipulator, subDocument, pos.table.index, pos.rowIndex, pos.cellIndex + 1, pos.cell.verticalMerging));
        };
        return InsertTableCellToTheRightOperation;
    }(InsertTableCellOperationBase));
    __aspxRichEdit.InsertTableCellToTheRightOperation = InsertTableCellToTheRightOperation;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var InsertTableRowOperationBase = (function () {
        function InsertTableRowOperationBase(control, subDocument) {
            this.control = control;
            this.subDocument = subDocument;
        }
        InsertTableRowOperationBase.prototype.execute = function (table, patternRowIndex) {
            var patternRow = table.rows[patternRowIndex];
            var insertParagraphsPositionInfo = this.getInsertParagraphsPositionInfo(table, patternRowIndex);
            this.insertParagraphs(this.subDocument, insertParagraphsPositionInfo, patternRow);
            patternRowIndex = this.insertRowsCore(table, patternRowIndex);
            this.correctVerticalMerging(this.subDocument, table, patternRowIndex);
        };
        InsertTableRowOperationBase.prototype.insertParagraphs = function (subDocument, insertPosition, patternRow) {
            var needShiftCellContent = !!insertPosition.cell;
            for (var i = patternRow.cells.length - 1, patternCell = void 0; patternCell = patternRow.cells[i]; i--) {
                if (needShiftCellContent) {
                    __aspxRichEdit.TablesManipulator.insertParagraphToTheCellStartAndShiftContent(this.control, this.subDocument, insertPosition.cell);
                    needShiftCellContent = false;
                    continue;
                }
                var patternCellRun = subDocument.getRunByPosition(patternCell.startParagraphPosition.value);
                var patternCellParagraph = subDocument.getParagraphByPosition(patternCell.startParagraphPosition.value);
                this.control.history.addAndRedo(new __aspxRichEdit.InsertParagraphHistoryItem(this.control.modelManipulator, subDocument, insertPosition.position, patternCellRun.maskedCharacterProperties, patternCellRun.characterStyle, patternCellParagraph.maskedParagraphProperties, patternCellParagraph.paragraphStyle, -1, -1, patternCellParagraph.tabs.clone()));
            }
        };
        return InsertTableRowOperationBase;
    }());
    __aspxRichEdit.InsertTableRowOperationBase = InsertTableRowOperationBase;
    var InsertTableRowAboveOperation = (function (_super) {
        __extends(InsertTableRowAboveOperation, _super);
        function InsertTableRowAboveOperation() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertTableRowAboveOperation.prototype.insertRowsCore = function (table, patternRowIndex) {
            var newCellsIntervals = [];
            var patternRow = table.rows[patternRowIndex];
            var newCellStartPosition = patternRow.getStartPosition();
            var cellsCount = patternRow.cells.length;
            for (var i = 0; i < cellsCount; i++)
                newCellsIntervals.push(new __aspxRichEdit.FixedInterval(newCellStartPosition + i, 1));
            this.control.history.addAndRedo(new __aspxRichEdit.InsertTableRowHistoryItem(this.control.modelManipulator, this.subDocument, table.index, table.rows[patternRowIndex], patternRowIndex, newCellsIntervals));
            return patternRowIndex + 1;
        };
        InsertTableRowAboveOperation.prototype.getInsertParagraphsPositionInfo = function (table, patternRowIndex) {
            return {
                cell: table.rows[patternRowIndex].cells[0],
                position: table.rows[patternRowIndex].getStartPosition()
            };
        };
        InsertTableRowAboveOperation.prototype.correctVerticalMerging = function (subDocument, table, patternRowIndex) {
            var patternRow = table.rows[patternRowIndex];
            for (var i = 0, patternCell = void 0; patternCell = patternRow.cells[i]; i++) {
                if (patternCell.verticalMerging === __aspxRichEdit.TableCellMergingState.Restart)
                    this.control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(this.control.modelManipulator, subDocument, table.index, patternRowIndex - 1, i, __aspxRichEdit.TableCellMergingState.None));
            }
        };
        return InsertTableRowAboveOperation;
    }(InsertTableRowOperationBase));
    __aspxRichEdit.InsertTableRowAboveOperation = InsertTableRowAboveOperation;
    var InsertTableRowBelowOperation = (function (_super) {
        __extends(InsertTableRowBelowOperation, _super);
        function InsertTableRowBelowOperation() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertTableRowBelowOperation.prototype.insertRowsCore = function (table, patternRowIndex) {
            var newCellsIntervals = [];
            var patternRow = table.rows[patternRowIndex];
            var newCellStartPosition = patternRow.getEndPosition();
            var cellsCount = patternRow.cells.length;
            for (var i = 0; i < cellsCount; i++)
                newCellsIntervals.push(new __aspxRichEdit.FixedInterval(newCellStartPosition + i, 1));
            this.control.history.addAndRedo(new __aspxRichEdit.InsertTableRowHistoryItem(this.control.modelManipulator, this.subDocument, table.index, table.rows[patternRowIndex], patternRowIndex + 1, newCellsIntervals));
            return patternRowIndex;
        };
        InsertTableRowBelowOperation.prototype.getInsertParagraphsPositionInfo = function (table, patternRowIndex) {
            return {
                cell: table.rows[patternRowIndex + 1] ? table.rows[patternRowIndex + 1].cells[0] : null,
                position: table.rows[patternRowIndex].getEndPosition()
            };
        };
        InsertTableRowBelowOperation.prototype.correctVerticalMerging = function (subDocument, table, patternRowIndex) {
            var patternRow = table.rows[patternRowIndex];
            var newRowIndex = patternRowIndex + 1;
            var nextRow = table.rows[newRowIndex + 1];
            for (var i = 0, patternCell = void 0; patternCell = patternRow.cells[i]; i++) {
                if (patternCell.verticalMerging === __aspxRichEdit.TableCellMergingState.Continue) {
                    if (!nextRow)
                        this.control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(this.control.modelManipulator, subDocument, table.index, newRowIndex, i, __aspxRichEdit.TableCellMergingState.None));
                    else {
                        var sourceCellStartColumnIndex = __aspxRichEdit.TableCellUtils.getStartColumnIndex(patternCell);
                        var indexInNextRow = __aspxRichEdit.TableCellUtils.getAbsoluteCellIndexInRow(nextRow, sourceCellStartColumnIndex);
                        if (nextRow.cells[indexInNextRow].verticalMerging !== __aspxRichEdit.TableCellMergingState.Continue)
                            this.control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(this.control.modelManipulator, subDocument, table.index, newRowIndex, i, __aspxRichEdit.TableCellMergingState.None));
                    }
                }
                else if (patternCell.verticalMerging === __aspxRichEdit.TableCellMergingState.Restart)
                    this.control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(this.control.modelManipulator, subDocument, table.index, newRowIndex, i, __aspxRichEdit.TableCellMergingState.Continue));
            }
        };
        return InsertTableRowBelowOperation;
    }(InsertTableRowOperationBase));
    __aspxRichEdit.InsertTableRowBelowOperation = InsertTableRowBelowOperation;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var MergeTableCellsOperationBase = (function () {
        function MergeTableCellsOperationBase(control, subDocument) {
            this.needDeleteNextTableCell = false;
            this.control = control;
            this.subDocument = subDocument;
        }
        MergeTableCellsOperationBase.prototype.execute = function (position, suppressNormalizeTableRows) {
            var nextCellPosition = this.calculateNextCell(position);
            this.updateCellsProperties(position, nextCellPosition);
            var nextCell = nextCellPosition.cell;
            var cell = position.cell;
            var isEmptyCell = this.isEmptyCell(cell);
            var isEmptyNextCell = this.isEmptyCell(nextCell);
            if (!isEmptyNextCell) {
                var insertPosition = cell.endParagrapPosition.value - 1;
                var nextCellLastParagraph = this.subDocument.paragraphs[this.getCellLastParagraphIndex(nextCell)];
                if (!isEmptyCell) {
                    __aspxRichEdit.ModelManipulator.insertParagraph(this.control, this.subDocument, new __aspxRichEdit.FixedInterval(insertPosition, 0));
                    insertPosition++;
                }
                this.applyParagraphProperties(this.getCellLastParagraphIndex(cell), nextCellLastParagraph);
                __aspxRichEdit.ModelManipulator.copyIntervalTo(this.control, this.subDocument, __aspxRichEdit.FixedInterval.fromPositions(nextCell.startParagraphPosition.value, nextCell.endParagrapPosition.value - 1), insertPosition);
            }
            this.deleteTableCellWithContent(nextCellPosition);
            __aspxRichEdit.TablesManipulator.normalizeCellColumnSpans(this.control, this.subDocument, position.table, true);
            if (!suppressNormalizeTableRows)
                __aspxRichEdit.TablesManipulator.normalizeRows(this.control, this.subDocument, cell.parentRow.parentTable);
        };
        MergeTableCellsOperationBase.prototype.getCellLastParagraphIndex = function (cell) {
            return this.subDocument.getParagraphIndexByPosition(cell.endParagrapPosition.value - 1);
        };
        MergeTableCellsOperationBase.prototype.applyParagraphProperties = function (targetIndex, source) {
            var target = this.subDocument.paragraphs[targetIndex];
            if (!target.maskedParagraphProperties.equals(source.maskedParagraphProperties) || target.numberingListIndex !== source.numberingListIndex || target.listLevelIndex !== source.listLevelIndex || target.tabs.equals(source.tabs) || target.paragraphStyle !== source.paragraphStyle)
                this.control.history.addAndRedo(new __aspxRichEdit.ParagraphPropertiesHistoryItem(this.control.modelManipulator, this.subDocument, targetIndex, source.maskedParagraphProperties, source.paragraphStyle, source.numberingListIndex, source.listLevelIndex, source.tabs));
        };
        MergeTableCellsOperationBase.prototype.deleteTableCellWithContent = function (nextCellPosition) {
            if (this.needDeleteNextTableCell)
                __aspxRichEdit.TablesManipulator.removeTableCellWithContent(this.control, this.subDocument, nextCellPosition.table, nextCellPosition.rowIndex, nextCellPosition.cellIndex);
            else {
                var nextCell = nextCellPosition.cell;
                __aspxRichEdit.ModelManipulator.removeInterval(this.control, this.subDocument, __aspxRichEdit.FixedInterval.fromPositions(nextCell.startParagraphPosition.value, nextCell.endParagrapPosition.value - 1), true, false);
            }
        };
        MergeTableCellsOperationBase.prototype.isEmptyCell = function (cell) {
            return cell.endParagrapPosition.value - cell.startParagraphPosition.value === 1;
        };
        return MergeTableCellsOperationBase;
    }());
    __aspxRichEdit.MergeTableCellsOperationBase = MergeTableCellsOperationBase;
    var MergeTwoTableCellsHorizontallyOperation = (function (_super) {
        __extends(MergeTwoTableCellsHorizontallyOperation, _super);
        function MergeTwoTableCellsHorizontallyOperation() {
            var _this = _super !== null && _super.apply(this, arguments) || this;
            _this.needDeleteNextTableCell = true;
            return _this;
        }
        MergeTwoTableCellsHorizontallyOperation.prototype.calculateNextCell = function (position) {
            var nextCellIndex = position.cellIndex + 1;
            return __aspxRichEdit.TablePosition.createAndInit(position.table, position.rowIndex, nextCellIndex);
        };
        MergeTwoTableCellsHorizontallyOperation.prototype.updateCellsProperties = function (patternCellPosition, nextCellPosition) {
            var patternCell = patternCellPosition.cell;
            var nextCell = nextCellPosition.cell;
            this.control.history.addAndRedo(new __aspxRichEdit.TableCellColumnSpanHistoryItem(this.control.modelManipulator, this.subDocument, patternCellPosition.table.index, patternCellPosition.rowIndex, patternCellPosition.cellIndex, patternCell.columnSpan + nextCell.columnSpan));
            var patternCellPreferredWidth = patternCell.preferredWidth;
            var nextCellPreferredWidth = nextCell.preferredWidth;
            if (patternCellPreferredWidth && nextCellPreferredWidth && nextCellPreferredWidth.type === patternCellPreferredWidth.type) {
                var newPreferredWidth = __aspxRichEdit.TableWidthUnit.create(patternCellPreferredWidth.value + nextCellPreferredWidth.value, patternCellPreferredWidth.type);
                this.control.history.addAndRedo(new __aspxRichEdit.TableCellPreferredWidthHistoryItem(this.control.modelManipulator, this.subDocument, patternCellPosition.table.index, patternCellPosition.rowIndex, patternCellPosition.cellIndex, newPreferredWidth));
            }
        };
        return MergeTwoTableCellsHorizontallyOperation;
    }(MergeTableCellsOperationBase));
    __aspxRichEdit.MergeTwoTableCellsHorizontallyOperation = MergeTwoTableCellsHorizontallyOperation;
    var MergeTwoTableCellsVerticallyOperation = (function (_super) {
        __extends(MergeTwoTableCellsVerticallyOperation, _super);
        function MergeTwoTableCellsVerticallyOperation() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        MergeTwoTableCellsVerticallyOperation.prototype.calculateNextCell = function (position) {
            var nextRowIndex = position.rowIndex + 1;
            var nextRow = position.table.rows[nextRowIndex];
            var columnIndex = __aspxRichEdit.TableCellUtils.getStartColumnIndex(position.cell);
            return __aspxRichEdit.TablePosition.createAndInit(position.table, nextRowIndex, __aspxRichEdit.TableCellUtils.getCellIndexByColumnIndex(nextRow, columnIndex));
        };
        MergeTwoTableCellsVerticallyOperation.prototype.updateCellsProperties = function (patternCellPosition, nextCellPosition) {
            this.control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(this.control.modelManipulator, this.subDocument, patternCellPosition.table.index, patternCellPosition.rowIndex, patternCellPosition.cellIndex, __aspxRichEdit.TableCellMergingState.Restart));
            this.control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(this.control.modelManipulator, this.subDocument, nextCellPosition.table.index, nextCellPosition.rowIndex, nextCellPosition.cellIndex, __aspxRichEdit.TableCellMergingState.Continue));
        };
        return MergeTwoTableCellsVerticallyOperation;
    }(MergeTableCellsOperationBase));
    __aspxRichEdit.MergeTwoTableCellsVerticallyOperation = MergeTwoTableCellsVerticallyOperation;
    var InsertTableCellWithShiftToTheDownOperation = (function (_super) {
        __extends(InsertTableCellWithShiftToTheDownOperation, _super);
        function InsertTableCellWithShiftToTheDownOperation() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        InsertTableCellWithShiftToTheDownOperation.prototype.calculateNextCell = function (position) {
            return __aspxRichEdit.TablePosition.createAndInit(position.table, position.rowIndex - 1, position.cellIndex);
        };
        InsertTableCellWithShiftToTheDownOperation.prototype.updateCellsProperties = function (patternCellPosition, nextCellPosition) {
            var manipulator = this.control.modelManipulator;
            var subDocument = this.subDocument;
            this.control.history.addAndRedo(new __aspxRichEdit.TableCellBordersHistoryItem(manipulator, subDocument, patternCellPosition.table.index, patternCellPosition.rowIndex, patternCellPosition.cellIndex, [
                nextCellPosition.cell.properties.borders.topBorder.clone(),
                nextCellPosition.cell.properties.borders.rightBorder.clone(),
                nextCellPosition.cell.properties.borders.bottomBorder.clone(),
                nextCellPosition.cell.properties.borders.leftBorder.clone(),
                nextCellPosition.cell.properties.borders.topLeftDiagonalBorder.clone(),
                nextCellPosition.cell.properties.borders.topRightDiagonalBorder.clone()
            ], [true, true, true, true, true, true]));
            this.control.history.addAndRedo(new __aspxRichEdit.TableCellShadingInfoHistoryItem(manipulator, subDocument, patternCellPosition.table.index, patternCellPosition.rowIndex, patternCellPosition.cellIndex, nextCellPosition.cell.properties.shadingInfo, true));
            this.control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalAlignmentHistoryItem(manipulator, subDocument, patternCellPosition.table.index, patternCellPosition.rowIndex, patternCellPosition.cellIndex, nextCellPosition.cell.properties.verticalAlignment, true));
        };
        InsertTableCellWithShiftToTheDownOperation.prototype.deleteTableCellWithContent = function (nextCellPosition) {
            var nextCell = nextCellPosition.cell;
            if (nextCell.endParagrapPosition.value - nextCell.startParagraphPosition.value > 1)
                __aspxRichEdit.ModelManipulator.removeInterval(this.control, this.subDocument, __aspxRichEdit.FixedInterval.fromPositions(nextCell.startParagraphPosition.value, nextCell.endParagrapPosition.value - 1), true, false);
        };
        return InsertTableCellWithShiftToTheDownOperation;
    }(MergeTableCellsOperationBase));
    __aspxRichEdit.InsertTableCellWithShiftToTheDownOperation = InsertTableCellWithShiftToTheDownOperation;
    var DeleteOneTableCellWithShiftToTheUpOperation = (function (_super) {
        __extends(DeleteOneTableCellWithShiftToTheUpOperation, _super);
        function DeleteOneTableCellWithShiftToTheUpOperation() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        DeleteOneTableCellWithShiftToTheUpOperation.prototype.execute = function (position, suppressNormalizeTableRows) {
            if (position.rowIndex === position.table.rows.length - 1)
                this.deleteContentFromCell(position.cell);
            else {
                this.deleteContentFromCell(position.cell);
                _super.prototype.execute.call(this, position, suppressNormalizeTableRows);
            }
        };
        DeleteOneTableCellWithShiftToTheUpOperation.prototype.updateCellsProperties = function (patternCellPosition, nextCellPosition) {
            if (patternCellPosition.cell.verticalMerging === __aspxRichEdit.TableCellMergingState.Restart) {
                this.control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(this.control.modelManipulator, this.subDocument, patternCellPosition.table.index, patternCellPosition.rowIndex, patternCellPosition.cellIndex, __aspxRichEdit.TableCellMergingState.None));
                if (nextCellPosition.rowIndex === nextCellPosition.table.rows.length - 1)
                    this.control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(this.control.modelManipulator, this.subDocument, nextCellPosition.table.index, nextCellPosition.rowIndex, nextCellPosition.cellIndex, __aspxRichEdit.TableCellMergingState.None));
                else {
                    var afterNextCellPosition = this.calculateNextCell(nextCellPosition);
                    if (afterNextCellPosition.cell && afterNextCellPosition.cell.verticalMerging === __aspxRichEdit.TableCellMergingState.Continue)
                        this.control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(this.control.modelManipulator, this.subDocument, nextCellPosition.table.index, nextCellPosition.rowIndex, nextCellPosition.cellIndex, __aspxRichEdit.TableCellMergingState.Restart));
                    else
                        this.control.history.addAndRedo(new __aspxRichEdit.TableCellVerticalMergingHistoryItem(this.control.modelManipulator, this.subDocument, nextCellPosition.table.index, nextCellPosition.rowIndex, nextCellPosition.cellIndex, __aspxRichEdit.TableCellMergingState.None));
                }
            }
        };
        DeleteOneTableCellWithShiftToTheUpOperation.prototype.deleteContentFromCell = function (cell) {
            var cellInterval = cell.interval;
            if (--cellInterval.length > 0)
                __aspxRichEdit.ModelManipulator.removeInterval(this.control, this.subDocument, cellInterval, true, false);
        };
        return DeleteOneTableCellWithShiftToTheUpOperation;
    }(MergeTwoTableCellsVerticallyOperation));
    __aspxRichEdit.DeleteOneTableCellWithShiftToTheUpOperation = DeleteOneTableCellWithShiftToTheUpOperation;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RemoveIntervalOperation = (function () {
        function RemoveIntervalOperation(manipulator, subDocument) {
            this.currentCellIndex = 0;
            this.manipulator = manipulator;
            this.subDocument = subDocument;
        }
        RemoveIntervalOperation.prototype.execute = function (interval, applyPropertiesToLeft, needHistory) {
            if (interval.end >= this.subDocument.getDocumentEndPosition())
                throw new Error("Interval.end must be less than subDocument.getDocumentEndPosition()");
            this.cellsIterator = new SelectedCellsIterator(this.subDocument, interval);
            var result = new RemoveIntervalOperationResult(this.cellsIterator);
            result.bookmarkItems = this.manipulator.bookmarksManipulator.deleteBookmarks(this.subDocument, interval);
            if (this.tryPackSelectionInOneRun(interval, result))
                return result;
            var iterator = this.subDocument.getRunIterator(interval);
            if (needHistory)
                this.fillResult(interval, result);
            this.initializeStartPositions(interval.start);
            this.executeCore(applyPropertiesToLeft, interval.start, iterator, result);
            this.correctTablesStart();
            return result;
        };
        RemoveIntervalOperation.prototype.correctTablesStart = function () {
            for (var _i = 0, _a = this.subDocument.tables; _i < _a.length; _i++) {
                var tbl = _a[_i];
                var tblPos = tbl.getStartPosition();
                var parPos = this.subDocument.getParagraphByPosition(tblPos).startLogPosition.value;
                if (tblPos != parPos)
                    this.manipulator.tables.changeTableStartPosition(this.subDocument, tbl, parPos);
            }
        };
        RemoveIntervalOperation.prototype.initializeStartPositions = function (intervalStart) {
            this.position = intervalStart;
            this.currentChunkIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.subDocument.chunks, function (c) { return c.startLogPosition.value; }, intervalStart);
            this.currentSectionIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.subDocument.documentModel.sections, function (s) { return s.startLogPosition.value; }, intervalStart);
            this.currentParagraphIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.subDocument.paragraphs, function (p) { return p.startLogPosition.value; }, intervalStart);
            this.fieldIndexThatNeedDelete = -1;
        };
        RemoveIntervalOperation.prototype.executeCore = function (applyPropertiesToLeft, startPosition, iterator, result) {
            var subDocument = this.subDocument;
            var accumulatedInterval = new __aspxRichEdit.FixedInterval(this.position, 0);
            while (iterator.moveNext()) {
                if (__aspxRichEdit.EnumUtils.isAnyOf(iterator.currentRun.getType(), __aspxRichEdit.RunType.AnchoredPictureRun, __aspxRichEdit.RunType.AnchoredTextBoxRun))
                    this.manipulator.dispatcher.notifyAnchorObjectRemoved(this.subDocument, (iterator.currentRun).anchoredObjectID, iterator.currentInterval().start);
                if (iterator.currentChunk !== subDocument.chunks[this.currentChunkIndex]) {
                    this.removeAccumulatedInterval(accumulatedInterval, this.position, 0);
                    this.currentChunkIndex++;
                }
                if (subDocument.documentModel.sections[this.currentSectionIndex] !== iterator.currentSection)
                    this.currentSectionIndex++;
                var runIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(subDocument.chunks[this.currentChunkIndex].textRuns, function (r) { return r.startOffset; }, iterator.currentRun.startOffset);
                if (iterator.currentRun.getType() == __aspxRichEdit.RunType.FieldCodeStartRun)
                    this.removeField(startPosition);
                if (iterator.currentRun.getType() == __aspxRichEdit.RunType.ParagraphRun) {
                    if (subDocument.paragraphs.length === 1) {
                        result.removeLastParagraphRun();
                        continue;
                    }
                }
                iterator.currentRun.paragraph.length -= iterator.currentRun.getLength();
                this.modifySectionLength(iterator.currentSection, -iterator.currentRun.getLength());
                var strategy = this.getStrategy(iterator, accumulatedInterval);
                strategy.call(this, accumulatedInterval, runIndex);
            }
            this.removeAccumulatedInterval(accumulatedInterval, -1, 0);
            if (this.shouldMergeParagraphs)
                this.tryMergeStartEndParagraphs(startPosition, applyPropertiesToLeft);
            this.cellsIterator.reset();
        };
        RemoveIntervalOperation.prototype.modifySectionLength = function (section, delta) {
            section.setLength(this.subDocument, section.getLength() + delta);
        };
        RemoveIntervalOperation.prototype.getStrategy = function (iterator, accumulatedInterval) {
            if (!this.canRemoveRun(iterator.currentRun, iterator.currentRun.startOffset + iterator.currentChunk.startLogPosition.value + accumulatedInterval.length, iterator.currentRun.paragraph.length === 0))
                return this.skipRunAndMoveToNextParagraph;
            else if (iterator.currentRun.getType() === __aspxRichEdit.RunType.SectionRun && iterator.currentSection.getLength() == 0)
                return this.removeWholeSection;
            else if (iterator.currentRun.getType() === __aspxRichEdit.RunType.ParagraphRun && iterator.currentRun.paragraph.length === 0)
                return this.removeWholeParagraph;
            else if (iterator.currentRun.getType() === __aspxRichEdit.RunType.SectionRun && this.shouldMergeParagraphs && iterator.currentRun.paragraph.length === 0)
                return this.mergePreviousParagraph;
            else if (!iterator.currentRun.isParagraphOrSectionRun())
                return this.removeTextRun;
            else
                return this.skipParagraphRunAndMergeParagraphsAtTheEnd;
        };
        RemoveIntervalOperation.prototype.removeTextRun = function (accumulatedInterval, runIndex) {
            accumulatedInterval.length += this.subDocument.chunks[this.currentChunkIndex].textRuns[runIndex].getLength();
            this.removeRunInternal(this.subDocument, runIndex);
        };
        RemoveIntervalOperation.prototype.skipParagraphRunAndMergeParagraphsAtTheEnd = function (accumulatedInterval, runIndex) {
            this.skipRunAndMoveToNextParagraph(accumulatedInterval, runIndex);
            this.shouldMergeParagraphs = true;
        };
        RemoveIntervalOperation.prototype.skipRunAndMoveToNextParagraph = function (accumulatedInterval, _runIndex) {
            this.subDocument.paragraphs[this.currentParagraphIndex].length++;
            this.modifySectionLength(this.subDocument.documentModel.sections[this.currentSectionIndex], 1);
            this.position++;
            this.removeAccumulatedInterval(accumulatedInterval, this.position, 0);
            this.currentParagraphIndex++;
        };
        RemoveIntervalOperation.prototype.mergePreviousParagraph = function (accumulatedInterval, runIndex) {
            if (runIndex === 0)
                this.currentChunkIndex--;
            var paragraphIndex = this.currentParagraphIndex;
            this.subDocument.paragraphs[paragraphIndex].length++;
            this.removeAccumulatedInterval(accumulatedInterval, this.position, 0);
            this.mergeParagraphsInternal(this.subDocument, paragraphIndex - 1, false);
            this.manipulator.dispatcher.notifyParagraphMerged(this.subDocument, this.subDocument.paragraphs[paragraphIndex - 1].getEndPosition() - 1, false);
        };
        RemoveIntervalOperation.prototype.removeWholeSection = function (accumulatedInterval, runIndex) {
            var subDocument = this.subDocument;
            var currentSection = subDocument.documentModel.sections[this.currentSectionIndex];
            this.removeAccumulatedInterval(accumulatedInterval, this.position, -1);
            if (subDocument.documentModel.sections.length > 1) {
                subDocument.positionManager.unregisterPosition(currentSection.startLogPosition);
                subDocument.documentModel.sections.splice(this.currentSectionIndex, 1);
                subDocument.positionManager.unregisterPosition(subDocument.paragraphs[this.currentParagraphIndex].startLogPosition);
                subDocument.paragraphs.splice(this.currentParagraphIndex, 1);
                this.removeRunInternal(subDocument, runIndex);
                this.currentSectionIndex--;
                this.manipulator.dispatcher.notifySectionMerged(subDocument, this.currentSectionIndex + 1, false);
            }
        };
        RemoveIntervalOperation.prototype.removeWholeParagraph = function (accumulatedInterval, runIndex) {
            var subDocument = this.subDocument;
            this.removeAccumulatedInterval(accumulatedInterval, this.position, -1);
            if (subDocument.paragraphs.length > 1) {
                subDocument.positionManager.unregisterPosition(subDocument.paragraphs[this.currentParagraphIndex].startLogPosition);
                subDocument.paragraphs.splice(this.currentParagraphIndex, 1);
                this.removeRunInternal(subDocument, runIndex);
                this.manipulator.dispatcher.notifyParagraphMerged(subDocument, this.position, false);
            }
        };
        RemoveIntervalOperation.prototype.tryMergeStartEndParagraphs = function (startPosition, applyPropertiesToLeft) {
            var subDocument = this.subDocument;
            var firstParagraphIndex = subDocument.getParagraphIndexByPosition(startPosition), firstParagraph = subDocument.paragraphs[firstParagraphIndex], lastParagraph = subDocument.paragraphs[firstParagraphIndex + 1];
            var firstSectionIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(subDocument.documentModel.sections, function (s) { return s.startLogPosition.value; }, firstParagraph.startLogPosition.value), firstSection = subDocument.documentModel.sections[firstSectionIndex];
            if (lastParagraph) {
                this.modifySectionLength(firstSection, -1);
                if (this.subDocument.isMain() && firstSection.getEndPosition() === firstParagraph.getEndPosition() - 1 && firstSectionIndex < subDocument.documentModel.sections.length - 1) {
                    var lastSection = subDocument.documentModel.sections[firstSectionIndex + 1];
                    subDocument.positionManager.unregisterPosition(lastSection.startLogPosition);
                    lastSection.startLogPosition = subDocument.positionManager.registerPosition(firstSection.startLogPosition.value);
                    this.modifySectionLength(lastSection, firstSection.getLength());
                    subDocument.positionManager.unregisterPosition(firstSection.startLogPosition);
                    subDocument.documentModel.sections.splice(firstSectionIndex, 1);
                    this.mergeParagraphsInternal(subDocument, firstParagraphIndex, applyPropertiesToLeft);
                    this.manipulator.dispatcher.notifySectionMerged(subDocument, firstSectionIndex, !!applyPropertiesToLeft);
                }
                else {
                    this.mergeParagraphsInternal(subDocument, firstParagraphIndex, applyPropertiesToLeft);
                    this.manipulator.dispatcher.notifyParagraphMerged(subDocument, lastParagraph.startLogPosition.value - 1, !!applyPropertiesToLeft);
                }
            }
        };
        RemoveIntervalOperation.prototype.removeField = function (startPosition) {
            if (this.fieldIndexThatNeedDelete < 0) {
                this.fieldIndexThatNeedDelete = __aspxRichEdit.Field.normedBinaryIndexOf(this.subDocument.fields, startPosition + 1);
                if (this.fieldIndexThatNeedDelete < 0 || startPosition > this.subDocument.fields[this.fieldIndexThatNeedDelete].getFieldStartPosition())
                    this.fieldIndexThatNeedDelete++;
            }
            __aspxRichEdit.Field.deleteFieldByIndex(this.subDocument, this.fieldIndexThatNeedDelete, this.manipulator);
        };
        RemoveIntervalOperation.prototype.tryPackSelectionInOneRun = function (interval, result) {
            var runInfo = this.subDocument.getRunAndIndexesByPosition(interval.start);
            var runStartPosition = runInfo.chunk.startLogPosition.value + runInfo.run.startOffset;
            var runEndPosition = runStartPosition + runInfo.run.getLength();
            var selectionEndPosition = interval.end;
            var selectionStartPosition = interval.start;
            if ((runStartPosition < selectionStartPosition) && (selectionEndPosition < runEndPosition)) {
                var chunkStartPosition = runInfo.chunk.startLogPosition.value;
                var offsetStartSelectionAtChunk = selectionStartPosition - chunkStartPosition;
                var offsetEndSelectionAtChunk = selectionEndPosition - chunkStartPosition;
                result.registerItem(new __aspxRichEdit.HistoryRun(runInfo.run.getType(), runInfo.run.characterStyle, selectionStartPosition, runInfo.run.maskedCharacterProperties, runInfo.chunk.getTextInChunk(offsetStartSelectionAtChunk, interval.length)));
                runInfo.run.incLength(-interval.length);
                runInfo.chunk.textBuffer = [runInfo.chunk.textBuffer.substr(0, offsetStartSelectionAtChunk), runInfo.chunk.textBuffer.substr(offsetEndSelectionAtChunk)].join('');
                var paragraphIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.subDocument.paragraphs, function (p) { return p.startLogPosition.value; }, selectionStartPosition);
                this.subDocument.paragraphs[paragraphIndex].length -= interval.length;
                var sectionIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.subDocument.documentModel.sections, function (s) { return s.startLogPosition.value; }, selectionStartPosition);
                this.modifySectionLength(this.subDocument.documentModel.sections[sectionIndex], -interval.length);
                __aspxRichEdit.TextManipulator.moveRunsInChunk(runInfo.chunk, runInfo.runIndex + 1, -interval.length);
                this.subDocument.positionManager.advance(selectionStartPosition, -interval.length);
                this.manipulator.dispatcher.notifyIntervalRemoved(this.subDocument, interval.start, interval.length);
                return true;
            }
            return false;
        };
        RemoveIntervalOperation.prototype.canRemoveRun = function (run, absolutePosition, isLastRunInParagraph) {
            if (run.getType() === __aspxRichEdit.RunType.ParagraphRun) {
                this.cellsIterator.moveTo(absolutePosition);
                var currentCell = this.cellsIterator.getCurrent();
                if (currentCell && absolutePosition === currentCell.endParagrapPosition.value - 1)
                    return false;
                var nextCell = this.cellsIterator.getNext();
                if (nextCell && nextCell.startParagraphPosition.value === absolutePosition + 1) {
                    if (!isLastRunInParagraph)
                        return false;
                    var prevCell = this.cellsIterator.getPrev();
                    if (prevCell && prevCell.parentRow.parentTable.getLastCell() === prevCell)
                        return false;
                }
            }
            return true;
        };
        RemoveIntervalOperation.prototype.fillResult = function (interval, result) {
            var iterator = this.subDocument.getRunIterator(interval);
            var isInsertPropertiesAndStyleIndexToCurrentParagraph = undefined;
            var lastParagraphRemovingLength = 0;
            while (iterator.moveNext()) {
                var currentRun = iterator.currentRun;
                var currentChunk = iterator.currentChunk;
                var currentInterval = iterator.currentInterval();
                lastParagraphRemovingLength += currentInterval.length;
                if (!this.canRemoveRun(currentRun, currentInterval.start, iterator.currentRun.paragraph.length === lastParagraphRemovingLength)) {
                    if (currentRun.isParagraphOrSectionRun())
                        lastParagraphRemovingLength = 0;
                    continue;
                }
                switch (currentRun.getType()) {
                    case __aspxRichEdit.RunType.TextRun:
                        result.registerItem(new __aspxRichEdit.HistoryRun(currentRun.getType(), currentRun.characterStyle, currentInterval.start, currentRun.maskedCharacterProperties, currentChunk.getRunText(currentRun)));
                        break;
                    case __aspxRichEdit.RunType.ParagraphRun:
                    case __aspxRichEdit.RunType.SectionRun:
                        if (isInsertPropertiesAndStyleIndexToCurrentParagraph === undefined)
                            isInsertPropertiesAndStyleIndexToCurrentParagraph = currentRun.paragraph.startLogPosition.value == interval.start ? true : false;
                        var paragraph;
                        if (isInsertPropertiesAndStyleIndexToCurrentParagraph)
                            paragraph = currentRun.paragraph;
                        else {
                            var nextParagraphIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.subDocument.paragraphs, function (p) { return p.startLogPosition.value; }, currentRun.paragraph.startLogPosition.value) + 1;
                            paragraph = this.subDocument.paragraphs[nextParagraphIndex];
                        }
                        if (currentRun.getType() == __aspxRichEdit.RunType.ParagraphRun) {
                            result.registerItem(new __aspxRichEdit.HistoryRunParagraph(currentRun.getType(), currentRun.characterStyle, currentInterval.start, currentRun.maskedCharacterProperties, currentChunk.getRunText(currentRun), paragraph.paragraphStyle, paragraph.maskedParagraphProperties, isInsertPropertiesAndStyleIndexToCurrentParagraph, paragraph.numberingListIndex, paragraph.listLevelIndex, paragraph.tabs.clone()));
                        }
                        else {
                            result.registerItem(new __aspxRichEdit.HistoryRunSection(currentRun, paragraph, iterator.currentSection, currentInterval.start, isInsertPropertiesAndStyleIndexToCurrentParagraph));
                        }
                        lastParagraphRemovingLength = 0;
                        break;
                    case __aspxRichEdit.RunType.InlinePictureRun:
                        var currentPictureRun = currentRun;
                        if (!(currentPictureRun instanceof __aspxRichEdit.InlinePictureRun))
                            throw new Error("In TexManipulator.getHistoryRunsFromInterval currentPictureRun not have type InlinePictureRun");
                        result.registerItem(new __aspxRichEdit.HistoryRunInlinePicture(currentPictureRun.characterStyle, currentInterval.start, currentPictureRun.maskedCharacterProperties, currentPictureRun.id, currentPictureRun.size.originalSize.width, currentPictureRun.size.originalSize.height, currentPictureRun.size.scale.width, currentPictureRun.size.scale.height, currentPictureRun.size.lockAspectRatio, true, "", currentPictureRun.publicAPIId));
                        break;
                    case __aspxRichEdit.RunType.FieldCodeStartRun:
                        var globalOffset = currentInterval.start;
                        var fieldIndex = __aspxRichEdit.Field.normedBinaryIndexOf(this.subDocument.fields, globalOffset + 1);
                        var field = this.subDocument.fields[fieldIndex];
                        result.registerItem(new __aspxRichEdit.HistoryRunFieldCodeStart(currentRun.getType(), currentRun.characterStyle, globalOffset, currentRun.maskedCharacterProperties, currentChunk.getRunText(currentRun), field.showCode, field.getFieldStartPosition(), field.getSeparatorPosition(), field.getFieldEndPosition(), field.getHyperlinkInfo() ? field.getHyperlinkInfo().clone() : undefined));
                        break;
                    case __aspxRichEdit.RunType.FieldCodeEndRun:
                        result.registerItem(new __aspxRichEdit.HistoryRunFieldCodeEnd(currentRun.getType(), currentRun.characterStyle, currentInterval.start, currentRun.maskedCharacterProperties, currentChunk.getRunText(currentRun)));
                        break;
                    case __aspxRichEdit.RunType.FieldResultEndRun:
                        result.registerItem(new __aspxRichEdit.HistoryRunFieldResultEnd(currentRun.getType(), currentRun.characterStyle, currentInterval.start, currentRun.maskedCharacterProperties, currentChunk.getRunText(currentRun)));
                        break;
                    case __aspxRichEdit.RunType.AnchoredPictureRun:
                        var currentAnchoredRun = currentRun;
                        if (!(currentAnchoredRun instanceof __aspxRichEdit.AnchoredPictureRun))
                            throw new Error("In TextManipulator.getHistoryRunsFromInterval currentAnchoredRun is not of type AnchoredPictureRun");
                        result.registerItem(new __aspxRichEdit.HistoryRunAnchoredPicture(currentAnchoredRun.characterStyle, currentInterval.start, currentAnchoredRun.maskedCharacterProperties, currentAnchoredRun.id, currentAnchoredRun.size.clone(), currentAnchoredRun.size.scale.width, currentAnchoredRun.size.scale.height, currentAnchoredRun.size.lockAspectRatio, currentAnchoredRun.isLoaded, currentAnchoredRun.shape.clone(), currentAnchoredRun.anchorInfo.clone()));
                        break;
                    case __aspxRichEdit.RunType.AnchoredTextBoxRun:
                        var currentAnchoredTextBoxRun = currentRun;
                        if (!(currentAnchoredTextBoxRun instanceof __aspxRichEdit.AnchoredTextBoxRun))
                            throw new Error("In TextManipulator.getHistoryRunsFromInterval currentAnchoredTextBoxRun is not of type AnchoredTextBoxRun");
                        result.registerItem(new __aspxRichEdit.HistoryRunAnchoredTextBox(currentAnchoredTextBoxRun.characterStyle, currentInterval.start, currentAnchoredTextBoxRun.maskedCharacterProperties, currentAnchoredTextBoxRun.size.clone(), currentAnchoredTextBoxRun.size.lockAspectRatio, currentAnchoredTextBoxRun.shape.clone(), currentAnchoredTextBoxRun.textBoxProperties.clone(), currentAnchoredTextBoxRun.anchorInfo.clone(), this.manipulator.model.subDocuments[currentAnchoredTextBoxRun.subDocId]));
                        break;
                }
            }
            iterator.reset();
            this.cellsIterator.reset();
        };
        RemoveIntervalOperation.prototype.removeAccumulatedInterval = function (removingInterval, newPosition, advanceDelta) {
            advanceDelta -= removingInterval.length;
            if (Math.abs(advanceDelta) > 0)
                this.subDocument.positionManager.advance(removingInterval.start, advanceDelta);
            if (removingInterval.length)
                this.manipulator.dispatcher.notifyIntervalRemoved(this.subDocument, removingInterval.start, removingInterval.length);
            removingInterval.start = newPosition;
            removingInterval.length = 0;
        };
        RemoveIntervalOperation.prototype.mergeParagraphsInternal = function (subDocument, paragraphIndex, setPropertiesSecondParagraph) {
            var firstParagraph = subDocument.paragraphs[paragraphIndex];
            var lastParagraph = subDocument.paragraphs[paragraphIndex + 1];
            var runInfo = subDocument.getRunAndIndexesByPosition(lastParagraph.startLogPosition.value - 1);
            if (setPropertiesSecondParagraph)
                this.copyPropertiesToParagraph(firstParagraph, lastParagraph);
            var runs = subDocument.getRunsByInterval(new __aspxRichEdit.FixedInterval(lastParagraph.startLogPosition.value, lastParagraph.length));
            var chunkIndexDelta = this.currentChunkIndex - runInfo.chunkIndex;
            this.currentChunkIndex = runInfo.chunkIndex;
            this.removeRunInternal(subDocument, runInfo.runIndex);
            this.currentChunkIndex += chunkIndexDelta;
            firstParagraph.length--;
            for (var i = 0, run; run = runs[i]; i++) {
                run.paragraph = firstParagraph;
                run.onCharacterPropertiesChanged();
                firstParagraph.length += run.getLength();
            }
            subDocument.positionManager.advance(lastParagraph.startLogPosition.value - 1, -1);
            subDocument.positionManager.unregisterPosition(lastParagraph.startLogPosition);
            subDocument.paragraphs.splice(paragraphIndex + 1, 1);
        };
        RemoveIntervalOperation.prototype.removeRunInternal = function (subDocument, runIndex) {
            var currentChunk = subDocument.chunks[this.currentChunkIndex];
            var currentRun = currentChunk.textRuns[runIndex];
            currentChunk.textBuffer = currentChunk.textBuffer.substr(0, currentRun.startOffset) + currentChunk.textBuffer.substr(currentRun.startOffset + currentRun.getLength());
            currentChunk.textRuns.splice(runIndex, 1);
            __aspxRichEdit.TextManipulator.moveRunsInChunk(currentChunk, runIndex, -currentRun.getLength());
            if (currentChunk.textRuns.length === 0) {
                subDocument.positionManager.unregisterPosition(currentChunk.startLogPosition);
                subDocument.chunks.splice(this.currentChunkIndex--, 1);
            }
        };
        RemoveIntervalOperation.prototype.copyPropertiesToParagraph = function (to, from) {
            to.paragraphStyle = from.paragraphStyle;
            to.setParagraphProperties(from.maskedParagraphProperties);
            if (from.hasParagraphMergedProperies())
                to.setParagraphMergedProperies(from.getParagraphMergedProperies());
            to.numberingListIndex = from.numberingListIndex;
            to.listLevelIndex = from.listLevelIndex;
            to.tabs = from.tabs.clone();
        };
        return RemoveIntervalOperation;
    }());
    __aspxRichEdit.RemoveIntervalOperation = RemoveIntervalOperation;
    var RemoveIntervalOperationResult = (function () {
        function RemoveIntervalOperationResult(cellsIterator) {
            this.historyRuns = [];
            this.nestingLevels = [];
            this.bookmarkItems = [];
            this.cellsIterator = cellsIterator;
        }
        RemoveIntervalOperationResult.prototype.registerItem = function (historyRun) {
            this.cellsIterator.moveTo(historyRun.offsetAtStartDocument);
            var cell = this.cellsIterator.getCurrent();
            this.registerItemCore(historyRun, cell ? cell.parentRow.parentTable.nestedLevel : -1);
        };
        RemoveIntervalOperationResult.prototype.registerItemCore = function (historyRun, nestingLevel) {
            this.historyRuns.push(historyRun);
            this.nestingLevels.push(nestingLevel);
        };
        RemoveIntervalOperationResult.prototype.removeLastParagraphRun = function () {
            var lastIndex = this.historyRuns.length - 1;
            var lastHistoryRun = this.historyRuns[lastIndex];
            if (lastHistoryRun && lastHistoryRun.type == __aspxRichEdit.RunType.ParagraphRun) {
                this.historyRuns.splice(lastIndex, 1);
                this.nestingLevels.splice(lastIndex, 1);
            }
        };
        RemoveIntervalOperationResult.prototype.getIterator = function () {
            return new RemoveIntervalOperationResultIterator(this.historyRuns, this.nestingLevels);
        };
        return RemoveIntervalOperationResult;
    }());
    __aspxRichEdit.RemoveIntervalOperationResult = RemoveIntervalOperationResult;
    var SelectedCellsIterator = (function () {
        function SelectedCellsIterator(subDocument, interval) {
            this.current = 0;
            this.cells = SelectedCellsIterator.getCellsByInterval(subDocument, interval);
        }
        SelectedCellsIterator.prototype.moveTo = function (position) {
            if (position < this.position)
                this.reset();
            this.position = position;
            var cell;
            while (cell = this.cells[this.current]) {
                if (position >= cell.endParagrapPosition.value)
                    this.current++;
                else
                    return true;
            }
            return false;
        };
        SelectedCellsIterator.prototype.getCurrent = function () {
            var cell = this.cells[this.current];
            return cell ? SelectedCellsIterator.correctCurrent(this.position, cell) : null;
        };
        SelectedCellsIterator.prototype.getPrev = function () {
            var cell = this.cells[this.current];
            if (cell && this.position >= cell.endParagrapPosition.value)
                return cell;
            return this.cells[this.current - 1] || null;
        };
        SelectedCellsIterator.prototype.getNext = function () {
            var cell = this.cells[this.current];
            if (cell && this.position < cell.startParagraphPosition.value)
                return cell;
            return this.cells[this.current + 1] || null;
        };
        SelectedCellsIterator.prototype.reset = function () {
            this.current = 0;
            this.position = 0;
        };
        SelectedCellsIterator.getCellsByInterval = function (subDocument, interval) {
            if (subDocument.tables.length === 0)
                return [];
            var table = subDocument.tablesByLevels[0][Math.max(0, __aspxRichEdit.Utils.normedInterpolationIndexOf(subDocument.tablesByLevels[0], function (t) { return t.getStartPosition(); }, interval.start))];
            var intervalEnd = interval.end;
            if (intervalEnd < table.getStartPosition())
                return [];
            var result = [];
            this.collectCellsByIntervalCore(subDocument, result, table, interval.start, intervalEnd);
            return result.sort(function (c1, c2) { return c1.endParagrapPosition.value - c2.endParagrapPosition.value; });
        };
        SelectedCellsIterator.collectCellsByIntervalCore = function (subDocument, result, table, intervalStart, intervalEnd) {
            var nextTable = subDocument.tables[table.index + 1];
            if (nextTable && nextTable.getStartPosition() <= intervalEnd)
                this.collectCellsByIntervalCore(subDocument, result, nextTable, intervalStart, intervalEnd);
            for (var rowIndex = 0, row = void 0; row = table.rows[rowIndex]; rowIndex++) {
                for (var cellIndex = 0, cell = void 0; cell = row.cells[cellIndex]; cellIndex++) {
                    if (intervalStart < cell.endParagrapPosition.value && intervalEnd > cell.startParagraphPosition.value)
                        result.push(cell);
                    else if (intervalStart === cell.endParagrapPosition.value && cell.parentRow.parentTable.getLastCell() === cell)
                        result.push(cell);
                    else if (cell.parentRow.parentTable.getFirstCell() === cell && cell.startParagraphPosition.value === intervalEnd)
                        result.push(cell);
                    else if (cell.startParagraphPosition.value > intervalEnd)
                        return;
                }
            }
        };
        SelectedCellsIterator.correctCurrent = function (position, cell) {
            if (position >= cell.startParagraphPosition.value && position < cell.endParagrapPosition.value)
                return cell;
            if (position < cell.startParagraphPosition.value && cell.parentRow.parentTable.parentCell)
                return this.correctCurrent(position, cell.parentRow.parentTable.parentCell);
            return null;
        };
        return SelectedCellsIterator;
    }());
    __aspxRichEdit.SelectedCellsIterator = SelectedCellsIterator;
    var RemoveIntervalOperationResultIterator = (function () {
        function RemoveIntervalOperationResultIterator(historyRuns, nestingLevels) {
            this.position = -1;
            this.historyRuns = historyRuns;
            this.nestingLevels = nestingLevels;
        }
        RemoveIntervalOperationResultIterator.prototype.moveNext = function () {
            this.position++;
            this.currentHistoryRun = this.historyRuns[this.position];
            this.currentNestingLevel = this.nestingLevels[this.position];
            return !!this.currentHistoryRun;
        };
        return RemoveIntervalOperationResultIterator;
    }());
    __aspxRichEdit.RemoveIntervalOperationResultIterator = RemoveIntervalOperationResultIterator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var RestoreRemovedIntervalOperation = (function () {
        function RestoreRemovedIntervalOperation(manipulator, subDocument) {
            this.currentTableIndex = undefined;
            this.manipulator = manipulator;
            this.subDocument = subDocument;
        }
        RestoreRemovedIntervalOperation.prototype.execute = function (removeOperationResult) {
            var iterator = removeOperationResult.getIterator();
            var subDocument = this.subDocument;
            var textManipulator = this.manipulator.text;
            var fields = this.subDocument.fields;
            var fieldStackHistory = [];
            while (iterator.moveNext()) {
                var historyRun = iterator.currentHistoryRun;
                switch (historyRun.type) {
                    case __aspxRichEdit.RunType.ParagraphRun:
                        if (!(historyRun instanceof __aspxRichEdit.HistoryRunParagraph))
                            throw new Error("In unpackHistoryRunsToModel type text run = TextRunType.ParagraphRun, but type historyRun != HistoryRunParagraph. historyRun.offsetAtStartDocument = " +
                                historyRun.offsetAtStartDocument + ", historyRun.text = " + historyRun.text);
                        var historyRunParagraph = historyRun;
                        var currentTable = this.getTableForShifting(historyRunParagraph.offsetAtStartDocument);
                        textManipulator.insertParagraph(subDocument, historyRunParagraph.offsetAtStartDocument, historyRunParagraph.characterProperties, historyRunParagraph.characterStyle, historyRunParagraph.paragraphMaskedProperties, historyRunParagraph.paragraphStyle, historyRunParagraph.isInsertPropertiesAndStyleIndexToCurrentParagraph, historyRunParagraph.numbericListIndex, historyRunParagraph.listLevelIndex, historyRunParagraph.tabs.clone());
                        if (currentTable && currentTable.nestedLevel > iterator.currentNestingLevel)
                            this.shiftTablesToPosition(currentTable, historyRunParagraph.offsetAtStartDocument + 1, iterator.currentNestingLevel);
                        break;
                    case __aspxRichEdit.RunType.SectionRun:
                        if (!(historyRun instanceof __aspxRichEdit.HistoryRunSection))
                            throw new Error("In unpackHistoryRunsToModel type text run = TextRunType.SectionRun, but type historyRun != HistoryRunSection. historyRun.offsetAtStartDocument = " +
                                historyRun.offsetAtStartDocument + ", historyRun.text = " + historyRun.text);
                        var historyRunSection = historyRun;
                        textManipulator.insertSection(subDocument, historyRunSection.offsetAtStartDocument, historyRunSection.characterProperties, historyRunSection.characterStyle, historyRunSection.sectionProperties, true, historyRunSection.paragraphStyle, historyRunSection.paragraphMaskedProperties, historyRunSection.isInsertPropertiesAndStyleIndexToCurrentParagraph, historyRunSection.numbericListIndex, historyRunSection.listLevelIndex, historyRunSection.tabs.clone());
                        break;
                    case __aspxRichEdit.RunType.InlinePictureRun:
                        if (!(historyRun instanceof __aspxRichEdit.HistoryRunInlinePicture))
                            throw new Error("In unpackHistoryRunsToModel type text run = TextRunType.InlinePictureRun, but type historyRun != HistoryRunInlinePicture. historyRun.offsetAtStartDocument = " +
                                historyRun.offsetAtStartDocument + ", historyRun.text = " + historyRun.text);
                        var inlineHistoryRun = historyRun;
                        textManipulator.insertInlinePicture(subDocument, historyRun.offsetAtStartDocument, inlineHistoryRun.id, inlineHistoryRun.originalWidth, inlineHistoryRun.originalHeight, inlineHistoryRun.scaleX, inlineHistoryRun.scaleY, inlineHistoryRun.lockAspectRatio, historyRun.characterProperties, historyRun.characterStyle, true, inlineHistoryRun.publicAPIID);
                        break;
                    case __aspxRichEdit.RunType.FieldCodeStartRun:
                        if (!(historyRun instanceof __aspxRichEdit.HistoryRunFieldCodeStart))
                            throw new Error("In unpackHistoryRunsToModel type text run = TextRunType.HistoryRunFieldCodeStart, but type historyRun != HistoryRunFieldCodeStart. historyRun.offsetAtStartDocument = " +
                                historyRun.offsetAtStartDocument + ", historyRun.text = " + historyRun.text);
                        fieldStackHistory.push(historyRun);
                        textManipulator.insertText(subDocument, historyRun.offsetAtStartDocument, historyRun.text, historyRun.characterProperties, historyRun.characterStyle, historyRun.type);
                        break;
                    case __aspxRichEdit.RunType.FieldResultEndRun:
                        textManipulator.insertText(subDocument, historyRun.offsetAtStartDocument, historyRun.text, historyRun.characterProperties, historyRun.characterStyle, historyRun.type);
                        var histFieldCodeStartRun = fieldStackHistory.pop();
                        var fieldInsertIndex = 0;
                        if (fields.length > 0) {
                            fieldInsertIndex = Math.max(0, __aspxRichEdit.Field.normedBinaryIndexOf(fields, histFieldCodeStartRun.startPosition + 1));
                            if (histFieldCodeStartRun.startPosition > fields[fieldInsertIndex].getFieldStartPosition())
                                fieldInsertIndex++;
                        }
                        var newField = new __aspxRichEdit.Field(subDocument.positionManager, fieldInsertIndex, histFieldCodeStartRun.startPosition, histFieldCodeStartRun.separatorPosition, histFieldCodeStartRun.endPosition, histFieldCodeStartRun.showCode, histFieldCodeStartRun.hyperlinkInfo ? histFieldCodeStartRun.hyperlinkInfo.clone() : undefined);
                        __aspxRichEdit.Field.addField(fields, newField);
                        this.manipulator.dispatcher.notifyFieldInserted(subDocument, histFieldCodeStartRun.startPosition, histFieldCodeStartRun.separatorPosition, histFieldCodeStartRun.endPosition);
                        if (histFieldCodeStartRun.hyperlinkInfo)
                            this.manipulator.dispatcher.notifyHyperlinkInfoChanged(subDocument, __aspxRichEdit.FixedInterval.fromPositions(histFieldCodeStartRun.separatorPosition + 1, histFieldCodeStartRun.endPosition - 1), __aspxRichEdit.FixedInterval.fromPositions(histFieldCodeStartRun.startPosition + 1, histFieldCodeStartRun.endPosition), histFieldCodeStartRun.hyperlinkInfo);
                        break;
                    case __aspxRichEdit.RunType.AnchoredPictureRun:
                        var anchoredPictureHistoryRun = historyRun;
                        textManipulator.insertAnchoredPicture(subDocument, historyRun.offsetAtStartDocument, anchoredPictureHistoryRun.id, anchoredPictureHistoryRun.size, historyRun.characterProperties, historyRun.characterStyle, anchoredPictureHistoryRun.isLoaded, anchoredPictureHistoryRun.shapeInfo.clone(), anchoredPictureHistoryRun.anchorInfo.clone());
                        break;
                    case __aspxRichEdit.RunType.AnchoredTextBoxRun:
                        var anchoredTextBoxHistoryRun = historyRun;
                        var size = anchoredTextBoxHistoryRun.size;
                        var newTextBoxRun = textManipulator.insertAnchoredTextBox(subDocument, historyRun.offsetAtStartDocument, size, historyRun.characterProperties, historyRun.characterStyle, anchoredTextBoxHistoryRun.shapeInfo.clone(), anchoredTextBoxHistoryRun.textBoxProperties.clone(), anchoredTextBoxHistoryRun.anchorInfo.clone());
                        this.manipulator.text.insertSubDocumentInOtherSubDocument(this.manipulator.model.subDocuments[newTextBoxRun.subDocId], 0, anchoredTextBoxHistoryRun.innerSubDocument, new __aspxRichEdit.FixedInterval(0, anchoredTextBoxHistoryRun.innerSubDocument.getDocumentEndPosition() - 1));
                        break;
                    default:
                        textManipulator.insertText(subDocument, historyRun.offsetAtStartDocument, historyRun.text, historyRun.characterProperties, historyRun.characterStyle, historyRun.type);
                        break;
                }
            }
            for (var _i = 0, _a = removeOperationResult.bookmarkItems; _i < _a.length; _i++) {
                var bkmTemplate = _a[_i];
                this.manipulator.bookmarksManipulator.createBookmark(subDocument, bkmTemplate, false);
            }
            subDocument.bookmarks = subDocument.bookmarks.sort(__aspxRichEdit.CompareUtils.bookmarksComparer);
        };
        RestoreRemovedIntervalOperation.prototype.shiftTablesToPosition = function (table, position, minNestingLevel) {
            this.manipulator.tables.changeTableStartPosition(this.subDocument, table, position);
            var prevTable = this.subDocument.tables[table.index - 1];
            if (prevTable && prevTable.nestedLevel > minNestingLevel)
                this.shiftTablesToPosition(prevTable, position, minNestingLevel);
        };
        RestoreRemovedIntervalOperation.prototype.getTableForShifting = function (position) {
            if (this.currentTableIndex === undefined) {
                this.currentTableIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(this.subDocument.tables, function (t) { return t.getStartPosition(); }, position);
                while (this.currentTableIndex > -1 && this.subDocument.tables[this.currentTableIndex].nestedLevel > 0)
                    this.currentTableIndex--;
            }
            var table;
            while (table = this.subDocument.tables[this.currentTableIndex]) {
                if (position >= table.getEndPosition()) {
                    this.currentTableIndex++;
                    continue;
                }
                else if (position < table.getStartPosition())
                    return null;
                var nextTable = this.subDocument.tables[this.currentTableIndex + 1];
                if (!nextTable || nextTable.getStartPosition() > position)
                    return table;
                this.currentTableIndex++;
            }
            return null;
        };
        return RestoreRemovedIntervalOperation;
    }());
    __aspxRichEdit.RestoreRemovedIntervalOperation = RestoreRemovedIntervalOperation;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var __DEBUG_TABLE = (function () {
        function __DEBUG_TABLE() {
        }
        __DEBUG_TABLE.tables = function (subDocument) {
            var tables = subDocument.tables;
            if (!tables.length)
                return;
            __aspxRichEdit.ListUtils.foreach(subDocument.tablesByLevels, function (levelTables, levelInd) {
                if (levelTables.length) {
                    var prevTblInd_1 = levelTables[0].index - 1;
                    __aspxRichEdit.ListUtils.foreach(levelTables, function (tbl) {
                        if (tbl.nestedLevel != levelInd)
                            throw new Error("DEBUG_TABLES_CHECKS incorrect position of table(his index = " + tbl.index + "), level = " + levelInd);
                        if (tbl.index <= prevTblInd_1)
                            throw new Error("DEBUG_TABLES_CHECKS incorrect order of tables on level " + levelInd);
                        prevTblInd_1 = tbl.index;
                    });
                }
            });
            if (!__aspxRichEdit.ListUtils.allOf(tables, function (t, i) { return t.index > tables[i - 1].index; }, 1))
                throw new Error("DEBUG_TABLES_CHECKS incorrect order of subDocument[" + subDocument.id + "].tables");
            for (var _i = 0, tables_1 = tables; _i < tables_1.length; _i++) {
                var t = tables_1[_i];
                __DEBUG_TABLE.table(t);
            }
        };
        __DEBUG_TABLE.table = function (table) {
            var colCount = __aspxRichEdit.TableCellUtils.getColumnCount(table);
            if (!table.rows.length)
                throw new Error("DEBUG_TABLE_CHECKS no rowsOnTable");
            __aspxRichEdit.ListUtils.foreach(table.rows, function (r, rInd) {
                if (r.logicColumnCount != colCount)
                    throw new Error("DEBUG_TABLE_CHECKS incorrectColCount on row[" + rInd + "]. Must be = " + colCount);
                if (!r.cells.length)
                    throw new Error("DEBUG_TABLE_CHECKS no cellsOnRow on row[" + rInd + "]");
            });
            new TableData(table, colCount).check();
        };
        __DEBUG_TABLE.VISUALIZE_SELECTED_CELLS = function (tableInfo) {
            if (tableInfo.extendedData.numRows == 0)
                return "noCells";
            var table = tableInfo.table;
            var result = __aspxRichEdit.ListUtils.initByCallback(table.rows.length, function () {
                return __aspxRichEdit.ListUtils.initByValue(__aspxRichEdit.TableCellUtils.getColumnCount(table), "*");
            });
            var cgim = new __aspxRichEdit.LayoutFormatter.Table.CellGridInfoManager(table);
            tableInfo.extendedData.foreach(function () { }, function (cellInfo, rowInfo) {
                var cellGridInfo = cgim.tableCellInfos[rowInfo.rowIndex][cellInfo.cellIndex];
                __aspxRichEdit.ListUtils.foreachOnInterval(cellGridInfo.rowIndexesInterval, function (rowIndex) {
                    __aspxRichEdit.ListUtils.foreachOnInterval(new __aspxRichEdit.FixedInterval(cellGridInfo.getGridCellIndex(), cellInfo.cell.columnSpan), function (colIndex) {
                        result[rowIndex][colIndex] = "X";
                    });
                });
            });
            return __aspxRichEdit.ListUtils.map(result, function (r) { return r.join(""); }).join("\n");
        };
        return __DEBUG_TABLE;
    }());
    __aspxRichEdit.__DEBUG_TABLE = __DEBUG_TABLE;
    var DebugTableCellState;
    (function (DebugTableCellState) {
        DebugTableCellState[DebugTableCellState["NotVisited"] = 0] = "NotVisited";
        DebugTableCellState[DebugTableCellState["None"] = 1] = "None";
        DebugTableCellState[DebugTableCellState["Continious"] = 2] = "Continious";
        DebugTableCellState[DebugTableCellState["Restart"] = 3] = "Restart";
        DebugTableCellState[DebugTableCellState["BeforeAfter"] = 4] = "BeforeAfter";
    })(DebugTableCellState || (DebugTableCellState = {}));
    var Data = (function () {
        function Data(startCellSpan, cellLen, state) {
            this.startCellSpan = startCellSpan;
            this.state = state;
            this.cellLen = cellLen;
        }
        Data.prototype.toString = function () {
            return Data.toStrMap[this.state] + "[" + this.startCellSpan + "|" + (this.startCellSpan + this.cellLen) + ")";
        };
        Data.toStrMap = new __aspxRichEdit.MapCreatorNumberAsKey()
            .add(DebugTableCellState.None, "N")
            .add(DebugTableCellState.Restart, "R")
            .add(DebugTableCellState.Continious, "C")
            .add(DebugTableCellState.NotVisited, "NoVis")
            .add(DebugTableCellState.BeforeAfter, "BA")
            .get();
        return Data;
    }());
    var TableData = (function () {
        function TableData(table, colCount) {
            this.colCount = colCount;
            this.table = table;
        }
        TableData.prototype.check = function () {
            this.fill();
            this.checkData();
            __DEBUG_TABLE.lastString = this.toString();
        };
        TableData.prototype.fill = function () {
            var _this = this;
            this.tblData = __aspxRichEdit.ListUtils.initByCallback(this.table.rows.length, function () { return __aspxRichEdit.ListUtils.initByValue(_this.colCount, new Data(-1, -1, DebugTableCellState.NotVisited)); });
            var tblPos = new __aspxRichEdit.TablePosition(this.table, -1, -1);
            var _loop_10 = function () {
                __aspxRichEdit.ListUtils.foreachOnInterval(new __aspxRichEdit.FixedInterval(0, tblPos.row.gridBefore), function (colIndex) { return _this.add(new __aspxRichEdit.TablePositionIndexes(tblPos.rowIndex, colIndex), null, -1, -1); });
                var cellSpan = tblPos.row.gridBefore;
                while (tblPos.moveToNextCell()) {
                    __aspxRichEdit.ListUtils.foreachOnInterval(new __aspxRichEdit.FixedInterval(cellSpan, tblPos.cell.columnSpan), function (colIndex) { return _this.add(new __aspxRichEdit.TablePositionIndexes(tblPos.rowIndex, colIndex), tblPos.cell, cellSpan, tblPos.cell.columnSpan); });
                    cellSpan += tblPos.cell.columnSpan;
                }
                __aspxRichEdit.ListUtils.foreachOnInterval(new __aspxRichEdit.FixedInterval(cellSpan, tblPos.row.gridAfter), function (colIndex) { return _this.add(new __aspxRichEdit.TablePositionIndexes(tblPos.rowIndex, colIndex), null, -1, -1); });
            };
            while (tblPos.moveToNextRow()) {
                _loop_10();
            }
        };
        TableData.prototype.add = function (ind, cell, startCellSpan, cellSpanLength) {
            var oldVal = this.tblData[ind.rowIndex][ind.cellIndex];
            if (oldVal.state != DebugTableCellState.NotVisited)
                throw new Error("DEBUG_TABLE_CHECKS Table model is incorrect");
            this.tblData[ind.rowIndex][ind.cellIndex] = new Data(startCellSpan, cellSpanLength, this.getState(cell));
        };
        TableData.prototype.checkData = function () {
            var _this = this;
            __aspxRichEdit.ListUtils.foreach(this.tblData, function (rowData, rowInd) {
                __aspxRichEdit.ListUtils.foreach(rowData, function (data, colInd) {
                    switch (data.state) {
                        case DebugTableCellState.NotVisited:
                            throw new Error("DEBUG_TABLE_CHECKS some of logic cells is free");
                        case DebugTableCellState.Continious: {
                            if (rowInd == 0)
                                throw new Error("DEBUG_TABLE_CHECKS obvious error [" + rowInd + "][" + colInd + "]");
                            var neighborRowData = _this.tblData[rowInd - 1][colInd];
                            if (neighborRowData.cellLen != data.cellLen || neighborRowData.startCellSpan != data.startCellSpan ||
                                !__aspxRichEdit.EnumUtils.isAnyOf(neighborRowData.state, DebugTableCellState.Continious, DebugTableCellState.Restart)) {
                                console.log(_this.toString());
                                throw new Error("DEBUG_TABLE_CHECKS error");
                            }
                            break;
                        }
                        case DebugTableCellState.Restart: {
                            if (rowInd == _this.table.rows.length - 1)
                                throw new Error("DEBUG_TABLE_CHECKS obvious error [" + rowInd + "][" + colInd + "]");
                            var neighborRowData = _this.tblData[rowInd + 1][colInd];
                            if (neighborRowData.cellLen != data.cellLen || neighborRowData.startCellSpan != data.startCellSpan ||
                                neighborRowData.state != DebugTableCellState.Continious) {
                                console.log(_this.toString());
                                throw new Error("DEBUG_TABLE_CHECKS error");
                            }
                            break;
                        }
                        case DebugTableCellState.None:
                    }
                });
            });
        };
        TableData.prototype.toString = function () {
            return __aspxRichEdit.ListUtils.map(this.tblData, function (d) {
                return __aspxRichEdit.ListUtils.map(d, function (val) { return val.toString(); }).join("\t");
            }).join("\n");
        };
        TableData.prototype.getState = function (cell) {
            if (!cell)
                return DebugTableCellState.BeforeAfter;
            switch (cell.verticalMerging) {
                case __aspxRichEdit.TableCellMergingState.None: return DebugTableCellState.None;
                case __aspxRichEdit.TableCellMergingState.Restart: return DebugTableCellState.Restart;
                case __aspxRichEdit.TableCellMergingState.Continue: return DebugTableCellState.Continious;
            }
        };
        return TableData;
    }());
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Table = (function () {
        function Table(properties, style) {
            this.rows = [];
            this.preferredWidth = __aspxRichEdit.TableWidthUnit.createDefault();
            this.lookTypes = __aspxRichEdit.TableLookTypes.None;
            this.properties = properties;
            this.style = style;
        }
        Table.prototype.destructor = function (positionManager) {
            for (var rowIndex = 0, tableRow; tableRow = this.rows[rowIndex]; rowIndex++)
                tableRow.destructor(positionManager);
        };
        Object.defineProperty(Table.prototype, "interval", {
            get: function () { return __aspxRichEdit.FixedInterval.fromPositions(this.getStartPosition(), this.getEndPosition()); },
            enumerable: true,
            configurable: true
        });
        Table.prototype.getParentTable = function () {
            var parentCell = this.parentCell;
            return parentCell ? this.parentCell.parentRow.parentTable : null;
        };
        Table.prototype.getTopLevelParent = function () {
            var currTable = this;
            while (currTable.parentCell)
                currTable = currTable.getParentTable();
            return currTable;
        };
        Table.prototype.getStartPosition = function () {
            return this.rows[0].getStartPosition();
        };
        Table.prototype.getEndPosition = function () {
            return this.rows[this.rows.length - 1].getEndPosition();
        };
        Table.prototype.getLastCell = function () {
            var lastRow = this.rows[this.rows.length - 1];
            return lastRow.cells[lastRow.cells.length - 1];
        };
        Table.prototype.getFirstCell = function () {
            return this.rows[0].cells[0];
        };
        Table.sort = function (tables) {
            tables.sort(__aspxRichEdit.CompareUtils.tableComparer);
            for (var tableIndex = 0, table = void 0; table = tables[tableIndex]; tableIndex++)
                table.index = tableIndex;
        };
        Table.fillTableByLevels = function (subDocument) {
            var tableByLevels = subDocument.tablesByLevels;
            var tableByLevelsLength = tableByLevels.length;
            for (var tableIndex = 0, table = void 0; table = subDocument.tables[tableIndex]; tableIndex++) {
                table.index = tableIndex;
                if (table.nestedLevel >= tableByLevelsLength) {
                    tableByLevels.push([]);
                    tableByLevelsLength++;
                }
                tableByLevels[table.nestedLevel].push(table);
            }
        };
        Table.getTableCellByPosition = function (tables, position) {
            var table = Table.getTableByPosition(tables, position, true);
            if (!table)
                return null;
            var rowIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(table.rows, function (r) { return r.getStartPosition(); }, position);
            var row = table.rows[rowIndex];
            var cellIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(row.cells, function (c) { return c.startParagraphPosition.value; }, position);
            return row.cells[cellIndex];
        };
        Table.getTableByPosition = function (tables, position, maxNestedLevel, tableIndex) {
            if (tableIndex === void 0) { tableIndex = __aspxRichEdit.Utils.normedInterpolationIndexOf(tables, function (t) { return t.getStartPosition(); }, position); }
            if (tableIndex < 0)
                return null;
            var table = tables[tableIndex];
            while (position >= table.getEndPosition()) {
                if (table.nestedLevel === 0)
                    return null;
                table = table.getParentTable();
            }
            return Table.correctBoundTable(tables, table.index, position, maxNestedLevel ? function (index) { return ++index; } : function (index) { return --index; });
        };
        Table.correctBoundTable = function (tables, tableIndex, position, indexIterator) {
            var table = tables[tableIndex];
            var tablePos = table.getStartPosition();
            tableIndex = indexIterator(tableIndex);
            for (var neighborTable = void 0; neighborTable = tables[tableIndex]; tableIndex = indexIterator(tableIndex)) {
                var neighborTablePos = neighborTable.getStartPosition();
                if (tablePos != neighborTablePos || position >= neighborTable.getEndPosition())
                    break;
                tablePos = neighborTablePos;
                table = neighborTable;
            }
            return table;
        };
        Table.getFirstCellPositionInVerticalMergingGroup = function (tablePosition) {
            if (tablePosition.cell.verticalMerging != __aspxRichEdit.TableCellMergingState.Continue)
                return tablePosition;
            var tblPos = tablePosition.clone().init();
            var cellColumnIndex = tblPos.row.getCellColumnIndex(tblPos.cellIndex);
            while (tblPos.moveToPrevRow()) {
                var columnIndex = tblPos.row.gridBefore;
                tblPos.setCell(0);
                do {
                    if (cellColumnIndex <= columnIndex) {
                        if (tblPos.cell.verticalMerging != __aspxRichEdit.TableCellMergingState.Continue || tblPos.rowIndex == 0)
                            return tblPos;
                        else
                            break;
                    }
                    columnIndex += tblPos.cell.columnSpan;
                } while (tblPos.moveToNextCell());
            }
            return null;
        };
        Table.DEBUG_TABLES_CHECKS = function (subDocument, forceCheck) {
            if (forceCheck === void 0) { forceCheck = false; }
            if (!forceCheck && !__aspxRichEdit.Log.isEnabled)
                return;
            __aspxRichEdit.__DEBUG_TABLE.tables(subDocument);
        };
        return Table;
    }());
    __aspxRichEdit.Table = Table;
    var TablePositionIndexes = (function () {
        function TablePositionIndexes(rowIndex, cellIndex) {
            this.rowIndex = rowIndex;
            this.cellIndex = cellIndex;
        }
        TablePositionIndexes.prototype.equals = function (obj) {
            return obj &&
                this.cellIndex == obj.cellIndex &&
                this.rowIndex == obj.rowIndex;
        };
        TablePositionIndexes.prototype.copyFrom = function (obj) {
            this.rowIndex = obj.rowIndex;
            this.cellIndex = obj.cellIndex;
        };
        TablePositionIndexes.prototype.clone = function () {
            return new TablePositionIndexes(this.rowIndex, this.cellIndex);
        };
        return TablePositionIndexes;
    }());
    __aspxRichEdit.TablePositionIndexes = TablePositionIndexes;
    var TablePosition = (function (_super) {
        __extends(TablePosition, _super);
        function TablePosition(table, rowIndex, cellIndex) {
            var _this = _super.call(this, rowIndex, cellIndex) || this;
            _this.table = table;
            return _this;
        }
        TablePosition.prototype.initIndexes = function (rowIndex, cellIndex) {
            this.rowIndex = rowIndex;
            this.cellIndex = cellIndex;
            return this;
        };
        TablePosition.prototype.init = function () {
            this.row = this.table.rows[this.rowIndex];
            this.cell = this.row.cells[this.cellIndex];
            return this;
        };
        TablePosition.prototype.setRow = function (rowIndex) {
            this.rowIndex = rowIndex;
            this.row = this.table.rows[this.rowIndex];
            return this;
        };
        TablePosition.prototype.setCell = function (cellIndex) {
            this.cellIndex = cellIndex;
            this.cell = this.row.cells[cellIndex];
        };
        TablePosition.createAndInit = function (table, rowIndex, cellIndex) {
            var position = new TablePosition(table, rowIndex, cellIndex);
            position.init();
            return position;
        };
        TablePosition.indexOfCell = function (positions, cell) {
            for (var i = 0, pos = void 0; pos = positions[i]; i++) {
                if (pos.cell === cell)
                    return i;
            }
            return -1;
        };
        TablePosition.prototype.moveToPrevRow = function () {
            if (!this.rowIndex)
                return false;
            this.rowIndex--;
            this.row = this.table.rows[this.rowIndex];
            return true;
        };
        TablePosition.prototype.moveToNextRow = function () {
            if (this.rowIndex == this.table.rows.length - 1)
                return false;
            this.rowIndex++;
            this.row = this.table.rows[this.rowIndex];
            this.cellIndex = -1;
            return true;
        };
        TablePosition.prototype.moveToNextCell = function () {
            if (this.cellIndex == this.row.cells.length - 1)
                return false;
            this.cellIndex++;
            this.cell = this.row.cells[this.cellIndex];
            return true;
        };
        TablePosition.prototype.copyFrom = function (obj) {
            _super.prototype.copyFrom.call(this, obj);
            this.table = obj.table;
            this.row = obj.row;
            this.cell = obj.cell;
        };
        TablePosition.prototype.clone = function () {
            var pos = new TablePosition(this.table, this.rowIndex, this.cellIndex);
            pos.row = this.row;
            pos.cell = this.cell;
            return pos;
        };
        TablePosition.prototype.equals = function (obj) {
            return obj &&
                this.table == obj.table &&
                this.rowIndex == obj.rowIndex &&
                this.cellIndex == obj.cellIndex;
        };
        return TablePosition;
    }(TablePositionIndexes));
    __aspxRichEdit.TablePosition = TablePosition;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableCell = (function () {
        function TableCell(parentRow, properties) {
            this.preferredWidth = __aspxRichEdit.TableWidthUnit.createDefault();
            this.columnSpan = 1;
            this.verticalMerging = __aspxRichEdit.TableCellMergingState.None;
            this.conditionalFormatting = __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable;
            this.parentRow = parentRow;
            this.properties = properties;
        }
        TableCell.prototype.destructor = function (positionManager) {
            if (this.startParagraphPosition)
                positionManager.unregisterPosition(this.startParagraphPosition);
            if (this.endParagrapPosition)
                positionManager.unregisterPosition(this.endParagrapPosition);
        };
        Object.defineProperty(TableCell.prototype, "interval", {
            get: function () { return __aspxRichEdit.FixedInterval.fromPositions(this.startParagraphPosition.value, this.endParagrapPosition.value); },
            enumerable: true,
            configurable: true
        });
        return TableCell;
    }());
    __aspxRichEdit.TableCell = TableCell;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableRow = (function () {
        function TableRow(parentTable, properties) {
            this.cells = [];
            this.widthBefore = __aspxRichEdit.TableWidthUnit.createDefault();
            this.widthAfter = __aspxRichEdit.TableWidthUnit.createDefault();
            this.gridBefore = 0;
            this.gridAfter = 0;
            this.height = __aspxRichEdit.TableHeightUnit.createDefault();
            this.tablePropertiesException = new __aspxRichEdit.TableProperties();
            this.conditionalFormatting = __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable;
            this.parentTable = parentTable;
            this.properties = properties;
        }
        Object.defineProperty(TableRow.prototype, "logicColumnCount", {
            get: function () { return this.gridBefore + this.gridAfter + __aspxRichEdit.ListUtils.accumulate(this.cells, 0, function (acc, c) { return acc += c.columnSpan; }); },
            enumerable: true,
            configurable: true
        });
        TableRow.prototype.destructor = function (positionManager) {
            for (var cellIndex = 0, cell; cell = this.cells[cellIndex]; cellIndex++)
                cell.destructor(positionManager);
        };
        TableRow.prototype.getStartPosition = function () {
            return this.cells[0].startParagraphPosition.value;
        };
        TableRow.prototype.getEndPosition = function () {
            return __aspxRichEdit.ListUtils.last(this.cells).endParagrapPosition.value;
        };
        Object.defineProperty(TableRow.prototype, "interval", {
            get: function () { return __aspxRichEdit.FixedInterval.fromPositions(this.getStartPosition(), this.getEndPosition()); },
            enumerable: true,
            configurable: true
        });
        TableRow.prototype.getCellColumnIndex = function (cellIndex) {
            return __aspxRichEdit.ListUtils.accumulate(this.cells, this.gridBefore, function (acc, cell) { return acc + cell.columnSpan; }, 0, cellIndex);
        };
        TableRow.prototype.getTotalCellsInRowConsiderGrid = function () {
            var cells = this.gridBefore;
            for (var i = 0, cell = void 0; cell = this.cells[i]; i++)
                cells += cell.columnSpan;
            cells += this.gridAfter;
            return cells;
        };
        return TableRow;
    }());
    __aspxRichEdit.TableRow = TableRow;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableCellProperties = (function () {
        function TableCellProperties() {
            this.mask = TableCellPropertiesMask.UseNone;
            this.cellMargins = __aspxRichEdit.TableCellMargins.create(__aspxRichEdit.TableWidthUnit.createDefault(), __aspxRichEdit.TableWidthUnit.createDefault(), __aspxRichEdit.TableWidthUnit.createDefault(), __aspxRichEdit.TableWidthUnit.createDefault());
            this.borders = __aspxRichEdit.TableCellBorders.create(new __aspxRichEdit.BorderInfo(), new __aspxRichEdit.BorderInfo(), new __aspxRichEdit.BorderInfo(), new __aspxRichEdit.BorderInfo(), new __aspxRichEdit.BorderInfo(), new __aspxRichEdit.BorderInfo());
            this.hideCellMark = false;
            this.noWrap = false;
            this.fitText = false;
            this.textDirection = __aspxRichEdit.TextDirection.LeftToRightTopToBottom;
            this.verticalAlignment = __aspxRichEdit.TableCellVerticalAlignment.Top;
            this.shadingInfo = __aspxRichEdit.ShadingInfo.noColor;
        }
        TableCellProperties.prototype.calculateHash = function () {
            return __aspxRichEdit.MathUtils.somePrimes[0] * this.mask ^
                __aspxRichEdit.MathUtils.somePrimes[1] * this.borders.getHashCode() ^
                __aspxRichEdit.MathUtils.somePrimes[2] * this.verticalAlignment ^
                __aspxRichEdit.MathUtils.somePrimes[3] * this.shadingInfo.getHashCode();
        };
        TableCellProperties.prototype.getHashCode = function () {
            return this.hash === undefined ? this.hash = this.calculateHash() : this.hash;
        };
        TableCellProperties.prototype.equals = function (obj) {
            if (!obj)
                return false;
            return this.mask == obj.mask &&
                this.cellMargins.equals(obj.cellMargins) &&
                this.borders.equals(obj.borders) &&
                this.hideCellMark == obj.hideCellMark &&
                this.noWrap == obj.noWrap &&
                this.fitText == obj.fitText &&
                this.textDirection == obj.textDirection &&
                this.verticalAlignment == obj.verticalAlignment &&
                this.shadingInfo.equals(obj.shadingInfo);
        };
        TableCellProperties.prototype.clone = function () {
            var result = new TableCellProperties();
            result.copyFrom(this);
            return result;
        };
        TableCellProperties.prototype.copyFrom = function (obj) {
            this.mask = obj.mask;
            this.cellMargins = obj.cellMargins.clone();
            this.borders = obj.borders.clone();
            this.hideCellMark = obj.hideCellMark;
            this.noWrap = obj.noWrap;
            this.fitText = obj.fitText;
            this.textDirection = obj.textDirection;
            this.verticalAlignment = obj.verticalAlignment;
            if (obj.shadingInfo)
                this.shadingInfo = obj.shadingInfo.clone();
        };
        TableCellProperties.prototype.setUseValue = function (mask, value) {
            if (value)
                this.mask |= mask;
            else
                this.mask &= ~mask;
        };
        TableCellProperties.prototype.getUseValue = function (mask) {
            return (this.mask & mask) != 0;
        };
        TableCellProperties.prototype.setValue = function (desc, value) {
            desc.setProp(this, value);
            this.setUseValue(desc.maskValue(), true);
        };
        return TableCellProperties;
    }());
    __aspxRichEdit.TableCellProperties = TableCellProperties;
    var TableCellPropertiesMask;
    (function (TableCellPropertiesMask) {
        TableCellPropertiesMask[TableCellPropertiesMask["UseNone"] = 0] = "UseNone";
        TableCellPropertiesMask[TableCellPropertiesMask["UseHideCellMark"] = 2] = "UseHideCellMark";
        TableCellPropertiesMask[TableCellPropertiesMask["UseNoWrap"] = 4] = "UseNoWrap";
        TableCellPropertiesMask[TableCellPropertiesMask["UseFitText"] = 8] = "UseFitText";
        TableCellPropertiesMask[TableCellPropertiesMask["UseLeftMargin"] = 16] = "UseLeftMargin";
        TableCellPropertiesMask[TableCellPropertiesMask["UseRightMargin"] = 32] = "UseRightMargin";
        TableCellPropertiesMask[TableCellPropertiesMask["UseTopMargin"] = 64] = "UseTopMargin";
        TableCellPropertiesMask[TableCellPropertiesMask["UseBottomMargin"] = 128] = "UseBottomMargin";
        TableCellPropertiesMask[TableCellPropertiesMask["UseTextDirection"] = 256] = "UseTextDirection";
        TableCellPropertiesMask[TableCellPropertiesMask["UseVerticalAlignment"] = 512] = "UseVerticalAlignment";
        TableCellPropertiesMask[TableCellPropertiesMask["UseCellConditionalFormatting"] = 2048] = "UseCellConditionalFormatting";
        TableCellPropertiesMask[TableCellPropertiesMask["UseLeftBorder"] = 4096] = "UseLeftBorder";
        TableCellPropertiesMask[TableCellPropertiesMask["UseRightBorder"] = 8192] = "UseRightBorder";
        TableCellPropertiesMask[TableCellPropertiesMask["UseTopBorder"] = 16384] = "UseTopBorder";
        TableCellPropertiesMask[TableCellPropertiesMask["UseBottomBorder"] = 32768] = "UseBottomBorder";
        TableCellPropertiesMask[TableCellPropertiesMask["UseTopLeftDiagonalBorder"] = 262144] = "UseTopLeftDiagonalBorder";
        TableCellPropertiesMask[TableCellPropertiesMask["UseTopRightDiagonalBorder"] = 524288] = "UseTopRightDiagonalBorder";
        TableCellPropertiesMask[TableCellPropertiesMask["UseShadingInfoIndex"] = 1048576] = "UseShadingInfoIndex";
        TableCellPropertiesMask[TableCellPropertiesMask["UseAll"] = 2147483647] = "UseAll";
    })(TableCellPropertiesMask = __aspxRichEdit.TableCellPropertiesMask || (__aspxRichEdit.TableCellPropertiesMask = {}));
    var TableCellPropertyDescriptor = (function () {
        function TableCellPropertyDescriptor() {
        }
        TableCellPropertyDescriptor.topBorder = new __aspxRichEdit.TableCellPropertiesTopBorderDescriptor();
        TableCellPropertyDescriptor.rightBorder = new __aspxRichEdit.TableCellPropertiesRightBorderDescriptor();
        TableCellPropertyDescriptor.bottomBorder = new __aspxRichEdit.TableCellPropertiesBottomBorderDescriptor();
        TableCellPropertyDescriptor.leftBorder = new __aspxRichEdit.TableCellPropertiesLeftBorderDescriptor();
        TableCellPropertyDescriptor.topLeftDiagonalBorder = new __aspxRichEdit.TableCellPropertiesTopLeftDiagonalBorderDescriptor();
        TableCellPropertyDescriptor.topRightDiagonalBorder = new __aspxRichEdit.TableCellPropertiesTopRightDiagonalBorderDescriptor();
        TableCellPropertyDescriptor.topMargin = new __aspxRichEdit.TableCellPropertiesTopMarginDescriptor();
        TableCellPropertyDescriptor.rightMargin = new __aspxRichEdit.TableCellPropertiesRightMarginDescriptor();
        TableCellPropertyDescriptor.bottomMargin = new __aspxRichEdit.TableCellPropertiesBottomMarginDescriptor();
        TableCellPropertyDescriptor.leftMargin = new __aspxRichEdit.TableCellPropertiesLeftMarginDescriptor();
        TableCellPropertyDescriptor.fitText = new __aspxRichEdit.TableCellPropertiesFitTextDescriptor();
        TableCellPropertyDescriptor.hideCellMark = new __aspxRichEdit.TableCellPropertiesHideCellMarkDescriptor();
        TableCellPropertyDescriptor.noWrap = new __aspxRichEdit.TableCellPropertiesNoWrapDescriptor();
        TableCellPropertyDescriptor.shadingInfo = new __aspxRichEdit.TableCellPropertiesShadingInfoDescriptor();
        TableCellPropertyDescriptor.textDirection = new __aspxRichEdit.TableCellPropertiesTextDirectionDescriptor();
        TableCellPropertyDescriptor.vertivalAlignment = new __aspxRichEdit.TableCellPropertiesVerticalAlignmentDescriptor();
        TableCellPropertyDescriptor.ALL_FIELDS = [
            TableCellPropertyDescriptor.topBorder,
            TableCellPropertyDescriptor.rightBorder,
            TableCellPropertyDescriptor.bottomBorder,
            TableCellPropertyDescriptor.leftBorder,
            TableCellPropertyDescriptor.topLeftDiagonalBorder,
            TableCellPropertyDescriptor.topRightDiagonalBorder,
            TableCellPropertyDescriptor.topMargin,
            TableCellPropertyDescriptor.rightMargin,
            TableCellPropertyDescriptor.bottomMargin,
            TableCellPropertyDescriptor.leftMargin,
            TableCellPropertyDescriptor.fitText,
            TableCellPropertyDescriptor.hideCellMark,
            TableCellPropertyDescriptor.noWrap,
            TableCellPropertyDescriptor.shadingInfo,
            TableCellPropertyDescriptor.textDirection,
            TableCellPropertyDescriptor.vertivalAlignment,
        ];
        return TableCellPropertyDescriptor;
    }());
    __aspxRichEdit.TableCellPropertyDescriptor = TableCellPropertyDescriptor;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableProperties = (function () {
        function TableProperties() {
            this.mask = 0;
            this.cellMargins = __aspxRichEdit.TableCellMargins.create(__aspxRichEdit.TableWidthUnit.createDefault(), __aspxRichEdit.TableWidthUnit.createDefault(), __aspxRichEdit.TableWidthUnit.createDefault(), __aspxRichEdit.TableWidthUnit.createDefault());
            this.cellSpacing = __aspxRichEdit.TableWidthUnit.createDefault();
            this.indent = __aspxRichEdit.TableWidthUnit.createDefault();
            this.borders = __aspxRichEdit.TableBorders.create(new __aspxRichEdit.BorderInfo(), new __aspxRichEdit.BorderInfo(), new __aspxRichEdit.BorderInfo(), new __aspxRichEdit.BorderInfo(), new __aspxRichEdit.BorderInfo(), new __aspxRichEdit.BorderInfo());
            this.tableStyleColumnBandSize = 1;
            this.tableStyleRowBandSize = 1;
            this.avoidDoubleBorders = false;
            this.layoutType = __aspxRichEdit.TableLayoutType.Autofit;
            this.shadingInfo = __aspxRichEdit.ShadingInfo.noColor;
            this.tableRowAlignment = __aspxRichEdit.TableRowAlignment.Left;
            this.isTableOverlap = true;
            this.bottomFromText = 0;
            this.leftFromText = 0;
            this.topFromText = 0;
            this.rightFromText = 0;
            this.tableHorizontalPosition = 0;
            this.tableVerticalPosition = 0;
            this.horizontalAlignMode = __aspxRichEdit.HorizontalAlignMode.None;
            this.verticalAlignMode = __aspxRichEdit.VerticalAlignMode.None;
            this.horizontalAnchorType = __aspxRichEdit.HorizontalAnchorTypes.Page;
            this.verticalAnchorType = __aspxRichEdit.VerticalAnchorTypes.Page;
            this.textWrapping = __aspxRichEdit.TextWrapping.Never;
        }
        TableProperties.prototype.calculateHash = function () {
            return __aspxRichEdit.MathUtils.somePrimes[0] * this.mask ^
                __aspxRichEdit.MathUtils.somePrimes[1] * this.borders.getHashCode() ^
                __aspxRichEdit.MathUtils.somePrimes[2] * this.indent.getHashCode() ^
                __aspxRichEdit.MathUtils.somePrimes[3] * this.tableRowAlignment ^
                __aspxRichEdit.MathUtils.somePrimes[4] * this.shadingInfo.getHashCode();
        };
        TableProperties.prototype.getHashCode = function () {
            return this.hash === undefined ? this.hash = this.calculateHash() : this.hash;
        };
        TableProperties.prototype.equals = function (obj) {
            if (!obj)
                return false;
            return this.mask == obj.mask &&
                this.cellMargins.equals(obj.cellMargins) &&
                this.cellSpacing.equals(obj.cellSpacing) &&
                this.indent.equals(obj.indent) &&
                this.borders.equals(obj.borders) &&
                this.tableStyleColumnBandSize == obj.tableStyleColumnBandSize &&
                this.tableStyleRowBandSize == obj.tableStyleRowBandSize &&
                this.isTableOverlap == obj.isTableOverlap &&
                this.avoidDoubleBorders == obj.avoidDoubleBorders &&
                this.layoutType == obj.layoutType &&
                this.shadingInfo.equals(obj.shadingInfo) &&
                this.tableRowAlignment == obj.tableRowAlignment &&
                this.bottomFromText == obj.bottomFromText &&
                this.leftFromText == obj.leftFromText &&
                this.topFromText == obj.topFromText &&
                this.rightFromText == obj.rightFromText &&
                this.tableHorizontalPosition == obj.tableHorizontalPosition &&
                this.tableVerticalPosition == obj.tableVerticalPosition &&
                this.horizontalAlignMode == obj.horizontalAlignMode &&
                this.verticalAlignMode == obj.verticalAlignMode &&
                this.horizontalAnchorType == obj.horizontalAnchorType &&
                this.verticalAnchorType == obj.verticalAnchorType &&
                this.textWrapping == obj.textWrapping;
        };
        TableProperties.prototype.clone = function () {
            var result = new TableProperties();
            result.copyFrom(this);
            return result;
        };
        TableProperties.prototype.copyFrom = function (obj) {
            this.mask = obj.mask;
            this.cellMargins = obj.cellMargins.clone();
            this.cellSpacing = obj.cellSpacing.clone();
            this.indent = obj.indent.clone();
            this.borders = obj.borders.clone();
            this.tableStyleColumnBandSize = obj.tableStyleColumnBandSize;
            this.tableStyleRowBandSize = obj.tableStyleRowBandSize;
            this.isTableOverlap = obj.isTableOverlap;
            this.avoidDoubleBorders = obj.avoidDoubleBorders;
            this.layoutType = obj.layoutType;
            if (obj.shadingInfo)
                this.shadingInfo = obj.shadingInfo.clone();
            this.tableRowAlignment = obj.tableRowAlignment;
            this.bottomFromText = obj.bottomFromText;
            this.leftFromText = obj.leftFromText;
            this.topFromText = obj.topFromText;
            this.rightFromText = obj.rightFromText;
            this.tableHorizontalPosition = obj.tableHorizontalPosition;
            this.tableVerticalPosition = obj.tableVerticalPosition;
            this.horizontalAlignMode = obj.horizontalAlignMode;
            this.verticalAlignMode = obj.verticalAlignMode;
            this.horizontalAnchorType = obj.horizontalAnchorType;
            this.verticalAnchorType = obj.verticalAnchorType;
            this.textWrapping = obj.textWrapping;
        };
        TableProperties.prototype.setUseValue = function (mask, value) {
            if (value)
                this.mask |= mask;
            else
                this.mask &= ~mask;
        };
        TableProperties.prototype.getUseValue = function (mask) {
            return (this.mask & mask) != 0;
        };
        TableProperties.prototype.setValue = function (desc, value) {
            desc.setProp(this, value);
            this.setUseValue(desc.maskValue(), true);
        };
        return TableProperties;
    }());
    __aspxRichEdit.TableProperties = TableProperties;
    var TablePropertiesMask;
    (function (TablePropertiesMask) {
        TablePropertiesMask[TablePropertiesMask["UseNone"] = 0] = "UseNone";
        TablePropertiesMask[TablePropertiesMask["UseLeftMargin"] = 1] = "UseLeftMargin";
        TablePropertiesMask[TablePropertiesMask["UseRightMargin"] = 2] = "UseRightMargin";
        TablePropertiesMask[TablePropertiesMask["UseTopMargin"] = 4] = "UseTopMargin";
        TablePropertiesMask[TablePropertiesMask["UseBottomMargin"] = 8] = "UseBottomMargin";
        TablePropertiesMask[TablePropertiesMask["UseCellSpacing"] = 16] = "UseCellSpacing";
        TablePropertiesMask[TablePropertiesMask["UseTableIndent"] = 32] = "UseTableIndent";
        TablePropertiesMask[TablePropertiesMask["UseTableLayout"] = 64] = "UseTableLayout";
        TablePropertiesMask[TablePropertiesMask["UseTableStyleColBandSize"] = 512] = "UseTableStyleColBandSize";
        TablePropertiesMask[TablePropertiesMask["UseTableStyleRowBandSize"] = 1024] = "UseTableStyleRowBandSize";
        TablePropertiesMask[TablePropertiesMask["UseIsTableOverlap"] = 2048] = "UseIsTableOverlap";
        TablePropertiesMask[TablePropertiesMask["UseFloatingPosition"] = 4096] = "UseFloatingPosition";
        TablePropertiesMask[TablePropertiesMask["UseLeftBorder"] = 8192] = "UseLeftBorder";
        TablePropertiesMask[TablePropertiesMask["UseRightBorder"] = 16384] = "UseRightBorder";
        TablePropertiesMask[TablePropertiesMask["UseTopBorder"] = 32768] = "UseTopBorder";
        TablePropertiesMask[TablePropertiesMask["UseBottomBorder"] = 65536] = "UseBottomBorder";
        TablePropertiesMask[TablePropertiesMask["UseInsideHorizontalBorder"] = 131072] = "UseInsideHorizontalBorder";
        TablePropertiesMask[TablePropertiesMask["UseInsideVerticalBorder"] = 262144] = "UseInsideVerticalBorder";
        TablePropertiesMask[TablePropertiesMask["UseShadingInfoIndex"] = 524288] = "UseShadingInfoIndex";
        TablePropertiesMask[TablePropertiesMask["UseTableAlignment"] = 1048576] = "UseTableAlignment";
        TablePropertiesMask[TablePropertiesMask["UseAvoidDoubleBorders"] = 2097152] = "UseAvoidDoubleBorders";
        TablePropertiesMask[TablePropertiesMask["UseRightToLeft"] = 4194304] = "UseRightToLeft";
        TablePropertiesMask[TablePropertiesMask["UseAll"] = 2147483647] = "UseAll";
    })(TablePropertiesMask = __aspxRichEdit.TablePropertiesMask || (__aspxRichEdit.TablePropertiesMask = {}));
    var TablePropertyDescriptor = (function () {
        function TablePropertyDescriptor() {
        }
        TablePropertyDescriptor.avoidDoubleBorders = new __aspxRichEdit.TablePropertiesAvoidDoubleBordersDescriptor();
        TablePropertyDescriptor.topBorder = new __aspxRichEdit.TablePropertiesTopBorderDescriptor();
        TablePropertyDescriptor.rightBorder = new __aspxRichEdit.TablePropertiesRightBorderDescriptor();
        TablePropertyDescriptor.bottomBorder = new __aspxRichEdit.TablePropertiesBottomBorderDescriptor();
        TablePropertyDescriptor.leftBorder = new __aspxRichEdit.TablePropertiesLeftBorderDescriptor();
        TablePropertyDescriptor.insideHorizontalBorder = new __aspxRichEdit.TablePropertiesInsideHorizontalBorderDescriptor();
        TablePropertyDescriptor.insideVerticalBorder = new __aspxRichEdit.TablePropertiesInsideVerticalBorderDescriptor();
        TablePropertyDescriptor.topMargin = new __aspxRichEdit.TablePropertiesTopMarginDescriptor();
        TablePropertyDescriptor.rightMargin = new __aspxRichEdit.TablePropertiesRightMarginDescriptor();
        TablePropertyDescriptor.bottomMargin = new __aspxRichEdit.TablePropertiesBottomMarginDescriptor();
        TablePropertyDescriptor.leftMargin = new __aspxRichEdit.TablePropertiesLeftMarginDescriptor();
        TablePropertyDescriptor.cellSpacing = new __aspxRichEdit.TablePropertiesCellSpacingDescriptor();
        TablePropertyDescriptor.indent = new __aspxRichEdit.TablePropertiesIndentDescriptor();
        TablePropertyDescriptor.layoutType = new __aspxRichEdit.TablePropertiesLayoutTypeDescriptor();
        TablePropertyDescriptor.shadingInfo = new __aspxRichEdit.TablePropertiesShadingInfoDescriptor();
        TablePropertyDescriptor.rowAlignment = new __aspxRichEdit.TablePropertiesRowAlignmentDescriptor();
        TablePropertyDescriptor.styleColumnBandSize = new __aspxRichEdit.TablePropertiesStyleColumnBandSizeDescriptor();
        TablePropertyDescriptor.styleRowBandSize = new __aspxRichEdit.TablePropertiesStyleRowBandSizeDescriptor();
        TablePropertyDescriptor.ALL_FIELDS = [
            TablePropertyDescriptor.avoidDoubleBorders,
            TablePropertyDescriptor.topBorder,
            TablePropertyDescriptor.rightBorder,
            TablePropertyDescriptor.bottomBorder,
            TablePropertyDescriptor.leftBorder,
            TablePropertyDescriptor.insideHorizontalBorder,
            TablePropertyDescriptor.insideVerticalBorder,
            TablePropertyDescriptor.topMargin,
            TablePropertyDescriptor.rightMargin,
            TablePropertyDescriptor.bottomMargin,
            TablePropertyDescriptor.leftMargin,
            TablePropertyDescriptor.cellSpacing,
            TablePropertyDescriptor.indent,
            TablePropertyDescriptor.layoutType,
            TablePropertyDescriptor.shadingInfo,
            TablePropertyDescriptor.rowAlignment,
            TablePropertyDescriptor.styleColumnBandSize,
            TablePropertyDescriptor.styleRowBandSize,
        ];
        return TablePropertyDescriptor;
    }());
    __aspxRichEdit.TablePropertyDescriptor = TablePropertyDescriptor;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableRowProperties = (function () {
        function TableRowProperties() {
            this.mask = 0;
            this.cellSpacing = __aspxRichEdit.TableWidthUnit.createDefault();
            this.cantSplit = false;
            this.hideCellMark = false;
            this.header = false;
            this.tableRowAlignment = __aspxRichEdit.TableRowAlignment.Left;
            this.divId = 0;
        }
        TableRowProperties.prototype.calculateHash = function () {
            return __aspxRichEdit.MathUtils.somePrimes[0] * this.mask ^
                __aspxRichEdit.MathUtils.somePrimes[1] * this.cellSpacing.getHashCode();
        };
        TableRowProperties.prototype.getHashCode = function () {
            return this.hash === undefined ? this.hash = this.calculateHash() : this.hash;
        };
        TableRowProperties.prototype.equals = function (obj) {
            if (!obj)
                return false;
            return this.mask == obj.mask &&
                this.cellSpacing.equals(obj.cellSpacing) &&
                this.cantSplit == obj.cantSplit &&
                this.hideCellMark == obj.hideCellMark &&
                this.header == obj.header &&
                this.tableRowAlignment == obj.tableRowAlignment &&
                this.divId == obj.divId;
        };
        TableRowProperties.prototype.clone = function () {
            var result = new TableRowProperties();
            result.copyFrom(this);
            return result;
        };
        TableRowProperties.prototype.copyFrom = function (obj) {
            this.mask = obj.mask;
            this.cellSpacing = obj.cellSpacing.clone();
            this.cantSplit = obj.cantSplit;
            this.hideCellMark = obj.hideCellMark;
            this.header = obj.header;
            this.tableRowAlignment = obj.tableRowAlignment;
            this.divId = obj.divId;
        };
        TableRowProperties.prototype.setUseValue = function (mask, value) {
            if (value)
                this.mask |= mask;
            else
                this.mask &= ~mask;
        };
        TableRowProperties.prototype.getUseValue = function (mask) {
            return (this.mask & mask) != 0;
        };
        TableRowProperties.prototype.setValue = function (desc, value) {
            desc.setProp(this, value);
            this.setUseValue(desc.maskValue(), true);
        };
        return TableRowProperties;
    }());
    __aspxRichEdit.TableRowProperties = TableRowProperties;
    var TableRowPropertiesMask;
    (function (TableRowPropertiesMask) {
        TableRowPropertiesMask[TableRowPropertiesMask["UseNone"] = 0] = "UseNone";
        TableRowPropertiesMask[TableRowPropertiesMask["UseCantSplit"] = 2] = "UseCantSplit";
        TableRowPropertiesMask[TableRowPropertiesMask["UseHideCellMark"] = 4] = "UseHideCellMark";
        TableRowPropertiesMask[TableRowPropertiesMask["UseCellSpacing"] = 128] = "UseCellSpacing";
        TableRowPropertiesMask[TableRowPropertiesMask["UseTableRowAlignment"] = 256] = "UseTableRowAlignment";
        TableRowPropertiesMask[TableRowPropertiesMask["UseShadingInfoIndex"] = 2048] = "UseShadingInfoIndex";
        TableRowPropertiesMask[TableRowPropertiesMask["UseHeader"] = 1024] = "UseHeader";
        TableRowPropertiesMask[TableRowPropertiesMask["UseDivId"] = 4096] = "UseDivId";
        TableRowPropertiesMask[TableRowPropertiesMask["UseAll"] = 2147483647] = "UseAll";
    })(TableRowPropertiesMask = __aspxRichEdit.TableRowPropertiesMask || (__aspxRichEdit.TableRowPropertiesMask = {}));
    var TableRowPropertyDescriptor = (function () {
        function TableRowPropertyDescriptor() {
        }
        TableRowPropertyDescriptor.cantSplit = new __aspxRichEdit.TableRowPropertiesCantSplitDescriptor();
        TableRowPropertyDescriptor.cellSpacing = new __aspxRichEdit.TableRowPropertiesCellSpacingDescriptor();
        TableRowPropertyDescriptor.divId = new __aspxRichEdit.TableRowPropertiesDivIdDescriptor();
        TableRowPropertyDescriptor.header = new __aspxRichEdit.TableRowPropertiesHeaderDescriptor();
        TableRowPropertyDescriptor.hideCellMark = new __aspxRichEdit.TableRowPropertiesHideCellMarkDescriptor();
        TableRowPropertyDescriptor.rowAlignment = new __aspxRichEdit.TableRowPropertiesRowAlignmentDescriptor();
        TableRowPropertyDescriptor.ALL_FIELDS = [
            TableRowPropertyDescriptor.cantSplit,
            TableRowPropertyDescriptor.cellSpacing,
            TableRowPropertyDescriptor.divId,
            TableRowPropertyDescriptor.header,
            TableRowPropertyDescriptor.hideCellMark,
            TableRowPropertyDescriptor.rowAlignment,
        ];
        return TableRowPropertyDescriptor;
    }());
    __aspxRichEdit.TableRowPropertyDescriptor = TableRowPropertyDescriptor;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableCellPropertiesMerger = (function (_super) {
        __extends(TableCellPropertiesMerger, _super);
        function TableCellPropertiesMerger() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellPropertiesMerger.prototype.getContainerFromConditionalStyle = function (condStyle) {
            return condStyle.tableCellProperties;
        };
        TableCellPropertiesMerger.prototype.canUseValue = function (props) {
            return !!(props.mask & this.getPropertyMask());
        };
        TableCellPropertiesMerger.prototype.getCondTableStyleFormattingListForThisContainer = function () {
            return TableCellPropertiesMerger.conditionalTableStyleFormattingPriority;
        };
        TableCellPropertiesMerger.prototype.getNotMergedProperty = function () {
            return new __aspxRichEdit.TableMergerNotMergedPropertyResult(false, null);
        };
        TableCellPropertiesMerger.conditionalTableStyleFormattingPriority = [
            __aspxRichEdit.ConditionalTableStyleFormatting.TopLeftCell,
            __aspxRichEdit.ConditionalTableStyleFormatting.TopRightCell,
            __aspxRichEdit.ConditionalTableStyleFormatting.BottomLeftCell,
            __aspxRichEdit.ConditionalTableStyleFormatting.BottomRightCell,
            __aspxRichEdit.ConditionalTableStyleFormatting.FirstRow,
            __aspxRichEdit.ConditionalTableStyleFormatting.LastRow,
            __aspxRichEdit.ConditionalTableStyleFormatting.FirstColumn,
            __aspxRichEdit.ConditionalTableStyleFormatting.LastColumn,
            __aspxRichEdit.ConditionalTableStyleFormatting.EvenColumnBanding,
            __aspxRichEdit.ConditionalTableStyleFormatting.OddColumnBanding,
            __aspxRichEdit.ConditionalTableStyleFormatting.EvenRowBanding,
            __aspxRichEdit.ConditionalTableStyleFormatting.OddRowBanding,
            __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable,
        ];
        return TableCellPropertiesMerger;
    }(__aspxRichEdit.TablePropertiesMergerBase));
    __aspxRichEdit.TableCellPropertiesMerger = TableCellPropertiesMerger;
    var TableCellPropertiesMergerMarginBase = (function (_super) {
        __extends(TableCellPropertiesMergerMarginBase, _super);
        function TableCellPropertiesMergerMarginBase(table, model, tablePropertiesException) {
            var _this = _super.call(this) || this;
            _this.table = table;
            _this.model = model;
            _this.tablePropertiesException = tablePropertiesException;
            return _this;
        }
        TableCellPropertiesMergerMarginBase.prototype.actionBeforeDefaultValue = function () {
            this.result = this.getMarginMerger().getProperty(this.table.properties, this.table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, this.model.defaultTableProperties);
            return true;
        };
        TableCellPropertiesMergerMarginBase.prototype.getNotMergedProperty = function () {
            return this.getMarginMerger().getTableNotMergedProperty(this.tablePropertiesException);
        };
        return TableCellPropertiesMergerMarginBase;
    }(TableCellPropertiesMerger));
    __aspxRichEdit.TableCellPropertiesMergerMarginBase = TableCellPropertiesMergerMarginBase;
    var TableCellPropertiesMergerMarginLeft = (function (_super) {
        __extends(TableCellPropertiesMergerMarginLeft, _super);
        function TableCellPropertiesMergerMarginLeft() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellPropertiesMergerMarginLeft.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseLeftMargin;
        };
        TableCellPropertiesMergerMarginLeft.prototype.getPropertyFromContainer = function (container) {
            return container.cellMargins.left;
        };
        TableCellPropertiesMergerMarginLeft.prototype.getMarginMerger = function () {
            return new __aspxRichEdit.TablePropertiesMergerMarginLeft();
        };
        return TableCellPropertiesMergerMarginLeft;
    }(TableCellPropertiesMergerMarginBase));
    __aspxRichEdit.TableCellPropertiesMergerMarginLeft = TableCellPropertiesMergerMarginLeft;
    var TableCellPropertiesMergerMarginRight = (function (_super) {
        __extends(TableCellPropertiesMergerMarginRight, _super);
        function TableCellPropertiesMergerMarginRight() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellPropertiesMergerMarginRight.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseRightMargin;
        };
        TableCellPropertiesMergerMarginRight.prototype.getPropertyFromContainer = function (container) {
            return container.cellMargins.right;
        };
        TableCellPropertiesMergerMarginRight.prototype.getMarginMerger = function () {
            return new __aspxRichEdit.TablePropertiesMergerMarginRight();
        };
        return TableCellPropertiesMergerMarginRight;
    }(TableCellPropertiesMergerMarginBase));
    __aspxRichEdit.TableCellPropertiesMergerMarginRight = TableCellPropertiesMergerMarginRight;
    var TableCellPropertiesMergerMarginTop = (function (_super) {
        __extends(TableCellPropertiesMergerMarginTop, _super);
        function TableCellPropertiesMergerMarginTop() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellPropertiesMergerMarginTop.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseTopMargin;
        };
        TableCellPropertiesMergerMarginTop.prototype.getPropertyFromContainer = function (container) {
            return container.cellMargins.top;
        };
        TableCellPropertiesMergerMarginTop.prototype.getMarginMerger = function () {
            return new __aspxRichEdit.TablePropertiesMergerMarginTop();
        };
        return TableCellPropertiesMergerMarginTop;
    }(TableCellPropertiesMergerMarginBase));
    __aspxRichEdit.TableCellPropertiesMergerMarginTop = TableCellPropertiesMergerMarginTop;
    var TableCellPropertiesMergerMarginBottom = (function (_super) {
        __extends(TableCellPropertiesMergerMarginBottom, _super);
        function TableCellPropertiesMergerMarginBottom() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellPropertiesMergerMarginBottom.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseBottomMargin;
        };
        TableCellPropertiesMergerMarginBottom.prototype.getPropertyFromContainer = function (container) {
            return container.cellMargins.bottom;
        };
        TableCellPropertiesMergerMarginBottom.prototype.getMarginMerger = function () {
            return new __aspxRichEdit.TablePropertiesMergerMarginBottom();
        };
        return TableCellPropertiesMergerMarginBottom;
    }(TableCellPropertiesMergerMarginBase));
    __aspxRichEdit.TableCellPropertiesMergerMarginBottom = TableCellPropertiesMergerMarginBottom;
    var TableCellPropertiesMergerBorderBase = (function (_super) {
        __extends(TableCellPropertiesMergerBorderBase, _super);
        function TableCellPropertiesMergerBorderBase(tablePropertiesException) {
            var _this = _super.call(this) || this;
            _this.tablePropertiesException = tablePropertiesException;
            return _this;
        }
        TableCellPropertiesMergerBorderBase.prototype.actionBeforeDefaultValue = function () {
            this.result = null;
            return true;
        };
        return TableCellPropertiesMergerBorderBase;
    }(TableCellPropertiesMerger));
    __aspxRichEdit.TableCellPropertiesMergerBorderBase = TableCellPropertiesMergerBorderBase;
    var TableCellPropertiesMergerBorderLeft = (function (_super) {
        __extends(TableCellPropertiesMergerBorderLeft, _super);
        function TableCellPropertiesMergerBorderLeft(tablePropertiesException, isOutsideBorder) {
            var _this = _super.call(this, tablePropertiesException) || this;
            _this.isOutsideBorder = isOutsideBorder;
            return _this;
        }
        TableCellPropertiesMergerBorderLeft.prototype.getPropertyFromContainer = function (container) {
            return container.borders.leftBorder;
        };
        TableCellPropertiesMergerBorderLeft.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseLeftBorder;
        };
        TableCellPropertiesMergerBorderLeft.prototype.getNotMergedProperty = function () {
            return new (this.isOutsideBorder ? __aspxRichEdit.TablePropertiesMergerBorderLeft : __aspxRichEdit.TablePropertiesMergerBorderVertical)()
                .getTableNotMergedProperty(this.tablePropertiesException);
        };
        return TableCellPropertiesMergerBorderLeft;
    }(TableCellPropertiesMergerBorderBase));
    __aspxRichEdit.TableCellPropertiesMergerBorderLeft = TableCellPropertiesMergerBorderLeft;
    var TableCellPropertiesMergerBorderRight = (function (_super) {
        __extends(TableCellPropertiesMergerBorderRight, _super);
        function TableCellPropertiesMergerBorderRight(tablePropertiesException, isOutsideBorder) {
            var _this = _super.call(this, tablePropertiesException) || this;
            _this.isOutsideBorder = isOutsideBorder;
            return _this;
        }
        TableCellPropertiesMergerBorderRight.prototype.getPropertyFromContainer = function (container) {
            return container.borders.rightBorder;
        };
        TableCellPropertiesMergerBorderRight.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseRightBorder;
        };
        TableCellPropertiesMergerBorderRight.prototype.getNotMergedProperty = function () {
            return new (this.isOutsideBorder ? __aspxRichEdit.TablePropertiesMergerBorderRight : __aspxRichEdit.TablePropertiesMergerBorderVertical)()
                .getTableNotMergedProperty(this.tablePropertiesException);
        };
        return TableCellPropertiesMergerBorderRight;
    }(TableCellPropertiesMergerBorderBase));
    __aspxRichEdit.TableCellPropertiesMergerBorderRight = TableCellPropertiesMergerBorderRight;
    var TableCellPropertiesMergerBorderTop = (function (_super) {
        __extends(TableCellPropertiesMergerBorderTop, _super);
        function TableCellPropertiesMergerBorderTop(tablePropertiesException, isOutsideBorder) {
            var _this = _super.call(this, tablePropertiesException) || this;
            _this.isOutsideBorder = isOutsideBorder;
            return _this;
        }
        TableCellPropertiesMergerBorderTop.prototype.getPropertyFromContainer = function (container) {
            return container.borders.topBorder;
        };
        TableCellPropertiesMergerBorderTop.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseTopBorder;
        };
        TableCellPropertiesMergerBorderTop.prototype.getNotMergedProperty = function () {
            return new (this.isOutsideBorder ? __aspxRichEdit.TablePropertiesMergerBorderTop : __aspxRichEdit.TablePropertiesMergerBorderHorizontal)()
                .getTableNotMergedProperty(this.tablePropertiesException);
        };
        return TableCellPropertiesMergerBorderTop;
    }(TableCellPropertiesMergerBorderBase));
    __aspxRichEdit.TableCellPropertiesMergerBorderTop = TableCellPropertiesMergerBorderTop;
    var TableCellPropertiesMergerBorderBottom = (function (_super) {
        __extends(TableCellPropertiesMergerBorderBottom, _super);
        function TableCellPropertiesMergerBorderBottom(tablePropertiesException, isOutsideBorder) {
            var _this = _super.call(this, tablePropertiesException) || this;
            _this.isOutsideBorder = isOutsideBorder;
            return _this;
        }
        TableCellPropertiesMergerBorderBottom.prototype.getPropertyFromContainer = function (container) {
            return container.borders.bottomBorder;
        };
        TableCellPropertiesMergerBorderBottom.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseBottomBorder;
        };
        TableCellPropertiesMergerBorderBottom.prototype.getNotMergedProperty = function () {
            return new (this.isOutsideBorder ? __aspxRichEdit.TablePropertiesMergerBorderBottom : __aspxRichEdit.TablePropertiesMergerBorderHorizontal)()
                .getTableNotMergedProperty(this.tablePropertiesException);
        };
        return TableCellPropertiesMergerBorderBottom;
    }(TableCellPropertiesMergerBorderBase));
    __aspxRichEdit.TableCellPropertiesMergerBorderBottom = TableCellPropertiesMergerBorderBottom;
    var TableCellPropertiesMergerBorderTopLeftDiagonal = (function (_super) {
        __extends(TableCellPropertiesMergerBorderTopLeftDiagonal, _super);
        function TableCellPropertiesMergerBorderTopLeftDiagonal() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellPropertiesMergerBorderTopLeftDiagonal.prototype.getPropertyFromContainer = function (container) {
            return container.borders.topLeftDiagonalBorder;
        };
        TableCellPropertiesMergerBorderTopLeftDiagonal.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseTopLeftDiagonalBorder;
        };
        return TableCellPropertiesMergerBorderTopLeftDiagonal;
    }(TableCellPropertiesMergerBorderBase));
    __aspxRichEdit.TableCellPropertiesMergerBorderTopLeftDiagonal = TableCellPropertiesMergerBorderTopLeftDiagonal;
    var TableCellPropertiesMergerBorderTopRightDiagonal = (function (_super) {
        __extends(TableCellPropertiesMergerBorderTopRightDiagonal, _super);
        function TableCellPropertiesMergerBorderTopRightDiagonal() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellPropertiesMergerBorderTopRightDiagonal.prototype.getPropertyFromContainer = function (container) {
            return container.borders.topRightDiagonalBorder;
        };
        TableCellPropertiesMergerBorderTopRightDiagonal.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseTopRightDiagonalBorder;
        };
        return TableCellPropertiesMergerBorderTopRightDiagonal;
    }(TableCellPropertiesMergerBorderBase));
    __aspxRichEdit.TableCellPropertiesMergerBorderTopRightDiagonal = TableCellPropertiesMergerBorderTopRightDiagonal;
    var TableCellPropertiesMergerNoWrap = (function (_super) {
        __extends(TableCellPropertiesMergerNoWrap, _super);
        function TableCellPropertiesMergerNoWrap() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellPropertiesMergerNoWrap.prototype.getPropertyFromContainer = function (container) {
            return container.noWrap;
        };
        TableCellPropertiesMergerNoWrap.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseNoWrap;
        };
        return TableCellPropertiesMergerNoWrap;
    }(TableCellPropertiesMerger));
    __aspxRichEdit.TableCellPropertiesMergerNoWrap = TableCellPropertiesMergerNoWrap;
    var TableCellPropertiesMergerShadingInfo = (function (_super) {
        __extends(TableCellPropertiesMergerShadingInfo, _super);
        function TableCellPropertiesMergerShadingInfo() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellPropertiesMergerShadingInfo.prototype.getPropertyFromContainer = function (container) {
            return container.shadingInfo;
        };
        TableCellPropertiesMergerShadingInfo.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseShadingInfoIndex;
        };
        return TableCellPropertiesMergerShadingInfo;
    }(TableCellPropertiesMerger));
    __aspxRichEdit.TableCellPropertiesMergerShadingInfo = TableCellPropertiesMergerShadingInfo;
    var TableCellVerticalAlignmentMerger = (function (_super) {
        __extends(TableCellVerticalAlignmentMerger, _super);
        function TableCellVerticalAlignmentMerger() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableCellVerticalAlignmentMerger.prototype.getPropertyFromContainer = function (container) {
            return container.verticalAlignment;
        };
        TableCellVerticalAlignmentMerger.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TableCellPropertiesMask.UseVerticalAlignment;
        };
        return TableCellVerticalAlignmentMerger;
    }(TableCellPropertiesMerger));
    __aspxRichEdit.TableCellVerticalAlignmentMerger = TableCellVerticalAlignmentMerger;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TablePropertiesMerger = (function (_super) {
        __extends(TablePropertiesMerger, _super);
        function TablePropertiesMerger() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TablePropertiesMerger.prototype.getContainerFromConditionalStyle = function (condStyle) {
            return condStyle.tableProperties;
        };
        TablePropertiesMerger.prototype.canUseValue = function (props) {
            return !!(props.mask & this.getPropertyMask());
        };
        TablePropertiesMerger.prototype.getCondTableStyleFormattingListForThisContainer = function () {
            return TablePropertiesMerger.conditionalTableStyleFormattingPriority;
        };
        TablePropertiesMerger.prototype.getTableNotMergedProperty = function (container) {
            if (!this.canUseValue(container))
                return new __aspxRichEdit.TableMergerNotMergedPropertyResult(false, null);
            return new __aspxRichEdit.TableMergerNotMergedPropertyResult(true, this.getPropertyFromContainer(container));
        };
        TablePropertiesMerger.prototype.getNotMergedProperty = function () {
            return this.getTableNotMergedProperty(this.tablePropertiesException);
        };
        TablePropertiesMerger.conditionalTableStyleFormattingPriority = [
            __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable,
        ];
        return TablePropertiesMerger;
    }(__aspxRichEdit.TablePropertiesMergerBase));
    __aspxRichEdit.TablePropertiesMerger = TablePropertiesMerger;
    var TablePropertiesMergerIndent = (function (_super) {
        __extends(TablePropertiesMergerIndent, _super);
        function TablePropertiesMergerIndent() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TablePropertiesMergerIndent.prototype.getPropertyFromContainer = function (container) {
            return container.indent;
        };
        TablePropertiesMergerIndent.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TablePropertiesMask.UseTableIndent;
        };
        return TablePropertiesMergerIndent;
    }(TablePropertiesMerger));
    __aspxRichEdit.TablePropertiesMergerIndent = TablePropertiesMergerIndent;
    var TablePropertiesMergerCellSpacing = (function (_super) {
        __extends(TablePropertiesMergerCellSpacing, _super);
        function TablePropertiesMergerCellSpacing() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TablePropertiesMergerCellSpacing.prototype.getPropertyFromContainer = function (container) {
            return container.cellSpacing;
        };
        TablePropertiesMergerCellSpacing.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TablePropertiesMask.UseCellSpacing;
        };
        return TablePropertiesMergerCellSpacing;
    }(TablePropertiesMerger));
    __aspxRichEdit.TablePropertiesMergerCellSpacing = TablePropertiesMergerCellSpacing;
    var TablePropertiesMergerBorderLeft = (function (_super) {
        __extends(TablePropertiesMergerBorderLeft, _super);
        function TablePropertiesMergerBorderLeft() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TablePropertiesMergerBorderLeft.prototype.getPropertyFromContainer = function (container) {
            return container.borders.leftBorder;
        };
        TablePropertiesMergerBorderLeft.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TablePropertiesMask.UseLeftBorder;
        };
        return TablePropertiesMergerBorderLeft;
    }(TablePropertiesMerger));
    __aspxRichEdit.TablePropertiesMergerBorderLeft = TablePropertiesMergerBorderLeft;
    var TablePropertiesMergerBorderRight = (function (_super) {
        __extends(TablePropertiesMergerBorderRight, _super);
        function TablePropertiesMergerBorderRight() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TablePropertiesMergerBorderRight.prototype.getPropertyFromContainer = function (container) {
            return container.borders.rightBorder;
        };
        TablePropertiesMergerBorderRight.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TablePropertiesMask.UseRightBorder;
        };
        return TablePropertiesMergerBorderRight;
    }(TablePropertiesMerger));
    __aspxRichEdit.TablePropertiesMergerBorderRight = TablePropertiesMergerBorderRight;
    var TablePropertiesMergerBorderTop = (function (_super) {
        __extends(TablePropertiesMergerBorderTop, _super);
        function TablePropertiesMergerBorderTop() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TablePropertiesMergerBorderTop.prototype.getPropertyFromContainer = function (container) {
            return container.borders.topBorder;
        };
        TablePropertiesMergerBorderTop.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TablePropertiesMask.UseTopBorder;
        };
        return TablePropertiesMergerBorderTop;
    }(TablePropertiesMerger));
    __aspxRichEdit.TablePropertiesMergerBorderTop = TablePropertiesMergerBorderTop;
    var TablePropertiesMergerBorderBottom = (function (_super) {
        __extends(TablePropertiesMergerBorderBottom, _super);
        function TablePropertiesMergerBorderBottom() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TablePropertiesMergerBorderBottom.prototype.getPropertyFromContainer = function (container) {
            return container.borders.bottomBorder;
        };
        TablePropertiesMergerBorderBottom.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TablePropertiesMask.UseBottomBorder;
        };
        return TablePropertiesMergerBorderBottom;
    }(TablePropertiesMerger));
    __aspxRichEdit.TablePropertiesMergerBorderBottom = TablePropertiesMergerBorderBottom;
    var TablePropertiesMergerBorderVertical = (function (_super) {
        __extends(TablePropertiesMergerBorderVertical, _super);
        function TablePropertiesMergerBorderVertical() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TablePropertiesMergerBorderVertical.prototype.getPropertyFromContainer = function (container) {
            return container.borders.insideVerticalBorder;
        };
        TablePropertiesMergerBorderVertical.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TablePropertiesMask.UseInsideVerticalBorder;
        };
        return TablePropertiesMergerBorderVertical;
    }(TablePropertiesMerger));
    __aspxRichEdit.TablePropertiesMergerBorderVertical = TablePropertiesMergerBorderVertical;
    var TablePropertiesMergerBorderHorizontal = (function (_super) {
        __extends(TablePropertiesMergerBorderHorizontal, _super);
        function TablePropertiesMergerBorderHorizontal() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TablePropertiesMergerBorderHorizontal.prototype.getPropertyFromContainer = function (container) {
            return container.borders.insideHorizontalBorder;
        };
        TablePropertiesMergerBorderHorizontal.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TablePropertiesMask.UseInsideHorizontalBorder;
        };
        return TablePropertiesMergerBorderHorizontal;
    }(TablePropertiesMerger));
    __aspxRichEdit.TablePropertiesMergerBorderHorizontal = TablePropertiesMergerBorderHorizontal;
    var TablePropertiesMergerMarginLeft = (function (_super) {
        __extends(TablePropertiesMergerMarginLeft, _super);
        function TablePropertiesMergerMarginLeft() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TablePropertiesMergerMarginLeft.prototype.getPropertyFromContainer = function (container) {
            return container.cellMargins.left;
        };
        TablePropertiesMergerMarginLeft.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TablePropertiesMask.UseLeftMargin;
        };
        return TablePropertiesMergerMarginLeft;
    }(TablePropertiesMerger));
    __aspxRichEdit.TablePropertiesMergerMarginLeft = TablePropertiesMergerMarginLeft;
    var TablePropertiesMergerMarginRight = (function (_super) {
        __extends(TablePropertiesMergerMarginRight, _super);
        function TablePropertiesMergerMarginRight() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TablePropertiesMergerMarginRight.prototype.getPropertyFromContainer = function (container) {
            return container.cellMargins.right;
        };
        TablePropertiesMergerMarginRight.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TablePropertiesMask.UseRightMargin;
        };
        return TablePropertiesMergerMarginRight;
    }(TablePropertiesMerger));
    __aspxRichEdit.TablePropertiesMergerMarginRight = TablePropertiesMergerMarginRight;
    var TablePropertiesMergerMarginTop = (function (_super) {
        __extends(TablePropertiesMergerMarginTop, _super);
        function TablePropertiesMergerMarginTop() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TablePropertiesMergerMarginTop.prototype.getPropertyFromContainer = function (container) {
            return container.cellMargins.top;
        };
        TablePropertiesMergerMarginTop.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TablePropertiesMask.UseTopMargin;
        };
        return TablePropertiesMergerMarginTop;
    }(TablePropertiesMerger));
    __aspxRichEdit.TablePropertiesMergerMarginTop = TablePropertiesMergerMarginTop;
    var TablePropertiesMergerMarginBottom = (function (_super) {
        __extends(TablePropertiesMergerMarginBottom, _super);
        function TablePropertiesMergerMarginBottom() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TablePropertiesMergerMarginBottom.prototype.getPropertyFromContainer = function (container) {
            return container.cellMargins.bottom;
        };
        TablePropertiesMergerMarginBottom.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TablePropertiesMask.UseBottomMargin;
        };
        return TablePropertiesMergerMarginBottom;
    }(TablePropertiesMerger));
    __aspxRichEdit.TablePropertiesMergerMarginBottom = TablePropertiesMergerMarginBottom;
    var TablePropertiesMergerLayoutType = (function () {
        function TablePropertiesMergerLayoutType() {
        }
        TablePropertiesMergerLayoutType.prototype.getProperty = function (container) {
            return container.getUseValue(__aspxRichEdit.TablePropertiesMask.UseTableLayout) ? container.layoutType : __aspxRichEdit.TableLayoutType.Autofit;
        };
        return TablePropertiesMergerLayoutType;
    }());
    __aspxRichEdit.TablePropertiesMergerLayoutType = TablePropertiesMergerLayoutType;
    var TablePropertiesMergerShadingInfo = (function (_super) {
        __extends(TablePropertiesMergerShadingInfo, _super);
        function TablePropertiesMergerShadingInfo() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TablePropertiesMergerShadingInfo.prototype.getPropertyFromContainer = function (container) {
            return container.shadingInfo;
        };
        TablePropertiesMergerShadingInfo.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TablePropertiesMask.UseShadingInfoIndex;
        };
        return TablePropertiesMergerShadingInfo;
    }(TablePropertiesMerger));
    __aspxRichEdit.TablePropertiesMergerShadingInfo = TablePropertiesMergerShadingInfo;
    var TablePropertiesMergerStyleColumnBandSize = (function (_super) {
        __extends(TablePropertiesMergerStyleColumnBandSize, _super);
        function TablePropertiesMergerStyleColumnBandSize() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TablePropertiesMergerStyleColumnBandSize.prototype.getPropertyFromContainer = function (container) {
            return container.tableStyleColumnBandSize;
        };
        TablePropertiesMergerStyleColumnBandSize.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TablePropertiesMask.UseTableStyleColBandSize;
        };
        return TablePropertiesMergerStyleColumnBandSize;
    }(TablePropertiesMerger));
    __aspxRichEdit.TablePropertiesMergerStyleColumnBandSize = TablePropertiesMergerStyleColumnBandSize;
    var TablePropertiesMergerStyleRowBandSize = (function (_super) {
        __extends(TablePropertiesMergerStyleRowBandSize, _super);
        function TablePropertiesMergerStyleRowBandSize() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TablePropertiesMergerStyleRowBandSize.prototype.getPropertyFromContainer = function (container) {
            return container.tableStyleRowBandSize;
        };
        TablePropertiesMergerStyleRowBandSize.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TablePropertiesMask.UseTableStyleRowBandSize;
        };
        return TablePropertiesMergerStyleRowBandSize;
    }(TablePropertiesMerger));
    __aspxRichEdit.TablePropertiesMergerStyleRowBandSize = TablePropertiesMergerStyleRowBandSize;
    var TablePropertiesMergerHorizontalAlignment = (function (_super) {
        __extends(TablePropertiesMergerHorizontalAlignment, _super);
        function TablePropertiesMergerHorizontalAlignment() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TablePropertiesMergerHorizontalAlignment.prototype.getPropertyFromContainer = function (container) {
            return container.tableRowAlignment;
        };
        TablePropertiesMergerHorizontalAlignment.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TablePropertiesMask.UseTableAlignment;
        };
        TablePropertiesMergerHorizontalAlignment.prototype.actionBeforeDefaultValue = function () {
            this.result = __aspxRichEdit.TableRowAlignment.Left;
            return true;
        };
        return TablePropertiesMergerHorizontalAlignment;
    }(TablePropertiesMerger));
    __aspxRichEdit.TablePropertiesMergerHorizontalAlignment = TablePropertiesMergerHorizontalAlignment;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableRowPropertiesMerger = (function (_super) {
        __extends(TableRowPropertiesMerger, _super);
        function TableRowPropertiesMerger() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableRowPropertiesMerger.prototype.getContainerFromConditionalStyle = function (condStyle) {
            return condStyle.tableRowProperties;
        };
        TableRowPropertiesMerger.prototype.canUseValue = function (props) {
            return !!(props.mask & this.getPropertyMask());
        };
        TableRowPropertiesMerger.prototype.getCondTableStyleFormattingListForThisContainer = function () {
            return TableRowPropertiesMerger.conditionalTableStyleFormattingPriority;
        };
        TableRowPropertiesMerger.prototype.getNotMergedProperty = function () {
            return new __aspxRichEdit.TableMergerNotMergedPropertyResult(false, null);
        };
        TableRowPropertiesMerger.conditionalTableStyleFormattingPriority = [
            __aspxRichEdit.ConditionalTableStyleFormatting.FirstRow,
            __aspxRichEdit.ConditionalTableStyleFormatting.LastRow,
            __aspxRichEdit.ConditionalTableStyleFormatting.OddRowBanding,
            __aspxRichEdit.ConditionalTableStyleFormatting.EvenRowBanding,
            __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable,
        ];
        return TableRowPropertiesMerger;
    }(__aspxRichEdit.TablePropertiesMergerBase));
    __aspxRichEdit.TableRowPropertiesMerger = TableRowPropertiesMerger;
    var TableRowPropertiesMergerCellSpacing = (function (_super) {
        __extends(TableRowPropertiesMergerCellSpacing, _super);
        function TableRowPropertiesMergerCellSpacing(model, table, tablePropertiesException) {
            var _this = _super.call(this) || this;
            _this.tablePropertiesException = tablePropertiesException;
            _this.model = model;
            _this.table = table;
            return _this;
        }
        TableRowPropertiesMergerCellSpacing.prototype.getPropertyFromContainer = function (container) {
            return container.cellSpacing;
        };
        TableRowPropertiesMergerCellSpacing.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TableRowPropertiesMask.UseCellSpacing;
        };
        TableRowPropertiesMergerCellSpacing.prototype.getNotMergedProperty = function () {
            return new __aspxRichEdit.TablePropertiesMergerCellSpacing().getTableNotMergedProperty(this.tablePropertiesException);
        };
        TableRowPropertiesMergerCellSpacing.prototype.actionBeforeDefaultValue = function () {
            this.result = new __aspxRichEdit.TablePropertiesMergerCellSpacing().getProperty(this.table.properties, this.table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, this.model.defaultTableProperties);
            return true;
        };
        return TableRowPropertiesMergerCellSpacing;
    }(TableRowPropertiesMerger));
    __aspxRichEdit.TableRowPropertiesMergerCellSpacing = TableRowPropertiesMergerCellSpacing;
    var TableRowPropertiesMergerCantSplit = (function (_super) {
        __extends(TableRowPropertiesMergerCantSplit, _super);
        function TableRowPropertiesMergerCantSplit() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableRowPropertiesMergerCantSplit.prototype.getPropertyFromContainer = function (container) {
            return container.cantSplit;
        };
        TableRowPropertiesMergerCantSplit.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TableRowPropertiesMask.UseCantSplit;
        };
        return TableRowPropertiesMergerCantSplit;
    }(TableRowPropertiesMerger));
    __aspxRichEdit.TableRowPropertiesMergerCantSplit = TableRowPropertiesMergerCantSplit;
    var TableRowPropertiesMergerHorizontalAlignment = (function (_super) {
        __extends(TableRowPropertiesMergerHorizontalAlignment, _super);
        function TableRowPropertiesMergerHorizontalAlignment(tablePropertiesException) {
            var _this = _super.call(this) || this;
            _this.tablePropertiesException = tablePropertiesException;
            return _this;
        }
        TableRowPropertiesMergerHorizontalAlignment.prototype.getPropertyFromContainer = function (container) {
            return container.tableRowAlignment;
        };
        TableRowPropertiesMergerHorizontalAlignment.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TableRowPropertiesMask.UseTableRowAlignment;
        };
        TableRowPropertiesMergerHorizontalAlignment.prototype.actionBeforeDefaultValue = function () {
            this.result = null;
            return true;
        };
        TableRowPropertiesMergerHorizontalAlignment.prototype.getNotMergedProperty = function () {
            return new __aspxRichEdit.TablePropertiesMergerHorizontalAlignment().getTableNotMergedProperty(this.tablePropertiesException);
        };
        return TableRowPropertiesMergerHorizontalAlignment;
    }(TableRowPropertiesMerger));
    __aspxRichEdit.TableRowPropertiesMergerHorizontalAlignment = TableRowPropertiesMergerHorizontalAlignment;
    var TableRowPropertiesMergerDivId = (function (_super) {
        __extends(TableRowPropertiesMergerDivId, _super);
        function TableRowPropertiesMergerDivId() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableRowPropertiesMergerDivId.prototype.getPropertyFromContainer = function (container) {
            return container.divId;
        };
        TableRowPropertiesMergerDivId.prototype.getPropertyMask = function () {
            return __aspxRichEdit.TableRowPropertiesMask.UseDivId;
        };
        TableRowPropertiesMergerDivId.prototype.actionBeforeDefaultValue = function () {
            this.result = null;
            return true;
        };
        return TableRowPropertiesMergerDivId;
    }(TableRowPropertiesMerger));
    __aspxRichEdit.TableRowPropertiesMergerDivId = TableRowPropertiesMergerDivId;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableStyleCharacterPropertiesMerger = (function (_super) {
        __extends(TableStyleCharacterPropertiesMerger, _super);
        function TableStyleCharacterPropertiesMerger() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleCharacterPropertiesMerger.prototype.getContainerFromConditionalStyle = function (condStyle) {
            return condStyle.maskedCharacterProperties;
        };
        TableStyleCharacterPropertiesMerger.prototype.canUseValue = function (props) {
            return !!(props.useValue & this.getPropertyMask());
        };
        TableStyleCharacterPropertiesMerger.prototype.getCondTableStyleFormattingListForThisContainer = function () {
            return __aspxRichEdit.TableCellPropertiesMerger.conditionalTableStyleFormattingPriority;
        };
        TableStyleCharacterPropertiesMerger.prototype.actionBeforeDefaultValue = function () {
            this.result = null;
            return true;
        };
        TableStyleCharacterPropertiesMerger.prototype.getNotMergedProperty = function () {
            return new __aspxRichEdit.TableMergerNotMergedPropertyResult(false, null);
        };
        return TableStyleCharacterPropertiesMerger;
    }(__aspxRichEdit.TablePropertiesMergerBase));
    __aspxRichEdit.TableStyleCharacterPropertiesMerger = TableStyleCharacterPropertiesMerger;
    var TableStyleCharacterPropertiesMergerHidden = (function (_super) {
        __extends(TableStyleCharacterPropertiesMergerHidden, _super);
        function TableStyleCharacterPropertiesMergerHidden() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleCharacterPropertiesMergerHidden.prototype.getPropertyFromContainer = function (container) {
            return container.hidden;
        };
        TableStyleCharacterPropertiesMergerHidden.prototype.getPropertyMask = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseHidden;
        };
        return TableStyleCharacterPropertiesMergerHidden;
    }(TableStyleCharacterPropertiesMerger));
    __aspxRichEdit.TableStyleCharacterPropertiesMergerHidden = TableStyleCharacterPropertiesMergerHidden;
    var TableStyleCharacterPropertiesMergerScript = (function (_super) {
        __extends(TableStyleCharacterPropertiesMergerScript, _super);
        function TableStyleCharacterPropertiesMergerScript() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleCharacterPropertiesMergerScript.prototype.getPropertyFromContainer = function (container) {
            return container.script;
        };
        TableStyleCharacterPropertiesMergerScript.prototype.getPropertyMask = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseScript;
        };
        return TableStyleCharacterPropertiesMergerScript;
    }(TableStyleCharacterPropertiesMerger));
    __aspxRichEdit.TableStyleCharacterPropertiesMergerScript = TableStyleCharacterPropertiesMergerScript;
    var TableStyleCharacterPropertiesMergerAllCaps = (function (_super) {
        __extends(TableStyleCharacterPropertiesMergerAllCaps, _super);
        function TableStyleCharacterPropertiesMergerAllCaps() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleCharacterPropertiesMergerAllCaps.prototype.getPropertyFromContainer = function (container) {
            return container.allCaps;
        };
        TableStyleCharacterPropertiesMergerAllCaps.prototype.getPropertyMask = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseAllCaps;
        };
        return TableStyleCharacterPropertiesMergerAllCaps;
    }(TableStyleCharacterPropertiesMerger));
    __aspxRichEdit.TableStyleCharacterPropertiesMergerAllCaps = TableStyleCharacterPropertiesMergerAllCaps;
    var TableStyleCharacterPropertiesMergerNoProof = (function (_super) {
        __extends(TableStyleCharacterPropertiesMergerNoProof, _super);
        function TableStyleCharacterPropertiesMergerNoProof() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleCharacterPropertiesMergerNoProof.prototype.getPropertyFromContainer = function (container) {
            return container.noProof;
        };
        TableStyleCharacterPropertiesMergerNoProof.prototype.getPropertyMask = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseNoProof;
        };
        return TableStyleCharacterPropertiesMergerNoProof;
    }(TableStyleCharacterPropertiesMerger));
    __aspxRichEdit.TableStyleCharacterPropertiesMergerNoProof = TableStyleCharacterPropertiesMergerNoProof;
    var TableStyleCharacterPropertiesMergerFontBold = (function (_super) {
        __extends(TableStyleCharacterPropertiesMergerFontBold, _super);
        function TableStyleCharacterPropertiesMergerFontBold() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleCharacterPropertiesMergerFontBold.prototype.getPropertyFromContainer = function (container) {
            return container.fontBold;
        };
        TableStyleCharacterPropertiesMergerFontBold.prototype.getPropertyMask = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseFontBold;
        };
        return TableStyleCharacterPropertiesMergerFontBold;
    }(TableStyleCharacterPropertiesMerger));
    __aspxRichEdit.TableStyleCharacterPropertiesMergerFontBold = TableStyleCharacterPropertiesMergerFontBold;
    var TableStyleCharacterPropertiesMergerFontName = (function (_super) {
        __extends(TableStyleCharacterPropertiesMergerFontName, _super);
        function TableStyleCharacterPropertiesMergerFontName() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleCharacterPropertiesMergerFontName.prototype.getPropertyFromContainer = function (container) {
            return container.fontInfo;
        };
        TableStyleCharacterPropertiesMergerFontName.prototype.getPropertyMask = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseFontName;
        };
        return TableStyleCharacterPropertiesMergerFontName;
    }(TableStyleCharacterPropertiesMerger));
    __aspxRichEdit.TableStyleCharacterPropertiesMergerFontName = TableStyleCharacterPropertiesMergerFontName;
    var TableStyleCharacterPropertiesMergerShadingInfo = (function (_super) {
        __extends(TableStyleCharacterPropertiesMergerShadingInfo, _super);
        function TableStyleCharacterPropertiesMergerShadingInfo() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleCharacterPropertiesMergerShadingInfo.prototype.getPropertyFromContainer = function (container) {
            return container.shadingInfo;
        };
        TableStyleCharacterPropertiesMergerShadingInfo.prototype.getPropertyMask = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseShadingInfoIndex;
        };
        return TableStyleCharacterPropertiesMergerShadingInfo;
    }(TableStyleCharacterPropertiesMerger));
    __aspxRichEdit.TableStyleCharacterPropertiesMergerShadingInfo = TableStyleCharacterPropertiesMergerShadingInfo;
    var TableStyleCharacterPropertiesMergerTextColor = (function (_super) {
        __extends(TableStyleCharacterPropertiesMergerTextColor, _super);
        function TableStyleCharacterPropertiesMergerTextColor() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleCharacterPropertiesMergerTextColor.prototype.getPropertyFromContainer = function (container) {
            return container.textColor;
        };
        TableStyleCharacterPropertiesMergerTextColor.prototype.getPropertyMask = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseForeColorIndex;
        };
        return TableStyleCharacterPropertiesMergerTextColor;
    }(TableStyleCharacterPropertiesMerger));
    __aspxRichEdit.TableStyleCharacterPropertiesMergerTextColor = TableStyleCharacterPropertiesMergerTextColor;
    var TableStyleCharacterPropertiesMergerFontSize = (function (_super) {
        __extends(TableStyleCharacterPropertiesMergerFontSize, _super);
        function TableStyleCharacterPropertiesMergerFontSize() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleCharacterPropertiesMergerFontSize.prototype.getPropertyFromContainer = function (container) {
            return container.fontSize;
        };
        TableStyleCharacterPropertiesMergerFontSize.prototype.getPropertyMask = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseDoubleFontSize;
        };
        return TableStyleCharacterPropertiesMergerFontSize;
    }(TableStyleCharacterPropertiesMerger));
    __aspxRichEdit.TableStyleCharacterPropertiesMergerFontSize = TableStyleCharacterPropertiesMergerFontSize;
    var TableStyleCharacterPropertiesMergerFontItalic = (function (_super) {
        __extends(TableStyleCharacterPropertiesMergerFontItalic, _super);
        function TableStyleCharacterPropertiesMergerFontItalic() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleCharacterPropertiesMergerFontItalic.prototype.getPropertyFromContainer = function (container) {
            return container.fontItalic;
        };
        TableStyleCharacterPropertiesMergerFontItalic.prototype.getPropertyMask = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseFontItalic;
        };
        return TableStyleCharacterPropertiesMergerFontItalic;
    }(TableStyleCharacterPropertiesMerger));
    __aspxRichEdit.TableStyleCharacterPropertiesMergerFontItalic = TableStyleCharacterPropertiesMergerFontItalic;
    var TableStyleCharacterPropertiesMergerHighlightColor = (function (_super) {
        __extends(TableStyleCharacterPropertiesMergerHighlightColor, _super);
        function TableStyleCharacterPropertiesMergerHighlightColor() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleCharacterPropertiesMergerHighlightColor.prototype.getPropertyFromContainer = function (container) {
            return container.highlightColor;
        };
        TableStyleCharacterPropertiesMergerHighlightColor.prototype.getPropertyMask = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseStrikeoutColorIndex;
        };
        return TableStyleCharacterPropertiesMergerHighlightColor;
    }(TableStyleCharacterPropertiesMerger));
    __aspxRichEdit.TableStyleCharacterPropertiesMergerHighlightColor = TableStyleCharacterPropertiesMergerHighlightColor;
    var TableStyleCharacterPropertiesMergerStrikeoutColor = (function (_super) {
        __extends(TableStyleCharacterPropertiesMergerStrikeoutColor, _super);
        function TableStyleCharacterPropertiesMergerStrikeoutColor() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleCharacterPropertiesMergerStrikeoutColor.prototype.getPropertyFromContainer = function (container) {
            return container.strikeoutColor;
        };
        TableStyleCharacterPropertiesMergerStrikeoutColor.prototype.getPropertyMask = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseStrikeoutColorIndex;
        };
        return TableStyleCharacterPropertiesMergerStrikeoutColor;
    }(TableStyleCharacterPropertiesMerger));
    __aspxRichEdit.TableStyleCharacterPropertiesMergerStrikeoutColor = TableStyleCharacterPropertiesMergerStrikeoutColor;
    var TableStyleCharacterPropertiesMergerUnderlineColor = (function (_super) {
        __extends(TableStyleCharacterPropertiesMergerUnderlineColor, _super);
        function TableStyleCharacterPropertiesMergerUnderlineColor() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleCharacterPropertiesMergerUnderlineColor.prototype.getPropertyFromContainer = function (container) {
            return container.underlineColor;
        };
        TableStyleCharacterPropertiesMergerUnderlineColor.prototype.getPropertyMask = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseUnderlineColorIndex;
        };
        return TableStyleCharacterPropertiesMergerUnderlineColor;
    }(TableStyleCharacterPropertiesMerger));
    __aspxRichEdit.TableStyleCharacterPropertiesMergerUnderlineColor = TableStyleCharacterPropertiesMergerUnderlineColor;
    var TableStyleCharacterPropertiesMergerFontStrikeoutType = (function (_super) {
        __extends(TableStyleCharacterPropertiesMergerFontStrikeoutType, _super);
        function TableStyleCharacterPropertiesMergerFontStrikeoutType() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleCharacterPropertiesMergerFontStrikeoutType.prototype.getPropertyFromContainer = function (container) {
            return container.fontStrikeoutType;
        };
        TableStyleCharacterPropertiesMergerFontStrikeoutType.prototype.getPropertyMask = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseFontStrikeoutType;
        };
        return TableStyleCharacterPropertiesMergerFontStrikeoutType;
    }(TableStyleCharacterPropertiesMerger));
    __aspxRichEdit.TableStyleCharacterPropertiesMergerFontStrikeoutType = TableStyleCharacterPropertiesMergerFontStrikeoutType;
    var TableStyleCharacterPropertiesMergerFontUnderlineType = (function (_super) {
        __extends(TableStyleCharacterPropertiesMergerFontUnderlineType, _super);
        function TableStyleCharacterPropertiesMergerFontUnderlineType() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleCharacterPropertiesMergerFontUnderlineType.prototype.getPropertyFromContainer = function (container) {
            return container.fontUnderlineType;
        };
        TableStyleCharacterPropertiesMergerFontUnderlineType.prototype.getPropertyMask = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseFontUnderlineType;
        };
        return TableStyleCharacterPropertiesMergerFontUnderlineType;
    }(TableStyleCharacterPropertiesMerger));
    __aspxRichEdit.TableStyleCharacterPropertiesMergerFontUnderlineType = TableStyleCharacterPropertiesMergerFontUnderlineType;
    var TableStyleCharacterPropertiesMergerStrikeoutWordsOnly = (function (_super) {
        __extends(TableStyleCharacterPropertiesMergerStrikeoutWordsOnly, _super);
        function TableStyleCharacterPropertiesMergerStrikeoutWordsOnly() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleCharacterPropertiesMergerStrikeoutWordsOnly.prototype.getPropertyFromContainer = function (container) {
            return container.strikeoutWordsOnly;
        };
        TableStyleCharacterPropertiesMergerStrikeoutWordsOnly.prototype.getPropertyMask = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseStrikeoutWordsOnly;
        };
        return TableStyleCharacterPropertiesMergerStrikeoutWordsOnly;
    }(TableStyleCharacterPropertiesMerger));
    __aspxRichEdit.TableStyleCharacterPropertiesMergerStrikeoutWordsOnly = TableStyleCharacterPropertiesMergerStrikeoutWordsOnly;
    var TableStyleCharacterPropertiesMergerUnderlineWordsOnly = (function (_super) {
        __extends(TableStyleCharacterPropertiesMergerUnderlineWordsOnly, _super);
        function TableStyleCharacterPropertiesMergerUnderlineWordsOnly() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleCharacterPropertiesMergerUnderlineWordsOnly.prototype.getPropertyFromContainer = function (container) {
            return container.underlineWordsOnly;
        };
        TableStyleCharacterPropertiesMergerUnderlineWordsOnly.prototype.getPropertyMask = function () {
            return __aspxRichEdit.CharacterPropertiesMask.UseUnderlineWordsOnly;
        };
        return TableStyleCharacterPropertiesMergerUnderlineWordsOnly;
    }(TableStyleCharacterPropertiesMerger));
    __aspxRichEdit.TableStyleCharacterPropertiesMergerUnderlineWordsOnly = TableStyleCharacterPropertiesMergerUnderlineWordsOnly;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableStyleParagraphPropertiesMerger = (function (_super) {
        __extends(TableStyleParagraphPropertiesMerger, _super);
        function TableStyleParagraphPropertiesMerger() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMerger.prototype.getContainerFromConditionalStyle = function (condStyle) {
            return condStyle.maskedParagraphProperties;
        };
        TableStyleParagraphPropertiesMerger.prototype.canUseValue = function (props) {
            return !!(props.useValue & this.getPropertyMask());
        };
        TableStyleParagraphPropertiesMerger.prototype.getCondTableStyleFormattingListForThisContainer = function () {
            return __aspxRichEdit.TableCellPropertiesMerger.conditionalTableStyleFormattingPriority;
        };
        TableStyleParagraphPropertiesMerger.prototype.actionBeforeDefaultValue = function () {
            this.result = null;
            return true;
        };
        TableStyleParagraphPropertiesMerger.prototype.getNotMergedProperty = function () {
            return new __aspxRichEdit.TableMergerNotMergedPropertyResult(false, null);
        };
        return TableStyleParagraphPropertiesMerger;
    }(__aspxRichEdit.TablePropertiesMergerBase));
    __aspxRichEdit.TableStyleParagraphPropertiesMerger = TableStyleParagraphPropertiesMerger;
    var TableStyleParagraphPropertiesMergerAlignment = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerAlignment, _super);
        function TableStyleParagraphPropertiesMergerAlignment() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerAlignment.prototype.getPropertyFromContainer = function (container) {
            return container.alignment;
        };
        TableStyleParagraphPropertiesMergerAlignment.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseAlignment;
        };
        return TableStyleParagraphPropertiesMergerAlignment;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerAlignment = TableStyleParagraphPropertiesMergerAlignment;
    var TableStyleParagraphPropertiesMergerShadingInfo = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerShadingInfo, _super);
        function TableStyleParagraphPropertiesMergerShadingInfo() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerShadingInfo.prototype.getPropertyFromContainer = function (container) {
            return container.shadingInfo;
        };
        TableStyleParagraphPropertiesMergerShadingInfo.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseShadingInfoIndex;
        };
        return TableStyleParagraphPropertiesMergerShadingInfo;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerShadingInfo = TableStyleParagraphPropertiesMergerShadingInfo;
    var TableStyleParagraphPropertiesMergerLeftIndent = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerLeftIndent, _super);
        function TableStyleParagraphPropertiesMergerLeftIndent() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerLeftIndent.prototype.getPropertyFromContainer = function (container) {
            return container.leftIndent;
        };
        TableStyleParagraphPropertiesMergerLeftIndent.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseLeftIndent;
        };
        return TableStyleParagraphPropertiesMergerLeftIndent;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerLeftIndent = TableStyleParagraphPropertiesMergerLeftIndent;
    var TableStyleParagraphPropertiesMergerRightIndent = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerRightIndent, _super);
        function TableStyleParagraphPropertiesMergerRightIndent() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerRightIndent.prototype.getPropertyFromContainer = function (container) {
            return container.rightIndent;
        };
        TableStyleParagraphPropertiesMergerRightIndent.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseRightIndent;
        };
        return TableStyleParagraphPropertiesMergerRightIndent;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerRightIndent = TableStyleParagraphPropertiesMergerRightIndent;
    var TableStyleParagraphPropertiesMergerTopBorder = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerTopBorder, _super);
        function TableStyleParagraphPropertiesMergerTopBorder() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerTopBorder.prototype.getPropertyFromContainer = function (container) {
            return container.topBorder;
        };
        TableStyleParagraphPropertiesMergerTopBorder.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseTopBorder;
        };
        return TableStyleParagraphPropertiesMergerTopBorder;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerTopBorder = TableStyleParagraphPropertiesMergerTopBorder;
    var TableStyleParagraphPropertiesMergerKeepWithNext = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerKeepWithNext, _super);
        function TableStyleParagraphPropertiesMergerKeepWithNext() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerKeepWithNext.prototype.getPropertyFromContainer = function (container) {
            return container.keepWithNext;
        };
        TableStyleParagraphPropertiesMergerKeepWithNext.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseKeepWithNext;
        };
        return TableStyleParagraphPropertiesMergerKeepWithNext;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerKeepWithNext = TableStyleParagraphPropertiesMergerKeepWithNext;
    var TableStyleParagraphPropertiesMergerOutlineLevel = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerOutlineLevel, _super);
        function TableStyleParagraphPropertiesMergerOutlineLevel() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerOutlineLevel.prototype.getPropertyFromContainer = function (container) {
            return container.outlineLevel;
        };
        TableStyleParagraphPropertiesMergerOutlineLevel.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseOutlineLevel;
        };
        return TableStyleParagraphPropertiesMergerOutlineLevel;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerOutlineLevel = TableStyleParagraphPropertiesMergerOutlineLevel;
    var TableStyleParagraphPropertiesMergerSpacingAfter = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerSpacingAfter, _super);
        function TableStyleParagraphPropertiesMergerSpacingAfter() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerSpacingAfter.prototype.getPropertyFromContainer = function (container) {
            return container.spacingAfter;
        };
        TableStyleParagraphPropertiesMergerSpacingAfter.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseSpacingAfter;
        };
        return TableStyleParagraphPropertiesMergerSpacingAfter;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerSpacingAfter = TableStyleParagraphPropertiesMergerSpacingAfter;
    var TableStyleParagraphPropertiesMergerLeftBorder = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerLeftBorder, _super);
        function TableStyleParagraphPropertiesMergerLeftBorder() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerLeftBorder.prototype.getPropertyFromContainer = function (container) {
            return container.leftBorder;
        };
        TableStyleParagraphPropertiesMergerLeftBorder.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseLeftBorder;
        };
        return TableStyleParagraphPropertiesMergerLeftBorder;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerLeftBorder = TableStyleParagraphPropertiesMergerLeftBorder;
    var TableStyleParagraphPropertiesMergerSpacingBefore = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerSpacingBefore, _super);
        function TableStyleParagraphPropertiesMergerSpacingBefore() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerSpacingBefore.prototype.getPropertyFromContainer = function (container) {
            return container.spacingBefore;
        };
        TableStyleParagraphPropertiesMergerSpacingBefore.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseSpacingBefore;
        };
        return TableStyleParagraphPropertiesMergerSpacingBefore;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerSpacingBefore = TableStyleParagraphPropertiesMergerSpacingBefore;
    var TableStyleParagraphPropertiesMergerRightBorder = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerRightBorder, _super);
        function TableStyleParagraphPropertiesMergerRightBorder() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerRightBorder.prototype.getPropertyFromContainer = function (container) {
            return container.rightBorder;
        };
        TableStyleParagraphPropertiesMergerRightBorder.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseRightBorder;
        };
        return TableStyleParagraphPropertiesMergerRightBorder;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerRightBorder = TableStyleParagraphPropertiesMergerRightBorder;
    var TableStyleParagraphPropertiesMergerBottomBorder = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerBottomBorder, _super);
        function TableStyleParagraphPropertiesMergerBottomBorder() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerBottomBorder.prototype.getPropertyFromContainer = function (container) {
            return container.bottomBorder;
        };
        TableStyleParagraphPropertiesMergerBottomBorder.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseBottomBorder;
        };
        return TableStyleParagraphPropertiesMergerBottomBorder;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerBottomBorder = TableStyleParagraphPropertiesMergerBottomBorder;
    var TableStyleParagraphPropertiesMergerBetweenBorder = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerBetweenBorder, _super);
        function TableStyleParagraphPropertiesMergerBetweenBorder() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerBetweenBorder.prototype.getPropertyFromContainer = function (container) {
            return container.betweenBorder;
        };
        TableStyleParagraphPropertiesMergerBetweenBorder.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseBetweenBorder;
        };
        return TableStyleParagraphPropertiesMergerBetweenBorder;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerBetweenBorder = TableStyleParagraphPropertiesMergerBetweenBorder;
    var TableStyleParagraphPropertiesMergerPageBreakBefore = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerPageBreakBefore, _super);
        function TableStyleParagraphPropertiesMergerPageBreakBefore() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerPageBreakBefore.prototype.getPropertyFromContainer = function (container) {
            return container.pageBreakBefore;
        };
        TableStyleParagraphPropertiesMergerPageBreakBefore.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UsePageBreakBefore;
        };
        return TableStyleParagraphPropertiesMergerPageBreakBefore;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerPageBreakBefore = TableStyleParagraphPropertiesMergerPageBreakBefore;
    var TableStyleParagraphPropertiesMergerAfterAutoSpacing = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerAfterAutoSpacing, _super);
        function TableStyleParagraphPropertiesMergerAfterAutoSpacing() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerAfterAutoSpacing.prototype.getPropertyFromContainer = function (container) {
            return container.afterAutoSpacing;
        };
        TableStyleParagraphPropertiesMergerAfterAutoSpacing.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseAfterAutoSpacing;
        };
        return TableStyleParagraphPropertiesMergerAfterAutoSpacing;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerAfterAutoSpacing = TableStyleParagraphPropertiesMergerAfterAutoSpacing;
    var TableStyleParagraphPropertiesMergerKeepLinesTogether = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerKeepLinesTogether, _super);
        function TableStyleParagraphPropertiesMergerKeepLinesTogether() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerKeepLinesTogether.prototype.getPropertyFromContainer = function (container) {
            return container.keepLinesTogether;
        };
        TableStyleParagraphPropertiesMergerKeepLinesTogether.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseKeepLinesTogether;
        };
        return TableStyleParagraphPropertiesMergerKeepLinesTogether;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerKeepLinesTogether = TableStyleParagraphPropertiesMergerKeepLinesTogether;
    var TableStyleParagraphPropertiesMergerRightToLeft = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerRightToLeft, _super);
        function TableStyleParagraphPropertiesMergerRightToLeft() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerRightToLeft.prototype.getPropertyFromContainer = function (container) {
            return container.rightToLeft;
        };
        TableStyleParagraphPropertiesMergerRightToLeft.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseRightToLeft;
        };
        return TableStyleParagraphPropertiesMergerRightToLeft;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerRightToLeft = TableStyleParagraphPropertiesMergerRightToLeft;
    var TableStyleParagraphPropertiesMergerBeforeAutoSpacing = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerBeforeAutoSpacing, _super);
        function TableStyleParagraphPropertiesMergerBeforeAutoSpacing() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerBeforeAutoSpacing.prototype.getPropertyFromContainer = function (container) {
            return container.beforeAutoSpacing;
        };
        TableStyleParagraphPropertiesMergerBeforeAutoSpacing.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseBeforeAutoSpacing;
        };
        return TableStyleParagraphPropertiesMergerBeforeAutoSpacing;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerBeforeAutoSpacing = TableStyleParagraphPropertiesMergerBeforeAutoSpacing;
    var TableStyleParagraphPropertiesMergerContextualSpacing = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerContextualSpacing, _super);
        function TableStyleParagraphPropertiesMergerContextualSpacing() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerContextualSpacing.prototype.getPropertyFromContainer = function (container) {
            return container.contextualSpacing;
        };
        TableStyleParagraphPropertiesMergerContextualSpacing.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseContextualSpacing;
        };
        return TableStyleParagraphPropertiesMergerContextualSpacing;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerContextualSpacing = TableStyleParagraphPropertiesMergerContextualSpacing;
    var TableStyleParagraphPropertiesMergerWidowOrphanControl = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerWidowOrphanControl, _super);
        function TableStyleParagraphPropertiesMergerWidowOrphanControl() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerWidowOrphanControl.prototype.getPropertyFromContainer = function (container) {
            return container.widowOrphanControl;
        };
        TableStyleParagraphPropertiesMergerWidowOrphanControl.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseWidowOrphanControl;
        };
        return TableStyleParagraphPropertiesMergerWidowOrphanControl;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerWidowOrphanControl = TableStyleParagraphPropertiesMergerWidowOrphanControl;
    var TableStyleParagraphPropertiesMergerSuppressHyphenation = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerSuppressHyphenation, _super);
        function TableStyleParagraphPropertiesMergerSuppressHyphenation() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerSuppressHyphenation.prototype.getPropertyFromContainer = function (container) {
            return container.suppressHyphenation;
        };
        TableStyleParagraphPropertiesMergerSuppressHyphenation.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseSuppressHyphenation;
        };
        return TableStyleParagraphPropertiesMergerSuppressHyphenation;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerSuppressHyphenation = TableStyleParagraphPropertiesMergerSuppressHyphenation;
    var TableStyleParagraphPropertiesMergerSuppressLineNumbers = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerSuppressLineNumbers, _super);
        function TableStyleParagraphPropertiesMergerSuppressLineNumbers() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerSuppressLineNumbers.prototype.getPropertyFromContainer = function (container) {
            return container.suppressLineNumbers;
        };
        TableStyleParagraphPropertiesMergerSuppressLineNumbers.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseSuppressLineNumbers;
        };
        return TableStyleParagraphPropertiesMergerSuppressLineNumbers;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerSuppressLineNumbers = TableStyleParagraphPropertiesMergerSuppressLineNumbers;
    var TableStyleParagraphPropertiesMergerFirstLineIndent = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerFirstLineIndent, _super);
        function TableStyleParagraphPropertiesMergerFirstLineIndent() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerFirstLineIndent.prototype.getPropertyFromContainer = function (container) {
            return container.firstLineIndent;
        };
        TableStyleParagraphPropertiesMergerFirstLineIndent.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseFirstLineIndent;
        };
        return TableStyleParagraphPropertiesMergerFirstLineIndent;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerFirstLineIndent = TableStyleParagraphPropertiesMergerFirstLineIndent;
    var TableStyleParagraphPropertiesMergerFirstLineIndentType = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerFirstLineIndentType, _super);
        function TableStyleParagraphPropertiesMergerFirstLineIndentType() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerFirstLineIndentType.prototype.getPropertyFromContainer = function (container) {
            return container.firstLineIndentType;
        };
        TableStyleParagraphPropertiesMergerFirstLineIndentType.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseFirstLineIndent;
        };
        return TableStyleParagraphPropertiesMergerFirstLineIndentType;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerFirstLineIndentType = TableStyleParagraphPropertiesMergerFirstLineIndentType;
    var TableStyleParagraphPropertiesMergerLineSpacing = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerLineSpacing, _super);
        function TableStyleParagraphPropertiesMergerLineSpacing() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerLineSpacing.prototype.getPropertyFromContainer = function (container) {
            return container.lineSpacing;
        };
        TableStyleParagraphPropertiesMergerLineSpacing.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseLineSpacing;
        };
        return TableStyleParagraphPropertiesMergerLineSpacing;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerLineSpacing = TableStyleParagraphPropertiesMergerLineSpacing;
    var TableStyleParagraphPropertiesMergerLineSpacingType = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerLineSpacingType, _super);
        function TableStyleParagraphPropertiesMergerLineSpacingType() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerLineSpacingType.prototype.getPropertyFromContainer = function (container) {
            return container.lineSpacingType;
        };
        TableStyleParagraphPropertiesMergerLineSpacingType.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseLineSpacing;
        };
        return TableStyleParagraphPropertiesMergerLineSpacingType;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerLineSpacingType = TableStyleParagraphPropertiesMergerLineSpacingType;
    var TableStyleParagraphPropertiesMergerDivId = (function (_super) {
        __extends(TableStyleParagraphPropertiesMergerDivId, _super);
        function TableStyleParagraphPropertiesMergerDivId() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        TableStyleParagraphPropertiesMergerDivId.prototype.getPropertyFromContainer = function (container) {
            return container.divId;
        };
        TableStyleParagraphPropertiesMergerDivId.prototype.getPropertyMask = function () {
            return __aspxRichEdit.ParagraphPropertiesMask.UseDivId;
        };
        return TableStyleParagraphPropertiesMergerDivId;
    }(TableStyleParagraphPropertiesMerger));
    __aspxRichEdit.TableStyleParagraphPropertiesMergerDivId = TableStyleParagraphPropertiesMergerDivId;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableBorderInfo = (function () {
        function TableBorderInfo(compoundArray, widthDivider) {
            this.drawingCompoundArray = [];
            this.compoundArray = compoundArray;
            this.widthDivider = widthDivider;
            this.lineCount = Math.floor(compoundArray.length / 2);
            this.widthMultiplier = this.compoundArray[this.compoundArray.length - 1];
            for (var _i = 0, _a = this.compoundArray; _i < _a.length; _i++) {
                var num = _a[_i];
                this.drawingCompoundArray.push(num / this.widthMultiplier);
            }
        }
        TableBorderInfo.prototype.getActualWidth = function (borderWidth) {
            return borderWidth * this.widthMultiplier / this.widthDivider;
        };
        return TableBorderInfo;
    }());
    var TableBorderCalculator = (function () {
        function TableBorderCalculator() {
            TableBorderCalculator.initStaticMembers();
        }
        TableBorderCalculator.initStaticMembers = function () {
            if (!!TableBorderCalculator.lineStyleInfo)
                return;
            TableBorderCalculator.lineStyleInfo = {};
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.Single] = new TableBorderInfo([0, 1], 1);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.Thick] = new TableBorderInfo([0, 1], 1);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.Double] = new TableBorderInfo([0, 1, 2, 3], 1);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.Dotted] = new TableBorderInfo([0, 1], 1);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.Dashed] = new TableBorderInfo([0, 1], 1);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.DotDash] = new TableBorderInfo([0, 1], 1);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.DotDotDash] = new TableBorderInfo([0, 1], 1);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.Triple] = new TableBorderInfo([0, 1, 2, 3, 4, 5], 1);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.ThinThickSmallGap] = new TableBorderInfo([0, 1, 2, 10], 8);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.ThickThinSmallGap] = new TableBorderInfo([0, 8, 9, 10], 8);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.ThinThickThinSmallGap] = new TableBorderInfo([0, 1, 2, 10, 11, 12], 8);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.ThinThickMediumGap] = new TableBorderInfo([0, 1, 2, 4], 2);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.ThickThinMediumGap] = new TableBorderInfo([0, 2, 3, 4], 2);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.ThinThickThinMediumGap] = new TableBorderInfo([0, 1, 2, 4, 5, 6], 2);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.ThinThickLargeGap] = new TableBorderInfo([0, 1, 9, 11], 8);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.ThickThinLargeGap] = new TableBorderInfo([0, 2, 10, 11], 8);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.ThinThickThinLargeGap] = new TableBorderInfo([0, 1, 9, 11, 19, 20], 8);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.Wave] = new TableBorderInfo([0, 1], 1);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.DoubleWave] = new TableBorderInfo([0, 1, 1, 2], 1);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.DashSmallGap] = new TableBorderInfo([0, 1], 1);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.DashDotStroked] = new TableBorderInfo([0, 1], 1);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.ThreeDEmboss] = new TableBorderInfo([0, 1, 1, 5, 6], 4);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.ThreeDEngrave] = new TableBorderInfo([0, 1, 1, 5, 6], 4);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.Outset] = new TableBorderInfo([0, 1], 1);
            TableBorderCalculator.lineStyleInfo[__aspxRichEdit.BorderLineStyle.Inset] = new TableBorderInfo([0, 1], 1);
        };
        TableBorderCalculator.getPowerfulBorder = function (colorProvider, aBorder, bBorder) {
            this.initStaticMembers();
            if (!aBorder)
                return bBorder;
            if (!bBorder)
                return aBorder;
            var aBorderWeight = TableBorderCalculator.getWeight(aBorder);
            var bBorderWeight = TableBorderCalculator.getWeight(bBorder);
            if (aBorderWeight > bBorderWeight)
                return aBorder;
            if (bBorderWeight > aBorderWeight)
                return bBorder;
            var aBorderStyleWeight = aBorder.style;
            var bBorderStyleWeight = bBorder.style;
            if (aBorderStyleWeight > bBorderStyleWeight)
                return aBorder;
            if (bBorderStyleWeight > aBorderStyleWeight)
                return bBorder;
            var aBorderColor = colorProvider.getRgbaFromModelColor(aBorder.color);
            var bBorderColor = colorProvider.getRgbaFromModelColor(bBorder.color);
            var aBorderBrightness = TableBorderCalculator.getBrightnessLevelOne(aBorderColor);
            var bBorderBrightness = TableBorderCalculator.getBrightnessLevelOne(bBorderColor);
            if (aBorderBrightness == bBorderBrightness) {
                aBorderBrightness = TableBorderCalculator.getBrightnessLevelTwo(aBorderColor);
                bBorderBrightness = TableBorderCalculator.getBrightnessLevelTwo(bBorderColor);
                if (aBorderBrightness == bBorderBrightness) {
                    aBorderBrightness = TableBorderCalculator.getBrightnessLevelThree(aBorderColor);
                    bBorderBrightness = TableBorderCalculator.getBrightnessLevelThree(bBorderColor);
                }
            }
            if (aBorderBrightness < bBorderBrightness)
                return aBorder;
            if (bBorderBrightness < aBorderBrightness)
                return bBorder;
            return aBorder;
        };
        TableBorderCalculator.getActualWidth = function (borderInfo) {
            var info = TableBorderCalculator.getActualBorderLineStyle(borderInfo.style).info;
            return info ? info.getActualWidth(borderInfo.width) : 0;
        };
        TableBorderCalculator.getBrightnessLevelOne = function (color) {
            return __aspxRichEdit.ColorHelper.getRed(color) + TableBorderCalculator.getBrightnessLevelTwo(color);
        };
        TableBorderCalculator.getBrightnessLevelTwo = function (color) {
            return __aspxRichEdit.ColorHelper.getBlue(color) + 2 * __aspxRichEdit.ColorHelper.getGreen(color);
        };
        TableBorderCalculator.getBrightnessLevelThree = function (color) {
            return __aspxRichEdit.ColorHelper.getGreen(color);
        };
        TableBorderCalculator.getWeight = function (borderInfo) {
            var borderStyle = borderInfo.style;
            var info = TableBorderCalculator.getActualBorderLineStyle(borderStyle).info;
            return info ? (info.lineCount * borderStyle) : (borderStyle == __aspxRichEdit.BorderLineStyle.Disabled ? Number.MAX_VALUE : 0);
        };
        TableBorderCalculator.getActualBorderLineStyle = function (borderLineStyle) {
            if (borderLineStyle == __aspxRichEdit.BorderLineStyle.None || borderLineStyle == __aspxRichEdit.BorderLineStyle.Nil || borderLineStyle == __aspxRichEdit.BorderLineStyle.Disabled)
                return { actualLineStyle: borderLineStyle, info: null };
            var info = TableBorderCalculator.lineStyleInfo[borderLineStyle];
            if (info)
                return { actualLineStyle: borderLineStyle, info: info };
            return { actualLineStyle: __aspxRichEdit.BorderLineStyle.Single, info: null };
        };
        return TableBorderCalculator;
    }());
    __aspxRichEdit.TableBorderCalculator = TableBorderCalculator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableCellStyle = (function (_super) {
        __extends(TableCellStyle, _super);
        function TableCellStyle(styleName, localizedName, deleted, hidden, semihidden, isDefault, tableCellProperties, characterProperties) {
            var _this = _super.call(this, styleName, localizedName, deleted, hidden, semihidden, isDefault) || this;
            _this.tableCellProperties = tableCellProperties;
            _this.characterProperties = characterProperties;
            return _this;
        }
        TableCellStyle.prototype.clone = function () {
            return new TableCellStyle(this.styleName, this.localizedName, this.deleted, this.hidden, this.semihidden, this.isDefault, this.tableCellProperties, this.characterProperties);
        };
        TableCellStyle.DEFAULT_STYLENAME = "";
        return TableCellStyle;
    }(__aspxRichEdit.StyleBase));
    __aspxRichEdit.TableCellStyle = TableCellStyle;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableConditionalStyle = (function () {
        function TableConditionalStyle(tableProperties, tableRowProperties, tableCellProperties, maskedParagraphProperties, maskedCharacterProperties, tabs) {
            this.tableProperties = tableProperties;
            this.tableRowProperties = tableRowProperties;
            this.tableCellProperties = tableCellProperties;
            this.maskedParagraphProperties = maskedParagraphProperties;
            this.maskedCharacterProperties = maskedCharacterProperties;
            this.tabs = tabs;
        }
        TableConditionalStyle.addConditionalStyle = function (conditionalStyles, type, conditionalStyle) {
            conditionalStyles[type] = conditionalStyle;
        };
        return TableConditionalStyle;
    }());
    __aspxRichEdit.TableConditionalStyle = TableConditionalStyle;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var TableStyle = (function (_super) {
        __extends(TableStyle, _super);
        function TableStyle(styleName, localizedName, deleted, hidden, semihidden, isDefault, conditionalStyles, baseConditionalStyle, base64EncodedImage) {
            var _this = _super.call(this, styleName, localizedName, deleted, hidden, semihidden, isDefault, base64EncodedImage) || this;
            _this.conditionalStyles = {};
            _this.conditionalStyles = conditionalStyles;
            _this.baseConditionalStyle = baseConditionalStyle;
            return _this;
        }
        TableStyle.prototype.clone = function () {
            var newStyle = new TableStyle(this.styleName, this.localizedName, this.deleted, this.hidden, this.semihidden, this.isDefault, this.conditionalStyles, this.baseConditionalStyle, this.base64EncodedImage);
            return newStyle;
        };
        TableStyle.SIMPLE_STYLENAME = "Table Simple 1";
        TableStyle.DEFAULT_STYLENAME = "Normal Table";
        TableStyle.DEFAULT_STYLENAME_2 = "Table Normal";
        return TableStyle;
    }(__aspxRichEdit.StyleBase));
    __aspxRichEdit.TableStyle = TableStyle;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_AnchorObjectsPositionInfo = (function (_super) {
                __extends(CCF_AnchorObjectsPositionInfo, _super);
                function CCF_AnchorObjectsPositionInfo() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_AnchorObjectsPositionInfo.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.AnchorObjectsPositionInfo;
                };
                CCF_AnchorObjectsPositionInfo.prototype.getShortDescription = function (_config) {
                    if (__aspxRichEdit.MapUtilsKeyAsNumber.isEmpty(this.curr.cache))
                        return new ChromeCustomFormatters.SpanElement().setText("Empty");
                    return this.stdShow(new ChromeCustomFormatters.StdProps(this.getList()).showAsLine().setStdNumElements());
                };
                CCF_AnchorObjectsPositionInfo.prototype.hasBody = function (_, _config) {
                    return !__aspxRichEdit.MapUtilsKeyAsNumber.isEmpty(this.curr.cache);
                };
                CCF_AnchorObjectsPositionInfo.prototype.getFullDescription = function (_config) {
                    return this.stdShow(new ChromeCustomFormatters.StdProps(this.getList()).showAsColumn());
                };
                CCF_AnchorObjectsPositionInfo.prototype.getList = function () {
                    return this.mapNumberAsKeyToListOfPairs(this.curr.cache, function (_, obj) { return obj.modelPosition; }, function (key, obj) { return new __aspxRichEdit.Pair(key.toString(), obj.modelPosition); });
                };
                CCF_AnchorObjectsPositionInfo._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_AnchorObjectsPositionInfo());
                return CCF_AnchorObjectsPositionInfo;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_AnchorObjectsPositionInfo = CCF_AnchorObjectsPositionInfo;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_DocumentLayout = (function (_super) {
                __extends(CCF_DocumentLayout, _super);
                function CCF_DocumentLayout() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_DocumentLayout.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.DocumentLayout;
                };
                CCF_DocumentLayout.prototype.getShortDescription = function (_config) {
                    return this.stdShow(new ChromeCustomFormatters.StdProps([
                        new __aspxRichEdit.Pair("", this.curr.isFullyFormatted ? "FullFormatted" : "NotFullFormatted"),
                        new __aspxRichEdit.Pair("validPages", this.curr.validPageCount),
                        new __aspxRichEdit.Pair("phisicalPages", this.curr.pages.length),
                        new __aspxRichEdit.Pair("anchorObjectsPositionInfo", this.curr.anchorObjectsPositionInfo),
                    ]).showAsLine());
                };
                CCF_DocumentLayout.prototype.availableFullDescription = function (_config) {
                    return true;
                };
                CCF_DocumentLayout.prototype.getFullDescription = function (_config) {
                    return this.stdShow(new ChromeCustomFormatters.StdProps(this.getList(true)).showAsColumn());
                };
                CCF_DocumentLayout.prototype.getList = function (placePagesInfo) {
                    var list = [new __aspxRichEdit.Pair("isFullyFormatted", this.curr.isFullyFormatted),
                        new __aspxRichEdit.Pair("validPages", this.curr.validPageCount),
                        new __aspxRichEdit.Pair("existingPages", this.curr.pages.length),
                        new __aspxRichEdit.Pair("lastMaxNumPages", this.curr.lastMaxNumPages),
                        new __aspxRichEdit.Pair("pagesColor", new ChromeCustomFormatters.DivElement().setStyle("display: inline-block")
                            .setText(__aspxRichEdit.ColorHelper.getCssString(this.curr.pageColor, false) + " (" + this.curr.pageColor + ") ")
                            .setNode(ChromeCustomFormatters.BaseFormatter.getColorBoxNode(this.curr.pageColor))),
                        new __aspxRichEdit.Pair("anchorObjectsPositionInfo", this.curr.anchorObjectsPositionInfo)];
                    if (placePagesInfo)
                        list.push(new __aspxRichEdit.Pair("pages", this.curr.pages));
                    return list;
                };
                CCF_DocumentLayout._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_DocumentLayout());
                return CCF_DocumentLayout;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_DocumentLayout = CCF_DocumentLayout;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_LayoutBox = (function (_super) {
                __extends(CCF_LayoutBox, _super);
                function CCF_LayoutBox() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_LayoutBox.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.LayoutBox;
                };
                CCF_LayoutBox.prototype.getShortDescription = function (_config) {
                    var list = [new __aspxRichEdit.Pair("", __aspxRichEdit.LayoutBoxType[this.curr.getType()])];
                    if (this.curr.getType() == __aspxRichEdit.LayoutBoxType.Text)
                        list.push(new __aspxRichEdit.Pair("text", this.curr.text));
                    list.push(new __aspxRichEdit.Pair("offset", this.curr.rowOffset));
                    if (this.curr.getType() == __aspxRichEdit.LayoutBoxType.AnchorTextBox)
                        list.push(new __aspxRichEdit.Pair("txt", this.getSubDocumentText(this.curr.internalSubDocId)));
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsLine());
                };
                CCF_LayoutBox.prototype.availableFullDescription = function (_config) {
                    return true;
                };
                CCF_LayoutBox.prototype.getFullDescription = function (_config) {
                    return this.stdShow(new ChromeCustomFormatters.StdProps(this.getList()).showAsColumn());
                };
                CCF_LayoutBox.prototype.getList = function () {
                    var list = [
                        new __aspxRichEdit.Pair("offset", this.curr.rowOffset),
                        new __aspxRichEdit.Pair("type", __aspxRichEdit.LayoutBoxType[this.curr.getType()]),
                        new __aspxRichEdit.Pair("bounds", this.curr.rectangle),
                    ];
                    switch (this.curr.getType()) {
                        case __aspxRichEdit.LayoutBoxType.Text:
                            list.push(new __aspxRichEdit.Pair("text", this.curr.text));
                            break;
                        case __aspxRichEdit.LayoutBoxType.Space:
                            list.push(new __aspxRichEdit.Pair("hiddenSpaceWidth", this.curr.hiddenSpaceWidth));
                            list.push(new __aspxRichEdit.Pair("spaceWidth", this.curr.spaceWidth));
                            break;
                        case __aspxRichEdit.LayoutBoxType.NonBreakingSpace:
                            list.push(new __aspxRichEdit.Pair("nonBreakingSymbolWidth", this.curr.spaceWidth));
                            list.push(new __aspxRichEdit.Pair("hiddenSpaceWidth", this.curr.hiddenSpaceWidth));
                            break;
                        case __aspxRichEdit.LayoutBoxType.Picture:
                            list.push(new __aspxRichEdit.Pair("pictureIsLoaded", this.curr.isLoaded));
                            this.addPicInfo(list);
                            break;
                        case __aspxRichEdit.LayoutBoxType.NumberingList:
                            list.push(new __aspxRichEdit.Pair("separatorBox", this.curr.separatorBox));
                            list.push(new __aspxRichEdit.Pair("textBox", this.curr.textBox));
                            break;
                        case __aspxRichEdit.LayoutBoxType.AnchorPicture:
                        case __aspxRichEdit.LayoutBoxType.AnchorTextBox:
                            list.push(new __aspxRichEdit.Pair("objectId", this.curr.objectId));
                            list.push(new __aspxRichEdit.Pair("belongsToSubDocId", this.curr.belongsToSubDocId));
                            list.push(new __aspxRichEdit.Pair("rotationInRadians", this.curr.rotationInRadians));
                            list.push(new __aspxRichEdit.Pair("anchorInfo", this.curr.anchorInfo));
                            list.push(new __aspxRichEdit.Pair("shape", this.curr.shape));
                            list.push(new __aspxRichEdit.Pair("rendererLevel", this.curr.rendererLevel));
                            if (this.curr.getType() == __aspxRichEdit.LayoutBoxType.AnchorTextBox) {
                                list.push(new __aspxRichEdit.Pair("internalSubDocId", this.curr.internalSubDocId));
                                list.push(new __aspxRichEdit.Pair("textBoxProperties", this.curr.textBoxProperties));
                                list.push(new __aspxRichEdit.Pair("textOfInnerSubDocument", this.getSubDocumentText(this.curr.internalSubDocId)));
                            }
                            else {
                                list.push(new __aspxRichEdit.Pair("isLoaded", this.curr.isLoaded));
                                this.addPicInfo(list);
                            }
                            break;
                    }
                    list.push(new __aspxRichEdit.Pair("characterProperties", this.curr.characterProperties));
                    list.push(new __aspxRichEdit.Pair("fieldLevel", this.curr.fieldLevel));
                    list.push(new __aspxRichEdit.Pair("hyperlinkTip", this.curr.hyperlinkTip));
                    return list;
                };
                CCF_LayoutBox.prototype.addPicInfo = function (list) {
                    var picId = this.curr.getType() == __aspxRichEdit.LayoutBoxType.Picture ?
                        this.curr.id : this.curr.pictureId;
                    list.push(new __aspxRichEdit.Pair("pictureId", picId));
                    list.push(new __aspxRichEdit.Pair("", this.getPictureNode(picId, this.curr)));
                };
                CCF_LayoutBox._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_LayoutBox());
                return CCF_LayoutBox;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_LayoutBox = CCF_LayoutBox;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_LayoutColumn = (function (_super) {
                __extends(CCF_LayoutColumn, _super);
                function CCF_LayoutColumn() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_LayoutColumn.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.LayoutColumn;
                };
                CCF_LayoutColumn.prototype.getShortDescription = function (_config) {
                    return this.stdShow(new ChromeCustomFormatters.StdProps([
                        new __aspxRichEdit.Pair("offset", this.curr.pageAreaOffset),
                    ]).showAsLine());
                };
                CCF_LayoutColumn.prototype.availableFullDescription = function (_config) {
                    return true;
                };
                CCF_LayoutColumn.prototype.getFullDescription = function (_config) {
                    return this.stdShow(new ChromeCustomFormatters.StdProps([
                        new __aspxRichEdit.Pair("offset", this.curr.pageAreaOffset),
                        new __aspxRichEdit.Pair("bounds", this.curr.rectangle),
                        new __aspxRichEdit.Pair("rows", this.curr.rows),
                        new __aspxRichEdit.Pair("paragraphFrames", this.curr.paragraphFrames),
                        new __aspxRichEdit.Pair("tablesInfo", this.curr.tablesInfo),
                    ]).showAsColumn());
                };
                CCF_LayoutColumn._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_LayoutColumn());
                return CCF_LayoutColumn;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_LayoutColumn = CCF_LayoutColumn;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_LayoutPage = (function (_super) {
                __extends(CCF_LayoutPage, _super);
                function CCF_LayoutPage() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_LayoutPage.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.LayoutPage;
                };
                CCF_LayoutPage.prototype.getShortDescription = function (_config) {
                    return this.stdShow(new ChromeCustomFormatters.StdProps([
                        new __aspxRichEdit.Pair("", this.curr.index),
                        new __aspxRichEdit.Pair("offset", this.curr.getPosition()),
                        new __aspxRichEdit.Pair("", this.curr.isValid ? "valid" : "invalid")
                    ]).showAsLine());
                };
                CCF_LayoutPage.prototype.availableFullDescription = function (_config) {
                    return true;
                };
                CCF_LayoutPage.prototype.getFullDescription = function (_config) {
                    return this.stdShow(new ChromeCustomFormatters.StdProps([
                        new __aspxRichEdit.Pair("index", this.curr.index),
                        new __aspxRichEdit.Pair("isValid", this.curr.isValid),
                        new __aspxRichEdit.Pair("intervals", this.curr.getContentIntervals()),
                        new __aspxRichEdit.Pair("bounds", this.curr.rectangle),
                        new __aspxRichEdit.Pair("mainPageAreas", this.curr.mainSubDocumentPageAreas),
                        new __aspxRichEdit.Pair("otherPageAreas", this.stdShow(new ChromeCustomFormatters.StdProps(this.mapNumberAsKeyToListOfPairs(this.curr.otherPageAreas, function (id) { return id; }, function (id, pa) { return new __aspxRichEdit.Pair(id.toString(), pa); })).showAsLine().setStdNumElements()).setInlineBlockType()),
                        new __aspxRichEdit.Pair("anchoredObjectHolder", this.curr.anchoredObjectHolder),
                        new __aspxRichEdit.Pair("flags", __aspxRichEdit.Log.mask(__aspxRichEdit.LayoutPageFlags, this.curr.flags.getValue())),
                    ]).showAsColumn());
                };
                CCF_LayoutPage._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_LayoutPage());
                return CCF_LayoutPage;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_LayoutPage = CCF_LayoutPage;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_LayoutPageArea = (function (_super) {
                __extends(CCF_LayoutPageArea, _super);
                function CCF_LayoutPageArea() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_LayoutPageArea.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.LayoutPageArea;
                };
                CCF_LayoutPageArea.prototype.getShortDescription = function (_config) {
                    return this.stdShow(new ChromeCustomFormatters.StdProps([
                        new __aspxRichEdit.Pair("subDoc", this.curr.subDocument)
                    ]).showAsLine());
                };
                CCF_LayoutPageArea.prototype.availableFullDescription = function (_config) {
                    return true;
                };
                CCF_LayoutPageArea.prototype.getFullDescription = function (_config) {
                    return this.stdShow(new ChromeCustomFormatters.StdProps([
                        new __aspxRichEdit.Pair("offset", this.curr.pageOffset),
                        new __aspxRichEdit.Pair("columns", this.curr.columns),
                        new __aspxRichEdit.Pair("subDocument", this.curr.subDocument),
                        new __aspxRichEdit.Pair("bounds", this.curr.rectangle)
                    ]).showAsColumn());
                };
                CCF_LayoutPageArea._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_LayoutPageArea());
                return CCF_LayoutPageArea;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_LayoutPageArea = CCF_LayoutPageArea;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_LayoutPosition = (function (_super) {
                __extends(CCF_LayoutPosition, _super);
                function CCF_LayoutPosition() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_LayoutPosition.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.LayoutPosition;
                };
                CCF_LayoutPosition.prototype.getShortDescription = function (_config) {
                    return this.stdShow(new ChromeCustomFormatters.StdProps([
                        new __aspxRichEdit.Pair("lvl", __aspxRichEdit.DocumentLayoutDetailsLevel[this.curr.detailsLevel]),
                        new __aspxRichEdit.Pair("p", this.curr.pageIndex),
                        new __aspxRichEdit.Pair("pa", this.curr.pageAreaIndex),
                        new __aspxRichEdit.Pair("c", this.curr.columnIndex),
                        new __aspxRichEdit.Pair("r", this.curr.rowIndex),
                        new __aspxRichEdit.Pair("b", this.curr.boxIndex),
                        new __aspxRichEdit.Pair("c", this.curr.charOffset)
                    ]).showAsLine());
                };
                CCF_LayoutPosition.prototype.availableFullDescription = function (_config) {
                    return true;
                };
                CCF_LayoutPosition.prototype.getFullDescription = function (_config) {
                    return this.stdShow(new ChromeCustomFormatters.StdProps([
                        new __aspxRichEdit.Pair("detailsLevel", __aspxRichEdit.DocumentLayoutDetailsLevel[this.curr.detailsLevel]),
                        new __aspxRichEdit.Pair("pageInd", this.curr.pageIndex),
                        new __aspxRichEdit.Pair("page", this.curr.page),
                        new __aspxRichEdit.Pair("pageAreaInd", this.curr.pageAreaIndex),
                        new __aspxRichEdit.Pair("pageArea", this.curr.pageArea),
                        new __aspxRichEdit.Pair("columnInd", this.curr.columnIndex),
                        new __aspxRichEdit.Pair("column", this.curr.column),
                        new __aspxRichEdit.Pair("rowInd", this.curr.rowIndex),
                        new __aspxRichEdit.Pair("row", this.curr.row),
                        new __aspxRichEdit.Pair("boxInd", this.curr.boxIndex),
                        new __aspxRichEdit.Pair("box", this.curr.box),
                        new __aspxRichEdit.Pair("charOffset", this.curr.charOffset),
                        new __aspxRichEdit.Pair("char", this.curr.box && this.curr.box.getType() == __aspxRichEdit.LayoutBoxType.Text ? this.curr.box.text.charAt(this.curr.charOffset) : null),
                    ]).showAsColumn());
                };
                CCF_LayoutPosition._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_LayoutPosition());
                return CCF_LayoutPosition;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_LayoutPosition = CCF_LayoutPosition;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_LayoutRow = (function (_super) {
                __extends(CCF_LayoutRow, _super);
                function CCF_LayoutRow() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_LayoutRow.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.LayoutRow;
                };
                CCF_LayoutRow.prototype.getShortDescription = function (_config) {
                    return this.stdShow(new ChromeCustomFormatters.StdProps([
                        new __aspxRichEdit.Pair("offset", this.curr.columnOffset),
                    ]).showAsLine());
                };
                CCF_LayoutRow.prototype.availableFullDescription = function (_config) {
                    return true;
                };
                CCF_LayoutRow.prototype.getFullDescription = function (_config) {
                    return this.stdShow(new ChromeCustomFormatters.StdProps([
                        new __aspxRichEdit.Pair("offset", this.curr.columnOffset),
                        new __aspxRichEdit.Pair("bounds", this.curr.rectangle),
                        new __aspxRichEdit.Pair("boxes", this.curr.boxes),
                        new __aspxRichEdit.Pair("tableCellInfo", this.curr.tableCellInfo),
                        new __aspxRichEdit.Pair("numberingListBox", this.curr.numberingListBox),
                        new __aspxRichEdit.Pair("flags", __aspxRichEdit.Log.mask(__aspxRichEdit.LayoutRowStateFlags, this.curr.flags.getValue(), __aspxRichEdit.LayoutRowStateFlags.NormallyEnd)),
                        new __aspxRichEdit.Pair("bookmarkBoxes", this.curr.bookmarkBoxes),
                        new __aspxRichEdit.Pair("baseLine", this.curr.baseLine),
                    ]).showAsColumn());
                };
                CCF_LayoutRow._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_LayoutRow());
                return CCF_LayoutRow;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_LayoutRow = CCF_LayoutRow;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_PageAnchoredObjectHolder = (function (_super) {
                __extends(CCF_PageAnchoredObjectHolder, _super);
                function CCF_PageAnchoredObjectHolder() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_PageAnchoredObjectHolder.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.PageAnchoredObjectHolder;
                };
                CCF_PageAnchoredObjectHolder.prototype.getShortDescription = function (_config) {
                    return this.stdShow(new ChromeCustomFormatters.StdProps(this.getList()).showAsLine().setStdNumElements());
                };
                CCF_PageAnchoredObjectHolder.prototype.availableFullDescription = function (_config) {
                    return !__aspxRichEdit.MapUtilsKeyAsNumber.isEmpty(this.curr.objects);
                };
                CCF_PageAnchoredObjectHolder.prototype.getFullDescription = function (_config) {
                    return this.stdShow(new ChromeCustomFormatters.StdProps(this.getList()).showAsColumn());
                };
                CCF_PageAnchoredObjectHolder.prototype.getList = function () {
                    return this.mapNumberAsKeyToListOfPairs(this.curr.objects, function (key) { return key; }, function (key, obj) { return new __aspxRichEdit.Pair(key.toString(), obj); });
                };
                CCF_PageAnchoredObjectHolder._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_PageAnchoredObjectHolder());
                return CCF_PageAnchoredObjectHolder;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_PageAnchoredObjectHolder = CCF_PageAnchoredObjectHolder;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_ParagraphFrame = (function (_super) {
                __extends(CCF_ParagraphFrame, _super);
                function CCF_ParagraphFrame() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_ParagraphFrame.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.ParagraphFrame;
                };
                CCF_ParagraphFrame.prototype.getShortDescription = function (_config) {
                    return this.stdShow(new ChromeCustomFormatters.StdProps([
                        new __aspxRichEdit.Pair("color", ChromeCustomFormatters.BaseFormatter.getColorBoxNode(this.curr.paragraphColor)),
                    ]).showAsLine());
                };
                CCF_ParagraphFrame.prototype.availableFullDescription = function (_config) {
                    return true;
                };
                CCF_ParagraphFrame.prototype.getFullDescription = function (_config) {
                    return this.stdShow(new ChromeCustomFormatters.StdProps([
                        new __aspxRichEdit.Pair("color", ChromeCustomFormatters.BaseFormatter.getColorBoxNode(this.curr.paragraphColor)),
                        new __aspxRichEdit.Pair("bounds", this.curr.rectangle),
                    ]).showAsColumn());
                };
                CCF_ParagraphFrame._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_ParagraphFrame());
                return CCF_ParagraphFrame;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_ParagraphFrame = CCF_ParagraphFrame;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_BorderInfo = (function (_super) {
                __extends(CCF_BorderInfo, _super);
                function CCF_BorderInfo() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_BorderInfo.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.BorderInfo;
                };
                CCF_BorderInfo.prototype.getShortDescription = function (_config) {
                    var list = [
                        new __aspxRichEdit.Pair("width", this.curr.width + "(" + __aspxRichEdit.UnitConverter.twipsToPixels(this.curr.width) + "px)"),
                        new __aspxRichEdit.Pair("style", __aspxRichEdit.BorderLineStyle[this.curr.style]),
                        new __aspxRichEdit.Pair("", ChromeCustomFormatters.BaseFormatter.getColorBoxNode(this.model.colorProvider.getRgbaFromModelColor(this.curr.color))),
                    ];
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsLine());
                };
                CCF_BorderInfo.prototype.availableFullDescription = function (_config) {
                    return true;
                };
                CCF_BorderInfo.prototype.getFullDescription = function (_config) {
                    var list = [
                        new __aspxRichEdit.Pair("width", this.curr.width + "(" + __aspxRichEdit.UnitConverter.twipsToPixels(this.curr.width) + "px)"),
                        new __aspxRichEdit.Pair("style", __aspxRichEdit.BorderLineStyle[this.curr.style]),
                        new __aspxRichEdit.Pair("colorIndex", ChromeCustomFormatters.BaseFormatter.getColorBoxNode(this.model.colorProvider.getRgbaFromModelColor(this.curr.color))),
                        new __aspxRichEdit.Pair("frame", this.curr.frame),
                        new __aspxRichEdit.Pair("offset", this.curr.offset),
                        new __aspxRichEdit.Pair("shadow", this.curr.shadow),
                    ];
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsColumn());
                };
                CCF_BorderInfo._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_BorderInfo());
                return CCF_BorderInfo;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_BorderInfo = CCF_BorderInfo;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_CharacterProperties = (function (_super) {
                __extends(CCF_CharacterProperties, _super);
                function CCF_CharacterProperties() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_CharacterProperties.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.CharacterProperties;
                };
                CCF_CharacterProperties.prototype.getShortDescription = function (_config) {
                    var useVal = this.getUseVal();
                    var list = [];
                    if (useVal & __aspxRichEdit.CharacterPropertiesMask.UseHidden)
                        list.push(new __aspxRichEdit.Pair("", this.curr.hidden ? "hidden" : ""));
                    if (useVal & __aspxRichEdit.CharacterPropertiesMask.UseFontName)
                        list.push(new __aspxRichEdit.Pair("f", this.curr.fontInfo));
                    if (useVal & __aspxRichEdit.CharacterPropertiesMask.UseDoubleFontSize)
                        list.push(new __aspxRichEdit.Pair("fSize", this.curr.fontSize));
                    if (useVal & __aspxRichEdit.CharacterPropertiesMask.UseShadingInfoIndex)
                        list.push(new __aspxRichEdit.Pair("bckColor", ChromeCustomFormatters.BaseFormatter.getColorBoxNode(__aspxRichEdit.CharacterProperties.getActualBackgroundColor(this.curr, this.model.colorProvider))));
                    if (this.isMasked())
                        list.push(new __aspxRichEdit.Pair("mask", __aspxRichEdit.Log.mask(__aspxRichEdit.CharacterPropertiesMask, useVal, __aspxRichEdit.CharacterPropertiesMask.UseNone)));
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsLine());
                };
                CCF_CharacterProperties.prototype.availableFullDescription = function (_config) {
                    return true;
                };
                CCF_CharacterProperties.prototype.getFullDescription = function (_config) {
                    var list = [];
                    var useVal = this.getUseVal();
                    if (this.isMasked())
                        list.push(new __aspxRichEdit.Pair("mask", __aspxRichEdit.Log.mask(__aspxRichEdit.CharacterPropertiesMask, useVal, __aspxRichEdit.CharacterPropertiesMask.UseNone)));
                    if (useVal & __aspxRichEdit.CharacterPropertiesMask.UseHidden)
                        list.push(new __aspxRichEdit.Pair("hidden", this.curr.hidden));
                    if (useVal & __aspxRichEdit.CharacterPropertiesMask.UseFontName)
                        list.push(new __aspxRichEdit.Pair("fontInfo", this.curr.fontInfo));
                    if (useVal & __aspxRichEdit.CharacterPropertiesMask.UseDoubleFontSize)
                        list.push(new __aspxRichEdit.Pair("fontSize", this.curr.fontSize));
                    if (useVal & __aspxRichEdit.CharacterPropertiesMask.UseFontBold)
                        list.push(new __aspxRichEdit.Pair("fontBold", this.curr.fontBold));
                    if (useVal & __aspxRichEdit.CharacterPropertiesMask.UseFontItalic)
                        list.push(new __aspxRichEdit.Pair("fontItalic", this.curr.fontItalic));
                    if (useVal & __aspxRichEdit.CharacterPropertiesMask.UseForeColorIndex)
                        list.push(new __aspxRichEdit.Pair("textColor", ChromeCustomFormatters.BaseFormatter.getColorBoxNode(this.curr.textColor.toRgb(this.model.colorProvider))));
                    if (useVal & __aspxRichEdit.CharacterPropertiesMask.UseShadingInfoIndex)
                        list.push(new __aspxRichEdit.Pair("backColor", ChromeCustomFormatters.BaseFormatter.getColorBoxNode(__aspxRichEdit.CharacterProperties.getActualBackgroundColor(this.curr, this.model.colorProvider))));
                    if (useVal & __aspxRichEdit.CharacterPropertiesMask.UseAllCaps)
                        list.push(new __aspxRichEdit.Pair("allCaps", this.curr.allCaps));
                    if (useVal & __aspxRichEdit.CharacterPropertiesMask.UseFontStrikeoutType)
                        list.push(new __aspxRichEdit.Pair("fontStrikeoutType", __aspxRichEdit.StrikeoutType[this.curr.fontStrikeoutType]));
                    if (useVal & __aspxRichEdit.CharacterPropertiesMask.UseFontUnderlineType)
                        list.push(new __aspxRichEdit.Pair("fontUnderlineType", __aspxRichEdit.UnderlineType[this.curr.fontUnderlineType]));
                    if (useVal & __aspxRichEdit.CharacterPropertiesMask.UseNoProof)
                        list.push(new __aspxRichEdit.Pair("noProof", this.curr.noProof));
                    if (useVal & __aspxRichEdit.CharacterPropertiesMask.UseScript)
                        list.push(new __aspxRichEdit.Pair("script", __aspxRichEdit.CharacterFormattingScript[this.curr.script]));
                    if (useVal & __aspxRichEdit.CharacterPropertiesMask.UseStrikeoutColorIndex)
                        list.push(new __aspxRichEdit.Pair("strikeoutColor", ChromeCustomFormatters.BaseFormatter.getColorBoxNode(this.curr.strikeoutColor.toRgb(this.model.colorProvider))));
                    if (useVal & __aspxRichEdit.CharacterPropertiesMask.UseStrikeoutWordsOnly)
                        list.push(new __aspxRichEdit.Pair("strikeoutWordsOnly", this.curr.strikeoutWordsOnly));
                    if (useVal & __aspxRichEdit.CharacterPropertiesMask.UseUnderlineColorIndex)
                        list.push(new __aspxRichEdit.Pair("underlineColor", ChromeCustomFormatters.BaseFormatter.getColorBoxNode(this.curr.underlineColor.toRgb(this.model.colorProvider))));
                    if (useVal & __aspxRichEdit.CharacterPropertiesMask.UseUnderlineWordsOnly)
                        list.push(new __aspxRichEdit.Pair("underlineWordsOnly", this.curr.underlineWordsOnly));
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsColumn());
                };
                CCF_CharacterProperties.prototype.getUseVal = function () {
                    return this.isMasked() ? this.curr.useValue : __aspxRichEdit.CharacterPropertiesMask.UseAll;
                };
                CCF_CharacterProperties.prototype.isMasked = function () {
                    return this.curr.useValue !== undefined;
                };
                CCF_CharacterProperties._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_CharacterProperties());
                return CCF_CharacterProperties;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_CharacterProperties = CCF_CharacterProperties;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_Chunk = (function (_super) {
                __extends(CCF_Chunk, _super);
                function CCF_Chunk() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_Chunk.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.Chunk;
                };
                CCF_Chunk.prototype.getShortDescription = function (_config) {
                    var list = [
                        new __aspxRichEdit.Pair("", "[" + this.curr.startLogPosition.value + ", " + this.curr.textBuffer.length + "]"),
                        new __aspxRichEdit.Pair("", new ChromeCustomFormatters.ShortString(this.curr.textBuffer, 20)),
                    ];
                    if (this.curr.isLast)
                        list.push(new __aspxRichEdit.Pair("", "last"));
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsLine());
                };
                CCF_Chunk.prototype.availableFullDescription = function (_config) {
                    return true;
                };
                CCF_Chunk.prototype.getFullDescription = function (_config) {
                    var list = [
                        new __aspxRichEdit.Pair("startPos", this.curr.startLogPosition.value),
                        new __aspxRichEdit.Pair("endPos", this.curr.getEndPosition()),
                        new __aspxRichEdit.Pair("length", this.curr.textBuffer.length),
                        new __aspxRichEdit.Pair("runs", this.curr.textRuns),
                        new __aspxRichEdit.Pair("text", this.getRawText(this.curr.textBuffer).setLen(30)),
                    ];
                    if (this.curr.isLast)
                        list.push(new __aspxRichEdit.Pair("isLast", this.curr.isLast));
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsColumn());
                };
                CCF_Chunk._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_Chunk());
                return CCF_Chunk;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_Chunk = CCF_Chunk;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_Field = (function (_super) {
                __extends(CCF_Field, _super);
                function CCF_Field() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_Field.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.Field;
                };
                CCF_Field.prototype.getShortDescription = function (_config) {
                    var list = [
                        new __aspxRichEdit.Pair("", this.curr.index + ":"),
                        new __aspxRichEdit.Pair("", this.curr.showCode ? "showCode" : "showRes"),
                        new __aspxRichEdit.Pair("", this.curr.getFieldStartPosition() + "[" + this.curr.getSeparatorPosition() + "|]" + this.curr.getFieldEndPosition())
                    ];
                    if (this.curr.isHyperlinkField())
                        list.push(new __aspxRichEdit.Pair("", "hyperl"));
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsLine());
                };
                CCF_Field.prototype.availableFullDescription = function (_config) {
                    return true;
                };
                CCF_Field.prototype.getFullDescription = function (_config) {
                    var list = [new __aspxRichEdit.Pair("index", this.curr.index)];
                    if (this.curr.parent)
                        list.push(new __aspxRichEdit.Pair("parentInd", this.curr.parent.index));
                    list.push(new __aspxRichEdit.Pair("isShowCode", this.curr.showCode));
                    if (this.curr.isHyperlinkField()) {
                        var hypInfo = this.curr.getHyperlinkInfo();
                        list.push(new __aspxRichEdit.Pair("anchor", hypInfo.anchor));
                        list.push(new __aspxRichEdit.Pair("tip", hypInfo.tip));
                        list.push(new __aspxRichEdit.Pair("uri", hypInfo.uri));
                        list.push(new __aspxRichEdit.Pair("visited", hypInfo.visited));
                    }
                    list.push(new __aspxRichEdit.Pair("intervals", "(" + this.curr.getFieldStartPosition() + ")[code(" + this.curr.getSeparatorPosition() + ")|result](" + this.curr.getFieldEndPosition() + ")"));
                    list.push(new __aspxRichEdit.Pair("text", "[" + this.getSubDocument().getText(this.curr.getCodeInterval()) + "|" + this.getSubDocument().getText(this.curr.getResultInterval()) + "]"));
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsColumn());
                };
                CCF_Field.prototype.getSubDocument = function () {
                    var _this = this;
                    return __aspxRichEdit.MapUtilsKeyAsNumber.elementBy(this.model.subDocuments, function (subD) { return subD.fields[_this.curr.index] ? subD.fields[_this.curr.index] === _this.curr : null; });
                };
                CCF_Field._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_Field());
                return CCF_Field;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_Field = CCF_Field;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_FixedInterval = (function (_super) {
                __extends(CCF_FixedInterval, _super);
                function CCF_FixedInterval() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_FixedInterval.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.FixedInterval;
                };
                CCF_FixedInterval.prototype.getShortDescription = function (_config) {
                    var list = [
                        new __aspxRichEdit.Pair("", "[" + this.curr.start + ", " + this.curr.end + "]"),
                    ];
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsLine());
                };
                CCF_FixedInterval.prototype.availableFullDescription = function (_config) {
                    return this.curr.length > 1;
                };
                CCF_FixedInterval.prototype.getFullDescription = function (_config) {
                    var list = [
                        new __aspxRichEdit.Pair("start", this.curr.start),
                        new __aspxRichEdit.Pair("end", this.curr.end),
                        new __aspxRichEdit.Pair("length", this.curr.length),
                    ];
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsColumn());
                };
                CCF_FixedInterval._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_FixedInterval());
                return CCF_FixedInterval;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_FixedInterval = CCF_FixedInterval;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_Paragraph = (function (_super) {
                __extends(CCF_Paragraph, _super);
                function CCF_Paragraph() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_Paragraph.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.Paragraph;
                };
                CCF_Paragraph.prototype.getShortDescription = function (_config) {
                    return this.stdShow(new ChromeCustomFormatters.StdProps([
                        new __aspxRichEdit.Pair("pos", this.curr.startLogPosition.value),
                        new __aspxRichEdit.Pair("len", this.curr.length),
                    ]).showAsLine());
                };
                CCF_Paragraph.prototype.availableFullDescription = function (_config) {
                    return true;
                };
                CCF_Paragraph.prototype.getFullDescription = function (_config) {
                    return this.stdShow(new ChromeCustomFormatters.StdProps([
                        new __aspxRichEdit.Pair("position", this.curr.startLogPosition.value),
                        new __aspxRichEdit.Pair("length", this.curr.length),
                        new __aspxRichEdit.Pair("endPos", this.curr.getEndPosition()),
                        new __aspxRichEdit.Pair("numberingListIndex", this.curr.numberingListIndex),
                        new __aspxRichEdit.Pair("listLevelIndex", this.curr.listLevelIndex),
                        new __aspxRichEdit.Pair("maskedParagraphProperties", this.curr.maskedParagraphProperties),
                        new __aspxRichEdit.Pair("tabs", this.curr.tabs),
                        new __aspxRichEdit.Pair("subDocument", this.curr.subDocument),
                        new __aspxRichEdit.Pair("text", this.getSubDocumentText(this.curr.subDocument.id, this.curr.interval).setLen(60)),
                    ]).showAsColumn());
                };
                CCF_Paragraph._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_Paragraph());
                return CCF_Paragraph;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_Paragraph = CCF_Paragraph;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_RunBase = (function (_super) {
                __extends(CCF_RunBase, _super);
                function CCF_RunBase() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_RunBase.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.RunBase;
                };
                CCF_RunBase.prototype.getShortDescription = function (_config) {
                    var list = [
                        new __aspxRichEdit.Pair("", __aspxRichEdit.RunType[this.curr.getType()]),
                        new __aspxRichEdit.Pair("", "[" + this.curr.startOffset + ", " + (this.curr.startOffset + this.curr.getLength()) + "]"),
                    ];
                    if (this.curr.getType() == __aspxRichEdit.RunType.TextRun)
                        list.push(new __aspxRichEdit.Pair("", new ChromeCustomFormatters.ShortString(this.getText())));
                    if (this.curr.getType() == __aspxRichEdit.RunType.AnchoredPictureRun || this.curr.getType() == __aspxRichEdit.RunType.InlinePictureRun) {
                        var r = this.curr;
                        var size = new __aspxRichEdit.Size(__aspxRichEdit.UnitConverter.twipsToPixels(r.size.getActualWidth()), __aspxRichEdit.UnitConverter.twipsToPixels(r.size.getActualHeight()));
                        list.push(new __aspxRichEdit.Pair("", this.getPictureNode(r.id, size)));
                    }
                    if (this.curr.getType() == __aspxRichEdit.RunType.AnchoredTextBoxRun)
                        list.push(new __aspxRichEdit.Pair("txt", this.getSubDocumentText(this.curr.subDocId)));
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsLine());
                };
                CCF_RunBase.prototype.availableFullDescription = function (_config) {
                    return true;
                };
                CCF_RunBase.prototype.getFullDescription = function (_config) {
                    var list = [
                        new __aspxRichEdit.Pair("type", __aspxRichEdit.RunType[this.curr.getType()]),
                        new __aspxRichEdit.Pair("offset", this.curr.startOffset),
                        new __aspxRichEdit.Pair("endOffset", this.curr.startOffset + this.curr.getLength()),
                        new __aspxRichEdit.Pair("length", this.curr.getLength()),
                        new __aspxRichEdit.Pair("maskedCharacterProperties", this.curr.maskedCharacterProperties),
                        new __aspxRichEdit.Pair("mergedCharacterProperies", this.curr.getCharacterMergedProperies()),
                        new __aspxRichEdit.Pair("charStyle", this.curr.characterStyle),
                        new __aspxRichEdit.Pair("paragraph", this.curr.paragraph),
                    ];
                    switch (this.curr.getType()) {
                        case __aspxRichEdit.RunType.TextRun:
                            list.push(new __aspxRichEdit.Pair("text", new ChromeCustomFormatters.ShortString(this.getText())));
                            break;
                        case __aspxRichEdit.RunType.InlinePictureRun: {
                            list.push(new __aspxRichEdit.Pair("nextPublicAPIId", __aspxRichEdit.InlinePictureRun.nextPublicAPIId));
                            this.addPicRunInfo(list);
                            break;
                        }
                        case __aspxRichEdit.RunType.AnchoredPictureRun: {
                            this.addPicRunInfo(list);
                            this.addAnchorInfo(list);
                            break;
                        }
                        case __aspxRichEdit.RunType.InlineTextBoxRun: {
                            var r_1 = this.curr;
                            this.addTextBoxRunInfo(list);
                            list.push(new __aspxRichEdit.Pair("size", r_1.size));
                            var subDoc = this.model.subDocuments[r_1.subDocId];
                            list.push(new __aspxRichEdit.Pair("textOfInnerSubDocument", new ChromeCustomFormatters.ShortString(subDoc.getText(new __aspxRichEdit.FixedInterval(0, subDoc.getDocumentEndPosition())))));
                            break;
                        }
                        case __aspxRichEdit.RunType.AnchoredTextBoxRun:
                            var r = this.curr;
                            this.addTextBoxRunInfo(list);
                            this.addAnchorInfo(list);
                            list.push(new __aspxRichEdit.Pair("size", r.size));
                            list.push(new __aspxRichEdit.Pair("textOfInnerSubDocument", this.getSubDocumentText(r.subDocId)));
                            break;
                        case __aspxRichEdit.RunType.EndNoteRun:
                            break;
                        case __aspxRichEdit.RunType.FieldCodeEndRun:
                            break;
                        case __aspxRichEdit.RunType.FieldCodeStartRun:
                            break;
                        case __aspxRichEdit.RunType.FieldResultEndRun:
                            break;
                        case __aspxRichEdit.RunType.FootNoteRun:
                            break;
                        case __aspxRichEdit.RunType.LayoutDependentRun:
                            break;
                        case __aspxRichEdit.RunType.ParagraphRun:
                            break;
                        case __aspxRichEdit.RunType.SectionRun:
                            break;
                        case __aspxRichEdit.RunType.Undefined:
                            break;
                        default: throw new Error(__aspxRichEdit.Errors.NotImplemented);
                    }
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsColumn());
                };
                CCF_RunBase.prototype.addPicRunInfo = function (list) {
                    var r = this.curr;
                    list.push(new __aspxRichEdit.Pair("id", r.id));
                    list.push(new __aspxRichEdit.Pair("size", r.size));
                    list.push(new __aspxRichEdit.Pair("isLoaded", r.isLoaded));
                    list.push(new __aspxRichEdit.Pair("shape", r.shape));
                    list.push(new __aspxRichEdit.Pair("", this.getPictureNode(r.id, new __aspxRichEdit.Size(r.size.getActualWidth(), r.size.getActualHeight()))));
                };
                CCF_RunBase.prototype.addTextBoxRunInfo = function (list) {
                    var r = this.curr;
                    list.push(new __aspxRichEdit.Pair("subDocId", r.subDocId));
                    list.push(new __aspxRichEdit.Pair("textBoxProperties", r.textBoxProperties));
                    list.push(new __aspxRichEdit.Pair("shape", r.shape));
                };
                CCF_RunBase.prototype.addAnchorInfo = function (list) {
                    var r = this.curr;
                    list.push(new __aspxRichEdit.Pair("anchoredObjectID", r.anchoredObjectID));
                    list.push(new __aspxRichEdit.Pair("anchorInfo", r.anchorInfo));
                };
                CCF_RunBase.prototype.getText = function () {
                    return this.getChunk().textBuffer.substr(this.curr.startOffset, this.curr.getLength());
                };
                CCF_RunBase.prototype.getChunk = function () {
                    var _this = this;
                    return __aspxRichEdit.MapUtilsKeyAsNumber.anyOf(this.model.subDocuments, function (subD) {
                        return __aspxRichEdit.ListUtils.elementBy(subD.chunks, function (chunk) { return !!__aspxRichEdit.ListUtils.elementBy(chunk.textRuns, function (run) { return run === _this.curr; }); });
                    });
                };
                CCF_RunBase._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_RunBase());
                return CCF_RunBase;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_RunBase = CCF_RunBase;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_SubDocument = (function (_super) {
                __extends(CCF_SubDocument, _super);
                function CCF_SubDocument() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_SubDocument.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.SubDocument;
                };
                CCF_SubDocument.prototype.getShortDescription = function (_config) {
                    return this.stdShow(new ChromeCustomFormatters.StdProps([
                        new __aspxRichEdit.Pair("id", this.curr.id),
                        new __aspxRichEdit.Pair("type", __aspxRichEdit.SubDocumentInfoType[this.curr.info.getType()])
                    ]).showAsLine());
                };
                CCF_SubDocument.prototype.availableFullDescription = function (_config) {
                    return true;
                };
                CCF_SubDocument.prototype.getFullDescription = function (_config) {
                    return this.stdShow(new ChromeCustomFormatters.StdProps([
                        new __aspxRichEdit.Pair("id", this.curr.id),
                        new __aspxRichEdit.Pair("type", __aspxRichEdit.SubDocumentInfoType[this.curr.info.getType()]),
                        new __aspxRichEdit.Pair("endPos", this.curr.getDocumentEndPosition()),
                        new __aspxRichEdit.Pair("paragraphs", this.curr.paragraphs),
                        new __aspxRichEdit.Pair("chunks", this.curr.chunks),
                        new __aspxRichEdit.Pair("fields", this.curr.fields),
                        new __aspxRichEdit.Pair("tables", this.curr.tables),
                        new __aspxRichEdit.Pair("rangePermissions", this.curr.rangePermissions),
                        new __aspxRichEdit.Pair("tablesByLevels", this.curr.tablesByLevels),
                        new __aspxRichEdit.Pair("text", this.getSubDocumentText(this.curr.id).setLen(60)),
                        new __aspxRichEdit.Pair("bookmarks", this.curr.bookmarks),
                        new __aspxRichEdit.Pair("positionManager", this.curr.positionManager),
                    ]).showAsColumn());
                };
                CCF_SubDocument._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_SubDocument());
                return CCF_SubDocument;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_SubDocument = CCF_SubDocument;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var GeomLine = (function () {
        function GeomLine() {
        }
        Object.defineProperty(GeomLine.prototype, "a", {
            get: function () {
                return this.pa;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(GeomLine.prototype, "b", {
            get: function () {
                return this.pb;
            },
            enumerable: true,
            configurable: true
        });
        GeomLine.prototype.init = function (pa, pb) {
            this.pa = pa;
            this.pb = pb;
            return this;
        };
        Object.defineProperty(GeomLine.prototype, "lengthByX", {
            get: function () {
                return this.pb.x - this.pa.x;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(GeomLine.prototype, "lengthByY", {
            get: function () {
                return this.pb.y - this.pa.y;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(GeomLine.prototype, "length", {
            get: function () {
                return Math.sqrt(Math.pow(this.lengthByX, 2) + Math.pow(this.lengthByY, 2));
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(GeomLine.prototype, "vector", {
            get: function () {
                return new __aspxRichEdit.Vector(this.lengthByX, this.lengthByY);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(GeomLine.prototype, "center", {
            get: function () {
                return new __aspxRichEdit.Point(this.lengthByX / 2, this.lengthByY / 2);
            },
            enumerable: true,
            configurable: true
        });
        return GeomLine;
    }());
    __aspxRichEdit.GeomLine = GeomLine;
    var LineEquation = (function (_super) {
        __extends(LineEquation, _super);
        function LineEquation() {
            return _super !== null && _super.apply(this, arguments) || this;
        }
        LineEquation.prototype.init = function (pa, pb) {
            _super.prototype.init.call(this, pa, pb);
            this.initEquationParams();
            return this;
        };
        LineEquation.intersection = function (a, b) {
            var A1 = a.A;
            var B1 = a.B;
            var C1 = a.C;
            var A2 = b.A;
            var B2 = b.B;
            var C2 = b.C;
            var v = A2 * B1 - A1 * B2;
            if (__aspxRichEdit.Utils.numberCloseTo(v, 0))
                return null;
            if (A1 == 0) {
                var x = (B2 * C1 - C2 * B1) / (B1 * A2);
                return new __aspxRichEdit.Point(x, -C1 / B1);
            }
            var y = (C2 * A1 - C1 * A2) / v;
            return new __aspxRichEdit.Point((-B1 * y - C1) / A1, y);
        };
        LineEquation.prototype.initEquationParams = function () {
            this.A = this.pb.y - this.pa.y;
            this.B = this.pa.x - this.pb.x;
            this.C = this.pb.x * this.pa.y - this.pa.x * this.pb.y;
        };
        return LineEquation;
    }(GeomLine));
    __aspxRichEdit.LineEquation = LineEquation;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Parallelogram = (function () {
        function Parallelogram() {
        }
        Object.defineProperty(Parallelogram.prototype, "lengthSideA", {
            get: function () {
                return new __aspxRichEdit.GeomLine().init(this.points[0], this.points[1]).length;
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Parallelogram.prototype, "lengthSideB", {
            get: function () {
                return new __aspxRichEdit.GeomLine().init(this.points[1], this.points[2]).length;
            },
            enumerable: true,
            configurable: true
        });
        Parallelogram.prototype.angleRelativeAxisX = function (rightSC, byClockwise) {
            if (rightSC === void 0) { rightSC = false; }
            if (byClockwise === void 0) { byClockwise = true; }
            var vec = new __aspxRichEdit.GeomLine().init(this.points[0], this.points[1]).vector;
            var angle = __aspxRichEdit.Vector.angleBetween(__aspxRichEdit.Vector.axisX, vec);
            return __aspxRichEdit.Utils.boolToInt(rightSC) ^ __aspxRichEdit.Utils.boolToInt(byClockwise) ?
                (vec.y >= 0 ? angle : Math.PI * 2 - angle) :
                (vec.y <= 0 ? angle : Math.PI * 2 - angle);
        };
        Parallelogram.prototype.init = function (points) {
            this.points = points;
            return this;
        };
        Object.defineProperty(Parallelogram.prototype, "rectangle", {
            get: function () {
                return new __aspxRichEdit.Rectangle().init(this.points[0].x, this.points[0].y, this.points[3].x - this.points[0].x, this.points[3].y - this.points[0].y);
            },
            enumerable: true,
            configurable: true
        });
        Parallelogram.prototype.rotateAroundCenter = function (fiInRadians, rightSC, byClockwise) {
            if (rightSC === void 0) { rightSC = false; }
            if (byClockwise === void 0) { byClockwise = true; }
            var center = this.center;
            this.changeCoordinateCenterTo(center);
            var sinFi = Math.sin(fiInRadians);
            var cosFi = Math.cos(fiInRadians);
            var sign = __aspxRichEdit.Utils.boolToInt(rightSC) ^ __aspxRichEdit.Utils.boolToInt(byClockwise) ? -1 : 1;
            __aspxRichEdit.ListUtils.foreach(this.points, function (rp) {
                return rp.copyFrom(new __aspxRichEdit.Point(rp.x * cosFi + sign * rp.y * sinFi, -sign * rp.x * sinFi + rp.y * cosFi));
            });
            this.changeCoordinateCenterTo(center.applyMultiplier(-1, -1));
            return this;
        };
        Object.defineProperty(Parallelogram.prototype, "center", {
            get: function () {
                return new __aspxRichEdit.GeomLine().init(this.points[0], this.points[2]).center;
            },
            enumerable: true,
            configurable: true
        });
        Parallelogram.prototype.changeCoordinateCenterTo = function (p) {
            var offset = p.clone().applyMultiplier(-1, -1);
            __aspxRichEdit.ListUtils.foreach(this.points, function (rp) { return rp.applyOffset(offset); });
            return this;
        };
        Object.defineProperty(Parallelogram.prototype, "check", {
            get: function () {
                var c1 = this.center;
                var c2 = new __aspxRichEdit.GeomLine().init(this.points[1], this.points[3]).center;
                return __aspxRichEdit.Utils.numberCloseTo(c1.x, c2.x) && __aspxRichEdit.Utils.numberCloseTo(c1.y, c2.y);
            },
            enumerable: true,
            configurable: true
        });
        return Parallelogram;
    }());
    __aspxRichEdit.Parallelogram = Parallelogram;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Polygon = (function () {
        function Polygon() {
        }
        Object.defineProperty(Polygon.prototype, "edges", {
            get: function () {
                return this.points.length;
            },
            enumerable: true,
            configurable: true
        });
        Polygon.prototype.getEdge = function (edgeIndex) {
            return new __aspxRichEdit.Vector().initByPoint(this.points[edgeIndex], this.points[(edgeIndex + 1) % this.edges]);
        };
        Polygon.prototype.init = function (points, center) {
            this.points = points;
            this.center = center;
            return this;
        };
        Object.defineProperty(Polygon.prototype, "bounds", {
            get: function () {
                var top = __aspxRichEdit.ListUtils.min(this.points, __aspxRichEdit.CompareUtils.pointYComparer).y;
                var left = __aspxRichEdit.ListUtils.min(this.points, __aspxRichEdit.CompareUtils.pointXComparer).x;
                var right = __aspxRichEdit.ListUtils.max(this.points, __aspxRichEdit.CompareUtils.pointXComparer).x;
                var bottom = __aspxRichEdit.ListUtils.max(this.points, __aspxRichEdit.CompareUtils.pointYComparer).y;
                return new __aspxRichEdit.Rectangle().init(left, top, right - left, bottom - top);
            },
            enumerable: true,
            configurable: true
        });
        Polygon.prototype.applyMarginsOutside = function (_margins) {
        };
        Polygon.prototype.rotateAround = function (point, angle, rightSC, byClockwise) {
            if (rightSC === void 0) { rightSC = false; }
            if (byClockwise === void 0) { byClockwise = true; }
            var center = point.clone();
            this.changeCoordinateCenterTo(center);
            var sinFi = Math.sin(angle);
            var cosFi = Math.cos(angle);
            var sign = __aspxRichEdit.Utils.boolToInt(rightSC) ^ __aspxRichEdit.Utils.boolToInt(byClockwise) ? -1 : 1;
            __aspxRichEdit.ListUtils.foreach(this.points, function (rp) {
                return rp.copyFrom(new __aspxRichEdit.Point(rp.x * cosFi + sign * rp.y * sinFi, -sign * rp.x * sinFi + rp.y * cosFi));
            });
            this.changeCoordinateCenterTo(center.applyMultiplier(-1, -1));
            return this;
        };
        Polygon.prototype.changeCoordinateCenterTo = function (p) {
            var offset = p.clone().applyMultiplier(-1, -1);
            __aspxRichEdit.ListUtils.foreach(this.points, function (rp) { return rp.applyOffset(offset); });
            return this;
        };
        Polygon.prototype.projection = function (axis) {
            return __aspxRichEdit.ListUtils.minMaxExtended(this.points, function (p) { return __aspxRichEdit.Vector.scalarProduct(p, axis); });
        };
        Polygon.collision = function (a, b) {
            var edgeCountA = a.edges;
            var edgeCountB = b.edges;
            var intersect = false;
            for (var edgeIndex = 0; edgeIndex < edgeCountA + edgeCountB; edgeIndex++) {
                var edge = edgeIndex < edgeCountA ? a.getEdge(edgeIndex) : b.getEdge(edgeIndex - edgeCountA);
                var axis = new __aspxRichEdit.Vector(-edge.y, edge.x).normalize();
                var projectionA = a.projection(axis);
                var projectionB = b.projection(axis);
                var intersectionOfProjection = projectionA.minValue < projectionB.minValue ?
                    projectionB.minValue - projectionA.maxValue :
                    projectionA.minValue - projectionB.maxValue;
                if (intersectionOfProjection > 0)
                    return CollisionResult.None;
                if (intersectionOfProjection < 0)
                    intersect = true;
            }
            return intersect ? CollisionResult.Intersect : CollisionResult.Contact;
        };
        return Polygon;
    }());
    __aspxRichEdit.Polygon = Polygon;
    var CollisionResult;
    (function (CollisionResult) {
        CollisionResult[CollisionResult["None"] = 0] = "None";
        CollisionResult[CollisionResult["Intersect"] = 1] = "Intersect";
        CollisionResult[CollisionResult["Contact"] = 2] = "Contact";
    })(CollisionResult = __aspxRichEdit.CollisionResult || (__aspxRichEdit.CollisionResult = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var Vector = (function () {
        function Vector(x, y) {
            if (x === void 0) { x = 0; }
            if (y === void 0) { y = 0; }
            this.x = x;
            this.y = y;
        }
        Vector.prototype.initByPoint = function (a, b) {
            this.x = b.x - a.x;
            this.y = b.y - a.y;
            return this;
        };
        Object.defineProperty(Vector.prototype, "length", {
            get: function () {
                return Math.sqrt(Math.pow(this.x, 2) + Math.pow(this.y, 2));
            },
            enumerable: true,
            configurable: true
        });
        Vector.prototype.normalize = function () {
            var length = this.length;
            this.x /= length;
            this.y /= length;
            return this;
        };
        Object.defineProperty(Vector, "axisX", {
            get: function () {
                return new Vector(1, 0);
            },
            enumerable: true,
            configurable: true
        });
        Object.defineProperty(Vector, "axisY", {
            get: function () {
                return new Vector(0, 1);
            },
            enumerable: true,
            configurable: true
        });
        Vector.angleBetween = function (a, b) {
            var cosFi = Vector.scalarProduct(a, b) / (a.length * b.length);
            return Math.acos(cosFi);
        };
        Vector.scalarProduct = function (a, b) {
            return a.x * b.x + a.y * b.y;
        };
        return Vector;
    }());
    __aspxRichEdit.Vector = Vector;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutWordEndBoundsIterator = (function (_super) {
        __extends(LayoutWordEndBoundsIterator, _super);
        function LayoutWordEndBoundsIterator(layout, subDocument, selection, startPosition) {
            var _this = this;
            var endPosition = subDocument.isMain() ?
                layout.getLastValidPage().getEndPosition() :
                layout.pages[selection.pageIndex].otherPageAreas[subDocument.id].getEndPosition();
            _this = _super.call(this, layout, subDocument, selection, startPosition, endPosition) || this;
            if (startPosition >= endPosition) {
                _this.isInitOk = false;
                _this.startResultPosition = endPosition;
            }
            return _this;
        }
        LayoutWordEndBoundsIterator.prototype.moveIterator = function () {
            return this.boxIterator.moveNext(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
        };
        LayoutWordEndBoundsIterator.prototype.nextCallsSetCharOffset = function () {
            this.charOffset++;
            return this.charOffset < this.boxIterator.position.box.getLength();
        };
        LayoutWordEndBoundsIterator.prototype.setCharacterOffsetOnNextCalls = function () {
            this.charOffset = this.boxIterator.position.charOffset;
        };
        LayoutWordEndBoundsIterator.prototype.needExcessMoveBoxIterator = function () {
            return false;
        };
        return LayoutWordEndBoundsIterator;
    }(__aspxRichEdit.LayoutWordBoundsIterator));
    __aspxRichEdit.LayoutWordEndBoundsIterator = LayoutWordEndBoundsIterator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutWordStartBoundsIterator = (function (_super) {
        __extends(LayoutWordStartBoundsIterator, _super);
        function LayoutWordStartBoundsIterator(layout, subDocument, selection, startPosition) {
            var _this = this;
            var firstPagePosition = layout.pages[0].getPosition();
            _this = _super.call(this, layout, subDocument, selection, firstPagePosition, startPosition) || this;
            if (startPosition <= firstPagePosition) {
                _this.startResultPosition = 0;
                _this.isInitOk = false;
                return;
            }
            var endPosLastValigPage = subDocument.isMain() ?
                layout.getLastValidPage().getEndPosition() :
                layout.pages[selection.pageIndex].otherPageAreas[subDocument.id].getEndPosition();
            if (startPosition >= endPosLastValigPage) {
                _this.startResultPosition = endPosLastValigPage;
                _this.isInitOk = false;
            }
            return _this;
        }
        LayoutWordStartBoundsIterator.prototype.moveIterator = function () {
            return this.boxIterator.movePrev(new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false), new __aspxRichEdit.LayoutPositionCreatorConflictFlags().setDefault(false));
        };
        LayoutWordStartBoundsIterator.prototype.nextCallsSetCharOffset = function () {
            this.charOffset--;
            return this.charOffset >= 0;
        };
        LayoutWordStartBoundsIterator.prototype.setCharacterOffsetOnNextCalls = function () {
            this.charOffset = this.boxIterator.position.box.getLength() - 1;
        };
        LayoutWordStartBoundsIterator.prototype.needExcessMoveBoxIterator = function () {
            return this.boxIterator.position.charOffset != 0;
        };
        return LayoutWordStartBoundsIterator;
    }(__aspxRichEdit.LayoutWordBoundsIterator));
    __aspxRichEdit.LayoutWordStartBoundsIterator = LayoutWordStartBoundsIterator;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONAnchorTextBoxSizeConverterConverter = (function () {
        function JSONAnchorTextBoxSizeConverterConverter() {
        }
        JSONAnchorTextBoxSizeConverterConverter.convertFromJSON = function (obj) {
            var relativeSizeType = __aspxRichEdit.SizeExporter.convertFromJSON(obj[__aspxRichEdit.JSONAnchorTextBoxSize.RelativeSizeType]);
            var useAbsoluteSize = __aspxRichEdit.SizeExporter.convertFromJSON(obj[__aspxRichEdit.JSONAnchorTextBoxSize.UseAbsoluteSize]);
            return new __aspxRichEdit.AnchorTextBoxSize(!!obj[__aspxRichEdit.JSONAnchorInlineBaseSize.LockAspectRatio], obj[__aspxRichEdit.JSONAnchorInlineBaseSize.Rotation], __aspxRichEdit.SizeExporter.convertFromJSON(obj[__aspxRichEdit.JSONAnchorTextBoxSize.AbsoluteSize]), __aspxRichEdit.SizeExporter.convertFromJSON(obj[__aspxRichEdit.JSONAnchorTextBoxSize.RelativeSize]), relativeSizeType.width, relativeSizeType.height, !!useAbsoluteSize.width, !!useAbsoluteSize.height);
        };
        JSONAnchorTextBoxSizeConverterConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONAnchorInlineBaseSize.LockAspectRatio] = __aspxRichEdit.Utils.boolToInt(source.lockAspectRatio);
            result[__aspxRichEdit.JSONAnchorInlineBaseSize.Rotation] = source.rotation;
            result[__aspxRichEdit.JSONAnchorTextBoxSize.AbsoluteSize] = __aspxRichEdit.SizeExporter.convertToJSON(source.absoluteSize);
            result[__aspxRichEdit.JSONAnchorTextBoxSize.RelativeSize] = __aspxRichEdit.SizeExporter.convertToJSON(source.relativeSize);
            result[__aspxRichEdit.JSONAnchorTextBoxSize.RelativeSizeType] = __aspxRichEdit.SizeExporter.convertToJSONSeparately(source.relativeWidthType, source.relativeHeightType);
            result[__aspxRichEdit.JSONAnchorTextBoxSize.UseAbsoluteSize] = __aspxRichEdit.SizeExporter.convertToJSONSeparately(__aspxRichEdit.Utils.boolToInt(source.useAbsoluteWidth()), __aspxRichEdit.Utils.boolToInt(source.useAbsoluteHeight()));
            return result;
        };
        return JSONAnchorTextBoxSizeConverterConverter;
    }());
    __aspxRichEdit.JSONAnchorTextBoxSizeConverterConverter = JSONAnchorTextBoxSizeConverterConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONInlinePictureSizeConverterConverter = (function () {
        function JSONInlinePictureSizeConverterConverter() {
        }
        JSONInlinePictureSizeConverterConverter.convertFromJSON = function (obj) {
            return new __aspxRichEdit.PictureSize(!!obj[__aspxRichEdit.JSONAnchorInlineBaseSize.LockAspectRatio], obj[__aspxRichEdit.JSONAnchorInlineBaseSize.Rotation], __aspxRichEdit.SizeExporter.convertFromJSON(obj[__aspxRichEdit.JSONPictureSize.OriginalSize]), __aspxRichEdit.SizeExporter.convertFromJSON(obj[__aspxRichEdit.JSONPictureSize.Scale]));
        };
        JSONInlinePictureSizeConverterConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONAnchorInlineBaseSize.LockAspectRatio] = __aspxRichEdit.Utils.boolToInt(source.lockAspectRatio);
            result[__aspxRichEdit.JSONAnchorInlineBaseSize.Rotation] = source.rotation;
            result[__aspxRichEdit.JSONPictureSize.OriginalSize] = __aspxRichEdit.SizeExporter.convertToJSON(source.originalSize);
            result[__aspxRichEdit.JSONPictureSize.Scale] = __aspxRichEdit.SizeExporter.convertToJSON(source.scale);
            return result;
        };
        return JSONInlinePictureSizeConverterConverter;
    }());
    __aspxRichEdit.JSONInlinePictureSizeConverterConverter = JSONInlinePictureSizeConverterConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var JSONInlineTextBoxSizeConverterConverter = (function () {
        function JSONInlineTextBoxSizeConverterConverter() {
        }
        JSONInlineTextBoxSizeConverterConverter.convertFromJSON = function (obj) {
            return new __aspxRichEdit.InlineTextBoxSize(!!obj[__aspxRichEdit.JSONAnchorInlineBaseSize.LockAspectRatio], obj[__aspxRichEdit.JSONAnchorInlineBaseSize.Rotation], __aspxRichEdit.SizeExporter.convertFromJSON(obj[__aspxRichEdit.JSONInlineTextBoxSize.AbsoluteSize]));
        };
        JSONInlineTextBoxSizeConverterConverter.convertToJSON = function (source) {
            var result = {};
            result[__aspxRichEdit.JSONAnchorInlineBaseSize.LockAspectRatio] = __aspxRichEdit.Utils.boolToInt(source.lockAspectRatio);
            result[__aspxRichEdit.JSONAnchorInlineBaseSize.Rotation] = source.rotation;
            result[__aspxRichEdit.JSONInlineTextBoxSize.AbsoluteSize] = __aspxRichEdit.SizeExporter.convertToJSON(source.absoluteSize);
            return result;
        };
        return JSONInlineTextBoxSizeConverterConverter;
    }());
    __aspxRichEdit.JSONInlineTextBoxSizeConverterConverter = JSONInlineTextBoxSizeConverterConverter;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutAreaSelectionChange = (function (_super) {
        __extends(LayoutAreaSelectionChange, _super);
        function LayoutAreaSelectionChange(index, changeType, selection) {
            var _this = _super.call(this, index, changeType) || this;
            _this.selection = selection;
            return _this;
        }
        LayoutAreaSelectionChange.prototype.reduceChanges = function () {
            throw new Error(__aspxRichEdit.Errors.InternalException);
        };
        return LayoutAreaSelectionChange;
    }(__aspxRichEdit.LayoutChangeBase));
    __aspxRichEdit.LayoutAreaSelectionChange = LayoutAreaSelectionChange;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutPageSelectionChange = (function (_super) {
        __extends(LayoutPageSelectionChange, _super);
        function LayoutPageSelectionChange(index, changeType, areaChanges) {
            if (areaChanges === void 0) { areaChanges = []; }
            var _this = _super.call(this, index, changeType) || this;
            _this.areaChanges = areaChanges;
            return _this;
        }
        LayoutPageSelectionChange.prototype.reduceChanges = function () {
            throw new Error(__aspxRichEdit.Errors.InternalException);
        };
        return LayoutPageSelectionChange;
    }(__aspxRichEdit.LayoutChangeBase));
    __aspxRichEdit.LayoutPageSelectionChange = LayoutPageSelectionChange;
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var ColumnInterval = (function () {
                function ColumnInterval(interval) {
                    this.width = interval.type == __aspxRichEdit.TableWidthUnitType.ModelUnits ? __aspxRichEdit.UnitConverter.twipsToPixels(interval.width) : interval.width;
                    this.type = interval.type;
                }
                return ColumnInterval;
            }());
            Table.ColumnInterval = ColumnInterval;
            var ColumnIntervalFixed = (function (_super) {
                __extends(ColumnIntervalFixed, _super);
                function ColumnIntervalFixed() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                return ColumnIntervalFixed;
            }(ColumnInterval));
            Table.ColumnIntervalFixed = ColumnIntervalFixed;
            var ColumnIntervalAuto = (function (_super) {
                __extends(ColumnIntervalAuto, _super);
                function ColumnIntervalAuto(interval) {
                    var _this = _super.call(this, interval) || this;
                    _this.bounds = new __aspxRichEdit.MinMaxNumber(0, 0);
                    _this.totalHorizontalMargins = 0;
                    _this.preferredWidth = 0;
                    return _this;
                }
                ColumnIntervalAuto.prototype.updateMinBound = function (val) {
                    if (val > this.bounds.min)
                        this.bounds.min = val;
                };
                ColumnIntervalAuto.prototype.updateMaxBound = function (val) {
                    if (val > this.bounds.max)
                        this.bounds.max = val;
                };
                ColumnIntervalAuto.totalWidth = function (columns, startColumnIndex, endColumnIndex) {
                    if (startColumnIndex === void 0) { startColumnIndex = 0; }
                    if (endColumnIndex === void 0) { endColumnIndex = columns.length; }
                    var result = 0;
                    for (var columnIndex = startColumnIndex; columnIndex < endColumnIndex; columnIndex++)
                        result += columns[columnIndex].width;
                    return result;
                };
                ColumnIntervalAuto.totalMinWidth = function (columns, startColumnIndex, endColumnIndex) {
                    if (startColumnIndex === void 0) { startColumnIndex = 0; }
                    if (endColumnIndex === void 0) { endColumnIndex = columns.length; }
                    var result = 0;
                    for (var columnIndex = startColumnIndex; columnIndex < endColumnIndex; columnIndex++)
                        result += columns[columnIndex].bounds.min;
                    return result;
                };
                ColumnIntervalAuto.totalMaxWidth = function (columns, startColumnIndex, endColumnIndex) {
                    if (startColumnIndex === void 0) { startColumnIndex = 0; }
                    if (endColumnIndex === void 0) { endColumnIndex = columns.length; }
                    var result = 0;
                    for (var columnIndex = startColumnIndex; columnIndex < endColumnIndex; columnIndex++)
                        result += columns[columnIndex].bounds.max;
                    return result;
                };
                ColumnIntervalAuto.totalPreferredWidth = function (columns, startColumnIndex, endColumnIndex) {
                    if (startColumnIndex === void 0) { startColumnIndex = 0; }
                    if (endColumnIndex === void 0) { endColumnIndex = columns.length; }
                    var result = 0;
                    for (var columnIndex = startColumnIndex; columnIndex < endColumnIndex; columnIndex++)
                        result += columns[columnIndex].preferredWidth;
                    return result;
                };
                ColumnIntervalAuto.totalHorizontalMargins = function (columns, startColumnIndex, endColumnIndex) {
                    var result = 0;
                    for (var columnIndex = startColumnIndex; columnIndex < endColumnIndex; columnIndex++)
                        result += columns[columnIndex].totalHorizontalMargins;
                    return result;
                };
                ColumnIntervalAuto.hasColumnsWithoutPreferredWidth = function (columns, startColumnIndex, endColumnIndex) {
                    if (startColumnIndex === void 0) { startColumnIndex = 0; }
                    if (endColumnIndex === void 0) { endColumnIndex = columns.length; }
                    for (var columnIndex = startColumnIndex; columnIndex < endColumnIndex; columnIndex++)
                        if (columns[columnIndex].preferredWidth)
                            return true;
                    return false;
                };
                return ColumnIntervalAuto;
            }(ColumnInterval));
            Table.ColumnIntervalAuto = ColumnIntervalAuto;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var GridCalculatorAuto = (function (_super) {
                __extends(GridCalculatorAuto, _super);
                function GridCalculatorAuto() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                GridCalculatorAuto.prototype.makeInterval = function (interval) {
                    return new Table.ColumnIntervalAuto(interval);
                };
                GridCalculatorAuto.prototype.calculateIntervals = function () {
                    if (this.table.preferredWidth.type == __aspxRichEdit.TableWidthUnitType.Auto)
                        this.calculateEstimatedTableWidth();
                    else
                        this.calcCacheCellWidths();
                    this.applyPercentWidth();
                    this.applyCellContentWidth();
                    this.autofitTable();
                };
                GridCalculatorAuto.prototype.calcCacheCellWidths = function () {
                    var pos = new __aspxRichEdit.TablePosition(this.table, -1, -1);
                    while (pos.moveToNextRow())
                        while (pos.moveToNextCell())
                            new Table.TableCellWidthCalculator(this.subDocument, this.boxIterator, this.grid, this.cache, pos, this.percentBaseWidth).cellWidth();
                };
                GridCalculatorAuto.prototype.calculateEstimatedTableWidth = function () {
                    var _this = this;
                    var columnsInModelUnitsWidth = 0;
                    var totalPercentWidth = 0;
                    for (var _i = 0, _a = this.columns; _i < _a.length; _i++) {
                        var interval = _a[_i];
                        if (interval.type == __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent)
                            totalPercentWidth += interval.width;
                        else
                            columnsInModelUnitsWidth += interval.width;
                    }
                    var allColumnsInPercents = totalPercentWidth > 0 && columnsInModelUnitsWidth == 0;
                    if (allColumnsInPercents) {
                        this.calcCacheCellWidths();
                        var estimatedTableWidth_1 = 0;
                        __aspxRichEdit.ListUtils.foreach(this.table.rows, function (row, rowIndex) {
                            var columnIndex = row.gridBefore;
                            __aspxRichEdit.ListUtils.foreach(row.cells, function (cell, cellIndex) {
                                var column = _this.columns[columnIndex];
                                if (column.type == __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent) {
                                    var pos = new __aspxRichEdit.TablePosition(_this.table, rowIndex, cellIndex).init();
                                    var info = new Table.TableCellWidthCalculator(_this.subDocument, _this.boxIterator, _this.grid, _this.cache, pos, _this.percentBaseWidth).cellWidth();
                                    estimatedTableWidth_1 = Math.max(estimatedTableWidth_1, info.max);
                                    if (column.width > 0)
                                        estimatedTableWidth_1 = Math.max(info.min * __aspxRichEdit.TableWidthUnit.MAX_PERCENT_WIDTH, estimatedTableWidth_1);
                                }
                                columnIndex += cell.columnSpan;
                            });
                        });
                        this.percentBaseWidth = Math.min(estimatedTableWidth_1, this.percentBaseWidth) * __aspxRichEdit.TableWidthUnit.MAX_PERCENT_WIDTH / totalPercentWidth;
                    }
                    else {
                        var widthOfModelUnitsColumnsInPercents = __aspxRichEdit.TableWidthUnit.MAX_PERCENT_WIDTH - totalPercentWidth;
                        if (widthOfModelUnitsColumnsInPercents > 0)
                            this.percentBaseWidth = Math.min(columnsInModelUnitsWidth * __aspxRichEdit.TableWidthUnit.MAX_PERCENT_WIDTH / widthOfModelUnitsColumnsInPercents, this.percentBaseWidth);
                        this.calcCacheCellWidths();
                    }
                };
                GridCalculatorAuto.prototype.applyPercentWidth = function () {
                    var totalPercentWidth = 0;
                    var totalUnitWidth = 0;
                    var unsetIntervalsList = [];
                    for (var _i = 0, _a = this.columns; _i < _a.length; _i++) {
                        var interval = _a[_i];
                        switch (interval.type) {
                            case __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent:
                                totalPercentWidth += interval.width;
                                if (totalPercentWidth > __aspxRichEdit.TableWidthUnit.MAX_PERCENT_WIDTH)
                                    interval.width = Math.max(0, __aspxRichEdit.TableWidthUnit.MAX_PERCENT_WIDTH - totalPercentWidth + interval.width);
                                break;
                            case __aspxRichEdit.TableWidthUnitType.ModelUnits:
                                totalUnitWidth += interval.width;
                                break;
                            case __aspxRichEdit.TableWidthUnitType.Auto:
                            case __aspxRichEdit.TableWidthUnitType.Nil:
                                unsetIntervalsList.push(interval);
                                break;
                        }
                    }
                    if (totalPercentWidth == 0)
                        return;
                    var restUnitWidth = Math.max(0, this.percentBaseWidth - totalUnitWidth);
                    if (restUnitWidth > 0 && unsetIntervalsList.length > 0) {
                        var restPercentWidth = __aspxRichEdit.TableWidthUnit.MAX_PERCENT_WIDTH - totalPercentWidth;
                        if (restPercentWidth > 0) {
                            var restUnsetIntervalsCount = unsetIntervalsList.length;
                            for (var _b = 0, unsetIntervalsList_1 = unsetIntervalsList; _b < unsetIntervalsList_1.length; _b++) {
                                var interval = unsetIntervalsList_1[_b];
                                interval.type = __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent;
                                interval.width = restPercentWidth / restUnsetIntervalsCount;
                                restPercentWidth -= interval.width;
                                restUnsetIntervalsCount--;
                            }
                            totalPercentWidth = __aspxRichEdit.TableWidthUnit.MAX_PERCENT_WIDTH;
                        }
                    }
                    for (var _c = 0, _d = this.columns; _c < _d.length; _c++) {
                        var interval = _d[_c];
                        if (interval.type != __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent)
                            continue;
                        interval.type = __aspxRichEdit.TableWidthUnitType.ModelUnits;
                        var newWidth = totalPercentWidth > 0 ? restUnitWidth * interval.width / totalPercentWidth : 0;
                        totalPercentWidth -= interval.width;
                        interval.width = Math.max(1, newWidth);
                        restUnitWidth -= newWidth;
                    }
                };
                GridCalculatorAuto.prototype.autofitTable = function () {
                    var width = Table.ColumnIntervalAuto.totalWidth(this.columns);
                    var minWidth = Table.ColumnIntervalAuto.totalMinWidth(this.columns);
                    var preferredWidth = this.table.preferredWidth;
                    if (__aspxRichEdit.EnumUtils.isAnyOf(preferredWidth.type, __aspxRichEdit.TableWidthUnitType.ModelUnits, __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent)) {
                        var preferredTableWidth = preferredWidth.asNumber(this.percentBaseWidth, __aspxRichEdit.UnitConverter.twipsToPixels) +
                            this.cache[this.table.index].indent.asNumber(this.percentBaseWidth, __aspxRichEdit.UnitConverter.twipsToPixels);
                        if (width >= preferredTableWidth)
                            if (minWidth < this.maxTableWidth || preferredTableWidth > this.maxTableWidth)
                                this.compressTableGridToPreferredWidth(this.columns, width, preferredTableWidth);
                            else
                                this.compressTableGridToColumnWidth(this.columns, width, this.maxTableWidth);
                        else if (width < preferredTableWidth)
                            this.enlargeTableGridToPreferredWidth(this.columns, width, preferredTableWidth);
                    }
                    else {
                        if (width > this.maxTableWidth)
                            this.compressTableGridToColumnWidth(this.columns, width, this.maxTableWidth);
                        else {
                            this.compressRelativelySizedTable(this.columns);
                        }
                    }
                };
                GridCalculatorAuto.prototype.compressTableGridToPreferredWidth = function (columns, oldWidth, newWidth) {
                    var totalMinWidth = 0;
                    var totalMaxWidth = 0;
                    var totalPreferredWidth = 0;
                    for (var _i = 0, columns_4 = columns; _i < columns_4.length; _i++) {
                        var column = columns_4[_i];
                        totalMinWidth += column.bounds.min;
                        totalMaxWidth += column.bounds.max;
                        totalPreferredWidth += column.preferredWidth;
                    }
                    if (newWidth <= totalMinWidth) {
                        for (var _a = 0, columns_5 = columns; _a < columns_5.length; _a++) {
                            var column = columns_5[_a];
                            column.width = column.bounds.min;
                        }
                        return;
                    }
                    var totalMinWidthForNonPreferredWidthColumn = 0;
                    var totalDelta = oldWidth - newWidth;
                    for (var _b = 0, columns_6 = columns; _b < columns_6.length; _b++) {
                        var column = columns_6[_b];
                        if (column.bounds.max < column.bounds.min) {
                            totalDelta += column.bounds.min - column.width;
                            var delta = column.bounds.min - column.bounds.max;
                            totalMinWidth -= delta;
                            totalMaxWidth += delta;
                            var minWidth = column.bounds.min;
                            column.bounds.min = column.bounds.max;
                            column.bounds.max = column.width = minWidth;
                        }
                        if (column.preferredWidth == 0)
                            totalMinWidthForNonPreferredWidthColumn += column.bounds.min;
                    }
                    var totalMaxWidthForNonPreferredWidthColumn = totalMaxWidth - totalPreferredWidth;
                    if (newWidth - totalMinWidthForNonPreferredWidthColumn < totalPreferredWidth) {
                        for (var _c = 0, columns_7 = columns; _c < columns_7.length; _c++) {
                            var column = columns_7[_c];
                            if (column.preferredWidth == 0) {
                                totalDelta -= column.width - column.bounds.min;
                                column.width = column.bounds.min;
                            }
                        }
                        var rest = totalPreferredWidth - (totalMinWidth - totalMinWidthForNonPreferredWidthColumn);
                        for (var i = columns.length - 1, column = void 0; (column = columns[i]) && totalDelta > 0; i--) {
                            if (column.preferredWidth > 0) {
                                var delta = (column.preferredWidth - column.bounds.min) * totalDelta / (rest > 0 ? rest : 1);
                                column.width = Math.max(column.width - delta, 1);
                                rest -= column.preferredWidth - column.bounds.min;
                                totalDelta -= delta;
                            }
                        }
                    }
                    else {
                        var rest = totalMaxWidthForNonPreferredWidthColumn - totalMinWidthForNonPreferredWidthColumn;
                        for (var i = columns.length - 1, column = void 0; (column = columns[i]) && totalDelta > 0; i--) {
                            if (column.preferredWidth == 0) {
                                var delta = (column.bounds.max - column.bounds.min) * totalDelta / rest;
                                column.width = column.width - delta;
                                rest -= column.bounds.max - column.bounds.min;
                                totalDelta -= delta;
                            }
                        }
                    }
                };
                GridCalculatorAuto.prototype.compressTableGridToColumnWidth = function (columns, oldWidth, newWidth) {
                    var totalMinWidth = Table.ColumnIntervalAuto.totalMinWidth(columns);
                    if (totalMinWidth <= newWidth) {
                        this.compressTableGridToPreferredWidth(columns, oldWidth, newWidth);
                        return;
                    }
                    if (GridCalculatorAuto.allowTablesToExtendIntoMargins) {
                        this.compressTableGridToPreferredWidth(columns, oldWidth, totalMinWidth);
                        return;
                    }
                    var totalWidth = newWidth;
                    var rest = totalMinWidth;
                    for (var _i = 0, columns_8 = columns; _i < columns_8.length; _i++) {
                        var column = columns_8[_i];
                        var newColumnWidth = rest > 0 ? Math.max(column.bounds.min * totalWidth / rest, 1) : 1;
                        column.width = newColumnWidth;
                        totalWidth -= newColumnWidth;
                        rest -= column.bounds.min;
                    }
                };
                GridCalculatorAuto.prototype.applyCellContentWidth = function () {
                    var pos = new __aspxRichEdit.TablePosition(this.table, -1, -1);
                    while (pos.moveToNextRow()) {
                        var columnIndex = pos.row.gridBefore;
                        while (pos.moveToNextCell()) {
                            if (pos.cell.columnSpan == 1)
                                this.applyCellContentWidthWithoutSpan(this.columns, pos, columnIndex);
                            columnIndex += pos.cell.columnSpan;
                        }
                    }
                    for (var _i = 0, _a = this.columns; _i < _a.length; _i++) {
                        var column = _a[_i];
                        if (column.bounds.min == 0 && column.bounds.max == 0)
                            column.bounds.min = column.bounds.max = column.width;
                    }
                    pos.initIndexes(-1, -1);
                    while (pos.moveToNextRow()) {
                        var columnIndex = pos.row.gridBefore;
                        while (pos.moveToNextCell()) {
                            if (pos.cell.columnSpan > 1)
                                this.applyCellContentWidthWithSpan(this.columns, pos, columnIndex);
                            columnIndex += pos.cell.columnSpan;
                        }
                    }
                    for (var _b = 0, _c = this.columns; _b < _c.length; _b++) {
                        var column = _c[_b];
                        column.width = column.bounds.max = Math.max(column.bounds.max, 1);
                    }
                };
                GridCalculatorAuto.prototype.compressRelativelySizedTable = function (columns) {
                    var preferredWidth = this.table.preferredWidth;
                    if (!(preferredWidth.type == __aspxRichEdit.TableWidthUnitType.Auto && this.cache[this.table.index].layoutType == __aspxRichEdit.TableLayoutType.Autofit && this.flex))
                        return;
                    var ratio = 0.0;
                    var pos = new __aspxRichEdit.TablePosition(this.table, -1, -1);
                    while (pos.moveToNextRow()) {
                        while (pos.moveToNextCell()) {
                            if (pos.cell.verticalMerging == __aspxRichEdit.TableCellMergingState.Continue)
                                continue;
                            var cellCache = this.cache[this.table.index].rows[pos.rowIndex].cells[pos.cellIndex];
                            if (cellCache.contentWidthsInfo.max >= cellCache.containerWidthsInfo.max)
                                return;
                            var q = cellCache.contentWidthsInfo.max / cellCache.containerWidthsInfo.max;
                            if (q > ratio)
                                ratio = q;
                        }
                    }
                    for (var _i = 0, columns_9 = columns; _i < columns_9.length; _i++) {
                        var column = columns_9[_i];
                        column.width = Math.max(Math.floor(column.width * ratio), column.bounds.min);
                    }
                };
                GridCalculatorAuto.prototype.applyCellContentWidthWithoutSpan = function (columns, pos, columnIndex) {
                    var cellCache = this.currCache.rows[pos.rowIndex].cells[pos.cellIndex];
                    var info = cellCache.containerWidthsInfo;
                    var cellMinWidth = Math.max(1, info.min);
                    var cellMaxWidth = Math.max(1, info.max);
                    var column = columns[columnIndex];
                    if (column.width > 0)
                        cellMaxWidth = Math.max(cellMinWidth, column.width);
                    var preferredWidth = pos.cell.preferredWidth.asNumber(this.percentBaseWidth, __aspxRichEdit.UnitConverter.twipsToPixels);
                    column.updateMinBound(cellMinWidth);
                    column.updateMaxBound(cellMaxWidth);
                    column.totalHorizontalMargins = Math.max(column.totalHorizontalMargins, cellCache.horizontalMargins);
                    var noWrap = this.cache[this.table.index].rows[pos.rowIndex].cells[pos.cellIndex].noWrap;
                    if (preferredWidth <= 0 && noWrap)
                        preferredWidth = column.bounds.max;
                    if (preferredWidth > 0) {
                        if (!noWrap)
                            preferredWidth = Math.max(preferredWidth, cellMinWidth);
                        column.preferredWidth = Math.max(column.preferredWidth, preferredWidth);
                        column.bounds.max = column.preferredWidth;
                    }
                    else {
                        var totalColumnsMinWidth = column.bounds.min;
                        if (cellMinWidth > totalColumnsMinWidth)
                            this.enlargeColumnsWidths(columns, columnIndex, columnIndex + 1, totalColumnsMinWidth, cellMinWidth);
                    }
                };
                GridCalculatorAuto.prototype.applyCellContentWidthWithSpan = function (columns, pos, columnIndex) {
                    var endColumnIndex = columnIndex + pos.cell.columnSpan;
                    var cellCache = this.currCache.rows[pos.rowIndex].cells[pos.cellIndex];
                    var info = cellCache.containerWidthsInfo;
                    var gridWidth = Table.ColumnIntervalAuto.totalWidth(columns, columnIndex, endColumnIndex);
                    var cellMinWidth = Math.max(1, info.min);
                    var cellMaxWidth = Math.max(1, info.max);
                    if (gridWidth > 0)
                        cellMaxWidth = Math.max(cellMinWidth, gridWidth);
                    var preferredWidth = pos.cell.preferredWidth.asNumber(this.percentBaseWidth, __aspxRichEdit.UnitConverter.twipsToPixels);
                    if (preferredWidth > 0)
                        cellMaxWidth = Math.max(cellMinWidth, preferredWidth);
                    var gridMinWidth = Table.ColumnIntervalAuto.totalMinWidth(columns, columnIndex, endColumnIndex);
                    if (cellMinWidth > gridMinWidth)
                        this.enlargeColumnsMinWidth(columns, columnIndex, endColumnIndex, cellMinWidth);
                    var gridMaxWidth = Table.ColumnIntervalAuto.totalMaxWidth(columns, columnIndex, endColumnIndex);
                    if (cellMaxWidth > gridMaxWidth)
                        this.enlargeColumnsMaxWidth(columns, columnIndex, endColumnIndex, gridMaxWidth, cellMaxWidth);
                    var gridTotalMargins = Table.ColumnIntervalAuto.totalHorizontalMargins(columns, columnIndex, endColumnIndex);
                    if (cellCache.horizontalMargins > gridTotalMargins)
                        this.enlargeColumnsHorizontalMargins(columns, columnIndex, endColumnIndex, gridTotalMargins, cellCache.horizontalMargins);
                };
                GridCalculatorAuto.prototype.enlargeColumnsHorizontalMargins = function (columns, startColumnIndex, endColumnIndex, oldWidth, newWidth) {
                    var equalSpace = oldWidth == 0;
                    var totalDelta = newWidth - oldWidth;
                    var totalCount = endColumnIndex - startColumnIndex + 1;
                    for (var i = endColumnIndex - 1, column = void 0; (column = columns[i]) && totalDelta > 0; i--) {
                        var delta = equalSpace ? totalDelta / totalCount : totalDelta * column.totalHorizontalMargins / oldWidth;
                        totalDelta -= delta;
                        oldWidth -= column.totalHorizontalMargins;
                        column.totalHorizontalMargins += delta;
                        totalCount--;
                    }
                };
                GridCalculatorAuto.prototype.enlargeColumnsMinWidth = function (columns, startColumnIndex, endColumnIndex, newWidth) {
                    var hasColumnsWithoutPreferredWidth = Table.ColumnIntervalAuto.hasColumnsWithoutPreferredWidth(columns, startColumnIndex, endColumnIndex);
                    var zeroMinWidthCount = 0;
                    var existingMinWidth = 0;
                    __aspxRichEdit.ListUtils.foreach(columns, function (column) {
                        if (column.bounds.min == 0 && column.bounds.max == 0)
                            zeroMinWidthCount++;
                        else
                            existingMinWidth += column.bounds.min;
                    }, startColumnIndex, endColumnIndex);
                    var rest = Table.ColumnIntervalAuto.totalMaxWidth(columns, startColumnIndex, endColumnIndex) +
                        Table.ColumnIntervalAuto.totalMinWidth(columns, startColumnIndex, endColumnIndex);
                    var equalSpace = rest == 0;
                    if (equalSpace || zeroMinWidthCount > 0) {
                        rest = endColumnIndex - startColumnIndex;
                        newWidth -= existingMinWidth;
                    }
                    __aspxRichEdit.ListUtils.reverseForeach(columns, function (column) {
                        if (!hasColumnsWithoutPreferredWidth || column.preferredWidth == 0) {
                            if (zeroMinWidthCount > 0 && (column.bounds.min > 0 || column.bounds.max > 0))
                                return;
                            var factor = (equalSpace || zeroMinWidthCount > 0) ? 1 : (column.bounds.min + column.bounds.max);
                            var newMinWidth = factor * newWidth / rest;
                            rest -= factor;
                            newWidth -= newMinWidth;
                            column.updateMinBound(newMinWidth);
                            column.updateMaxBound(column.bounds.min);
                        }
                    }, endColumnIndex - 1, startColumnIndex);
                };
                GridCalculatorAuto.prototype.enlargeColumnsMaxWidth = function (columns, startColumnIndex, endColumnIndex, oldWidth, newWidth) {
                    var allColumnsHavePreferredWidth = __aspxRichEdit.ListUtils.allOf(columns, function (col) { return col.preferredWidth != 0; }, startColumnIndex, endColumnIndex);
                    var rest = oldWidth;
                    __aspxRichEdit.ListUtils.reverseForeach(columns, function (column) {
                        if (allColumnsHavePreferredWidth || column.preferredWidth == 0) {
                            var newMaxWidth = rest != 0 ? column.bounds.max * newWidth / rest : 0;
                            rest -= column.bounds.max;
                            newWidth -= newMaxWidth;
                            if (rest < 0)
                                rest = 0;
                            if (newWidth < 0)
                                newWidth = 0;
                            column.bounds.max = Math.max(1, newMaxWidth);
                        }
                    }, endColumnIndex - 1, startColumnIndex);
                };
                GridCalculatorAuto.prototype.enlargeColumnsWidths = function (columns, startColumnIndex, endColumnIndex, oldMinWidth, newMinWidth) {
                    var rest = newMinWidth - oldMinWidth;
                    var availableWidth = 0;
                    var totalRestMaxWidth = 0;
                    for (var i = startColumnIndex; i < endColumnIndex; i++) {
                        var column = columns[i];
                        availableWidth += column.bounds.length;
                        totalRestMaxWidth += column.bounds.max;
                    }
                    if (availableWidth < rest) {
                        __aspxRichEdit.ListUtils.foreach(columns, function (column) {
                            var delta = column.bounds.max * rest / totalRestMaxWidth;
                            var newMaxWidth = column.bounds.max + delta;
                            totalRestMaxWidth -= column.bounds.max;
                            rest -= delta;
                            column.bounds.max = column.bounds.min = newMaxWidth;
                        }, startColumnIndex, endColumnIndex);
                    }
                    else {
                        for (var i = startColumnIndex; i < endColumnIndex; i++) {
                            var column = columns[i];
                            var delta = column.bounds.length * rest / availableWidth;
                            availableWidth -= column.bounds.length;
                            rest -= delta;
                            column.bounds.min += delta;
                        }
                    }
                };
                GridCalculatorAuto.prototype.enlargeTableGridToPreferredWidth = function (columns, oldWidth, newWidth) {
                    var totalMaxWidth = Table.ColumnIntervalAuto.totalMaxWidth(columns);
                    var totalPreferredWidth = Table.ColumnIntervalAuto.totalPreferredWidth(columns);
                    var hasColumnsWithoutPreferredWidth = Table.ColumnIntervalAuto.hasColumnsWithoutPreferredWidth(columns);
                    var totalDelta = newWidth - oldWidth;
                    var rest = totalMaxWidth;
                    if (hasColumnsWithoutPreferredWidth)
                        rest -= totalPreferredWidth;
                    __aspxRichEdit.ListUtils.reverseForeach(columns, function (column) {
                        if (!hasColumnsWithoutPreferredWidth || column.preferredWidth == 0) {
                            var delta = column.bounds.max * totalDelta / rest;
                            column.width = column.width + delta;
                            rest -= column.bounds.max;
                            totalDelta -= delta;
                        }
                    });
                };
                GridCalculatorAuto.allowTablesToExtendIntoMargins = false;
                return GridCalculatorAuto;
            }(Table.GridCalculator));
            Table.GridCalculatorAuto = GridCalculatorAuto;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var GridCalculatorFixed = (function (_super) {
                __extends(GridCalculatorFixed, _super);
                function GridCalculatorFixed() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                GridCalculatorFixed.prototype.makeInterval = function (interval) {
                    return new Table.ColumnIntervalFixed(interval);
                };
                GridCalculatorFixed.prototype.calculateIntervals = function () {
                    this.setMinimumWidth();
                    var tablePreferredWidth = this.table.preferredWidth;
                    var actualWidth = tablePreferredWidth ? tablePreferredWidth.asNumber(this.percentBaseWidth, __aspxRichEdit.UnitConverter.twipsToPixels) : 0;
                    if (actualWidth > 0)
                        this.setActualModelUnitColumnsWidths(actualWidth, true);
                    else
                        this.setActualModelUnitColumnsWidths(this.percentBaseWidth, false);
                };
                GridCalculatorFixed.prototype.setMinimumWidth = function () {
                    for (var _i = 0, _a = this.columns; _i < _a.length; _i++) {
                        var col = _a[_i];
                        switch (col.type) {
                            case __aspxRichEdit.TableWidthUnitType.ModelUnits:
                            case __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent:
                                if (col.width > 0)
                                    break;
                            case __aspxRichEdit.TableWidthUnitType.Auto:
                            case __aspxRichEdit.TableWidthUnitType.Nil:
                                col.width = 1;
                                break;
                        }
                    }
                };
                GridCalculatorFixed.getCellWidth = function (tablePosition, grid) {
                    var cells = tablePosition.row.cells;
                    var colIndex = tablePosition.row.gridBefore;
                    for (var cellIndex = 0; cellIndex < tablePosition.cellIndex; cellIndex++)
                        colIndex += cells[cellIndex].columnSpan;
                    var endColIndex = colIndex + tablePosition.cell.columnSpan;
                    var resultWidth = 0;
                    for (; colIndex < endColIndex; colIndex++)
                        resultWidth += grid.columns.width[colIndex];
                    return resultWidth;
                };
                GridCalculatorFixed.prototype.setActualModelUnitColumnsWidths = function (avaliableSpacing, isTablePreferredWidthSet) {
                    var widthColumnsWithPercentAndModelUnitTypeInPixels = 0;
                    if (this.numIntervalsInPercents > 0) {
                        var muitiplierForPercentColumns = this.widthInPercents > __aspxRichEdit.TableWidthUnit.MAX_PERCENT_WIDTH ?
                            this.widthInPercents / __aspxRichEdit.TableWidthUnit.MAX_PERCENT_WIDTH : 1;
                        for (var _i = 0, _a = this.columns; _i < _a.length; _i++) {
                            var col = _a[_i];
                            if (col.type == __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent) {
                                col.width = Math.floor(col.width * muitiplierForPercentColumns / __aspxRichEdit.TableWidthUnit.MAX_PERCENT_WIDTH * avaliableSpacing);
                                widthColumnsWithPercentAndModelUnitTypeInPixels += col.width;
                            }
                        }
                        widthColumnsWithPercentAndModelUnitTypeInPixels =
                            this.fillAvaliableWidthWithModelUnitsColumn(avaliableSpacing, widthColumnsWithPercentAndModelUnitTypeInPixels, isTablePreferredWidthSet);
                    }
                    else {
                        if (isTablePreferredWidthSet)
                            widthColumnsWithPercentAndModelUnitTypeInPixels =
                                this.fillAvaliableWidthWithModelUnitsColumn(avaliableSpacing, widthColumnsWithPercentAndModelUnitTypeInPixels, true);
                        else
                            for (var _b = 0, _c = this.columns; _b < _c.length; _b++) {
                                var col = _c[_b];
                                if (col.type == __aspxRichEdit.TableWidthUnitType.ModelUnits)
                                    widthColumnsWithPercentAndModelUnitTypeInPixels += col.width;
                            }
                    }
                    if (isTablePreferredWidthSet)
                        this.setAutoAndNilColumns(avaliableSpacing, widthColumnsWithPercentAndModelUnitTypeInPixels);
                    else
                        this.setAutoAndNilColumnsAsIs(widthColumnsWithPercentAndModelUnitTypeInPixels);
                };
                GridCalculatorFixed.prototype.fillAvaliableWidthWithModelUnitsColumn = function (avaliableSpacing, widthColumnsWithPercentAndModelUnitTypeInPixels, isTablePreferredWidthSet) {
                    var avaliableSpaceForModelUnitsColumns = isTablePreferredWidthSet ?
                        avaliableSpacing - widthColumnsWithPercentAndModelUnitTypeInPixels :
                        Math.min(avaliableSpacing - widthColumnsWithPercentAndModelUnitTypeInPixels, this.widthInModelUnits);
                    for (var _i = 0, _a = this.columns; _i < _a.length; _i++) {
                        var col = _a[_i];
                        if (col.type == __aspxRichEdit.TableWidthUnitType.ModelUnits) {
                            col.width = Math.floor(col.width / this.widthInModelUnits * avaliableSpaceForModelUnitsColumns);
                            widthColumnsWithPercentAndModelUnitTypeInPixels += col.width;
                        }
                    }
                    return widthColumnsWithPercentAndModelUnitTypeInPixels;
                };
                GridCalculatorFixed.prototype.setAutoAndNilColumnsAsIs = function (widthColumnsWithPercentAndModelUnitTypeInPixels) {
                    this.widthInModelUnits = widthColumnsWithPercentAndModelUnitTypeInPixels;
                    for (var _i = 0, _a = this.columns; _i < _a.length; _i++) {
                        var col = _a[_i];
                        switch (col.type) {
                            case __aspxRichEdit.TableWidthUnitType.Auto:
                            case __aspxRichEdit.TableWidthUnitType.Nil:
                                col.type = __aspxRichEdit.TableWidthUnitType.ModelUnits;
                                col.width = Math.max(22, col.width);
                                this.widthInModelUnits += col.width;
                                break;
                            case __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent:
                                col.type = __aspxRichEdit.TableWidthUnitType.ModelUnits;
                                break;
                        }
                    }
                };
                GridCalculatorFixed.prototype.setAutoAndNilColumns = function (avaliableSpacing, widthColumnsWithPercentAndModelUnitTypeInPixels) {
                    var widthOneAutoColumn;
                    var widthOneNilColumn;
                    if (this.numIntervalsAsAuto > 0) {
                        var avaliableSpaceForAutoColumns = Math.max(0, avaliableSpacing - widthColumnsWithPercentAndModelUnitTypeInPixels - this.numIntervalsAsNil);
                        widthOneAutoColumn = Math.max(1, Math.floor(avaliableSpaceForAutoColumns / this.numIntervalsAsAuto));
                        widthOneNilColumn = 1;
                    }
                    else {
                        var avaliableSpaceForNilColumns = Math.max(0, avaliableSpacing - widthColumnsWithPercentAndModelUnitTypeInPixels);
                        widthOneAutoColumn = 1;
                        widthOneNilColumn = Math.max(1, Math.floor(avaliableSpaceForNilColumns / this.numIntervalsAsNil));
                    }
                    for (var _i = 0, _a = this.columns; _i < _a.length; _i++) {
                        var col = _a[_i];
                        switch (col.type) {
                            case __aspxRichEdit.TableWidthUnitType.Auto:
                                col.type = __aspxRichEdit.TableWidthUnitType.ModelUnits;
                                col.width = widthOneAutoColumn;
                                break;
                            case __aspxRichEdit.TableWidthUnitType.Nil:
                                col.type = __aspxRichEdit.TableWidthUnitType.ModelUnits;
                                col.width = widthOneNilColumn;
                                break;
                            case __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent:
                                col.type = __aspxRichEdit.TableWidthUnitType.ModelUnits;
                                break;
                        }
                    }
                    this.widthInModelUnits = widthColumnsWithPercentAndModelUnitTypeInPixels + this.numIntervalsAsNil + this.numIntervalsAsAuto * widthOneAutoColumn;
                };
                return GridCalculatorFixed;
            }(Table.GridCalculator));
            Table.GridCalculatorFixed = GridCalculatorFixed;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var TablePropertiesCache = (function () {
                function TablePropertiesCache(model, table, grid) {
                    this.borderProvider = new Table.TableBorderInfoProvider(model, table, __aspxRichEdit.UnitConverter.twipsToPixels);
                    this.indent = new __aspxRichEdit.TablePropertiesMergerIndent()
                        .getProperty(table.properties, table.style, __aspxRichEdit.ConditionalTableStyleFormatting.WholeTable, model.defaultTableProperties);
                    this.layoutType = new __aspxRichEdit.TablePropertiesMergerLayoutType().getProperty(table.properties);
                    var pos = new __aspxRichEdit.TablePosition(table, -1, -1);
                    this.rows = [];
                    while (pos.moveToNextRow())
                        this.rows.push(new TableRowPropertiesCache(model, this.borderProvider, pos, this.rows, grid));
                }
                return TablePropertiesCache;
            }());
            Table.TablePropertiesCache = TablePropertiesCache;
            var TableRowPropertiesCache = (function () {
                function TableRowPropertiesCache(model, tblBrdProv, pos, rows, grid) {
                    this.cells = [];
                    while (pos.moveToNextCell()) {
                        if (pos.cell.verticalMerging == __aspxRichEdit.TableCellMergingState.Continue) {
                            var cellInfo = grid.tableCellInfos[pos.rowIndex][pos.cellIndex];
                            var rowIndex = cellInfo.getStartRowIndex();
                            this.cells.push(rows[rowIndex].cells[cellInfo.getCellIndexAbs(rowIndex)]);
                        }
                        else
                            this.cells.push(new TableCellPropertiesCache(model, tblBrdProv, pos));
                    }
                }
                return TableRowPropertiesCache;
            }());
            Table.TableRowPropertiesCache = TableRowPropertiesCache;
            var TableCellPropertiesCache = (function () {
                function TableCellPropertiesCache(model, tblBrdProv, pos) {
                    var tableStyle = pos.table.style;
                    var defCellProps = model.defaultTableCellProperties;
                    this.noWrap = new __aspxRichEdit.TableCellPropertiesMergerNoWrap().getProperty(pos.cell.properties, tableStyle, pos.cell.conditionalFormatting, defCellProps);
                    this.horizontalMargins =
                        Table.Formatter.getCellMargin(tableStyle, pos.cell, new __aspxRichEdit.TableCellPropertiesMergerMarginLeft(pos.table, model, pos.cell.parentRow.tablePropertiesException)) +
                            Table.Formatter.getCellMargin(tableStyle, pos.cell, new __aspxRichEdit.TableCellPropertiesMergerMarginRight(pos.table, model, pos.cell.parentRow.tablePropertiesException));
                    this.leftBorderWidth = LayoutFormatter.Table.BorderHelper.getLeftBorder(model.colorProvider, pos, pos.row.cells[pos.cellIndex - 1], tblBrdProv, __aspxRichEdit.UnitConverter.twipsToPixels).width;
                    this.rightBorderWidth = LayoutFormatter.Table.BorderHelper.getRightBorder(model.colorProvider, pos, pos.row.cells[pos.cellIndex + 1], tblBrdProv, __aspxRichEdit.UnitConverter.twipsToPixels).width;
                    this.spacing = tblBrdProv.cellSpacings[pos.rowIndex] *
                        ((pos.cell.parentRow.gridBefore == 0 && pos.cellIndex == 0) ||
                            (pos.cell.parentRow.gridAfter == 0 && pos.cellIndex == pos.row.cells.length - 1) ?
                            3 : 2);
                }
                return TableCellPropertiesCache;
            }());
            Table.TableCellPropertiesCache = TableCellPropertiesCache;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_Point = (function (_super) {
                __extends(CCF_Point, _super);
                function CCF_Point() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_Point.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.Point;
                };
                CCF_Point.prototype.getShortDescription = function (_config) {
                    if (this.curr instanceof __aspxRichEdit.LayoutPoint)
                        return new ChromeCustomFormatters.DivElement().setText(this.curr.pageIndex + ": [" + this.toFixed(this.curr.x) + ", " + this.toFixed(this.curr.y) + "]").setColor(ChromeCustomFormatters.BaseFormatter.valueColor);
                    else
                        return new ChromeCustomFormatters.DivElement().setText("[" + this.toFixed(this.curr.x) + ", " + this.toFixed(this.curr.y) + "]").setColor(ChromeCustomFormatters.BaseFormatter.valueColor);
                };
                CCF_Point._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_Point());
                return CCF_Point;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_Point = CCF_Point;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_Rectangle = (function (_super) {
                __extends(CCF_Rectangle, _super);
                function CCF_Rectangle() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_Rectangle.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.Rectangle;
                };
                CCF_Rectangle.prototype.getShortDescription = function (_config) {
                    return new ChromeCustomFormatters.DivElement().setText("[" + this.toFixed(this.curr.x) + ", " + this.toFixed(this.curr.y) + ", " + this.toFixed(this.curr.width) + ", " + this.toFixed(this.curr.height) + "]");
                };
                CCF_Rectangle.prototype.availableFullDescription = function (_config) {
                    return true;
                };
                CCF_Rectangle.prototype.getFullDescription = function (_config) {
                    return this.stdShow(new ChromeCustomFormatters.StdProps([
                        new __aspxRichEdit.Pair("x", this.toFixed(this.curr.x)),
                        new __aspxRichEdit.Pair("y", this.toFixed(this.curr.y)),
                        new __aspxRichEdit.Pair("width", this.toFixed(this.curr.width)),
                        new __aspxRichEdit.Pair("height", this.toFixed(this.curr.height)),
                        new __aspxRichEdit.Pair("maxX", this.toFixed(this.curr.getRightBoundPosition())),
                        new __aspxRichEdit.Pair("maxY", this.toFixed(this.curr.getBottomBoundPosition())),
                        new __aspxRichEdit.Pair("center", this.curr.center)
                    ])
                        .showAsColumn());
                };
                CCF_Rectangle._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_Rectangle());
                return CCF_Rectangle;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_Rectangle = CCF_Rectangle;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_Table = (function (_super) {
                __extends(CCF_Table, _super);
                function CCF_Table() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_Table.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.Table;
                };
                CCF_Table.prototype.getShortDescription = function (_config) {
                    var list = [
                        new __aspxRichEdit.Pair("", this.curr.index + ":"),
                        new __aspxRichEdit.Pair("lvl", this.curr.nestedLevel),
                        new __aspxRichEdit.Pair("rows", this.curr.rows.length)
                    ];
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsLine());
                };
                CCF_Table.prototype.availableFullDescription = function (_config) {
                    return true;
                };
                CCF_Table.prototype.getFullDescription = function (_config) {
                    var list = [
                        new __aspxRichEdit.Pair("index", this.curr.index),
                        new __aspxRichEdit.Pair("nestedLevel", this.curr.nestedLevel),
                        new __aspxRichEdit.Pair("interval", this.curr.interval),
                        new __aspxRichEdit.Pair("preferredWidth", this.curr.preferredWidth),
                        new __aspxRichEdit.Pair("properties", this.curr.properties),
                        new __aspxRichEdit.Pair("text", this.getRawText(this.getSubDocument().getText(this.curr.interval)).setLen(30)),
                        new __aspxRichEdit.Pair("runsOnCell", this.getSubDocument().getRunsByInterval(this.curr.interval)),
                        new __aspxRichEdit.Pair("lookTypes", __aspxRichEdit.Log.mask(__aspxRichEdit.TableLookTypes, this.curr.lookTypes, __aspxRichEdit.TableLookTypes.None)),
                        new __aspxRichEdit.Pair("style", this.curr.style),
                        new __aspxRichEdit.Pair("rows", this.curr.rows),
                    ];
                    if (this.curr.nestedLevel > 0)
                        list.push(new __aspxRichEdit.Pair("parentCell", this.curr.parentCell));
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsColumn());
                };
                CCF_Table.prototype.getSubDocument = function () {
                    var _this = this;
                    return __aspxRichEdit.MapUtilsKeyAsNumber.elementBy(this.model.subDocuments, function (subDoc) {
                        return subDoc.tables[_this.curr.index] == _this.curr;
                    });
                };
                CCF_Table._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_Table());
                return CCF_Table;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_Table = CCF_Table;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_TableCell = (function (_super) {
                __extends(CCF_TableCell, _super);
                function CCF_TableCell() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_TableCell.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.TableCell;
                };
                CCF_TableCell.prototype.getShortDescription = function (_config) {
                    var list = [
                        new __aspxRichEdit.Pair("", this.getIndex() + ":"),
                        new __aspxRichEdit.Pair("", "[" + this.curr.startParagraphPosition.value + ", " + this.curr.endParagrapPosition.value + "]"),
                    ];
                    if (this.curr.columnSpan > 1)
                        list.push(new __aspxRichEdit.Pair("cols", this.curr.columnSpan));
                    if (this.curr.verticalMerging != __aspxRichEdit.TableCellMergingState.None)
                        list.push(new __aspxRichEdit.Pair("vertMerg", __aspxRichEdit.TableCellMergingState[this.curr.verticalMerging]));
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsLine());
                };
                CCF_TableCell.prototype.availableFullDescription = function (_config) {
                    return true;
                };
                CCF_TableCell.prototype.getFullDescription = function (_config) {
                    var list = [
                        new __aspxRichEdit.Pair("index", this.getIndex()),
                        new __aspxRichEdit.Pair("preferredWidth", this.curr.preferredWidth),
                        new __aspxRichEdit.Pair("columnSpan", this.curr.columnSpan),
                        new __aspxRichEdit.Pair("interval", this.curr.interval),
                        new __aspxRichEdit.Pair("text", this.getRawText(this.getSubDocument().getText(this.curr.interval)).setLen(30)),
                        new __aspxRichEdit.Pair("runsOnCell", this.getSubDocument().getRunsByInterval(this.curr.interval)),
                        new __aspxRichEdit.Pair("properties", this.curr.properties),
                        new __aspxRichEdit.Pair("conditionalFormatting", __aspxRichEdit.ConditionalTableStyleFormatting[this.curr.conditionalFormatting]),
                        new __aspxRichEdit.Pair("style", this.curr.style),
                        new __aspxRichEdit.Pair("verticalMerging", __aspxRichEdit.TableCellMergingState[this.curr.verticalMerging]),
                        new __aspxRichEdit.Pair("parentRow", this.curr.parentRow),
                    ];
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsColumn());
                };
                CCF_TableCell.prototype.getIndex = function () {
                    return __aspxRichEdit.ListUtils.indexOf(this.curr.parentRow.cells, this.curr);
                };
                CCF_TableCell.prototype.getSubDocument = function () {
                    var _this = this;
                    return __aspxRichEdit.MapUtilsKeyAsNumber.elementBy(this.model.subDocuments, function (subDoc) {
                        return subDoc.tables[_this.curr.parentRow.parentTable.index] == _this.curr.parentRow.parentTable;
                    });
                };
                CCF_TableCell._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_TableCell());
                return CCF_TableCell;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_TableCell = CCF_TableCell;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_TableCellProperties = (function (_super) {
                __extends(CCF_TableCellProperties, _super);
                function CCF_TableCellProperties() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_TableCellProperties.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.TableCellProperties;
                };
                CCF_TableCellProperties.prototype.getShortDescription = function (_config) {
                    var list = [];
                    if (this.curr.getUseValue(__aspxRichEdit.TableCellPropertiesMask.UseVerticalAlignment) && this.curr.verticalAlignment != __aspxRichEdit.TableCellVerticalAlignment.Top)
                        list.push(new __aspxRichEdit.Pair("vertAlign", __aspxRichEdit.TableCellVerticalAlignment[this.curr.verticalAlignment]));
                    if (this.curr.getUseValue(__aspxRichEdit.TableCellPropertiesMask.UseShadingInfoIndex))
                        list.push(new __aspxRichEdit.Pair("", ChromeCustomFormatters.BaseFormatter.getColorBoxNode(this.curr.shadingInfo.getActualColor(this.model.colorProvider))));
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsLine());
                };
                CCF_TableCellProperties.prototype.availableFullDescription = function (_config) {
                    return true;
                };
                CCF_TableCellProperties.prototype.getFullDescription = function (_config) {
                    var list = [
                        new __aspxRichEdit.Pair("mask", __aspxRichEdit.Log.mask(__aspxRichEdit.TableCellPropertiesMask, this.curr.mask, __aspxRichEdit.TableCellPropertiesMask.UseNone)),
                    ];
                    if (this.curr.getUseValue(__aspxRichEdit.TableCellPropertiesMask.UseVerticalAlignment))
                        list.push(new __aspxRichEdit.Pair("verticalAlignment", __aspxRichEdit.TableCellVerticalAlignment[this.curr.verticalAlignment]));
                    if (this.curr.getUseValue(__aspxRichEdit.TableCellPropertiesMask.UseLeftMargin))
                        list.push(new __aspxRichEdit.Pair("cellMargins.left", this.curr.cellMargins.left));
                    if (this.curr.getUseValue(__aspxRichEdit.TableCellPropertiesMask.UseRightMargin))
                        list.push(new __aspxRichEdit.Pair("cellMargins.right", this.curr.cellMargins.right));
                    if (this.curr.getUseValue(__aspxRichEdit.TableCellPropertiesMask.UseTopMargin))
                        list.push(new __aspxRichEdit.Pair("cellMargins.top", this.curr.cellMargins.top));
                    if (this.curr.getUseValue(__aspxRichEdit.TableCellPropertiesMask.UseBottomMargin))
                        list.push(new __aspxRichEdit.Pair("cellMargins.bottom", this.curr.cellMargins.bottom));
                    if (this.curr.getUseValue(__aspxRichEdit.TableCellPropertiesMask.UseLeftBorder))
                        list.push(new __aspxRichEdit.Pair("cellMargins.left", this.curr.borders.leftBorder));
                    if (this.curr.getUseValue(__aspxRichEdit.TableCellPropertiesMask.UseRightBorder))
                        list.push(new __aspxRichEdit.Pair("cellMargins.right", this.curr.borders.rightBorder));
                    if (this.curr.getUseValue(__aspxRichEdit.TableCellPropertiesMask.UseTopBorder))
                        list.push(new __aspxRichEdit.Pair("cellMargins.top", this.curr.borders.topBorder));
                    if (this.curr.getUseValue(__aspxRichEdit.TableCellPropertiesMask.UseBottomBorder))
                        list.push(new __aspxRichEdit.Pair("cellMargins.bottom", this.curr.borders.bottomBorder));
                    if (this.curr.getUseValue(__aspxRichEdit.TableCellPropertiesMask.UseTextDirection))
                        list.push(new __aspxRichEdit.Pair("textDirection", __aspxRichEdit.TextDirection[this.curr.textDirection]));
                    if (this.curr.getUseValue(__aspxRichEdit.TableCellPropertiesMask.UseFitText))
                        list.push(new __aspxRichEdit.Pair("fitText", this.curr.fitText));
                    if (this.curr.getUseValue(__aspxRichEdit.TableCellPropertiesMask.UseShadingInfoIndex))
                        list.push(new __aspxRichEdit.Pair("shadingInfo", this.curr.shadingInfo.getActualColor(this.model.colorProvider)));
                    if (this.curr.getUseValue(__aspxRichEdit.TableCellPropertiesMask.UseHideCellMark))
                        list.push(new __aspxRichEdit.Pair("hideCellMark", this.curr.hideCellMark));
                    if (this.curr.getUseValue(__aspxRichEdit.TableCellPropertiesMask.UseNoWrap))
                        list.push(new __aspxRichEdit.Pair("noWrap", this.curr.noWrap));
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsColumn());
                };
                CCF_TableCellProperties._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_TableCellProperties());
                return CCF_TableCellProperties;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_TableCellProperties = CCF_TableCellProperties;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_TableHeightUnit = (function (_super) {
                __extends(CCF_TableHeightUnit, _super);
                function CCF_TableHeightUnit() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_TableHeightUnit.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.TableHeightUnit;
                };
                CCF_TableHeightUnit.prototype.getShortDescription = function (_config) {
                    var list = [
                        new __aspxRichEdit.Pair("", __aspxRichEdit.TableHeightUnitType[this.curr.type] + ":"),
                        new __aspxRichEdit.Pair("", this.curr.value + "(" + __aspxRichEdit.UnitConverter.twipsToPixels(this.curr.value) + "px)"),
                    ];
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsLine());
                };
                CCF_TableHeightUnit._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_TableHeightUnit());
                return CCF_TableHeightUnit;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_TableHeightUnit = CCF_TableHeightUnit;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_TablePositionIndexes = (function (_super) {
                __extends(CCF_TablePositionIndexes, _super);
                function CCF_TablePositionIndexes() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_TablePositionIndexes.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.TablePositionIndexes;
                };
                CCF_TablePositionIndexes.prototype.getShortDescription = function (_config) {
                    var list = [];
                    if (this.curr instanceof __aspxRichEdit.TablePosition)
                        list.push(new __aspxRichEdit.Pair("tableI", this.curr.table.index));
                    list.push(new __aspxRichEdit.Pair("rowI", this.curr.rowIndex));
                    list.push(new __aspxRichEdit.Pair("cellI", this.curr.cellIndex));
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsLine());
                };
                CCF_TablePositionIndexes.prototype.availableFullDescription = function (_config) {
                    return this.curr instanceof __aspxRichEdit.TablePosition;
                };
                CCF_TablePositionIndexes.prototype.getFullDescription = function (_config) {
                    var curr = this.curr;
                    var list = [
                        new __aspxRichEdit.Pair("tableIndex", curr.table),
                        new __aspxRichEdit.Pair("rowIndex", curr.rowIndex),
                        new __aspxRichEdit.Pair("cellIndex", curr.cellIndex),
                        new __aspxRichEdit.Pair("row", curr.row),
                        new __aspxRichEdit.Pair("cell", curr.cell),
                    ];
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsColumn());
                };
                CCF_TablePositionIndexes._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_TablePositionIndexes());
                return CCF_TablePositionIndexes;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_TablePositionIndexes = CCF_TablePositionIndexes;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_TableProperties = (function (_super) {
                __extends(CCF_TableProperties, _super);
                function CCF_TableProperties() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_TableProperties.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.TableProperties;
                };
                CCF_TableProperties.prototype.getShortDescription = function (_config) {
                    var list = [
                        new __aspxRichEdit.Pair("", __aspxRichEdit.TableLayoutType[this.curr.layoutType]),
                        new __aspxRichEdit.Pair("indent", this.curr.indent),
                    ];
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsLine());
                };
                CCF_TableProperties.prototype.availableFullDescription = function (_config) {
                    return true;
                };
                CCF_TableProperties.prototype.getFullDescription = function (_config) {
                    var list = [
                        new __aspxRichEdit.Pair("layoutType", __aspxRichEdit.TableLayoutType[this.curr.layoutType]),
                        new __aspxRichEdit.Pair("indent", this.curr.indent),
                        new __aspxRichEdit.Pair("mask", __aspxRichEdit.Log.mask(__aspxRichEdit.TablePropertiesMask, this.curr.mask, __aspxRichEdit.TablePropertiesMask.UseNone)),
                    ];
                    if (this.curr.getUseValue(__aspxRichEdit.TablePropertiesMask.UseCellSpacing))
                        list.push(new __aspxRichEdit.Pair("cellSpacing", this.curr.cellSpacing));
                    if (this.curr.getUseValue(__aspxRichEdit.TablePropertiesMask.UseLeftMargin))
                        list.push(new __aspxRichEdit.Pair("cellMargins.left", this.curr.cellMargins.left));
                    if (this.curr.getUseValue(__aspxRichEdit.TablePropertiesMask.UseRightMargin))
                        list.push(new __aspxRichEdit.Pair("cellMargins.right", this.curr.cellMargins.right));
                    if (this.curr.getUseValue(__aspxRichEdit.TablePropertiesMask.UseTopMargin))
                        list.push(new __aspxRichEdit.Pair("cellMargins.top", this.curr.cellMargins.top));
                    if (this.curr.getUseValue(__aspxRichEdit.TablePropertiesMask.UseBottomMargin))
                        list.push(new __aspxRichEdit.Pair("cellMargins.bottom", this.curr.cellMargins.bottom));
                    if (this.curr.getUseValue(__aspxRichEdit.TablePropertiesMask.UseLeftBorder))
                        list.push(new __aspxRichEdit.Pair("borders.leftBorder", this.curr.borders.leftBorder));
                    if (this.curr.getUseValue(__aspxRichEdit.TablePropertiesMask.UseRightBorder))
                        list.push(new __aspxRichEdit.Pair("borders.rightBorder", this.curr.borders.rightBorder));
                    if (this.curr.getUseValue(__aspxRichEdit.TablePropertiesMask.UseTopBorder))
                        list.push(new __aspxRichEdit.Pair("borders.topBorder", this.curr.borders.topBorder));
                    if (this.curr.getUseValue(__aspxRichEdit.TablePropertiesMask.UseBottomBorder))
                        list.push(new __aspxRichEdit.Pair("borders.bottomBorder", this.curr.borders.bottomBorder));
                    if (this.curr.getUseValue(__aspxRichEdit.TablePropertiesMask.UseShadingInfoIndex))
                        list.push(new __aspxRichEdit.Pair("backgroundColor", ChromeCustomFormatters.BaseFormatter.getColorBoxNode(this.curr.shadingInfo.getActualColor(this.model.colorProvider))));
                    if (this.curr.getUseValue(__aspxRichEdit.TablePropertiesMask.UseTableAlignment))
                        list.push(new __aspxRichEdit.Pair("tableRowAlignment", __aspxRichEdit.TableRowAlignment[this.curr.tableRowAlignment]));
                    if (this.curr.getUseValue(__aspxRichEdit.TablePropertiesMask.UseTableStyleColBandSize))
                        list.push(new __aspxRichEdit.Pair("tableStyleColumnBandSize", this.curr.tableStyleColumnBandSize));
                    if (this.curr.getUseValue(__aspxRichEdit.TablePropertiesMask.UseTableStyleRowBandSize))
                        list.push(new __aspxRichEdit.Pair("tableStyleRowBandSize", this.curr.tableStyleRowBandSize));
                    if (this.curr.getUseValue(__aspxRichEdit.TablePropertiesMask.UseAvoidDoubleBorders))
                        list.push(new __aspxRichEdit.Pair("avoidDoubleBorders", this.curr.avoidDoubleBorders));
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsColumn());
                };
                CCF_TableProperties._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_TableProperties());
                return CCF_TableProperties;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_TableProperties = CCF_TableProperties;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_TableRow = (function (_super) {
                __extends(CCF_TableRow, _super);
                function CCF_TableRow() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_TableRow.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.TableRow;
                };
                CCF_TableRow.prototype.getShortDescription = function (_config) {
                    var list = [
                        new __aspxRichEdit.Pair("", this.getIndex() + ":"),
                        new __aspxRichEdit.Pair("cells", this.curr.cells.length),
                        new __aspxRichEdit.Pair("height", this.curr.height),
                    ];
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsLine());
                };
                CCF_TableRow.prototype.availableFullDescription = function (_config) {
                    return true;
                };
                CCF_TableRow.prototype.getFullDescription = function (_config) {
                    var list = [
                        new __aspxRichEdit.Pair("index", this.getIndex()),
                        new __aspxRichEdit.Pair("gridBefore", this.curr.gridBefore),
                        new __aspxRichEdit.Pair("gridAfter", this.curr.gridAfter),
                        new __aspxRichEdit.Pair("cells", this.curr.cells),
                        new __aspxRichEdit.Pair("height", this.curr.height),
                        new __aspxRichEdit.Pair("text", this.getRawText(this.getSubDocument().getText(this.curr.interval)).setLen(30)),
                        new __aspxRichEdit.Pair("runsOnCell", this.getSubDocument().getRunsByInterval(this.curr.interval)),
                        new __aspxRichEdit.Pair("conditionalFormatting", __aspxRichEdit.Log.mask(__aspxRichEdit.ConditionalTableStyleFormatting, this.curr.conditionalFormatting)),
                        new __aspxRichEdit.Pair("properties", this.curr.properties),
                        new __aspxRichEdit.Pair("tablePropertiesException", this.curr.tablePropertiesException),
                    ];
                    if (this.curr.gridBefore)
                        list.push(new __aspxRichEdit.Pair("widthBefore", this.curr.widthBefore));
                    if (this.curr.gridAfter)
                        list.push(new __aspxRichEdit.Pair("widthAfter", this.curr.widthAfter));
                    list.push(new __aspxRichEdit.Pair("parentTable", this.curr.parentTable));
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsColumn());
                };
                CCF_TableRow.prototype.getIndex = function () {
                    return __aspxRichEdit.ListUtils.indexOf(this.curr.parentTable.rows, this.curr);
                };
                CCF_TableRow.prototype.getSubDocument = function () {
                    var _this = this;
                    return __aspxRichEdit.MapUtilsKeyAsNumber.elementBy(this.model.subDocuments, function (subDoc) {
                        return subDoc.tables[_this.curr.parentTable.index] == _this.curr.parentTable;
                    });
                };
                CCF_TableRow._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_TableRow());
                return CCF_TableRow;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_TableRow = CCF_TableRow;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_TableRowProperties = (function (_super) {
                __extends(CCF_TableRowProperties, _super);
                function CCF_TableRowProperties() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_TableRowProperties.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.TableRowProperties;
                };
                CCF_TableRowProperties.prototype.getShortDescription = function (_config) {
                    var list = [];
                    if (this.curr.getUseValue(__aspxRichEdit.TableRowPropertiesMask.UseCantSplit))
                        list.push(new __aspxRichEdit.Pair("cantSplit", this.curr.cantSplit));
                    if (this.curr.getUseValue(__aspxRichEdit.TableRowPropertiesMask.UseCellSpacing))
                        list.push(new __aspxRichEdit.Pair("cellSpacing", this.curr.cellSpacing));
                    if (this.curr.getUseValue(__aspxRichEdit.TableRowPropertiesMask.UseTableRowAlignment) && this.curr.tableRowAlignment != __aspxRichEdit.TableRowAlignment.Left)
                        list.push(new __aspxRichEdit.Pair("tableRowAlignment", __aspxRichEdit.TableRowAlignment[this.curr.tableRowAlignment]));
                    if (this.curr.getUseValue(__aspxRichEdit.TableRowPropertiesMask.UseHideCellMark) && this.curr.header)
                        list.push(new __aspxRichEdit.Pair("", "header"));
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsLine());
                };
                CCF_TableRowProperties.prototype.availableFullDescription = function (_config) {
                    return true;
                };
                CCF_TableRowProperties.prototype.getFullDescription = function (_config) {
                    var list = [
                        new __aspxRichEdit.Pair("mask", __aspxRichEdit.Log.mask(__aspxRichEdit.TableRowPropertiesMask, this.curr.mask, __aspxRichEdit.TableRowPropertiesMask.UseNone)),
                    ];
                    if (this.curr.getUseValue(__aspxRichEdit.TableRowPropertiesMask.UseCellSpacing))
                        list.push(new __aspxRichEdit.Pair("cellSpacing", this.curr.cellSpacing));
                    if (this.curr.getUseValue(__aspxRichEdit.TableRowPropertiesMask.UseCantSplit))
                        list.push(new __aspxRichEdit.Pair("cantSplit", this.curr.cantSplit));
                    if (this.curr.getUseValue(__aspxRichEdit.TableRowPropertiesMask.UseHeader))
                        list.push(new __aspxRichEdit.Pair("header", this.curr.header));
                    if (this.curr.getUseValue(__aspxRichEdit.TableRowPropertiesMask.UseDivId))
                        list.push(new __aspxRichEdit.Pair("divId", this.curr.divId));
                    if (this.curr.getUseValue(__aspxRichEdit.TableRowPropertiesMask.UseTableRowAlignment))
                        list.push(new __aspxRichEdit.Pair("tableRowAlignment", __aspxRichEdit.TableRowAlignment[this.curr.tableRowAlignment]));
                    if (this.curr.getUseValue(__aspxRichEdit.TableRowPropertiesMask.UseHideCellMark))
                        list.push(new __aspxRichEdit.Pair("header", this.curr.hideCellMark));
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsColumn());
                };
                CCF_TableRowProperties._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_TableRowProperties());
                return CCF_TableRowProperties;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_TableRowProperties = CCF_TableRowProperties;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var ChromeCustomFormatters;
    (function (ChromeCustomFormatters) {
        var Layout;
        (function (Layout) {
            var CCF_TableWidthUnit = (function (_super) {
                __extends(CCF_TableWidthUnit, _super);
                function CCF_TableWidthUnit() {
                    return _super !== null && _super.apply(this, arguments) || this;
                }
                CCF_TableWidthUnit.prototype.isHandleObject = function (obj) {
                    return obj instanceof __aspxRichEdit.TableWidthUnit;
                };
                CCF_TableWidthUnit.prototype.getShortDescription = function (_config) {
                    var list = [
                        new __aspxRichEdit.Pair("", __aspxRichEdit.TableWidthUnitType[this.curr.type] + ":"),
                    ];
                    if (this.curr.type == __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent)
                        list.push(new __aspxRichEdit.Pair("", this.curr.value + "(" + this.curr.value / __aspxRichEdit.TableWidthUnit.MAX_PERCENT_WIDTH * 100 + "%)"));
                    else
                        list.push(new __aspxRichEdit.Pair("", this.curr.value + "(" + __aspxRichEdit.UnitConverter.twipsToPixels(this.curr.value) + "px)"));
                    return this.stdShow(new ChromeCustomFormatters.StdProps(list).showAsLine());
                };
                CCF_TableWidthUnit._foo = ChromeCustomFormatters.BaseFormatter.addToFormattersList(new CCF_TableWidthUnit());
                return CCF_TableWidthUnit;
            }(ChromeCustomFormatters.BaseFormatter));
            Layout.CCF_TableWidthUnit = CCF_TableWidthUnit;
        })(Layout = ChromeCustomFormatters.Layout || (ChromeCustomFormatters.Layout = {}));
    })(ChromeCustomFormatters = __aspxRichEdit.ChromeCustomFormatters || (__aspxRichEdit.ChromeCustomFormatters = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var ColumnWidthEngine;
            (function (ColumnWidthEngine) {
                var Calculator = (function () {
                    function Calculator() {
                    }
                    Calculator.getIntervals = function (table) {
                        var rows = table.rows;
                        var currRowTableGrid = Calculator.columnsInfo(rows[0]);
                        for (var nextRowIndex = 1, nextRow = void 0; nextRow = rows[nextRowIndex]; nextRowIndex++) {
                            var nextRowTableGrid = Calculator.columnsInfo(nextRow);
                            currRowTableGrid = Calculator.mergeRowColumnIntervals(currRowTableGrid, nextRowTableGrid);
                        }
                        return currRowTableGrid;
                    };
                    Calculator.columnsInfo = function (row) {
                        var columns = [];
                        if (row.gridBefore > 0)
                            columns.push(new ColumnWidthEngine.ColumnInterval(row.widthBefore.value, row.gridBefore, row.widthBefore.type));
                        for (var _i = 0, _a = row.cells; _i < _a.length; _i++) {
                            var cell = _a[_i];
                            var cellPreferredWidth = cell.preferredWidth;
                            columns.push(new ColumnWidthEngine.ColumnInterval(cellPreferredWidth.value, cell.columnSpan, cellPreferredWidth.type));
                        }
                        if (row.gridAfter > 0)
                            columns.push(new ColumnWidthEngine.ColumnInterval(row.widthAfter.value, row.gridAfter, row.widthAfter.type));
                        return columns;
                    };
                    Calculator.mergeRowColumnIntervals = function (currRowTableGrid, nextRowTableGrid) {
                        var mergedTableGrid = [];
                        var currRowIterator = new ColumnWidthEngine.ColumnIntervalWidthIterator(currRowTableGrid);
                        var nextRowIterator = new ColumnWidthEngine.ColumnIntervalWidthIterator(nextRowTableGrid);
                        while (!currRowIterator.endOfIntervals() && !nextRowIterator.endOfIntervals()) {
                            var currIntervalSpan = currRowIterator.interval.colSpan;
                            var nextIntervalSpan = nextRowIterator.interval.colSpan;
                            if (currIntervalSpan > nextIntervalSpan)
                                Calculator.processDependedIntervals(currRowIterator, nextRowIterator, mergedTableGrid);
                            else if (nextIntervalSpan > currIntervalSpan)
                                Calculator.processDependedIntervals(nextRowIterator, currRowIterator, mergedTableGrid);
                            else {
                                var newInterval = Calculator.mergeIntervalsDifferentRows(currRowIterator.interval, nextRowIterator.interval);
                                mergedTableGrid.push(newInterval);
                                currRowIterator.advance(newInterval);
                                nextRowIterator.advance(newInterval);
                            }
                        }
                        Calculator.copyRestIntervals(currRowIterator, mergedTableGrid);
                        Calculator.copyRestIntervals(nextRowIterator, mergedTableGrid);
                        return mergedTableGrid;
                    };
                    Calculator.mergeIntervalsDifferentRows = function (currRowTableColumnInterval, nextRowTableColumnInterval) {
                        var colSpan = currRowTableColumnInterval.colSpan;
                        if (currRowTableColumnInterval.type == nextRowTableColumnInterval.type)
                            return new ColumnWidthEngine.ColumnInterval(Math.max(currRowTableColumnInterval.width, nextRowTableColumnInterval.width), colSpan, currRowTableColumnInterval.type);
                        if (currRowTableColumnInterval.type == __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent)
                            return Calculator.mergeIntervalsDifferentRowsDifferentTypes(currRowTableColumnInterval, nextRowTableColumnInterval, colSpan);
                        if (nextRowTableColumnInterval.type == __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent)
                            return Calculator.mergeIntervalsDifferentRowsDifferentTypes(nextRowTableColumnInterval, currRowTableColumnInterval, colSpan);
                        if (currRowTableColumnInterval.type == __aspxRichEdit.TableWidthUnitType.ModelUnits)
                            return new ColumnWidthEngine.ColumnInterval(currRowTableColumnInterval.width, colSpan, __aspxRichEdit.TableWidthUnitType.ModelUnits);
                        return new ColumnWidthEngine.ColumnInterval(nextRowTableColumnInterval.width, colSpan, __aspxRichEdit.TableWidthUnitType.ModelUnits);
                    };
                    Calculator.mergeIntervalsDifferentRowsDifferentTypes = function (percentBasedInterval, anotherBasedInterval, colSpan) {
                        return anotherBasedInterval.width > 0 ?
                            new ColumnWidthEngine.ColumnInterval(anotherBasedInterval.width, colSpan, anotherBasedInterval.type) :
                            new ColumnWidthEngine.ColumnInterval(percentBasedInterval.width, colSpan, percentBasedInterval.type);
                    };
                    Calculator.copyRestIntervals = function (iterator, to) {
                        while (!iterator.endOfIntervals()) {
                            to.push(iterator.interval);
                            iterator.advance(iterator.interval);
                        }
                    };
                    Calculator.processDependedIntervals = function (masterIterator, slaveIterator, mergedRowsIntervals) {
                        var deferredTableGrid = [];
                        var autoSizeIntervalsCount = 0;
                        var masterInterval = masterIterator.interval;
                        do {
                            var slaveInterval = slaveIterator.interval;
                            if (slaveInterval.type == __aspxRichEdit.TableWidthUnitType.Auto || slaveInterval.type == __aspxRichEdit.TableWidthUnitType.Nil)
                                autoSizeIntervalsCount++;
                            deferredTableGrid.push(slaveInterval);
                            slaveIterator.advance(slaveInterval);
                            masterInterval = masterInterval.substract(slaveInterval);
                        } while (masterInterval.colSpan > 0 && !slaveIterator.endOfIntervals() && slaveIterator.interval.colSpan <= masterInterval.colSpan);
                        var calculateNotSetIntervals = masterInterval.type == __aspxRichEdit.TableWidthUnitType.ModelUnits && autoSizeIntervalsCount > 0;
                        var newWidth = calculateNotSetIntervals ? masterInterval.width / autoSizeIntervalsCount : 0;
                        for (var _i = 0, deferredTableGrid_1 = deferredTableGrid; _i < deferredTableGrid_1.length; _i++) {
                            var interval = deferredTableGrid_1[_i];
                            if (calculateNotSetIntervals && (interval.type == __aspxRichEdit.TableWidthUnitType.Auto || interval.type == __aspxRichEdit.TableWidthUnitType.Nil)) {
                                interval.type = __aspxRichEdit.TableWidthUnitType.ModelUnits;
                                interval.width = newWidth;
                            }
                            mergedRowsIntervals.push(masterIterator.interval.colSpan > 1 ? interval : Calculator.mergeIntervalsDifferentRows(masterIterator.interval, interval));
                            masterIterator.advance(interval);
                        }
                    };
                    return Calculator;
                }());
                ColumnWidthEngine.Calculator = Calculator;
            })(ColumnWidthEngine = Table.ColumnWidthEngine || (Table.ColumnWidthEngine = {}));
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var ColumnWidthEngine;
            (function (ColumnWidthEngine) {
                var ColumnInterval = (function () {
                    function ColumnInterval(width, colSpan, type) {
                        this.width = width;
                        this.colSpan = colSpan;
                        this.type = type;
                    }
                    ColumnInterval.prototype.substract = function (b) {
                        var colSpan = this.colSpan - b.colSpan;
                        if (this.type == b.type)
                            return new ColumnInterval(Math.max(0, this.width - b.width), colSpan, this.type);
                        switch (this.type) {
                            case __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent: return new ColumnInterval(b.width, colSpan, b.type);
                            case __aspxRichEdit.TableWidthUnitType.ModelUnits: return new ColumnInterval(this.width, colSpan, this.type);
                            default:
                                var type = this.type == __aspxRichEdit.TableWidthUnitType.Auto || b.type == __aspxRichEdit.TableWidthUnitType.Auto ?
                                    __aspxRichEdit.TableWidthUnitType.Auto : __aspxRichEdit.TableWidthUnitType.Nil;
                                return new ColumnInterval(0, colSpan, type);
                        }
                    };
                    return ColumnInterval;
                }());
                ColumnWidthEngine.ColumnInterval = ColumnInterval;
            })(ColumnWidthEngine = Table.ColumnWidthEngine || (Table.ColumnWidthEngine = {}));
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var ColumnWidthEngine;
            (function (ColumnWidthEngine) {
                var ColumnIntervalWidthIterator = (function () {
                    function ColumnIntervalWidthIterator(columnsInfo) {
                        this.columnsInfo = columnsInfo;
                        this.intervalIndex = 0;
                        this.interval = columnsInfo[0];
                    }
                    ColumnIntervalWidthIterator.prototype.endOfIntervals = function () {
                        return !this.interval;
                    };
                    ColumnIntervalWidthIterator.prototype.moveNext = function () {
                        this.intervalIndex++;
                        this.interval = this.columnsInfo[this.intervalIndex];
                    };
                    ColumnIntervalWidthIterator.prototype.advance = function (interval) {
                        if (this.interval.colSpan == interval.colSpan)
                            this.moveNext();
                        else
                            this.interval = this.interval.substract(interval);
                    };
                    return ColumnIntervalWidthIterator;
                }());
                ColumnWidthEngine.ColumnIntervalWidthIterator = ColumnIntervalWidthIterator;
            })(ColumnWidthEngine = Table.ColumnWidthEngine || (Table.ColumnWidthEngine = {}));
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var TableCellWidthCalculator = (function () {
                function TableCellWidthCalculator(subDocument, boxIterator, grid, cache, pos, percentBaseWidth) {
                    this.subDocument = subDocument;
                    this.boxIterator = boxIterator;
                    this.cache = cache;
                    this.pos = pos;
                    this.percentBaseWidth = percentBaseWidth;
                    this.grid = grid;
                }
                TableCellWidthCalculator.prototype.cellWidth = function () {
                    var currCache = this.cache[this.grid.table.index];
                    var info = this.grid.tableCellInfos[this.pos.rowIndex][this.pos.cellIndex];
                    if (this.pos.cell.verticalMerging == __aspxRichEdit.TableCellMergingState.Continue)
                        return currCache.rows[info.getStartRowIndex()].cells[info.getCellIndexAbs(info.getStartRowIndex())].containerWidthsInfo;
                    var table = this.pos.table;
                    var cellStartRowIndex = info.getStartRowIndex();
                    this.pos = new __aspxRichEdit.TablePosition(table, cellStartRowIndex, info.getCellIndexAbs(cellStartRowIndex)).init();
                    var cellCache = currCache.rows[this.pos.rowIndex].cells[this.pos.cellIndex];
                    var horizontalBorders = cellCache.leftBorderWidth + cellCache.rightBorderWidth;
                    var contentWidths = this.cellWidthCore(this.pos, this.pos.table.preferredWidth, currCache.indent, this.percentBaseWidth);
                    if (cellCache.noWrap && this.pos.cell.preferredWidth.type != __aspxRichEdit.TableWidthUnitType.ModelUnits)
                        contentWidths.min = contentWidths.max;
                    var cellPreferredWidth = this.pos.cell.preferredWidth.asNumber(this.percentBaseWidth, __aspxRichEdit.UnitConverter.twipsToPixels);
                    var resultMinWidth = contentWidths.min + cellCache.horizontalMargins + cellCache.spacing + horizontalBorders;
                    if (cellCache.noWrap && this.pos.cell.preferredWidth.type == __aspxRichEdit.TableWidthUnitType.ModelUnits)
                        resultMinWidth = Math.max(cellPreferredWidth, resultMinWidth);
                    resultMinWidth = Math.min(__aspxRichEdit.Constants.MAX_SAFE_INTEGER, resultMinWidth);
                    var resultMaxWidth = contentWidths.max + cellCache.horizontalMargins + cellCache.spacing + horizontalBorders;
                    resultMaxWidth = Math.min(__aspxRichEdit.Constants.MAX_SAFE_INTEGER, resultMaxWidth);
                    cellCache.contentWidthsInfo = new __aspxRichEdit.MinMaxNumber(resultMinWidth, resultMaxWidth);
                    if (__aspxRichEdit.EnumUtils.isAnyOf(this.pos.cell.preferredWidth.type, __aspxRichEdit.TableWidthUnitType.ModelUnits, __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent))
                        resultMaxWidth = Math.max(resultMinWidth, cellPreferredWidth);
                    return cellCache.containerWidthsInfo = new __aspxRichEdit.MinMaxNumber(resultMinWidth, resultMaxWidth);
                };
                TableCellWidthCalculator.prototype.getTableWidth = function (table, tablePreferredWidth, tableIndent, percentBaseWidth) {
                    var result = new Table.TableWidthCalculator(this.subDocument, this.boxIterator, this.cache, table, 0).tableWidth();
                    if (tablePreferredWidth.type != __aspxRichEdit.TableWidthUnitType.Nil && tablePreferredWidth.type != __aspxRichEdit.TableWidthUnitType.Auto) {
                        var tableWidth = tablePreferredWidth.asNumber(percentBaseWidth, __aspxRichEdit.UnitConverter.twipsToPixels) +
                            tableIndent.asNumber(percentBaseWidth, __aspxRichEdit.UnitConverter.twipsToPixels);
                        result.updateBounds(new __aspxRichEdit.MinMaxNumber(tableWidth, tableWidth));
                    }
                    return result;
                };
                TableCellWidthCalculator.prototype.getInnerTables = function (pos) {
                    var lowerLevelIndex = pos.table.nestedLevel + 1;
                    var tables = this.boxIterator.subDocument.tablesByLevels[lowerLevelIndex];
                    var cellEndPos = pos.cell.endParagrapPosition.value;
                    var result = [];
                    if (tables)
                        for (var tbl = void 0, tblIndex = pos.table.index + 1; (tbl = tables[tblIndex]) && tbl.getStartPosition() < cellEndPos; tblIndex++)
                            if (tbl.nestedLevel == lowerLevelIndex)
                                result.push(tbl);
                    return result;
                };
                TableCellWidthCalculator.prototype.cellWidthCore = function (pos, tablePreferredWidth, tableIndent, percentBaseWidth) {
                    var subDocument = this.boxIterator.subDocument;
                    var paragraphs = subDocument.paragraphs;
                    var minMax = new __aspxRichEdit.MinMaxNumber(0, 0);
                    var innerTables = this.getInnerTables(pos);
                    for (var _i = 0, innerTables_1 = innerTables; _i < innerTables_1.length; _i++) {
                        var tbl = innerTables_1[_i];
                        minMax.updateBounds(this.getTableWidth(tbl, tablePreferredWidth, tableIndent, percentBaseWidth));
                    }
                    for (var _a = 0, _b = __aspxRichEdit.IntervalAlgorithms.reflectIntervals(__aspxRichEdit.ListUtils.map(innerTables, function (t) { return t.interval; }), pos.cell.interval); _a < _b.length; _a++) {
                        var interval = _b[_a];
                        var firstParInd = subDocument.getParagraphIndexByPosition(interval.start);
                        var intervalEnd = interval.end;
                        for (var parInd = firstParInd, par = void 0; (par = paragraphs[parInd]) && (par.startLogPosition.value < intervalEnd); parInd++)
                            minMax.updateBounds(this.boxIterator.getParagraphBounds(parInd));
                    }
                    return minMax;
                };
                return TableCellWidthCalculator;
            }());
            Table.TableCellWidthCalculator = TableCellWidthCalculator;
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
var __aspxRichEdit;
(function (__aspxRichEdit) {
    var LayoutFormatter;
    (function (LayoutFormatter) {
        var Table;
        (function (Table) {
            var TableWidthCalculator = (function () {
                function TableWidthCalculator(subDocument, boxIterator, cache, table, avaliableSpacing) {
                    this.containsCellsMergedByHorizontal = false;
                    this.table = table;
                    this.map = {};
                    var grid = new Table.Grid(this.table);
                    var pos = new __aspxRichEdit.TablePosition(this.table, -1, -1);
                    while (pos.moveToNextRow())
                        while (pos.moveToNextCell()) {
                            var cellWidth = new Table.TableCellWidthCalculator(subDocument, boxIterator, grid, cache, pos, avaliableSpacing).cellWidth();
                            this.register(new CellHorizontalBoundsInfo(new CellHorizontalBounds(grid.tableCellInfos[pos.rowIndex][pos.cellIndex].getGridCellIndex(), pos.cell.columnSpan), cellWidth));
                        }
                }
                TableWidthCalculator.prototype.register = function (info) {
                    var key = info.pos.columnIndex * 250 + info.pos.span;
                    var existingCellInfo = this.map[key];
                    if (existingCellInfo)
                        existingCellInfo.info.updateBounds(info.info);
                    else
                        this.map[key] = info;
                    if (!this.containsCellsMergedByHorizontal)
                        this.containsCellsMergedByHorizontal = info.pos.span > 1;
                };
                TableWidthCalculator.prototype.tableWidth = function () {
                    if (!this.containsCellsMergedByHorizontal)
                        return __aspxRichEdit.MapUtilsKeyAsNumber.accumulate(this.map, new __aspxRichEdit.MinMaxNumber(0, 0), function (acc, v) { return acc.updateBounds(v.info); });
                    var list = __aspxRichEdit.MapUtilsKeyAsNumber.toList(this.map);
                    list = list.sort(function (a, b) {
                        var diffByColumns = a.pos.columnIndex - b.pos.columnIndex;
                        return diffByColumns ? diffByColumns : a.pos.span - b.pos.span;
                    });
                    var summaryListLength = list.length;
                    var summary = __aspxRichEdit.ListUtils.initByCallback(summaryListLength + 1, function () { return new __aspxRichEdit.MinMaxNumber(0, 0); });
                    for (var _i = 0, list_2 = list; _i < list_2.length; _i++) {
                        var info = list_2[_i];
                        var existingSummary = summary[info.pos.columnIndex];
                        var newSummary = new __aspxRichEdit.MinMaxNumber(existingSummary.min + info.info.min, existingSummary.max + info.info.max);
                        for (var i = info.pos.endColumnIndex; i < summaryListLength; i++) {
                            var oldSummary = summary[i];
                            if (oldSummary.min > newSummary.min && oldSummary.max > newSummary.max)
                                break;
                            oldSummary.updateBounds(newSummary);
                        }
                        ;
                    }
                    return summary[summaryListLength - 1];
                };
                return TableWidthCalculator;
            }());
            Table.TableWidthCalculator = TableWidthCalculator;
            var CellHorizontalBounds = (function () {
                function CellHorizontalBounds(columnIndex, span) {
                    this.columnIndex = columnIndex;
                    this.span = span;
                }
                Object.defineProperty(CellHorizontalBounds.prototype, "endColumnIndex", {
                    get: function () { return this.columnIndex + this.span; },
                    enumerable: true,
                    configurable: true
                });
                return CellHorizontalBounds;
            }());
            var CellHorizontalBoundsInfo = (function () {
                function CellHorizontalBoundsInfo(pos, info) {
                    this.pos = pos;
                    this.info = info;
                }
                return CellHorizontalBoundsInfo;
            }());
        })(Table = LayoutFormatter.Table || (LayoutFormatter.Table = {}));
    })(LayoutFormatter = __aspxRichEdit.LayoutFormatter || (__aspxRichEdit.LayoutFormatter = {}));
})(__aspxRichEdit || (__aspxRichEdit = {}));
//# sourceMappingURL=clientBaseScripts.js.map     J   ﻿(function() {
 <%= WebResource("custom:RichEditLocalization")%>
})();  }  ﻿(function(dx) {
 var constants = {
  MainID: "_Main",
  ViewID: "_View",
  DialogControlID: "_REDC",
  ModalDialogControlID: "_REMC",
  PopupMenuControlID: "_REPUM",
  AutoCorrectBarID: "_AC",
  RibbonID: "_R",
  HelperFrameID: "_HF",
  LoadingPanel: "_LPC",
  Bar: "_Bar",
  MeasurerContainerCssClass: "dxreMeasurer",
  HelperFrameCssClass: "dxre-helperFrame",
  SuggestionMenuItemCssClass: "dxre-pum-suggestionItem",
  PlaceholderDivCssClass: "dxrePlaceholderDiv",
  InternalCallBackPostfix: "%RichEdit",
  PerformCallbackPrefix: "REPC",
  CommandsCallbackPrefix: "REC",
  InternalCallbackPrefix: "IC-",
  UploadControlUrlParameter: "REUCUP",
  Base64ImageDataUrl: "data:image/png;base64,"
 };
 var ASPxClientRichEditCustomCommandExecutedEventArgs = ASPx.CreateClass(ASPxClientEventArgs, {
  constructor: function(commandName, parameter) {
   this.constructor.prototype.constructor.call(this);
   this.commandName = commandName;
   this.parameter = parameter;
  }
 });
 var ASPxClientRichEditHyperlinkClickEventArgs = ASPx.CreateClass(ASPxClientEventArgs, {
  constructor: function(htmlEvent, handled, targetUri, hyperlinkType) {
   this.constructor.prototype.constructor.call(this);
   this.handled = handled;
   this.htmlEvent = htmlEvent;
   this.hyperlinkType = hyperlinkType;
   this.targetUri = targetUri;
  }
 });
 var ASPxClientRichEditKeyDownEventArgs = ASPx.CreateClass(ASPxClientEventArgs, {
  constructor: function(htmlEvent, handled) {
   this.constructor.prototype.constructor.call(this);
   this.handled = handled;
   this.htmlEvent = htmlEvent;
  }
 });
 var ASPxClientRichEditKeyUpEventArgs = ASPx.CreateClass(ASPxClientEventArgs, {
  constructor: function(htmlEvent) {
   this.constructor.prototype.constructor.call(this);
   this.htmlEvent = htmlEvent;
  }
 });
 var ASPxClientRichEditPointerDownEventArgs = ASPx.CreateClass(ASPxClientEventArgs, {
  constructor: function(htmlEvent, handled) {
   this.constructor.prototype.constructor.call(this);
   this.handled = handled;
   this.htmlEvent = htmlEvent;
  }
 });
 var ASPxClientRichEditPointerUpEventArgs = ASPx.CreateClass(ASPxClientEventArgs, {
  constructor: function(htmlEvent, handled) {
   this.constructor.prototype.constructor.call(this);
   this.handled = handled;
   this.htmlEvent = htmlEvent;
  }
 });
 var ASPxClientRichEditContentInsertedEventArgs = ASPx.CreateClass(ASPxClientEventArgs, {
  constructor: function(subDocumentId, interval) {
   this.constructor.prototype.constructor.call(this);
   this.subDocumentId = subDocumentId;
   this.interval = interval;
  }
 });
 var ASPxClientRichEditContentRemovedEventArgs = ASPx.CreateClass(ASPxClientEventArgs, {
  constructor: function(subDocumentId, interval) {
   this.constructor.prototype.constructor.call(this);
   this.subDocumentId = subDocumentId;
   this.interval = interval;
  }
 });
 var ASPxClientRichEditCharacterPropertiesChangedEventArgs = ASPx.CreateClass(ASPxClientEventArgs, {
  constructor: function(subDocumentId, interval) {
   this.constructor.prototype.constructor.call(this);
   this.subDocumentId = subDocumentId;
   this.interval = interval;
  }
 });
 var ASPxClientRichEditParagraphPropertiesChangedEventArgs = ASPx.CreateClass(ASPxClientEventArgs, {
  constructor: function(subDocumentId, paragraphIndex) {
   this.constructor.prototype.constructor.call(this);
   this.subDocumentId = subDocumentId;
   this.paragraphIndex = paragraphIndex;
  }
 });
 var ASPxClientRichEditPopupMenuShowingEventArgs = ASPx.CreateClass(ASPxClientCancelEventArgs, {
  constructor: function(menuItems) {
   this.constructor.prototype.constructor.call(this);
   this.menuItems = menuItems;
  }
 });
 var ASPxClientRichEditAutoCorrectEventArgs = ASPx.CreateClass(ASPxClientEventArgs, {
  constructor: function(text, interval, handled) {
   this.constructor.prototype.constructor.call(this);
   this.handled = handled;
   this.text = text;
   this.interval = interval;
  }
 });
 var ASPxClientRichEdit = ASPx.CreateClass(ASPxClientControl, { 
  constructor: function(name) {
   this.constructor.prototype.constructor.call(this, name);
   this.rulerSettings = null;
   this.bookmarksSettings = null;
   this.spellCheckerSettings = null;
   this.autoCorrectSettings = null;
   this.mailMergeOptions = null;
   this.documentProtectionSettings = null;
   this.core = null;
   this.units = 1;
   this.clientGuid = null;
   this.readOnly = false;
   this.pendingCallbacks = [];
   this.bars = [];
   this.isInternalServiceCallback = false;
   this.CustomCommandExecuted = new ASPxClientEvent();
   this.BeginSynchronization = new ASPxClientEvent();
   this.EndSynchronization = new ASPxClientEvent();
   this.DocumentLoaded = new ASPxClientEvent();
   this.DocumentChanged = new ASPxClientEvent();
   this.ActiveSubDocumentChanged = new ASPxClientEvent();
   this.GotFocus = new ASPxClientEvent();
   this.LostFocus = new ASPxClientEvent();
   this.PointerDown = new ASPxClientEvent();
   this.PointerUp = new ASPxClientEvent();
   this.KeyDown = new ASPxClientEvent();
   this.KeyUp = new ASPxClientEvent();
   this.PopupMenuShowing = new ASPxClientEvent();
   this.HyperlinkClick = new ASPxClientEvent();
   this.SelectionChanged = new ASPxClientEvent();
   this.ContentInserted = new ASPxClientEvent();
   this.ContentRemoved = new ASPxClientEvent();
   this.CharacterPropertiesChanged = new ASPxClientEvent();
   this.ParagraphPropertiesChanged = new ASPxClientEvent();
   this.AutoCorrect = new ASPxClientEvent();
   this.document = null;
   this.commands = null;
   this.selection = null;
   this.unitConverter = null;
  },
  InlineInitialize: function() {
   ASPxClientControl.prototype.InlineInitialize.call(this);
   if(this.canInitializeCoreDuringPageParsing())
    this.InitializeRichEditCore();
  },
  Initialize: function() {
   ASPxClientControl.prototype.Initialize.call(this);
   if(!this.canInitializeCoreDuringPageParsing())
    this.InitializeRichEditCore();
   this.fullScreenTempVars = {};
   this.isInFullScreenMode = false;
   if(this.getConfirmUpdateText())
    this.updateWatcherHelper = new RichEditUpdateWatcherHelper(this);
   if(!ASPx.Browser.TouchUI)
    this.initializeRefocus();
  },
  canInitializeCoreDuringPageParsing: function() {
   return !(ASPx.Browser.IE && ASPx.Browser.Version < 9);
  },
  AfterInitialize: function() {
   this.document = new ASPx.RichEditDocument(this.core);
   this.commands = new ASPx.RichEditCommands(this.core);
   this.selection = new ASPx.RichEditSelection(this.core);
   this.unitConverter = new ASPx.RichEditUnitConverter();
   if (!this.core.serverDispatcher.onGetResponse(this.startResponse))
    this.throwSessionExpiredAlert();
   this.startResponse = null;
   ASPxClientControl.prototype.AfterInitialize.call(this);
   this.AdjustControlCore();
   if(this.workSessionIsLost) {
    this.core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowErrorSessionHasExpiredMessageCommand).execute(this.core.commandManager.isPublicApiCall);
    this.core.closeDocument();
   }
  },
  InitializeRichEditCore: function() {
   this.InitializeBars();
   if(ASPx.Browser.IE && ASPx.Browser.MajorVersion < 9)
    ASPx.Evt.PreventElementDragAndSelect(viewElement);
   var core = new __aspxRichEdit.AspxRichEditCore(
    this,
    this.name,
    document.getElementById(this.name + constants.MainID),
    this.clientGuid,
    this.readOnly,
    this.bars,
    this.units,
    this.rulerSettings,
    this.bookmarksSettings,
    this.fieldsSettings,
    this.mailMergeOptions,
    this.spellCheckerSettings,
    this.autoCorrectSettings,
    this.documentProtectionSettings,
    this.viewsSettings
   );
   this.core = core;
  },
  InitializeBars: function() {
   this.bars = [];
   this.bars.push(this.createContextMenuBar(this.getPopupMenu(), this));
   var ribbon = this.GetRibbon();
   if(ribbon)
    this.bars.push(new RibbonBar(ribbon, this));
  },
  createContextMenuBar: function(popupMenu, clientRichEdit) {
   return new ContextMenuBar(popupMenu, clientRichEdit);
  },
  getQuickSeachPanel: function() {
   if (!this.quickSearchPanel)
    this.quickSearchPanel = new __aspxRichEdit.QuickSearchPanel(this, this.core.searchManager);
   return this.quickSearchPanel;
  },
  getEditableDocument: function() {
   return this.core.inputController.getEditableDocument();
  },
  getModifiedState: function() {
   return this.core.getModifiedState();
  },
  initializeRefocus: function() {
   var statusBar = this.getStatusBar();
   if(statusBar)
    ASPx.Evt.AttachEventToElement(statusBar, ASPx.TouchUIHelper.touchMouseUpEventName, this.getRefocusHandler());
   this.attachRefocusHandlerToRibbon();
  },
  getRefocusHandler: function() {
   if(!this.refocusHandler) {
    var refocusFunction = function() {
     var activeElement = ASPx.GetActiveElement();
     if(activeElement && !ASPx.IsInteractiveControl(activeElement) && !this.hasActiveDialog())
      this.Focus();
    }.aspxBind(this);
    this.refocusHandler = function(evt) { window.setTimeout(refocusFunction, 120); };
   }
   return this.refocusHandler;
  },
  attachRefocusHandlerToRibbon: function() {
   var ribbon = this.GetRibbon();
   if(ribbon)
    ASPx.Evt.AttachEventToElement(ribbon.GetMainElement(), ASPx.TouchUIHelper.touchMouseUpEventName, this.getRefocusHandler());
  },
  detachRefocusHandlerFromRibbon: function() {
   var ribbon = this.GetRibbon();
   if(ribbon)
    ASPx.Evt.DetachEventFromElement(ribbon.GetMainElement(), ASPx.TouchUIHelper.touchMouseUpEventName, this.getRefocusHandler());
  },
  getCustomCssClass: function(key) {
   return "";
  },
  showDialog: function(commandID, parameters, callback, afterClosing, isModal) {
   var dialog = ASPxClientRichEdit.ASPxRichEditDialogList[commandID];
   if(dialog) {
    if(this.hasActiveDialog()) {
     var activeDialog = this.getCurrentDialog();
     activeDialog.HideDialog();
    }
    dialog.Execute(this, parameters, callback, afterClosing, isModal);
   } else
    alert("Dialog is not found");
  },
  canCaptureFocus: function() {
   return !ASPx.Browser.TouchUI ? !this.hasActiveModalDialog() && !this.getPopupMenu().IsVisible() : !this.hasActiveModalDialog();
  },
  hasActiveDialog: function() {
   return !!this.stateObject.currentDialog;
  },
  hasActiveModalDialog: function() {
   return this.hasActiveDialog() && this.getCurrentDialog().isModal;
  },
  getCurrentDialog: function() {
   return ASPx.Dialog.GetCurrentDialog(this.name);
  },
  sendInternalServiceCallback: function(callbackPrefix, arg, callbackOwnerControl) {
   arg = ASPx.FormatCallbackArg(constants.InternalCallbackPrefix + callbackPrefix, arg);
   this.sendCallback(arg, callbackOwnerControl, true);
  },
  sendCallback: function(arg, callbackOwnerControl, isInternalServiceCallback, handler) {
   if(this.InCallback())
    this.pendingCallbacks.push([arg, callbackOwnerControl, isInternalServiceCallback, handler]);
   else
    this.createCallbackCore(arg, callbackOwnerControl, isInternalServiceCallback, handler);
  },
  createCallbackCore: function(arg, callbackOwnerControl, isInternalServiceCallback, handler) {
   this.isInternalServiceCallback = isInternalServiceCallback;
   if (callbackOwnerControl)
    this.setOwnerControlCallback(callbackOwnerControl);
   this.CreateCallback(arg, undefined, handler);
  },
  CreateCallback: function(arg, command, handler) {
   this.SpecifyCallbackWithWorkSessionID();
   ASPxClientControl.prototype.CreateCallback.call(this, arg, command, handler);
  },
  SpecifyCallbackWithWorkSessionID: function() {
   ASPx.OfficeWorkSessionIDInputHelper.SetValue(this.core.sessionGuid);
  },
  DoEndCallback: function() {
   this.isInternalServiceCallback = false;
   if (this.callbackOwner != null && !this.isErrorOnCallback)
    this.callbackOwner.OnEndCallback();
   this.isErrorOnCallback = false;
   if(this.pendingCallbacks.length) {
    var callbackInfo = this.pendingCallbacks.shift();
    this.createCallbackCore(callbackInfo[0], callbackInfo[1], callbackInfo[2], callbackInfo[3]);
   }
   ASPxClientControl.prototype.DoEndCallback.call(this);
  },
  clearOwnerControlCallback: function() {
   this.callbackOwner = null;
  },
  setOwnerControlCallback: function(owner) {
   this.callbackOwner = owner;
  },
  sendRequest: function(requestQueryString, viaInternalCallback) {
   var resourceUrl = this.getResourceUrl();
   if(viaInternalCallback)
    this.sendInternalServiceCallback(constants.CommandsCallbackPrefix, requestQueryString);
   else {
    var postdata = "commands=" + requestQueryString;
    this.createXMLHttpRequest(resourceUrl, postdata);
   }
  },
  sendDownloadRequest: function(downloadRequestType, parameters) {
   var resourceUrl = this.getResourceUrl() + "&downloadRequestType=" + downloadRequestType;
   if(parameters)
    resourceUrl += "&parameters=" + parameters;
   if(downloadRequestType == __aspxRichEdit.DownloadRequestType.PrintCurrentDocument && !ASPx.PDFPluginHelper.IsInstalled())
    window.open(resourceUrl);
   else {
    var helperFrame = this.getHelperFrame();
    helperFrame.document.location = resourceUrl;
   }
  },
  getResourceUrl: function() {
   var url = ASPx.OfficeHandlerUtils.getHandlerResourceUrl();
   url += "DXS.ashx?dxwsid=" + this.core.sessionGuid + "&c=" + this.clientGuid;
   return url;
  },
  createXMLHttpRequest: function(resourceUrl, postdata) {
   var xmlHttp = new XMLHttpRequest();
   var async = true;
   this.increaseHandlerRequestCount();
   xmlHttp.open("POST", resourceUrl, async);
   xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); 
   xmlHttp.onreadystatechange = function () {
    if (xmlHttp.readyState === 4) {
     if (xmlHttp.status === 200) {
      var response = xmlHttp.responseText;
      this.onResponseReceived(response);
     } else if (xmlHttp.status === 404) {
      this.core.serverDispatcher.reset();
      this.core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowErrorSessionHasExpiredMessageCommand).execute(this.core.commandManager.isPublicApiCall);
     }
    }
   }.aspxBind(this);
   xmlHttp.onerror = function () {
   };
   xmlHttp.send(postdata);
   this.setLoadingPanelVisible(true);
  },
  onResponseReceived: function (jsonResponse) {
   this.decreaseHandlerRequestCount();
   if (jsonResponse)
    if (!this.core.serverDispatcher.onGetResponse(jsonResponse))
     this.throwSessionExpiredAlert();
   this.unlockEndCallbackEvent();
   this.setLoadingPanelVisible(false);
   this.raiseEndSynchronization();
  },
  throwSessionExpiredAlert: function() {
   var text = ASPxClientRichEdit.ASPxRichEditDialogList.AlertTexts[__aspxRichEdit.AlertMessageText.SessionHasExpired];
   alert(text.replace(/<br\s*[\/]?>/gi, "\n"));
  },
  AdjustControlCore: function() {
   this.adjustRibbon();
   this.adjustMainView();
  },
  adjustControl: function() {
   this.AdjustControlCore();
  },
  adjustControlInFullScreenMode: function() {
   this.SetWidth(ASPx.GetDocumentClientWidth());
   this.SetHeight(ASPx.GetDocumentClientHeight() - this.getExternalRibbonControlHeight());
   this.AdjustControlCore();
   this.adjustPlaceholderDiv();
  },
  adjustMainView: function() {
   var mainViewElement = this.getMainViewElement();
   var viewElement = this.getViewElement();
   if (mainViewElement && this.core) {
    if(this.core.horizontalRulerControl)
     this.core.horizontalRulerControl.adjust();
    var innerControlsHeight = this.getInternalRibbonControlHeight() + this.getStatusBarHeight();
    var rulerHeight = this.getRulerHeight();
    var height = mainViewElement.parentNode.offsetHeight - ASPx.GetTopBottomBordersAndPaddingsSummaryValue(mainViewElement.parentNode) 
     - innerControlsHeight - ASPx.GetTopBottomBordersAndPaddingsSummaryValue(mainViewElement);
    if (height < 0)
     height = rulerHeight;
    mainViewElement.style.height = height + "px";
    viewElement.style.height = height - rulerHeight + "px";
    if(this.core.viewManager)
     this.core.viewManager.adjust(true);
   }
  },
  adjustRibbon: function() {
   var ribbonControl = this.GetRibbon();
   if(ribbonControl)
    ribbonControl.AdjustControl();
  },
  adjustPlaceholderDiv: function() {
   var ribbonControl = this.GetRibbon();
   if(ribbonControl) {
    ASPx.SetStyles(this.placeholderDiv, {
     "width": ribbonControl.GetWidth(),
     "height": ribbonControl.GetHeight()
    });
   }
  },
  ribbonStateChanged: function() {
   if(this.isInFullScreenMode && this.isRibbonExternal()) {
    ASPx.Attr.ChangeStyleAttribute(this.GetMainElement(), "top", this.getExternalRibbonControlHeight() + "px");
    this.adjustControlInFullScreenMode();
   } else
    this.adjustMainView();
   if(!this.isRibbonExternal())
    if(this.GetRibbon().minimized)
     ASPx.Attr.ChangeStyleAttribute(this.getQuickSeachPanel().getQuickSearchPanelWrapper(), "top", "0px");
    else
     ASPx.Attr.ResetStyleAttribute(this.getQuickSeachPanel().getQuickSearchPanelWrapper(), "top");
  },
  getRibbonControlHeight: function() {
   var ribbonControl = this.GetRibbon();
   return ribbonControl ? ribbonControl.GetHeight() : 0;
  },
  getInternalRibbonControlHeight: function() {
   return this.isRibbonExternal() ? 0 : this.getRibbonControlHeight();
  },
  getExternalRibbonControlHeight: function() {
   return this.isRibbonExternal() ? this.getRibbonControlHeight() : 0;
  },
  getStatusBarHeight: function() {
   var statusBar = this.getStatusBar();
   return statusBar ? statusBar.offsetHeight : 0;
  },
  getRulerHeight: function () {
   if(this.core.horizontalRulerControl)
    return this.core.horizontalRulerControl.getHeight();
   return 0;
  },
  SetFullscreenMode: function(fullscreen) {
   if(this.isInFullScreenMode === fullscreen)
    return;
   this.core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.FullScreen).execute(this.core.commandManager.isPublicApiCall);
  },
  toggleFullScreenMode: function() {
   this.isInFullScreenMode = !this.isInFullScreenMode;
   if(this.isInFullScreenMode)
    this.setFullScreenMode();
   else
    this.setNormalMode();
  },
  setFullScreenMode: function() {
   this.prepareFullScreenMode();
   this.togglePlaceholderDiv();
   if(this.isRibbonExternal())
    this.setExternalRibbonPositionOnPageTop();
   this.adjustControlInFullScreenMode();   
  },
  setNormalMode: function() {
   if(this.isRibbonExternal())
    this.restoreExternalRibbonPositionOnPage(this);
   var mainElement = this.GetMainElement();
   ASPx.Attr.RestoreStyleAttribute(mainElement, "left");
   ASPx.Attr.RestoreStyleAttribute(mainElement, "top");
   if(!this.getLastDialog())
    this.restoreBodyScroll();
   ASPx.Attr.RestoreStyleAttribute(mainElement, ASPx.Browser.IE ? "zIndex" : "z-index");
   document.body.style.margin = this.fullScreenTempVars.savedBodyMargin;
   ASPx.Attr.RestoreStyleAttribute(mainElement, "position");
   ASPx.Attr.RestoreStyleAttribute(mainElement, ASPx.Browser.IE ? "borderTopWidth" : "border-top-width");
   ASPx.Attr.RestoreStyleAttribute(mainElement, ASPx.Browser.IE ? "borderLeftWidth" : "border-left-width");
   ASPx.Attr.RestoreStyleAttribute(mainElement, ASPx.Browser.IE ? "borderRightWidth" : "border-right-width");
   ASPx.Attr.RestoreStyleAttribute(mainElement, ASPx.Browser.IE ? "borderBottomWidth" : "border-bottom-width");
   this.SetHeight(this.fullScreenTempVars.savedCurrentHeight);
   this.SetWidth(this.fullScreenTempVars.savedCurrentWidth);
   document.documentElement.scrollTop = this.fullScreenTempVars.savedBodyScrollTop;
   document.documentElement.scrollLeft = this.fullScreenTempVars.savedBodyScrollTop;
   this.togglePlaceholderDiv();
   this.AdjustControlCore();
  },
  prepareFullScreenMode: function() {
   var mainElement = this.GetMainElement();
   ASPx.Attr.ChangeStyleAttribute(mainElement, ASPx.Browser.IE ? "borderTopWidth" : "border-top-width", "0px");
   ASPx.Attr.ChangeStyleAttribute(mainElement, ASPx.Browser.IE ? "borderLeftWidth" : "border-left-width", "0px");
   ASPx.Attr.ChangeStyleAttribute(mainElement, ASPx.Browser.IE ? "borderRightWidth" : "border-right-width", "0px");
   ASPx.Attr.ChangeStyleAttribute(mainElement, ASPx.Browser.IE ? "borderBottomWidth" : "border-bottom-width", "0px");
   this.fullScreenTempVars.savedBodyScrollTop = ASPx.GetDocumentScrollTop();
   this.fullScreenTempVars.savedBodyScrollLeft = ASPx.GetDocumentScrollLeft();
   ASPx.Attr.ChangeStyleAttribute(mainElement, "position", "fixed");
   ASPx.Attr.ChangeStyleAttribute(mainElement, "top", this.getExternalRibbonControlHeight() + "px");
   ASPx.Attr.ChangeStyleAttribute(mainElement, "left", "0px");
   ASPx.Attr.ChangeStyleAttribute(mainElement, ASPx.Browser.IE ? "zIndex" : "z-index", 10001);
   this.hideBodyScroll();
   this.fullScreenTempVars.savedBodyMargin = document.body.style.margin;
   document.body.style.margin = 0;
   if(ASPx.IsPercentageSize(mainElement.style.width))
    this.fullScreenTempVars.savedCurrentWidth = mainElement.style.width;
   else
    this.fullScreenTempVars.savedCurrentWidth = this.GetWidth();
   if(ASPx.IsPercentageSize(mainElement.style.height))
    this.fullScreenTempVars.savedCurrentHeight = mainElement.style.height;
   else
    this.fullScreenTempVars.savedCurrentHeight = this.GetHeight();
  },
  hideBodyScroll: function() {
   ASPx.Attr.ChangeStyleAttribute(document.documentElement, "position", "static");
   ASPx.Attr.ChangeStyleAttribute(document.documentElement, "overflow", "hidden");
  },
  restoreBodyScroll: function() {
   ASPx.Attr.RestoreStyleAttribute(document.documentElement, "overflow");
   ASPx.Attr.RestoreStyleAttribute(document.documentElement, "position");
  },
  togglePlaceholderDiv: function() {
   if(!this.placeholderDiv) {
    this.placeholderDiv = ASPx.CreateHtmlElement();
    ASPx.InsertElementAfter(this.placeholderDiv, this.GetMainElement());
    ASPx.AddClassNameToElement(this.placeholderDiv, constants.PlaceholderDivCssClass);
   }
   ASPx.SetElementDisplay(this.placeholderDiv, this.isInFullScreenMode);
  },
  setExternalRibbonPositionOnPageTop: function() {
   var ribbonMainElement = this.GetRibbon().GetMainElement();
   if(ribbonMainElement.style.position == "fixed")
    return;
   ASPx.Attr.ChangeStyleAttribute(ribbonMainElement, "position", "fixed");
   ASPx.Attr.ChangeStyleAttribute(ribbonMainElement, "top", "0px");
   ASPx.Attr.ChangeStyleAttribute(ribbonMainElement, "left", "0px");
   ASPx.Attr.ChangeStyleAttribute(ribbonMainElement, ASPx.Browser.IE ? "zIndex" : "z-index", 10002);
   if(ASPx.IsPercentageSize(ribbonMainElement.style.width))
    this.fullScreenTempVars.saveRibbonWidth = ribbonMainElement.style.width;
   else
    this.fullScreenTempVars.saveRibbonWidth = this.GetRibbon().GetWidth();
   ribbonMainElement.style.width = "100%";
  },
  restoreExternalRibbonPositionOnPage: function() {
   var ribbonMainElement = this.GetRibbon().GetMainElement();
   if(!ribbonMainElement.style.position)
    return;
   ASPx.Attr.RestoreStyleAttribute(ribbonMainElement, "left");
   ASPx.Attr.RestoreStyleAttribute(ribbonMainElement, "top");
   ASPx.Attr.RestoreStyleAttribute(ribbonMainElement, "position");
   ASPx.Attr.RestoreStyleAttribute(ribbonMainElement, ASPx.Browser.IE ? "zIndex" : "z-index");
   if(this.fullScreenTempVars.saveRibbonWidth) {
    if(!ASPx.IsNumber(this.fullScreenTempVars.saveRibbonWidth) && ASPx.IsPercentageSize(this.fullScreenTempVars.saveRibbonWidth))
     ribbonMainElement.style.width = this.fullScreenTempVars.saveRibbonWidth;
    else
     ribbonMainElement.style.width = this.fullScreenTempVars.saveRibbonWidth + "px";
    this.fullScreenTempVars.saveRibbonWidth = undefined;
   }
  },
  SetWidth: function(width, skipAdjustControl) {
   if(!ASPx.IsNumber(width) && ASPx.IsPercentageSize(width))
    this.setSizeInPercentage("width", width);
   else
    ASPxClientControl.prototype.SetWidth.call(this, width);
   if(!skipAdjustControl)
    this.AdjustControl();
  },
  SetHeight: function(height, skipAdjustControl) {
   if(!ASPx.IsNumber(height) && ASPx.IsPercentageSize(height))
    this.setSizeInPercentage("height", height);
   else
    ASPxClientControl.prototype.SetHeight.call(this, height);
   if(!skipAdjustControl)
    this.AdjustControl();
  },
  setSizeInPercentage: function(sizePropertyName, size){
   this.GetMainElement().style[sizePropertyName] = size;
   this.UpdateAdjustmentFlags();
  },
  isRibbonExternal: function() {
   return !!this.ribbonClientID;
  },
  isRibbon: function (element) {
   var ribbon = this.GetRibbon();
   return ribbon ? ASPx.GetIsParent(ribbon.GetMainElement(), element) : false;
  },
  getRibbonBar: function() {
   for(var i = 0, bar; bar = this.bars[i]; i++)
    if(bar.isRibbon())
     return bar;
   return null;
  },
  GetRibbon: function() {
   var ribbonID = this.ribbonClientID || this.name + constants.RibbonID;
   var ribbon = ASPx.GetControlCollection().Get(ribbonID);
   return ribbon && ASPx.IsValidElement(ribbon.GetMainElement()) ? ribbon : null;
  },
  getStatusBar: function() {
   return this.GetChildElement(constants.Bar);
  },
  getMainViewElement: function () {
   return this.GetChildElement(constants.MainID);
  },
  getViewElement: function () {
   return this.GetChildElement(constants.ViewID);
  },
  getLoadingPanelContainer: function() {
   return this.GetChildElement(constants.LoadingPanel);
  },
  getLoadingPanel: function() {
   if(!this.loadingPanel) {
    var loadingPanelDiv = this.getLoadingPanelContainer();
    this.loadingPanel = ASPx.GetNodeByTagName(loadingPanelDiv, "table", 0);
   }
   return this.loadingPanel;
  },
  GetDialogPopupControl: function() {
   return ASPx.GetControlCollection().Get(this.name + constants.DialogControlID);
  },
  getDialogModalWindow: function() {
   return ASPx.GetControlCollection().Get(this.name + constants.ModalDialogControlID);
  },
  getLastDialog: function () {
   return ASPx.Dialog.GetLastDialog(this);
  },
  getPopupMenu: function() {
   return ASPx.GetControlCollection().Get(this.name + constants.PopupMenuControlID);
  },
  getHelperFrame: function() {
   if(ASPx.Browser.Firefox)
    this.removeHelperFrame();
   if(!this.helperFrame)
    this.helperFrame = this.createHelperFrame();
   return this.helperFrame;
  },
  createHelperFrame: function() {
   var helperFrame = document.createElement("iframe");
   var frameSize = ASPx.Browser.Safari ? "1px" : "0px";
   helperFrame.style.width = frameSize;
   helperFrame.style.height = frameSize;
   helperFrame.name = this.name + constants.HelperFrameID;
   helperFrame.id = this.name + constants.HelperFrameID;
   helperFrame.className = constants.HelperFrameCssClass;
   this.GetMainElement().appendChild(helperFrame);
   return window.frames[helperFrame.name];
  },
  removeHelperFrame: function() {
   var frameElement = this.GetChildElement(constants.HelperFrameID);
   if(frameElement)
    this.GetMainElement().removeChild(frameElement);
   try {
    delete window.frames[this.name + constants.HelperFrameID];
   } catch(e) { }
   if(this.helperFrame)
    this.helperFrame = null;
  },
  getChildElement: function(postfix) {
   return this.GetChildElement(postfix);
  },
  getMainElement: function() {
   this.GetMainElement();
  },
  increaseHandlerRequestCount: function () {
   this.handlerRequestCount++;
  },
  decreaseHandlerRequestCount: function () {
   this.handlerRequestCount--;
  },
  InHandlerRequestProcessing: function () {
   return this.handlerRequestCount > 0;
  },
  InCallback: function () {
   return this.InHandlerRequestProcessing() || ASPxClientControl.prototype.InCallback.call(this);
  },
  lockEndCallbackEvent: function () {
   this.endCallbackEventLockCount++;
  },
  unlockEndCallbackEvent: function () {
   var wasLocked = this.endCallbackEventLocked();
   if (wasLocked) {
    this.endCallbackEventLockCount--;
    var unlocks = !this.endCallbackEventLocked();
    if (unlocks)
     this.RaiseEndCallback();
   }
  },
  endCallbackEventLocked: function () {
   return this.endCallbackEventLockCount > 0;
  },
  RaiseEndCallback: function () {
   if (this.endCallbackEventLocked()) return;
   ASPxClientControl.prototype.RaiseEndCallback.call(this);
  },
  OnCallback: function (result) {
   if (!this.isInternalServiceCallback)
    this.core.closeDocument();
   if (this.callbackOwner != null)
    this.callbackOwner.OnCallback(result);
   else if(typeof result === "string" && result.indexOf(constants.CommandsCallbackPrefix + "|") === 0) {
    if (!this.core.serverDispatcher.onGetResponse(result.substr(constants.CommandsCallbackPrefix.length + 1)))
     this.throwSessionExpiredAlert();
    this.raiseEndSynchronization();
   }
   else {
    this.core.setPersistentReadOnly(result.readOnly);
    this.core.initialize(result.sessionGuid, result.fileName);
    if (!this.core.serverDispatcher.onGetResponse(result.startResponse))
     this.throwSessionExpiredAlert();
   }
  },
  ProcessCallbackError: function(errorObj, callbackId) {
   ASPxClientControl.prototype.ProcessCallbackError.call(this, errorObj, callbackId);
   this.ProcessDialogOnCallbackError();
   if(!this.isInternalServiceCallback)
    this.core.setPersistentReadOnly(false);
  },
  ProcessCallbackGeneralError: function(errorMessage, serverExceptionOnLastCallback) {
   ASPxClientControl.prototype.ProcessCallbackGeneralError.call(this, errorMessage, serverExceptionOnLastCallback);
   this.ProcessDialogOnCallbackError();
   if(!this.isInternalServiceCallback)
    this.core.setPersistentReadOnly(false);
  },
  ProcessDialogOnCallbackError: function() {
   var lastDialog = this.getLastDialog();
   if(lastDialog != null)
    lastDialog.OnCallbackError();
  },
  BrowserWindowResizeSubscriber: function () {
   return this.isInFullScreenMode || ASPxClientControl.prototype.BrowserWindowResizeSubscriber.call(this);
  },
  OnBrowserWindowResize: function(e) {
   if(this.isInFullScreenMode)
    this.adjustControlInFullScreenMode();
   else
    this.AdjustControl();
  },
  ShowLoadingPanel: function() {
   this.CreateLoadingPanelWithAbsolutePosition(this.GetMainElement(), this.GetLoadingPanelOffsetElement(this.core.viewManager.canvas));
  },
  setLoadingPanelVisible: function(visible) {
   var loadingPanel = this.getLoadingPanel();
   if(loadingPanel)
    loadingPanel.style.display = visible ? "" : "none";
  },
  getConfirmUpdateText: function() {
   return this.confirmUpdate;
  },
  getUpdateWatcherHelper: function() {
   return this.updateWatcherHelper;
  },
  setConfirmOnCallbackEnabled: function(enabled) {
   this.getUpdateWatcherHelper().SetConfirmOnCallbackEnabled(enabled);
  },
  setConfirmOnPostbackEnabled: function(enabled) {
   this.getUpdateWatcherHelper().SetConfirmOnPostbackEnabled(enabled);
  },
  confirmOnLosingChanges: function() {
   return this.getUpdateWatcherHelper() ? this.getUpdateWatcherHelper().ConfirmOnCustomControlEvent() : true;
  },
  documentUploadingStarted: function() {
   var updateWatcherHelper = this.getUpdateWatcherHelper();
   if(updateWatcherHelper)
    updateWatcherHelper.StartImageUploadCallback();
  },
  documentUploadingComplete: function() {
   var updateWatcherHelper = this.getUpdateWatcherHelper();
   if(updateWatcherHelper)
    updateWatcherHelper.EndImageUploadCallback();
  },
  syncSessionGuid: function(sessionGuid) {
   this.UpdateStateObjectWithObject({ dxwsid: sessionGuid });
  },
  Focus: function() {
   this.core.focusManager.captureFocus();
  },
  showPopupMenu: function(getPoint) {
   this.core.barManager.updateContextMenu();
   var contextMenuBar = this.getContextMenuBar();
   var menuItemCollection = new ASPxClientRichEditPopupMenuItemCollection(null, contextMenuBar.currentItemProperties);
   var cancel = this.raisePopupMenuShowing(menuItemCollection);
   if(!cancel) {
    contextMenuBar.createItems(menuItemCollection);
    var point = getPoint(contextMenuBar);
    contextMenuBar.control.ShowAtPos(point.x, point.y);
   }
  },
  getContextMenuBar: function() {
   return __aspxRichEdit.ListUtils.elementBy(this.bars, function(bar) { return bar.isContextMenu(); });
  },
  hidePopupMenu: function() {
   var popupMenu = this.getPopupMenu();
   if(popupMenu)
    popupMenu.Hide();
  },
  showQuickSearchPanel: function() {
   var panel = this.getQuickSeachPanel();
   panel.show();
  },
  hideQuickSearchPanel: function() {
   var panel = this.getQuickSeachPanel();
   panel.hide();
  },
  raiseCustomCommandExecuted: function(commandName, parameter) {
   if(!this.CustomCommandExecuted.IsEmpty()) {
    var args = new ASPxClientRichEditCustomCommandExecutedEventArgs(commandName, parameter);
    this.CustomCommandExecuted.FireEvent(this, args);
   }
  },
  raiseBeginSynchronization: function() {
   if(!this.BeginSynchronization.IsEmpty()) {
    var args = new ASPxClientEventArgs();
    this.BeginSynchronization.FireEvent(this, args);
   }
  },
  raiseEndSynchronization: function() {
   if(!this.EndSynchronization.IsEmpty()) {
    var args = new ASPxClientEventArgs();
    this.EndSynchronization.FireEvent(this, args);
   }
  },
  raiseSelectionChanged: function() {
   if(!this.SelectionChanged.IsEmpty()) {
    var args = new ASPxClientEventArgs();
    this.SelectionChanged.FireEvent(this, args);
   }
  },
  UpdateStateObject: function() {
   this.UpdateStateObjectWithObject({ scmds: this.core.serverDispatcher.getRequestJSON(), cguid: this.clientGuid, isc: this.isInternalServiceCallback, viewMergeData: this.core.mailMergeOptions.viewMergedData });
  },
  showLoadingElements: function() {
   this.ShowLoadingElements();
  },
  hideLoadingElements: function() {
   this.HideLoadingElements();
  },
  PerformCallback: function(parameter, onSuccess) {
   this.ShowLoadingElements();
   this.sendCallback(ASPx.FormatCallbackArg(constants.PerformCallbackPrefix, parameter), null, false, onSuccess);
   this.core.setPersistentReadOnly(true);
  },
  HasUnsavedChanges: function() {
   return this.core.getModifiedState() != __aspxRichEdit.IsModified.False;
  },
  ReconnectToExternalRibbon: function() {
   if(this.isRibbonExternal()) {
    this.detachEventsFromRibbon();
    this.attachEventsToRibbon();
   }
  },
  attachEventsToRibbon: function() {
   var ribbonBar = this.getRibbonBar();
   if(ribbonBar) {
    ribbonBar.control = this.GetRibbon();
    ribbonBar.attachEvents();
    this.attachRefocusHandlerToRibbon();
   }
  },
  detachEventsFromRibbon: function() {
   var ribbonBar = this.getRibbonBar();
   if(ribbonBar)
    ribbonBar.detachEvents();
   this.detachRefocusHandlerFromRibbon();
  },
  raiseDocumentLoaded: function () {
   if (!this.DocumentLoaded.IsEmpty()) {
    var args = new ASPxClientEventArgs();
    this.DocumentLoaded.FireEvent(this, args);
   }
  },
  raiseDocumentChanged: function() {
   if(!this.DocumentChanged.IsEmpty()) {
    var args = new ASPxClientEventArgs();
    this.DocumentChanged.FireEvent(this, args);
   }
  },
  raiseActiveSubDocumentChanged: function () {
   if (!this.ActiveSubDocumentChanged.IsEmpty()) {
    var args = new ASPxClientEventArgs();
    this.ActiveSubDocumentChanged.FireEvent(this, args);
   }
  },
  raiseGotFocus: function () {
   if (!this.GotFocus.IsEmpty()) {
    var args = new ASPxClientEventArgs();
    this.GotFocus.FireEvent(this, args);
   }
  },
  raiseLostFocus: function () {
   if (!this.LostFocus.IsEmpty()) {
    var args = new ASPxClientEventArgs();
    this.LostFocus.FireEvent(this, args);
   }
  },
  raisePointerDown: function (evt) {
   var handled = false;
   if (!this.PointerDown.IsEmpty()) {
    var args = new ASPxClientRichEditPointerDownEventArgs(evt, handled);
    this.PointerDown.FireEvent(this, args);
    return args.handled;
   }
  },
  raisePointerUp: function (evt) {
   var handled = false;
   if (!this.PointerUp.IsEmpty()) {
    var args = new ASPxClientRichEditPointerUpEventArgs(evt, handled);
    this.PointerUp.FireEvent(this, args);
    return args.handled;
   }
  },
  raisePopupMenuShowing: function(menuItems){
   if(this.PopupMenuShowing.IsEmpty())
    return false;
   var args = new ASPxClientRichEditPopupMenuShowingEventArgs(menuItems);
   this.PopupMenuShowing.FireEvent(this, args);
   return args.cancel;
  },
  raiseHyperlinkClick: function(evt, hyperlinkInfo) {
   var handled = false;
   if(hyperlinkInfo) {
    var url = hyperlinkInfo.uri || hyperlinkInfo.anchor,
     hyperlinkType = this.getLinkType(hyperlinkInfo);
    var args = new ASPxClientRichEditHyperlinkClickEventArgs(evt, handled, url, hyperlinkType);
    this.HyperlinkClick.FireEvent(this, args);
    handled = args.handled;
   }
   return handled;
  },
  raiseKeyDown: function (evt) {
   var handled = false;
   if (!this.KeyDown.IsEmpty()) {
    var args = new ASPxClientRichEditKeyDownEventArgs(evt, handled);
    this.KeyDown.FireEvent(this, args);
    handled = args.handled;
   }
   return handled;
  },
  raiseKeyUp: function (evt) {
   if (!this.KeyUp.IsEmpty()) {
    var args = new ASPxClientRichEditKeyUpEventArgs(evt);
    this.KeyUp.FireEvent(this, args);
   }
  },
  raiseContentInserted: function (subDocumentId, interval) {
   if (!this.ContentInserted.IsEmpty()) {
    var args = new ASPxClientRichEditContentInsertedEventArgs(subDocumentId, interval);
    this.ContentInserted.FireEvent(this, args);
   }
  },
  raiseContentRemoved: function (subDocumentId, interval) {
   if (!this.ContentRemoved.IsEmpty()) {
    var args = new ASPxClientRichEditContentRemovedEventArgs(subDocumentId, interval);
    this.ContentRemoved.FireEvent(this, args);
   }
  },
  raiseCharacterPropertiesChanged: function (subDocumentId, interval) {
   if (!this.CharacterPropertiesChanged.IsEmpty()) {
    var args = new ASPxClientRichEditCharacterPropertiesChangedEventArgs(subDocumentId, interval);
    this.CharacterPropertiesChanged.FireEvent(this, args);
   }
  },
  raiseParagraphPropertiesChanged: function (subDocumentId, paragraphIndex) {
   if (!this.ParagraphPropertiesChanged.IsEmpty()) {
    var args = new ASPxClientRichEditParagraphPropertiesChangedEventArgs(subDocumentId, paragraphIndex);
    this.ParagraphPropertiesChanged.FireEvent(this, args);
   }
  },
  raiseAutoCorrect: function(text, interval) {
   var handled = false;
   if (!this.AutoCorrect.IsEmpty()) {
    var args = new ASPxClientRichEditAutoCorrectEventArgs(text, interval, handled);
    this.AutoCorrect.FireEvent(this, args);
    handled = args.handled;
   }
   return handled;
  },
  getLinkType: function(hyperlinkInfo) {
   if(hyperlinkInfo.anchor)
    return ASPxClientOfficeDocumentLinkType.Bookmark;
   if(hyperlinkInfo.uri && hyperlinkInfo.uri.substr(0, 7) === "mailto:")
    return ASPxClientOfficeDocumentLinkType.EmailAddress;
   return ASPxClientOfficeDocumentLinkType.Hyperlink;   
  },
  OnDispose: function() {
   ASPxClientControl.prototype.OnDispose.call(this);
   this.detachEventsFromRibbon();
   this.core.dispose();
  }
 });
 ASPxClientRichEdit.Cast = ASPxClientControl.Cast;
 ASPxClientRichEdit.Constants = {
  PerformCallbackPrefix: constants.PerformCallbackPrefix,
  InternalCallBackPostfix: constants.InternalCallBackPostfix,
  UploadControlUrlParameter: constants.UploadControlUrlParameter
 };
 var BarBase = ASPx.CreateClass(null, { 
  constructor: function(control, owner) {
   this.control = control;
   this.owner = owner;
   this.onChanged = new __aspxRichEdit.EventDispatcher(); 
  },
  getCommandKeys: function() { 
  },
  setItemValue: function(key, value) { 
  },
  setItemEnabled: function(key, enabled) { 
  },
  setItemVisible: function(key, visible) { 
  },
  setItemSubItems: function (key, subItems) { 
  },
  setEnabled: function(enabled) { 
  },
  onCanvasMouseDown: function() {
  },
  isVisible: function() { 
   return true;
  },
  isContextMenu: function() { 
   return false;
  },
  isRibbon: function() {
   return false;
  },
  activate: function() {
  },
  hasContextItems: function() {
   return false;
  },
  getContextKeys: function() {
   return [];
  },
  getItem: function(key) {
   return this.control.GetItemByName(key);
  },
  setContextItemVisible: function(key, visible) {
  },
  activateContextItem: function(key){
  },
  updateItemsList: function(suggestions) {
  },
  raiseBarCommandExecuted: function(item, parameter) {
   var key = parseInt(item.name);
   if(!isNaN(key) && __aspxRichEdit.RichEditClientCommand[key] !== undefined)
    this.onChanged.raise("NotifyBarCommandExecuted", key, parameter);
   else
    this.owner.raiseCustomCommandExecuted(item.name, parameter);
  },
  raiseBarUpdateRequested: function() {
   this.onChanged.raise("NotifyBarUpdateRequested");
  },
  completeUpdate: function () {
  }
 });
 var RibbonBar = ASPx.CreateClass(BarBase, {
  constructor: function(control, owner) {
   this.constructor.prototype.constructor.call(this, control, owner);
   this.cache = {};
   this.visibility = ASPxClientRibbonState.Normal;     
   this.contextTabs = null;
   this.attachEvents();
  },
  getCommandKeys: function() { 
   var activeTab = this.control.GetActiveTab();
   var result = [];
   if(activeTab) {
    var itemsCache = this.getItemsCache(activeTab.index);
    for(var itemKey in itemsCache) {
     if(!itemsCache.hasOwnProperty(itemKey)) continue;
     result.push(itemKey);
    }
   }
   return result;
  },
  setItemSubItems: function (key, subItems) {
   var itemsCache = this.getItemsCache(this.control.GetActiveTab().index);
   var obj = [];
   if(parseInt(key) === __aspxRichEdit.RichEditClientCommand.ChangeStyle) {
    obj.push({ text: "Paragraph Styles", items: [] });
    obj.push({ text: "Character Styles", items: [] });
    for(var i = 0, style; style = subItems[0][i]; i++) {
     var psDisplayText = "";
     for(var charIndex = 0, char; char = style.text[charIndex]; charIndex++)
      psDisplayText += charIndex == 0 || style.text[charIndex - 1] == " " ? char.toUpperCase() : char;
     var styleName = __aspxRichEdit.HTMLUtils.prepareTextForRequest(style.value.substring(style.value.indexOf('-') + 1));
     obj[0].items.push({
      text: __aspxRichEdit.RichUtils.specialCharacters.HiddenParagraphMark + " " + psDisplayText,
      value: style.value,
      image: { url: style.data ? constants.Base64ImageDataUrl + style.data : this.owner.getResourceUrl() + "&psimg=" + styleName }
     });
    }
    for(var i = 0, style; style = subItems[1][i]; i++) {
     var csDisplayText = "";
     for(var charIndex = 0, char; char = style.text[charIndex]; charIndex++)
      csDisplayText += charIndex == 0 || style.text[charIndex - 1] == " " ? char.toUpperCase() : char;
     var styleName = __aspxRichEdit.HTMLUtils.prepareTextForRequest(style.value.substring(style.value.indexOf('-') + 1));
     obj[1].items.push({
      text: csDisplayText,
      value: style.value,
      image: { url: style.data ? constants.Base64ImageDataUrl + style.data : this.owner.getResourceUrl() + "&csimg=" + styleName }
     });
    }
   }
   if(parseInt(key) === __aspxRichEdit.RichEditClientCommand.ApplyTableStyle) {
    obj.push({ text: "Table Styles", items: [] });
    for(var i = 0, style; style = subItems[i]; i++) {
     var tsDisplayText = "";
     for(var charIndex = 0, char; char = style.text[charIndex]; charIndex++)
      tsDisplayText += charIndex == 0 || style.text[charIndex - 1] == " " ? char.toUpperCase() : char;
     var styleName = __aspxRichEdit.HTMLUtils.prepareTextForRequest(style.value);
     obj[0].items.push({
      text: tsDisplayText,
      value: style.value,
      image: { url: style.data ? constants.Base64ImageDataUrl + style.data : this.owner.getResourceUrl() + "&tsimg=" + styleName }
     });
    }
   }
   if(obj.length) {
    for(var i = 0, item; item = itemsCache[key][i]; i++) {
     var prevValue = item["aspxricheditsubitems"];
     if(!prevValue || this.areSubItemsChanged(prevValue, obj)) {
      item["aspxricheditsubitems"] = obj;
      item.setItems(obj);
     }
    }
   }
  },
  areSubItemsChanged: function(oldItems, newItems) {
   if(oldItems.length !== newItems.length)
    return true;
   for(var i = oldItems.length - 1; i >= 0; i--) {
    var oldGroup = oldItems[i],
     newGroup = newItems[i];
    if(oldGroup.text !== newGroup.text)
     return true;
    if(oldGroup.items.length !== newGroup.items.length)
     return true;
    for(var j = newGroup.items.length - 1; j >= 0; j--) {
     var oldItem = oldGroup.items[j];
     var newItem = newGroup.items[j];
     if(oldItem.value !== newItem.value)
      return true;
     if(oldItem.text !== newItem.text)
      return true;
    }
   }
   return false;
  },
  setItemValue: function(key, value) {
   var itemsCache = this.getItemsCache(this.control.GetActiveTab().index);
   for(var i = 0, item; item = itemsCache[key][i]; i++) {
    if(item.GetValue() !== value)
     item.SetValue(value);
   }
  },
  setItemEnabled: function(key, enabled) {
   var itemsCache = this.getItemsCache(this.control.GetActiveTab().index);
   for(var i = 0, item; item = itemsCache[key][i]; i++) {
    item.SetEnabled(enabled);
    if(!enabled && key == __aspxRichEdit.RichEditClientCommand.ChangeFontName) {
     var itemEditor = item.getEditor();
     if(itemEditor.focused)
      ASPx.ESLostFocus(itemEditor.name);
    }
   }
  },
  setEnabled: function(enabled) {
   this.control.SetEnabled(enabled);
  },
  onCanvasMouseDown: function() {
   if(this.control.GetItemByName(__aspxRichEdit.RichEditClientCommand.ChangeFontName) != null) {
    var fontNameComboBox = this.control.GetItemByName(__aspxRichEdit.RichEditClientCommand.ChangeFontName).getEditor();
    if(fontNameComboBox.HasChanges())
     fontNameComboBox.OnApplyChangesInternal();
   }
   if(this.control.GetItemByName(__aspxRichEdit.RichEditClientCommand.ChangeFontSize) != null) {
    var fontSizeComboBox = this.control.GetItemByName(__aspxRichEdit.RichEditClientCommand.ChangeFontSize).getEditor();
    if(fontSizeComboBox.HasChanges())
     fontSizeComboBox.OnApplyChangesInternal();
   }
  },
  isVisible: function() {
   return this.visibility != ASPxClientRibbonState.Minimized;
  },
  getItemsCache: function(tabIndex) {
   if(!this.control["aspxricheditlink"]) {
    this.cache = {};
    this.control["aspxricheditlink"] = true;
   }
   if(!this.cache[tabIndex]) {
    this.cache[tabIndex] = {};
    var tab = this.control.GetTab(tabIndex);
    for(var i = 0, group; group = tab.groups[i]; i++) {
     this.ensureSubItemsCache(tabIndex, group);
    }
   }
   return this.cache[tabIndex];
  },
  ensureSubItemsCache: function(tabIndex, parentItem) {
   for(var i = 0, item; item = parentItem.items[i]; i++) {
    var key = parseInt(item.name);
    if(!isNaN(key) && __aspxRichEdit.RichEditClientCommand[key] !== undefined) {
     if(!this.cache[tabIndex][key])
      this.cache[tabIndex][key] = [];
     this.cache[tabIndex][key].push(item);
    }
    if(item.items && item.items.length)
     this.ensureSubItemsCache(tabIndex, item);
   }
  },
  attachEvents: function() {
   this.control.CommandExecuted.AddHandler(function(s, e) {
    var activeElement = ASPx.GetActiveElement();
    if(activeElement && !ASPx.IsInteractiveControl(activeElement))
     this.owner.Focus();
    this.raiseBarCommandExecuted(e.item, e.parameter);
   }.aspxBind(this), this.owner);
   this.control.MinimizationStateChanged.AddHandler(function(s, e) {
    this.visibility = e.ribbonState;
    if(e.ribbonState == ASPxClientRibbonState.TemporaryShown)
     this.raiseBarUpdateRequested();
    this.owner.ribbonStateChanged(); 
   }.aspxBind(this), this.owner);
   this.control.DialogBoxLauncherClicked.AddHandler(function(s, e) { this.raiseBarCommandExecuted(e.group, null); }.aspxBind(this), this.owner);
   this.control.ActiveTabChanged.AddHandler(function(s, e) { this.raiseBarUpdateRequested(); }.aspxBind(this), this.owner);
   this.control.KeyTipsClosedOnEscape.AddHandler(function(s, e) { this.owner.Focus(); }.aspxBind(this), this.owner);
  },
  detachEvents: function() {
   this.control.CommandExecuted.removeHandlerByControlName(this.owner.name);
   this.control.MinimizationStateChanged.removeHandlerByControlName(this.owner.name);
   this.control.DialogBoxLauncherClicked.removeHandlerByControlName(this.owner.name);
   this.control.ActiveTabChanged.removeHandlerByControlName(this.owner.name);
   this.control.KeyTipsClosedOnEscape.removeHandlerByControlName(this.owner.name);
  },
  hasContextItems: function() {
   return true;
  },
  getContextKeys: function() {
   if(!this.contextTabs) {
    this.contextTabs = [];
    for(var tab, i = 0; tab = this.control.tabs[i]; i++) {
     if(tab.isContext && tab.categoryName)
      this.contextTabs.push(parseInt(tab.categoryName));
    }
   }
   return this.contextTabs;
  },
  setContextItemVisible: function(key, visible) {
   this.control.SetContextTabCategoryVisible(key, visible);
  },
  activateContextItem: function(key) {
   for(var tab, i = 0; tab = this.control.tabs[i]; i++) {
    if(tab.isContext && tab.categoryName == key) {
     this.control.SetActiveTab(tab);
     break;
    }
   }
  },
  isRibbon: function() {
   return true;
  },
  activate: function() {
   this.control.ShowKeyTips();
  }
 });
 var ContextMenuBar = ASPx.CreateClass(BarBase, {
  constructor: function(control, owner) {
   this.constructor.prototype.constructor.call(this, control, owner);
   this.cache = {};
   this.isSpellingMenu = false;
   this.itemProperties = ASPxClientRichEdit.PopupMenuItemProperties;
   this.spellingItemProperties = ASPxClientRichEdit.SpellingPopupMenuItemProperties;
   this.currentItemProperties = [];
   this.initializeItemProperties(this.itemProperties);
   this.initializeItemProperties(this.spellingItemProperties);
   this.initializeEvents();
  },
  initializeItemProperties: function(items) {
   if(!ASPx.IsExists(items))
    return;
   for(var i = 0, item; item = items[i]; i++) {
    if (item.imageName)
     item.imageClassName = this.getImageClassName(this.owner.menuIconSet, item.imageName);
    if(item.items)
     this.initializeItemProperties(item.items);
   }
  },
  getImageClassName: function(iconSetName, imageName){
   return "dxRichEdit_" + iconSetName + "_" + imageName;
  },
  initializeEvents: function() {
   this.control.ItemClick.AddHandler(function(s, e) {
    var parameter = e.item.name == this.getChangeSpellingErrorCommandId() ? e.item.text : null;
    if(!this.hasSubItems(e.item))
     this.control.Hide();
    this.raiseBarCommandExecuted(e.item, parameter);
    if(this.owner.core.isTouchMode())
     this.owner.Focus();
   }.aspxBind(this));
   this.control.CloseUp.AddHandler(function(s, e) {
    if(!ASPx.Browser.TouchUI && !e.item.parent)
     this.owner.Focus();
   }.aspxBind(this));
   this.control.PopUp.AddHandler(function(s, e) {
    this.raiseBarUpdateRequested();
   }.aspxBind(this));
  },
  isVisible: function() {
   return this.control.IsVisible();
  },
  getCommandKeys: function() { 
   var itemsCache = this.getItemsCache();
   var result = [];
   for(var itemKey in itemsCache) {
    if(!itemsCache.hasOwnProperty(itemKey)) continue;
    result.push(parseInt(itemKey));
   }
   return result;
  },
  setItemValue: function(key, value) {
   var itemsCache = this.getItemsCache();
   for(var i = 0, item; item = itemsCache[key][i]; i++)
    item.value = value;
  },
  setItemEnabled: function(key, enabled) {
   var itemsCache = this.getItemsCache();
   for(var i = 0, item; item = itemsCache[key][i]; i++)
    item.enabled = enabled;
  },
  setItemVisible: function(key, visible) {
   var itemsCache = this.getItemsCache();
   for(var i = 0, item; item = itemsCache[key][i]; i++)
    item.visible = visible;
  },
  setEnabled: function(enabled) {
   this.control.SetEnabled(enabled);
  },
  isContextMenu: function() {
   return true;
  }, 
  getItemsCache: function() {
   if(!this.control["aspxricheditlink"]) {
    this.cache = null;
    this.control["aspxricheditlink"] = true;
   }
   if(!this.cache) {
    this.cache = {};
    this.ensureSubItemsCache(this.currentItemProperties);
   }
   return this.cache;
  },
  ensureSubItemsCache: function(itemProperties) {
   for(var i = 0, item; item = itemProperties[i]; i++) {
    var key = parseInt(item.name);
    if(!isNaN(key) && __aspxRichEdit.RichEditClientCommand[key] !== undefined) {
     if(!this.cache[key])
      this.cache[key] = [];
     this.cache[key].push(item);
    }
    this.ensureSubItemsCache(item.items);
   }
  },
  updateItemsList: function(suggestions) {
   this.clearCache();
   if(suggestions === undefined) {
    this.currentItemProperties = this.itemProperties.slice();
    this.isSpellingMenu = false;
   } else {
    var suggestionItemProperties = this.createSuggestionItemProperties(suggestions);
    this.currentItemProperties = suggestionItemProperties.concat(this.spellingItemProperties);
    this.isSpellingMenu = true;
   }
  },
  createItems: function(menuItemCollection) {
   this.control.ClearItems();
   this.control.CreateItems(menuItemCollection);
   this.setStyleForSuggestionItems(menuItemCollection);
  },
  clearCache: function() {
   this.cache = null;
   this.control["aspxricheditlink"] = false;
  },
  createSuggestionItemProperties: function(suggestions) {
   var suggestionItemProperties = [];
   if(suggestions)
    if(suggestions.length > 0)
     for(var i = 0, suggestion; suggestion = suggestions[i]; i++) {
      var suggestionItemProprty = new ASPxClientRichEditPopupMenuItem();
      suggestionItemProprty.name = this.getChangeSpellingErrorCommandId();
      suggestionItemProprty.text = suggestion;
      suggestionItemProperties.push(suggestionItemProprty);
     }
    else {
     var suggestionItemProprty = new ASPxClientRichEditPopupMenuItem();
     suggestionItemProprty.enabled = false;
     suggestionItemProprty.text = ASPxClientRichEdit.ASPxRichEditDialogList.OtherLabels.NoSpellingSuggestions;
     suggestionItemProperties.push(suggestionItemProprty);
    }
   return suggestionItemProperties;
  },
  setStyleForSuggestionItems: function(menuItemCollection) {
   for(var i = 0, item; item = menuItemCollection[i]; i++)
    if(item.name == this.getChangeSpellingErrorCommandId())
     ASPx.AddClassNameToElement(this.control.GetItemElement(i), constants.SuggestionMenuItemCssClass);
  },
  getChangeSpellingErrorCommandId: function() {
   return __aspxRichEdit.RichEditClientCommand.ChangeSpellingError;
  },
  hasSubItems: function(item) {
   return item.items.length > 0;
  }
 });
 var RichEditUpdateWatcherHelper = ASPx.CreateClass(ASPx.UpdateWatcherHelper, {
  constructor: function(owner) {
   this.constructor.prototype.constructor.call(this, owner);
   this.richedit = owner;
   this.confirmOnCallback = false;
   this.confirmOnPostback = false;
   this.isInUploadControlCallback = false;
  },
  HasChanges: function() {
   return this.richedit.getModifiedState();
  },
  NeedConfirmOnCallback: function(dxCallbackOwner, arg) {
   return this.confirmOnCallback && arg.indexOf(constants.InternalCallbackPrefix) !== 0;
  },
  NeedConfirmOnPostback: function() {
   return this.confirmOnPostback;
  },
  GetConfirmUpdateText: function() {
   return this.richedit.getConfirmUpdateText();
  },
  SetConfirmOnCallbackEnabled: function(enabled) {
   this.confirmOnCallback = enabled;
  },
  SetConfirmOnPostbackEnabled: function(enabled) {
   this.confirmOnPostback = enabled;
  },
  StartImageUploadCallback: function() {
   this.isInUploadControlCallback = true;
  },
  EndImageUploadCallback: function() {
   this.isInUploadControlCallback = false;
  },
  isInUploadCallback: function() {
   return this.isInUploadControlCallback;
  }
 });
 var ASPxClientRichEditPopupMenuItem = ASPx.CreateClass(ASPx.OfficePopupMenuItem, {
 });
 var ASPxClientRichEditPopupMenuItemCollection = ASPx.CreateClass(ASPx.OfficePopupMenuItemCollection, {
 });
 window.ASPxClientRichEdit = ASPxClientRichEdit;
 window.ASPxClientRichEditCustomCommandExecutedEventArgs = ASPxClientRichEditCustomCommandExecutedEventArgs;
 window.ASPxClientRichEditHyperlinkClickEventArgs = ASPxClientRichEditHyperlinkClickEventArgs;
 window.ASPxClientRichEditPopupMenuShowingEventArgs = ASPxClientRichEditPopupMenuShowingEventArgs;
 window.ASPxClientRichEditPopupMenuItem = ASPxClientRichEditPopupMenuItem;
 window.ASPxClientRichEditPopupMenuItemCollection = ASPxClientRichEditPopupMenuItemCollection;
 dx.RichEditContextMenuBar = ContextMenuBar;
})(dx || (dx = {}));
          ﻿(function () {
 __aspxRichEdit.StylesManager.populatePresetStyles(<%=WebResource("custom:RichEditDefaultFontsAndPresetStyles") %>);
})();      ΍ ﻿(function() {
 var constants = {
  SaveImageToServerCallbackPrefix: "REITS",
  SaveImageToServerErrorCallbackPrefix: "REISE",
  SaveImageToServerNewUrlCallbackPrefix: "REISU",
  ColumnsEditorCallbackPrefix: "RECE",
  SymbolListCallbackPrefix: "RESL",
  Prefix: "dxre-",
  PreviewTextElementID: "_dxInsertImagePreviewText",
  PreviewImageElementID: "_dxInsertImagePreviewImage",
  TableBorderPreviewElementID: "_borderContainerPreview",
  WidthSpinElementName: "dxreDialog_SpnColumnsWidth",
  SpacingSpinElementName: "dxreDialog_SpnColumnsSpacing",
  ColumnsPresetElementName: "dxreDialog_BtnPreset",
  UrlAreaElementID: "_dxreUrlArea",
  EmailToAreaElementID: "_dxreEmailToArea",
  EmailSubjectAreaElementID: "_dxreEmailSubjectArea",
  SearchResultLabelID: "_dxSearchResultLabel",
  AbstractNumberingListElementID: "_dxeAbstractNumberingList_",
  BulletedPresetElementName: "dxreDialog_BulletedPreset",
  DefaultLinkPrefix : "http://",
  MailToPrefex : "mailto:",
  SubjectPrefix : "?subject=",
  DialogListBoxClass: "dxreDlgListBox",
  ListSelectedClass: "dxreDlgListSelected",
  ListHoverClass: "dxreDlgListHover",
  NumberingListPreviewClass: "dxreDlgNumberingListPreview",
  BorderLineClass: "dxrePreviewBorderLine",
  BorderVerticalLineClass: "dxrePreviewVerticalLine",
  BorderHorizontalLineClass: "dxrePreviewHorizontalLine",
  BorderControlLineClass: "dxrePreviewBorderControlLine",
  BorderTopLineClass: "dxrePreviewTopLine",
  BorderMiddleLineClass: "dxrePreviewMiddleLine",
  BorderBottomLineClass: "dxrePreviewBottomLine",
  BorderLeftLineClass: "dxrePreviewLeftLine",
  BorderCenterLineClass: "dxrePreviewCenterLine",
  BorderRightLineClass: "dxrePreviewRightLine",
  PreviewCellClass: "dxrePreviewCell",
  PreviewTextClass: "dxrePreviewTextLine",
  PreviewTopLeftCellClass: "dxrePreviewTopLeftCell",
  PreviewTopRightCellClass: "dxrePreviewTopRightCell",
  PreviewBottomLeftCellClass: "dxrePreviewBottomLeft",
  PreviewBottomRightCellClass: "dxrePreviewBottomRight"
 };
 var ASPxRichEditDialog = ASPx.CreateClass(ASPx.Dialog, {
  Execute: function(ownerControl, parameters, callback, afterClosing, isModal) {
   this.richedit = ownerControl;
   this.callback = callback;
   this.parameters = parameters;
   this.afterClosing = afterClosing;
   this.SetDialogNameInput();
   this.isOnCallbackError = false;
   this.isModal = isModal;
   ASPx.Dialog.prototype.Execute.call(this, ownerControl);
  },
  InitializePopupElements: function() {
   ASPx.Dialog.prototype.InitializePopupElements.call(this);
   this.GetDialogPopup().allowDraggingInAdaptiveMode = true;
   this.GetDialogPopup().switchAtWindowInnerWidth = 3000;
  },
  OnCallbackError: function(result, data) {
   this.isOnCallbackError = true;
   this.ClearDialogNameInput();
   this.HideDialog(null, true);
   ASPx.Dialog.prototype.OnCallbackError.call(this, result);
  },
  OnClose: function() {
   if(this.richedit.isInFullScreenMode)
    this.richedit.hideBodyScroll();
   ASPx.Dialog.prototype.OnClose.call(this);
   this.ClearDialogNameInput();
   ASPx.RemoveClassNameFromElement(this.GetDialogPopup().GetCurrentWindowElement(), constants.Prefix + this.name);
   if(this.afterClosing)
    this.afterClosing();
  },
  OnComplete: function(result, params) {
   this.DoCustomAction(result, params);
   this.HideDialogPopup();
  },
  OnInitComplete: function() {
   ASPx.Dialog.prototype.OnInitComplete.call(this);
   this.attachEvents();
   this.UpdatePopupPosition();
   var popupElement = this.GetDialogPopup().GetCurrentWindowElement();
   ASPx.AddClassNameToElement(popupElement, constants.Prefix + this.name);
   if (popupElement && popupElement.style.width)
    ASPx.Attr.RemoveAttribute(popupElement.style, "width");
   if (!this.isModal) {
    this.GetDialogPopup().GetWindowElement(-1).style.pointerEvents = "auto";
    this.GetDialogPopup().GetModalWrapperElement(-1).style.pointerEvents = "none";
    this.GetDialogPopup().GetWindowModalElement(-1).style.pointerEvents = "none";
   }
  },
  onOkButtonClick: function() {
   if(this.isDialogValid())
    this.OnComplete(1);
  },
  onCancelButtonClick: function() {
   this.OnComplete(0);
  },
  ClearDialogNameInput: function() {
   this.richedit.UpdateStateObjectWithObject({ currentDialog: "" });
  },
  SetDialogNameInput: function() {
   this.richedit.UpdateStateObjectWithObject({ currentDialog: this.name });
  },
  DoCustomAction: function(result) {
   if(result)
    this.callback(this.GetResultParameters());
   else
    this.callback(null);
  },
  ShowLoadingPanelOverDialogPopup: function() {
   var offsetElement = this.GetDialogPopup().GetWindowContentElement(-1);
   this.richedit.CreateLoadingDiv(document.body, offsetElement);
   this.richedit.CreateLoadingPanelWithAbsolutePosition(document.body, offsetElement);
  },
  SendCallbackForDialogContent: function() {
   this.richedit.sendInternalServiceCallback(ASPx.dialogFormCallbackStatus, this.name, this);
  },
  GetInitInfoObject: function() {
   return this.parameters;
  },
  GetResultParameters: function() {
   return {};
  },
  toggleFullScreen: function() {
   this.richedit.SetFullscreenMode(!this.richedit.isInFullScreenMode);
   this.GetDialogPopup().UpdatePosition();
  },
  SetFocusInField: function() {
   var focusedElement = this.GetFocusedElement();
   if(focusedElement)
    setTimeout(function() { focusedElement.SetFocus(); }, 100);
  },
  GetFocusedElement: function() {
   return null;
  },
  attachEvents: function() {
   executeIfExists("dxreDialog_BtnOk", function(element) {
    element.Click.AddHandler(this.onOkButtonClick.aspxBind(this));
   }.aspxBind(this));
   executeIfExists("dxreDialog_BtnCancel", function(element) {
    element.Click.AddHandler(this.onCancelButtonClick.aspxBind(this));
   }.aspxBind(this));
  },
  isDialogValid: function() {
   return true;
  }
 });
 var FileExistenceMode = {
  Exist: 0,
  Free: 1,
  NotEnoughData: 2,
  FolderNotExist: 3
 };
 var RESaveAsDialog = ASPx.CreateClass(ASPxRichEditDialog, {
  OnInitComplete: function() {
   ASPxRichEditDialog.prototype.OnInitComplete.apply(this, arguments);
   if(typeof (ASPxClientRichEditFolderManager) != "undefined") {
    ASPxClientRichEditFolderManager.SetOwner(this.GetDialogPopup().GetContentContainer(-1), this.richedit);
    if(this.isFileManagerExist())
     setTimeout(function() { FileManager.Refresh(); }, 0);
   }
  },
  GetResultParameters: function() {
   var returnedObject = this.GetInitInfoObject();
   returnedObject.fileSavedToServer = this.isFileSavedToServer();
   if (returnedObject.fileSavedToServer) {
    returnedObject.folderPath = __aspxRichEdit.FileNameHelper.normalizeVirtualFolderPath(FileManager.GetCurrentFolderPath("\\", true), true);
    returnedObject.fileName = dxreDialog_TbxFileName.GetText();
    returnedObject.documentFormat = parseInt(dxreDialog_CbxFileType.GetValue());
   }
   else {
    returnedObject.folderPath = undefined;
    returnedObject.fileName = undefined;
    returnedObject.documentFormat = parseInt(dxreDialog_CbxDownloadFileType.GetValue());
   }
   return returnedObject;
  },
  InitializeDialogFields: function(parameters) {
   this.toggleElements();
   this.hasFolderManager = this.isFileManagerExist() && typeof (ASPxClientRichEditFolderManager) != "undefined" && FileManager instanceof ASPxClientRichEditFolderManager;
   if (this.hasFolderManager) {
    dxreDialog_TbxFolderPath.SetText(__aspxRichEdit.FileNameHelper.normalizeVirtualFolderPath(FileManager.GetCurrentFolderPath()) + parameters.folderPath);
    dxreDialog_TbxFileName.SetText(parameters.fileName);
    this.InitializeFileExtensionComboBox(dxreDialog_CbxFileType, parameters.documentFormat);
   }
   if(typeof(dxreDialog_CbxDownloadFileType) != "undefined")
    this.InitializeFileExtensionComboBox(dxreDialog_CbxDownloadFileType, parameters.documentFormat);
  },
  InitializeFileExtensionComboBox: function (combobox, documentFormat) {
   var fileExtensionItem = combobox.FindItemByValue(documentFormat.toString());
   if(fileExtensionItem)
    combobox.SetSelectedItem(fileExtensionItem);
   else
    combobox.SetSelectedIndex(0);
  },
  attachEvents: function() {
   ASPxRichEditDialog.prototype.attachEvents.call(this);
   executeIfExists("dxreDialog_RblNavigation", function(element) {
    element.ValueChanged.AddHandler(this.toggleElements.aspxBind(this));
   }.aspxBind(this));
   executeIfExists("dxreDialog_TbxFolderPath", function(element) {
    element.ButtonClick.AddHandler(this.OnBrowserButtonClick.aspxBind(this));
   }.aspxBind(this));
   executeIfExists("BrowsePopup", function(element) {
    element.PopUp.AddHandler(this.OnBrowserPopupOpen.aspxBind(this));
    element.CloseUp.AddHandler(this.OnBrowserPopupClose.aspxBind(this));
   }.aspxBind(this));
   executeIfExists("dxreDialog_BtnSelect", function(element) {
    element.Click.AddHandler(this.SelectFolderForm_FolderSelected.aspxBind(this));
   }.aspxBind(this));
   executeIfExists("dxreDialog_BtnCancleSelect", function(element) {
    element.Click.AddHandler(BrowsePopup.Hide.aspxBind(BrowsePopup));
   }.aspxBind(this));
   if (this.hasFolderManager)
    executeIfExists("FileManager", function(element) {
     element.SelectedFileOpened.AddHandler(this.SelectFolderForm_FolderSelected.aspxBind(this));
    }.aspxBind(this));
   dxreDialog_BtnDownload.Click.AddHandler(this.onOkButtonClick.aspxBind(this));
  },
  GetFocusedElement: function() {
   return this.isFileSavedToServer() ? dxreDialog_TbxFileName : dxreDialog_CbxDownloadFileType;
  },
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.SaveAsFile;
  },
  toggleElements: function() {
   var folderPath = dxreDialog_FormLayout.GetItemByName("TbxFolderPath");
   var fileName = dxreDialog_FormLayout.GetItemByName("TbxFileName");
   var fileType = dxreDialog_FormLayout.GetItemByName("CbxFileType");
   var downloadFileType = dxreDialog_FormLayout.GetItemByName("CbxDownloadFileType");
   isFileSavedToServer = this.isFileSavedToServer();
   if(downloadFileType)
    downloadFileType.SetVisible(!isFileSavedToServer);
   if (folderPath && fileName && fileType) { 
    folderPath.SetVisible(isFileSavedToServer);
    fileName.SetVisible(isFileSavedToServer);
    fileType.SetVisible(isFileSavedToServer);
   }
   dxreDialog_BtnOk.SetVisible(isFileSavedToServer);
   dxreDialog_BtnDownload.SetVisible(!isFileSavedToServer);
  },
  OnBrowserButtonClick: function() {
   FileManager.browsePopup = BrowsePopup;
   BrowsePopup.Show();
   FileManager.Refresh();
   FileManager.Focus();
  },
  OnBrowserPopupOpen: function() {
   ASPx.Attr.ChangeAttribute(dxreDialog_LayoutWrapper.mainElement, "onkeypress", "");
  },
  OnBrowserPopupClose: function() {
   ASPx.Attr.RestoreAttribute(dxreDialog_LayoutWrapper.mainElement, "onkeypress");
   dxreDialog_TbxFolderPath.Focus();
  },
  SelectFolderForm_FolderSelected: function() {
   BrowsePopup.Hide();
   var documentUrl = __aspxRichEdit.FileNameHelper.normalizeVirtualFolderPath(FileManager.GetCurrentFolderPath("\\", false));
   dxreDialog_TbxFolderPath.SetText(documentUrl);
   var selectedFile = FileManager.GetSelectedFile();
   if (selectedFile) {
    var fileInfo = new __aspxRichEdit.FileNameHelper(documentUrl + selectedFile.name);
    var comboBoxExtItem = dxreDialog_CbxFileType.FindItemByValue(fileInfo.documentFormat.toString());
    if(comboBoxExtItem)
     dxreDialog_CbxFileType.SetSelectedItem(comboBoxExtItem);
    dxreDialog_TbxFileName.SetText(fileInfo.name);
   }
  },
  isFileSavedToServer: function() {
   if(typeof(dxreDialog_RblNavigation) != "undefined")
    return dxreDialog_RblNavigation.GetValue() ? false : true;
   else
    return typeof(dxreDialog_TbxFileName) != "undefined";
  },
  isDialogValid: function() {
   return this.isValidFields_SaveFileForm() && this.checkAndConfirmToRewriteExistingFile();
  },
  isValidFields_SaveFileForm: function() {
   return (typeof(dxreDialog_TbxFolderPath) != "undefined" && dxreDialog_TbxFolderPath.IsVisible()) ? ASPxClientEdit.ValidateGroup("_dxeTbxSaveFilePathGroup") : true;
  },
  checkAndConfirmToRewriteExistingFile: function() {
   var isValid = true;
   if (this.isFileSavedToServer()) {
    var fileExistanceMode = this.getFileExistanceMode();
    if (fileExistanceMode === FileExistenceMode.Exist)
     isValid = confirm(dxreDialog_TbxFileName.GetText() + __aspxRichEdit.FileNameHelper.convertToString(parseInt(dxreDialog_CbxFileType.GetValue())) + " " + ASPxRichEditDialogList.OtherLabels.ConfirmToRewriteExistingFile);
    else if (fileExistanceMode === FileExistenceMode.NotEnoughData) {
     isValid = false;
     this.submitDialogAfterFileManagerRecievedData = true;
    } else if (fileExistanceMode === FileExistenceMode.FolderNotExist) {
     isValid = false;
     alert(dxreDialog_dxHfMessage.Get("FolderInvalidMessage"));
    }
   }
   return isValid;
  },
  getFileExistanceMode: function() {
   var fileExistanceMode = FileExistenceMode.Free;
   var folderVirtualPath = this.getFolderVirtualPath(),
    folderPath = this.getFolderRelativePath();
   if(this.isFileManagerExist()) {
    if(FileManager.GetCurrentFolderPath() !== folderVirtualPath && !this.inFileUpdateRequest())
     FileManager.SetCurrentFolderPath(folderPath);
    if(!FileManager.InCallback()) {
     if(FileManager.GetCurrentFolderPath() === folderVirtualPath) {
      var itemCollection = FileManager.GetItems(),
       fullFileName = dxreDialog_TbxFileName.GetText() + __aspxRichEdit.FileNameHelper.convertToString(parseInt(dxreDialog_CbxFileType.GetValue()));
      if(itemCollection) {
       if(__aspxRichEdit.ListUtils.anyOf(itemCollection, function(item) { return item.name === fullFileName; }))
        fileExistanceMode = FileExistenceMode.Exist;
      }
     } else {
      fileExistanceMode = FileExistenceMode.FolderNotExist;
     }
    } else {
     fileExistanceMode = FileExistenceMode.NotEnoughData;
    }
   }
   return fileExistanceMode;
  },
  onFileManagerReceivedData: function() {
   if(this.inFileUpdateRequest()) {
    this.onOkButtonClick();
    this.submitDialogAfterFileManagerRecievedData = false;
   }
  },
  getFolderVirtualPath: function() {
   var folderPath = __aspxRichEdit.FileNameHelper.normalizeVirtualFolderPath(dxreDialog_TbxFolderPath.GetText(), true);
   if(folderPath[folderPath.length - 1] === "\\")
    folderPath = folderPath.substring(0, folderPath.length - 1);
   return folderPath;
  },
  getFolderRelativePath: function() {
   return this.removeRootFolder(this.getFolderVirtualPath());
  },
  removeRootFolder: function(filePath) {
   var rootFolderSeparatorPosition = filePath.indexOf("\\");
   if(rootFolderSeparatorPosition >= 0)
    filePath = filePath.substring(rootFolderSeparatorPosition + 1);
   return filePath;
  },
  inFileUpdateRequest: function() {
   return this.submitDialogAfterFileManagerRecievedData;
  },
  isFileManagerExist: function() {
   return typeof (FileManager) !== "undefined";
  }
 });
 var REOpenFileDialog = ASPx.CreateClass(ASPxRichEditDialog, {
  OnInitComplete: function() {
   ASPxRichEditDialog.prototype.OnInitComplete.apply(this, arguments);
   if(typeof(ASPxClientRichEditFileManager) != "undefined")
    ASPxClientRichEditFileManager.SetOwner(this.GetDialogPopup().GetContentContainer(-1), this.richedit);
   if(FileManager)
    setTimeout(function() {
     FileManager.Refresh();
     FileManager.setFocusToFilterBox();
    }, 0);
   this.SetOkButtonEnabled(false);
  },
  GetResultParameters: function() {
   var returnedObject = this.GetInitInfoObject();
   returnedObject.src = __aspxRichEdit.FileNameHelper.normalizeVirtualFolderPath(FileManager.GetCurrentFolderPath("\\", true), true) + FileManager.GetSelectedFile().name;
   return returnedObject;
  },
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.OpenFile;
  },
  attachEvents: function() {
   ASPxRichEditDialog.prototype.attachEvents.call(this);
   FileManager.SelectedFileOpened.AddHandler(function(s, e) {
    this.onOkButtonClick();
   }.aspxBind(this));
   FileManager.SelectedFileChanged.AddHandler(function(s, e) {
    this.SetOkButtonEnabled(!!e.file);
   }.aspxBind(this));
  },
  SetOkButtonEnabled: function(value) {
   dxreDialog_BtnOk.SetEnabled(value);
  },
 });
 var REFontDialog = ASPx.CreateClass(ASPxRichEditDialog, {
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.Font;
  },
  InitializeDialogFields: function(parameters) {
   dxreDialog_CbxFontName.SetText(parameters.fontName);
   dxreDialog_CbxFontStyle.SetValue(parameters.fontStyle);
   dxreDialog_CbxFontSize.SetValue(parameters.fontSize < 0 ? null : parameters.fontSize);
   dxreDialog_CeFontColor.SetValue(parameters.fontColor);
   dxreDialog_CbxUnderlineStyle.SetValue(parameters.fontUnderlineType);
   dxreDialog_RblStrikeout.SetValue(parameters.fontStrikeoutType);
   dxreDialog_CbUnderlineWordsOnly.SetValue(parameters.underlineWordsOnly);
   dxreDialog_RblSubscript.SetValue(parameters.script);
   dxreDialog_ChkAllCaps.SetValue(parameters.allCaps);
   dxreDialog_ChkHidden.SetValue(parameters.hidden);
   dxreDialog_CeUnderlineColor.SetValue(parameters.fontUnderlineColor);
  },
  GetFocusedElement: function() {
   return dxreDialog_CbxFontName;
  },
  GetResultParameters: function() {
   var returnedObject = this.GetInitInfoObject();
   returnedObject.fontName = dxreDialog_CbxFontName.GetValue();
   returnedObject.fontStyle = dxreDialog_CbxFontStyle.GetValue();
   returnedObject.fontSize = dxreDialog_CbxFontSize.GetValue() === null ? -1 : parseFloat(dxreDialog_CbxFontSize.GetValue());
   returnedObject.fontColor = dxreDialog_CeFontColor.GetValue();
   returnedObject.fontUnderlineType = dxreDialog_CbxUnderlineStyle.GetValue();
   returnedObject.fontStrikeoutType = dxreDialog_RblStrikeout.GetValue();
   returnedObject.underlineWordsOnly = dxreDialog_CbUnderlineWordsOnly.GetValue();
   returnedObject.script = dxreDialog_RblSubscript.GetValue();
   returnedObject.allCaps = dxreDialog_ChkAllCaps.GetValue();
   returnedObject.hidden = dxreDialog_ChkHidden.GetValue();
   returnedObject.fontUnderlineColor = dxreDialog_CeUnderlineColor.GetValue();
   return returnedObject;
  },
  isDialogValid: function() {
   var fontSizeValue = new RegExp(/^\d+(\.[05])?$/).test(dxreDialog_CbxFontSize.GetValue()) ? parseFloat(dxreDialog_CbxFontSize.GetValue()) : null;
   if(fontSizeValue === null || fontSizeValue < __aspxRichEdit.RichUtils.minFontSize || fontSizeValue > __aspxRichEdit.RichUtils.maxFontSize) {
    dxreDialog_CbxFontSize.isValid = false;
    dxreDialog_CbxFontSize.errorText = ASPx.Formatter.Format(dxreDialog_CbxFontSize.errorText, __aspxRichEdit.RichUtils.minFontSize, __aspxRichEdit.RichUtils.maxFontSize);
    dxreDialog_CbxFontSize.UpdateErrorFrameAndFocus(false, true);
    return false;
   }
   return true;
  }
 });
 var REParagraphDialog = ASPx.CreateClass(ASPxRichEditDialog, {
  defaultFormatString: "",
  lineSpacing: 0,
  lineSpacingMultiple: 0,
  pageWidth: 0,
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.Paragraph;
  },
  InitializeDialogFields: function(parameters) {
   dxreDialog_CbxAlign.SetValue(parameters.alignment);
   dxreDialog_CbxOutlineLevel.SetValue(parameters.outlineLevel);
   dxreDialog_SpnLeft.SetValue(parameters.leftIndent);
   dxreDialog_SpnRight.SetValue(parameters.rightIndent);
   dxreDialog_CbxSpecial.SetValue(parameters.firstLineIndentType);
   dxreDialog_SpnBy.SetValue(parameters.firstLineIndent);
   dxreDialog_SpnBefore.SetValue(parameters.spacingBefore);
   dxreDialog_SpnAfter.SetValue(parameters.spacingAfter);
   dxreDialog_CbxLineSpacing.SetValue(parameters.lineSpacingType);
   dxreDialog_ChkNoSpace.SetValue(parameters.contextualSpacing);
   dxreDialog_ChkKLT.SetValue(parameters.keepLinesTogether);
   dxreDialog_ChkPBB.SetValue(parameters.pageBreakBefore);
   this.lineSpacing = parameters.lineSpacing;
   this.lineSpacingMultiple = parameters.lineSpacingMultiple;
   this.defaultFormatString = dxreDialog_SpnAt.displayFormat;
   this.pageWidth = parameters.pageWidth;
   switch(parameters.lineSpacingType) {
    case __aspxRichEdit.ParagraphLineSpacingType.Single:
    case __aspxRichEdit.ParagraphLineSpacingType.Sesquialteral:
    case __aspxRichEdit.ParagraphLineSpacingType.Double:
     dxreDialog_SpnAt.displayFormat = null;
     dxreDialog_SpnAt.SetValue(null);
     break;
    case __aspxRichEdit.ParagraphLineSpacingType.Multiple:
     dxreDialog_SpnAt.displayFormat = null;
     dxreDialog_SpnAt.inc = 0.5;
     dxreDialog_SpnAt.SetMinValue(1);
     dxreDialog_SpnAt.SetValue(this.lineSpacingMultiple);
     break;
    default:
     dxreDialog_SpnAt.SetMinValue(0);
     dxreDialog_SpnAt.inc = 0.01;
     dxreDialog_SpnAt.SetValue(this.lineSpacing);
     break;
   }
  },
  attachEvents: function() {
   ASPxRichEditDialog.prototype.attachEvents.call(this);
   dxreDialog_CbxLineSpacing.ValueChanged.AddHandler(function(s, e) {
    this.OnLineSpacingTypeValueChanged();
   }.aspxBind(this));
   dxreDialog_SpnAt.ValueChanged.AddHandler(function(s, e) {
    this.OnLineSpacingValueChanged();
   }.aspxBind(this));
   dxreDialog_BtnTabs.Click.AddHandler(function(s, e) {
    this.ShowTabsDialog();
   }.aspxBind(this));
   dxreDialog_CbxSpecial.ValueChanged.AddHandler(function(s, e) {
    if(s.GetValue() === __aspxRichEdit.ParagraphFirstLineIndent.None)
     dxreDialog_SpnBy.SetValue(0);
   }.aspxBind(this));
   dxreDialog_SpnBy.ValueChanged.AddHandler(function(s, e) {
    if(s.GetValue() > 0 && dxreDialog_CbxSpecial.GetValue() === __aspxRichEdit.ParagraphFirstLineIndent.None)
     dxreDialog_CbxSpecial.SetValue(__aspxRichEdit.ParagraphFirstLineIndent.Indented);
   }.aspxBind(this));
  },
  GetFocusedElement: function() {
   return dxreDialog_CbxAlign;
  },
  GetResultParameters: function() {
   var returnedObject = this.GetInitInfoObject();
   returnedObject.alignment = dxreDialog_CbxAlign.GetValue();
   returnedObject.outlineLevel = dxreDialog_CbxOutlineLevel.GetValue();
   returnedObject.leftIndent = dxreDialog_SpnLeft.GetValue();
   returnedObject.rightIndent = dxreDialog_SpnRight.GetValue();
   returnedObject.firstLineIndentType = dxreDialog_CbxSpecial.GetValue();
   returnedObject.firstLineIndent = dxreDialog_SpnBy.GetValue();
   returnedObject.spacingBefore = dxreDialog_SpnBefore.GetValue();
   returnedObject.spacingAfter = dxreDialog_SpnAfter.GetValue();
   returnedObject.lineSpacingType = dxreDialog_CbxLineSpacing.GetValue();
   returnedObject.lineSpacing = dxreDialog_SpnAt.GetValue();
   returnedObject.lineSpacingMultiple = dxreDialog_SpnAt.GetValue();
   returnedObject.contextualSpacing = dxreDialog_ChkNoSpace.GetValue();
   returnedObject.keepLinesTogether = dxreDialog_ChkKLT.GetValue();
   returnedObject.pageBreakBefore = dxreDialog_ChkPBB.GetValue();
   return returnedObject;
  },
  ShowTabsDialog: function() {
   this.OnComplete(0);
   this.richedit.core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowTabsForm).execute(this.richedit.core.commandManager.isPublicApiCall);
  },
  OnLineSpacingTypeValueChanged: function() {
   switch(dxreDialog_CbxLineSpacing.GetValue()) {
    case __aspxRichEdit.ParagraphLineSpacingType.Single:
    case __aspxRichEdit.ParagraphLineSpacingType.Sesquialteral:
    case __aspxRichEdit.ParagraphLineSpacingType.Double:
     dxreDialog_SpnAt.displayFormat = null;
     dxreDialog_SpnAt.SetValue(null);
     break;
    case __aspxRichEdit.ParagraphLineSpacingType.Multiple:
     dxreDialog_SpnAt.displayFormat = null;
     dxreDialog_SpnAt.inc = 0.5;
     dxreDialog_SpnAt.SetMinValue(0.5);
     dxreDialog_SpnAt.SetValue(this.lineSpacingMultiple);
     break;
    default:
     dxreDialog_SpnAt.displayFormat = this.defaultFormatString;
     dxreDialog_SpnAt.inc = 0.01;
     dxreDialog_SpnAt.SetMinValue(0);
     dxreDialog_SpnAt.SetValue(this.lineSpacing);
     break;
   }
  },
  OnLineSpacingValueChanged: function() {
   var type = dxreDialog_CbxLineSpacing.GetValue();
   if(type === __aspxRichEdit.ParagraphLineSpacingType.Single || type === __aspxRichEdit.ParagraphLineSpacingType.Sesquialteral || type === __aspxRichEdit.ParagraphLineSpacingType.Double)
    dxreDialog_CbxLineSpacing.SetValue(__aspxRichEdit.ParagraphLineSpacingType.Multiple);
  },
  onOkButtonClick: function() {
   var leftIndent = dxreDialog_SpnLeft.GetValue();
   if(dxreDialog_CbxSpecial.GetValue() === __aspxRichEdit.ParagraphFirstLineIndent.Indented)
    leftIndent += dxreDialog_SpnBy.GetValue();
   if(dxreDialog_SpnRight.GetValue() + leftIndent >= this.pageWidth)
    alert("The indent size is too large");
   else
    this.OnComplete(1);
  }
 });
 var REPageSetupDialog = ASPx.CreateClass(ASPxRichEditDialog, {
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.PageSetup;
  },
  InitializeDialogFields: function(parameters) {
   dxreDialog_SpnTop.SetValue(parameters.marginTop);
   dxreDialog_SpnBottom.SetValue(parameters.marginBottom);
   dxreDialog_SpnLeft.SetValue(parameters.marginLeft);
   dxreDialog_SpnRight.SetValue(parameters.marginRight);
   if(parameters.landscape === true)
    dxreDialog_RblOrientation.SetValue(1);
   else if(parameters.landscape === false)
    dxreDialog_RblOrientation.SetValue(0);
   dxreDialog_SpnWidth.SetValue(parameters.pageWidth);
   dxreDialog_SpnHeight.SetValue(parameters.pageHeight);
   if(parameters.pageWidth && parameters.pageHeight)
    this.OnPaperSizeChanged();
   dxreDialog_CbxSectionStart.SetValue(parameters.startType);
   dxreDialog_ChkDifferentOddAndEven.SetValue(parameters.headerDifferentOddAndEven);
   dxreDialog_ChkDifferentFirstPage.SetValue(parameters.headerDifferentFirstPage);
   dxreDialog_SpnHeaderOffset.SetValue(parameters.headerOffset);
   dxreDialog_SpnFooterOffset.SetValue(parameters.footerOffset);
   dxreDialog_CbxApplyTo.SetValue(parameters.applyTo);
   dxreDialog_PageSetupPageControl.SetActiveTab(dxreDialog_PageSetupPageControl.GetTabByName(parameters.initialTab));
  },
  attachEvents: function() {
   ASPxRichEditDialog.prototype.attachEvents.call(this);
   dxreDialog_CbxPaperSize.ValueChanged.AddHandler(function(s, e) {
    this.OnPaperKindChanged();
   }.aspxBind(this));
   dxreDialog_SpnWidth.ValueChanged.AddHandler(function(s, e) {
    this.OnPaperSizeChanged();
   }.aspxBind(this));
   dxreDialog_SpnHeight.ValueChanged.AddHandler(function(s, e) {
    this.OnPaperSizeChanged();
   }.aspxBind(this));
   dxreDialog_RblOrientation.ValueChanged.AddHandler(function(s, e) {
    this.OnOrientationChanged();
   }.aspxBind(this));
  },
  GetFocusedElement: function() {
   return dxreDialog_SpnTop;
  },
  GetResultParameters: function() {
   var returnedObject = this.GetInitInfoObject();
   var orientation = dxreDialog_RblOrientation.GetValue();
   var landscape;
   if(orientation === 1)
    landscape = true;
   else if(orientation === 0)
    landscape = false;
   var marginTop = dxreDialog_SpnTop.GetValue();
   var marginBottom = dxreDialog_SpnBottom.GetValue();
   var marginLeft = dxreDialog_SpnLeft.GetValue();
   var marginRight = dxreDialog_SpnRight.GetValue();
   var pageWidth = dxreDialog_SpnWidth.GetValue();
   var pageHeight = dxreDialog_SpnHeight.GetValue();
   var headerOffset = dxreDialog_SpnHeaderOffset.GetValue();
   var footerOffset = dxreDialog_SpnFooterOffset.GetValue();
   var kind = dxreDialog_CbxPaperSize.GetValue();
   if(kind > 0) {
    var size = __aspxRichEdit.PaperSizeConverter.calculatePaperSize(kind);
    var isNeedRotation = pageWidth > pageHeight && size.width < size.height;
    if(!isNeedRotation) {
     pageWidth = this.richedit.core.uiUnitConverter.twipsToUI(size.width);
     pageHeight = this.richedit.core.uiUnitConverter.twipsToUI(size.height);
    } else {
     pageWidth = this.richedit.core.uiUnitConverter.twipsToUI(size.height);
     pageHeight = this.richedit.core.uiUnitConverter.twipsToUI(size.width);
    }
   }
   returnedObject.marginTop = marginTop == null ? undefined : marginTop;
   returnedObject.marginBottom = marginBottom == null ? undefined : marginBottom;
   returnedObject.marginLeft = marginLeft == null ? undefined : marginLeft;
   returnedObject.marginRight = marginRight == null ? undefined : marginRight;
   returnedObject.landscape = landscape;
   returnedObject.pageWidth = pageWidth == null ? undefined : pageWidth;
   returnedObject.pageHeight = pageHeight == null ? undefined : pageHeight;
   returnedObject.startType = dxreDialog_CbxSectionStart.GetValue();
   returnedObject.headerDifferentOddAndEven = dxreDialog_ChkDifferentOddAndEven.GetValue();
   returnedObject.headerDifferentFirstPage = dxreDialog_ChkDifferentFirstPage.GetValue();
   returnedObject.headerOffset = headerOffset == null ? undefined : headerOffset;
   returnedObject.footerOffset = footerOffset == null ? undefined : footerOffset;
   returnedObject.applyTo = dxreDialog_CbxApplyTo.GetValue();
   return returnedObject;
  },
  OnPaperKindChanged: function() {
   var kind = dxreDialog_CbxPaperSize.GetValue();
   var size = __aspxRichEdit.PaperSizeConverter.calculatePaperSize(kind);
   dxreDialog_SpnWidth.SetValue(this.richedit.core.uiUnitConverter.twipsToUI(size.width));
   dxreDialog_SpnHeight.SetValue(this.richedit.core.uiUnitConverter.twipsToUI(size.height));
   this.updateOrientation(size.width > size.height);
  },
  OnPaperSizeChanged: function() {
   this.updatePaperKind(dxreDialog_SpnWidth.GetValue(), dxreDialog_SpnHeight.GetValue());
   this.updateOrientation(dxreDialog_SpnWidth.GetValue() > dxreDialog_SpnHeight.GetValue());
  },
  OnOrientationChanged: function() {
   var landscape = dxreDialog_RblOrientation.GetValue() === 1;
   var width = dxreDialog_SpnWidth.GetValue();
   var height = dxreDialog_SpnHeight.GetValue();
   if(landscape) {
    dxreDialog_SpnWidth.SetValue(Math.max(width, height));
    dxreDialog_SpnHeight.SetValue(Math.min(width, height));
    this.updatePaperKind(Math.max(width, height), Math.min(width, height));
   }
   else {
    dxreDialog_SpnWidth.SetValue(Math.min(width, height));
    dxreDialog_SpnHeight.SetValue(Math.max(width, height));
    this.updatePaperKind(Math.min(width, height), Math.max(width, height));
   }
  },
  updatePaperKind: function(width, height) {
   var size = { width: this.richedit.core.uiUnitConverter.UIToTwips(width), height: this.richedit.core.uiUnitConverter.UIToTwips(height) };
   var paperKind = __aspxRichEdit.PaperSizeConverter.calculatePaperKind(size, 0, this.richedit.core.uiUnitConverter.UIToTwips(0.01));
   if(paperKind == 0)
    paperKind = __aspxRichEdit.PaperSizeConverter.calculatePaperKind({ width: size.height, height: size.width }, 0, this.richedit.core.uiUnitConverter.UIToTwips(0.01));
   dxreDialog_CbxPaperSize.SetValue(paperKind >= 0 ? paperKind : null);
  },
  updateOrientation: function(landscape) {
   dxreDialog_RblOrientation.SetSelectedIndex(landscape ? 1 : 0);
  }
 });
 var REColumnsDialog = ASPx.CreateClass(ASPxRichEditDialog, {
  InitializeDialogFields: function(parameters) {
   this.currentColumnCount = 0;
   this.controller = new __aspxRichEdit.ColumnsEditorController(parameters);
   this.UpdateForm();
  },
  attachEvents: function() {
   ASPxRichEditDialog.prototype.attachEvents.call(this);
   for(var i = 0; i < this.controller.presets.length; i++) {
    var presetButton = this.GetPresetElement(i);
    presetButton.Click.AddHandler(function(s) {
     this.OnColumnsPresetChecked(this.GetIndexByElementName(s.name));
    }.aspxBind(this));
   }
   dxreDialog_SpnNumberOfColumns.ValueChanged.AddHandler(function(s) {
    this.OnColumnsCountChanged(s.GetValue());
   }.aspxBind(this));
   dxreDialog_ChkEqualWidth.CheckedChanged.AddHandler(function(s) {
    this.OnEqualColumnWidthChanged(s.GetChecked());
   }.aspxBind(this));
   dxreDialog_CbxApplyTo.ValueChanged.AddHandler(function(s) {
    this.OnApplyTypeChanged(s.GetValue());
   }.aspxBind(this));
  },
  initColumnsEditorHandlers: function() {
   for(var i = 0; i < this.currentColumnCount; i++) {
    var spacingSpinElement = this.GetSpacingSpinElement(i);
    var widthSpinElement = this.GetWidthSpinElement(i);
    spacingSpinElement.ValueChanged.AddHandler(function(s) {
     this.OnColumnsEditorSpacingChanged(this.GetIndexByElementName(s.name), s.GetValue());
    }.aspxBind(this));
    widthSpinElement.ValueChanged.AddHandler(function(s) {
     this.OnColumnsEditorWidthChanged(this.GetIndexByElementName(s.name), s.GetValue());
    }.aspxBind(this));
   }
  },
  GetFocusedElement: function() {
   return dxreDialog_SpnNumberOfColumns;
  },
  UpdateForm: function() {
   dxreDialog_SpnNumberOfColumns.SetValue(this.controller.columnsInfo.columnCount);
   dxreDialog_ChkEqualWidth.SetChecked(this.controller.columnsInfo.equalColumnWidth);
   dxreDialog_CbxApplyTo.SetValue(this.controller.columnsInfo.applyType);
   if(this.controller.columnsInfo.columnCount)
    this.UpdateColumnsEditor();
   this.UpdatePresetControls();
  },
  UpdateColumnsEditor: function() {
   if(this.currentColumnCount == this.controller.columnsInfo.columnCount)
    this.UpdateColumnsEditorFields();
   else {
    this.currentColumnCount = this.controller.columnsInfo.columnCount;
    this.SendCallbackForContent();
   }
  },
  UpdateColumnsEditorFields: function() {
   for(var i = 0, length = this.controller.columnsInfo.columnCount; i < length; i++) {
    var width = this.controller.getWidth(i);
    var spacing = this.controller.getSpacing(i);
    this.GetWidthSpinElement(i).SetValue(width);
    this.GetSpacingSpinElement(i).SetValue(spacing);
   }
   this.ApplyEditorsAvailability();
  },
  UpdatePresetControls: function() {
   var hasChecked = false;
   for(var i = 0; i < this.controller.presets.length; i++) {
    var checked = this.controller.matchPreset(i);
    if(checked) {
     hasChecked = true;
     this.GetPresetElement(i).SetChecked(true);
     break;
    }
   }
   if(!hasChecked)
    this.GetPresetElement(0).SetChecked(false);
  },
  SendCallbackForContent: function() {
   var columnCount = this.controller.columnsInfo.columnCount;
   this.ShowLoadingPanelOverDialogPopup();
   this.SetEnabledForColumnsCountControl(false);
   this.SetStateObjectValue(columnCount);
   this.GetColumnsEditorCallbackHelper().SendCallback(constants.ColumnsEditorCallbackPrefix, columnCount);
  },
  SetStateObjectValue: function(value) {
   this.richedit.UpdateStateObjectWithObject({ columnsCount: value });
  },
  ApplyEditorsAvailability: function() {
   var lastIndex = this.controller.columnsInfo.columnCount - 1;
   this.SetEnableForColumnsEditors(0, lastIndex, false);
   if(this.controller.columnsInfo.equalColumnWidth && this.controller.columnsInfo.columnCount > 0)
    this.SetEnableForColumnsEditors(0, 0, true);
   else
    this.SetEnableForColumnsEditors(0, lastIndex, true);
   this.GetSpacingSpinElement(lastIndex).SetEnabled(false);
  },
  SetEnableForColumnsEditors: function(from, to, enabled) {
   for(var i = from; i <= to; i++) {
    this.GetWidthSpinElement(i).SetEnabled(enabled);
    this.GetSpacingSpinElement(i).SetEnabled(enabled);
   }
  },
  SetEnabledForColumnsCountControl: function(value) {
   dxreDialog_SpnNumberOfColumns.SetEnabled(value);
  },
  OnCallbackForContent: function(content) {
   ASPx.SetInnerHtml(this.GetColumnsEditorElement(), content);
  },
  OnEndCallbackForContent: function() {
   this.SetStateObjectValue(null);
   this.SetEnabledForColumnsCountControl(true);
   this.UpdateColumnsEditorFields();
   this.initColumnsEditorHandlers();
   this.SetFocusInField();
  },
  OnColumnsCountChanged: function(columnsCount) {
   this.controller.changeColumnCount(columnsCount);
   this.UpdateForm();
  },
  OnEqualColumnWidthChanged: function(value) {
   this.controller.setEqualColumnWidth(value);
   this.UpdateForm();
  },
  OnColumnsPresetChecked: function(presetIndex) {
   this.controller.applyPreset(presetIndex);
   this.UpdateForm();
  },
  OnColumnsEditorWidthChanged: function(index, value) {
   this.controller.setWidth(index, value);
   this.UpdateForm();
  },
  OnColumnsEditorSpacingChanged: function(index, value) {
   this.controller.setSpacing(index, value);
   this.UpdateForm();
  },
  OnApplyTypeChanged: function(value) {
   this.controller.columnsInfo.applyType = value;
  },
  GetColumnsEditorCallbackHelper: function() {
   if(!this.callbackHelper)
    this.callbackHelper = new CallbackHelper(this);
   return this.callbackHelper;
  },
  GetWidthSpinElement: function(index) {
   return window[constants.WidthSpinElementName + index];
  },
  GetSpacingSpinElement: function(index) {
   return window[constants.SpacingSpinElementName + index];
  },
  GetPresetElement: function(index) {
   return element = window[constants.ColumnsPresetElementName + index];
  },
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.Columns;
  },
  GetColumnsEditorElement: function() {
   var item = dxreDialog_WidthSpacingLayout.GetItemByName("ColumnsEditor");
   var itemElement = dxreDialog_WidthSpacingLayout.GetHTMLElementByItem(item);
   return ASPx.GetChildElementNodes(itemElement)[0];
  },
  GetIndexByElementName: function(name) {
   var nameParts = name.split(" ");
   return parseInt(nameParts[nameParts.length - 1]);
  },
  GetResultParameters: function() {
   var returnedObject = this.GetInitInfoObject();
   returnedObject.columnsInfo = this.controller.columnsInfo;
   return returnedObject;
  }
 });
 var REInsertTableDialog = ASPx.CreateClass(ASPxRichEditDialog, {
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.InsertTable;
  },
  GetFocusedElement: function() {
   return dxreDialog_SpnColumnsNumber;
  },
  InitializeDialogFields: function(parameters) {
   dxreDialog_SpnRowsNumber.SetValue(parameters.rowCount);
   dxreDialog_SpnColumnsNumber.SetValue(parameters.columnCount);
  },
  GetResultParameters: function() {
   var returnedObject = this.GetInitInfoObject();
   returnedObject.rowCount = dxreDialog_SpnRowsNumber.GetValue();
   returnedObject.columnCount = dxreDialog_SpnColumnsNumber.GetValue();
   return returnedObject;
  },
 });
 var REInsertTableCellsDialog = ASPx.CreateClass(ASPxRichEditDialog, {
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.InsertTableCells;
  },
  InitializeDialogFields: function(parameters) {
   dxreDialog_RblCellOperation.SetValue(parameters.tableCellOperation);
  },
  GetResultParameters: function() {
   var returnedObject = this.GetInitInfoObject();
   returnedObject.tableCellOperation = dxreDialog_RblCellOperation.GetValue();
   return returnedObject;
  }
 });
 var REDeleteTableCellsDialog = ASPx.CreateClass(ASPxRichEditDialog, {
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.DeleteTableCells;
  },
  InitializeDialogFields: function(parameters) {
   dxreDialog_RblCellOperation.SetValue(parameters.tableCellOperation);
  },
  GetResultParameters: function() {
   var returnedObject = this.GetInitInfoObject();
   returnedObject.tableCellOperation = dxreDialog_RblCellOperation.GetValue();
   return returnedObject;
  }
 });
 var RESplitTableCellsDialog = ASPx.CreateClass(ASPxRichEditDialog, {
  availableRowNumber: -1,
  prevRowCount: -1,
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.SplitTableCells;
  },
  attachEvents: function() {
   ASPxRichEditDialog.prototype.attachEvents.call(this);
   dxreDialog_SpnRowsNumber.NumberChanged.AddHandler(function(s, e) {
    if(this.availableRowNumber > 1) {
     if(s.GetValue() > this.prevRowCount) {
      s.SetValue(this.availableRowNumber);
      this.prevRowCount = this.availableRowNumber;
     }
     else {
      s.SetValue(1);
      this.prevRowCount = 1;
     }
    }
   }.aspxBind(this));
  },
  InitializeDialogFields: function(parameters) {
   dxreDialog_SpnColumnsNumber.SetValue(parameters.columnCount);
   dxreDialog_SpnRowsNumber.SetValue(parameters.rowCount);
   this.prevRowCount = parameters.rowCount;
   this.availableRowNumber = parameters.availableRowNumber;
   dxreDialog_ChkMergeCells.SetChecked(parameters.isMergeBeforeSplit);
   dxreDialog_ChkMergeCells.SetEnabled(parameters.isMergeBeforeSplit);
   dxreDialog_SpnRowsNumber.SetEnabled(!parameters.disableRowsSelector);
  },
  GetResultParameters: function() {
   var returnedObject = this.GetInitInfoObject();
   returnedObject.columnCount = dxreDialog_SpnColumnsNumber.GetValue();
   returnedObject.rowCount = dxreDialog_SpnRowsNumber.GetValue();
   returnedObject.isMergeBeforeSplit = dxreDialog_ChkMergeCells.GetValue();
   return returnedObject;
  }
 });
 var RETablePropertiesDialog = ASPx.CreateClass(ASPxRichEditDialog, {
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.TableProperties;
  },
  InitializeDialogFields: function(parameters) {
   if(parameters.useDefaultTableWidth !== null && !parameters.useDefaultTableWidth) {
    dxreDialog_ChkTablePrefWidth.SetChecked(true);
    this.SetEnabledForTablePreferredWidth(true);
   }
   dxreDialog_CbxTableMeasureIn.SetValue(parameters.tablePreferredWidth.type === __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent ? parameters.tablePreferredWidth.type : __aspxRichEdit.TableWidthUnitType.ModelUnits);
   dxreDialog_SpnTablePrefWidth.displayFormat = this.getUnitFormatString(parameters.tablePreferredWidth.type);
   dxreDialog_SpnTablePrefWidth.SetValue(this.modelUnitToPercent(parameters.tablePreferredWidth.type, parameters.tablePreferredWidth.value));
   dxreDialog_RblAligment.SetValue(parameters.tableRowAlignment);
   dxreDialog_SpnIndentLeft.SetValue(parameters.tableIndent);
   dxreDialog_ChkAllowSpacing.SetValue(parameters.allowCellSpacing);
   dxreDialog_SpnSpacing.SetEnabled(parameters.allowCellSpacing);
   dxreDialog_SpnSpacing.SetValue(parameters.cellSpacing);
   dxreDialog_ChkAutoResize.SetValue(parameters.resizeToFitContent);
   dxreDialog_SpnTopMarginDefault.SetValue(parameters.defaultCellMarginTop);
   dxreDialog_SpnLeftMarginDefault.SetValue(parameters.defaultCellMarginLeft);
   dxreDialog_SpnRightMarginDefault.SetValue(parameters.defaultCellMarginRight);
   dxreDialog_SpnBottomMarginDefault.SetValue(parameters.defaultCellMarginBottom);
   if(parameters.useDefaultRowHeight !== null && !parameters.useDefaultRowHeight) {
    dxreDialog_ChkSpecifyHeight.SetChecked(true);
    this.SetEnabledForRowHeight(true);
   }
   dxreDialog_SpnRowHeight.SetValue(parameters.rowHeight.value);
   dxreDialog_CbxRowHeight.SetValue(parameters.rowHeight.type);
   dxreDialog_ChkCantSplit.SetValue(parameters.cantSplit !== null ? !parameters.cantSplit : null);
   if(parameters.useDefaultColumnWidth !== null && !parameters.useDefaultColumnWidth) {
    dxreDialog_ChkColumnPrefWidth.SetValue(true);
    this.SetEnabledForColumnPreferredWidth(true);
   }
   dxreDialog_CbxColumnMeasureIn.SetValue(parameters.columnPreferredWidth.type === __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent ? parameters.columnPreferredWidth.type : __aspxRichEdit.TableWidthUnitType.ModelUnits);
   dxreDialog_SpnColumnPrefWidth.displayFormat = this.getUnitFormatString(parameters.columnPreferredWidth.type);
   dxreDialog_SpnColumnPrefWidth.SetValue(this.modelUnitToPercent(parameters.columnPreferredWidth.type, parameters.columnPreferredWidth.value));
   if(parameters.useDefaultCellWidth !== null && !parameters.useDefaultCellWidth) {
    dxreDialog_ChkCellPrefWidth.SetValue(true);
    this.SetEnabledForCellPreferredWidth(true);
   }
   dxreDialog_CbxCellMeasureIn.SetValue(parameters.cellPreferredWidth.type === __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent ? parameters.cellPreferredWidth.type : __aspxRichEdit.TableWidthUnitType.ModelUnits);
   dxreDialog_SpnCellPrefWidth.displayFormat = this.getUnitFormatString(parameters.cellPreferredWidth.type);
   dxreDialog_SpnCellPrefWidth.SetValue(this.modelUnitToPercent(parameters.cellPreferredWidth.type, parameters.cellPreferredWidth.value));
   dxreDialog_RblVerticalAligment.SetValue(parameters.cellVerticalAlignment);
   dxreDialog_ChkWrapText.SetValue(parameters.cellNoWrap !== null ? !parameters.cellNoWrap : null);
   dxreDialog_ChkSameAsTable.SetValue(parameters.cellMarginsSameAsTable);
   dxreDialog_SpnTopMargin.SetValue(parameters.cellMarginTop);
   dxreDialog_SpnLeftMargin.SetValue(parameters.cellMarginLeft);
   dxreDialog_SpnRightMargin.SetValue(parameters.cellMarginRight);
   dxreDialog_SpnBottomMargin.SetValue(parameters.cellMarginBottom);
   this.SetEnabledForCellMargins(!parameters.cellMarginsSameAsTable);
   this.setMinMaxValuesForEdits();
   dxreDialog_TablePropertiesPageControl.SetActiveTab(dxreDialog_TablePropertiesPageControl.GetTabByName(parameters.initialTab));
  },
  setMinMaxValuesForEdits: function() {
   dxreDialog_SpnTablePrefWidth.SetMinValue(__aspxRichEdit.TablePropertiesDialogDefaults.MinTableWidthByDefault);
   dxreDialog_SpnTablePrefWidth.SetMaxValue(this.GetTableWidthMaxValueConsiderWidthUnitType(dxreDialog_CbxTableMeasureIn.GetValue()));
   dxreDialog_SpnColumnPrefWidth.SetMinValue(__aspxRichEdit.TablePropertiesDialogDefaults.MinColumnWidthByDefault);
   dxreDialog_SpnColumnPrefWidth.SetMaxValue(this.GetColumnWidthMaxValueConsiderWidthUnitType(dxreDialog_CbxColumnMeasureIn.GetValue()));
   dxreDialog_SpnCellPrefWidth.SetMinValue(__aspxRichEdit.TablePropertiesDialogDefaults.MinCellWidthByDefault);
   dxreDialog_SpnCellPrefWidth.SetMaxValue(this.GetCellWidthMaxValueConsiderWidthUnitType(dxreDialog_CbxCellMeasureIn.GetValue()));
   dxreDialog_SpnRowHeight.SetMinValue(this.richedit.core.uiUnitConverter.twipsToUI(__aspxRichEdit.TablePropertiesDialogDefaults.MinRowHeightByDefault));
   dxreDialog_SpnRowHeight.SetMaxValue(this.richedit.core.uiUnitConverter.twipsToUI(__aspxRichEdit.TablePropertiesDialogDefaults.MaxRowHeightByDefault));
   dxreDialog_SpnIndentLeft.SetMinValue(this.richedit.core.uiUnitConverter.twipsToUI(__aspxRichEdit.TablePropertiesDialogDefaults.MinTableIndentByDefault));
   dxreDialog_SpnIndentLeft.SetMaxValue(this.richedit.core.uiUnitConverter.twipsToUI(__aspxRichEdit.TablePropertiesDialogDefaults.MaxTableIndentByDefault));
  },
  attachEvents: function() {
   ASPxRichEditDialog.prototype.attachEvents.call(this);
   dxreDialog_ChkTablePrefWidth.CheckedChanged.AddHandler(function(s) {
    this.SetEnabledForTablePreferredWidth(s.GetValue());
   }.aspxBind(this));
   dxreDialog_CbxTableMeasureIn.ValueChanged.AddHandler(function(s) {
    dxreDialog_SpnTablePrefWidth.displayFormat = this.getUnitFormatString(s.GetValue());
    var value = this.switchMeasureIn(s.GetValue(), dxreDialog_SpnTablePrefWidth.GetValue(), this.parameters.maxTableWidth);
    dxreDialog_SpnTablePrefWidth.SetValue(value);
    dxreDialog_SpnTablePrefWidth.SetMaxValue(this.GetTableWidthMaxValueConsiderWidthUnitType(s.GetValue()));
   }.aspxBind(this));
   dxreDialog_RblAligment.ValueChanged.AddHandler(function(s) {
    dxreDialog_SpnIndentLeft.SetEnabled(s.GetValue() === __aspxRichEdit.HorizontalAlignMode.Left);
   });
   dxreDialog_ChkAllowSpacing.CheckedChanged.AddHandler(function(s) {
    dxreDialog_SpnSpacing.SetEnabled(s.GetValue());
   });
   dxreDialog_ChkSpecifyHeight.CheckedChanged.AddHandler(function(s) {
    this.SetEnabledForRowHeight(s.GetValue());
   }.aspxBind(this));
   dxreDialog_ChkColumnPrefWidth.CheckedChanged.AddHandler(function(s) {
    dxreDialog_SpnColumnPrefWidth.SetEnabled(s.GetValue());
    dxreDialog_CbxColumnMeasureIn.SetEnabled(s.GetValue());
   });
   dxreDialog_CbxColumnMeasureIn.ValueChanged.AddHandler(function(s) {
    dxreDialog_SpnColumnPrefWidth.displayFormat = this.getUnitFormatString(s.GetValue());
    var value = this.switchMeasureIn(s.GetValue(), dxreDialog_SpnColumnPrefWidth.GetValue(), this.getMaxCellAvailableWidth());
    dxreDialog_SpnColumnPrefWidth.SetValue(value);
    dxreDialog_SpnColumnPrefWidth.SetMaxValue(this.GetColumnWidthMaxValueConsiderWidthUnitType(s.GetValue()));     
   }.aspxBind(this));
   dxreDialog_ChkCellPrefWidth.CheckedChanged.AddHandler(function(s) {
    dxreDialog_SpnCellPrefWidth.SetEnabled(s.GetValue());
    dxreDialog_CbxCellMeasureIn.SetEnabled(s.GetValue());
   });
   dxreDialog_CbxCellMeasureIn.ValueChanged.AddHandler(function(s) {
    dxreDialog_SpnCellPrefWidth.displayFormat = this.getUnitFormatString(s.GetValue());
    var value = this.switchMeasureIn(s.GetValue(), dxreDialog_SpnCellPrefWidth.GetValue(), this.getMaxCellAvailableWidth());
    dxreDialog_SpnCellPrefWidth.SetValue(value);
    dxreDialog_SpnCellPrefWidth.SetMaxValue(this.GetCellWidthMaxValueConsiderWidthUnitType(s.GetValue()));     
   }.aspxBind(this));
   dxreDialog_ChkSameAsTable.CheckedChanged.AddHandler(function(s) {
    this.SetEnabledForCellMargins(!s.GetValue());
   }.aspxBind(this));
   dxreDialog_BtnBorderShading.Click.AddHandler(this.ShowBorderShadingForm.aspxBind(this));
  },
  SetEnabledForTablePreferredWidth: function(value) {
   dxreDialog_SpnTablePrefWidth.SetEnabled(value);
   dxreDialog_CbxTableMeasureIn.SetEnabled(value);
  },
  SetEnabledForColumnPreferredWidth: function(value) {
   dxreDialog_SpnColumnPrefWidth.SetEnabled(value);
   dxreDialog_CbxColumnMeasureIn.SetEnabled(value);
  },
  SetEnabledForCellPreferredWidth: function(value) {
   dxreDialog_SpnCellPrefWidth.SetEnabled(value);
   dxreDialog_CbxCellMeasureIn.SetEnabled(value);
  },
  SetEnabledForRowHeight: function(value) {
   dxreDialog_SpnRowHeight.SetEnabled(value);
   dxreDialog_CbxRowHeight.SetEnabled(value);
  },
  SetEnabledForCellMargins: function(value) {
   dxreDialog_SpnTopMargin.SetEnabled(value);
   dxreDialog_SpnLeftMargin.SetEnabled(value);
   dxreDialog_SpnRightMargin.SetEnabled(value);
   dxreDialog_SpnBottomMargin.SetEnabled(value);
  },
  GetResultParameters: function() {
   var returnedObject = this.GetInitInfoObject();
   returnedObject.tablePreferredWidth.type = dxreDialog_CbxTableMeasureIn.GetValue();
   returnedObject.tablePreferredWidth.value = this.percentToModelUnit(returnedObject.tablePreferredWidth.type, dxreDialog_SpnTablePrefWidth.GetValue());
   returnedObject.useDefaultTableWidth = dxreDialog_ChkTablePrefWidth.GetValue() !== null ? !dxreDialog_ChkTablePrefWidth.GetValue() : null;
   returnedObject.tableRowAlignment = dxreDialog_RblAligment.GetValue();
   returnedObject.tableIndent = dxreDialog_SpnIndentLeft.GetValue();
   returnedObject.allowCellSpacing = dxreDialog_ChkAllowSpacing.GetValue();
   returnedObject.cellSpacing = dxreDialog_SpnSpacing.GetValue();
   returnedObject.resizeToFitContent = dxreDialog_ChkAutoResize.GetValue();
   returnedObject.defaultCellMarginTop = dxreDialog_SpnTopMarginDefault.GetValue();
   returnedObject.defaultCellMarginLeft = dxreDialog_SpnLeftMarginDefault.GetValue();
   returnedObject.defaultCellMarginRight = dxreDialog_SpnRightMarginDefault.GetValue();
   returnedObject.defaultCellMarginBottom = dxreDialog_SpnBottomMarginDefault.GetValue();
   returnedObject.useDefaultRowHeight = dxreDialog_ChkSpecifyHeight.GetValue() !== null ? !dxreDialog_ChkSpecifyHeight.GetValue() : null;
   returnedObject.rowHeight.type = dxreDialog_CbxRowHeight.GetValue();
   returnedObject.rowHeight.value = dxreDialog_SpnRowHeight.GetValue();
   returnedObject.cantSplit = dxreDialog_ChkCantSplit.GetValue() !== null ? !dxreDialog_ChkCantSplit.GetValue() : null;
   returnedObject.columnPreferredWidth.type = dxreDialog_CbxColumnMeasureIn.GetValue();
   if(this.checkValueChanged(returnedObject.columnPreferredWidth.value, this.percentToModelUnit(returnedObject.columnPreferredWidth.type, dxreDialog_SpnColumnPrefWidth.GetValue())))
    returnedObject.columnPreferredWidth.value = this.percentToModelUnit(returnedObject.columnPreferredWidth.type, dxreDialog_SpnColumnPrefWidth.GetValue());
   returnedObject.useDefaultColumnWidth = dxreDialog_ChkColumnPrefWidth.GetValue() !== null ? !dxreDialog_ChkColumnPrefWidth.GetValue() : null;
   returnedObject.cellPreferredWidth.type = dxreDialog_CbxCellMeasureIn.GetValue();
   if(this.checkValueChanged(returnedObject.cellPreferredWidth.value, this.percentToModelUnit(returnedObject.cellPreferredWidth.type, dxreDialog_SpnCellPrefWidth.GetValue())))
    returnedObject.cellPreferredWidth.value = this.percentToModelUnit(returnedObject.cellPreferredWidth.type, dxreDialog_SpnCellPrefWidth.GetValue());
   returnedObject.useDefaultCellWidth = dxreDialog_ChkCellPrefWidth.GetValue() !== null ? !dxreDialog_ChkCellPrefWidth.GetValue() : null;
   returnedObject.cellVerticalAlignment = dxreDialog_RblVerticalAligment.GetValue();
   returnedObject.cellNoWrap = dxreDialog_ChkWrapText.GetValue() !== null ? !dxreDialog_ChkWrapText.GetValue() : null;
   returnedObject.cellMarginsSameAsTable = dxreDialog_ChkSameAsTable.GetValue();
   returnedObject.cellMarginTop = dxreDialog_SpnTopMargin.GetValue();
   returnedObject.cellMarginRight = dxreDialog_SpnRightMargin.GetValue();
   returnedObject.cellMarginBottom = dxreDialog_SpnBottomMargin.GetValue();
   returnedObject.cellMarginLeft = dxreDialog_SpnLeftMargin.GetValue();
   return returnedObject;
  },
  switchMeasureIn: function(targetType, value, maxWidth) {
   if(targetType === __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent)
    return value / maxWidth * 100;
   else
    return value / 100 * maxWidth;
  },
  percentToModelUnit: function(type, valueFromUI) {
   return type === __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent ? Math.floor(valueFromUI * 50) : valueFromUI;
  },
  modelUnitToPercent: function(type, valueForUI) {
   return type === __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent ? valueForUI / 50 : valueForUI;
  },
  getUnitFormatString: function(unitType) {
   var abbreviation = unitType === __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent ? this.richedit.unitAbbreviations.percent : this.richedit.unitAbbreviations.unit;
   return "{0}" + abbreviation;
  },
  GetTableWidthMaxValueConsiderWidthUnitType: function(type) {
   if(type === __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent)
    return __aspxRichEdit.TablePropertiesDialogDefaults.MaxTableWidthInPercentByDefault;
   return this.richedit.core.uiUnitConverter.twipsToUI(__aspxRichEdit.TablePropertiesDialogDefaults.MaxTableWidthInModelUnitsByDefault);
  },
  GetColumnWidthMaxValueConsiderWidthUnitType: function(type) {
   if(type === __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent)
    return __aspxRichEdit.TablePropertiesDialogDefaults.MaxColumnWidthInPercentByDefault;
   return this.richedit.core.uiUnitConverter.twipsToUI(__aspxRichEdit.TablePropertiesDialogDefaults.MaxColumnWidthInModelUnitsByDefault);
  },
  GetCellWidthMaxValueConsiderWidthUnitType: function(type) {
   if(type === __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent)
    return __aspxRichEdit.TablePropertiesDialogDefaults.MaxCellWidthInPercentByDefault;
   return this.richedit.core.uiUnitConverter.twipsToUI(__aspxRichEdit.TablePropertiesDialogDefaults.MaxCellWidthInModelUnitsByDefault);
  },
  getMaxCellAvailableWidth: function() {
   var maxCellWidth = this.parameters.tablePreferredWidth.type === __aspxRichEdit.TableWidthUnitType.FiftiethsOfPercent ?
    this.switchMeasureIn(__aspxRichEdit.TableWidthUnitType.ModelUnits, this.modelUnitToPercent(this.parameters.tablePreferredWidth.type, this.parameters.tablePreferredWidth.value), this.parameters.maxTableWidth) :
    this.parameters.tablePreferredWidth.value;
   return maxCellWidth ? maxCellWidth : this.parameters.maxTableWidth;
  },
  checkValueChanged: function (oldValue, newValue) {
   return oldValue.toFixed(2) !== newValue.toFixed(2);
  },
  ShowBorderShadingForm: function(clientCommand) {
   this.OnComplete(0);
   var parameters = this.GetResultParameters();
   parameters.toAnotherMeasuringSystem(this.richedit.core.uiUnitConverter.UIToTwips);
   this.richedit.core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.ShowServiceBorderShadingForm)
    .execute(this.richedit.core.commandManager.isPublicApiCall,
    new __aspxRichEdit.CommandSimpleOptions(this.richedit.core, parameters));
  },
  GetFocusedElement: function() {
   return dxreDialog_BtnOk;
  }
 });
 var REBorderShadingDialog = ASPx.CreateClass(ASPxRichEditDialog, {
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.BorderShading;
  },
  InitializeDialogFields: function(parameters) {
   var previewContainer = this.GetBorderPreviewElement();
   this.tablePreview = new TableBorderPreview(this, previewContainer, parameters.borderLineHorizontalInVisible, parameters.borderLineVerticalInVisible);
   dxreDialog_CeFillColor.SetValue(parameters.backgroundColor);
   previewContainer.style.backgroundColor = parameters.backgroundColor;
   this.tablePreview.mode = parameters.setModeButton;
   switch(parameters.setModeButton) {
    case __aspxRichEdit.SetModeButtons.None:
     dxreDialog_BtnPresetNone.SetChecked(true);
     break;
    case __aspxRichEdit.SetModeButtons.Box:
     dxreDialog_BtnPresetBox.SetChecked(true);
     break;
    case __aspxRichEdit.SetModeButtons.All:
     dxreDialog_BtnPresetAll.SetChecked(true);
     break;
    case __aspxRichEdit.SetModeButtons.Grid:
     dxreDialog_BtnPresetGrid.SetChecked(true);
     break;
    default:
     dxreDialog_BtnPresetCustom.SetChecked(true);
   }
  },
  attachEvents: function() {
   ASPxRichEditDialog.prototype.attachEvents.call(this);
   dxreDialog_BtnPresetNone.Click.AddHandler(function() { this.tablePreview.setMode(__aspxRichEdit.SetModeButtons.None); }.aspxBind(this));
   dxreDialog_BtnPresetBox.Click.AddHandler(function() { this.tablePreview.setMode(__aspxRichEdit.SetModeButtons.Box); }.aspxBind(this));
   dxreDialog_BtnPresetAll.Click.AddHandler(function() { this.tablePreview.setMode(__aspxRichEdit.SetModeButtons.All); }.aspxBind(this));
   dxreDialog_BtnPresetGrid.Click.AddHandler(function() { this.tablePreview.setMode(__aspxRichEdit.SetModeButtons.Grid); }.aspxBind(this));
   dxreDialog_BtnPresetCustom.Click.AddHandler(function() { this.tablePreview.setMode(__aspxRichEdit.SetModeButtons.Custom); }.aspxBind(this));
   dxreDialog_CeFillColor.ValueChanged.AddHandler(function(s) {
    var previewElement = this.GetBorderPreviewElement();
    var backColor = s.GetValue();
    previewElement.style.backgroundColor = backColor == __aspxRichEdit.ColorHelper.NO_COLOR ? "" : backColor;
   }.aspxBind(this));
   dxreDialog_CeBorderColor.ValueChanged.AddHandler(function(s) {
    this.updateBorder(this.tablePreview.mode);
   }.aspxBind(this));
   dxreDialog_CmbWidth.ValueChanged.AddHandler(function(s) {
    this.updateBorder(this.tablePreview.mode);
   }.aspxBind(this));
   dxreDialog_CmbBorderStyle.ValueChanged.AddHandler(function(s) {
    this.updateBorder(this.tablePreview.mode);
   }.aspxBind(this));
  },
  updateBorder: function(mode) {
   this.tablePreview.setMode(mode);
  },
  GetBorderPreviewElement: function() {
   return ASPx.GetElementById(this.richedit.name + constants.TableBorderPreviewElementID);
  },
  GetResultParameters: function() {
   var returnedObject = this.GetInitInfoObject();
   returnedObject.backgroundColor = dxreDialog_CeFillColor.GetValue();
   returnedObject.top = this.tablePreview.topBorder.borderInfo;
   returnedObject.bottom = this.tablePreview.bottomBorder.borderInfo;
   returnedObject.right = this.tablePreview.rightBorder.borderInfo;
   returnedObject.left = this.tablePreview.leftBorder.borderInfo;
   if(this.parameters.borderLineHorizontalInVisible)
    returnedObject.insideHorizontal = this.tablePreview.horizontalInBorder.borderInfo;
   if(this.parameters.borderLineVerticalInVisible)
    returnedObject.insideVertical = this.tablePreview.verticalInBorder.borderInfo;
   return returnedObject;
  },
 });
 var REInsertImageDialog = ASPx.CreateClass(ASPxRichEditDialog, {
  constructor: function(name) {
   this.constructor.prototype.constructor.call(this, name);
   this.callbackCount = 0;
  },
  InitializeDialogFields: function(parameters) {
   var imageUploader = this.GetImageUploader();
   if(typeof MVCxClientUploadControl !== 'undefined' && imageUploader instanceof MVCxClientUploadControl)
    imageUploader.uploadManager.options.callbackUrl = this.richedit.callbackUrl;
  },
  OnComplete: function(result, params) {
   this.insertImageParams = {};
   if(result) {
    if(!this.HasImageProductedFromUrl()) {
     this.notifyOwnerControlThatDocumentUploadingStarted();
     return this.GetImageUploader().UploadFile();
    } else
     return this.SaveImageToServerViaCallback(this.GetInsertImageUrlTextBox().GetText());
   }
   else
    this.HideLoadingPanelOverDialogPopup();
   ASPxRichEditDialog.prototype.OnComplete.call(this, result, params);
  },
  attachEvents: function() {
   ASPxRichEditDialog.prototype.attachEvents.call(this);
   executeIfExists("dxreDialog_RblNavigation", function(element) {
    element.ValueChanged.AddHandler(this.OnImageFromTypeChanged.aspxBind(this));
   }.aspxBind(this));
   dxreDialog_TxbInsertImageUrl.TextChanged.AddHandler(function(s) {
    this.OnImageSrcChanged(s.GetText());
   }.aspxBind(this));
   executeIfExists("dxreDialog_UplImage", function(element) {
    element.FileUploadComplete.AddHandler(function(s, e) {
     this.OnImageUploadComplete(e);
    }.aspxBind(this));
    element.FilesUploadComplete.AddHandler(function(s, e) {
     this.OnImageUploadComplete(e);
    }.aspxBind(this));
    element.FilesUploadStart.AddHandler(function(s, e) {
     this.OnImageUploadStart();
    }.aspxBind(this));
   }.aspxBind(this));
  },
  HasImageProductedFromUrl: function() {
   if(typeof(dxreDialog_RblNavigation) == "undefined")
    return true;
   return dxreDialog_RblNavigation.GetValue() ? false : true;
  },
  SaveImageToServerViaCallback: function(src) {
   this.ShowLoadingPanelOverDialogPopup();
   this.ownerControl.sendInternalServiceCallback(constants.SaveImageToServerCallbackPrefix, src, this);
   this.callbackCount++;
  },
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.InsertImage;
  },
  GetResultParameters: function() {
   var returnedObject = this.GetInitInfoObject();
   returnedObject.id = this.insertImageParams.id;
   returnedObject.originalWidth = this.insertImageParams.originalWidth;
   returnedObject.originalHeight = this.insertImageParams.originalHeight;
   returnedObject.base64EncodedImage = this.insertImageParams.base64EncodedImage;
   return returnedObject;
  },
  CheckImageExisting: function(checkingSrc) {
   if(document.images) {
    this.testImage = new Image();
    ASPx.Evt.AttachEventToElement(this.testImage, "load", new Function("aspxTestExistingImageOnLoad" + "('" + this.richedit.name + "');"));
    ASPx.Evt.AttachEventToElement(this.testImage, "error", new Function("aspxTestExistingImageOnError" + "('" + this.richedit.name + "');"));
    this.testImage.src = checkingSrc;
   }
  },
  SetPreviewImageSize: function(sourceWidth, sourceHeight, maxWidth, maxHeight) {
   var newWidth = sourceWidth;
   var newHeight = sourceHeight;
   if((sourceWidth > maxWidth) ||
    (sourceHeight > maxHeight)) {
    var cw = sourceWidth / maxWidth;
    var ch = sourceHeight / maxHeight;
    if(cw > ch) {
     var cw = sourceWidth / maxWidth;
     newWidth = Math.floor(sourceWidth / cw);
     newHeight = Math.floor(sourceHeight / cw);
    }
    else {
     newWidth = Math.floor(sourceWidth / ch);
     newHeight = Math.floor(sourceHeight / ch);
    }
   }
   var previewImage = this.GetPreviewImageElement();
   previewImage.style.width = newWidth + "px";
   previewImage.style.height = newHeight + "px";
  },
  ShowErrorMessage: function(message) {
   var textBox = this.GetInsertImageUrlTextBox();
   textBox.isValid = false;
   textBox.errorText = message;
   textBox.UpdateErrorFrameAndFocus(false, true);
  },
  GetFocusedElement: function() {
   return dxreDialog_TxbInsertImageUrl;
  },
  OnCallback: function(result) {
   if(result.indexOf(constants.SaveImageToServerCallbackPrefix) == 0) {
    this.OnImageSavedToServer(result.substring(constants.SaveImageToServerCallbackPrefix.length + 1, result.length));
    if(this.callbackCount > 0)
     this.callbackCount--;
    if(this.callbackCount <= 0)
     this.ownerControl.clearOwnerControlCallback();
   }
   else
    ASPx.Dialog.prototype.OnCallback.call(this, result);
  },
  OnImageFromTypeChanged: function() {
   var url = dxreDialog_InsertImageFormLayout.GetItemByName("TxbInsertImageUrl");
   var previewArea = dxreDialog_InsertImageFormLayout.GetItemByName("ImagePreview");
   var uploadArea = dxreDialog_InsertImageFormLayout.GetItemByName("UploadControl");
   url.SetVisible(!dxreDialog_RblNavigation.GetValue());
   previewArea.SetVisible(!dxreDialog_RblNavigation.GetValue());
   uploadArea.SetVisible(dxreDialog_RblNavigation.GetValue());
  },
  OnLoadTestExistingImage: function() {
   ASPxClientEdit.ValidateGroup("_dxeTbxInsertImageUrlGroup");
   this.GetPreviewImageElement().src = this.testImage.src;
   var previewArea = this.GetPreviewAreaCell();
   var maxWidth = previewArea.clientWidth;
   var maxHeight = ASPx.Browser.WebKitFamily ? previewArea.offsetHeight : previewArea.clientHeight;
   this.SetPreviewImageSize(this.testImage.width, this.testImage.height, maxWidth, maxHeight);
   ASPx.SetElementDisplay(this.GetPreviewTextElement(), false);
   ASPx.SetElementDisplay(this.GetPreviewImageElement(), true);
   previewArea.style.borderStyle = "none";
  },
  OnErrorTestExistingImage: function() {
   ASPx.SetElementDisplay(this.GetPreviewTextElement(), true);
   ASPx.SetElementDisplay(this.GetPreviewImageElement(), false);
   var previewArea = this.GetPreviewAreaCell();
   previewArea.style.borderStyle = "";
  },
  OnImageSrcChanged: function(src) {
   this.CheckImageExisting(src);
  },
  OnImageSavedToServer: function(result) {
   if(result.indexOf(constants.SaveImageToServerErrorCallbackPrefix) > -1)
    this.ShowErrorMessage(result.substring(constants.SaveImageToServerErrorCallbackPrefix.length + 1, result.length));
   else {
    var result = eval(result.substr(constants.SaveImageToServerNewUrlCallbackPrefix.length + 1, result.length));
    if(result.id !== null) {
     this.insertImageParams.id = result.id;
     this.insertImageParams.originalWidth = result.originalWidth;
     this.insertImageParams.originalHeight = result.originalHeight;
     this.insertImageParams.base64EncodedImage = result.base64EncodedImage;
     ASPxRichEditDialog.prototype.OnComplete.call(this, 1, this.insertImageParams);
    }
    else
     ASPxRichEditDialog.prototype.OnComplete.call(this, 0, this.insertImageParams);
   }
  },
  OnImageUploadComplete: function(args) {
   this.HideLoadingPanelOverDialogPopup();
   this.notifyOwnerControlThatDocumentUploadingComplete();
   if(args.isValid) {
    var result = eval(args.callbackData);
    if(result.id !== null) {
     this.insertImageParams.id = result.id;
     this.insertImageParams.originalWidth = result.originalWidth;
     this.insertImageParams.originalHeight = result.originalHeight;
     this.insertImageParams.base64EncodedImage = result.base64EncodedImage;
     ASPxRichEditDialog.prototype.OnComplete.call(this, 1, this.insertImageParams);
    }
    else
     ASPxRichEditDialog.prototype.OnComplete.call(this, 0, this.insertImageParams);
   }
  },
  OnImageUploadStart: function() {
   this.ShowLoadingPanelOverDialogPopup();
  },
  GetPreviewTextElement: function() {
   return ASPx.GetElementById(this.richedit.name + constants.PreviewTextElementID);
  },
  GetPreviewImageElement: function() {
   return ASPx.GetElementById(this.richedit.name + constants.PreviewImageElementID);
  },
  GetPreviewAreaCell: function() {
   return ASPx.GetParentByTagName(this.GetPreviewImageElement(), "table");
  },
  GetImageUploader: function() {
   return dxreDialog_UplImage;
  },
  GetInsertImageUrlTextBox: function() {
   return dxreDialog_TxbInsertImageUrl;
  },
  isDialogValid: function() {
   var ret = true;
   if(dxreDialog_TxbInsertImageUrl.IsVisible())
    ret = ASPxClientEdit.ValidateGroup("_dxeTbxInsertImageUrlGroup") && ret;
   else {
    ret = (dxreDialog_UplImage.GetText() != "") && ret;
    if(!ret)
     dxreDialog_UplImage.UpdateCommonErrorDiv(dxreDialog_HiddenField.Get("RequiredFieldError"), true);
   }
   return ret;
  },
  notifyOwnerControlThatDocumentUploadingStarted: function() {
   this.richedit.documentUploadingStarted();
  },
  notifyOwnerControlThatDocumentUploadingComplete: function() {
   this.richedit.documentUploadingComplete();
  }
 });
 var REAlertDialog = ASPx.CreateClass(ASPxRichEditDialog, {
  InitializeDialogFields: function(parameters) {
   var text = ASPxRichEditDialogList.AlertTexts[parameters.messageTextId];
   dxreDialog_MessageText.SetValue(text);
  },
  GetResultParameters: function() {
   var returnedObject = this.GetInitInfoObject();
   return returnedObject;
  }
 });
 var REErrorDialog = ASPx.CreateClass(REAlertDialog, {
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.Error;
  }
 });
 var REInformationDialog = ASPx.CreateClass(REAlertDialog, {
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.Information;
  }
 });
 var REWarningDialog = ASPx.CreateClass(REAlertDialog, {
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.Warning;
  }
 });
 var REFindReplaceDialog = ASPx.CreateClass(ASPxRichEditDialog, {  
  Execute: function(ownerControl, parameters, callback, afterClosing, isModal) {
   ownerControl.hideQuickSearchPanel();
   ASPxRichEditDialog.prototype.Execute.call(this, ownerControl, parameters, callback, afterClosing, isModal);
  },
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.FindReplace;
  },
  InitializeDialogFields: function(parameters) {
   this.controller = parameters.controller;
   this.resetSearchOnClose = true;
   this.controller.onChanged.add(this);
   if(this.controller.whatFind) {
    dxreDialog_TxbFind.SetValue(parameters.controller.whatFind);
    if(this.controller.foundIntervals.length)
     this.fillResults(this.controller.foundIntervals);
    else
     this.findAll();
   }
  },
  attachEvents: function() {
   ASPxRichEditDialog.prototype.attachEvents.call(this);
   dxreDialog_TxbFind.KeyUp.AddHandler(function(s, e) {
    clearTimeout(this.searchTimerId);
    if(s.GetValue() !== null)
     this.searchTimerId = setTimeout(function() {
      this.findAll();
     }.aspxBind(this), 700);
    else {
     this.clearResults();
     this.controller.resetSearch();
    }
   }.aspxBind(this));
   dxreDialog_ChkMatchCase.ValueChanged.AddHandler(function() { this.findAll(); }.aspxBind(this));
   dxreDialog_LsbResult.ValueChanged.AddHandler(function() { this.goTo(); }.aspxBind(this));
   dxreDialog_BtnReplace.Click.AddHandler(function() { this.replace(); }.aspxBind(this));
   dxreDialog_BtnReplaceAll.Click.AddHandler(function() { this.replaceAll(); }.aspxBind(this));
   dxreDialog_BtnNext.Click.AddHandler(function() { this.findNext(); }.aspxBind(this));
   dxreDialog_BtnPrevious.Click.AddHandler(function() { this.findPrev(); }.aspxBind(this));
   ASPx.Evt.AttachEventToElement(this.GetDialogPopup().GetWindowElement(-1), "keydown", function(e) {
    var shortcutCode = ASPx.GetShortcutCodeByEvent(e);
    if (shortcutCode === __aspxRichEdit.QuickSearchPanel.shortcuts.showDialog || shortcutCode === __aspxRichEdit.QuickSearchPanel.shortcuts.showPanel) {
     ASPx.Evt.PreventEvent(e);
     if (shortcutCode === __aspxRichEdit.QuickSearchPanel.shortcuts.showPanel) {
      this.resetSearchOnClose = dxreDialog_ChkMatchCase.GetValue();
      this.HideDialogPopup();
      this.richedit.showQuickSearchPanel();
     }
    }
   }.aspxBind(this));
  },
  GetFocusedElement: function() {
   return dxreDialog_TxbFind;
  },
  findNext: function() {
   var index = this.controller.findNextIntervalIndex();
   if(index !== null) {
    this.controller.selectIntervalByIndex(index);
    this.selectResult(index);
   }
  },
  findPrev: function() {
   var index = this.controller.findPrevIntervalIndex();
   if(index !== null) {
    this.controller.selectIntervalByIndex(index);
    this.selectResult(index);
   }
  },
  findAll: function() {
   if(dxreDialog_TxbFind.GetValue()) {
    this.controller.findAll(dxreDialog_TxbFind.GetValue(), dxreDialog_ChkMatchCase.GetValue());
    this.fillResults(this.controller.foundIntervals);
    var index = this.controller.findNextIntervalIndex();
    if(index !== null)
     this.controller.scrollToIntervalByIndex(index);
   }
  },
  replace: function() {
   var replaceWith = dxreDialog_TxbReplace.GetValue() || "";
   if(this.controller.replace(dxreDialog_TxbFind.GetValue(), replaceWith, dxreDialog_ChkMatchCase.GetValue()))
    this.findAll();
   this.findNext();
  },
  replaceAll: function() {
   var replacementCount = this.controller.foundIntervals.length;
   var replaceWith = dxreDialog_TxbReplace.GetValue() || "";
   this.ShowLoadingPanelOverDialogPopup();
   setTimeout(function() {
    this.controller.replaceAll(dxreDialog_TxbFind.GetValue(), replaceWith, dxreDialog_ChkMatchCase.GetValue());
    this.HideLoadingPanelOverDialogPopup();
    this.showReplaceInfo(replacementCount);
    this.findAll();
   }.aspxBind(this), 0);
  },
  goTo: function() {
   var index = dxreDialog_LsbResult.GetSelectedIndex();
   this.controller.selectIntervalByIndex(index);
   this.updateResultLabel(index);
  },
  SetEnabledForButton: function(enabled) {
   var readOnly = this.richedit.core.readOnly === __aspxRichEdit.ReadOnlyMode.Persistent;
   dxreDialog_BtnReplaceAll.SetEnabled(enabled && !readOnly);
   dxreDialog_BtnReplace.SetEnabled(enabled && !readOnly);
   dxreDialog_BtnNext.SetEnabled(enabled);
   dxreDialog_BtnPrevious.SetEnabled(enabled);
  },
  showReplaceInfo: function(value) {
   clearTimeout(this.replaceInfoTimer);
   var replaceInfoElement = this.getReplaceInfoElement();
   replaceInfoElement.children[0].innerHTML = ASPx.Str.ApplyReplacement(ASPxRichEditDialogList.OtherLabels.ReplaceAllNotify, [["{0}", value]]);
   ASPx.SetElementVisibility(replaceInfoElement, true);
   this.replaceInfoTimer = setTimeout(this.hideReplaceInfo.aspxBind(this), 3000);
  },
  hideReplaceInfo: function() {
   var replaceInfoElement = this.getReplaceInfoElement();
   ASPx.AnimationHelper.fadeOut(replaceInfoElement, function() {
    ASPx.SetElementVisibility(replaceInfoElement, false);
    ASPx.SetElementOpacity(replaceInfoElement, 1);
   });
  },
  fillResults: function(foundIntervals) {
   this.clearResults();
   if(foundIntervals.length) {
    if(foundIntervals.length < 300) {
     ASPx.Data.ForEach(foundIntervals, function(interval, index) {
      dxreDialog_LsbResult.AddItem(__aspxRichEdit.DialogFindReplaceCommand.getTextForResult(this.richedit.core, this.richedit.core.model.activeSubDocument, interval), index);
     }.aspxBind(this));
     dxreDialog_LsbResult.SetEnabled(true);
    }
    else {
     dxreDialog_LsbResult.AddItem(ASPxRichEditDialogList.OtherLabels.FindTooLongResult);
     dxreDialog_LsbResult.SetEnabled(false);
    }
    this.SetEnabledForButton(true);
   }
   else {
    if(dxreDialog_TxbFind.GetValue())
     dxreDialog_LsbResult.AddItem(ASPxRichEditDialogList.OtherLabels.FindNoResult);
    dxreDialog_LsbResult.SetEnabled(false);
   }
   this.updateResultLabel(-1);
  },
  clearResults: function() {
   dxreDialog_LsbResult.ClearItems();
   this.SetEnabledForButton(false);
   this.updateResultLabel();
  },
  selectResult: function(index) {
   if(dxreDialog_LsbResult.GetEnabled())
    dxreDialog_LsbResult.SetSelectedIndex(index);
   this.updateResultLabel(index);
  },
  updateResultLabel: function(index) {
   if(this.controller.foundIntervals.length) {
    var resultText = index >= 0 ?
     ASPx.Str.ApplyReplacement("{0} " + ASPxClientRichEdit.QuickSearchPanel.Of + " {1}", [["{0}", index + 1], ["{1}", this.controller.foundIntervals.length]]) :
     ASPxClientRichEdit.QuickSearchPanel.Items + ": " + this.controller.foundIntervals.length;
    this.getResultLabel().innerHTML = resultText;
    return;
   }
   __aspxRichEdit.HTMLUtils.clearInnerHtml(this.getResultLabel());
  },
  getResultLabel: function() {
   return ASPx.GetElementById(this.richedit.name + constants.SearchResultLabelID);
  },
  getReplaceInfoElement: function() {
   var replaceInfoItem = dxreDialog_FormLayout.GetItemByName("InfoBox");
   var replaceInfoElement = dxreDialog_FormLayout.GetHTMLElementByItem(replaceInfoItem).firstElementChild.firstElementChild;
   return replaceInfoElement;
  },
  NotifySearchReset: function() {
   this.clearResults();
  },
  OnClose: function() {
   ASPxRichEditDialog.prototype.OnClose.call(this);
   if(this.resetSearchOnClose)
    this.controller.resetSearch();
   this.controller.onChanged.remove(this);
  }
 });
 var RENumberingListDialog = ASPx.CreateClass(ASPxRichEditDialog, {
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.BulletedAndNumbering;
  },
  InitializeDialogFields: function(parameters) {
   this.FillAllowedListType();
   this.FillAbstractNumberingListsArray();
   this.InitializeTabs();
   this.SetSelectedList(parameters.selectedAbstractNumberingList);
  },
  InitializeTabs: function() {
   this.listBoxes = [];
   this.forEachListType(function(listType) {
    this.InitializeListBoxes(listType);
    this.CreateItems(listType);
   }.aspxBind(this));
   this.lastListType = this.GetActiveTabType();
   this.initializeTabsComplited = true;
  },
  SetSelectedList: function(selectedList) {
   if(selectedList) {
    var listType = selectedList.getListType();
    if(this.IsAllowedListType(listType)) {
     this.SetActiveTab(listType);
     this.GetListBox(listType).SetSelectedValue(selectedList);
    }
   }
   if(selectedList === null)
    this.GetListBox(this.lastListType).SetSelectedValue(null);
  },
  InitializeListBoxes: function(listType) {
   this.listBoxes[listType] = new NumberingListBox(this, "numbering" + listType, this.GetMainElementByListType(listType));
  },
  attachEvents: function() {
   ASPxRichEditDialog.prototype.attachEvents.call(this);
   dxreDialog_BtnCustomize.Click.AddHandler(this.ShowCustomizeListDialog.aspxBind(this));
   dxreDialog_NumberingListPageControl.ActiveTabChanged.AddHandler(this.OnActiveTabChanged.aspxBind(this));
  },
  CreateItems: function(listType) {
   var listBox = this.GetListBox(listType);
   listBox.AddItem(null);
   for(var i = 0, list; list = this.abstractNumberingLists[i]; i++)
    if(list.getListType() == listType)
     listBox.AddItem(list);
  },
  SetActiveTab: function(listType) {
   switch(listType) {
    case __aspxRichEdit.NumberingType.Bullet:
     dxreDialog_NumberingListPageControl.SetActiveTabIndex(0);
     break;
    case __aspxRichEdit.NumberingType.Simple:
     dxreDialog_NumberingListPageControl.SetActiveTabIndex(1);
     break;
    case __aspxRichEdit.NumberingType.MultiLevel:
     dxreDialog_NumberingListPageControl.SetActiveTabIndex(2);
     break;
   }
   this.lastListType = listType;
  },
  FillAbstractNumberingListsArray: function() {
   this.abstractNumberingLists = [];
   if (this.parameters.selectedAbstractNumberingList)
    this.abstractNumberingLists.push(this.parameters.selectedAbstractNumberingList);
   this.FillListsArrayFromModel(this.richedit.core.model.abstractNumberingLists);
   this.FillListsArrayFromModel(this.richedit.core.model.abstractNumberingListTemplates);
  },
  FillListsArrayFromModel: function(abstractNumberingLists) {
   for(var i = 0, list; list = abstractNumberingLists[i]; i++)
    if(!this.IsArrayContainsListWithSameProperties(list))
     this.abstractNumberingLists.push(list);
  },
  IsArrayContainsListWithSameProperties: function (list) {
   var lvlIndex = this.parameters.currentLevel;
   for(var i = 0, currentList; currentList = this.abstractNumberingLists[i]; i++)
    if (list.getListType() == __aspxRichEdit.NumberingType.MultiLevel) {
     if (currentList.externallyEquals(list))
      return true;
    }
    else if (list.getListType() == currentList.getListType() && currentList.levels[lvlIndex].externallyEquals(list.levels[lvlIndex]))
     return true;
   return false;
  },
  OnValueChanged: function(value) {
   this.SetEnabledForCustomizeButton(!!value);
   this.SetEnabledForOkButton(true);
  },
  OnActiveTabChanged: function() {
   if(!this.initializeTabsComplited)
    return;
   var selectedIndex = this.GetListBox(this.lastListType).GetSelectedIndex();
   this.lastListType = this.GetActiveTabType();
   if(selectedIndex > -1) {
    var listBox = this.GetListBox(this.lastListType);
    var newIndex = Math.min(selectedIndex, listBox.itemsCount - 1);
    listBox.SetSelectedIndex(newIndex);
   }
  },
  SetEnabledForCustomizeButton: function(value) {
   dxreDialog_BtnCustomize.SetEnabled(value);
  },
  SetEnabledForOkButton: function(value) {
   dxreDialog_BtnOk.SetEnabled(value);
  },
  IsBulletedTabSelected: function() {
   return dxreDialog_NumberingListPageControl.GetActiveTabIndex() == 0;
  },
  GetActiveTabType: function() {
   var activeTabIndex = dxreDialog_NumberingListPageControl.GetActiveTabIndex();
   switch(activeTabIndex) {
    case 0:
     return __aspxRichEdit.NumberingType.Bullet;
    case 1:
     return __aspxRichEdit.NumberingType.Simple;
    case 2:
     return __aspxRichEdit.NumberingType.MultiLevel;
   }
   return null;
  },
  GetListBox: function(listType) {
   return this.listBoxes[listType];
  },
  GetMainElementByListType: function(listType) {
   return ASPx.GetElementById(this.richedit.name + constants.AbstractNumberingListElementID + listType);
  },
  GetFocusedElement: function() {
   return dxreDialog_BtnOk;
  },
  forEachListType: function(action) {
   for(var i = 0; i < this.allowedListTypes.length; i++)
    action(this.allowedListTypes[i]);
  },
  IsAllowedListType: function(listType) {
   return ASPx.Data.ArrayContains(this.allowedListTypes, listType);
  },
  FillAllowedListType: function() {
   this.allowedListTypes = [];
   var options = this.richedit.core.options;
   var defaultValue = __aspxRichEdit.DocumentCapability.Default;
   var enabledValue = __aspxRichEdit.DocumentCapability.Enabled;
   if(options.numberingBulleted == defaultValue || options.numberingBulleted == enabledValue)
    this.allowedListTypes.push(__aspxRichEdit.NumberingType.Bullet);
   if(options.numberingSimple == defaultValue || options.numberingSimple == enabledValue)
    this.allowedListTypes.push(__aspxRichEdit.NumberingType.Simple);
   if(options.numberingMultiLevel == defaultValue || options.numberingMultiLevel == enabledValue)
    this.allowedListTypes.push(__aspxRichEdit.NumberingType.MultiLevel);
  },
  ShowCustomizeListDialog: function() {
   var clientCommand = __aspxRichEdit.RichEditClientCommand.ShowCustomNumberingListForm;
   var listBox = this.GetListBox(this.GetActiveTabType());
   var selectedAbstractList = listBox.GetValue();
   var params = new __aspxRichEdit.DialogCustomNumberingListParameters();
   params.init(this.richedit.core.model.colorProvider, selectedAbstractList, this.parameters.currentLevel);
   this.OnComplete(0);
   this.richedit.core.commandManager.getCommand(clientCommand).execute(this.richedit.core.commandManager.isPublicApiCall, params);
  },
  OnClose: function() {
   ASPxRichEditDialog.prototype.OnClose.call(this);
   this.initializeTabsComplited = false;
  },
  GetResultParameters: function() {
   var returnedObject = this.GetInitInfoObject();
   returnedObject.selectedAbstractNumberingList = this.GetListBox(this.GetActiveTabType()).GetValue();
   return returnedObject;
  }
 });
 var RENumberingListDialogBase = ASPx.CreateClass(ASPxRichEditDialog, {
  onCancelButtonClick: function() {
   this.ShowNumberingListForm();
  },
  InitializeDialogFields: function(parameters) {
   this.parameters = parameters;
   this.UpdateForm();
  },
  attachEvents: function() {
   ASPxRichEditDialog.prototype.attachEvents.call(this);
   dxreDialog_BtnFont.Click.AddHandler(this.ShowServiceFontForm.aspxBind(this));
   dxreDialog_SpnAlignedAt.ValueChanged.AddHandler(function(s) {
    this.OnAlignedValueChanged();
   }.aspxBind(this));
   dxreDialog_SpnIndentAt.ValueChanged.AddHandler(function(s) {
    this.OnIndentValueChanged();
   }.aspxBind(this));
  },
  UpdateForm: function() {
  },
  GetFirstLineIndent: function() {
   var level = this.GetEditedLevel();
   if(level.firstLineIndentType == __aspxRichEdit.ParagraphFirstLineIndent.Hanging)
    return level.leftIndent - level.firstLineIndent;
   return level.firstLineIndent + level.leftIndent;
  },
  GetEditedLevel: function() {
   return this.parameters.levels[this.GetEditedLevelIndex()];
  },
  UpdateNumberFormat: function() {
   var items = [];
   for(var i = 0; i <= this.GetEditedLevelIndex() ; i++) {
    var currentLevel = this.parameters.levels[i];
    var converter = __aspxRichEdit.OrdinalBasedNumberConverter.createConverter(currentLevel.format);
    items[i] = converter.convertNumber(currentLevel.start);
   }
   var value = ASPx.Formatter.Format(this.GetEditedLevel().displayFormatString, items);
   this.SetNumberFormatValue(value);
  },
  OnAlignedValueChanged: function() {
   this.AssignIndentValues();
  },
  OnIndentValueChanged: function() {
   this.AssignIndentValues();
  },
  OnNumberFormatChanged: function() {
   var numberFormat = dxreDialog_TxbNumberFormat.GetValue();
   var resultFormat = "";
   for (var i = this.GetEditedLevelIndex(); i >= 0; i--) {
    var currentLevel = this.parameters.levels[i];
    var converter = __aspxRichEdit.OrdinalBasedNumberConverter.createConverter(currentLevel.format);
    var item = converter.convertNumber(currentLevel.start);
    var index = numberFormat.lastIndexOf(item);
    if (index != -1) {
     resultFormat = "{" + i + "}" + numberFormat.substring(index + item.length) + resultFormat;
     numberFormat = numberFormat.substring(0, index);
    }
   }
   this.GetEditedLevel().displayFormatString = resultFormat;
   this.UpdateNumberFormat();
  },
  OnNumberStyleChanged: function() {
   this.GetEditedLevel().format = dxreDialog_CbxNumberStyle.GetValue();
   this.UpdateNumberFormat();
  },
  OnStartAtChanged: function() {
   this.GetEditedLevel().start = dxreDialog_SpnStartAt.GetValue();
   this.UpdateNumberFormat();
  },
  OnNumberPositionChanged: function() {
   this.GetEditedLevel().alignment = dxreDialog_CbxNumberPosition.GetValue();
  },
  AssignIndentValues: function() {
   var alignValue = this.richedit.core.uiUnitConverter.UIToTwips(this.GetAlignedEditorValue());
   var indentValue = this.richedit.core.uiUnitConverter.UIToTwips(this.GetIndentEditorValue());
   var level = this.GetEditedLevel();
   level.leftIndent = indentValue;
   var probableFirstLineIndent = indentValue - alignValue;
   if(probableFirstLineIndent > 0) {
    level.firstLineIndentType = __aspxRichEdit.ParagraphFirstLineIndent.Hanging;
    level.firstLineIndent = probableFirstLineIndent;
   }
   else if(probableFirstLineIndent < 0) {
    level.firstLineIndentType = __aspxRichEdit.ParagraphFirstLineIndent.Indented;
    level.firstLineIndent = -probableFirstLineIndent;
   }
   else {
    level.firstLineIndentType = __aspxRichEdit.ParagraphFirstLineIndent.None;
    level.firstLineIndent = 0;
   }
  },
  SetNumberFormatValue: function(value) {
   dxreDialog_TxbNumberFormat.SetValue(value);
  },
  GetAlignedEditorValue: function() {
   return dxreDialog_SpnAlignedAt.GetValue();
  },
  GetIndentEditorValue: function() {
   return dxreDialog_SpnIndentAt.GetValue();
  },
  GetEditedLevelIndex: function() {
   return this.parameters.currentLevel;
  },
  ShowNumberingListForm: function() {
   this.OnComplete(0);
   var clientCommand = __aspxRichEdit.RichEditClientCommand.ShowNumberingListForm;
   this.richedit.core.commandManager.getCommand(clientCommand).execute(this.richedit.core.commandManager.isPublicApiCall, this.parameters.initAbstractNumberingList);
  },
  ShowServiceFontForm: function() {
   this.ShowServiceForm(__aspxRichEdit.RichEditClientCommand.ShowServiceFontForm);
  },
  ShowServiceForm: function(clientCommand) {
   this.OnComplete(0);
   this.richedit.core.commandManager.getCommand(clientCommand).execute(this.richedit.core.commandManager.isPublicApiCall, this.parameters);
  },
  GetResultParameters: function() {
   var returnedObject = this.GetInitInfoObject();
   return returnedObject;
  }
 });
 var RESimpleNumberingListDialog = ASPx.CreateClass(RENumberingListDialogBase, {
  attachEvents: function() {
   RENumberingListDialogBase.prototype.attachEvents.call(this);
   dxreDialog_TxbNumberFormat.LostFocus.AddHandler(this.OnNumberFormatChanged.aspxBind(this));
   dxreDialog_CbxNumberStyle.ValueChanged.AddHandler(this.OnNumberStyleChanged.aspxBind(this));
   dxreDialog_SpnStartAt.ValueChanged.AddHandler(this.OnStartAtChanged.aspxBind(this));
  },
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.CustomizeNumberedList;
  },
  UpdateForm: function() {
   var level = this.GetEditedLevel();
   dxreDialog_CbxNumberStyle.SetValue(level.format);
   dxreDialog_SpnStartAt.SetValue(level.start);
   dxreDialog_CbxNumberPosition.SetValue(level.alignment);
   dxreDialog_SpnIndentAt.SetValue(this.richedit.core.uiUnitConverter.twipsToUI(level.leftIndent));
   dxreDialog_SpnAlignedAt.SetValue(this.richedit.core.uiUnitConverter.twipsToUI(this.GetFirstLineIndent()));
   this.UpdateNumberFormat();
  }
 });
 var REBulletedListDialog = ASPx.CreateClass(RENumberingListDialogBase, {
  attachEvents: function() {
   RENumberingListDialogBase.prototype.attachEvents.call(this);
   dxreDialog_BtnChar.Click.AddHandler(this.ShowServiceSymbolsForm.aspxBind(this));
   for(var i = 0; i < 6; i++) {
    var preset = this.GetPresetControl(i);
    preset.Click.AddHandler(function(s) {
     this.OnPresetChecked(s);
    }.aspxBind(this));
   }
  },
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.CustomizeBulletedList;
  },
  UpdateForm: function() {
   dxreDialog_SpnIndentAt.SetValue(this.richedit.core.uiUnitConverter.twipsToUI(this.GetEditedLevel().leftIndent));
   dxreDialog_SpnAlignedAt.SetValue(this.richedit.core.uiUnitConverter.twipsToUI(this.GetFirstLineIndent()));
   this.UpdateBulletCharacters();
  },
  UpdateBulletCharacters: function() {
   var fontName = this.GetEditedLevel().fontName;
   var symbol = this.GetEditedLevel().displayFormatString;
   var symbolIndex = this.GetActiveSymbolIndex(symbol, fontName);
   if(symbolIndex == -1) {
    symbolIndex = 0;
    this.SetPresetSymbolProperties(symbolIndex, symbol, fontName);
   }
   this.GetPresetControl(symbolIndex).SetChecked(true);
  },
  GetActiveSymbolIndex: function(symbol, fontName) {
   for(var i = 0; i < 6; i++) {
    var preset = this.GetPresetControl(i);
    if(preset.GetText() == symbol && this.GetPresetFontName(preset) == fontName)
     return i;
   }
   return -1;
  },
  SetPresetSymbolProperties: function(index, symbol, fontName) {
   var preset = this.GetPresetControl(index);
   preset.SetText(symbol);
   ASPx.SetStyles(preset.GetTextContainer(), { "font-family": fontName });
  },
  OnPresetChecked: function(preset) {
   this.GetEditedLevel().fontName = this.GetPresetFontName(preset);
   this.GetEditedLevel().displayFormatString = preset.GetText();
  },
  GetPresetControl: function(index) {
   return element = window[constants.BulletedPresetElementName + index];
  },
  GetPresetFontName: function(presetControl) {
   return ASPx.GetCurrentStyle(presetControl.GetTextContainer()).fontFamily;
  },
  ShowServiceSymbolsForm: function() {
   this.ShowServiceForm(__aspxRichEdit.RichEditClientCommand.ShowServiceSymbolsForm);
  }
 });
 var REMultiLevelNumberingListDialog = ASPx.CreateClass(RENumberingListDialogBase, {
  attachEvents: function() {
   RENumberingListDialogBase.prototype.attachEvents.call(this);
   dxreDialog_LbLevel.SelectedIndexChanged.AddHandler(function(s) {
    this.SetEditedLevel(s.GetValue());
   }.aspxBind(this));
   dxreDialog_TxbNumberFormat.LostFocus.AddHandler(this.OnNumberFormatChanged.aspxBind(this));
   dxreDialog_CbxNumberStyle.ValueChanged.AddHandler(this.OnNumberStyleChanged.aspxBind(this));
   dxreDialog_SpnStartAt.ValueChanged.AddHandler(this.OnStartAtChanged.aspxBind(this));
   dxreDialog_CbxNumberPosition.ValueChanged.AddHandler(this.OnNumberPositionChanged.aspxBind(this));
  },
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.CustomizeOutlineNumbered;
  },
  UpdateForm: function() {
   dxreDialog_LbLevel.SetValue(this.parameters.currentLevel);
   var level = this.GetEditedLevel();
   dxreDialog_CbxNumberStyle.SetValue(level.format);
   dxreDialog_SpnStartAt.SetValue(level.start);
   dxreDialog_CbxNumberPosition.SetValue(level.alignment);
   dxreDialog_SpnIndentAt.SetValue(this.richedit.core.uiUnitConverter.twipsToUI(level.leftIndent));
   dxreDialog_SpnAlignedAt.SetValue(this.richedit.core.uiUnitConverter.twipsToUI(this.GetFirstLineIndent()));
   this.UpdateSeparator();
   this.UpdateNumberFormat();
  },
  UpdateSeparator: function() {
   var separator = this.GetEditedLevel().separator;
   var value = 2;
   switch(separator) {
    case __aspxRichEdit.RichUtils.specialCharacters.TabMark:
     value = 0;
     break;
    case ' ':
     value = 1;
     break;
   }
   dxreDialog_CbxFollowNumberWith.SetValue(value);
  },
  OnFollowNumberWithChanged: function() {
   this.GetEditedLevel().separator = dxreDialog_CbxFollowNumberWith.GetValue();
  },
  SetEditedLevel: function(value) {
   this.parameters.currentLevel = value;
   this.UpdateForm();
  },
  GetEditedLevelIndex: function() {
   return this.parameters.currentLevel;
  }
 });
 var REHyperlinkDialogEnum = {
  WebPage: 0,
  Bookmarks: 1,
  Mail: 2
 };
 var REHyperlinkDialog = ASPx.CreateClass(ASPxRichEditDialog, {
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.Hyperlink;
  },
  InitializeDialogFields: function(parameters) {
   this.ClearFilels();
   this.InitializeFields(parameters);
   this.SetLinkToValue(parameters);
   this.SetOkBtnEnabled();
   this.updateFieldsVisibility();
  },
  ClearFilels: function() {
   dxreDialog_TxbURL.SetValue("");
   dxreDialog_TxbEmailTo.SetValue("");
   dxreDialog_TxbSubject.SetValue("");
  },
  SetLinkToValue: function(parameters) {
   if(parameters.anchor)
    dxreDialog_RblLinkTo.SetValue(REHyperlinkDialogEnum.Bookmarks);
   else if(this.IsLinkMailTo(parameters.url))
    dxreDialog_RblLinkTo.SetValue(REHyperlinkDialogEnum.Mail);
   else
    dxreDialog_RblLinkTo.SetValue(REHyperlinkDialogEnum.WebPage);
  },
  InitializeFields: function(parameters) {
   this.InitializeBookmarksField(parameters);
   if(this.IsLinkMailTo(parameters.url))
    this.InitializeEmailFields(parameters.url);
   else
    this.InitializeUrlFields(parameters);
   if(parameters.canChangeDisplayText)
    dxreDialog_TxbText.SetValue(parameters.text);
   else
    dxreDialog_TxbText.SetEnabled(false);
   dxreDialog_TxbToolTip.SetValue(parameters.tooltip);
  },
  InitializeBookmarksField: function(parameters) {
   dxreDialog_CbBookmarkNames.Clear();
   for(var i = 0, name; name = parameters.bookmarkNames[i]; i++)
    dxreDialog_CbBookmarkNames.AddItem(name);
   if(parameters.anchor)
    dxreDialog_CbBookmarkNames.SetValue(parameters.anchor);
   else if(parameters.bookmarkNames.length)
    dxreDialog_CbBookmarkNames.SetValue(parameters.bookmarkNames[0]);
  },
  InitializeUrlFields: function(parameters) {
   dxreDialog_TxbURL.SetValue(parameters.url && !parameters.anchor ? parameters.url : constants.DefaultLinkPrefix);
  },
  InitializeEmailFields: function(url) {
   var mailtoIndex = url.toLowerCase().indexOf(constants.MailToPrefex),
    subjectIndex = url.toLowerCase().indexOf(constants.SubjectPrefix),
    endIndex = subjectIndex > -1 ? subjectIndex : url.length,
    email = url.substring(mailtoIndex + constants.MailToPrefex.length, endIndex);
   subject = subjectIndex == -1 ? "" : unescape(url.substring(subjectIndex + constants.SubjectPrefix.length));
   dxreDialog_TxbEmailTo.SetValue(email);
   dxreDialog_TxbSubject.SetValue(subject);
  },
  attachEvents: function() {
   ASPxRichEditDialog.prototype.attachEvents.call(this);
   dxreDialog_TxbURL.KeyUp.AddHandler(this.SetOkBtnEnabled.aspxBind(this));
   dxreDialog_TxbEmailTo.KeyUp.AddHandler(this.SetOkBtnEnabled.aspxBind(this));
   dxreDialog_RblLinkTo.ValueChanged.AddHandler(function() { this.updateFieldsVisibility(); }.aspxBind(this));
  },
  SetOkBtnEnabled: function() {
   var isEmail = this.IsActiveEmailForm();
   var value = isEmail ? dxreDialog_TxbEmailTo.GetText().length > 0 : dxreDialog_TxbURL.GetText().length > 0;
   dxreDialog_BtnOk.SetEnabled(value);
  },
  IsLinkMailTo: function(url) {
   return url.toLowerCase().indexOf(constants.MailToPrefex) > -1;
  },
  IsActiveEmailForm: function() {
   return dxreDialog_RblLinkTo.GetValue() == REHyperlinkDialogEnum.Mail;
  },
  GetFocusedElement: function() {
   return this.IsActiveEmailForm() ? dxreDialog_TxbEmailTo : dxreDialog_TxbURL;
  },
  GetUrl: function() {
   var url = dxreDialog_TxbURL.GetText();
   if(this.IsActiveEmailForm()) {
    url = constants.MailToPrefex + dxreDialog_TxbEmailTo.GetText();
    var subject = dxreDialog_TxbSubject.GetText();
    if(subject)
     url += constants.SubjectPrefix + subject;
   }
   return url;
  },
  GetResultParameters: function() {
   var url = this.GetUrl(),
    text = dxreDialog_TxbText.GetText(),
    tooltip = dxreDialog_TxbToolTip.GetText(),
    anchor = dxreDialog_CbBookmarkNames.GetValue(),
    canChangeDisplayText = dxreDialog_TxbText.GetEnabled();
   var returnedObject = this.GetInitInfoObject();
   returnedObject.url = "";
   returnedObject.anchor = "";
   returnedObject.text = text;
   returnedObject.tooltip = tooltip;
   returnedObject.canChangeDisplayText = canChangeDisplayText;
   switch(dxreDialog_RblLinkTo.GetValue()) {
    case REHyperlinkDialogEnum.WebPage:
    case REHyperlinkDialogEnum.Mail:
     returnedObject.url = url;
     break;
    case REHyperlinkDialogEnum.Bookmarks:
     returnedObject.anchor = anchor;
     break;
   }
   return returnedObject;
  },
  isDialogValid: function() {
   if(typeof (dxreDialog_TxbEmailTo) != "undefined" && dxreDialog_TxbEmailTo.IsVisible())
    return ASPxClientEdit.ValidateGroup("_dxeTxbEmailToGroup");
   if(typeof (dxreDialog_TxbURL) != "undefined" && dxreDialog_TxbURL.IsVisible())
    return ASPxClientEdit.ValidateGroup("_dxeTxbURLGroup");
   return true;
  },
  updateFieldsVisibility: function() {
   var val = dxreDialog_RblLinkTo.GetValue();
   dxreDialog_FormLayout.GetItemByName("TxbURL").SetVisible(val == REHyperlinkDialogEnum.WebPage);
   dxreDialog_FormLayout.GetItemByName("CbBookmarkNames").SetVisible(val == REHyperlinkDialogEnum.Bookmarks);
   dxreDialog_FormLayout.GetItemByName("TxbEmailTo").SetVisible(val == REHyperlinkDialogEnum.Mail);
   dxreDialog_FormLayout.GetItemByName("TxbSubject").SetVisible(val == REHyperlinkDialogEnum.Mail);
  }
 });
 var RETabsDialog = ASPx.CreateClass(ASPxRichEditDialog, {
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.Tabs;
  },
  onOkButtonClick: function() {
   if(this.isDialogValid()) {
    this.SetTab();
    this.OnComplete(1);
   }
  },
  InitializeDialogFields: function(parameters) {
   this.tabProperties = parameters.tabProperties;
   this.tabsInfo = this.tabProperties.tabsInfo;
   this.deletedTabs = [];
   this.isClearAllHappend = false;
   dxreDialog_SpnDefaultTabStops.SetValue(parameters.defaultTabStop);
   this.UpdateForm();
  },
  attachEvents: function() {
   ASPxRichEditDialog.prototype.attachEvents.call(this);
   dxreDialog_LbTabStopPosition.SelectedIndexChanged.AddHandler(function(s, e) {
    this.OnSelectedTabIndexChanged(s.GetSelectedIndex());
   }.aspxBind(this));
   dxreDialog_TxbTabStopPosition.KeyUp.AddHandler(function(s, e) {
    this.SetButtonsEnabled();
   }.aspxBind(this));
   dxreDialog_BtnTabSet.Click.AddHandler(function(s, e) {
    if(this.isDialogValid())
     this.SetTab();
   }.aspxBind(this));
   dxreDialog_BtnTabClear.Click.AddHandler(function(s, e) {
    this.ClearTab();
   }.aspxBind(this));
   dxreDialog_BtnTabClearAll.Click.AddHandler(function(s, e) {
    this.ClearAllTab();
   }.aspxBind(this));
   dxreDialog_RblTabsAlignment.ValueChanged.AddHandler(function(s, e) {
    this.SetAlignmentValue(s.GetValue());
   }.aspxBind(this));
   dxreDialog_RblTabsLeader.ValueChanged.AddHandler(function(s, e) {
    this.SetLeaderValue(s.GetValue());
   }.aspxBind(this));
  },
  UpdateForm: function() {
   dxreDialog_LbTabStopPosition.ClearItems();
   this.forEachTabsInfo(function(tabInfo) {
    var position = this.GetRoundedPositionByTwips(tabInfo.position);
    dxreDialog_LbTabStopPosition.AddItem(position + this.richedit.unitAbbreviations.unit, position);
   }.aspxBind(this));
   this.SetSelectedTabIndex(0);
   this.UpdateClearedTabsLabel();
  },
  GetFocusedElement: function() {
   return dxreDialog_TxbTabStopPosition;
  },
  forEachTabsInfo: function(action) {
   var tabsInfoCount = this.tabsInfo.length;
   for(var i = 0; i < tabsInfoCount; i++)
    action(this.tabsInfo[i]);
  },
  SetSelectedTabIndex: function(index) {
   dxreDialog_LbTabStopPosition.SetSelectedIndex(index);
   this.OnSelectedTabIndexChanged(index);
  },
  OnSelectedTabIndexChanged: function(index) {
   var tabInfo = this.tabsInfo[index];
   if(tabInfo) {
    this.SetTabPositionValue(tabInfo.position);
    dxreDialog_RblTabsAlignment.SetValue(tabInfo.alignment);
    dxreDialog_RblTabsLeader.SetValue(tabInfo.leader);
   }
   else {
    dxreDialog_TxbTabStopPosition.SetValue("");
    dxreDialog_RblTabsAlignment.SetValue(__aspxRichEdit.TabAlign.Left);
    dxreDialog_RblTabsLeader.SetValue(__aspxRichEdit.TabLeaderType.None);
   }
   this.SetButtonsEnabled();
  },
  SetTabPositionValue: function(value) {
   dxreDialog_TxbTabStopPosition.SetValue(this.GetRoundedPositionByTwips(value));
  },
  SetButtonsEnabled: function() {
   var text = this.GetTabPositionText() + "";
   var value = text.length > 0;
   dxreDialog_BtnTabSet.SetEnabled(value);
   dxreDialog_BtnTabClear.SetEnabled(value);
  },
  GetCurrentTabsInfoIndex: function() {
   var tabPositionText = this.GetTabPositionText();
   if(tabPositionText.length != 0) {
    var currentPosition = this.GetRoundedPosition(tabPositionText);
    for(var i = 0; i < this.tabsInfo.length; i++)
     if(this.GetRoundedPositionByTwips(this.tabsInfo[i].position) == currentPosition)
      return i;
   }
   return -1;
  },
  SetTab: function() {
   var currentTabsInfoIndex = this.GetCurrentTabsInfoIndex();
   if(currentTabsInfoIndex > -1)
    return;
   var tabPositionText = this.GetTabPositionText();
   if(tabPositionText.length == 0)
    return;
   var currentPosition = this.richedit.core.uiUnitConverter.UIToTwips(tabPositionText);
   var currentTabStopAlign = dxreDialog_RblTabsAlignment.GetValue();
   var currentTabStopLeader = dxreDialog_RblTabsLeader.GetValue();
   var tabInfo = new __aspxRichEdit.TabInfo(currentPosition, currentTabStopAlign, currentTabStopLeader, false, false);
   this.tabsInfo.push(tabInfo);
   this.SortTabsInfo();
   this.UpdateForm();
  },
  SetAlignmentValue: function(value) {
   var currentTabsInfoIndex = this.GetCurrentTabsInfoIndex();
   if(currentTabsInfoIndex > -1)
    this.tabsInfo[currentTabsInfoIndex].alignment = value;
  },
  SetLeaderValue: function(value) {
   var currentTabsInfoIndex = this.GetCurrentTabsInfoIndex();
   if(currentTabsInfoIndex > -1)
    this.tabsInfo[currentTabsInfoIndex].leader = value;
  },
  SortTabsInfo: function() {
   this.tabsInfo.sort(function(i1, i2) {
    if(i1.position > i2.position)
     return 1;
    else if(i1.position < i2.position)
     return -1;
    return 0;
   });
  },
  ClearTab: function() {
   var currentTabsInfoIndex = this.GetCurrentTabsInfoIndex();
   if(currentTabsInfoIndex < 0)
    return;
   var currentTabStopPosition = this.GetRoundedPositionByTwips(this.tabsInfo[currentTabsInfoIndex].position);
   ASPx.Data.ArrayRemove(this.deletedTabs, currentTabStopPosition);
   this.deletedTabs.push(currentTabStopPosition);
   ASPx.Data.ArrayIntegerAscendingSort(this.deletedTabs);
   ASPx.Data.ArrayRemoveAt(this.tabsInfo, currentTabsInfoIndex);
   this.UpdateForm();
  },
  UpdateClearedTabsLabel: function() {
   var text = "";
   if(!this.isClearAllHappend)
    for(var i = 0; i < this.deletedTabs.length; i++) {
     if(text.length)
      text += "; ";
     text += this.deletedTabs[i] + this.richedit.unitAbbreviations.unit;
    }
   else
    text = ASPxRichEditDialogList.OtherLabels.All;
   dxreDialog_LblToBeClearedList.SetText(text);
  },
  ClearAllTab: function() {
   ASPx.Data.ArrayClear(this.tabsInfo);
   this.isClearAllHappend = true;
   this.UpdateForm();
  },
  GetTabPositionText: function() {
   return dxreDialog_TxbTabStopPosition.GetText();
  },
  GetRoundedPosition: function(position) {
   return Math.round(position * 100) / 100;
  },
  GetRoundedPositionByTwips: function(position) {
   return this.GetRoundedPosition(this.richedit.core.uiUnitConverter.twipsToUI(position));
  },
  GetResultParameters: function() {
   var returnedObject = this.GetInitInfoObject();
   returnedObject.tabProperties = this.tabProperties;
   returnedObject.defaultTabStop = dxreDialog_SpnDefaultTabStops.GetValue();
   return returnedObject;
  },
  isDialogValid: function() {
   return dxreDialog_TxbTabStopPosition.GetIsValid();
  }
 });
 var RESymbolsDialog = ASPx.CreateClass(ASPxRichEditDialog, {
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.Symbols;
  },
  InitializeDialogFields: function(parameters) {
   dxreDialog_CbxFontName.SetText(parameters.fontName);
   this.CreateListBox();
   this.UpdateSymbolList(parameters.fontName);
  },
  attachEvents: function() {
   ASPxRichEditDialog.prototype.attachEvents.call(this);
   dxreDialog_CbxFontName.ValueChanged.AddHandler(function(s, e) {
    this.OnFontNameChanged(s.GetValue());
   }.aspxBind(this));
  },
  CreateListBox: function() {
   this.listBox = new DialogListBox(this, "symbol", this.GetSymbolListElement());
  },
  UpdateSymbolList: function(fontName) {
   this.SendCallbackForContent(fontName);
  },
  SendCallbackForContent: function(fontName) {
   this.ShowLoadingPanelOverDialogPopup();
   this.SetEnabledForComboBox(false);
   this.SetEnabledForSelectButton(false);
   this.GetCallbackHelper().SendCallback(constants.SymbolListCallbackPrefix, fontName);
  },
  SetEnabledForComboBox: function(value) {
   dxreDialog_CbxFontName.SetEnabled(value);
  },
  SetEnabledForSelectButton: function(value) {
   dxreDialog_BtnOk.SetEnabled(value);
  },
  CreateItems: function(symbolList) {
   this.listBox.ClearItems();
   this.listBox.SetStyles({ "font-family": this.GetCurrentFontName() });
   for(var i = 0; i < symbolList.length; i++)
    this.listBox.AddItem(symbolList[i]);
  },
  OnFontNameChanged: function(fontName) {
   this.UpdateSymbolList(fontName);
  },
  OnCallbackForContent: function(result) {
   var symbolList = eval(result);
   this.CreateItems(symbolList);
  },
  OnEndCallbackForContent: function() {
   this.SetEnabledForComboBox(true);
  },
  OnValueChanged: function(value) {
   this.SetEnabledForSelectButton(true);
  },
  GetCallbackHelper: function() {
   if(!this.callbackHelper)
    this.callbackHelper = new CallbackHelper(this);
   return this.callbackHelper;
  },
  GetSymbolListElement: function() {
   var item = dxreDialog_FormLayout.GetItemByName("SymbolList");
   return dxreDialog_FormLayout.GetHTMLElementByItem(item).lastElementChild.lastElementChild;
  },
  GetCurrentSymbol: function() {
   return this.listBox.GetValue();
  },
  GetCurrentFontName: function() {
   return dxreDialog_CbxFontName.GetValue();
  },
  GetResultParameters: function() {
   var returnedObject = this.GetInitInfoObject();
   returnedObject.fontName = this.GetCurrentFontName();
   returnedObject.symbol = this.GetCurrentSymbol();
   return returnedObject;
  },
  GetFocusedElement: function() {
   return dxreDialog_CbxFontName;
  }
 });
 var REInsertMergeFieldDialog = ASPx.CreateClass(ASPxRichEditDialog, {
  OnInitComplete: function() {
   ASPxRichEditDialog.prototype.OnInitComplete.call(this);
   dxreDialog_LsbFields.AdjustControl();
   this.richedit.Focus();
  },  
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.InsertMergeField;
  },
  InitializeDialogFields: function() {
   this.fieldsList = [];
   this.lastSearchText = "";
   var fieldsCount = dxreDialog_LsbFields.GetItemCount();
   for(var i = 0; i < fieldsCount; i++) {
    var item = dxreDialog_LsbFields.GetItem(i);
    this.fieldsList.push({ text: item.text, value: item.value });
   }
  },
  GetResultParameters: function() {
   var returnedObject = this.GetInitInfoObject();
   returnedObject.fieldName = dxreDialog_LsbFields.GetValue();
   return returnedObject;
  },
  attachEvents: function() {
   ASPxRichEditDialog.prototype.attachEvents.call(this);
   dxreDialog_BtnInsert.Click.AddHandler(function() {
    this.DoCustomAction(true);
   }.aspxBind(this));
   dxreDialog_LsbFields.ItemDoubleClick.AddHandler(function() {
    this.DoCustomAction(true);
   }.aspxBind(this));
   dxreDialog_LsbFields.SelectedIndexChanged.AddHandler(function() {
    this.UpdateInsertButtonEnabled();
   }.aspxBind(this));
   dxreDialog_TxbSearch.KeyUp.AddHandler(function(s, e) {
    this.onTxbSearchKeyUp(s, e);
   }.aspxBind(this));
   dxreDialog_TxbSearch.LostFocus.AddHandler(function() {
    this.toFilterOut();
   }.aspxBind(this));
  },
  onTxbSearchKeyUp: function(s, e) {
   if(ASPx.Evt.GetKeyCode(e.htmlEvent) === ASPx.KeyCode.Esc)
    this.DoCustomAction(false);
   else
    this.toFilterOut();
  },
  toFilterOut: function() {
   clearTimeout(this.timerId);
   this.timerId = setTimeout(function() {
    this.toFilterOutCore();
   }.aspxBind(this), 300);
  },
  toFilterOutCore: function() {
   var text = dxreDialog_TxbSearch.GetText().toUpperCase();
   if(text != this.lastSearchText) {
    this.lastSearchText = text;
    dxreDialog_LsbFields.ClearItems();
    for(var i = 0, item; item = this.fieldsList[i]; i++)
     if(text.length == 0 || item.text.toUpperCase().indexOf(text) > -1)
      dxreDialog_LsbFields.AddItem(item.text, item.value);
    this.UpdateInsertButtonEnabled();
   }
  },
  UpdateInsertButtonEnabled: function() {
   dxreDialog_BtnInsert.SetEnabled(dxreDialog_LsbFields.GetSelectedIndex() >= 0);
  },
  GetFocusedElement: function() {
   return dxreDialog_TxbSearch;
  }
 });
 var REFinishAndMergeDialog = ASPx.CreateClass(ASPxRichEditDialog, {
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.ExportRange;
  },
  InitializeDialogFields: function(parameters) {
   dxreDialog_RdBttnListSwitcher.SetValue(parameters.range);
   dxreDialog_SpnFrom.SetValue(parameters.exportFrom);
   dxreDialog_SpnCount.SetValue(parameters.exportRecordsCount);
   dxreDialog_CmbMergeMode.SetValue(parameters.mergeMode);
   this.toggleElements();
  },
  attachEvents: function() {
   ASPxRichEditDialog.prototype.attachEvents.call(this);
   dxreDialog_RdBttnListSwitcher.ValueChanged.AddHandler(this.toggleElements.aspxBind(this));
  },
  onOkButtonClick: function() {
   this.ShowSaveDialog();
  },
  ShowSaveDialog: function() {
   var clientCommand = __aspxRichEdit.RichEditClientCommand.ShowSaveMergedDocumentForm;
   var parameters = this.GetResultParameters();
   this.OnComplete(0);
   this.richedit.core.commandManager.getCommand(clientCommand).execute(this.richedit.core.commandManager.isPublicApiCall, parameters);
  },
  toggleElements: function() {
   var exportRange = this.GetExportRangeValue();
   dxreDialog_SpnFrom.SetEnabled(exportRange === __aspxRichEdit.MailMergeExportRange.Range);
   dxreDialog_SpnCount.SetEnabled(exportRange === __aspxRichEdit.MailMergeExportRange.Range);
   dxreDialog_CmbMergeMode.SetEnabled(exportRange !== __aspxRichEdit.MailMergeExportRange.CurrentRecord);
  },
  GetResultParameters: function() {
   var returnedObject = this.GetInitInfoObject();
   returnedObject.range = this.GetExportRangeValue();
   returnedObject.exportFrom = dxreDialog_SpnFrom.GetValue();
   returnedObject.exportRecordsCount = dxreDialog_SpnCount.GetValue();
   returnedObject.mergeMode = dxreDialog_CmbMergeMode.GetValue();
   return returnedObject;
  },
  GetExportRangeValue: function() {
   return dxreDialog_RdBttnListSwitcher.GetValue();
  },
  setDialogSize: function(popupControl) {
   popupControl.SetMinWidth(215);
  }
 });
 var REBookmarksDialog = ASPx.CreateClass(ASPxRichEditDialog, {
  newBookmarkName: "",
  sortByName: false,
  bookmarks: [],
  allowedAddNewBookmarks: true,
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.Bookmark;
  },
  InitializeDialogFields: function(parameters) {
   this.clear();
   for(var i = 0, bookmark; bookmark = parameters.bookmarks[i]; i++) {
    bookmark.deleted = false;
    this.bookmarks.push(bookmark);
   }
   this.allowedAddNewBookmarks = parameters.allowedAddNewBookmarks;
   this.updateDataSource();
  },
  clear: function() {
   this.bookmarks = [];
   this.newBookmarkName = "";
  },
  GetFocusedElement: function() {
   if(dxreDialog_LsbBookmarkNames.GetItemCount() > 0)
    return dxreDialog_LsbBookmarkNames;
   return dxreDialog_TxbBookmarksName;
  },
  getDataSource: function() {
   var array = [];
   if(this.sortByName) {
    this.bookmarks = this.bookmarks.sort(function(b1, b2) {
     if(b1.name > b2.name)
      return 1;
     else if(b1.name < b2.name)
      return -1;
     return 0;
    });
   }
   else {
    this.bookmarks = this.bookmarks.sort(function(b1, b2) {
     if(b1.start > b2.start)
      return 1;
     else if(b1.start < b2.start)
      return -1;
     return 0;
    });
   }
   for(var i = 0, bookmark; bookmark = this.bookmarks[i]; i++)
    if(!bookmark.deleted)
     array.push(bookmark.name);
   return array;
  },
  updateDataSource: function() {
   dxreDialog_LsbBookmarkNames.ClearItems();
   var dataSource = this.getDataSource();
   for(var i = 0, name; name = dataSource[i]; i++)
    dxreDialog_LsbBookmarkNames.AddItem(name);
   var lastIndex = dxreDialog_LsbBookmarkNames.GetItemCount() - 1;
   if(lastIndex > -1) {
    dxreDialog_LsbBookmarkNames.SetSelectedIndex(lastIndex);
    dxreDialog_TxbBookmarksName.SetValue(dxreDialog_LsbBookmarkNames.GetValue());
   }
   var isValidName = this.getIsValidBookmarkName(dxreDialog_TxbBookmarksName.GetText());
   this.updateEnableState(isValidName);
  },
  updateEnableState: function(enable) {
   dxreDialog_BtnAdd.SetEnabled(enable && this.allowedAddNewBookmarks);
   var listEnable = false;
   var bookmarkName = dxreDialog_TxbBookmarksName.GetText();
   for(var i = 0, listItem; listItem = dxreDialog_LsbBookmarkNames.GetItem(i); i++)
    if(bookmarkName == listItem.value) {
     listEnable = true;
     break;
    }
   dxreDialog_BtnDelete.SetEnabled(listEnable);
   dxreDialog_BtnGoTo.SetEnabled(listEnable);
  },
  getIsValidBookmarkName: function(name) {
   return __aspxRichEdit.Bookmark.isValidName(name, false);
  },
  onBookmarkNameTextBoxValidation: function(s, e) {
   var isValid = this.getIsValidBookmarkName(e.value);
   e.isValid = isValid;
   this.updateEnableState(isValid);
  },
  attachEvents: function() {
   ASPxRichEditDialog.prototype.attachEvents.call(this);
   dxreDialog_TxbBookmarksName.Validation.AddHandler(function(s, e) { this.onBookmarkNameTextBoxValidation(s, e); }.aspxBind(this));
   dxreDialog_TxbBookmarksName.KeyUp.AddHandler(function(s, e) { s.Validate(); }.aspxBind(this));
   dxreDialog_TxbBookmarksName.KeyDown.AddHandler(function(s, e) {
    if(ASPx.Evt.GetKeyCode(e.htmlEvent) === ASPx.KeyCode.Enter)
     this.onBtnAddClick();
   }.aspxBind(this));
   dxreDialog_BtnAdd.Click.AddHandler(function() { this.onBtnAddClick(); }.aspxBind(this));
   dxreDialog_BtnDelete.Click.AddHandler(function() { this.onBtnDeleteClick(); }.aspxBind(this));
   dxreDialog_BtnCancel.Click.AddHandler(function() { this.OnComplete(1); }.aspxBind(this));
   dxreDialog_RblSortBy.ValueChanged.AddHandler(function(s, e) { this.onRblSortByValueChanged(s, e); }.aspxBind(this));
   dxreDialog_BtnGoTo.Click.AddHandler(function() { this.onBtnGoToClick(); }.aspxBind(this));
  },
  onBtnGoToClick: function() {
   var name = dxreDialog_LsbBookmarkNames.GetValue();
   this.richedit.core.commandManager.getCommand(__aspxRichEdit.RichEditClientCommand.GoToBookmark).execute(this.richedit.core.commandManager.isPublicApiCall, name);
  },
  onRblSortByValueChanged: function(s, e) {
   this.sortByName = !!!s.GetValue();
   this.updateDataSource();
  },
  onBtnAddClick: function() {
   this.newBookmarkName = dxreDialog_TxbBookmarksName.GetValue();
   this.OnComplete(1);
  },
  onBtnDeleteClick: function() {
   var name = dxreDialog_LsbBookmarkNames.GetValue();
   for(var i = 0, bookmark; bookmark = this.bookmarks[i]; i++)
    if(bookmark.name == name)
     bookmark.deleted = true;
   this.updateDataSource();
  },
  GetResultParameters: function () {
   var returnedObject = this.GetInitInfoObject();
   var deletedBookmarkNames = [];
   for(var i = 0, bookmark; bookmark = this.bookmarks[i]; i++)
    if(bookmark.deleted)
     deletedBookmarkNames.push(bookmark.name);
   returnedObject.newBookmarkName = this.newBookmarkName;
   returnedObject.deletedBookmarkNames = deletedBookmarkNames;
   return returnedObject;
  }
 });
 var RESpellingDialog = ASPx.CreateClass(ASPxRichEditDialog, {
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.Spelling;
  },
  InitializeDialogFields: function(parameters) {
   this.controller = parameters.controller;
   this.GoToNextError();
  },
  attachEvents: function() {
   ASPxRichEditDialog.prototype.attachEvents.call(this);
   dxreDialog_BtnIgnoreOnce.Click.AddHandler(function() { this.IgnoreOnce(); }.aspxBind(this));
   dxreDialog_BtnIgnoreAll.Click.AddHandler(function() { this.IgnoreAll(); }.aspxBind(this));
   dxreDialog_BtnAddToDictionary.Click.AddHandler(function() { this.AddToDictionary(); }.aspxBind(this));
   dxreDialog_BtnDelete.Click.AddHandler(function() { this.Delete(); }.aspxBind(this));
   dxreDialog_BtnChange.Click.AddHandler(function() { this.Change(); }.aspxBind(this));
   dxreDialog_BtnChangeAll.Click.AddHandler(function() { this.ChangeAll(); }.aspxBind(this));
   dxreDialog_SuggestionsListBox.ItemDoubleClick.AddHandler(function() { this.Change(); }.aspxBind(this));
  },
  GoToNextError: function() {
   if(this.controller.tryFindNextError())
    this.UpdateDialogFields();
  },
  UpdateDialogFields: function() {
   this.UpdateLabels();
   this.UpdateMisspelledMemo();
   this.UpdateSuggestionsList();
   this.UpdateButtons();
  },
  UpdateLabels: function() {
   var isRepeatingError = this.controller.isRepeatingError;
   dxreDialog_LblNotInDictionary.SetVisible(!isRepeatingError);
   dxreDialog_LblRepeatedWord.SetVisible(isRepeatingError);
  },
  UpdateMisspelledMemo: function() {
   dxreDialog_MisspelledMemo.SetHeight(100); 
   dxreDialog_MisspelledMemo.SetText(this.controller.getContext());
  },
  UpdateSuggestionsList: function() {
   dxreDialog_SuggestionsListBox.ClearItems();
   var suggestions = this.controller.suggestions;
   if(suggestions != null) {
    if(suggestions.length > 0) {
     for(var i = 0, suggettion; suggettion = suggestions[i]; i++)
      dxreDialog_SuggestionsListBox.AddItem(suggettion);
     dxreDialog_SuggestionsListBox.SetEnabled(true);
     dxreDialog_SuggestionsListBox.SetSelectedIndex(0);
    } else {
     dxreDialog_SuggestionsListBox.AddItem(ASPxRichEditDialogList.OtherLabels.NoSpellingSuggestions);
     dxreDialog_SuggestionsListBox.SetEnabled(false);
    }
   }
  },
  UpdateButtons: function() {
   var isRepeatingError = this.controller.isRepeatingError;
   dxreDialog_BtnIgnoreAll.SetEnabled(!isRepeatingError);
   dxreDialog_BtnDelete.SetVisible(isRepeatingError);
   dxreDialog_BtnChange.SetVisible(!isRepeatingError);
   dxreDialog_BtnChangeAll.SetVisible(!isRepeatingError);
   dxreDialog_BtnAddToDictionary.SetEnabled(!isRepeatingError && this.controller.canAddToDictionary);
   var changeButtonsEnabled = dxreDialog_SuggestionsListBox.GetSelectedIndex() >= 0;
   dxreDialog_BtnChange.SetEnabled(changeButtonsEnabled);
   dxreDialog_BtnChangeAll.SetEnabled(changeButtonsEnabled);
  },
  IgnoreOnce: function() {
   this.controller.ignoreOnce();
   this.GoToNextError();
  },
  IgnoreAll: function() {
   this.controller.ignoreAll();
   this.GoToNextError();
  },
  AddToDictionary: function() {
   this.controller.addToDictionary();
   this.GoToNextError();
  },
  Delete: function() {
   this.controller.delete();
   this.GoToNextError();
  },
  Change: function() {
   this.controller.change(dxreDialog_SuggestionsListBox.GetValue());
   this.GoToNextError();
  },
  ChangeAll: function() {
   this.controller.changeAll(dxreDialog_SuggestionsListBox.GetValue());
   this.GoToNextError();
  },
  GetFocusedElement: function() {
   return dxreDialog_BtnIgnoreOnce;
  },
  GetResultParameters: function() {
   var returnedObject = this.GetInitInfoObject();
   return returnedObject;
  }
 });
 var RELayoutOptionsDialog = ASPx.CreateClass(ASPxRichEditDialog, {
  GetDialogCaptionText: function() {
   return ASPxRichEditDialogList.Titles.Layout;
  },
  InitializeDialogFields: function(parameters) {
   if(parameters.wrapType !== null)
    dxreDialog_LayoutPageControl.GetTab(0).SetEnabled(true);
   dxreDialog_SpnAbsoluteHeight.SetValue(parameters.absoluteHeight);
   dxreDialog_SpnAbsoluteWidth.SetValue(parameters.absoluteWidth);
   dxreDialog_SpnRotation.SetValue(parameters.rotation);
   dxreDialog_ChkScale.SetValue(parameters.lockAspectRatio);
   if(parameters.useAbsoluteWidth !== undefined) {
    this.setEnabledForAbsoluteHeight(parameters.useAbsoluteHeight);
    this.setEnabledForAbsoluteWidth(parameters.useAbsoluteWidth);
    dxreDialog_RbtAbsoluteHeight.SetValue(parameters.useAbsoluteHeight);
    dxreDialog_RbtAbsoluteWidth.SetValue(parameters.useAbsoluteWidth);
    dxreDialog_RbtRelativeHeight.SetValue(!parameters.useAbsoluteHeight);
    dxreDialog_RbtRelativeWidth.SetValue(!parameters.useAbsoluteWidth);
    dxreDialog_SpnRelativeHeight.SetValue(this.relativePercentToUI(parameters.relativeHeight));
    dxreDialog_SpnRelativeWidth.SetValue(this.relativePercentToUI(parameters.relativeWidth));
    dxreDialog_CbxHeightRelativTo.SetValue(parameters.relativeHeightType);
    dxreDialog_CbxWidthRelativTo.SetValue(parameters.relativeWidthType);
    dxreDialog_RbtRelativeHeight.SetEnabled(true);
    dxreDialog_RbtRelativeWidth.SetEnabled(true);
   }
   else {
    this.setEnabledForAbsoluteHeight(true);
    this.setEnabledForAbsoluteWidth(true);
    dxreDialog_RbtAbsoluteHeight.SetValue(true);
    dxreDialog_RbtAbsoluteWidth.SetValue(true);
    dxreDialog_LblOriginalWidth.SetValue(Math.round(parameters.originalWidth * 100) / 100);
    dxreDialog_LblOriginalHeight.SetValue(Math.round(parameters.originalHeight * 100) / 100);
    dxreDialog_BtnReset.SetEnabled(true);
   }
   dxreDialog_CbxHorizontalAlignment.SetValue(parameters.horizontalAligmentType === __aspxRichEdit.LayoutDialogAlignmentType.Alignment ?
    parameters.horizontalPositionAlignment : __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Left);
   dxreDialog_CbxHorizontalBookLayout.SetValue(parameters.horizontalAligmentType === __aspxRichEdit.LayoutDialogAlignmentType.BookLayout ?
    parameters.horizontalPositionAlignment : __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.Inside);
   dxreDialog_CbxHorizontalBookLayoutOf.SetValue(parameters.horizontalAligmentType === __aspxRichEdit.LayoutDialogAlignmentType.BookLayout ?
    parameters.horizontalPositionType : __aspxRichEdit.AnchorObjectHorizontalPositionType.Margin);
   dxreDialog_CbxHorizontalAlignmentRelativeTo.SetValue(parameters.horizontalPositionType);
   dxreDialog_CbxHorizontalAbsToTheRightOf.SetValue(parameters.horizontalPositionType);
   dxreDialog_SpnHorizontalAbsPosition.SetValue(parameters.offsetX ? parameters.offsetX : 0);
   dxreDialog_CbxHorizontalRelPosRelativeTo.SetValue(dxreDialog_CbxHorizontalRelPosRelativeTo.FindItemByValue(parameters.horizontalPositionType) !== null ?
    parameters.horizontalPositionType : __aspxRichEdit.AnchorObjectHorizontalPositionType.Page);
   dxreDialog_SpnHorizontalRelativePosition.SetValue(parameters.percentOffsetX ? this.relativePercentToUI(parameters.percentOffsetX) : 0);
   this.setEnabledForHorizontalAlignment(parameters.horizontalAligmentType);
   dxreDialog_CbxVerticalAlignment.SetValue(parameters.verticalAligmentType === __aspxRichEdit.LayoutDialogAlignmentType.Alignment ?
    parameters.verticalPositionAlignment : __aspxRichEdit.AnchorObjectVerticalPositionAlignment.Top);
   dxreDialog_CbxVerticalRelativTo.SetValue(dxreDialog_CbxVerticalRelativTo.FindItemByValue(parameters.verticalPositionType) !== null ?
    parameters.verticalPositionType : __aspxRichEdit.AnchorObjectVerticalPositionType.Page);
   dxreDialog_CbxVerticalBelow.SetValue(parameters.verticalPositionType);
   dxreDialog_SpnVerticalAbsPosition.SetValue(parameters.offsetY ? parameters.offsetY : 0);
   dxreDialog_CbxVerticalRelPosRelativeTo.SetValue(dxreDialog_CbxVerticalRelPosRelativeTo.FindItemByValue(parameters.verticalPositionType) !== null ?
    parameters.verticalPositionType : __aspxRichEdit.AnchorObjectVerticalPositionType.Page);
   dxreDialog_SpnVerticalRelativePosition.SetValue(parameters.percentOffsetY ? this.relativePercentToUI(parameters.percentOffsetY) : 0);
   this.setEnabledForVerticalAlignment(parameters.verticalAligmentType);
   dxreDialog_ChkLockAnchor.SetValue(parameters.locked);
   switch(parameters.horizontalAligmentType) {
    case __aspxRichEdit.LayoutDialogAlignmentType.Alignment:
     dxreDialog_RbtHorizontalAlignment.SetValue(true);
     break;
    case __aspxRichEdit.LayoutDialogAlignmentType.BookLayout:
     dxreDialog_RbtBookLayout.SetValue(true);
     break;
    case __aspxRichEdit.LayoutDialogAlignmentType.Absolute:
     dxreDialog_RbtHorizontalAbsPosition.SetValue(true);
     break;
    case __aspxRichEdit.LayoutDialogAlignmentType.Relative:
     dxreDialog_RbtHorizontalRelativePosition.SetValue(true);
     break;
   }
   switch(parameters.verticalAligmentType) {
    case __aspxRichEdit.LayoutDialogAlignmentType.Alignment:
     dxreDialog_RbtVerticalAlignment.SetValue(true);
     break;
    case __aspxRichEdit.LayoutDialogAlignmentType.Absolute:
     dxreDialog_RbtVerticalAbsPosition.SetValue(true);
     break;
    case __aspxRichEdit.LayoutDialogAlignmentType.Relative:
     dxreDialog_RbtVerticalRelativePosition.SetValue(true);
     break;
   }
   switch(parameters.wrapType) {
    case __aspxRichEdit.AnchorObjectTextWrapType.Square:
     dxreDialog_BtnPresetTextWrapSquare.SetChecked(true);
     break;
    case __aspxRichEdit.AnchorObjectTextWrapType.Tight:
     dxreDialog_BtnPresetTextWrapTight.SetChecked(true);
     break;
    case __aspxRichEdit.AnchorObjectTextWrapType.Through:
     dxreDialog_BtnPresetTextWrapThrough.SetChecked(true);
     break;
    case __aspxRichEdit.AnchorObjectTextWrapType.TopAndBottom:
     dxreDialog_BtnPresetTextWrapTopAndBottom.SetChecked(true);
     break;
    case __aspxRichEdit.AnchorObjectTextWrapType.None:
     if(parameters.isBehindDoc)
      dxreDialog_BtnPresetTextWrapBehind.SetChecked(true);
     else
      dxreDialog_BtnPresetTextWrapInFrontOfText.SetChecked(true);
     break;
    case null:
     dxreDialog_BtnPresetTextWrapInline.SetChecked(true);
     break;
   }
   this.setWrapType(parameters.wrapType, parameters.isBehindDoc);
   dxreDialog_RblWrapText.SetValue(parameters.wrapSide !== null ? parameters.wrapSide : 0);
   dxreDialog_SpnTop.SetValue(parameters.topDistance ? parameters.topDistance : 0);
   dxreDialog_SpnBottom.SetValue(parameters.bottomDistance ? parameters.bottomDistance : 0);
   dxreDialog_SpnRight.SetValue(parameters.rightDistance ? parameters.rightDistance : 0);
   dxreDialog_SpnLeft.SetValue(parameters.leftDistance ? parameters.leftDistance : 0);
   if(parameters.textBoxProperties) {
    dxreDialog_LayoutPageControl.GetTab(3).SetVisible(true);
    dxreDialog_SpnTopMargin.SetValue(parameters.textBoxProperties.topMargin);
    dxreDialog_SpnBottomMargin.SetValue(parameters.textBoxProperties.bottomMargin);
    dxreDialog_SpnRightMargin.SetValue(parameters.textBoxProperties.rightMargin);
    dxreDialog_SpnLeftMargin.SetValue(parameters.textBoxProperties.leftMargin);
   }
   else
    dxreDialog_LayoutPageControl.GetTab(3).SetVisible(false);
  },
  attachEvents: function() {
   ASPxRichEditDialog.prototype.attachEvents.call(this);
   dxreDialog_RbtHorizontalAbsPosition.CheckedChanged.AddHandler(function(s) {
    this.setEnabledForHorizontalAlignment(__aspxRichEdit.LayoutDialogAlignmentType.Absolute);
   }.aspxBind(this));
   dxreDialog_RbtHorizontalAlignment.CheckedChanged.AddHandler(function(s) {
    this.setEnabledForHorizontalAlignment(__aspxRichEdit.LayoutDialogAlignmentType.Alignment);
   }.aspxBind(this));
   dxreDialog_RbtBookLayout.CheckedChanged.AddHandler(function(s) {
    this.setEnabledForHorizontalAlignment(__aspxRichEdit.LayoutDialogAlignmentType.BookLayout);
   }.aspxBind(this));
   dxreDialog_RbtHorizontalRelativePosition.CheckedChanged.AddHandler(function(s) {
    this.setEnabledForHorizontalAlignment(__aspxRichEdit.LayoutDialogAlignmentType.Relative);
   }.aspxBind(this));
   dxreDialog_RbtVerticalAbsPosition.CheckedChanged.AddHandler(function(s) {
    this.setEnabledForVerticalAlignment(__aspxRichEdit.LayoutDialogAlignmentType.Absolute);
   }.aspxBind(this));
   dxreDialog_RbtVerticalAlignment.CheckedChanged.AddHandler(function(s) {
    this.setEnabledForVerticalAlignment(__aspxRichEdit.LayoutDialogAlignmentType.Alignment);
   }.aspxBind(this));
   dxreDialog_RbtVerticalRelativePosition.CheckedChanged.AddHandler(function(s) {
    this.setEnabledForVerticalAlignment(__aspxRichEdit.LayoutDialogAlignmentType.Relative);
   }.aspxBind(this));
   dxreDialog_RbtRelativeHeight.CheckedChanged.AddHandler(function(s) {
    this.setEnabledForAbsoluteHeight(!s.GetValue());
   }.aspxBind(this));
   dxreDialog_RbtAbsoluteHeight.CheckedChanged.AddHandler(function(s) {
    this.setEnabledForAbsoluteHeight(s.GetValue());
   }.aspxBind(this));
   dxreDialog_RbtRelativeWidth.CheckedChanged.AddHandler(function(s) {
    this.setEnabledForAbsoluteWidth(!s.GetValue());
   }.aspxBind(this));
   dxreDialog_RbtAbsoluteWidth.CheckedChanged.AddHandler(function(s) {
    this.setEnabledForAbsoluteWidth(s.GetValue());
   }.aspxBind(this));
   dxreDialog_BtnReset.Click.AddHandler(function() {
    dxreDialog_SpnAbsoluteHeight.SetValue(dxreDialog_LblOriginalHeight.GetValue());
    dxreDialog_SpnAbsoluteWidth.SetValue(dxreDialog_LblOriginalWidth.GetValue());
   }.aspxBind(this));
   dxreDialog_SpnAbsoluteWidth.ValueChanged.AddHandler(function() {
    if(dxreDialog_ChkScale.GetValue())
     this.lockAspectRationHeight();
   }.aspxBind(this));
   dxreDialog_SpnAbsoluteHeight.ValueChanged.AddHandler(function() {
    if(dxreDialog_ChkScale.GetValue())
     this.lockAspectRationWidth();
   }.aspxBind(this));
   dxreDialog_ChkScale.CheckedChanged.AddHandler(function(s) {
    if(s.GetValue())
     this.lockAspectRationWidth();
   }.aspxBind(this));
   dxreDialog_BtnPresetTextWrapInline.Click.AddHandler(function() { this.setWrapType(null, false); }.aspxBind(this));
   dxreDialog_BtnPresetTextWrapSquare.Click.AddHandler(function() { this.setWrapType(__aspxRichEdit.AnchorObjectTextWrapType.Square, false); }.aspxBind(this));
   dxreDialog_BtnPresetTextWrapTight.Click.AddHandler(function() { this.setWrapType(__aspxRichEdit.AnchorObjectTextWrapType.Tight, false); }.aspxBind(this));
   dxreDialog_BtnPresetTextWrapThrough.Click.AddHandler(function() { this.setWrapType(__aspxRichEdit.AnchorObjectTextWrapType.Through, false); }.aspxBind(this));
   dxreDialog_BtnPresetTextWrapTopAndBottom.Click.AddHandler(function() { this.setWrapType(__aspxRichEdit.AnchorObjectTextWrapType.TopAndBottom, false); }.aspxBind(this));
   dxreDialog_BtnPresetTextWrapBehind.Click.AddHandler(function() { this.setWrapType(__aspxRichEdit.AnchorObjectTextWrapType.None, true); }.aspxBind(this));
   dxreDialog_BtnPresetTextWrapInFrontOfText.Click.AddHandler(function() { this.setWrapType(__aspxRichEdit.AnchorObjectTextWrapType.None, false); }.aspxBind(this));
  },
  setWrapType: function(type, isBehindDoc) {
   if(type !== null) {
    dxreDialog_LayoutPageControl.GetTab(0).SetEnabled(true);
    dxreDialog_SpnRotation.SetEnabled(true);
   }
   else {
    dxreDialog_LayoutPageControl.GetTab(0).SetEnabled(false);
    dxreDialog_SpnRotation.SetEnabled(false);
   }
   switch(type) {
    case __aspxRichEdit.AnchorObjectTextWrapType.Square:
     this.setEnabledForDistance(true, true);
     dxreDialog_RblWrapText.SetEnabled(true);
     break;
    case __aspxRichEdit.AnchorObjectTextWrapType.Tight:
    case __aspxRichEdit.AnchorObjectTextWrapType.Through:
     this.setEnabledForDistance(true, true);
     dxreDialog_RblWrapText.SetEnabled(true);
     break;
    case __aspxRichEdit.AnchorObjectTextWrapType.TopAndBottom:
     this.setEnabledForDistance(true, false);
     dxreDialog_RblWrapText.SetEnabled(false);
     break;
    case __aspxRichEdit.AnchorObjectTextWrapType.None:
    case null:
     this.setEnabledForDistance(false, false);
     dxreDialog_RblWrapText.SetEnabled(false);
     break;
   }
   var returnedObject = this.GetInitInfoObject();
   returnedObject.wrapType = type;
   returnedObject.isBehindDoc = isBehindDoc;
  },
  setEnabledForDistance: function(TopAndBottomEnabled, LeftAndRightEnabled) {
   dxreDialog_SpnTop.SetEnabled(TopAndBottomEnabled);
   dxreDialog_SpnBottom.SetEnabled(TopAndBottomEnabled);
   dxreDialog_SpnRight.SetEnabled(LeftAndRightEnabled);
   dxreDialog_SpnLeft.SetEnabled(LeftAndRightEnabled);
  },
  setEnabledForHorizontalAlignment: function(type) {
   dxreDialog_CbxHorizontalAlignment.SetEnabled(type === __aspxRichEdit.LayoutDialogAlignmentType.Alignment);
   dxreDialog_CbxHorizontalAlignmentRelativeTo.SetEnabled(type === __aspxRichEdit.LayoutDialogAlignmentType.Alignment);
   dxreDialog_SpnHorizontalAbsPosition.SetEnabled(type === __aspxRichEdit.LayoutDialogAlignmentType.Absolute);
   dxreDialog_CbxHorizontalAbsToTheRightOf.SetEnabled(type === __aspxRichEdit.LayoutDialogAlignmentType.Absolute);
   dxreDialog_CbxHorizontalBookLayout.SetEnabled(type === __aspxRichEdit.LayoutDialogAlignmentType.BookLayout);
   dxreDialog_CbxHorizontalBookLayoutOf.SetEnabled(type === __aspxRichEdit.LayoutDialogAlignmentType.BookLayout);
   dxreDialog_SpnHorizontalRelativePosition.SetEnabled(type === __aspxRichEdit.LayoutDialogAlignmentType.Relative);
   dxreDialog_CbxHorizontalRelPosRelativeTo.SetEnabled(type === __aspxRichEdit.LayoutDialogAlignmentType.Relative);
   var returnedObject = this.GetInitInfoObject();
   returnedObject.horizontalAligmentType = type;
  },
  setEnabledForVerticalAlignment: function(type) {
   dxreDialog_CbxVerticalAlignment.SetEnabled(type === __aspxRichEdit.LayoutDialogAlignmentType.Alignment);
   dxreDialog_CbxVerticalRelativTo.SetEnabled(type === __aspxRichEdit.LayoutDialogAlignmentType.Alignment);
   dxreDialog_SpnVerticalAbsPosition.SetEnabled(type === __aspxRichEdit.LayoutDialogAlignmentType.Absolute);
   dxreDialog_CbxVerticalBelow.SetEnabled(type === __aspxRichEdit.LayoutDialogAlignmentType.Absolute);
   dxreDialog_SpnVerticalRelativePosition.SetEnabled(type === __aspxRichEdit.LayoutDialogAlignmentType.Relative);
   dxreDialog_CbxVerticalRelPosRelativeTo.SetEnabled(type === __aspxRichEdit.LayoutDialogAlignmentType.Relative);
   var returnedObject = this.GetInitInfoObject();
   returnedObject.verticalAligmentType = type;
  },
  setEnabledForAbsoluteHeight: function(enabled) {
   dxreDialog_SpnAbsoluteHeight.SetEnabled(enabled);
   dxreDialog_SpnRelativeHeight.SetEnabled(!enabled);
   dxreDialog_CbxHeightRelativTo.SetEnabled(!enabled);
  },
  setEnabledForAbsoluteWidth: function(enabled) {
   dxreDialog_SpnAbsoluteWidth.SetEnabled(enabled);
   dxreDialog_SpnRelativeWidth.SetEnabled(!enabled);
   dxreDialog_CbxWidthRelativTo.SetEnabled(!enabled);
  },
  GetResultParameters: function() {
   var returnedObject = this.GetInitInfoObject();
   var isAnchoredObject = returnedObject.wrapType !== null;
   if(isAnchoredObject) {
    switch(returnedObject.horizontalAligmentType) {
     case __aspxRichEdit.LayoutDialogAlignmentType.Alignment:
      returnedObject.horizontalPositionAlignment = dxreDialog_CbxHorizontalAlignment.GetValue();
      returnedObject.horizontalPositionType = dxreDialog_CbxHorizontalAlignmentRelativeTo.GetValue();
      break;
     case __aspxRichEdit.LayoutDialogAlignmentType.Absolute:
      returnedObject.horizontalPositionAlignment = __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.None;
      returnedObject.horizontalPositionType = dxreDialog_CbxHorizontalAbsToTheRightOf.GetValue();
      break;
     case __aspxRichEdit.LayoutDialogAlignmentType.BookLayout:
      returnedObject.horizontalPositionAlignment = dxreDialog_CbxHorizontalBookLayout.GetValue();
      returnedObject.horizontalPositionType = dxreDialog_CbxHorizontalBookLayoutOf.GetValue();
      break;
     case __aspxRichEdit.LayoutDialogAlignmentType.Relative:
      returnedObject.horizontalPositionAlignment = __aspxRichEdit.AnchorObjectHorizontalPositionAlignment.None;
      returnedObject.horizontalPositionType = dxreDialog_CbxHorizontalRelPosRelativeTo.GetValue();
      break;
    }
    returnedObject.offsetX = returnedObject.horizontalAligmentType !== __aspxRichEdit.LayoutDialogAlignmentType.Absolute ? 0 : dxreDialog_SpnHorizontalAbsPosition.GetValue();
    returnedObject.percentOffsetX = returnedObject.horizontalAligmentType !== __aspxRichEdit.LayoutDialogAlignmentType.Relative ? 0 : this.relativePercentFromUI(dxreDialog_SpnHorizontalRelativePosition.GetValue());
    switch(returnedObject.verticalAligmentType) {
     case __aspxRichEdit.LayoutDialogAlignmentType.Alignment:
      returnedObject.verticalPositionAlignment = dxreDialog_CbxVerticalAlignment.GetValue();
      returnedObject.verticalPositionType = dxreDialog_CbxVerticalRelativTo.GetValue();
      break;
     case __aspxRichEdit.LayoutDialogAlignmentType.Absolute:
      returnedObject.verticalPositionAlignment = __aspxRichEdit.AnchorObjectVerticalPositionAlignment.None;
      returnedObject.verticalPositionType = dxreDialog_CbxVerticalBelow.GetValue();
      break;
     case __aspxRichEdit.LayoutDialogAlignmentType.Relative:
      returnedObject.verticalPositionAlignment = __aspxRichEdit.AnchorObjectVerticalPositionAlignment.None;
      returnedObject.verticalPositionType = dxreDialog_CbxVerticalRelPosRelativeTo.GetValue();
      break;
    }
    returnedObject.offsetY = returnedObject.verticalAligmentType !== __aspxRichEdit.LayoutDialogAlignmentType.Absolute ? 0 : dxreDialog_SpnVerticalAbsPosition.GetValue();
    returnedObject.percentOffsetY = returnedObject.verticalAligmentType !== __aspxRichEdit.LayoutDialogAlignmentType.Relative ? 0 : this.relativePercentFromUI(dxreDialog_SpnVerticalRelativePosition.GetValue());
    returnedObject.locked = dxreDialog_ChkLockAnchor.GetValue();
    returnedObject.wrapSide = dxreDialog_RblWrapText.GetValue();
    returnedObject.topDistance = dxreDialog_SpnTop.GetValue();
    returnedObject.bottomDistance = dxreDialog_SpnBottom.GetValue();
    returnedObject.rightDistance = dxreDialog_SpnRight.GetValue();
    returnedObject.leftDistance = dxreDialog_SpnLeft.GetValue();
    if(returnedObject.textBoxProperties) {
     returnedObject.textBoxProperties.topMargin = dxreDialog_SpnTopMargin.GetValue();
     returnedObject.textBoxProperties.bottomMargin = dxreDialog_SpnBottomMargin.GetValue();
     returnedObject.textBoxProperties.rightMargin = dxreDialog_SpnRightMargin.GetValue();
     returnedObject.textBoxProperties.leftMargin = dxreDialog_SpnLeftMargin.GetValue();
    }
    returnedObject.relativeWidth = this.relativePercentFromUI(dxreDialog_SpnRelativeWidth.GetValue());
    returnedObject.relativeHeight = this.relativePercentFromUI(dxreDialog_SpnRelativeHeight.GetValue());
    returnedObject.relativeWidthType = dxreDialog_CbxWidthRelativTo.GetValue();
    returnedObject.relativeHeightType = dxreDialog_CbxHeightRelativTo.GetValue();
   }
   returnedObject.absoluteHeight = dxreDialog_SpnAbsoluteHeight.GetValue();
   returnedObject.absoluteWidth = dxreDialog_SpnAbsoluteWidth.GetValue();
   returnedObject.useAbsoluteHeight = dxreDialog_RbtAbsoluteHeight.GetValue();
   returnedObject.useAbsoluteWidth = dxreDialog_RbtAbsoluteWidth.GetValue();
   returnedObject.rotation = dxreDialog_SpnRotation.GetValue();
   returnedObject.lockAspectRatio = dxreDialog_ChkScale.GetValue();
   return returnedObject;
  },
  relativePercentToUI: function(value) {
   return value / (__aspxRichEdit.AnchorInfo.RELATIVE_COEFF / 100);
  },
  relativePercentFromUI: function(value) {
   return value * (__aspxRichEdit.AnchorInfo.RELATIVE_COEFF / 100);
  },
  lockAspectRationWidth: function() {
   var aspect = this.parameters.originalWidth / this.parameters.originalHeight;
   dxreDialog_SpnAbsoluteWidth.SetValue(dxreDialog_SpnAbsoluteHeight.GetValue() * aspect);
  },
  lockAspectRationHeight: function() {
   var aspect = this.parameters.originalHeight / this.parameters.originalWidth;
   dxreDialog_SpnAbsoluteHeight.SetValue(dxreDialog_SpnAbsoluteWidth.GetValue() * aspect);
  }
 });
 var CallbackHelper = ASPx.CreateClass(null, {
  constructor: function(owner) {
   this.owner = owner;
   this.callbackCount = 0;
  },
  SendCallback: function(prefix, args) {
   var sendCallback = function() {
    this.owner.richedit.sendInternalServiceCallback(prefix, args, this);
    this.callbackCount++;
   }.aspxBind(this);
   window.setTimeout(sendCallback, 10);
  },
  OnCallback: function(result) {
   this.owner.OnCallbackForContent(result);
    },
  OnEndCallback: function() {
   if(this.callbackCount > 0)
    this.callbackCount--;
   if(this.callbackCount <= 0)
    this.owner.richedit.clearOwnerControlCallback();
   this.owner.OnEndCallbackForContent();
  }
 });
 var DialogListBox = ASPx.CreateClass(null, {
  constructor: function(owner, id, mainElement) {
   this.owner = owner;
   this.id = id;
   this.mainElement = mainElement;
   this.items = [];
   this.itemsCount = 0;
   this.selectedItem = null;
   this.Initialize();
  },
  Initialize: function() {
   this.InitializeEventHandlers();
   var mainElement = this.GetMainElement();
   ASPx.AddClassNameToElement(mainElement, constants.DialogListBoxClass);
   ASPx.AddClassNameToElement(mainElement, this.owner.richedit.getCustomCssClass("DialogListBox"));
  },
  InitializeEventHandlers: function() {
   ASPx.Evt.AttachEventToElement(this.GetMainElement(), "mousedown", function(evt) { this.OnMainContainerClick(evt); }.aspxBind(this));
   ASPx.Evt.AttachEventToElement(this.GetMainElement(), "dblclick", function(evt) { this.OnMainContainerDblClick(evt); }.aspxBind(this));
  },
  AddItem: function(value) {
   var item = new DialogListBoxItem(this, this.itemsCount++, value);
   this.items[item.id] = item;
  },
  ClearItems: function() {
   this.forEachItem(function(item) {
    var itemId = item.id;
    ASPx.GetStateController().RemoveSelectedItem(itemId);
    ASPx.GetStateController().RemoveHoverItem(itemId);
   }.aspxBind(this));
   ASPx.SetInnerHtml(this.GetMainElement(), "");
   this.items = [];
   this.selectedItem = null;
   this.itemsCount = 0;
  },
  OnMainContainerClick: function(evt) {
   if(!ASPx.Evt.IsLeftButtonPressed(evt))
    return;
   var item = this.GetItemByEvent(evt);
   if(item)
    this.SetSelectedItem(item);
  },
  OnMainContainerDblClick: function(evt) {
   var item = this.GetItemByEvent(evt);
   if(item)
    ASPx.DialogComplete(1);
  },
  GetItemByEvent: function(evt) {
   var sourceElement = ASPx.GetParentByTagName(ASPx.Evt.GetEventSource(evt), "DIV");
   while(!sourceElement.id)
    sourceElement = sourceElement.parentNode;
   return this.items[sourceElement.id];
  },
  SetSelectedItem: function(item) {
   if(this.selectedItem)
    this.selectedItem.Unselect();
   this.selectedItem = item;
   item.Select();
   this.owner.OnValueChanged(this.GetValue());
  },
  forEachItem: function(action) {
   for(var item in this.items)
    if(this.items.hasOwnProperty(item) && action(this.items[item]))
     return;
  },
  SetStyles: function(styles) {
   ASPx.SetStyles(this.GetMainElement(), styles);
  },
  SetSelectedIndex: function(index) {
   if(index < -1 && index >= this.itemsCount)
    return;
   if(index == -1 && this.selectedItem) {
    this.selectedItem = null;
    this.selectedItem.Unselect();
    return;
   }
   this.forEachItem(function(item) {
    if(item.index == index) {
     this.SetSelectedItem(item);
     return;
    }
   }.aspxBind(this));
  },
  SetSelectedValue: function(value) {
   this.forEachItem(function(item) {
    if(item.HasEqualValue(value)) {
     this.SetSelectedItem(item);
     return;
    }
   }.aspxBind(this));
  },
  GetSelectedItem: function() {
   return this.selectedItem;
  },
  GetValue: function() {
   return this.selectedItem ? this.selectedItem.GetValue() : undefined;
  },
  GetSelectedIndex: function() {
   return this.selectedItem ? this.selectedItem.index : -1;
  },
  GetMainElement: function() {
   return this.mainElement;
  }
 });
 var DialogListBoxItem = ASPx.CreateClass(null, {
  constructor: function(owner, index, value) {
   this.owner = owner;
   this.index = index;
   this.value = value;
   this.richedit = this.owner.owner.richedit;
   this.id = this.richedit.name + "_" + this.owner.id + "_" + index;
   this.CreateElement();
   this.PrepareElementState();
  },
  CreateElement: function() {
   var element = this.GetElementWithContent();
   element.id = this.id;
   ASPx.AddClassNameToElement(element, this.richedit.getCustomCssClass("DialogListBoxItem"));
   var parentElement = this.owner.GetMainElement();
   parentElement.appendChild(element);
  },
  PrepareElementState: function() {
   ASPx.GetStateController().AddSelectedItem(
    this.id,
    [constants.ListSelectedClass],
    [""],
    null,
    null,
    null
   );
   ASPx.GetStateController().AddHoverItem(
    this.id,
    [constants.ListHoverClass],
    [""],
    null,
    null,
    null
   );
  },
  Select: function() {
   ASPx.GetStateController().SelectElementBySrcElement(this.GetElement());
  },
  Unselect: function() {
   ASPx.GetStateController().DeselectElementBySrcElement(this.GetElement());
  },
  HasEqualValue: function(value) {
   return this.GetValue() === value;
  },
  GetValue: function() {
   return this.value;
  },
  GetElementWithContent: function() {
   var element = ASPx.CreateHtmlElement();
   ASPx.SetInnerHtml(element, this.GetContent());
   return element;
  },
  GetContent: function() {
   return this.GetValue();
  },
  GetElement: function() {
   return ASPx.GetElementById(this.id);
  }
 });
 var NumberingListBox = ASPx.CreateClass(DialogListBox, {
  constructor: function(owner, id, mainElement) {
   this.constructor.prototype.constructor.call(this, owner, id, mainElement);
  },
  AddItem: function(value) {
   var item = new NumberingListBoxItem(this, this.itemsCount++, value);
   this.items[item.id] = item;
  }
 });
 var NumberingListBoxItem = ASPx.CreateClass(DialogListBoxItem, {
  GetElementWithContent: function() {
   return this.IsNoneItem() ? DialogListBoxItem.prototype.GetElementWithContent.apply(this) : this.GetPreview();
  },
  GetContent: function() {
   return ASPxRichEditDialogList.OtherLabels.None;
  },
  HasEqualValue: function(abstractNumberingList) {
   var currentValue = this.GetValue();
   return abstractNumberingList !== null && currentValue !== null ? abstractNumberingList.externallyEquals(currentValue) : abstractNumberingList === currentValue;
  },
  IsNoneItem: function() {
   return this.GetValue() == null;
  },
  GetPreview: function() {
   var previewElement = ASPx.CreateHtmlElement();
   var previewHelper = new __aspxRichEdit.NumberingListFormPreviewHelper(this.richedit.core, this.GetValue(), this.owner.owner.parameters.currentLevel);
   var previewContentElement = previewHelper.createPreview();
   ASPx.AddClassNameToElement(previewContentElement, constants.NumberingListPreviewClass);
   previewElement.appendChild(previewContentElement);
   return previewElement;
  }
 });
 var TableBorderPreview = ASPx.CreateClass(null, {
  constructor: function(owner, container, horizontalInVisible, verticalInVisible) {
   this.owner = owner;
   this.container = container;
   this.verticalInVisible = verticalInVisible;
   this.horizontalInVisible = horizontalInVisible;
   this.mode = null;
   this.createPreview(container);
  },
  createPreview: function(container) {
   this.topBorder = this.createPreviewLine(container, constants.BorderTopLineClass, true, this.owner.parameters.top, dxreDialog_BtnBorderTop);
   this.bottomBorder = this.createPreviewLine(container, constants.BorderBottomLineClass, true, this.owner.parameters.bottom, dxreDialog_BtnBorderBottom);
   this.leftBorder = this.createPreviewLine(container, constants.BorderLeftLineClass, false, this.owner.parameters.left, dxreDialog_BtnBorderLeft);
   this.rightBorder = this.createPreviewLine(container, constants.BorderRightLineClass, false, this.owner.parameters.right, dxreDialog_BtnBorderRight);
   this.topLeftCell = this.createCellPreview(container, constants.PreviewTopLeftCellClass);
   if(this.verticalInVisible) {
    this.verticalInBorder = this.createPreviewLine(container, constants.BorderCenterLineClass, false, this.owner.parameters.insideVertical, dxreDialog_BtnBorderInsideVertical);
    this.topRightCell = this.createCellPreview(container, constants.PreviewTopRightCellClass);
   }
   if(this.horizontalInVisible) {
    this.horizontalInBorder = this.createPreviewLine(container, constants.BorderMiddleLineClass, true, this.owner.parameters.insideHorizontal, dxreDialog_BtnBorderInsideHorizontal);
    this.bottomLeftCell = this.createCellPreview(container, constants.PreviewBottomLeftCellClass);
   }
   if(this.horizontalInVisible && this.verticalInVisible)
    this.bottomRightCell = this.createCellPreview(container, constants.PreviewBottomRightCellClass);
   this.correctLayout();
  },
  createPreviewLine: function(container, cssClass, isHorizontalLine, borderInfo, controlBtn) {
   var line = ASPx.CreateHtmlElement();
   ASPx.AddClassNameToElement(line, constants.BorderLineClass);
   ASPx.AddClassNameToElement(line, isHorizontalLine ? constants.BorderHorizontalLineClass : constants.BorderVerticalLineClass);
   ASPx.AddClassNameToElement(line, cssClass);
   container.appendChild(line);
   var controlLine = ASPx.CreateHtmlElement();
   ASPx.AddClassNameToElement(controlLine, constants.BorderControlLineClass);
   ASPx.AddClassNameToElement(controlLine, isHorizontalLine ? constants.BorderHorizontalLineClass : constants.BorderVerticalLineClass);
   ASPx.AddClassNameToElement(controlLine, cssClass);
   container.appendChild(controlLine);
   return new TableBorderPreviewLine(this, borderInfo, line, controlLine, controlBtn);
  },
  createCellPreview: function(container, className) {
   var cell = ASPx.CreateHtmlElement();
   ASPx.AddClassNameToElement(cell, constants.PreviewCellClass);
   ASPx.AddClassNameToElement(cell, className);
   container.appendChild(cell);
   this.createGrid(cell);
   return cell;
  },
  createGrid: function(element) {
   __aspxRichEdit.HTMLUtils.clearInnerHtml(element);
   var height = ASPx.GetClearClientHeight(element);
   var lineCount = Math.round(height / 8);
   for(var i = 0; i < lineCount; i++) {
    var terxtLine = ASPx.CreateHtmlElement();
    ASPx.AddClassNameToElement(terxtLine, constants.PreviewTextClass);
    element.appendChild(terxtLine);
    ASPx.SetOffsetHeight(terxtLine, 4);
    terxtLine.style.marginBottom = "4px";
   }
  },
  correctLayout: function() {
   var horizontalInBorderHeight = this.horizontalInVisible ? this.horizontalInBorder.line.offsetHeight : 0;
   var verticalInBorderWidth = this.verticalInVisible ? this.verticalInBorder.line.offsetWidth : 0;
   var halfWidth = this.container.offsetWidth / 2;
   var halfHeight = this.container.offsetHeight / 2;
   var leftColumntWidth = Math.round(halfWidth - ((verticalInBorderWidth / 2) + this.leftBorder.line.offsetWidth));
   var righColumntWidth = Math.round(halfWidth - ((verticalInBorderWidth / 2) + this.rightBorder.line.offsetWidth));
   var topRowHeight = Math.round(halfHeight - (this.topBorder.line.offsetHeight + (horizontalInBorderHeight / 2)));
   var bottomRowHeight = Math.round(halfHeight - (this.bottomBorder.line.offsetHeight + (horizontalInBorderHeight / 2)));
   ASPx.SetOffsetHeight(this.topLeftCell, this.horizontalInVisible ? topRowHeight : topRowHeight + bottomRowHeight);
   ASPx.SetOffsetWidth(this.topLeftCell, this.verticalInVisible ? leftColumntWidth : leftColumntWidth + righColumntWidth);
   this.topLeftCell.style.top = this.topBorder.line.offsetHeight + "px";
   this.topLeftCell.style.left = this.leftBorder.line.offsetWidth + "px";
   this.createGrid(this.topLeftCell);
   if(this.horizontalInVisible) {
    this.horizontalInBorder.line.style.top = Math.round(halfHeight - (horizontalInBorderHeight / 2)) + "px";
    ASPx.SetOffsetHeight(this.bottomLeftCell, bottomRowHeight);
    ASPx.SetOffsetWidth(this.bottomLeftCell, this.verticalInVisible ? leftColumntWidth : leftColumntWidth + righColumntWidth);
    this.bottomLeftCell.style.top = (halfHeight + Math.round(horizontalInBorderHeight / 2)) + "px";
    this.bottomLeftCell.style.left = this.leftBorder.line.offsetWidth + "px";
    this.createGrid(this.bottomLeftCell);
   }
   if(this.verticalInVisible) {
    this.verticalInBorder.line.style.left = Math.round(halfWidth - (verticalInBorderWidth / 2)) + "px";
    ASPx.SetOffsetHeight(this.topRightCell, this.horizontalInVisible ? topRowHeight: topRowHeight + bottomRowHeight);
    ASPx.SetOffsetWidth(this.topRightCell, righColumntWidth);
    this.topRightCell.style.top = this.topBorder.line.offsetHeight + "px";
    this.topRightCell.style.left = (halfWidth + Math.round(verticalInBorderWidth / 2)) + "px";
    this.createGrid(this.topRightCell);
   }
   if(this.verticalInVisible && this.horizontalInVisible) {
    ASPx.SetOffsetHeight(this.bottomRightCell, bottomRowHeight);
    ASPx.SetOffsetWidth(this.bottomRightCell, righColumntWidth);
    this.bottomRightCell.style.top = (halfHeight + Math.round(horizontalInBorderHeight / 2)) + "px";
    this.bottomRightCell.style.left = (halfWidth + Math.round(verticalInBorderWidth / 2)) + "px";
    this.createGrid(this.bottomRightCell);
   }   
  },
  setMode: function(mode) {
   this.mode = mode;
   switch(mode) {
    case __aspxRichEdit.SetModeButtons.None:
     this.setModeCore(null, null, null, null, null, null);
     break;
    case __aspxRichEdit.SetModeButtons.All:
     var borderInfo = this.getBorderInfo();
     this.setModeCore(borderInfo, borderInfo, borderInfo, borderInfo, borderInfo, borderInfo);
     break;
    case __aspxRichEdit.SetModeButtons.Box:
     var borderInfo = this.getBorderInfo();
     this.setModeCore(borderInfo, borderInfo, borderInfo, borderInfo, null, null);
     break;
    case __aspxRichEdit.SetModeButtons.Grid:
     var borderInfo = this.getBorderInfo();
     var inBorderInfo = null;
     if(this.horizontalInVisible || this.verticalInVisible)
      inBorderInfo = {
       color: borderInfo.color,
       style: __aspxRichEdit.BorderLineStyle.Single,
       width: __aspxRichEdit.BorderShadingDialogParameters.gridWidth
      };
     this.setModeCore(borderInfo, borderInfo, borderInfo, borderInfo, inBorderInfo, inBorderInfo);
     break;
    case __aspxRichEdit.SetModeButtons.Custom:
     dxreDialog_BtnPresetCustom.SetChecked(true);
     break;
   }
   this.correctLayout();
  },
  setModeCore: function(topBorderInfo, rightBorderInfo, bottomBorderInfo, leftBorderInfo, horizontalInBorderInfo, verticalInBorderinfo) {
   if(topBorderInfo)
    this.topBorder.setBorder(topBorderInfo);
   else
    this.topBorder.resetBorder();
   if(rightBorderInfo)
    this.rightBorder.setBorder(rightBorderInfo);
   else
    this.rightBorder.resetBorder();
   if(bottomBorderInfo)
    this.bottomBorder.setBorder(bottomBorderInfo);
   else
    this.bottomBorder.resetBorder();
   if(leftBorderInfo)
    this.leftBorder.setBorder(leftBorderInfo);
   else
    this.leftBorder.resetBorder();
   if(this.horizontalInVisible)
    if(horizontalInBorderInfo)
     this.horizontalInBorder.setBorder(horizontalInBorderInfo);
    else
     this.horizontalInBorder.resetBorder();
   if(this.verticalInVisible)
    if(verticalInBorderinfo)
     this.verticalInBorder.setBorder(verticalInBorderinfo);
    else
     this.verticalInBorder.resetBorder();
  },
  getBorderInfo: function() {
   var borderInfo = {
    color: dxreDialog_CeBorderColor.GetValue(),
    style: dxreDialog_CmbBorderStyle.GetValue(),
    width: dxreDialog_CmbWidth.GetValue()
   };
   return borderInfo;
  }
 });
 var TableBorderPreviewLine = ASPx.CreateClass(null, {
  constructor: function(owner, borderInfo, line, controlLine, controlBtn) {
   this.owner = owner;
   this.borderInfo = borderInfo;
   this.line = line;
   this.controlLine = controlLine;
   this.controlBtn = controlBtn;
   this.borderToUpdate = ASPx.ElementHasCssClass(this.line, constants.BorderVerticalLineClass) ? "borderRight" : "borderBottom";
   this.Initialize();
  },
  Initialize: function() {
   this.InitializeEventHandlers();
   this.controlBtn.mainElement.style.visibility = "visible";
   if(this.borderInfo !== null && this.borderInfo.style !== __aspxRichEdit.BorderLineStyle.None) {
    this.setLineElementColor();
    this.setLineElementStyle();
    this.setLineElementWidth();
    if(this.borderInfo.width > 0) {     
     this.controlBtn.SetChecked(true);
    }
   }
  },
  InitializeEventHandlers: function() {
   ASPx.Evt.AttachEventToElement(this.controlLine, "click", function() {
    var borderInfo = this.owner.getBorderInfo();
    if(this.borderInfo !== null && this.borderInfo.equals(borderInfo))
     this.resetBorder();
    else
     this.setBorder(borderInfo);
    this.owner.correctLayout();
    this.owner.setMode(__aspxRichEdit.SetModeButtons.Custom);
   }.aspxBind(this));
   this.controlBtn.Click.AddHandler(function(s) {
    if(s.GetChecked())
     this.setBorder(this.owner.getBorderInfo());
    else
     this.resetBorder();
    this.owner.correctLayout();
    this.owner.setMode(__aspxRichEdit.SetModeButtons.Custom);
   }.aspxBind(this));
  },
  setBorder: function(borderInfo) {
   if(!this.borderInfo)
    this.borderInfo = new __aspxRichEdit.DialogBorderInfo();
   if(this.borderInfo.color !== borderInfo.color) {
    this.borderInfo.color = borderInfo.color;
    this.setLineElementColor();
   }
   if(this.borderInfo.width !== borderInfo.width || this.borderInfo.style !== borderInfo.style) {
    if(this.borderInfo.width !== borderInfo.width) {
     this.borderInfo.width = borderInfo.width;
    }
    if(this.borderInfo.style !== borderInfo.style) {
     this.borderInfo.style = borderInfo.style;
     this.setLineElementStyle();
    }
    this.setLineElementWidth();
   }
   this.controlBtn.SetChecked(true);
  },
  resetBorder: function() {
   if(this.borderInfo) {
    this.borderInfo.width = 0;
    this.borderInfo.style = __aspxRichEdit.BorderLineStyle.None;
    this.line.style[this.borderToUpdate + "Width"] = 0;
    this.controlBtn.SetChecked(false);
   }
  },
  setLineElementColor: function() {
   this.line.style[this.borderToUpdate + "Color"] = this.borderInfo.color;
  },
  setLineElementStyle: function() {
   this.line.style[this.borderToUpdate + "Style"] = this.getBorderStyleForHtml(this.borderInfo.style);
  },
  setLineElementWidth: function() {
   var width = __aspxRichEdit.UnitConverter.pointsToPixels(this.borderInfo.width);
   width = ((width === 0) && (this.borderInfo.width > 0)) ? 1 : Math.floor(width);
   width = this.correctWidthDueToStyle(width);
   this.line.style[this.borderToUpdate + "Width"] = width + "px";
  },
  correctWidthDueToStyle: function(width) {
   switch(this.borderInfo.style) {
    case __aspxRichEdit.BorderLineStyle.Double:
     return width * 3;
    default:
     return width;
   }
  },
  getBorderStyleForHtml: function(style) {
   switch(style) {
    case __aspxRichEdit.BorderLineStyle.Dotted:
     return "dotted";
    case __aspxRichEdit.BorderLineStyle.Dashed:
     return "dashed";
    case __aspxRichEdit.BorderLineStyle.Double:
     return "double";
    default:
     return "solid";
   }
  }
 });
 function aspxTestExistingImageOnLoad(name) {
  var richedit = ASPx.GetControlCollection().Get(name);
  var curDialog = richedit != null ? ASPx.Dialog.GetLastDialog(richedit) : null;
  if(curDialog != null) curDialog.OnLoadTestExistingImage();
 }
 function aspxTestExistingImageOnError(name) {
  var richedit = ASPx.GetControlCollection().Get(name);
  var curDialog = richedit != null ? ASPx.Dialog.GetLastDialog(richedit) : null;
  if(curDialog != null) curDialog.OnErrorTestExistingImage();
 }
 var ASPxRichEditDialogList = {};
 ASPxRichEditDialogList["FileSaveAs"] = new RESaveAsDialog("savefiledialog");
 ASPxRichEditDialogList["FileOpen"] = new REOpenFileDialog("openfiledialog");
 ASPxRichEditDialogList["EditFont"] = new REFontDialog("fontdialog");
 ASPxRichEditDialogList["EditParagraph"] = new REParagraphDialog("paragraphdialog");
 ASPxRichEditDialogList["PageSetup"] = new REPageSetupDialog("pagesetupdialog");
 ASPxRichEditDialogList["Columns"] = new REColumnsDialog("columnsdialog");
 ASPxRichEditDialogList["InsertTable"] = new REInsertTableDialog("inserttabledialog");
 ASPxRichEditDialogList["InsertImage"] = new REInsertImageDialog("insertimagedialog");
 ASPxRichEditDialogList["ErrorMessage"] = new REErrorDialog("alertdialog");
 ASPxRichEditDialogList["NumberingList"] = new RENumberingListDialog("numberinglistdialog");
 ASPxRichEditDialogList["Hyperlink"] = new REHyperlinkDialog("hyperlinkdialog");
 ASPxRichEditDialogList["Tabs"] = new RETabsDialog("tabsdialog");
 ASPxRichEditDialogList["SimpleNumberingList"] = new RESimpleNumberingListDialog("simplenumberinglistdialog");
 ASPxRichEditDialogList["BulletedList"] = new REBulletedListDialog("bulletedlistdialog");
 ASPxRichEditDialogList["MultiLevelNumberingList"] = new REMultiLevelNumberingListDialog("multilevelnumberinglistdialog");
 ASPxRichEditDialogList["Symbols"] = new RESymbolsDialog("symbolsdialog");
 ASPxRichEditDialogList["InsertMergeField"] = new REInsertMergeFieldDialog("insertmergefielddialog");
 ASPxRichEditDialogList["FinishAndMerge"] = new REFinishAndMergeDialog("finishandmergedialog");
 ASPxRichEditDialogList["Bookmarks"] = new REBookmarksDialog("bookmarksdialog");
 ASPxRichEditDialogList["TableProperties"] = new RETablePropertiesDialog("tablepropertiesdialog");
 ASPxRichEditDialogList["InsertTableCells"] = new REInsertTableCellsDialog("inserttablecellsdialog");
 ASPxRichEditDialogList["DeleteTableCells"] = new REDeleteTableCellsDialog("deletetablecellsdialog");
 ASPxRichEditDialogList["SplitTableCells"] = new RESplitTableCellsDialog("splittablecellsdialog");
 ASPxRichEditDialogList["BorderShading"] = new REBorderShadingDialog("bordershadingdialog");
 ASPxRichEditDialogList["FindReplace"] = new REFindReplaceDialog("findreplacedialog");
 ASPxRichEditDialogList["Spelling"] = new RESpellingDialog("spellingdialog");
 ASPxRichEditDialogList["InformationMessage"] = new REInformationDialog("alertdialog");
 ASPxRichEditDialogList["WarningMessage"] = new REWarningDialog("alertdialog");
 ASPxRichEditDialogList["LayoutOptions"] = new RELayoutOptionsDialog("layoutoptionsdialog");
 ASPxClientRichEdit.ASPxRichEditDialogList = ASPxRichEditDialogList;
 ASPxClientRichEdit.getActiveDialog = function() {
  var richedit = ASPx.GetControlCollection().Get(ASPx.currentControlNameInDialog);
  return richedit != null ? ASPx.Dialog.GetLastDialog(richedit) : null;
 };
 function executeIfExists(name, execFunc) {
  var element = window[name];
  if(element && element.IsDOMInitialized())
   return execFunc(element);
  return false;
 }
 window.aspxTestExistingImageOnLoad = aspxTestExistingImageOnLoad;
 window.aspxTestExistingImageOnError = aspxTestExistingImageOnError;
})();      J  ﻿(function() {
 var constants = {
  CallbackPrefix: "REFM"
 };
 ASPx.RegisterMixin("RE_FileManager", function (baseClass) {
  return {
   constructor: function (name) {
    this.constructor.prototype.constructor.call(this, name);
    this.callbackCount = 0;
   },
   InitializeKbdHelper: function () {
   },
   CreateCallback: function (callbackString) {
    this.richedit.sendInternalServiceCallback(constants.CallbackPrefix, callbackString, this);
    this.callbackCount++;
   },
   OnEndCallback: function () {
    if (this.callbackCount > 0)
     this.callbackCount--;
    if (this.callbackCount <= 0)
     this.richedit.clearOwnerControlCallback();
    baseClass.prototype.DoEndCallback.apply(this, arguments);
   },
   RaiseEndCallback: function () {
    this.RaiseEndCallbackInternal();
   }
  };
 });
 var ASPxClientRichEditFileManager = ASPx.GetMixin("RE_FileManager", ASPxClientFileManager);
 ASPxClientRichEditFileManager.SetOwner = function(container, owner) {
  var fileManager = null;
  ASPx.GetControlCollection().ProcessControlsInContainer(
   container,
   function(control) {
    if (control.mixinName == "RE_FileManager")
     fileManager = control;
   }
  );
  if(fileManager)
   fileManager.richedit = owner;
 };
 window.ASPxClientRichEditFileManager = ASPxClientRichEditFileManager;
})();    ﻿(function() {
 var RichEditFileManagerUploadControl = ASPx.CreateClass(ASPx.FileManagerUploadControl, {
  createUploadManager: function(stateHelper) {
   return new ASPxRichEditFileManagerUploadManagerClass(this.options, stateHelper);
  }
 });
 var ASPxRichEditFileManagerUploadManagerClass = ASPx.CreateClass(ASPxClientUploadControl.UploadManagerClass, {
  GetUploadFormAction: function(form) {
   var action = ASPxClientUploadControl.UploadManagerClass.prototype.GetUploadFormAction.call(this, form);
   return this.AddQueryParamToUrl(action, ASPxClientRichEdit.Constants.UploadControlUrlParameter, ASPxClientRichEdit.Constants.InternalCallBackPostfix);
  }
 });
 ASPx.RichEditFileManagerUploadControl = RichEditFileManagerUploadControl;
})();   m	  ﻿(function() {
 var constants = {
  CallbackPrefix: "REFM"
 };
 ASPx.RegisterMixin("RE_FolderManager", function (baseClass) {
  return {
   constructor: function(name) {
    this.constructor.prototype.constructor.call(this, name);
    this.callbackCount = 0;
    this.notifyOwnerDialogOnEndCallback = false;
   },
   InitializeKbdHelper: function() {
   },
   CreateCallback: function(callbackString) {
    this.richedit.sendInternalServiceCallback(constants.CallbackPrefix, callbackString, this);
    this.callbackCount++;
    this.notifyOwnerDialogOnEndCallback = false;
   },
   OnCallback: function(result) {
    baseClass.prototype.OnCallback.call(this, result);
    this.notifyOwnerDialogOnEndCallback = this.isChangeFolderCallback(result);
   },
   OnEndCallback: function() {
    if(this.callbackCount > 0)
     this.callbackCount--;
    if(this.callbackCount <= 0)
     this.richedit.clearOwnerControlCallback();
    baseClass.prototype.DoEndCallback.apply(this);
    if(this.notifyOwnerDialogOnEndCallback) {
     var currentDialog = this.richedit.getCurrentDialog();
     if(currentDialog && currentDialog.onFileManagerReceivedData)
      currentDialog.onFileManagerReceivedData();
    }
    this.notifyOwnerDialogOnEndCallback = false;
   },
   InCallback: function() {
    return this.callbackCount > 0 || baseClass.prototype.InCallback.call(this);
   },
   isChangeFolderCallback: function(result) {
    return result && result.command === "CHANGEFOLDER" || result.command === "GETFILELIST";
   },
   PrepareFileStates: function() {
    baseClass.prototype.PrepareFileStates();
    this.forEachFile(function(file) {
     var fileId = file.id;
     ASPx.GetStateController().RemoveSelectedItem(fileId);
    }.aspxBind(this));
   },
   RaiseEndCallback: function() {
    this.RaiseEndCallbackInternal();
   }
  };
 });
 var ASPxClientRichEditFolderManager = ASPx.GetMixin("RE_FolderManager", ASPxClientFileManager);
 ASPxClientRichEditFolderManager.SetOwner = function(container, owner) {
  var fileManager = null;
  ASPx.GetControlCollection().ProcessControlsInContainer(
   container,
   function(control) {
    if (control.mixinName == "RE_FolderManager")
     fileManager = control;
   }
  );
  if(fileManager)
   fileManager.richedit = owner;
 };
 window.ASPxClientRichEditFolderManager = ASPxClientRichEditFolderManager;
})();         ﻿(function () {
 ASPx.RegisterMixin("RE_UploadControl", function (baseClass) {
  return {
   createUploadManager: function (stateHelper) {
    return new RichEditUploadManagerClass(this.options, stateHelper);
   }
  };
 });
 var RichEditUploadControl = ASPx.GetMixin("RE_UploadControl", ASPxClientUploadControl);
 var RichEditUploadManagerClass = ASPx.CreateClass(ASPxClientUploadControl.UploadManagerClass, {
  GetUploadFormAction: function(form) {
   var action = ASPxClientUploadControl.UploadManagerClass.prototype.GetUploadFormAction.call(this, form);
   return this.AddQueryParamToUrl(action, ASPxClientRichEdit.Constants.UploadControlUrlParameter, ASPxClientRichEdit.Constants.InternalCallBackPostfix);
  }
 });
 ASPx.RichEditUploadControl = RichEditUploadControl;
})();  i  PNG

   
IHDR     h   Y   	pHYs    od  hIDATx^]	|TEү~!`\DX<*^AE0$#@`[<u[PYD!tޞwdͬ7
S]]]O!B݌5
 Wޱ1VOps;i`Oya-GG^zS
Iy)%mЀR
j}<M5 <wS#_q'D@P~Mqi\-N;dTO)x?NQJJ΍$8.\(3mh4+qh- #UL l/白l a=ЖG̡+e<¹{H! p-iO1>?7<3{2󉌿s +_㛫yq׼	BE;LMhzJZ2ʈx7
!
8k"_.w/cq4`QH)!4a=UPG(qsw,>YsPGک|3;j'oܫ!:@ҋ%lؙmvT:T
my%R!7@q !zpӨPbjDv֥Ij$QC&F|V<AAB=^TnK·PQ1H
8,0$ӋKƥ\l9zJ/ A-a=ЗG֯x15ɩpo^PG N"uIe *	o&A{.J',ރtqgCCOS&[b9rq XR8BB=:ZKrG]kJƂ>s2_zS;
myӼ_ϣ4@>[Dȩ?|Ow9/Ա
5!Jys2ЋRYٮ@ t bF(qɟ'F!Iã8щ
V3pXsH#81!pSʩ0P/qϕQϣG:{m*؋;'^K=xIOψ0z*}oq|_:Z[WCݡL^	$Q/;O]}";jXX
2CpaqQؐquQ(p5)5)_'"DMZRHM\%ھ8
4!r.@HɽgxMQ%D6O@CMiΤ
ir-KRwpyq)Zkdrw6t%C]Ox
3p)|l8i0yv':~[h̜M~I	ABYY4J]2Dr-uhp'Cdbʦ$@P	.	uԋ"?wc!`Q<Npّy?<	=~ȑ:qK'SvP{A}s`!.agv1#x28lLQ!!]X<($0Lrgz䱗7""Jۮyb$.P!%HS|b؞zGMXRB	t>J PbN"u9*- 8
|Fx!= 6.OGcԭ9@x+:CDU D7r|I#qԎ0Lrn/xm.]TpD7n	*UUnB8J.;\Pw=|l+G`Ă~#^<NO8&
myv2ڲX:'KP?ԔHJ&*!&
\,B[;wLgcYbJage%I0qGÁ^?@ Q (X 7nM\
;|~l?9r<Xqt4揯ra$NMЧG2ŶjIy:?p?' k6a#SqSό"*t8JnUBd<#q4Bx?vk.YgLGqy7x܂㻟~'ᆈz$nr9+#W4|<qؐ; Ca̭s)VΧu1׾mO{T?L<0
iUt0>Z#9{NՋڴ>^`$?OdԔlݯg꟧	k$9_3^-cb]UhGf@_F~,rZw2)͋h`!H81us44 !Gb~<yؒ_ ?xHkO?1Qޅ~م|_~7:7*!8濞q Q1s4q0w&>ؐ;ؾSж5L<9J/@޶kC0 ڑL
>9٭}0
Hd׌lGZlV	Q@yE̜=όkE8 kT?pf?G!fNO8'l{){Kw2-t+$p|)lߖ\{=*ƛn|u77[8/Gc
;+oCx6TCy
8s4ǀ
lz )=¢b5v2L
%U1;Nh+^u|{Ds8A
koI7';QsN
G8o8
V㏅)aæR=@TH>b}rr>A=fⰧ)(Pq [svB֦]Dmب8@m[w'uW_4}\(8̽[lLJĺqۄr4PgžsPdQANy.~Wm`bE)"njCB<r"|t0:MA9C`;Rc|s6 )P
kWe6věE5rvhO/
 *ꉝԾ[[åSA/P84sǠwO3g~ø1ۙ0'T2hJctj¬xf%,	pC-xbZW_7*
# n.1v'1|	caAV6D
zA@A=mR{ j.v8kDE]k2`@y8aCgy;|\~,brJ`'}zݯv6b>-AfW+*ˋ>?vn/i<GC"pAbage%^ZPqPYE|;NF-;xOmqxhp&#/; `?ٰ.`ƍr5,9[~,tl>{.}#bk?qxA}YgUd<HHUkr-6lW]f6$(P?
t#
Mrjpn-~{z=&Me7z
m>9,v!4
C=u):'>N~s!R'^~Sp!)mk͐stJ<F")F<3<AU "/D,r)OS#>É3RWQ, [|;$1"'v*Rb,9\tDRqPITIq1TP2G
q*~Zu=	%Zn͒cjN<cҌK8sxfjߡ7R8qXxR,(''ͨQW.PLs=:
j¹_Ѣ$/킺w6CzösX"?q\<3 ధ<^lF[Ⱦ0ЦYV`¶s|{څKEUǏ&*F\(9?iWOG*=z"R`"19X^E>Ɍ3"19
p98 BX^E|@E
7ؓA}$񎏳nBӦWK_wiW%CLCDGMA9hfL@$7,rp,nZv͈LqԖ(_ U&b>tʱ$LC6xH)!4Ti &kaLGD(`	tWǱm7S8aOOMW#eHz*ZXJߵSAaK
"\eeUI!>n|ܸ2@8خBy8e/-F?Q]! :j׶Og|+8P#cbr1³ͅsQ43SZzюvcI|4PrMk C_"^F֏E{4T$8t`Pnŋe8¥+92*}WzB}?8N>cCcE1P6m
}?4.zxc>\yՕ򼙨=Im"Ο;K	K6	!קhmCnFv6i}Zz l+N0&q?{fT?(koy{GŋՎZ>?NB'Ëq28t3
/K?]kuO._yB1gࣵ=ttAiEEl<4\0ㅿBU>Gm+eB8ƀOq'|;$'0-*B>3`bK#RI;1G$8\#J y	y\V}]
?G08$sƤ% gmtFK4=S(SdU1i㰧&臘Ȅt0MjYEXtUBbSCsd]jv۹:
IE#hVzL.J'vըSuܔ
C}7Q㷑8lP!t4:uc&vS|TXu}[(wp`NGtFk}
=о-&kKNTUCd$ƌ{Ο?/C5Mi% `4BOn,tc#c(z Y-B6pXH<[=lW.#sPjÞv6lSQ5ڭKiz
x}  qFGG*>Y@k"Þuؾñ~il{l^xWŖpIq]!t4HιXX+%+A**8?tr~ɚd\`;O'u i\'?cĈ
o
ao\ΫH5JK8O{>Z},b*4N2b</,c)3g1N؃8l(e{2	3E;[!t ľ-?uSB0zĭMYy94j؈XjM@=;4F/+u]ǊÁpÆ}΅t0o:q[dcmyIȃA;Q`$2yWkeޕ\UuT
Wr0?<2OJ:cs42hF4<@NRŻW^ux0qP_p?px	bxw(/~',׳Dy/=QQ2Ǐ;`ÈgB(]ǰGJ]w
dfqTVT1%]V^ ]ּs~n:;6xCiroc+Z>)xM8L@^nvz:,%KͿaNl#bTӔqeధޫY}c0ڥ9E3l
mqxttfD;$;KgzQ+Apx0-pU18+.ir)Is˳w
?΂2h6FxE:.7}
8Cb+	ɓüh 9/fSCII	<3jGMâVq緅`[=@}0ŃjDQGֶ]: q6D4l#c(@=֯Gi9kA߮wYp+)%,@PaOXhWA=ϥQMzjJgh*QG%fqB8/?b,сep.o#INմJϮ񽺚.hOf	N;)}dzUH!\'8TJVT2(Aǋƥ7XJٱCHcdKYqFp$6brwW1ERxh@@B iފvk5mvǁzZ?'˲<8MӠQ`ѢLJ#ġ"Rz5K,1̯ GS
I?e
d(RlRjzk}Yy *+Au_t&hh~P0t(`F$,jrDuX&qn`,8c#ڛpS<sϿ0E0o+HۗY񽁵7unFaC['*9*RcїZvQBP	VՌc#VqȌvc)d)"M)`pbF"~(Tp'CILI?RtS=bp U/BןS|mt1	vM&ߋaC` /8H}~9Q8UM݆dq Yo9ЕzMѫPوF_ Y8u}YY `@G jKfV|jȵ<}}9ij<p\Bð:88	緭ۍq$)4
!:S,]n!.a,NOuZ*eL_lӺ"񛰦F#Y.DoW|&;Z!Ae@^c6!k9Usë(`np1;tO<ip]TcD>-h(GdؑQjTbz<3$]Q_[	(
^ypK.Hu0) 
%&M+%Mj_0fBFw^V 0YhЗ7;ZUŒA

\q|р@'I=a%JT]2</·u
Q *"0CD'ZRA!S!We-yпOi/%a!H r{rORX?zBay)*:yLzytp&<Sõr@~w|cEk,I0bF0
 ާרx?&kBl!FM(;c|_(8G5
{	iXOU),Qd|MͼPp1w{/2rt2>H&8/+4x`Mk5E<><?XNWlS=0qTRnG9NN
rJYc{ъ  *8BinP
DQ)ڔ%aicٳ4axv(vh`BERSRVlF4 *jge/
Qcσܝ}`nvYvg( E)Ak=Jwf~J`DX+͓lʟ@ N (0)9u" SiR          1,%3?;?
螏cL9(3˕ie 0pp|wÊBW-*Vْ{k='yy̤R*u[tJD
ɇ~Z|X*ϒ@ԶJӲW{ϸ񞦭}J<w=?7w+N,<BX.:ry1'}{(=dK5;UۏUcQo:m?w7u$`(D$$  ? ETA>D	(i!@H	J{9l&'s0μw>ϼΌŒ[RA٘`0B\E<
B<6ہ9w([=\Y.Q(q	,_qbJ)O5	  EtRX(ׯil󭅯af9A {h'â H=OL:g=&cGg?YRB?*iRpna{7=QQQ ldEHΝ?=pM3 VVYv$/x7+p=PLkR^ :n^:r#vP>fݹm1?H<<AUq䮏/|9
aΒ{X1d$?.6ΗDʄFDÛX cq ]6 bPt.ۡ;'fvm4 h$_ gf,ܷG0z3?ygعL%AlA 8"Ϣ$rj}M+z>oW_Բ¯Ra	
,S^*ԗ1NSOk A|(4bOGљg4= 2R}"QSw}:A  ʯNW'D	qEc(N߯?82 z*d5  (h.ElvRI0gDPD&Gf4#r$a׸lwO㮵B1UhYoBN1@NIV!D
jDoN&$vn+g}/V	0="˼
c.{0~O/ϼGvU
ҏ 
~MqaG>9?yNJ;mҘv/ tZ
OrA$Wcf粶 'g^bc;HZs6ڶ|E#M[iKރ-n@Nek父gB*sM4_睾rt ph0Ƹl63(F@kXfz<Wh#7*tbWa'ݴ<eyrDd>`*$ߏ*]L($!fDATI<^`169_f}DђD6uTl[+_}>:=j>߃E
)a_щØY8}>`{UB^=faaa;wHMqz".^DM?VMʼ[%(S=%G"6@)ԭQ~6rj"agcǍp]>:b>ݛ7Ax擺L{10cѐ$AZ Q¹]oXALIbw/L߉/Ơ`ZFՑ(CڅlhUL;@L:u'P5PH9^O1%kB(\`/ng!8DXoռvPv.t81mkqɇOtu-G͌箶J>r,;3Rv|o]Νl5{uƠď&gc+W`b4l'郬Qnm`W</b=G;|g_Mڽ~a|/%LP TqԼBmNz
̶\Oqb%HLT 6QRĘG 8y*Z@	pVl}8aH  pB_ ,RqļjbKO (qrڮ?䙹6ӻ -'뱊0S}63hdO	*y'H;9U+G.09Ⱦ)Ԭ |+ѐ	y2 X
L?TeԌ 3h6Mqi' % _	)cAU(^=1HvW߀@P\B-AMI`nt@m8ABu)~q;˄"J*:ˣ'\\ݓMaPB?ҠWZUYwimؾs__ r.t<fԘ<M!V7inC; H} 7:-Z>7rA_Fiij46</Îi9tozVg^`0DM+y}V䩗
 =GWDao*yBgfŃ0NBx9 0Yp/(W-8֓zHDƵu92eJ[(d:0}߿[sVٗ*X~щIKoyǻdxKV;Q,,h}`CPO@Zh5´$1\F_^˗.i	 ?&n_'UOkBC
C&>v[s](1np	nF׮6O	 F^ σ	
EU{EY'QDp!>8c*{vɋ2U$X(«!UG0/ve=[sXhBd;L,
Rʾ+ψq/ھ!f/ng<	v.}B|zؒ|,3At1eJpoH<" (0 f 9pr(/(E<Cۿ1ŖTCl!x+y? pPbpG:~L46|TR}VCɄҒFr$|@*y18s`ct'=TN5;4=E=teUk27~%0ĳG1_EaU^Pq
,>
Dc3$L!q %ﳽC7򉭈W_ni-wb n];?ћ'˫W`.ݘuJa`z 0<U{BUmaCQr	̹\uǩ A7)CyKYSV35 c1'Ank{ (9 Ls^ 3Y_y7zyNT.X% +RG߂ۗz/եG, aEs.<oAf 4y `үNK=/N47Ow;=ʴ `,xuNtlX=H9x2$InAz=ɳȾ{Xi+lW.b.s[]j!
۷7fx,%: [ 2AJH4N=rEKSGc8WAJHPJU`PwKaoLB^: O(=C]MOśAizuK`?LF)Z%T5)+kQߎjUUG/Id;{?=ti\3(c{{_z2s94)+Buh2MQƫp9\~1_	2 8NDhHĝ'5jixdd0xTd
o W=L֫ܣ~l<.:ϯ@Ca2HpurBbɥ >X>blhS53ZlyKn  
_6RDݥ?oa}Mv$lzmjרb^^		K!:38y5IPN0ՕMo5.6h|)S
&K8,n;@0|x=IUWxW`mDڵ<VFۖŸ֦́ߜکOV9׍cx$dy~ʶ={zdm;u!>6KgLF.mG.#)iAWs).zʢ	jjP/vhx+6pw󜔀ϷWc{NM[qϟ\we+~#n>Mq`([JU=L4B:iqNI.)8`T`Ūz+O1;<CL>
~}%+5\GE9JZ00_~2s@dY#L9e
jq7'EGAOcQ
~[3bߵM.KiBIȢ95PnV~
䢊&05A-;V	Vik6;R'A ?]Rۤ $EZ<cHo !iϽ^#9 l̵x4mJ>,k 8aXk_92^DBiT8~	RԭjAH8z=Zq=W`}y eŕ?F..*0&o&0Lp;jQb, Cq7߂)4 QmU¹{v	"Ft0n[+Γ 0+-ӮeQIJ: 2|I8E?fww'~aKfmK{^vx .54!<*! >QRgOܼEo鎛{7g3.IfV[7,`VÊï-ӻ᠒wAFR 3O[5>R`|nƋ5Ły=}hZbXNT})$QJr w]FҲx}Pb~e+Ek#?9~ŝM;WaŻTl}OI`dW':MSL"1~[_hu{i?`tK9)KϹ'"کDM.%a
Cltc8%#i϶ڣMD#	l߻DVMD4xs .F|E8;Xd8 elLDC WvC
 G}
L$kD<+264hP'oKWN+ӯ<Qe`I˓Xnwbd
bI"NtDQʆE=~:q
Tio%4jW~7OHm)W5;i{<GhvgYE$>[7M`@޻!Klhư:ye"xy.CF@+թmBR}<Z݄BSSuOLliV~i +CN4~N@)%髸hRx4P6	^b4t08D$0:';@\t)P,hp <
~1$z*_}>U-F"<6봗:]o @a0 sاoϟ4vJOʎu{Dzr-wTZ&4`yj^ت
E#"'.σ@pBh3JOBg_υDͲ=ٺ$JA.J껪n"<r(VT'	*N` Q# \]go!ÙcؑvC#D#ۏ@+WǺXaCd*YW~Y<z_0ׯ^ݚnY" :̓M vQWAy`PMT#C{<<)YG~=7(ʓ\\h1Oy`ܺ:Cm<jusOEތkY3wt@&Q2	͟78$ bwǇC(7ibB0&dN)0xh#68ШLH1B#B BqqF.J2:I	^*XW=z+?OEHozKKoy2:!Pȵʩ
Oe3${^r@@]Z=3؉-
&xy==(=KvUZ57x֗%~D5Ư;Ry~`ppV<t??=]N&~
pL`/jk!y^ڑcM[7c~S?82,fvmO"BQVRog~KFel3ڼ|泞(bw&amC4x^e~->rFf^X`H2Z`ؔ~WO,O&>7:r!9k{. 2͈5V~AyUL3
!,][Юmkc_PJ(=iLݚS/j )_:ЦpRT
kc !  !~y'> uR}V-qE	CLx9WŰ
Q +k=C.GՁc1 B9u9`Ճ
~zTlt)?&]]}"` 
וWEc{Fe;ܬ]rW=AufMƦ:E֗e5EG~
K "~^cw X,Pvl,jw,ύWۆP
,?ݾeHhpɸz&l9+ ЂDCEyx-c7\
  }ifZe6u_egN\Ҡe}%X^_wK0kngv|

j{jW Uf<X N?(.U05w0S3Lj2*<ni,'Y±25Za!lKL yGIU#FH@<NThxj?Lzr)3WF	;V^AB+_T>ThWuwx+˵`5  lhP2B<@4@zbN6{\a7	ktΑ[}7laNzg=sUUm{Q[^N$|_
K ?A:hmpd9SSPH*[T
@A0qƙĲafo]0Z$ݼ#}zǵЪ:8s
SOPkM*w}
`V}%
(;4Un_.Y;9xw</}|sqoXlbjDP%,9fܻ2>"%ѹx,r||(%i=) pEgO%Ty)DhSqR뎚\Kf4l?2lqt{?72"Cw}哝u[Rm<0Qm> =:?e}HR#Ǘ;>%آ~0-;}~IT ذ:	o\ި<[ru{jж#!i~ܿyq % c.Q=3*iϖ%>׏Ւh}6W$x3Ÿ6 lp1MYyB	'</s9L_귣UqV4dª_p*zA0 s&v(
J. -cL4_#C>o25͹͹w\'i[ *NZWQ'nZfoŋz!-O~/4@0?.KSռ9s!=2= Pڐm_yg[0/mzүqc22<.SNƁ~jo-Oh_v.T} 4fQtR~q1Hg8,JoF@lY	aqרHXh^hx?m=Aq+1}Gʩ$ŜρgB*Շ9;뫻ș-8vp#'޽QEq Ml*_">I4JXQ"XC""U,)5ԂVM5GUS_ "XZi8l{ę!]fܛff﹨n5 ꬌ3e8+rC⴩7_=s0,+O 8,NcW{,:/E*t9KϥΫ9cmmmLct1@Ud<"ÇeFteck~~GY|w^vehQ-eQ#
xN
UWDX[m5vH8w$<3V >e
( Vo_@DD@>-oyKOvՓ>|m"t.ˣ!(oM#Q:h|\s@JnI$$@DD@ce)[)ky@U;5!j֓c """w.Hm-οND6"""ݳbL?X`=wkT KPwk ǫ'}DDD4PU3ćzjՉݷD.jOC GC(RRE1))zry(%BuuɎj_!""ZTp#ڶM
Y]CTA \5KHmBDD@CJ("UEizo-	 Tmw ""b12r(Zk0I0SCiE9[iJ_/  0Uۙ|kgނ;Wut!ͪ(HY{}OmE-La`ۊ yFDR-@E "P)@
QFo5خqɫ4ii>gƞ=нos+rm[vEi\F t';_|	|CTu=XAݳ\87c?o&{zЬ6H#G:׷]y߰vIWn_/80v.;ꆚy TOӏ: %	%)R{QZPDA$|~(tE!ZMi@@Z!!	B-	%ov3-Ix3-;s;glfU[Jaʉ
Bf)rQP  pfm&@FѭV1 ʯ2
e1q#BƇ	cFyy(a	
_IEب÷9nиNK2d.,dwu՚Z?J hn j Lj GP*?р`z=B]/SRe+Bá+Ub!򸲈Nd%qu8\
1A+0l0p+HCD<ǦOG.߻}X{rݔub`#W	 503g=-Q~0pW~aMp?|FN=Y8t1p-a'Rv OTPKuKWnX!ӧy
)y:*0-'Rp>͞zho=F&+yp4mBP (oo6~^W{RșN 
K4e߽'$QLYP<yc䛂!hҨ r%]XV+%?@iJHhn1[&Fv}V	,$#?	31jV8Q\=%K>!|hWT;CZrsbŒ.s\/èeV.\QeЮA9Hr-
F, <}q`,p%#'.
2F"͑r>j2z
QYncޖd]7; X=ϓzLb|3ݖCw0,f^Xz
Ǐ'+b::FO5	X-",f3*@ip!binV%9Ռe]*M
HyS- cLhsq9n?x^<zzl"R%Mٳ$SF1BH"ȎD :w<By%Pd,G1`
d јaS4(\0X<.DJF
G1hJ($ʐ)B"5QP+
-yn&g!=&,kF`h/0(h.
N 1C2= $	`̢Dޥ@0	TF՛5)@@32P!#	@7V:w%lr +x<ٺ8w;U˗pݗq<^nWoKo{
8@!W^ijb!<>. e>أ(Y9JOCT	GϞ¤Hp1 IkfQ΀NF~TL LuD2KUzlޫ4J	ȯ\?bh{xp. 0%} dڶdgfKW#%Sf,;/t$|&`&TBKTlO%qy9 opQFkNM<D>WՈ9qTp@>\'%ϡ=t
͕EUWJ97(ǍzTԖG+46I	{ &79X J(Nt_@vg\X7h4tӽy$r9%BC
 W/1-0
K$QaF&߾+s
^H`$LB;֜>Y.ƽQ ΉĔ)+W^KuC67Xvf/nܺ$I:M`|mK+ׯblX㔮܆՜vP8A4/PVy}AfL ?.}Y_&0<^5^BW \<{p!L_ee߅Ѫ-)ӷAvR^w>t[w}(۠%b$@Dʦwmň	Kl$/\`|G5 /	}ff$
ڹcs_5M#g31w
庈D}DQ4jQUETV*W9%vRe4ZZ& Ƃ2[|$b]%F
/[Lo$996 +|*hy+}Wr/
 ~['sIC~bƻSy4 .!T1o<BxZ7ŏ*18<Wب&$?K~'&zjW[WTm^* Tl# 
XҬ)0)M)f7?Eȍ͸}xy_0\ : n ?|uRݺZ(IDh+x\!pOobgmpCycҕ4PPQ1_P)G&1 "sbuj!y% Gd|/k5igy.kN1դP8)  `R8ˡqٲ2'k+s:Z6?q^McH\kb:uH|QpKtӷF~}q'>/$AƵqGEQA+$:"U0.'|Q$2Ptwl$x8;ׇOfE1=Zjf5oQM'|;r$$"BO[Ag%J`9Ic6F{c⷟g3@Adz^ըz"H!$iY
ݿ&	f$	a
ij4~>=Q6l#{ں߀wj 6ǔ/$
_E(@9ǿ@)G4rAZy=CO
!ff^)~z
SqcۖEO;-*)\)<Vȱa~
\ <k2'yJuoHnˎ{svw019#nm_e3xN,0!.r/E
s5`'7>2"=-'f&\y)*K;
rKI8
[ 9ȃ,*gKx#[Iiر*&xϿ%xdM 5X/cJTlƴm\+& v# 68q |CPfٌVoq4!~_8{>U5h.~~u
(VBh%|Y.Ǘ-i=FeetؖǒB	ƘX *2"	L4C297{bܿtsJrAS/BEwW;KUhÝ}4+]l9f@;x(po͓?{{wnWʜCz4u4OeZd-Ṛ6~=8
c.q^C{n(7Ǻ1Qk8t+ĿWT<JBhwD#P.O H?dʜ̓ZA``Xb87J;Cf\5*Biޚ޻Κ`r^\əM@UAo(SbqܹjBpcL.ċ*kj7$I!<AEJ1yMƥKWŉŒf͛b#TJdpkobnq(4?
R/Opp4ceQWl=p}H8*EL^sNZ&McwPti2 
5x~g|n~As\l2_ػ ʔ)M  Ε?=uk :sfn|9ԫ3;nթ㞚[ynmTLQ]b 6/W(ql0X$p%ͪ'-[7Z,uddU`qy5w?
yc;W֋y&E&<\1*LVOF#~ؿ]©ȸgݟ< !aO[?}xɽw:<~Qơehc2hvj~ҞrXngbhu`_gѰd(A唖i!̕'o֡H8ƙ_ Sp,5nb`
oC$W>ƈ2z}jj I2'|FRI so<@[`53zp<f|е`Facv"ʘMd%sĉzEo9*3[Td녫иNۭ
 h3[*aJB*/,%QfMnlI(9[Ùo5sSkB1qTg36MB,
 c1}T2#z#;+ͮ<"`kM20m 6_7TQ>Z쳵 	O2ETm8_~	N]Iǅ'qՙN*ux
VKnWkuGiƘZ$cf<w,&PYNCtP5 \)ٲn$MI`[zI^]b96W:
=zBմwPk}waĥplt̍Ȃ"Cw	p")IKΜ׌|~A͛Q
E{ꇞhP( 7Cfzb@[V3pP_?X>xJg8}y%ppw~0reJ fsδ)L] f} (meTa $[77CIJ&:FzZˤgrp ma֓
lQ-<W({Owu  TXQHn}Ъ4VlPbUQ$ HI.]:L8zGV1(Дx
Nq3bH)f c^ct
 x#f } `˚<:YS'"#&FXIܶO@7QJNvhW^֋1˕UocX@-Ս楑{5n}gУ%pq9?3@3_AA
u/QA$"?'L"EP	L4D(&:<ZQK2`hA[/\^\*`￬15%߮R%XcjR޼wq)wE%%_{DfT WѼ=!p֭(!{wʯ[=%Ǐi)j].젆sAPMwK(z{4ilgl T[J˶ڋgtՓQ$ѐ;v}-pٚ0j1}	;uOysxr"jЌsI4W5ǲ5F@~,Lۭ.[o^DD4ei[]%*U9*z.(1кEGYAJ"|9hHk89fbiɣ;!	^)P~GB]p : <ba J-]_,p8*Uoֶ}vtٮـwS'w O؎tz̽>0V}]h$SWA{^C"*!
&f8
bHTkS
ޣ^<g{;1}]=\JiTQdQ#/F"95D!*bw$OpkOw
(p}2w[whQ
!tfp8b+wu_35!WݔG:r1z̷^ 0*g۪04^}:/"19dlNI2g{F'=$Kç&cHCT[]7HY$?o= Vhu`RHIK0AbT3RY780|NKx3nqV`8@жNqv1 p ͢{Ma&<H1t/O\ i x60-z:9v,\нG}qH7[vKن-rঝ xj\xG}uo{9c#ו`!Ն`ʶlY܆9tѰI&Pњkr{<?a>0ؼ| 1?&ZEfk%fZp~b]+'%l `4iնT}/j~9BJQ߷wz '8hx.{ǃDCn4,?\l9R @t/ΚI틄ij'IͶFLW) @Ɠ(
N*ؗ_՗Pm"_.U@S/зoZhmg\>!;zFzj(|[]5ưhM4
&U)_!Tog_,	.RTpڗi1txuN3Up	}?pczQO^L'ǅp\uS::ԫY'zLpR?|^ӁLUgu-f14l޹X9H~T<84;g:VybܟN|p
A!cH{w/YKH})E2Iw!D| drjT}}}7jxݻw;$''h
Do 3ȅUfGFF*LGp<I4ŔshjH|7LjЈ);#vkÅsO
9@r4.o^eeī,ɼMO-}Ľ`DhP0A|h"2npIuAm_9 ,_D]/3k:sQgx2/thV/?u{qaO1svVu51;xy&(O&GO2jO8l͙A͙j0聝F=Z/P LJoڍجH)fF<  hѦ=\:%Vq_u JP7{I!}o ^ۺ3&(pvlM3`hs
)To(*7,> qiYn18s"J֭Ű@
F
|9eJʁDsp0JmÎ~:{oWeu	S>U"dQf0Gߗ>d%*1L2gO<Y_~EE%qjG
vD]|n=5.<i= ;wq-nSegPVˏ #} /69w||#=a8ERddlΞzH_?b bp =@|m[ABvG,=|d/ׯS:-aX	2P֑B
 )2dɅ<URGz5n/x\F}*^ct'].ƪ9ӱ( %h1b-mB㠌1&ZP[	%~w^HbT5PFUkI[Zi1-P}L&;907%{k}fee=|r40|4c`8<?`WOw6ED13333333˛V*M@sZ4
X9333*qMө
XS3333ZoF u9Q[,k䅨\U@QVѐ̬E o j HhnN{xgst$≈%QU
T8g#|iHfffV XAU9b<T1yO JSK :نɍhY\%K{v`yTRU/po/Sϙo9~A	IӾ1 G>E@dH9e(_<{<=c4$333y܆̼b́,?,>81"k0zgNػr؉\}Y3C?4333fE s``>0=;z L|+/Z[[9BDΚ2<!2z{-ki38w٬޴kZmDiTfff>р_'bf|fޯ=f%z?=3~/((cՓ*x&~iBnј̬ezEH[scʹϾgƿghmE@K$J|oź5ogva#?͟fГŌfwb'efffok}W|$ZT$[t){V>vm4&<"!QH=DLmD#233]| D+&FǾ}}Gw[ҽ
XEi]effF! 		'/MQߑ8܉*ǮwOъ5Ӑ̬xdD AB4R)$"moϞ\uOm[wp$iwҐ̬zn_9 R#H*% `hF?o'cz߁'@HC_%XiHfff @W0>(;71     IENDB`    f  PNG

   
IHDR     h   Y   	pHYs    od  IDATx^y.E*Z!'{_ӾzamLZ{[u184ErԇJR%Z(NSu)!q('N@~|&̙̜{?ә{^:373^    uzj*:r   F
Lr7Fv_OU}6Ѐhoobᅀuq?EG|>9\_C/(a-,*8p4 p)4 b'-ک(5SZDDH!G:hрGZl,ܡOd4W. .&s^] r4E}W*2: 6рG#e88	hрZl׹r68
 GN  455]"@zٰ3G?ų	T۴ײrhSyy>n[tq7(bgp_Z˛T&qFMutvv^pl{GÎ}p4\ؐ$v
7Xa}uz},ؗfx?Kq{W__ߕ/_	属 WpKhPNe1~,GMJuKq:Q[!an7iWx@8~<6G]}<_Iр!orEǣ.
Ac
;hcɞbg#ܑe>	3>oᱞ WpK󞀨8wz{{WNLL\Ή[8p4`c3t4	cGL3Y8mmm1vGCD͍up݅\hxNo9p4cIEW8"$>X<2vz,ho A/j2;wl{vqR_Ao8osdxV_ArLqFyvL
9(>x3Fs	c]>ޛ,7:yt.t,ʢ\_%,bd_)uBgԧC_BE-eq4\E-< Oc3O=ְ)Em澞 :){ui`'C_mH.2
{$Zl?U_0#_8J`D8/:R7#|ϝA{yu<NQG8%9p4:::VDs#d.>dam<Xp`%TwhlCx7DP|MYn^FDNW8p4h;!(GH;:ѐ7y8ruhȿɁQ^t΅\u"X'1'pv";m\Ui^Fݞ WoҁtBgtdhg1Re핼FIs2
[QhZ4s4hHߛuQѨxԑ!FY A4m]^N,͗{Xp`%hL
81EܛYv$-S񍰧rn;%XG"WCxQy;p4
fl7בx:q4]p4JH68ƕ
 G  ^>
R -SG4Gup<h8p4 
  "cZhрG
8p4p4h 8  `$vsr:եιh*\սĎ
: Gގ.N p/4                    ,y u	_z;Mʓtu_8s)pV"[aTY APE@j%.cH1!*?Fqb⯩_>7g0oK`Dُ{8#$͋۹_aB#d2ƈN1?ק)kAPV@
ID`755]BծƷy_XdPA'yL!r%Cbŵ`	9!	kv'KǔEh$I'FCRJ֙b6O-FfFR(+G]
v	QO|wz{ct%4<dF|R[z
WEbCq[|%znO*
8rգIhv>%8AU,֯,*~ޏ?ģztǟ(7@hT]Zdlۺ~2BDkZlS%\k],[<G GI
+ɰ	
yҨ|Qg;.T$(T7Lq}qUhѸ˳ <{G8A43jF5pۯ9
YN]hD(V$9s~Xh{-bQTwHc685/{p⬎\m'!8H*
am8vhpYnGC7Yy(新sVTKi?yKmoQywſ汖pɯ%"OGs---ˊDED;*"x9a%(&ӊKGC4O	+FXhu쵴+a'Lh^/	Pq=<6i~v6*Zh$1E

{}%+#9E'n;Vi/a
dhHR٧KGBhG
;x5Ď>uASO~s5tTI6_SJFw0j&y	?m}$B#ȅV?'@'}!1񃀛1m\n?3p4h{dHFRIhɠ楳{MgA ȅZF-b/#q68i$NB\	AAH =Rdx۹kqh@h}4Bi<[F]!mOŝp j.4䉦
gM?|=9z-\a^]BbSӵ\R(7Gp`;.BD721WMPwe/G#A*bNҮ1ȅqm&Gd0|:B
-&h@h
!G  B#;^&'1#Fh|^Ψc1gs	
9dPqGhleaz|Z<2-^	1j͋<_UWŅ䪓j-\*8β 4%
K4

[1z	K^Ia1h]/n(a|yOU'GOo9          r4    h     F     
    (        8    p4     G|                 p                   pɂp@{{%y^߯ۆ)BqiZ eWuc~P:z}h`sas>u5bK4"Yr9kl5p?9gJPf϶/08fQ#nl-g)_Pp}=;S?J.+eղM7ެ6NmU6ߤMNxu]A
K# 4AQO6"2k>Slr40\h_ԝ4%b\BhEp2w,o#+wRK\z1/(KkB2F0t<qu~DŬKj8+*2lb#j
F-r0"4h?烑&4|cm\&uk=~2-8ZY]S'3ݡnKjz`M7Ir0oIU'57U5ohLu!hCh@hEg!/G&4FQFBwGږ{ަG)K;ls}><M-WiNos.
Sdpii,㴮dvX
{dh,4nos7\H1Lhp!3"C+S'E8ѱ5<9&GyCdvB#*Fr%8Cf-(bFt#_lQ6jx|]'T(;gPw=jU[jj^8hQN^	
فmI+=J/s7ѰcYÑH*4q0EF0E"ٲ9i<Bqp4dc7AAiņEd<9U䎆E<h([x!HE<T_a
{WSC#kTe\(n#,Hr4l9aF9i9fhXGа'ޥCzz>/zzzK.;AxuݒwcsdeIl]uϴw:^mc%/G#mb$!EmqǨVFKɠ*gA.2rG'fH`HOl*$0֫hO(hX@F6d)4Ae򺧆;V*^rG~	
AA	F
dQGs0Ҋ130z٫ۻzۮC6yXh}F0aR<ix4wcO2_vdew4T&yGC,4Jѐ#:ʚavnk&V#kU傃_PNbA2h81"iۏNK]D>Puv
а)U'~{ؘ2\u9>%|Is[Hjmꆦf|JmGy]}m}(dIQcq
z
fG1w<iFT[jLB&J&4G#~YD=so(h*,0~ekvm p4Qhy)VXJrhS'w4AbrXҡx{GZRq ɠ
P5,Os4N*E:G~dW:q0+g{0EUZo&u?119楮x{P	B[p9^p^z_c          yzi         )fw$^     ,"NXZT.   AJǨE*Ϙ#[ZZ9u9^C   @x<H"oˎ$ۺ@xS$􃣔\^!    h;kj;e;u§K(;\˧˥0    ŠAKi8;.d    ubۯs_p{Ph    ɠ:;;oЮ_HbpٸU   p_BhI    0%G㸗    Y'钸N(漴     9qݴ    xzk                    'C
{    IENDB`      .  PNG

   
IHDR        p}l   	pHYs    od  .IDATx^}
}np-\8x!+ݙlq8_AZj߸
ʜ>$Erk)m^b[%r!R.%C1v"j}?-Lvnvwvgói4/            Ν;=lӵD?U?<Nrצtj=]aӾ8K{t75s;cƌdÀ:*i۳܇7Vu|dǺG-. *,4
   ,4hp8Tx5t4hрG4q&͛׏0Nm C   h%4tw4G88KWoGFрQ}H`g   
wc[i)OQto##Gqjj;t`4&\
.3􇳣A(=F|lNyAyXGwz:oS!γ}x@GGcC:/5/hP,[h)ǉ&)@np4hiX{hsK1I$l;wޔ)S.Q
j
7'$Ի;Z]Rm1iL&NN	<8p4h8ӬFZ?z{Pzi돂b4^!p\㫔ҧrc_h(Y>/"o'Y+_)?N>Khl@
ln8 S=ϭN輓
&'k@'bI PG{^ŅЗfRрG}6o=+nS~'@;(.X<7GFcsɏ?WMϘm18bי 8p4j4N?b^@kLC_sAhw:2P5J^a )|M8XGm
ٽt;}C2((1#ua;8,3H~d q{u4c&CʎJC>D A|/2˸mx pJ;q!!N5!=0qѽMuyn.\x>	Jm u-'7@.֩$];ΧNIq:Z;g/VFpw4I@`8^A"`0kv4AJ_28L=%
锩Qbee(p 
8\s;{'9Ie|Mw:X4}.لN^L?@:3N:{7xr4)?
CLƳLCNAH2	9,3Kư')9)*8sъϭ{Y%_L>m0NGoݫ9_c:JjrRK+:t4h;N;]=}G\^dXR/j^[i}R>[h?+eLBc򈓔I
GрQq*ܶ_ӧOX\Ǫu-'Aycຜ_7Wc0i?ΓGˌIGc4fYјѳV]Cw4l]\%eGB?;c0MqHʎ񹳣aw5^6:$eG\GfZ@-	   QX>	G8Uݞ>wTV
U a	   G
8-<}6
8p4jp4 8p4<vV   p4	:Is`g&uknI%ݔtp4hѨA 	     4                            D9p M
Em CC y@hx\!(O}F ͼIYw)m{hD5
8 
 ]F8u]hdn35p4hz^</рGp4BU{  !(bwk/
!
8p4h@h)4t h hрGC˯1ӱx-q])kWG&x,<$uߧ;YP8uBBB8GVA6Tv1PBƇup4
S0Dt̙x")pGg	㿈O
G};PwG}рQ׸͆Au8
u6g-8#=Nh?NѰ{i*kkhxn~48p
8cZbΜ9i LC_ 4h`|xPWG#8p4L+{iOԬ
s]F.u4$oj˸=\ܶgBhڬGC(q4w`z4ȸp]G=`

c$<	vou(J
@J89̴
)[ISϗOhSs>ؽ#5X{tuuM5H'_ 4h`|xP3GF1Gh.GCلoK	g;Ѩq.
sE:ܶg5:^'yH

hHRd__yL>ʆ
Q{Ѐ?F0 GCDޡʾ-h`cZ[*e5eG#iGY9ݓ2>T|G}9Hxрjz$N328u
]\I1>/pֶ}<+-hf#
 h``5r4 4 8p4L
'рᓸ:p4	G G G G
8p4h@hрG
 Ѐp4hрGF Ts|`8 n`S5 @h@h   @h@               @>;pү~̝;wjzj2vm^b{oT2 ϏtUrO:!A?E-v^hJQr޼y$ME¨)3gΜCBI~}<˘x۶q}r`-wmJN|u+?J0?7N~R3Ν;=tN"vSfMjĀ^^WE]&m>^-sr~b$ؐ:"6Fi{gqik7M"C*#rԺYC
]dbDT]dņYhP[Vv1bG<)bHS>|.g%l;1UሲJ-ZUd"6".Hj_?7 NXӼ
]dņG!_vЌc.48)bc?p?E u4};i⼔F7(cyU(GCtOYf0MF{;B)qSitۉ-*@F*2Li|ѸBA Y)Н ..PY1.BCpp4$4vJwآ Z [aLL*4
o>=5%oT;$TaGIh"C?]ROry?vgG#Я~bc&2尸dh]w4rȶTBx7;
EhEFF	
sFGcX{t)Yk $!Ng!2_FihGc%1}:BË	%ĝUDFu
waIev.^!!"NkXu.Ӕ强8x-4~M.M4PN[`l;"_:^7?YS`B.4|./yv]h=
/N0xf
!c#,!PTq,
]|]Aڿ\O.	Yq1X&umj"ND$)ǉ&)@n
|yWSӷ_菶Z "UKkO	SoGýr4$s?w7c
qRq45p4

}
k7,3]h^S#tIC`8~عyHd2qp2N7T'GCP?8GŽ8Ȕ	}v q"82FC9#"fmjN:1:Ly%b4t"E ""
UY[1|$6,!r>:viQxhl@
l
v6|lكapp_Ggq2"#ݗso+h؅{p4	
71c]V>gP1wa6qjʐ-<gmy`QʻhHlC(.f52;,GßC>9V(d.3:~yG\0d?d~
;}jʠxi(ku,La &^gFڰ{c]Cq8
w,6SX=;|nJh^>!e+{i,OGH0k:!e+&69R6uKބ`LiBfٰvgGhhAa
UT

GCX2N7$Щ9".$fd#^d qۨ1dV8 ;HHg\unCȵ Y'2Z^8܅F^hbC>^3TW;_@ًoh8`05Hqs4,
Y   NqS
nlj
nai    ,XhMK	ghPz6afB&q4    @b.<<51qrbkd__yL>B    H@tv4QMhPvie_:"4\q9rie_    vzӘIJ$-hR5B5W#L    @R?ƌ.j&yR(]
:$N%oj*         g5VGFU     3$     φG    ;5     ξM:3>J&ݒJE)٫+h                                    (roܕr{;(iL'ʇzS?%!ʉVZ *iJS!F
I;B(U?t:Fk'z\Q2
?yh1
J;Y%ߊFَF!gqU|Toņ(y3s@t~ZuQQU!}pUN ?V	Vu4lG`
{OU>D!x5"p~&!?9!cC|[ѐ#ǈS:S{

zx*&\I
|0
{
wQgyRzk*K`GCTp4d=+j8A~Ј
>`!xnN^-b*?g
{hEGc;1aq­
8Eoaf[4B7
chMGK)Uw'½ t-:
]d:u4,BfЎ=&ങ
ی~ICP{5Ď4B]=)Ɯ9s&Yq41X&פkhL"qǒ7PG#k]@fQm:A
Auro?Q:	hlc({4BqL̙3;(%$.F#AǳdPtq4t"FI
"c;´.ΰF55UwGC;Mhh})V4GC"(4pwq
s[{8ZрDՏ^
j2G)_jpjrѰWf&yh'<

o;
#"#0b'Ш.h4v'"s)hY'/݂ +Ѱ:ix V
+4<Oxߎ>R{5"5:Z0[p4

wYhpɻ(ʉ:	fv4l^B#ʠ9 4{çފM՜>T0fvo2"kӉLuht~/Bw4vop?Sm}9ҠOu!`Pw            Drس'FyǞNX܎yCam !?UT-\/0d]R_Ïam{ƯX#k&=jCyǒ r0ݹsN%!T>LÔ~ה]s\6Zbʅ}

Yhv=,0oO{[Ah%F_!4t/Ô>Lq'q%>uns

?&GC=0ee38tAbboϟ?F[[8:_\8aA,\lPZt^TM\aZ*4{&qV6·H!/ˉR㐾˚B
rKs>6*4Dd#~8Cևx8V17"vR!n>q<"_g X"4\z	C¾J`Zpr4إ`Ae_
t|\\W5)?sZvr4A`g@đ)΁oT_.y[e"Ԕ]hȽ-c${C\oeP	<◈ǥc"6)cWDL{]Bϗ'ȰQS,q\@o3q!q1!>*"ǘaJX9},*6 Y"׬M+rp/hxӉ'ETPrsy@QFE`h8#4\[o"4:H+rpژ\ұ|N}"*n15K䚵EQDoSz[C3nl",68ᅆ)Sgr<5ҹe9!A_${7U"Q|Oknʧ9H"44gOow\t1N%ݢIEnBç^hPOk[0Eq~HχPz3yQ|mћDi: h[WE)khÃceF"t4+d*mnuXi
ĽL9^e&60ȹPdA5A""ʻvK96g$)
t4m ~y"doE%N
?m
먺
Ea\G|ʸ)Bq.Rn)gvO'de)K6e"C?]v45*4nцڗA(.$2tft2V^H&MJ򈯵])7Khy
	<B1&cc寷ou4܅F1%xf\	fp!7oU.'hH0jB2mZے6u#Aqk{{ޅўvH:Y'HuΉ9	bΜ9쬴ǒ71Ϭq-Fױf&GCrY-[l(8>_p!%gMGąƮg&7V5&SDfur{5,6Jg8VCK
|rsSQޟq<3#>G?WYr4~FeQ8b̙Β>
S'Ύ|:Qf\Lm+?!Ο5k/sJ@16l	{}'klMjH~*4ROa;>{xGB#ldM)ͧ~.&}8A1"/$műe;.إ;ᅆYb4kIuG]L!4NDp%F#է._c
(Mt~b4%
g"|04sr۴&2h;ѨQښBc\gL>$;iA<=[ha^%1FhhЂNMLU"4b:J(;0'.7^fs4"B<-V^Oa%h8U])4dp~3XB!b]h*	
FAtWH 46L$88f$ؙFzx\[ [y	Bc[m
넚9]h#97LK`WB5K܋А%Y'[LsuL \Aei%Qwu3$~WѰh̿e
Gy#d}_&;8.^a\G+|;a[[H6SWNou}S5E`D
GTI"tn<;IV;(](Jhr4xVAwsS5uw[h1b:D:	ЁpYѰo/OXb4h >DUb//Clh[OrwSM_aG',1OTShbC!B             tkz ɺ@\X28v{bVKkܪrnC_RbBcl?oy91Ƣ {x^5!ضt7MڛGkn%᳟V9ZyMѵF׬\-]-Y2ZZBfCAe~LyvrS;^m
لFKeD|L㶈G?;דre%K%"quL3CSPIxumN>&f$%iU"{}Sv 4zϦ:-Vm$Nr44ak
#^mmm2M;晥C8Qr|&4tapyX.<3Ӷ^o>FkoVq7EnV\wC+K{VDs,f[^i]LE1ԡo 4<(}xx;i.O\\!RoW$bcSI%^@</c^!i_>xi	S}OsY:,0El%.4hoqnS)eg'
8Nħ)%Jhg2N7DՍ-8Oq)MďWDWBa"2 q"8O_"hv3 7?K7F˯>ZzͪhѲKz-_F5g~4cּ9ѴYQq4
ٚ+xVS6T>~ЃpvAk2f$*ҿ꺌)$K΂

s`Qt|Q |	
S0(	
s>D[_/#~%ogS;'gERA _鎆{;q[qdv% S9sL9.mg)M3s*;wpp\h\-',6Byx.*fQ+M3#MJ	η91bY Yvm`heќ#.c{:?8x/1mq4"=BhͶ9ذv?vGCu2/q+;*)fPE>O$PȟaGN776Y
`g,6BhpmvZG$0
Yu%Y%аؠQ`P
l]Y'1xV>&KD~l?ףmcuwB)}C\L9~>c4/4ņ`Z2i^~n:78*|Sׯ0?ǃ,DB

.69=Y4=Qhz3凿Qq|\GG;.qyF6w
%g8p(ѐ4R\ab4.x-#hTWhdn^)
S`jFFܭYbUˏD_CU>t0f[ȁQW~-WsYvt"f1z؀r>@bR~|vq"xZG߈/rBR41&Q(L4
HaEoės9~u4Bl;gΜ8*xDB1gL$~uWuFWML/ոYs~9s[w o|)JhH5gU@98XG#,,BŎH㸕xOJzxcj[VaUuo:a^hx}SW8F#BTztvGwn__3Y_13i3h
SYӎ^RxRiO'[,z~Ku}fAuJ~q"p	2A`K" ^і 

;+㩿MiFUWHb
VZ=g]1^zI56Hw4ʢ\%	F[_~ViSi.(R
hI:^'~fzkvoN"q*;.CayGN6S@jp>D`&k"2*	El'^}9            {fG㛒
    Ш0,S    @VPiG.4AX`g(jKep     ar10"1Ow9,"Z`	2Zf|N)Q:     g<9>A9r|qR>|O'favWP?l%H     Y
+mĩ|(
O'vq7}"F$>/lk     8T7IhlW9Tη6,*0:%dD҉@ƶf    .L
/`?Ԅe$bqg     $aS1xVcɛhubD:}@B     4,P):xj!48Sk     x\_˲'=DPL`     4꽋,1Cz    2'!J̳NN     ѢPb2h8,    TV    h                 eȍHTT    IENDB`       .  PNG

   
IHDR        p}l   	pHYs    od  .IDATx^}
}np-\8x!+ݙlq8_AZj߸
ʜ>$Erk)m^b[%r!R.%C1v"j}?-Lvnvwvgói4/            Ν;=lӵD?U?<Nrצtj=]aӾ8K{t75s;cƌdÀ:*i۳܇7Vu|dǺG-. *,4
   ,4hp8Tx5t4hрG4q&͛׏0Nm C   h%4tw4G88KWoGFрQ}H`g   
wc[i)OQto##Gqjj;t`4&\
.3􇳣A(=F|lNyAyXGwz:oS!γ}x@GGcC:/5/hP,[h)ǉ&)@np4hiX{hsK1I$l;wޔ)S.Q
j
7'$Ի;Z]Rm1iL&NN	<8p4h8ӬFZ?z{Pzi돂b4^!p\㫔ҧrc_h(Y>/"o'Y+_)?N>Khl@
ln8 S=ϭN輓
&'k@'bI PG{^ŅЗfRрG}6o=+nS~'@;(.X<7GFcsɏ?WMϘm18bי 8p4j4N?b^@kLC_sAhw:2P5J^a )|M8XGm
ٽt;}C2((1#ua;8,3H~d q{u4c&CʎJC>D A|/2˸mx pJ;q!!N5!=0qѽMuyn.\x>	Jm u-'7@.֩$];ΧNIq:Z;g/VFpw4I@`8^A"`0kv4AJ_28L=%
锩Qbee(p 
8\s;{'9Ie|Mw:X4}.لN^L?@:3N:{7xr4)?
CLƳLCNAH2	9,3Kư')9)*8sъϭ{Y%_L>m0NGoݫ9_c:JjrRK+:t4h;N;]=}G\^dXR/j^[i}R>[h?+eLBc򈓔I
GрQq*ܶ_ӧOX\Ǫu-'Aycຜ_7Wc0i?ΓGˌIGc4fYјѳV]Cw4l]\%eGB?;c0MqHʎ񹳣aw5^6:$eG\GfZ@-	   QX>	G8Uݞ>wTV
U a	   G
8-<}6
8p4jp4 8p4<vV   p4	:Is`g&uknI%ݔtp4hѨA 	     4                            D9p M
Em CC y@hx\!(O}F ͼIYw)m{hD5
8 
 ]F8u]hdn35p4hz^</рGp4BU{  !(bwk/
!
8p4h@h)4t h hрGC˯1ӱx-q])kWG&x,<$uߧ;YP8uBBB8GVA6Tv1PBƇup4
S0Dt̙x")pGg	㿈O
G};PwG}рQ׸͆Au8
u6g-8#=Nh?NѰ{i*kkhxn~48p
8cZbΜ9i LC_ 4h`|xPWG#8p4L+{iOԬ
s]F.u4$oj˸=\ܶgBhڬGC(q4w`z4ȸp]G=`

c$<	vou(J
@J89̴
)[ISϗOhSs>ؽ#5X{tuuM5H'_ 4h`|xP3GF1Gh.GCلoK	g;Ѩq.
sE:ܶg5:^'yH

hHRd__yL>ʆ
Q{Ѐ?F0 GCDޡʾ-h`cZ[*e5eG#iGY9ݓ2>T|G}9Hxрjz$N328u
]\I1>/pֶ}<+-hf#
 h``5r4 4 8p4L
'рᓸ:p4	G G G G
8p4h@hрG
 Ѐp4hрGF Ts|`8 n`S5 @h@h   @h@               @>;pү~̝;wjzj2vm^b{oT2 ϏtUrO:!A?E-v^hJQr޼y$ME¨)3gΜCBI~}<˘x۶q}r`-wmJN|u+?J0?7N~R3Ν;=tN"vSfMjĀ^^WE]&m>^-sr~b$ؐ:"6Fi{gqik7M"C*#rԺYC
]dbDT]dņYhP[Vv1bG<)bHS>|.g%l;1UሲJ-ZUd"6".Hj_?7 NXӼ
]dņG!_vЌc.48)bc?p?E u4};i⼔F7(cyU(GCtOYf0MF{;B)qSitۉ-*@F*2Li|ѸBA Y)Н ..PY1.BCpp4$4vJwآ Z [aLL*4
o>=5%oT;$TaGIh"C?]ROry?vgG#Я~bc&2尸dh]w4rȶTBx7;
EhEFF	
sFGcX{t)Yk $!Ng!2_FihGc%1}:BË	%ĝUDFu
waIev.^!!"NkXu.Ӕ强8x-4~M.M4PN[`l;"_:^7?YS`B.4|./yv]h=
/N0xf
!c#,!PTq,
]|]Aڿ\O.	Yq1X&umj"ND$)ǉ&)@n
|yWSӷ_菶Z "UKkO	SoGýr4$s?w7c
qRq45p4

}
k7,3]h^S#tIC`8~عyHd2qp2N7T'GCP?8GŽ8Ȕ	}v q"82FC9#"fmjN:1:Ly%b4t"E ""
UY[1|$6,!r>:viQxhl@
l
v6|lكapp_Ggq2"#ݗso+h؅{p4	
71c]V>gP1wa6qjʐ-<gmy`QʻhHlC(.f52;,GßC>9V(d.3:~yG\0d?d~
;}jʠxi(ku,La &^gFڰ{c]Cq8
w,6SX=;|nJh^>!e+{i,OGH0k:!e+&69R6uKބ`LiBfٰvgGhhAa
UT

GCX2N7$Щ9".$fd#^d qۨ1dV8 ;HHg\unCȵ Y'2Z^8܅F^hbC>^3TW;_@ًoh8`05Hqs4,
Y   NqS
nlj
nai    ,XhMK	ghPz6afB&q4    @b.<<51qrbkd__yL>B    H@tv4QMhPvie_:"4\q9rie_    vzӘIJ$-hR5B5W#L    @R?ƌ.j&yR(]
:$N%oj*         g5VGFU     3$     φG    ;5     ξM:3>J&ݒJE)٫+h                                    (roܕr{;(iL'ʇzS?%!ʉVZ *iJS!F
I;B(U?t:Fk'z\Q2
?yh1
J;Y%ߊFَF!gqU|Toņ(y3s@t~ZuQQU!}pUN ?V	Vu4lG`
{OU>D!x5"p~&!?9!cC|[ѐ#ǈS:S{

zx*&\I
|0
{
wQgyRzk*K`GCTp4d=+j8A~Ј
>`!xnN^-b*?g
{hEGc;1aq­
8Eoaf[4B7
chMGK)Uw'½ t-:
]d:u4,BfЎ=&ങ
ی~ICP{5Ď4B]=)Ɯ9s&Yq41X&פkhL"qǒ7PG#k]@fQm:A
Auro?Q:	hlc({4BqL̙3;(%$.F#AǳdPtq4t"FI
"c;´.ΰF55UwGC;Mhh})V4GC"(4pwq
s[{8ZрDՏ^
j2G)_jpjrѰWf&yh'<

o;
#"#0b'Ш.h4v'"s)hY'/݂ +Ѱ:ix V
+4<Oxߎ>R{5"5:Z0[p4

wYhpɻ(ʉ:	fv4l^B#ʠ9 4{çފM՜>T0fvo2"kӉLuht~/Bw4vop?Sm}9ҠOu!`Pw            Drس'FyǞNX܎yCam !?UT-\/0d]R_Ïam{ƯX#k&=jCyǒ r0ݹsN%!T>LÔ~ה]s\6Zbʅ}

Yhv=,0oO{[Ah%F_!4t/Ô>Lq'q%>uns

?&GC=0ee38tAbboϟ?F[[8:_\8aA,\lPZt^TM\aZ*4{&qV6·H!/ˉR㐾˚B
rKs>6*4Dd#~8Cևx8V17"vR!n>q<"_g X"4\z	C¾J`Zpr4إ`Ae_
t|\\W5)?sZvr4A`g@đ)΁oT_.y[e"Ԕ]hȽ-c${C\oeP	<◈ǥc"6)cWDL{]Bϗ'ȰQS,q\@o3q!q1!>*"ǘaJX9},*6 Y"׬M+rp/hxӉ'ETPrsy@QFE`h8#4\[o"4:H+rpژ\ұ|N}"*n15K䚵EQDoSz[C3nl",68ᅆ)Sgr<5ҹe9!A_${7U"Q|Oknʧ9H"44gOow\t1N%ݢIEnBç^hPOk[0Eq~HχPz3yQ|mћDi: h[WE)khÃceF"t4+d*mnuXi
ĽL9^e&60ȹPdA5A""ʻvK96g$)
t4m ~y"doE%N
?m
먺
Ea\G|ʸ)Bq.Rn)gvO'de)K6e"C?]v45*4nцڗA(.$2tft2V^H&MJ򈯵])7Khy
	<B1&cc寷ou4܅F1%xf\	fp!7oU.'hH0jB2mZے6u#Aqk{{ޅўvH:Y'HuΉ9	bΜ9쬴ǒ71Ϭq-Fױf&GCrY-[l(8>_p!%gMGąƮg&7V5&SDfur{5,6Jg8VCK
|rsSQޟq<3#>G?WYr4~FeQ8b̙Β>
S'Ύ|:Qf\Lm+?!Ο5k/sJ@16l	{}'klMjH~*4ROa;>{xGB#ldM)ͧ~.&}8A1"/$műe;.إ;ᅆYb4kIuG]L!4NDp%F#է._c
(Mt~b4%
g"|04sr۴&2h;ѨQښBc\gL>$;iA<=[ha^%1FhhЂNMLU"4b:J(;0'.7^fs4"B<-V^Oa%h8U])4dp~3XB!b]h*	
FAtWH 46L$88f$ؙFzx\[ [y	Bc[m
넚9]h#97LK`WB5K܋А%Y'[LsuL \Aei%Qwu3$~WѰh̿e
Gy#d}_&;8.^a\G+|;a[[H6SWNou}S5E`D
GTI"tn<;IV;(](Jhr4xVAwsS5uw[h1b:D:	ЁpYѰo/OXb4h >DUb//Clh[OrwSM_aG',1OTShbC!B             tkz ɺ@\X28v{bVKkܪrnC_RbBcl?oy91Ƣ {x^5!ضt7MڛGkn%᳟V9ZyMѵF׬\-]-Y2ZZBfCAe~LyvrS;^m
لFKeD|L㶈G?;דre%K%"quL3CSPIxumN>&f$%iU"{}Sv 4zϦ:-Vm$Nr44ak
#^mmm2M;晥C8Qr|&4tapyX.<3Ӷ^o>FkoVq7EnV\wC+K{VDs,f[^i]LE1ԡo 4<(}xx;i.O\\!RoW$bcSI%^@</c^!i_>xi	S}OsY:,0El%.4hoqnS)eg'
8Nħ)%Jhg2N7DՍ-8Oq)MďWDWBa"2 q"8O_"hv3 7?K7F˯>ZzͪhѲKz-_F5g~4cּ9ѴYQq4
ٚ+xVS6T>~ЃpvAk2f$*ҿ꺌)$K΂

s`Qt|Q |	
S0(	
s>D[_/#~%ogS;'gERA _鎆{;q[qdv% S9sL9.mg)M3s*;wpp\h\-',6Byx.*fQ+M3#MJ	η91bY Yvm`heќ#.c{:?8x/1mq4"=BhͶ9ذv?vGCu2/q+;*)fPE>O$PȟaGN776Y
`g,6BhpmvZG$0
Yu%Y%аؠQ`P
l]Y'1xV>&KD~l?ףmcuwB)}C\L9~>c4/4ņ`Z2i^~n:78*|Sׯ0?ǃ,DB

.69=Y4=Qhz3凿Qq|\GG;.qyF6w
%g8p(ѐ4R\ab4.x-#hTWhdn^)
S`jFFܭYbUˏD_CU>t0f[ȁQW~-WsYvt"f1z؀r>@bR~|vq"xZG߈/rBR41&Q(L4
HaEoės9~u4Bl;gΜ8*xDB1gL$~uWuFWML/ոYs~9s[w o|)JhH5gU@98XG#,,BŎH㸕xOJzxcj[VaUuo:a^hx}SW8F#BTztvGwn__3Y_13i3h
SYӎ^RxRiO'[,z~Ku}fAuJ~q"p	2A`K" ^і 

;+㩿MiFUWHb
VZ=g]1^zI56Hw4ʢ\%	F[_~ViSi.(R
hI:^'~fzkvoN"q*;.CayGN6S@jp>D`&k"2*	El'^}9            {fG㛒
    Ш0,S    @VPiG.4AX`g(jKep     ar10"1Ow9,"Z`	2Zf|N)Q:     g<9>A9r|qR>|O'favWP?l%H     Y
+mĩ|(
O'vq7}"F$>/lk     8T7IhlW9Tη6,*0:%dD҉@ƶf    .L
/`?Ԅe$bqg     $aS1xVcɛhubD:}@B     4,P):xj!48Sk     x\_˲'=DPL`     4꽋,1Cz    2'!J̳NN     ѢPb2h8,    TV    h                 eȍHTT    IENDB`       {   PNG

   
IHDR         a   BIDATx^1
 0O_Th@
$k/.>(Q#jX<$辙jUc(@!7C,    IENDB`   PNG

   
IHDR        T   	pHYs    od   PLTE   wwwkkkLLLKKKUUUGGG^^^DDDfffVVVlllTTT```NNNbbb>>>HHHWWWaaaCCCccceee]]]XXX[4W   tRNS ~8O  IDATx^ɲ Pَ ۙͯ?	"J/z:EpN}<k%1iyje
A
DbC54 [QW[hQYPDbeԍdPf%ݤƭ1rph 1np3@ܒx[c|T'a  L%ȩ@#]
5^iQv%rvo6}3
 rkORtb"!1902`BrڄwhwP7Ts6EI6a?܁.`hu+>;JщĢfл#rqMI7	?FHIQE*IUB!AI>@'}    IENDB`      
  PNG

   
IHDR      j   V   	pHYs    od  PLTE    { z      ~~~Ŀ                     Ŀ¿                {   8/      ;0   80:/    x   8/    x?590   :0 { {   ;0    { {   ;/ {  y       ;0??7/ w z:1 {;/:/;09391 z    z z    {;/;/;/ { {?/ z    :/<1 y {;/;2 y    {;0uuuc̊   tRNS ```@@xXXx8HHǇ׏p8 @X߀`p8(`0ߏϏ(ϗxx00 x  p燀׷(Xχ8P@pH@pHXH P8(dJ  IDATx^wܸ/əѨZZ-ɖ˺ƽm_oloz8@ G(VNN.@|G<H{5dEU}k7ա=:SL,u?|q+3Ȋ}'G${wBe@'TOV~ea	B	/jY}%lddom [BH"RV['X_ؚj6E/~!HGֿ̒c:,/EʭЬ{R<=`g	0ORi~ N cdZK$Bj>fxz"Zdj}@&DŨ s!G.EVI")x("ቐ3@waO>2D("Uo%YeE@M&
P0Яj֥΀PD"dt
<t

~h@O2}h/(.
J
PM	lB-0ףL߅L7602!kjv2FdM}Z)eh{gbSVtmҰIXl%󹢌	'O_inmkS
{:vt_'U)T=H2HUOT^ϵ%<|^̮*5vBdZ[?ABܔI6L"RI$lUT&R+-~ T<Tin~%r=E4z.yc,@0ɳȁIJ^tȳ<ZZʴyk~=?<,LDRPDL"5w=iuIAuiNmk} h!&CLU{0WKd/r	1'W4u)
1)I:$bNN&hsvZgEBa}䢅@be^㒺
Y5
ykՐizh{Y/ܧާu_VE3dSt)iH)$OWt2Ke802	R&SI3Un{;B&Tͱ-JS<lp`dH!S&Eyo@2	ۻ^	ԧQРF`\c90J 9Dm"0CJ͌a{'C D6]H~\h	&L)B&PXyٶ|Jf'oa= (PE7(mL*%'߆g4֦jθ_*',\'(
{fOFge5ĝC2!uM=T&LOݕ$6{F(i{6ۺگԥ&`ĸSc;Jڞh!qZ&YQMRٽNo&jSe/QWǏy5JWTЮLi\z:Hn5,(\;Pdjͅȫ }^
ӽE2GLLz%fթ-sٗL~(^Mb2ÑeeLIC9$%#wau(c9xu&p	-1-K{_ճ!JUt(T䴈,v<D9w ]./ JlOrLbFw:W<wP&MCfG2*K#LD"ԡat<]$=>+ɺ{<9$wC&#I&"ssXɊ$S|PyPڞEE	 ԝ7sL),]}'&)9O~cK-fTgwx6,6gݫD/sSʭ-M?IIFEQŊ껢)c("m2WQ17c|co117c|c|co117c|co117c|co117c|co'QK    IENDB`       
  PNG

   
IHDR      j   V   	pHYs    od  PLTE    { z      ~~~Ŀ                     Ŀ¿                {   8/      ;0   80:/    x   8/    x?590   :0 { {   ;0    { {   ;/ {  y       ;0??7/ w z:1 {;/:/;09391 z    z z    {;/;/;/ { {?/ z    :/<1 y {;/;2 y    {;0uuuc̊   tRNS ```@@xXXx8HHǇ׏p8 @X߀`p8(`0ߏϏ(ϗxx00 x  p燀׷(Xχ8P@pH@pHXH P8(dJ  IDATx^wܸ/əѨZZ-ɖ˺ƽm_oloz8@ G(VNN.@|G<H{5dEU}k7ա=:SL,u?|q+3Ȋ}'G${wBe@'TOV~ea	B	/jY}%lddom [BH"RV['X_ؚj6E/~!HGֿ̒c:,/EʭЬ{R<=`g	0ORi~ N cdZK$Bj>fxz"Zdj}@&DŨ s!G.EVI")x("ቐ3@waO>2D("Uo%YeE@M&
P0Яj֥΀PD"dt
<t

~h@O2}h/(.
J
PM	lB-0ףL߅L7602!kjv2FdM}Z)eh{gbSVtmҰIXl%󹢌	'O_inmkS
{:vt_'U)T=H2HUOT^ϵ%<|^̮*5vBdZ[?ABܔI6L"RI$lUT&R+-~ T<Tin~%r=E4z.yc,@0ɳȁIJ^tȳ<ZZʴyk~=?<,LDRPDL"5w=iuIAuiNmk} h!&CLU{0WKd/r	1'W4u)
1)I:$bNN&hsvZgEBa}䢅@be^㒺
Y5
ykՐizh{Y/ܧާu_VE3dSt)iH)$OWt2Ke802	R&SI3Un{;B&Tͱ-JS<lp`dH!S&Eyo@2	ۻ^	ԧQРF`\c90J 9Dm"0CJ͌a{'C D6]H~\h	&L)B&PXyٶ|Jf'oa= (PE7(mL*%'߆g4֦jθ_*',\'(
{fOFge5ĝC2!uM=T&LOݕ$6{F(i{6ۺگԥ&`ĸSc;Jڞh!qZ&YQMRٽNo&jSe/QWǏy5JWTЮLi\z:Hn5,(\;Pdjͅȫ }^
ӽE2GLLz%fթ-sٗL~(^Mb2ÑeeLIC9$%#wau(c9xu&p	-1-K{_ճ!JUt(T䴈,v<D9w ]./ JlOrLbFw:W<wP&MCfG2*K#LD"ԡat<]$=>+ɺ{<9$wC&#I&"ssXɊ$S|PyPڞEE	 ԝ7sL),]}'&)9O~cK-fTgwx6,6gݫD/sSʭ-M?IIFEQŊ껢)c("m2WQ17c|co117c|c|co117c|co117c|co117c|co'QK    IENDB`       +   GIF89a       !    ,       D ; U   GIF89a      !NETSCAPE2.0   !	2  ,       D !2  ,       L ;       U   GIF89a   n!NETSCAPE2.0   !	2  ,       D !2  ,       L ;       0   GIF89a     !   ,       [  ;    S  GIF89a     \\\???   fff&&&                                             !NETSCAPE2.0   !XMP DataXMP<?xpacket begin="﻿" id="W5M0MpCehiHzreSzNTczkc9d"?> <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.3-c011 66.145661, 2012/02/06-14:56:27        "> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmpMM:OriginalDocumentID="xmp.did:01801174072068118083C0EDDE0D01CC" xmpMM:DocumentID="xmp.did:F43E69FAA51A11E2A76AC2C9B94580DF" xmpMM:InstanceID="xmp.iid:F43E69F9A51A11E2A76AC2C9B94580DF" xmp:CreatorTool="Adobe Photoshop CS6 (Macintosh)"> <xmpMM:DerivedFrom stRef:instanceID="xmp.iid:FD7B6AA73E206811822A9FE890860311" stRef:documentID="xmp.did:01801174072068118083C0EDDE0D01CC"/> </rdf:Description> </rdf:RDF> </x:xmpmeta> <?xpacket end="r"?>~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"! 

	  !	
  ,         v $dihl뾰FA8 [`zpD4Bf( j( nZ(kH![uqk~"		qk.! !	
  ,         u $dihl뾰 <0H`h 
1 -3
@
9'1N-E48{$}#wy(		u! !	
  ,         u $dihl뾰 AQ( @p
B$0c2A[ng]`j
pAvrUx\>o#		('&! !	
  ,         v $dihl뾰E0,P 
A( #R9A[ng@p9J\n[JL67#

'&%! !	
  ,         u $dihl뾰 $pHP 1 -3
7 
B٧1N"0|#~"xz$

! !	
  ,         u $dihl뾰BB2[)4Bj*  nZZ>B6
Cpkb

pk~)! !	
  ,         t $dihlp, $s*T
U`q,
ANGu

n (mP G

GCn/! !	
  ,         t $dihlp,tmB@@EȮl"98T+:B!,  9]]
az2a8 

 y{}1qsv x6_,! !	
  ,         s $dihlp,tmx|	 1p-ʀ@\a~[qtZm].0
`   {} 

 2rtwy7P(! !	
  ,         s $dihlp,tmx|7Cg@ D#rJ	 @bUtZf[ aZ@ @z|~r1qs vx7O,! !	
  ,         s $dihlp,tmqc
N7
"$9`+mzE (9@0% .@{}1rtwy7p(! !
  ,         s $dihlp7Ȫ <fh"0f	J  [@ pnB \0\-a		LL[},! ;   GIF89a  w ɸڷ֑aaa达ݽ000Ƭppp着ooo왙Ѐ^^^|||>>>kkkuuugggeeecccMMMnnn򧧧qqqHHHYYYKKK<<<Ώrrr999                        !NETSCAPE2.0   ! w ,       w
-7917"wp!^= #w
"wG6$24#3ǌ((Í% & w 
w*+) w ς/@4! ! w ,   
  :w wH,w*b1!1&
_Ce425t2w ! w ,   
  ;w.'	86ow
\Tw
J36F0!N?@A ! w ,     8wwlB!7ws  wr8S1%wKDRmO;2= ! w , 	    Bw:X%!GZ
w	w*+)N?w	W2<0MEQ'0d! ! w ,      8((ww04LqYwv
O;	w4!9P[w
 ! w ,    
  <w3wwhRig)H:@	1wkAw w0w / ! w ,    
  <wA@?I0F>QwJ
w	I5w4 &   ! w ,      9w=u;a>Kw	D5>wPwS8jcL$w7!
1 ! w ,     Cww	9wBME6"w<	V2<` #w	Cwnf5$8:U] ;  e  <?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<svg version="1.1" id="4cc98fab-5c88-424b-91b9-d840a05735b7_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="0 0 20 20" style="enable-background:new 0 0 20 20;" xml:space="preserve">
<style type="text/css">
	.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#C0C0C0;}
</style>
<g>
	<g>
		<path class="st0" d="M10,0L4,6h12L10,0z M10,20l6-6H4L10,20z M8,10c0,1.1,0.9,2,2,2s2-0.9,2-2s-0.9-2-2-2S8,8.9,8,10z"/>
	</g>
</g>
</svg>
         <?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<svg version="1.1" id="_x31__1_" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="20" height="20"
	 viewBox="0 0 20 20" style="enable-background:new 0 0 20 20;" xml:space="preserve">
<path id="_x31_" d="M10,0L4,6h12L10,0z M12,10c0-1.1-0.9-2-2-2s-2,0.9-2,2s0.9,2,2,2S12,11.1,12,10z"/>
</svg>
       o  <?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<svg version="1.1" id="e32ad255-882e-4b94-9d87-9f889fd4c58f_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="20" height="20"
	 viewBox="0 0 20 20" style="enable-background:new 0 0 20 20;" xml:space="preserve">
<style type="text/css">
	.st0{fill-rule:evenodd;clip-rule:evenodd;}
</style>
<g>
	<g>
		<path class="st0" d="M10,0L4,6h12L10,0z M10,20l6-6H4L10,20z M8,10c0,1.1,0.9,2,2,2s2-0.9,2-2s-0.9-2-2-2S8,8.9,8,10z"/>
	</g>
</g>
</svg>
       <?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<svg version="1.1" id="_x31__1_" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="20" height="20"
	 viewBox="0 0 20 20" style="enable-background:new 0 0 20 20;" xml:space="preserve">
<path id="_x31_" d="M10,20l6-6H4L10,20z M8,10c0,1.1,0.9,2,2,2s2-0.9,2-2s-0.9-2-2-2S8,8.9,8,10z"/>
</svg>
    <?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
<svg version="1.1" id="Layer" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
	 viewBox="0 0 12 12" style="enable-background:new 0 0 12 12;" xml:space="preserve">
<style type="text/css">
	.st0{fill-rule:evenodd;clip-rule:evenodd;fill:#020202;}
	.st1{opacity:0.5;fill-rule:evenodd;clip-rule:evenodd;fill:#020202;}
</style>
<path id="_x32_" class="st0" d="M9,11v-1h1V9h1v2H9z M10,6h1v2h-1V6z M10,4H9V3h2v2h-1V4z M6,10h2v1H6V10z M6,3h2v1H6V3z M5,4H4v1H3
	V3h2V4z M4,8H3V6h1V8z M4,10h1v1H3V9h1V10z"/>
<polygon id="_x31_" class="st1" points="1,1 1,8 2,8 2,2 8,2 8,1 "/>
</svg>
	 <?xml version="1.0" encoding="utf-8"?>

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="538" height="1020">
<g transform="translate(0, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black0 { fill:#727272;}
	.Green0 { fill:#404040;}
	.Red0 { fill:#585858;}
</style>
<path class="Red0" d="M16,16H6v-2h10V16z M16,18H6v2h10V18z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black0" d="M26,26v3c0,0.6-0.4,1-1,1H1c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1h24c0.6,0,1,0.4,1,1v7h-2V2H2v26h22v-2H26z&#xD;&#xA;	 M20,6H6v2h14V6z M16,10H6v2h10V10z M16,22H6v2h10V22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Green0" d="M31,10H19c-0.6,0-1,0.4-1,1v12c0,0.6,0.4,1,1,1h12c0.6,0,1-0.4,1-1V11C32,10.4,31.6,10,31,10z M30,18h-4v4h-2&#xD;&#xA;	v-4h-4v-2h4v-4h2v4h4V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 510)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black0_white { fill:#FFFFFF;}
	.Green0_white { fill:#FFFFFF;}
	.Red0_white { fill:#FFFFFF;}
</style>
<path class="Red0_white" d="M16,16H6v-2h10V16z M16,18H6v2h10V18z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black0_white" d="M26,26v3c0,0.6-0.4,1-1,1H1c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1h24c0.6,0,1,0.4,1,1v7h-2V2H2v26h22v-2H26z&#xD;&#xA;	 M20,6H6v2h14V6z M16,10H6v2h10V10z M16,22H6v2h10V22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Green0_white" d="M31,10H19c-0.6,0-1,0.4-1,1v12c0,0.6,0.4,1,1,1h12c0.6,0,1-0.4,1-1V11C32,10.4,31.6,10,31,10z M30,18h-4v4h-2&#xD;&#xA;	v-4h-4v-2h4v-4h2v4h4V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black1 { fill:#727272;}
	.Blue1 { fill:#757575;}
</style>
<path class="Black1" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue1" d="M20,16H10v2h10V16z M24,20H6v2h18V20z M20,24H10v2h10V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 646)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black1_white { fill:#FFFFFF;}
	.Blue1_white { fill:#FFFFFF;}
</style>
<path class="Black1_white" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue1_white" d="M20,16H10v2h10V16z M24,20H6v2h18V20z M20,24H10v2h10V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black2 { fill:#727272;}
	.Blue2 { fill:#757575;}
</style>
<path class="Black2" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue2" d="M14,16H4v2h10V16z M20,20H4v2h16V20z M14,24H4v2h10V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 816)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black2_white { fill:#FFFFFF;}
	.Blue2_white { fill:#FFFFFF;}
</style>
<path class="Black2_white" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue2_white" d="M14,16H4v2h10V16z M20,20H4v2h16V20z M14,24H4v2h10V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black3 { fill:#727272;}
	.Blue3 { fill:#757575;}
</style>
<path class="Black3" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue3" d="M26,16H16v2h10V16z M26,20H10v2h16V20z M26,24H16v2h10V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 612)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black3_white { fill:#FFFFFF;}
	.Blue3_white { fill:#FFFFFF;}
</style>
<path class="Black3_white" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue3_white" d="M26,16H16v2h10V16z M26,20H10v2h16V20z M26,24H16v2h10V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black4 { fill:#727272;}
</style>
<path id="Align_Center_1_" class="Black4" d="M28,8H4V6h24V8z M24,10H8v2h16V10z M28,14H4v2h24V14z M28,22H4v2h24V22z M24,18H8v2h16&#xD;&#xA;	V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 612)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black4_white { fill:#FFFFFF;}
</style>
<path id="Align_Center_1_" class="Black4_white" d="M28,8H4V6h24V8z M24,10H8v2h16V10z M28,14H4v2h24V14z M28,22H4v2h24V22z M24,18H8v2h16&#xD;&#xA;	V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow5 { fill:#979797;}
	.Black5 { fill:#727272;}
</style>
<path class="Black5" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M26,6H4V4h22V6z M26,10H4V8h22V10z M26,22h-6v-2h6V22z M26,26h-6v-2h6V26z M10,22H4v-2h6V22z M10,26H4v-2h6V26z M26,14H4v-2h22V14z&#xD;&#xA;	 M26,18H4v-2h22V18z" xmlns="http://www.w3.org/2000/svg" />
<rect x="12" y="20" class="Yellow5" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 612)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow5_white { fill:#FFFFFF;}
	.Black5_white { fill:#FFFFFF;}
</style>
<path class="Black5_white" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M26,6H4V4h22V6z M26,10H4V8h22V10z M26,22h-6v-2h6V22z M26,26h-6v-2h6V26z M10,22H4v-2h6V22z M10,26H4v-2h6V26z M26,14H4v-2h22V14z&#xD;&#xA;	 M26,18H4v-2h22V18z" xmlns="http://www.w3.org/2000/svg" />
<rect x="12" y="20" class="Yellow5_white" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow6 { fill:#979797;}
	.Black6 { fill:#727272;}
</style>
<path class="Black6" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M26,6H4V4h22V6z M26,10H4V8h22V10z M26,14H4v-2h22V14z M26,18H4v-2h22V18z M26,22H12v-2h14V22z M26,26H12v-2h14V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="4" y="20" class="Yellow6" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 544)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow6_white { fill:#FFFFFF;}
	.Black6_white { fill:#FFFFFF;}
</style>
<path class="Black6_white" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M26,6H4V4h22V6z M26,10H4V8h22V10z M26,14H4v-2h22V14z M26,18H4v-2h22V18z M26,22H12v-2h14V22z M26,26H12v-2h14V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="4" y="20" class="Yellow6_white" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow7 { fill:#979797;}
	.Black7 { fill:#727272;}
</style>
<path class="Black7" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M26,6H4V4h22V6z M26,10H4V8h22V10z M26,14H4v-2h22V14z M26,18H4v-2h22V18z M18,22H4v-2h14V22z M18,26H4v-2h14V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="20" y="20" class="Yellow7" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 544)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow7_white { fill:#FFFFFF;}
	.Black7_white { fill:#FFFFFF;}
</style>
<path class="Black7_white" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M26,6H4V4h22V6z M26,10H4V8h22V10z M26,14H4v-2h22V14z M26,18H4v-2h22V18z M18,22H4v-2h14V22z M18,26H4v-2h14V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="20" y="20" class="Yellow7_white" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow8 { fill:#979797;}
	.Black8 { fill:#727272;}
</style>
<path class="Black8" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M26,6H4V4h22V6z M26,10H4V8h22V10z M26,14h-6v-2h6V14z M26,18h-6v-2h6V18z M10,14H4v-2h6V14z M10,18H4v-2h6V18z M26,22H4v-2h22V22z&#xD;&#xA;	 M26,26H4v-2h22V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="12" y="12" class="Yellow8" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 544)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow8_white { fill:#FFFFFF;}
	.Black8_white { fill:#FFFFFF;}
</style>
<path class="Black8_white" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M26,6H4V4h22V6z M26,10H4V8h22V10z M26,14h-6v-2h6V14z M26,18h-6v-2h6V18z M10,14H4v-2h6V14z M10,18H4v-2h6V18z M26,22H4v-2h22V22z&#xD;&#xA;	 M26,26H4v-2h22V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="12" y="12" class="Yellow8_white" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow9 { fill:#979797;}
	.Black9 { fill:#727272;}
</style>
<path class="Black9" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M26,6H4V4h22V6z M26,10H4V8h22V10z M26,14H12v-2h14V14z M26,18H12v-2h14V18z M26,22H4v-2h22V22z M26,26H4v-2h22V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="4" y="12" class="Yellow9" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 544)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow9_white { fill:#FFFFFF;}
	.Black9_white { fill:#FFFFFF;}
</style>
<path class="Black9_white" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M26,6H4V4h22V6z M26,10H4V8h22V10z M26,14H12v-2h14V14z M26,18H12v-2h14V18z M26,22H4v-2h22V22z M26,26H4v-2h22V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="4" y="12" class="Yellow9_white" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow10 { fill:#979797;}
	.Black10 { fill:#727272;}
</style>
<path class="Black10" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M26,6H4V4h22V6z M26,10H4V8h22V10z M18,14H4v-2h14V14z M18,18H4v-2h14V18z M26,22H4v-2h22V22z M26,26H4v-2h22V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="20" y="12" class="Yellow10" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 544)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow10_white { fill:#FFFFFF;}
	.Black10_white { fill:#FFFFFF;}
</style>
<path class="Black10_white" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M26,6H4V4h22V6z M26,10H4V8h22V10z M18,14H4v-2h14V14z M18,18H4v-2h14V18z M26,22H4v-2h22V22z M26,26H4v-2h22V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="20" y="12" class="Yellow10_white" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow11 { fill:#979797;}
	.Black11 { fill:#727272;}
</style>
<path class="Black11" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M10,6H4V4h6V6z M10,10H4V8h6V10z M26,6h-6V4h6V6z M26,10h-6V8h6V10z M26,14H4v-2h22V14z M26,18H4v-2h22V18z M26,22H4v-2h22V22z&#xD;&#xA;	 M26,26H4v-2h22V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="12" y="4" class="Yellow11" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 544)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow11_white { fill:#FFFFFF;}
	.Black11_white { fill:#FFFFFF;}
</style>
<path class="Black11_white" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M10,6H4V4h6V6z M10,10H4V8h6V10z M26,6h-6V4h6V6z M26,10h-6V8h6V10z M26,14H4v-2h22V14z M26,18H4v-2h22V18z M26,22H4v-2h22V22z&#xD;&#xA;	 M26,26H4v-2h22V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="12" y="4" class="Yellow11_white" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow12 { fill:#979797;}
	.Black12 { fill:#727272;}
</style>
<path class="Black12" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M26,6H12V4h14V6z M26,10H12V8h14V10z M26,14H4v-2h22V14z M26,18H4v-2h22V18z M26,22H4v-2h22V22z M26,26H4v-2h22V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="4" y="4" class="Yellow12" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 544)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow12_white { fill:#FFFFFF;}
	.Black12_white { fill:#FFFFFF;}
</style>
<path class="Black12_white" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M26,6H12V4h14V6z M26,10H12V8h14V10z M26,14H4v-2h22V14z M26,18H4v-2h22V18z M26,22H4v-2h22V22z M26,26H4v-2h22V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="4" y="4" class="Yellow12_white" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow13 { fill:#979797;}
	.Black13 { fill:#727272;}
</style>
<path class="Black13" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M18,6H4V4h14V6z M18,10H4V8h14V10z M26,14H4v-2h22V14z M26,18H4v-2h22V18z M26,22H4v-2h22V22z M26,26H4v-2h22V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="20" y="4" class="Yellow13" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 544)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow13_white { fill:#FFFFFF;}
	.Black13_white { fill:#FFFFFF;}
</style>
<path class="Black13_white" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M18,6H4V4h14V6z M18,10H4V8h14V10z M26,14H4v-2h22V14z M26,18H4v-2h22V18z M26,22H4v-2h22V22z M26,26H4v-2h22V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="20" y="4" class="Yellow13_white" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black14 { fill:#727272;}
</style>
<path id="Align_Justify_2_" class="Black14" d="M28,8H4V6h24V8z M28,10H4v2h24V10z M28,14H4v2h24V14z M28,22H4v2h24V22z M28,18H4v2h24&#xD;&#xA;	V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 544)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black14_white { fill:#FFFFFF;}
</style>
<path id="Align_Justify_2_" class="Black14_white" d="M28,8H4V6h24V8z M28,10H4v2h24V10z M28,14H4v2h24V14z M28,22H4v2h24V22z M28,18H4v2h24&#xD;&#xA;	V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black15 { fill:#727272;}
</style>
<path id="Align_Left_2_" class="Black15" d="M28,8H4V6h24V8z M20,10H4v2h16V10z M28,14H4v2h24V14z M28,22H4v2h24V22z M20,18H4v2h16V18&#xD;&#xA;	z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 544)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black15_white { fill:#FFFFFF;}
</style>
<path id="Align_Left_2_" class="Black15_white" d="M28,8H4V6h24V8z M20,10H4v2h16V10z M28,14H4v2h24V14z M28,22H4v2h24V22z M20,18H4v2h16V18&#xD;&#xA;	z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black16 { fill:#727272;}
	.Blue16 { fill:#757575;}
</style>
<path class="Black16" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue16" d="M20,10H10v2h10V10z M24,14H6v2h18V14z M20,18H10v2h10V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 544)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black16_white { fill:#FFFFFF;}
	.Blue16_white { fill:#FFFFFF;}
</style>
<path class="Black16_white" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue16_white" d="M20,10H10v2h10V10z M24,14H6v2h18V14z M20,18H10v2h10V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black17 { fill:#727272;}
	.Blue17 { fill:#757575;}
</style>
<path class="Black17" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue17" d="M14,10H4v2h10V10z M20,14H4v2h16V14z M14,18H4v2h10V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 748)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black17_white { fill:#FFFFFF;}
	.Blue17_white { fill:#FFFFFF;}
</style>
<path class="Black17_white" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue17_white" d="M14,10H4v2h10V10z M20,14H4v2h16V14z M14,18H4v2h10V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black18 { fill:#727272;}
	.Blue18 { fill:#757575;}
</style>
<path class="Black18" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue18" d="M26,10H16v2h10V10z M26,14H10v2h16V14z M26,18H16v2h10V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 544)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black18_white { fill:#FFFFFF;}
	.Blue18_white { fill:#FFFFFF;}
</style>
<path class="Black18_white" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue18_white" d="M26,10H16v2h10V10z M26,14H10v2h16V14z M26,18H16v2h10V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black19 { fill:#727272;}
</style>
<path id="Align_Right_2_" class="Black19" d="M28,8H4V6h24V8z M28,10H12v2h16V10z M28,14H4v2h24V14z M28,22H4v2h24V22z M28,18H12v2h16&#xD;&#xA;	V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 544)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black19_white { fill:#FFFFFF;}
</style>
<path id="Align_Right_2_" class="Black19_white" d="M28,8H4V6h24V8z M28,10H12v2h16V10z M28,14H4v2h24V14z M28,22H4v2h24V22z M28,18H12v2h16&#xD;&#xA;	V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black20 { fill:#727272;}
	.Blue20 { fill:#757575;}
</style>
<path class="Black20" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue20" d="M20,4H10v2h10V4z M24,8H6v2h18V8z M20,12H10v2h10V12z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 544)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black20_white { fill:#FFFFFF;}
	.Blue20_white { fill:#FFFFFF;}
</style>
<path class="Black20_white" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue20_white" d="M20,4H10v2h10V4z M24,8H6v2h18V8z M20,12H10v2h10V12z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black21 { fill:#727272;}
	.Blue21 { fill:#757575;}
</style>
<path class="Black21" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue21" d="M14,4H4v2h10V4z M20,8H4v2h16V8z M14,12H4v2h10V12z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 578)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black21_white { fill:#FFFFFF;}
	.Blue21_white { fill:#FFFFFF;}
</style>
<path class="Black21_white" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue21_white" d="M14,4H4v2h10V4z M20,8H4v2h16V8z M14,12H4v2h10V12z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black22 { fill:#727272;}
	.Blue22 { fill:#757575;}
</style>
<path class="Black22" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue22" d="M26,4H16v2h10V4z M26,8H10v2h16V8z M26,12H16v2h10V12z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 850)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black22_white { fill:#FFFFFF;}
	.Blue22_white { fill:#FFFFFF;}
</style>
<path class="Black22_white" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue22_white" d="M26,4H16v2h10V4z M26,8H10v2h16V8z M26,12H16v2h10V12z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black23 { fill:#727272;}
	.Blue23 { fill:#757575;}
</style>
<path class="Black23" d="M19,0H7C6.4,0,6,0.4,6,1v5.6l2-2V2h10v5c0,0.6,0.4,1,1,1h5v14H8v-1.1c-0.7-0.1-1.4-0.5-1.9-1L6,19.8V23&#xD;&#xA;	c0,0.6,0.4,1,1,1h18c0.6,0,1-0.4,1-1V7L19,0z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black23" d="M10.8,19.2c-1.1,1.1-2.9,1.1-4,0l-4-4c-1.1-1.1-1.1-2.9,0-4L8,6l8,8L10.8,19.2z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue23" d="M14,10c2.2,0,4,3.6,4,8c0,1.1,0.9,2,2,2c1.1,0,2-0.9,2-2C22,13.6,18.4,10,14,10z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 714)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black23_white { fill:#FFFFFF;}
	.Blue23_white { fill:#FFFFFF;}
</style>
<path class="Black23_white" d="M19,0H7C6.4,0,6,0.4,6,1v5.6l2-2V2h10v5c0,0.6,0.4,1,1,1h5v14H8v-1.1c-0.7-0.1-1.4-0.5-1.9-1L6,19.8V23&#xD;&#xA;	c0,0.6,0.4,1,1,1h18c0.6,0,1-0.4,1-1V7L19,0z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black23_white" d="M10.8,19.2c-1.1,1.1-2.9,1.1-4,0l-4-4c-1.1-1.1-1.1-2.9,0-4L8,6l8,8L10.8,19.2z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue23_white" d="M14,10c2.2,0,4,3.6,4,8c0,1.1,0.9,2,2,2c1.1,0,2-0.9,2-2C22,13.6,18.4,10,14,10z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black24 { fill:#727272;}
</style>
<path class="Black24" d="M8,26V4h8c2.5,0,4.3,0.5,5.7,1.4c1.3,0.9,2,2.2,2,3.8c0,1.2-0.4,2.2-1.2,3.1c-0.8,0.9-1.8,1.5-3.1,1.9v0.1&#xD;&#xA;	c1.6,0.2,2.8,0.8,3.8,1.7c0.9,1,1.4,2.1,1.4,3.5c0,2-0.7,3.6-2.2,4.8C20.9,25.4,19,26,16.5,26H8z M13,7.7v5.2h2.2&#xD;&#xA;	c1,0,1.8-0.2,2.4-0.7c0.6-0.5,0.9-1.2,0.9-2c0-1.6-1.2-2.4-3.6-2.4H13z M13,16.6v5.8h2.7c1.1,0,2-0.3,2.7-0.8c0.6-0.5,1-1.3,1-2.2&#xD;&#xA;	c0-0.9-0.3-1.6-1-2.1c-0.6-0.5-1.5-0.8-2.7-0.8H13z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 918)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black24_white { fill:#FFFFFF;}
</style>
<path class="Black24_white" d="M8,26V4h8c2.5,0,4.3,0.5,5.7,1.4c1.3,0.9,2,2.2,2,3.8c0,1.2-0.4,2.2-1.2,3.1c-0.8,0.9-1.8,1.5-3.1,1.9v0.1&#xD;&#xA;	c1.6,0.2,2.8,0.8,3.8,1.7c0.9,1,1.4,2.1,1.4,3.5c0,2-0.7,3.6-2.2,4.8C20.9,25.4,19,26,16.5,26H8z M13,7.7v5.2h2.2&#xD;&#xA;	c1,0,1.8-0.2,2.4-0.7c0.6-0.5,0.9-1.2,0.9-2c0-1.6-1.2-2.4-3.6-2.4H13z M13,16.6v5.8h2.7c1.1,0,2-0.3,2.7-0.8c0.6-0.5,1-1.3,1-2.2&#xD;&#xA;	c0-0.9-0.3-1.6-1-2.1c-0.6-0.5-1.5-0.8-2.7-0.8H13z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black25 { fill:#727272;}
	.Red25 { fill:#585858;}
</style>
<path class="Black25" d="M27,4H7C6.5,4,6,4.5,6,5v24c0,0.5,0.5,1,1,1h20c0.5,0,1-0.5,1-1V5C28,4.5,27.5,4,27,4z M26,28H8V6h18V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red25" d="M17,2h-6c-0.5,0-1,0.5-1,1v15l4-4l4,4V3C18,2.5,17.5,2,17,2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 680)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black25_white { fill:#FFFFFF;}
	.Red25_white { fill:#FFFFFF;}
</style>
<path class="Black25_white" d="M27,4H7C6.5,4,6,4.5,6,5v24c0,0.5,0.5,1,1,1h20c0.5,0,1-0.5,1-1V5C28,4.5,27.5,4,27,4z M26,28H8V6h18V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red25_white" d="M17,2h-6c-0.5,0-1,0.5-1,1v15l4-4l4,4V3C18,2.5,17.5,2,17,2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black26 { fill:#727272;}
	.st026 {opacity:0.5;}
</style>
<g class="st026" xmlns="http://www.w3.org/2000/svg">
	<path class="Black26" d="M2,2h2v2H2V2z M6,4h2V2H6V4z M10,4h2V2h-2V4z M14,4h2V2h-2V4z M18,4h2V2h-2V4z M22,4h2V2h-2V4z M26,2v2h2V2&#xD;&#xA;		H26z M26,8h2V6h-2V8z M26,12h2v-2h-2V12z M26,16h2v-2h-2V16z M26,20h2v-2h-2V20z M26,24h2v-2h-2V24z M2,24h2v-2H2V24z M2,20h2v-2H2&#xD;&#xA;		V20z M2,16h2v-2H2V16z M2,12h2v-2H2V12z M2,8h2V6H2V8z M14,8h2V6h-2V8z M14,12h2v-2h-2V12z M14,16h2v-2h-2V16z M14,20h2v-2h-2V20z&#xD;&#xA;		 M14,24h2v-2h-2V24z M18,16h2v-2h-2V16z M22,16h2v-2h-2V16z M10,16h2v-2h-2V16z M6,16h2v-2H6V16z" />
</g>
<rect x="2" y="26" class="Black26" width="26" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 850)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black26_white { fill:#FFFFFF;}
	.st026_white {opacity:0.5;}
</style>
<g class="st026_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black26_white" d="M2,2h2v2H2V2z M6,4h2V2H6V4z M10,4h2V2h-2V4z M14,4h2V2h-2V4z M18,4h2V2h-2V4z M22,4h2V2h-2V4z M26,2v2h2V2&#xD;&#xA;		H26z M26,8h2V6h-2V8z M26,12h2v-2h-2V12z M26,16h2v-2h-2V16z M26,20h2v-2h-2V20z M26,24h2v-2h-2V24z M2,24h2v-2H2V24z M2,20h2v-2H2&#xD;&#xA;		V20z M2,16h2v-2H2V16z M2,12h2v-2H2V12z M2,8h2V6H2V8z M14,8h2V6h-2V8z M14,12h2v-2h-2V12z M14,16h2v-2h-2V16z M14,20h2v-2h-2V20z&#xD;&#xA;		 M14,24h2v-2h-2V24z M18,16h2v-2h-2V16z M22,16h2v-2h-2V16z M10,16h2v-2h-2V16z M6,16h2v-2H6V16z" />
</g>
<rect x="2" y="26" class="Black26_white" width="26" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black27 { fill:#727272;}
	.st027 {opacity:0.5;}
</style>
<g class="st027" xmlns="http://www.w3.org/2000/svg">
	<path class="Black27" d="M2,2h2v2H2V2z M6,4h2V2H6V4z M10,4h2V2h-2V4z M14,4h2V2h-2V4z M18,4h2V2h-2V4z M22,4h2V2h-2V4z M26,2v2h2V2&#xD;&#xA;		H26z M26,8h2V6h-2V8z M26,12h2v-2h-2V12z M26,20h2v-2h-2V20z M26,24h2v-2h-2V24z M26,28h2v-2h-2V28z M22,28h2v-2h-2V28z M18,28h2&#xD;&#xA;		v-2h-2V28z M14,28h2v-2h-2V28z M10,28h2v-2h-2V28z M6,28h2v-2H6V28z M2,28h2v-2H2V28z M2,24h2v-2H2V24z M2,20h2v-2H2V20z M2,12h2&#xD;&#xA;		v-2H2V12z M2,8h2V6H2V8z M14,8h2V6h-2V8z M14,12h2v-2h-2V12z M14,20h2v-2h-2V20z M14,24h2v-2h-2V24z" />
</g>
<polygon class="Black27" points="14,14 2,14 2,16 14,16 16,16 28,16 28,14 16,14 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 952)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black27_white { fill:#FFFFFF;}
	.st027_white {opacity:0.5;}
</style>
<g class="st027_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black27_white" d="M2,2h2v2H2V2z M6,4h2V2H6V4z M10,4h2V2h-2V4z M14,4h2V2h-2V4z M18,4h2V2h-2V4z M22,4h2V2h-2V4z M26,2v2h2V2&#xD;&#xA;		H26z M26,8h2V6h-2V8z M26,12h2v-2h-2V12z M26,20h2v-2h-2V20z M26,24h2v-2h-2V24z M26,28h2v-2h-2V28z M22,28h2v-2h-2V28z M18,28h2&#xD;&#xA;		v-2h-2V28z M14,28h2v-2h-2V28z M10,28h2v-2h-2V28z M6,28h2v-2H6V28z M2,28h2v-2H2V28z M2,24h2v-2H2V24z M2,20h2v-2H2V20z M2,12h2&#xD;&#xA;		v-2H2V12z M2,8h2V6H2V8z M14,8h2V6h-2V8z M14,12h2v-2h-2V12z M14,20h2v-2h-2V20z M14,24h2v-2h-2V24z" />
</g>
<polygon class="Black27_white" points="14,14 2,14 2,16 14,16 16,16 28,16 28,14 16,14 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black28 { fill:#727272;}
	.st028 {opacity:0.5;}
</style>
<g class="st028" xmlns="http://www.w3.org/2000/svg">
	<path class="Black28" d="M2,2h2v2H2V2z M6,4h2V2H6V4z M10,4h2V2h-2V4z M18,4h2V2h-2V4z M22,4h2V2h-2V4z M26,2v2h2V2H26z M26,8h2V6h-2&#xD;&#xA;		V8z M26,12h2v-2h-2V12z M26,16h2v-2h-2V16z M26,20h2v-2h-2V20z M26,24h2v-2h-2V24z M26,28h2v-2h-2V28z M22,28h2v-2h-2V28z M18,28h2&#xD;&#xA;		v-2h-2V28z M10,28h2v-2h-2V28z M6,28h2v-2H6V28z M2,28h2v-2H2V28z M2,24h2v-2H2V24z M2,20h2v-2H2V20z M2,16h2v-2H2V16z M2,12h2v-2&#xD;&#xA;		H2V12z M2,8h2V6H2V8z M18,16h2v-2h-2V16z M22,16h2v-2h-2V16z M10,16h2v-2h-2V16z M6,16h2v-2H6V16z" />
</g>
<polygon class="Black28" points="16,16 16,14 16,10 16,2 14,2 14,10 14,14 14,16 14,28 16,28 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 918)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black28_white { fill:#FFFFFF;}
	.st028_white {opacity:0.5;}
</style>
<g class="st028_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black28_white" d="M2,2h2v2H2V2z M6,4h2V2H6V4z M10,4h2V2h-2V4z M18,4h2V2h-2V4z M22,4h2V2h-2V4z M26,2v2h2V2H26z M26,8h2V6h-2&#xD;&#xA;		V8z M26,12h2v-2h-2V12z M26,16h2v-2h-2V16z M26,20h2v-2h-2V20z M26,24h2v-2h-2V24z M26,28h2v-2h-2V28z M22,28h2v-2h-2V28z M18,28h2&#xD;&#xA;		v-2h-2V28z M10,28h2v-2h-2V28z M6,28h2v-2H6V28z M2,28h2v-2H2V28z M2,24h2v-2H2V24z M2,20h2v-2H2V20z M2,16h2v-2H2V16z M2,12h2v-2&#xD;&#xA;		H2V12z M2,8h2V6H2V8z M18,16h2v-2h-2V16z M22,16h2v-2h-2V16z M10,16h2v-2h-2V16z M6,16h2v-2H6V16z" />
</g>
<polygon class="Black28_white" points="16,16 16,14 16,10 16,2 14,2 14,10 14,14 14,16 14,28 16,28 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black29 { fill:#727272;}
	.st029 {opacity:0.5;}
</style>
<g class="st029" xmlns="http://www.w3.org/2000/svg">
	<path class="Black29" d="M6,4h2V2H6V4z M10,4h2V2h-2V4z M14,4h2V2h-2V4z M18,4h2V2h-2V4z M22,4h2V2h-2V4z M26,2v2h2V2H26z M26,8h2V6&#xD;&#xA;		h-2V8z M26,12h2v-2h-2V12z M26,16h2v-2h-2V16z M26,20h2v-2h-2V20z M26,24h2v-2h-2V24z M26,28h2v-2h-2V28z M22,28h2v-2h-2V28z&#xD;&#xA;		 M18,28h2v-2h-2V28z M14,28h2v-2h-2V28z M10,28h2v-2h-2V28z M6,28h2v-2H6V28z M14,8h2V6h-2V8z M14,12h2v-2h-2V12z M14,16h2v-2h-2&#xD;&#xA;		V16z M14,20h2v-2h-2V20z M14,24h2v-2h-2V24z M18,16h2v-2h-2V16z M22,16h2v-2h-2V16z M10,16h2v-2h-2V16z M6,16h2v-2H6V16z" />
</g>
<rect x="2" y="2" class="Black29" width="2" height="26" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 918)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black29_white { fill:#FFFFFF;}
	.st029_white {opacity:0.5;}
</style>
<g class="st029_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black29_white" d="M6,4h2V2H6V4z M10,4h2V2h-2V4z M14,4h2V2h-2V4z M18,4h2V2h-2V4z M22,4h2V2h-2V4z M26,2v2h2V2H26z M26,8h2V6&#xD;&#xA;		h-2V8z M26,12h2v-2h-2V12z M26,16h2v-2h-2V16z M26,20h2v-2h-2V20z M26,24h2v-2h-2V24z M26,28h2v-2h-2V28z M22,28h2v-2h-2V28z&#xD;&#xA;		 M18,28h2v-2h-2V28z M14,28h2v-2h-2V28z M10,28h2v-2h-2V28z M6,28h2v-2H6V28z M14,8h2V6h-2V8z M14,12h2v-2h-2V12z M14,16h2v-2h-2&#xD;&#xA;		V16z M14,20h2v-2h-2V20z M14,24h2v-2h-2V24z M18,16h2v-2h-2V16z M22,16h2v-2h-2V16z M10,16h2v-2h-2V16z M6,16h2v-2H6V16z" />
</g>
<rect x="2" y="2" class="Black29_white" width="2" height="26" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black30 { fill:#727272;}
	.st030 {opacity:0.5;}
</style>
<g class="st030" xmlns="http://www.w3.org/2000/svg">
	<path class="Black30" d="M2,2h2v2H2V2z M6,4h2V2H6V4z M10,4h2V2h-2V4z M14,4h2V2h-2V4z M18,4h2V2h-2V4z M22,4h2V2h-2V4z M26,2v2h2V2&#xD;&#xA;		H26z M26,8h2V6h-2V8z M26,12h2v-2h-2V12z M26,16h2v-2h-2V16z M26,20h2v-2h-2V20z M26,24h2v-2h-2V24z M26,28h2v-2h-2V28z M22,28h2&#xD;&#xA;		v-2h-2V28z M18,28h2v-2h-2V28z M14,28h2v-2h-2V28z M10,28h2v-2h-2V28z M6,28h2v-2H6V28z M2,28h2v-2H2V28z M2,24h2v-2H2V24z M2,20h2&#xD;&#xA;		v-2H2V20z M2,16h2v-2H2V16z M2,12h2v-2H2V12z M2,8h2V6H2V8z M14,8h2V6h-2V8z M14,12h2v-2h-2V12z M14,16h2v-2h-2V16z M14,20h2v-2h-2&#xD;&#xA;		V20z M14,24h2v-2h-2V24z M18,16h2v-2h-2V16z M22,16h2v-2h-2V16z M10,16h2v-2h-2V16z M6,16h2v-2H6V16z" />
</g>
</g>

<g transform="translate(340, 952)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black30_white { fill:#FFFFFF;}
	.st030_white {opacity:0.5;}
</style>
<g class="st030_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black30_white" d="M2,2h2v2H2V2z M6,4h2V2H6V4z M10,4h2V2h-2V4z M14,4h2V2h-2V4z M18,4h2V2h-2V4z M22,4h2V2h-2V4z M26,2v2h2V2&#xD;&#xA;		H26z M26,8h2V6h-2V8z M26,12h2v-2h-2V12z M26,16h2v-2h-2V16z M26,20h2v-2h-2V20z M26,24h2v-2h-2V24z M26,28h2v-2h-2V28z M22,28h2&#xD;&#xA;		v-2h-2V28z M18,28h2v-2h-2V28z M14,28h2v-2h-2V28z M10,28h2v-2h-2V28z M6,28h2v-2H6V28z M2,28h2v-2H2V28z M2,24h2v-2H2V24z M2,20h2&#xD;&#xA;		v-2H2V20z M2,16h2v-2H2V16z M2,12h2v-2H2V12z M2,8h2V6H2V8z M14,8h2V6h-2V8z M14,12h2v-2h-2V12z M14,16h2v-2h-2V16z M14,20h2v-2h-2&#xD;&#xA;		V20z M14,24h2v-2h-2V24z M18,16h2v-2h-2V16z M22,16h2v-2h-2V16z M10,16h2v-2h-2V16z M6,16h2v-2H6V16z" />
</g>
</g>

<g transform="translate(374, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black31 { fill:#727272;}
	.st031 {opacity:0.5;}
</style>
<g class="st031" xmlns="http://www.w3.org/2000/svg">
	<path class="Black31" d="M2,2h2v2H2V2z M6,4h2V2H6V4z M10,4h2V2h-2V4z M14,4h2V2h-2V4z M18,4h2V2h-2V4z M22,4h2V2h-2V4z M22,28h2v-2&#xD;&#xA;		h-2V28z M18,28h2v-2h-2V28z M14,28h2v-2h-2V28z M10,28h2v-2h-2V28z M6,28h2v-2H6V28z M2,28h2v-2H2V28z M2,24h2v-2H2V24z M2,20h2v-2&#xD;&#xA;		H2V20z M2,16h2v-2H2V16z M2,12h2v-2H2V12z M2,8h2V6H2V8z M14,8h2V6h-2V8z M14,12h2v-2h-2V12z M14,16h2v-2h-2V16z M14,20h2v-2h-2V20&#xD;&#xA;		z M14,24h2v-2h-2V24z M18,16h2v-2h-2V16z M22,16h2v-2h-2V16z M10,16h2v-2h-2V16z M6,16h2v-2H6V16z" />
</g>
<rect x="26" y="2" class="Black31" width="2" height="26" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 952)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black31_white { fill:#FFFFFF;}
	.st031_white {opacity:0.5;}
</style>
<g class="st031_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black31_white" d="M2,2h2v2H2V2z M6,4h2V2H6V4z M10,4h2V2h-2V4z M14,4h2V2h-2V4z M18,4h2V2h-2V4z M22,4h2V2h-2V4z M22,28h2v-2&#xD;&#xA;		h-2V28z M18,28h2v-2h-2V28z M14,28h2v-2h-2V28z M10,28h2v-2h-2V28z M6,28h2v-2H6V28z M2,28h2v-2H2V28z M2,24h2v-2H2V24z M2,20h2v-2&#xD;&#xA;		H2V20z M2,16h2v-2H2V16z M2,12h2v-2H2V12z M2,8h2V6H2V8z M14,8h2V6h-2V8z M14,12h2v-2h-2V12z M14,16h2v-2h-2V16z M14,20h2v-2h-2V20&#xD;&#xA;		z M14,24h2v-2h-2V24z M18,16h2v-2h-2V16z M22,16h2v-2h-2V16z M10,16h2v-2h-2V16z M6,16h2v-2H6V16z" />
</g>
<rect x="26" y="2" class="Black31_white" width="2" height="26" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black32 { fill:#727272;}
</style>
<path class="Black32" d="M2,2v2v24h26V16v-2V4V2H2z M14,4v10H4V4H14z M4,26V16h10v10H4z M26,26H16V16h10V26z M26,14H16V4h10V14z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 714)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black32_white { fill:#FFFFFF;}
</style>
<path class="Black32_white" d="M2,2v2v24h26V16v-2V4V2H2z M14,4v10H4V4H14z M4,26V16h10v10H4z M26,26H16V16h10V26z M26,14H16V4h10V14z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black33 {fill:#727272;}
	.st033 {opacity:0.5;}
</style>
<g class="st033" xmlns="http://www.w3.org/2000/svg">
	<path class="Black33" d="M2,2h2v2H2V2z M6,4h2V2H6V4z M10,4h2V2h-2V4z M18,4h2V2h-2V4z M22,4h2V2h-2V4z M26,2v2h2V2H26z M26,8h2V6h-2&#xD;&#xA;		V8z M26,12h2v-2h-2V12z M26,20h2v-2h-2V20z M26,24h2v-2h-2V24z M26,28h2v-2h-2V28z M22,28h2v-2h-2V28z M18,28h2v-2h-2V28z M10,28h2&#xD;&#xA;		v-2h-2V28z M6,28h2v-2H6V28z M2,28h2v-2H2V28z M2,24h2v-2H2V24z M2,20h2v-2H2V20z M2,12h2v-2H2V12z M2,8h2V6H2V8z" />
</g>
<polygon class="Black33" points="28,14 16,14 16,2 14,2 14,14 2,14 2,16 14,16 14,28 16,28 16,16 28,16 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 884)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black33_white { fill:#FFFFFF;}
	.st033_white {opacity:0.5;}
</style>
<g class="st033_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black33_white" d="M2,2h2v2H2V2z M6,4h2V2H6V4z M10,4h2V2h-2V4z M18,4h2V2h-2V4z M22,4h2V2h-2V4z M26,2v2h2V2H26z M26,8h2V6h-2&#xD;&#xA;		V8z M26,12h2v-2h-2V12z M26,20h2v-2h-2V20z M26,24h2v-2h-2V24z M26,28h2v-2h-2V28z M22,28h2v-2h-2V28z M18,28h2v-2h-2V28z M10,28h2&#xD;&#xA;		v-2h-2V28z M6,28h2v-2H6V28z M2,28h2v-2H2V28z M2,24h2v-2H2V24z M2,20h2v-2H2V20z M2,12h2v-2H2V12z M2,8h2V6H2V8z" />
</g>
<polygon class="Black33_white" points="28,14 16,14 16,2 14,2 14,14 2,14 2,16 14,16 14,28 16,28 16,16 28,16 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black34 {fill:#727272;}
	.st034 {opacity:0.5;}
</style>
<g class="st034" xmlns="http://www.w3.org/2000/svg">
	<path class="Black34" d="M14,8h2V6h-2V8z M14,12h2v-2h-2V12z M14,16h2v-2h-2V16z M14,20h2v-2h-2V20z M14,24h2v-2h-2V24z M18,16h2v-2&#xD;&#xA;		h-2V16z M22,16h2v-2h-2V16z M10,16h2v-2h-2V16z M6,16h2v-2H6V16z" />
</g>
<path class="Black34" d="M2,2v26h26V2H2z M26,26H4V4h22V26z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 884)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black34_white { fill:#FFFFFF;}
	.st034_white {opacity:0.5;}
</style>
<g class="st034_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black34_white" d="M14,8h2V6h-2V8z M14,12h2v-2h-2V12z M14,16h2v-2h-2V16z M14,20h2v-2h-2V20z M14,24h2v-2h-2V24z M18,16h2v-2&#xD;&#xA;		h-2V16z M22,16h2v-2h-2V16z M10,16h2v-2h-2V16z M6,16h2v-2H6V16z" />
</g>
<path class="Black34_white" d="M2,2v26h26V2H2z M26,26H4V4h22V26z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black35 {fill:#727272;}
	.st035 {opacity:0.5;}
</style>
<g class="st035" xmlns="http://www.w3.org/2000/svg">
	<path class="Black35" d="M26,8h2V6h-2V8z M26,12h2v-2h-2V12z M26,16h2v-2h-2V16z M26,20h2v-2h-2V20z M26,24h2v-2h-2V24z M26,28h2v-2&#xD;&#xA;		h-2V28z M22,28h2v-2h-2V28z M18,28h2v-2h-2V28z M14,28h2v-2h-2V28z M10,28h2v-2h-2V28z M6,28h2v-2H6V28z M2,28h2v-2H2V28z M2,24h2&#xD;&#xA;		v-2H2V24z M2,20h2v-2H2V20z M2,16h2v-2H2V16z M2,12h2v-2H2V12z M2,8h2V6H2V8z M14,8h2V6h-2V8z M14,12h2v-2h-2V12z M14,16h2v-2h-2&#xD;&#xA;		V16z M14,20h2v-2h-2V20z M14,24h2v-2h-2V24z M18,16h2v-2h-2V16z M22,16h2v-2h-2V16z M10,16h2v-2h-2V16z M6,16h2v-2H6V16z" />
</g>
<rect x="2" y="2" class="Black35" width="26" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 680)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black35_white { fill:#FFFFFF;}
	.st035_white {opacity:0.5;}
</style>
<g class="st035_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black35_white" d="M26,8h2V6h-2V8z M26,12h2v-2h-2V12z M26,16h2v-2h-2V16z M26,20h2v-2h-2V20z M26,24h2v-2h-2V24z M26,28h2v-2&#xD;&#xA;		h-2V28z M22,28h2v-2h-2V28z M18,28h2v-2h-2V28z M14,28h2v-2h-2V28z M10,28h2v-2h-2V28z M6,28h2v-2H6V28z M2,28h2v-2H2V28z M2,24h2&#xD;&#xA;		v-2H2V24z M2,20h2v-2H2V20z M2,16h2v-2H2V16z M2,12h2v-2H2V12z M2,8h2V6H2V8z M14,8h2V6h-2V8z M14,12h2v-2h-2V12z M14,16h2v-2h-2&#xD;&#xA;		V16z M14,20h2v-2h-2V20z M14,24h2v-2h-2V24z M18,16h2v-2h-2V16z M22,16h2v-2h-2V16z M10,16h2v-2h-2V16z M6,16h2v-2H6V16z" />
</g>
<rect x="2" y="2" class="Black35_white" width="26" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st036 {fill:#727272;}
	.st136 {opacity:0.5;fill:#727272;}
	.st236 {opacity:0.75;fill:#727272;}
</style>
<path id="layer_3_" class="st036" d="M18,25.5c4,4-2.5-2.5,1.5,1.5c0,5.4-6.5,5-8.5,5C15.5,27.5,14.3,25.5,18,25.5z" xmlns="http://www.w3.org/2000/svg" />
<path id="layer_2_" class="st136" d="M31,14L31,14c-0.4-0.4-1.5-1.5-3,0l-9,9l3,3l9-9C32.5,15.5,31.4,14.4,31,14z" xmlns="http://www.w3.org/2000/svg" />
<path id="layer_1_" class="st236" d="M19,23L19,23c-0.4,0.4-1.4,2.1-1,2.5l1.5,1.5c0.4,0.4,2.1-0.6,2.5-1l0,0L19,23z" xmlns="http://www.w3.org/2000/svg" />
<path id="layer" class="st036" d="M17.8,21.2l2.8-2.8L14,0h-4L2,22h3.9l1.8-5.6h8.5L17.8,21.2z M8.6,13.4l2.9-8.8&#xD;&#xA;	c0.1-0.4,0.2-0.8,0.3-1.4h0.1c0.1,0.7,0.2,1.1,0.3,1.4l3,8.8H8.6z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 612)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st036_white { fill:#FFFFFF;}
	.st136_white { fill:#FFFFFF;}
	.st236_white { fill:#FFFFFF;}
</style>
<path id="layer_3_" class="st036_white" d="M18,25.5c4,4-2.5-2.5,1.5,1.5c0,5.4-6.5,5-8.5,5C15.5,27.5,14.3,25.5,18,25.5z" xmlns="http://www.w3.org/2000/svg" />
<path id="layer_2_" class="st136_white" d="M31,14L31,14c-0.4-0.4-1.5-1.5-3,0l-9,9l3,3l9-9C32.5,15.5,31.4,14.4,31,14z" xmlns="http://www.w3.org/2000/svg" />
<path id="layer_1_" class="st236_white" d="M19,23L19,23c-0.4,0.4-1.4,2.1-1,2.5l1.5,1.5c0.4,0.4,2.1-0.6,2.5-1l0,0L19,23z" xmlns="http://www.w3.org/2000/svg" />
<path id="layer" class="st036_white" d="M17.8,21.2l2.8-2.8L14,0h-4L2,22h3.9l1.8-5.6h8.5L17.8,21.2z M8.6,13.4l2.9-8.8&#xD;&#xA;	c0.1-0.4,0.2-0.8,0.3-1.4h0.1c0.1,0.7,0.2,1.1,0.3,1.4l3,8.8H8.6z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow37 { fill:#979797;}
	.Red37 { fill:#585858;}
	.Blue37 { fill:#757575;}
	.Green37 { fill:#404040;}
	.Black37 { fill:#727272;}
	.White37 { fill:#FFFFFF;}
	.st037 {opacity:0.5;}
	.st137 {display:none;}
	.st237 { fill:#404040;}
	.st337 { fill:#585858;}
	.st437 { fill:#727272;}
</style>
<g id="ChangeTextCase" xmlns="http://www.w3.org/2000/svg">
	<path class="Blue37" d="M12.6,6l5.8,16h-3.6l-1.2-3.6H7.8L6.6,22H3.1L9.1,6H12.6z M12.8,15.8l-2-5.9h0l-2,5.9H12.8z M19.7,14&#xD;&#xA;		c0-0.7,0.2-1.4,0.5-1.9s0.7-0.9,1.2-1.2c0.5-0.3,1.1-0.5,1.7-0.6c0.6-0.1,1.2-0.2,1.9-0.2c0.6,0,1.1,0,1.7,0.1&#xD;&#xA;		c0.6,0.1,1.1,0.2,1.6,0.5c0.5,0.2,0.9,0.6,1.2,1c0.3,0.4,0.5,1,0.5,1.7v6c0,0.5,0,1,0.1,1.5c0.1,0.5,0.2,0.8,0.3,1.1h-3.2&#xD;&#xA;		c-0.1-0.2-0.1-0.4-0.1-0.5c0-0.2-0.1-0.4-0.1-0.6c-0.5,0.5-1.1,0.9-1.8,1.1c-0.7,0.2-1.4,0.3-2.1,0.3c-0.5,0-1-0.1-1.5-0.2&#xD;&#xA;		c-0.5-0.1-0.9-0.3-1.2-0.6c-0.3-0.3-0.6-0.6-0.8-1.1c-0.2-0.4-0.3-1-0.3-1.5c0-0.7,0.1-1.2,0.3-1.6c0.2-0.4,0.5-0.8,0.9-1&#xD;&#xA;		c0.4-0.3,0.8-0.4,1.2-0.6c0.5-0.1,0.9-0.2,1.4-0.3c0.5-0.1,0.9-0.1,1.4-0.2c0.5,0,0.9-0.1,1.2-0.2c0.3-0.1,0.6-0.2,0.8-0.4&#xD;&#xA;		c0.2-0.2,0.3-0.4,0.3-0.8c0-0.3-0.1-0.6-0.2-0.8c-0.1-0.2-0.3-0.4-0.4-0.5c-0.2-0.1-0.4-0.2-0.6-0.2c-0.2,0-0.5-0.1-0.8-0.1&#xD;&#xA;		c-0.6,0-1.1,0.1-1.4,0.4s-0.6,0.7-0.6,1.3H19.7z M26.9,16.3c-0.1,0.1-0.3,0.2-0.5,0.3c-0.2,0.1-0.4,0.1-0.6,0.2&#xD;&#xA;		c-0.2,0-0.5,0.1-0.7,0.1c-0.2,0-0.5,0.1-0.7,0.1c-0.2,0-0.5,0.1-0.7,0.2c-0.2,0.1-0.4,0.2-0.6,0.3c-0.2,0.1-0.3,0.3-0.4,0.5&#xD;&#xA;		c-0.1,0.2-0.2,0.4-0.2,0.7c0,0.3,0.1,0.5,0.2,0.7c0.1,0.2,0.2,0.3,0.4,0.5c0.2,0.1,0.4,0.2,0.6,0.2c0.2,0,0.5,0.1,0.7,0.1&#xD;&#xA;		c0.6,0,1.1-0.1,1.4-0.3c0.3-0.2,0.6-0.5,0.7-0.8c0.2-0.3,0.3-0.6,0.3-0.9c0-0.3,0.1-0.5,0.1-0.7V16.3z" />
</g>
</g>

<g transform="translate(170, 612)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow37_white { fill:#FFFFFF;}
	.Red37_white { fill:#FFFFFF;}
	.Blue37_white { fill:#FFFFFF;}
	.Green37_white { fill:#FFFFFF;}
	.Black37_white { fill:#FFFFFF;}
	.White37_white { fill:#FFFFFF;}
	.st037_white {opacity:0.5;}
	.st137_white {display:none;}
	.st237_white { fill:#FFFFFF;}
	.st337_white { fill:#FFFFFF;}
	.st437_white { fill:#FFFFFF;}
</style>
<g id="ChangeTextCase" xmlns="http://www.w3.org/2000/svg">
	<path class="Blue37_white" d="M12.6,6l5.8,16h-3.6l-1.2-3.6H7.8L6.6,22H3.1L9.1,6H12.6z M12.8,15.8l-2-5.9h0l-2,5.9H12.8z M19.7,14&#xD;&#xA;		c0-0.7,0.2-1.4,0.5-1.9s0.7-0.9,1.2-1.2c0.5-0.3,1.1-0.5,1.7-0.6c0.6-0.1,1.2-0.2,1.9-0.2c0.6,0,1.1,0,1.7,0.1&#xD;&#xA;		c0.6,0.1,1.1,0.2,1.6,0.5c0.5,0.2,0.9,0.6,1.2,1c0.3,0.4,0.5,1,0.5,1.7v6c0,0.5,0,1,0.1,1.5c0.1,0.5,0.2,0.8,0.3,1.1h-3.2&#xD;&#xA;		c-0.1-0.2-0.1-0.4-0.1-0.5c0-0.2-0.1-0.4-0.1-0.6c-0.5,0.5-1.1,0.9-1.8,1.1c-0.7,0.2-1.4,0.3-2.1,0.3c-0.5,0-1-0.1-1.5-0.2&#xD;&#xA;		c-0.5-0.1-0.9-0.3-1.2-0.6c-0.3-0.3-0.6-0.6-0.8-1.1c-0.2-0.4-0.3-1-0.3-1.5c0-0.7,0.1-1.2,0.3-1.6c0.2-0.4,0.5-0.8,0.9-1&#xD;&#xA;		c0.4-0.3,0.8-0.4,1.2-0.6c0.5-0.1,0.9-0.2,1.4-0.3c0.5-0.1,0.9-0.1,1.4-0.2c0.5,0,0.9-0.1,1.2-0.2c0.3-0.1,0.6-0.2,0.8-0.4&#xD;&#xA;		c0.2-0.2,0.3-0.4,0.3-0.8c0-0.3-0.1-0.6-0.2-0.8c-0.1-0.2-0.3-0.4-0.4-0.5c-0.2-0.1-0.4-0.2-0.6-0.2c-0.2,0-0.5-0.1-0.8-0.1&#xD;&#xA;		c-0.6,0-1.1,0.1-1.4,0.4s-0.6,0.7-0.6,1.3H19.7z M26.9,16.3c-0.1,0.1-0.3,0.2-0.5,0.3c-0.2,0.1-0.4,0.1-0.6,0.2&#xD;&#xA;		c-0.2,0-0.5,0.1-0.7,0.1c-0.2,0-0.5,0.1-0.7,0.1c-0.2,0-0.5,0.1-0.7,0.2c-0.2,0.1-0.4,0.2-0.6,0.3c-0.2,0.1-0.3,0.3-0.4,0.5&#xD;&#xA;		c-0.1,0.2-0.2,0.4-0.2,0.7c0,0.3,0.1,0.5,0.2,0.7c0.1,0.2,0.2,0.3,0.4,0.5c0.2,0.1,0.4,0.2,0.6,0.2c0.2,0,0.5,0.1,0.7,0.1&#xD;&#xA;		c0.6,0,1.1-0.1,1.4-0.3c0.3-0.2,0.6-0.5,0.7-0.8c0.2-0.3,0.3-0.6,0.3-0.9c0-0.3,0.1-0.5,0.1-0.7V16.3z" />
</g>
</g>

<g transform="translate(204, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow38 { fill:#979797;}
	.Red38 { fill:#585858;}
	.Blue38 { fill:#757575;}
	.Green38 { fill:#404040;}
	.Black38 { fill:#727272;}
	.White38 { fill:#FFFFFF;}
	.st038 {opacity:0.5;}
	.st138 {display:none;}
	.st238 { fill:#404040;}
	.st338 { fill:#585858;}
	.st438 { fill:#727272;}
</style>
<g id="ClearFormatting" xmlns="http://www.w3.org/2000/svg">
	<path class="Black38" d="M1.1,11.2c0-0.6,0.2-1.2,0.5-1.6c0.3-0.4,0.6-0.8,1.1-1C3,8.4,3.5,8.2,4.1,8.1C4.6,8,5.1,7.9,5.7,7.9&#xD;&#xA;		c0.5,0,1,0,1.5,0.1c0.5,0.1,1,0.2,1.4,0.4c0.4,0.2,0.8,0.5,1,0.8s0.4,0.8,0.4,1.4v5.1c0,0.4,0,0.9,0.1,1.3c0.1,0.4,0.1,0.7,0.3,0.9&#xD;&#xA;		H7.6c-0.1-0.2-0.1-0.3-0.1-0.5c0-0.2-0.1-0.3-0.1-0.5C7,17.5,6.5,17.8,5.9,18c-0.6,0.2-1.2,0.3-1.8,0.3c-0.5,0-0.9-0.1-1.3-0.2&#xD;&#xA;		C2.4,18,2,17.8,1.7,17.5C1.4,17.3,1.2,17,1,16.6c-0.2-0.4-0.3-0.8-0.3-1.3c0-0.6,0.1-1,0.3-1.4s0.4-0.6,0.8-0.9&#xD;&#xA;		c0.3-0.2,0.7-0.4,1.1-0.5s0.8-0.2,1.2-0.3c0.4-0.1,0.8-0.1,1.2-0.2c0.4,0,0.7-0.1,1-0.2c0.3-0.1,0.5-0.2,0.7-0.3&#xD;&#xA;		c0.2-0.1,0.3-0.4,0.2-0.6c0-0.3,0-0.5-0.1-0.7C7.1,10.2,6.9,10,6.8,10C6.6,9.9,6.4,9.8,6.2,9.8s-0.4,0-0.7,0c-0.5,0-1,0.1-1.3,0.3&#xD;&#xA;		c-0.3,0.2-0.5,0.6-0.5,1.1H1.1z M7.3,13.2c-0.1,0.1-0.3,0.2-0.4,0.2c-0.2,0.1-0.4,0.1-0.6,0.1c-0.2,0-0.4,0.1-0.6,0.1&#xD;&#xA;		s-0.4,0.1-0.6,0.1c-0.2,0-0.4,0.1-0.6,0.2c-0.2,0.1-0.4,0.1-0.5,0.3c-0.1,0.1-0.3,0.2-0.4,0.4c-0.1,0.2-0.1,0.4-0.1,0.6&#xD;&#xA;		c0,0.2,0,0.4,0.1,0.6C3.7,16,3.8,16.1,4,16.2c0.2,0.1,0.3,0.2,0.5,0.2s0.4,0.1,0.6,0.1c0.5,0,0.9-0.1,1.2-0.3&#xD;&#xA;		C6.6,16,6.9,15.8,7,15.6s0.2-0.5,0.3-0.8c0-0.3,0-0.5,0-0.6V13.2z" />
	<path class="Black38" d="M14.7,4v5.4h0c0.3-0.5,0.8-0.9,1.3-1.1c0.6-0.2,1.1-0.4,1.8-0.4c0.5,0,1,0.1,1.5,0.3&#xD;&#xA;		c0.5,0.2,0.9,0.5,1.3,0.9c0.4,0.4,0.7,1,0.9,1.6s0.4,1.4,0.4,2.3s-0.1,1.7-0.4,2.3S21,16.6,20.6,17c-0.4,0.4-0.8,0.7-1.3,0.9&#xD;&#xA;		c-0.5,0.2-1,0.3-1.5,0.3c-0.7,0-1.4-0.1-1.9-0.3c-0.6-0.2-1-0.6-1.3-1.2h0V18H12V4H14.7z M19.1,11.9c-0.1-0.4-0.2-0.7-0.4-1&#xD;&#xA;		c-0.2-0.3-0.4-0.5-0.7-0.7c-0.3-0.2-0.6-0.3-1-0.3c-0.4,0-0.7,0.1-1,0.3c-0.3,0.2-0.5,0.4-0.7,0.7c-0.2,0.3-0.3,0.6-0.4,1&#xD;&#xA;		c-0.1,0.4-0.1,0.8-0.1,1.2c0,0.4,0,0.8,0.1,1.2c0.1,0.4,0.2,0.7,0.4,1s0.4,0.5,0.7,0.7c0.3,0.2,0.6,0.3,1,0.3c0.4,0,0.8-0.1,1-0.3&#xD;&#xA;		c0.3-0.2,0.5-0.4,0.7-0.7c0.2-0.3,0.3-0.6,0.4-1c0.1-0.4,0.1-0.8,0.1-1.2C19.2,12.7,19.2,12.3,19.1,11.9z" />
	<path class="Blue38" d="M19,21.3L16.3,24c-0.4,0.4-0.4,1.2,0,1.6l4,4c0.4,0.4,1.2,0.4,1.6,0l2.7-2.7L19,21.3z" />
	<path class="Red38" d="M31.7,18.4l-4-4c-0.4-0.4-1.2-0.4-1.6,0L20,20.5l5.6,5.6l6.1-6.1C32.1,19.5,32.1,18.8,31.7,18.4z" />
</g>
</g>

<g transform="translate(204, 612)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow38_white { fill:#FFFFFF;}
	.Red38_white { fill:#FFFFFF;}
	.Blue38_white { fill:#FFFFFF;}
	.Green38_white { fill:#FFFFFF;}
	.Black38_white { fill:#FFFFFF;}
	.White38_white { fill:#FFFFFF;}
	.st038_white {opacity:0.5;}
	.st138_white {display:none;}
	.st238_white { fill:#FFFFFF;}
	.st338_white { fill:#FFFFFF;}
	.st438_white { fill:#FFFFFF;}
</style>
<g id="ClearFormatting" xmlns="http://www.w3.org/2000/svg">
	<path class="Black38_white" d="M1.1,11.2c0-0.6,0.2-1.2,0.5-1.6c0.3-0.4,0.6-0.8,1.1-1C3,8.4,3.5,8.2,4.1,8.1C4.6,8,5.1,7.9,5.7,7.9&#xD;&#xA;		c0.5,0,1,0,1.5,0.1c0.5,0.1,1,0.2,1.4,0.4c0.4,0.2,0.8,0.5,1,0.8s0.4,0.8,0.4,1.4v5.1c0,0.4,0,0.9,0.1,1.3c0.1,0.4,0.1,0.7,0.3,0.9&#xD;&#xA;		H7.6c-0.1-0.2-0.1-0.3-0.1-0.5c0-0.2-0.1-0.3-0.1-0.5C7,17.5,6.5,17.8,5.9,18c-0.6,0.2-1.2,0.3-1.8,0.3c-0.5,0-0.9-0.1-1.3-0.2&#xD;&#xA;		C2.4,18,2,17.8,1.7,17.5C1.4,17.3,1.2,17,1,16.6c-0.2-0.4-0.3-0.8-0.3-1.3c0-0.6,0.1-1,0.3-1.4s0.4-0.6,0.8-0.9&#xD;&#xA;		c0.3-0.2,0.7-0.4,1.1-0.5s0.8-0.2,1.2-0.3c0.4-0.1,0.8-0.1,1.2-0.2c0.4,0,0.7-0.1,1-0.2c0.3-0.1,0.5-0.2,0.7-0.3&#xD;&#xA;		c0.2-0.1,0.3-0.4,0.2-0.6c0-0.3,0-0.5-0.1-0.7C7.1,10.2,6.9,10,6.8,10C6.6,9.9,6.4,9.8,6.2,9.8s-0.4,0-0.7,0c-0.5,0-1,0.1-1.3,0.3&#xD;&#xA;		c-0.3,0.2-0.5,0.6-0.5,1.1H1.1z M7.3,13.2c-0.1,0.1-0.3,0.2-0.4,0.2c-0.2,0.1-0.4,0.1-0.6,0.1c-0.2,0-0.4,0.1-0.6,0.1&#xD;&#xA;		s-0.4,0.1-0.6,0.1c-0.2,0-0.4,0.1-0.6,0.2c-0.2,0.1-0.4,0.1-0.5,0.3c-0.1,0.1-0.3,0.2-0.4,0.4c-0.1,0.2-0.1,0.4-0.1,0.6&#xD;&#xA;		c0,0.2,0,0.4,0.1,0.6C3.7,16,3.8,16.1,4,16.2c0.2,0.1,0.3,0.2,0.5,0.2s0.4,0.1,0.6,0.1c0.5,0,0.9-0.1,1.2-0.3&#xD;&#xA;		C6.6,16,6.9,15.8,7,15.6s0.2-0.5,0.3-0.8c0-0.3,0-0.5,0-0.6V13.2z" />
	<path class="Black38_white" d="M14.7,4v5.4h0c0.3-0.5,0.8-0.9,1.3-1.1c0.6-0.2,1.1-0.4,1.8-0.4c0.5,0,1,0.1,1.5,0.3&#xD;&#xA;		c0.5,0.2,0.9,0.5,1.3,0.9c0.4,0.4,0.7,1,0.9,1.6s0.4,1.4,0.4,2.3s-0.1,1.7-0.4,2.3S21,16.6,20.6,17c-0.4,0.4-0.8,0.7-1.3,0.9&#xD;&#xA;		c-0.5,0.2-1,0.3-1.5,0.3c-0.7,0-1.4-0.1-1.9-0.3c-0.6-0.2-1-0.6-1.3-1.2h0V18H12V4H14.7z M19.1,11.9c-0.1-0.4-0.2-0.7-0.4-1&#xD;&#xA;		c-0.2-0.3-0.4-0.5-0.7-0.7c-0.3-0.2-0.6-0.3-1-0.3c-0.4,0-0.7,0.1-1,0.3c-0.3,0.2-0.5,0.4-0.7,0.7c-0.2,0.3-0.3,0.6-0.4,1&#xD;&#xA;		c-0.1,0.4-0.1,0.8-0.1,1.2c0,0.4,0,0.8,0.1,1.2c0.1,0.4,0.2,0.7,0.4,1s0.4,0.5,0.7,0.7c0.3,0.2,0.6,0.3,1,0.3c0.4,0,0.8-0.1,1-0.3&#xD;&#xA;		c0.3-0.2,0.5-0.4,0.7-0.7c0.2-0.3,0.3-0.6,0.4-1c0.1-0.4,0.1-0.8,0.1-1.2C19.2,12.7,19.2,12.3,19.1,11.9z" />
	<path class="Blue38_white" d="M19,21.3L16.3,24c-0.4,0.4-0.4,1.2,0,1.6l4,4c0.4,0.4,1.2,0.4,1.6,0l2.7-2.7L19,21.3z" />
	<path class="Red38_white" d="M31.7,18.4l-4-4c-0.4-0.4-1.2-0.4-1.6,0L20,20.5l5.6,5.6l6.1-6.1C32.1,19.5,32.1,18.8,31.7,18.4z" />
</g>
</g>

<g transform="translate(238, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue39 { fill:#757575;}
	.Black39 { fill:#727272;}
	.Red39 { fill:#585858;}
	.st039 {opacity:0.5;}
</style>
<g class="st039" xmlns="http://www.w3.org/2000/svg">
	<path class="Black39" d="M28,10h-8V4h8V10z M24.6,14.9c0.6-0.6,1.4-0.9,2.2-0.9c0.4,0,0.8,0.1,1.2,0.2V12h-8v6h1.5L24.6,14.9z M0,26&#xD;&#xA;		h8v-6H0V26z M14.9,24.6l3.1-3.1V20h-8v6h4.1C14.3,25.5,14.5,25,14.9,24.6z" />
</g>
<path class="Blue39" d="M0,4h8v6H0V4z M0,18h8v-6H0V18z M10,10h8V4h-8V10z M10,18h8v-6h-8V18z M19,23.3L16.3,26&#xD;&#xA;	c-0.4,0.4-0.4,1.2,0,1.6l4,4c0.4,0.4,1.2,0.4,1.6,0l2.7-2.7L19,23.3z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red39" d="M31.7,20.4l-4-4c-0.4-0.4-1.2-0.4-1.6,0l-6.1,6.1l5.6,5.6l6.1-6.1C32.1,21.5,32.1,20.8,31.7,20.4z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 612)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue39_white { fill:#FFFFFF;}
	.Black39_white { fill:#FFFFFF;}
	.Red39_white { fill:#FFFFFF;}
	.st039_white {opacity:0.5;}
</style>
<g class="st039_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black39_white" d="M28,10h-8V4h8V10z M24.6,14.9c0.6-0.6,1.4-0.9,2.2-0.9c0.4,0,0.8,0.1,1.2,0.2V12h-8v6h1.5L24.6,14.9z M0,26&#xD;&#xA;		h8v-6H0V26z M14.9,24.6l3.1-3.1V20h-8v6h4.1C14.3,25.5,14.5,25,14.9,24.6z" />
</g>
<path class="Blue39_white" d="M0,4h8v6H0V4z M0,18h8v-6H0V18z M10,10h8V4h-8V10z M10,18h8v-6h-8V18z M19,23.3L16.3,26&#xD;&#xA;	c-0.4,0.4-0.4,1.2,0,1.6l4,4c0.4,0.4,1.2,0.4,1.6,0l2.7-2.7L19,23.3z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red39_white" d="M31.7,20.4l-4-4c-0.4-0.4-1.2-0.4-1.6,0l-6.1,6.1l5.6,5.6l6.1-6.1C32.1,21.5,32.1,20.8,31.7,20.4z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red40 { fill:#585858;}
</style>
<path class="Red40" d="M27,4H5C4.5,4,4,4.5,4,5v22c0,0.5,0.5,1,1,1h22c0.5,0,1-0.5,1-1V5C28,4.5,27.5,4,27,4z M22,20l-2,2l-4-4l-4,4&#xD;&#xA;	l-2-2l4-4l-4-4l2-2l4,4l4-4l2,2l-4,4L22,20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 612)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red40_white { fill:#FFFFFF;}
</style>
<path class="Red40_white" d="M27,4H5C4.5,4,4,4.5,4,5v22c0,0.5,0.5,1,1,1h22c0.5,0,1-0.5,1-1V5C28,4.5,27.5,4,27,4z M22,20l-2,2l-4-4l-4,4&#xD;&#xA;	l-2-2l4-4l-4-4l2-2l4,4l4-4l2,2l-4,4L22,20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st041 {fill:#727272;enable-background:new    ;}
</style>
<path class="st041" d="M30,8H2V6h28V8z M30,10H2v2h28V10z M30,14H2v2h28V14z M30,18H2v2h28V18z M30,22H2v2h28V22z" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="2" class="st041" width="28" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="26" class="st041" width="28" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 612)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st041_white { fill:#FFFFFF;enable-background:new    ;}
</style>
<path class="st041_white" d="M30,8H2V6h28V8z M30,10H2v2h28V10z M30,14H2v2h28V14z M30,18H2v2h28V18z M30,22H2v2h28V22z" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="2" class="st041_white" width="28" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="26" class="st041_white" width="28" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black42 { fill:#727272;}
</style>
<path class="Black42" d="M14,6H4V4h10V6z M26,4H16v2h10V4z M14,8H4v2h10V8z M26,8H16v2h10V8z M14,12H4v2h10V12z M26,12H16v2h10V12z&#xD;&#xA;	 M14,16H4v2h10V16z M26,16H16v2h10V16z M14,20H4v2h10V20z M26,20H16v2h10V20z M14,24H4v2h10V24z M26,24H16v2h10V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 612)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black42_white { fill:#FFFFFF;}
</style>
<path class="Black42_white" d="M14,6H4V4h10V6z M26,4H16v2h10V4z M14,8H4v2h10V8z M26,8H16v2h10V8z M14,12H4v2h10V12z M26,12H16v2h10V12z&#xD;&#xA;	 M14,16H4v2h10V16z M26,16H16v2h10V16z M14,20H4v2h10V20z M26,20H16v2h10V20z M14,24H4v2h10V24z M26,24H16v2h10V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st043 {fill:#727272;enable-background:new    ;}
</style>
<path class="st043" d="M10,8H2V6h8V8z M10,10H2v2h8V10z M10,14H2v2h8V14z M10,18H2v2h8V18z M10,22H2v2h8V22z" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="2" class="st043" width="8" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="26" class="st043" width="8" height="2" xmlns="http://www.w3.org/2000/svg" />
<path class="st043" d="M20,8h-8V6h8V8z M20,10h-8v2h8V10z M20,14h-8v2h8V14z M20,18h-8v2h8V18z M20,22h-8v2h8V22z" xmlns="http://www.w3.org/2000/svg" />
<rect x="12" y="2" class="st043" width="8" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="12" y="26" class="st043" width="8" height="2" xmlns="http://www.w3.org/2000/svg" />
<path class="st043" d="M30,8h-8V6h8V8z M30,10h-8v2h8V10z M30,14h-8v2h8V14z M30,18h-8v2h8V18z M30,22h-8v2h8V22z" xmlns="http://www.w3.org/2000/svg" />
<rect x="22" y="2" class="st043" width="8" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="22" y="26" class="st043" width="8" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 612)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st043_white { fill:#FFFFFF;enable-background:new    ;}
</style>
<path class="st043_white" d="M10,8H2V6h8V8z M10,10H2v2h8V10z M10,14H2v2h8V14z M10,18H2v2h8V18z M10,22H2v2h8V22z" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="2" class="st043_white" width="8" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="26" class="st043_white" width="8" height="2" xmlns="http://www.w3.org/2000/svg" />
<path class="st043_white" d="M20,8h-8V6h8V8z M20,10h-8v2h8V10z M20,14h-8v2h8V14z M20,18h-8v2h8V18z M20,22h-8v2h8V22z" xmlns="http://www.w3.org/2000/svg" />
<rect x="12" y="2" class="st043_white" width="8" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="12" y="26" class="st043_white" width="8" height="2" xmlns="http://www.w3.org/2000/svg" />
<path class="st043_white" d="M30,8h-8V6h8V8z M30,10h-8v2h8V10z M30,14h-8v2h8V14z M30,18h-8v2h8V18z M30,22h-8v2h8V22z" xmlns="http://www.w3.org/2000/svg" />
<rect x="22" y="2" class="st043_white" width="8" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="22" y="26" class="st043_white" width="8" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st044 {fill:#727272;enable-background:new    ;}
</style>
<path class="st044" d="M15,8H2V6h13V8z M30,6H17v2h13V6z M15,10H2v2h13V10z M30,10H17v2h13V10z M15,14H2v2h13V14z M30,14H17v2h13V14z&#xD;&#xA;	 M15,18H2v2h13V18z M30,18H17v2h13V18z M15,22H2v2h13V22z M30,22H17v2h13V22z" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="2" class="st044" width="13" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="17" y="2" class="st044" width="13" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="26" class="st044" width="13" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="17" y="26" class="st044" width="13" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 612)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st044_white { fill:#FFFFFF;enable-background:new    ;}
</style>
<path class="st044_white" d="M15,8H2V6h13V8z M30,6H17v2h13V6z M15,10H2v2h13V10z M30,10H17v2h13V10z M15,14H2v2h13V14z M30,14H17v2h13V14z&#xD;&#xA;	 M15,18H2v2h13V18z M30,18H17v2h13V18z M15,22H2v2h13V22z M30,22H17v2h13V22z" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="2" class="st044_white" width="13" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="17" y="2" class="st044_white" width="13" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="26" class="st044_white" width="13" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="17" y="26" class="st044_white" width="13" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow45 { fill:#979797;}
	.Red45 { fill:#585858;}
	.Blue45 { fill:#757575;}
	.Green45 { fill:#404040;}
	.Black45 { fill:#727272;}
	.White45 { fill:#FFFFFF;}
	.st045 {opacity:0.75;}
</style>
<g id="Copy" xmlns="http://www.w3.org/2000/svg">
	<path class="Black45" d="M21,2H11c-0.5,0-1,0.5-1,1v5H5C4.5,8,4,8.5,4,9v20c0,0.5,0.5,1,1,1h16c0.5,0,1-0.5,1-1v-5h5c0.5,0,1-0.5,1-1&#xD;&#xA;		V9L21,2z M20,28H6V10h8v5c0,0.5,0.5,1,1,1h5V28z M26,22h-4v-7l-7-7h-3V4h8v5c0,0.5,0.5,1,1,1h5V22z" />
</g>
</g>

<g transform="translate(442, 612)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow45_white { fill:#FFFFFF;}
	.Red45_white { fill:#FFFFFF;}
	.Blue45_white { fill:#FFFFFF;}
	.Green45_white { fill:#FFFFFF;}
	.Black45_white { fill:#FFFFFF;}
	.White45_white { fill:#FFFFFF;}
	.st045_white {opacity:0.75;}
</style>
<g id="Copy" xmlns="http://www.w3.org/2000/svg">
	<path class="Black45_white" d="M21,2H11c-0.5,0-1,0.5-1,1v5H5C4.5,8,4,8.5,4,9v20c0,0.5,0.5,1,1,1h16c0.5,0,1-0.5,1-1v-5h5c0.5,0,1-0.5,1-1&#xD;&#xA;		V9L21,2z M20,28H6V10h8v5c0,0.5,0.5,1,1,1h5V28z M26,22h-4v-7l-7-7h-3V4h8v5c0,0.5,0.5,1,1,1h5V22z" />
</g>
</g>

<g transform="translate(170, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow46 { fill:#979797;}
	.Red46 { fill:#585858;}
	.Blue46 { fill:#757575;}
	.Green46 { fill:#404040;}
	.Black46 { fill:#727272;}
	.White46 { fill:#FFFFFF;}
	.st046 {opacity:0.5;}
	.st146 {display:none;}
	.st246 { fill:#404040;}
	.st346 { fill:#585858;}
	.st446 { fill:#727272;}
</style>
<g id="Cut" xmlns="http://www.w3.org/2000/svg">
	<path class="Black46" d="M16.4,11.6L26,2l-5.8,13.3L16.4,11.6z M12,23c0,2.8-2.2,5-5,5s-5-2.2-5-5s2.2-5,5-5S12,20.2,12,23z M10,23&#xD;&#xA;		c0-1.7-1.3-3-3-3s-3,1.3-3,3s1.3,3,3,3S10,24.7,10,23z M28,23c0,2.8-2.2,5-5,5s-5-2.2-5-5c0-0.9,0.2-1.7,0.6-2.4L16,18h-5L4,2&#xD;&#xA;		l16.6,16.6c0.7-0.4,1.5-0.6,2.4-0.6C25.8,18,28,20.2,28,23z M26,23c0-1.7-1.3-3-3-3s-3,1.3-3,3s1.3,3,3,3S26,24.7,26,23z" />
</g>
</g>

<g transform="translate(170, 850)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow46_white { fill:#FFFFFF;}
	.Red46_white { fill:#FFFFFF;}
	.Blue46_white { fill:#FFFFFF;}
	.Green46_white { fill:#FFFFFF;}
	.Black46_white { fill:#FFFFFF;}
	.White46_white { fill:#FFFFFF;}
	.st046_white {opacity:0.5;}
	.st146_white {display:none;}
	.st246_white { fill:#FFFFFF;}
	.st346_white { fill:#FFFFFF;}
	.st446_white { fill:#FFFFFF;}
</style>
<g id="Cut" xmlns="http://www.w3.org/2000/svg">
	<path class="Black46_white" d="M16.4,11.6L26,2l-5.8,13.3L16.4,11.6z M12,23c0,2.8-2.2,5-5,5s-5-2.2-5-5s2.2-5,5-5S12,20.2,12,23z M10,23&#xD;&#xA;		c0-1.7-1.3-3-3-3s-3,1.3-3,3s1.3,3,3,3S10,24.7,10,23z M28,23c0,2.8-2.2,5-5,5s-5-2.2-5-5c0-0.9,0.2-1.7,0.6-2.4L16,18h-5L4,2&#xD;&#xA;		l16.6,16.6c0.7-0.4,1.5-0.6,2.4-0.6C25.8,18,28,20.2,28,23z M26,23c0-1.7-1.3-3-3-3s-3,1.3-3,3s1.3,3,3,3S26,24.7,26,23z" />
</g>
</g>

<g transform="translate(476, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st047 {fill:#727272;}
</style>
<path class="st047" d="M18.8,16l6.9-6.9c0.4-0.4,0.4-1,0-1.4l-1.4-1.4c-0.4-0.4-1-0.4-1.4,0L16,13.2L9.1,6.3c-0.4-0.4-1-0.4-1.4,0&#xD;&#xA;	L6.3,7.7c-0.4,0.4-0.4,1,0,1.4l6.9,6.9l-6.9,6.9c-0.4,0.4-0.4,1,0,1.4l1.4,1.4c0.4,0.4,1,0.4,1.4,0l6.9-6.9l6.9,6.9&#xD;&#xA;	c0.4,0.4,1,0.4,1.4,0l1.4-1.4c0.4-0.4,0.4-1,0-1.4L18.8,16z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 612)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st047_white { fill:#FFFFFF;}
</style>
<path class="st047_white" d="M18.8,16l6.9-6.9c0.4-0.4,0.4-1,0-1.4l-1.4-1.4c-0.4-0.4-1-0.4-1.4,0L16,13.2L9.1,6.3c-0.4-0.4-1-0.4-1.4,0&#xD;&#xA;	L6.3,7.7c-0.4,0.4-0.4,1,0,1.4l6.9,6.9l-6.9,6.9c-0.4,0.4-0.4,1,0,1.4l1.4,1.4c0.4,0.4,1,0.4,1.4,0l6.9-6.9l6.9,6.9&#xD;&#xA;	c0.4,0.4,1,0.4,1.4,0l1.4-1.4c0.4-0.4,0.4-1,0-1.4L18.8,16z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black48 { fill:#727272;}
	.Red48 { fill:#585858;}
</style>
<path id="Hyperlink" class="Black48" d="M16.8,18c1.3,1.9,1.1,4.6-0.6,6.3l-4.2,4.2c-2,2-5.1,2-7.1,0l-1.4-1.4c-2-2-2-5.1,0-7.1&#xD;&#xA;	l4.2-4.2c1.7-1.7,4.3-1.9,6.3-0.6l-1.5,1.5c-1.1-0.5-2.5-0.3-3.4,0.6l-4.2,4.2c-1.2,1.2-1.2,3.1,0,4.2l1.4,1.4&#xD;&#xA;	c1.2,1.2,3.1,1.2,4.2,0l4.2-4.2c0.9-0.9,1.1-2.3,0.6-3.4L16.8,18z M28.5,4.9l-1.4-1.4c-2-2-5.1-2-7.1,0l-4.2,4.2&#xD;&#xA;	c-1.7,1.7-1.9,4.3-0.6,6.3l1.5-1.5c-0.5-1.1-0.3-2.5,0.6-3.4l4.2-4.2c1.2-1.2,3.1-1.2,4.2,0l1.4,1.4c1.2,1.2,1.2,3.1,0,4.2l-4.2,4.2&#xD;&#xA;	c-0.9,0.9-2.3,1.1-3.4,0.6L18,16.8c1.9,1.3,4.6,1.1,6.3-0.6l4.2-4.2C30.5,10,30.5,6.8,28.5,4.9z M21.7,11.7c0.4-0.4,0.4-1,0-1.4l0,0&#xD;&#xA;	c-0.4-0.4-1-0.4-1.4,0l-10,10c-0.4,0.4-0.4,1,0,1.4l0,0c0.4,0.4,1,0.4,1.4,0L21.7,11.7z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Red48" points="32,22 30,20 26,24 22,20 20,22 24,26 20,30 22,32 26,28 30,32 32,30 28,26 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 680)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black48_white { fill:#FFFFFF;}
	.Red48_white { fill:#FFFFFF;}
</style>
<path id="Hyperlink" class="Black48_white" d="M16.8,18c1.3,1.9,1.1,4.6-0.6,6.3l-4.2,4.2c-2,2-5.1,2-7.1,0l-1.4-1.4c-2-2-2-5.1,0-7.1&#xD;&#xA;	l4.2-4.2c1.7-1.7,4.3-1.9,6.3-0.6l-1.5,1.5c-1.1-0.5-2.5-0.3-3.4,0.6l-4.2,4.2c-1.2,1.2-1.2,3.1,0,4.2l1.4,1.4&#xD;&#xA;	c1.2,1.2,3.1,1.2,4.2,0l4.2-4.2c0.9-0.9,1.1-2.3,0.6-3.4L16.8,18z M28.5,4.9l-1.4-1.4c-2-2-5.1-2-7.1,0l-4.2,4.2&#xD;&#xA;	c-1.7,1.7-1.9,4.3-0.6,6.3l1.5-1.5c-0.5-1.1-0.3-2.5,0.6-3.4l4.2-4.2c1.2-1.2,3.1-1.2,4.2,0l1.4,1.4c1.2,1.2,1.2,3.1,0,4.2l-4.2,4.2&#xD;&#xA;	c-0.9,0.9-2.3,1.1-3.4,0.6L18,16.8c1.9,1.3,4.6,1.1,6.3-0.6l4.2-4.2C30.5,10,30.5,6.8,28.5,4.9z M21.7,11.7c0.4-0.4,0.4-1,0-1.4l0,0&#xD;&#xA;	c-0.4-0.4-1-0.4-1.4,0l-10,10c-0.4,0.4-0.4,1,0,1.4l0,0c0.4,0.4,1,0.4,1.4,0L21.7,11.7z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Red48_white" points="32,22 30,20 26,24 22,20 20,22 24,26 20,30 22,32 26,28 30,32 32,30 28,26 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow49 { fill:#979797;}
	.Red49 { fill:#585858;}
	.Blue49 { fill:#757575;}
	.Green49 { fill:#404040;}
	.Black49 { fill:#727272;}
	.White49 { fill:#FFFFFF;}
	.st049 {opacity:0.5;}
	.st149 {display:none;}
	.st249 { fill:#404040;}
	.st349 { fill:#585858;}
	.st449 { fill:#727272;}
</style>
<g id="Delete" xmlns="http://www.w3.org/2000/svg">
	<path class="Red49" d="M18.8,16l8.9-8.9c0.4-0.4,0.4-1,0-1.4l-1.4-1.4c-0.4-0.4-1-0.4-1.4,0L16,13.2L7.1,4.3c-0.4-0.4-1-0.4-1.4,0&#xD;&#xA;		L4.3,5.7c-0.4,0.4-0.4,1,0,1.4l8.9,8.9l-8.9,8.9c-0.4,0.4-0.4,1,0,1.4l1.4,1.4c0.4,0.4,1,0.4,1.4,0l8.9-8.9l8.9,8.9&#xD;&#xA;		c0.4,0.4,1,0.4,1.4,0l1.4-1.4c0.4-0.4,0.4-1,0-1.4L18.8,16z" />
</g>
</g>

<g transform="translate(136, 850)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow49_white { fill:#FFFFFF;}
	.Red49_white { fill:#FFFFFF;}
	.Blue49_white { fill:#FFFFFF;}
	.Green49_white { fill:#FFFFFF;}
	.Black49_white { fill:#FFFFFF;}
	.White49_white { fill:#FFFFFF;}
	.st049_white {opacity:0.5;}
	.st149_white {display:none;}
	.st249_white { fill:#FFFFFF;}
	.st349_white { fill:#FFFFFF;}
	.st449_white { fill:#FFFFFF;}
</style>
<g id="Delete" xmlns="http://www.w3.org/2000/svg">
	<path class="Red49_white" d="M18.8,16l8.9-8.9c0.4-0.4,0.4-1,0-1.4l-1.4-1.4c-0.4-0.4-1-0.4-1.4,0L16,13.2L7.1,4.3c-0.4-0.4-1-0.4-1.4,0&#xD;&#xA;		L4.3,5.7c-0.4,0.4-0.4,1,0,1.4l8.9,8.9l-8.9,8.9c-0.4,0.4-0.4,1,0,1.4l1.4,1.4c0.4,0.4,1,0.4,1.4,0l8.9-8.9l8.9,8.9&#xD;&#xA;		c0.4,0.4,1,0.4,1.4,0l1.4-1.4c0.4-0.4,0.4-1,0-1.4L18.8,16z" />
</g>
</g>

<g transform="translate(340, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st050 {fill:#727272;}
	.st150 {opacity:0.5;}
</style>
<path class="st050" d="M8,8H0V2h8V8z M18,2h-8v6h8V2z M28,2h-8v6h8V2z" xmlns="http://www.w3.org/2000/svg" />
<g class="st150" xmlns="http://www.w3.org/2000/svg">
	<path class="st050" d="M8,16H0v-6h8V16z M18,10h-8v6h8V10z M28,10h-8v6h8V10z M8,18H0v6h8V18z M18,18h-8v6h8V18z" />
</g>
<polygon class="st050" points="32,20 30,18 26,22 22,18 20,20 24,24 20,28 22,30 26,26 30,30 32,28 28,24 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 748)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st050_white { fill:#FFFFFF;}
	.st150_white {opacity:0.5;}
</style>
<path class="st050_white" d="M8,8H0V2h8V8z M18,2h-8v6h8V2z M28,2h-8v6h8V2z" xmlns="http://www.w3.org/2000/svg" />
<g class="st150_white" xmlns="http://www.w3.org/2000/svg">
	<path class="st050_white" d="M8,16H0v-6h8V16z M18,10h-8v6h8V10z M28,10h-8v6h8V10z M8,18H0v6h8V18z M18,18h-8v6h8V18z" />
</g>
<polygon class="st050_white" points="32,20 30,18 26,22 22,18 20,20 24,24 20,28 22,30 26,26 30,30 32,28 28,24 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black51 { fill:#727272;}
	.Red51 { fill:#585858;}
	.st051 {opacity:0.5;}
</style>
<g class="st051" xmlns="http://www.w3.org/2000/svg">
	<path class="Black51" d="M10,14H2V8h8V14z M30,8h-8v6h8V8z M10,6H2V0h8V6z M20,0h-8v6h8V0z M30,0h-8v6h8V0z M10,16H2v6h8V16z M20,16&#xD;&#xA;		h-8v6h8V16z M30,16h-8v6h8V16z" />
</g>
<path class="Red51" d="M20,28l-4,4l-4-4h2v-4h4v4H20z M20,8h-8v6h8V8z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 952)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black51_white { fill:#FFFFFF;}
	.Red51_white { fill:#FFFFFF;}
	.st051_white {opacity:0.5;}
</style>
<g class="st051_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black51_white" d="M10,14H2V8h8V14z M30,8h-8v6h8V8z M10,6H2V0h8V6z M20,0h-8v6h8V0z M30,0h-8v6h8V0z M10,16H2v6h8V16z M20,16&#xD;&#xA;		h-8v6h8V16z M30,16h-8v6h8V16z" />
</g>
<path class="Red51_white" d="M20,28l-4,4l-4-4h2v-4h4v4H20z M20,8h-8v6h8V8z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black52 { fill:#727272;}
	.Red52 { fill:#585858;}
	.st052 {opacity:0.5;}
</style>
<g class="st052" xmlns="http://www.w3.org/2000/svg">
	<path class="Black52" d="M10,14H2V8h8V14z M30,8h-8v6h8V8z M10,6H2V0h8V6z M30,0h-8v6h8V0z M10,16H2v6h8V16z M30,16h-8v6h8V16z" />
</g>
<path class="Red52" d="M20,28l-4,4l-4-4h2v-4h4v4H20z M20,0h-8v22h8V0z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 850)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black52_white { fill:#FFFFFF;}
	.Red52_white { fill:#FFFFFF;}
	.st052_white {opacity:0.5;}
</style>
<g class="st052_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black52_white" d="M10,14H2V8h8V14z M30,8h-8v6h8V8z M10,6H2V0h8V6z M30,0h-8v6h8V0z M10,16H2v6h8V16z M30,16h-8v6h8V16z" />
</g>
<path class="Red52_white" d="M20,28l-4,4l-4-4h2v-4h4v4H20z M20,0h-8v22h8V0z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black53 { fill:#727272;}
	.Red53 { fill:#585858;}
	.st053 {opacity:0.5;}
</style>
<g class="st053" xmlns="http://www.w3.org/2000/svg">
	<path class="Black53" d="M20,10h-8V4h8V10z M30,4h-8v6h8V4z M30,22h-8v6h8V22z M20,22h-8v6h8V22z" />
</g>
<path class="Red53" d="M6,14h4v4H6v2l-4-4l4-4V14z M12,12v8h18v-8H12z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 748)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black53_white { fill:#FFFFFF;}
	.Red53_white { fill:#FFFFFF;}
	.st053_white {opacity:0.5;}
</style>
<g class="st053_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black53_white" d="M20,10h-8V4h8V10z M30,4h-8v6h8V4z M30,22h-8v6h8V22z M20,22h-8v6h8V22z" />
</g>
<path class="Red53_white" d="M6,14h4v4H6v2l-4-4l4-4V14z M12,12v8h18v-8H12z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black54 { fill:#727272;}
	.Green54 { fill:#404040;}
</style>
<path class="Green54" d="M19,12H3c-0.5,0-1,0.5-1,1v18c0,0.5,0.5,1,1,1h16c0.5,0,1-0.5,1-1V13C20,12.5,19.5,12,19,12z M12,26h-2v-5.2&#xD;&#xA;	H8v-1.2c0.3,0,0.6,0,0.8-0.1c0.3,0,0.5-0.1,0.7-0.3c0.2-0.1,0.4-0.3,0.5-0.5c0.1-0.2,0.2-0.5,0.3-0.8H12V26z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black54" d="M31,0H15c-0.5,0-1,0.5-1,1v3h-3c-0.5,0-1,0.5-1,1v3H7C6.5,8,6,8.5,6,9v3h2v-2h14v16h-2v2h3c0.5,0,1-0.5,1-1&#xD;&#xA;	v-3h3c0.5,0,1-0.5,1-1v-3h3c0.5,0,1-0.5,1-1V1C32,0.5,31.5,0,31,0z M26,22h-2V9c0-0.5-0.5-1-1-1H12V6h14V22z M30,18h-2V5&#xD;&#xA;	c0-0.5-0.5-1-1-1H16V2h14V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 918)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black54_white { fill:#FFFFFF;}
	.Green54_white { fill:#FFFFFF;}
</style>
<path class="Green54_white" d="M19,12H3c-0.5,0-1,0.5-1,1v18c0,0.5,0.5,1,1,1h16c0.5,0,1-0.5,1-1V13C20,12.5,19.5,12,19,12z M12,26h-2v-5.2&#xD;&#xA;	H8v-1.2c0.3,0,0.6,0,0.8-0.1c0.3,0,0.5-0.1,0.7-0.3c0.2-0.1,0.4-0.3,0.5-0.5c0.1-0.2,0.2-0.5,0.3-0.8H12V26z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black54_white" d="M31,0H15c-0.5,0-1,0.5-1,1v3h-3c-0.5,0-1,0.5-1,1v3H7C6.5,8,6,8.5,6,9v3h2v-2h14v16h-2v2h3c0.5,0,1-0.5,1-1&#xD;&#xA;	v-3h3c0.5,0,1-0.5,1-1v-3h3c0.5,0,1-0.5,1-1V1C32,0.5,31.5,0,31,0z M26,22h-2V9c0-0.5-0.5-1-1-1H12V6h14V22z M30,18h-2V5&#xD;&#xA;	c0-0.5-0.5-1-1-1H16V2h14V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black55 { fill:#727272;}
	.Green55 { fill:#404040;}
</style>
<path class="Green55" d="M28,5v18c0,0.5-0.5,1-1,1h-5V10H10V5c0-0.5,0.5-1,1-1h16C27.5,4,28,4.5,28,5z M3,32h16c0.5,0,1-0.5,1-1V13&#xD;&#xA;	c0-0.6-0.5-1-1-1H3c-0.5,0-1,0.4-1,1v18C2,31.5,2.5,32,3,32z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black55" d="M24,9v18c0,0.5-0.5,1-1,1h-3v-2h2V10H8v2H6V9c0-0.5,0.5-1,1-1h16C23.5,8,24,8.5,24,9z M31,0H15&#xD;&#xA;	c-0.5,0-1,0.5-1,1v3h2V2h14v16h-2v2h3c0.5,0,1-0.5,1-1V1C32,0.5,31.5,0,31,0z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 748)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black55_white { fill:#FFFFFF;}
	.Green55_white { fill:#FFFFFF;}
</style>
<path class="Green55_white" d="M28,5v18c0,0.5-0.5,1-1,1h-5V10H10V5c0-0.5,0.5-1,1-1h16C27.5,4,28,4.5,28,5z M3,32h16c0.5,0,1-0.5,1-1V13&#xD;&#xA;	c0-0.6-0.5-1-1-1H3c-0.5,0-1,0.4-1,1v18C2,31.5,2.5,32,3,32z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black55_white" d="M24,9v18c0,0.5-0.5,1-1,1h-3v-2h2V10H8v2H6V9c0-0.5,0.5-1,1-1h16C23.5,8,24,8.5,24,9z M31,0H15&#xD;&#xA;	c-0.5,0-1,0.5-1,1v3h2V2h14v16h-2v2h3c0.5,0,1-0.5,1-1V1C32,0.5,31.5,0,31,0z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black56 { fill:#727272;}
	.Red56 { fill:#585858;}
	.Blue56 { fill:#757575;}
</style>
<path class="Black56" d="M6,6h14v2H6V6z M6,12h14v-2H6V12z M14.9,24.6l0.6-0.6H2V2h22v13.5l0.6-0.6c0.4-0.4,0.9-0.7,1.4-0.8V1&#xD;&#xA;	c0-0.5-0.5-1-1-1H1C0.5,0,0,0.5,0,1v24c0,0.5,0.5,1,1,1h13.1C14.3,25.5,14.5,25,14.9,24.6z M6,16h14v-2H6V16z M6,20h14v-2H6V20z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue56" d="M19,23.3L16.3,26c-0.4,0.4-0.4,1.2,0,1.6l4,4c0.4,0.4,1.2,0.4,1.6,0l2.7-2.7L19,23.3z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red56" d="M31.7,20.4l-4-4c-0.4-0.4-1.2-0.4-1.6,0l-6.1,6.1l5.6,5.6l6.1-6.1C32.1,21.5,32.1,20.8,31.7,20.4z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 680)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black56_white { fill:#FFFFFF;}
	.Red56_white { fill:#FFFFFF;}
	.Blue56_white { fill:#FFFFFF;}
</style>
<path class="Black56_white" d="M6,6h14v2H6V6z M6,12h14v-2H6V12z M14.9,24.6l0.6-0.6H2V2h22v13.5l0.6-0.6c0.4-0.4,0.9-0.7,1.4-0.8V1&#xD;&#xA;	c0-0.5-0.5-1-1-1H1C0.5,0,0,0.5,0,1v24c0,0.5,0.5,1,1,1h13.1C14.3,25.5,14.5,25,14.9,24.6z M6,16h14v-2H6V16z M6,20h14v-2H6V20z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue56_white" d="M19,23.3L16.3,26c-0.4,0.4-0.4,1.2,0,1.6l4,4c0.4,0.4,1.2,0.4,1.6,0l2.7-2.7L19,23.3z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red56_white" d="M31.7,20.4l-4-4c-0.4-0.4-1.2-0.4-1.6,0l-6.1,6.1l5.6,5.6l6.1-6.1C32.1,21.5,32.1,20.8,31.7,20.4z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow57 { fill:#979797;}
	.Black57 { fill:#727272;}
</style>
<path class="Yellow57" d="M31,24h-1v-3c0-1.7-1.3-3-3-3h-2c-1.7,0-3,1.3-3,3v3h-1c-0.6,0-1,0.4-1,1v6c0,0.6,0.4,1,1,1h10&#xD;&#xA;	c0.6,0,1-0.4,1-1v-6C32,24.4,31.6,24,31,24z M24,21c0-0.6,0.4-1,1-1h2c0.6,0,1,0.4,1,1v3h-4V21z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black57" d="M10,22h10v0.2c-0.9,0.3-1.5,1-1.8,1.8H10V22z M27,4H12.3c0,0,0,0,0,0c0,0.1,0.1,0.2,0.1,0.4&#xD;&#xA;	C12.6,5,12.5,5.6,12.3,6H26v10h1c0.3,0,0.7,0,1,0.1V5C28,4.4,27.6,4,27,4z M10,18v2h10.1c0.2-0.7,0.5-1.4,0.9-2h-5H10z M6,18H4v11&#xD;&#xA;	c0,0.6,0.4,1,1,1h13v-2H6V18z M16,15.1V16h6v-2h-6.1C16,14.3,16,14.7,16,15.1z M15.4,12H22v-2h-8.6C14.1,10.4,14.9,11,15.4,12z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black57" d="M3.7,5.7C3.6,5.4,3.4,5.2,3.5,4.8c0-0.1,0.2-0.2,0.3-0.2C3.1,2.4,3.8,0.2,6.3,0C9-0.2,9.5,1.8,9.5,1.8&#xD;&#xA;	s1.4-0.1,0.6,2.9c0.1,0,0.3,0,0.3,0.2c0.1,0.3,0,0.6-0.2,0.9c-0.1,0.3,0.1,1-0.5,1c0,0,0,0.1,0,0.1c-0.3,1.4-1.2,3-2.8,3&#xD;&#xA;	c-1.6,0-2.4-1.6-2.8-3c0,0,0-0.1,0-0.1C3.7,6.7,3.9,6,3.7,5.7z M9.3,9.9c-0.5,0.9-1.2,2.5-2.3,2.5c-1.1,0-1.8-1.6-2.3-2.6&#xD;&#xA;	C3.4,12.1,0,10.5,0,15.1V16h14v-0.9C14,10.5,10.7,12,9.3,9.9z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 680)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow57_white { fill:#FFFFFF;}
	.Black57_white { fill:#FFFFFF;}
</style>
<path class="Yellow57_white" d="M31,24h-1v-3c0-1.7-1.3-3-3-3h-2c-1.7,0-3,1.3-3,3v3h-1c-0.6,0-1,0.4-1,1v6c0,0.6,0.4,1,1,1h10&#xD;&#xA;	c0.6,0,1-0.4,1-1v-6C32,24.4,31.6,24,31,24z M24,21c0-0.6,0.4-1,1-1h2c0.6,0,1,0.4,1,1v3h-4V21z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black57_white" d="M10,22h10v0.2c-0.9,0.3-1.5,1-1.8,1.8H10V22z M27,4H12.3c0,0,0,0,0,0c0,0.1,0.1,0.2,0.1,0.4&#xD;&#xA;	C12.6,5,12.5,5.6,12.3,6H26v10h1c0.3,0,0.7,0,1,0.1V5C28,4.4,27.6,4,27,4z M10,18v2h10.1c0.2-0.7,0.5-1.4,0.9-2h-5H10z M6,18H4v11&#xD;&#xA;	c0,0.6,0.4,1,1,1h13v-2H6V18z M16,15.1V16h6v-2h-6.1C16,14.3,16,14.7,16,15.1z M15.4,12H22v-2h-8.6C14.1,10.4,14.9,11,15.4,12z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black57_white" d="M3.7,5.7C3.6,5.4,3.4,5.2,3.5,4.8c0-0.1,0.2-0.2,0.3-0.2C3.1,2.4,3.8,0.2,6.3,0C9-0.2,9.5,1.8,9.5,1.8&#xD;&#xA;	s1.4-0.1,0.6,2.9c0.1,0,0.3,0,0.3,0.2c0.1,0.3,0,0.6-0.2,0.9c-0.1,0.3,0.1,1-0.5,1c0,0,0,0.1,0,0.1c-0.3,1.4-1.2,3-2.8,3&#xD;&#xA;	c-1.6,0-2.4-1.6-2.8-3c0,0,0-0.1,0-0.1C3.7,6.7,3.9,6,3.7,5.7z M9.3,9.9c-0.5,0.9-1.2,2.5-2.3,2.5c-1.1,0-1.8-1.6-2.3-2.6&#xD;&#xA;	C3.4,12.1,0,10.5,0,15.1V16h14v-0.9C14,10.5,10.7,12,9.3,9.9z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(510, 34)">
<path d="M20.7,18.6l-4.9-5.1c0.8-1.2,1.2-2.6,1.2-4C17,5.4,13.6,2,9.5,2S2,5.4,2,9.5S5.4,17,9.5,17c1.5,0,3-0.5,4.2-1.3l4.9,4.9&#xD;&#xA;	c0.4,0.4,1.1,0.4,1.5,0l0.6-0.6C21.1,19.7,21.1,19,20.7,18.6z M4,9.5C4,6.5,6.5,4,9.5,4c3,0,5.5,2.5,5.5,5.5c0,3-2.5,5.5-5.5,5.5&#xD;&#xA;	C6.5,15,4,12.5,4,9.5z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(510, 544)">
<path d="M20.7,18.6l-4.9-5.1c0.8-1.2,1.2-2.6,1.2-4C17,5.4,13.6,2,9.5,2S2,5.4,2,9.5S5.4,17,9.5,17c1.5,0,3-0.5,4.2-1.3l4.9,4.9&#xD;&#xA;	c0.4,0.4,1.1,0.4,1.5,0l0.6-0.6C21.1,19.7,21.1,19,20.7,18.6z M4,9.5C4,6.5,6.5,4,9.5,4c3,0,5.5,2.5,5.5,5.5c0,3-2.5,5.5-5.5,5.5&#xD;&#xA;	C6.5,15,4,12.5,4,9.5z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(510, 0)">
<path d="M20.7,18.6l-4.9-5.1c0.8-1.2,1.2-2.6,1.2-4C17,5.4,13.6,2,9.5,2S2,5.4,2,9.5S5.4,17,9.5,17c1.5,0,3-0.5,4.2-1.3l4.9,4.9&#xD;&#xA;	c0.4,0.4,1.1,0.4,1.5,0l0.6-0.6C21.1,19.7,21.1,19,20.7,18.6z M4,9.5C4,6.5,6.5,4,9.5,4c3,0,5.5,2.5,5.5,5.5c0,3-2.5,5.5-5.5,5.5&#xD;&#xA;	C6.5,15,4,12.5,4,9.5z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(510, 510)">
<path d="M20.7,18.6l-4.9-5.1c0.8-1.2,1.2-2.6,1.2-4C17,5.4,13.6,2,9.5,2S2,5.4,2,9.5S5.4,17,9.5,17c1.5,0,3-0.5,4.2-1.3l4.9,4.9&#xD;&#xA;	c0.4,0.4,1.1,0.4,1.5,0l0.6-0.6C21.1,19.7,21.1,19,20.7,18.6z M4,9.5C4,6.5,6.5,4,9.5,4c3,0,5.5,2.5,5.5,5.5c0,3-2.5,5.5-5.5,5.5&#xD;&#xA;	C6.5,15,4,12.5,4,9.5z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue60 { fill:#757575;}
</style>
<path class="Blue60" d="M10.4,14.5c-0.5,0.3-0.5,0.8,0,1.1l16.8,10.3c0.5,0.3,0.9,0.1,0.9-0.5V4.6c0-0.6-0.4-0.8-0.9-0.5L10.4,14.5z&#xD;&#xA;	 M4,25V5c0-0.6,0.4-1,1-1h2c0.6,0,1,0.4,1,1v20c0,0.5-0.4,1-1,1H5C4.4,26,4,25.5,4,25z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 680)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue60_white { fill:#FFFFFF;}
</style>
<path class="Blue60_white" d="M10.4,14.5c-0.5,0.3-0.5,0.8,0,1.1l16.8,10.3c0.5,0.3,0.9,0.1,0.9-0.5V4.6c0-0.6-0.4-0.8-0.9-0.5L10.4,14.5z&#xD;&#xA;	 M4,25V5c0-0.6,0.4-1,1-1h2c0.6,0,1,0.4,1,1v20c0,0.5-0.4,1-1,1H5C4.4,26,4,25.5,4,25z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow61 { fill:#979797;}
	.Black61 { fill:#727272;}
</style>
<path class="Black61" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M18,6H4V4h14V6z M18,10H4V8h14V10z M26,14H4v-2h22V14z M26,18H4v-2h22V18z M26,22H4v-2h22V22z M26,26H4v-2h22V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="20" y="4" class="Yellow61" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 680)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow61_white { fill:#FFFFFF;}
	.Black61_white { fill:#FFFFFF;}
</style>
<path class="Black61_white" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M18,6H4V4h14V6z M18,10H4V8h14V10z M26,14H4v-2h22V14z M26,18H4v-2h22V18z M26,22H4v-2h22V22z M26,26H4v-2h22V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="20" y="4" class="Yellow61_white" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black62 { fill:#727272;}
	.Yellow62 { fill:#979797;}
</style>
<path class="Yellow62" d="M22,21c0,0.6-0.4,1-1,1H3c-0.6,0-1-0.4-1-1V3c0-0.6,0.4-1,1-1h18c0.6,0,1,0.4,1,1V21z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black62" d="M29,14h-5v2h4v12H16v-4h-2v5c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1V15C30,14.4,29.6,14,29,14z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 680)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black62_white { fill:#FFFFFF;}
	.Yellow62_white { fill:#FFFFFF;}
</style>
<path class="Yellow62_white" d="M22,21c0,0.6-0.4,1-1,1H3c-0.6,0-1-0.4-1-1V3c0-0.6,0.4-1,1-1h18c0.6,0,1,0.4,1,1V21z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black62_white" d="M29,14h-5v2h4v12H16v-4h-2v5c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1V15C30,14.4,29.6,14,29,14z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black63 { fill:#727272;}
	.Blue63 { fill:#757575;}
</style>
<path class="Black63" d="M4,8h14v2H4V8z M4,6h14V4H4V6z M10,21c0-0.3,0-0.7,0.1-1H2V2h18v8.1c0.3,0,0.7-0.1,1-0.1s0.7,0,1,0.1V1&#xD;&#xA;	c0-0.5-0.5-1-1-1H1C0.5,0,0,0.5,0,1v20c0,0.5,0.5,1,1,1h9.1C10,21.7,10,21.3,10,21z M4,14h8.5c0.6-0.8,1.4-1.4,2.2-2H4V14z M4,18&#xD;&#xA;	h6.4c0.2-0.7,0.5-1.4,0.8-2H4V18z" xmlns="http://www.w3.org/2000/svg" />
<circle class="Blue63" cx="21" cy="21" r="9" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 680)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black63_white { fill:#FFFFFF;}
	.Blue63_white { fill:#FFFFFF;}
</style>
<path class="Black63_white" d="M4,8h14v2H4V8z M4,6h14V4H4V6z M10,21c0-0.3,0-0.7,0.1-1H2V2h18v8.1c0.3,0,0.7-0.1,1-0.1s0.7,0,1,0.1V1&#xD;&#xA;	c0-0.5-0.5-1-1-1H1C0.5,0,0,0.5,0,1v20c0,0.5,0.5,1,1,1h9.1C10,21.7,10,21.3,10,21z M4,14h8.5c0.6-0.8,1.4-1.4,2.2-2H4V14z M4,18&#xD;&#xA;	h6.4c0.2-0.7,0.5-1.4,0.8-2H4V18z" xmlns="http://www.w3.org/2000/svg" />
<circle class="Blue63_white" cx="21" cy="21" r="9" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black64 { fill:#727272;}
	.Yellow64 { fill:#979797;}
</style>
<path class="Yellow64" d="M26,25c0,0.6-0.4,1-1,1H7c-0.6,0-1-0.4-1-1V7c0-0.6,0.4-1,1-1h18c0.6,0,1,0.4,1,1V25z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black64" d="M32,19v12c0,0.6-0.4,1-1,1H19c-0.6,0-1-0.4-1-1v-3h2v2h10V20h-2v-2h3C31.6,18,32,18.4,32,19z M1,14h3v-2H2V2&#xD;&#xA;	h10v2h2V1c0-0.6-0.4-1-1-1H1C0.4,0,0,0.4,0,1v12C0,13.6,0.4,14,1,14z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 748)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black64_white { fill:#FFFFFF;}
	.Yellow64_white { fill:#FFFFFF;}
</style>
<path class="Yellow64_white" d="M26,25c0,0.6-0.4,1-1,1H7c-0.6,0-1-0.4-1-1V7c0-0.6,0.4-1,1-1h18c0.6,0,1,0.4,1,1V25z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black64_white" d="M32,19v12c0,0.6-0.4,1-1,1H19c-0.6,0-1-0.4-1-1v-3h2v2h10V20h-2v-2h3C31.6,18,32,18.4,32,19z M1,14h3v-2H2V2&#xD;&#xA;	h10v2h2V1c0-0.6-0.4-1-1-1H1C0.4,0,0,0.4,0,1v12C0,13.6,0.4,14,1,14z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black65 { fill:#727272;}
	.Blue65 { fill:#757575;}
</style>
<path class="Black65" d="M4,8h14v2H4V8z M4,6h14V4H4V6z M10,21c0-0.3,0-0.7,0.1-1H2V2h18v8.1c0.3,0,0.7-0.1,1-0.1s0.7,0,1,0.1V1&#xD;&#xA;	c0-0.5-0.5-1-1-1H1C0.5,0,0,0.5,0,1v20c0,0.5,0.5,1,1,1h9.1C10,21.7,10,21.3,10,21z M4,14h8.5c0.6-0.8,1.4-1.4,2.2-2H4V14z M4,18&#xD;&#xA;	h6.4c0.2-0.7,0.5-1.4,0.8-2H4V18z" xmlns="http://www.w3.org/2000/svg" />
<circle class="Blue65" cx="21" cy="21" r="9" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 680)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black65_white { fill:#FFFFFF;}
	.Blue65_white { fill:#FFFFFF;}
</style>
<path class="Black65_white" d="M4,8h14v2H4V8z M4,6h14V4H4V6z M10,21c0-0.3,0-0.7,0.1-1H2V2h18v8.1c0.3,0,0.7-0.1,1-0.1s0.7,0,1,0.1V1&#xD;&#xA;	c0-0.5-0.5-1-1-1H1C0.5,0,0,0.5,0,1v20c0,0.5,0.5,1,1,1h9.1C10,21.7,10,21.3,10,21z M4,14h8.5c0.6-0.8,1.4-1.4,2.2-2H4V14z M4,18&#xD;&#xA;	h6.4c0.2-0.7,0.5-1.4,0.8-2H4V18z" xmlns="http://www.w3.org/2000/svg" />
<circle class="Blue65_white" cx="21" cy="21" r="9" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue66 { fill:#757575;}
	.Black66 { fill:#727272;}
</style>
<path class="Black66" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M6,22H4v-2h2V22z M4,26h22v-2H4V26z M6,12H4v2h2V12z M6,8H4v2h2V8z M6,16H4v2h2V16z M4,4v2h2h18h2V4H4z M24,22h2v-2h-2V22z M24,10&#xD;&#xA;	h2V8h-2V10z M24,14h2v-2h-2V14z M24,18h2v-2h-2V18z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue66" d="M8,8v6h6V8H8z M12,12h-2v-2h2V12z M16,8v6h6V8H16z M20,12h-2v-2h2V12z M16,16v6h6v-6H16z M20,20h-2v-2h2V20z&#xD;&#xA;	 M8,16v6h6v-6H8z M12,20h-2v-2h2V20z M16,12h-2v-2h2V12z M12,14h-2v2h2V14z M20,14h-2v2h2V14z M16,18h-2v2h2V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 748)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue66_white { fill:#FFFFFF;}
	.Black66_white { fill:#FFFFFF;}
</style>
<path class="Black66_white" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M6,22H4v-2h2V22z M4,26h22v-2H4V26z M6,12H4v2h2V12z M6,8H4v2h2V8z M6,16H4v2h2V16z M4,4v2h2h18h2V4H4z M24,22h2v-2h-2V22z M24,10&#xD;&#xA;	h2V8h-2V10z M24,14h2v-2h-2V14z M24,18h2v-2h-2V18z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue66_white" d="M8,8v6h6V8H8z M12,12h-2v-2h2V12z M16,8v6h6V8H16z M20,12h-2v-2h2V12z M16,16v6h6v-6H16z M20,20h-2v-2h2V20z&#xD;&#xA;	 M8,16v6h6v-6H8z M12,20h-2v-2h2V20z M16,12h-2v-2h2V12z M12,14h-2v2h2V14z M20,14h-2v2h2V14z M16,18h-2v2h2V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black67 { fill:#727272;}
	.Blue67 { fill:#757575;}
</style>
<polygon class="Black67" points="17.2,10 19.2,8 2,8 2,22 10,22 10,20 4,20 4,10 " xmlns="http://www.w3.org/2000/svg" />
<path class="Blue67" d="M27,11L17,21l-4-4L23,7L27,11z M28,10l1.7-1.7c0.4-0.4,0.4-1,0-1.3l-2.7-2.7c-0.4-0.4-1-0.4-1.3,0L24,6L28,10z&#xD;&#xA;	 M12,18v4h4L12,18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 748)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black67_white { fill:#FFFFFF;}
	.Blue67_white { fill:#FFFFFF;}
</style>
<polygon class="Black67_white" points="17.2,10 19.2,8 2,8 2,22 10,22 10,20 4,20 4,10 " xmlns="http://www.w3.org/2000/svg" />
<path class="Blue67_white" d="M27,11L17,21l-4-4L23,7L27,11z M28,10l1.7-1.7c0.4-0.4,0.4-1,0-1.3l-2.7-2.7c-0.4-0.4-1-0.4-1.3,0L24,6L28,10z&#xD;&#xA;	 M12,18v4h4L12,18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black68 { fill:#727272;}
	.Yellow68 { fill:#979797;}
</style>
<path class="Black68" d="M29,14H15c-0.6,0-1,0.4-1,1v14c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1V15C30,14.4,29.6,14,29,14z M28,28H16V16&#xD;&#xA;	h12V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Yellow68" d="M12,14c0-1.1,0.9-2,2-2h8V3c0-0.6-0.4-1-1-1H3C2.4,2,2,2.4,2,3v18c0,0.6,0.4,1,1,1h9V14z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 816)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black68_white { fill:#FFFFFF;}
	.Yellow68_white { fill:#FFFFFF;}
</style>
<path class="Black68_white" d="M29,14H15c-0.6,0-1,0.4-1,1v14c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1V15C30,14.4,29.6,14,29,14z M28,28H16V16&#xD;&#xA;	h12V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Yellow68_white" d="M12,14c0-1.1,0.9-2,2-2h8V3c0-0.6-0.4-1-1-1H3C2.4,2,2,2.4,2,3v18c0,0.6,0.4,1,1,1h9V14z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black69 { fill:#727272;}
	.Blue69 { fill:#757575;}
</style>
<path class="Black69" d="M21,0H1C0.5,0,0,0.5,0,1v20c0,0.5,0.5,1,1,1h20c0.5,0,1-0.5,1-1V1C22,0.5,21.5,0,21,0z M20,20H2V2h18V20z&#xD;&#xA;	 M18,6H4V4h14V6z M18,10H4V8h14V10z M18,14H4v-2h14V14z M18,18H4v-2h14V18z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue69" d="M24,12.5V22c0,1.1-0.9,2-2,2h-9.5c1.2,3.5,4.6,6,8.5,6c5,0,9-4,9-9C30,17.1,27.5,13.8,24,12.5z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 748)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black69_white { fill:#FFFFFF;}
	.Blue69_white { fill:#FFFFFF;}
</style>
<path class="Black69_white" d="M21,0H1C0.5,0,0,0.5,0,1v20c0,0.5,0.5,1,1,1h20c0.5,0,1-0.5,1-1V1C22,0.5,21.5,0,21,0z M20,20H2V2h18V20z&#xD;&#xA;	 M18,6H4V4h14V6z M18,10H4V8h14V10z M18,14H4v-2h14V14z M18,18H4v-2h14V18z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue69_white" d="M24,12.5V22c0,1.1-0.9,2-2,2h-9.5c1.2,3.5,4.6,6,8.5,6c5,0,9-4,9-9C30,17.1,27.5,13.8,24,12.5z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black70 { fill:#727272;}
	.Yellow70 { fill:#979797;}
</style>
<path class="Black70" d="M13,0H1C0.4,0,0,0.4,0,1v12c0,0.6,0.4,1,1,1h12c0.6,0,1-0.4,1-1V1C14,0.4,13.6,0,13,0z M12,12H2V2h10V12z&#xD;&#xA;	 M31,18H19c-0.6,0-1,0.4-1,1v12c0,0.6,0.4,1,1,1h12c0.6,0,1-0.4,1-1V19C32,18.4,31.6,18,31,18z M30,30H20V20h10V30z" xmlns="http://www.w3.org/2000/svg" />
<path class="Yellow70" d="M25,6h-9v8c0,1.1-0.9,2-2,2H6v9c0,0.6,0.4,1,1,1h9v-8c0-1.1,0.9-2,2-2h8V7C26,6.4,25.6,6,25,6z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 884)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black70_white { fill:#FFFFFF;}
	.Yellow70_white { fill:#FFFFFF;}
</style>
<path class="Black70_white" d="M13,0H1C0.4,0,0,0.4,0,1v12c0,0.6,0.4,1,1,1h12c0.6,0,1-0.4,1-1V1C14,0.4,13.6,0,13,0z M12,12H2V2h10V12z&#xD;&#xA;	 M31,18H19c-0.6,0-1,0.4-1,1v12c0,0.6,0.4,1,1,1h12c0.6,0,1-0.4,1-1V19C32,18.4,31.6,18,31,18z M30,30H20V20h10V30z" xmlns="http://www.w3.org/2000/svg" />
<path class="Yellow70_white" d="M25,6h-9v8c0,1.1-0.9,2-2,2H6v9c0,0.6,0.4,1,1,1h9v-8c0-1.1,0.9-2,2-2h8V7C26,6.4,25.6,6,25,6z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black71 { fill:#727272;}
	.Blue71 { fill:#757575;}
</style>
<path class="Black71" d="M31,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h30c0.5,0,1-0.5,1-1V1C32,0.5,31.5,0,31,0z M30,28H2V2h28V28z&#xD;&#xA;	 M6,22H4v-2h2V22z M6,16H4v2h2V16z M6,8H4v2h2V8z M4,26h24v-2H4V26z M6,12H4v2h2V12z M4,4v2h24V4H4z M26,22h2v-2h-2V22z M26,10h2V8&#xD;&#xA;	h-2V10z M26,14h2v-2h-2V14z M26,18h2v-2h-2V18z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue71" d="M20.1,16.2C21.8,14.5,24,11.6,24,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C10.8,16.7,10,17.7,10,19&#xD;&#xA;	c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C22,17.7,21.2,16.7,20.1,16.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 748)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black71_white { fill:#FFFFFF;}
	.Blue71_white { fill:#FFFFFF;}
</style>
<path class="Black71_white" d="M31,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h30c0.5,0,1-0.5,1-1V1C32,0.5,31.5,0,31,0z M30,28H2V2h28V28z&#xD;&#xA;	 M6,22H4v-2h2V22z M6,16H4v2h2V16z M6,8H4v2h2V8z M4,26h24v-2H4V26z M6,12H4v2h2V12z M4,4v2h24V4H4z M26,22h2v-2h-2V22z M26,10h2V8&#xD;&#xA;	h-2V10z M26,14h2v-2h-2V14z M26,18h2v-2h-2V18z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue71_white" d="M20.1,16.2C21.8,14.5,24,11.6,24,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C10.8,16.7,10,17.7,10,19&#xD;&#xA;	c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C22,17.7,21.2,16.7,20.1,16.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st072 {fill:#727272;}
</style>
<path class="st072" d="M21.7,28H26L17.3,4h-0.4H13h-0.4L4,28h4.3l2.2-6h9.1L21.7,28z M11.9,18L15,9.4l3.1,8.6H11.9z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 816)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st072_white { fill:#FFFFFF;}
</style>
<path class="st072_white" d="M21.7,28H26L17.3,4h-0.4H13h-0.4L4,28h4.3l2.2-6h9.1L21.7,28z M11.9,18L15,9.4l3.1,8.6H11.9z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st073 {fill:#727272;}
	.st173 {opacity:0.5;fill:#727272;}
	.st273 {opacity:0.75;fill:#727272;}
</style>
<path id="layer_3_" class="st073" d="M18,25.5c4,4-2.5-2.5,1.5,1.5c0,5.4-6.5,5-8.5,5C15.5,27.5,14.3,25.5,18,25.5z" xmlns="http://www.w3.org/2000/svg" />
<path id="layer_2_" class="st173" d="M31,14L31,14c-0.4-0.4-1.5-1.5-3,0l-9,9l3,3l9-9C32.5,15.5,31.4,14.4,31,14z" xmlns="http://www.w3.org/2000/svg" />
<path id="layer_1_" class="st273" d="M19,23L19,23c-0.4,0.4-1.4,2.1-1,2.5l1.5,1.5c0.4,0.4,2.1-0.6,2.5-1l0,0L19,23z" xmlns="http://www.w3.org/2000/svg" />
<path id="layer" class="st073" d="M17.8,21.2l2.8-2.8L14,0h-4L2,22h3.9l1.8-5.6h8.5L17.8,21.2z M8.6,13.4l2.9-8.8&#xD;&#xA;	c0.1-0.4,0.2-0.8,0.3-1.4h0.1c0.1,0.7,0.2,1.1,0.3,1.4l3,8.8H8.6z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 816)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st073_white { fill:#FFFFFF;}
	.st173_white { fill:#FFFFFF;}
	.st273_white { fill:#FFFFFF;}
</style>
<path id="layer_3_" class="st073_white" d="M18,25.5c4,4-2.5-2.5,1.5,1.5c0,5.4-6.5,5-8.5,5C15.5,27.5,14.3,25.5,18,25.5z" xmlns="http://www.w3.org/2000/svg" />
<path id="layer_2_" class="st173_white" d="M31,14L31,14c-0.4-0.4-1.5-1.5-3,0l-9,9l3,3l9-9C32.5,15.5,31.4,14.4,31,14z" xmlns="http://www.w3.org/2000/svg" />
<path id="layer_1_" class="st273_white" d="M19,23L19,23c-0.4,0.4-1.4,2.1-1,2.5l1.5,1.5c0.4,0.4,2.1-0.6,2.5-1l0,0L19,23z" xmlns="http://www.w3.org/2000/svg" />
<path id="layer" class="st073_white" d="M17.8,21.2l2.8-2.8L14,0h-4L2,22h3.9l1.8-5.6h8.5L17.8,21.2z M8.6,13.4l2.9-8.8&#xD;&#xA;	c0.1-0.4,0.2-0.8,0.3-1.4h0.1c0.1,0.7,0.2,1.1,0.3,1.4l3,8.8H8.6z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st074 {fill:#727272;}
</style>
<path class="st074" d="M21.7,28H26L17.3,4h-0.4H13h-0.4L4,28h4.3l2.2-6h9.1L21.7,28z M11.9,18L15,9.4l3.1,8.6H11.9z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 816)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st074_white { fill:#FFFFFF;}
</style>
<path class="st074_white" d="M21.7,28H26L17.3,4h-0.4H13h-0.4L4,28h4.3l2.2-6h9.1L21.7,28z M11.9,18L15,9.4l3.1,8.6H11.9z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st075 {fill:#727272;}
</style>
<path class="st075" d="M19.7,28H24L15.3,4h-0.4H11h-0.4L2,28h4.3l2.2-6h9.1L19.7,28z M9.9,18L13,9.4l3.1,8.6H9.9z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="st075" points="30,8 32,8 29,4 26,8 28,8 28,24 26,24 29,28 32,24 30,24 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 816)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st075_white { fill:#FFFFFF;}
</style>
<path class="st075_white" d="M19.7,28H24L15.3,4h-0.4H11h-0.4L2,28h4.3l2.2-6h9.1L19.7,28z M9.9,18L13,9.4l3.1,8.6H9.9z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="st075_white" points="30,8 32,8 29,4 26,8 28,8 28,24 26,24 29,28 32,24 30,24 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black76 { fill:#727272;}
	.Blue76 { fill:#757575;}
</style>
<path class="Black76" d="M22,28h-2.7l-1.2-4h-6.1l-1.2,4H8l5.6-16h2.8L22,28z M17.3,22l-2.1-6.6c-0.1-0.2-0.1-0.5-0.2-1h0&#xD;&#xA;	c-0.1,0.4-0.1,0.8-0.2,1L12.7,22H17.3z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Blue76" points="22,4 30,4 26,8 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 782)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black76_white { fill:#FFFFFF;}
	.Blue76_white { fill:#FFFFFF;}
</style>
<path class="Black76_white" d="M22,28h-2.7l-1.2-4h-6.1l-1.2,4H8l5.6-16h2.8L22,28z M17.3,22l-2.1-6.6c-0.1-0.2-0.1-0.5-0.2-1h0&#xD;&#xA;	c-0.1,0.4-0.1,0.8-0.2,1L12.7,22H17.3z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Blue76_white" points="22,4 30,4 26,8 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black77 { fill:#727272;}
	.Blue77 { fill:#757575;}
</style>
<polygon class="Blue77" points="22,8 30,8 26,4 " xmlns="http://www.w3.org/2000/svg" />
<path class="Black77" d="M24,28h-3.9l-1.9-5.6H9.7L7.9,28H4l8-22h4L24,28z M17.2,19.4l-3-8.8c-0.1-0.3-0.2-0.7-0.3-1.4h-0.1&#xD;&#xA;	c-0.1,0.6-0.2,1-0.3,1.4l-2.9,8.8H17.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 748)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black77_white { fill:#FFFFFF;}
	.Blue77_white { fill:#FFFFFF;}
</style>
<polygon class="Blue77_white" points="22,8 30,8 26,4 " xmlns="http://www.w3.org/2000/svg" />
<path class="Black77_white" d="M24,28h-3.9l-1.9-5.6H9.7L7.9,28H4l8-22h4L24,28z M17.2,19.4l-3-8.8c-0.1-0.3-0.2-0.7-0.3-1.4h-0.1&#xD;&#xA;	c-0.1,0.6-0.2,1-0.3,1.4l-2.9,8.8H17.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black78 { fill:#727272;}
	.Yellow78 { fill:#979797;}
	.st078 {opacity:0.75;}
</style>
<path class="Black78" d="M25,2H5C4.5,2,4,2.5,4,3v24c0,0.5,0.5,1,1,1h20c0.5,0,1-0.5,1-1V3C26,2.5,25.5,2,25,2z M24,26H6V4h18V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="8" y="18" class="Yellow78" width="14" height="6" xmlns="http://www.w3.org/2000/svg" />
<g class="st078" xmlns="http://www.w3.org/2000/svg">
	<path class="Black78" d="M22,8H8V6h14V8z M22,10H8v2h14V10z M22,14H8v2h14V14z" />
</g>
</g>

<g transform="translate(68, 680)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black78_white { fill:#FFFFFF;}
	.Yellow78_white { fill:#FFFFFF;}
	.st078_white {opacity:0.75;}
</style>
<path class="Black78_white" d="M25,2H5C4.5,2,4,2.5,4,3v24c0,0.5,0.5,1,1,1h20c0.5,0,1-0.5,1-1V3C26,2.5,25.5,2,25,2z M24,26H6V4h18V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="8" y="18" class="Yellow78_white" width="14" height="6" xmlns="http://www.w3.org/2000/svg" />
<g class="st078_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black78_white" d="M22,8H8V6h14V8z M22,10H8v2h14V10z M22,14H8v2h14V14z" />
</g>
</g>

<g transform="translate(408, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue79 { fill:#757575;}
	.Yellow79 { fill:#979797;}
	.Black79 { fill:#727272;}
	.Green79 { fill:#404040;}
	.Red79 { fill:#585858;}
	.st079 {opacity:0.75;}
	.st179 {opacity:0.5;}
</style>
<g id="FullScreen" xmlns="http://www.w3.org/2000/svg">
	<polygon class="Black79" points="2,12 6,12 6,6 12,6 12,2 2,2 	" />
	<polygon class="Black79" points="6,20 2,20 2,30 12,30 12,26 6,26 	" />
	<polygon class="Black79" points="20,2 20,6 26,6 26,12 30,12 30,2 	" />
	<polygon class="Black79" points="26,26 20,26 20,30 30,30 30,20 26,20 	" />
</g>
</g>

<g transform="translate(408, 748)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue79_white { fill:#FFFFFF;}
	.Yellow79_white { fill:#FFFFFF;}
	.Black79_white { fill:#FFFFFF;}
	.Green79_white { fill:#FFFFFF;}
	.Red79_white { fill:#FFFFFF;}
	.st079_white {opacity:0.75;}
	.st179_white {opacity:0.5;}
</style>
<g id="FullScreen" xmlns="http://www.w3.org/2000/svg">
	<polygon class="Black79_white" points="2,12 6,12 6,6 12,6 12,2 2,2 	" />
	<polygon class="Black79_white" points="6,20 2,20 2,30 12,30 12,26 6,26 	" />
	<polygon class="Black79_white" points="20,2 20,6 26,6 26,12 30,12 30,2 	" />
	<polygon class="Black79_white" points="26,26 20,26 20,30 30,30 30,20 26,20 	" />
</g>
</g>

<g transform="translate(170, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black80 { fill:#727272;}
	.Yellow80 { fill:#979797;}
	.st080 {opacity:0.75;}
</style>
<g class="st080" xmlns="http://www.w3.org/2000/svg">
	<path class="Black80" d="M28,10H10V4h18V10z M18,12H8v2h10V12z M18,18H8v-2h10V18z M18,22H8v-2h10V22z" />
</g>
<rect x="10" y="24" class="Yellow80" width="18" height="6" xmlns="http://www.w3.org/2000/svg" />
<path class="Black80" d="M6,26h4v2H5c-0.5,0-1-0.5-1-1V7c0-0.5,0.5-1,1-1h5v2H6V26z M20,10v14h2V10H20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 884)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black80_white { fill:#FFFFFF;}
	.Yellow80_white { fill:#FFFFFF;}
	.st080_white {opacity:0.75;}
</style>
<g class="st080_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black80_white" d="M28,10H10V4h18V10z M18,12H8v2h10V12z M18,18H8v-2h10V18z M18,22H8v-2h10V22z" />
</g>
<rect x="10" y="24" class="Yellow80_white" width="18" height="6" xmlns="http://www.w3.org/2000/svg" />
<path class="Black80_white" d="M6,26h4v2H5c-0.5,0-1-0.5-1-1V7c0-0.5,0.5-1,1-1h5v2H6V26z M20,10v14h2V10H20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black81 { fill:#727272;}
	.Yellow81 { fill:#979797;}
	.st081 {opacity:0.75;}
</style>
<g class="st081" xmlns="http://www.w3.org/2000/svg">
	<path class="Black81" d="M28,30H10v-6h18V30z M18,12H8v2h10V12z M18,18H8v-2h10V18z M18,22H8v-2h10V22z" />
</g>
<rect x="10" y="4" class="Yellow81" width="18" height="6" xmlns="http://www.w3.org/2000/svg" />
<path class="Black81" d="M6,26h4v2H5c-0.5,0-1-0.5-1-1V7c0-0.5,0.5-1,1-1h5v2H6V26z M20,10v14h2V10H20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 850)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black81_white { fill:#FFFFFF;}
	.Yellow81_white { fill:#FFFFFF;}
	.st081_white {opacity:0.75;}
</style>
<g class="st081_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black81_white" d="M28,30H10v-6h18V30z M18,12H8v2h10V12z M18,18H8v-2h10V18z M18,22H8v-2h10V22z" />
</g>
<rect x="10" y="4" class="Yellow81_white" width="18" height="6" xmlns="http://www.w3.org/2000/svg" />
<path class="Black81_white" d="M6,26h4v2H5c-0.5,0-1-0.5-1-1V7c0-0.5,0.5-1,1-1h5v2H6V26z M20,10v14h2V10H20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Green82 { fill:#404040;}
	.Black82 { fill:#727272;}
	.Yellow82 { fill:#979797;}
	.st082 {opacity:0.75;}
</style>
<g class="st082" xmlns="http://www.w3.org/2000/svg">
	<path class="Black82" d="M18,14H8v-2h10V14z M18,16H8v2h10V16z M18,20H8v2h10V20z" />
</g>
<rect x="10" y="4" class="Yellow82" width="18" height="6" xmlns="http://www.w3.org/2000/svg" />
<path class="Black82" d="M20,10v16H6V8h4V6H5C4.5,6,4,6.5,4,7v20c0,0.5,0.5,1,1,1h16c0.5,0,1-0.5,1-1V10H20z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Green82" points="24,20 24,32 30,26 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 680)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Green82_white { fill:#FFFFFF;}
	.Black82_white { fill:#FFFFFF;}
	.Yellow82_white { fill:#FFFFFF;}
	.st082_white {opacity:0.75;}
</style>
<g class="st082_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black82_white" d="M18,14H8v-2h10V14z M18,16H8v2h10V16z M18,20H8v2h10V20z" />
</g>
<rect x="10" y="4" class="Yellow82_white" width="18" height="6" xmlns="http://www.w3.org/2000/svg" />
<path class="Black82_white" d="M20,10v16H6V8h4V6H5C4.5,6,4,6.5,4,7v20c0,0.5,0.5,1,1,1h16c0.5,0,1-0.5,1-1V10H20z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Green82_white" points="24,20 24,32 30,26 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Green83 { fill:#404040;}
	.Black83 { fill:#727272;}
	.Yellow83 { fill:#979797;}
	.st083 {opacity:0.75;}
</style>
<g class="st083" xmlns="http://www.w3.org/2000/svg">
	<path class="Black83" d="M18,14H8v-2h10V14z M18,16H8v2h10V16z M18,20H8v2h10V20z" />
</g>
<rect x="10" y="4" class="Yellow83" width="18" height="6" xmlns="http://www.w3.org/2000/svg" />
<path class="Black83" d="M20,10v16H6V8h4V6H5C4.5,6,4,6.5,4,7v20c0,0.5,0.5,1,1,1h16c0.5,0,1-0.5,1-1V10H20z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Green83" points="30,20 30,32 24,26 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 680)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Green83_white { fill:#FFFFFF;}
	.Black83_white { fill:#FFFFFF;}
	.Yellow83_white { fill:#FFFFFF;}
	.st083_white {opacity:0.75;}
</style>
<g class="st083_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black83_white" d="M18,14H8v-2h10V14z M18,16H8v2h10V16z M18,20H8v2h10V20z" />
</g>
<rect x="10" y="4" class="Yellow83_white" width="18" height="6" xmlns="http://www.w3.org/2000/svg" />
<path class="Black83_white" d="M20,10v16H6V8h4V6H5C4.5,6,4,6.5,4,7v20c0,0.5,0.5,1,1,1h16c0.5,0,1-0.5,1-1V10H20z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Green83_white" points="30,20 30,32 24,26 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black84 { fill:#727272;}
	.Yellow84 { fill:#979797;}
	.st084 {opacity:0.75;}
</style>
<path class="Black84" d="M25,2H5C4.5,2,4,2.5,4,3v24c0,0.5,0.5,1,1,1h20c0.5,0,1-0.5,1-1V3C26,2.5,25.5,2,25,2z M24,26H6V4h18V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="8" y="6" class="Yellow84" width="14" height="6" xmlns="http://www.w3.org/2000/svg" />
<g class="st084" xmlns="http://www.w3.org/2000/svg">
	<path class="Black84" d="M22,16H8v-2h14V16z M22,18H8v2h14V18z M22,22H8v2h14V22z" />
</g>
</g>

<g transform="translate(374, 680)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black84_white { fill:#FFFFFF;}
	.Yellow84_white { fill:#FFFFFF;}
	.st084_white {opacity:0.75;}
</style>
<path class="Black84_white" d="M25,2H5C4.5,2,4,2.5,4,3v24c0,0.5,0.5,1,1,1h20c0.5,0,1-0.5,1-1V3C26,2.5,25.5,2,25,2z M24,26H6V4h18V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="8" y="6" class="Yellow84_white" width="14" height="6" xmlns="http://www.w3.org/2000/svg" />
<g class="st084_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black84_white" d="M22,16H8v-2h14V16z M22,18H8v2h14V18z M22,22H8v2h14V22z" />
</g>
</g>

<g transform="translate(408, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow85 { fill:#979797;}
	.Red85 { fill:#585858;}
	.Blue85 { fill:#757575;}
	.Green85 { fill:#404040;}
	.Black85 { fill:#727272;}
	.White85 { fill:#FFFFFF;}
	.st085 {opacity:0.75;}
</style>
<g id="Highlight" xmlns="http://www.w3.org/2000/svg">
	<path class="Black85" d="M0.8,5.4c0.3-0.4,0.7-0.8,1.1-1C2.3,4.1,2.8,4,3.4,3.8C4,3.7,4.5,3.6,5.1,3.6c0.5,0,1,0,1.6,0.1&#xD;&#xA;		c0.5,0.1,1,0.2,1.4,0.4c0.4,0.2,0.7,0.5,1,0.9s0.4,0.9,0.4,1.5v5.3c0,0.5,0,0.9,0.1,1.3c0.1,0.4,0.1,0.7,0.3,0.9H7.1&#xD;&#xA;		C7,13.9,7,13.7,6.9,13.5c0-0.2-0.1-0.3-0.1-0.5c-0.4,0.5-1,0.8-1.6,1S4,14.3,3.4,14.3c-0.5,0-0.9-0.1-1.4-0.2&#xD;&#xA;		c-0.3-0.1-0.7-0.3-1-0.6S0.4,13,0.3,12.6C0.1,12.2,0,11.8,0,11.2s0.1-1,0.3-1.4s0.5-0.7,0.8-0.9s0.7-0.4,1.1-0.5S3,8.2,3.4,8.2&#xD;&#xA;		C3.9,8.1,4.3,8.1,4.7,8c0.4,0,0.8-0.1,1.1-0.2c0.3-0.1,0.6-0.2,0.7-0.3c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3,0-0.5-0.1-0.7&#xD;&#xA;		C6.5,5.9,6.4,5.8,6.2,5.7C6,5.6,5.9,5.5,5.6,5.5c-0.2,0-0.4,0-0.7,0c-0.5,0-1,0.1-1.3,0.4C3.3,6,3.2,6.4,3.1,7H0.3&#xD;&#xA;		C0.4,6.3,0.5,5.8,0.8,5.4z M6.3,9.3C6.1,9.4,5.9,9.4,5.7,9.4c-0.2,0-0.4,0.1-0.6,0.1S4.7,9.6,4.4,9.6C4.2,9.7,4,9.7,3.8,9.8&#xD;&#xA;		C3.6,9.9,3.4,10,3.3,10.1c-0.2,0.1-0.3,0.3-0.4,0.4c-0.1,0.2-0.1,0.4-0.1,0.6c0,0.2,0,0.5,0.1,0.6C3,11.9,3.1,12,3.3,12.1&#xD;&#xA;		c0.2,0.1,0.3,0.2,0.5,0.2s0.4,0.1,0.6,0.1c0.5,0,1-0.1,1.3-0.3c0.3-0.2,0.5-0.4,0.7-0.7c0.1-0.3,0.2-0.5,0.3-0.8c0-0.3,0-0.5,0-0.6&#xD;&#xA;		V9C6.6,9.2,6.5,9.2,6.3,9.3z M14.5,0v5.1l0,0c0.3-0.5,0.8-0.9,1.4-1.1c0.6-0.2,1.2-0.4,1.8-0.4c0.5,0,1,0.1,1.5,0.3s0.9,0.5,1.3,1&#xD;&#xA;		c0.4,0.4,0.7,1,1,1.7c0.2,0.7,0.4,1.5,0.4,2.4c0,0.9-0.1,1.7-0.4,2.4c-0.2,0.7-0.6,1.2-1,1.7c-0.4,0.4-0.8,0.8-1.3,1&#xD;&#xA;		s-1,0.3-1.5,0.3c-0.7,0-1.4-0.1-2-0.4c-0.6-0.2-1-0.6-1.3-1.2l0,0V14h-2.6V0H14.5z M19,7.7c-0.1-0.4-0.2-0.7-0.4-1&#xD;&#xA;		c-0.2-0.3-0.4-0.5-0.7-0.7c-0.3-0.2-0.7-0.3-1.1-0.3S16,5.8,15.7,6c-0.3,0.2-0.5,0.4-0.7,0.7c-0.2,0.3-0.3,0.6-0.4,1&#xD;&#xA;		c-0.1,0.4-0.1,0.8-0.1,1.2s0,0.8,0.1,1.2s0.2,0.7,0.4,1s0.4,0.5,0.7,0.7s0.7,0.3,1.1,0.3s0.8-0.1,1.1-0.3c0.3-0.2,0.5-0.4,0.7-0.7&#xD;&#xA;		s0.3-0.6,0.4-1s0.1-0.8,0.1-1.2S19.1,8.1,19,7.7z" />
	<path class="Blue85" d="M29,15l-8,8l-4-4l8-8L29,15z M30,14l1.7-1.7c0.4-0.4,0.4-1,0-1.3L29,8.3c-0.4-0.4-1-0.4-1.3,0L26,10L30,14z&#xD;&#xA;		 M16,20v4h4L16,20z" />
	<rect y="26" class="Yellow85" width="32" height="6" />
</g>
</g>

<g transform="translate(408, 850)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow85_white { fill:#FFFFFF;}
	.Red85_white { fill:#FFFFFF;}
	.Blue85_white { fill:#FFFFFF;}
	.Green85_white { fill:#FFFFFF;}
	.Black85_white { fill:#FFFFFF;}
	.White85_white { fill:#FFFFFF;}
	.st085_white {opacity:0.75;}
</style>
<g id="Highlight" xmlns="http://www.w3.org/2000/svg">
	<path class="Black85_white" d="M0.8,5.4c0.3-0.4,0.7-0.8,1.1-1C2.3,4.1,2.8,4,3.4,3.8C4,3.7,4.5,3.6,5.1,3.6c0.5,0,1,0,1.6,0.1&#xD;&#xA;		c0.5,0.1,1,0.2,1.4,0.4c0.4,0.2,0.7,0.5,1,0.9s0.4,0.9,0.4,1.5v5.3c0,0.5,0,0.9,0.1,1.3c0.1,0.4,0.1,0.7,0.3,0.9H7.1&#xD;&#xA;		C7,13.9,7,13.7,6.9,13.5c0-0.2-0.1-0.3-0.1-0.5c-0.4,0.5-1,0.8-1.6,1S4,14.3,3.4,14.3c-0.5,0-0.9-0.1-1.4-0.2&#xD;&#xA;		c-0.3-0.1-0.7-0.3-1-0.6S0.4,13,0.3,12.6C0.1,12.2,0,11.8,0,11.2s0.1-1,0.3-1.4s0.5-0.7,0.8-0.9s0.7-0.4,1.1-0.5S3,8.2,3.4,8.2&#xD;&#xA;		C3.9,8.1,4.3,8.1,4.7,8c0.4,0,0.8-0.1,1.1-0.2c0.3-0.1,0.6-0.2,0.7-0.3c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3,0-0.5-0.1-0.7&#xD;&#xA;		C6.5,5.9,6.4,5.8,6.2,5.7C6,5.6,5.9,5.5,5.6,5.5c-0.2,0-0.4,0-0.7,0c-0.5,0-1,0.1-1.3,0.4C3.3,6,3.2,6.4,3.1,7H0.3&#xD;&#xA;		C0.4,6.3,0.5,5.8,0.8,5.4z M6.3,9.3C6.1,9.4,5.9,9.4,5.7,9.4c-0.2,0-0.4,0.1-0.6,0.1S4.7,9.6,4.4,9.6C4.2,9.7,4,9.7,3.8,9.8&#xD;&#xA;		C3.6,9.9,3.4,10,3.3,10.1c-0.2,0.1-0.3,0.3-0.4,0.4c-0.1,0.2-0.1,0.4-0.1,0.6c0,0.2,0,0.5,0.1,0.6C3,11.9,3.1,12,3.3,12.1&#xD;&#xA;		c0.2,0.1,0.3,0.2,0.5,0.2s0.4,0.1,0.6,0.1c0.5,0,1-0.1,1.3-0.3c0.3-0.2,0.5-0.4,0.7-0.7c0.1-0.3,0.2-0.5,0.3-0.8c0-0.3,0-0.5,0-0.6&#xD;&#xA;		V9C6.6,9.2,6.5,9.2,6.3,9.3z M14.5,0v5.1l0,0c0.3-0.5,0.8-0.9,1.4-1.1c0.6-0.2,1.2-0.4,1.8-0.4c0.5,0,1,0.1,1.5,0.3s0.9,0.5,1.3,1&#xD;&#xA;		c0.4,0.4,0.7,1,1,1.7c0.2,0.7,0.4,1.5,0.4,2.4c0,0.9-0.1,1.7-0.4,2.4c-0.2,0.7-0.6,1.2-1,1.7c-0.4,0.4-0.8,0.8-1.3,1&#xD;&#xA;		s-1,0.3-1.5,0.3c-0.7,0-1.4-0.1-2-0.4c-0.6-0.2-1-0.6-1.3-1.2l0,0V14h-2.6V0H14.5z M19,7.7c-0.1-0.4-0.2-0.7-0.4-1&#xD;&#xA;		c-0.2-0.3-0.4-0.5-0.7-0.7c-0.3-0.2-0.7-0.3-1.1-0.3S16,5.8,15.7,6c-0.3,0.2-0.5,0.4-0.7,0.7c-0.2,0.3-0.3,0.6-0.4,1&#xD;&#xA;		c-0.1,0.4-0.1,0.8-0.1,1.2s0,0.8,0.1,1.2s0.2,0.7,0.4,1s0.4,0.5,0.7,0.7s0.7,0.3,1.1,0.3s0.8-0.1,1.1-0.3c0.3-0.2,0.5-0.4,0.7-0.7&#xD;&#xA;		s0.3-0.6,0.4-1s0.1-0.8,0.1-1.2S19.1,8.1,19,7.7z" />
	<path class="Blue85_white" d="M29,15l-8,8l-4-4l8-8L29,15z M30,14l1.7-1.7c0.4-0.4,0.4-1,0-1.3L29,8.3c-0.4-0.4-1-0.4-1.3,0L26,10L30,14z&#xD;&#xA;		 M16,20v4h4L16,20z" />
	<rect y="26" class="Yellow85_white" width="32" height="6" />
</g>
</g>

<g transform="translate(34, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue86 {fill:#1177D7;}
	.Yellow86 {fill:#FFB115;}
	.Black86 {fill:#727272;}
	.Green86 {fill:#039C23;}
	.Red86 {fill:#D11C1C;}
	.st086 {opacity:0.75;}
	.st186 {opacity:0.5;}
</style>
<g id="Hyperlink" xmlns="http://www.w3.org/2000/svg">
	<path class="Black86" d="M10.3,21.7c0.4,0.4,1,0.4,1.4,0l10-10c0.4-0.4,0.4-1,0-1.4c-0.4-0.4-1-0.4-1.4,0l-10,10&#xD;&#xA;		C9.9,20.7,9.9,21.3,10.3,21.7z" />
	<path class="Black86" d="M15.4,19.5c0.5,1.1,0.3,2.5-0.6,3.4l-4.2,4.2c-1.2,1.2-3.1,1.2-4.2,0l-1.4-1.4c-1.2-1.2-1.2-3.1,0-4.2&#xD;&#xA;		l4.2-4.2c0.9-0.9,2.3-1.1,3.4-0.6l1.5-1.5c-1.9-1.3-4.6-1.1-6.3,0.6l-4.2,4.2c-2,2-2,5.1,0,7.1l1.4,1.4c2,2,5.1,2,7.1,0l4.2-4.2&#xD;&#xA;		c1.7-1.7,1.9-4.3,0.6-6.3L15.4,19.5z" />
	<path class="Black86" d="M28.5,4.9l-1.4-1.4c-2-2-5.1-2-7.1,0l-4.2,4.2c-1.7,1.7-1.9,4.3-0.6,6.3l1.5-1.5c-0.5-1.1-0.3-2.5,0.6-3.4&#xD;&#xA;		l4.2-4.2c1.2-1.2,3.1-1.2,4.2,0l1.4,1.4c1.2,1.2,1.2,3.1,0,4.2l-4.2,4.2c-0.9,0.9-2.3,1.1-3.4,0.6L18,16.8c1.9,1.3,4.6,1.1,6.3-0.6&#xD;&#xA;		l4.2-4.2C30.5,10,30.5,6.8,28.5,4.9z" />
</g>
</g>

<g transform="translate(34, 952)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue86_white { fill:#FFFFFF;}
	.Yellow86_white { fill:#FFFFFF;}
	.Black86_white { fill:#FFFFFF;}
	.Green86_white { fill:#FFFFFF;}
	.Red86_white { fill:#FFFFFF;}
	.st086_white {opacity:0.75;}
	.st186_white {opacity:0.5;}
</style>
<g id="Hyperlink" xmlns="http://www.w3.org/2000/svg">
	<path class="Black86_white" d="M10.3,21.7c0.4,0.4,1,0.4,1.4,0l10-10c0.4-0.4,0.4-1,0-1.4c-0.4-0.4-1-0.4-1.4,0l-10,10&#xD;&#xA;		C9.9,20.7,9.9,21.3,10.3,21.7z" />
	<path class="Black86_white" d="M15.4,19.5c0.5,1.1,0.3,2.5-0.6,3.4l-4.2,4.2c-1.2,1.2-3.1,1.2-4.2,0l-1.4-1.4c-1.2-1.2-1.2-3.1,0-4.2&#xD;&#xA;		l4.2-4.2c0.9-0.9,2.3-1.1,3.4-0.6l1.5-1.5c-1.9-1.3-4.6-1.1-6.3,0.6l-4.2,4.2c-2,2-2,5.1,0,7.1l1.4,1.4c2,2,5.1,2,7.1,0l4.2-4.2&#xD;&#xA;		c1.7-1.7,1.9-4.3,0.6-6.3L15.4,19.5z" />
	<path class="Black86_white" d="M28.5,4.9l-1.4-1.4c-2-2-5.1-2-7.1,0l-4.2,4.2c-1.7,1.7-1.9,4.3-0.6,6.3l1.5-1.5c-0.5-1.1-0.3-2.5,0.6-3.4&#xD;&#xA;		l4.2-4.2c1.2-1.2,3.1-1.2,4.2,0l1.4,1.4c1.2,1.2,1.2,3.1,0,4.2l-4.2,4.2c-0.9,0.9-2.3,1.1-3.4,0.6L18,16.8c1.9,1.3,4.6,1.1,6.3-0.6&#xD;&#xA;		l4.2-4.2C30.5,10,30.5,6.8,28.5,4.9z" />
</g>
</g>

<g transform="translate(442, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st087 {fill:#727272;}
	.st187 {opacity:0.5;}
</style>
<circle class="st087" cx="21" cy="11" r="3" xmlns="http://www.w3.org/2000/svg" />
<polygon class="st087" points="20,24 10,14 6,18 6,24 " xmlns="http://www.w3.org/2000/svg" />
<g class="st187" xmlns="http://www.w3.org/2000/svg">
	<polygon class="st087" points="22,24 18,20 20,18 26,24 	" />
</g>
<g xmlns="http://www.w3.org/2000/svg">
	<rect x="14" y="28" class="st087" width="2" height="2" />
	<rect x="22" y="28" class="st087" width="2" height="2" />
	<rect x="18" y="28" class="st087" width="2" height="2" />
	<rect x="6" y="28" class="st087" width="2" height="2" />
	<rect x="10" y="28" class="st087" width="2" height="2" />
</g>
<g xmlns="http://www.w3.org/2000/svg">
	<rect x="18" y="4" class="st087" width="2" height="2" />
	<rect x="10" y="4" class="st087" width="2" height="2" />
	<rect x="14" y="4" class="st087" width="2" height="2" />
	<rect x="22" y="4" class="st087" width="2" height="2" />
	<rect x="6" y="4" class="st087" width="2" height="2" />
</g>
<g xmlns="http://www.w3.org/2000/svg">
	<rect y="14" class="st087" width="2" height="2" />
	<rect y="18" class="st087" width="2" height="2" />
	<rect y="22" class="st087" width="2" height="2" />
	<rect y="10" class="st087" width="2" height="2" />
	<path class="st087" d="M1,4C0.5,4,0,4.5,0,5v3h2V6h2V4H1z" />
	<path class="st087" d="M2,26H0v3c0,0.5,0.5,1,1,1h3v-2H2V26z" />
</g>
<g xmlns="http://www.w3.org/2000/svg">
	<path class="st087" d="M28,8h2V5c0-0.5-0.5-1-1-1h-3v2h2V8z" />
	<rect x="28" y="18" class="st087" width="2" height="2" />
	<rect x="28" y="22" class="st087" width="2" height="2" />
	<path class="st087" d="M28,26v2h-2v2h3c0.5,0,1-0.5,1-1v-3H28z" />
	<rect x="28" y="14" class="st087" width="2" height="2" />
	<rect x="28" y="10" class="st087" width="2" height="2" />
</g>
</g>

<g transform="translate(442, 952)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st087_white { fill:#FFFFFF;}
	.st187_white {opacity:0.5;}
</style>
<circle class="st087_white" cx="21" cy="11" r="3" xmlns="http://www.w3.org/2000/svg" />
<polygon class="st087_white" points="20,24 10,14 6,18 6,24 " xmlns="http://www.w3.org/2000/svg" />
<g class="st187_white" xmlns="http://www.w3.org/2000/svg">
	<polygon class="st087_white" points="22,24 18,20 20,18 26,24 	" />
</g>
<g xmlns="http://www.w3.org/2000/svg">
	<rect x="14" y="28" class="st087_white" width="2" height="2" />
	<rect x="22" y="28" class="st087_white" width="2" height="2" />
	<rect x="18" y="28" class="st087_white" width="2" height="2" />
	<rect x="6" y="28" class="st087_white" width="2" height="2" />
	<rect x="10" y="28" class="st087_white" width="2" height="2" />
</g>
<g xmlns="http://www.w3.org/2000/svg">
	<rect x="18" y="4" class="st087_white" width="2" height="2" />
	<rect x="10" y="4" class="st087_white" width="2" height="2" />
	<rect x="14" y="4" class="st087_white" width="2" height="2" />
	<rect x="22" y="4" class="st087_white" width="2" height="2" />
	<rect x="6" y="4" class="st087_white" width="2" height="2" />
</g>
<g xmlns="http://www.w3.org/2000/svg">
	<rect y="14" class="st087_white" width="2" height="2" />
	<rect y="18" class="st087_white" width="2" height="2" />
	<rect y="22" class="st087_white" width="2" height="2" />
	<rect y="10" class="st087_white" width="2" height="2" />
	<path class="st087_white" d="M1,4C0.5,4,0,4.5,0,5v3h2V6h2V4H1z" />
	<path class="st087_white" d="M2,26H0v3c0,0.5,0.5,1,1,1h3v-2H2V26z" />
</g>
<g xmlns="http://www.w3.org/2000/svg">
	<path class="st087_white" d="M28,8h2V5c0-0.5-0.5-1-1-1h-3v2h2V8z" />
	<rect x="28" y="18" class="st087_white" width="2" height="2" />
	<rect x="28" y="22" class="st087_white" width="2" height="2" />
	<path class="st087_white" d="M28,26v2h-2v2h3c0.5,0,1-0.5,1-1v-3H28z" />
	<rect x="28" y="14" class="st087_white" width="2" height="2" />
	<rect x="28" y="10" class="st087_white" width="2" height="2" />
</g>
</g>

<g transform="translate(0, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st088 {fill:#727272;}
</style>
<g id="IndentDecrease" xmlns="http://www.w3.org/2000/svg">
	<path class="st088" d="M28,6H4V4h24V6z M28,8H4v2h24V8z M28,12H16v2h12V12z M28,20H4v2h24V20z M28,24H4v2h24V24z M28,16H16v2h12V16z" />
	<path class="st088" d="M14,16h-4v3l-6-4l6-4v3h4V16z" />
</g>
</g>

<g transform="translate(0, 918)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st088_white { fill:#FFFFFF;}
</style>
<g id="IndentDecrease" xmlns="http://www.w3.org/2000/svg">
	<path class="st088_white" d="M28,6H4V4h24V6z M28,8H4v2h24V8z M28,12H16v2h12V12z M28,20H4v2h24V20z M28,24H4v2h24V24z M28,16H16v2h12V16z" />
	<path class="st088_white" d="M14,16h-4v3l-6-4l6-4v3h4V16z" />
</g>
</g>

<g transform="translate(34, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue89 { fill:#757575;}
	.Black89 { fill:#727272;}
</style>
<path class="Black89" d="M28,6H4V4h24V6z M28,8H4v2h24V8z M28,12H16v2h12V12z M28,20H4v2h24V20z M28,24H4v2h24V24z M28,16H16v2h12V16z&#xD;&#xA;	" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue89" d="M4,14h4v-3l6,4l-6,4v-3H4V14z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 748)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue89_white { fill:#FFFFFF;}
	.Black89_white { fill:#FFFFFF;}
</style>
<path class="Black89_white" d="M28,6H4V4h24V6z M28,8H4v2h24V8z M28,12H16v2h12V12z M28,20H4v2h24V20z M28,24H4v2h24V24z M28,16H16v2h12V16z&#xD;&#xA;	" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue89_white" d="M4,14h4v-3l6,4l-6,4v-3H4V14z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black90 { fill:#727272;}
	.Green90 { fill:#404040;}
	.Blue90 { fill:#757575;}
	.st090 {opacity:0.5;}
</style>
<polygon class="Green90" points="10,23 4,19 4,22 0,22 0,24 4,24 4,27 " xmlns="http://www.w3.org/2000/svg" />
<g class="st090" xmlns="http://www.w3.org/2000/svg">
	<rect x="12" y="8" class="Black90" width="14" height="12" />
</g>
<path class="Black90" d="M31,0H7C6.4,0,6,0.4,6,1v17l2,1.3V2h22v28H8v-3.3L6,28v3c0,0.6,0.4,1,1,1h24c0.6,0,1-0.4,1-1V1&#xD;&#xA;	C32,0.4,31.6,0,31,0z M26,24H12v-2h14V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 884)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black90_white { fill:#FFFFFF;}
	.Green90_white { fill:#FFFFFF;}
	.Blue90_white { fill:#FFFFFF;}
	.st090_white {opacity:0.5;}
</style>
<polygon class="Green90_white" points="10,23 4,19 4,22 0,22 0,24 4,24 4,27 " xmlns="http://www.w3.org/2000/svg" />
<g class="st090_white" xmlns="http://www.w3.org/2000/svg">
	<rect x="12" y="8" class="Black90_white" width="14" height="12" />
</g>
<path class="Black90_white" d="M31,0H7C6.4,0,6,0.4,6,1v17l2,1.3V2h22v28H8v-3.3L6,28v3c0,0.6,0.4,1,1,1h24c0.6,0,1-0.4,1-1V1&#xD;&#xA;	C32,0.4,31.6,0,31,0z M26,24H12v-2h14V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red91 { fill:#585858;}
	.Blue91 { fill:#757575;}
	.Black91 { fill:#727272;}
</style>
<path class="Black91" d="M29,0H5C4.4,0,4,0.4,4,1v12.6l2,1.3V2h22v26H6v-2.9l-2,1.3V29c0,0.6,0.4,1,1,1h24c0.6,0,1-0.4,1-1V1&#xD;&#xA;	C30,0.4,29.6,0,29,0z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue91" d="M16,8h-6V6h6V8z M16,10h-6v2h6V10z M16,14h-6v2h6V14z M4,24l6-4l-6-4V24z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red91" d="M24,6h-6v2h6V6z M24,10h-6v2h6V10z M24,14h-6v2h6V14z M24,18h-6v2h6V18z M24,22h-6v2h6V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 816)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red91_white { fill:#FFFFFF;}
	.Blue91_white { fill:#FFFFFF;}
	.Black91_white { fill:#FFFFFF;}
</style>
<path class="Black91_white" d="M29,0H5C4.4,0,4,0.4,4,1v12.6l2,1.3V2h22v26H6v-2.9l-2,1.3V29c0,0.6,0.4,1,1,1h24c0.6,0,1-0.4,1-1V1&#xD;&#xA;	C30,0.4,29.6,0,29,0z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue91_white" d="M16,8h-6V6h6V8z M16,10h-6v2h6V10z M16,14h-6v2h6V14z M4,24l6-4l-6-4V24z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red91_white" d="M24,6h-6v2h6V6z M24,10h-6v2h6V10z M24,14h-6v2h6V14z M24,18h-6v2h6V18z M24,22h-6v2h6V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Green92 { fill:#404040;}
	.Black92 { fill:#727272;}
	.Red92 { fill:#585858;}
	.Yellow92 { fill:#979797;}
	.Blue92 { fill:#757575;}
	.White92 { fill:#FFFFFF;}
	.st092 {opacity:0.5;}
	.st192 {opacity:0.75;}
</style>
<g id="InsertField" xmlns="http://www.w3.org/2000/svg">
	<path class="Black92" d="M26,24H14v-2h12V24z M29,4h-5v2h4v22H12v-5.2l-2,1.3V29c0,0.5,0.5,1,1,1h18c0.5,0,1-0.5,1-1V5&#xD;&#xA;		C30,4.5,29.5,4,29,4z M26,14h-2H14v2h12V14z" />
	<path class="Green92" d="M8,18.1H6v-4H4v5c0,0.6,0.4,1,1,1h3v3l6-4l-6-4V18.1z" />
	<path class="Yellow92" d="M22,11V1c0-0.5-0.5-1-1-1H1C0.5,0,0,0.5,0,1v10c0,0.5,0.5,1,1,1h20C21.5,12,22,11.5,22,11z M16,18h10v2H16&#xD;&#xA;		V18z" />
</g>
</g>

<g transform="translate(68, 816)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Green92_white { fill:#FFFFFF;}
	.Black92_white { fill:#FFFFFF;}
	.Red92_white { fill:#FFFFFF;}
	.Yellow92_white { fill:#FFFFFF;}
	.Blue92_white { fill:#FFFFFF;}
	.White92_white { fill:#FFFFFF;}
	.st092_white {opacity:0.5;}
	.st192_white {opacity:0.75;}
</style>
<g id="InsertField" xmlns="http://www.w3.org/2000/svg">
	<path class="Black92_white" d="M26,24H14v-2h12V24z M29,4h-5v2h4v22H12v-5.2l-2,1.3V29c0,0.5,0.5,1,1,1h18c0.5,0,1-0.5,1-1V5&#xD;&#xA;		C30,4.5,29.5,4,29,4z M26,14h-2H14v2h12V14z" />
	<path class="Green92_white" d="M8,18.1H6v-4H4v5c0,0.6,0.4,1,1,1h3v3l6-4l-6-4V18.1z" />
	<path class="Yellow92_white" d="M22,11V1c0-0.5-0.5-1-1-1H1C0.5,0,0,0.5,0,1v10c0,0.5,0.5,1,1,1h20C21.5,12,22,11.5,22,11z M16,18h10v2H16&#xD;&#xA;		V18z" />
</g>
</g>

<g transform="translate(476, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black93 { fill:#727272;}
</style>
<path class="Black93" d="M17.1,10h2.5l-0.5,2h-2.5l-2.5,10.2c-0.3,1.3-0.7,2.4-1.4,3.2c-0.6,0.9-1.3,1.5-2.2,1.9&#xD;&#xA;	C9.8,27.8,8.8,28,7.7,28c-1.1,0-1.9-0.2-2.6-0.6C4.4,26.8,4,26.2,4,25.6c0-0.5,0.2-1,0.5-1.3c0.4-0.4,0.8-0.5,1.3-0.5&#xD;&#xA;	c0.2,0,0.4,0,0.7,0.1C6.8,23.9,7,24,7.2,24.2c0.1,0.1,0.4,0.3,0.7,0.8c0.1,0.2,0.3,0.3,0.4,0.4c0.1,0.1,0.3,0.1,0.4,0.1&#xD;&#xA;	c0.6,0,1-0.6,1.2-1.9L12.5,12h-1.8l0.4-2H13l0.3-1.3c0.3-1.5,1.1-2.6,2.2-3.5S18,4,19.8,4c0.9,0,1.6,0.1,2.1,0.3&#xD;&#xA;	c0.5,0.2,0.9,0.5,1.2,0.9c0.3,0.4,0.4,0.8,0.4,1.2c0,0.3-0.1,0.7-0.3,1c-0.2,0.3-0.4,0.5-0.7,0.7c-0.3,0.2-0.6,0.2-1,0.2&#xD;&#xA;	c-0.3,0-0.6-0.1-0.9-0.2c-0.3-0.1-0.6-0.4-0.8-0.7c-0.3-0.4-0.5-0.6-0.7-0.7c-0.1-0.1-0.3-0.1-0.5-0.1c-0.3,0-0.6,0.2-0.8,0.5&#xD;&#xA;	c-0.2,0.2-0.3,0.7-0.5,1.4L17.1,10z M21.5,18.2l1.5,3.1c0.8-1.2,1.4-1.9,1.7-2.2c0.4-0.4,0.8-0.7,1.2-0.9s0.8-0.3,1.1-0.3&#xD;&#xA;	c0.4,0,0.7,0.1,1,0.4c0.3,0.2,0.4,0.5,0.4,0.9c0,0.2,0,0.5-0.1,0.6c-0.1,0.2-0.2,0.3-0.4,0.5c-0.2,0.1-0.4,0.2-0.5,0.3&#xD;&#xA;	c-0.1,0-0.3,0-0.7,0.1c-0.4,0-0.7,0-0.8,0.1c-0.2,0-0.3,0.1-0.5,0.3c-0.2,0.2-0.4,0.3-0.6,0.6c-0.1,0.1-0.4,0.5-1,1.4l0.5,1&#xD;&#xA;	c0.4,0.8,0.7,1.3,1,1.6c0.3,0.2,0.5,0.4,0.8,0.4c0.4,0,0.9-0.2,1.4-0.7l1.1,1.2c-1.1,1-2.2,1.5-3.4,1.5c-0.5,0-0.9-0.1-1.3-0.2&#xD;&#xA;	c-0.4-0.2-0.7-0.4-1-0.7c-0.3-0.3-0.6-0.8-0.9-1.4l-0.5-1.1c-0.5,0.8-1,1.5-1.6,2.1c-0.5,0.6-1,0.9-1.4,1.1C18,27.9,17.6,28,17.2,28&#xD;&#xA;	c-0.3,0-0.5-0.1-0.8-0.2c-0.2-0.1-0.3-0.2-0.4-0.5c-0.1-0.2-0.2-0.4-0.2-0.7c0-0.3,0.1-0.5,0.2-0.7c0.1-0.2,0.3-0.4,0.5-0.5&#xD;&#xA;	c0.2-0.1,0.6-0.2,1.1-0.2c0.4,0,0.7-0.1,0.9-0.2c0.2-0.1,0.5-0.3,0.7-0.6c0.3-0.3,0.7-0.8,1.2-1.7l-0.9-2h-1.4l0.4-1.8&#xD;&#xA;	c0.8-0.1,1.5-0.4,2.2-0.8H21.5z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 952)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black93_white { fill:#FFFFFF;}
</style>
<path class="Black93_white" d="M17.1,10h2.5l-0.5,2h-2.5l-2.5,10.2c-0.3,1.3-0.7,2.4-1.4,3.2c-0.6,0.9-1.3,1.5-2.2,1.9&#xD;&#xA;	C9.8,27.8,8.8,28,7.7,28c-1.1,0-1.9-0.2-2.6-0.6C4.4,26.8,4,26.2,4,25.6c0-0.5,0.2-1,0.5-1.3c0.4-0.4,0.8-0.5,1.3-0.5&#xD;&#xA;	c0.2,0,0.4,0,0.7,0.1C6.8,23.9,7,24,7.2,24.2c0.1,0.1,0.4,0.3,0.7,0.8c0.1,0.2,0.3,0.3,0.4,0.4c0.1,0.1,0.3,0.1,0.4,0.1&#xD;&#xA;	c0.6,0,1-0.6,1.2-1.9L12.5,12h-1.8l0.4-2H13l0.3-1.3c0.3-1.5,1.1-2.6,2.2-3.5S18,4,19.8,4c0.9,0,1.6,0.1,2.1,0.3&#xD;&#xA;	c0.5,0.2,0.9,0.5,1.2,0.9c0.3,0.4,0.4,0.8,0.4,1.2c0,0.3-0.1,0.7-0.3,1c-0.2,0.3-0.4,0.5-0.7,0.7c-0.3,0.2-0.6,0.2-1,0.2&#xD;&#xA;	c-0.3,0-0.6-0.1-0.9-0.2c-0.3-0.1-0.6-0.4-0.8-0.7c-0.3-0.4-0.5-0.6-0.7-0.7c-0.1-0.1-0.3-0.1-0.5-0.1c-0.3,0-0.6,0.2-0.8,0.5&#xD;&#xA;	c-0.2,0.2-0.3,0.7-0.5,1.4L17.1,10z M21.5,18.2l1.5,3.1c0.8-1.2,1.4-1.9,1.7-2.2c0.4-0.4,0.8-0.7,1.2-0.9s0.8-0.3,1.1-0.3&#xD;&#xA;	c0.4,0,0.7,0.1,1,0.4c0.3,0.2,0.4,0.5,0.4,0.9c0,0.2,0,0.5-0.1,0.6c-0.1,0.2-0.2,0.3-0.4,0.5c-0.2,0.1-0.4,0.2-0.5,0.3&#xD;&#xA;	c-0.1,0-0.3,0-0.7,0.1c-0.4,0-0.7,0-0.8,0.1c-0.2,0-0.3,0.1-0.5,0.3c-0.2,0.2-0.4,0.3-0.6,0.6c-0.1,0.1-0.4,0.5-1,1.4l0.5,1&#xD;&#xA;	c0.4,0.8,0.7,1.3,1,1.6c0.3,0.2,0.5,0.4,0.8,0.4c0.4,0,0.9-0.2,1.4-0.7l1.1,1.2c-1.1,1-2.2,1.5-3.4,1.5c-0.5,0-0.9-0.1-1.3-0.2&#xD;&#xA;	c-0.4-0.2-0.7-0.4-1-0.7c-0.3-0.3-0.6-0.8-0.9-1.4l-0.5-1.1c-0.5,0.8-1,1.5-1.6,2.1c-0.5,0.6-1,0.9-1.4,1.1C18,27.9,17.6,28,17.2,28&#xD;&#xA;	c-0.3,0-0.5-0.1-0.8-0.2c-0.2-0.1-0.3-0.2-0.4-0.5c-0.1-0.2-0.2-0.4-0.2-0.7c0-0.3,0.1-0.5,0.2-0.7c0.1-0.2,0.3-0.4,0.5-0.5&#xD;&#xA;	c0.2-0.1,0.6-0.2,1.1-0.2c0.4,0,0.7-0.1,0.9-0.2c0.2-0.1,0.5-0.3,0.7-0.6c0.3-0.3,0.7-0.8,1.2-1.7l-0.9-2h-1.4l0.4-1.8&#xD;&#xA;	c0.8-0.1,1.5-0.4,2.2-0.8H21.5z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow94 { fill:#979797;}
	.Red94 { fill:#585858;}
	.Black94 { fill:#727272;}
	.Blue94 { fill:#757575;}
	.White94 { fill:#FFFFFF;}
	.Green94 { fill:#404040;}
	.st094 {opacity:0.75;}
	.st194 {opacity:0.5;}
	.st294 {opacity:0.25;}
	.st394 { fill:#979797;}
</style>
<g id="Images" xmlns="http://www.w3.org/2000/svg">
	<path class="Black94" d="M29,4H3C2.5,4,2,4.5,2,5v22c0,0.5,0.5,1,1,1h26c0.5,0,1-0.5,1-1V5C30,4.5,29.5,4,29,4z M28,26H4V6h24V26z" />
	<circle class="Yellow94" cx="21" cy="11" r="3" />
	<polygon class="Green94" points="20,24 10,14 6,18 6,24 	" />
	<g class="st194">
		<polygon class="Green94" points="22,24 18,20 20,18 26,24 		" />
	</g>
</g>
</g>

<g transform="translate(0, 884)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow94_white { fill:#FFFFFF;}
	.Red94_white { fill:#FFFFFF;}
	.Black94_white { fill:#FFFFFF;}
	.Blue94_white { fill:#FFFFFF;}
	.White94_white { fill:#FFFFFF;}
	.Green94_white { fill:#FFFFFF;}
	.st094_white {opacity:0.75;}
	.st194_white {opacity:0.5;}
	.st294_white {opacity:0.25;}
	.st394_white { fill:#FFFFFF;}
</style>
<g id="Images" xmlns="http://www.w3.org/2000/svg">
	<path class="Black94_white" d="M29,4H3C2.5,4,2,4.5,2,5v22c0,0.5,0.5,1,1,1h26c0.5,0,1-0.5,1-1V5C30,4.5,29.5,4,29,4z M28,26H4V6h24V26z" />
	<circle class="Yellow94_white" cx="21" cy="11" r="3" />
	<polygon class="Green94_white" points="20,24 10,14 6,18 6,24 	" />
	<g class="st194_white">
		<polygon class="Green94_white" points="22,24 18,20 20,18 26,24 		" />
	</g>
</g>
</g>

<g transform="translate(306, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow95 { fill:#979797;}
	.Red95 { fill:#585858;}
	.Black95 { fill:#727272;}
	.Blue95 { fill:#757575;}
	.White95 { fill:#FFFFFF;}
	.Green95 { fill:#404040;}
	.st095 {opacity:0.75;}
	.st195 {opacity:0.5;}
	.st295 {opacity:0.25;}
	.st395 { fill:#979797;}
</style>
<g id="Images" xmlns="http://www.w3.org/2000/svg">
	<path class="Black95" d="M29,4H3C2.5,4,2,4.5,2,5v22c0,0.5,0.5,1,1,1h26c0.5,0,1-0.5,1-1V5C30,4.5,29.5,4,29,4z M28,26H4V6h24V26z" />
	<circle class="Yellow95" cx="21" cy="11" r="3" />
	<polygon class="Green95" points="20,24 10,14 6,18 6,24 	" />
	<g class="st195">
		<polygon class="Green95" points="22,24 18,20 20,18 26,24 		" />
	</g>
</g>
</g>

<g transform="translate(306, 816)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow95_white { fill:#FFFFFF;}
	.Red95_white { fill:#FFFFFF;}
	.Black95_white { fill:#FFFFFF;}
	.Blue95_white { fill:#FFFFFF;}
	.White95_white { fill:#FFFFFF;}
	.Green95_white { fill:#FFFFFF;}
	.st095_white {opacity:0.75;}
	.st195_white {opacity:0.5;}
	.st295_white {opacity:0.25;}
	.st395_white { fill:#FFFFFF;}
</style>
<g id="Images" xmlns="http://www.w3.org/2000/svg">
	<path class="Black95_white" d="M29,4H3C2.5,4,2,4.5,2,5v22c0,0.5,0.5,1,1,1h26c0.5,0,1-0.5,1-1V5C30,4.5,29.5,4,29,4z M28,26H4V6h24V26z" />
	<circle class="Yellow95_white" cx="21" cy="11" r="3" />
	<polygon class="Green95_white" points="20,24 10,14 6,18 6,24 	" />
	<g class="st195_white">
		<polygon class="Green95_white" points="22,24 18,20 20,18 26,24 		" />
	</g>
</g>
</g>

<g transform="translate(238, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow96 { fill:#979797;}
	.Red96 { fill:#585858;}
	.Black96 { fill:#727272;}
	.Blue96 { fill:#757575;}
	.White96 { fill:#FFFFFF;}
	.Green96 { fill:#404040;}
	.st096 {opacity:0.75;}
	.st196 {opacity:0.5;}
	.st296 {opacity:0.25;}
	.st396 { fill:#979797;}
</style>
<g id="Images" xmlns="http://www.w3.org/2000/svg">
	<path class="Black96" d="M29,4H3C2.5,4,2,4.5,2,5v22c0,0.5,0.5,1,1,1h26c0.5,0,1-0.5,1-1V5C30,4.5,29.5,4,29,4z M28,26H4V6h24V26z" />
	<circle class="Yellow96" cx="21" cy="11" r="3" />
	<polygon class="Green96" points="20,24 10,14 6,18 6,24 	" />
	<g class="st196">
		<polygon class="Green96" points="22,24 18,20 20,18 26,24 		" />
	</g>
</g>
</g>

<g transform="translate(238, 884)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow96_white { fill:#FFFFFF;}
	.Red96_white { fill:#FFFFFF;}
	.Black96_white { fill:#FFFFFF;}
	.Blue96_white { fill:#FFFFFF;}
	.White96_white { fill:#FFFFFF;}
	.Green96_white { fill:#FFFFFF;}
	.st096_white {opacity:0.75;}
	.st196_white {opacity:0.5;}
	.st296_white {opacity:0.25;}
	.st396_white { fill:#FFFFFF;}
</style>
<g id="Images" xmlns="http://www.w3.org/2000/svg">
	<path class="Black96_white" d="M29,4H3C2.5,4,2,4.5,2,5v22c0,0.5,0.5,1,1,1h26c0.5,0,1-0.5,1-1V5C30,4.5,29.5,4,29,4z M28,26H4V6h24V26z" />
	<circle class="Yellow96_white" cx="21" cy="11" r="3" />
	<polygon class="Green96_white" points="20,24 10,14 6,18 6,24 	" />
	<g class="st196_white">
		<polygon class="Green96_white" points="22,24 18,20 20,18 26,24 		" />
	</g>
</g>
</g>

<g transform="translate(272, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black97 { fill:#727272;}
	.Blue97 { fill:#757575;}
</style>
<polyline class="Blue97" points="0,20 6,16 0,12 " xmlns="http://www.w3.org/2000/svg" />
<path class="Black97" d="M8,30V19c0-0.6,0.4-1,1-1h14l7,7v5h-2v-4h-5c-0.6,0-1-0.4-1-1v-5H10v10H8z M28,2v10H10V2H8v11&#xD;&#xA;	c0,0.6,0.4,1,1,1h20c0.6,0,1-0.4,1-1V2H28z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 918)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black97_white { fill:#FFFFFF;}
	.Blue97_white { fill:#FFFFFF;}
</style>
<polyline class="Blue97_white" points="0,20 6,16 0,12 " xmlns="http://www.w3.org/2000/svg" />
<path class="Black97_white" d="M8,30V19c0-0.6,0.4-1,1-1h14l7,7v5h-2v-4h-5c-0.6,0-1-0.4-1-1v-5H10v10H8z M28,2v10H10V2H8v11&#xD;&#xA;	c0,0.6,0.4,1,1,1h20c0.6,0,1-0.4,1-1V2H28z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black98 { fill:#727272;}
	.Blue98 { fill:#757575;}
</style>
<path class="Black98" d="M27,6h-3V3c0-0.5-0.5-1-1-1H3C2.5,2,2,2.5,2,3v22c0,0.5,0.5,1,1,1h3v3c0,0.5,0.5,1,1,1h20c0.5,0,1-0.5,1-1V7&#xD;&#xA;	C28,6.5,27.5,6,27,6z M6,7v17H4V4h18v2H7C6.5,6,6,6.5,6,7z M26,28H8V8h18V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue98" d="M22,15.3l-0.3,1.6H20l-0.5,2.3h1.8L21,20.8h-1.7L18.5,24h-1.8l0.6-3.2h-2L14.8,24H13l0.6-3.2H12l0.3-1.6H14&#xD;&#xA;	l0.5-2.3h-1.8l0.3-1.6h1.8l0.7-3.3h1.8l-0.7,3.3h2l0.7-3.3H21l-0.7,3.3H22z M18.3,16.9h-2l-0.5,2.3h2L18.3,16.9z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 952)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black98_white { fill:#FFFFFF;}
	.Blue98_white { fill:#FFFFFF;}
</style>
<path class="Black98_white" d="M27,6h-3V3c0-0.5-0.5-1-1-1H3C2.5,2,2,2.5,2,3v22c0,0.5,0.5,1,1,1h3v3c0,0.5,0.5,1,1,1h20c0.5,0,1-0.5,1-1V7&#xD;&#xA;	C28,6.5,27.5,6,27,6z M6,7v17H4V4h18v2H7C6.5,6,6,6.5,6,7z M26,28H8V8h18V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue98_white" d="M22,15.3l-0.3,1.6H20l-0.5,2.3h1.8L21,20.8h-1.7L18.5,24h-1.8l0.6-3.2h-2L14.8,24H13l0.6-3.2H12l0.3-1.6H14&#xD;&#xA;	l0.5-2.3h-1.8l0.3-1.6h1.8l0.7-3.3h1.8l-0.7,3.3h2l0.7-3.3H21l-0.7,3.3H22z M18.3,16.9h-2l-0.5,2.3h2L18.3,16.9z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black99 { fill:#727272;}
	.Blue99 { fill:#757575;}
</style>
<path class="Black99" d="M25,2H5C4.5,2,4,2.5,4,3v26c0,0.5,0.5,1,1,1h20c0.5,0,1-0.5,1-1V3C26,2.5,25.5,2,25,2z M24,28H6V4h18V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue99" d="M20,13.3l-0.3,1.6H18l-0.5,2.3h1.8L19,18.8h-1.7L16.5,22h-1.8l0.6-3.2h-2L12.8,22H11l0.6-3.2H10l0.3-1.6H12&#xD;&#xA;	l0.5-2.3h-1.8l0.3-1.6h1.8l0.7-3.3h1.8l-0.7,3.3h2l0.7-3.3H19l-0.7,3.3H20z M16.3,14.9h-2l-0.5,2.3h2L16.3,14.9z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 850)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black99_white { fill:#FFFFFF;}
	.Blue99_white { fill:#FFFFFF;}
</style>
<path class="Black99_white" d="M25,2H5C4.5,2,4,2.5,4,3v26c0,0.5,0.5,1,1,1h20c0.5,0,1-0.5,1-1V3C26,2.5,25.5,2,25,2z M24,28H6V4h18V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue99_white" d="M20,13.3l-0.3,1.6H18l-0.5,2.3h1.8L19,18.8h-1.7L16.5,22h-1.8l0.6-3.2h-2L12.8,22H11l0.6-3.2H10l0.3-1.6H12&#xD;&#xA;	l0.5-2.3h-1.8l0.3-1.6h1.8l0.7-3.3h1.8l-0.7,3.3h2l0.7-3.3H19l-0.7,3.3H20z M16.3,14.9h-2l-0.5,2.3h2L16.3,14.9z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red100 { fill:#585858;}
	.Blue100 { fill:#757575;}
	.Black100 { fill:#727272;}
</style>
<path class="Black100" d="M29,0H5C4.4,0,4,0.4,4,1v10.6l2,1.3V2h22v26H6v-4.9l-2,1.3V29c0,0.6,0.4,1,1,1h24c0.6,0,1-0.4,1-1V1&#xD;&#xA;	C30,0.4,29.6,0,29,0z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue100" d="M24,8H12V6h12V8z M24,10H12v2h12V10z M24,14H12v2h12V14z M4,22l6-4l-6-4V22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red100" d="M24,18H12v2h12V18z M24,22H12v2h12V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 850)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red100_white { fill:#FFFFFF;}
	.Blue100_white { fill:#FFFFFF;}
	.Black100_white { fill:#FFFFFF;}
</style>
<path class="Black100_white" d="M29,0H5C4.4,0,4,0.4,4,1v10.6l2,1.3V2h22v26H6v-4.9l-2,1.3V29c0,0.6,0.4,1,1,1h24c0.6,0,1-0.4,1-1V1&#xD;&#xA;	C30,0.4,29.6,0,29,0z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue100_white" d="M24,8H12V6h12V8z M24,10H12v2h12V10z M24,14H12v2h12V14z M4,22l6-4l-6-4V22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red100_white" d="M24,18H12v2h12V18z M24,22H12v2h12V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red101 { fill:#585858;}
	.Black101 { fill:#727272;}
	.Blue101 { fill:#757575;}
</style>
<path class="Black101" d="M28,2v10H10V2H8v11c0,0.6,0.4,1,1,1h20c0.6,0,1-0.4,1-1V2H28z M28,30V20H10v10H8V19c0-0.6,0.4-1,1-1h20&#xD;&#xA;	c0.6,0,1,0.4,1,1v11H28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue101" d="M0,12l6,4l-6,4 M22,10V8.4h-3.4C18.7,8.2,18.9,8.1,19,8c0.2-0.2,0.5-0.4,0.7-0.5c0.3-0.2,0.5-0.3,0.8-0.5&#xD;&#xA;	c0.3-0.2,0.5-0.4,0.7-0.6c0.2-0.2,0.4-0.5,0.5-0.8c0.1-0.3,0.2-0.6,0.2-1c0-0.4-0.1-0.7-0.2-1.1c-0.1-0.3-0.4-0.6-0.6-0.8&#xD;&#xA;	c-0.3-0.2-0.5-0.4-0.9-0.5c-0.3-0.1-0.7-0.2-1-0.2c-0.5,0-0.9,0.1-1.3,0.2c-0.4,0.2-0.7,0.4-0.9,0.7c-0.2,0.3-0.4,0.6-0.5,1&#xD;&#xA;	c-0.1,0.4-0.2,0.8-0.2,1.3l0,0.1h1.8V5.2c0-0.2,0-0.4,0.1-0.6c0-0.2,0.1-0.4,0.2-0.5c0.1-0.1,0.2-0.3,0.3-0.4&#xD;&#xA;	c0.1-0.1,0.3-0.1,0.5-0.1c0.3,0,0.5,0.1,0.7,0.3c0.2,0.2,0.3,0.4,0.3,0.8c0,0.2,0,0.4-0.1,0.5c-0.1,0.2-0.2,0.3-0.4,0.5&#xD;&#xA;	c-0.1,0.1-0.3,0.3-0.5,0.4c-0.2,0.1-0.4,0.2-0.5,0.4C18.3,6.6,18,6.8,17.7,7c-0.3,0.2-0.6,0.5-0.8,0.7c-0.2,0.3-0.4,0.6-0.5,0.9&#xD;&#xA;	c-0.1,0.3-0.2,0.7-0.2,1.2V10H22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red101" d="M18,30v-2h-3v-1.7l3.4-4.3H20l0,4.3h1V28h-1l0,2H18z M18,26.3v-1.5l-1.3,1.5H18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 884)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red101_white { fill:#FFFFFF;}
	.Black101_white { fill:#FFFFFF;}
	.Blue101_white { fill:#FFFFFF;}
</style>
<path class="Black101_white" d="M28,2v10H10V2H8v11c0,0.6,0.4,1,1,1h20c0.6,0,1-0.4,1-1V2H28z M28,30V20H10v10H8V19c0-0.6,0.4-1,1-1h20&#xD;&#xA;	c0.6,0,1,0.4,1,1v11H28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue101_white" d="M0,12l6,4l-6,4 M22,10V8.4h-3.4C18.7,8.2,18.9,8.1,19,8c0.2-0.2,0.5-0.4,0.7-0.5c0.3-0.2,0.5-0.3,0.8-0.5&#xD;&#xA;	c0.3-0.2,0.5-0.4,0.7-0.6c0.2-0.2,0.4-0.5,0.5-0.8c0.1-0.3,0.2-0.6,0.2-1c0-0.4-0.1-0.7-0.2-1.1c-0.1-0.3-0.4-0.6-0.6-0.8&#xD;&#xA;	c-0.3-0.2-0.5-0.4-0.9-0.5c-0.3-0.1-0.7-0.2-1-0.2c-0.5,0-0.9,0.1-1.3,0.2c-0.4,0.2-0.7,0.4-0.9,0.7c-0.2,0.3-0.4,0.6-0.5,1&#xD;&#xA;	c-0.1,0.4-0.2,0.8-0.2,1.3l0,0.1h1.8V5.2c0-0.2,0-0.4,0.1-0.6c0-0.2,0.1-0.4,0.2-0.5c0.1-0.1,0.2-0.3,0.3-0.4&#xD;&#xA;	c0.1-0.1,0.3-0.1,0.5-0.1c0.3,0,0.5,0.1,0.7,0.3c0.2,0.2,0.3,0.4,0.3,0.8c0,0.2,0,0.4-0.1,0.5c-0.1,0.2-0.2,0.3-0.4,0.5&#xD;&#xA;	c-0.1,0.1-0.3,0.3-0.5,0.4c-0.2,0.1-0.4,0.2-0.5,0.4C18.3,6.6,18,6.8,17.7,7c-0.3,0.2-0.6,0.5-0.8,0.7c-0.2,0.3-0.4,0.6-0.5,0.9&#xD;&#xA;	c-0.1,0.3-0.2,0.7-0.2,1.2V10H22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red101_white" d="M18,30v-2h-3v-1.7l3.4-4.3H20l0,4.3h1V28h-1l0,2H18z M18,26.3v-1.5l-1.3,1.5H18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red102 { fill:#585858;}
	.Blue102 { fill:#757575;}
	.Black102 { fill:#727272;}
</style>
<path class="Black102" d="M28,2v10H10V2H8v11c0,0.6,0.4,1,1,1h20c0.6,0,1-0.4,1-1V2H28z M28,30V20H10v10H8V19c0-0.6,0.4-1,1-1h20&#xD;&#xA;	c0.6,0,1,0.4,1,1v11H28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue102" d="M0,12l6,4l-6,4 M24,6H14v2h10V6z M24,4H14V2h10V4z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red102" d="M24,30H14v-2h10V30z M24,24H14v2h10V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 782)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red102_white { fill:#FFFFFF;}
	.Blue102_white { fill:#FFFFFF;}
	.Black102_white { fill:#FFFFFF;}
</style>
<path class="Black102_white" d="M28,2v10H10V2H8v11c0,0.6,0.4,1,1,1h20c0.6,0,1-0.4,1-1V2H28z M28,30V20H10v10H8V19c0-0.6,0.4-1,1-1h20&#xD;&#xA;	c0.6,0,1,0.4,1,1v11H28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue102_white" d="M0,12l6,4l-6,4 M24,6H14v2h10V6z M24,4H14V2h10V4z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red102_white" d="M24,30H14v-2h10V30z M24,24H14v2h10V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red103 { fill:#585858;}
	.Black103 { fill:#727272;}
	.Blue103 { fill:#757575;}
</style>
<path class="Black103" d="M28,2v10H10V2H8v11c0,0.6,0.4,1,1,1h20c0.6,0,1-0.4,1-1V2H28z M28,30V20H10v10H8V19c0-0.6,0.4-1,1-1h20&#xD;&#xA;	c0.6,0,1,0.4,1,1v11H28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red103" d="M20,29.8c0.3-0.1,0.7-0.3,0.9-0.5c0.3-0.2,0.5-0.5,0.6-0.8c0.2-0.3,0.2-0.7,0.2-1.1c0-0.5-0.1-0.9-0.4-1.2&#xD;&#xA;	c-0.2-0.2-0.4-0.4-0.7-0.5c0.2-0.1,0.4-0.3,0.5-0.5c0.2-0.3,0.3-0.6,0.3-1c0-0.4-0.1-0.7-0.2-1c-0.2-0.3-0.4-0.5-0.6-0.7&#xD;&#xA;	c-0.2-0.2-0.5-0.3-0.8-0.4C19.5,22,19.2,22,18.9,22c-0.4,0-0.8,0.1-1.1,0.2c-0.3,0.1-0.6,0.3-0.9,0.6c-0.2,0.2-0.4,0.5-0.6,0.9&#xD;&#xA;	c-0.1,0.3-0.2,0.7-0.2,1.1l0,0.1h1.7l0-0.1c0-0.3,0.1-0.6,0.3-0.9c0.2-0.2,0.4-0.3,0.8-0.3c0.2,0,0.5,0.1,0.6,0.2&#xD;&#xA;	c0.2,0.1,0.3,0.3,0.3,0.6c0,0.2,0,0.3-0.1,0.4c-0.1,0.1-0.2,0.2-0.3,0.3c-0.1,0.1-0.3,0.1-0.5,0.1c-0.1,0-0.2,0-0.3,0&#xD;&#xA;	c-0.1,0-0.4,0-0.5,0l-0.2,0v1.4h0.1c0.2,0,0.6,0,0.8,0c0.2,0,0.4,0,0.5,0.1c0.1,0.1,0.3,0.1,0.4,0.3c0.1,0.1,0.1,0.3,0.1,0.6&#xD;&#xA;	c0,0.3-0.1,0.6-0.3,0.7c-0.2,0.2-0.5,0.3-0.8,0.3c-0.2,0-0.4,0-0.5-0.1c-0.1-0.1-0.3-0.2-0.4-0.3c-0.1-0.1-0.2-0.3-0.2-0.4&#xD;&#xA;	c-0.1-0.2-0.1-0.3-0.1-0.5l0-0.1H16l0,0.1c0,0.4,0.1,0.9,0.2,1.2c0.1,0.4,0.3,0.7,0.6,0.9c0.3,0.2,0.6,0.4,0.9,0.6&#xD;&#xA;	c0.4,0.1,0.8,0.2,1.2,0.2C19.3,30,19.6,29.9,20,29.8z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue103" d="M0,12l6,4l-6,4 M18.4,2l0,0.1c0,0.3-0.1,0.5-0.3,0.7c-0.1,0.2-0.3,0.4-0.5,0.5c-0.2,0.1-0.4,0.2-0.7,0.3&#xD;&#xA;	c-0.2,0-0.5,0.1-0.7,0.1l-0.2,0v1.6l2,0V10h2V2H18.4z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 952)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red103_white { fill:#FFFFFF;}
	.Black103_white { fill:#FFFFFF;}
	.Blue103_white { fill:#FFFFFF;}
</style>
<path class="Black103_white" d="M28,2v10H10V2H8v11c0,0.6,0.4,1,1,1h20c0.6,0,1-0.4,1-1V2H28z M28,30V20H10v10H8V19c0-0.6,0.4-1,1-1h20&#xD;&#xA;	c0.6,0,1,0.4,1,1v11H28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red103_white" d="M20,29.8c0.3-0.1,0.7-0.3,0.9-0.5c0.3-0.2,0.5-0.5,0.6-0.8c0.2-0.3,0.2-0.7,0.2-1.1c0-0.5-0.1-0.9-0.4-1.2&#xD;&#xA;	c-0.2-0.2-0.4-0.4-0.7-0.5c0.2-0.1,0.4-0.3,0.5-0.5c0.2-0.3,0.3-0.6,0.3-1c0-0.4-0.1-0.7-0.2-1c-0.2-0.3-0.4-0.5-0.6-0.7&#xD;&#xA;	c-0.2-0.2-0.5-0.3-0.8-0.4C19.5,22,19.2,22,18.9,22c-0.4,0-0.8,0.1-1.1,0.2c-0.3,0.1-0.6,0.3-0.9,0.6c-0.2,0.2-0.4,0.5-0.6,0.9&#xD;&#xA;	c-0.1,0.3-0.2,0.7-0.2,1.1l0,0.1h1.7l0-0.1c0-0.3,0.1-0.6,0.3-0.9c0.2-0.2,0.4-0.3,0.8-0.3c0.2,0,0.5,0.1,0.6,0.2&#xD;&#xA;	c0.2,0.1,0.3,0.3,0.3,0.6c0,0.2,0,0.3-0.1,0.4c-0.1,0.1-0.2,0.2-0.3,0.3c-0.1,0.1-0.3,0.1-0.5,0.1c-0.1,0-0.2,0-0.3,0&#xD;&#xA;	c-0.1,0-0.4,0-0.5,0l-0.2,0v1.4h0.1c0.2,0,0.6,0,0.8,0c0.2,0,0.4,0,0.5,0.1c0.1,0.1,0.3,0.1,0.4,0.3c0.1,0.1,0.1,0.3,0.1,0.6&#xD;&#xA;	c0,0.3-0.1,0.6-0.3,0.7c-0.2,0.2-0.5,0.3-0.8,0.3c-0.2,0-0.4,0-0.5-0.1c-0.1-0.1-0.3-0.2-0.4-0.3c-0.1-0.1-0.2-0.3-0.2-0.4&#xD;&#xA;	c-0.1-0.2-0.1-0.3-0.1-0.5l0-0.1H16l0,0.1c0,0.4,0.1,0.9,0.2,1.2c0.1,0.4,0.3,0.7,0.6,0.9c0.3,0.2,0.6,0.4,0.9,0.6&#xD;&#xA;	c0.4,0.1,0.8,0.2,1.2,0.2C19.3,30,19.6,29.9,20,29.8z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue103_white" d="M0,12l6,4l-6,4 M18.4,2l0,0.1c0,0.3-0.1,0.5-0.3,0.7c-0.1,0.2-0.3,0.4-0.5,0.5c-0.2,0.1-0.4,0.2-0.7,0.3&#xD;&#xA;	c-0.2,0-0.5,0.1-0.7,0.1l-0.2,0v1.6l2,0V10h2V2H18.4z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue104 { fill:#757575;}
</style>
<path class="Blue104" d="M10,10H2V4h8V10z M20,4h-8v6h8V4z M30,4h-8v6h8V4z M10,12H2v6h8V12z M20,12h-8v6h8V12z M30,12h-8v6h8V12z&#xD;&#xA;	 M10,20H2v6h8V20z M20,20h-8v6h8V20z M30,20h-8v6h8V20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 816)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue104_white { fill:#FFFFFF;}
</style>
<path class="Blue104_white" d="M10,10H2V4h8V10z M20,4h-8v6h8V4z M30,4h-8v6h8V4z M10,12H2v6h8V12z M20,12h-8v6h8V12z M30,12h-8v6h8V12z&#xD;&#xA;	 M10,20H2v6h8V20z M20,20h-8v6h8V20z M30,20h-8v6h8V20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0105 {opacity:0.5;}
	.st1105 {fill:#727272;}
</style>
<g class="st0105" xmlns="http://www.w3.org/2000/svg">
	<path class="st1105" d="M22,12h8v6h-8V12z M12,12v6h8v-6H12z M10,18v-6H2v6H10z M22,26h8v-6h-8V26z M12,20v6h8v-6H12z M10,26v-6H2v6&#xD;&#xA;		H10z" />
</g>
<rect x="2" y="4" class="st1105" width="28" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 918)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0105_white {opacity:0.5;}
	.st1105_white { fill:#FFFFFF;}
</style>
<g class="st0105_white" xmlns="http://www.w3.org/2000/svg">
	<path class="st1105_white" d="M22,12h8v6h-8V12z M12,12v6h8v-6H12z M10,18v-6H2v6H10z M22,26h8v-6h-8V26z M12,20v6h8v-6H12z M10,26v-6H2v6&#xD;&#xA;		H10z" />
</g>
<rect x="2" y="4" class="st1105_white" width="28" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue106 { fill:#757575;}
	.Black106 { fill:#727272;}
	.Yellow106 { fill:#979797;}
	.st0106 {opacity:0.5;}
</style>
<g class="st0106" xmlns="http://www.w3.org/2000/svg">
	<path class="Black106" d="M30,6H20V0h10V6z M30,16H20v6h10V16z M30,24H20v6h10V24z" />
</g>
<polygon class="Blue106" points="12,10 12,12 18,12 18,14 22,11 18,8 18,10 " xmlns="http://www.w3.org/2000/svg" />
<rect y="8" class="Yellow106" width="10" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 782)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue106_white { fill:#FFFFFF;}
	.Black106_white { fill:#FFFFFF;}
	.Yellow106_white { fill:#FFFFFF;}
	.st0106_white {opacity:0.5;}
</style>
<g class="st0106_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black106_white" d="M30,6H20V0h10V6z M30,16H20v6h10V16z M30,24H20v6h10V24z" />
</g>
<polygon class="Blue106_white" points="12,10 12,12 18,12 18,14 22,11 18,8 18,10 " xmlns="http://www.w3.org/2000/svg" />
<rect y="8" class="Yellow106_white" width="10" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black107 { fill:#727272;}
	.Yellow107 { fill:#979797;}
	.Blue107 { fill:#757575;}
	.st0107 {opacity:0.5;}
</style>
<g class="st0107" xmlns="http://www.w3.org/2000/svg">
	<path class="Black107" d="M10,10H2V4h8V10z M30,4h-8v6h8V4z M30,12h-8v6h8V12z M30,20h-8v6h8V20z M10,20H2v6h8V20z" />
</g>
<path class="Blue107" d="M6,13h4v4H6v2l-4-4l4-4V13z" xmlns="http://www.w3.org/2000/svg" />
<rect x="12" y="4" class="Yellow107" width="8" height="22" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 816)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black107_white { fill:#FFFFFF;}
	.Yellow107_white { fill:#FFFFFF;}
	.Blue107_white { fill:#FFFFFF;}
	.st0107_white {opacity:0.5;}
</style>
<g class="st0107_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black107_white" d="M10,10H2V4h8V10z M30,4h-8v6h8V4z M30,12h-8v6h8V12z M30,20h-8v6h8V20z M10,20H2v6h8V20z" />
</g>
<path class="Blue107_white" d="M6,13h4v4H6v2l-4-4l4-4V13z" xmlns="http://www.w3.org/2000/svg" />
<rect x="12" y="4" class="Yellow107_white" width="8" height="22" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black108 { fill:#727272;}
	.Yellow108 { fill:#979797;}
	.Blue108 { fill:#757575;}
	.st0108 {opacity:0.5;}
</style>
<g class="st0108" xmlns="http://www.w3.org/2000/svg">
	<path class="Black108" d="M10,10H2V4h8V10z M30,4h-8v6h8V4z M10,12H2v6h8V12z M30,20h-8v6h8V20z M10,20H2v6h8V20z" />
</g>
<path class="Blue108" d="M26,13h-4v4h4v2l4-4l-4-4V13z" xmlns="http://www.w3.org/2000/svg" />
<rect x="12" y="4" class="Yellow108" width="8" height="22" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 680)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black108_white { fill:#FFFFFF;}
	.Yellow108_white { fill:#FFFFFF;}
	.Blue108_white { fill:#FFFFFF;}
	.st0108_white {opacity:0.5;}
</style>
<g class="st0108_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black108_white" d="M10,10H2V4h8V10z M30,4h-8v6h8V4z M10,12H2v6h8V12z M30,20h-8v6h8V20z M10,20H2v6h8V20z" />
</g>
<path class="Blue108_white" d="M26,13h-4v4h4v2l4-4l-4-4V13z" xmlns="http://www.w3.org/2000/svg" />
<rect x="12" y="4" class="Yellow108_white" width="8" height="22" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black109 { fill:#727272;}
	.Green109 { fill:#404040;}
	.Blue109 { fill:#757575;}
	.st0109 {opacity:0.5;}
</style>
<g class="st0109" xmlns="http://www.w3.org/2000/svg">
	<path class="Black109" d="M22,20h-2v2h2V20z M22,24h-2v2h2V24z M22,16h-2v2h2V16z" />
</g>
<path class="Blue109" d="M26,16h-2v2h2V16z M26,20h-2v2h2V20z M26,24h-2v2h2V24z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black109" d="M12,26v-2h6v2H12z M18,22v-2h-6v2H18z M31,0H7C6.4,0,6,0.4,6,1v14.9l2,1.3V2h22v28H8v-5.3l-2,1.3V31&#xD;&#xA;	c0,0.6,0.4,1,1,1h24c0.6,0,1-0.4,1-1V1C32,0.4,31.6,0,31,0z M18,16h-6v2h6V16z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Green109" points="10,21 4,17 4,20 0,20 0,22 4,22 4,25 " xmlns="http://www.w3.org/2000/svg" />
<g class="st0109" xmlns="http://www.w3.org/2000/svg">
	<rect x="12" y="6" class="Black109" width="14" height="8" />
</g>
</g>

<g transform="translate(204, 578)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black109_white { fill:#FFFFFF;}
	.Green109_white { fill:#FFFFFF;}
	.Blue109_white { fill:#FFFFFF;}
	.st0109_white {opacity:0.5;}
</style>
<g class="st0109_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black109_white" d="M22,20h-2v2h2V20z M22,24h-2v2h2V24z M22,16h-2v2h2V16z" />
</g>
<path class="Blue109_white" d="M26,16h-2v2h2V16z M26,20h-2v2h2V20z M26,24h-2v2h2V24z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black109_white" d="M12,26v-2h6v2H12z M18,22v-2h-6v2H18z M31,0H7C6.4,0,6,0.4,6,1v14.9l2,1.3V2h22v28H8v-5.3l-2,1.3V31&#xD;&#xA;	c0,0.6,0.4,1,1,1h24c0.6,0,1-0.4,1-1V1C32,0.4,31.6,0,31,0z M18,16h-6v2h6V16z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Green109_white" points="10,21 4,17 4,20 0,20 0,22 4,22 4,25 " xmlns="http://www.w3.org/2000/svg" />
<g class="st0109_white" xmlns="http://www.w3.org/2000/svg">
	<rect x="12" y="6" class="Black109_white" width="14" height="8" />
</g>
</g>

<g transform="translate(238, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black110 { fill:#727272;}
	.Blue110 { fill:#757575;}
	.st0110 {opacity:0.5;}
</style>
<g class="st0110" xmlns="http://www.w3.org/2000/svg">
	<path class="Black110" d="M20,8h-2V6h2V8z M20,10h-2v2h2V10z M20,18h-2v2h2V18z M20,22h-2v2h2V22z M20,14h-2v2h2V14z M16,8h-2V6h2V8z&#xD;&#xA;		 M16,10h-2v2h2V10z M16,18h-2v2h2V18z M16,22h-2v2h2V22z M16,14h-2v2h2V14z" />
</g>
<path class="Blue110" d="M24,8h-2V6h2V8z M24,10h-2v2h2V10z M24,14h-2v2h2V14z M24,18h-2v2h2V18z M24,22h-2v2h2V22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black110" d="M27,0H3C2.4,0,2,0.4,2,1v28c0,0.6,0.4,1,1,1h24c0.6,0,1-0.4,1-1V1C28,0.4,27.6,0,27,0z M26,28H4V2h22V28z&#xD;&#xA;	 M12,8H6V6h6V8z M12,10H6v2h6V10z M12,14H6v2h6V14z M12,18H6v2h6V18z M12,22H6v2h6V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 578)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black110_white { fill:#FFFFFF;}
	.Blue110_white { fill:#FFFFFF;}
	.st0110_white {opacity:0.5;}
</style>
<g class="st0110_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black110_white" d="M20,8h-2V6h2V8z M20,10h-2v2h2V10z M20,18h-2v2h2V18z M20,22h-2v2h2V22z M20,14h-2v2h2V14z M16,8h-2V6h2V8z&#xD;&#xA;		 M16,10h-2v2h2V10z M16,18h-2v2h2V18z M16,22h-2v2h2V22z M16,14h-2v2h2V14z" />
</g>
<path class="Blue110_white" d="M24,8h-2V6h2V8z M24,10h-2v2h2V10z M24,14h-2v2h2V14z M24,18h-2v2h2V18z M24,22h-2v2h2V22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black110_white" d="M27,0H3C2.4,0,2,0.4,2,1v28c0,0.6,0.4,1,1,1h24c0.6,0,1-0.4,1-1V1C28,0.4,27.6,0,27,0z M26,28H4V2h22V28z&#xD;&#xA;	 M12,8H6V6h6V8z M12,10H6v2h6V10z M12,14H6v2h6V14z M12,18H6v2h6V18z M12,22H6v2h6V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black111 { fill:#727272;}
</style>
<path class="Black111" d="M17.1,10h2.5l-0.5,2h-2.5l-2.5,10.2c-0.3,1.3-0.7,2.4-1.4,3.2c-0.6,0.9-1.3,1.5-2.2,1.9&#xD;&#xA;	C9.8,27.8,8.8,28,7.7,28c-1.1,0-1.9-0.2-2.6-0.6C4.4,26.8,4,26.2,4,25.6c0-0.5,0.2-1,0.5-1.3c0.4-0.4,0.8-0.5,1.3-0.5&#xD;&#xA;	c0.2,0,0.4,0,0.7,0.1C6.8,23.9,7,24,7.2,24.2c0.1,0.1,0.4,0.3,0.7,0.8c0.1,0.2,0.3,0.3,0.4,0.4c0.1,0.1,0.3,0.1,0.4,0.1&#xD;&#xA;	c0.6,0,1-0.6,1.2-1.9L12.5,12h-1.8l0.4-2H13l0.3-1.3c0.3-1.5,1.1-2.6,2.2-3.5S18,4,19.8,4c0.9,0,1.6,0.1,2.1,0.3&#xD;&#xA;	c0.5,0.2,0.9,0.5,1.2,0.9c0.3,0.4,0.4,0.8,0.4,1.2c0,0.3-0.1,0.7-0.3,1c-0.2,0.3-0.4,0.5-0.7,0.7c-0.3,0.2-0.6,0.2-1,0.2&#xD;&#xA;	c-0.3,0-0.6-0.1-0.9-0.2c-0.3-0.1-0.6-0.4-0.8-0.7c-0.3-0.4-0.5-0.6-0.7-0.7c-0.1-0.1-0.3-0.1-0.5-0.1c-0.3,0-0.6,0.2-0.8,0.5&#xD;&#xA;	c-0.2,0.2-0.3,0.7-0.5,1.4L17.1,10z M21.5,18.2l1.5,3.1c0.8-1.2,1.4-1.9,1.7-2.2c0.4-0.4,0.8-0.7,1.2-0.9s0.8-0.3,1.1-0.3&#xD;&#xA;	c0.4,0,0.7,0.1,1,0.4c0.3,0.2,0.4,0.5,0.4,0.9c0,0.2,0,0.5-0.1,0.6c-0.1,0.2-0.2,0.3-0.4,0.5c-0.2,0.1-0.4,0.2-0.5,0.3&#xD;&#xA;	c-0.1,0-0.3,0-0.7,0.1c-0.4,0-0.7,0-0.8,0.1c-0.2,0-0.3,0.1-0.5,0.3c-0.2,0.2-0.4,0.3-0.6,0.6c-0.1,0.1-0.4,0.5-1,1.4l0.5,1&#xD;&#xA;	c0.4,0.8,0.7,1.3,1,1.6c0.3,0.2,0.5,0.4,0.8,0.4c0.4,0,0.9-0.2,1.4-0.7l1.1,1.2c-1.1,1-2.2,1.5-3.4,1.5c-0.5,0-0.9-0.1-1.3-0.2&#xD;&#xA;	c-0.4-0.2-0.7-0.4-1-0.7c-0.3-0.3-0.6-0.8-0.9-1.4l-0.5-1.1c-0.5,0.8-1,1.5-1.6,2.1c-0.5,0.6-1,0.9-1.4,1.1C18,27.9,17.6,28,17.2,28&#xD;&#xA;	c-0.3,0-0.5-0.1-0.8-0.2c-0.2-0.1-0.3-0.2-0.4-0.5c-0.1-0.2-0.2-0.4-0.2-0.7c0-0.3,0.1-0.5,0.2-0.7c0.1-0.2,0.3-0.4,0.5-0.5&#xD;&#xA;	c0.2-0.1,0.6-0.2,1.1-0.2c0.4,0,0.7-0.1,0.9-0.2c0.2-0.1,0.5-0.3,0.7-0.6c0.3-0.3,0.7-0.8,1.2-1.7l-0.9-2h-1.4l0.4-1.8&#xD;&#xA;	c0.8-0.1,1.5-0.4,2.2-0.8H21.5z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 578)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black111_white { fill:#FFFFFF;}
</style>
<path class="Black111_white" d="M17.1,10h2.5l-0.5,2h-2.5l-2.5,10.2c-0.3,1.3-0.7,2.4-1.4,3.2c-0.6,0.9-1.3,1.5-2.2,1.9&#xD;&#xA;	C9.8,27.8,8.8,28,7.7,28c-1.1,0-1.9-0.2-2.6-0.6C4.4,26.8,4,26.2,4,25.6c0-0.5,0.2-1,0.5-1.3c0.4-0.4,0.8-0.5,1.3-0.5&#xD;&#xA;	c0.2,0,0.4,0,0.7,0.1C6.8,23.9,7,24,7.2,24.2c0.1,0.1,0.4,0.3,0.7,0.8c0.1,0.2,0.3,0.3,0.4,0.4c0.1,0.1,0.3,0.1,0.4,0.1&#xD;&#xA;	c0.6,0,1-0.6,1.2-1.9L12.5,12h-1.8l0.4-2H13l0.3-1.3c0.3-1.5,1.1-2.6,2.2-3.5S18,4,19.8,4c0.9,0,1.6,0.1,2.1,0.3&#xD;&#xA;	c0.5,0.2,0.9,0.5,1.2,0.9c0.3,0.4,0.4,0.8,0.4,1.2c0,0.3-0.1,0.7-0.3,1c-0.2,0.3-0.4,0.5-0.7,0.7c-0.3,0.2-0.6,0.2-1,0.2&#xD;&#xA;	c-0.3,0-0.6-0.1-0.9-0.2c-0.3-0.1-0.6-0.4-0.8-0.7c-0.3-0.4-0.5-0.6-0.7-0.7c-0.1-0.1-0.3-0.1-0.5-0.1c-0.3,0-0.6,0.2-0.8,0.5&#xD;&#xA;	c-0.2,0.2-0.3,0.7-0.5,1.4L17.1,10z M21.5,18.2l1.5,3.1c0.8-1.2,1.4-1.9,1.7-2.2c0.4-0.4,0.8-0.7,1.2-0.9s0.8-0.3,1.1-0.3&#xD;&#xA;	c0.4,0,0.7,0.1,1,0.4c0.3,0.2,0.4,0.5,0.4,0.9c0,0.2,0,0.5-0.1,0.6c-0.1,0.2-0.2,0.3-0.4,0.5c-0.2,0.1-0.4,0.2-0.5,0.3&#xD;&#xA;	c-0.1,0-0.3,0-0.7,0.1c-0.4,0-0.7,0-0.8,0.1c-0.2,0-0.3,0.1-0.5,0.3c-0.2,0.2-0.4,0.3-0.6,0.6c-0.1,0.1-0.4,0.5-1,1.4l0.5,1&#xD;&#xA;	c0.4,0.8,0.7,1.3,1,1.6c0.3,0.2,0.5,0.4,0.8,0.4c0.4,0,0.9-0.2,1.4-0.7l1.1,1.2c-1.1,1-2.2,1.5-3.4,1.5c-0.5,0-0.9-0.1-1.3-0.2&#xD;&#xA;	c-0.4-0.2-0.7-0.4-1-0.7c-0.3-0.3-0.6-0.8-0.9-1.4l-0.5-1.1c-0.5,0.8-1,1.5-1.6,2.1c-0.5,0.6-1,0.9-1.4,1.1C18,27.9,17.6,28,17.2,28&#xD;&#xA;	c-0.3,0-0.5-0.1-0.8-0.2c-0.2-0.1-0.3-0.2-0.4-0.5c-0.1-0.2-0.2-0.4-0.2-0.7c0-0.3,0.1-0.5,0.2-0.7c0.1-0.2,0.3-0.4,0.5-0.5&#xD;&#xA;	c0.2-0.1,0.6-0.2,1.1-0.2c0.4,0,0.7-0.1,0.9-0.2c0.2-0.1,0.5-0.3,0.7-0.6c0.3-0.3,0.7-0.8,1.2-1.7l-0.9-2h-1.4l0.4-1.8&#xD;&#xA;	c0.8-0.1,1.5-0.4,2.2-0.8H21.5z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow112 { fill:#979797;}
	.Red112 { fill:#585858;}
	.Black112 { fill:#727272;}
	.Blue112 { fill:#757575;}
	.White112 { fill:#FFFFFF;}
	.Green112 { fill:#404040;}
	.st0112 {opacity:0.75;}
	.st1112 {opacity:0.5;}
	.st2112 {opacity:0.25;}
	.st3112 { fill:#979797;}
</style>
<g id="Images" xmlns="http://www.w3.org/2000/svg">
	<path class="Black112" d="M29,4H3C2.5,4,2,4.5,2,5v22c0,0.5,0.5,1,1,1h26c0.5,0,1-0.5,1-1V5C30,4.5,29.5,4,29,4z M28,26H4V6h24V26z" />
	<circle class="Yellow112" cx="21" cy="11" r="3" />
	<polygon class="Green112" points="20,24 10,14 6,18 6,24 	" />
	<g class="st1112">
		<polygon class="Green112" points="22,24 18,20 20,18 26,24 		" />
	</g>
</g>
</g>

<g transform="translate(340, 578)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow112_white { fill:#FFFFFF;}
	.Red112_white { fill:#FFFFFF;}
	.Black112_white { fill:#FFFFFF;}
	.Blue112_white { fill:#FFFFFF;}
	.White112_white { fill:#FFFFFF;}
	.Green112_white { fill:#FFFFFF;}
	.st0112_white {opacity:0.75;}
	.st1112_white {opacity:0.5;}
	.st2112_white {opacity:0.25;}
	.st3112_white { fill:#FFFFFF;}
</style>
<g id="Images" xmlns="http://www.w3.org/2000/svg">
	<path class="Black112_white" d="M29,4H3C2.5,4,2,4.5,2,5v22c0,0.5,0.5,1,1,1h26c0.5,0,1-0.5,1-1V5C30,4.5,29.5,4,29,4z M28,26H4V6h24V26z" />
	<circle class="Yellow112_white" cx="21" cy="11" r="3" />
	<polygon class="Green112_white" points="20,24 10,14 6,18 6,24 	" />
	<g class="st1112_white">
		<polygon class="Green112_white" points="22,24 18,20 20,18 26,24 		" />
	</g>
</g>
</g>

<g transform="translate(442, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black113 { fill:#727272;}
	.Yellow113 { fill:#979797;}
	.Blue113 { fill:#757575;}
	.st0113 {opacity:0.5;}
</style>
<g class="st0113" xmlns="http://www.w3.org/2000/svg">
	<path class="Black113" d="M10,10H2V4h8V10z M20,20h-8v6h8V20z M30,4h-8v6h8V4z M10,20H2v6h8V20z M30,20h-8v6h8V20z" />
</g>
<path class="Yellow113" d="M30,12H2v6h28V12z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Blue113" points="20,6 16,2 12,6 14,6 14,10 18,10 18,6 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 782)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black113_white { fill:#FFFFFF;}
	.Yellow113_white { fill:#FFFFFF;}
	.Blue113_white { fill:#FFFFFF;}
	.st0113_white {opacity:0.5;}
</style>
<g class="st0113_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black113_white" d="M10,10H2V4h8V10z M20,20h-8v6h8V20z M30,4h-8v6h8V4z M10,20H2v6h8V20z M30,20h-8v6h8V20z" />
</g>
<path class="Yellow113_white" d="M30,12H2v6h28V12z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Blue113_white" points="20,6 16,2 12,6 14,6 14,10 18,10 18,6 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black114 { fill:#727272;}
	.Yellow114 { fill:#979797;}
	.Blue114 { fill:#757575;}
	.st0114 {opacity:0.5;}
</style>
<g class="st0114" xmlns="http://www.w3.org/2000/svg">
	<path class="Black114" d="M10,10H2V4h8V10z M20,4h-8v6h8V4z M30,4h-8v6h8V4z M10,20H2v6h8V20z M30,20h-8v6h8V20z" />
</g>
<path class="Yellow114" d="M30,12H2v6h28V12z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Blue114" points="20,24 16,28 12,24 14,24 14,20 18,20 18,24 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 578)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black114_white { fill:#FFFFFF;}
	.Yellow114_white { fill:#FFFFFF;}
	.Blue114_white { fill:#FFFFFF;}
	.st0114_white {opacity:0.5;}
</style>
<g class="st0114_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black114_white" d="M10,10H2V4h8V10z M20,4h-8v6h8V4z M30,4h-8v6h8V4z M10,20H2v6h8V20z M30,20h-8v6h8V20z" />
</g>
<path class="Yellow114_white" d="M30,12H2v6h28V12z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Blue114_white" points="20,24 16,28 12,24 14,24 14,20 18,20 18,24 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black115 { fill:#727272;}
	.Blue115 { fill:#757575;}
	.st0115 {opacity:0.75;}
</style>
<path class="Black115" d="M27,2H5C4.5,2,4,2.5,4,3v26c0,0.5,0.5,1,1,1h22c0.5,0,1-0.5,1-1V3C28,2.5,27.5,2,27,2z M26,28H6V4h20V28z" xmlns="http://www.w3.org/2000/svg" />
<g class="st0115" xmlns="http://www.w3.org/2000/svg">
	<path class="Black115" d="M24,26H8v-2h16V26z M24,20H8v2h16V20z" />
</g>
<path class="Blue115" d="M22,18h-3l-0.9-2.7h-4.3L13,18h-3l4.4-12h3.2L22,18z M17.5,13.3l-1.3-4c-0.1-0.3-0.2-0.7-0.2-1.1h-0.1&#xD;&#xA;	c0,0.4-0.1,0.7-0.2,1l-1.3,4.1H17.5z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 578)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black115_white { fill:#FFFFFF;}
	.Blue115_white { fill:#FFFFFF;}
	.st0115_white {opacity:0.75;}
</style>
<path class="Black115_white" d="M27,2H5C4.5,2,4,2.5,4,3v26c0,0.5,0.5,1,1,1h22c0.5,0,1-0.5,1-1V3C28,2.5,27.5,2,27,2z M26,28H6V4h20V28z" xmlns="http://www.w3.org/2000/svg" />
<g class="st0115_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black115_white" d="M24,26H8v-2h16V26z M24,20H8v2h16V20z" />
</g>
<path class="Blue115_white" d="M22,18h-3l-0.9-2.7h-4.3L13,18h-3l4.4-12h3.2L22,18z M17.5,13.3l-1.3-4c-0.1-0.3-0.2-0.7-0.2-1.1h-0.1&#xD;&#xA;	c0,0.4-0.1,0.7-0.2,1l-1.3,4.1H17.5z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black116 { fill:#727272;}
</style>
<polygon class="Black116" points="21.6,6 22,4 14,4 13.6,6 15.8,6 12,24 9.8,24 9.4,26 17.6,26 17.8,24 15.6,24 19.4,6 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 578)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black116_white { fill:#FFFFFF;}
</style>
<polygon class="Black116_white" points="21.6,6 22,4 14,4 13.6,6 15.8,6 12,24 9.8,24 9.4,26 17.6,26 17.8,24 15.6,24 19.4,6 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black117 { fill:#727272;}
	.Yellow117 { fill:#979797;}
	.Blue117 { fill:#757575;}
</style>
<path class="Blue117" d="M3.3,28c1.3-1.1,2.9-1.7,4.7-1.9v3.9C6.2,29.7,4.6,29.1,3.3,28z M14.9,18l-2,2h5.1c-0.1-0.7-0.3-1.4-0.5-2&#xD;&#xA;	H14.9z M10,22v2.1c2.3,0.2,4.4,1.1,6.1,2.5c1-1.3,1.7-2.9,1.9-4.6h-7.1H10z M1.9,26.6c1.7-1.4,3.8-2.3,6.1-2.5V22H0.1&#xD;&#xA;	C0.2,23.7,0.9,25.3,1.9,26.6z M10,29.9c1.8-0.2,3.4-0.9,4.7-1.9c-1.3-1.1-2.9-1.7-4.7-1.9V29.9z M5,18c-1.5,0-2.7-1.1-2.9-2.5&#xD;&#xA;	c0,0-0.1-0.1-0.1-0.1c-1,1.3-1.7,2.9-1.9,4.6H8v-2H7H5z" xmlns="http://www.w3.org/2000/svg" />
<path class="Yellow117" d="M29,0H5C4.5,0,4,0.5,4,1v14c0,0.5,0.5,1,1,1h5v4l4-4h15c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black117" d="M13.9,12h-2l-0.6-1.8H8.5L8,12H6l2.9-8H11L13.9,12z M10.9,8.8l-0.9-2.7C10,5.9,10,5.7,10,5.4h0&#xD;&#xA;	c0,0.2-0.1,0.5-0.1,0.7L8.9,8.8H10.9z M14.9,12V4h2.9c0.9,0,1.6,0.2,2.1,0.5c0.5,0.3,0.7,0.8,0.7,1.4c0,0.4-0.1,0.8-0.4,1.1&#xD;&#xA;	c-0.3,0.3-0.7,0.5-1.1,0.7v0c0.6,0.1,1,0.3,1.4,0.6c0.3,0.3,0.5,0.8,0.5,1.3c0,0.7-0.3,1.3-0.8,1.7C19.6,11.8,18.9,12,18,12H14.9z&#xD;&#xA;	 M16.7,5.3v1.9h0.8c0.4,0,0.7-0.1,0.9-0.3s0.3-0.4,0.3-0.7c0-0.6-0.4-0.9-1.3-0.9H16.7z M16.7,8.6v2.1h1c0.4,0,0.7-0.1,1-0.3&#xD;&#xA;	c0.2-0.2,0.4-0.5,0.4-0.8c0-0.3-0.1-0.6-0.3-0.8c-0.2-0.2-0.6-0.3-1-0.3H16.7z M27.9,11.7c-0.6,0.3-1.3,0.4-2.3,0.4&#xD;&#xA;	c-1.2,0-2.2-0.4-2.9-1.1c-0.7-0.7-1.1-1.7-1.1-2.9c0-1.3,0.4-2.3,1.2-3.1c0.8-0.8,1.8-1.2,3.1-1.2c0.8,0,1.4,0.1,2,0.3v1.7&#xD;&#xA;	c-0.5-0.3-1.1-0.5-1.8-0.5c-0.8,0-1.4,0.2-1.8,0.7c-0.5,0.5-0.7,1.1-0.7,1.9c0,0.8,0.2,1.4,0.7,1.8s1,0.7,1.8,0.7&#xD;&#xA;	c0.7,0,1.3-0.2,1.9-0.5V11.7z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 578)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black117_white { fill:#FFFFFF;}
	.Yellow117_white { fill:#FFFFFF;}
	.Blue117_white { fill:#FFFFFF;}
</style>
<path class="Blue117_white" d="M3.3,28c1.3-1.1,2.9-1.7,4.7-1.9v3.9C6.2,29.7,4.6,29.1,3.3,28z M14.9,18l-2,2h5.1c-0.1-0.7-0.3-1.4-0.5-2&#xD;&#xA;	H14.9z M10,22v2.1c2.3,0.2,4.4,1.1,6.1,2.5c1-1.3,1.7-2.9,1.9-4.6h-7.1H10z M1.9,26.6c1.7-1.4,3.8-2.3,6.1-2.5V22H0.1&#xD;&#xA;	C0.2,23.7,0.9,25.3,1.9,26.6z M10,29.9c1.8-0.2,3.4-0.9,4.7-1.9c-1.3-1.1-2.9-1.7-4.7-1.9V29.9z M5,18c-1.5,0-2.7-1.1-2.9-2.5&#xD;&#xA;	c0,0-0.1-0.1-0.1-0.1c-1,1.3-1.7,2.9-1.9,4.6H8v-2H7H5z" xmlns="http://www.w3.org/2000/svg" />
<path class="Yellow117_white" d="M29,0H5C4.5,0,4,0.5,4,1v14c0,0.5,0.5,1,1,1h5v4l4-4h15c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black117_white" d="M13.9,12h-2l-0.6-1.8H8.5L8,12H6l2.9-8H11L13.9,12z M10.9,8.8l-0.9-2.7C10,5.9,10,5.7,10,5.4h0&#xD;&#xA;	c0,0.2-0.1,0.5-0.1,0.7L8.9,8.8H10.9z M14.9,12V4h2.9c0.9,0,1.6,0.2,2.1,0.5c0.5,0.3,0.7,0.8,0.7,1.4c0,0.4-0.1,0.8-0.4,1.1&#xD;&#xA;	c-0.3,0.3-0.7,0.5-1.1,0.7v0c0.6,0.1,1,0.3,1.4,0.6c0.3,0.3,0.5,0.8,0.5,1.3c0,0.7-0.3,1.3-0.8,1.7C19.6,11.8,18.9,12,18,12H14.9z&#xD;&#xA;	 M16.7,5.3v1.9h0.8c0.4,0,0.7-0.1,0.9-0.3s0.3-0.4,0.3-0.7c0-0.6-0.4-0.9-1.3-0.9H16.7z M16.7,8.6v2.1h1c0.4,0,0.7-0.1,1-0.3&#xD;&#xA;	c0.2-0.2,0.4-0.5,0.4-0.8c0-0.3-0.1-0.6-0.3-0.8c-0.2-0.2-0.6-0.3-1-0.3H16.7z M27.9,11.7c-0.6,0.3-1.3,0.4-2.3,0.4&#xD;&#xA;	c-1.2,0-2.2-0.4-2.9-1.1c-0.7-0.7-1.1-1.7-1.1-2.9c0-1.3,0.4-2.3,1.2-3.1c0.8-0.8,1.8-1.2,3.1-1.2c0.8,0,1.4,0.1,2,0.3v1.7&#xD;&#xA;	c-0.5-0.3-1.1-0.5-1.8-0.5c-0.8,0-1.4,0.2-1.8,0.7c-0.5,0.5-0.7,1.1-0.7,1.9c0,0.8,0.2,1.4,0.7,1.8s1,0.7,1.8,0.7&#xD;&#xA;	c0.7,0,1.3-0.2,1.9-0.5V11.7z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue118 { fill:#757575;}
</style>
<path class="Blue118" d="M21.6,14.5c0.5,0.3,0.5,0.8,0,1.1L4.9,25.9C4.4,26.2,4,25.9,4,25.4V4.6c0-0.6,0.4-0.8,0.9-0.5L21.6,14.5z&#xD;&#xA;	 M28,25V5c0-0.6-0.5-1-1-1h-2c-0.5,0-1,0.4-1,1v20c0,0.5,0.5,1,1,1h2C27.5,26,28,25.5,28,25z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 612)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue118_white { fill:#FFFFFF;}
</style>
<path class="Blue118_white" d="M21.6,14.5c0.5,0.3,0.5,0.8,0,1.1L4.9,25.9C4.4,26.2,4,25.9,4,25.4V4.6c0-0.6,0.4-0.8,0.9-0.5L21.6,14.5z&#xD;&#xA;	 M28,25V5c0-0.6-0.5-1-1-1h-2c-0.5,0-1,0.4-1,1v20c0,0.5,0.5,1,1,1h2C27.5,26,28,25.5,28,25z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0119 {fill:#727272;enable-background:new    ;}
</style>
<path class="st0119" d="M12,8H2V6h10V8z M30,6H14v2h16V6z M12,10H2v2h10V10z M30,10H14v2h16V10z M12,14H2v2h10V14z M30,14H14v2h16V14z&#xD;&#xA;	 M12,18H2v2h10V18z M30,18H14v2h16V18z M12,22H2v2h10V22z M30,22H14v2h16V22z" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="2" class="st0119" width="10" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="14" y="2" class="st0119" width="16" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="26" class="st0119" width="10" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="14" y="26" class="st0119" width="16" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 884)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0119_white { fill:#FFFFFF;enable-background:new    ;}
</style>
<path class="st0119_white" d="M12,8H2V6h10V8z M30,6H14v2h16V6z M12,10H2v2h10V10z M30,10H14v2h16V10z M12,14H2v2h10V14z M30,14H14v2h16V14z&#xD;&#xA;	 M12,18H2v2h10V18z M30,18H14v2h16V18z M12,22H2v2h10V22z M30,22H14v2h16V22z" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="2" class="st0119_white" width="10" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="14" y="2" class="st0119_white" width="16" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="26" class="st0119_white" width="10" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="14" y="26" class="st0119_white" width="16" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black120 { fill:#727272;}
	.Blue120 { fill:#757575;}
	.Red120 { fill:#585858;}
</style>
<path class="Black120" d="M31,2H13c-0.5,0-1,0.5-1,1v26c0,0.5,0.5,1,1,1h18c0.5,0,1-0.5,1-1V3C32,2.5,31.5,2,31,2z M30,28H14V4h16V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue120" d="M26,12h-8v-2h8V12z M26,22h-8v-2h8V22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red120" d="M4,6v8H2V9.3l-2,0V7.7l0.2,0c0.2,0,0.5,0,0.7-0.1c0.3,0,0.5-0.1,0.7-0.3c0.2-0.1,0.4-0.3,0.5-0.5&#xD;&#xA;	c0.1-0.2,0.2-0.4,0.3-0.7l0-0.1H4z M6,24v-1.6H2.6C2.7,22.2,2.9,22.1,3,22c0.2-0.2,0.5-0.4,0.7-0.5c0.3-0.2,0.5-0.3,0.8-0.5&#xD;&#xA;	c0.3-0.2,0.5-0.4,0.7-0.6c0.2-0.2,0.4-0.5,0.5-0.8c0.1-0.3,0.2-0.6,0.2-1c0-0.4-0.1-0.7-0.2-1.1c-0.1-0.3-0.4-0.6-0.6-0.8&#xD;&#xA;	c-0.3-0.2-0.5-0.4-0.9-0.5c-0.3-0.1-0.7-0.2-1-0.2c-0.5,0-0.9,0.1-1.3,0.2c-0.4,0.2-0.7,0.4-0.9,0.7c-0.2,0.3-0.4,0.6-0.5,1&#xD;&#xA;	c-0.1,0.4-0.2,0.8-0.2,1.3l0,0.1h1.8v-0.1c0-0.2,0-0.4,0.1-0.6c0-0.2,0.1-0.4,0.2-0.5c0.1-0.1,0.2-0.3,0.3-0.4&#xD;&#xA;	c0.1-0.1,0.3-0.1,0.5-0.1c0.3,0,0.5,0.1,0.7,0.3c0.2,0.2,0.3,0.4,0.3,0.8c0,0.2,0,0.4-0.1,0.5c-0.1,0.2-0.2,0.3-0.4,0.5&#xD;&#xA;	c-0.1,0.1-0.3,0.3-0.5,0.4c-0.2,0.1-0.4,0.2-0.5,0.4C2.3,20.6,2,20.8,1.7,21c-0.3,0.2-0.6,0.5-0.8,0.7c-0.2,0.3-0.4,0.6-0.5,0.9&#xD;&#xA;	c-0.1,0.3-0.2,0.7-0.2,1.2V24H6z M10,10H8v2h2V10z M10,20H8v2h2V20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 782)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black120_white { fill:#FFFFFF;}
	.Blue120_white { fill:#FFFFFF;}
	.Red120_white { fill:#FFFFFF;}
</style>
<path class="Black120_white" d="M31,2H13c-0.5,0-1,0.5-1,1v26c0,0.5,0.5,1,1,1h18c0.5,0,1-0.5,1-1V3C32,2.5,31.5,2,31,2z M30,28H14V4h16V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue120_white" d="M26,12h-8v-2h8V12z M26,22h-8v-2h8V22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red120_white" d="M4,6v8H2V9.3l-2,0V7.7l0.2,0c0.2,0,0.5,0,0.7-0.1c0.3,0,0.5-0.1,0.7-0.3c0.2-0.1,0.4-0.3,0.5-0.5&#xD;&#xA;	c0.1-0.2,0.2-0.4,0.3-0.7l0-0.1H4z M6,24v-1.6H2.6C2.7,22.2,2.9,22.1,3,22c0.2-0.2,0.5-0.4,0.7-0.5c0.3-0.2,0.5-0.3,0.8-0.5&#xD;&#xA;	c0.3-0.2,0.5-0.4,0.7-0.6c0.2-0.2,0.4-0.5,0.5-0.8c0.1-0.3,0.2-0.6,0.2-1c0-0.4-0.1-0.7-0.2-1.1c-0.1-0.3-0.4-0.6-0.6-0.8&#xD;&#xA;	c-0.3-0.2-0.5-0.4-0.9-0.5c-0.3-0.1-0.7-0.2-1-0.2c-0.5,0-0.9,0.1-1.3,0.2c-0.4,0.2-0.7,0.4-0.9,0.7c-0.2,0.3-0.4,0.6-0.5,1&#xD;&#xA;	c-0.1,0.4-0.2,0.8-0.2,1.3l0,0.1h1.8v-0.1c0-0.2,0-0.4,0.1-0.6c0-0.2,0.1-0.4,0.2-0.5c0.1-0.1,0.2-0.3,0.3-0.4&#xD;&#xA;	c0.1-0.1,0.3-0.1,0.5-0.1c0.3,0,0.5,0.1,0.7,0.3c0.2,0.2,0.3,0.4,0.3,0.8c0,0.2,0,0.4-0.1,0.5c-0.1,0.2-0.2,0.3-0.4,0.5&#xD;&#xA;	c-0.1,0.1-0.3,0.3-0.5,0.4c-0.2,0.1-0.4,0.2-0.5,0.4C2.3,20.6,2,20.8,1.7,21c-0.3,0.2-0.6,0.5-0.8,0.7c-0.2,0.3-0.4,0.6-0.5,0.9&#xD;&#xA;	c-0.1,0.3-0.2,0.7-0.2,1.2V24H6z M10,10H8v2h2V10z M10,20H8v2h2V20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 476)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue121 { fill:#757575;}
	.Black121 { fill:#727272;}
</style>
<path class="Black121" d="M30,16H12v-2h18V16z M30,8H12v2h18V8z M30,20H12v2h18V20z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue121" d="M6,24h4l-5,5l-5-5h4v-6h2V24z M4,12h2V6h4L5,1L0,6h4V12z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 986)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue121_white { fill:#FFFFFF;}
	.Black121_white { fill:#FFFFFF;}
</style>
<path class="Black121_white" d="M30,16H12v-2h18V16z M30,8H12v2h18V8z M30,20H12v2h18V20z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue121_white" d="M6,24h4l-5,5l-5-5h4v-6h2V24z M4,12h2V6h4L5,1L0,6h4V12z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black122 { fill:#727272;}
	.Yellow122 { fill:#979797;}
	.Blue122 { fill:#757575;}
</style>
<path class="Yellow122" d="M16,16H6v-6h10V16z M32,10H22v6h10V10z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black122" d="M14,16v11c0,0.5-0.5,1-1,1H3c-0.5,0-1-0.5-1-1V13c0-0.5,0.5-1,1-1h3v2H4v12h8V16H14z M28,16v10h-8V14h2v-2h-3&#xD;&#xA;	c-0.5,0-1,0.5-1,1v14c0,0.5,0.5,1,1,1h10c0.5,0,1-0.5,1-1V16H28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue122" d="M10.9,2.9C12.7,1.1,15.2,0,18,0c4.8,0,8.9,3.4,9.8,8h-2.1c-0.9-3.4-4-6-7.7-6c-2.2,0-4.2,0.9-5.6,2.4L16,8H8V0&#xD;&#xA;	L10.9,2.9z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 782)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black122_white { fill:#FFFFFF;}
	.Yellow122_white { fill:#FFFFFF;}
	.Blue122_white { fill:#FFFFFF;}
</style>
<path class="Yellow122_white" d="M16,16H6v-6h10V16z M32,10H22v6h10V10z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black122_white" d="M14,16v11c0,0.5-0.5,1-1,1H3c-0.5,0-1-0.5-1-1V13c0-0.5,0.5-1,1-1h3v2H4v12h8V16H14z M28,16v10h-8V14h2v-2h-3&#xD;&#xA;	c-0.5,0-1,0.5-1,1v14c0,0.5,0.5,1,1,1h10c0.5,0,1-0.5,1-1V16H28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue122_white" d="M10.9,2.9C12.7,1.1,15.2,0,18,0c4.8,0,8.9,3.4,9.8,8h-2.1c-0.9-3.4-4-6-7.7-6c-2.2,0-4.2,0.9-5.6,2.4L16,8H8V0&#xD;&#xA;	L10.9,2.9z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black123 { fill:#727272;}
	.Blue123 { fill:#757575;}
</style>
<path class="Black123" d="M30,8H12V6h18V8z M30,16H12v-2h18V16z M30,24H12v-2h18V24z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue123" d="M8,7c0,1.7-1.3,3-3,3S2,8.7,2,7s1.3-3,3-3S8,5.3,8,7z M5,12c-1.7,0-3,1.3-3,3s1.3,3,3,3s3-1.3,3-3S6.7,12,5,12&#xD;&#xA;	z M5,20c-1.7,0-3,1.3-3,3s1.3,3,3,3s3-1.3,3-3S6.7,20,5,20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 816)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black123_white { fill:#FFFFFF;}
	.Blue123_white { fill:#FFFFFF;}
</style>
<path class="Black123_white" d="M30,8H12V6h18V8z M30,16H12v-2h18V16z M30,24H12v-2h18V24z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue123_white" d="M8,7c0,1.7-1.3,3-3,3S2,8.7,2,7s1.3-3,3-3S8,5.3,8,7z M5,12c-1.7,0-3,1.3-3,3s1.3,3,3,3s3-1.3,3-3S6.7,12,5,12&#xD;&#xA;	z M5,20c-1.7,0-3,1.3-3,3s1.3,3,3,3s3-1.3,3-3S6.7,20,5,20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red124 { fill:#585858;}
	.Black124 { fill:#727272;}
</style>
<path class="Black124" d="M24,8H6V6h18V8z M28,18H10v-2h18V18z M32,28H14v-2h18V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red124" d="M4,2v8H2V5.3l-2,0V3.7l0.2,0c0.2,0,0.5,0,0.7-0.1c0.3,0,0.5-0.1,0.7-0.3c0.2-0.1,0.4-0.3,0.5-0.5&#xD;&#xA;	c0.1-0.2,0.2-0.4,0.3-0.7l0-0.1H4z M5.4,20c0.3-0.1,0.6-0.3,0.8-0.5c0,0,0,0.1,0,0.1c0,0.1,0,0.2,0.1,0.3l0,0.1h2l-0.1-0.2&#xD;&#xA;	c-0.1-0.1-0.1-0.3-0.1-0.5c0-0.3,0-0.5,0-0.8v-3.3c0-0.4-0.1-0.8-0.3-1c-0.2-0.2-0.4-0.4-0.7-0.6c-0.3-0.1-0.6-0.2-0.9-0.3&#xD;&#xA;	c-0.3,0-0.6-0.1-1-0.1c-0.3,0-0.7,0-1,0.1c-0.3,0.1-0.7,0.2-0.9,0.4c-0.3,0.2-0.5,0.4-0.7,0.7c-0.2,0.3-0.3,0.7-0.3,1.1l0,0.1h1.9&#xD;&#xA;	l0-0.1c0-0.3,0.1-0.5,0.3-0.7c0.2-0.1,0.4-0.2,0.7-0.2c0.1,0,0.3,0,0.4,0c0.1,0,0.2,0.1,0.3,0.1C5.9,14.8,6,14.9,6,15&#xD;&#xA;	c0,0.1,0.1,0.2,0.1,0.4c0,0.1,0,0.2-0.1,0.3c-0.1,0.1-0.2,0.1-0.4,0.2c-0.2,0-0.4,0.1-0.6,0.1c-0.2,0-0.5,0.1-0.8,0.1&#xD;&#xA;	c-0.3,0-0.5,0.1-0.8,0.2c-0.3,0.1-0.5,0.2-0.7,0.3c-0.2,0.2-0.4,0.4-0.5,0.6c-0.1,0.3-0.2,0.6-0.2,1c0,0.3,0.1,0.6,0.2,0.9&#xD;&#xA;	c0.1,0.3,0.3,0.5,0.5,0.6C2.9,19.8,3.1,20,3.4,20c0.3,0.1,0.5,0.1,0.9,0.1C4.6,20.2,5,20.1,5.4,20z M6.1,17v0.4c0,0.1,0,0.2,0,0.4&#xD;&#xA;	c0,0.1-0.1,0.3-0.1,0.4c-0.1,0.1-0.2,0.3-0.4,0.4c-0.2,0.1-0.4,0.2-0.7,0.2c-0.1,0-0.3,0-0.4,0c-0.1,0-0.2-0.1-0.3-0.1&#xD;&#xA;	C4.1,18.6,4,18.5,4,18.4c0-0.1-0.1-0.2-0.1-0.3c0-0.1,0-0.3,0.1-0.3c0-0.1,0.1-0.2,0.2-0.2c0.1-0.1,0.2-0.1,0.3-0.1&#xD;&#xA;	c0.1,0,0.2-0.1,0.4-0.1c0.1,0,0.3,0,0.4-0.1c0.1,0,0.3,0,0.4-0.1c0.1,0,0.2-0.1,0.4-0.1C6,17,6.1,17,6.1,17z M10,22H8v2h2V22z&#xD;&#xA;	 M10,30H8v-4.9h2V30z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 816)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red124_white { fill:#FFFFFF;}
	.Black124_white { fill:#FFFFFF;}
</style>
<path class="Black124_white" d="M24,8H6V6h18V8z M28,18H10v-2h18V18z M32,28H14v-2h18V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red124_white" d="M4,2v8H2V5.3l-2,0V3.7l0.2,0c0.2,0,0.5,0,0.7-0.1c0.3,0,0.5-0.1,0.7-0.3c0.2-0.1,0.4-0.3,0.5-0.5&#xD;&#xA;	c0.1-0.2,0.2-0.4,0.3-0.7l0-0.1H4z M5.4,20c0.3-0.1,0.6-0.3,0.8-0.5c0,0,0,0.1,0,0.1c0,0.1,0,0.2,0.1,0.3l0,0.1h2l-0.1-0.2&#xD;&#xA;	c-0.1-0.1-0.1-0.3-0.1-0.5c0-0.3,0-0.5,0-0.8v-3.3c0-0.4-0.1-0.8-0.3-1c-0.2-0.2-0.4-0.4-0.7-0.6c-0.3-0.1-0.6-0.2-0.9-0.3&#xD;&#xA;	c-0.3,0-0.6-0.1-1-0.1c-0.3,0-0.7,0-1,0.1c-0.3,0.1-0.7,0.2-0.9,0.4c-0.3,0.2-0.5,0.4-0.7,0.7c-0.2,0.3-0.3,0.7-0.3,1.1l0,0.1h1.9&#xD;&#xA;	l0-0.1c0-0.3,0.1-0.5,0.3-0.7c0.2-0.1,0.4-0.2,0.7-0.2c0.1,0,0.3,0,0.4,0c0.1,0,0.2,0.1,0.3,0.1C5.9,14.8,6,14.9,6,15&#xD;&#xA;	c0,0.1,0.1,0.2,0.1,0.4c0,0.1,0,0.2-0.1,0.3c-0.1,0.1-0.2,0.1-0.4,0.2c-0.2,0-0.4,0.1-0.6,0.1c-0.2,0-0.5,0.1-0.8,0.1&#xD;&#xA;	c-0.3,0-0.5,0.1-0.8,0.2c-0.3,0.1-0.5,0.2-0.7,0.3c-0.2,0.2-0.4,0.4-0.5,0.6c-0.1,0.3-0.2,0.6-0.2,1c0,0.3,0.1,0.6,0.2,0.9&#xD;&#xA;	c0.1,0.3,0.3,0.5,0.5,0.6C2.9,19.8,3.1,20,3.4,20c0.3,0.1,0.5,0.1,0.9,0.1C4.6,20.2,5,20.1,5.4,20z M6.1,17v0.4c0,0.1,0,0.2,0,0.4&#xD;&#xA;	c0,0.1-0.1,0.3-0.1,0.4c-0.1,0.1-0.2,0.3-0.4,0.4c-0.2,0.1-0.4,0.2-0.7,0.2c-0.1,0-0.3,0-0.4,0c-0.1,0-0.2-0.1-0.3-0.1&#xD;&#xA;	C4.1,18.6,4,18.5,4,18.4c0-0.1-0.1-0.2-0.1-0.3c0-0.1,0-0.3,0.1-0.3c0-0.1,0.1-0.2,0.2-0.2c0.1-0.1,0.2-0.1,0.3-0.1&#xD;&#xA;	c0.1,0,0.2-0.1,0.4-0.1c0.1,0,0.3,0,0.4-0.1c0.1,0,0.3,0,0.4-0.1c0.1,0,0.2-0.1,0.4-0.1C6,17,6.1,17,6.1,17z M10,22H8v2h2V22z&#xD;&#xA;	 M10,30H8v-4.9h2V30z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red125 { fill:#585858;}
	.Black125 { fill:#727272;}
</style>
<path class="Black125" d="M30,8H12V6h18V8z M30,18H12v-2h18V18z M30,28H12v-2h18V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red125" d="M6,2v8H4V5.3l-2,0V3.7l0.2,0c0.2,0,0.5,0,0.7-0.1c0.3,0,0.5-0.1,0.7-0.3c0.2-0.1,0.4-0.3,0.5-0.5&#xD;&#xA;	c0.1-0.2,0.2-0.4,0.3-0.7l0-0.1H6z M8,20v-1.6H4.6C4.7,18.2,4.9,18.1,5,18c0.2-0.2,0.5-0.4,0.7-0.5c0.3-0.2,0.5-0.3,0.8-0.5&#xD;&#xA;	c0.3-0.2,0.5-0.4,0.7-0.6c0.2-0.2,0.4-0.5,0.5-0.8c0.1-0.3,0.2-0.6,0.2-1c0-0.4-0.1-0.7-0.2-1.1c-0.1-0.3-0.4-0.6-0.6-0.8&#xD;&#xA;	c-0.3-0.2-0.5-0.4-0.9-0.5c-0.3-0.1-0.7-0.2-1-0.2c-0.5,0-0.9,0.1-1.3,0.2c-0.4,0.2-0.7,0.4-0.9,0.7c-0.2,0.3-0.4,0.6-0.5,1&#xD;&#xA;	c-0.1,0.4-0.2,0.8-0.2,1.3l0,0.1h1.8v-0.1c0-0.2,0-0.4,0.1-0.6c0-0.2,0.1-0.4,0.2-0.5c0.1-0.1,0.2-0.3,0.3-0.4&#xD;&#xA;	c0.1-0.1,0.3-0.1,0.5-0.1c0.3,0,0.5,0.1,0.7,0.3c0.2,0.2,0.3,0.4,0.3,0.8c0,0.2,0,0.4-0.1,0.5c-0.1,0.2-0.2,0.3-0.4,0.5&#xD;&#xA;	c-0.1,0.1-0.3,0.3-0.5,0.4c-0.2,0.1-0.4,0.2-0.5,0.4C4.3,16.6,4,16.8,3.7,17c-0.3,0.2-0.6,0.5-0.8,0.7c-0.2,0.3-0.4,0.6-0.5,0.9&#xD;&#xA;	c-0.1,0.3-0.2,0.7-0.2,1.2V20H8z M6.1,29.8c0.3-0.1,0.7-0.3,0.9-0.5c0.3-0.2,0.5-0.5,0.6-0.8C7.9,28.2,8,27.8,8,27.4&#xD;&#xA;	c0-0.5-0.1-0.9-0.4-1.2c-0.2-0.2-0.4-0.4-0.7-0.5c0.2-0.1,0.4-0.3,0.5-0.5c0.2-0.3,0.3-0.6,0.3-1c0-0.4-0.1-0.7-0.2-1&#xD;&#xA;	c-0.2-0.3-0.4-0.5-0.6-0.7c-0.2-0.2-0.5-0.3-0.8-0.4C5.7,22,5.4,22,5.1,22c-0.4,0-0.8,0.1-1.1,0.2c-0.3,0.1-0.6,0.3-0.9,0.6&#xD;&#xA;	c-0.2,0.2-0.4,0.5-0.6,0.9c-0.1,0.3-0.2,0.7-0.2,1.1l0,0.1h1.7l0-0.1c0-0.3,0.1-0.6,0.3-0.9c0.2-0.2,0.4-0.3,0.8-0.3&#xD;&#xA;	c0.2,0,0.5,0.1,0.6,0.2C5.9,23.9,6,24.1,6,24.4c0,0.2,0,0.3-0.1,0.4C5.8,24.9,5.6,25,5.5,25c-0.1,0.1-0.3,0.1-0.5,0.1&#xD;&#xA;	c-0.1,0-0.2,0-0.3,0c-0.1,0-0.2,0-0.2,0l-0.2,0v1.4h0.1c0.2,0,0.4,0,0.6,0c0.2,0,0.4,0,0.5,0.1c0.1,0.1,0.3,0.1,0.4,0.3&#xD;&#xA;	c0.1,0.1,0.1,0.3,0.1,0.6c0,0.3-0.1,0.6-0.3,0.7c-0.2,0.2-0.5,0.3-0.8,0.3c-0.2,0-0.4,0-0.5-0.1c-0.1-0.1-0.3-0.2-0.4-0.3&#xD;&#xA;	C4.1,28,4,27.8,4,27.7c-0.1-0.2-0.1-0.3-0.1-0.5l0-0.1H2.2l0,0.1c0,0.4,0.1,0.9,0.2,1.2c0.1,0.4,0.3,0.7,0.6,0.9&#xD;&#xA;	c0.3,0.2,0.6,0.4,0.9,0.6C4.2,29.9,4.6,30,5.1,30C5.4,30,5.8,29.9,6.1,29.8z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 816)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red125_white { fill:#FFFFFF;}
	.Black125_white { fill:#FFFFFF;}
</style>
<path class="Black125_white" d="M30,8H12V6h18V8z M30,18H12v-2h18V18z M30,28H12v-2h18V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red125_white" d="M6,2v8H4V5.3l-2,0V3.7l0.2,0c0.2,0,0.5,0,0.7-0.1c0.3,0,0.5-0.1,0.7-0.3c0.2-0.1,0.4-0.3,0.5-0.5&#xD;&#xA;	c0.1-0.2,0.2-0.4,0.3-0.7l0-0.1H6z M8,20v-1.6H4.6C4.7,18.2,4.9,18.1,5,18c0.2-0.2,0.5-0.4,0.7-0.5c0.3-0.2,0.5-0.3,0.8-0.5&#xD;&#xA;	c0.3-0.2,0.5-0.4,0.7-0.6c0.2-0.2,0.4-0.5,0.5-0.8c0.1-0.3,0.2-0.6,0.2-1c0-0.4-0.1-0.7-0.2-1.1c-0.1-0.3-0.4-0.6-0.6-0.8&#xD;&#xA;	c-0.3-0.2-0.5-0.4-0.9-0.5c-0.3-0.1-0.7-0.2-1-0.2c-0.5,0-0.9,0.1-1.3,0.2c-0.4,0.2-0.7,0.4-0.9,0.7c-0.2,0.3-0.4,0.6-0.5,1&#xD;&#xA;	c-0.1,0.4-0.2,0.8-0.2,1.3l0,0.1h1.8v-0.1c0-0.2,0-0.4,0.1-0.6c0-0.2,0.1-0.4,0.2-0.5c0.1-0.1,0.2-0.3,0.3-0.4&#xD;&#xA;	c0.1-0.1,0.3-0.1,0.5-0.1c0.3,0,0.5,0.1,0.7,0.3c0.2,0.2,0.3,0.4,0.3,0.8c0,0.2,0,0.4-0.1,0.5c-0.1,0.2-0.2,0.3-0.4,0.5&#xD;&#xA;	c-0.1,0.1-0.3,0.3-0.5,0.4c-0.2,0.1-0.4,0.2-0.5,0.4C4.3,16.6,4,16.8,3.7,17c-0.3,0.2-0.6,0.5-0.8,0.7c-0.2,0.3-0.4,0.6-0.5,0.9&#xD;&#xA;	c-0.1,0.3-0.2,0.7-0.2,1.2V20H8z M6.1,29.8c0.3-0.1,0.7-0.3,0.9-0.5c0.3-0.2,0.5-0.5,0.6-0.8C7.9,28.2,8,27.8,8,27.4&#xD;&#xA;	c0-0.5-0.1-0.9-0.4-1.2c-0.2-0.2-0.4-0.4-0.7-0.5c0.2-0.1,0.4-0.3,0.5-0.5c0.2-0.3,0.3-0.6,0.3-1c0-0.4-0.1-0.7-0.2-1&#xD;&#xA;	c-0.2-0.3-0.4-0.5-0.6-0.7c-0.2-0.2-0.5-0.3-0.8-0.4C5.7,22,5.4,22,5.1,22c-0.4,0-0.8,0.1-1.1,0.2c-0.3,0.1-0.6,0.3-0.9,0.6&#xD;&#xA;	c-0.2,0.2-0.4,0.5-0.6,0.9c-0.1,0.3-0.2,0.7-0.2,1.1l0,0.1h1.7l0-0.1c0-0.3,0.1-0.6,0.3-0.9c0.2-0.2,0.4-0.3,0.8-0.3&#xD;&#xA;	c0.2,0,0.5,0.1,0.6,0.2C5.9,23.9,6,24.1,6,24.4c0,0.2,0,0.3-0.1,0.4C5.8,24.9,5.6,25,5.5,25c-0.1,0.1-0.3,0.1-0.5,0.1&#xD;&#xA;	c-0.1,0-0.2,0-0.3,0c-0.1,0-0.2,0-0.2,0l-0.2,0v1.4h0.1c0.2,0,0.4,0,0.6,0c0.2,0,0.4,0,0.5,0.1c0.1,0.1,0.3,0.1,0.4,0.3&#xD;&#xA;	c0.1,0.1,0.1,0.3,0.1,0.6c0,0.3-0.1,0.6-0.3,0.7c-0.2,0.2-0.5,0.3-0.8,0.3c-0.2,0-0.4,0-0.5-0.1c-0.1-0.1-0.3-0.2-0.4-0.3&#xD;&#xA;	C4.1,28,4,27.8,4,27.7c-0.1-0.2-0.1-0.3-0.1-0.5l0-0.1H2.2l0,0.1c0,0.4,0.1,0.9,0.2,1.2c0.1,0.4,0.3,0.7,0.6,0.9&#xD;&#xA;	c0.3,0.2,0.6,0.4,0.9,0.6C4.2,29.9,4.6,30,5.1,30C5.4,30,5.8,29.9,6.1,29.8z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Green126 { fill:#404040;}
	.Black126 { fill:#727272;}
	.Yellow126 { fill:#979797;}
</style>
<path class="Yellow126" d="M28,22H18v-2h10V22z M10,6c0-1.1,0.9-2,2-2h4V3c0-1.7-3.6-3-8-3S0,1.3,0,3v14c0,1.1,1.6,2.1,4,2.6V15&#xD;&#xA;	c0-0.5,0.5-1,1-1h3h1.1h0l0.9,0.6V6z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black126" d="M16,16h12v2H16V16z M31,6H13c-0.5,0-1,0.5-1,1v8.9l2,1.3V8h16v22H14v-5.3l-2,1.3V31c0,0.5,0.5,1,1,1h18&#xD;&#xA;	c0.5,0,1-0.5,1-1V7C32,6.5,31.5,6,31,6z M28,12H16v2h12V12z M16,26h12v-2H16V26z" xmlns="http://www.w3.org/2000/svg" />
<path class="Green126" d="M10,20H8v-4H6v5c0,0.6,0.4,1,1,1h3v3l6-4l-6-4V20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 850)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Green126_white { fill:#FFFFFF;}
	.Black126_white { fill:#FFFFFF;}
	.Yellow126_white { fill:#FFFFFF;}
</style>
<path class="Yellow126_white" d="M28,22H18v-2h10V22z M10,6c0-1.1,0.9-2,2-2h4V3c0-1.7-3.6-3-8-3S0,1.3,0,3v14c0,1.1,1.6,2.1,4,2.6V15&#xD;&#xA;	c0-0.5,0.5-1,1-1h3h1.1h0l0.9,0.6V6z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black126_white" d="M16,16h12v2H16V16z M31,6H13c-0.5,0-1,0.5-1,1v8.9l2,1.3V8h16v22H14v-5.3l-2,1.3V31c0,0.5,0.5,1,1,1h18&#xD;&#xA;	c0.5,0,1-0.5,1-1V7C32,6.5,31.5,6,31,6z M28,12H16v2h12V12z M16,26h12v-2H16V26z" xmlns="http://www.w3.org/2000/svg" />
<path class="Green126_white" d="M10,20H8v-4H6v5c0,0.6,0.4,1,1,1h3v3l6-4l-6-4V20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black127 { fill:#727272;}
	.Green127 { fill:#404040;}
	.st0127 {opacity:0.5;}
</style>
<g class="st0127" xmlns="http://www.w3.org/2000/svg">
	<path class="Black127" d="M10,6H2V0h8V6z M20,0h-8v6h8V0z M30,0h-8v6h8V0z M10,8H2v6h8V8z M10,16H2v6h8V16z M10,24H2v6h8V24z M20,24&#xD;&#xA;		h-8v6h8V24z M30,24h-8v6h8V24z" />
</g>
<rect x="12" y="8" class="Green127" width="18" height="14" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 952)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black127_white { fill:#FFFFFF;}
	.Green127_white { fill:#FFFFFF;}
	.st0127_white {opacity:0.5;}
</style>
<g class="st0127_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black127_white" d="M10,6H2V0h8V6z M20,0h-8v6h8V0z M30,0h-8v6h8V0z M10,8H2v6h8V8z M10,16H2v6h8V16z M10,24H2v6h8V24z M20,24&#xD;&#xA;		h-8v6h8V24z M30,24h-8v6h8V24z" />
</g>
<rect x="12" y="8" class="Green127_white" width="18" height="14" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue128 { fill:#757575;}
	.Black128 { fill:#727272;}
	.st0128 {opacity:0.5;}
</style>
<g class="st0128" xmlns="http://www.w3.org/2000/svg">
	<path class="Black128" d="M28,10h-8V4h8V10z M26.3,14.9c0.5-0.5,1.1-0.7,1.7-0.8v-2h-8v6h3.2L26.3,14.9z M0,26h8v-6H0V26z M18,23.2V20&#xD;&#xA;		h-8v6h5.2L18,23.2z" />
</g>
<path class="Blue128" d="M0,4h8v6H0V4z M0,18h8v-6H0V18z M10,10h8V4h-8V10z M10,18h8v-6h-8V18z M29,23l-8,8l-4-4l8-8L29,23z M30,22&#xD;&#xA;	l1.7-1.7c0.4-0.4,0.4-1,0-1.3l-2.7-2.7c-0.4-0.4-1-0.4-1.3,0L26,18L30,22z M16,28v4h4L16,28z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 952)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue128_white { fill:#FFFFFF;}
	.Black128_white { fill:#FFFFFF;}
	.st0128_white {opacity:0.5;}
</style>
<g class="st0128_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black128_white" d="M28,10h-8V4h8V10z M26.3,14.9c0.5-0.5,1.1-0.7,1.7-0.8v-2h-8v6h3.2L26.3,14.9z M0,26h8v-6H0V26z M18,23.2V20&#xD;&#xA;		h-8v6h5.2L18,23.2z" />
</g>
<path class="Blue128_white" d="M0,4h8v6H0V4z M0,18h8v-6H0V18z M10,10h8V4h-8V10z M10,18h8v-6h-8V18z M29,23l-8,8l-4-4l8-8L29,23z M30,22&#xD;&#xA;	l1.7-1.7c0.4-0.4,0.4-1,0-1.3l-2.7-2.7c-0.4-0.4-1-0.4-1.3,0L26,18L30,22z M16,28v4h4L16,28z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black129 {fill:#727272;}
</style>
<path class="Black129" d="M19,2H5C4.4,2,4,2.4,4,3v24c0,0.6,0.4,1,1,1h20c0.6,0,1-0.4,1-1V9L19,2z M24,26H6V4h12v5c0,0.6,0.4,1,1,1h5&#xD;&#xA;	V26z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 918)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black129_white { fill:#FFFFFF;}
</style>
<path class="Black129_white" d="M19,2H5C4.4,2,4,2.4,4,3v24c0,0.6,0.4,1,1,1h20c0.6,0,1-0.4,1-1V9L19,2z M24,26H6V4h12v5c0,0.6,0.4,1,1,1h5&#xD;&#xA;	V26z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 374)">
<polygon opacity="0.6" points="4,0 4,30 28,30 28,7 21,0 " xmlns="http://www.w3.org/2000/svg" />
<polygon fill="#FFFFFF" points="6,2 6,28 26,28 26,10 18,10 18,2 " xmlns="http://www.w3.org/2000/svg" />
<polygon fill="#FFFFFF" points="20,2 20,8 26,8 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 884)">
<polygon opacity="0.6" points="4,0 4,30 28,30 28,7 21,0 " xmlns="http://www.w3.org/2000/svg" />
<polygon fill="#FFFFFF" points="6,2 6,28 26,28 26,10 18,10 18,2 " xmlns="http://www.w3.org/2000/svg" />
<polygon fill="#FFFFFF" points="20,2 20,8 26,8 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue131 { fill:#757575;}
	.Black131 { fill:#727272;}
	.Yellow131 { fill:#979797;}
	.st0131 {opacity:0.5;}
</style>
<g class="st0131" xmlns="http://www.w3.org/2000/svg">
	<path class="Black131" d="M0,20h8v6H0V20z M10,26h8v-6h-8V26z M20,12v6h8v-6H20z M20,26h8v-6h-8V26z" />
</g>
<path class="Blue131" d="M0,4h8v6H0V4z M0,18h8v-6H0V18z M10,10h8V4h-8V10z M10,18h8v-6h-8V18z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Yellow131" points="25,2 27,0 27,3 30,3 28,5 30,7 27,7 27,10 25,8 23,10 23,7 20,7 22,5 20,3 23,3 23,0 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 646)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue131_white { fill:#FFFFFF;}
	.Black131_white { fill:#FFFFFF;}
	.Yellow131_white { fill:#FFFFFF;}
	.st0131_white {opacity:0.5;}
</style>
<g class="st0131_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black131_white" d="M0,20h8v6H0V20z M10,26h8v-6h-8V26z M20,12v6h8v-6H20z M20,26h8v-6h-8V26z" />
</g>
<path class="Blue131_white" d="M0,4h8v6H0V4z M0,18h8v-6H0V18z M10,10h8V4h-8V10z M10,18h8v-6h-8V18z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Yellow131_white" points="25,2 27,0 27,3 30,3 28,5 30,7 27,7 27,10 25,8 23,10 23,7 20,7 22,5 20,3 23,3 23,0 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0132 {fill:#727272;}
</style>
<path class="st0132" d="M8.9,4.1C8.4,3.8,8,4.1,8,4.6v20.7c0,0.6,0.4,0.8,0.9,0.5l16.8-10.3c0.5-0.3,0.5-0.8,0-1.1L8.9,4.1z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 578)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0132_white { fill:#FFFFFF;}
</style>
<path class="st0132_white" d="M8.9,4.1C8.4,3.8,8,4.1,8,4.6v20.7c0,0.6,0.4,0.8,0.9,0.5l16.8-10.3c0.5-0.3,0.5-0.8,0-1.1L8.9,4.1z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0133 {fill:#727272;}
</style>
<path class="st0133" d="M8.9,4.1C8.4,3.8,8,4.1,8,4.6v20.7c0,0.6,0.4,0.8,0.9,0.5l16.8-10.3c0.5-0.3,0.5-0.8,0-1.1L8.9,4.1z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 578)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0133_white { fill:#FFFFFF;}
</style>
<path class="st0133_white" d="M8.9,4.1C8.4,3.8,8,4.1,8,4.6v20.7c0,0.6,0.4,0.8,0.9,0.5l16.8-10.3c0.5-0.3,0.5-0.8,0-1.1L8.9,4.1z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow134 { fill:#979797;}
	.st0134 {opacity:0.75;}
</style>
<g class="st0134" xmlns="http://www.w3.org/2000/svg">
	<path class="Yellow134" d="M2.2,25.2l5.5-10C8,14.5,8.7,14,9.5,14H24v-3c0-0.6-0.4-1-1-1H12V7c0-0.6-0.4-1-1-1H3C2.4,6,2,6.5,2,7v18&#xD;&#xA;		c0,0.2,0,0.3,0.1,0.4C2.1,25.4,2.2,25.3,2.2,25.2z" />
</g>
<path class="Yellow134" d="M29.3,16H9.6L4,26h19.8c0.5,0,1.1-0.2,1.3-0.6l4.9-8.9C30.1,16.2,29.8,16,29.3,16z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 578)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow134_white { fill:#FFFFFF;}
	.st0134_white {opacity:0.75;}
</style>
<g class="st0134_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Yellow134_white" d="M2.2,25.2l5.5-10C8,14.5,8.7,14,9.5,14H24v-3c0-0.6-0.4-1-1-1H12V7c0-0.6-0.4-1-1-1H3C2.4,6,2,6.5,2,7v18&#xD;&#xA;		c0,0.2,0,0.3,0.1,0.4C2.1,25.4,2.2,25.3,2.2,25.2z" />
</g>
<path class="Yellow134_white" d="M29.3,16H9.6L4,26h19.8c0.5,0,1.1-0.2,1.3-0.6l4.9-8.9C30.1,16.2,29.8,16,29.3,16z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black135 { fill:#727272;}
	.Green135 { fill:#404040;}
</style>
<path class="Green135" d="M32,3v26c0,0.5-0.5,1-1,1H9c-0.5,0-1-0.5-1-1v-3.1C8.2,26,8.5,26,8.7,26c1.5,0,2.9-0.6,4-1.6l6.2-6.1&#xD;&#xA;	c0.2,1,0.3,2.1,0.3,3.3c0,2.4,2,4.4,4.4,4.4s4.4-2,4.4-4.4c0-5.8-4.3-10.6-9.9-11.5L19,9.3c1.2-1.2,1.2-3.1,0-4.2&#xD;&#xA;	c-0.6-0.6-1.3-0.9-2.1-0.9c-0.8,0-1.6,0.3-2.1,0.9l-2.6,2.6L8,3.4V3c0-0.5,0.5-1,1-1h22C31.5,2,32,2.5,32,3z M16.4,12&#xD;&#xA;	c2.6,0,4.8,4.3,4.8,9.6c0,1.3,1.1,2.4,2.4,2.4c1.3,0,2.4-1.1,2.4-2.4C26,16.3,21.7,12,16.4,12z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black135" d="M15,13.2l3,3l-6.7,6.7c-1.4,1.4-3.7,1.4-5.1,0l-5.1-5.1c-1.4-1.4-1.4-3.7,0-5.1L7.7,6l3,3l-1.9,1.9&#xD;&#xA;	C8.3,11.4,8,12.2,8,13c0,0.8,0.3,1.6,0.9,2.1C9.4,15.7,10.2,16,11,16s1.6-0.3,2.1-0.9L15,13.2z M11.7,13.7l5.9-5.9&#xD;&#xA;	c0.4-0.4,0.4-1,0-1.4l0,0c-0.4-0.4-1-0.4-1.4,0l-5.9,5.9c-0.4,0.4-0.4,1,0,1.4l0,0C10.7,14.1,11.3,14.1,11.7,13.7z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 510)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black135_white { fill:#FFFFFF;}
	.Green135_white { fill:#FFFFFF;}
</style>
<path class="Green135_white" d="M32,3v26c0,0.5-0.5,1-1,1H9c-0.5,0-1-0.5-1-1v-3.1C8.2,26,8.5,26,8.7,26c1.5,0,2.9-0.6,4-1.6l6.2-6.1&#xD;&#xA;	c0.2,1,0.3,2.1,0.3,3.3c0,2.4,2,4.4,4.4,4.4s4.4-2,4.4-4.4c0-5.8-4.3-10.6-9.9-11.5L19,9.3c1.2-1.2,1.2-3.1,0-4.2&#xD;&#xA;	c-0.6-0.6-1.3-0.9-2.1-0.9c-0.8,0-1.6,0.3-2.1,0.9l-2.6,2.6L8,3.4V3c0-0.5,0.5-1,1-1h22C31.5,2,32,2.5,32,3z M16.4,12&#xD;&#xA;	c2.6,0,4.8,4.3,4.8,9.6c0,1.3,1.1,2.4,2.4,2.4c1.3,0,2.4-1.1,2.4-2.4C26,16.3,21.7,12,16.4,12z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black135_white" d="M15,13.2l3,3l-6.7,6.7c-1.4,1.4-3.7,1.4-5.1,0l-5.1-5.1c-1.4-1.4-1.4-3.7,0-5.1L7.7,6l3,3l-1.9,1.9&#xD;&#xA;	C8.3,11.4,8,12.2,8,13c0,0.8,0.3,1.6,0.9,2.1C9.4,15.7,10.2,16,11,16s1.6-0.3,2.1-0.9L15,13.2z M11.7,13.7l5.9-5.9&#xD;&#xA;	c0.4-0.4,0.4-1,0-1.4l0,0c-0.4-0.4-1-0.4-1.4,0l-5.9,5.9c-0.4,0.4-0.4,1,0,1.4l0,0C10.7,14.1,11.3,14.1,11.7,13.7z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue136 { fill:#757575;}
	.Black136 { fill:#727272;}
</style>
<path class="Black136" d="M27,2H5C4.4,2,4,2.4,4,3v26c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V3C28,2.4,27.6,2,27,2z M26,28H6V4h20V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue136" d="M26,10V8h-4V4h-2v4h-8V4h-2v4H6v2h4v12H6v2h4v4h2v-4h8v4h2v-4h4v-2h-4V10H26z M20,22h-8V10h8V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 510)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue136_white { fill:#FFFFFF;}
	.Black136_white { fill:#FFFFFF;}
</style>
<path class="Black136_white" d="M27,2H5C4.4,2,4,2.4,4,3v26c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V3C28,2.4,27.6,2,27,2z M26,28H6V4h20V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue136_white" d="M26,10V8h-4V4h-2v4h-8V4h-2v4H6v2h4v12H6v2h4v4h2v-4h8v4h2v-4h4v-2h-4V10H26z M20,22h-8V10h8V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue137 { fill:#757575;}
	.Black137 { fill:#727272;}
</style>
<path class="Black137" d="M27,2H5C4.4,2,4,2.4,4,3v26c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V3C28,2.4,27.6,2,27,2z M26,28H6V4h20V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue137" d="M26,10V8h-4V4h-2v4h-8V4h-2v4H6v2h4v12H6v2h4v4h2v-4h8v4h2v-4h4v-2h-4V10H26z M20,22h-8V10h8V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 510)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue137_white { fill:#FFFFFF;}
	.Black137_white { fill:#FFFFFF;}
</style>
<path class="Black137_white" d="M27,2H5C4.4,2,4,2.4,4,3v26c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V3C28,2.4,27.6,2,27,2z M26,28H6V4h20V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue137_white" d="M26,10V8h-4V4h-2v4h-8V4h-2v4H6v2h4v12H6v2h4v4h2v-4h8v4h2v-4h4v-2h-4V10H26z M20,22h-8V10h8V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue138 { fill:#757575;}
	.Black138 { fill:#727272;}
</style>
<path class="Black138" d="M27,2H5C4.4,2,4,2.4,4,3v26c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V3C28,2.4,27.6,2,27,2z M26,28H6V4h20V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue138" d="M26,8V6h-2V4h-2v2H10V4H8v2H6v2h2v16H6v2h2v2h2v-2h12v2h2v-2h2v-2h-2V8H26z M22,24H10V8h12V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 510)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue138_white { fill:#FFFFFF;}
	.Black138_white { fill:#FFFFFF;}
</style>
<path class="Black138_white" d="M27,2H5C4.4,2,4,2.4,4,3v26c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V3C28,2.4,27.6,2,27,2z M26,28H6V4h20V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue138_white" d="M26,8V6h-2V4h-2v2H10V4H8v2H6v2h2v16H6v2h2v2h2v-2h12v2h2v-2h2v-2h-2V8H26z M22,24H10V8h12V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue139 { fill:#757575;}
	.Black139 { fill:#727272;}
</style>
<path class="Black139" d="M27,2H5C4.4,2,4,2.4,4,3v26c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V3C28,2.4,27.6,2,27,2z M26,28H6V4h20V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue139" d="M26,10V8h-2V4h-2v4H12V4h-2v4H6v2h4v12H6v2h4v4h2v-4h10v4h2v-4h2v-2h-2V10H26z M22,22H12V10h10V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 510)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue139_white { fill:#FFFFFF;}
	.Black139_white { fill:#FFFFFF;}
</style>
<path class="Black139_white" d="M27,2H5C4.4,2,4,2.4,4,3v26c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V3C28,2.4,27.6,2,27,2z M26,28H6V4h20V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue139_white" d="M26,10V8h-2V4h-2v4H12V4h-2v4H6v2h4v12H6v2h4v4h2v-4h10v4h2v-4h2v-2h-2V10H26z M22,22H12V10h10V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue140 { fill:#757575;}
	.Black140 { fill:#727272;}
</style>
<path class="Black140" d="M27,2H5C4.4,2,4,2.4,4,3v26c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V3C28,2.4,27.6,2,27,2z M26,28H6V4h20V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue140" d="M26,10V8h-6V4h-2v4h-4V4h-2v4H6v2h6v12H6v2h6v4h2v-4h4v4h2v-4h6v-2h-6V10H26z M18,22h-4V10h4V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 510)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue140_white { fill:#FFFFFF;}
	.Black140_white { fill:#FFFFFF;}
</style>
<path class="Black140_white" d="M27,2H5C4.4,2,4,2.4,4,3v26c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V3C28,2.4,27.6,2,27,2z M26,28H6V4h20V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue140_white" d="M26,10V8h-6V4h-2v4h-4V4h-2v4H6v2h6v12H6v2h6v4h2v-4h4v4h2v-4h6v-2h-6V10H26z M18,22h-4V10h4V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black141 {fill:#727272;}
</style>
<path class="Black141" d="M23,12h-3V7l-7-7H1C0.4,0,0,0.4,0,1v22c0,0.6,0.4,1,1,1h5v7c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V19L23,12z&#xD;&#xA;	 M2,22V2h10v5c0,0.6,0.4,1,1,1h5v4H7c-0.6,0-1,0.4-1,1v9H2z M28,30H8v-6v-2v-8h10h2h2v5c0,0.6,0.4,1,1,1h5V30z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 510)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black141_white { fill:#FFFFFF;}
</style>
<path class="Black141_white" d="M23,12h-3V7l-7-7H1C0.4,0,0,0.4,0,1v22c0,0.6,0.4,1,1,1h5v7c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V19L23,12z&#xD;&#xA;	 M2,22V2h10v5c0,0.6,0.4,1,1,1h5v4H7c-0.6,0-1,0.4-1,1v9H2z M28,30H8v-6v-2v-8h10h2h2v5c0,0.6,0.4,1,1,1h5V30z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0142 {fill:#727272;}
</style>
<path class="st0142" d="M8,14h16v2H8V14z" xmlns="http://www.w3.org/2000/svg" />
<path class="st0142" d="M2,5v21c0,0.6,0.4,1,1,1h26c0.6,0,1-0.4,1-1V5c0-0.6-0.4-1-1-1H3C2.4,4,2,4.4,2,5z M28,6v19H4V6H28z" xmlns="http://www.w3.org/2000/svg" />
<rect x="8" y="18" class="st0142" width="16" height="2" xmlns="http://www.w3.org/2000/svg" />
<path class="st0142" d="M8,10h16v2H8V10z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 510)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0142_white { fill:#FFFFFF;}
</style>
<path class="st0142_white" d="M8,14h16v2H8V14z" xmlns="http://www.w3.org/2000/svg" />
<path class="st0142_white" d="M2,5v21c0,0.6,0.4,1,1,1h26c0.6,0,1-0.4,1-1V5c0-0.6-0.4-1-1-1H3C2.4,4,2,4.4,2,5z M28,6v19H4V6H28z" xmlns="http://www.w3.org/2000/svg" />
<rect x="8" y="18" class="st0142_white" width="16" height="2" xmlns="http://www.w3.org/2000/svg" />
<path class="st0142_white" d="M8,10h16v2H8V10z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0143 {fill:#727272;}
</style>
<path class="st0143" d="M22,16H10v-2h12V16z" xmlns="http://www.w3.org/2000/svg" />
<path class="st0143" d="M27,2H5C4.4,2,4,2.4,4,3v26c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V3C28,2.4,27.6,2,27,2z M26,28H6V4h20V28z" xmlns="http://www.w3.org/2000/svg" />
<rect x="10" y="10" class="st0143" width="12" height="2" xmlns="http://www.w3.org/2000/svg" />
<path class="st0143" d="M22,20H10v-2h12V20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 510)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0143_white { fill:#FFFFFF;}
</style>
<path class="st0143_white" d="M22,16H10v-2h12V16z" xmlns="http://www.w3.org/2000/svg" />
<path class="st0143_white" d="M27,2H5C4.4,2,4,2.4,4,3v26c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V3C28,2.4,27.6,2,27,2z M26,28H6V4h20V28z" xmlns="http://www.w3.org/2000/svg" />
<rect x="10" y="10" class="st0143_white" width="12" height="2" xmlns="http://www.w3.org/2000/svg" />
<path class="st0143_white" d="M22,20H10v-2h12V20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black144 { fill:#727272;}
	.Blue144 { fill:#757575;}
</style>
<path class="Black144" d="M23,8H11c-0.6,0-1,0.4-1,1v22c0,0.6,0.4,1,1,1h18c0.6,0,1-0.4,1-1V15L23,8z M28,30H12V10h10v5&#xD;&#xA;	c0,0.6,0.4,1,1,1h5V30z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue144" d="M8,10H2V8h6V10z M8,30H2v2h6V30z M6,10H4v20h2V10z M12,0h-2v6h2V0z M28,2H10v2h18V2z M30,0h-2v6h2V0z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 510)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black144_white { fill:#FFFFFF;}
	.Blue144_white { fill:#FFFFFF;}
</style>
<path class="Black144_white" d="M23,8H11c-0.6,0-1,0.4-1,1v22c0,0.6,0.4,1,1,1h18c0.6,0,1-0.4,1-1V15L23,8z M28,30H12V10h10v5&#xD;&#xA;	c0,0.6,0.4,1,1,1h5V30z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue144_white" d="M8,10H2V8h6V10z M8,30H2v2h6V30z M6,10H4v20h2V10z M12,0h-2v6h2V0z M28,2H10v2h18V2z M30,0h-2v6h2V0z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black145 { fill:#727272;}
</style>
<path class="Black145" d="M30,4H10V2h20V4z M30,6H2v2h28V6z M30,10H2v2h28V10z M10,18H2v2h8V18z M10,14H2v2h8V14z M30,14H18&#xD;&#xA;	c-3.3,0-6,2.7-6,6s2.7,6,6,6v6h4V18h2v14h4V18h2V14z M18,22c-1.1,0-2-0.9-2-2c0-1.1,0.9-2,2-2V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 510)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black145_white { fill:#FFFFFF;}
</style>
<path class="Black145_white" d="M30,4H10V2h20V4z M30,6H2v2h28V6z M30,10H2v2h28V10z M10,18H2v2h8V18z M10,14H2v2h8V14z M30,14H18&#xD;&#xA;	c-3.3,0-6,2.7-6,6s2.7,6,6,6v6h4V18h2v14h4V18h2V14z M18,22c-1.1,0-2-0.9-2-2c0-1.1,0.9-2,2-2V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black146 { fill:#727272;}
</style>
<path class="Black146" d="M30,4H10V2h20V4z M30,6H2v2h28V6z M30,10H2v2h28V10z M10,18H2v2h8V18z M10,14H2v2h8V14z M30,14H18&#xD;&#xA;	c-3.3,0-6,2.7-6,6s2.7,6,6,6v6h4V18h2v14h4V18h2V14z M18,22c-1.1,0-2-0.9-2-2c0-1.1,0.9-2,2-2V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 510)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black146_white { fill:#FFFFFF;}
</style>
<path class="Black146_white" d="M30,4H10V2h20V4z M30,6H2v2h28V6z M30,10H2v2h28V10z M10,18H2v2h8V18z M10,14H2v2h8V14z M30,14H18&#xD;&#xA;	c-3.3,0-6,2.7-6,6s2.7,6,6,6v6h4V18h2v14h4V18h2V14z M18,22c-1.1,0-2-0.9-2-2c0-1.1,0.9-2,2-2V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black147 { fill:#727272;}
	.Yellow147 { fill:#979797;}
</style>
<path class="Yellow147" d="M12,24v4H5c-0.6,0-1-0.4-1-1V3c0-0.6,0.4-1,1-1h3v22H12z M25,2h-3v8h4V2.8C26,2.4,25.6,2,25,2z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black147" d="M29,12H15c-0.6,0-1,0.4-1,1v16c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1V13C30,12.4,29.6,12,29,12z M28,28H16V14&#xD;&#xA;	h12V28z M26,20h-8v-2h8V20z M26,24h-8v-2h8V24z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black147" d="M18,2V1c0-0.6-0.4-1-1-1h-4c-0.6,0-1,0.4-1,1v1h-2v3c0,0.6,0.4,1,1,1h8c0.6,0,1-0.4,1-1V2H18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 578)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black147_white { fill:#FFFFFF;}
	.Yellow147_white { fill:#FFFFFF;}
</style>
<path class="Yellow147_white" d="M12,24v4H5c-0.6,0-1-0.4-1-1V3c0-0.6,0.4-1,1-1h3v22H12z M25,2h-3v8h4V2.8C26,2.4,25.6,2,25,2z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black147_white" d="M29,12H15c-0.6,0-1,0.4-1,1v16c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1V13C30,12.4,29.6,12,29,12z M28,28H16V14&#xD;&#xA;	h12V28z M26,20h-8v-2h8V20z M26,24h-8v-2h8V24z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black147_white" d="M18,2V1c0-0.6-0.4-1-1-1h-4c-0.6,0-1,0.4-1,1v1h-2v3c0,0.6,0.4,1,1,1h8c0.6,0,1-0.4,1-1V2H18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black148 { fill:#727272;}
	.Yellow148 { fill:#979797;}
</style>
<path class="Yellow148" d="M12,24v4H5c-0.6,0-1-0.4-1-1V3c0-0.6,0.4-1,1-1h3v22H12z M25,2h-3v8h4V2.8C26,2.4,25.6,2,25,2z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black148" d="M29,12H15c-0.6,0-1,0.4-1,1v16c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1V13C30,12.4,29.6,12,29,12z M28,28H16V14&#xD;&#xA;	h12V28z M26,20h-8v-2h8V20z M26,24h-8v-2h8V24z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black148" d="M18,2V1c0-0.6-0.4-1-1-1h-4c-0.6,0-1,0.4-1,1v1h-2v3c0,0.6,0.4,1,1,1h8c0.6,0,1-0.4,1-1V2H18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 510)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black148_white { fill:#FFFFFF;}
	.Yellow148_white { fill:#FFFFFF;}
</style>
<path class="Yellow148_white" d="M12,24v4H5c-0.6,0-1-0.4-1-1V3c0-0.6,0.4-1,1-1h3v22H12z M25,2h-3v8h4V2.8C26,2.4,25.6,2,25,2z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black148_white" d="M29,12H15c-0.6,0-1,0.4-1,1v16c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1V13C30,12.4,29.6,12,29,12z M28,28H16V14&#xD;&#xA;	h12V28z M26,20h-8v-2h8V20z M26,24h-8v-2h8V24z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black148_white" d="M18,2V1c0-0.6-0.4-1-1-1h-4c-0.6,0-1,0.4-1,1v1h-2v3c0,0.6,0.4,1,1,1h8c0.6,0,1-0.4,1-1V2H18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black149 { fill:#727272;}
	.Yellow149 { fill:#979797;}
	.Blue149 { fill:#757575;}
</style>
<path class="Yellow149" d="M12,24v4H5c-0.6,0-1-0.4-1-1V3c0-0.6,0.4-1,1-1h3v22H12z M25,2h-3v10h4V3C26,2.4,25.6,2,25,2z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue149" d="M32,18v-3c0-0.6-0.4-1-1-1H15c-0.6,0-1,0.4-1,1v3H32z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black149" d="M28,20v2H18v-2H28z M18,26h10v-2H18V26z M30,18v10H16V18h-2v11c0,0.6,0.4,1,1,1h16c0.6,0,1-0.4,1-1V18H30z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black149" d="M18,2V1c0-0.6-0.4-1-1-1h-4c-0.6,0-1,0.4-1,1v1h-2v3c0,0.6,0.4,1,1,1h2h4h2c0.6,0,1-0.4,1-1V2H18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 510)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black149_white { fill:#FFFFFF;}
	.Yellow149_white { fill:#FFFFFF;}
	.Blue149_white { fill:#FFFFFF;}
</style>
<path class="Yellow149_white" d="M12,24v4H5c-0.6,0-1-0.4-1-1V3c0-0.6,0.4-1,1-1h3v22H12z M25,2h-3v10h4V3C26,2.4,25.6,2,25,2z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue149_white" d="M32,18v-3c0-0.6-0.4-1-1-1H15c-0.6,0-1,0.4-1,1v3H32z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black149_white" d="M28,20v2H18v-2H28z M18,26h10v-2H18V26z M30,18v10H16V18h-2v11c0,0.6,0.4,1,1,1h16c0.6,0,1-0.4,1-1V18H30z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black149_white" d="M18,2V1c0-0.6-0.4-1-1-1h-4c-0.6,0-1,0.4-1,1v1h-2v3c0,0.6,0.4,1,1,1h2h4h2c0.6,0,1-0.4,1-1V2H18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue150 { fill:#757575;}
</style>
<path class="Blue150" d="M17,11L7,21l-4-4L13,7L17,11z M18,10l1.7-1.7c0.4-0.4,0.4-1,0-1.3l-2.7-2.7c-0.4-0.4-1-0.4-1.3,0L14,6L18,10z&#xD;&#xA;	 M2,18v4h4L2,18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 544)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue150_white { fill:#FFFFFF;}
</style>
<path class="Blue150_white" d="M17,11L7,21l-4-4L13,7L17,11z M18,10l1.7-1.7c0.4-0.4,0.4-1,0-1.3l-2.7-2.7c-0.4-0.4-1-0.4-1.3,0L14,6L18,10z&#xD;&#xA;	 M2,18v4h4L2,18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0151 {fill:#727272;}
</style>
<path class="st0151" d="M23.1,4.1c0.5-0.3,0.9,0,0.9,0.5v20.7c0,0.6-0.4,0.8-0.9,0.5L6.4,15.5c-0.5-0.3-0.5-0.8,0-1.1L23.1,4.1z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 884)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0151_white { fill:#FFFFFF;}
</style>
<path class="st0151_white" d="M23.1,4.1c0.5-0.3,0.9,0,0.9,0.5v20.7c0,0.6-0.4,0.8-0.9,0.5L6.4,15.5c-0.5-0.3-0.5-0.8,0-1.1L23.1,4.1z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black152 { fill:#727272;}
	.Yellow152 { fill:#979797;}
	.Blue152 { fill:#757575;}
	.Red152 { fill:#585858;}
	.White152 { fill:#FFFFFF;}
	.Green152 { fill:#404040;}
	.st0152 { fill:#727272;}
	.st1152 {opacity:0.5;}
	.st2152 {opacity:0.75;}
</style>
<g id="PagePrevious" xmlns="http://www.w3.org/2000/svg">
	<polygon class="Blue152" points="24,4 24,28 4,16 	" />
</g>
</g>

<g transform="translate(408, 918)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black152_white { fill:#FFFFFF;}
	.Yellow152_white { fill:#FFFFFF;}
	.Blue152_white { fill:#FFFFFF;}
	.Red152_white { fill:#FFFFFF;}
	.White152_white { fill:#FFFFFF;}
	.Green152_white { fill:#FFFFFF;}
	.st0152_white { fill:#FFFFFF;}
	.st1152_white {opacity:0.5;}
	.st2152_white {opacity:0.75;}
</style>
<g id="PagePrevious" xmlns="http://www.w3.org/2000/svg">
	<polygon class="Blue152_white" points="24,4 24,28 4,16 	" />
</g>
</g>

<g transform="translate(34, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black153 { fill:#727272;}
	.Yellow153 { fill:#979797;}
	.Blue153 { fill:#757575;}
	.Red153 { fill:#585858;}
	.White153 { fill:#FFFFFF;}
	.Green153 { fill:#404040;}
	.st0153 { fill:#727272;}
	.st1153 {opacity:0.5;}
	.st2153 {opacity:0.75;}
</style>
<g id="PagePrevious" xmlns="http://www.w3.org/2000/svg">
	<polygon class="Blue153" points="24,4 24,28 4,16 	" />
</g>
</g>

<g transform="translate(34, 646)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black153_white { fill:#FFFFFF;}
	.Yellow153_white { fill:#FFFFFF;}
	.Blue153_white { fill:#FFFFFF;}
	.Red153_white { fill:#FFFFFF;}
	.White153_white { fill:#FFFFFF;}
	.Green153_white { fill:#FFFFFF;}
	.st0153_white { fill:#FFFFFF;}
	.st1153_white {opacity:0.5;}
	.st2153_white {opacity:0.75;}
</style>
<g id="PagePrevious" xmlns="http://www.w3.org/2000/svg">
	<polygon class="Blue153_white" points="24,4 24,28 4,16 	" />
</g>
</g>

<g transform="translate(170, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black154 {fill:#727272;}
</style>
<path class="Black154" d="M10,2h12v8h2V0H8v10h2V2z M28,8h-2v3c0,0.6-0.4,1-1,1H7c-0.6,0-1-0.4-1-1V8H4c-1.1,0-2,0.9-2,2v12&#xD;&#xA;	c0,1.1,0.9,2,2,2h4v6h16v-6h4c1.1,0,2-0.9,2-2V10C30,8.9,29.1,8,28,8z M22,22v2v4H10v-4v-2v-4h12V22z M20,24h-8v2h8V24z M20,20h-8v2&#xD;&#xA;	h8V20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 714)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black154_white { fill:#FFFFFF;}
</style>
<path class="Black154_white" d="M10,2h12v8h2V0H8v10h2V2z M28,8h-2v3c0,0.6-0.4,1-1,1H7c-0.6,0-1-0.4-1-1V8H4c-1.1,0-2,0.9-2,2v12&#xD;&#xA;	c0,1.1,0.9,2,2,2h4v6h16v-6h4c1.1,0,2-0.9,2-2V10C30,8.9,29.1,8,28,8z M22,22v2v4H10v-4v-2v-4h12V22z M20,24h-8v2h8V24z M20,20h-8v2&#xD;&#xA;	h8V20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black155 { fill:#727272;}
	.Green155 { fill:#404040;}
</style>
<path class="Green155" d="M25,0c-3.9,0-7,3.1-7,7c0,3.9,3.1,7,7,7c3.9,0,7-3.1,7-7C32,3.1,28.9,0,25,0z M26,12h-2v-2h2V12z M27.9,5.5&#xD;&#xA;	c-0.1,0.2-0.1,0.5-0.2,0.6c-0.1,0.2-0.2,0.3-0.3,0.5C27.2,6.8,27.1,6.9,27,7c-0.1,0.1-0.3,0.2-0.4,0.3c-0.1,0.1-0.3,0.2-0.4,0.3&#xD;&#xA;	c-0.1,0.1-0.2,0.3-0.3,0.4c-0.1,0.2-0.1,0.3-0.2,0.5V9h-1.7V8.5c0-0.3,0.1-0.6,0.1-0.8c0.1-0.2,0.2-0.4,0.3-0.6&#xD;&#xA;	c0.1-0.2,0.2-0.3,0.3-0.4c0.1-0.1,0.2-0.2,0.4-0.4c0.1-0.1,0.2-0.2,0.3-0.3c0.1-0.1,0.2-0.2,0.3-0.3c0.1-0.1,0.1-0.2,0.2-0.4&#xD;&#xA;	c0-0.1,0.1-0.3,0.1-0.5c0-0.4-0.1-0.7-0.3-0.9c-0.2-0.2-0.4-0.3-0.8-0.3c-0.2,0-0.4,0-0.6,0.1C24.3,3.9,24.1,4,24,4.1&#xD;&#xA;	c-0.1,0.2-0.2,0.3-0.2,0.6c0,0.1,0,0.2,0,0.3H22c0-0.4,0.1-0.7,0.2-1c0.1-0.4,0.3-0.8,0.6-1.1c0.3-0.3,0.6-0.5,0.9-0.7&#xD;&#xA;	C24.1,2.1,24.5,2,24.9,2c0.6,0,1.1,0.1,1.5,0.3c0.4,0.2,0.7,0.4,0.9,0.7c0.2,0.3,0.4,0.6,0.5,0.9C27.9,4.1,28,4.4,28,4.7&#xD;&#xA;	C28,5,28,5.3,27.9,5.5z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black155" d="M16,20h-6v2h6V20z M16,24h-6v2h6V24z M25,16c-2.1,0-4.1-0.8-5.7-2H5c-0.6,0-1-0.4-1-1v-3H2c-1.1,0-2,0.9-2,2&#xD;&#xA;	v10c0,1.1,0.9,2,2,2h4v6h14v-6h4c1.1,0,2-0.9,2-2v-6.1C25.7,16,25.3,16,25,16z M18,28H8V18h10V28z M8,4h8.5c0.3-0.7,0.6-1.4,1-2H6&#xD;&#xA;	v10h2V4z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 714)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black155_white { fill:#FFFFFF;}
	.Green155_white { fill:#FFFFFF;}
</style>
<path class="Green155_white" d="M25,0c-3.9,0-7,3.1-7,7c0,3.9,3.1,7,7,7c3.9,0,7-3.1,7-7C32,3.1,28.9,0,25,0z M26,12h-2v-2h2V12z M27.9,5.5&#xD;&#xA;	c-0.1,0.2-0.1,0.5-0.2,0.6c-0.1,0.2-0.2,0.3-0.3,0.5C27.2,6.8,27.1,6.9,27,7c-0.1,0.1-0.3,0.2-0.4,0.3c-0.1,0.1-0.3,0.2-0.4,0.3&#xD;&#xA;	c-0.1,0.1-0.2,0.3-0.3,0.4c-0.1,0.2-0.1,0.3-0.2,0.5V9h-1.7V8.5c0-0.3,0.1-0.6,0.1-0.8c0.1-0.2,0.2-0.4,0.3-0.6&#xD;&#xA;	c0.1-0.2,0.2-0.3,0.3-0.4c0.1-0.1,0.2-0.2,0.4-0.4c0.1-0.1,0.2-0.2,0.3-0.3c0.1-0.1,0.2-0.2,0.3-0.3c0.1-0.1,0.1-0.2,0.2-0.4&#xD;&#xA;	c0-0.1,0.1-0.3,0.1-0.5c0-0.4-0.1-0.7-0.3-0.9c-0.2-0.2-0.4-0.3-0.8-0.3c-0.2,0-0.4,0-0.6,0.1C24.3,3.9,24.1,4,24,4.1&#xD;&#xA;	c-0.1,0.2-0.2,0.3-0.2,0.6c0,0.1,0,0.2,0,0.3H22c0-0.4,0.1-0.7,0.2-1c0.1-0.4,0.3-0.8,0.6-1.1c0.3-0.3,0.6-0.5,0.9-0.7&#xD;&#xA;	C24.1,2.1,24.5,2,24.9,2c0.6,0,1.1,0.1,1.5,0.3c0.4,0.2,0.7,0.4,0.9,0.7c0.2,0.3,0.4,0.6,0.5,0.9C27.9,4.1,28,4.4,28,4.7&#xD;&#xA;	C28,5,28,5.3,27.9,5.5z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black155_white" d="M16,20h-6v2h6V20z M16,24h-6v2h6V24z M25,16c-2.1,0-4.1-0.8-5.7-2H5c-0.6,0-1-0.4-1-1v-3H2c-1.1,0-2,0.9-2,2&#xD;&#xA;	v10c0,1.1,0.9,2,2,2h4v6h14v-6h4c1.1,0,2-0.9,2-2v-6.1C25.7,16,25.3,16,25,16z M18,28H8V18h10V28z M8,4h8.5c0.3-0.7,0.6-1.4,1-2H6&#xD;&#xA;	v10h2V4z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black156 { fill:#727272;}
	.Green156 { fill:#404040;}
</style>
<path class="Green156" d="M25,0c-3.9,0-7,3.1-7,7c0,3.9,3.1,7,7,7c3.9,0,7-3.1,7-7C32,3.1,28.9,0,25,0z M26,12h-2v-2h2V12z M27.9,5.5&#xD;&#xA;	c-0.1,0.2-0.1,0.5-0.2,0.6c-0.1,0.2-0.2,0.3-0.3,0.5C27.2,6.8,27.1,6.9,27,7c-0.1,0.1-0.3,0.2-0.4,0.3c-0.1,0.1-0.3,0.2-0.4,0.3&#xD;&#xA;	c-0.1,0.1-0.2,0.3-0.3,0.4c-0.1,0.2-0.1,0.3-0.2,0.5V9h-1.7V8.5c0-0.3,0.1-0.6,0.1-0.8c0.1-0.2,0.2-0.4,0.3-0.6&#xD;&#xA;	c0.1-0.2,0.2-0.3,0.3-0.4c0.1-0.1,0.2-0.2,0.4-0.4c0.1-0.1,0.2-0.2,0.3-0.3c0.1-0.1,0.2-0.2,0.3-0.3c0.1-0.1,0.1-0.2,0.2-0.4&#xD;&#xA;	c0-0.1,0.1-0.3,0.1-0.5c0-0.4-0.1-0.7-0.3-0.9c-0.2-0.2-0.4-0.3-0.8-0.3c-0.2,0-0.4,0-0.6,0.1C24.3,3.9,24.1,4,24,4.1&#xD;&#xA;	c-0.1,0.2-0.2,0.3-0.2,0.6c0,0.1,0,0.2,0,0.3H22c0-0.4,0.1-0.7,0.2-1c0.1-0.4,0.3-0.8,0.6-1.1c0.3-0.3,0.6-0.5,0.9-0.7&#xD;&#xA;	C24.1,2.1,24.5,2,24.9,2c0.6,0,1.1,0.1,1.5,0.3c0.4,0.2,0.7,0.4,0.9,0.7c0.2,0.3,0.4,0.6,0.5,0.9C27.9,4.1,28,4.4,28,4.7&#xD;&#xA;	C28,5,28,5.3,27.9,5.5z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black156" d="M16,20h-6v2h6V20z M16,24h-6v2h6V24z M25,16c-2.1,0-4.1-0.8-5.7-2H5c-0.6,0-1-0.4-1-1v-3H2c-1.1,0-2,0.9-2,2&#xD;&#xA;	v10c0,1.1,0.9,2,2,2h4v6h14v-6h4c1.1,0,2-0.9,2-2v-6.1C25.7,16,25.3,16,25,16z M18,28H8V18h10V28z M8,4h8.5c0.3-0.7,0.6-1.4,1-2H6&#xD;&#xA;	v10h2V4z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 578)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black156_white { fill:#FFFFFF;}
	.Green156_white { fill:#FFFFFF;}
</style>
<path class="Green156_white" d="M25,0c-3.9,0-7,3.1-7,7c0,3.9,3.1,7,7,7c3.9,0,7-3.1,7-7C32,3.1,28.9,0,25,0z M26,12h-2v-2h2V12z M27.9,5.5&#xD;&#xA;	c-0.1,0.2-0.1,0.5-0.2,0.6c-0.1,0.2-0.2,0.3-0.3,0.5C27.2,6.8,27.1,6.9,27,7c-0.1,0.1-0.3,0.2-0.4,0.3c-0.1,0.1-0.3,0.2-0.4,0.3&#xD;&#xA;	c-0.1,0.1-0.2,0.3-0.3,0.4c-0.1,0.2-0.1,0.3-0.2,0.5V9h-1.7V8.5c0-0.3,0.1-0.6,0.1-0.8c0.1-0.2,0.2-0.4,0.3-0.6&#xD;&#xA;	c0.1-0.2,0.2-0.3,0.3-0.4c0.1-0.1,0.2-0.2,0.4-0.4c0.1-0.1,0.2-0.2,0.3-0.3c0.1-0.1,0.2-0.2,0.3-0.3c0.1-0.1,0.1-0.2,0.2-0.4&#xD;&#xA;	c0-0.1,0.1-0.3,0.1-0.5c0-0.4-0.1-0.7-0.3-0.9c-0.2-0.2-0.4-0.3-0.8-0.3c-0.2,0-0.4,0-0.6,0.1C24.3,3.9,24.1,4,24,4.1&#xD;&#xA;	c-0.1,0.2-0.2,0.3-0.2,0.6c0,0.1,0,0.2,0,0.3H22c0-0.4,0.1-0.7,0.2-1c0.1-0.4,0.3-0.8,0.6-1.1c0.3-0.3,0.6-0.5,0.9-0.7&#xD;&#xA;	C24.1,2.1,24.5,2,24.9,2c0.6,0,1.1,0.1,1.5,0.3c0.4,0.2,0.7,0.4,0.9,0.7c0.2,0.3,0.4,0.6,0.5,0.9C27.9,4.1,28,4.4,28,4.7&#xD;&#xA;	C28,5,28,5.3,27.9,5.5z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black156_white" d="M16,20h-6v2h6V20z M16,24h-6v2h6V24z M25,16c-2.1,0-4.1-0.8-5.7-2H5c-0.6,0-1-0.4-1-1v-3H2c-1.1,0-2,0.9-2,2&#xD;&#xA;	v10c0,1.1,0.9,2,2,2h4v6h14v-6h4c1.1,0,2-0.9,2-2v-6.1C25.7,16,25.3,16,25,16z M18,28H8V18h10V28z M8,4h8.5c0.3-0.7,0.6-1.4,1-2H6&#xD;&#xA;	v10h2V4z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0157 {fill:#727272;}
</style>
<path class="st0157" d="M6,6h14v2H6V6z M12,24H2V2h22v10h2V1c0-0.5-0.5-1-1-1H1C0.5,0,0,0.5,0,1v24c0,0.5,0.5,1,1,1h11V24z M6,12h10h4&#xD;&#xA;	v-2H6V12z M6,20h6c0-0.7,0.2-1.4,0.6-2H6V20z M6,16h10v-2H6V16z" xmlns="http://www.w3.org/2000/svg" />
<path id="Print" class="st0157" d="M28,20v-6H18v6h2v-4h6v4H28z M30,18L30,18v3c0,0.6-0.4,1-1,1H17c-0.6,0-1-0.4-1-1v-3l0,0&#xD;&#xA;	c-1.1,0-2,0.9-2,2v8c0,1.1,0.9,2,2,2h2v2h10v-2h2c1.1,0,2-0.9,2-2v-8C32,18.9,31.1,18,30,18z M26,30h-6v-4h6V30z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 578)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0157_white { fill:#FFFFFF;}
</style>
<path class="st0157_white" d="M6,6h14v2H6V6z M12,24H2V2h22v10h2V1c0-0.5-0.5-1-1-1H1C0.5,0,0,0.5,0,1v24c0,0.5,0.5,1,1,1h11V24z M6,12h10h4&#xD;&#xA;	v-2H6V12z M6,20h6c0-0.7,0.2-1.4,0.6-2H6V20z M6,16h10v-2H6V16z" xmlns="http://www.w3.org/2000/svg" />
<path id="Print" class="st0157_white" d="M28,20v-6H18v6h2v-4h6v4H28z M30,18L30,18v3c0,0.6-0.4,1-1,1H17c-0.6,0-1-0.4-1-1v-3l0,0&#xD;&#xA;	c-1.1,0-2,0.9-2,2v8c0,1.1,0.9,2,2,2h2v2h10v-2h2c1.1,0,2-0.9,2-2v-8C32,18.9,31.1,18,30,18z M26,30h-6v-4h6V30z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black158 { fill:#727272;}
	.Blue158 { fill:#757575;}
</style>
<path class="Black158" d="M19.4,26H16c0,0,0,0,0,0c0,0,0,0,0,0H6V4h12v5c0,0.6,0.4,1,1,1h5v11.4l2,2V9l-7-7H5C4.4,2,4,2.4,4,3v24&#xD;&#xA;	c0,0.6,0.4,1,1,1h16.4L19.4,26z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue158" d="M16,12c3.3,0,6,2.7,6,6c0,1.2-0.4,2.3-1,3.3l4.6,4.6c0.5,0.5,0.5,1.3,0,1.7c-0.5,0.5-1.3,0.5-1.7,0L19.3,23&#xD;&#xA;	c-0.9,0.6-2.1,1-3.3,1c-3.3,0-6-2.7-6-6C10,14.7,12.7,12,16,12z M16,22c2.2,0,4-1.8,4-4s-1.8-4-4-4s-4,1.8-4,4S13.8,22,16,22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 646)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black158_white { fill:#FFFFFF;}
	.Blue158_white { fill:#FFFFFF;}
</style>
<path class="Black158_white" d="M19.4,26H16c0,0,0,0,0,0c0,0,0,0,0,0H6V4h12v5c0,0.6,0.4,1,1,1h5v11.4l2,2V9l-7-7H5C4.4,2,4,2.4,4,3v24&#xD;&#xA;	c0,0.6,0.4,1,1,1h16.4L19.4,26z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue158_white" d="M16,12c3.3,0,6,2.7,6,6c0,1.2-0.4,2.3-1,3.3l4.6,4.6c0.5,0.5,0.5,1.3,0,1.7c-0.5,0.5-1.3,0.5-1.7,0L19.3,23&#xD;&#xA;	c-0.9,0.6-2.1,1-3.3,1c-3.3,0-6-2.7-6-6C10,14.7,12.7,12,16,12z M16,22c2.2,0,4-1.8,4-4s-1.8-4-4-4s-4,1.8-4,4S13.8,22,16,22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow159 { fill:#979797;}
	.Black159 { fill:#727272;}
</style>
<path class="Black159" d="M8,10h14v2H8V10z M8,16h14v-2H8V16z M8,8h14V6H8V8z M18,28H4V2h22v14h1c0.3,0,0.7,0,1,0.1V1c0-0.6-0.4-1-1-1&#xD;&#xA;	H3C2.4,0,2,0.4,2,1v28c0,0.6,0.4,1,1,1h15V28z M8,24h10.2c0.3-0.9,1-1.5,1.8-1.8V22H8V24z M8,20h12.1c0.2-0.7,0.5-1.4,0.9-2H8V20z" xmlns="http://www.w3.org/2000/svg" />
<path class="Yellow159" d="M31,24h-1v-3c0-1.7-1.3-3-3-3h-2c-1.7,0-3,1.3-3,3v3h-1c-0.6,0-1,0.4-1,1v6c0,0.6,0.4,1,1,1h10&#xD;&#xA;	c0.6,0,1-0.4,1-1v-6C32,24.4,31.6,24,31,24z M24,21c0-0.6,0.4-1,1-1h2c0.6,0,1,0.4,1,1v3h-4V21z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 646)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow159_white { fill:#FFFFFF;}
	.Black159_white { fill:#FFFFFF;}
</style>
<path class="Black159_white" d="M8,10h14v2H8V10z M8,16h14v-2H8V16z M8,8h14V6H8V8z M18,28H4V2h22v14h1c0.3,0,0.7,0,1,0.1V1c0-0.6-0.4-1-1-1&#xD;&#xA;	H3C2.4,0,2,0.4,2,1v28c0,0.6,0.4,1,1,1h15V28z M8,24h10.2c0.3-0.9,1-1.5,1.8-1.8V22H8V24z M8,20h12.1c0.2-0.7,0.5-1.4,0.9-2H8V20z" xmlns="http://www.w3.org/2000/svg" />
<path class="Yellow159_white" d="M31,24h-1v-3c0-1.7-1.3-3-3-3h-2c-1.7,0-3,1.3-3,3v3h-1c-0.6,0-1,0.4-1,1v6c0,0.6,0.4,1,1,1h10&#xD;&#xA;	c0.6,0,1-0.4,1-1v-6C32,24.4,31.6,24,31,24z M24,21c0-0.6,0.4-1,1-1h2c0.6,0,1,0.4,1,1v3h-4V21z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0160 {fill:#727272;}
</style>
<path class="st0160" d="M16,10V4l16,10L16,24v-6C0,18,0,26,0,26S0,10,16,10z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 646)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0160_white { fill:#FFFFFF;}
</style>
<path class="st0160_white" d="M16,10V4l16,10L16,24v-6C0,18,0,26,0,26S0,10,16,10z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue161 { fill:#757575;}
	.Green161 { fill:#404040;}
	.Red161 { fill:#585858;}
</style>
<path class="Red161" d="M12,26h-0.2H9.9H9.8l0-0.1L9.2,24H4.8l-0.6,1.9l0,0.1H4.1H2.2H2l0.1-0.2l3.9-11.7L6,14h0.1H8h0.1l0,0.1&#xD;&#xA;	l3.8,11.7L12,26L12,26z M5.4,22h3.2L7,16.7c0,0,0,0,0-0.1c0,0,0,0,0,0.1L5.4,22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Green161" d="M20,26V14h4.4c1.3,0,2.4,0.2,3.1,0.7c0.7,0.5,1.1,1.2,1.1,2.1c0,0.6-0.2,1.2-0.7,1.7c-0.4,0.5-1,0.8-1.7,1v0&#xD;&#xA;	c0.9,0.1,1.5,0.4,2,0.9c0.5,0.5,0.8,1.2,0.8,1.9c0,1.1-0.4,2-1.2,2.6c-0.8,0.6-1.9,1-3.2,1H20z M22.7,16v2.8h1.2&#xD;&#xA;	c0.6,0,1-0.1,1.3-0.4c0.3-0.3,0.5-0.6,0.5-1.1c0-0.9-0.7-1.3-2-1.3H22.7z M22.7,20.8V24h1.5c0.6,0,1.1-0.1,1.5-0.4&#xD;&#xA;	c0.4-0.3,0.5-0.7,0.5-1.2c0-0.5-0.2-0.9-0.5-1.1c-0.3-0.3-0.8-0.4-1.5-0.4H22.7z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue161" d="M23.1,6.9C21.3,5.1,18.8,4,16,4c-4.8,0-8.9,3.4-9.8,8h2.1c0.9-3.4,4-6,7.7-6c2.2,0,4.2,0.9,5.6,2.4L18,12h5.7&#xD;&#xA;	h2.1H26V4L23.1,6.9z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 646)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue161_white { fill:#FFFFFF;}
	.Green161_white { fill:#FFFFFF;}
	.Red161_white { fill:#FFFFFF;}
</style>
<path class="Red161_white" d="M12,26h-0.2H9.9H9.8l0-0.1L9.2,24H4.8l-0.6,1.9l0,0.1H4.1H2.2H2l0.1-0.2l3.9-11.7L6,14h0.1H8h0.1l0,0.1&#xD;&#xA;	l3.8,11.7L12,26L12,26z M5.4,22h3.2L7,16.7c0,0,0,0,0-0.1c0,0,0,0,0,0.1L5.4,22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Green161_white" d="M20,26V14h4.4c1.3,0,2.4,0.2,3.1,0.7c0.7,0.5,1.1,1.2,1.1,2.1c0,0.6-0.2,1.2-0.7,1.7c-0.4,0.5-1,0.8-1.7,1v0&#xD;&#xA;	c0.9,0.1,1.5,0.4,2,0.9c0.5,0.5,0.8,1.2,0.8,1.9c0,1.1-0.4,2-1.2,2.6c-0.8,0.6-1.9,1-3.2,1H20z M22.7,16v2.8h1.2&#xD;&#xA;	c0.6,0,1-0.1,1.3-0.4c0.3-0.3,0.5-0.6,0.5-1.1c0-0.9-0.7-1.3-2-1.3H22.7z M22.7,20.8V24h1.5c0.6,0,1.1-0.1,1.5-0.4&#xD;&#xA;	c0.4-0.3,0.5-0.7,0.5-1.2c0-0.5-0.2-0.9-0.5-1.1c-0.3-0.3-0.8-0.4-1.5-0.4H22.7z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue161_white" d="M23.1,6.9C21.3,5.1,18.8,4,16,4c-4.8,0-8.9,3.4-9.8,8h2.1c0.9-3.4,4-6,7.7-6c2.2,0,4.2,0.9,5.6,2.4L18,12h5.7&#xD;&#xA;	h2.1H26V4L23.1,6.9z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black162 { fill:#727272;}
	.st0162 {opacity:0.75;}
</style>
<g class="st0162" xmlns="http://www.w3.org/2000/svg">
	<path class="Black162" d="M19.7,7.7c-0.1-0.3-0.3-0.5-0.2-0.9c0-0.1,0.2-0.2,0.3-0.2c-0.7-2.2,0-4.4,2.5-4.6c2.7-0.2,3.2,1.8,3.2,1.8&#xD;&#xA;		s1.4-0.1,0.6,2.9c0.1,0,0.3,0,0.3,0.2c0.1,0.3,0,0.6-0.2,0.9c-0.1,0.3,0.1,1-0.5,1c0,0,0,0.1,0,0.1c-0.3,1.4-1.2,3-2.8,3&#xD;&#xA;		c-1.6,0-2.4-1.6-2.8-3c0,0,0-0.1,0-0.1C19.7,8.7,19.9,8,19.7,7.7z M6.3,8.7c0,0,0,0.1,0,0.1c0.3,1.4,1.2,3,2.8,3&#xD;&#xA;		c1.6,0,2.4-1.6,2.8-3c0,0,0-0.1,0-0.1c0.6,0,0.4-0.7,0.5-1c0.1-0.3,0.2-0.5,0.2-0.9c-0.1-0.2-0.3-0.2-0.3-0.2&#xD;&#xA;		c0.7-2.9-0.6-2.9-0.6-2.9S11,1.8,8.3,2C5.8,2.2,5.1,4.4,5.8,6.6c-0.1,0-0.2,0.1-0.3,0.2C5.4,7.2,5.6,7.4,5.7,7.7&#xD;&#xA;		C5.9,8,5.7,8.7,6.3,8.7z M25.3,11.9c-0.5,0.9-1.2,2.5-2.3,2.5c-0.5,0-0.8-0.3-1.2-0.7c0,0.3,0,0.5-0.1,0.8c0.1,0.1,0.1,0.3,0.1,0.4&#xD;&#xA;		c0.2,0.9,0,1.6-0.2,2c0,0.4-0.1,0.7-0.2,1H30v-0.9C30,12.5,26.7,14,25.3,11.9z M10.4,17c-0.2-0.4-0.5-1.1-0.3-2.1&#xD;&#xA;		c0-0.1,0-0.2,0.1-0.3c0-0.3-0.1-0.5-0.1-0.8c-0.3,0.3-0.7,0.5-1.1,0.5c-1.1,0-1.8-1.6-2.3-2.6C5.4,14.1,2,12.5,2,17.1V18h8.6&#xD;&#xA;		C10.5,17.7,10.4,17.4,10.4,17z" />
</g>
<path class="Black162" d="M12.3,16.4c-0.2-0.3-0.3-0.6-0.3-1c0-0.2,0.2-0.2,0.3-0.2c-0.7-2.5,0-5,2.9-5.2c3-0.2,3.7,2,3.7,2&#xD;&#xA;	s1.6-0.1,0.7,3.2c0.1,0,0.3-0.1,0.4,0.2c0.1,0.4,0,0.6-0.2,1c-0.2,0.3,0.1,1.1-0.6,1.1c0,0,0,0.1,0,0.1C18.8,19.2,17.8,21,16,21&#xD;&#xA;	c-1.8,0-2.8-1.7-3.2-3.4c0,0,0-0.1,0-0.1C12.2,17.6,12.4,16.8,12.3,16.4z M18.7,21.2c-0.5,1-1.4,2.8-2.7,2.8c-1.3,0-2.1-1.8-2.6-2.9&#xD;&#xA;	C11.9,23.6,8,21.8,8,27v1h16v-1C24,21.9,20.2,23.5,18.7,21.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 918)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black162_white { fill:#FFFFFF;}
	.st0162_white {opacity:0.75;}
</style>
<g class="st0162_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black162_white" d="M19.7,7.7c-0.1-0.3-0.3-0.5-0.2-0.9c0-0.1,0.2-0.2,0.3-0.2c-0.7-2.2,0-4.4,2.5-4.6c2.7-0.2,3.2,1.8,3.2,1.8&#xD;&#xA;		s1.4-0.1,0.6,2.9c0.1,0,0.3,0,0.3,0.2c0.1,0.3,0,0.6-0.2,0.9c-0.1,0.3,0.1,1-0.5,1c0,0,0,0.1,0,0.1c-0.3,1.4-1.2,3-2.8,3&#xD;&#xA;		c-1.6,0-2.4-1.6-2.8-3c0,0,0-0.1,0-0.1C19.7,8.7,19.9,8,19.7,7.7z M6.3,8.7c0,0,0,0.1,0,0.1c0.3,1.4,1.2,3,2.8,3&#xD;&#xA;		c1.6,0,2.4-1.6,2.8-3c0,0,0-0.1,0-0.1c0.6,0,0.4-0.7,0.5-1c0.1-0.3,0.2-0.5,0.2-0.9c-0.1-0.2-0.3-0.2-0.3-0.2&#xD;&#xA;		c0.7-2.9-0.6-2.9-0.6-2.9S11,1.8,8.3,2C5.8,2.2,5.1,4.4,5.8,6.6c-0.1,0-0.2,0.1-0.3,0.2C5.4,7.2,5.6,7.4,5.7,7.7&#xD;&#xA;		C5.9,8,5.7,8.7,6.3,8.7z M25.3,11.9c-0.5,0.9-1.2,2.5-2.3,2.5c-0.5,0-0.8-0.3-1.2-0.7c0,0.3,0,0.5-0.1,0.8c0.1,0.1,0.1,0.3,0.1,0.4&#xD;&#xA;		c0.2,0.9,0,1.6-0.2,2c0,0.4-0.1,0.7-0.2,1H30v-0.9C30,12.5,26.7,14,25.3,11.9z M10.4,17c-0.2-0.4-0.5-1.1-0.3-2.1&#xD;&#xA;		c0-0.1,0-0.2,0.1-0.3c0-0.3-0.1-0.5-0.1-0.8c-0.3,0.3-0.7,0.5-1.1,0.5c-1.1,0-1.8-1.6-2.3-2.6C5.4,14.1,2,12.5,2,17.1V18h8.6&#xD;&#xA;		C10.5,17.7,10.4,17.4,10.4,17z" />
</g>
<path class="Black162_white" d="M12.3,16.4c-0.2-0.3-0.3-0.6-0.3-1c0-0.2,0.2-0.2,0.3-0.2c-0.7-2.5,0-5,2.9-5.2c3-0.2,3.7,2,3.7,2&#xD;&#xA;	s1.6-0.1,0.7,3.2c0.1,0,0.3-0.1,0.4,0.2c0.1,0.4,0,0.6-0.2,1c-0.2,0.3,0.1,1.1-0.6,1.1c0,0,0,0.1,0,0.1C18.8,19.2,17.8,21,16,21&#xD;&#xA;	c-1.8,0-2.8-1.7-3.2-3.4c0,0,0-0.1,0-0.1C12.2,17.6,12.4,16.8,12.3,16.4z M18.7,21.2c-0.5,1-1.4,2.8-2.7,2.8c-1.3,0-2.1-1.8-2.6-2.9&#xD;&#xA;	C11.9,23.6,8,21.8,8,27v1h16v-1C24,21.9,20.2,23.5,18.7,21.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow163 { fill:#979797;}
	.Black163 { fill:#727272;}
	.st0163 {opacity:0.5;}
</style>
<g class="st0163" xmlns="http://www.w3.org/2000/svg">
	<path class="Black163" d="M29,2H14v10h2V7.3L27.6,15L16,22.7V18h-2v10h15c0.5,0,1-0.5,1-1V3C30,2.5,29.5,2,29,2z" />
</g>
<path class="Black163" d="M8,16h10v3l6-4l-6-4v3H8V16z" xmlns="http://www.w3.org/2000/svg" />
<path class="Yellow163" d="M6,18v-6h6V2H3C2.5,2,2,2.5,2,3v24c0,0.5,0.5,1,1,1h9V18H6z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 952)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow163_white { fill:#FFFFFF;}
	.Black163_white { fill:#FFFFFF;}
	.st0163_white {opacity:0.5;}
</style>
<g class="st0163_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black163_white" d="M29,2H14v10h2V7.3L27.6,15L16,22.7V18h-2v10h15c0.5,0,1-0.5,1-1V3C30,2.5,29.5,2,29,2z" />
</g>
<path class="Black163_white" d="M8,16h10v3l6-4l-6-4v3H8V16z" xmlns="http://www.w3.org/2000/svg" />
<path class="Yellow163_white" d="M6,18v-6h6V2H3C2.5,2,2,2.5,2,3v24c0,0.5,0.5,1,1,1h9V18H6z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0164 {fill:#727272;enable-background:new    ;}
</style>
<path class="st0164" d="M20,6h10v2H20V6z M2,8h16V6H2V8z M20,12h10v-2H20V12z M2,12h16v-2H2V12z M20,16h10v-2H20V16z M2,16h16v-2H2V16z&#xD;&#xA;	 M20,20h10v-2H20V20z M2,20h16v-2H2V20z M20,24h10v-2H20V24z M2,24h16v-2H2V24z" xmlns="http://www.w3.org/2000/svg" />
<rect x="20" y="2" class="st0164" width="10" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="2" class="st0164" width="16" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="20" y="26" class="st0164" width="10" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="26" class="st0164" width="16" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 884)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0164_white { fill:#FFFFFF;enable-background:new    ;}
</style>
<path class="st0164_white" d="M20,6h10v2H20V6z M2,8h16V6H2V8z M20,12h10v-2H20V12z M2,12h16v-2H2V12z M20,16h10v-2H20V16z M2,16h16v-2H2V16z&#xD;&#xA;	 M20,20h10v-2H20V20z M2,20h16v-2H2V20z M20,24h10v-2H20V24z M2,24h16v-2H2V24z" xmlns="http://www.w3.org/2000/svg" />
<rect x="20" y="2" class="st0164_white" width="10" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="2" class="st0164_white" width="16" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="20" y="26" class="st0164_white" width="10" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="26" class="st0164_white" width="16" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black165 { fill:#727272;}
	.Yellow165 { fill:#979797;}
</style>
<path class="Yellow165" d="M29,22H1c-0.6,0-1-0.5-1-1V9c0-0.6,0.4-1,1-1h28c0.5,0,1,0.4,1,1v12C30,21.5,29.5,22,29,22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black165" d="M4,22H2v-6h2V22z M8,18H6v4h2V18z M12,16h-2v6h2V16z M16,18h-2v4h2V18z M20,16h-2v6h2V16z M24,18h-2v4h2V18z&#xD;&#xA;	 M28,16h-2v6h2V16z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 816)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black165_white { fill:#FFFFFF;}
	.Yellow165_white { fill:#FFFFFF;}
</style>
<path class="Yellow165_white" d="M29,22H1c-0.6,0-1-0.5-1-1V9c0-0.6,0.4-1,1-1h28c0.5,0,1,0.4,1,1v12C30,21.5,29.5,22,29,22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black165_white" d="M4,22H2v-6h2V22z M8,18H6v4h2V18z M12,16h-2v6h2V16z M16,18h-2v4h2V18z M20,16h-2v6h2V16z M24,18h-2v4h2V18z&#xD;&#xA;	 M28,16h-2v6h2V16z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black166 { fill:#727272;}
	.Yellow166 { fill:#979797;}
</style>
<path class="Yellow166" d="M21,30H9c-0.6,0-1-0.5-1-1V1c0-0.6,0.4-1,1-1h12c0.5,0,1,0.4,1,1v28C22,29.5,21.5,30,21,30z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black166" d="M22,4h-6V2h6V4z M18,8h4V6h-4V8z M16,12h6v-2h-6V12z M18,16h4v-2h-4V16z M16,20h6v-2h-6V20z M18,24h4v-2h-4&#xD;&#xA;	V24z M16,28h6v-2h-6V28z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 850)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black166_white { fill:#FFFFFF;}
	.Yellow166_white { fill:#FFFFFF;}
</style>
<path class="Yellow166_white" d="M21,30H9c-0.6,0-1-0.5-1-1V1c0-0.6,0.4-1,1-1h12c0.5,0,1,0.4,1,1v28C22,29.5,21.5,30,21,30z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black166_white" d="M22,4h-6V2h6V4z M18,8h4V6h-4V8z M16,12h6v-2h-6V12z M18,16h4v-2h-4V16z M16,20h6v-2h-6V20z M18,24h4v-2h-4&#xD;&#xA;	V24z M16,28h6v-2h-6V28z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black167 {fill:#727272;}
</style>
<path class="Black167" d="M27,4h-3v10H8V4H5C4.4,4,4,4.4,4,5v22c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V5C28,4.4,27.6,4,27,4z M24,24H8v-6&#xD;&#xA;	h16V24z M10,4v8h10V4H10z M14,10h-2V6h2V10z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 646)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black167_white { fill:#FFFFFF;}
</style>
<path class="Black167_white" d="M27,4h-3v10H8V4H5C4.4,4,4,4.4,4,5v22c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V5C28,4.4,27.6,4,27,4z M24,24H8v-6&#xD;&#xA;	h16V24z M10,4v8h10V4H10z M14,10h-2V6h2V10z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow168 { fill:#979797;}
	.Red168 { fill:#585858;}
	.Black168 { fill:#727272;}
	.Blue168 { fill:#757575;}
	.White168 { fill:#FFFFFF;}
	.Green168 { fill:#404040;}
	.st0168 {opacity:0.75;}
	.st1168 {opacity:0.5;}
	.st2168 {opacity:0.25;}
	.st3168 { fill:#979797;}
</style>
<g xmlns="http://www.w3.org/2000/svg">
</g>
<g id="SaveAs" xmlns="http://www.w3.org/2000/svg">
	<path class="Black168" d="M31,0H19c-0.6,0-1,0.4-1,1v16c0,0.6,0.4,1,1,1h12c0.6,0,1-0.4,1-1V1C32,0.4,31.6,0,31,0z M30,16H20V2h10V16z&#xD;&#xA;		 M22,20v4H6v-6h10v-4H6V4H3C2.4,4,2,4.4,2,5v22c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1v-7H22z M16,4H8v8h8V4z M12,10h-2V6h2V10z" />
</g>
</g>

<g transform="translate(306, 782)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow168_white { fill:#FFFFFF;}
	.Red168_white { fill:#FFFFFF;}
	.Black168_white { fill:#FFFFFF;}
	.Blue168_white { fill:#FFFFFF;}
	.White168_white { fill:#FFFFFF;}
	.Green168_white { fill:#FFFFFF;}
	.st0168_white {opacity:0.75;}
	.st1168_white {opacity:0.5;}
	.st2168_white {opacity:0.25;}
	.st3168_white { fill:#FFFFFF;}
</style>
<g xmlns="http://www.w3.org/2000/svg">
</g>
<g id="SaveAs" xmlns="http://www.w3.org/2000/svg">
	<path class="Black168_white" d="M31,0H19c-0.6,0-1,0.4-1,1v16c0,0.6,0.4,1,1,1h12c0.6,0,1-0.4,1-1V1C32,0.4,31.6,0,31,0z M30,16H20V2h10V16z&#xD;&#xA;		 M22,20v4H6v-6h10v-4H6V4H3C2.4,4,2,4.4,2,5v22c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1v-7H22z M16,4H8v8h8V4z M12,10h-2V6h2V10z" />
</g>
</g>

<g transform="translate(34, 476)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow169 {fill:#FFB115;}
	.Red169 {fill:#D11C1C;}
	.Blue169 {fill:#1177D7;}
	.Green169 {fill:#039C23;}
	.Black169 {fill:#727272;}
	.White169 {fill:#FFFFFF;}
	.st0169 {opacity:0.75;}
</style>
<g id="Select" xmlns="http://www.w3.org/2000/svg">
	<path class="Black169" d="M18.2,20H26L10,4v22l5.3-5.3l2.7,6.7c0.2,0.5,0.8,0.8,1.3,0.5l0.9-0.4c0.5-0.2,0.8-0.8,0.5-1.3L18.2,20z" />
</g>
</g>

<g transform="translate(34, 986)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow169_white { fill:#FFFFFF;}
	.Red169_white { fill:#FFFFFF;}
	.Blue169_white { fill:#FFFFFF;}
	.Green169_white { fill:#FFFFFF;}
	.Black169_white { fill:#FFFFFF;}
	.White169_white { fill:#FFFFFF;}
	.st0169_white {opacity:0.75;}
</style>
<g id="Select" xmlns="http://www.w3.org/2000/svg">
	<path class="Black169_white" d="M18.2,20H26L10,4v22l5.3-5.3l2.7,6.7c0.2,0.5,0.8,0.8,1.3,0.5l0.9-0.4c0.5-0.2,0.8-0.8,0.5-1.3L18.2,20z" />
</g>
</g>

<g transform="translate(68, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0170 {fill:#727272;}
	.st1170 {opacity:0.5;fill:#727272;}
</style>
<path id="layer_1_" class="st0170" d="M24,8H6V6h18V8z M24,10H6v2h18V10z M24,14H6v2h18V14z M24,18H6v2h18V18z M24,22H6v2h18V22z" xmlns="http://www.w3.org/2000/svg" />
<path id="layer" class="st1170" d="M2,0h4v2H2v4H0V0H2z M8,2h6V0H8V2z M16,2h6V0h-6V2z M24,0v2h4v4h2V2V0H24z M28,14h2V8h-2V14z M28,22&#xD;&#xA;	h2v-6h-2V22z M28,28h-4v2h4h2v-6h-2V28z M8,30h6v-2H8V30z M16,30h6v-2h-6V30z M2,8H0v6h2V8z M2,16H0v6h2V16z M2,24H0v4v2h6v-2H2V24z&#xD;&#xA;	" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 850)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0170_white { fill:#FFFFFF;}
	.st1170_white { fill:#FFFFFF;}
</style>
<path id="layer_1_" class="st0170_white" d="M24,8H6V6h18V8z M24,10H6v2h18V10z M24,14H6v2h18V14z M24,18H6v2h18V18z M24,22H6v2h18V22z" xmlns="http://www.w3.org/2000/svg" />
<path id="layer" class="st1170_white" d="M2,0h4v2H2v4H0V0H2z M8,2h6V0H8V2z M16,2h6V0h-6V2z M24,0v2h4v4h2V2V0H24z M28,14h2V8h-2V14z M28,22&#xD;&#xA;	h2v-6h-2V22z M28,28h-4v2h4h2v-6h-2V28z M8,30h6v-2H8V30z M16,30h6v-2h-6V30z M2,8H0v6h2V8z M2,16H0v6h2V16z M2,24H0v4v2h6v-2H2V24z&#xD;&#xA;	" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0171 {fill:#727272;}
</style>
<path class="st0171" d="M10,10H2V4h8V10z M20,4h-8v6h8V4z M30,4h-8v6h8V4z M10,12H2v6h8V12z M20,12h-8v6h8V12z M30,12h-8v6h8V12z&#xD;&#xA;	 M10,20H2v6h8V20z M20,20h-8v6h8V20z M30,20h-8v6h8V20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 952)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0171_white { fill:#FFFFFF;}
</style>
<path class="st0171_white" d="M10,10H2V4h8V10z M20,4h-8v6h8V4z M30,4h-8v6h8V4z M10,12H2v6h8V12z M20,12h-8v6h8V12z M30,12h-8v6h8V12z&#xD;&#xA;	 M10,20H2v6h8V20z M20,20h-8v6h8V20z M30,20h-8v6h8V20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue172 { fill:#757575;}
	.Black172 { fill:#727272;}
	.st0172 {opacity:0.5;}
</style>
<rect x="12" y="12" class="Blue172" width="8" height="6" xmlns="http://www.w3.org/2000/svg" />
<g class="st0172" xmlns="http://www.w3.org/2000/svg">
	<path class="Black172" d="M10,10H2V4h8V10z M20,4h-8v6h8V4z M30,4h-8v6h8V4z M10,12H2v6h8V12z M30,12h-8v6h8V12z M10,20H2v6h8V20z&#xD;&#xA;		 M20,20h-8v6h8V20z M30,20h-8v6h8V20z" />
</g>
</g>

<g transform="translate(238, 952)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue172_white { fill:#FFFFFF;}
	.Black172_white { fill:#FFFFFF;}
	.st0172_white {opacity:0.5;}
</style>
<rect x="12" y="12" class="Blue172_white" width="8" height="6" xmlns="http://www.w3.org/2000/svg" />
<g class="st0172_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black172_white" d="M10,10H2V4h8V10z M20,4h-8v6h8V4z M30,4h-8v6h8V4z M10,12H2v6h8V12z M30,12h-8v6h8V12z M10,20H2v6h8V20z&#xD;&#xA;		 M20,20h-8v6h8V20z M30,20h-8v6h8V20z" />
</g>
</g>

<g transform="translate(476, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue173 { fill:#757575;}
	.Black173 { fill:#727272;}
	.st0173 {opacity:0.5;}
</style>
<path class="Blue173" d="M20,10h-8V4h8V10z M20,12h-8v6h8V12z M20,20h-8v6h8V20z" xmlns="http://www.w3.org/2000/svg" />
<g class="st0173" xmlns="http://www.w3.org/2000/svg">
	<path class="Black173" d="M10,10H2V4h8V10z M30,4h-8v6h8V4z M10,12H2v6h8V12z M30,12h-8v6h8V12z M10,20H2v6h8V20z M30,20h-8v6h8V20z" />
</g>
</g>

<g transform="translate(476, 782)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue173_white { fill:#FFFFFF;}
	.Black173_white { fill:#FFFFFF;}
	.st0173_white {opacity:0.5;}
</style>
<path class="Blue173_white" d="M20,10h-8V4h8V10z M20,12h-8v6h8V12z M20,20h-8v6h8V20z" xmlns="http://www.w3.org/2000/svg" />
<g class="st0173_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black173_white" d="M10,10H2V4h8V10z M30,4h-8v6h8V4z M10,12H2v6h8V12z M30,12h-8v6h8V12z M10,20H2v6h8V20z M30,20h-8v6h8V20z" />
</g>
</g>

<g transform="translate(306, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue174 { fill:#757575;}
	.Black174 { fill:#727272;}
	.st0174 {opacity:0.5;}
</style>
<path class="Blue174" d="M20,10h-8V4h8V10z M20,12h-8v6h8V12z M20,20h-8v6h8V20z" xmlns="http://www.w3.org/2000/svg" />
<g class="st0174" xmlns="http://www.w3.org/2000/svg">
	<path class="Black174" d="M10,10H2V4h8V10z M30,4h-8v6h8V4z M10,12H2v6h8V12z M30,12h-8v6h8V12z M10,20H2v6h8V20z M30,20h-8v6h8V20z" />
</g>
</g>

<g transform="translate(306, 714)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue174_white { fill:#FFFFFF;}
	.Black174_white { fill:#FFFFFF;}
	.st0174_white {opacity:0.5;}
</style>
<path class="Blue174_white" d="M20,10h-8V4h8V10z M20,12h-8v6h8V12z M20,20h-8v6h8V20z" xmlns="http://www.w3.org/2000/svg" />
<g class="st0174_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black174_white" d="M10,10H2V4h8V10z M30,4h-8v6h8V4z M10,12H2v6h8V12z M30,12h-8v6h8V12z M10,20H2v6h8V20z M30,20h-8v6h8V20z" />
</g>
</g>

<g transform="translate(68, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black175 {fill:#727272;}
	.Blue175 {fill:#1177D7;}
</style>
<path class="Blue175" d="M18.4,8c2.6,0,4.8,4.3,4.8,9.6c0,1.3,1.1,2.4,2.4,2.4c1.3,0,2.4-1.1,2.4-2.4C28,12.3,23.7,8,18.4,8z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black175" d="M17,9.3l3,3L13.3,19c-1.4,1.4-3.7,1.4-5.1,0l-5.1-5.1c-1.4-1.4-1.4-3.7,0-5.1L9.7,2l3,3l-1.9,1.9&#xD;&#xA;	C10.3,7.4,10,8.2,10,9c0,0.8,0.3,1.6,0.9,2.1c0.6,0.6,1.3,0.9,2.1,0.9s1.6-0.3,2.1-0.9L17,9.3z M13.7,9.7l5.9-5.9&#xD;&#xA;	c0.4-0.4,0.4-1,0-1.4l0,0c-0.4-0.4-1-0.4-1.4,0l-5.9,5.9c-0.4,0.4-0.4,1,0,1.4l0,0C12.7,10.1,13.3,10.1,13.7,9.7z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 714)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black175_white { fill:#FFFFFF;}
	.Blue175_white { fill:#FFFFFF;}
</style>
<path class="Blue175_white" d="M18.4,8c2.6,0,4.8,4.3,4.8,9.6c0,1.3,1.1,2.4,2.4,2.4c1.3,0,2.4-1.1,2.4-2.4C28,12.3,23.7,8,18.4,8z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black175_white" d="M17,9.3l3,3L13.3,19c-1.4,1.4-3.7,1.4-5.1,0l-5.1-5.1c-1.4-1.4-1.4-3.7,0-5.1L9.7,2l3,3l-1.9,1.9&#xD;&#xA;	C10.3,7.4,10,8.2,10,9c0,0.8,0.3,1.6,0.9,2.1c0.6,0.6,1.3,0.9,2.1,0.9s1.6-0.3,2.1-0.9L17,9.3z M13.7,9.7l5.9-5.9&#xD;&#xA;	c0.4-0.4,0.4-1,0-1.4l0,0c-0.4-0.4-1-0.4-1.4,0l-5.9,5.9c-0.4,0.4-0.4,1,0,1.4l0,0C12.7,10.1,13.3,10.1,13.7,9.7z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black176 { fill:#727272;}
	.Yellow176 { fill:#979797;}
</style>
<path class="Black176" d="M28,24H10v2h18V24z M28,16H10v2h18V16z M16,20h-6v2h6V20z M31,4H7C6.5,4,6,4.5,6,5v26c0,0.5,0.5,1,1,1h24&#xD;&#xA;	c0.5,0,1-0.5,1-1V5C32,4.5,31.5,4,31,4z M30,30H8V6h22V30z" xmlns="http://www.w3.org/2000/svg" />
<path class="Yellow176" d="M28,22H18v-2h10V22z M24,13V1c0-0.6-0.5-1-1-1H1C0.4,0,0,0.4,0,1v12c0,0.6,0.4,1,1,1h22&#xD;&#xA;	C23.5,14,24,13.6,24,13z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black176" d="M19,7.8c0,0-0.1,0-0.1,0c-0.1,0-0.3,0.1-0.4,0.2c-0.1,0.1-0.2,0.2-0.3,0.4C18,8.6,18,8.8,18,9.1v0.7&#xD;&#xA;	c0,0.4-0.1,0.7-0.2,1c-0.1,0.3-0.3,0.5-0.4,0.7c-0.2,0.2-0.4,0.3-0.6,0.4C16.6,12,16.4,12,16.3,12H14v-1.8h1.2c0.2,0,0.3,0,0.4-0.1&#xD;&#xA;	c0.1-0.1,0.2-0.2,0.2-0.3C15.9,9.6,16,9.5,16,9.4c0-0.1,0-0.3,0-0.4V8.8c0-0.4,0.1-0.6,0.2-0.9c0.1-0.2,0.2-0.4,0.4-0.5&#xD;&#xA;	s0.3-0.2,0.5-0.3C17.2,7.1,17.3,7,17.4,7v0c-0.1,0-0.2,0-0.4-0.1c-0.2-0.1-0.3-0.2-0.5-0.3S16.3,6.3,16.2,6S16,5.4,16,5v0&#xD;&#xA;	c0-0.1,0-0.3,0-0.4c0-0.1,0-0.3-0.1-0.4C15.8,4.1,15.7,4,15.6,4c-0.1-0.1-0.2-0.1-0.4-0.1H14V2h2.3c0.2,0,0.3,0,0.5,0.1&#xD;&#xA;	c0.2,0.1,0.4,0.2,0.6,0.4c0.2,0.2,0.3,0.4,0.4,0.7c0.1,0.3,0.2,0.6,0.2,1v0.6c0,0.3,0,0.5,0.1,0.7c0.1,0.2,0.2,0.3,0.3,0.5&#xD;&#xA;	c0.1,0.1,0.3,0.2,0.4,0.2c0,0,0.1,0,0.1,0V7.8z M5,7.8c0,0,0.1,0,0.1,0c0.1,0,0.3,0.1,0.4,0.2c0.1,0.1,0.2,0.2,0.3,0.4&#xD;&#xA;	C6,8.6,6,8.8,6,9.1v0.7c0,0.4,0.1,0.7,0.2,1c0.1,0.3,0.3,0.5,0.4,0.7c0.2,0.2,0.4,0.3,0.6,0.4C7.4,12,7.6,12,7.7,12H10v-1.8H8.8&#xD;&#xA;	c-0.2,0-0.3,0-0.4-0.1C8.3,10,8.2,9.9,8.1,9.8C8.1,9.6,8,9.5,8,9.4C8,9.2,8,9.1,8,9V8.8C8,8.5,7.9,8.2,7.8,8&#xD;&#xA;	C7.7,7.8,7.6,7.6,7.5,7.4S7.2,7.2,7,7.1C6.8,7.1,6.7,7,6.6,7v0c0.1,0,0.2,0,0.4-0.1c0.2-0.1,0.3-0.2,0.5-0.3S7.7,6.3,7.8,6&#xD;&#xA;	S8,5.4,8,5v0c0-0.1,0-0.3,0-0.4c0-0.1,0-0.3,0.1-0.4C8.2,4.1,8.3,4,8.4,4c0.1-0.1,0.2-0.1,0.4-0.1H10V2H7.7C7.6,2,7.4,2,7.2,2.1&#xD;&#xA;	C7,2.2,6.8,2.4,6.6,2.6C6.5,2.7,6.3,3,6.2,3.2C6.1,3.5,6,3.8,6,4.2v0.6c0,0.3,0,0.5-0.1,0.7C5.8,5.7,5.7,5.9,5.5,6&#xD;&#xA;	C5.4,6.1,5.3,6.2,5.1,6.2c0,0-0.1,0-0.1,0V7.8z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 714)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black176_white { fill:#FFFFFF;}
	.Yellow176_white { fill:#FFFFFF;}
</style>
<path class="Black176_white" d="M28,24H10v2h18V24z M28,16H10v2h18V16z M16,20h-6v2h6V20z M31,4H7C6.5,4,6,4.5,6,5v26c0,0.5,0.5,1,1,1h24&#xD;&#xA;	c0.5,0,1-0.5,1-1V5C32,4.5,31.5,4,31,4z M30,30H8V6h22V30z" xmlns="http://www.w3.org/2000/svg" />
<path class="Yellow176_white" d="M28,22H18v-2h10V22z M24,13V1c0-0.6-0.5-1-1-1H1C0.4,0,0,0.4,0,1v12c0,0.6,0.4,1,1,1h22&#xD;&#xA;	C23.5,14,24,13.6,24,13z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black176_white" d="M19,7.8c0,0-0.1,0-0.1,0c-0.1,0-0.3,0.1-0.4,0.2c-0.1,0.1-0.2,0.2-0.3,0.4C18,8.6,18,8.8,18,9.1v0.7&#xD;&#xA;	c0,0.4-0.1,0.7-0.2,1c-0.1,0.3-0.3,0.5-0.4,0.7c-0.2,0.2-0.4,0.3-0.6,0.4C16.6,12,16.4,12,16.3,12H14v-1.8h1.2c0.2,0,0.3,0,0.4-0.1&#xD;&#xA;	c0.1-0.1,0.2-0.2,0.2-0.3C15.9,9.6,16,9.5,16,9.4c0-0.1,0-0.3,0-0.4V8.8c0-0.4,0.1-0.6,0.2-0.9c0.1-0.2,0.2-0.4,0.4-0.5&#xD;&#xA;	s0.3-0.2,0.5-0.3C17.2,7.1,17.3,7,17.4,7v0c-0.1,0-0.2,0-0.4-0.1c-0.2-0.1-0.3-0.2-0.5-0.3S16.3,6.3,16.2,6S16,5.4,16,5v0&#xD;&#xA;	c0-0.1,0-0.3,0-0.4c0-0.1,0-0.3-0.1-0.4C15.8,4.1,15.7,4,15.6,4c-0.1-0.1-0.2-0.1-0.4-0.1H14V2h2.3c0.2,0,0.3,0,0.5,0.1&#xD;&#xA;	c0.2,0.1,0.4,0.2,0.6,0.4c0.2,0.2,0.3,0.4,0.4,0.7c0.1,0.3,0.2,0.6,0.2,1v0.6c0,0.3,0,0.5,0.1,0.7c0.1,0.2,0.2,0.3,0.3,0.5&#xD;&#xA;	c0.1,0.1,0.3,0.2,0.4,0.2c0,0,0.1,0,0.1,0V7.8z M5,7.8c0,0,0.1,0,0.1,0c0.1,0,0.3,0.1,0.4,0.2c0.1,0.1,0.2,0.2,0.3,0.4&#xD;&#xA;	C6,8.6,6,8.8,6,9.1v0.7c0,0.4,0.1,0.7,0.2,1c0.1,0.3,0.3,0.5,0.4,0.7c0.2,0.2,0.4,0.3,0.6,0.4C7.4,12,7.6,12,7.7,12H10v-1.8H8.8&#xD;&#xA;	c-0.2,0-0.3,0-0.4-0.1C8.3,10,8.2,9.9,8.1,9.8C8.1,9.6,8,9.5,8,9.4C8,9.2,8,9.1,8,9V8.8C8,8.5,7.9,8.2,7.8,8&#xD;&#xA;	C7.7,7.8,7.6,7.6,7.5,7.4S7.2,7.2,7,7.1C6.8,7.1,6.7,7,6.6,7v0c0.1,0,0.2,0,0.4-0.1c0.2-0.1,0.3-0.2,0.5-0.3S7.7,6.3,7.8,6&#xD;&#xA;	S8,5.4,8,5v0c0-0.1,0-0.3,0-0.4c0-0.1,0-0.3,0.1-0.4C8.2,4.1,8.3,4,8.4,4c0.1-0.1,0.2-0.1,0.4-0.1H10V2H7.7C7.6,2,7.4,2,7.2,2.1&#xD;&#xA;	C7,2.2,6.8,2.4,6.6,2.6C6.5,2.7,6.3,3,6.2,3.2C6.1,3.5,6,3.8,6,4.2v0.6c0,0.3,0,0.5-0.1,0.7C5.8,5.7,5.7,5.9,5.5,6&#xD;&#xA;	C5.4,6.1,5.3,6.2,5.1,6.2c0,0-0.1,0-0.1,0V7.8z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black177 { fill:#727272;}
	.Yellow177 { fill:#979797;}
</style>
<path class="Black177" d="M28,24H10v2h18V24z M28,16H10v2h18V16z M16,20h-6v2h6V20z M31,4H7C6.5,4,6,4.5,6,5v26c0,0.5,0.5,1,1,1h24&#xD;&#xA;	c0.5,0,1-0.5,1-1V5C32,4.5,31.5,4,31,4z M30,30H8V6h22V30z" xmlns="http://www.w3.org/2000/svg" />
<path class="Yellow177" d="M28,22H18v-2h10V22z M24,13V1c0-0.6-0.5-1-1-1H1C0.4,0,0,0.4,0,1v12c0,0.6,0.4,1,1,1h22&#xD;&#xA;	C23.5,14,24,13.6,24,13z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black177" d="M4.6,5.4c0.2-0.3,0.5-0.6,0.8-0.8c0.3-0.2,0.7-0.3,1.1-0.4C6.9,4.1,7.3,4,7.7,4c0.4,0,0.7,0,1.1,0.1&#xD;&#xA;	c0.4,0.1,0.7,0.2,1,0.3c0.3,0.2,0.6,0.4,0.8,0.7S11,5.8,11,6.2v4c0,0.4,0,0.7,0.1,1c0,0.3,0.1,0.6,0.2,0.7H9.2&#xD;&#xA;	c0-0.1-0.1-0.2-0.1-0.4c0-0.1,0-0.3,0-0.4c-0.3,0.4-0.7,0.6-1.1,0.7c-0.4,0.1-0.9,0.2-1.3,0.2c-0.4,0-0.7,0-1-0.1S5,11.8,4.7,11.6&#xD;&#xA;	c-0.2-0.2-0.4-0.4-0.5-0.7C4.1,10.6,4,10.3,4,9.9c0-0.4,0.1-0.8,0.2-1.1c0.1-0.3,0.3-0.5,0.6-0.7C5,7.9,5.3,7.8,5.6,7.7&#xD;&#xA;	c0.3-0.1,0.6-0.2,0.9-0.2c0.3,0,0.6-0.1,0.9-0.1c0.3,0,0.6-0.1,0.8-0.1C8.4,7.2,8.6,7.1,8.7,7c0.1-0.1,0.2-0.3,0.2-0.5&#xD;&#xA;	c0-0.2,0-0.4-0.1-0.5C8.7,5.8,8.7,5.7,8.5,5.6S8.3,5.5,8.1,5.5c-0.2,0-0.3,0-0.5,0c-0.4,0-0.7,0.1-0.9,0.3C6.4,5.9,6.3,6.2,6.3,6.6&#xD;&#xA;	h-2C4.3,6.1,4.4,5.7,4.6,5.4z M8.6,8.4c-0.1,0-0.3,0.1-0.4,0.1C8,8.5,7.9,8.6,7.7,8.6c-0.2,0-0.3,0-0.5,0.1c-0.2,0-0.3,0.1-0.5,0.1&#xD;&#xA;	C6.6,8.8,6.5,8.9,6.4,9C6.3,9.1,6.2,9.2,6.1,9.3C6.1,9.4,6,9.6,6,9.8c0,0.2,0,0.4,0.1,0.5c0.1,0.1,0.2,0.2,0.3,0.3&#xD;&#xA;	c0.1,0.1,0.2,0.1,0.4,0.2c0.2,0,0.3,0,0.5,0c0.4,0,0.7-0.1,0.9-0.2c0.2-0.1,0.4-0.3,0.5-0.5c0.1-0.2,0.2-0.4,0.2-0.6&#xD;&#xA;	c0-0.2,0-0.4,0-0.5V8.2C8.8,8.3,8.7,8.3,8.6,8.4z M14.6,2v3.2h0c0.2-0.4,0.6-0.7,1-0.9C16,4.1,16.5,4,16.9,4c0.4,0,0.7,0.1,1.1,0.2&#xD;&#xA;	c0.4,0.2,0.7,0.4,1,0.7c0.3,0.3,0.5,0.8,0.7,1.3C19.9,6.8,20,7.4,20,8.1s-0.1,1.3-0.3,1.8c-0.2,0.5-0.4,0.9-0.7,1.3&#xD;&#xA;	c-0.3,0.3-0.6,0.6-1,0.7c-0.4,0.2-0.7,0.2-1.1,0.2c-0.5,0-1-0.1-1.5-0.3c-0.4-0.2-0.8-0.5-1-0.9h0v1h-1.9V2H14.6z M17.9,7.2&#xD;&#xA;	c-0.1-0.3-0.2-0.6-0.3-0.8C17.4,6.2,17.2,6,17,5.8c-0.2-0.1-0.5-0.2-0.8-0.2c-0.3,0-0.6,0.1-0.8,0.2c-0.2,0.1-0.4,0.3-0.5,0.5&#xD;&#xA;	c-0.1,0.2-0.2,0.5-0.3,0.8c-0.1,0.3-0.1,0.6-0.1,0.9c0,0.3,0,0.6,0.1,0.9c0.1,0.3,0.2,0.6,0.3,0.8c0.1,0.2,0.3,0.4,0.5,0.5&#xD;&#xA;	c0.2,0.1,0.5,0.2,0.8,0.2c0.3,0,0.6-0.1,0.8-0.2c0.2-0.1,0.4-0.3,0.5-0.5c0.1-0.2,0.2-0.5,0.3-0.8C17.9,8.8,18,8.4,18,8.1&#xD;&#xA;	C18,7.8,17.9,7.5,17.9,7.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 918)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black177_white { fill:#FFFFFF;}
	.Yellow177_white { fill:#FFFFFF;}
</style>
<path class="Black177_white" d="M28,24H10v2h18V24z M28,16H10v2h18V16z M16,20h-6v2h6V20z M31,4H7C6.5,4,6,4.5,6,5v26c0,0.5,0.5,1,1,1h24&#xD;&#xA;	c0.5,0,1-0.5,1-1V5C32,4.5,31.5,4,31,4z M30,30H8V6h22V30z" xmlns="http://www.w3.org/2000/svg" />
<path class="Yellow177_white" d="M28,22H18v-2h10V22z M24,13V1c0-0.6-0.5-1-1-1H1C0.4,0,0,0.4,0,1v12c0,0.6,0.4,1,1,1h22&#xD;&#xA;	C23.5,14,24,13.6,24,13z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black177_white" d="M4.6,5.4c0.2-0.3,0.5-0.6,0.8-0.8c0.3-0.2,0.7-0.3,1.1-0.4C6.9,4.1,7.3,4,7.7,4c0.4,0,0.7,0,1.1,0.1&#xD;&#xA;	c0.4,0.1,0.7,0.2,1,0.3c0.3,0.2,0.6,0.4,0.8,0.7S11,5.8,11,6.2v4c0,0.4,0,0.7,0.1,1c0,0.3,0.1,0.6,0.2,0.7H9.2&#xD;&#xA;	c0-0.1-0.1-0.2-0.1-0.4c0-0.1,0-0.3,0-0.4c-0.3,0.4-0.7,0.6-1.1,0.7c-0.4,0.1-0.9,0.2-1.3,0.2c-0.4,0-0.7,0-1-0.1S5,11.8,4.7,11.6&#xD;&#xA;	c-0.2-0.2-0.4-0.4-0.5-0.7C4.1,10.6,4,10.3,4,9.9c0-0.4,0.1-0.8,0.2-1.1c0.1-0.3,0.3-0.5,0.6-0.7C5,7.9,5.3,7.8,5.6,7.7&#xD;&#xA;	c0.3-0.1,0.6-0.2,0.9-0.2c0.3,0,0.6-0.1,0.9-0.1c0.3,0,0.6-0.1,0.8-0.1C8.4,7.2,8.6,7.1,8.7,7c0.1-0.1,0.2-0.3,0.2-0.5&#xD;&#xA;	c0-0.2,0-0.4-0.1-0.5C8.7,5.8,8.7,5.7,8.5,5.6S8.3,5.5,8.1,5.5c-0.2,0-0.3,0-0.5,0c-0.4,0-0.7,0.1-0.9,0.3C6.4,5.9,6.3,6.2,6.3,6.6&#xD;&#xA;	h-2C4.3,6.1,4.4,5.7,4.6,5.4z M8.6,8.4c-0.1,0-0.3,0.1-0.4,0.1C8,8.5,7.9,8.6,7.7,8.6c-0.2,0-0.3,0-0.5,0.1c-0.2,0-0.3,0.1-0.5,0.1&#xD;&#xA;	C6.6,8.8,6.5,8.9,6.4,9C6.3,9.1,6.2,9.2,6.1,9.3C6.1,9.4,6,9.6,6,9.8c0,0.2,0,0.4,0.1,0.5c0.1,0.1,0.2,0.2,0.3,0.3&#xD;&#xA;	c0.1,0.1,0.2,0.1,0.4,0.2c0.2,0,0.3,0,0.5,0c0.4,0,0.7-0.1,0.9-0.2c0.2-0.1,0.4-0.3,0.5-0.5c0.1-0.2,0.2-0.4,0.2-0.6&#xD;&#xA;	c0-0.2,0-0.4,0-0.5V8.2C8.8,8.3,8.7,8.3,8.6,8.4z M14.6,2v3.2h0c0.2-0.4,0.6-0.7,1-0.9C16,4.1,16.5,4,16.9,4c0.4,0,0.7,0.1,1.1,0.2&#xD;&#xA;	c0.4,0.2,0.7,0.4,1,0.7c0.3,0.3,0.5,0.8,0.7,1.3C19.9,6.8,20,7.4,20,8.1s-0.1,1.3-0.3,1.8c-0.2,0.5-0.4,0.9-0.7,1.3&#xD;&#xA;	c-0.3,0.3-0.6,0.6-1,0.7c-0.4,0.2-0.7,0.2-1.1,0.2c-0.5,0-1-0.1-1.5-0.3c-0.4-0.2-0.8-0.5-1-0.9h0v1h-1.9V2H14.6z M17.9,7.2&#xD;&#xA;	c-0.1-0.3-0.2-0.6-0.3-0.8C17.4,6.2,17.2,6,17,5.8c-0.2-0.1-0.5-0.2-0.8-0.2c-0.3,0-0.6,0.1-0.8,0.2c-0.2,0.1-0.4,0.3-0.5,0.5&#xD;&#xA;	c-0.1,0.2-0.2,0.5-0.3,0.8c-0.1,0.3-0.1,0.6-0.1,0.9c0,0.3,0,0.6,0.1,0.9c0.1,0.3,0.2,0.6,0.3,0.8c0.1,0.2,0.3,0.4,0.5,0.5&#xD;&#xA;	c0.2,0.1,0.5,0.2,0.8,0.2c0.3,0,0.6-0.1,0.8-0.2c0.2-0.1,0.4-0.3,0.5-0.5c0.1-0.2,0.2-0.5,0.3-0.8C17.9,8.8,18,8.4,18,8.1&#xD;&#xA;	C18,7.8,17.9,7.5,17.9,7.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow178 { fill:#979797;}
	.Black178 { fill:#727272;}
</style>
<path class="Yellow178" d="M12.1,21.3C12.2,21,15,14,22,14c1.5,0,2.9,0.3,4,0.9V7c0-0.6-0.4-1-1-1H3C2.4,6,2,6.4,2,7v14&#xD;&#xA;	c0,0.6,0.4,1,1,1h3v6l6-6h0C12,21.8,12,21.5,12.1,21.3z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black178" d="M22,16c5.7,0,8,6,8,6s-2.3,6-8,6c-5.7,0-8-6-8-6S16.3,16,22,16 M22,18c-3.3,0-5.1,2.7-5.8,4&#xD;&#xA;	c0.7,1.3,2.5,4,5.8,4c3.3,0,5.1-2.7,5.8-4C27.1,20.7,25.3,18,22,18L22,18z M22,20c-1.1,0-2,0.9-2,2s0.9,2,2,2c1.1,0,2-0.9,2-2&#xD;&#xA;	S23.1,20,22,20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 918)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow178_white { fill:#FFFFFF;}
	.Black178_white { fill:#FFFFFF;}
</style>
<path class="Yellow178_white" d="M12.1,21.3C12.2,21,15,14,22,14c1.5,0,2.9,0.3,4,0.9V7c0-0.6-0.4-1-1-1H3C2.4,6,2,6.4,2,7v14&#xD;&#xA;	c0,0.6,0.4,1,1,1h3v6l6-6h0C12,21.8,12,21.5,12.1,21.3z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black178_white" d="M22,16c5.7,0,8,6,8,6s-2.3,6-8,6c-5.7,0-8-6-8-6S16.3,16,22,16 M22,18c-3.3,0-5.1,2.7-5.8,4&#xD;&#xA;	c0.7,1.3,2.5,4,5.8,4c3.3,0,5.1-2.7,5.8-4C27.1,20.7,25.3,18,22,18L22,18z M22,20c-1.1,0-2,0.9-2,2s0.9,2,2,2c1.1,0,2-0.9,2-2&#xD;&#xA;	S23.1,20,22,20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black179 { fill:#727272;}
</style>
<path class="Black179" d="M14,4h-2h-2c-4.4,0-8,3.6-8,8s3.6,8,8,8h2v6v2h4V8h4v20h4V8h4V4H14z M10,16c-2.2,0-4-1.8-4-4s1.8-4,4-4h2v8&#xD;&#xA;	H10z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 782)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black179_white { fill:#FFFFFF;}
</style>
<path class="Black179_white" d="M14,4h-2h-2c-4.4,0-8,3.6-8,8s3.6,8,8,8h2v6v2h4V8h4v20h4V8h4V4H14z M10,16c-2.2,0-4-1.8-4-4s1.8-4,4-4h2v8&#xD;&#xA;	H10z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black180 { fill:#727272;}
	.Blue180 { fill:#757575;}
</style>
<path class="Black180" d="M24,8H6V6h18V8z M24,10H6v2h18V10z M24,14H6v2h18V14z M24,18H6v2h18V18z M24,22H6v2h18V22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue180" d="M2,0h4v2H2v4H0V0H2z M8,2h6V0H8V2z M16,2h6V0h-6V2z M24,0v2h4v4h2V2V0H24z M28,14h2V8h-2V14z M28,22h2v-6h-2&#xD;&#xA;	V22z M28,28h-4v2h4h2v-6h-2V28z M8,30h6v-2H8V30z M16,30h6v-2h-6V30z M2,8H0v6h2V8z M2,16H0v6h2V16z M2,24H0v4v2h6v-2H2V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 952)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black180_white { fill:#FFFFFF;}
	.Blue180_white { fill:#FFFFFF;}
</style>
<path class="Black180_white" d="M24,8H6V6h18V8z M24,10H6v2h18V10z M24,14H6v2h18V14z M24,18H6v2h18V18z M24,22H6v2h18V22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue180_white" d="M2,0h4v2H2v4H0V0H2z M8,2h6V0H8V2z M16,2h6V0h-6V2z M24,0v2h4v4h2V2V0H24z M28,14h2V8h-2V14z M28,22h2v-6h-2&#xD;&#xA;	V22z M28,28h-4v2h4h2v-6h-2V28z M8,30h6v-2H8V30z M16,30h6v-2h-6V30z M2,8H0v6h2V8z M2,16H0v6h2V16z M2,24H0v4v2h6v-2H2V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue181 { fill:#757575;}
	.Black181 { fill:#727272;}
</style>
<path class="Black181" d="M30,16H12v-2h18V16z M30,8H12v2h18V8z M30,20H12v2h18V20z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue181" d="M6,6h4l-5,5L0,6h4V0h2V6z M4,30h2v-6h4l-5-5l-5,5h4V30z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 918)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue181_white { fill:#FFFFFF;}
	.Black181_white { fill:#FFFFFF;}
</style>
<path class="Black181_white" d="M30,16H12v-2h18V16z M30,8H12v2h18V8z M30,20H12v2h18V20z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue181_white" d="M6,6h4l-5,5L0,6h4V0h2V6z M4,30h2v-6h4l-5-5l-5,5h4V30z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0182 {fill:#727272;}
</style>
<g id="SpellCheck" xmlns="http://www.w3.org/2000/svg">
	<polygon class="st0182" points="27,9 12,24 7,19 4,22 12,30 30,12 	" />
	<path class="st0182" d="M7.9,12H6l-0.6-1.8H2.6L2,12H0l3-8h2.1L7.9,12z M5,8.8L4.1,6.1C4.1,5.9,4,5.7,4,5.4l0,0c0,0.2-0.1,0.5-0.1,0.7&#xD;&#xA;		L3,8.8H5z M8.9,12V4h2.9c0.9,0,1.6,0.2,2.1,0.5s0.7,0.8,0.7,1.4c0,0.4-0.1,0.8-0.4,1.1c-0.3,0.3-0.7,0.5-1.1,0.7l0,0&#xD;&#xA;		c0.6,0.1,1,0.3,1.4,0.6C14.9,8.6,15,9.1,15,9.6c0,0.7-0.3,1.3-0.8,1.7C13.6,11.8,12.9,12,12,12H8.9z M10.7,5.3v1.9h0.8&#xD;&#xA;		c0.4,0,0.7-0.1,0.9-0.3s0.3-0.4,0.3-0.7c0-0.6-0.4-0.9-1.3-0.9H10.7z M10.7,8.6v2.1h1c0.4,0,0.7-0.1,1-0.3c0.2-0.2,0.4-0.5,0.4-0.8&#xD;&#xA;		S13,9,12.8,8.8s-0.6-0.3-1-0.3h-1.1V8.6z M22,11.7c-0.6,0.3-1.3,0.4-2.3,0.4c-1.2,0-2.2-0.4-2.9-1.1c-0.7-0.7-1.1-1.7-1.1-2.9&#xD;&#xA;		c0-1.3,0.4-2.3,1.2-3.1c0.8-0.8,1.8-1.2,3.1-1.2c0.8,0,1.4,0.1,2,0.3v1.7c-0.5-0.3-1.1-0.5-1.8-0.5c-0.8,0-1.4,0.2-1.8,0.7&#xD;&#xA;		c-0.5,0.5-0.7,1.1-0.7,1.9s0.2,1.4,0.7,1.8s1,0.7,1.8,0.7c0.7,0,1.3-0.2,1.9-0.5v1.8C22.1,11.7,22,11.7,22,11.7z" />
</g>
</g>

<g transform="translate(136, 748)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0182_white { fill:#FFFFFF;}
</style>
<g id="SpellCheck" xmlns="http://www.w3.org/2000/svg">
	<polygon class="st0182_white" points="27,9 12,24 7,19 4,22 12,30 30,12 	" />
	<path class="st0182_white" d="M7.9,12H6l-0.6-1.8H2.6L2,12H0l3-8h2.1L7.9,12z M5,8.8L4.1,6.1C4.1,5.9,4,5.7,4,5.4l0,0c0,0.2-0.1,0.5-0.1,0.7&#xD;&#xA;		L3,8.8H5z M8.9,12V4h2.9c0.9,0,1.6,0.2,2.1,0.5s0.7,0.8,0.7,1.4c0,0.4-0.1,0.8-0.4,1.1c-0.3,0.3-0.7,0.5-1.1,0.7l0,0&#xD;&#xA;		c0.6,0.1,1,0.3,1.4,0.6C14.9,8.6,15,9.1,15,9.6c0,0.7-0.3,1.3-0.8,1.7C13.6,11.8,12.9,12,12,12H8.9z M10.7,5.3v1.9h0.8&#xD;&#xA;		c0.4,0,0.7-0.1,0.9-0.3s0.3-0.4,0.3-0.7c0-0.6-0.4-0.9-1.3-0.9H10.7z M10.7,8.6v2.1h1c0.4,0,0.7-0.1,1-0.3c0.2-0.2,0.4-0.5,0.4-0.8&#xD;&#xA;		S13,9,12.8,8.8s-0.6-0.3-1-0.3h-1.1V8.6z M22,11.7c-0.6,0.3-1.3,0.4-2.3,0.4c-1.2,0-2.2-0.4-2.9-1.1c-0.7-0.7-1.1-1.7-1.1-2.9&#xD;&#xA;		c0-1.3,0.4-2.3,1.2-3.1c0.8-0.8,1.8-1.2,3.1-1.2c0.8,0,1.4,0.1,2,0.3v1.7c-0.5-0.3-1.1-0.5-1.8-0.5c-0.8,0-1.4,0.2-1.8,0.7&#xD;&#xA;		c-0.5,0.5-0.7,1.1-0.7,1.9s0.2,1.4,0.7,1.8s1,0.7,1.8,0.7c0.7,0,1.3-0.2,1.9-0.5v1.8C22.1,11.7,22,11.7,22,11.7z" />
</g>
</g>

<g transform="translate(102, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black183 { fill:#727272;}
	.Red183 { fill:#585858;}
</style>
<path class="Red183" d="M32,24c-1.4,0-2.2-0.7-2.7-1.3C28.8,22.2,28.6,22,28,22s-0.8,0.2-1.3,0.7C26.2,23.3,25.4,24,24,24&#xD;&#xA;	s-2.2-0.7-2.7-1.3C20.8,22.2,20.6,22,20,22s-0.8,0.2-1.3,0.7C18.2,23.3,17.4,24,16,24s-2.2-0.7-2.7-1.3C12.8,22.2,12.6,22,12,22&#xD;&#xA;	s-0.8,0.2-1.3,0.7C10.2,23.3,9.4,24,8,24s-2.2-0.7-2.7-1.3C4.8,22.2,4.6,22,4,22s-0.8,0.2-1.3,0.7C2.2,23.3,1.4,24,0,24v-2&#xD;&#xA;	c0.6,0,0.8-0.2,1.3-0.7C1.8,20.7,2.6,20,4,20s2.2,0.7,2.7,1.3C7.2,21.8,7.4,22,8,22s0.8-0.2,1.3-0.7C9.8,20.7,10.6,20,12,20&#xD;&#xA;	s2.2,0.7,2.7,1.3c0.5,0.5,0.7,0.7,1.3,0.7s0.8-0.2,1.3-0.7c0.5-0.5,1.3-1.3,2.7-1.3s2.2,0.7,2.7,1.3c0.5,0.5,0.7,0.7,1.3,0.7&#xD;&#xA;	s0.8-0.2,1.3-0.7c0.5-0.5,1.3-1.3,2.7-1.3s2.2,0.7,2.7,1.3c0.5,0.5,0.7,0.7,1.3,0.7V24z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black183" d="M12.1,18H9.6l-0.7-2.2H5.2L4.5,18H2L5.7,8h2.7L12.1,18z M8.3,14l-1.1-3.3C7.1,10.4,7.1,10.1,7,9.8H7&#xD;&#xA;	c0,0.3-0.1,0.6-0.2,0.9L5.7,14H8.3z M13.3,18l0-10h3.7c1.1,0,2,0.2,2.6,0.6c0.6,0.4,0.9,1,0.9,1.7c0,0.5-0.2,1-0.6,1.4&#xD;&#xA;	c-0.4,0.4-0.8,0.7-1.4,0.8v0c0.7,0.1,1.3,0.3,1.7,0.8c0.4,0.4,0.7,1,0.7,1.6c0,0.9-0.3,1.6-1,2.2c-0.7,0.5-1.6,0.8-2.7,0.8H13.3z&#xD;&#xA;	 M15.6,9.7V12h1c0.5,0,0.8-0.1,1.1-0.3c0.3-0.2,0.4-0.5,0.4-0.9c0-0.7-0.6-1.1-1.7-1.1H15.6z M15.6,13.7v2.6h1.2&#xD;&#xA;	c0.5,0,0.9-0.1,1.2-0.4c0.3-0.2,0.5-0.6,0.5-1c0-0.4-0.1-0.7-0.4-0.9c-0.3-0.2-0.7-0.3-1.2-0.3H15.6z M30,17.6&#xD;&#xA;	c-0.7,0.4-1.7,0.5-2.9,0.5c-1.6,0-2.8-0.4-3.7-1.3c-0.9-0.9-1.3-2.1-1.3-3.6c0-1.6,0.5-2.9,1.5-3.9c1-1,2.3-1.5,3.9-1.5&#xD;&#xA;	c1,0,1.8,0.1,2.5,0.4v2.2c-0.7-0.4-1.5-0.6-2.3-0.6c-1,0-1.7,0.3-2.3,0.9c-0.6,0.6-0.9,1.4-0.9,2.4c0,1,0.3,1.7,0.8,2.3&#xD;&#xA;	c0.6,0.6,1.3,0.9,2.2,0.9c0.9,0,1.7-0.2,2.5-0.6V17.6z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 748)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black183_white { fill:#FFFFFF;}
	.Red183_white { fill:#FFFFFF;}
</style>
<path class="Red183_white" d="M32,24c-1.4,0-2.2-0.7-2.7-1.3C28.8,22.2,28.6,22,28,22s-0.8,0.2-1.3,0.7C26.2,23.3,25.4,24,24,24&#xD;&#xA;	s-2.2-0.7-2.7-1.3C20.8,22.2,20.6,22,20,22s-0.8,0.2-1.3,0.7C18.2,23.3,17.4,24,16,24s-2.2-0.7-2.7-1.3C12.8,22.2,12.6,22,12,22&#xD;&#xA;	s-0.8,0.2-1.3,0.7C10.2,23.3,9.4,24,8,24s-2.2-0.7-2.7-1.3C4.8,22.2,4.6,22,4,22s-0.8,0.2-1.3,0.7C2.2,23.3,1.4,24,0,24v-2&#xD;&#xA;	c0.6,0,0.8-0.2,1.3-0.7C1.8,20.7,2.6,20,4,20s2.2,0.7,2.7,1.3C7.2,21.8,7.4,22,8,22s0.8-0.2,1.3-0.7C9.8,20.7,10.6,20,12,20&#xD;&#xA;	s2.2,0.7,2.7,1.3c0.5,0.5,0.7,0.7,1.3,0.7s0.8-0.2,1.3-0.7c0.5-0.5,1.3-1.3,2.7-1.3s2.2,0.7,2.7,1.3c0.5,0.5,0.7,0.7,1.3,0.7&#xD;&#xA;	s0.8-0.2,1.3-0.7c0.5-0.5,1.3-1.3,2.7-1.3s2.2,0.7,2.7,1.3c0.5,0.5,0.7,0.7,1.3,0.7V24z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black183_white" d="M12.1,18H9.6l-0.7-2.2H5.2L4.5,18H2L5.7,8h2.7L12.1,18z M8.3,14l-1.1-3.3C7.1,10.4,7.1,10.1,7,9.8H7&#xD;&#xA;	c0,0.3-0.1,0.6-0.2,0.9L5.7,14H8.3z M13.3,18l0-10h3.7c1.1,0,2,0.2,2.6,0.6c0.6,0.4,0.9,1,0.9,1.7c0,0.5-0.2,1-0.6,1.4&#xD;&#xA;	c-0.4,0.4-0.8,0.7-1.4,0.8v0c0.7,0.1,1.3,0.3,1.7,0.8c0.4,0.4,0.7,1,0.7,1.6c0,0.9-0.3,1.6-1,2.2c-0.7,0.5-1.6,0.8-2.7,0.8H13.3z&#xD;&#xA;	 M15.6,9.7V12h1c0.5,0,0.8-0.1,1.1-0.3c0.3-0.2,0.4-0.5,0.4-0.9c0-0.7-0.6-1.1-1.7-1.1H15.6z M15.6,13.7v2.6h1.2&#xD;&#xA;	c0.5,0,0.9-0.1,1.2-0.4c0.3-0.2,0.5-0.6,0.5-1c0-0.4-0.1-0.7-0.4-0.9c-0.3-0.2-0.7-0.3-1.2-0.3H15.6z M30,17.6&#xD;&#xA;	c-0.7,0.4-1.7,0.5-2.9,0.5c-1.6,0-2.8-0.4-3.7-1.3c-0.9-0.9-1.3-2.1-1.3-3.6c0-1.6,0.5-2.9,1.5-3.9c1-1,2.3-1.5,3.9-1.5&#xD;&#xA;	c1,0,1.8,0.1,2.5,0.4v2.2c-0.7-0.4-1.5-0.6-2.3-0.6c-1,0-1.7,0.3-2.3,0.9c-0.6,0.6-0.9,1.4-0.9,2.4c0,1,0.3,1.7,0.8,2.3&#xD;&#xA;	c0.6,0.6,1.3,0.9,2.2,0.9c0.9,0,1.7-0.2,2.5-0.6V17.6z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black184 {fill:#727272;}
	.st0184 {opacity:0.5;}
</style>
<g id="SplitTable_1_" class="st0184" xmlns="http://www.w3.org/2000/svg">
	<path class="Black184" d="M10,8H2v6h8V8z M20,8h-8v6h8V8z M30,8h-8v6h8V8z M10,0H2v6h8V0z M20,0h-8v6h8V0z M30,0h-8v6h8V0z M30,18h-8&#xD;&#xA;		v6h8V18z M20,18h-8v6h8V18z M10,18H2v6h8V18z M10,26H2v6h8V26z M20,26h-8v6h8V26z M30,26h-8v6h8V26z" />
</g>
</g>

<g transform="translate(340, 850)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black184_white { fill:#FFFFFF;}
	.st0184_white {opacity:0.5;}
</style>
<g id="SplitTable_1_" class="st0184_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black184_white" d="M10,8H2v6h8V8z M20,8h-8v6h8V8z M30,8h-8v6h8V8z M10,0H2v6h8V0z M20,0h-8v6h8V0z M30,0h-8v6h8V0z M30,18h-8&#xD;&#xA;		v6h8V18z M20,18h-8v6h8V18z M10,18H2v6h8V18z M10,26H2v6h8V26z M20,26h-8v6h8V26z M30,26h-8v6h8V26z" />
</g>
</g>

<g transform="translate(68, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black185 { fill:#727272;}
	.Green185 { fill:#404040;}
	.st0185 {opacity:0.5;}
</style>
<g class="st0185" xmlns="http://www.w3.org/2000/svg">
	<path class="Black185" d="M10,6H2V0h8V6z M20,0h-8v6h8V0z M30,0h-8v6h8V0z M10,8H2v6h8V8z M10,16H2v6h8V16z M10,24H2v6h8V24z M20,24&#xD;&#xA;		h-8v6h8V24z M30,24h-8v6h8V24z" />
</g>
<path class="Green185" d="M20,14h-8V8h8V14z M30,8h-8v6h8V8z M30,16h-8v6h8V16z M20,16h-8v6h8V16z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 782)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black185_white { fill:#FFFFFF;}
	.Green185_white { fill:#FFFFFF;}
	.st0185_white {opacity:0.5;}
</style>
<g class="st0185_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black185_white" d="M10,6H2V0h8V6z M20,0h-8v6h8V0z M30,0h-8v6h8V0z M10,8H2v6h8V8z M10,16H2v6h8V16z M10,24H2v6h8V24z M20,24&#xD;&#xA;		h-8v6h8V24z M30,24h-8v6h8V24z" />
</g>
<path class="Green185_white" d="M20,14h-8V8h8V14z M30,8h-8v6h8V8z M30,16h-8v6h8V16z M20,16h-8v6h8V16z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow186 {fill:#FFB115;}
	.Red186 {fill:#D11C1C;}
	.Blue186 {fill:#1177D7;}
	.Green186 {fill:#039C23;}
	.Black186 {fill:#727272;}
	.White186 {fill:#FFFFFF;}
	.st0186 {opacity:0.5;}
	.st1186 {display:none;}
	.st2186 {display:inline;fill:#039C23;}
	.st3186 {display:inline;fill:#D11C1C;}
	.st4186 {display:inline;fill:#727272;}
</style>
<g id="Strikeout" xmlns="http://www.w3.org/2000/svg">
	<path class="Black186" d="M24,14h-7c-0.2-0.1-0.4-0.2-0.7-0.4c-0.7-0.3-1.4-0.6-2-0.9c-0.6-0.3-1-0.6-1.4-0.8c-0.4-0.3-0.7-0.6-0.9-1&#xD;&#xA;		s-0.3-0.8-0.3-1.2c0-0.5,0.1-0.9,0.4-1.3c0.3-0.4,0.6-0.6,1-0.9c0.4-0.2,0.9-0.4,1.4-0.5c0.5-0.1,1.1-0.1,1.6-0.1&#xD;&#xA;		c1.9,0,3.5,0.4,4.8,1.3V4.8c-1-0.5-2.7-0.8-5-0.8c-1,0-2,0.1-3,0.3c-1,0.2-1.8,0.6-2.6,1.1C9.8,5.9,9.2,6.5,8.7,7.2S8,8.8,8,9.8&#xD;&#xA;		c0,0.8,0.1,1.5,0.4,2.1c0.3,0.6,0.6,1.1,1.1,1.6c0.1,0.1,0.3,0.3,0.5,0.4H6v2h7.1c0.1,0,0.1,0.1,0.2,0.1c0.7,0.3,1.3,0.6,1.9,0.9&#xD;&#xA;		c0.6,0.3,1.1,0.6,1.6,0.9c0.4,0.3,0.8,0.6,1,1c0.2,0.4,0.4,0.8,0.4,1.3c0,0.9-0.4,1.7-1.1,2.2c-0.7,0.5-1.9,0.7-3.4,0.7&#xD;&#xA;		c-0.4,0-0.9,0-1.4-0.1s-1-0.2-1.6-0.4c-0.5-0.2-1-0.4-1.5-0.6c-0.5-0.2-0.9-0.5-1.2-0.8v3.6c0.3,0.2,0.7,0.4,1.2,0.5&#xD;&#xA;		c0.5,0.1,1,0.3,1.6,0.4c0.6,0.1,1.1,0.2,1.6,0.2c0.5,0.1,1,0.1,1.3,0.1c1.1,0,2.1-0.1,3.1-0.3s1.9-0.5,2.6-1&#xD;&#xA;		c0.8-0.5,1.4-1.1,1.8-1.8s0.7-1.7,0.7-2.7c0-0.8-0.2-1.5-0.4-2.1c-0.3-0.6-0.7-1.2-1.2-1.7c-0.1-0.1-0.2-0.2-0.3-0.3h4V14z" />
</g>
</g>

<g transform="translate(204, 714)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow186_white { fill:#FFFFFF;}
	.Red186_white { fill:#FFFFFF;}
	.Blue186_white { fill:#FFFFFF;}
	.Green186_white { fill:#FFFFFF;}
	.Black186_white { fill:#FFFFFF;}
	.White186_white { fill:#FFFFFF;}
	.st0186_white {opacity:0.5;}
	.st1186_white {display:none;}
	.st2186_white { fill:#FFFFFF;}
	.st3186_white { fill:#FFFFFF;}
	.st4186_white { fill:#FFFFFF;}
</style>
<g id="Strikeout" xmlns="http://www.w3.org/2000/svg">
	<path class="Black186_white" d="M24,14h-7c-0.2-0.1-0.4-0.2-0.7-0.4c-0.7-0.3-1.4-0.6-2-0.9c-0.6-0.3-1-0.6-1.4-0.8c-0.4-0.3-0.7-0.6-0.9-1&#xD;&#xA;		s-0.3-0.8-0.3-1.2c0-0.5,0.1-0.9,0.4-1.3c0.3-0.4,0.6-0.6,1-0.9c0.4-0.2,0.9-0.4,1.4-0.5c0.5-0.1,1.1-0.1,1.6-0.1&#xD;&#xA;		c1.9,0,3.5,0.4,4.8,1.3V4.8c-1-0.5-2.7-0.8-5-0.8c-1,0-2,0.1-3,0.3c-1,0.2-1.8,0.6-2.6,1.1C9.8,5.9,9.2,6.5,8.7,7.2S8,8.8,8,9.8&#xD;&#xA;		c0,0.8,0.1,1.5,0.4,2.1c0.3,0.6,0.6,1.1,1.1,1.6c0.1,0.1,0.3,0.3,0.5,0.4H6v2h7.1c0.1,0,0.1,0.1,0.2,0.1c0.7,0.3,1.3,0.6,1.9,0.9&#xD;&#xA;		c0.6,0.3,1.1,0.6,1.6,0.9c0.4,0.3,0.8,0.6,1,1c0.2,0.4,0.4,0.8,0.4,1.3c0,0.9-0.4,1.7-1.1,2.2c-0.7,0.5-1.9,0.7-3.4,0.7&#xD;&#xA;		c-0.4,0-0.9,0-1.4-0.1s-1-0.2-1.6-0.4c-0.5-0.2-1-0.4-1.5-0.6c-0.5-0.2-0.9-0.5-1.2-0.8v3.6c0.3,0.2,0.7,0.4,1.2,0.5&#xD;&#xA;		c0.5,0.1,1,0.3,1.6,0.4c0.6,0.1,1.1,0.2,1.6,0.2c0.5,0.1,1,0.1,1.3,0.1c1.1,0,2.1-0.1,3.1-0.3s1.9-0.5,2.6-1&#xD;&#xA;		c0.8-0.5,1.4-1.1,1.8-1.8s0.7-1.7,0.7-2.7c0-0.8-0.2-1.5-0.4-2.1c-0.3-0.6-0.7-1.2-1.2-1.7c-0.1-0.1-0.2-0.2-0.3-0.3h4V14z" />
</g>
</g>

<g transform="translate(68, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow187 { fill:#979797;}
	.Red187 { fill:#585858;}
	.Blue187 { fill:#757575;}
	.Green187 { fill:#404040;}
	.Black187 { fill:#727272;}
	.White187 { fill:#FFFFFF;}
	.st0187 {opacity:0.5;}
	.st1187 {display:none;}
	.st2187 { fill:#404040;}
	.st3187 { fill:#585858;}
	.st4187 { fill:#727272;}
</style>
<g id="StrikeoutDouble" xmlns="http://www.w3.org/2000/svg">
	<path class="Black187" d="M24,14h-7c0.5,0.3,1,0.6,1.5,0.9c0.5,0.3,1,0.7,1.5,1.1h4v2h-2.4c0.3,0.6,0.4,1.3,0.4,2.1&#xD;&#xA;		c0,1.1-0.2,2-0.7,2.7s-1,1.3-1.8,1.8c-0.8,0.5-1.6,0.8-2.6,1s-2,0.3-3.1,0.3c-0.4,0-0.8,0-1.3-0.1c-0.5-0.1-1.1-0.1-1.6-0.2&#xD;&#xA;		c-0.6-0.1-1.1-0.2-1.6-0.4C8.7,25.2,8.3,25,8,24.8v-3.6c0.3,0.3,0.7,0.6,1.2,0.8c0.5,0.2,1,0.4,1.5,0.6c0.5,0.2,1,0.3,1.6,0.4&#xD;&#xA;		s1,0.1,1.4,0.1c1.5,0,2.7-0.2,3.4-0.7c0.7-0.5,1.1-1.2,1.1-2.2c0-0.5-0.1-0.9-0.4-1.3c-0.2-0.3-0.5-0.6-0.9-0.9H6v-2h7.1&#xD;&#xA;		c-0.7-0.4-1.3-0.7-1.9-1.1c-0.5-0.3-0.8-0.6-1.2-0.9H6v-2h2.4c0,0,0,0,0,0C8.1,11.4,8,10.7,8,9.8c0-1,0.2-1.9,0.7-2.6&#xD;&#xA;		s1.1-1.3,1.8-1.8c0.8-0.5,1.6-0.8,2.6-1.1c1-0.2,1.9-0.3,3-0.3c2.3,0,4,0.3,5,0.8v3.5c-1.2-0.9-2.8-1.3-4.8-1.3&#xD;&#xA;		c-0.5,0-1.1,0-1.6,0.1c-0.5,0.1-1,0.3-1.4,0.5c-0.4,0.2-0.8,0.5-1,0.9c-0.3,0.4-0.4,0.8-0.4,1.3c0,0.5,0.1,0.9,0.3,1.2&#xD;&#xA;		s0.5,0.7,0.9,1c0,0,0.1,0,0.1,0.1H24V14z" />
</g>
</g>

<g transform="translate(68, 918)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow187_white { fill:#FFFFFF;}
	.Red187_white { fill:#FFFFFF;}
	.Blue187_white { fill:#FFFFFF;}
	.Green187_white { fill:#FFFFFF;}
	.Black187_white { fill:#FFFFFF;}
	.White187_white { fill:#FFFFFF;}
	.st0187_white {opacity:0.5;}
	.st1187_white {display:none;}
	.st2187_white { fill:#FFFFFF;}
	.st3187_white { fill:#FFFFFF;}
	.st4187_white { fill:#FFFFFF;}
</style>
<g id="StrikeoutDouble" xmlns="http://www.w3.org/2000/svg">
	<path class="Black187_white" d="M24,14h-7c0.5,0.3,1,0.6,1.5,0.9c0.5,0.3,1,0.7,1.5,1.1h4v2h-2.4c0.3,0.6,0.4,1.3,0.4,2.1&#xD;&#xA;		c0,1.1-0.2,2-0.7,2.7s-1,1.3-1.8,1.8c-0.8,0.5-1.6,0.8-2.6,1s-2,0.3-3.1,0.3c-0.4,0-0.8,0-1.3-0.1c-0.5-0.1-1.1-0.1-1.6-0.2&#xD;&#xA;		c-0.6-0.1-1.1-0.2-1.6-0.4C8.7,25.2,8.3,25,8,24.8v-3.6c0.3,0.3,0.7,0.6,1.2,0.8c0.5,0.2,1,0.4,1.5,0.6c0.5,0.2,1,0.3,1.6,0.4&#xD;&#xA;		s1,0.1,1.4,0.1c1.5,0,2.7-0.2,3.4-0.7c0.7-0.5,1.1-1.2,1.1-2.2c0-0.5-0.1-0.9-0.4-1.3c-0.2-0.3-0.5-0.6-0.9-0.9H6v-2h7.1&#xD;&#xA;		c-0.7-0.4-1.3-0.7-1.9-1.1c-0.5-0.3-0.8-0.6-1.2-0.9H6v-2h2.4c0,0,0,0,0,0C8.1,11.4,8,10.7,8,9.8c0-1,0.2-1.9,0.7-2.6&#xD;&#xA;		s1.1-1.3,1.8-1.8c0.8-0.5,1.6-0.8,2.6-1.1c1-0.2,1.9-0.3,3-0.3c2.3,0,4,0.3,5,0.8v3.5c-1.2-0.9-2.8-1.3-4.8-1.3&#xD;&#xA;		c-0.5,0-1.1,0-1.6,0.1c-0.5,0.1-1,0.3-1.4,0.5c-0.4,0.2-0.8,0.5-1,0.9c-0.3,0.4-0.4,0.8-0.4,1.3c0,0.5,0.1,0.9,0.3,1.2&#xD;&#xA;		s0.5,0.7,0.9,1c0,0,0.1,0,0.1,0.1H24V14z" />
</g>
</g>

<g transform="translate(374, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow188 { fill:#979797;}
	.Red188 { fill:#585858;}
	.Blue188 { fill:#757575;}
	.Green188 { fill:#404040;}
	.Black188 { fill:#727272;}
	.White188 { fill:#FFFFFF;}
	.st0188 {opacity:0.5;}
	.st1188 {display:none;}
	.st2188 { fill:#404040;}
	.st3188 { fill:#585858;}
	.st4188 { fill:#727272;}
</style>
<g id="Subscript" xmlns="http://www.w3.org/2000/svg">
	<path class="Black188" d="M2.6,6H8l4.1,7l4.3-7h5.1l-6.8,10.5L22,28h-5.5l-4.6-7.6L7.2,28H2l7.3-11.5L2.6,6z" />
	<path class="Red188" d="M27.4,30.3c0.2-0.3,0.5-0.6,0.8-0.9s0.6-0.5,1-0.7s0.7-0.4,1-0.7s0.6-0.5,0.9-0.7c0.3-0.3,0.5-0.6,0.6-0.9&#xD;&#xA;		c0.2-0.4,0.2-0.8,0.2-1.3c0-0.5-0.1-0.9-0.3-1.3c-0.2-0.4-0.4-0.7-0.7-1c-0.3-0.3-0.7-0.5-1.1-0.6C29.5,22.1,29,22,28.6,22&#xD;&#xA;		c-0.6,0-1.1,0.1-1.6,0.3c-0.5,0.2-0.8,0.5-1.1,0.8c-0.3,0.4-0.5,0.8-0.7,1.3S25,25.4,25,26l0,0h1.9l0,0c0-0.3,0-0.5,0.1-0.8&#xD;&#xA;		c0.1-0.3,0.1-0.5,0.3-0.7c0.1-0.2,0.3-0.4,0.5-0.5c0.2-0.1,0.4-0.2,0.7-0.2c0.4,0,0.8,0.1,1.1,0.4c0.3,0.3,0.4,0.6,0.4,1.1&#xD;&#xA;		c0,0.3-0.1,0.6-0.2,0.8c-0.1,0.2-0.3,0.4-0.5,0.6c-0.2,0.2-0.4,0.4-0.7,0.5c-0.2,0.2-0.5,0.3-0.7,0.5c-0.4,0.3-0.8,0.6-1.2,0.9&#xD;&#xA;		c-0.4,0.3-0.7,0.6-1,0.9c-0.3,0.3-0.5,0.7-0.7,1.1s-0.2,0.9-0.2,1.5H32v-1.7H27.4z" />
</g>
</g>

<g transform="translate(374, 850)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow188_white { fill:#FFFFFF;}
	.Red188_white { fill:#FFFFFF;}
	.Blue188_white { fill:#FFFFFF;}
	.Green188_white { fill:#FFFFFF;}
	.Black188_white { fill:#FFFFFF;}
	.White188_white { fill:#FFFFFF;}
	.st0188_white {opacity:0.5;}
	.st1188_white {display:none;}
	.st2188_white { fill:#FFFFFF;}
	.st3188_white { fill:#FFFFFF;}
	.st4188_white { fill:#FFFFFF;}
</style>
<g id="Subscript" xmlns="http://www.w3.org/2000/svg">
	<path class="Black188_white" d="M2.6,6H8l4.1,7l4.3-7h5.1l-6.8,10.5L22,28h-5.5l-4.6-7.6L7.2,28H2l7.3-11.5L2.6,6z" />
	<path class="Red188_white" d="M27.4,30.3c0.2-0.3,0.5-0.6,0.8-0.9s0.6-0.5,1-0.7s0.7-0.4,1-0.7s0.6-0.5,0.9-0.7c0.3-0.3,0.5-0.6,0.6-0.9&#xD;&#xA;		c0.2-0.4,0.2-0.8,0.2-1.3c0-0.5-0.1-0.9-0.3-1.3c-0.2-0.4-0.4-0.7-0.7-1c-0.3-0.3-0.7-0.5-1.1-0.6C29.5,22.1,29,22,28.6,22&#xD;&#xA;		c-0.6,0-1.1,0.1-1.6,0.3c-0.5,0.2-0.8,0.5-1.1,0.8c-0.3,0.4-0.5,0.8-0.7,1.3S25,25.4,25,26l0,0h1.9l0,0c0-0.3,0-0.5,0.1-0.8&#xD;&#xA;		c0.1-0.3,0.1-0.5,0.3-0.7c0.1-0.2,0.3-0.4,0.5-0.5c0.2-0.1,0.4-0.2,0.7-0.2c0.4,0,0.8,0.1,1.1,0.4c0.3,0.3,0.4,0.6,0.4,1.1&#xD;&#xA;		c0,0.3-0.1,0.6-0.2,0.8c-0.1,0.2-0.3,0.4-0.5,0.6c-0.2,0.2-0.4,0.4-0.7,0.5c-0.2,0.2-0.5,0.3-0.7,0.5c-0.4,0.3-0.8,0.6-1.2,0.9&#xD;&#xA;		c-0.4,0.3-0.7,0.6-1,0.9c-0.3,0.3-0.5,0.7-0.7,1.1s-0.2,0.9-0.2,1.5H32v-1.7H27.4z" />
</g>
</g>

<g transform="translate(238, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow189 { fill:#979797;}
	.Red189 { fill:#585858;}
	.Blue189 { fill:#757575;}
	.Green189 { fill:#404040;}
	.Black189 { fill:#727272;}
	.White189 { fill:#FFFFFF;}
	.st0189 {opacity:0.5;}
	.st1189 {display:none;}
	.st2189 { fill:#404040;}
	.st3189 { fill:#585858;}
	.st4189 { fill:#727272;}
</style>
<g id="Superscript" xmlns="http://www.w3.org/2000/svg">
	<path class="Black189" d="M2.6,6H8l4.1,7l4.3-7h5.1l-6.8,10.5L22,28h-5.5l-4.6-7.6L7.2,28H2l7.3-11.5L2.6,6z" />
	<path class="Red189" d="M27.4,8.3c0.2-0.3,0.5-0.6,0.8-0.9s0.6-0.5,1-0.7s0.7-0.4,1-0.7s0.6-0.5,0.9-0.7c0.3-0.3,0.5-0.6,0.6-0.9&#xD;&#xA;		c0.2-0.4,0.2-0.8,0.2-1.3c0-0.5-0.1-0.9-0.3-1.3c-0.2-0.4-0.4-0.7-0.7-1c-0.3-0.3-0.7-0.5-1.1-0.6C29.5,0.1,29,0,28.6,0&#xD;&#xA;		C28,0,27.5,0.1,27,0.3c-0.5,0.2-0.8,0.5-1.1,0.8c-0.3,0.4-0.5,0.8-0.7,1.3S25,3.4,25,4l0,0h1.9l0,0c0-0.3,0-0.5,0.1-0.8&#xD;&#xA;		c0.1-0.3,0.1-0.5,0.3-0.7c0.1-0.2,0.3-0.4,0.5-0.5c0.2-0.1,0.4-0.2,0.7-0.2c0.4,0,0.8,0.1,1.1,0.4C29.8,2.4,30,2.7,30,3.2&#xD;&#xA;		c0,0.3-0.1,0.6-0.2,0.8c-0.1,0.2-0.3,0.4-0.5,0.6C29,4.8,28.8,5,28.6,5.2c-0.2,0.2-0.5,0.3-0.7,0.5c-0.4,0.3-0.8,0.6-1.2,0.9&#xD;&#xA;		c-0.4,0.3-0.7,0.6-1,0.9c-0.3,0.3-0.5,0.7-0.7,1.1s-0.2,0.9-0.2,1.5H32V8.3H27.4z" />
</g>
</g>

<g transform="translate(238, 646)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow189_white { fill:#FFFFFF;}
	.Red189_white { fill:#FFFFFF;}
	.Blue189_white { fill:#FFFFFF;}
	.Green189_white { fill:#FFFFFF;}
	.Black189_white { fill:#FFFFFF;}
	.White189_white { fill:#FFFFFF;}
	.st0189_white {opacity:0.5;}
	.st1189_white {display:none;}
	.st2189_white { fill:#FFFFFF;}
	.st3189_white { fill:#FFFFFF;}
	.st4189_white { fill:#FFFFFF;}
</style>
<g id="Superscript" xmlns="http://www.w3.org/2000/svg">
	<path class="Black189_white" d="M2.6,6H8l4.1,7l4.3-7h5.1l-6.8,10.5L22,28h-5.5l-4.6-7.6L7.2,28H2l7.3-11.5L2.6,6z" />
	<path class="Red189_white" d="M27.4,8.3c0.2-0.3,0.5-0.6,0.8-0.9s0.6-0.5,1-0.7s0.7-0.4,1-0.7s0.6-0.5,0.9-0.7c0.3-0.3,0.5-0.6,0.6-0.9&#xD;&#xA;		c0.2-0.4,0.2-0.8,0.2-1.3c0-0.5-0.1-0.9-0.3-1.3c-0.2-0.4-0.4-0.7-0.7-1c-0.3-0.3-0.7-0.5-1.1-0.6C29.5,0.1,29,0,28.6,0&#xD;&#xA;		C28,0,27.5,0.1,27,0.3c-0.5,0.2-0.8,0.5-1.1,0.8c-0.3,0.4-0.5,0.8-0.7,1.3S25,3.4,25,4l0,0h1.9l0,0c0-0.3,0-0.5,0.1-0.8&#xD;&#xA;		c0.1-0.3,0.1-0.5,0.3-0.7c0.1-0.2,0.3-0.4,0.5-0.5c0.2-0.1,0.4-0.2,0.7-0.2c0.4,0,0.8,0.1,1.1,0.4C29.8,2.4,30,2.7,30,3.2&#xD;&#xA;		c0,0.3-0.1,0.6-0.2,0.8c-0.1,0.2-0.3,0.4-0.5,0.6C29,4.8,28.8,5,28.6,5.2c-0.2,0.2-0.5,0.3-0.7,0.5c-0.4,0.3-0.8,0.6-1.2,0.9&#xD;&#xA;		c-0.4,0.3-0.7,0.6-1,0.9c-0.3,0.3-0.5,0.7-0.7,1.1s-0.2,0.9-0.2,1.5H32V8.3H27.4z" />
</g>
</g>

<g transform="translate(272, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue190 { fill:#757575;}
</style>
<path class="Blue190" d="M28,14c0-6.6-5.4-12-12-12C9.4,2,4,7.4,4,14c0,2.9,2.3,6.7,4.8,10H4v4h8.2H14v-4v-0.1c-2.4-2.6-6-7-6-9.9&#xD;&#xA;	c0-4.4,3.6-8,8-8c4.4,0,8,3.6,8,8c0,3-3.6,7.4-6,9.9V24v4h1.8H28v-4h-4.8C25.7,20.7,28,16.9,28,14z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 646)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue190_white { fill:#FFFFFF;}
</style>
<path class="Blue190_white" d="M28,14c0-6.6-5.4-12-12-12C9.4,2,4,7.4,4,14c0,2.9,2.3,6.7,4.8,10H4v4h8.2H14v-4v-0.1c-2.4-2.6-6-7-6-9.9&#xD;&#xA;	c0-4.4,3.6-8,8-8c4.4,0,8,3.6,8,8c0,3-3.6,7.4-6,9.9V24v4h1.8H28v-4h-4.8C25.7,20.7,28,16.9,28,14z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black191 { fill:#727272;}
	.Blue191 { fill:#757575;}
	.st0191 {opacity:0.5;}
</style>
<path class="Blue191" d="M10,22H2v-6h8V22z M20,16h-8v6h8V16z M30,16h-8v6h8V16z" xmlns="http://www.w3.org/2000/svg" />
<g class="st0191" xmlns="http://www.w3.org/2000/svg">
	<path class="Black191" d="M10,30H2v-6h8V30z M20,24h-8v6h8V24z M30,24h-8v6h8V24z M4,8h4v2H4v4H2v-4V8V4h2V8z M28,4v4h-4v2h4v4h2v-4V8&#xD;&#xA;		V4H28z" />
</g>
<polygon class="Black191" points="20.7,4.7 22,6 22,2 18,2 19.3,3.3 16,6.6 12.7,3.3 14,2 10,2 10,6 11.3,4.7 14.6,8 11.3,11.3 10,10 &#xD;&#xA;	10,14 14,14 12.7,12.7 16,9.4 19.3,12.7 18,14 22,14 22,10 20.7,11.3 17.4,8 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 646)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black191_white { fill:#FFFFFF;}
	.Blue191_white { fill:#FFFFFF;}
	.st0191_white {opacity:0.5;}
</style>
<path class="Blue191_white" d="M10,22H2v-6h8V22z M20,16h-8v6h8V16z M30,16h-8v6h8V16z" xmlns="http://www.w3.org/2000/svg" />
<g class="st0191_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black191_white" d="M10,30H2v-6h8V30z M20,24h-8v6h8V24z M30,24h-8v6h8V24z M4,8h4v2H4v4H2v-4V8V4h2V8z M28,4v4h-4v2h4v4h2v-4V8&#xD;&#xA;		V4H28z" />
</g>
<polygon class="Black191_white" points="20.7,4.7 22,6 22,2 18,2 19.3,3.3 16,6.6 12.7,3.3 14,2 10,2 10,6 11.3,4.7 14.6,8 11.3,11.3 10,10 &#xD;&#xA;	10,14 14,14 12.7,12.7 16,9.4 19.3,12.7 18,14 22,14 22,10 20.7,11.3 17.4,8 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black192 { fill:#727272;}
	.Blue192 { fill:#757575;}
	.st0192 {opacity:0.5;}
</style>
<path class="Blue192" d="M10,22H2v-6h8V22z M20,16h-8v6h8V16z M30,16h-8v6h8V16z" xmlns="http://www.w3.org/2000/svg" />
<g class="st0192" xmlns="http://www.w3.org/2000/svg">
	<path class="Black192" d="M10,30H2v-6h8V30z M20,24h-8v6h8V24z M30,24h-8v6h8V24z M4,8h4v2H4v4H2v-4V8V4h2V8z M28,4v4h-4v2h4v4h2v-4V8&#xD;&#xA;		V4H28z" />
</g>
<path class="Black192" d="M12.6,9.1c-0.8,0-1.4-0.2-1.9-0.7C10.2,8,10,7.4,10,6.6c0-0.8,0.2-1.5,0.7-1.9c0.5-0.5,1.2-0.7,2-0.7&#xD;&#xA;	c0.8,0,1.4,0.2,1.9,0.6c0.4,0.4,0.7,1,0.7,1.8c0,0.8-0.2,1.4-0.7,1.9C14,8.8,13.4,9.1,12.6,9.1z M20,4l-6.2,10H12l6.2-10H20z&#xD;&#xA;	 M12.7,5.2c-0.7,0-1.1,0.5-1.1,1.4c0,0.9,0.3,1.3,1,1.3c0.7,0,1.1-0.5,1.1-1.4C13.7,5.6,13.4,5.2,12.7,5.2z M19.3,14&#xD;&#xA;	c-0.8,0-1.4-0.2-1.9-0.7c-0.5-0.4-0.7-1-0.7-1.8c0-0.8,0.2-1.5,0.7-1.9s1.2-0.7,2-0.7c0.8,0,1.4,0.2,1.9,0.6s0.7,1,0.7,1.8&#xD;&#xA;	c0,0.8-0.2,1.4-0.7,1.9S20.1,14,19.3,14z M19.4,10.1c-0.7,0-1.1,0.5-1.1,1.4c0,0.9,0.4,1.3,1.1,1.3c0.7,0,1.1-0.5,1.1-1.4&#xD;&#xA;	c0-0.4-0.1-0.7-0.3-1C20,10.2,19.7,10.1,19.4,10.1z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 646)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black192_white { fill:#FFFFFF;}
	.Blue192_white { fill:#FFFFFF;}
	.st0192_white {opacity:0.5;}
</style>
<path class="Blue192_white" d="M10,22H2v-6h8V22z M20,16h-8v6h8V16z M30,16h-8v6h8V16z" xmlns="http://www.w3.org/2000/svg" />
<g class="st0192_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black192_white" d="M10,30H2v-6h8V30z M20,24h-8v6h8V24z M30,24h-8v6h8V24z M4,8h4v2H4v4H2v-4V8V4h2V8z M28,4v4h-4v2h4v4h2v-4V8&#xD;&#xA;		V4H28z" />
</g>
<path class="Black192_white" d="M12.6,9.1c-0.8,0-1.4-0.2-1.9-0.7C10.2,8,10,7.4,10,6.6c0-0.8,0.2-1.5,0.7-1.9c0.5-0.5,1.2-0.7,2-0.7&#xD;&#xA;	c0.8,0,1.4,0.2,1.9,0.6c0.4,0.4,0.7,1,0.7,1.8c0,0.8-0.2,1.4-0.7,1.9C14,8.8,13.4,9.1,12.6,9.1z M20,4l-6.2,10H12l6.2-10H20z&#xD;&#xA;	 M12.7,5.2c-0.7,0-1.1,0.5-1.1,1.4c0,0.9,0.3,1.3,1,1.3c0.7,0,1.1-0.5,1.1-1.4C13.7,5.6,13.4,5.2,12.7,5.2z M19.3,14&#xD;&#xA;	c-0.8,0-1.4-0.2-1.9-0.7c-0.5-0.4-0.7-1-0.7-1.8c0-0.8,0.2-1.5,0.7-1.9s1.2-0.7,2-0.7c0.8,0,1.4,0.2,1.9,0.6s0.7,1,0.7,1.8&#xD;&#xA;	c0,0.8-0.2,1.4-0.7,1.9S20.1,14,19.3,14z M19.4,10.1c-0.7,0-1.1,0.5-1.1,1.4c0,0.9,0.4,1.3,1.1,1.3c0.7,0,1.1-0.5,1.1-1.4&#xD;&#xA;	c0-0.4-0.1-0.7-0.3-1C20,10.2,19.7,10.1,19.4,10.1z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black193 { fill:#727272;}
	.Blue193 { fill:#757575;}
</style>
<path class="Black193" d="M32,6V4h-4V0h-2v4H6V0H4v4H0v2h4v20H0v2h4v4h2v-4h20v4h2v-4h4v-2h-4V6H32z M26,26H6V6h20V26z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue193" d="M8,8v16h16V8H8z M22,22H10V10h12V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 646)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black193_white { fill:#FFFFFF;}
	.Blue193_white { fill:#FFFFFF;}
</style>
<path class="Black193_white" d="M32,6V4h-4V0h-2v4H6V0H4v4H0v2h4v20H0v2h4v4h2v-4h20v4h2v-4h4v-2h-4V6H32z M26,26H6V6h20V26z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue193_white" d="M8,8v16h16V8H8z M22,22H10V10h12V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0194 {fill:#727272;}
	.st1194 {opacity:0.5;}
</style>
<path class="st0194" d="M10,22H2v-6h8V22z M20,16h-8v6h8V16z M30,16h-8v6h8V16z" xmlns="http://www.w3.org/2000/svg" />
<g class="st1194" xmlns="http://www.w3.org/2000/svg">
	<path class="st0194" d="M10,30H2v-6h8V30z M20,24h-8v6h8V24z M30,24h-8v6h8V24z M4,8h4v2H4v4H2v-4V8V4h2V8z M28,4v4h-4v2h4v4h2v-4V8V4&#xD;&#xA;		H28z" />
</g>
<path class="st0194" d="M21,6h-1V3c0-1.7-1.3-3-3-3h-2c-1.7,0-3,1.3-3,3v3h-1c-0.6,0-1,0.4-1,1v6c0,0.6,0.4,1,1,1h10c0.6,0,1-0.4,1-1V7&#xD;&#xA;	C22,6.4,21.6,6,21,6z M14,3c0-0.6,0.4-1,1-1h2c0.6,0,1,0.4,1,1v3h-4V3z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 782)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0194_white { fill:#FFFFFF;}
	.st1194_white {opacity:0.5;}
</style>
<path class="st0194_white" d="M10,22H2v-6h8V22z M20,16h-8v6h8V16z M30,16h-8v6h8V16z" xmlns="http://www.w3.org/2000/svg" />
<g class="st1194_white" xmlns="http://www.w3.org/2000/svg">
	<path class="st0194_white" d="M10,30H2v-6h8V30z M20,24h-8v6h8V24z M30,24h-8v6h8V24z M4,8h4v2H4v4H2v-4V8V4h2V8z M28,4v4h-4v2h4v4h2v-4V8V4&#xD;&#xA;		H28z" />
</g>
<path class="st0194_white" d="M21,6h-1V3c0-1.7-1.3-3-3-3h-2c-1.7,0-3,1.3-3,3v3h-1c-0.6,0-1,0.4-1,1v6c0,0.6,0.4,1,1,1h10c0.6,0,1-0.4,1-1V7&#xD;&#xA;	C22,6.4,21.6,6,21,6z M14,3c0-0.6,0.4-1,1-1h2c0.6,0,1,0.4,1,1v3h-4V3z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black195 { fill:#727272;}
	.Blue195 { fill:#757575;}
	.Yellow195 { fill:#979797;}
	.st0195 {opacity:0.5;}
</style>
<g class="st0195" xmlns="http://www.w3.org/2000/svg">
	<path class="Black195" d="M10,18.1V22H2v-6h4.2c0.2,0.5,0.4,0.9,0.7,1.2c0.6,0.6,1.4,0.9,2.3,0.9C9.5,18.2,9.8,18.1,10,18.1z M12,30h8&#xD;&#xA;		v-6h-8V30z M2,30h8v-6H2V30z M27.3,16l-3,3c-0.6,0.6-1.4,1-2.3,1v2h8v-6h-1H27.3z M22,30h8v-6h-8V30z M19.6,19&#xD;&#xA;		c-0.4-0.4-0.7-1-0.9-1.5c-0.6-0.1-1.1-0.4-1.5-0.9c-0.2-0.2-0.3-0.4-0.5-0.6h-3.9L12,16.8V22h8v-2.7C19.9,19.2,19.7,19.1,19.6,19z" />
</g>
<path class="Yellow195" d="M29,2h-7v0c-1,0-2,0.4-2.8,1.1L16,6.4L8.4,14c-0.5,0.5-0.5,1.3,0,1.8c0.5,0.5,1.3,0.5,1.8,0l7.7-7.7&#xD;&#xA;	c0.6-0.6,1.2,0,0.6,0.6L16.2,11c-0.5,0.5-0.5,1.3,0,1.8c0.5,0.5,1.3,0.5,1.8,0l2.3-2.3c0.6-0.6,1.2,0,0.6,0.6l-2.3,2.3&#xD;&#xA;	c-0.5,0.5-0.5,1.3,0,1.8s1.3,0.5,1.8,0l2.3-2.3c0.6-0.6,1.2,0,0.6,0.6L21,15.8c-0.5,0.5-0.5,1.3,0,1.8c0.5,0.5,1.3,0.5,1.8,0&#xD;&#xA;	l3.6-3.6H29c1.7,0,3-1.4,3-3V5C32,3.3,30.7,2,29,2z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue195" d="M6.9,12.6L10,9.5V8H2v6h4.1C6.3,13.5,6.6,13,6.9,12.6z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 646)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black195_white { fill:#FFFFFF;}
	.Blue195_white { fill:#FFFFFF;}
	.Yellow195_white { fill:#FFFFFF;}
	.st0195_white {opacity:0.5;}
</style>
<g class="st0195_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black195_white" d="M10,18.1V22H2v-6h4.2c0.2,0.5,0.4,0.9,0.7,1.2c0.6,0.6,1.4,0.9,2.3,0.9C9.5,18.2,9.8,18.1,10,18.1z M12,30h8&#xD;&#xA;		v-6h-8V30z M2,30h8v-6H2V30z M27.3,16l-3,3c-0.6,0.6-1.4,1-2.3,1v2h8v-6h-1H27.3z M22,30h8v-6h-8V30z M19.6,19&#xD;&#xA;		c-0.4-0.4-0.7-1-0.9-1.5c-0.6-0.1-1.1-0.4-1.5-0.9c-0.2-0.2-0.3-0.4-0.5-0.6h-3.9L12,16.8V22h8v-2.7C19.9,19.2,19.7,19.1,19.6,19z" />
</g>
<path class="Yellow195_white" d="M29,2h-7v0c-1,0-2,0.4-2.8,1.1L16,6.4L8.4,14c-0.5,0.5-0.5,1.3,0,1.8c0.5,0.5,1.3,0.5,1.8,0l7.7-7.7&#xD;&#xA;	c0.6-0.6,1.2,0,0.6,0.6L16.2,11c-0.5,0.5-0.5,1.3,0,1.8c0.5,0.5,1.3,0.5,1.8,0l2.3-2.3c0.6-0.6,1.2,0,0.6,0.6l-2.3,2.3&#xD;&#xA;	c-0.5,0.5-0.5,1.3,0,1.8s1.3,0.5,1.8,0l2.3-2.3c0.6-0.6,1.2,0,0.6,0.6L21,15.8c-0.5,0.5-0.5,1.3,0,1.8c0.5,0.5,1.3,0.5,1.8,0&#xD;&#xA;	l3.6-3.6H29c1.7,0,3-1.4,3-3V5C32,3.3,30.7,2,29,2z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue195_white" d="M6.9,12.6L10,9.5V8H2v6h4.1C6.3,13.5,6.6,13,6.9,12.6z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black196 { fill:#727272;}
	.Blue196 { fill:#757575;}
	.st0196 {opacity:0.5;}
</style>
<g class="st0196" xmlns="http://www.w3.org/2000/svg">
	<path class="Blue196" d="M20.1,16.2C21.8,14.5,24,11.6,24,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C10.8,16.7,10,17.7,10,19&#xD;&#xA;		c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C22,17.7,21.2,16.7,20.1,16.2z" />
</g>
<path class="Black196" d="M4,6V4h24v2H4z M28,10V8H4v2H28z M28,14v-2H4v2H28z M28,18v-2H4v2H28z M28,22v-2H4v2H28z M28,24H4v2h24V24z&#xD;&#xA;	 M32,1v28c0,0.5-0.5,1-1,1H1c-0.5,0-1-0.5-1-1V1c0-0.5,0.5-1,1-1h30C31.5,0,32,0.5,32,1z M30,2H2v26h28V2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 782)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black196_white { fill:#FFFFFF;}
	.Blue196_white { fill:#FFFFFF;}
	.st0196_white {opacity:0.5;}
</style>
<g class="st0196_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Blue196_white" d="M20.1,16.2C21.8,14.5,24,11.6,24,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C10.8,16.7,10,17.7,10,19&#xD;&#xA;		c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C22,17.7,21.2,16.7,20.1,16.2z" />
</g>
<path class="Black196_white" d="M4,6V4h24v2H4z M28,10V8H4v2H28z M28,14v-2H4v2H28z M28,18v-2H4v2H28z M28,22v-2H4v2H28z M28,24H4v2h24V24z&#xD;&#xA;	 M32,1v28c0,0.5-0.5,1-1,1H1c-0.5,0-1-0.5-1-1V1c0-0.5,0.5-1,1-1h30C31.5,0,32,0.5,32,1z M30,2H2v26h28V2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black197 { fill:#727272;}
	.Blue197 { fill:#757575;}
	.st0197 {opacity:0.5;}
</style>
<path class="Black197" d="M32,1v28c0,0.5-0.5,1-1,1H1c-0.5,0-1-0.5-1-1V1c0-0.5,0.5-1,1-1h30C31.5,0,32,0.5,32,1z M30,2H2v26h28V2z" xmlns="http://www.w3.org/2000/svg" />
<g class="st0197" xmlns="http://www.w3.org/2000/svg">
	<path class="Black197" d="M4,6V4h24v2H4z M28,10V8H4v2H28z M28,14v-2H4v2H28z M28,18v-2H4v2H28z M28,22v-2H4v2H28z M28,24H4v2h24V24z" />
</g>
<path class="Blue197" d="M20.1,16.2C21.8,14.5,24,11.6,24,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C10.8,16.7,10,17.7,10,19&#xD;&#xA;	c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C22,17.7,21.2,16.7,20.1,16.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 884)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black197_white { fill:#FFFFFF;}
	.Blue197_white { fill:#FFFFFF;}
	.st0197_white {opacity:0.5;}
</style>
<path class="Black197_white" d="M32,1v28c0,0.5-0.5,1-1,1H1c-0.5,0-1-0.5-1-1V1c0-0.5,0.5-1,1-1h30C31.5,0,32,0.5,32,1z M30,2H2v26h28V2z" xmlns="http://www.w3.org/2000/svg" />
<g class="st0197_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Black197_white" d="M4,6V4h24v2H4z M28,10V8H4v2H28z M28,14v-2H4v2H28z M28,18v-2H4v2H28z M28,22v-2H4v2H28z M28,24H4v2h24V24z" />
</g>
<path class="Blue197_white" d="M20.1,16.2C21.8,14.5,24,11.6,24,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C10.8,16.7,10,17.7,10,19&#xD;&#xA;	c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C22,17.7,21.2,16.7,20.1,16.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black198 { fill:#727272;}
	.Blue198 { fill:#757575;}
</style>
<path class="Blue198" d="M16.1,16.2C17.8,14.5,20,11.6,20,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C6.8,16.7,6,17.7,6,19&#xD;&#xA;	c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C18,17.7,17.2,16.7,16.1,16.2z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black198" d="M31,0H1C0.4,0,0,0.4,0,1v28c0,0.6,0.4,1,1,1h30c0.6,0,1-0.4,1-1V1C32,0.4,31.6,0,31,0z M30,28H2V2h28V28z" xmlns="http://www.w3.org/2000/svg" />
<rect x="4" y="4" class="Black198" width="24" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="4" y="24" class="Black198" width="24" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="20" y="20" class="Black198" width="8" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 714)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black198_white { fill:#FFFFFF;}
	.Blue198_white { fill:#FFFFFF;}
</style>
<path class="Blue198_white" d="M16.1,16.2C17.8,14.5,20,11.6,20,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C6.8,16.7,6,17.7,6,19&#xD;&#xA;	c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C18,17.7,17.2,16.7,16.1,16.2z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black198_white" d="M31,0H1C0.4,0,0,0.4,0,1v28c0,0.6,0.4,1,1,1h30c0.6,0,1-0.4,1-1V1C32,0.4,31.6,0,31,0z M30,28H2V2h28V28z" xmlns="http://www.w3.org/2000/svg" />
<rect x="4" y="4" class="Black198_white" width="24" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="4" y="24" class="Black198_white" width="24" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="20" y="20" class="Black198_white" width="8" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black199 { fill:#727272;}
	.Blue199 { fill:#757575;}
</style>
<path class="Black199" d="M31,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h30c0.5,0,1-0.5,1-1V1C32,0.5,31.5,0,31,0z M30,28H2V2h28V28z&#xD;&#xA;	 M6,22H4v-2h2V22z M6,16H4v2h2V16z M6,8H4v2h2V8z M4,26h24v-2H4V26z M6,12H4v2h2V12z M4,4v2h24V4H4z M26,22h2v-2h-2V22z M26,10h2V8&#xD;&#xA;	h-2V10z M26,14h2v-2h-2V14z M26,18h2v-2h-2V18z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue199" d="M20.1,16.2C21.8,14.5,24,11.6,24,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C10.8,16.7,10,17.7,10,19&#xD;&#xA;	c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C22,17.7,21.2,16.7,20.1,16.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 714)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black199_white { fill:#FFFFFF;}
	.Blue199_white { fill:#FFFFFF;}
</style>
<path class="Black199_white" d="M31,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h30c0.5,0,1-0.5,1-1V1C32,0.5,31.5,0,31,0z M30,28H2V2h28V28z&#xD;&#xA;	 M6,22H4v-2h2V22z M6,16H4v2h2V16z M6,8H4v2h2V8z M4,26h24v-2H4V26z M6,12H4v2h2V12z M4,4v2h24V4H4z M26,22h2v-2h-2V22z M26,10h2V8&#xD;&#xA;	h-2V10z M26,14h2v-2h-2V14z M26,18h2v-2h-2V18z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue199_white" d="M20.1,16.2C21.8,14.5,24,11.6,24,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C10.8,16.7,10,17.7,10,19&#xD;&#xA;	c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C22,17.7,21.2,16.7,20.1,16.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black200 { fill:#727272;}
	.Blue200 { fill:#757575;}
</style>
<path class="Black200" d="M6,6H4V4h24v2h-2h-2H8H6z M26,14h2v-2h-2V14z M24,18h4v-2h-4V18z M16,10c0.5-0.7,1.2-1.4,2-2h-4&#xD;&#xA;	C14.8,8.6,15.5,9.3,16,10z M24,22h4v-2h-4V22z M26,10h2V8h-2V10z M8,20H4v2h4V20z M28,24H4v2h24V24z M6,8H4v2h2V8z M32,1v28&#xD;&#xA;	c0,0.5-0.5,1-1,1H1c-0.5,0-1-0.5-1-1V1c0-0.5,0.5-1,1-1h30C31.5,0,32,0.5,32,1z M30,2H2v26h28V2z M8,16H4v2h4V16z M6,12H4v2h2V12z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue200" d="M20.1,16.2C21.8,14.5,24,11.6,24,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C10.8,16.7,10,17.7,10,19&#xD;&#xA;	c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C22,17.7,21.2,16.7,20.1,16.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 918)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black200_white { fill:#FFFFFF;}
	.Blue200_white { fill:#FFFFFF;}
</style>
<path class="Black200_white" d="M6,6H4V4h24v2h-2h-2H8H6z M26,14h2v-2h-2V14z M24,18h4v-2h-4V18z M16,10c0.5-0.7,1.2-1.4,2-2h-4&#xD;&#xA;	C14.8,8.6,15.5,9.3,16,10z M24,22h4v-2h-4V22z M26,10h2V8h-2V10z M8,20H4v2h4V20z M28,24H4v2h24V24z M6,8H4v2h2V8z M32,1v28&#xD;&#xA;	c0,0.5-0.5,1-1,1H1c-0.5,0-1-0.5-1-1V1c0-0.5,0.5-1,1-1h30C31.5,0,32,0.5,32,1z M30,2H2v26h28V2z M8,16H4v2h4V16z M6,12H4v2h2V12z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue200_white" d="M20.1,16.2C21.8,14.5,24,11.6,24,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C10.8,16.7,10,17.7,10,19&#xD;&#xA;	c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C22,17.7,21.2,16.7,20.1,16.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black201 { fill:#727272;}
	.Blue201 { fill:#757575;}
</style>
<path class="Black201" d="M31,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h30c0.5,0,1-0.5,1-1V1C32,0.5,31.5,0,31,0z M30,28H2V2h28V28z&#xD;&#xA;	 M8,22H4v-2h4V22z M8,16H4v2h4V16z M6,8H4v2h2V8z M4,26h24v-2H4V26z M6,12H4v2h2V12z M4,4v2h24V4H4z M24,22h4v-2h-4V22z M26,10h2V8&#xD;&#xA;	h-2V10z M26,14h2v-2h-2V14z M24,18h4v-2h-4V18z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue201" d="M20.1,16.2C21.8,14.5,24,11.6,24,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C10.8,16.7,10,17.7,10,19&#xD;&#xA;	c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C22,17.7,21.2,16.7,20.1,16.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 884)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black201_white { fill:#FFFFFF;}
	.Blue201_white { fill:#FFFFFF;}
</style>
<path class="Black201_white" d="M31,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h30c0.5,0,1-0.5,1-1V1C32,0.5,31.5,0,31,0z M30,28H2V2h28V28z&#xD;&#xA;	 M8,22H4v-2h4V22z M8,16H4v2h4V16z M6,8H4v2h2V8z M4,26h24v-2H4V26z M6,12H4v2h2V12z M4,4v2h24V4H4z M24,22h4v-2h-4V22z M26,10h2V8&#xD;&#xA;	h-2V10z M26,14h2v-2h-2V14z M24,18h4v-2h-4V18z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue201_white" d="M20.1,16.2C21.8,14.5,24,11.6,24,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C10.8,16.7,10,17.7,10,19&#xD;&#xA;	c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C22,17.7,21.2,16.7,20.1,16.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black202 { fill:#727272;}
	.Blue202 { fill:#757575;}
</style>
<path class="Black202" d="M6,6H4V4h24v2h-2h-2H8H6z M28,24H4v2h24V24z M32,1v28c0,0.5-0.5,1-1,1H1c-0.5,0-1-0.5-1-1V1c0-0.5,0.5-1,1-1&#xD;&#xA;	h30C31.5,0,32,0.5,32,1z M30,2H2v26h28V2z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue202" d="M20.1,16.2C21.8,14.5,24,11.6,24,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C10.8,16.7,10,17.7,10,19&#xD;&#xA;	c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C22,17.7,21.2,16.7,20.1,16.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 714)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black202_white { fill:#FFFFFF;}
	.Blue202_white { fill:#FFFFFF;}
</style>
<path class="Black202_white" d="M6,6H4V4h24v2h-2h-2H8H6z M28,24H4v2h24V24z M32,1v28c0,0.5-0.5,1-1,1H1c-0.5,0-1-0.5-1-1V1c0-0.5,0.5-1,1-1&#xD;&#xA;	h30C31.5,0,32,0.5,32,1z M30,2H2v26h28V2z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue202_white" d="M20.1,16.2C21.8,14.5,24,11.6,24,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C10.8,16.7,10,17.7,10,19&#xD;&#xA;	c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C22,17.7,21.2,16.7,20.1,16.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black203 { fill:#727272;}
	.Yellow203 { fill:#979797;}
	.st0203 {opacity:0.75;}
</style>
<path class="Yellow203" d="M32,31V15c0-0.6-0.5-1-1-1H9c-0.6,0-1,0.4-1,1v16c0,0.5,0.4,1,1,1h22C31.5,32,32,31.5,32,31z" xmlns="http://www.w3.org/2000/svg" />
<g class="st0203" xmlns="http://www.w3.org/2000/svg">
	<path class="Yellow203" d="M24,17V1c0-0.6-0.5-1-1-1H1C0.4,0,0,0.4,0,1v16c0,0.5,0.4,1,1,1h22C23.5,18,24,17.5,24,17z" />
</g>
<path class="Black203" d="M12.6,21.4c0.2-0.3,0.5-0.6,0.8-0.8c0.3-0.2,0.7-0.3,1.1-0.4c0.4-0.1,0.8-0.1,1.2-0.1c0.4,0,0.7,0,1.1,0.1&#xD;&#xA;	c0.4,0.1,0.7,0.2,1,0.3c0.3,0.2,0.6,0.4,0.8,0.7c0.2,0.3,0.3,0.7,0.3,1.1v4c0,0.4,0,0.7,0.1,1c0,0.3,0.1,0.6,0.2,0.7h-2.1&#xD;&#xA;	c0-0.1-0.1-0.2-0.1-0.4c0-0.1,0-0.3,0-0.4c-0.3,0.4-0.7,0.6-1.1,0.7c-0.4,0.1-0.9,0.2-1.3,0.2c-0.4,0-0.7,0-1-0.1&#xD;&#xA;	c-0.3-0.1-0.6-0.2-0.8-0.4c-0.2-0.2-0.4-0.4-0.5-0.7s-0.2-0.6-0.2-1c0-0.4,0.1-0.8,0.2-1.1c0.1-0.3,0.3-0.5,0.6-0.7s0.5-0.3,0.8-0.4&#xD;&#xA;	c0.3-0.1,0.6-0.2,0.9-0.2c0.3,0,0.6-0.1,0.9-0.1c0.3,0,0.6-0.1,0.8-0.1c0.2-0.1,0.4-0.1,0.5-0.3c0.1-0.1,0.2-0.3,0.2-0.5&#xD;&#xA;	c0-0.2,0-0.4-0.1-0.5c-0.1-0.1-0.2-0.2-0.3-0.3c-0.1-0.1-0.3-0.1-0.4-0.1c-0.2,0-0.3,0-0.5,0c-0.4,0-0.7,0.1-0.9,0.3&#xD;&#xA;	c-0.2,0.2-0.4,0.5-0.4,0.9h-2C12.3,22.1,12.4,21.7,12.6,21.4z M16.6,24.4c-0.1,0-0.3,0.1-0.4,0.1c-0.1,0-0.3,0.1-0.5,0.1&#xD;&#xA;	c-0.2,0-0.3,0-0.5,0.1c-0.2,0-0.3,0.1-0.5,0.1c-0.1,0.1-0.3,0.1-0.4,0.2c-0.1,0.1-0.2,0.2-0.3,0.3c-0.1,0.1-0.1,0.3-0.1,0.5&#xD;&#xA;	c0,0.2,0,0.4,0.1,0.5c0.1,0.1,0.2,0.2,0.3,0.3c0.1,0.1,0.2,0.1,0.4,0.2c0.2,0,0.3,0,0.5,0c0.4,0,0.7-0.1,0.9-0.2&#xD;&#xA;	c0.2-0.1,0.4-0.3,0.5-0.5c0.1-0.2,0.2-0.4,0.2-0.6c0-0.2,0-0.4,0-0.5v-0.8C16.8,24.3,16.7,24.3,16.6,24.4z M22.6,18v3.2h0&#xD;&#xA;	c0.2-0.4,0.6-0.7,1-0.9c0.4-0.2,0.9-0.3,1.3-0.3c0.4,0,0.7,0.1,1.1,0.2c0.4,0.2,0.7,0.4,1,0.7c0.3,0.3,0.5,0.8,0.7,1.3&#xD;&#xA;	c0.2,0.5,0.3,1.1,0.3,1.8s-0.1,1.3-0.3,1.8c-0.2,0.5-0.4,0.9-0.7,1.3c-0.3,0.3-0.6,0.6-1,0.7c-0.4,0.2-0.7,0.2-1.1,0.2&#xD;&#xA;	c-0.5,0-1-0.1-1.5-0.3c-0.4-0.2-0.8-0.5-1-0.9h0v1h-1.9V18H22.6z M25.9,23.2c-0.1-0.3-0.2-0.6-0.3-0.8c-0.1-0.2-0.3-0.4-0.5-0.5&#xD;&#xA;	c-0.2-0.1-0.5-0.2-0.8-0.2c-0.3,0-0.6,0.1-0.8,0.2c-0.2,0.1-0.4,0.3-0.5,0.5c-0.1,0.2-0.2,0.5-0.3,0.8c-0.1,0.3-0.1,0.6-0.1,0.9&#xD;&#xA;	c0,0.3,0,0.6,0.1,0.9c0.1,0.3,0.2,0.6,0.3,0.8c0.1,0.2,0.3,0.4,0.5,0.5c0.2,0.1,0.5,0.2,0.8,0.2c0.3,0,0.6-0.1,0.8-0.2&#xD;&#xA;	c0.2-0.1,0.4-0.3,0.5-0.5c0.1-0.2,0.2-0.5,0.3-0.8c0.1-0.3,0.1-0.6,0.1-0.9C26,23.8,25.9,23.5,25.9,23.2z M19,9.8c0,0-0.1,0-0.1,0&#xD;&#xA;	c-0.1,0-0.3,0.1-0.4,0.2c-0.1,0.1-0.2,0.2-0.3,0.4C18,10.6,18,10.8,18,11.1v0.7c0,0.4-0.1,0.7-0.2,1c-0.1,0.3-0.3,0.5-0.4,0.7&#xD;&#xA;	c-0.2,0.2-0.4,0.3-0.6,0.4C16.6,14,16.4,14,16.3,14H14v-1.8h1.2c0.2,0,0.3,0,0.4-0.1c0.1-0.1,0.2-0.2,0.2-0.3&#xD;&#xA;	c0.1-0.1,0.1-0.2,0.1-0.4c0-0.1,0-0.3,0-0.4v-0.1c0-0.4,0.1-0.6,0.2-0.9c0.1-0.2,0.2-0.4,0.4-0.5s0.3-0.2,0.5-0.3&#xD;&#xA;	C17.2,9.1,17.3,9,17.4,9v0c-0.1,0-0.2,0-0.4-0.1c-0.2-0.1-0.3-0.2-0.5-0.3S16.3,8.3,16.2,8S16,7.4,16,7v0c0-0.1,0-0.3,0-0.4&#xD;&#xA;	c0-0.1,0-0.3-0.1-0.4C15.8,6.1,15.7,6,15.6,6c-0.1-0.1-0.2-0.1-0.4-0.1H14V4h2.3c0.2,0,0.3,0,0.5,0.1c0.2,0.1,0.4,0.2,0.6,0.4&#xD;&#xA;	c0.2,0.2,0.3,0.4,0.4,0.7c0.1,0.3,0.2,0.6,0.2,1v0.6c0,0.3,0,0.5,0.1,0.7c0.1,0.2,0.2,0.3,0.3,0.5c0.1,0.1,0.3,0.2,0.4,0.2&#xD;&#xA;	c0,0,0.1,0,0.1,0V9.8z M5,9.8c0,0,0.1,0,0.1,0c0.1,0,0.3,0.1,0.4,0.2c0.1,0.1,0.2,0.2,0.3,0.4C6,10.6,6,10.8,6,11.1v0.7&#xD;&#xA;	c0,0.4,0.1,0.7,0.2,1c0.1,0.3,0.3,0.5,0.4,0.7c0.2,0.2,0.4,0.3,0.6,0.4C7.4,14,7.6,14,7.7,14H10v-1.8H8.8c-0.2,0-0.3,0-0.4-0.1&#xD;&#xA;	c-0.1-0.1-0.2-0.2-0.2-0.3C8.1,11.6,8,11.5,8,11.4c0-0.1,0-0.3,0-0.4v-0.1c0-0.4-0.1-0.6-0.2-0.9C7.7,9.8,7.6,9.6,7.5,9.4&#xD;&#xA;	S7.2,9.2,7,9.1C6.8,9.1,6.7,9,6.6,9v0c0.1,0,0.2,0,0.4-0.1c0.2-0.1,0.3-0.2,0.5-0.3S7.7,8.3,7.8,8S8,7.4,8,7v0c0-0.1,0-0.3,0-0.4&#xD;&#xA;	c0-0.1,0-0.3,0.1-0.4C8.2,6.1,8.3,6,8.4,6c0.1-0.1,0.2-0.1,0.4-0.1H10V4H7.7C7.6,4,7.4,4,7.2,4.1C7,4.2,6.8,4.4,6.6,4.6&#xD;&#xA;	C6.5,4.7,6.3,5,6.2,5.2C6.1,5.5,6,5.8,6,6.2v0.6c0,0.3,0,0.5-0.1,0.7C5.8,7.7,5.7,7.9,5.5,8C5.4,8.1,5.3,8.2,5.1,8.2&#xD;&#xA;	c0,0-0.1,0-0.1,0V9.8z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 714)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black203_white { fill:#FFFFFF;}
	.Yellow203_white { fill:#FFFFFF;}
	.st0203_white {opacity:0.75;}
</style>
<path class="Yellow203_white" d="M32,31V15c0-0.6-0.5-1-1-1H9c-0.6,0-1,0.4-1,1v16c0,0.5,0.4,1,1,1h22C31.5,32,32,31.5,32,31z" xmlns="http://www.w3.org/2000/svg" />
<g class="st0203_white" xmlns="http://www.w3.org/2000/svg">
	<path class="Yellow203_white" d="M24,17V1c0-0.6-0.5-1-1-1H1C0.4,0,0,0.4,0,1v16c0,0.5,0.4,1,1,1h22C23.5,18,24,17.5,24,17z" />
</g>
<path class="Black203_white" d="M12.6,21.4c0.2-0.3,0.5-0.6,0.8-0.8c0.3-0.2,0.7-0.3,1.1-0.4c0.4-0.1,0.8-0.1,1.2-0.1c0.4,0,0.7,0,1.1,0.1&#xD;&#xA;	c0.4,0.1,0.7,0.2,1,0.3c0.3,0.2,0.6,0.4,0.8,0.7c0.2,0.3,0.3,0.7,0.3,1.1v4c0,0.4,0,0.7,0.1,1c0,0.3,0.1,0.6,0.2,0.7h-2.1&#xD;&#xA;	c0-0.1-0.1-0.2-0.1-0.4c0-0.1,0-0.3,0-0.4c-0.3,0.4-0.7,0.6-1.1,0.7c-0.4,0.1-0.9,0.2-1.3,0.2c-0.4,0-0.7,0-1-0.1&#xD;&#xA;	c-0.3-0.1-0.6-0.2-0.8-0.4c-0.2-0.2-0.4-0.4-0.5-0.7s-0.2-0.6-0.2-1c0-0.4,0.1-0.8,0.2-1.1c0.1-0.3,0.3-0.5,0.6-0.7s0.5-0.3,0.8-0.4&#xD;&#xA;	c0.3-0.1,0.6-0.2,0.9-0.2c0.3,0,0.6-0.1,0.9-0.1c0.3,0,0.6-0.1,0.8-0.1c0.2-0.1,0.4-0.1,0.5-0.3c0.1-0.1,0.2-0.3,0.2-0.5&#xD;&#xA;	c0-0.2,0-0.4-0.1-0.5c-0.1-0.1-0.2-0.2-0.3-0.3c-0.1-0.1-0.3-0.1-0.4-0.1c-0.2,0-0.3,0-0.5,0c-0.4,0-0.7,0.1-0.9,0.3&#xD;&#xA;	c-0.2,0.2-0.4,0.5-0.4,0.9h-2C12.3,22.1,12.4,21.7,12.6,21.4z M16.6,24.4c-0.1,0-0.3,0.1-0.4,0.1c-0.1,0-0.3,0.1-0.5,0.1&#xD;&#xA;	c-0.2,0-0.3,0-0.5,0.1c-0.2,0-0.3,0.1-0.5,0.1c-0.1,0.1-0.3,0.1-0.4,0.2c-0.1,0.1-0.2,0.2-0.3,0.3c-0.1,0.1-0.1,0.3-0.1,0.5&#xD;&#xA;	c0,0.2,0,0.4,0.1,0.5c0.1,0.1,0.2,0.2,0.3,0.3c0.1,0.1,0.2,0.1,0.4,0.2c0.2,0,0.3,0,0.5,0c0.4,0,0.7-0.1,0.9-0.2&#xD;&#xA;	c0.2-0.1,0.4-0.3,0.5-0.5c0.1-0.2,0.2-0.4,0.2-0.6c0-0.2,0-0.4,0-0.5v-0.8C16.8,24.3,16.7,24.3,16.6,24.4z M22.6,18v3.2h0&#xD;&#xA;	c0.2-0.4,0.6-0.7,1-0.9c0.4-0.2,0.9-0.3,1.3-0.3c0.4,0,0.7,0.1,1.1,0.2c0.4,0.2,0.7,0.4,1,0.7c0.3,0.3,0.5,0.8,0.7,1.3&#xD;&#xA;	c0.2,0.5,0.3,1.1,0.3,1.8s-0.1,1.3-0.3,1.8c-0.2,0.5-0.4,0.9-0.7,1.3c-0.3,0.3-0.6,0.6-1,0.7c-0.4,0.2-0.7,0.2-1.1,0.2&#xD;&#xA;	c-0.5,0-1-0.1-1.5-0.3c-0.4-0.2-0.8-0.5-1-0.9h0v1h-1.9V18H22.6z M25.9,23.2c-0.1-0.3-0.2-0.6-0.3-0.8c-0.1-0.2-0.3-0.4-0.5-0.5&#xD;&#xA;	c-0.2-0.1-0.5-0.2-0.8-0.2c-0.3,0-0.6,0.1-0.8,0.2c-0.2,0.1-0.4,0.3-0.5,0.5c-0.1,0.2-0.2,0.5-0.3,0.8c-0.1,0.3-0.1,0.6-0.1,0.9&#xD;&#xA;	c0,0.3,0,0.6,0.1,0.9c0.1,0.3,0.2,0.6,0.3,0.8c0.1,0.2,0.3,0.4,0.5,0.5c0.2,0.1,0.5,0.2,0.8,0.2c0.3,0,0.6-0.1,0.8-0.2&#xD;&#xA;	c0.2-0.1,0.4-0.3,0.5-0.5c0.1-0.2,0.2-0.5,0.3-0.8c0.1-0.3,0.1-0.6,0.1-0.9C26,23.8,25.9,23.5,25.9,23.2z M19,9.8c0,0-0.1,0-0.1,0&#xD;&#xA;	c-0.1,0-0.3,0.1-0.4,0.2c-0.1,0.1-0.2,0.2-0.3,0.4C18,10.6,18,10.8,18,11.1v0.7c0,0.4-0.1,0.7-0.2,1c-0.1,0.3-0.3,0.5-0.4,0.7&#xD;&#xA;	c-0.2,0.2-0.4,0.3-0.6,0.4C16.6,14,16.4,14,16.3,14H14v-1.8h1.2c0.2,0,0.3,0,0.4-0.1c0.1-0.1,0.2-0.2,0.2-0.3&#xD;&#xA;	c0.1-0.1,0.1-0.2,0.1-0.4c0-0.1,0-0.3,0-0.4v-0.1c0-0.4,0.1-0.6,0.2-0.9c0.1-0.2,0.2-0.4,0.4-0.5s0.3-0.2,0.5-0.3&#xD;&#xA;	C17.2,9.1,17.3,9,17.4,9v0c-0.1,0-0.2,0-0.4-0.1c-0.2-0.1-0.3-0.2-0.5-0.3S16.3,8.3,16.2,8S16,7.4,16,7v0c0-0.1,0-0.3,0-0.4&#xD;&#xA;	c0-0.1,0-0.3-0.1-0.4C15.8,6.1,15.7,6,15.6,6c-0.1-0.1-0.2-0.1-0.4-0.1H14V4h2.3c0.2,0,0.3,0,0.5,0.1c0.2,0.1,0.4,0.2,0.6,0.4&#xD;&#xA;	c0.2,0.2,0.3,0.4,0.4,0.7c0.1,0.3,0.2,0.6,0.2,1v0.6c0,0.3,0,0.5,0.1,0.7c0.1,0.2,0.2,0.3,0.3,0.5c0.1,0.1,0.3,0.2,0.4,0.2&#xD;&#xA;	c0,0,0.1,0,0.1,0V9.8z M5,9.8c0,0,0.1,0,0.1,0c0.1,0,0.3,0.1,0.4,0.2c0.1,0.1,0.2,0.2,0.3,0.4C6,10.6,6,10.8,6,11.1v0.7&#xD;&#xA;	c0,0.4,0.1,0.7,0.2,1c0.1,0.3,0.3,0.5,0.4,0.7c0.2,0.2,0.4,0.3,0.6,0.4C7.4,14,7.6,14,7.7,14H10v-1.8H8.8c-0.2,0-0.3,0-0.4-0.1&#xD;&#xA;	c-0.1-0.1-0.2-0.2-0.2-0.3C8.1,11.6,8,11.5,8,11.4c0-0.1,0-0.3,0-0.4v-0.1c0-0.4-0.1-0.6-0.2-0.9C7.7,9.8,7.6,9.6,7.5,9.4&#xD;&#xA;	S7.2,9.2,7,9.1C6.8,9.1,6.7,9,6.6,9v0c0.1,0,0.2,0,0.4-0.1c0.2-0.1,0.3-0.2,0.5-0.3S7.7,8.3,7.8,8S8,7.4,8,7v0c0-0.1,0-0.3,0-0.4&#xD;&#xA;	c0-0.1,0-0.3,0.1-0.4C8.2,6.1,8.3,6,8.4,6c0.1-0.1,0.2-0.1,0.4-0.1H10V4H7.7C7.6,4,7.4,4,7.2,4.1C7,4.2,6.8,4.4,6.6,4.6&#xD;&#xA;	C6.5,4.7,6.3,5,6.2,5.2C6.1,5.5,6,5.8,6,6.2v0.6c0,0.3,0,0.5-0.1,0.7C5.8,7.7,5.7,7.9,5.5,8C5.4,8.1,5.3,8.2,5.1,8.2&#xD;&#xA;	c0,0-0.1,0-0.1,0V9.8z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow204 { fill:#979797;}
	.Red204 { fill:#585858;}
	.Blue204 { fill:#757575;}
	.Green204 { fill:#404040;}
	.Black204 { fill:#727272;}
	.White204 { fill:#FFFFFF;}
	.st0204 {opacity:0.5;}
	.st1204 {display:none;}
	.st2204 { fill:#404040;}
	.st3204 { fill:#585858;}
	.st4204 { fill:#727272;}
</style>
<g id="Underline" xmlns="http://www.w3.org/2000/svg">
	<path class="Black204" d="M8,15.7V4h3.4v11c0,4,1.6,6,4.7,6c3,0,4.5-1.9,4.5-5.8V4H24v11.4c0,5.7-2.7,8.6-8.2,8.6&#xD;&#xA;		C10.6,24,8,21.2,8,15.7z M6,28v2h20v-2H6z" />
</g>
</g>

<g transform="translate(408, 714)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow204_white { fill:#FFFFFF;}
	.Red204_white { fill:#FFFFFF;}
	.Blue204_white { fill:#FFFFFF;}
	.Green204_white { fill:#FFFFFF;}
	.Black204_white { fill:#FFFFFF;}
	.White204_white { fill:#FFFFFF;}
	.st0204_white {opacity:0.5;}
	.st1204_white {display:none;}
	.st2204_white { fill:#FFFFFF;}
	.st3204_white { fill:#FFFFFF;}
	.st4204_white { fill:#FFFFFF;}
</style>
<g id="Underline" xmlns="http://www.w3.org/2000/svg">
	<path class="Black204_white" d="M8,15.7V4h3.4v11c0,4,1.6,6,4.7,6c3,0,4.5-1.9,4.5-5.8V4H24v11.4c0,5.7-2.7,8.6-8.2,8.6&#xD;&#xA;		C10.6,24,8,21.2,8,15.7z M6,28v2h20v-2H6z" />
</g>
</g>

<g transform="translate(476, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow205 { fill:#979797;}
	.Red205 { fill:#585858;}
	.Blue205 { fill:#757575;}
	.Green205 { fill:#404040;}
	.Black205 { fill:#727272;}
	.White205 { fill:#FFFFFF;}
	.st0205 {opacity:0.5;}
	.st1205 {display:none;}
	.st2205 { fill:#404040;}
	.st3205 { fill:#585858;}
	.st4205 { fill:#727272;}
</style>
<g id="UnderlineDouble" xmlns="http://www.w3.org/2000/svg">
	<path class="Black205" d="M24,15.4c0,5.7-2.7,8.6-8.2,8.6C10.6,24,8,21.2,8,15.7V4h3.4v11c0,4,1.6,6,4.7,6c3,0,4.5-1.9,4.5-5.8V4H24&#xD;&#xA;		V15.4z M26,26H6v2h20V26z M26,30H6v2h20V30z" />
</g>
</g>

<g transform="translate(476, 714)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow205_white { fill:#FFFFFF;}
	.Red205_white { fill:#FFFFFF;}
	.Blue205_white { fill:#FFFFFF;}
	.Green205_white { fill:#FFFFFF;}
	.Black205_white { fill:#FFFFFF;}
	.White205_white { fill:#FFFFFF;}
	.st0205_white {opacity:0.5;}
	.st1205_white {display:none;}
	.st2205_white { fill:#FFFFFF;}
	.st3205_white { fill:#FFFFFF;}
	.st4205_white { fill:#FFFFFF;}
</style>
<g id="UnderlineDouble" xmlns="http://www.w3.org/2000/svg">
	<path class="Black205_white" d="M24,15.4c0,5.7-2.7,8.6-8.2,8.6C10.6,24,8,21.2,8,15.7V4h3.4v11c0,4,1.6,6,4.7,6c3,0,4.5-1.9,4.5-5.8V4H24&#xD;&#xA;		V15.4z M26,26H6v2h20V26z M26,30H6v2h20V30z" />
</g>
</g>

<g transform="translate(238, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue206 { fill:#757575;}
</style>
<path class="Blue206" d="M32,26c0,0,0-8-16-8v6L0,14L16,4v6C32,10,32,26,32,26z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 850)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue206_white { fill:#FFFFFF;}
</style>
<path class="Blue206_white" d="M32,26c0,0,0-8-16-8v6L0,14L16,4v6C32,10,32,26,32,26z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow207 { fill:#979797;}
	.Black207 { fill:#727272;}
	.Red207 { fill:#585858;}
</style>
<path class="Yellow207" d="M31,24h-1v-3c0-1.7-1.3-3-3-3h-2c-1.7,0-3,1.3-3,3v3h-1c-0.6,0-1,0.4-1,1v6c0,0.6,0.4,1,1,1h10&#xD;&#xA;	c0.6,0,1-0.4,1-1v-6C32,24.4,31.6,24,31,24z M24,21c0-0.6,0.4-1,1-1h2c0.6,0,1,0.4,1,1v3h-4V21z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black207" d="M10,18h11c-0.4,0.6-0.8,1.3-0.9,2H10V18z M10,24h8.2c0.3-0.9,1-1.5,1.8-1.8V22H10V24z M6,10.8l-2,2V29&#xD;&#xA;	c0,0.6,0.4,1,1,1h13v-2H6V10.8z M27,4H12.8l-2,2H26v10h1c0.3,0,0.7,0,1,0.1V5C28,4.4,27.6,4,27,4z M10,14v2h12v-2H10z M12.8,12H22&#xD;&#xA;	v-2h-7.2L12.8,12z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Red207" points="12,2 10,0 6,4 2,0 0,2 4,6 0,10 2,12 6,8 10,12 12,10 8,6 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 748)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow207_white { fill:#FFFFFF;}
	.Black207_white { fill:#FFFFFF;}
	.Red207_white { fill:#FFFFFF;}
</style>
<path class="Yellow207_white" d="M31,24h-1v-3c0-1.7-1.3-3-3-3h-2c-1.7,0-3,1.3-3,3v3h-1c-0.6,0-1,0.4-1,1v6c0,0.6,0.4,1,1,1h10&#xD;&#xA;	c0.6,0,1-0.4,1-1v-6C32,24.4,31.6,24,31,24z M24,21c0-0.6,0.4-1,1-1h2c0.6,0,1,0.4,1,1v3h-4V21z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black207_white" d="M10,18h11c-0.4,0.6-0.8,1.3-0.9,2H10V18z M10,24h8.2c0.3-0.9,1-1.5,1.8-1.8V22H10V24z M6,10.8l-2,2V29&#xD;&#xA;	c0,0.6,0.4,1,1,1h13v-2H6V10.8z M27,4H12.8l-2,2H26v10h1c0.3,0,0.7,0,1,0.1V5C28,4.4,27.6,4,27,4z M10,14v2h12v-2H10z M12.8,12H22&#xD;&#xA;	v-2h-7.2L12.8,12z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Red207_white" points="12,2 10,0 6,4 2,0 0,2 4,6 0,10 2,12 6,8 10,12 12,10 8,6 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow208 { fill:#979797;}
	.Green208 { fill:#404040;}
</style>
<g xmlns="http://www.w3.org/2000/svg">
	<g>
		<path class="Yellow208" d="M16.1,22l0-0.3c0.6-4.4,4.5-7.7,8.9-7.7c1,0,2,0.2,3,0.5V7c0-0.5-0.5-1-1-1H1C0.5,6,0,6.5,0,7v14&#xD;&#xA;			c0,0.5,0.5,1,1,1H16.1L16.1,22z" />
	</g>
	<g>
		<path class="Yellow208" d="M16.1,22l0-0.3c0.6-4.4,4.5-7.7,8.9-7.7c1,0,2,0.2,3,0.5V7c0-0.5-0.5-1-1-1H1C0.5,6,0,6.5,0,7v14&#xD;&#xA;			c0,0.5,0.5,1,1,1H16.1L16.1,22z" />
	</g>
</g>
<path class="Green208" d="M32,16v6h-0.1h-2H26l2.5-2.5C27.6,18.6,26.4,18,25,18c-2.4,0-4.4,1.7-4.9,4h-2c0.5-3.4,3.4-6,6.9-6&#xD;&#xA;	c1.9,0,3.7,0.8,4.9,2.1L32,16z M25,28c-1.4,0-2.6-0.6-3.5-1.5L24,24h-3.9h-2H18v6l2.1-2.1c1.3,1.3,3,2.1,4.9,2.1&#xD;&#xA;	c3.5,0,6.4-2.6,6.9-6h-2C29.4,26.3,27.4,28,25,28z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 782)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow208_white { fill:#FFFFFF;}
	.Green208_white { fill:#FFFFFF;}
</style>
<g xmlns="http://www.w3.org/2000/svg">
	<g>
		<path class="Yellow208_white" d="M16.1,22l0-0.3c0.6-4.4,4.5-7.7,8.9-7.7c1,0,2,0.2,3,0.5V7c0-0.5-0.5-1-1-1H1C0.5,6,0,6.5,0,7v14&#xD;&#xA;			c0,0.5,0.5,1,1,1H16.1L16.1,22z" />
	</g>
	<g>
		<path class="Yellow208_white" d="M16.1,22l0-0.3c0.6-4.4,4.5-7.7,8.9-7.7c1,0,2,0.2,3,0.5V7c0-0.5-0.5-1-1-1H1C0.5,6,0,6.5,0,7v14&#xD;&#xA;			c0,0.5,0.5,1,1,1H16.1L16.1,22z" />
	</g>
</g>
<path class="Green208_white" d="M32,16v6h-0.1h-2H26l2.5-2.5C27.6,18.6,26.4,18,25,18c-2.4,0-4.4,1.7-4.9,4h-2c0.5-3.4,3.4-6,6.9-6&#xD;&#xA;	c1.9,0,3.7,0.8,4.9,2.1L32,16z M25,28c-1.4,0-2.6-0.6-3.5-1.5L24,24h-3.9h-2H18v6l2.1-2.1c1.3,1.3,3,2.1,4.9,2.1&#xD;&#xA;	c3.5,0,6.4-2.6,6.9-6h-2C29.4,26.3,27.4,28,25,28z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0209 {opacity:0.5;}
	.st1209 {fill:#727272;}
</style>
<g class="st0209" xmlns="http://www.w3.org/2000/svg">
	<path class="st1209" d="M20,8h-2V6h2V8z M20,10h-2v2h2V10z M20,14h-2v2h2V14z M16,8h-2V6h2V8z M16,10h-2v2h2V10z M16,18h-2v2h2V18z&#xD;&#xA;		 M16,22h-2v2h2V22z M16,14h-2v2h2V14z" />
</g>
<path class="st1209" d="M24,8h-2V6h2V8z M24,10h-2v2h2V10z M24,14h-2v2h2V14z" xmlns="http://www.w3.org/2000/svg" />
<path class="st1209" d="M12,8H6V6h6V8z M12,18H6v2h6V18z M16,28H4V2h22v14.1c0.7,0.1,1.4,0.2,2,0.5V1c0-0.6-0.4-1-1-1H3&#xD;&#xA;	C2.4,0,2,0.4,2,1v28c0,0.6,0.4,1,1,1h13V28z M6,24h6v-2H6V24z M12,10H6v2h6V10z M12,14H6v2h6V14z" xmlns="http://www.w3.org/2000/svg" />
<path class="st1209" d="M32,18v6h-0.1h-2H26l2.5-2.5C27.6,20.6,26.4,20,25,20c-2.4,0-4.4,1.7-4.9,4h-2c0.5-3.4,3.4-6,6.9-6&#xD;&#xA;	c1.9,0,3.7,0.8,4.9,2.1L32,18z M25,30c-1.4,0-2.6-0.6-3.5-1.5L24,26h-3.9h-2H18v6l2.1-2.1c1.3,1.3,3,2.1,4.9,2.1&#xD;&#xA;	c3.5,0,6.4-2.6,6.9-6h-2C29.4,28.3,27.4,30,25,30z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 782)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0209_white {opacity:0.5;}
	.st1209_white { fill:#FFFFFF;}
</style>
<g class="st0209_white" xmlns="http://www.w3.org/2000/svg">
	<path class="st1209_white" d="M20,8h-2V6h2V8z M20,10h-2v2h2V10z M20,14h-2v2h2V14z M16,8h-2V6h2V8z M16,10h-2v2h2V10z M16,18h-2v2h2V18z&#xD;&#xA;		 M16,22h-2v2h2V22z M16,14h-2v2h2V14z" />
</g>
<path class="st1209_white" d="M24,8h-2V6h2V8z M24,10h-2v2h2V10z M24,14h-2v2h2V14z" xmlns="http://www.w3.org/2000/svg" />
<path class="st1209_white" d="M12,8H6V6h6V8z M12,18H6v2h6V18z M16,28H4V2h22v14.1c0.7,0.1,1.4,0.2,2,0.5V1c0-0.6-0.4-1-1-1H3&#xD;&#xA;	C2.4,0,2,0.4,2,1v28c0,0.6,0.4,1,1,1h13V28z M6,24h6v-2H6V24z M12,10H6v2h6V10z M12,14H6v2h6V14z" xmlns="http://www.w3.org/2000/svg" />
<path class="st1209_white" d="M32,18v6h-0.1h-2H26l2.5-2.5C27.6,20.6,26.4,20,25,20c-2.4,0-4.4,1.7-4.9,4h-2c0.5-3.4,3.4-6,6.9-6&#xD;&#xA;	c1.9,0,3.7,0.8,4.9,2.1L32,18z M25,30c-1.4,0-2.6-0.6-3.5-1.5L24,26h-3.9h-2H18v6l2.1-2.1c1.3,1.3,3,2.1,4.9,2.1&#xD;&#xA;	c3.5,0,6.4-2.6,6.9-6h-2C29.4,28.3,27.4,30,25,30z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black210 { fill:#727272;}
	.Blue210 { fill:#757575;}
	.Yellow210 { fill:#979797;}
</style>
<path class="Black210" d="M6,6h18v2H6V6z M21.4,28H4V2h22v21.4l2,2V1c0-0.5-0.5-1-1-1H3C2.5,0,2,0.5,2,1v28c0,0.5,0.5,1,1,1h20.4&#xD;&#xA;	L21.4,28z M12,14H6v2h6V14z M10,18H6v2h4V18z M10,22H6v2h4V22z" xmlns="http://www.w3.org/2000/svg" />
<rect x="6" y="10" class="Yellow210" width="18" height="2" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue210" d="M27.6,27.9L23,23.3c0.6-0.9,1-2.1,1-3.3c0-3.3-2.7-6-6-6c-3.3,0-6,2.7-6,6s2.7,6,6,6c1.2,0,2.3-0.4,3.3-1&#xD;&#xA;	l4.6,4.6c0.5,0.5,1.3,0.5,1.7,0C28.1,29.2,28.1,28.4,27.6,27.9z M18,24c-2.2,0-4-1.8-4-4c0-2.2,1.8-4,4-4s4,1.8,4,4&#xD;&#xA;	C22,22.2,20.2,24,18,24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 714)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black210_white { fill:#FFFFFF;}
	.Blue210_white { fill:#FFFFFF;}
	.Yellow210_white { fill:#FFFFFF;}
</style>
<path class="Black210_white" d="M6,6h18v2H6V6z M21.4,28H4V2h22v21.4l2,2V1c0-0.5-0.5-1-1-1H3C2.5,0,2,0.5,2,1v28c0,0.5,0.5,1,1,1h20.4&#xD;&#xA;	L21.4,28z M12,14H6v2h6V14z M10,18H6v2h4V18z M10,22H6v2h4V22z" xmlns="http://www.w3.org/2000/svg" />
<rect x="6" y="10" class="Yellow210_white" width="18" height="2" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue210_white" d="M27.6,27.9L23,23.3c0.6-0.9,1-2.1,1-3.3c0-3.3-2.7-6-6-6c-3.3,0-6,2.7-6,6s2.7,6,6,6c1.2,0,2.3-0.4,3.3-1&#xD;&#xA;	l4.6,4.6c0.5,0.5,1.3,0.5,1.7,0C28.1,29.2,28.1,28.4,27.6,27.9z M18,24c-2.2,0-4-1.8-4-4c0-2.2,1.8-4,4-4s4,1.8,4,4&#xD;&#xA;	C22,22.2,20.2,24,18,24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black211 { fill:#727272;}
</style>
<g xmlns="http://www.w3.org/2000/svg">
	<path class="Black211" d="M8,10H6v2h2V10z M16,10h-2v2h2V10z M24,10h-2v2h2V10z M8,18H6v2h2V18z M16,18h-2v2h2V18z M24,18h-2v2h2V18z&#xD;&#xA;		 M12,6h-2v2h2V6z M12,10h-2v2h2V10z M12,14h-2v2h2V14z M12,18h-2v2h2V18z M12,22h-2v2h2V22z M20,6h-2v2h2V6z M20,10h-2v2h2V10z&#xD;&#xA;		 M20,14h-2v2h2V14z M20,18h-2v2h2V18z M20,22h-2v2h2V22z" />
</g>
<path class="Black211" d="M27,2H3C2.5,2,2,2.5,2,3v24c0,0.5,0.5,1,1,1h24c0.5,0,1-0.5,1-1V3C28,2.5,27.5,2,27,2z M26,26H4V4h22V26z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 646)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black211_white { fill:#FFFFFF;}
</style>
<g xmlns="http://www.w3.org/2000/svg">
	<path class="Black211_white" d="M8,10H6v2h2V10z M16,10h-2v2h2V10z M24,10h-2v2h2V10z M8,18H6v2h2V18z M16,18h-2v2h2V18z M24,18h-2v2h2V18z&#xD;&#xA;		 M12,6h-2v2h2V6z M12,10h-2v2h2V10z M12,14h-2v2h2V14z M12,18h-2v2h2V18z M12,22h-2v2h2V22z M20,6h-2v2h2V6z M20,10h-2v2h2V10z&#xD;&#xA;		 M20,14h-2v2h2V14z M20,18h-2v2h2V18z M20,22h-2v2h2V22z" />
</g>
<path class="Black211_white" d="M27,2H3C2.5,2,2,2.5,2,3v24c0,0.5,0.5,1,1,1h24c0.5,0,1-0.5,1-1V3C28,2.5,27.5,2,27,2z M26,26H4V4h22V26z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black212 { fill:#727272;}
	.Blue212 { fill:#757575;}
</style>
<polygon class="Blue212" points="18,12 14,12 14,8 12,8 12,12 8,12 8,14 12,14 12,18 14,18 14,14 18,14 " xmlns="http://www.w3.org/2000/svg" />
<path class="Black212" d="M29.7,27.3L22,19.6c0,0-0.1-0.1-0.1-0.1c1.3-1.8,2.1-4.1,2.1-6.5c0-6.1-4.9-11-11-11C6.9,2,2,6.9,2,13&#xD;&#xA;	s4.9,11,11,11c2.4,0,4.7-0.8,6.5-2.1c0,0,0,0.1,0.1,0.1l7.7,7.7c0.3,0.3,0.9,0.3,1.2,0l1.2-1.2C30.1,28.2,30.1,27.6,29.7,27.3z&#xD;&#xA;	 M4,13c0-5,4-9,9-9c5,0,9,4,9,9s-4,9-9,9C8,22,4,18,4,13z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 884)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black212_white { fill:#FFFFFF;}
	.Blue212_white { fill:#FFFFFF;}
</style>
<polygon class="Blue212_white" points="18,12 14,12 14,8 12,8 12,12 8,12 8,14 12,14 12,18 14,18 14,14 18,14 " xmlns="http://www.w3.org/2000/svg" />
<path class="Black212_white" d="M29.7,27.3L22,19.6c0,0-0.1-0.1-0.1-0.1c1.3-1.8,2.1-4.1,2.1-6.5c0-6.1-4.9-11-11-11C6.9,2,2,6.9,2,13&#xD;&#xA;	s4.9,11,11,11c2.4,0,4.7-0.8,6.5-2.1c0,0,0,0.1,0.1,0.1l7.7,7.7c0.3,0.3,0.9,0.3,1.2,0l1.2-1.2C30.1,28.2,30.1,27.6,29.7,27.3z&#xD;&#xA;	 M4,13c0-5,4-9,9-9c5,0,9,4,9,9s-4,9-9,9C8,22,4,18,4,13z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black213 { fill:#727272;}
	.Blue213 { fill:#757575;}
</style>
<g id="Zoom_Out" xmlns="http://www.w3.org/2000/svg">
	<rect x="8" y="12" class="Blue213" width="10" height="2" />
	<path class="Black213" d="M29.7,27.3l-7.9-7.9c1.3-1.8,2.1-4,2.1-6.5c0-6.1-4.9-11-11-11C6.9,2,2,6.9,2,13s4.9,11,11,11&#xD;&#xA;		c2.4,0,4.6-0.8,6.5-2.1l7.9,7.9c0.3,0.3,0.9,0.3,1.2,0l1.2-1.2C30.1,28.2,30.1,27.6,29.7,27.3z M4,13c0-5,4-9,9-9c5,0,9,4,9,9&#xD;&#xA;		s-4,9-9,9C8,22,4,18,4,13z" />
</g>
</g>

<g transform="translate(408, 782)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black213_white { fill:#FFFFFF;}
	.Blue213_white { fill:#FFFFFF;}
</style>
<g id="Zoom_Out" xmlns="http://www.w3.org/2000/svg">
	<rect x="8" y="12" class="Blue213_white" width="10" height="2" />
	<path class="Black213_white" d="M29.7,27.3l-7.9-7.9c1.3-1.8,2.1-4,2.1-6.5c0-6.1-4.9-11-11-11C6.9,2,2,6.9,2,13s4.9,11,11,11&#xD;&#xA;		c2.4,0,4.6-0.8,6.5-2.1l7.9,7.9c0.3,0.3,0.9,0.3,1.2,0l1.2-1.2C30.1,28.2,30.1,27.6,29.7,27.3z M4,13c0-5,4-9,9-9c5,0,9,4,9,9&#xD;&#xA;		s-4,9-9,9C8,22,4,18,4,13z" />
</g>
</g>


</svg>
   )} <?xml version="1.0" encoding="utf-8"?>

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="538" height="510">
<g transform="translate(0, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black0 { fill:#727272;}
	.Green0 { fill:#404040;}
	.Red0 { fill:#585858;}
</style>
<path class="Red0" d="M16,16H6v-2h10V16z M16,18H6v2h10V18z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black0" d="M26,26v3c0,0.6-0.4,1-1,1H1c-0.6,0-1-0.4-1-1V1c0-0.6,0.4-1,1-1h24c0.6,0,1,0.4,1,1v7h-2V2H2v26h22v-2H26z&#xD;&#xA;	 M20,6H6v2h14V6z M16,10H6v2h10V10z M16,22H6v2h10V22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Green0" d="M31,10H19c-0.6,0-1,0.4-1,1v12c0,0.6,0.4,1,1,1h12c0.6,0,1-0.4,1-1V11C32,10.4,31.6,10,31,10z M30,18h-4v4h-2&#xD;&#xA;	v-4h-4v-2h4v-4h2v4h4V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black1 { fill:#727272;}
	.Blue1 { fill:#757575;}
</style>
<path class="Black1" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue1" d="M20,16H10v2h10V16z M24,20H6v2h18V20z M20,24H10v2h10V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black2 { fill:#727272;}
	.Blue2 { fill:#757575;}
</style>
<path class="Black2" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue2" d="M14,16H4v2h10V16z M20,20H4v2h16V20z M14,24H4v2h10V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black3 { fill:#727272;}
	.Blue3 { fill:#757575;}
</style>
<path class="Black3" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue3" d="M26,16H16v2h10V16z M26,20H10v2h16V20z M26,24H16v2h10V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black4 { fill:#727272;}
</style>
<path id="Align_Center_1_" class="Black4" d="M28,8H4V6h24V8z M24,10H8v2h16V10z M28,14H4v2h24V14z M28,22H4v2h24V22z M24,18H8v2h16&#xD;&#xA;	V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow5 { fill:#979797;}
	.Black5 { fill:#727272;}
</style>
<path class="Black5" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M26,6H4V4h22V6z M26,10H4V8h22V10z M26,22h-6v-2h6V22z M26,26h-6v-2h6V26z M10,22H4v-2h6V22z M10,26H4v-2h6V26z M26,14H4v-2h22V14z&#xD;&#xA;	 M26,18H4v-2h22V18z" xmlns="http://www.w3.org/2000/svg" />
<rect x="12" y="20" class="Yellow5" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow6 { fill:#979797;}
	.Black6 { fill:#727272;}
</style>
<path class="Black6" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M26,6H4V4h22V6z M26,10H4V8h22V10z M26,14H4v-2h22V14z M26,18H4v-2h22V18z M26,22H12v-2h14V22z M26,26H12v-2h14V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="4" y="20" class="Yellow6" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow7 { fill:#979797;}
	.Black7 { fill:#727272;}
</style>
<path class="Black7" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M26,6H4V4h22V6z M26,10H4V8h22V10z M26,14H4v-2h22V14z M26,18H4v-2h22V18z M18,22H4v-2h14V22z M18,26H4v-2h14V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="20" y="20" class="Yellow7" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow8 { fill:#979797;}
	.Black8 { fill:#727272;}
</style>
<path class="Black8" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M26,6H4V4h22V6z M26,10H4V8h22V10z M26,14h-6v-2h6V14z M26,18h-6v-2h6V18z M10,14H4v-2h6V14z M10,18H4v-2h6V18z M26,22H4v-2h22V22z&#xD;&#xA;	 M26,26H4v-2h22V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="12" y="12" class="Yellow8" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow9 { fill:#979797;}
	.Black9 { fill:#727272;}
</style>
<path class="Black9" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M26,6H4V4h22V6z M26,10H4V8h22V10z M26,14H12v-2h14V14z M26,18H12v-2h14V18z M26,22H4v-2h22V22z M26,26H4v-2h22V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="4" y="12" class="Yellow9" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow10 { fill:#979797;}
	.Black10 { fill:#727272;}
</style>
<path class="Black10" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M26,6H4V4h22V6z M26,10H4V8h22V10z M18,14H4v-2h14V14z M18,18H4v-2h14V18z M26,22H4v-2h22V22z M26,26H4v-2h22V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="20" y="12" class="Yellow10" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow11 { fill:#979797;}
	.Black11 { fill:#727272;}
</style>
<path class="Black11" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M10,6H4V4h6V6z M10,10H4V8h6V10z M26,6h-6V4h6V6z M26,10h-6V8h6V10z M26,14H4v-2h22V14z M26,18H4v-2h22V18z M26,22H4v-2h22V22z&#xD;&#xA;	 M26,26H4v-2h22V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="12" y="4" class="Yellow11" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow12 { fill:#979797;}
	.Black12 { fill:#727272;}
</style>
<path class="Black12" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M26,6H12V4h14V6z M26,10H12V8h14V10z M26,14H4v-2h22V14z M26,18H4v-2h22V18z M26,22H4v-2h22V22z M26,26H4v-2h22V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="4" y="4" class="Yellow12" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow13 { fill:#979797;}
	.Black13 { fill:#727272;}
</style>
<path class="Black13" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M18,6H4V4h14V6z M18,10H4V8h14V10z M26,14H4v-2h22V14z M26,18H4v-2h22V18z M26,22H4v-2h22V22z M26,26H4v-2h22V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="20" y="4" class="Yellow13" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black14 { fill:#727272;}
</style>
<path id="Align_Justify_2_" class="Black14" d="M28,8H4V6h24V8z M28,10H4v2h24V10z M28,14H4v2h24V14z M28,22H4v2h24V22z M28,18H4v2h24&#xD;&#xA;	V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black15 { fill:#727272;}
</style>
<path id="Align_Left_2_" class="Black15" d="M28,8H4V6h24V8z M20,10H4v2h16V10z M28,14H4v2h24V14z M28,22H4v2h24V22z M20,18H4v2h16V18&#xD;&#xA;	z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black16 { fill:#727272;}
	.Blue16 { fill:#757575;}
</style>
<path class="Black16" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue16" d="M20,10H10v2h10V10z M24,14H6v2h18V14z M20,18H10v2h10V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black17 { fill:#727272;}
	.Blue17 { fill:#757575;}
</style>
<path class="Black17" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue17" d="M14,10H4v2h10V10z M20,14H4v2h16V14z M14,18H4v2h10V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black18 { fill:#727272;}
	.Blue18 { fill:#757575;}
</style>
<path class="Black18" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue18" d="M26,10H16v2h10V10z M26,14H10v2h16V14z M26,18H16v2h10V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black19 { fill:#727272;}
</style>
<path id="Align_Right_2_" class="Black19" d="M28,8H4V6h24V8z M28,10H12v2h16V10z M28,14H4v2h24V14z M28,22H4v2h24V22z M28,18H12v2h16&#xD;&#xA;	V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black20 { fill:#727272;}
	.Blue20 { fill:#757575;}
</style>
<path class="Black20" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue20" d="M20,4H10v2h10V4z M24,8H6v2h18V8z M20,12H10v2h10V12z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black21 { fill:#727272;}
	.Blue21 { fill:#757575;}
</style>
<path class="Black21" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue21" d="M14,4H4v2h10V4z M20,8H4v2h16V8z M14,12H4v2h10V12z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black22 { fill:#727272;}
	.Blue22 { fill:#757575;}
</style>
<path class="Black22" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue22" d="M26,4H16v2h10V4z M26,8H10v2h16V8z M26,12H16v2h10V12z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black23 { fill:#727272;}
	.Blue23 { fill:#757575;}
</style>
<path class="Black23" d="M19,0H7C6.4,0,6,0.4,6,1v5.6l2-2V2h10v5c0,0.6,0.4,1,1,1h5v14H8v-1.1c-0.7-0.1-1.4-0.5-1.9-1L6,19.8V23&#xD;&#xA;	c0,0.6,0.4,1,1,1h18c0.6,0,1-0.4,1-1V7L19,0z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black23" d="M10.8,19.2c-1.1,1.1-2.9,1.1-4,0l-4-4c-1.1-1.1-1.1-2.9,0-4L8,6l8,8L10.8,19.2z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue23" d="M14,10c2.2,0,4,3.6,4,8c0,1.1,0.9,2,2,2c1.1,0,2-0.9,2-2C22,13.6,18.4,10,14,10z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black24 { fill:#727272;}
</style>
<path class="Black24" d="M8,26V4h8c2.5,0,4.3,0.5,5.7,1.4c1.3,0.9,2,2.2,2,3.8c0,1.2-0.4,2.2-1.2,3.1c-0.8,0.9-1.8,1.5-3.1,1.9v0.1&#xD;&#xA;	c1.6,0.2,2.8,0.8,3.8,1.7c0.9,1,1.4,2.1,1.4,3.5c0,2-0.7,3.6-2.2,4.8C20.9,25.4,19,26,16.5,26H8z M13,7.7v5.2h2.2&#xD;&#xA;	c1,0,1.8-0.2,2.4-0.7c0.6-0.5,0.9-1.2,0.9-2c0-1.6-1.2-2.4-3.6-2.4H13z M13,16.6v5.8h2.7c1.1,0,2-0.3,2.7-0.8c0.6-0.5,1-1.3,1-2.2&#xD;&#xA;	c0-0.9-0.3-1.6-1-2.1c-0.6-0.5-1.5-0.8-2.7-0.8H13z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black25 { fill:#727272;}
	.Red25 { fill:#585858;}
</style>
<path class="Black25" d="M27,4H7C6.5,4,6,4.5,6,5v24c0,0.5,0.5,1,1,1h20c0.5,0,1-0.5,1-1V5C28,4.5,27.5,4,27,4z M26,28H8V6h18V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red25" d="M17,2h-6c-0.5,0-1,0.5-1,1v15l4-4l4,4V3C18,2.5,17.5,2,17,2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black26 { fill:#727272;}
	.st026 {opacity:0.5;}
</style>
<g class="st026" xmlns="http://www.w3.org/2000/svg">
	<path class="Black26" d="M2,2h2v2H2V2z M6,4h2V2H6V4z M10,4h2V2h-2V4z M14,4h2V2h-2V4z M18,4h2V2h-2V4z M22,4h2V2h-2V4z M26,2v2h2V2&#xD;&#xA;		H26z M26,8h2V6h-2V8z M26,12h2v-2h-2V12z M26,16h2v-2h-2V16z M26,20h2v-2h-2V20z M26,24h2v-2h-2V24z M2,24h2v-2H2V24z M2,20h2v-2H2&#xD;&#xA;		V20z M2,16h2v-2H2V16z M2,12h2v-2H2V12z M2,8h2V6H2V8z M14,8h2V6h-2V8z M14,12h2v-2h-2V12z M14,16h2v-2h-2V16z M14,20h2v-2h-2V20z&#xD;&#xA;		 M14,24h2v-2h-2V24z M18,16h2v-2h-2V16z M22,16h2v-2h-2V16z M10,16h2v-2h-2V16z M6,16h2v-2H6V16z" />
</g>
<rect x="2" y="26" class="Black26" width="26" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black27 { fill:#727272;}
	.st027 {opacity:0.5;}
</style>
<g class="st027" xmlns="http://www.w3.org/2000/svg">
	<path class="Black27" d="M2,2h2v2H2V2z M6,4h2V2H6V4z M10,4h2V2h-2V4z M14,4h2V2h-2V4z M18,4h2V2h-2V4z M22,4h2V2h-2V4z M26,2v2h2V2&#xD;&#xA;		H26z M26,8h2V6h-2V8z M26,12h2v-2h-2V12z M26,20h2v-2h-2V20z M26,24h2v-2h-2V24z M26,28h2v-2h-2V28z M22,28h2v-2h-2V28z M18,28h2&#xD;&#xA;		v-2h-2V28z M14,28h2v-2h-2V28z M10,28h2v-2h-2V28z M6,28h2v-2H6V28z M2,28h2v-2H2V28z M2,24h2v-2H2V24z M2,20h2v-2H2V20z M2,12h2&#xD;&#xA;		v-2H2V12z M2,8h2V6H2V8z M14,8h2V6h-2V8z M14,12h2v-2h-2V12z M14,20h2v-2h-2V20z M14,24h2v-2h-2V24z" />
</g>
<polygon class="Black27" points="14,14 2,14 2,16 14,16 16,16 28,16 28,14 16,14 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black28 { fill:#727272;}
	.st028 {opacity:0.5;}
</style>
<g class="st028" xmlns="http://www.w3.org/2000/svg">
	<path class="Black28" d="M2,2h2v2H2V2z M6,4h2V2H6V4z M10,4h2V2h-2V4z M18,4h2V2h-2V4z M22,4h2V2h-2V4z M26,2v2h2V2H26z M26,8h2V6h-2&#xD;&#xA;		V8z M26,12h2v-2h-2V12z M26,16h2v-2h-2V16z M26,20h2v-2h-2V20z M26,24h2v-2h-2V24z M26,28h2v-2h-2V28z M22,28h2v-2h-2V28z M18,28h2&#xD;&#xA;		v-2h-2V28z M10,28h2v-2h-2V28z M6,28h2v-2H6V28z M2,28h2v-2H2V28z M2,24h2v-2H2V24z M2,20h2v-2H2V20z M2,16h2v-2H2V16z M2,12h2v-2&#xD;&#xA;		H2V12z M2,8h2V6H2V8z M18,16h2v-2h-2V16z M22,16h2v-2h-2V16z M10,16h2v-2h-2V16z M6,16h2v-2H6V16z" />
</g>
<polygon class="Black28" points="16,16 16,14 16,10 16,2 14,2 14,10 14,14 14,16 14,28 16,28 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black29 { fill:#727272;}
	.st029 {opacity:0.5;}
</style>
<g class="st029" xmlns="http://www.w3.org/2000/svg">
	<path class="Black29" d="M6,4h2V2H6V4z M10,4h2V2h-2V4z M14,4h2V2h-2V4z M18,4h2V2h-2V4z M22,4h2V2h-2V4z M26,2v2h2V2H26z M26,8h2V6&#xD;&#xA;		h-2V8z M26,12h2v-2h-2V12z M26,16h2v-2h-2V16z M26,20h2v-2h-2V20z M26,24h2v-2h-2V24z M26,28h2v-2h-2V28z M22,28h2v-2h-2V28z&#xD;&#xA;		 M18,28h2v-2h-2V28z M14,28h2v-2h-2V28z M10,28h2v-2h-2V28z M6,28h2v-2H6V28z M14,8h2V6h-2V8z M14,12h2v-2h-2V12z M14,16h2v-2h-2&#xD;&#xA;		V16z M14,20h2v-2h-2V20z M14,24h2v-2h-2V24z M18,16h2v-2h-2V16z M22,16h2v-2h-2V16z M10,16h2v-2h-2V16z M6,16h2v-2H6V16z" />
</g>
<rect x="2" y="2" class="Black29" width="2" height="26" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black30 { fill:#727272;}
	.st030 {opacity:0.5;}
</style>
<g class="st030" xmlns="http://www.w3.org/2000/svg">
	<path class="Black30" d="M2,2h2v2H2V2z M6,4h2V2H6V4z M10,4h2V2h-2V4z M14,4h2V2h-2V4z M18,4h2V2h-2V4z M22,4h2V2h-2V4z M26,2v2h2V2&#xD;&#xA;		H26z M26,8h2V6h-2V8z M26,12h2v-2h-2V12z M26,16h2v-2h-2V16z M26,20h2v-2h-2V20z M26,24h2v-2h-2V24z M26,28h2v-2h-2V28z M22,28h2&#xD;&#xA;		v-2h-2V28z M18,28h2v-2h-2V28z M14,28h2v-2h-2V28z M10,28h2v-2h-2V28z M6,28h2v-2H6V28z M2,28h2v-2H2V28z M2,24h2v-2H2V24z M2,20h2&#xD;&#xA;		v-2H2V20z M2,16h2v-2H2V16z M2,12h2v-2H2V12z M2,8h2V6H2V8z M14,8h2V6h-2V8z M14,12h2v-2h-2V12z M14,16h2v-2h-2V16z M14,20h2v-2h-2&#xD;&#xA;		V20z M14,24h2v-2h-2V24z M18,16h2v-2h-2V16z M22,16h2v-2h-2V16z M10,16h2v-2h-2V16z M6,16h2v-2H6V16z" />
</g>
</g>

<g transform="translate(374, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black31 { fill:#727272;}
	.st031 {opacity:0.5;}
</style>
<g class="st031" xmlns="http://www.w3.org/2000/svg">
	<path class="Black31" d="M2,2h2v2H2V2z M6,4h2V2H6V4z M10,4h2V2h-2V4z M14,4h2V2h-2V4z M18,4h2V2h-2V4z M22,4h2V2h-2V4z M22,28h2v-2&#xD;&#xA;		h-2V28z M18,28h2v-2h-2V28z M14,28h2v-2h-2V28z M10,28h2v-2h-2V28z M6,28h2v-2H6V28z M2,28h2v-2H2V28z M2,24h2v-2H2V24z M2,20h2v-2&#xD;&#xA;		H2V20z M2,16h2v-2H2V16z M2,12h2v-2H2V12z M2,8h2V6H2V8z M14,8h2V6h-2V8z M14,12h2v-2h-2V12z M14,16h2v-2h-2V16z M14,20h2v-2h-2V20&#xD;&#xA;		z M14,24h2v-2h-2V24z M18,16h2v-2h-2V16z M22,16h2v-2h-2V16z M10,16h2v-2h-2V16z M6,16h2v-2H6V16z" />
</g>
<rect x="26" y="2" class="Black31" width="2" height="26" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black32 { fill:#727272;}
</style>
<path class="Black32" d="M2,2v2v24h26V16v-2V4V2H2z M14,4v10H4V4H14z M4,26V16h10v10H4z M26,26H16V16h10V26z M26,14H16V4h10V14z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black33 {fill:#727272;}
	.st033 {opacity:0.5;}
</style>
<g class="st033" xmlns="http://www.w3.org/2000/svg">
	<path class="Black33" d="M2,2h2v2H2V2z M6,4h2V2H6V4z M10,4h2V2h-2V4z M18,4h2V2h-2V4z M22,4h2V2h-2V4z M26,2v2h2V2H26z M26,8h2V6h-2&#xD;&#xA;		V8z M26,12h2v-2h-2V12z M26,20h2v-2h-2V20z M26,24h2v-2h-2V24z M26,28h2v-2h-2V28z M22,28h2v-2h-2V28z M18,28h2v-2h-2V28z M10,28h2&#xD;&#xA;		v-2h-2V28z M6,28h2v-2H6V28z M2,28h2v-2H2V28z M2,24h2v-2H2V24z M2,20h2v-2H2V20z M2,12h2v-2H2V12z M2,8h2V6H2V8z" />
</g>
<polygon class="Black33" points="28,14 16,14 16,2 14,2 14,14 2,14 2,16 14,16 14,28 16,28 16,16 28,16 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black34 {fill:#727272;}
	.st034 {opacity:0.5;}
</style>
<g class="st034" xmlns="http://www.w3.org/2000/svg">
	<path class="Black34" d="M14,8h2V6h-2V8z M14,12h2v-2h-2V12z M14,16h2v-2h-2V16z M14,20h2v-2h-2V20z M14,24h2v-2h-2V24z M18,16h2v-2&#xD;&#xA;		h-2V16z M22,16h2v-2h-2V16z M10,16h2v-2h-2V16z M6,16h2v-2H6V16z" />
</g>
<path class="Black34" d="M2,2v26h26V2H2z M26,26H4V4h22V26z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black35 {fill:#727272;}
	.st035 {opacity:0.5;}
</style>
<g class="st035" xmlns="http://www.w3.org/2000/svg">
	<path class="Black35" d="M26,8h2V6h-2V8z M26,12h2v-2h-2V12z M26,16h2v-2h-2V16z M26,20h2v-2h-2V20z M26,24h2v-2h-2V24z M26,28h2v-2&#xD;&#xA;		h-2V28z M22,28h2v-2h-2V28z M18,28h2v-2h-2V28z M14,28h2v-2h-2V28z M10,28h2v-2h-2V28z M6,28h2v-2H6V28z M2,28h2v-2H2V28z M2,24h2&#xD;&#xA;		v-2H2V24z M2,20h2v-2H2V20z M2,16h2v-2H2V16z M2,12h2v-2H2V12z M2,8h2V6H2V8z M14,8h2V6h-2V8z M14,12h2v-2h-2V12z M14,16h2v-2h-2&#xD;&#xA;		V16z M14,20h2v-2h-2V20z M14,24h2v-2h-2V24z M18,16h2v-2h-2V16z M22,16h2v-2h-2V16z M10,16h2v-2h-2V16z M6,16h2v-2H6V16z" />
</g>
<rect x="2" y="2" class="Black35" width="26" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st036 {fill:#727272;}
	.st136 {opacity:0.5;fill:#727272;}
	.st236 {opacity:0.75;fill:#727272;}
</style>
<path id="layer_3_" class="st036" d="M18,25.5c4,4-2.5-2.5,1.5,1.5c0,5.4-6.5,5-8.5,5C15.5,27.5,14.3,25.5,18,25.5z" xmlns="http://www.w3.org/2000/svg" />
<path id="layer_2_" class="st136" d="M31,14L31,14c-0.4-0.4-1.5-1.5-3,0l-9,9l3,3l9-9C32.5,15.5,31.4,14.4,31,14z" xmlns="http://www.w3.org/2000/svg" />
<path id="layer_1_" class="st236" d="M19,23L19,23c-0.4,0.4-1.4,2.1-1,2.5l1.5,1.5c0.4,0.4,2.1-0.6,2.5-1l0,0L19,23z" xmlns="http://www.w3.org/2000/svg" />
<path id="layer" class="st036" d="M17.8,21.2l2.8-2.8L14,0h-4L2,22h3.9l1.8-5.6h8.5L17.8,21.2z M8.6,13.4l2.9-8.8&#xD;&#xA;	c0.1-0.4,0.2-0.8,0.3-1.4h0.1c0.1,0.7,0.2,1.1,0.3,1.4l3,8.8H8.6z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow37 { fill:#979797;}
	.Red37 { fill:#585858;}
	.Blue37 { fill:#757575;}
	.Green37 { fill:#404040;}
	.Black37 { fill:#727272;}
	.White37 { fill:#FFFFFF;}
	.st037 {opacity:0.5;}
	.st137 {display:none;}
	.st237 { fill:#404040;}
	.st337 { fill:#585858;}
	.st437 { fill:#727272;}
</style>
<g id="ChangeTextCase" xmlns="http://www.w3.org/2000/svg">
	<path class="Blue37" d="M12.6,6l5.8,16h-3.6l-1.2-3.6H7.8L6.6,22H3.1L9.1,6H12.6z M12.8,15.8l-2-5.9h0l-2,5.9H12.8z M19.7,14&#xD;&#xA;		c0-0.7,0.2-1.4,0.5-1.9s0.7-0.9,1.2-1.2c0.5-0.3,1.1-0.5,1.7-0.6c0.6-0.1,1.2-0.2,1.9-0.2c0.6,0,1.1,0,1.7,0.1&#xD;&#xA;		c0.6,0.1,1.1,0.2,1.6,0.5c0.5,0.2,0.9,0.6,1.2,1c0.3,0.4,0.5,1,0.5,1.7v6c0,0.5,0,1,0.1,1.5c0.1,0.5,0.2,0.8,0.3,1.1h-3.2&#xD;&#xA;		c-0.1-0.2-0.1-0.4-0.1-0.5c0-0.2-0.1-0.4-0.1-0.6c-0.5,0.5-1.1,0.9-1.8,1.1c-0.7,0.2-1.4,0.3-2.1,0.3c-0.5,0-1-0.1-1.5-0.2&#xD;&#xA;		c-0.5-0.1-0.9-0.3-1.2-0.6c-0.3-0.3-0.6-0.6-0.8-1.1c-0.2-0.4-0.3-1-0.3-1.5c0-0.7,0.1-1.2,0.3-1.6c0.2-0.4,0.5-0.8,0.9-1&#xD;&#xA;		c0.4-0.3,0.8-0.4,1.2-0.6c0.5-0.1,0.9-0.2,1.4-0.3c0.5-0.1,0.9-0.1,1.4-0.2c0.5,0,0.9-0.1,1.2-0.2c0.3-0.1,0.6-0.2,0.8-0.4&#xD;&#xA;		c0.2-0.2,0.3-0.4,0.3-0.8c0-0.3-0.1-0.6-0.2-0.8c-0.1-0.2-0.3-0.4-0.4-0.5c-0.2-0.1-0.4-0.2-0.6-0.2c-0.2,0-0.5-0.1-0.8-0.1&#xD;&#xA;		c-0.6,0-1.1,0.1-1.4,0.4s-0.6,0.7-0.6,1.3H19.7z M26.9,16.3c-0.1,0.1-0.3,0.2-0.5,0.3c-0.2,0.1-0.4,0.1-0.6,0.2&#xD;&#xA;		c-0.2,0-0.5,0.1-0.7,0.1c-0.2,0-0.5,0.1-0.7,0.1c-0.2,0-0.5,0.1-0.7,0.2c-0.2,0.1-0.4,0.2-0.6,0.3c-0.2,0.1-0.3,0.3-0.4,0.5&#xD;&#xA;		c-0.1,0.2-0.2,0.4-0.2,0.7c0,0.3,0.1,0.5,0.2,0.7c0.1,0.2,0.2,0.3,0.4,0.5c0.2,0.1,0.4,0.2,0.6,0.2c0.2,0,0.5,0.1,0.7,0.1&#xD;&#xA;		c0.6,0,1.1-0.1,1.4-0.3c0.3-0.2,0.6-0.5,0.7-0.8c0.2-0.3,0.3-0.6,0.3-0.9c0-0.3,0.1-0.5,0.1-0.7V16.3z" />
</g>
</g>

<g transform="translate(204, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow38 { fill:#979797;}
	.Red38 { fill:#585858;}
	.Blue38 { fill:#757575;}
	.Green38 { fill:#404040;}
	.Black38 { fill:#727272;}
	.White38 { fill:#FFFFFF;}
	.st038 {opacity:0.5;}
	.st138 {display:none;}
	.st238 { fill:#404040;}
	.st338 { fill:#585858;}
	.st438 { fill:#727272;}
</style>
<g id="ClearFormatting" xmlns="http://www.w3.org/2000/svg">
	<path class="Black38" d="M1.1,11.2c0-0.6,0.2-1.2,0.5-1.6c0.3-0.4,0.6-0.8,1.1-1C3,8.4,3.5,8.2,4.1,8.1C4.6,8,5.1,7.9,5.7,7.9&#xD;&#xA;		c0.5,0,1,0,1.5,0.1c0.5,0.1,1,0.2,1.4,0.4c0.4,0.2,0.8,0.5,1,0.8s0.4,0.8,0.4,1.4v5.1c0,0.4,0,0.9,0.1,1.3c0.1,0.4,0.1,0.7,0.3,0.9&#xD;&#xA;		H7.6c-0.1-0.2-0.1-0.3-0.1-0.5c0-0.2-0.1-0.3-0.1-0.5C7,17.5,6.5,17.8,5.9,18c-0.6,0.2-1.2,0.3-1.8,0.3c-0.5,0-0.9-0.1-1.3-0.2&#xD;&#xA;		C2.4,18,2,17.8,1.7,17.5C1.4,17.3,1.2,17,1,16.6c-0.2-0.4-0.3-0.8-0.3-1.3c0-0.6,0.1-1,0.3-1.4s0.4-0.6,0.8-0.9&#xD;&#xA;		c0.3-0.2,0.7-0.4,1.1-0.5s0.8-0.2,1.2-0.3c0.4-0.1,0.8-0.1,1.2-0.2c0.4,0,0.7-0.1,1-0.2c0.3-0.1,0.5-0.2,0.7-0.3&#xD;&#xA;		c0.2-0.1,0.3-0.4,0.2-0.6c0-0.3,0-0.5-0.1-0.7C7.1,10.2,6.9,10,6.8,10C6.6,9.9,6.4,9.8,6.2,9.8s-0.4,0-0.7,0c-0.5,0-1,0.1-1.3,0.3&#xD;&#xA;		c-0.3,0.2-0.5,0.6-0.5,1.1H1.1z M7.3,13.2c-0.1,0.1-0.3,0.2-0.4,0.2c-0.2,0.1-0.4,0.1-0.6,0.1c-0.2,0-0.4,0.1-0.6,0.1&#xD;&#xA;		s-0.4,0.1-0.6,0.1c-0.2,0-0.4,0.1-0.6,0.2c-0.2,0.1-0.4,0.1-0.5,0.3c-0.1,0.1-0.3,0.2-0.4,0.4c-0.1,0.2-0.1,0.4-0.1,0.6&#xD;&#xA;		c0,0.2,0,0.4,0.1,0.6C3.7,16,3.8,16.1,4,16.2c0.2,0.1,0.3,0.2,0.5,0.2s0.4,0.1,0.6,0.1c0.5,0,0.9-0.1,1.2-0.3&#xD;&#xA;		C6.6,16,6.9,15.8,7,15.6s0.2-0.5,0.3-0.8c0-0.3,0-0.5,0-0.6V13.2z" />
	<path class="Black38" d="M14.7,4v5.4h0c0.3-0.5,0.8-0.9,1.3-1.1c0.6-0.2,1.1-0.4,1.8-0.4c0.5,0,1,0.1,1.5,0.3&#xD;&#xA;		c0.5,0.2,0.9,0.5,1.3,0.9c0.4,0.4,0.7,1,0.9,1.6s0.4,1.4,0.4,2.3s-0.1,1.7-0.4,2.3S21,16.6,20.6,17c-0.4,0.4-0.8,0.7-1.3,0.9&#xD;&#xA;		c-0.5,0.2-1,0.3-1.5,0.3c-0.7,0-1.4-0.1-1.9-0.3c-0.6-0.2-1-0.6-1.3-1.2h0V18H12V4H14.7z M19.1,11.9c-0.1-0.4-0.2-0.7-0.4-1&#xD;&#xA;		c-0.2-0.3-0.4-0.5-0.7-0.7c-0.3-0.2-0.6-0.3-1-0.3c-0.4,0-0.7,0.1-1,0.3c-0.3,0.2-0.5,0.4-0.7,0.7c-0.2,0.3-0.3,0.6-0.4,1&#xD;&#xA;		c-0.1,0.4-0.1,0.8-0.1,1.2c0,0.4,0,0.8,0.1,1.2c0.1,0.4,0.2,0.7,0.4,1s0.4,0.5,0.7,0.7c0.3,0.2,0.6,0.3,1,0.3c0.4,0,0.8-0.1,1-0.3&#xD;&#xA;		c0.3-0.2,0.5-0.4,0.7-0.7c0.2-0.3,0.3-0.6,0.4-1c0.1-0.4,0.1-0.8,0.1-1.2C19.2,12.7,19.2,12.3,19.1,11.9z" />
	<path class="Blue38" d="M19,21.3L16.3,24c-0.4,0.4-0.4,1.2,0,1.6l4,4c0.4,0.4,1.2,0.4,1.6,0l2.7-2.7L19,21.3z" />
	<path class="Red38" d="M31.7,18.4l-4-4c-0.4-0.4-1.2-0.4-1.6,0L20,20.5l5.6,5.6l6.1-6.1C32.1,19.5,32.1,18.8,31.7,18.4z" />
</g>
</g>

<g transform="translate(238, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue39 { fill:#757575;}
	.Black39 { fill:#727272;}
	.Red39 { fill:#585858;}
	.st039 {opacity:0.5;}
</style>
<g class="st039" xmlns="http://www.w3.org/2000/svg">
	<path class="Black39" d="M28,10h-8V4h8V10z M24.6,14.9c0.6-0.6,1.4-0.9,2.2-0.9c0.4,0,0.8,0.1,1.2,0.2V12h-8v6h1.5L24.6,14.9z M0,26&#xD;&#xA;		h8v-6H0V26z M14.9,24.6l3.1-3.1V20h-8v6h4.1C14.3,25.5,14.5,25,14.9,24.6z" />
</g>
<path class="Blue39" d="M0,4h8v6H0V4z M0,18h8v-6H0V18z M10,10h8V4h-8V10z M10,18h8v-6h-8V18z M19,23.3L16.3,26&#xD;&#xA;	c-0.4,0.4-0.4,1.2,0,1.6l4,4c0.4,0.4,1.2,0.4,1.6,0l2.7-2.7L19,23.3z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red39" d="M31.7,20.4l-4-4c-0.4-0.4-1.2-0.4-1.6,0l-6.1,6.1l5.6,5.6l6.1-6.1C32.1,21.5,32.1,20.8,31.7,20.4z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red40 { fill:#585858;}
</style>
<path class="Red40" d="M27,4H5C4.5,4,4,4.5,4,5v22c0,0.5,0.5,1,1,1h22c0.5,0,1-0.5,1-1V5C28,4.5,27.5,4,27,4z M22,20l-2,2l-4-4l-4,4&#xD;&#xA;	l-2-2l4-4l-4-4l2-2l4,4l4-4l2,2l-4,4L22,20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st041 {fill:#727272;enable-background:new    ;}
</style>
<path class="st041" d="M30,8H2V6h28V8z M30,10H2v2h28V10z M30,14H2v2h28V14z M30,18H2v2h28V18z M30,22H2v2h28V22z" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="2" class="st041" width="28" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="26" class="st041" width="28" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black42 { fill:#727272;}
</style>
<path class="Black42" d="M14,6H4V4h10V6z M26,4H16v2h10V4z M14,8H4v2h10V8z M26,8H16v2h10V8z M14,12H4v2h10V12z M26,12H16v2h10V12z&#xD;&#xA;	 M14,16H4v2h10V16z M26,16H16v2h10V16z M14,20H4v2h10V20z M26,20H16v2h10V20z M14,24H4v2h10V24z M26,24H16v2h10V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st043 {fill:#727272;enable-background:new    ;}
</style>
<path class="st043" d="M10,8H2V6h8V8z M10,10H2v2h8V10z M10,14H2v2h8V14z M10,18H2v2h8V18z M10,22H2v2h8V22z" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="2" class="st043" width="8" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="26" class="st043" width="8" height="2" xmlns="http://www.w3.org/2000/svg" />
<path class="st043" d="M20,8h-8V6h8V8z M20,10h-8v2h8V10z M20,14h-8v2h8V14z M20,18h-8v2h8V18z M20,22h-8v2h8V22z" xmlns="http://www.w3.org/2000/svg" />
<rect x="12" y="2" class="st043" width="8" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="12" y="26" class="st043" width="8" height="2" xmlns="http://www.w3.org/2000/svg" />
<path class="st043" d="M30,8h-8V6h8V8z M30,10h-8v2h8V10z M30,14h-8v2h8V14z M30,18h-8v2h8V18z M30,22h-8v2h8V22z" xmlns="http://www.w3.org/2000/svg" />
<rect x="22" y="2" class="st043" width="8" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="22" y="26" class="st043" width="8" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st044 {fill:#727272;enable-background:new    ;}
</style>
<path class="st044" d="M15,8H2V6h13V8z M30,6H17v2h13V6z M15,10H2v2h13V10z M30,10H17v2h13V10z M15,14H2v2h13V14z M30,14H17v2h13V14z&#xD;&#xA;	 M15,18H2v2h13V18z M30,18H17v2h13V18z M15,22H2v2h13V22z M30,22H17v2h13V22z" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="2" class="st044" width="13" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="17" y="2" class="st044" width="13" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="26" class="st044" width="13" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="17" y="26" class="st044" width="13" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow45 { fill:#979797;}
	.Red45 { fill:#585858;}
	.Blue45 { fill:#757575;}
	.Green45 { fill:#404040;}
	.Black45 { fill:#727272;}
	.White45 { fill:#FFFFFF;}
	.st045 {opacity:0.75;}
</style>
<g id="Copy" xmlns="http://www.w3.org/2000/svg">
	<path class="Black45" d="M21,2H11c-0.5,0-1,0.5-1,1v5H5C4.5,8,4,8.5,4,9v20c0,0.5,0.5,1,1,1h16c0.5,0,1-0.5,1-1v-5h5c0.5,0,1-0.5,1-1&#xD;&#xA;		V9L21,2z M20,28H6V10h8v5c0,0.5,0.5,1,1,1h5V28z M26,22h-4v-7l-7-7h-3V4h8v5c0,0.5,0.5,1,1,1h5V22z" />
</g>
</g>

<g transform="translate(170, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow46 { fill:#979797;}
	.Red46 { fill:#585858;}
	.Blue46 { fill:#757575;}
	.Green46 { fill:#404040;}
	.Black46 { fill:#727272;}
	.White46 { fill:#FFFFFF;}
	.st046 {opacity:0.5;}
	.st146 {display:none;}
	.st246 { fill:#404040;}
	.st346 { fill:#585858;}
	.st446 { fill:#727272;}
</style>
<g id="Cut" xmlns="http://www.w3.org/2000/svg">
	<path class="Black46" d="M16.4,11.6L26,2l-5.8,13.3L16.4,11.6z M12,23c0,2.8-2.2,5-5,5s-5-2.2-5-5s2.2-5,5-5S12,20.2,12,23z M10,23&#xD;&#xA;		c0-1.7-1.3-3-3-3s-3,1.3-3,3s1.3,3,3,3S10,24.7,10,23z M28,23c0,2.8-2.2,5-5,5s-5-2.2-5-5c0-0.9,0.2-1.7,0.6-2.4L16,18h-5L4,2&#xD;&#xA;		l16.6,16.6c0.7-0.4,1.5-0.6,2.4-0.6C25.8,18,28,20.2,28,23z M26,23c0-1.7-1.3-3-3-3s-3,1.3-3,3s1.3,3,3,3S26,24.7,26,23z" />
</g>
</g>

<g transform="translate(476, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st047 {fill:#727272;}
</style>
<path class="st047" d="M18.8,16l6.9-6.9c0.4-0.4,0.4-1,0-1.4l-1.4-1.4c-0.4-0.4-1-0.4-1.4,0L16,13.2L9.1,6.3c-0.4-0.4-1-0.4-1.4,0&#xD;&#xA;	L6.3,7.7c-0.4,0.4-0.4,1,0,1.4l6.9,6.9l-6.9,6.9c-0.4,0.4-0.4,1,0,1.4l1.4,1.4c0.4,0.4,1,0.4,1.4,0l6.9-6.9l6.9,6.9&#xD;&#xA;	c0.4,0.4,1,0.4,1.4,0l1.4-1.4c0.4-0.4,0.4-1,0-1.4L18.8,16z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black48 { fill:#727272;}
	.Red48 { fill:#585858;}
</style>
<path id="Hyperlink" class="Black48" d="M16.8,18c1.3,1.9,1.1,4.6-0.6,6.3l-4.2,4.2c-2,2-5.1,2-7.1,0l-1.4-1.4c-2-2-2-5.1,0-7.1&#xD;&#xA;	l4.2-4.2c1.7-1.7,4.3-1.9,6.3-0.6l-1.5,1.5c-1.1-0.5-2.5-0.3-3.4,0.6l-4.2,4.2c-1.2,1.2-1.2,3.1,0,4.2l1.4,1.4&#xD;&#xA;	c1.2,1.2,3.1,1.2,4.2,0l4.2-4.2c0.9-0.9,1.1-2.3,0.6-3.4L16.8,18z M28.5,4.9l-1.4-1.4c-2-2-5.1-2-7.1,0l-4.2,4.2&#xD;&#xA;	c-1.7,1.7-1.9,4.3-0.6,6.3l1.5-1.5c-0.5-1.1-0.3-2.5,0.6-3.4l4.2-4.2c1.2-1.2,3.1-1.2,4.2,0l1.4,1.4c1.2,1.2,1.2,3.1,0,4.2l-4.2,4.2&#xD;&#xA;	c-0.9,0.9-2.3,1.1-3.4,0.6L18,16.8c1.9,1.3,4.6,1.1,6.3-0.6l4.2-4.2C30.5,10,30.5,6.8,28.5,4.9z M21.7,11.7c0.4-0.4,0.4-1,0-1.4l0,0&#xD;&#xA;	c-0.4-0.4-1-0.4-1.4,0l-10,10c-0.4,0.4-0.4,1,0,1.4l0,0c0.4,0.4,1,0.4,1.4,0L21.7,11.7z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Red48" points="32,22 30,20 26,24 22,20 20,22 24,26 20,30 22,32 26,28 30,32 32,30 28,26 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow49 { fill:#979797;}
	.Red49 { fill:#585858;}
	.Blue49 { fill:#757575;}
	.Green49 { fill:#404040;}
	.Black49 { fill:#727272;}
	.White49 { fill:#FFFFFF;}
	.st049 {opacity:0.5;}
	.st149 {display:none;}
	.st249 { fill:#404040;}
	.st349 { fill:#585858;}
	.st449 { fill:#727272;}
</style>
<g id="Delete" xmlns="http://www.w3.org/2000/svg">
	<path class="Red49" d="M18.8,16l8.9-8.9c0.4-0.4,0.4-1,0-1.4l-1.4-1.4c-0.4-0.4-1-0.4-1.4,0L16,13.2L7.1,4.3c-0.4-0.4-1-0.4-1.4,0&#xD;&#xA;		L4.3,5.7c-0.4,0.4-0.4,1,0,1.4l8.9,8.9l-8.9,8.9c-0.4,0.4-0.4,1,0,1.4l1.4,1.4c0.4,0.4,1,0.4,1.4,0l8.9-8.9l8.9,8.9&#xD;&#xA;		c0.4,0.4,1,0.4,1.4,0l1.4-1.4c0.4-0.4,0.4-1,0-1.4L18.8,16z" />
</g>
</g>

<g transform="translate(340, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st050 {fill:#727272;}
	.st150 {opacity:0.5;}
</style>
<path class="st050" d="M8,8H0V2h8V8z M18,2h-8v6h8V2z M28,2h-8v6h8V2z" xmlns="http://www.w3.org/2000/svg" />
<g class="st150" xmlns="http://www.w3.org/2000/svg">
	<path class="st050" d="M8,16H0v-6h8V16z M18,10h-8v6h8V10z M28,10h-8v6h8V10z M8,18H0v6h8V18z M18,18h-8v6h8V18z" />
</g>
<polygon class="st050" points="32,20 30,18 26,22 22,18 20,20 24,24 20,28 22,30 26,26 30,30 32,28 28,24 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black51 { fill:#727272;}
	.Red51 { fill:#585858;}
	.st051 {opacity:0.5;}
</style>
<g class="st051" xmlns="http://www.w3.org/2000/svg">
	<path class="Black51" d="M10,14H2V8h8V14z M30,8h-8v6h8V8z M10,6H2V0h8V6z M20,0h-8v6h8V0z M30,0h-8v6h8V0z M10,16H2v6h8V16z M20,16&#xD;&#xA;		h-8v6h8V16z M30,16h-8v6h8V16z" />
</g>
<path class="Red51" d="M20,28l-4,4l-4-4h2v-4h4v4H20z M20,8h-8v6h8V8z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black52 { fill:#727272;}
	.Red52 { fill:#585858;}
	.st052 {opacity:0.5;}
</style>
<g class="st052" xmlns="http://www.w3.org/2000/svg">
	<path class="Black52" d="M10,14H2V8h8V14z M30,8h-8v6h8V8z M10,6H2V0h8V6z M30,0h-8v6h8V0z M10,16H2v6h8V16z M30,16h-8v6h8V16z" />
</g>
<path class="Red52" d="M20,28l-4,4l-4-4h2v-4h4v4H20z M20,0h-8v22h8V0z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black53 { fill:#727272;}
	.Red53 { fill:#585858;}
	.st053 {opacity:0.5;}
</style>
<g class="st053" xmlns="http://www.w3.org/2000/svg">
	<path class="Black53" d="M20,10h-8V4h8V10z M30,4h-8v6h8V4z M30,22h-8v6h8V22z M20,22h-8v6h8V22z" />
</g>
<path class="Red53" d="M6,14h4v4H6v2l-4-4l4-4V14z M12,12v8h18v-8H12z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black54 { fill:#727272;}
	.Green54 { fill:#404040;}
</style>
<path class="Green54" d="M19,12H3c-0.5,0-1,0.5-1,1v18c0,0.5,0.5,1,1,1h16c0.5,0,1-0.5,1-1V13C20,12.5,19.5,12,19,12z M12,26h-2v-5.2&#xD;&#xA;	H8v-1.2c0.3,0,0.6,0,0.8-0.1c0.3,0,0.5-0.1,0.7-0.3c0.2-0.1,0.4-0.3,0.5-0.5c0.1-0.2,0.2-0.5,0.3-0.8H12V26z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black54" d="M31,0H15c-0.5,0-1,0.5-1,1v3h-3c-0.5,0-1,0.5-1,1v3H7C6.5,8,6,8.5,6,9v3h2v-2h14v16h-2v2h3c0.5,0,1-0.5,1-1&#xD;&#xA;	v-3h3c0.5,0,1-0.5,1-1v-3h3c0.5,0,1-0.5,1-1V1C32,0.5,31.5,0,31,0z M26,22h-2V9c0-0.5-0.5-1-1-1H12V6h14V22z M30,18h-2V5&#xD;&#xA;	c0-0.5-0.5-1-1-1H16V2h14V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black55 { fill:#727272;}
	.Green55 { fill:#404040;}
</style>
<path class="Green55" d="M28,5v18c0,0.5-0.5,1-1,1h-5V10H10V5c0-0.5,0.5-1,1-1h16C27.5,4,28,4.5,28,5z M3,32h16c0.5,0,1-0.5,1-1V13&#xD;&#xA;	c0-0.6-0.5-1-1-1H3c-0.5,0-1,0.4-1,1v18C2,31.5,2.5,32,3,32z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black55" d="M24,9v18c0,0.5-0.5,1-1,1h-3v-2h2V10H8v2H6V9c0-0.5,0.5-1,1-1h16C23.5,8,24,8.5,24,9z M31,0H15&#xD;&#xA;	c-0.5,0-1,0.5-1,1v3h2V2h14v16h-2v2h3c0.5,0,1-0.5,1-1V1C32,0.5,31.5,0,31,0z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black56 { fill:#727272;}
	.Red56 { fill:#585858;}
	.Blue56 { fill:#757575;}
</style>
<path class="Black56" d="M6,6h14v2H6V6z M6,12h14v-2H6V12z M14.9,24.6l0.6-0.6H2V2h22v13.5l0.6-0.6c0.4-0.4,0.9-0.7,1.4-0.8V1&#xD;&#xA;	c0-0.5-0.5-1-1-1H1C0.5,0,0,0.5,0,1v24c0,0.5,0.5,1,1,1h13.1C14.3,25.5,14.5,25,14.9,24.6z M6,16h14v-2H6V16z M6,20h14v-2H6V20z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue56" d="M19,23.3L16.3,26c-0.4,0.4-0.4,1.2,0,1.6l4,4c0.4,0.4,1.2,0.4,1.6,0l2.7-2.7L19,23.3z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red56" d="M31.7,20.4l-4-4c-0.4-0.4-1.2-0.4-1.6,0l-6.1,6.1l5.6,5.6l6.1-6.1C32.1,21.5,32.1,20.8,31.7,20.4z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow57 { fill:#979797;}
	.Black57 { fill:#727272;}
</style>
<path class="Yellow57" d="M31,24h-1v-3c0-1.7-1.3-3-3-3h-2c-1.7,0-3,1.3-3,3v3h-1c-0.6,0-1,0.4-1,1v6c0,0.6,0.4,1,1,1h10&#xD;&#xA;	c0.6,0,1-0.4,1-1v-6C32,24.4,31.6,24,31,24z M24,21c0-0.6,0.4-1,1-1h2c0.6,0,1,0.4,1,1v3h-4V21z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black57" d="M10,22h10v0.2c-0.9,0.3-1.5,1-1.8,1.8H10V22z M27,4H12.3c0,0,0,0,0,0c0,0.1,0.1,0.2,0.1,0.4&#xD;&#xA;	C12.6,5,12.5,5.6,12.3,6H26v10h1c0.3,0,0.7,0,1,0.1V5C28,4.4,27.6,4,27,4z M10,18v2h10.1c0.2-0.7,0.5-1.4,0.9-2h-5H10z M6,18H4v11&#xD;&#xA;	c0,0.6,0.4,1,1,1h13v-2H6V18z M16,15.1V16h6v-2h-6.1C16,14.3,16,14.7,16,15.1z M15.4,12H22v-2h-8.6C14.1,10.4,14.9,11,15.4,12z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black57" d="M3.7,5.7C3.6,5.4,3.4,5.2,3.5,4.8c0-0.1,0.2-0.2,0.3-0.2C3.1,2.4,3.8,0.2,6.3,0C9-0.2,9.5,1.8,9.5,1.8&#xD;&#xA;	s1.4-0.1,0.6,2.9c0.1,0,0.3,0,0.3,0.2c0.1,0.3,0,0.6-0.2,0.9c-0.1,0.3,0.1,1-0.5,1c0,0,0,0.1,0,0.1c-0.3,1.4-1.2,3-2.8,3&#xD;&#xA;	c-1.6,0-2.4-1.6-2.8-3c0,0,0-0.1,0-0.1C3.7,6.7,3.9,6,3.7,5.7z M9.3,9.9c-0.5,0.9-1.2,2.5-2.3,2.5c-1.1,0-1.8-1.6-2.3-2.6&#xD;&#xA;	C3.4,12.1,0,10.5,0,15.1V16h14v-0.9C14,10.5,10.7,12,9.3,9.9z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(510, 34)">
<path d="M20.7,18.6l-4.9-5.1c0.8-1.2,1.2-2.6,1.2-4C17,5.4,13.6,2,9.5,2S2,5.4,2,9.5S5.4,17,9.5,17c1.5,0,3-0.5,4.2-1.3l4.9,4.9&#xD;&#xA;	c0.4,0.4,1.1,0.4,1.5,0l0.6-0.6C21.1,19.7,21.1,19,20.7,18.6z M4,9.5C4,6.5,6.5,4,9.5,4c3,0,5.5,2.5,5.5,5.5c0,3-2.5,5.5-5.5,5.5&#xD;&#xA;	C6.5,15,4,12.5,4,9.5z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(510, 0)">
<path d="M20.7,18.6l-4.9-5.1c0.8-1.2,1.2-2.6,1.2-4C17,5.4,13.6,2,9.5,2S2,5.4,2,9.5S5.4,17,9.5,17c1.5,0,3-0.5,4.2-1.3l4.9,4.9&#xD;&#xA;	c0.4,0.4,1.1,0.4,1.5,0l0.6-0.6C21.1,19.7,21.1,19,20.7,18.6z M4,9.5C4,6.5,6.5,4,9.5,4c3,0,5.5,2.5,5.5,5.5c0,3-2.5,5.5-5.5,5.5&#xD;&#xA;	C6.5,15,4,12.5,4,9.5z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue60 { fill:#757575;}
</style>
<path class="Blue60" d="M10.4,14.5c-0.5,0.3-0.5,0.8,0,1.1l16.8,10.3c0.5,0.3,0.9,0.1,0.9-0.5V4.6c0-0.6-0.4-0.8-0.9-0.5L10.4,14.5z&#xD;&#xA;	 M4,25V5c0-0.6,0.4-1,1-1h2c0.6,0,1,0.4,1,1v20c0,0.5-0.4,1-1,1H5C4.4,26,4,25.5,4,25z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow61 { fill:#979797;}
	.Black61 { fill:#727272;}
</style>
<path class="Black61" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M18,6H4V4h14V6z M18,10H4V8h14V10z M26,14H4v-2h22V14z M26,18H4v-2h22V18z M26,22H4v-2h22V22z M26,26H4v-2h22V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="20" y="4" class="Yellow61" width="6" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black62 { fill:#727272;}
	.Yellow62 { fill:#979797;}
</style>
<path class="Yellow62" d="M22,21c0,0.6-0.4,1-1,1H3c-0.6,0-1-0.4-1-1V3c0-0.6,0.4-1,1-1h18c0.6,0,1,0.4,1,1V21z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black62" d="M29,14h-5v2h4v12H16v-4h-2v5c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1V15C30,14.4,29.6,14,29,14z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black63 { fill:#727272;}
	.Blue63 { fill:#757575;}
</style>
<path class="Black63" d="M4,8h14v2H4V8z M4,6h14V4H4V6z M10,21c0-0.3,0-0.7,0.1-1H2V2h18v8.1c0.3,0,0.7-0.1,1-0.1s0.7,0,1,0.1V1&#xD;&#xA;	c0-0.5-0.5-1-1-1H1C0.5,0,0,0.5,0,1v20c0,0.5,0.5,1,1,1h9.1C10,21.7,10,21.3,10,21z M4,14h8.5c0.6-0.8,1.4-1.4,2.2-2H4V14z M4,18&#xD;&#xA;	h6.4c0.2-0.7,0.5-1.4,0.8-2H4V18z" xmlns="http://www.w3.org/2000/svg" />
<circle class="Blue63" cx="21" cy="21" r="9" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black64 { fill:#727272;}
	.Yellow64 { fill:#979797;}
</style>
<path class="Yellow64" d="M26,25c0,0.6-0.4,1-1,1H7c-0.6,0-1-0.4-1-1V7c0-0.6,0.4-1,1-1h18c0.6,0,1,0.4,1,1V25z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black64" d="M32,19v12c0,0.6-0.4,1-1,1H19c-0.6,0-1-0.4-1-1v-3h2v2h10V20h-2v-2h3C31.6,18,32,18.4,32,19z M1,14h3v-2H2V2&#xD;&#xA;	h10v2h2V1c0-0.6-0.4-1-1-1H1C0.4,0,0,0.4,0,1v12C0,13.6,0.4,14,1,14z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black65 { fill:#727272;}
	.Blue65 { fill:#757575;}
</style>
<path class="Black65" d="M4,8h14v2H4V8z M4,6h14V4H4V6z M10,21c0-0.3,0-0.7,0.1-1H2V2h18v8.1c0.3,0,0.7-0.1,1-0.1s0.7,0,1,0.1V1&#xD;&#xA;	c0-0.5-0.5-1-1-1H1C0.5,0,0,0.5,0,1v20c0,0.5,0.5,1,1,1h9.1C10,21.7,10,21.3,10,21z M4,14h8.5c0.6-0.8,1.4-1.4,2.2-2H4V14z M4,18&#xD;&#xA;	h6.4c0.2-0.7,0.5-1.4,0.8-2H4V18z" xmlns="http://www.w3.org/2000/svg" />
<circle class="Blue65" cx="21" cy="21" r="9" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue66 { fill:#757575;}
	.Black66 { fill:#727272;}
</style>
<path class="Black66" d="M29,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h28c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z M28,28H2V2h26V28z&#xD;&#xA;	 M6,22H4v-2h2V22z M4,26h22v-2H4V26z M6,12H4v2h2V12z M6,8H4v2h2V8z M6,16H4v2h2V16z M4,4v2h2h18h2V4H4z M24,22h2v-2h-2V22z M24,10&#xD;&#xA;	h2V8h-2V10z M24,14h2v-2h-2V14z M24,18h2v-2h-2V18z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue66" d="M8,8v6h6V8H8z M12,12h-2v-2h2V12z M16,8v6h6V8H16z M20,12h-2v-2h2V12z M16,16v6h6v-6H16z M20,20h-2v-2h2V20z&#xD;&#xA;	 M8,16v6h6v-6H8z M12,20h-2v-2h2V20z M16,12h-2v-2h2V12z M12,14h-2v2h2V14z M20,14h-2v2h2V14z M16,18h-2v2h2V18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black67 { fill:#727272;}
	.Blue67 { fill:#757575;}
</style>
<polygon class="Black67" points="17.2,10 19.2,8 2,8 2,22 10,22 10,20 4,20 4,10 " xmlns="http://www.w3.org/2000/svg" />
<path class="Blue67" d="M27,11L17,21l-4-4L23,7L27,11z M28,10l1.7-1.7c0.4-0.4,0.4-1,0-1.3l-2.7-2.7c-0.4-0.4-1-0.4-1.3,0L24,6L28,10z&#xD;&#xA;	 M12,18v4h4L12,18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black68 { fill:#727272;}
	.Yellow68 { fill:#979797;}
</style>
<path class="Black68" d="M29,14H15c-0.6,0-1,0.4-1,1v14c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1V15C30,14.4,29.6,14,29,14z M28,28H16V16&#xD;&#xA;	h12V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Yellow68" d="M12,14c0-1.1,0.9-2,2-2h8V3c0-0.6-0.4-1-1-1H3C2.4,2,2,2.4,2,3v18c0,0.6,0.4,1,1,1h9V14z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black69 { fill:#727272;}
	.Blue69 { fill:#757575;}
</style>
<path class="Black69" d="M21,0H1C0.5,0,0,0.5,0,1v20c0,0.5,0.5,1,1,1h20c0.5,0,1-0.5,1-1V1C22,0.5,21.5,0,21,0z M20,20H2V2h18V20z&#xD;&#xA;	 M18,6H4V4h14V6z M18,10H4V8h14V10z M18,14H4v-2h14V14z M18,18H4v-2h14V18z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue69" d="M24,12.5V22c0,1.1-0.9,2-2,2h-9.5c1.2,3.5,4.6,6,8.5,6c5,0,9-4,9-9C30,17.1,27.5,13.8,24,12.5z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black70 { fill:#727272;}
	.Yellow70 { fill:#979797;}
</style>
<path class="Black70" d="M13,0H1C0.4,0,0,0.4,0,1v12c0,0.6,0.4,1,1,1h12c0.6,0,1-0.4,1-1V1C14,0.4,13.6,0,13,0z M12,12H2V2h10V12z&#xD;&#xA;	 M31,18H19c-0.6,0-1,0.4-1,1v12c0,0.6,0.4,1,1,1h12c0.6,0,1-0.4,1-1V19C32,18.4,31.6,18,31,18z M30,30H20V20h10V30z" xmlns="http://www.w3.org/2000/svg" />
<path class="Yellow70" d="M25,6h-9v8c0,1.1-0.9,2-2,2H6v9c0,0.6,0.4,1,1,1h9v-8c0-1.1,0.9-2,2-2h8V7C26,6.4,25.6,6,25,6z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black71 { fill:#727272;}
	.Blue71 { fill:#757575;}
</style>
<path class="Black71" d="M31,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h30c0.5,0,1-0.5,1-1V1C32,0.5,31.5,0,31,0z M30,28H2V2h28V28z&#xD;&#xA;	 M6,22H4v-2h2V22z M6,16H4v2h2V16z M6,8H4v2h2V8z M4,26h24v-2H4V26z M6,12H4v2h2V12z M4,4v2h24V4H4z M26,22h2v-2h-2V22z M26,10h2V8&#xD;&#xA;	h-2V10z M26,14h2v-2h-2V14z M26,18h2v-2h-2V18z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue71" d="M20.1,16.2C21.8,14.5,24,11.6,24,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C10.8,16.7,10,17.7,10,19&#xD;&#xA;	c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C22,17.7,21.2,16.7,20.1,16.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st072 {fill:#727272;}
</style>
<path class="st072" d="M21.7,28H26L17.3,4h-0.4H13h-0.4L4,28h4.3l2.2-6h9.1L21.7,28z M11.9,18L15,9.4l3.1,8.6H11.9z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st073 {fill:#727272;}
	.st173 {opacity:0.5;fill:#727272;}
	.st273 {opacity:0.75;fill:#727272;}
</style>
<path id="layer_3_" class="st073" d="M18,25.5c4,4-2.5-2.5,1.5,1.5c0,5.4-6.5,5-8.5,5C15.5,27.5,14.3,25.5,18,25.5z" xmlns="http://www.w3.org/2000/svg" />
<path id="layer_2_" class="st173" d="M31,14L31,14c-0.4-0.4-1.5-1.5-3,0l-9,9l3,3l9-9C32.5,15.5,31.4,14.4,31,14z" xmlns="http://www.w3.org/2000/svg" />
<path id="layer_1_" class="st273" d="M19,23L19,23c-0.4,0.4-1.4,2.1-1,2.5l1.5,1.5c0.4,0.4,2.1-0.6,2.5-1l0,0L19,23z" xmlns="http://www.w3.org/2000/svg" />
<path id="layer" class="st073" d="M17.8,21.2l2.8-2.8L14,0h-4L2,22h3.9l1.8-5.6h8.5L17.8,21.2z M8.6,13.4l2.9-8.8&#xD;&#xA;	c0.1-0.4,0.2-0.8,0.3-1.4h0.1c0.1,0.7,0.2,1.1,0.3,1.4l3,8.8H8.6z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st074 {fill:#727272;}
</style>
<path class="st074" d="M21.7,28H26L17.3,4h-0.4H13h-0.4L4,28h4.3l2.2-6h9.1L21.7,28z M11.9,18L15,9.4l3.1,8.6H11.9z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st075 {fill:#727272;}
</style>
<path class="st075" d="M19.7,28H24L15.3,4h-0.4H11h-0.4L2,28h4.3l2.2-6h9.1L19.7,28z M9.9,18L13,9.4l3.1,8.6H9.9z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="st075" points="30,8 32,8 29,4 26,8 28,8 28,24 26,24 29,28 32,24 30,24 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black76 { fill:#727272;}
	.Blue76 { fill:#757575;}
</style>
<path class="Black76" d="M22,28h-2.7l-1.2-4h-6.1l-1.2,4H8l5.6-16h2.8L22,28z M17.3,22l-2.1-6.6c-0.1-0.2-0.1-0.5-0.2-1h0&#xD;&#xA;	c-0.1,0.4-0.1,0.8-0.2,1L12.7,22H17.3z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Blue76" points="22,4 30,4 26,8 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black77 { fill:#727272;}
	.Blue77 { fill:#757575;}
</style>
<polygon class="Blue77" points="22,8 30,8 26,4 " xmlns="http://www.w3.org/2000/svg" />
<path class="Black77" d="M24,28h-3.9l-1.9-5.6H9.7L7.9,28H4l8-22h4L24,28z M17.2,19.4l-3-8.8c-0.1-0.3-0.2-0.7-0.3-1.4h-0.1&#xD;&#xA;	c-0.1,0.6-0.2,1-0.3,1.4l-2.9,8.8H17.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black78 { fill:#727272;}
	.Yellow78 { fill:#979797;}
	.st078 {opacity:0.75;}
</style>
<path class="Black78" d="M25,2H5C4.5,2,4,2.5,4,3v24c0,0.5,0.5,1,1,1h20c0.5,0,1-0.5,1-1V3C26,2.5,25.5,2,25,2z M24,26H6V4h18V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="8" y="18" class="Yellow78" width="14" height="6" xmlns="http://www.w3.org/2000/svg" />
<g class="st078" xmlns="http://www.w3.org/2000/svg">
	<path class="Black78" d="M22,8H8V6h14V8z M22,10H8v2h14V10z M22,14H8v2h14V14z" />
</g>
</g>

<g transform="translate(408, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue79 { fill:#757575;}
	.Yellow79 { fill:#979797;}
	.Black79 { fill:#727272;}
	.Green79 { fill:#404040;}
	.Red79 { fill:#585858;}
	.st079 {opacity:0.75;}
	.st179 {opacity:0.5;}
</style>
<g id="FullScreen" xmlns="http://www.w3.org/2000/svg">
	<polygon class="Black79" points="2,12 6,12 6,6 12,6 12,2 2,2 	" />
	<polygon class="Black79" points="6,20 2,20 2,30 12,30 12,26 6,26 	" />
	<polygon class="Black79" points="20,2 20,6 26,6 26,12 30,12 30,2 	" />
	<polygon class="Black79" points="26,26 20,26 20,30 30,30 30,20 26,20 	" />
</g>
</g>

<g transform="translate(170, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black80 { fill:#727272;}
	.Yellow80 { fill:#979797;}
	.st080 {opacity:0.75;}
</style>
<g class="st080" xmlns="http://www.w3.org/2000/svg">
	<path class="Black80" d="M28,10H10V4h18V10z M18,12H8v2h10V12z M18,18H8v-2h10V18z M18,22H8v-2h10V22z" />
</g>
<rect x="10" y="24" class="Yellow80" width="18" height="6" xmlns="http://www.w3.org/2000/svg" />
<path class="Black80" d="M6,26h4v2H5c-0.5,0-1-0.5-1-1V7c0-0.5,0.5-1,1-1h5v2H6V26z M20,10v14h2V10H20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black81 { fill:#727272;}
	.Yellow81 { fill:#979797;}
	.st081 {opacity:0.75;}
</style>
<g class="st081" xmlns="http://www.w3.org/2000/svg">
	<path class="Black81" d="M28,30H10v-6h18V30z M18,12H8v2h10V12z M18,18H8v-2h10V18z M18,22H8v-2h10V22z" />
</g>
<rect x="10" y="4" class="Yellow81" width="18" height="6" xmlns="http://www.w3.org/2000/svg" />
<path class="Black81" d="M6,26h4v2H5c-0.5,0-1-0.5-1-1V7c0-0.5,0.5-1,1-1h5v2H6V26z M20,10v14h2V10H20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Green82 { fill:#404040;}
	.Black82 { fill:#727272;}
	.Yellow82 { fill:#979797;}
	.st082 {opacity:0.75;}
</style>
<g class="st082" xmlns="http://www.w3.org/2000/svg">
	<path class="Black82" d="M18,14H8v-2h10V14z M18,16H8v2h10V16z M18,20H8v2h10V20z" />
</g>
<rect x="10" y="4" class="Yellow82" width="18" height="6" xmlns="http://www.w3.org/2000/svg" />
<path class="Black82" d="M20,10v16H6V8h4V6H5C4.5,6,4,6.5,4,7v20c0,0.5,0.5,1,1,1h16c0.5,0,1-0.5,1-1V10H20z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Green82" points="24,20 24,32 30,26 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Green83 { fill:#404040;}
	.Black83 { fill:#727272;}
	.Yellow83 { fill:#979797;}
	.st083 {opacity:0.75;}
</style>
<g class="st083" xmlns="http://www.w3.org/2000/svg">
	<path class="Black83" d="M18,14H8v-2h10V14z M18,16H8v2h10V16z M18,20H8v2h10V20z" />
</g>
<rect x="10" y="4" class="Yellow83" width="18" height="6" xmlns="http://www.w3.org/2000/svg" />
<path class="Black83" d="M20,10v16H6V8h4V6H5C4.5,6,4,6.5,4,7v20c0,0.5,0.5,1,1,1h16c0.5,0,1-0.5,1-1V10H20z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Green83" points="30,20 30,32 24,26 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black84 { fill:#727272;}
	.Yellow84 { fill:#979797;}
	.st084 {opacity:0.75;}
</style>
<path class="Black84" d="M25,2H5C4.5,2,4,2.5,4,3v24c0,0.5,0.5,1,1,1h20c0.5,0,1-0.5,1-1V3C26,2.5,25.5,2,25,2z M24,26H6V4h18V26z" xmlns="http://www.w3.org/2000/svg" />
<rect x="8" y="6" class="Yellow84" width="14" height="6" xmlns="http://www.w3.org/2000/svg" />
<g class="st084" xmlns="http://www.w3.org/2000/svg">
	<path class="Black84" d="M22,16H8v-2h14V16z M22,18H8v2h14V18z M22,22H8v2h14V22z" />
</g>
</g>

<g transform="translate(408, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow85 { fill:#979797;}
	.Red85 { fill:#585858;}
	.Blue85 { fill:#757575;}
	.Green85 { fill:#404040;}
	.Black85 { fill:#727272;}
	.White85 { fill:#FFFFFF;}
	.st085 {opacity:0.75;}
</style>
<g id="Highlight" xmlns="http://www.w3.org/2000/svg">
	<path class="Black85" d="M0.8,5.4c0.3-0.4,0.7-0.8,1.1-1C2.3,4.1,2.8,4,3.4,3.8C4,3.7,4.5,3.6,5.1,3.6c0.5,0,1,0,1.6,0.1&#xD;&#xA;		c0.5,0.1,1,0.2,1.4,0.4c0.4,0.2,0.7,0.5,1,0.9s0.4,0.9,0.4,1.5v5.3c0,0.5,0,0.9,0.1,1.3c0.1,0.4,0.1,0.7,0.3,0.9H7.1&#xD;&#xA;		C7,13.9,7,13.7,6.9,13.5c0-0.2-0.1-0.3-0.1-0.5c-0.4,0.5-1,0.8-1.6,1S4,14.3,3.4,14.3c-0.5,0-0.9-0.1-1.4-0.2&#xD;&#xA;		c-0.3-0.1-0.7-0.3-1-0.6S0.4,13,0.3,12.6C0.1,12.2,0,11.8,0,11.2s0.1-1,0.3-1.4s0.5-0.7,0.8-0.9s0.7-0.4,1.1-0.5S3,8.2,3.4,8.2&#xD;&#xA;		C3.9,8.1,4.3,8.1,4.7,8c0.4,0,0.8-0.1,1.1-0.2c0.3-0.1,0.6-0.2,0.7-0.3c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3,0-0.5-0.1-0.7&#xD;&#xA;		C6.5,5.9,6.4,5.8,6.2,5.7C6,5.6,5.9,5.5,5.6,5.5c-0.2,0-0.4,0-0.7,0c-0.5,0-1,0.1-1.3,0.4C3.3,6,3.2,6.4,3.1,7H0.3&#xD;&#xA;		C0.4,6.3,0.5,5.8,0.8,5.4z M6.3,9.3C6.1,9.4,5.9,9.4,5.7,9.4c-0.2,0-0.4,0.1-0.6,0.1S4.7,9.6,4.4,9.6C4.2,9.7,4,9.7,3.8,9.8&#xD;&#xA;		C3.6,9.9,3.4,10,3.3,10.1c-0.2,0.1-0.3,0.3-0.4,0.4c-0.1,0.2-0.1,0.4-0.1,0.6c0,0.2,0,0.5,0.1,0.6C3,11.9,3.1,12,3.3,12.1&#xD;&#xA;		c0.2,0.1,0.3,0.2,0.5,0.2s0.4,0.1,0.6,0.1c0.5,0,1-0.1,1.3-0.3c0.3-0.2,0.5-0.4,0.7-0.7c0.1-0.3,0.2-0.5,0.3-0.8c0-0.3,0-0.5,0-0.6&#xD;&#xA;		V9C6.6,9.2,6.5,9.2,6.3,9.3z M14.5,0v5.1l0,0c0.3-0.5,0.8-0.9,1.4-1.1c0.6-0.2,1.2-0.4,1.8-0.4c0.5,0,1,0.1,1.5,0.3s0.9,0.5,1.3,1&#xD;&#xA;		c0.4,0.4,0.7,1,1,1.7c0.2,0.7,0.4,1.5,0.4,2.4c0,0.9-0.1,1.7-0.4,2.4c-0.2,0.7-0.6,1.2-1,1.7c-0.4,0.4-0.8,0.8-1.3,1&#xD;&#xA;		s-1,0.3-1.5,0.3c-0.7,0-1.4-0.1-2-0.4c-0.6-0.2-1-0.6-1.3-1.2l0,0V14h-2.6V0H14.5z M19,7.7c-0.1-0.4-0.2-0.7-0.4-1&#xD;&#xA;		c-0.2-0.3-0.4-0.5-0.7-0.7c-0.3-0.2-0.7-0.3-1.1-0.3S16,5.8,15.7,6c-0.3,0.2-0.5,0.4-0.7,0.7c-0.2,0.3-0.3,0.6-0.4,1&#xD;&#xA;		c-0.1,0.4-0.1,0.8-0.1,1.2s0,0.8,0.1,1.2s0.2,0.7,0.4,1s0.4,0.5,0.7,0.7s0.7,0.3,1.1,0.3s0.8-0.1,1.1-0.3c0.3-0.2,0.5-0.4,0.7-0.7&#xD;&#xA;		s0.3-0.6,0.4-1s0.1-0.8,0.1-1.2S19.1,8.1,19,7.7z" />
	<path class="Blue85" d="M29,15l-8,8l-4-4l8-8L29,15z M30,14l1.7-1.7c0.4-0.4,0.4-1,0-1.3L29,8.3c-0.4-0.4-1-0.4-1.3,0L26,10L30,14z&#xD;&#xA;		 M16,20v4h4L16,20z" />
	<rect y="26" class="Yellow85" width="32" height="6" />
</g>
</g>

<g transform="translate(34, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue86 {fill:#1177D7;}
	.Yellow86 {fill:#FFB115;}
	.Black86 {fill:#727272;}
	.Green86 {fill:#039C23;}
	.Red86 {fill:#D11C1C;}
	.st086 {opacity:0.75;}
	.st186 {opacity:0.5;}
</style>
<g id="Hyperlink" xmlns="http://www.w3.org/2000/svg">
	<path class="Black86" d="M10.3,21.7c0.4,0.4,1,0.4,1.4,0l10-10c0.4-0.4,0.4-1,0-1.4c-0.4-0.4-1-0.4-1.4,0l-10,10&#xD;&#xA;		C9.9,20.7,9.9,21.3,10.3,21.7z" />
	<path class="Black86" d="M15.4,19.5c0.5,1.1,0.3,2.5-0.6,3.4l-4.2,4.2c-1.2,1.2-3.1,1.2-4.2,0l-1.4-1.4c-1.2-1.2-1.2-3.1,0-4.2&#xD;&#xA;		l4.2-4.2c0.9-0.9,2.3-1.1,3.4-0.6l1.5-1.5c-1.9-1.3-4.6-1.1-6.3,0.6l-4.2,4.2c-2,2-2,5.1,0,7.1l1.4,1.4c2,2,5.1,2,7.1,0l4.2-4.2&#xD;&#xA;		c1.7-1.7,1.9-4.3,0.6-6.3L15.4,19.5z" />
	<path class="Black86" d="M28.5,4.9l-1.4-1.4c-2-2-5.1-2-7.1,0l-4.2,4.2c-1.7,1.7-1.9,4.3-0.6,6.3l1.5-1.5c-0.5-1.1-0.3-2.5,0.6-3.4&#xD;&#xA;		l4.2-4.2c1.2-1.2,3.1-1.2,4.2,0l1.4,1.4c1.2,1.2,1.2,3.1,0,4.2l-4.2,4.2c-0.9,0.9-2.3,1.1-3.4,0.6L18,16.8c1.9,1.3,4.6,1.1,6.3-0.6&#xD;&#xA;		l4.2-4.2C30.5,10,30.5,6.8,28.5,4.9z" />
</g>
</g>

<g transform="translate(442, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st087 {fill:#727272;}
	.st187 {opacity:0.5;}
</style>
<circle class="st087" cx="21" cy="11" r="3" xmlns="http://www.w3.org/2000/svg" />
<polygon class="st087" points="20,24 10,14 6,18 6,24 " xmlns="http://www.w3.org/2000/svg" />
<g class="st187" xmlns="http://www.w3.org/2000/svg">
	<polygon class="st087" points="22,24 18,20 20,18 26,24 	" />
</g>
<g xmlns="http://www.w3.org/2000/svg">
	<rect x="14" y="28" class="st087" width="2" height="2" />
	<rect x="22" y="28" class="st087" width="2" height="2" />
	<rect x="18" y="28" class="st087" width="2" height="2" />
	<rect x="6" y="28" class="st087" width="2" height="2" />
	<rect x="10" y="28" class="st087" width="2" height="2" />
</g>
<g xmlns="http://www.w3.org/2000/svg">
	<rect x="18" y="4" class="st087" width="2" height="2" />
	<rect x="10" y="4" class="st087" width="2" height="2" />
	<rect x="14" y="4" class="st087" width="2" height="2" />
	<rect x="22" y="4" class="st087" width="2" height="2" />
	<rect x="6" y="4" class="st087" width="2" height="2" />
</g>
<g xmlns="http://www.w3.org/2000/svg">
	<rect y="14" class="st087" width="2" height="2" />
	<rect y="18" class="st087" width="2" height="2" />
	<rect y="22" class="st087" width="2" height="2" />
	<rect y="10" class="st087" width="2" height="2" />
	<path class="st087" d="M1,4C0.5,4,0,4.5,0,5v3h2V6h2V4H1z" />
	<path class="st087" d="M2,26H0v3c0,0.5,0.5,1,1,1h3v-2H2V26z" />
</g>
<g xmlns="http://www.w3.org/2000/svg">
	<path class="st087" d="M28,8h2V5c0-0.5-0.5-1-1-1h-3v2h2V8z" />
	<rect x="28" y="18" class="st087" width="2" height="2" />
	<rect x="28" y="22" class="st087" width="2" height="2" />
	<path class="st087" d="M28,26v2h-2v2h3c0.5,0,1-0.5,1-1v-3H28z" />
	<rect x="28" y="14" class="st087" width="2" height="2" />
	<rect x="28" y="10" class="st087" width="2" height="2" />
</g>
</g>

<g transform="translate(0, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st088 {fill:#727272;}
</style>
<g id="IndentDecrease" xmlns="http://www.w3.org/2000/svg">
	<path class="st088" d="M28,6H4V4h24V6z M28,8H4v2h24V8z M28,12H16v2h12V12z M28,20H4v2h24V20z M28,24H4v2h24V24z M28,16H16v2h12V16z" />
	<path class="st088" d="M14,16h-4v3l-6-4l6-4v3h4V16z" />
</g>
</g>

<g transform="translate(34, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue89 { fill:#757575;}
	.Black89 { fill:#727272;}
</style>
<path class="Black89" d="M28,6H4V4h24V6z M28,8H4v2h24V8z M28,12H16v2h12V12z M28,20H4v2h24V20z M28,24H4v2h24V24z M28,16H16v2h12V16z&#xD;&#xA;	" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue89" d="M4,14h4v-3l6,4l-6,4v-3H4V14z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black90 { fill:#727272;}
	.Green90 { fill:#404040;}
	.Blue90 { fill:#757575;}
	.st090 {opacity:0.5;}
</style>
<polygon class="Green90" points="10,23 4,19 4,22 0,22 0,24 4,24 4,27 " xmlns="http://www.w3.org/2000/svg" />
<g class="st090" xmlns="http://www.w3.org/2000/svg">
	<rect x="12" y="8" class="Black90" width="14" height="12" />
</g>
<path class="Black90" d="M31,0H7C6.4,0,6,0.4,6,1v17l2,1.3V2h22v28H8v-3.3L6,28v3c0,0.6,0.4,1,1,1h24c0.6,0,1-0.4,1-1V1&#xD;&#xA;	C32,0.4,31.6,0,31,0z M26,24H12v-2h14V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red91 { fill:#585858;}
	.Blue91 { fill:#757575;}
	.Black91 { fill:#727272;}
</style>
<path class="Black91" d="M29,0H5C4.4,0,4,0.4,4,1v12.6l2,1.3V2h22v26H6v-2.9l-2,1.3V29c0,0.6,0.4,1,1,1h24c0.6,0,1-0.4,1-1V1&#xD;&#xA;	C30,0.4,29.6,0,29,0z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue91" d="M16,8h-6V6h6V8z M16,10h-6v2h6V10z M16,14h-6v2h6V14z M4,24l6-4l-6-4V24z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red91" d="M24,6h-6v2h6V6z M24,10h-6v2h6V10z M24,14h-6v2h6V14z M24,18h-6v2h6V18z M24,22h-6v2h6V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Green92 { fill:#404040;}
	.Black92 { fill:#727272;}
	.Red92 { fill:#585858;}
	.Yellow92 { fill:#979797;}
	.Blue92 { fill:#757575;}
	.White92 { fill:#FFFFFF;}
	.st092 {opacity:0.5;}
	.st192 {opacity:0.75;}
</style>
<g id="InsertField" xmlns="http://www.w3.org/2000/svg">
	<path class="Black92" d="M26,24H14v-2h12V24z M29,4h-5v2h4v22H12v-5.2l-2,1.3V29c0,0.5,0.5,1,1,1h18c0.5,0,1-0.5,1-1V5&#xD;&#xA;		C30,4.5,29.5,4,29,4z M26,14h-2H14v2h12V14z" />
	<path class="Green92" d="M8,18.1H6v-4H4v5c0,0.6,0.4,1,1,1h3v3l6-4l-6-4V18.1z" />
	<path class="Yellow92" d="M22,11V1c0-0.5-0.5-1-1-1H1C0.5,0,0,0.5,0,1v10c0,0.5,0.5,1,1,1h20C21.5,12,22,11.5,22,11z M16,18h10v2H16&#xD;&#xA;		V18z" />
</g>
</g>

<g transform="translate(476, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black93 { fill:#727272;}
</style>
<path class="Black93" d="M17.1,10h2.5l-0.5,2h-2.5l-2.5,10.2c-0.3,1.3-0.7,2.4-1.4,3.2c-0.6,0.9-1.3,1.5-2.2,1.9&#xD;&#xA;	C9.8,27.8,8.8,28,7.7,28c-1.1,0-1.9-0.2-2.6-0.6C4.4,26.8,4,26.2,4,25.6c0-0.5,0.2-1,0.5-1.3c0.4-0.4,0.8-0.5,1.3-0.5&#xD;&#xA;	c0.2,0,0.4,0,0.7,0.1C6.8,23.9,7,24,7.2,24.2c0.1,0.1,0.4,0.3,0.7,0.8c0.1,0.2,0.3,0.3,0.4,0.4c0.1,0.1,0.3,0.1,0.4,0.1&#xD;&#xA;	c0.6,0,1-0.6,1.2-1.9L12.5,12h-1.8l0.4-2H13l0.3-1.3c0.3-1.5,1.1-2.6,2.2-3.5S18,4,19.8,4c0.9,0,1.6,0.1,2.1,0.3&#xD;&#xA;	c0.5,0.2,0.9,0.5,1.2,0.9c0.3,0.4,0.4,0.8,0.4,1.2c0,0.3-0.1,0.7-0.3,1c-0.2,0.3-0.4,0.5-0.7,0.7c-0.3,0.2-0.6,0.2-1,0.2&#xD;&#xA;	c-0.3,0-0.6-0.1-0.9-0.2c-0.3-0.1-0.6-0.4-0.8-0.7c-0.3-0.4-0.5-0.6-0.7-0.7c-0.1-0.1-0.3-0.1-0.5-0.1c-0.3,0-0.6,0.2-0.8,0.5&#xD;&#xA;	c-0.2,0.2-0.3,0.7-0.5,1.4L17.1,10z M21.5,18.2l1.5,3.1c0.8-1.2,1.4-1.9,1.7-2.2c0.4-0.4,0.8-0.7,1.2-0.9s0.8-0.3,1.1-0.3&#xD;&#xA;	c0.4,0,0.7,0.1,1,0.4c0.3,0.2,0.4,0.5,0.4,0.9c0,0.2,0,0.5-0.1,0.6c-0.1,0.2-0.2,0.3-0.4,0.5c-0.2,0.1-0.4,0.2-0.5,0.3&#xD;&#xA;	c-0.1,0-0.3,0-0.7,0.1c-0.4,0-0.7,0-0.8,0.1c-0.2,0-0.3,0.1-0.5,0.3c-0.2,0.2-0.4,0.3-0.6,0.6c-0.1,0.1-0.4,0.5-1,1.4l0.5,1&#xD;&#xA;	c0.4,0.8,0.7,1.3,1,1.6c0.3,0.2,0.5,0.4,0.8,0.4c0.4,0,0.9-0.2,1.4-0.7l1.1,1.2c-1.1,1-2.2,1.5-3.4,1.5c-0.5,0-0.9-0.1-1.3-0.2&#xD;&#xA;	c-0.4-0.2-0.7-0.4-1-0.7c-0.3-0.3-0.6-0.8-0.9-1.4l-0.5-1.1c-0.5,0.8-1,1.5-1.6,2.1c-0.5,0.6-1,0.9-1.4,1.1C18,27.9,17.6,28,17.2,28&#xD;&#xA;	c-0.3,0-0.5-0.1-0.8-0.2c-0.2-0.1-0.3-0.2-0.4-0.5c-0.1-0.2-0.2-0.4-0.2-0.7c0-0.3,0.1-0.5,0.2-0.7c0.1-0.2,0.3-0.4,0.5-0.5&#xD;&#xA;	c0.2-0.1,0.6-0.2,1.1-0.2c0.4,0,0.7-0.1,0.9-0.2c0.2-0.1,0.5-0.3,0.7-0.6c0.3-0.3,0.7-0.8,1.2-1.7l-0.9-2h-1.4l0.4-1.8&#xD;&#xA;	c0.8-0.1,1.5-0.4,2.2-0.8H21.5z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow94 { fill:#979797;}
	.Red94 { fill:#585858;}
	.Black94 { fill:#727272;}
	.Blue94 { fill:#757575;}
	.White94 { fill:#FFFFFF;}
	.Green94 { fill:#404040;}
	.st094 {opacity:0.75;}
	.st194 {opacity:0.5;}
	.st294 {opacity:0.25;}
	.st394 { fill:#979797;}
</style>
<g id="Images" xmlns="http://www.w3.org/2000/svg">
	<path class="Black94" d="M29,4H3C2.5,4,2,4.5,2,5v22c0,0.5,0.5,1,1,1h26c0.5,0,1-0.5,1-1V5C30,4.5,29.5,4,29,4z M28,26H4V6h24V26z" />
	<circle class="Yellow94" cx="21" cy="11" r="3" />
	<polygon class="Green94" points="20,24 10,14 6,18 6,24 	" />
	<g class="st194">
		<polygon class="Green94" points="22,24 18,20 20,18 26,24 		" />
	</g>
</g>
</g>

<g transform="translate(306, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow95 { fill:#979797;}
	.Red95 { fill:#585858;}
	.Black95 { fill:#727272;}
	.Blue95 { fill:#757575;}
	.White95 { fill:#FFFFFF;}
	.Green95 { fill:#404040;}
	.st095 {opacity:0.75;}
	.st195 {opacity:0.5;}
	.st295 {opacity:0.25;}
	.st395 { fill:#979797;}
</style>
<g id="Images" xmlns="http://www.w3.org/2000/svg">
	<path class="Black95" d="M29,4H3C2.5,4,2,4.5,2,5v22c0,0.5,0.5,1,1,1h26c0.5,0,1-0.5,1-1V5C30,4.5,29.5,4,29,4z M28,26H4V6h24V26z" />
	<circle class="Yellow95" cx="21" cy="11" r="3" />
	<polygon class="Green95" points="20,24 10,14 6,18 6,24 	" />
	<g class="st195">
		<polygon class="Green95" points="22,24 18,20 20,18 26,24 		" />
	</g>
</g>
</g>

<g transform="translate(238, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow96 { fill:#979797;}
	.Red96 { fill:#585858;}
	.Black96 { fill:#727272;}
	.Blue96 { fill:#757575;}
	.White96 { fill:#FFFFFF;}
	.Green96 { fill:#404040;}
	.st096 {opacity:0.75;}
	.st196 {opacity:0.5;}
	.st296 {opacity:0.25;}
	.st396 { fill:#979797;}
</style>
<g id="Images" xmlns="http://www.w3.org/2000/svg">
	<path class="Black96" d="M29,4H3C2.5,4,2,4.5,2,5v22c0,0.5,0.5,1,1,1h26c0.5,0,1-0.5,1-1V5C30,4.5,29.5,4,29,4z M28,26H4V6h24V26z" />
	<circle class="Yellow96" cx="21" cy="11" r="3" />
	<polygon class="Green96" points="20,24 10,14 6,18 6,24 	" />
	<g class="st196">
		<polygon class="Green96" points="22,24 18,20 20,18 26,24 		" />
	</g>
</g>
</g>

<g transform="translate(272, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black97 { fill:#727272;}
	.Blue97 { fill:#757575;}
</style>
<polyline class="Blue97" points="0,20 6,16 0,12 " xmlns="http://www.w3.org/2000/svg" />
<path class="Black97" d="M8,30V19c0-0.6,0.4-1,1-1h14l7,7v5h-2v-4h-5c-0.6,0-1-0.4-1-1v-5H10v10H8z M28,2v10H10V2H8v11&#xD;&#xA;	c0,0.6,0.4,1,1,1h20c0.6,0,1-0.4,1-1V2H28z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black98 { fill:#727272;}
	.Blue98 { fill:#757575;}
</style>
<path class="Black98" d="M27,6h-3V3c0-0.5-0.5-1-1-1H3C2.5,2,2,2.5,2,3v22c0,0.5,0.5,1,1,1h3v3c0,0.5,0.5,1,1,1h20c0.5,0,1-0.5,1-1V7&#xD;&#xA;	C28,6.5,27.5,6,27,6z M6,7v17H4V4h18v2H7C6.5,6,6,6.5,6,7z M26,28H8V8h18V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue98" d="M22,15.3l-0.3,1.6H20l-0.5,2.3h1.8L21,20.8h-1.7L18.5,24h-1.8l0.6-3.2h-2L14.8,24H13l0.6-3.2H12l0.3-1.6H14&#xD;&#xA;	l0.5-2.3h-1.8l0.3-1.6h1.8l0.7-3.3h1.8l-0.7,3.3h2l0.7-3.3H21l-0.7,3.3H22z M18.3,16.9h-2l-0.5,2.3h2L18.3,16.9z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black99 { fill:#727272;}
	.Blue99 { fill:#757575;}
</style>
<path class="Black99" d="M25,2H5C4.5,2,4,2.5,4,3v26c0,0.5,0.5,1,1,1h20c0.5,0,1-0.5,1-1V3C26,2.5,25.5,2,25,2z M24,28H6V4h18V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue99" d="M20,13.3l-0.3,1.6H18l-0.5,2.3h1.8L19,18.8h-1.7L16.5,22h-1.8l0.6-3.2h-2L12.8,22H11l0.6-3.2H10l0.3-1.6H12&#xD;&#xA;	l0.5-2.3h-1.8l0.3-1.6h1.8l0.7-3.3h1.8l-0.7,3.3h2l0.7-3.3H19l-0.7,3.3H20z M16.3,14.9h-2l-0.5,2.3h2L16.3,14.9z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red100 { fill:#585858;}
	.Blue100 { fill:#757575;}
	.Black100 { fill:#727272;}
</style>
<path class="Black100" d="M29,0H5C4.4,0,4,0.4,4,1v10.6l2,1.3V2h22v26H6v-4.9l-2,1.3V29c0,0.6,0.4,1,1,1h24c0.6,0,1-0.4,1-1V1&#xD;&#xA;	C30,0.4,29.6,0,29,0z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue100" d="M24,8H12V6h12V8z M24,10H12v2h12V10z M24,14H12v2h12V14z M4,22l6-4l-6-4V22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red100" d="M24,18H12v2h12V18z M24,22H12v2h12V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red101 { fill:#585858;}
	.Black101 { fill:#727272;}
	.Blue101 { fill:#757575;}
</style>
<path class="Black101" d="M28,2v10H10V2H8v11c0,0.6,0.4,1,1,1h20c0.6,0,1-0.4,1-1V2H28z M28,30V20H10v10H8V19c0-0.6,0.4-1,1-1h20&#xD;&#xA;	c0.6,0,1,0.4,1,1v11H28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue101" d="M0,12l6,4l-6,4 M22,10V8.4h-3.4C18.7,8.2,18.9,8.1,19,8c0.2-0.2,0.5-0.4,0.7-0.5c0.3-0.2,0.5-0.3,0.8-0.5&#xD;&#xA;	c0.3-0.2,0.5-0.4,0.7-0.6c0.2-0.2,0.4-0.5,0.5-0.8c0.1-0.3,0.2-0.6,0.2-1c0-0.4-0.1-0.7-0.2-1.1c-0.1-0.3-0.4-0.6-0.6-0.8&#xD;&#xA;	c-0.3-0.2-0.5-0.4-0.9-0.5c-0.3-0.1-0.7-0.2-1-0.2c-0.5,0-0.9,0.1-1.3,0.2c-0.4,0.2-0.7,0.4-0.9,0.7c-0.2,0.3-0.4,0.6-0.5,1&#xD;&#xA;	c-0.1,0.4-0.2,0.8-0.2,1.3l0,0.1h1.8V5.2c0-0.2,0-0.4,0.1-0.6c0-0.2,0.1-0.4,0.2-0.5c0.1-0.1,0.2-0.3,0.3-0.4&#xD;&#xA;	c0.1-0.1,0.3-0.1,0.5-0.1c0.3,0,0.5,0.1,0.7,0.3c0.2,0.2,0.3,0.4,0.3,0.8c0,0.2,0,0.4-0.1,0.5c-0.1,0.2-0.2,0.3-0.4,0.5&#xD;&#xA;	c-0.1,0.1-0.3,0.3-0.5,0.4c-0.2,0.1-0.4,0.2-0.5,0.4C18.3,6.6,18,6.8,17.7,7c-0.3,0.2-0.6,0.5-0.8,0.7c-0.2,0.3-0.4,0.6-0.5,0.9&#xD;&#xA;	c-0.1,0.3-0.2,0.7-0.2,1.2V10H22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red101" d="M18,30v-2h-3v-1.7l3.4-4.3H20l0,4.3h1V28h-1l0,2H18z M18,26.3v-1.5l-1.3,1.5H18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red102 { fill:#585858;}
	.Blue102 { fill:#757575;}
	.Black102 { fill:#727272;}
</style>
<path class="Black102" d="M28,2v10H10V2H8v11c0,0.6,0.4,1,1,1h20c0.6,0,1-0.4,1-1V2H28z M28,30V20H10v10H8V19c0-0.6,0.4-1,1-1h20&#xD;&#xA;	c0.6,0,1,0.4,1,1v11H28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue102" d="M0,12l6,4l-6,4 M24,6H14v2h10V6z M24,4H14V2h10V4z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red102" d="M24,30H14v-2h10V30z M24,24H14v2h10V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red103 { fill:#585858;}
	.Black103 { fill:#727272;}
	.Blue103 { fill:#757575;}
</style>
<path class="Black103" d="M28,2v10H10V2H8v11c0,0.6,0.4,1,1,1h20c0.6,0,1-0.4,1-1V2H28z M28,30V20H10v10H8V19c0-0.6,0.4-1,1-1h20&#xD;&#xA;	c0.6,0,1,0.4,1,1v11H28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red103" d="M20,29.8c0.3-0.1,0.7-0.3,0.9-0.5c0.3-0.2,0.5-0.5,0.6-0.8c0.2-0.3,0.2-0.7,0.2-1.1c0-0.5-0.1-0.9-0.4-1.2&#xD;&#xA;	c-0.2-0.2-0.4-0.4-0.7-0.5c0.2-0.1,0.4-0.3,0.5-0.5c0.2-0.3,0.3-0.6,0.3-1c0-0.4-0.1-0.7-0.2-1c-0.2-0.3-0.4-0.5-0.6-0.7&#xD;&#xA;	c-0.2-0.2-0.5-0.3-0.8-0.4C19.5,22,19.2,22,18.9,22c-0.4,0-0.8,0.1-1.1,0.2c-0.3,0.1-0.6,0.3-0.9,0.6c-0.2,0.2-0.4,0.5-0.6,0.9&#xD;&#xA;	c-0.1,0.3-0.2,0.7-0.2,1.1l0,0.1h1.7l0-0.1c0-0.3,0.1-0.6,0.3-0.9c0.2-0.2,0.4-0.3,0.8-0.3c0.2,0,0.5,0.1,0.6,0.2&#xD;&#xA;	c0.2,0.1,0.3,0.3,0.3,0.6c0,0.2,0,0.3-0.1,0.4c-0.1,0.1-0.2,0.2-0.3,0.3c-0.1,0.1-0.3,0.1-0.5,0.1c-0.1,0-0.2,0-0.3,0&#xD;&#xA;	c-0.1,0-0.4,0-0.5,0l-0.2,0v1.4h0.1c0.2,0,0.6,0,0.8,0c0.2,0,0.4,0,0.5,0.1c0.1,0.1,0.3,0.1,0.4,0.3c0.1,0.1,0.1,0.3,0.1,0.6&#xD;&#xA;	c0,0.3-0.1,0.6-0.3,0.7c-0.2,0.2-0.5,0.3-0.8,0.3c-0.2,0-0.4,0-0.5-0.1c-0.1-0.1-0.3-0.2-0.4-0.3c-0.1-0.1-0.2-0.3-0.2-0.4&#xD;&#xA;	c-0.1-0.2-0.1-0.3-0.1-0.5l0-0.1H16l0,0.1c0,0.4,0.1,0.9,0.2,1.2c0.1,0.4,0.3,0.7,0.6,0.9c0.3,0.2,0.6,0.4,0.9,0.6&#xD;&#xA;	c0.4,0.1,0.8,0.2,1.2,0.2C19.3,30,19.6,29.9,20,29.8z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue103" d="M0,12l6,4l-6,4 M18.4,2l0,0.1c0,0.3-0.1,0.5-0.3,0.7c-0.1,0.2-0.3,0.4-0.5,0.5c-0.2,0.1-0.4,0.2-0.7,0.3&#xD;&#xA;	c-0.2,0-0.5,0.1-0.7,0.1l-0.2,0v1.6l2,0V10h2V2H18.4z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue104 { fill:#757575;}
</style>
<path class="Blue104" d="M10,10H2V4h8V10z M20,4h-8v6h8V4z M30,4h-8v6h8V4z M10,12H2v6h8V12z M20,12h-8v6h8V12z M30,12h-8v6h8V12z&#xD;&#xA;	 M10,20H2v6h8V20z M20,20h-8v6h8V20z M30,20h-8v6h8V20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0105 {opacity:0.5;}
	.st1105 {fill:#727272;}
</style>
<g class="st0105" xmlns="http://www.w3.org/2000/svg">
	<path class="st1105" d="M22,12h8v6h-8V12z M12,12v6h8v-6H12z M10,18v-6H2v6H10z M22,26h8v-6h-8V26z M12,20v6h8v-6H12z M10,26v-6H2v6&#xD;&#xA;		H10z" />
</g>
<rect x="2" y="4" class="st1105" width="28" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue106 { fill:#757575;}
	.Black106 { fill:#727272;}
	.Yellow106 { fill:#979797;}
	.st0106 {opacity:0.5;}
</style>
<g class="st0106" xmlns="http://www.w3.org/2000/svg">
	<path class="Black106" d="M30,6H20V0h10V6z M30,16H20v6h10V16z M30,24H20v6h10V24z" />
</g>
<polygon class="Blue106" points="12,10 12,12 18,12 18,14 22,11 18,8 18,10 " xmlns="http://www.w3.org/2000/svg" />
<rect y="8" class="Yellow106" width="10" height="6" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black107 { fill:#727272;}
	.Yellow107 { fill:#979797;}
	.Blue107 { fill:#757575;}
	.st0107 {opacity:0.5;}
</style>
<g class="st0107" xmlns="http://www.w3.org/2000/svg">
	<path class="Black107" d="M10,10H2V4h8V10z M30,4h-8v6h8V4z M30,12h-8v6h8V12z M30,20h-8v6h8V20z M10,20H2v6h8V20z" />
</g>
<path class="Blue107" d="M6,13h4v4H6v2l-4-4l4-4V13z" xmlns="http://www.w3.org/2000/svg" />
<rect x="12" y="4" class="Yellow107" width="8" height="22" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 170)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black108 { fill:#727272;}
	.Yellow108 { fill:#979797;}
	.Blue108 { fill:#757575;}
	.st0108 {opacity:0.5;}
</style>
<g class="st0108" xmlns="http://www.w3.org/2000/svg">
	<path class="Black108" d="M10,10H2V4h8V10z M30,4h-8v6h8V4z M10,12H2v6h8V12z M30,20h-8v6h8V20z M10,20H2v6h8V20z" />
</g>
<path class="Blue108" d="M26,13h-4v4h4v2l4-4l-4-4V13z" xmlns="http://www.w3.org/2000/svg" />
<rect x="12" y="4" class="Yellow108" width="8" height="22" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black109 { fill:#727272;}
	.Green109 { fill:#404040;}
	.Blue109 { fill:#757575;}
	.st0109 {opacity:0.5;}
</style>
<g class="st0109" xmlns="http://www.w3.org/2000/svg">
	<path class="Black109" d="M22,20h-2v2h2V20z M22,24h-2v2h2V24z M22,16h-2v2h2V16z" />
</g>
<path class="Blue109" d="M26,16h-2v2h2V16z M26,20h-2v2h2V20z M26,24h-2v2h2V24z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black109" d="M12,26v-2h6v2H12z M18,22v-2h-6v2H18z M31,0H7C6.4,0,6,0.4,6,1v14.9l2,1.3V2h22v28H8v-5.3l-2,1.3V31&#xD;&#xA;	c0,0.6,0.4,1,1,1h24c0.6,0,1-0.4,1-1V1C32,0.4,31.6,0,31,0z M18,16h-6v2h6V16z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Green109" points="10,21 4,17 4,20 0,20 0,22 4,22 4,25 " xmlns="http://www.w3.org/2000/svg" />
<g class="st0109" xmlns="http://www.w3.org/2000/svg">
	<rect x="12" y="6" class="Black109" width="14" height="8" />
</g>
</g>

<g transform="translate(238, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black110 { fill:#727272;}
	.Blue110 { fill:#757575;}
	.st0110 {opacity:0.5;}
</style>
<g class="st0110" xmlns="http://www.w3.org/2000/svg">
	<path class="Black110" d="M20,8h-2V6h2V8z M20,10h-2v2h2V10z M20,18h-2v2h2V18z M20,22h-2v2h2V22z M20,14h-2v2h2V14z M16,8h-2V6h2V8z&#xD;&#xA;		 M16,10h-2v2h2V10z M16,18h-2v2h2V18z M16,22h-2v2h2V22z M16,14h-2v2h2V14z" />
</g>
<path class="Blue110" d="M24,8h-2V6h2V8z M24,10h-2v2h2V10z M24,14h-2v2h2V14z M24,18h-2v2h2V18z M24,22h-2v2h2V22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black110" d="M27,0H3C2.4,0,2,0.4,2,1v28c0,0.6,0.4,1,1,1h24c0.6,0,1-0.4,1-1V1C28,0.4,27.6,0,27,0z M26,28H4V2h22V28z&#xD;&#xA;	 M12,8H6V6h6V8z M12,10H6v2h6V10z M12,14H6v2h6V14z M12,18H6v2h6V18z M12,22H6v2h6V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black111 { fill:#727272;}
</style>
<path class="Black111" d="M17.1,10h2.5l-0.5,2h-2.5l-2.5,10.2c-0.3,1.3-0.7,2.4-1.4,3.2c-0.6,0.9-1.3,1.5-2.2,1.9&#xD;&#xA;	C9.8,27.8,8.8,28,7.7,28c-1.1,0-1.9-0.2-2.6-0.6C4.4,26.8,4,26.2,4,25.6c0-0.5,0.2-1,0.5-1.3c0.4-0.4,0.8-0.5,1.3-0.5&#xD;&#xA;	c0.2,0,0.4,0,0.7,0.1C6.8,23.9,7,24,7.2,24.2c0.1,0.1,0.4,0.3,0.7,0.8c0.1,0.2,0.3,0.3,0.4,0.4c0.1,0.1,0.3,0.1,0.4,0.1&#xD;&#xA;	c0.6,0,1-0.6,1.2-1.9L12.5,12h-1.8l0.4-2H13l0.3-1.3c0.3-1.5,1.1-2.6,2.2-3.5S18,4,19.8,4c0.9,0,1.6,0.1,2.1,0.3&#xD;&#xA;	c0.5,0.2,0.9,0.5,1.2,0.9c0.3,0.4,0.4,0.8,0.4,1.2c0,0.3-0.1,0.7-0.3,1c-0.2,0.3-0.4,0.5-0.7,0.7c-0.3,0.2-0.6,0.2-1,0.2&#xD;&#xA;	c-0.3,0-0.6-0.1-0.9-0.2c-0.3-0.1-0.6-0.4-0.8-0.7c-0.3-0.4-0.5-0.6-0.7-0.7c-0.1-0.1-0.3-0.1-0.5-0.1c-0.3,0-0.6,0.2-0.8,0.5&#xD;&#xA;	c-0.2,0.2-0.3,0.7-0.5,1.4L17.1,10z M21.5,18.2l1.5,3.1c0.8-1.2,1.4-1.9,1.7-2.2c0.4-0.4,0.8-0.7,1.2-0.9s0.8-0.3,1.1-0.3&#xD;&#xA;	c0.4,0,0.7,0.1,1,0.4c0.3,0.2,0.4,0.5,0.4,0.9c0,0.2,0,0.5-0.1,0.6c-0.1,0.2-0.2,0.3-0.4,0.5c-0.2,0.1-0.4,0.2-0.5,0.3&#xD;&#xA;	c-0.1,0-0.3,0-0.7,0.1c-0.4,0-0.7,0-0.8,0.1c-0.2,0-0.3,0.1-0.5,0.3c-0.2,0.2-0.4,0.3-0.6,0.6c-0.1,0.1-0.4,0.5-1,1.4l0.5,1&#xD;&#xA;	c0.4,0.8,0.7,1.3,1,1.6c0.3,0.2,0.5,0.4,0.8,0.4c0.4,0,0.9-0.2,1.4-0.7l1.1,1.2c-1.1,1-2.2,1.5-3.4,1.5c-0.5,0-0.9-0.1-1.3-0.2&#xD;&#xA;	c-0.4-0.2-0.7-0.4-1-0.7c-0.3-0.3-0.6-0.8-0.9-1.4l-0.5-1.1c-0.5,0.8-1,1.5-1.6,2.1c-0.5,0.6-1,0.9-1.4,1.1C18,27.9,17.6,28,17.2,28&#xD;&#xA;	c-0.3,0-0.5-0.1-0.8-0.2c-0.2-0.1-0.3-0.2-0.4-0.5c-0.1-0.2-0.2-0.4-0.2-0.7c0-0.3,0.1-0.5,0.2-0.7c0.1-0.2,0.3-0.4,0.5-0.5&#xD;&#xA;	c0.2-0.1,0.6-0.2,1.1-0.2c0.4,0,0.7-0.1,0.9-0.2c0.2-0.1,0.5-0.3,0.7-0.6c0.3-0.3,0.7-0.8,1.2-1.7l-0.9-2h-1.4l0.4-1.8&#xD;&#xA;	c0.8-0.1,1.5-0.4,2.2-0.8H21.5z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow112 { fill:#979797;}
	.Red112 { fill:#585858;}
	.Black112 { fill:#727272;}
	.Blue112 { fill:#757575;}
	.White112 { fill:#FFFFFF;}
	.Green112 { fill:#404040;}
	.st0112 {opacity:0.75;}
	.st1112 {opacity:0.5;}
	.st2112 {opacity:0.25;}
	.st3112 { fill:#979797;}
</style>
<g id="Images" xmlns="http://www.w3.org/2000/svg">
	<path class="Black112" d="M29,4H3C2.5,4,2,4.5,2,5v22c0,0.5,0.5,1,1,1h26c0.5,0,1-0.5,1-1V5C30,4.5,29.5,4,29,4z M28,26H4V6h24V26z" />
	<circle class="Yellow112" cx="21" cy="11" r="3" />
	<polygon class="Green112" points="20,24 10,14 6,18 6,24 	" />
	<g class="st1112">
		<polygon class="Green112" points="22,24 18,20 20,18 26,24 		" />
	</g>
</g>
</g>

<g transform="translate(442, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black113 { fill:#727272;}
	.Yellow113 { fill:#979797;}
	.Blue113 { fill:#757575;}
	.st0113 {opacity:0.5;}
</style>
<g class="st0113" xmlns="http://www.w3.org/2000/svg">
	<path class="Black113" d="M10,10H2V4h8V10z M20,20h-8v6h8V20z M30,4h-8v6h8V4z M10,20H2v6h8V20z M30,20h-8v6h8V20z" />
</g>
<path class="Yellow113" d="M30,12H2v6h28V12z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Blue113" points="20,6 16,2 12,6 14,6 14,10 18,10 18,6 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black114 { fill:#727272;}
	.Yellow114 { fill:#979797;}
	.Blue114 { fill:#757575;}
	.st0114 {opacity:0.5;}
</style>
<g class="st0114" xmlns="http://www.w3.org/2000/svg">
	<path class="Black114" d="M10,10H2V4h8V10z M20,4h-8v6h8V4z M30,4h-8v6h8V4z M10,20H2v6h8V20z M30,20h-8v6h8V20z" />
</g>
<path class="Yellow114" d="M30,12H2v6h28V12z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Blue114" points="20,24 16,28 12,24 14,24 14,20 18,20 18,24 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black115 { fill:#727272;}
	.Blue115 { fill:#757575;}
	.st0115 {opacity:0.75;}
</style>
<path class="Black115" d="M27,2H5C4.5,2,4,2.5,4,3v26c0,0.5,0.5,1,1,1h22c0.5,0,1-0.5,1-1V3C28,2.5,27.5,2,27,2z M26,28H6V4h20V28z" xmlns="http://www.w3.org/2000/svg" />
<g class="st0115" xmlns="http://www.w3.org/2000/svg">
	<path class="Black115" d="M24,26H8v-2h16V26z M24,20H8v2h16V20z" />
</g>
<path class="Blue115" d="M22,18h-3l-0.9-2.7h-4.3L13,18h-3l4.4-12h3.2L22,18z M17.5,13.3l-1.3-4c-0.1-0.3-0.2-0.7-0.2-1.1h-0.1&#xD;&#xA;	c0,0.4-0.1,0.7-0.2,1l-1.3,4.1H17.5z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black116 { fill:#727272;}
</style>
<polygon class="Black116" points="21.6,6 22,4 14,4 13.6,6 15.8,6 12,24 9.8,24 9.4,26 17.6,26 17.8,24 15.6,24 19.4,6 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black117 { fill:#727272;}
	.Yellow117 { fill:#979797;}
	.Blue117 { fill:#757575;}
</style>
<path class="Blue117" d="M3.3,28c1.3-1.1,2.9-1.7,4.7-1.9v3.9C6.2,29.7,4.6,29.1,3.3,28z M14.9,18l-2,2h5.1c-0.1-0.7-0.3-1.4-0.5-2&#xD;&#xA;	H14.9z M10,22v2.1c2.3,0.2,4.4,1.1,6.1,2.5c1-1.3,1.7-2.9,1.9-4.6h-7.1H10z M1.9,26.6c1.7-1.4,3.8-2.3,6.1-2.5V22H0.1&#xD;&#xA;	C0.2,23.7,0.9,25.3,1.9,26.6z M10,29.9c1.8-0.2,3.4-0.9,4.7-1.9c-1.3-1.1-2.9-1.7-4.7-1.9V29.9z M5,18c-1.5,0-2.7-1.1-2.9-2.5&#xD;&#xA;	c0,0-0.1-0.1-0.1-0.1c-1,1.3-1.7,2.9-1.9,4.6H8v-2H7H5z" xmlns="http://www.w3.org/2000/svg" />
<path class="Yellow117" d="M29,0H5C4.5,0,4,0.5,4,1v14c0,0.5,0.5,1,1,1h5v4l4-4h15c0.5,0,1-0.5,1-1V1C30,0.5,29.5,0,29,0z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black117" d="M13.9,12h-2l-0.6-1.8H8.5L8,12H6l2.9-8H11L13.9,12z M10.9,8.8l-0.9-2.7C10,5.9,10,5.7,10,5.4h0&#xD;&#xA;	c0,0.2-0.1,0.5-0.1,0.7L8.9,8.8H10.9z M14.9,12V4h2.9c0.9,0,1.6,0.2,2.1,0.5c0.5,0.3,0.7,0.8,0.7,1.4c0,0.4-0.1,0.8-0.4,1.1&#xD;&#xA;	c-0.3,0.3-0.7,0.5-1.1,0.7v0c0.6,0.1,1,0.3,1.4,0.6c0.3,0.3,0.5,0.8,0.5,1.3c0,0.7-0.3,1.3-0.8,1.7C19.6,11.8,18.9,12,18,12H14.9z&#xD;&#xA;	 M16.7,5.3v1.9h0.8c0.4,0,0.7-0.1,0.9-0.3s0.3-0.4,0.3-0.7c0-0.6-0.4-0.9-1.3-0.9H16.7z M16.7,8.6v2.1h1c0.4,0,0.7-0.1,1-0.3&#xD;&#xA;	c0.2-0.2,0.4-0.5,0.4-0.8c0-0.3-0.1-0.6-0.3-0.8c-0.2-0.2-0.6-0.3-1-0.3H16.7z M27.9,11.7c-0.6,0.3-1.3,0.4-2.3,0.4&#xD;&#xA;	c-1.2,0-2.2-0.4-2.9-1.1c-0.7-0.7-1.1-1.7-1.1-2.9c0-1.3,0.4-2.3,1.2-3.1c0.8-0.8,1.8-1.2,3.1-1.2c0.8,0,1.4,0.1,2,0.3v1.7&#xD;&#xA;	c-0.5-0.3-1.1-0.5-1.8-0.5c-0.8,0-1.4,0.2-1.8,0.7c-0.5,0.5-0.7,1.1-0.7,1.9c0,0.8,0.2,1.4,0.7,1.8s1,0.7,1.8,0.7&#xD;&#xA;	c0.7,0,1.3-0.2,1.9-0.5V11.7z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 102)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue118 { fill:#757575;}
</style>
<path class="Blue118" d="M21.6,14.5c0.5,0.3,0.5,0.8,0,1.1L4.9,25.9C4.4,26.2,4,25.9,4,25.4V4.6c0-0.6,0.4-0.8,0.9-0.5L21.6,14.5z&#xD;&#xA;	 M28,25V5c0-0.6-0.5-1-1-1h-2c-0.5,0-1,0.4-1,1v20c0,0.5,0.5,1,1,1h2C27.5,26,28,25.5,28,25z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0119 {fill:#727272;enable-background:new    ;}
</style>
<path class="st0119" d="M12,8H2V6h10V8z M30,6H14v2h16V6z M12,10H2v2h10V10z M30,10H14v2h16V10z M12,14H2v2h10V14z M30,14H14v2h16V14z&#xD;&#xA;	 M12,18H2v2h10V18z M30,18H14v2h16V18z M12,22H2v2h10V22z M30,22H14v2h16V22z" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="2" class="st0119" width="10" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="14" y="2" class="st0119" width="16" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="26" class="st0119" width="10" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="14" y="26" class="st0119" width="16" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black120 { fill:#727272;}
	.Blue120 { fill:#757575;}
	.Red120 { fill:#585858;}
</style>
<path class="Black120" d="M31,2H13c-0.5,0-1,0.5-1,1v26c0,0.5,0.5,1,1,1h18c0.5,0,1-0.5,1-1V3C32,2.5,31.5,2,31,2z M30,28H14V4h16V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue120" d="M26,12h-8v-2h8V12z M26,22h-8v-2h8V22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red120" d="M4,6v8H2V9.3l-2,0V7.7l0.2,0c0.2,0,0.5,0,0.7-0.1c0.3,0,0.5-0.1,0.7-0.3c0.2-0.1,0.4-0.3,0.5-0.5&#xD;&#xA;	c0.1-0.2,0.2-0.4,0.3-0.7l0-0.1H4z M6,24v-1.6H2.6C2.7,22.2,2.9,22.1,3,22c0.2-0.2,0.5-0.4,0.7-0.5c0.3-0.2,0.5-0.3,0.8-0.5&#xD;&#xA;	c0.3-0.2,0.5-0.4,0.7-0.6c0.2-0.2,0.4-0.5,0.5-0.8c0.1-0.3,0.2-0.6,0.2-1c0-0.4-0.1-0.7-0.2-1.1c-0.1-0.3-0.4-0.6-0.6-0.8&#xD;&#xA;	c-0.3-0.2-0.5-0.4-0.9-0.5c-0.3-0.1-0.7-0.2-1-0.2c-0.5,0-0.9,0.1-1.3,0.2c-0.4,0.2-0.7,0.4-0.9,0.7c-0.2,0.3-0.4,0.6-0.5,1&#xD;&#xA;	c-0.1,0.4-0.2,0.8-0.2,1.3l0,0.1h1.8v-0.1c0-0.2,0-0.4,0.1-0.6c0-0.2,0.1-0.4,0.2-0.5c0.1-0.1,0.2-0.3,0.3-0.4&#xD;&#xA;	c0.1-0.1,0.3-0.1,0.5-0.1c0.3,0,0.5,0.1,0.7,0.3c0.2,0.2,0.3,0.4,0.3,0.8c0,0.2,0,0.4-0.1,0.5c-0.1,0.2-0.2,0.3-0.4,0.5&#xD;&#xA;	c-0.1,0.1-0.3,0.3-0.5,0.4c-0.2,0.1-0.4,0.2-0.5,0.4C2.3,20.6,2,20.8,1.7,21c-0.3,0.2-0.6,0.5-0.8,0.7c-0.2,0.3-0.4,0.6-0.5,0.9&#xD;&#xA;	c-0.1,0.3-0.2,0.7-0.2,1.2V24H6z M10,10H8v2h2V10z M10,20H8v2h2V20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 476)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue121 { fill:#757575;}
	.Black121 { fill:#727272;}
</style>
<path class="Black121" d="M30,16H12v-2h18V16z M30,8H12v2h18V8z M30,20H12v2h18V20z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue121" d="M6,24h4l-5,5l-5-5h4v-6h2V24z M4,12h2V6h4L5,1L0,6h4V12z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black122 { fill:#727272;}
	.Yellow122 { fill:#979797;}
	.Blue122 { fill:#757575;}
</style>
<path class="Yellow122" d="M16,16H6v-6h10V16z M32,10H22v6h10V10z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black122" d="M14,16v11c0,0.5-0.5,1-1,1H3c-0.5,0-1-0.5-1-1V13c0-0.5,0.5-1,1-1h3v2H4v12h8V16H14z M28,16v10h-8V14h2v-2h-3&#xD;&#xA;	c-0.5,0-1,0.5-1,1v14c0,0.5,0.5,1,1,1h10c0.5,0,1-0.5,1-1V16H28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue122" d="M10.9,2.9C12.7,1.1,15.2,0,18,0c4.8,0,8.9,3.4,9.8,8h-2.1c-0.9-3.4-4-6-7.7-6c-2.2,0-4.2,0.9-5.6,2.4L16,8H8V0&#xD;&#xA;	L10.9,2.9z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black123 { fill:#727272;}
	.Blue123 { fill:#757575;}
</style>
<path class="Black123" d="M30,8H12V6h18V8z M30,16H12v-2h18V16z M30,24H12v-2h18V24z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue123" d="M8,7c0,1.7-1.3,3-3,3S2,8.7,2,7s1.3-3,3-3S8,5.3,8,7z M5,12c-1.7,0-3,1.3-3,3s1.3,3,3,3s3-1.3,3-3S6.7,12,5,12&#xD;&#xA;	z M5,20c-1.7,0-3,1.3-3,3s1.3,3,3,3s3-1.3,3-3S6.7,20,5,20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red124 { fill:#585858;}
	.Black124 { fill:#727272;}
</style>
<path class="Black124" d="M24,8H6V6h18V8z M28,18H10v-2h18V18z M32,28H14v-2h18V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red124" d="M4,2v8H2V5.3l-2,0V3.7l0.2,0c0.2,0,0.5,0,0.7-0.1c0.3,0,0.5-0.1,0.7-0.3c0.2-0.1,0.4-0.3,0.5-0.5&#xD;&#xA;	c0.1-0.2,0.2-0.4,0.3-0.7l0-0.1H4z M5.4,20c0.3-0.1,0.6-0.3,0.8-0.5c0,0,0,0.1,0,0.1c0,0.1,0,0.2,0.1,0.3l0,0.1h2l-0.1-0.2&#xD;&#xA;	c-0.1-0.1-0.1-0.3-0.1-0.5c0-0.3,0-0.5,0-0.8v-3.3c0-0.4-0.1-0.8-0.3-1c-0.2-0.2-0.4-0.4-0.7-0.6c-0.3-0.1-0.6-0.2-0.9-0.3&#xD;&#xA;	c-0.3,0-0.6-0.1-1-0.1c-0.3,0-0.7,0-1,0.1c-0.3,0.1-0.7,0.2-0.9,0.4c-0.3,0.2-0.5,0.4-0.7,0.7c-0.2,0.3-0.3,0.7-0.3,1.1l0,0.1h1.9&#xD;&#xA;	l0-0.1c0-0.3,0.1-0.5,0.3-0.7c0.2-0.1,0.4-0.2,0.7-0.2c0.1,0,0.3,0,0.4,0c0.1,0,0.2,0.1,0.3,0.1C5.9,14.8,6,14.9,6,15&#xD;&#xA;	c0,0.1,0.1,0.2,0.1,0.4c0,0.1,0,0.2-0.1,0.3c-0.1,0.1-0.2,0.1-0.4,0.2c-0.2,0-0.4,0.1-0.6,0.1c-0.2,0-0.5,0.1-0.8,0.1&#xD;&#xA;	c-0.3,0-0.5,0.1-0.8,0.2c-0.3,0.1-0.5,0.2-0.7,0.3c-0.2,0.2-0.4,0.4-0.5,0.6c-0.1,0.3-0.2,0.6-0.2,1c0,0.3,0.1,0.6,0.2,0.9&#xD;&#xA;	c0.1,0.3,0.3,0.5,0.5,0.6C2.9,19.8,3.1,20,3.4,20c0.3,0.1,0.5,0.1,0.9,0.1C4.6,20.2,5,20.1,5.4,20z M6.1,17v0.4c0,0.1,0,0.2,0,0.4&#xD;&#xA;	c0,0.1-0.1,0.3-0.1,0.4c-0.1,0.1-0.2,0.3-0.4,0.4c-0.2,0.1-0.4,0.2-0.7,0.2c-0.1,0-0.3,0-0.4,0c-0.1,0-0.2-0.1-0.3-0.1&#xD;&#xA;	C4.1,18.6,4,18.5,4,18.4c0-0.1-0.1-0.2-0.1-0.3c0-0.1,0-0.3,0.1-0.3c0-0.1,0.1-0.2,0.2-0.2c0.1-0.1,0.2-0.1,0.3-0.1&#xD;&#xA;	c0.1,0,0.2-0.1,0.4-0.1c0.1,0,0.3,0,0.4-0.1c0.1,0,0.3,0,0.4-0.1c0.1,0,0.2-0.1,0.4-0.1C6,17,6.1,17,6.1,17z M10,22H8v2h2V22z&#xD;&#xA;	 M10,30H8v-4.9h2V30z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Red125 { fill:#585858;}
	.Black125 { fill:#727272;}
</style>
<path class="Black125" d="M30,8H12V6h18V8z M30,18H12v-2h18V18z M30,28H12v-2h18V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Red125" d="M6,2v8H4V5.3l-2,0V3.7l0.2,0c0.2,0,0.5,0,0.7-0.1c0.3,0,0.5-0.1,0.7-0.3c0.2-0.1,0.4-0.3,0.5-0.5&#xD;&#xA;	c0.1-0.2,0.2-0.4,0.3-0.7l0-0.1H6z M8,20v-1.6H4.6C4.7,18.2,4.9,18.1,5,18c0.2-0.2,0.5-0.4,0.7-0.5c0.3-0.2,0.5-0.3,0.8-0.5&#xD;&#xA;	c0.3-0.2,0.5-0.4,0.7-0.6c0.2-0.2,0.4-0.5,0.5-0.8c0.1-0.3,0.2-0.6,0.2-1c0-0.4-0.1-0.7-0.2-1.1c-0.1-0.3-0.4-0.6-0.6-0.8&#xD;&#xA;	c-0.3-0.2-0.5-0.4-0.9-0.5c-0.3-0.1-0.7-0.2-1-0.2c-0.5,0-0.9,0.1-1.3,0.2c-0.4,0.2-0.7,0.4-0.9,0.7c-0.2,0.3-0.4,0.6-0.5,1&#xD;&#xA;	c-0.1,0.4-0.2,0.8-0.2,1.3l0,0.1h1.8v-0.1c0-0.2,0-0.4,0.1-0.6c0-0.2,0.1-0.4,0.2-0.5c0.1-0.1,0.2-0.3,0.3-0.4&#xD;&#xA;	c0.1-0.1,0.3-0.1,0.5-0.1c0.3,0,0.5,0.1,0.7,0.3c0.2,0.2,0.3,0.4,0.3,0.8c0,0.2,0,0.4-0.1,0.5c-0.1,0.2-0.2,0.3-0.4,0.5&#xD;&#xA;	c-0.1,0.1-0.3,0.3-0.5,0.4c-0.2,0.1-0.4,0.2-0.5,0.4C4.3,16.6,4,16.8,3.7,17c-0.3,0.2-0.6,0.5-0.8,0.7c-0.2,0.3-0.4,0.6-0.5,0.9&#xD;&#xA;	c-0.1,0.3-0.2,0.7-0.2,1.2V20H8z M6.1,29.8c0.3-0.1,0.7-0.3,0.9-0.5c0.3-0.2,0.5-0.5,0.6-0.8C7.9,28.2,8,27.8,8,27.4&#xD;&#xA;	c0-0.5-0.1-0.9-0.4-1.2c-0.2-0.2-0.4-0.4-0.7-0.5c0.2-0.1,0.4-0.3,0.5-0.5c0.2-0.3,0.3-0.6,0.3-1c0-0.4-0.1-0.7-0.2-1&#xD;&#xA;	c-0.2-0.3-0.4-0.5-0.6-0.7c-0.2-0.2-0.5-0.3-0.8-0.4C5.7,22,5.4,22,5.1,22c-0.4,0-0.8,0.1-1.1,0.2c-0.3,0.1-0.6,0.3-0.9,0.6&#xD;&#xA;	c-0.2,0.2-0.4,0.5-0.6,0.9c-0.1,0.3-0.2,0.7-0.2,1.1l0,0.1h1.7l0-0.1c0-0.3,0.1-0.6,0.3-0.9c0.2-0.2,0.4-0.3,0.8-0.3&#xD;&#xA;	c0.2,0,0.5,0.1,0.6,0.2C5.9,23.9,6,24.1,6,24.4c0,0.2,0,0.3-0.1,0.4C5.8,24.9,5.6,25,5.5,25c-0.1,0.1-0.3,0.1-0.5,0.1&#xD;&#xA;	c-0.1,0-0.2,0-0.3,0c-0.1,0-0.2,0-0.2,0l-0.2,0v1.4h0.1c0.2,0,0.4,0,0.6,0c0.2,0,0.4,0,0.5,0.1c0.1,0.1,0.3,0.1,0.4,0.3&#xD;&#xA;	c0.1,0.1,0.1,0.3,0.1,0.6c0,0.3-0.1,0.6-0.3,0.7c-0.2,0.2-0.5,0.3-0.8,0.3c-0.2,0-0.4,0-0.5-0.1c-0.1-0.1-0.3-0.2-0.4-0.3&#xD;&#xA;	C4.1,28,4,27.8,4,27.7c-0.1-0.2-0.1-0.3-0.1-0.5l0-0.1H2.2l0,0.1c0,0.4,0.1,0.9,0.2,1.2c0.1,0.4,0.3,0.7,0.6,0.9&#xD;&#xA;	c0.3,0.2,0.6,0.4,0.9,0.6C4.2,29.9,4.6,30,5.1,30C5.4,30,5.8,29.9,6.1,29.8z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Green126 { fill:#404040;}
	.Black126 { fill:#727272;}
	.Yellow126 { fill:#979797;}
</style>
<path class="Yellow126" d="M28,22H18v-2h10V22z M10,6c0-1.1,0.9-2,2-2h4V3c0-1.7-3.6-3-8-3S0,1.3,0,3v14c0,1.1,1.6,2.1,4,2.6V15&#xD;&#xA;	c0-0.5,0.5-1,1-1h3h1.1h0l0.9,0.6V6z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black126" d="M16,16h12v2H16V16z M31,6H13c-0.5,0-1,0.5-1,1v8.9l2,1.3V8h16v22H14v-5.3l-2,1.3V31c0,0.5,0.5,1,1,1h18&#xD;&#xA;	c0.5,0,1-0.5,1-1V7C32,6.5,31.5,6,31,6z M28,12H16v2h12V12z M16,26h12v-2H16V26z" xmlns="http://www.w3.org/2000/svg" />
<path class="Green126" d="M10,20H8v-4H6v5c0,0.6,0.4,1,1,1h3v3l6-4l-6-4V20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black127 { fill:#727272;}
	.Green127 { fill:#404040;}
	.st0127 {opacity:0.5;}
</style>
<g class="st0127" xmlns="http://www.w3.org/2000/svg">
	<path class="Black127" d="M10,6H2V0h8V6z M20,0h-8v6h8V0z M30,0h-8v6h8V0z M10,8H2v6h8V8z M10,16H2v6h8V16z M10,24H2v6h8V24z M20,24&#xD;&#xA;		h-8v6h8V24z M30,24h-8v6h8V24z" />
</g>
<rect x="12" y="8" class="Green127" width="18" height="14" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue128 { fill:#757575;}
	.Black128 { fill:#727272;}
	.st0128 {opacity:0.5;}
</style>
<g class="st0128" xmlns="http://www.w3.org/2000/svg">
	<path class="Black128" d="M28,10h-8V4h8V10z M26.3,14.9c0.5-0.5,1.1-0.7,1.7-0.8v-2h-8v6h3.2L26.3,14.9z M0,26h8v-6H0V26z M18,23.2V20&#xD;&#xA;		h-8v6h5.2L18,23.2z" />
</g>
<path class="Blue128" d="M0,4h8v6H0V4z M0,18h8v-6H0V18z M10,10h8V4h-8V10z M10,18h8v-6h-8V18z M29,23l-8,8l-4-4l8-8L29,23z M30,22&#xD;&#xA;	l1.7-1.7c0.4-0.4,0.4-1,0-1.3l-2.7-2.7c-0.4-0.4-1-0.4-1.3,0L26,18L30,22z M16,28v4h4L16,28z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black129 {fill:#727272;}
</style>
<path class="Black129" d="M19,2H5C4.4,2,4,2.4,4,3v24c0,0.6,0.4,1,1,1h20c0.6,0,1-0.4,1-1V9L19,2z M24,26H6V4h12v5c0,0.6,0.4,1,1,1h5&#xD;&#xA;	V26z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 374)">
<polygon opacity="0.6" points="4,0 4,30 28,30 28,7 21,0 " xmlns="http://www.w3.org/2000/svg" />
<polygon fill="#FFFFFF" points="6,2 6,28 26,28 26,10 18,10 18,2 " xmlns="http://www.w3.org/2000/svg" />
<polygon fill="#FFFFFF" points="20,2 20,8 26,8 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue131 { fill:#757575;}
	.Black131 { fill:#727272;}
	.Yellow131 { fill:#979797;}
	.st0131 {opacity:0.5;}
</style>
<g class="st0131" xmlns="http://www.w3.org/2000/svg">
	<path class="Black131" d="M0,20h8v6H0V20z M10,26h8v-6h-8V26z M20,12v6h8v-6H20z M20,26h8v-6h-8V26z" />
</g>
<path class="Blue131" d="M0,4h8v6H0V4z M0,18h8v-6H0V18z M10,10h8V4h-8V10z M10,18h8v-6h-8V18z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Yellow131" points="25,2 27,0 27,3 30,3 28,5 30,7 27,7 27,10 25,8 23,10 23,7 20,7 22,5 20,3 23,3 23,0 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0132 {fill:#727272;}
</style>
<path class="st0132" d="M8.9,4.1C8.4,3.8,8,4.1,8,4.6v20.7c0,0.6,0.4,0.8,0.9,0.5l16.8-10.3c0.5-0.3,0.5-0.8,0-1.1L8.9,4.1z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0133 {fill:#727272;}
</style>
<path class="st0133" d="M8.9,4.1C8.4,3.8,8,4.1,8,4.6v20.7c0,0.6,0.4,0.8,0.9,0.5l16.8-10.3c0.5-0.3,0.5-0.8,0-1.1L8.9,4.1z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow134 { fill:#979797;}
	.st0134 {opacity:0.75;}
</style>
<g class="st0134" xmlns="http://www.w3.org/2000/svg">
	<path class="Yellow134" d="M2.2,25.2l5.5-10C8,14.5,8.7,14,9.5,14H24v-3c0-0.6-0.4-1-1-1H12V7c0-0.6-0.4-1-1-1H3C2.4,6,2,6.5,2,7v18&#xD;&#xA;		c0,0.2,0,0.3,0.1,0.4C2.1,25.4,2.2,25.3,2.2,25.2z" />
</g>
<path class="Yellow134" d="M29.3,16H9.6L4,26h19.8c0.5,0,1.1-0.2,1.3-0.6l4.9-8.9C30.1,16.2,29.8,16,29.3,16z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black135 { fill:#727272;}
	.Green135 { fill:#404040;}
</style>
<path class="Green135" d="M32,3v26c0,0.5-0.5,1-1,1H9c-0.5,0-1-0.5-1-1v-3.1C8.2,26,8.5,26,8.7,26c1.5,0,2.9-0.6,4-1.6l6.2-6.1&#xD;&#xA;	c0.2,1,0.3,2.1,0.3,3.3c0,2.4,2,4.4,4.4,4.4s4.4-2,4.4-4.4c0-5.8-4.3-10.6-9.9-11.5L19,9.3c1.2-1.2,1.2-3.1,0-4.2&#xD;&#xA;	c-0.6-0.6-1.3-0.9-2.1-0.9c-0.8,0-1.6,0.3-2.1,0.9l-2.6,2.6L8,3.4V3c0-0.5,0.5-1,1-1h22C31.5,2,32,2.5,32,3z M16.4,12&#xD;&#xA;	c2.6,0,4.8,4.3,4.8,9.6c0,1.3,1.1,2.4,2.4,2.4c1.3,0,2.4-1.1,2.4-2.4C26,16.3,21.7,12,16.4,12z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black135" d="M15,13.2l3,3l-6.7,6.7c-1.4,1.4-3.7,1.4-5.1,0l-5.1-5.1c-1.4-1.4-1.4-3.7,0-5.1L7.7,6l3,3l-1.9,1.9&#xD;&#xA;	C8.3,11.4,8,12.2,8,13c0,0.8,0.3,1.6,0.9,2.1C9.4,15.7,10.2,16,11,16s1.6-0.3,2.1-0.9L15,13.2z M11.7,13.7l5.9-5.9&#xD;&#xA;	c0.4-0.4,0.4-1,0-1.4l0,0c-0.4-0.4-1-0.4-1.4,0l-5.9,5.9c-0.4,0.4-0.4,1,0,1.4l0,0C10.7,14.1,11.3,14.1,11.7,13.7z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue136 { fill:#757575;}
	.Black136 { fill:#727272;}
</style>
<path class="Black136" d="M27,2H5C4.4,2,4,2.4,4,3v26c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V3C28,2.4,27.6,2,27,2z M26,28H6V4h20V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue136" d="M26,10V8h-4V4h-2v4h-8V4h-2v4H6v2h4v12H6v2h4v4h2v-4h8v4h2v-4h4v-2h-4V10H26z M20,22h-8V10h8V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue137 { fill:#757575;}
	.Black137 { fill:#727272;}
</style>
<path class="Black137" d="M27,2H5C4.4,2,4,2.4,4,3v26c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V3C28,2.4,27.6,2,27,2z M26,28H6V4h20V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue137" d="M26,10V8h-4V4h-2v4h-8V4h-2v4H6v2h4v12H6v2h4v4h2v-4h8v4h2v-4h4v-2h-4V10H26z M20,22h-8V10h8V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue138 { fill:#757575;}
	.Black138 { fill:#727272;}
</style>
<path class="Black138" d="M27,2H5C4.4,2,4,2.4,4,3v26c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V3C28,2.4,27.6,2,27,2z M26,28H6V4h20V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue138" d="M26,8V6h-2V4h-2v2H10V4H8v2H6v2h2v16H6v2h2v2h2v-2h12v2h2v-2h2v-2h-2V8H26z M22,24H10V8h12V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue139 { fill:#757575;}
	.Black139 { fill:#727272;}
</style>
<path class="Black139" d="M27,2H5C4.4,2,4,2.4,4,3v26c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V3C28,2.4,27.6,2,27,2z M26,28H6V4h20V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue139" d="M26,10V8h-2V4h-2v4H12V4h-2v4H6v2h4v12H6v2h4v4h2v-4h10v4h2v-4h2v-2h-2V10H26z M22,22H12V10h10V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue140 { fill:#757575;}
	.Black140 { fill:#727272;}
</style>
<path class="Black140" d="M27,2H5C4.4,2,4,2.4,4,3v26c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V3C28,2.4,27.6,2,27,2z M26,28H6V4h20V28z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue140" d="M26,10V8h-6V4h-2v4h-4V4h-2v4H6v2h6v12H6v2h6v4h2v-4h4v4h2v-4h6v-2h-6V10H26z M18,22h-4V10h4V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black141 {fill:#727272;}
</style>
<path class="Black141" d="M23,12h-3V7l-7-7H1C0.4,0,0,0.4,0,1v22c0,0.6,0.4,1,1,1h5v7c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V19L23,12z&#xD;&#xA;	 M2,22V2h10v5c0,0.6,0.4,1,1,1h5v4H7c-0.6,0-1,0.4-1,1v9H2z M28,30H8v-6v-2v-8h10h2h2v5c0,0.6,0.4,1,1,1h5V30z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0142 {fill:#727272;}
</style>
<path class="st0142" d="M8,14h16v2H8V14z" xmlns="http://www.w3.org/2000/svg" />
<path class="st0142" d="M2,5v21c0,0.6,0.4,1,1,1h26c0.6,0,1-0.4,1-1V5c0-0.6-0.4-1-1-1H3C2.4,4,2,4.4,2,5z M28,6v19H4V6H28z" xmlns="http://www.w3.org/2000/svg" />
<rect x="8" y="18" class="st0142" width="16" height="2" xmlns="http://www.w3.org/2000/svg" />
<path class="st0142" d="M8,10h16v2H8V10z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0143 {fill:#727272;}
</style>
<path class="st0143" d="M22,16H10v-2h12V16z" xmlns="http://www.w3.org/2000/svg" />
<path class="st0143" d="M27,2H5C4.4,2,4,2.4,4,3v26c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V3C28,2.4,27.6,2,27,2z M26,28H6V4h20V28z" xmlns="http://www.w3.org/2000/svg" />
<rect x="10" y="10" class="st0143" width="12" height="2" xmlns="http://www.w3.org/2000/svg" />
<path class="st0143" d="M22,20H10v-2h12V20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black144 { fill:#727272;}
	.Blue144 { fill:#757575;}
</style>
<path class="Black144" d="M23,8H11c-0.6,0-1,0.4-1,1v22c0,0.6,0.4,1,1,1h18c0.6,0,1-0.4,1-1V15L23,8z M28,30H12V10h10v5&#xD;&#xA;	c0,0.6,0.4,1,1,1h5V30z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue144" d="M8,10H2V8h6V10z M8,30H2v2h6V30z M6,10H4v20h2V10z M12,0h-2v6h2V0z M28,2H10v2h18V2z M30,0h-2v6h2V0z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black145 { fill:#727272;}
</style>
<path class="Black145" d="M30,4H10V2h20V4z M30,6H2v2h28V6z M30,10H2v2h28V10z M10,18H2v2h8V18z M10,14H2v2h8V14z M30,14H18&#xD;&#xA;	c-3.3,0-6,2.7-6,6s2.7,6,6,6v6h4V18h2v14h4V18h2V14z M18,22c-1.1,0-2-0.9-2-2c0-1.1,0.9-2,2-2V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black146 { fill:#727272;}
</style>
<path class="Black146" d="M30,4H10V2h20V4z M30,6H2v2h28V6z M30,10H2v2h28V10z M10,18H2v2h8V18z M10,14H2v2h8V14z M30,14H18&#xD;&#xA;	c-3.3,0-6,2.7-6,6s2.7,6,6,6v6h4V18h2v14h4V18h2V14z M18,22c-1.1,0-2-0.9-2-2c0-1.1,0.9-2,2-2V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(68, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black147 { fill:#727272;}
	.Yellow147 { fill:#979797;}
</style>
<path class="Yellow147" d="M12,24v4H5c-0.6,0-1-0.4-1-1V3c0-0.6,0.4-1,1-1h3v22H12z M25,2h-3v8h4V2.8C26,2.4,25.6,2,25,2z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black147" d="M29,12H15c-0.6,0-1,0.4-1,1v16c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1V13C30,12.4,29.6,12,29,12z M28,28H16V14&#xD;&#xA;	h12V28z M26,20h-8v-2h8V20z M26,24h-8v-2h8V24z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black147" d="M18,2V1c0-0.6-0.4-1-1-1h-4c-0.6,0-1,0.4-1,1v1h-2v3c0,0.6,0.4,1,1,1h8c0.6,0,1-0.4,1-1V2H18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black148 { fill:#727272;}
	.Yellow148 { fill:#979797;}
</style>
<path class="Yellow148" d="M12,24v4H5c-0.6,0-1-0.4-1-1V3c0-0.6,0.4-1,1-1h3v22H12z M25,2h-3v8h4V2.8C26,2.4,25.6,2,25,2z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black148" d="M29,12H15c-0.6,0-1,0.4-1,1v16c0,0.6,0.4,1,1,1h14c0.6,0,1-0.4,1-1V13C30,12.4,29.6,12,29,12z M28,28H16V14&#xD;&#xA;	h12V28z M26,20h-8v-2h8V20z M26,24h-8v-2h8V24z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black148" d="M18,2V1c0-0.6-0.4-1-1-1h-4c-0.6,0-1,0.4-1,1v1h-2v3c0,0.6,0.4,1,1,1h8c0.6,0,1-0.4,1-1V2H18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 0)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black149 { fill:#727272;}
	.Yellow149 { fill:#979797;}
	.Blue149 { fill:#757575;}
</style>
<path class="Yellow149" d="M12,24v4H5c-0.6,0-1-0.4-1-1V3c0-0.6,0.4-1,1-1h3v22H12z M25,2h-3v10h4V3C26,2.4,25.6,2,25,2z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue149" d="M32,18v-3c0-0.6-0.4-1-1-1H15c-0.6,0-1,0.4-1,1v3H32z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black149" d="M28,20v2H18v-2H28z M18,26h10v-2H18V26z M30,18v10H16V18h-2v11c0,0.6,0.4,1,1,1h16c0.6,0,1-0.4,1-1V18H30z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black149" d="M18,2V1c0-0.6-0.4-1-1-1h-4c-0.6,0-1,0.4-1,1v1h-2v3c0,0.6,0.4,1,1,1h2h4h2c0.6,0,1-0.4,1-1V2H18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 34)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue150 { fill:#757575;}
</style>
<path class="Blue150" d="M17,11L7,21l-4-4L13,7L17,11z M18,10l1.7-1.7c0.4-0.4,0.4-1,0-1.3l-2.7-2.7c-0.4-0.4-1-0.4-1.3,0L14,6L18,10z&#xD;&#xA;	 M2,18v4h4L2,18z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0151 {fill:#727272;}
</style>
<path class="st0151" d="M23.1,4.1c0.5-0.3,0.9,0,0.9,0.5v20.7c0,0.6-0.4,0.8-0.9,0.5L6.4,15.5c-0.5-0.3-0.5-0.8,0-1.1L23.1,4.1z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black152 { fill:#727272;}
	.Yellow152 { fill:#979797;}
	.Blue152 { fill:#757575;}
	.Red152 { fill:#585858;}
	.White152 { fill:#FFFFFF;}
	.Green152 { fill:#404040;}
	.st0152 { fill:#727272;}
	.st1152 {opacity:0.5;}
	.st2152 {opacity:0.75;}
</style>
<g id="PagePrevious" xmlns="http://www.w3.org/2000/svg">
	<polygon class="Blue152" points="24,4 24,28 4,16 	" />
</g>
</g>

<g transform="translate(34, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black153 { fill:#727272;}
	.Yellow153 { fill:#979797;}
	.Blue153 { fill:#757575;}
	.Red153 { fill:#585858;}
	.White153 { fill:#FFFFFF;}
	.Green153 { fill:#404040;}
	.st0153 { fill:#727272;}
	.st1153 {opacity:0.5;}
	.st2153 {opacity:0.75;}
</style>
<g id="PagePrevious" xmlns="http://www.w3.org/2000/svg">
	<polygon class="Blue153" points="24,4 24,28 4,16 	" />
</g>
</g>

<g transform="translate(170, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black154 {fill:#727272;}
</style>
<path class="Black154" d="M10,2h12v8h2V0H8v10h2V2z M28,8h-2v3c0,0.6-0.4,1-1,1H7c-0.6,0-1-0.4-1-1V8H4c-1.1,0-2,0.9-2,2v12&#xD;&#xA;	c0,1.1,0.9,2,2,2h4v6h16v-6h4c1.1,0,2-0.9,2-2V10C30,8.9,29.1,8,28,8z M22,22v2v4H10v-4v-2v-4h12V22z M20,24h-8v2h8V24z M20,20h-8v2&#xD;&#xA;	h8V20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black155 { fill:#727272;}
	.Green155 { fill:#404040;}
</style>
<path class="Green155" d="M25,0c-3.9,0-7,3.1-7,7c0,3.9,3.1,7,7,7c3.9,0,7-3.1,7-7C32,3.1,28.9,0,25,0z M26,12h-2v-2h2V12z M27.9,5.5&#xD;&#xA;	c-0.1,0.2-0.1,0.5-0.2,0.6c-0.1,0.2-0.2,0.3-0.3,0.5C27.2,6.8,27.1,6.9,27,7c-0.1,0.1-0.3,0.2-0.4,0.3c-0.1,0.1-0.3,0.2-0.4,0.3&#xD;&#xA;	c-0.1,0.1-0.2,0.3-0.3,0.4c-0.1,0.2-0.1,0.3-0.2,0.5V9h-1.7V8.5c0-0.3,0.1-0.6,0.1-0.8c0.1-0.2,0.2-0.4,0.3-0.6&#xD;&#xA;	c0.1-0.2,0.2-0.3,0.3-0.4c0.1-0.1,0.2-0.2,0.4-0.4c0.1-0.1,0.2-0.2,0.3-0.3c0.1-0.1,0.2-0.2,0.3-0.3c0.1-0.1,0.1-0.2,0.2-0.4&#xD;&#xA;	c0-0.1,0.1-0.3,0.1-0.5c0-0.4-0.1-0.7-0.3-0.9c-0.2-0.2-0.4-0.3-0.8-0.3c-0.2,0-0.4,0-0.6,0.1C24.3,3.9,24.1,4,24,4.1&#xD;&#xA;	c-0.1,0.2-0.2,0.3-0.2,0.6c0,0.1,0,0.2,0,0.3H22c0-0.4,0.1-0.7,0.2-1c0.1-0.4,0.3-0.8,0.6-1.1c0.3-0.3,0.6-0.5,0.9-0.7&#xD;&#xA;	C24.1,2.1,24.5,2,24.9,2c0.6,0,1.1,0.1,1.5,0.3c0.4,0.2,0.7,0.4,0.9,0.7c0.2,0.3,0.4,0.6,0.5,0.9C27.9,4.1,28,4.4,28,4.7&#xD;&#xA;	C28,5,28,5.3,27.9,5.5z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black155" d="M16,20h-6v2h6V20z M16,24h-6v2h6V24z M25,16c-2.1,0-4.1-0.8-5.7-2H5c-0.6,0-1-0.4-1-1v-3H2c-1.1,0-2,0.9-2,2&#xD;&#xA;	v10c0,1.1,0.9,2,2,2h4v6h14v-6h4c1.1,0,2-0.9,2-2v-6.1C25.7,16,25.3,16,25,16z M18,28H8V18h10V28z M8,4h8.5c0.3-0.7,0.6-1.4,1-2H6&#xD;&#xA;	v10h2V4z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black156 { fill:#727272;}
	.Green156 { fill:#404040;}
</style>
<path class="Green156" d="M25,0c-3.9,0-7,3.1-7,7c0,3.9,3.1,7,7,7c3.9,0,7-3.1,7-7C32,3.1,28.9,0,25,0z M26,12h-2v-2h2V12z M27.9,5.5&#xD;&#xA;	c-0.1,0.2-0.1,0.5-0.2,0.6c-0.1,0.2-0.2,0.3-0.3,0.5C27.2,6.8,27.1,6.9,27,7c-0.1,0.1-0.3,0.2-0.4,0.3c-0.1,0.1-0.3,0.2-0.4,0.3&#xD;&#xA;	c-0.1,0.1-0.2,0.3-0.3,0.4c-0.1,0.2-0.1,0.3-0.2,0.5V9h-1.7V8.5c0-0.3,0.1-0.6,0.1-0.8c0.1-0.2,0.2-0.4,0.3-0.6&#xD;&#xA;	c0.1-0.2,0.2-0.3,0.3-0.4c0.1-0.1,0.2-0.2,0.4-0.4c0.1-0.1,0.2-0.2,0.3-0.3c0.1-0.1,0.2-0.2,0.3-0.3c0.1-0.1,0.1-0.2,0.2-0.4&#xD;&#xA;	c0-0.1,0.1-0.3,0.1-0.5c0-0.4-0.1-0.7-0.3-0.9c-0.2-0.2-0.4-0.3-0.8-0.3c-0.2,0-0.4,0-0.6,0.1C24.3,3.9,24.1,4,24,4.1&#xD;&#xA;	c-0.1,0.2-0.2,0.3-0.2,0.6c0,0.1,0,0.2,0,0.3H22c0-0.4,0.1-0.7,0.2-1c0.1-0.4,0.3-0.8,0.6-1.1c0.3-0.3,0.6-0.5,0.9-0.7&#xD;&#xA;	C24.1,2.1,24.5,2,24.9,2c0.6,0,1.1,0.1,1.5,0.3c0.4,0.2,0.7,0.4,0.9,0.7c0.2,0.3,0.4,0.6,0.5,0.9C27.9,4.1,28,4.4,28,4.7&#xD;&#xA;	C28,5,28,5.3,27.9,5.5z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black156" d="M16,20h-6v2h6V20z M16,24h-6v2h6V24z M25,16c-2.1,0-4.1-0.8-5.7-2H5c-0.6,0-1-0.4-1-1v-3H2c-1.1,0-2,0.9-2,2&#xD;&#xA;	v10c0,1.1,0.9,2,2,2h4v6h14v-6h4c1.1,0,2-0.9,2-2v-6.1C25.7,16,25.3,16,25,16z M18,28H8V18h10V28z M8,4h8.5c0.3-0.7,0.6-1.4,1-2H6&#xD;&#xA;	v10h2V4z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 68)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0157 {fill:#727272;}
</style>
<path class="st0157" d="M6,6h14v2H6V6z M12,24H2V2h22v10h2V1c0-0.5-0.5-1-1-1H1C0.5,0,0,0.5,0,1v24c0,0.5,0.5,1,1,1h11V24z M6,12h10h4&#xD;&#xA;	v-2H6V12z M6,20h6c0-0.7,0.2-1.4,0.6-2H6V20z M6,16h10v-2H6V16z" xmlns="http://www.w3.org/2000/svg" />
<path id="Print" class="st0157" d="M28,20v-6H18v6h2v-4h6v4H28z M30,18L30,18v3c0,0.6-0.4,1-1,1H17c-0.6,0-1-0.4-1-1v-3l0,0&#xD;&#xA;	c-1.1,0-2,0.9-2,2v8c0,1.1,0.9,2,2,2h2v2h10v-2h2c1.1,0,2-0.9,2-2v-8C32,18.9,31.1,18,30,18z M26,30h-6v-4h6V30z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black158 { fill:#727272;}
	.Blue158 { fill:#757575;}
</style>
<path class="Black158" d="M19.4,26H16c0,0,0,0,0,0c0,0,0,0,0,0H6V4h12v5c0,0.6,0.4,1,1,1h5v11.4l2,2V9l-7-7H5C4.4,2,4,2.4,4,3v24&#xD;&#xA;	c0,0.6,0.4,1,1,1h16.4L19.4,26z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue158" d="M16,12c3.3,0,6,2.7,6,6c0,1.2-0.4,2.3-1,3.3l4.6,4.6c0.5,0.5,0.5,1.3,0,1.7c-0.5,0.5-1.3,0.5-1.7,0L19.3,23&#xD;&#xA;	c-0.9,0.6-2.1,1-3.3,1c-3.3,0-6-2.7-6-6C10,14.7,12.7,12,16,12z M16,22c2.2,0,4-1.8,4-4s-1.8-4-4-4s-4,1.8-4,4S13.8,22,16,22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow159 { fill:#979797;}
	.Black159 { fill:#727272;}
</style>
<path class="Black159" d="M8,10h14v2H8V10z M8,16h14v-2H8V16z M8,8h14V6H8V8z M18,28H4V2h22v14h1c0.3,0,0.7,0,1,0.1V1c0-0.6-0.4-1-1-1&#xD;&#xA;	H3C2.4,0,2,0.4,2,1v28c0,0.6,0.4,1,1,1h15V28z M8,24h10.2c0.3-0.9,1-1.5,1.8-1.8V22H8V24z M8,20h12.1c0.2-0.7,0.5-1.4,0.9-2H8V20z" xmlns="http://www.w3.org/2000/svg" />
<path class="Yellow159" d="M31,24h-1v-3c0-1.7-1.3-3-3-3h-2c-1.7,0-3,1.3-3,3v3h-1c-0.6,0-1,0.4-1,1v6c0,0.6,0.4,1,1,1h10&#xD;&#xA;	c0.6,0,1-0.4,1-1v-6C32,24.4,31.6,24,31,24z M24,21c0-0.6,0.4-1,1-1h2c0.6,0,1,0.4,1,1v3h-4V21z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0160 {fill:#727272;}
</style>
<path class="st0160" d="M16,10V4l16,10L16,24v-6C0,18,0,26,0,26S0,10,16,10z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue161 { fill:#757575;}
	.Green161 { fill:#404040;}
	.Red161 { fill:#585858;}
</style>
<path class="Red161" d="M12,26h-0.2H9.9H9.8l0-0.1L9.2,24H4.8l-0.6,1.9l0,0.1H4.1H2.2H2l0.1-0.2l3.9-11.7L6,14h0.1H8h0.1l0,0.1&#xD;&#xA;	l3.8,11.7L12,26L12,26z M5.4,22h3.2L7,16.7c0,0,0,0,0-0.1c0,0,0,0,0,0.1L5.4,22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Green161" d="M20,26V14h4.4c1.3,0,2.4,0.2,3.1,0.7c0.7,0.5,1.1,1.2,1.1,2.1c0,0.6-0.2,1.2-0.7,1.7c-0.4,0.5-1,0.8-1.7,1v0&#xD;&#xA;	c0.9,0.1,1.5,0.4,2,0.9c0.5,0.5,0.8,1.2,0.8,1.9c0,1.1-0.4,2-1.2,2.6c-0.8,0.6-1.9,1-3.2,1H20z M22.7,16v2.8h1.2&#xD;&#xA;	c0.6,0,1-0.1,1.3-0.4c0.3-0.3,0.5-0.6,0.5-1.1c0-0.9-0.7-1.3-2-1.3H22.7z M22.7,20.8V24h1.5c0.6,0,1.1-0.1,1.5-0.4&#xD;&#xA;	c0.4-0.3,0.5-0.7,0.5-1.2c0-0.5-0.2-0.9-0.5-1.1c-0.3-0.3-0.8-0.4-1.5-0.4H22.7z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue161" d="M23.1,6.9C21.3,5.1,18.8,4,16,4c-4.8,0-8.9,3.4-9.8,8h2.1c0.9-3.4,4-6,7.7-6c2.2,0,4.2,0.9,5.6,2.4L18,12h5.7&#xD;&#xA;	h2.1H26V4L23.1,6.9z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black162 { fill:#727272;}
	.st0162 {opacity:0.75;}
</style>
<g class="st0162" xmlns="http://www.w3.org/2000/svg">
	<path class="Black162" d="M19.7,7.7c-0.1-0.3-0.3-0.5-0.2-0.9c0-0.1,0.2-0.2,0.3-0.2c-0.7-2.2,0-4.4,2.5-4.6c2.7-0.2,3.2,1.8,3.2,1.8&#xD;&#xA;		s1.4-0.1,0.6,2.9c0.1,0,0.3,0,0.3,0.2c0.1,0.3,0,0.6-0.2,0.9c-0.1,0.3,0.1,1-0.5,1c0,0,0,0.1,0,0.1c-0.3,1.4-1.2,3-2.8,3&#xD;&#xA;		c-1.6,0-2.4-1.6-2.8-3c0,0,0-0.1,0-0.1C19.7,8.7,19.9,8,19.7,7.7z M6.3,8.7c0,0,0,0.1,0,0.1c0.3,1.4,1.2,3,2.8,3&#xD;&#xA;		c1.6,0,2.4-1.6,2.8-3c0,0,0-0.1,0-0.1c0.6,0,0.4-0.7,0.5-1c0.1-0.3,0.2-0.5,0.2-0.9c-0.1-0.2-0.3-0.2-0.3-0.2&#xD;&#xA;		c0.7-2.9-0.6-2.9-0.6-2.9S11,1.8,8.3,2C5.8,2.2,5.1,4.4,5.8,6.6c-0.1,0-0.2,0.1-0.3,0.2C5.4,7.2,5.6,7.4,5.7,7.7&#xD;&#xA;		C5.9,8,5.7,8.7,6.3,8.7z M25.3,11.9c-0.5,0.9-1.2,2.5-2.3,2.5c-0.5,0-0.8-0.3-1.2-0.7c0,0.3,0,0.5-0.1,0.8c0.1,0.1,0.1,0.3,0.1,0.4&#xD;&#xA;		c0.2,0.9,0,1.6-0.2,2c0,0.4-0.1,0.7-0.2,1H30v-0.9C30,12.5,26.7,14,25.3,11.9z M10.4,17c-0.2-0.4-0.5-1.1-0.3-2.1&#xD;&#xA;		c0-0.1,0-0.2,0.1-0.3c0-0.3-0.1-0.5-0.1-0.8c-0.3,0.3-0.7,0.5-1.1,0.5c-1.1,0-1.8-1.6-2.3-2.6C5.4,14.1,2,12.5,2,17.1V18h8.6&#xD;&#xA;		C10.5,17.7,10.4,17.4,10.4,17z" />
</g>
<path class="Black162" d="M12.3,16.4c-0.2-0.3-0.3-0.6-0.3-1c0-0.2,0.2-0.2,0.3-0.2c-0.7-2.5,0-5,2.9-5.2c3-0.2,3.7,2,3.7,2&#xD;&#xA;	s1.6-0.1,0.7,3.2c0.1,0,0.3-0.1,0.4,0.2c0.1,0.4,0,0.6-0.2,1c-0.2,0.3,0.1,1.1-0.6,1.1c0,0,0,0.1,0,0.1C18.8,19.2,17.8,21,16,21&#xD;&#xA;	c-1.8,0-2.8-1.7-3.2-3.4c0,0,0-0.1,0-0.1C12.2,17.6,12.4,16.8,12.3,16.4z M18.7,21.2c-0.5,1-1.4,2.8-2.7,2.8c-1.3,0-2.1-1.8-2.6-2.9&#xD;&#xA;	C11.9,23.6,8,21.8,8,27v1h16v-1C24,21.9,20.2,23.5,18.7,21.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow163 { fill:#979797;}
	.Black163 { fill:#727272;}
	.st0163 {opacity:0.5;}
</style>
<g class="st0163" xmlns="http://www.w3.org/2000/svg">
	<path class="Black163" d="M29,2H14v10h2V7.3L27.6,15L16,22.7V18h-2v10h15c0.5,0,1-0.5,1-1V3C30,2.5,29.5,2,29,2z" />
</g>
<path class="Black163" d="M8,16h10v3l6-4l-6-4v3H8V16z" xmlns="http://www.w3.org/2000/svg" />
<path class="Yellow163" d="M6,18v-6h6V2H3C2.5,2,2,2.5,2,3v24c0,0.5,0.5,1,1,1h9V18H6z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0164 {fill:#727272;enable-background:new    ;}
</style>
<path class="st0164" d="M20,6h10v2H20V6z M2,8h16V6H2V8z M20,12h10v-2H20V12z M2,12h16v-2H2V12z M20,16h10v-2H20V16z M2,16h16v-2H2V16z&#xD;&#xA;	 M20,20h10v-2H20V20z M2,20h16v-2H2V20z M20,24h10v-2H20V24z M2,24h16v-2H2V24z" xmlns="http://www.w3.org/2000/svg" />
<rect x="20" y="2" class="st0164" width="10" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="2" class="st0164" width="16" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="20" y="26" class="st0164" width="10" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="2" y="26" class="st0164" width="16" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 306)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black165 { fill:#727272;}
	.Yellow165 { fill:#979797;}
</style>
<path class="Yellow165" d="M29,22H1c-0.6,0-1-0.5-1-1V9c0-0.6,0.4-1,1-1h28c0.5,0,1,0.4,1,1v12C30,21.5,29.5,22,29,22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black165" d="M4,22H2v-6h2V22z M8,18H6v4h2V18z M12,16h-2v6h2V16z M16,18h-2v4h2V18z M20,16h-2v6h2V16z M24,18h-2v4h2V18z&#xD;&#xA;	 M28,16h-2v6h2V16z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black166 { fill:#727272;}
	.Yellow166 { fill:#979797;}
</style>
<path class="Yellow166" d="M21,30H9c-0.6,0-1-0.5-1-1V1c0-0.6,0.4-1,1-1h12c0.5,0,1,0.4,1,1v28C22,29.5,21.5,30,21,30z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black166" d="M22,4h-6V2h6V4z M18,8h4V6h-4V8z M16,12h6v-2h-6V12z M18,16h4v-2h-4V16z M16,20h6v-2h-6V20z M18,24h4v-2h-4&#xD;&#xA;	V24z M16,28h6v-2h-6V28z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black167 {fill:#727272;}
</style>
<path class="Black167" d="M27,4h-3v10H8V4H5C4.4,4,4,4.4,4,5v22c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1V5C28,4.4,27.6,4,27,4z M24,24H8v-6&#xD;&#xA;	h16V24z M10,4v8h10V4H10z M14,10h-2V6h2V10z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow168 { fill:#979797;}
	.Red168 { fill:#585858;}
	.Black168 { fill:#727272;}
	.Blue168 { fill:#757575;}
	.White168 { fill:#FFFFFF;}
	.Green168 { fill:#404040;}
	.st0168 {opacity:0.75;}
	.st1168 {opacity:0.5;}
	.st2168 {opacity:0.25;}
	.st3168 { fill:#979797;}
</style>
<g xmlns="http://www.w3.org/2000/svg">
</g>
<g id="SaveAs" xmlns="http://www.w3.org/2000/svg">
	<path class="Black168" d="M31,0H19c-0.6,0-1,0.4-1,1v16c0,0.6,0.4,1,1,1h12c0.6,0,1-0.4,1-1V1C32,0.4,31.6,0,31,0z M30,16H20V2h10V16z&#xD;&#xA;		 M22,20v4H6v-6h10v-4H6V4H3C2.4,4,2,4.4,2,5v22c0,0.6,0.4,1,1,1h22c0.6,0,1-0.4,1-1v-7H22z M16,4H8v8h8V4z M12,10h-2V6h2V10z" />
</g>
</g>

<g transform="translate(34, 476)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow169 {fill:#FFB115;}
	.Red169 {fill:#D11C1C;}
	.Blue169 {fill:#1177D7;}
	.Green169 {fill:#039C23;}
	.Black169 {fill:#727272;}
	.White169 {fill:#FFFFFF;}
	.st0169 {opacity:0.75;}
</style>
<g id="Select" xmlns="http://www.w3.org/2000/svg">
	<path class="Black169" d="M18.2,20H26L10,4v22l5.3-5.3l2.7,6.7c0.2,0.5,0.8,0.8,1.3,0.5l0.9-0.4c0.5-0.2,0.8-0.8,0.5-1.3L18.2,20z" />
</g>
</g>

<g transform="translate(68, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0170 {fill:#727272;}
	.st1170 {opacity:0.5;fill:#727272;}
</style>
<path id="layer_1_" class="st0170" d="M24,8H6V6h18V8z M24,10H6v2h18V10z M24,14H6v2h18V14z M24,18H6v2h18V18z M24,22H6v2h18V22z" xmlns="http://www.w3.org/2000/svg" />
<path id="layer" class="st1170" d="M2,0h4v2H2v4H0V0H2z M8,2h6V0H8V2z M16,2h6V0h-6V2z M24,0v2h4v4h2V2V0H24z M28,14h2V8h-2V14z M28,22&#xD;&#xA;	h2v-6h-2V22z M28,28h-4v2h4h2v-6h-2V28z M8,30h6v-2H8V30z M16,30h6v-2h-6V30z M2,8H0v6h2V8z M2,16H0v6h2V16z M2,24H0v4v2h6v-2H2V24z&#xD;&#xA;	" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0171 {fill:#727272;}
</style>
<path class="st0171" d="M10,10H2V4h8V10z M20,4h-8v6h8V4z M30,4h-8v6h8V4z M10,12H2v6h8V12z M20,12h-8v6h8V12z M30,12h-8v6h8V12z&#xD;&#xA;	 M10,20H2v6h8V20z M20,20h-8v6h8V20z M30,20h-8v6h8V20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue172 { fill:#757575;}
	.Black172 { fill:#727272;}
	.st0172 {opacity:0.5;}
</style>
<rect x="12" y="12" class="Blue172" width="8" height="6" xmlns="http://www.w3.org/2000/svg" />
<g class="st0172" xmlns="http://www.w3.org/2000/svg">
	<path class="Black172" d="M10,10H2V4h8V10z M20,4h-8v6h8V4z M30,4h-8v6h8V4z M10,12H2v6h8V12z M30,12h-8v6h8V12z M10,20H2v6h8V20z&#xD;&#xA;		 M20,20h-8v6h8V20z M30,20h-8v6h8V20z" />
</g>
</g>

<g transform="translate(476, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue173 { fill:#757575;}
	.Black173 { fill:#727272;}
	.st0173 {opacity:0.5;}
</style>
<path class="Blue173" d="M20,10h-8V4h8V10z M20,12h-8v6h8V12z M20,20h-8v6h8V20z" xmlns="http://www.w3.org/2000/svg" />
<g class="st0173" xmlns="http://www.w3.org/2000/svg">
	<path class="Black173" d="M10,10H2V4h8V10z M30,4h-8v6h8V4z M10,12H2v6h8V12z M30,12h-8v6h8V12z M10,20H2v6h8V20z M30,20h-8v6h8V20z" />
</g>
</g>

<g transform="translate(306, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue174 { fill:#757575;}
	.Black174 { fill:#727272;}
	.st0174 {opacity:0.5;}
</style>
<path class="Blue174" d="M20,10h-8V4h8V10z M20,12h-8v6h8V12z M20,20h-8v6h8V20z" xmlns="http://www.w3.org/2000/svg" />
<g class="st0174" xmlns="http://www.w3.org/2000/svg">
	<path class="Black174" d="M10,10H2V4h8V10z M30,4h-8v6h8V4z M10,12H2v6h8V12z M30,12h-8v6h8V12z M10,20H2v6h8V20z M30,20h-8v6h8V20z" />
</g>
</g>

<g transform="translate(68, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black175 {fill:#727272;}
	.Blue175 {fill:#1177D7;}
</style>
<path class="Blue175" d="M18.4,8c2.6,0,4.8,4.3,4.8,9.6c0,1.3,1.1,2.4,2.4,2.4c1.3,0,2.4-1.1,2.4-2.4C28,12.3,23.7,8,18.4,8z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black175" d="M17,9.3l3,3L13.3,19c-1.4,1.4-3.7,1.4-5.1,0l-5.1-5.1c-1.4-1.4-1.4-3.7,0-5.1L9.7,2l3,3l-1.9,1.9&#xD;&#xA;	C10.3,7.4,10,8.2,10,9c0,0.8,0.3,1.6,0.9,2.1c0.6,0.6,1.3,0.9,2.1,0.9s1.6-0.3,2.1-0.9L17,9.3z M13.7,9.7l5.9-5.9&#xD;&#xA;	c0.4-0.4,0.4-1,0-1.4l0,0c-0.4-0.4-1-0.4-1.4,0l-5.9,5.9c-0.4,0.4-0.4,1,0,1.4l0,0C12.7,10.1,13.3,10.1,13.7,9.7z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black176 { fill:#727272;}
	.Yellow176 { fill:#979797;}
</style>
<path class="Black176" d="M28,24H10v2h18V24z M28,16H10v2h18V16z M16,20h-6v2h6V20z M31,4H7C6.5,4,6,4.5,6,5v26c0,0.5,0.5,1,1,1h24&#xD;&#xA;	c0.5,0,1-0.5,1-1V5C32,4.5,31.5,4,31,4z M30,30H8V6h22V30z" xmlns="http://www.w3.org/2000/svg" />
<path class="Yellow176" d="M28,22H18v-2h10V22z M24,13V1c0-0.6-0.5-1-1-1H1C0.4,0,0,0.4,0,1v12c0,0.6,0.4,1,1,1h22&#xD;&#xA;	C23.5,14,24,13.6,24,13z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black176" d="M19,7.8c0,0-0.1,0-0.1,0c-0.1,0-0.3,0.1-0.4,0.2c-0.1,0.1-0.2,0.2-0.3,0.4C18,8.6,18,8.8,18,9.1v0.7&#xD;&#xA;	c0,0.4-0.1,0.7-0.2,1c-0.1,0.3-0.3,0.5-0.4,0.7c-0.2,0.2-0.4,0.3-0.6,0.4C16.6,12,16.4,12,16.3,12H14v-1.8h1.2c0.2,0,0.3,0,0.4-0.1&#xD;&#xA;	c0.1-0.1,0.2-0.2,0.2-0.3C15.9,9.6,16,9.5,16,9.4c0-0.1,0-0.3,0-0.4V8.8c0-0.4,0.1-0.6,0.2-0.9c0.1-0.2,0.2-0.4,0.4-0.5&#xD;&#xA;	s0.3-0.2,0.5-0.3C17.2,7.1,17.3,7,17.4,7v0c-0.1,0-0.2,0-0.4-0.1c-0.2-0.1-0.3-0.2-0.5-0.3S16.3,6.3,16.2,6S16,5.4,16,5v0&#xD;&#xA;	c0-0.1,0-0.3,0-0.4c0-0.1,0-0.3-0.1-0.4C15.8,4.1,15.7,4,15.6,4c-0.1-0.1-0.2-0.1-0.4-0.1H14V2h2.3c0.2,0,0.3,0,0.5,0.1&#xD;&#xA;	c0.2,0.1,0.4,0.2,0.6,0.4c0.2,0.2,0.3,0.4,0.4,0.7c0.1,0.3,0.2,0.6,0.2,1v0.6c0,0.3,0,0.5,0.1,0.7c0.1,0.2,0.2,0.3,0.3,0.5&#xD;&#xA;	c0.1,0.1,0.3,0.2,0.4,0.2c0,0,0.1,0,0.1,0V7.8z M5,7.8c0,0,0.1,0,0.1,0c0.1,0,0.3,0.1,0.4,0.2c0.1,0.1,0.2,0.2,0.3,0.4&#xD;&#xA;	C6,8.6,6,8.8,6,9.1v0.7c0,0.4,0.1,0.7,0.2,1c0.1,0.3,0.3,0.5,0.4,0.7c0.2,0.2,0.4,0.3,0.6,0.4C7.4,12,7.6,12,7.7,12H10v-1.8H8.8&#xD;&#xA;	c-0.2,0-0.3,0-0.4-0.1C8.3,10,8.2,9.9,8.1,9.8C8.1,9.6,8,9.5,8,9.4C8,9.2,8,9.1,8,9V8.8C8,8.5,7.9,8.2,7.8,8&#xD;&#xA;	C7.7,7.8,7.6,7.6,7.5,7.4S7.2,7.2,7,7.1C6.8,7.1,6.7,7,6.6,7v0c0.1,0,0.2,0,0.4-0.1c0.2-0.1,0.3-0.2,0.5-0.3S7.7,6.3,7.8,6&#xD;&#xA;	S8,5.4,8,5v0c0-0.1,0-0.3,0-0.4c0-0.1,0-0.3,0.1-0.4C8.2,4.1,8.3,4,8.4,4c0.1-0.1,0.2-0.1,0.4-0.1H10V2H7.7C7.6,2,7.4,2,7.2,2.1&#xD;&#xA;	C7,2.2,6.8,2.4,6.6,2.6C6.5,2.7,6.3,3,6.2,3.2C6.1,3.5,6,3.8,6,4.2v0.6c0,0.3,0,0.5-0.1,0.7C5.8,5.7,5.7,5.9,5.5,6&#xD;&#xA;	C5.4,6.1,5.3,6.2,5.1,6.2c0,0-0.1,0-0.1,0V7.8z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black177 { fill:#727272;}
	.Yellow177 { fill:#979797;}
</style>
<path class="Black177" d="M28,24H10v2h18V24z M28,16H10v2h18V16z M16,20h-6v2h6V20z M31,4H7C6.5,4,6,4.5,6,5v26c0,0.5,0.5,1,1,1h24&#xD;&#xA;	c0.5,0,1-0.5,1-1V5C32,4.5,31.5,4,31,4z M30,30H8V6h22V30z" xmlns="http://www.w3.org/2000/svg" />
<path class="Yellow177" d="M28,22H18v-2h10V22z M24,13V1c0-0.6-0.5-1-1-1H1C0.4,0,0,0.4,0,1v12c0,0.6,0.4,1,1,1h22&#xD;&#xA;	C23.5,14,24,13.6,24,13z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black177" d="M4.6,5.4c0.2-0.3,0.5-0.6,0.8-0.8c0.3-0.2,0.7-0.3,1.1-0.4C6.9,4.1,7.3,4,7.7,4c0.4,0,0.7,0,1.1,0.1&#xD;&#xA;	c0.4,0.1,0.7,0.2,1,0.3c0.3,0.2,0.6,0.4,0.8,0.7S11,5.8,11,6.2v4c0,0.4,0,0.7,0.1,1c0,0.3,0.1,0.6,0.2,0.7H9.2&#xD;&#xA;	c0-0.1-0.1-0.2-0.1-0.4c0-0.1,0-0.3,0-0.4c-0.3,0.4-0.7,0.6-1.1,0.7c-0.4,0.1-0.9,0.2-1.3,0.2c-0.4,0-0.7,0-1-0.1S5,11.8,4.7,11.6&#xD;&#xA;	c-0.2-0.2-0.4-0.4-0.5-0.7C4.1,10.6,4,10.3,4,9.9c0-0.4,0.1-0.8,0.2-1.1c0.1-0.3,0.3-0.5,0.6-0.7C5,7.9,5.3,7.8,5.6,7.7&#xD;&#xA;	c0.3-0.1,0.6-0.2,0.9-0.2c0.3,0,0.6-0.1,0.9-0.1c0.3,0,0.6-0.1,0.8-0.1C8.4,7.2,8.6,7.1,8.7,7c0.1-0.1,0.2-0.3,0.2-0.5&#xD;&#xA;	c0-0.2,0-0.4-0.1-0.5C8.7,5.8,8.7,5.7,8.5,5.6S8.3,5.5,8.1,5.5c-0.2,0-0.3,0-0.5,0c-0.4,0-0.7,0.1-0.9,0.3C6.4,5.9,6.3,6.2,6.3,6.6&#xD;&#xA;	h-2C4.3,6.1,4.4,5.7,4.6,5.4z M8.6,8.4c-0.1,0-0.3,0.1-0.4,0.1C8,8.5,7.9,8.6,7.7,8.6c-0.2,0-0.3,0-0.5,0.1c-0.2,0-0.3,0.1-0.5,0.1&#xD;&#xA;	C6.6,8.8,6.5,8.9,6.4,9C6.3,9.1,6.2,9.2,6.1,9.3C6.1,9.4,6,9.6,6,9.8c0,0.2,0,0.4,0.1,0.5c0.1,0.1,0.2,0.2,0.3,0.3&#xD;&#xA;	c0.1,0.1,0.2,0.1,0.4,0.2c0.2,0,0.3,0,0.5,0c0.4,0,0.7-0.1,0.9-0.2c0.2-0.1,0.4-0.3,0.5-0.5c0.1-0.2,0.2-0.4,0.2-0.6&#xD;&#xA;	c0-0.2,0-0.4,0-0.5V8.2C8.8,8.3,8.7,8.3,8.6,8.4z M14.6,2v3.2h0c0.2-0.4,0.6-0.7,1-0.9C16,4.1,16.5,4,16.9,4c0.4,0,0.7,0.1,1.1,0.2&#xD;&#xA;	c0.4,0.2,0.7,0.4,1,0.7c0.3,0.3,0.5,0.8,0.7,1.3C19.9,6.8,20,7.4,20,8.1s-0.1,1.3-0.3,1.8c-0.2,0.5-0.4,0.9-0.7,1.3&#xD;&#xA;	c-0.3,0.3-0.6,0.6-1,0.7c-0.4,0.2-0.7,0.2-1.1,0.2c-0.5,0-1-0.1-1.5-0.3c-0.4-0.2-0.8-0.5-1-0.9h0v1h-1.9V2H14.6z M17.9,7.2&#xD;&#xA;	c-0.1-0.3-0.2-0.6-0.3-0.8C17.4,6.2,17.2,6,17,5.8c-0.2-0.1-0.5-0.2-0.8-0.2c-0.3,0-0.6,0.1-0.8,0.2c-0.2,0.1-0.4,0.3-0.5,0.5&#xD;&#xA;	c-0.1,0.2-0.2,0.5-0.3,0.8c-0.1,0.3-0.1,0.6-0.1,0.9c0,0.3,0,0.6,0.1,0.9c0.1,0.3,0.2,0.6,0.3,0.8c0.1,0.2,0.3,0.4,0.5,0.5&#xD;&#xA;	c0.2,0.1,0.5,0.2,0.8,0.2c0.3,0,0.6-0.1,0.8-0.2c0.2-0.1,0.4-0.3,0.5-0.5c0.1-0.2,0.2-0.5,0.3-0.8C17.9,8.8,18,8.4,18,8.1&#xD;&#xA;	C18,7.8,17.9,7.5,17.9,7.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(238, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow178 { fill:#979797;}
	.Black178 { fill:#727272;}
</style>
<path class="Yellow178" d="M12.1,21.3C12.2,21,15,14,22,14c1.5,0,2.9,0.3,4,0.9V7c0-0.6-0.4-1-1-1H3C2.4,6,2,6.4,2,7v14&#xD;&#xA;	c0,0.6,0.4,1,1,1h3v6l6-6h0C12,21.8,12,21.5,12.1,21.3z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black178" d="M22,16c5.7,0,8,6,8,6s-2.3,6-8,6c-5.7,0-8-6-8-6S16.3,16,22,16 M22,18c-3.3,0-5.1,2.7-5.8,4&#xD;&#xA;	c0.7,1.3,2.5,4,5.8,4c3.3,0,5.1-2.7,5.8-4C27.1,20.7,25.3,18,22,18L22,18z M22,20c-1.1,0-2,0.9-2,2s0.9,2,2,2c1.1,0,2-0.9,2-2&#xD;&#xA;	S23.1,20,22,20z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(34, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black179 { fill:#727272;}
</style>
<path class="Black179" d="M14,4h-2h-2c-4.4,0-8,3.6-8,8s3.6,8,8,8h2v6v2h4V8h4v20h4V8h4V4H14z M10,16c-2.2,0-4-1.8-4-4s1.8-4,4-4h2v8&#xD;&#xA;	H10z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 442)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black180 { fill:#727272;}
	.Blue180 { fill:#757575;}
</style>
<path class="Black180" d="M24,8H6V6h18V8z M24,10H6v2h18V10z M24,14H6v2h18V14z M24,18H6v2h18V18z M24,22H6v2h18V22z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue180" d="M2,0h4v2H2v4H0V0H2z M8,2h6V0H8V2z M16,2h6V0h-6V2z M24,0v2h4v4h2V2V0H24z M28,14h2V8h-2V14z M28,22h2v-6h-2&#xD;&#xA;	V22z M28,28h-4v2h4h2v-6h-2V28z M8,30h6v-2H8V30z M16,30h6v-2h-6V30z M2,8H0v6h2V8z M2,16H0v6h2V16z M2,24H0v4v2h6v-2H2V24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue181 { fill:#757575;}
	.Black181 { fill:#727272;}
</style>
<path class="Black181" d="M30,16H12v-2h18V16z M30,8H12v2h18V8z M30,20H12v2h18V20z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue181" d="M6,6h4l-5,5L0,6h4V0h2V6z M4,30h2v-6h4l-5-5l-5,5h4V30z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0182 {fill:#727272;}
</style>
<g id="SpellCheck" xmlns="http://www.w3.org/2000/svg">
	<polygon class="st0182" points="27,9 12,24 7,19 4,22 12,30 30,12 	" />
	<path class="st0182" d="M7.9,12H6l-0.6-1.8H2.6L2,12H0l3-8h2.1L7.9,12z M5,8.8L4.1,6.1C4.1,5.9,4,5.7,4,5.4l0,0c0,0.2-0.1,0.5-0.1,0.7&#xD;&#xA;		L3,8.8H5z M8.9,12V4h2.9c0.9,0,1.6,0.2,2.1,0.5s0.7,0.8,0.7,1.4c0,0.4-0.1,0.8-0.4,1.1c-0.3,0.3-0.7,0.5-1.1,0.7l0,0&#xD;&#xA;		c0.6,0.1,1,0.3,1.4,0.6C14.9,8.6,15,9.1,15,9.6c0,0.7-0.3,1.3-0.8,1.7C13.6,11.8,12.9,12,12,12H8.9z M10.7,5.3v1.9h0.8&#xD;&#xA;		c0.4,0,0.7-0.1,0.9-0.3s0.3-0.4,0.3-0.7c0-0.6-0.4-0.9-1.3-0.9H10.7z M10.7,8.6v2.1h1c0.4,0,0.7-0.1,1-0.3c0.2-0.2,0.4-0.5,0.4-0.8&#xD;&#xA;		S13,9,12.8,8.8s-0.6-0.3-1-0.3h-1.1V8.6z M22,11.7c-0.6,0.3-1.3,0.4-2.3,0.4c-1.2,0-2.2-0.4-2.9-1.1c-0.7-0.7-1.1-1.7-1.1-2.9&#xD;&#xA;		c0-1.3,0.4-2.3,1.2-3.1c0.8-0.8,1.8-1.2,3.1-1.2c0.8,0,1.4,0.1,2,0.3v1.7c-0.5-0.3-1.1-0.5-1.8-0.5c-0.8,0-1.4,0.2-1.8,0.7&#xD;&#xA;		c-0.5,0.5-0.7,1.1-0.7,1.9s0.2,1.4,0.7,1.8s1,0.7,1.8,0.7c0.7,0,1.3-0.2,1.9-0.5v1.8C22.1,11.7,22,11.7,22,11.7z" />
</g>
</g>

<g transform="translate(102, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black183 { fill:#727272;}
	.Red183 { fill:#585858;}
</style>
<path class="Red183" d="M32,24c-1.4,0-2.2-0.7-2.7-1.3C28.8,22.2,28.6,22,28,22s-0.8,0.2-1.3,0.7C26.2,23.3,25.4,24,24,24&#xD;&#xA;	s-2.2-0.7-2.7-1.3C20.8,22.2,20.6,22,20,22s-0.8,0.2-1.3,0.7C18.2,23.3,17.4,24,16,24s-2.2-0.7-2.7-1.3C12.8,22.2,12.6,22,12,22&#xD;&#xA;	s-0.8,0.2-1.3,0.7C10.2,23.3,9.4,24,8,24s-2.2-0.7-2.7-1.3C4.8,22.2,4.6,22,4,22s-0.8,0.2-1.3,0.7C2.2,23.3,1.4,24,0,24v-2&#xD;&#xA;	c0.6,0,0.8-0.2,1.3-0.7C1.8,20.7,2.6,20,4,20s2.2,0.7,2.7,1.3C7.2,21.8,7.4,22,8,22s0.8-0.2,1.3-0.7C9.8,20.7,10.6,20,12,20&#xD;&#xA;	s2.2,0.7,2.7,1.3c0.5,0.5,0.7,0.7,1.3,0.7s0.8-0.2,1.3-0.7c0.5-0.5,1.3-1.3,2.7-1.3s2.2,0.7,2.7,1.3c0.5,0.5,0.7,0.7,1.3,0.7&#xD;&#xA;	s0.8-0.2,1.3-0.7c0.5-0.5,1.3-1.3,2.7-1.3s2.2,0.7,2.7,1.3c0.5,0.5,0.7,0.7,1.3,0.7V24z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black183" d="M12.1,18H9.6l-0.7-2.2H5.2L4.5,18H2L5.7,8h2.7L12.1,18z M8.3,14l-1.1-3.3C7.1,10.4,7.1,10.1,7,9.8H7&#xD;&#xA;	c0,0.3-0.1,0.6-0.2,0.9L5.7,14H8.3z M13.3,18l0-10h3.7c1.1,0,2,0.2,2.6,0.6c0.6,0.4,0.9,1,0.9,1.7c0,0.5-0.2,1-0.6,1.4&#xD;&#xA;	c-0.4,0.4-0.8,0.7-1.4,0.8v0c0.7,0.1,1.3,0.3,1.7,0.8c0.4,0.4,0.7,1,0.7,1.6c0,0.9-0.3,1.6-1,2.2c-0.7,0.5-1.6,0.8-2.7,0.8H13.3z&#xD;&#xA;	 M15.6,9.7V12h1c0.5,0,0.8-0.1,1.1-0.3c0.3-0.2,0.4-0.5,0.4-0.9c0-0.7-0.6-1.1-1.7-1.1H15.6z M15.6,13.7v2.6h1.2&#xD;&#xA;	c0.5,0,0.9-0.1,1.2-0.4c0.3-0.2,0.5-0.6,0.5-1c0-0.4-0.1-0.7-0.4-0.9c-0.3-0.2-0.7-0.3-1.2-0.3H15.6z M30,17.6&#xD;&#xA;	c-0.7,0.4-1.7,0.5-2.9,0.5c-1.6,0-2.8-0.4-3.7-1.3c-0.9-0.9-1.3-2.1-1.3-3.6c0-1.6,0.5-2.9,1.5-3.9c1-1,2.3-1.5,3.9-1.5&#xD;&#xA;	c1,0,1.8,0.1,2.5,0.4v2.2c-0.7-0.4-1.5-0.6-2.3-0.6c-1,0-1.7,0.3-2.3,0.9c-0.6,0.6-0.9,1.4-0.9,2.4c0,1,0.3,1.7,0.8,2.3&#xD;&#xA;	c0.6,0.6,1.3,0.9,2.2,0.9c0.9,0,1.7-0.2,2.5-0.6V17.6z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black184 {fill:#727272;}
	.st0184 {opacity:0.5;}
</style>
<g id="SplitTable_1_" class="st0184" xmlns="http://www.w3.org/2000/svg">
	<path class="Black184" d="M10,8H2v6h8V8z M20,8h-8v6h8V8z M30,8h-8v6h8V8z M10,0H2v6h8V0z M20,0h-8v6h8V0z M30,0h-8v6h8V0z M30,18h-8&#xD;&#xA;		v6h8V18z M20,18h-8v6h8V18z M10,18H2v6h8V18z M10,26H2v6h8V26z M20,26h-8v6h8V26z M30,26h-8v6h8V26z" />
</g>
</g>

<g transform="translate(68, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black185 { fill:#727272;}
	.Green185 { fill:#404040;}
	.st0185 {opacity:0.5;}
</style>
<g class="st0185" xmlns="http://www.w3.org/2000/svg">
	<path class="Black185" d="M10,6H2V0h8V6z M20,0h-8v6h8V0z M30,0h-8v6h8V0z M10,8H2v6h8V8z M10,16H2v6h8V16z M10,24H2v6h8V24z M20,24&#xD;&#xA;		h-8v6h8V24z M30,24h-8v6h8V24z" />
</g>
<path class="Green185" d="M20,14h-8V8h8V14z M30,8h-8v6h8V8z M30,16h-8v6h8V16z M20,16h-8v6h8V16z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow186 {fill:#FFB115;}
	.Red186 {fill:#D11C1C;}
	.Blue186 {fill:#1177D7;}
	.Green186 {fill:#039C23;}
	.Black186 {fill:#727272;}
	.White186 {fill:#FFFFFF;}
	.st0186 {opacity:0.5;}
	.st1186 {display:none;}
	.st2186 {display:inline;fill:#039C23;}
	.st3186 {display:inline;fill:#D11C1C;}
	.st4186 {display:inline;fill:#727272;}
</style>
<g id="Strikeout" xmlns="http://www.w3.org/2000/svg">
	<path class="Black186" d="M24,14h-7c-0.2-0.1-0.4-0.2-0.7-0.4c-0.7-0.3-1.4-0.6-2-0.9c-0.6-0.3-1-0.6-1.4-0.8c-0.4-0.3-0.7-0.6-0.9-1&#xD;&#xA;		s-0.3-0.8-0.3-1.2c0-0.5,0.1-0.9,0.4-1.3c0.3-0.4,0.6-0.6,1-0.9c0.4-0.2,0.9-0.4,1.4-0.5c0.5-0.1,1.1-0.1,1.6-0.1&#xD;&#xA;		c1.9,0,3.5,0.4,4.8,1.3V4.8c-1-0.5-2.7-0.8-5-0.8c-1,0-2,0.1-3,0.3c-1,0.2-1.8,0.6-2.6,1.1C9.8,5.9,9.2,6.5,8.7,7.2S8,8.8,8,9.8&#xD;&#xA;		c0,0.8,0.1,1.5,0.4,2.1c0.3,0.6,0.6,1.1,1.1,1.6c0.1,0.1,0.3,0.3,0.5,0.4H6v2h7.1c0.1,0,0.1,0.1,0.2,0.1c0.7,0.3,1.3,0.6,1.9,0.9&#xD;&#xA;		c0.6,0.3,1.1,0.6,1.6,0.9c0.4,0.3,0.8,0.6,1,1c0.2,0.4,0.4,0.8,0.4,1.3c0,0.9-0.4,1.7-1.1,2.2c-0.7,0.5-1.9,0.7-3.4,0.7&#xD;&#xA;		c-0.4,0-0.9,0-1.4-0.1s-1-0.2-1.6-0.4c-0.5-0.2-1-0.4-1.5-0.6c-0.5-0.2-0.9-0.5-1.2-0.8v3.6c0.3,0.2,0.7,0.4,1.2,0.5&#xD;&#xA;		c0.5,0.1,1,0.3,1.6,0.4c0.6,0.1,1.1,0.2,1.6,0.2c0.5,0.1,1,0.1,1.3,0.1c1.1,0,2.1-0.1,3.1-0.3s1.9-0.5,2.6-1&#xD;&#xA;		c0.8-0.5,1.4-1.1,1.8-1.8s0.7-1.7,0.7-2.7c0-0.8-0.2-1.5-0.4-2.1c-0.3-0.6-0.7-1.2-1.2-1.7c-0.1-0.1-0.2-0.2-0.3-0.3h4V14z" />
</g>
</g>

<g transform="translate(68, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow187 { fill:#979797;}
	.Red187 { fill:#585858;}
	.Blue187 { fill:#757575;}
	.Green187 { fill:#404040;}
	.Black187 { fill:#727272;}
	.White187 { fill:#FFFFFF;}
	.st0187 {opacity:0.5;}
	.st1187 {display:none;}
	.st2187 { fill:#404040;}
	.st3187 { fill:#585858;}
	.st4187 { fill:#727272;}
</style>
<g id="StrikeoutDouble" xmlns="http://www.w3.org/2000/svg">
	<path class="Black187" d="M24,14h-7c0.5,0.3,1,0.6,1.5,0.9c0.5,0.3,1,0.7,1.5,1.1h4v2h-2.4c0.3,0.6,0.4,1.3,0.4,2.1&#xD;&#xA;		c0,1.1-0.2,2-0.7,2.7s-1,1.3-1.8,1.8c-0.8,0.5-1.6,0.8-2.6,1s-2,0.3-3.1,0.3c-0.4,0-0.8,0-1.3-0.1c-0.5-0.1-1.1-0.1-1.6-0.2&#xD;&#xA;		c-0.6-0.1-1.1-0.2-1.6-0.4C8.7,25.2,8.3,25,8,24.8v-3.6c0.3,0.3,0.7,0.6,1.2,0.8c0.5,0.2,1,0.4,1.5,0.6c0.5,0.2,1,0.3,1.6,0.4&#xD;&#xA;		s1,0.1,1.4,0.1c1.5,0,2.7-0.2,3.4-0.7c0.7-0.5,1.1-1.2,1.1-2.2c0-0.5-0.1-0.9-0.4-1.3c-0.2-0.3-0.5-0.6-0.9-0.9H6v-2h7.1&#xD;&#xA;		c-0.7-0.4-1.3-0.7-1.9-1.1c-0.5-0.3-0.8-0.6-1.2-0.9H6v-2h2.4c0,0,0,0,0,0C8.1,11.4,8,10.7,8,9.8c0-1,0.2-1.9,0.7-2.6&#xD;&#xA;		s1.1-1.3,1.8-1.8c0.8-0.5,1.6-0.8,2.6-1.1c1-0.2,1.9-0.3,3-0.3c2.3,0,4,0.3,5,0.8v3.5c-1.2-0.9-2.8-1.3-4.8-1.3&#xD;&#xA;		c-0.5,0-1.1,0-1.6,0.1c-0.5,0.1-1,0.3-1.4,0.5c-0.4,0.2-0.8,0.5-1,0.9c-0.3,0.4-0.4,0.8-0.4,1.3c0,0.5,0.1,0.9,0.3,1.2&#xD;&#xA;		s0.5,0.7,0.9,1c0,0,0.1,0,0.1,0.1H24V14z" />
</g>
</g>

<g transform="translate(374, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow188 { fill:#979797;}
	.Red188 { fill:#585858;}
	.Blue188 { fill:#757575;}
	.Green188 { fill:#404040;}
	.Black188 { fill:#727272;}
	.White188 { fill:#FFFFFF;}
	.st0188 {opacity:0.5;}
	.st1188 {display:none;}
	.st2188 { fill:#404040;}
	.st3188 { fill:#585858;}
	.st4188 { fill:#727272;}
</style>
<g id="Subscript" xmlns="http://www.w3.org/2000/svg">
	<path class="Black188" d="M2.6,6H8l4.1,7l4.3-7h5.1l-6.8,10.5L22,28h-5.5l-4.6-7.6L7.2,28H2l7.3-11.5L2.6,6z" />
	<path class="Red188" d="M27.4,30.3c0.2-0.3,0.5-0.6,0.8-0.9s0.6-0.5,1-0.7s0.7-0.4,1-0.7s0.6-0.5,0.9-0.7c0.3-0.3,0.5-0.6,0.6-0.9&#xD;&#xA;		c0.2-0.4,0.2-0.8,0.2-1.3c0-0.5-0.1-0.9-0.3-1.3c-0.2-0.4-0.4-0.7-0.7-1c-0.3-0.3-0.7-0.5-1.1-0.6C29.5,22.1,29,22,28.6,22&#xD;&#xA;		c-0.6,0-1.1,0.1-1.6,0.3c-0.5,0.2-0.8,0.5-1.1,0.8c-0.3,0.4-0.5,0.8-0.7,1.3S25,25.4,25,26l0,0h1.9l0,0c0-0.3,0-0.5,0.1-0.8&#xD;&#xA;		c0.1-0.3,0.1-0.5,0.3-0.7c0.1-0.2,0.3-0.4,0.5-0.5c0.2-0.1,0.4-0.2,0.7-0.2c0.4,0,0.8,0.1,1.1,0.4c0.3,0.3,0.4,0.6,0.4,1.1&#xD;&#xA;		c0,0.3-0.1,0.6-0.2,0.8c-0.1,0.2-0.3,0.4-0.5,0.6c-0.2,0.2-0.4,0.4-0.7,0.5c-0.2,0.2-0.5,0.3-0.7,0.5c-0.4,0.3-0.8,0.6-1.2,0.9&#xD;&#xA;		c-0.4,0.3-0.7,0.6-1,0.9c-0.3,0.3-0.5,0.7-0.7,1.1s-0.2,0.9-0.2,1.5H32v-1.7H27.4z" />
</g>
</g>

<g transform="translate(238, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow189 { fill:#979797;}
	.Red189 { fill:#585858;}
	.Blue189 { fill:#757575;}
	.Green189 { fill:#404040;}
	.Black189 { fill:#727272;}
	.White189 { fill:#FFFFFF;}
	.st0189 {opacity:0.5;}
	.st1189 {display:none;}
	.st2189 { fill:#404040;}
	.st3189 { fill:#585858;}
	.st4189 { fill:#727272;}
</style>
<g id="Superscript" xmlns="http://www.w3.org/2000/svg">
	<path class="Black189" d="M2.6,6H8l4.1,7l4.3-7h5.1l-6.8,10.5L22,28h-5.5l-4.6-7.6L7.2,28H2l7.3-11.5L2.6,6z" />
	<path class="Red189" d="M27.4,8.3c0.2-0.3,0.5-0.6,0.8-0.9s0.6-0.5,1-0.7s0.7-0.4,1-0.7s0.6-0.5,0.9-0.7c0.3-0.3,0.5-0.6,0.6-0.9&#xD;&#xA;		c0.2-0.4,0.2-0.8,0.2-1.3c0-0.5-0.1-0.9-0.3-1.3c-0.2-0.4-0.4-0.7-0.7-1c-0.3-0.3-0.7-0.5-1.1-0.6C29.5,0.1,29,0,28.6,0&#xD;&#xA;		C28,0,27.5,0.1,27,0.3c-0.5,0.2-0.8,0.5-1.1,0.8c-0.3,0.4-0.5,0.8-0.7,1.3S25,3.4,25,4l0,0h1.9l0,0c0-0.3,0-0.5,0.1-0.8&#xD;&#xA;		c0.1-0.3,0.1-0.5,0.3-0.7c0.1-0.2,0.3-0.4,0.5-0.5c0.2-0.1,0.4-0.2,0.7-0.2c0.4,0,0.8,0.1,1.1,0.4C29.8,2.4,30,2.7,30,3.2&#xD;&#xA;		c0,0.3-0.1,0.6-0.2,0.8c-0.1,0.2-0.3,0.4-0.5,0.6C29,4.8,28.8,5,28.6,5.2c-0.2,0.2-0.5,0.3-0.7,0.5c-0.4,0.3-0.8,0.6-1.2,0.9&#xD;&#xA;		c-0.4,0.3-0.7,0.6-1,0.9c-0.3,0.3-0.5,0.7-0.7,1.1s-0.2,0.9-0.2,1.5H32V8.3H27.4z" />
</g>
</g>

<g transform="translate(272, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue190 { fill:#757575;}
</style>
<path class="Blue190" d="M28,14c0-6.6-5.4-12-12-12C9.4,2,4,7.4,4,14c0,2.9,2.3,6.7,4.8,10H4v4h8.2H14v-4v-0.1c-2.4-2.6-6-7-6-9.9&#xD;&#xA;	c0-4.4,3.6-8,8-8c4.4,0,8,3.6,8,8c0,3-3.6,7.4-6,9.9V24v4h1.8H28v-4h-4.8C25.7,20.7,28,16.9,28,14z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black191 { fill:#727272;}
	.Blue191 { fill:#757575;}
	.st0191 {opacity:0.5;}
</style>
<path class="Blue191" d="M10,22H2v-6h8V22z M20,16h-8v6h8V16z M30,16h-8v6h8V16z" xmlns="http://www.w3.org/2000/svg" />
<g class="st0191" xmlns="http://www.w3.org/2000/svg">
	<path class="Black191" d="M10,30H2v-6h8V30z M20,24h-8v6h8V24z M30,24h-8v6h8V24z M4,8h4v2H4v4H2v-4V8V4h2V8z M28,4v4h-4v2h4v4h2v-4V8&#xD;&#xA;		V4H28z" />
</g>
<polygon class="Black191" points="20.7,4.7 22,6 22,2 18,2 19.3,3.3 16,6.6 12.7,3.3 14,2 10,2 10,6 11.3,4.7 14.6,8 11.3,11.3 10,10 &#xD;&#xA;	10,14 14,14 12.7,12.7 16,9.4 19.3,12.7 18,14 22,14 22,10 20.7,11.3 17.4,8 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black192 { fill:#727272;}
	.Blue192 { fill:#757575;}
	.st0192 {opacity:0.5;}
</style>
<path class="Blue192" d="M10,22H2v-6h8V22z M20,16h-8v6h8V16z M30,16h-8v6h8V16z" xmlns="http://www.w3.org/2000/svg" />
<g class="st0192" xmlns="http://www.w3.org/2000/svg">
	<path class="Black192" d="M10,30H2v-6h8V30z M20,24h-8v6h8V24z M30,24h-8v6h8V24z M4,8h4v2H4v4H2v-4V8V4h2V8z M28,4v4h-4v2h4v4h2v-4V8&#xD;&#xA;		V4H28z" />
</g>
<path class="Black192" d="M12.6,9.1c-0.8,0-1.4-0.2-1.9-0.7C10.2,8,10,7.4,10,6.6c0-0.8,0.2-1.5,0.7-1.9c0.5-0.5,1.2-0.7,2-0.7&#xD;&#xA;	c0.8,0,1.4,0.2,1.9,0.6c0.4,0.4,0.7,1,0.7,1.8c0,0.8-0.2,1.4-0.7,1.9C14,8.8,13.4,9.1,12.6,9.1z M20,4l-6.2,10H12l6.2-10H20z&#xD;&#xA;	 M12.7,5.2c-0.7,0-1.1,0.5-1.1,1.4c0,0.9,0.3,1.3,1,1.3c0.7,0,1.1-0.5,1.1-1.4C13.7,5.6,13.4,5.2,12.7,5.2z M19.3,14&#xD;&#xA;	c-0.8,0-1.4-0.2-1.9-0.7c-0.5-0.4-0.7-1-0.7-1.8c0-0.8,0.2-1.5,0.7-1.9s1.2-0.7,2-0.7c0.8,0,1.4,0.2,1.9,0.6s0.7,1,0.7,1.8&#xD;&#xA;	c0,0.8-0.2,1.4-0.7,1.9S20.1,14,19.3,14z M19.4,10.1c-0.7,0-1.1,0.5-1.1,1.4c0,0.9,0.4,1.3,1.1,1.3c0.7,0,1.1-0.5,1.1-1.4&#xD;&#xA;	c0-0.4-0.1-0.7-0.3-1C20,10.2,19.7,10.1,19.4,10.1z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black193 { fill:#727272;}
	.Blue193 { fill:#757575;}
</style>
<path class="Black193" d="M32,6V4h-4V0h-2v4H6V0H4v4H0v2h4v20H0v2h4v4h2v-4h20v4h2v-4h4v-2h-4V6H32z M26,26H6V6h20V26z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue193" d="M8,8v16h16V8H8z M22,22H10V10h12V22z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0194 {fill:#727272;}
	.st1194 {opacity:0.5;}
</style>
<path class="st0194" d="M10,22H2v-6h8V22z M20,16h-8v6h8V16z M30,16h-8v6h8V16z" xmlns="http://www.w3.org/2000/svg" />
<g class="st1194" xmlns="http://www.w3.org/2000/svg">
	<path class="st0194" d="M10,30H2v-6h8V30z M20,24h-8v6h8V24z M30,24h-8v6h8V24z M4,8h4v2H4v4H2v-4V8V4h2V8z M28,4v4h-4v2h4v4h2v-4V8V4&#xD;&#xA;		H28z" />
</g>
<path class="st0194" d="M21,6h-1V3c0-1.7-1.3-3-3-3h-2c-1.7,0-3,1.3-3,3v3h-1c-0.6,0-1,0.4-1,1v6c0,0.6,0.4,1,1,1h10c0.6,0,1-0.4,1-1V7&#xD;&#xA;	C22,6.4,21.6,6,21,6z M14,3c0-0.6,0.4-1,1-1h2c0.6,0,1,0.4,1,1v3h-4V3z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black195 { fill:#727272;}
	.Blue195 { fill:#757575;}
	.Yellow195 { fill:#979797;}
	.st0195 {opacity:0.5;}
</style>
<g class="st0195" xmlns="http://www.w3.org/2000/svg">
	<path class="Black195" d="M10,18.1V22H2v-6h4.2c0.2,0.5,0.4,0.9,0.7,1.2c0.6,0.6,1.4,0.9,2.3,0.9C9.5,18.2,9.8,18.1,10,18.1z M12,30h8&#xD;&#xA;		v-6h-8V30z M2,30h8v-6H2V30z M27.3,16l-3,3c-0.6,0.6-1.4,1-2.3,1v2h8v-6h-1H27.3z M22,30h8v-6h-8V30z M19.6,19&#xD;&#xA;		c-0.4-0.4-0.7-1-0.9-1.5c-0.6-0.1-1.1-0.4-1.5-0.9c-0.2-0.2-0.3-0.4-0.5-0.6h-3.9L12,16.8V22h8v-2.7C19.9,19.2,19.7,19.1,19.6,19z" />
</g>
<path class="Yellow195" d="M29,2h-7v0c-1,0-2,0.4-2.8,1.1L16,6.4L8.4,14c-0.5,0.5-0.5,1.3,0,1.8c0.5,0.5,1.3,0.5,1.8,0l7.7-7.7&#xD;&#xA;	c0.6-0.6,1.2,0,0.6,0.6L16.2,11c-0.5,0.5-0.5,1.3,0,1.8c0.5,0.5,1.3,0.5,1.8,0l2.3-2.3c0.6-0.6,1.2,0,0.6,0.6l-2.3,2.3&#xD;&#xA;	c-0.5,0.5-0.5,1.3,0,1.8s1.3,0.5,1.8,0l2.3-2.3c0.6-0.6,1.2,0,0.6,0.6L21,15.8c-0.5,0.5-0.5,1.3,0,1.8c0.5,0.5,1.3,0.5,1.8,0&#xD;&#xA;	l3.6-3.6H29c1.7,0,3-1.4,3-3V5C32,3.3,30.7,2,29,2z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue195" d="M6.9,12.6L10,9.5V8H2v6h4.1C6.3,13.5,6.6,13,6.9,12.6z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black196 { fill:#727272;}
	.Blue196 { fill:#757575;}
	.st0196 {opacity:0.5;}
</style>
<g class="st0196" xmlns="http://www.w3.org/2000/svg">
	<path class="Blue196" d="M20.1,16.2C21.8,14.5,24,11.6,24,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C10.8,16.7,10,17.7,10,19&#xD;&#xA;		c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C22,17.7,21.2,16.7,20.1,16.2z" />
</g>
<path class="Black196" d="M4,6V4h24v2H4z M28,10V8H4v2H28z M28,14v-2H4v2H28z M28,18v-2H4v2H28z M28,22v-2H4v2H28z M28,24H4v2h24V24z&#xD;&#xA;	 M32,1v28c0,0.5-0.5,1-1,1H1c-0.5,0-1-0.5-1-1V1c0-0.5,0.5-1,1-1h30C31.5,0,32,0.5,32,1z M30,2H2v26h28V2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(442, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black197 { fill:#727272;}
	.Blue197 { fill:#757575;}
	.st0197 {opacity:0.5;}
</style>
<path class="Black197" d="M32,1v28c0,0.5-0.5,1-1,1H1c-0.5,0-1-0.5-1-1V1c0-0.5,0.5-1,1-1h30C31.5,0,32,0.5,32,1z M30,2H2v26h28V2z" xmlns="http://www.w3.org/2000/svg" />
<g class="st0197" xmlns="http://www.w3.org/2000/svg">
	<path class="Black197" d="M4,6V4h24v2H4z M28,10V8H4v2H28z M28,14v-2H4v2H28z M28,18v-2H4v2H28z M28,22v-2H4v2H28z M28,24H4v2h24V24z" />
</g>
<path class="Blue197" d="M20.1,16.2C21.8,14.5,24,11.6,24,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C10.8,16.7,10,17.7,10,19&#xD;&#xA;	c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C22,17.7,21.2,16.7,20.1,16.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black198 { fill:#727272;}
	.Blue198 { fill:#757575;}
</style>
<path class="Blue198" d="M16.1,16.2C17.8,14.5,20,11.6,20,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C6.8,16.7,6,17.7,6,19&#xD;&#xA;	c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C18,17.7,17.2,16.7,16.1,16.2z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black198" d="M31,0H1C0.4,0,0,0.4,0,1v28c0,0.6,0.4,1,1,1h30c0.6,0,1-0.4,1-1V1C32,0.4,31.6,0,31,0z M30,28H2V2h28V28z" xmlns="http://www.w3.org/2000/svg" />
<rect x="4" y="4" class="Black198" width="24" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="4" y="24" class="Black198" width="24" height="2" xmlns="http://www.w3.org/2000/svg" />
<rect x="20" y="20" class="Black198" width="8" height="2" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(102, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black199 { fill:#727272;}
	.Blue199 { fill:#757575;}
</style>
<path class="Black199" d="M31,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h30c0.5,0,1-0.5,1-1V1C32,0.5,31.5,0,31,0z M30,28H2V2h28V28z&#xD;&#xA;	 M6,22H4v-2h2V22z M6,16H4v2h2V16z M6,8H4v2h2V8z M4,26h24v-2H4V26z M6,12H4v2h2V12z M4,4v2h24V4H4z M26,22h2v-2h-2V22z M26,10h2V8&#xD;&#xA;	h-2V10z M26,14h2v-2h-2V14z M26,18h2v-2h-2V18z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue199" d="M20.1,16.2C21.8,14.5,24,11.6,24,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C10.8,16.7,10,17.7,10,19&#xD;&#xA;	c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C22,17.7,21.2,16.7,20.1,16.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 408)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black200 { fill:#727272;}
	.Blue200 { fill:#757575;}
</style>
<path class="Black200" d="M6,6H4V4h24v2h-2h-2H8H6z M26,14h2v-2h-2V14z M24,18h4v-2h-4V18z M16,10c0.5-0.7,1.2-1.4,2-2h-4&#xD;&#xA;	C14.8,8.6,15.5,9.3,16,10z M24,22h4v-2h-4V22z M26,10h2V8h-2V10z M8,20H4v2h4V20z M28,24H4v2h24V24z M6,8H4v2h2V8z M32,1v28&#xD;&#xA;	c0,0.5-0.5,1-1,1H1c-0.5,0-1-0.5-1-1V1c0-0.5,0.5-1,1-1h30C31.5,0,32,0.5,32,1z M30,2H2v26h28V2z M8,16H4v2h4V16z M6,12H4v2h2V12z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue200" d="M20.1,16.2C21.8,14.5,24,11.6,24,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C10.8,16.7,10,17.7,10,19&#xD;&#xA;	c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C22,17.7,21.2,16.7,20.1,16.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(306, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black201 { fill:#727272;}
	.Blue201 { fill:#757575;}
</style>
<path class="Black201" d="M31,0H1C0.5,0,0,0.5,0,1v28c0,0.5,0.5,1,1,1h30c0.5,0,1-0.5,1-1V1C32,0.5,31.5,0,31,0z M30,28H2V2h28V28z&#xD;&#xA;	 M8,22H4v-2h4V22z M8,16H4v2h4V16z M6,8H4v2h2V8z M4,26h24v-2H4V26z M6,12H4v2h2V12z M4,4v2h24V4H4z M24,22h4v-2h-4V22z M26,10h2V8&#xD;&#xA;	h-2V10z M26,14h2v-2h-2V14z M24,18h4v-2h-4V18z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue201" d="M20.1,16.2C21.8,14.5,24,11.6,24,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C10.8,16.7,10,17.7,10,19&#xD;&#xA;	c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C22,17.7,21.2,16.7,20.1,16.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(340, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black202 { fill:#727272;}
	.Blue202 { fill:#757575;}
</style>
<path class="Black202" d="M6,6H4V4h24v2h-2h-2H8H6z M28,24H4v2h24V24z M32,1v28c0,0.5-0.5,1-1,1H1c-0.5,0-1-0.5-1-1V1c0-0.5,0.5-1,1-1&#xD;&#xA;	h30C31.5,0,32,0.5,32,1z M30,2H2v26h28V2z" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue202" d="M20.1,16.2C21.8,14.5,24,11.6,24,8c-6,0-8,6-8,6s-2-6-8-6c0,3.6,2.2,6.5,3.9,8.2C10.8,16.7,10,17.7,10,19&#xD;&#xA;	c0,1.7,1.3,3,3,3s3-1.3,3-3c0,1.7,1.3,3,3,3s3-1.3,3-3C22,17.7,21.2,16.7,20.1,16.2z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(374, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black203 { fill:#727272;}
	.Yellow203 { fill:#979797;}
	.st0203 {opacity:0.75;}
</style>
<path class="Yellow203" d="M32,31V15c0-0.6-0.5-1-1-1H9c-0.6,0-1,0.4-1,1v16c0,0.5,0.4,1,1,1h22C31.5,32,32,31.5,32,31z" xmlns="http://www.w3.org/2000/svg" />
<g class="st0203" xmlns="http://www.w3.org/2000/svg">
	<path class="Yellow203" d="M24,17V1c0-0.6-0.5-1-1-1H1C0.4,0,0,0.4,0,1v16c0,0.5,0.4,1,1,1h22C23.5,18,24,17.5,24,17z" />
</g>
<path class="Black203" d="M12.6,21.4c0.2-0.3,0.5-0.6,0.8-0.8c0.3-0.2,0.7-0.3,1.1-0.4c0.4-0.1,0.8-0.1,1.2-0.1c0.4,0,0.7,0,1.1,0.1&#xD;&#xA;	c0.4,0.1,0.7,0.2,1,0.3c0.3,0.2,0.6,0.4,0.8,0.7c0.2,0.3,0.3,0.7,0.3,1.1v4c0,0.4,0,0.7,0.1,1c0,0.3,0.1,0.6,0.2,0.7h-2.1&#xD;&#xA;	c0-0.1-0.1-0.2-0.1-0.4c0-0.1,0-0.3,0-0.4c-0.3,0.4-0.7,0.6-1.1,0.7c-0.4,0.1-0.9,0.2-1.3,0.2c-0.4,0-0.7,0-1-0.1&#xD;&#xA;	c-0.3-0.1-0.6-0.2-0.8-0.4c-0.2-0.2-0.4-0.4-0.5-0.7s-0.2-0.6-0.2-1c0-0.4,0.1-0.8,0.2-1.1c0.1-0.3,0.3-0.5,0.6-0.7s0.5-0.3,0.8-0.4&#xD;&#xA;	c0.3-0.1,0.6-0.2,0.9-0.2c0.3,0,0.6-0.1,0.9-0.1c0.3,0,0.6-0.1,0.8-0.1c0.2-0.1,0.4-0.1,0.5-0.3c0.1-0.1,0.2-0.3,0.2-0.5&#xD;&#xA;	c0-0.2,0-0.4-0.1-0.5c-0.1-0.1-0.2-0.2-0.3-0.3c-0.1-0.1-0.3-0.1-0.4-0.1c-0.2,0-0.3,0-0.5,0c-0.4,0-0.7,0.1-0.9,0.3&#xD;&#xA;	c-0.2,0.2-0.4,0.5-0.4,0.9h-2C12.3,22.1,12.4,21.7,12.6,21.4z M16.6,24.4c-0.1,0-0.3,0.1-0.4,0.1c-0.1,0-0.3,0.1-0.5,0.1&#xD;&#xA;	c-0.2,0-0.3,0-0.5,0.1c-0.2,0-0.3,0.1-0.5,0.1c-0.1,0.1-0.3,0.1-0.4,0.2c-0.1,0.1-0.2,0.2-0.3,0.3c-0.1,0.1-0.1,0.3-0.1,0.5&#xD;&#xA;	c0,0.2,0,0.4,0.1,0.5c0.1,0.1,0.2,0.2,0.3,0.3c0.1,0.1,0.2,0.1,0.4,0.2c0.2,0,0.3,0,0.5,0c0.4,0,0.7-0.1,0.9-0.2&#xD;&#xA;	c0.2-0.1,0.4-0.3,0.5-0.5c0.1-0.2,0.2-0.4,0.2-0.6c0-0.2,0-0.4,0-0.5v-0.8C16.8,24.3,16.7,24.3,16.6,24.4z M22.6,18v3.2h0&#xD;&#xA;	c0.2-0.4,0.6-0.7,1-0.9c0.4-0.2,0.9-0.3,1.3-0.3c0.4,0,0.7,0.1,1.1,0.2c0.4,0.2,0.7,0.4,1,0.7c0.3,0.3,0.5,0.8,0.7,1.3&#xD;&#xA;	c0.2,0.5,0.3,1.1,0.3,1.8s-0.1,1.3-0.3,1.8c-0.2,0.5-0.4,0.9-0.7,1.3c-0.3,0.3-0.6,0.6-1,0.7c-0.4,0.2-0.7,0.2-1.1,0.2&#xD;&#xA;	c-0.5,0-1-0.1-1.5-0.3c-0.4-0.2-0.8-0.5-1-0.9h0v1h-1.9V18H22.6z M25.9,23.2c-0.1-0.3-0.2-0.6-0.3-0.8c-0.1-0.2-0.3-0.4-0.5-0.5&#xD;&#xA;	c-0.2-0.1-0.5-0.2-0.8-0.2c-0.3,0-0.6,0.1-0.8,0.2c-0.2,0.1-0.4,0.3-0.5,0.5c-0.1,0.2-0.2,0.5-0.3,0.8c-0.1,0.3-0.1,0.6-0.1,0.9&#xD;&#xA;	c0,0.3,0,0.6,0.1,0.9c0.1,0.3,0.2,0.6,0.3,0.8c0.1,0.2,0.3,0.4,0.5,0.5c0.2,0.1,0.5,0.2,0.8,0.2c0.3,0,0.6-0.1,0.8-0.2&#xD;&#xA;	c0.2-0.1,0.4-0.3,0.5-0.5c0.1-0.2,0.2-0.5,0.3-0.8c0.1-0.3,0.1-0.6,0.1-0.9C26,23.8,25.9,23.5,25.9,23.2z M19,9.8c0,0-0.1,0-0.1,0&#xD;&#xA;	c-0.1,0-0.3,0.1-0.4,0.2c-0.1,0.1-0.2,0.2-0.3,0.4C18,10.6,18,10.8,18,11.1v0.7c0,0.4-0.1,0.7-0.2,1c-0.1,0.3-0.3,0.5-0.4,0.7&#xD;&#xA;	c-0.2,0.2-0.4,0.3-0.6,0.4C16.6,14,16.4,14,16.3,14H14v-1.8h1.2c0.2,0,0.3,0,0.4-0.1c0.1-0.1,0.2-0.2,0.2-0.3&#xD;&#xA;	c0.1-0.1,0.1-0.2,0.1-0.4c0-0.1,0-0.3,0-0.4v-0.1c0-0.4,0.1-0.6,0.2-0.9c0.1-0.2,0.2-0.4,0.4-0.5s0.3-0.2,0.5-0.3&#xD;&#xA;	C17.2,9.1,17.3,9,17.4,9v0c-0.1,0-0.2,0-0.4-0.1c-0.2-0.1-0.3-0.2-0.5-0.3S16.3,8.3,16.2,8S16,7.4,16,7v0c0-0.1,0-0.3,0-0.4&#xD;&#xA;	c0-0.1,0-0.3-0.1-0.4C15.8,6.1,15.7,6,15.6,6c-0.1-0.1-0.2-0.1-0.4-0.1H14V4h2.3c0.2,0,0.3,0,0.5,0.1c0.2,0.1,0.4,0.2,0.6,0.4&#xD;&#xA;	c0.2,0.2,0.3,0.4,0.4,0.7c0.1,0.3,0.2,0.6,0.2,1v0.6c0,0.3,0,0.5,0.1,0.7c0.1,0.2,0.2,0.3,0.3,0.5c0.1,0.1,0.3,0.2,0.4,0.2&#xD;&#xA;	c0,0,0.1,0,0.1,0V9.8z M5,9.8c0,0,0.1,0,0.1,0c0.1,0,0.3,0.1,0.4,0.2c0.1,0.1,0.2,0.2,0.3,0.4C6,10.6,6,10.8,6,11.1v0.7&#xD;&#xA;	c0,0.4,0.1,0.7,0.2,1c0.1,0.3,0.3,0.5,0.4,0.7c0.2,0.2,0.4,0.3,0.6,0.4C7.4,14,7.6,14,7.7,14H10v-1.8H8.8c-0.2,0-0.3,0-0.4-0.1&#xD;&#xA;	c-0.1-0.1-0.2-0.2-0.2-0.3C8.1,11.6,8,11.5,8,11.4c0-0.1,0-0.3,0-0.4v-0.1c0-0.4-0.1-0.6-0.2-0.9C7.7,9.8,7.6,9.6,7.5,9.4&#xD;&#xA;	S7.2,9.2,7,9.1C6.8,9.1,6.7,9,6.6,9v0c0.1,0,0.2,0,0.4-0.1c0.2-0.1,0.3-0.2,0.5-0.3S7.7,8.3,7.8,8S8,7.4,8,7v0c0-0.1,0-0.3,0-0.4&#xD;&#xA;	c0-0.1,0-0.3,0.1-0.4C8.2,6.1,8.3,6,8.4,6c0.1-0.1,0.2-0.1,0.4-0.1H10V4H7.7C7.6,4,7.4,4,7.2,4.1C7,4.2,6.8,4.4,6.6,4.6&#xD;&#xA;	C6.5,4.7,6.3,5,6.2,5.2C6.1,5.5,6,5.8,6,6.2v0.6c0,0.3,0,0.5-0.1,0.7C5.8,7.7,5.7,7.9,5.5,8C5.4,8.1,5.3,8.2,5.1,8.2&#xD;&#xA;	c0,0-0.1,0-0.1,0V9.8z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow204 { fill:#979797;}
	.Red204 { fill:#585858;}
	.Blue204 { fill:#757575;}
	.Green204 { fill:#404040;}
	.Black204 { fill:#727272;}
	.White204 { fill:#FFFFFF;}
	.st0204 {opacity:0.5;}
	.st1204 {display:none;}
	.st2204 { fill:#404040;}
	.st3204 { fill:#585858;}
	.st4204 { fill:#727272;}
</style>
<g id="Underline" xmlns="http://www.w3.org/2000/svg">
	<path class="Black204" d="M8,15.7V4h3.4v11c0,4,1.6,6,4.7,6c3,0,4.5-1.9,4.5-5.8V4H24v11.4c0,5.7-2.7,8.6-8.2,8.6&#xD;&#xA;		C10.6,24,8,21.2,8,15.7z M6,28v2h20v-2H6z" />
</g>
</g>

<g transform="translate(476, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow205 { fill:#979797;}
	.Red205 { fill:#585858;}
	.Blue205 { fill:#757575;}
	.Green205 { fill:#404040;}
	.Black205 { fill:#727272;}
	.White205 { fill:#FFFFFF;}
	.st0205 {opacity:0.5;}
	.st1205 {display:none;}
	.st2205 { fill:#404040;}
	.st3205 { fill:#585858;}
	.st4205 { fill:#727272;}
</style>
<g id="UnderlineDouble" xmlns="http://www.w3.org/2000/svg">
	<path class="Black205" d="M24,15.4c0,5.7-2.7,8.6-8.2,8.6C10.6,24,8,21.2,8,15.7V4h3.4v11c0,4,1.6,6,4.7,6c3,0,4.5-1.9,4.5-5.8V4H24&#xD;&#xA;		V15.4z M26,26H6v2h20V26z M26,30H6v2h20V30z" />
</g>
</g>

<g transform="translate(238, 340)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Blue206 { fill:#757575;}
</style>
<path class="Blue206" d="M32,26c0,0,0-8-16-8v6L0,14L16,4v6C32,10,32,26,32,26z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(0, 238)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow207 { fill:#979797;}
	.Black207 { fill:#727272;}
	.Red207 { fill:#585858;}
</style>
<path class="Yellow207" d="M31,24h-1v-3c0-1.7-1.3-3-3-3h-2c-1.7,0-3,1.3-3,3v3h-1c-0.6,0-1,0.4-1,1v6c0,0.6,0.4,1,1,1h10&#xD;&#xA;	c0.6,0,1-0.4,1-1v-6C32,24.4,31.6,24,31,24z M24,21c0-0.6,0.4-1,1-1h2c0.6,0,1,0.4,1,1v3h-4V21z" xmlns="http://www.w3.org/2000/svg" />
<path class="Black207" d="M10,18h11c-0.4,0.6-0.8,1.3-0.9,2H10V18z M10,24h8.2c0.3-0.9,1-1.5,1.8-1.8V22H10V24z M6,10.8l-2,2V29&#xD;&#xA;	c0,0.6,0.4,1,1,1h13v-2H6V10.8z M27,4H12.8l-2,2H26v10h1c0.3,0,0.7,0,1,0.1V5C28,4.4,27.6,4,27,4z M10,14v2h12v-2H10z M12.8,12H22&#xD;&#xA;	v-2h-7.2L12.8,12z" xmlns="http://www.w3.org/2000/svg" />
<polygon class="Red207" points="12,2 10,0 6,4 2,0 0,2 4,6 0,10 2,12 6,8 10,12 12,10 8,6 " xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(170, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Yellow208 { fill:#979797;}
	.Green208 { fill:#404040;}
</style>
<g xmlns="http://www.w3.org/2000/svg">
	<g>
		<path class="Yellow208" d="M16.1,22l0-0.3c0.6-4.4,4.5-7.7,8.9-7.7c1,0,2,0.2,3,0.5V7c0-0.5-0.5-1-1-1H1C0.5,6,0,6.5,0,7v14&#xD;&#xA;			c0,0.5,0.5,1,1,1H16.1L16.1,22z" />
	</g>
	<g>
		<path class="Yellow208" d="M16.1,22l0-0.3c0.6-4.4,4.5-7.7,8.9-7.7c1,0,2,0.2,3,0.5V7c0-0.5-0.5-1-1-1H1C0.5,6,0,6.5,0,7v14&#xD;&#xA;			c0,0.5,0.5,1,1,1H16.1L16.1,22z" />
	</g>
</g>
<path class="Green208" d="M32,16v6h-0.1h-2H26l2.5-2.5C27.6,18.6,26.4,18,25,18c-2.4,0-4.4,1.7-4.9,4h-2c0.5-3.4,3.4-6,6.9-6&#xD;&#xA;	c1.9,0,3.7,0.8,4.9,2.1L32,16z M25,28c-1.4,0-2.6-0.6-3.5-1.5L24,24h-3.9h-2H18v6l2.1-2.1c1.3,1.3,3,2.1,4.9,2.1&#xD;&#xA;	c3.5,0,6.4-2.6,6.9-6h-2C29.4,26.3,27.4,28,25,28z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(204, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.st0209 {opacity:0.5;}
	.st1209 {fill:#727272;}
</style>
<g class="st0209" xmlns="http://www.w3.org/2000/svg">
	<path class="st1209" d="M20,8h-2V6h2V8z M20,10h-2v2h2V10z M20,14h-2v2h2V14z M16,8h-2V6h2V8z M16,10h-2v2h2V10z M16,18h-2v2h2V18z&#xD;&#xA;		 M16,22h-2v2h2V22z M16,14h-2v2h2V14z" />
</g>
<path class="st1209" d="M24,8h-2V6h2V8z M24,10h-2v2h2V10z M24,14h-2v2h2V14z" xmlns="http://www.w3.org/2000/svg" />
<path class="st1209" d="M12,8H6V6h6V8z M12,18H6v2h6V18z M16,28H4V2h22v14.1c0.7,0.1,1.4,0.2,2,0.5V1c0-0.6-0.4-1-1-1H3&#xD;&#xA;	C2.4,0,2,0.4,2,1v28c0,0.6,0.4,1,1,1h13V28z M6,24h6v-2H6V24z M12,10H6v2h6V10z M12,14H6v2h6V14z" xmlns="http://www.w3.org/2000/svg" />
<path class="st1209" d="M32,18v6h-0.1h-2H26l2.5-2.5C27.6,20.6,26.4,20,25,20c-2.4,0-4.4,1.7-4.9,4h-2c0.5-3.4,3.4-6,6.9-6&#xD;&#xA;	c1.9,0,3.7,0.8,4.9,2.1L32,18z M25,30c-1.4,0-2.6-0.6-3.5-1.5L24,26h-3.9h-2H18v6l2.1-2.1c1.3,1.3,3,2.1,4.9,2.1&#xD;&#xA;	c3.5,0,6.4-2.6,6.9-6h-2C29.4,28.3,27.4,30,25,30z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(136, 204)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black210 { fill:#727272;}
	.Blue210 { fill:#757575;}
	.Yellow210 { fill:#979797;}
</style>
<path class="Black210" d="M6,6h18v2H6V6z M21.4,28H4V2h22v21.4l2,2V1c0-0.5-0.5-1-1-1H3C2.5,0,2,0.5,2,1v28c0,0.5,0.5,1,1,1h20.4&#xD;&#xA;	L21.4,28z M12,14H6v2h6V14z M10,18H6v2h4V18z M10,22H6v2h4V22z" xmlns="http://www.w3.org/2000/svg" />
<rect x="6" y="10" class="Yellow210" width="18" height="2" xmlns="http://www.w3.org/2000/svg" />
<path class="Blue210" d="M27.6,27.9L23,23.3c0.6-0.9,1-2.1,1-3.3c0-3.3-2.7-6-6-6c-3.3,0-6,2.7-6,6s2.7,6,6,6c1.2,0,2.3-0.4,3.3-1&#xD;&#xA;	l4.6,4.6c0.5,0.5,1.3,0.5,1.7,0C28.1,29.2,28.1,28.4,27.6,27.9z M18,24c-2.2,0-4-1.8-4-4c0-2.2,1.8-4,4-4s4,1.8,4,4&#xD;&#xA;	C22,22.2,20.2,24,18,24z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(476, 136)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black211 { fill:#727272;}
</style>
<g xmlns="http://www.w3.org/2000/svg">
	<path class="Black211" d="M8,10H6v2h2V10z M16,10h-2v2h2V10z M24,10h-2v2h2V10z M8,18H6v2h2V18z M16,18h-2v2h2V18z M24,18h-2v2h2V18z&#xD;&#xA;		 M12,6h-2v2h2V6z M12,10h-2v2h2V10z M12,14h-2v2h2V14z M12,18h-2v2h2V18z M12,22h-2v2h2V22z M20,6h-2v2h2V6z M20,10h-2v2h2V10z&#xD;&#xA;		 M20,14h-2v2h2V14z M20,18h-2v2h2V18z M20,22h-2v2h2V22z" />
</g>
<path class="Black211" d="M27,2H3C2.5,2,2,2.5,2,3v24c0,0.5,0.5,1,1,1h24c0.5,0,1-0.5,1-1V3C28,2.5,27.5,2,27,2z M26,26H4V4h22V26z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(272, 374)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black212 { fill:#727272;}
	.Blue212 { fill:#757575;}
</style>
<polygon class="Blue212" points="18,12 14,12 14,8 12,8 12,12 8,12 8,14 12,14 12,18 14,18 14,14 18,14 " xmlns="http://www.w3.org/2000/svg" />
<path class="Black212" d="M29.7,27.3L22,19.6c0,0-0.1-0.1-0.1-0.1c1.3-1.8,2.1-4.1,2.1-6.5c0-6.1-4.9-11-11-11C6.9,2,2,6.9,2,13&#xD;&#xA;	s4.9,11,11,11c2.4,0,4.7-0.8,6.5-2.1c0,0,0,0.1,0.1,0.1l7.7,7.7c0.3,0.3,0.9,0.3,1.2,0l1.2-1.2C30.1,28.2,30.1,27.6,29.7,27.3z&#xD;&#xA;	 M4,13c0-5,4-9,9-9c5,0,9,4,9,9s-4,9-9,9C8,22,4,18,4,13z" xmlns="http://www.w3.org/2000/svg" />
</g>

<g transform="translate(408, 272)">
<style type="text/css" xmlns="http://www.w3.org/2000/svg">
	.Black213 { fill:#727272;}
	.Blue213 { fill:#757575;}
</style>
<g id="Zoom_Out" xmlns="http://www.w3.org/2000/svg">
	<rect x="8" y="12" class="Blue213" width="10" height="2" />
	<path class="Black213" d="M29.7,27.3l-7.9-7.9c1.3-1.8,2.1-4,2.1-6.5c0-6.1-4.9-11-11-11C6.9,2,2,6.9,2,13s4.9,11,11,11&#xD;&#xA;		c2.4,0,4.6-0.8,6.5-2.1l7.9,7.9c0.3,0.3,0.9,0.3,1.2,0l1.2-1.2C30.1,28.2,30.1,27.6,29.7,27.3z M4,13c0-5,4-9,9-9c5,0,9,4,9,9&#xD;&#xA;		s-4,9-9,9C8,22,4,18,4,13z" />
</g>
</g>


</svg>
   lu!NA\N]ΌkQ0i*܎XV(
4\v&Yj\$,\tttID>C5j۰Sb"9ʠD* 3nB-Hc    'l          LɁ L                            RSDSzW=0k'.j0C   c:\projects\18.2\BuildLabel\Temp\NetStudio.v18.2.2005\ASP\DevExpress.RichEdit.Web\DevExpress.Web.ASPxRichEdit\obj\Release\DevExpress.Web.ASPxRichEdit.v18.2.pdb ,ʁ         Fʁ                         8ʁ           _CorDllMain mscoree.dll     %                            ?      ?      ?      ?      ?       @                                                                                                                                                                                                                                                                                                                                                                                                  0                     H   X 6          64   V S _ V E R S I O N _ I N F O            	     	 ?                         D    V a r F i l e I n f o     $    T r a n s l a t i o n          S t r i n g F i l e I n f o   r   0 0 0 0 0 4 b 0      C o m m e n t s       N   C o m p a n y N a m e     D e v e l o p e r   E x p r e s s   I n c .     `   F i l e D e s c r i p t i o n     D e v E x p r e s s . W e b . A S P x R i c h E d i t   2 	  F i l e V e r s i o n     1 8 . 2 . 9 . 0     l &  I n t e r n a l N a m e   D e v E x p r e s s . W e b . A S P x R i c h E d i t . v 1 8 . 2 . d l l    /  L e g a l C o p y r i g h t   C o p y r i g h t   ( c )   2 0 0 0 - 2 0 1 9   D e v e l o p e r   E x p r e s s   I n c .     *   L e g a l T r a d e m a r k s         t &  O r i g i n a l F i l e n a m e   D e v E x p r e s s . W e b . A S P x R i c h E d i t . v 1 8 . 2 . d l l   X   P r o d u c t N a m e     D e v E x p r e s s . W e b . A S P x R i c h E d i t   6 	  P r o d u c t V e r s i o n   1 8 . 2 . 9 . 0     : 	  A s s e m b l y   V e r s i o n   1 8 . 2 . 9 . 0                                                                                                                                                                                                                                                                                                                                                                                          X:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          0	*H
010
	`He 0x
+7j0h03
+70%   < < < O b s o l e t e > > >010
	`He  $ܐ1Iz: ^f6fИ00rjF,0
	*H
 0L10	UUS10U
thawte, Inc.1&0$Uthawte SHA256 Code Signing CA0
161129000000Z
200121235959Z010	UUS10U
California10UGlendale1'0%U
Developer Express Incorporated1'0%UDeveloper Express Incorporated0"0
	*H
  0
 1>]Qz34ѵ3'E՞:zpt?쿅A@ae%#!ˡ_`ojsY֢sՙ|>JgәrM~@TǬ&g
ob]ub|PgFtNbl3G$8HlַT-KJx{%A십x^?,~i8P{0R81<LCTSeuMHVs3ꢺDǧ=xI j0f0	U0 0U#0WT)ܷ0U	Y凅i'[zu.0+U$0"0 http://tl.symcb.com/tl.crl0U0U%0
+0nU g0e0cg0Y0&+https://www.thawte.com/cps0/+0#!https://www.thawte.com/repository0W+K0I0+0http://tl.symcd.com0&+0http://tl.symcb.com/tl.crt0
	*H
  e:O113R]2Uo:{ĞZJg_Bi{Ǒ=5<zAMDiW;\]׶
|[P:A	!j*/=~Wstgvݕ"Y%,5֪@ʤ,W+xV[[hSND ͊!8z[=Q[ɡ4N!3ZuMK4dvz300q6ݱ;+T0
	*H
 010	UUS10U
thawte, Inc.1(0&UCertification Services Division1806U/(c) 2006 thawte, Inc. - For authorized use only10Uthawte Primary Root CA0
131210000000Z
231209235959Z0L10	UUS10U
thawte, Inc.1&0$Uthawte SHA256 Code Signing CA0"0
	*H
  0
 ULf(~FS}'gʷ%S㾛#\Bd%X"Ǯ"tith0d8>sW5WPfvqcɺѹ,(! 
A/{SlDchG+*[Iaik x&i08NZUP֪8GC\MsIœiwW3BwĻ9\:d'W@S)4_ 00/+#0!0+0http://t2.symcb.com0U0 02U+0)0'%#!http://t1.symcb.com/ThawtePCA.crl0U%0++0U0)U"0 010USymantecPKI-1-5680UWT)ܷ0U#0{[Eϯz1jFWHP0
	*H
  $;נ6C	hј1n?{kLl{PՁ,)A,Y-G@=y5L'gEżNU{҇0l̙5m`h)YKFɎuO	N'D3soulD>ɽ,VwF,巧7uUwM^6)ʅEArWuy[4md B:Fd_G:(TOCoI^B (G n00W~|NYKw;0
	*H
 010	UZA10UWestern Cape10UDurbanville10
U
Thawte10UThawte Certification10UThawte Timestamping CA0
121221000000Z
201230235959Z0^10	UUS10U
Symantec Corporation100.U'Symantec Time Stamping Services CA - G20"0
	*H
  0
 ITK
%y"W*oܸ&Csk¿.PZvC%CE{t"״ MD$k_E;DCsi+˙r&Mq1QaSI,xE/W?=ƒJ{3y
uAQlie)`;
tޒ"t|'JÞ-'}aqPK],e ؖ|NHDDh]jxdE`F~T|yq 00U_n\t}?L.02+&0$0"+0http://ocsp.thawte.com0U0 0?U8060420.http://crl.thawte.com/ThawteTimestampingCA.crl0U%0
+0U0(U!0010UTimeStamp-2048-10
	*H
  	yY0h	O]7_R	DnmX|0i#soG9*ÎY M1\*zzWLey@b%n7j!AW?wI*^8j"Q~0085njP0
	*H
 0^10	UUS10U
Symantec Corporation100.U'Symantec Time Stamping Services CA - G20
121018000000Z
201229235959Z0b10	UUS10U
Symantec Corporation1402U+Symantec Time Stamping Services Signer - G40"0
	*H
  0
 c9D#DIa
Sۭ,Jn<SU?+پay[LvCK"+Ch@O8#dX2oNW*Kc2[^Z(Pa;EQVGf=Gpr_ăd%"кzw[etA*L-wDh֨tw[2V3cI:3ٳW;z"$.pžN&O(r W0S0U0 0U%0
+0U0s+g0e0*+0http://ts-ocsp.ws.symantec.com07+0+http://ts-aia.ws.symantec.com/tss-ca-g2.cer0<U50301/-+http://ts-crl.ws.symantec.com/tss-ca-g2.crl0(U!0010UTimeStamp-2048-20UFiJLRc?^6
0U#0_n\t}?L.0
	*H
  x;* Lb07x'o%ܠԔN%@y!hڶ2m,&c3Idm
g5l|߲ q͕tܶ\޽7Cxx( KĈ)\vnO^EFAn
8:	qy{i+[	=[m .8
),Z,/I"xQÆ]=Qy3+.{ 	qj[0W,I?ɿ>"hcSit<üu18040`0L10	UUS10U
thawte, Inc.1&0$Uthawte SHA256 Code Signing CArjF,0
	`He 0	*H
	1
+70
+710
+70/	*H
	1" $Cց;^@]T++?0/
+71!0https://www.devexpress.com/0
	*H
  H5Xiఄ
AS^OcCv৊
	Dlgz+
/)5sE u
%!72QVZ?&ϐCoD1'Έv_65:Lx?6Kڞnf@S`Ta{!_N,*t0_7(%쓙4,66B8`L
칻JY\
jI6#)&őK9
 |Wq3D7:QFvO!&0	*H
	100r0^10	UUS10U
Symantec Corporation100.U'Symantec Time Stamping Services CA - G285njP0	+ ]0	*H
	1	*H
0	*H
	1
190610074156Z0#	*H
	1`ZWhl&{LDQ0
	*H
  >T5;4V@ľfNc}jًeŔg1!_CQWxk$54j]2셬_P47AМ?ܗ]Rp"=ì%LHzd|uƸQu5{+nZg%kE5dWQF鎕_2r?cY# ?ESFbؓG{LqO2:>\^7G&|ܛ^HSHR|AѰ4       