g i t   :   w a r n i n g :   i n   t h e   w o r k i n g   c o p y   o f   ' e 2 e - t e s t . m j s ' ,   L F   w i l l   b e   r e p l a c e d   b y   C R L F   t h e   n e x t   t i m e   G i t   t o u c h e s   i t 
 
 E n   l  n e a :   1   C a r  c t e r :   1 
 
 +   g i t   d i f f   e 8 d 2 4 3 5   - -   s e r v e r / d b . t s   s h a r e d / t y p e s . t s   s e r v e r / l i b / s c h e d u l i n   . . . 
 
 +   ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 
 
         +   C a t e g o r y I n f o                     :   N o t S p e c i f i e d :   ( w a r n i n g :   i n   t h e . . .   G i t   t o u c h e s   i t : S t r i n g )   [ ] ,   R e m o t e E x c e p t i o n 
 
         +   F u l l y Q u a l i f i e d E r r o r I d   :   N a t i v e C o m m a n d E r r o r 
 
   
 
 w a r n i n g :   i n   t h e   w o r k i n g   c o p y   o f   ' p a c k a g e . j s o n ' ,   L F   w i l l   b e   r e p l a c e d   b y   C R L F   t h e   n e x t   t i m e   G i t   t o u c h e s   i t 
 
 w a r n i n g :   i n   t h e   w o r k i n g   c o p y   o f   ' s e r v e r / d b . t s ' ,   L F   w i l l   b e   r e p l a c e d   b y   C R L F   t h e   n e x t   t i m e   G i t   t o u c h e s   i t 
 
 w a r n i n g :   i n   t h e   w o r k i n g   c o p y   o f   ' s e r v e r / r o u t e s / a p p o i n t m e n t s . t s ' ,   L F   w i l l   b e   r e p l a c e d   b y   C R L F   t h e   n e x t   t i m e   G i t   t o u c h e s   
 
 i t 
 
 w a r n i n g :   i n   t h e   w o r k i n g   c o p y   o f   ' s e r v e r / r o u t e s / b o o k i n g . t s ' ,   L F   w i l l   b e   r e p l a c e d   b y   C R L F   t h e   n e x t   t i m e   G i t   t o u c h e s   i t 
 
 w a r n i n g :   i n   t h e   w o r k i n g   c o p y   o f   ' s e r v e r / r o u t e s / e m p l o y e e s . t s ' ,   L F   w i l l   b e   r e p l a c e d   b y   C R L F   t h e   n e x t   t i m e   G i t   t o u c h e s   i t 
 
 w a r n i n g :   i n   t h e   w o r k i n g   c o p y   o f   ' s e r v e r / r o u t e s / s e t t i n g s . t s ' ,   L F   w i l l   b e   r e p l a c e d   b y   C R L F   t h e   n e x t   t i m e   G i t   t o u c h e s   i t 
 
 w a r n i n g :   i n   t h e   w o r k i n g   c o p y   o f   ' s h a r e d / t y p e s . t s ' ,   L F   w i l l   b e   r e p l a c e d   b y   C R L F   t h e   n e x t   t i m e   G i t   t o u c h e s   i t 
 
 w a r n i n g :   i n   t h e   w o r k i n g   c o p y   o f   ' s r c / i n d e x . c s s ' ,   L F   w i l l   b e   r e p l a c e d   b y   C R L F   t h e   n e x t   t i m e   G i t   t o u c h e s   i t 
 
 w a r n i n g :   i n   t h e   w o r k i n g   c o p y   o f   ' s r c / l i b / p u b l i c A p i . t s ' ,   L F   w i l l   b e   r e p l a c e d   b y   C R L F   t h e   n e x t   t i m e   G i t   t o u c h e s   i t 
 
 w a r n i n g :   i n   t h e   w o r k i n g   c o p y   o f   ' s r c / p a g e s / E m p l o y e e s P a g e . t s x ' ,   L F   w i l l   b e   r e p l a c e d   b y   C R L F   t h e   n e x t   t i m e   G i t   t o u c h e s   i t 
 
 w a r n i n g :   i n   t h e   w o r k i n g   c o p y   o f   ' s r c / p a g e s / S e t t i n g s P a g e . t s x ' ,   L F   w i l l   b e   r e p l a c e d   b y   C R L F   t h e   n e x t   t i m e   G i t   t o u c h e s   i t 
 
 w a r n i n g :   i n   t h e   w o r k i n g   c o p y   o f   ' s r c / p a g e s / p u b l i c / B o o k i n g P a g e . t s x ' ,   L F   w i l l   b e   r e p l a c e d   b y   C R L F   t h e   n e x t   t i m e   G i t   
 
 t o u c h e s   i t 
 
 d i f f   - - g i t   a / e 2 e - t e s t . m j s   b / e 2 e - t e s t . m j s 
 
 i n d e x   3 e 2 0 9 4 b . . b 4 b f 8 6 c   1 0 0 6 4 4 
 
 - - -   a / e 2 e - t e s t . m j s 
 
 + + +   b / e 2 e - t e s t . m j s 
 
 @ @   - 1 3 , 6   + 1 3 , 1 9   @ @   f u n c t i o n   c h e c k ( n a m e ,   c o n d ,   e x t r a   =   " " )   { 
 
       e l s e   {   f a i l + + ;   c o n s o l e . l o g ( `          $ { n a m e }   $ { e x t r a } ` ) ;   } 
 
   } 
 
   
 
 + / /   F e t c h   t h e   f i r s t   a v a i l a b l e   s l o t   ( i s o )   f o r   a   s e r v i c e   o v e r   t h e   n e x t   ` m a x D a y s `   d a y s . 
 
 + / /   S l o t s   a l r e a d y   f i l t e r   o u t   n o n - w o r k i n g   d a y s   a n d   d o u b l e - b o o k e d   s p e c i a l i s t s ,   s o   a n y 
 
 + / /   r e t u r n e d   i s o   i s   s a f e   t o   u s e   a s   s t a r t _ a t   f o r   e i t h e r   a u t o A s s i g n   o r   s e l f - a s s i g n   p a t h s . 
 
 + a s y n c   f u n c t i o n   f i n d S l o t ( s l u g ,   s e r v i c e I d ,   m a x D a y s   =   3 0 )   { 
 
 +     f o r   ( l e t   i   =   1 ;   i   < =   m a x D a y s ;   i + + )   { 
 
 +         c o n s t   d   =   n e w   D a t e ( D a t e . n o w ( )   +   i   *   8 6 4 0 0 0 0 0 ) ; 
 
 +         c o n s t   d a t e   =   d . t o I S O S t r i n g ( ) . s l i c e ( 0 ,   1 0 ) ; 
 
 +         c o n s t   {   j s o n   }   =   a w a i t   r e q ( " G E T " ,   ` / p u b l i c / $ { s l u g } / s l o t s ? s e r v i c e _ i d = $ { s e r v i c e I d } & d a t e = $ { d a t e } ` ) ; 
 
 +         i f   ( A r r a y . i s A r r a y ( j s o n . s l o t s )   & &   j s o n . s l o t s . l e n g t h   >   0 )   r e t u r n   j s o n . s l o t s [ 0 ] . i s o ; 
 
 +     } 
 
 +     r e t u r n   n u l l ; 
 
 + } 
 
 + 
 
   / /   / m e   n o w   w o r k s   ( t h e   b u g   w e   f i x e d )        l o g i n   f i r s t   t o   g e t   a   r e a l   t o k e n 
 
   c o n s t   {   j s o n :   l o g i n   }   =   a w a i t   r e q ( " P O S T " ,   " / a u t h / l o g i n " ,   {   e m a i l :   " o w n e r @ a g e n d a p r o . d e m o " ,   p a s s w o r d :   " d e m o 1 2 3 4 "   } ) ; 
 
   c h e c k ( " l o g i n   o w n e r " ,   ! ! l o g i n . t o k e n   & &   l o g i n . u s e r ? . r o l e   = = =   " o w n e r " ,   J S O N . s t r i n g i f y ( l o g i n ) . s l i c e ( 0 ,   1 0 0 ) ) ; 
 
 @ @   - 2 0 , 6   + 3 3 , 1 1   @ @   c o n s t   t   =   l o g i n . t o k e n ; 
 
   c o n s t   {   j s o n :   m e   }   =   a w a i t   r e q ( " G E T " ,   " / a u t h / m e " ,   n u l l ,   t ) ; 
 
   c h e c k ( " / a p i / a u t h / m e   r e t u r n s   u s e r " ,   m e . u s e r ? . e m a i l   = = =   " o w n e r @ a g e n d a p r o . d e m o " ,   J S O N . s t r i n g i f y ( m e ) . s l i c e ( 0 ,   1 0 0 ) ) ; 
 
   
 
 + / /   S l u g   d e l   n e g o c i o   ( p a r a   c o n s u l t a r   s l o t s   p %Q%b l i c o s ) 
 
 + c o n s t   {   j s o n :   s e t t i n g s   }   =   a w a i t   r e q ( " G E T " ,   " / s e t t i n g s " ,   n u l l ,   t ) ; 
 
 + c o n s t   s l u g   =   s e t t i n g s . s e t t i n g s ? . s l u g ; 
 
 + c h e c k ( " t i e n e   s l u g " ,   ! ! s l u g ,   S t r i n g ( s l u g ) ) ; 
 
 + 
 
   c o n s t   c h e c k s   =   [ 
 
       [ " b u s i n e s s " ,   " / b u s i n e s s " ,   ( j )   = >   j . b u s i n e s s ? . n a m e   = = =   " L u m i % r e   E s t % t i c a   &   S p a " ] , 
 
       [ " e m p l o y e e s + s t a t s " ,   " / e m p l o y e e s " ,   ( j )   = >   j . e m p l o y e e s ? . l e n g t h   = = =   6   & &   ! ! j . e m p l o y e e s [ 0 ] . s t a t s ] , 
 
 @ @   - 4 2 , 1 3   + 6 0 , 2 1   @ @   f o r   ( c o n s t   [ n a m e ,   p a t h ,   c o n d ]   o f   c h e c k s )   { 
 
   } 
 
   
 
   / /   L i f e c y c l e 
 
 - c o n s t   {   j s o n :   c r e a t e d   }   =   a w a i t   r e q ( " P O S T " ,   " / a p p o i n t m e n t s " ,   {   s e r v i c e _ i d :   1 ,   c l i e n t _ i d :   1 ,   s t a r t _ a t :   " 2 0 2 6 - 0 9 - 1 5 T 1 1 : 0 0 : 0 0 Z "   } ,   t ) ; 
 
 + c o n s t   s l o t O w n e r   =   a w a i t   f i n d S l o t ( s l u g ,   1 ) ; 
 
 + c h e c k ( " f o u n d   s l o t   f o r   s e r v i c e   1 " ,   ! ! s l o t O w n e r ) ; 
 
 + c o n s t   {   j s o n :   c r e a t e d   }   =   a w a i t   r e q ( " P O S T " ,   " / a p p o i n t m e n t s " ,   {   s e r v i c e _ i d :   1 ,   c l i e n t _ i d :   1 ,   s t a r t _ a t :   s l o t O w n e r   } ,   t ) ; 
 
   c h e c k ( " c r e a t e   a p p o i n t m e n t " ,   ! ! c r e a t e d . a p p o i n t m e n t ? . i d ) ; 
 
   c o n s t   {   j s o n :   c o m p l e t e d   }   =   a w a i t   r e q ( " P O S T " ,   ` / a p p o i n t m e n t s / $ { c r e a t e d . a p p o i n t m e n t . i d } / c o m p l e t e ` ,   {   t i p :   5 0 ,   p a y m e n t _ m e t h o d :   " c a s h "   } ,   t ) ; 
 
   c h e c k ( " c o m p l e t e   - >   t i c k e t " ,   c o m p l e t e d . a p p o i n t m e n t ? . s t a t u s   = = =   " c o m p l e t e d " ) ; 
 
   c o n s t   {   j s o n :   e m p L o g i n   }   =   a w a i t   r e q ( " P O S T " ,   " / a u t h / l o g i n " ,   {   e m a i l :   " m a t e o . h e r r e r a @ l u m i e r e . m x " ,   p a s s w o r d :   " d e m o 1 2 3 4 "   } ) ; 
 
 - c o n s t   {   j s o n :   e m p A p p t   }   =   a w a i t   r e q ( " P O S T " ,   " / a p p o i n t m e n t s " ,   {   s e r v i c e _ i d :   5 ,   c l i e n t _ i d :   2 ,   s t a r t _ a t :   " 2 0 2 6 - 0 9 - 2 0 T 1 0 : 0 0 : 0 0 Z "   } ,   e m p L o g i n . t o k e n ) ; 
 
 - c h e c k ( " e m p l o y e e   a u t o - a s s i g n " ,   e m p A p p t . a p p o i n t m e n t ? . e m p l o y e e _ i d   = = =   e m p L o g i n . u s e r ? . e m p l o y e e _ i d ) ; 
 
 + / /   M a t e o   o f f e r s   s e r v i c e s   " C o r t e   c a b a l l e r o "   ( 5 )   a n d   " C o r t e   +   a r r e g l o   d e   b a r b a "   ( 6 ) . 
 
 + / /   T r y   5   f i r s t   ( k e e p s   t h e   o r i g i n a l   a s s e r t i o n   i n t e n t ) ;   f a l l   b a c k   t o   6   i f   5   h a s   n o   s l o t s . 
 
 + l e t   e m p S v c I d   =   5 ; 
 
 + l e t   s l o t E m p   =   a w a i t   f i n d S l o t ( s l u g ,   e m p S v c I d ) ; 
 
 + i f   ( ! s l o t E m p )   {   e m p S v c I d   =   6 ;   s l o t E m p   =   a w a i t   f i n d S l o t ( s l u g ,   e m p S v c I d ) ;   } 
 
 + c h e c k ( " f o u n d   s l o t   f o r   e m p l o y e e   s e r v i c e " ,   ! ! s l o t E m p ) ; 
 
 + c o n s t   {   j s o n :   e m p A p p t   }   =   a w a i t   r e q ( " P O S T " ,   " / a p p o i n t m e n t s " ,   {   s e r v i c e _ i d :   e m p S v c I d ,   c l i e n t _ i d :   2 ,   s t a r t _ a t :   s l o t E m p   } ,   e m p L o g i n . t o k e n ) ; 
 
 + c h e c k ( " e m p l o y e e   a u t o - a s s i g n " ,   e m p A p p t . a p p o i n t m e n t ? . e m p l o y e e _ i d   = = =   e m p L o g i n . u s e r ? . e m p l o y e e _ i d ,   J S O N . s t r i n g i f y ( e m p A p p t ) . s l i c e ( 0 ,   1 5 0 ) ) ; 
 
   c o n s t   {   s t a t u s :   b a d L o g i n   }   =   a w a i t   r e q ( " P O S T " ,   " / a u t h / l o g i n " ,   {   e m a i l :   " x @ x . c o m " ,   p a s s w o r d :   " w r o n g "   } ) ; 
 
   c h e c k ( " b a d   l o g i n   4 0 1 " ,   b a d L o g i n   = = =   4 0 1 ) ; 
 
   c o n s t   {   s t a t u s :   n o A u t h   }   =   a w a i t   r e q ( " G E T " ,   " / e m p l o y e e s " ) ; 
 
 d i f f   - - g i t   a / p a c k a g e . j s o n   b / p a c k a g e . j s o n 
 
 i n d e x   8 1 8 d 3 b d . . e 1 0 a a d c   1 0 0 6 4 4 
 
 - - -   a / p a c k a g e . j s o n 
 
 + + +   b / p a c k a g e . j s o n 
 
 @ @   - 1 5 , 6   + 1 5 , 8   @ @ 
 
           " s e e d " :   " t s x   s e r v e r / s c r i p t s / s e e d . t s " , 
 
           " t e s t : e 2 e " :   " n o d e   e 2 e - t e s t . m j s " , 
 
           " t e s t : a d m i n " :   " n o d e   a d m i n - t e s t . m j s " , 
 
 +         " t e s t : u n i t " :   " n o d e   - - i m p o r t   t s x   - - t e s t   s e r v e r / l i b / s c h e d u l i n g . t e s t . t s " , 
 
 +         " t e s t : b o o k i n g " :   " n o d e   s e r v e r / s c r i p t s / b o o k i n g - e 2 e . m j s " , 
 
           " a u d i t : v i s u a l " :   " n o d e   v i s u a l - a u d i t . m j s " 
 
       } , 
 
       " d e p e n d e n c i e s " :   { 
 
 d i f f   - - g i t   a / s e r v e r / d b . t s   b / s e r v e r / d b . t s 
 
 i n d e x   7 0 2 9 f c c . . 4 7 8 1 0 5 c   1 0 0 6 4 4 
 
 - - -   a / s e r v e r / d b . t s 
 
 + + +   b / s e r v e r / d b . t s 
 
 @ @   - 2 2 2 , 1 1   + 2 2 2 , 4 6   @ @   f u n c t i o n   m i g r a t e V 1 T o V 2 ( )   { 
 
       s e t M e t a ( " s c h e m a _ v e r s i o n " ,   " 2 " ) ; 
 
   } 
 
   
 
 + / * *   v 4 :   a u t o - a s s i g n   s p e c i a l i s t ,   b u s i n e s s   &   e m p l o y e e   w o r k i n g   h o u r s ,   e m p l o y e e   s p e c i a l t i e s / e f f i c i e n c y .   * / 
 
 + f u n c t i o n   m i g r a t e V 3 T o V 4 ( )   { 
 
 +     i f   ( g e t M e t a ( " s c h e m a _ v e r s i o n " )   > =   " 4 " )   r e t u r n ; 
 
 + 
 
 +     c o n s t   b i z C o l s :   [ s t r i n g ,   s t r i n g ] [ ]   =   [ 
 
 +         [ " a u t o _ a s s i g n _ s p e c i a l i s t " ,   " I N T E G E R   N O T   N U L L   D E F A U L T   0 " ] , 
 
 +         [ " w o r k i n g _ h o u r s " ,   " T E X T " ] , 
 
 +     ] ; 
 
 +     f o r   ( c o n s t   [ c o l ,   d e f ]   o f   b i z C o l s )   { 
 
 +         i f   ( ! c o l u m n E x i s t s ( " b u s i n e s s e s " ,   c o l ) )   d b . e x e c ( ` A L T E R   T A B L E   b u s i n e s s e s   A D D   C O L U M N   $ { c o l }   $ { d e f } ; ` ) ; 
 
 +     } 
 
 + 
 
 +     c o n s t   e m p C o l s :   [ s t r i n g ,   s t r i n g ] [ ]   =   [ 
 
 +         [ " s p e c i a l t i e s " ,   " T E X T " ] , 
 
 +         [ " w o r k i n g _ h o u r s " ,   " T E X T " ] , 
 
 +         [ " e f f i c i e n c y _ s c o r e " ,   " R E A L   N O T   N U L L   D E F A U L T   5 0 " ] , 
 
 +     ] ; 
 
 +     f o r   ( c o n s t   [ c o l ,   d e f ]   o f   e m p C o l s )   { 
 
 +         i f   ( ! c o l u m n E x i s t s ( " e m p l o y e e s " ,   c o l ) )   d b . e x e c ( ` A L T E R   T A B L E   e m p l o y e e s   A D D   C O L U M N   $ { c o l }   $ { d e f } ; ` ) ; 
 
 +     } 
 
 + 
 
 +     / /   B a c k f i l l   b u s i n e s s   w o r k i n g _ h o u r s :   L u n - V i e   0 9 : 0 0 - 2 0 : 0 0   ( r e p l i c a   d e l   h a r d c o d e a d o   a n t e r i o r ) 
 
 +     c o n s t   D E F A U L T _ W H   =   J S O N . s t r i n g i f y ( { 
 
 +         1 :   {   s t a r t :   " 0 9 : 0 0 " ,   e n d :   " 2 0 : 0 0 "   } ,   2 :   {   s t a r t :   " 0 9 : 0 0 " ,   e n d :   " 2 0 : 0 0 "   } , 
 
 +         3 :   {   s t a r t :   " 0 9 : 0 0 " ,   e n d :   " 2 0 : 0 0 "   } ,   4 :   {   s t a r t :   " 0 9 : 0 0 " ,   e n d :   " 2 0 : 0 0 "   } , 
 
 +         5 :   {   s t a r t :   " 0 9 : 0 0 " ,   e n d :   " 2 0 : 0 0 "   } ,   6 :   n u l l ,   7 :   n u l l , 
 
 +     } ) ; 
 
 +     c o n s t   n o W h   =   d b . p r e p a r e ( ` S E L E C T   i d   F R O M   b u s i n e s s e s   W H E R E   w o r k i n g _ h o u r s   I S   N U L L ` ) . a l l ( )   a s   {   i d :   n u m b e r   } [ ] ; 
 
 +     c o n s t   u p d   =   d b . p r e p a r e ( ` U P D A T E   b u s i n e s s e s   S E T   w o r k i n g _ h o u r s   =   ?   W H E R E   i d   =   ? ` ) ; 
 
 +     f o r   ( c o n s t   b   o f   n o W h )   u p d . r u n ( D E F A U L T _ W H ,   b . i d ) ; 
 
 + 
 
 +     s e t M e t a ( " s c h e m a _ v e r s i o n " ,   " 4 " ) ; 
 
 + } 
 
 + 
 
   e x p o r t   f u n c t i o n   r u n M i g r a t i o n s ( )   { 
 
       / /   E n s u r e   b a s e   s c h e m a   e x i s t s   ( n o - o p   o n   e x i s t i n g   t a b l e s ) 
 
       d b . e x e c ( S C H E M A ) ; 
 
       m i g r a t e V 1 T o V 2 ( ) ; 
 
       m i g r a t e V 2 T o V 3 ( ) ; 
 
 +     m i g r a t e V 3 T o V 4 ( ) ; 
 
   } 
 
   
 
   / * *   v 3 :   c a n c e l l a t i o n   p o l i c y ,   c o m m i s s i o n s ,   c a s h   r e g i s t e r ,   n o t i f i c a t i o n s / r e m i n d e r s ,   b o o k i n g   s l u g .   * / 
 
 d i f f   - - g i t   a / s e r v e r / r o u t e s / a p p o i n t m e n t s . t s   b / s e r v e r / r o u t e s / a p p o i n t m e n t s . t s 
 
 i n d e x   c 7 1 0 c 2 4 . . 5 8 d 3 5 6 2   1 0 0 6 4 4 
 
 - - -   a / s e r v e r / r o u t e s / a p p o i n t m e n t s . t s 
 
 + + +   b / s e r v e r / r o u t e s / a p p o i n t m e n t s . t s 
 
 @ @   - 2 , 6   + 2 , 7   @ @   i m p o r t   {   R o u t e r   }   f r o m   " e x p r e s s " ; 
 
   i m p o r t   {   d b   }   f r o m   " . . / d b . t s " ; 
 
   i m p o r t   t y p e   {   A u t h e d R e q u e s t   }   f r o m   " . . / l i b / a u t h . t s " ; 
 
   i m p o r t   {   e r r   }   f r o m   " . . / l i b / a u t h . t s " ; 
 
 + i m p o r t   {   a u t o A s s i g n ,   i s A v a i l a b l e ,   r u n I n T r a n s a c t i o n ,   p a r s e W o r k i n g H o u r s   }   f r o m   " . . / l i b / s c h e d u l i n g . t s " ; 
 
   
 
   e x p o r t   c o n s t   a p p o i n t m e n t s R o u t e r   =   R o u t e r ( ) ; 
 
   
 
 @ @   - 1 1 4 , 5 6   + 1 1 5 , 6 0   @ @   a p p o i n t m e n t s R o u t e r . p o s t ( " / " ,   ( r e q :   A u t h e d R e q u e s t ,   r e s )   = >   { 
 
       i f   ( ! c l i e n t I d )   r e t u r n   e r r ( r e s ,   4 0 0 ,   " S e l e c c i o n a   o   c r e a   u n   c l i e n t e " ) ; 
 
   
 
       / /   R e s o l v e   e m p l o y e e :   a u t o - a s s i g n   t o   s e l f   f o r   e m p l o y e e s ;   d e f a u l t   t o   f i r s t   e l i g i b l e   f o r   o w n e r 
 
 -     l e t   e m p I d   =   e m p l o y e e _ i d   ?   N u m b e r ( e m p l o y e e _ i d )   :   n u l l ; 
 
 -     i f   ( ! e m p I d   & &   r e q . u s e r ! . r o l e   = = =   " e m p l o y e e "   & &   r e q . u s e r ! . e m p l o y e e _ i d )   { 
 
 -         e m p I d   =   r e q . u s e r ! . e m p l o y e e _ i d ; 
 
 -     } 
 
 -     i f   ( ! e m p I d )   { 
 
 -         c o n s t   e l i g i b l e   =   d b 
 
 -             . p r e p a r e ( ` S E L E C T   e m p l o y e e _ i d   i d   F R O M   e m p l o y e e _ s e r v i c e s   W H E R E   s e r v i c e _ i d   =   ?   L I M I T   1 ` ) 
 
 -             . g e t ( N u m b e r ( s e r v i c e _ i d ) )   a s   {   i d :   n u m b e r   }   |   u n d e f i n e d ; 
 
 -         e m p I d   =   e l i g i b l e ? . i d   ? ?   n u l l ; 
 
 -     } 
 
 -     i f   ( ! e m p I d )   r e t u r n   e r r ( r e s ,   4 0 0 ,   " N o   h a y   e m p l e a d o   a s i g n a d o   a   e s t e   s e r v i c i o " ) ; 
 
 - 
 
       c o n s t   s t a r t   =   n e w   D a t e ( s t a r t _ a t ) ; 
 
       i f   ( i s N a N ( s t a r t . g e t T i m e ( ) ) )   r e t u r n   e r r ( r e s ,   4 0 0 ,   " F e c h a   d e   i n i c i o   i n v % l i d a " ) ; 
 
       c o n s t   d u r   =   N u m b e r ( d u r a t i o n _ m i n )   | |   s e r v i c e . d u r a t i o n _ m i n ; 
 
       c o n s t   e n d   =   n e w   D a t e ( s t a r t . g e t T i m e ( )   +   d u r   *   6 0 0 0 0 ) ; 
 
       c o n s t   e n d I s o   =   e n d . t o I S O S t r i n g ( ) . r e p l a c e ( / \ . \ d { 3 } Z $ / ,   " Z " ) ; 
 
       c o n s t   s t a r t I s o   =   s t a r t . t o I S O S t r i n g ( ) . r e p l a c e ( / \ . \ d { 3 } Z $ / ,   " Z " ) ; 
 
 +     c o n s t   s t a r t M s   =   s t a r t . g e t T i m e ( ) ; 
 
 +     c o n s t   e n d M s   =   e n d . g e t T i m e ( ) ; 
 
   
 
       c o n s t   f i n a l S t a t u s   =   s t a t u s   | |   " s c h e d u l e d " ; 
 
       c o n s t   p r i c e   =   p r i c e _ o v e r r i d e   ! = =   u n d e f i n e d   ?   N u m b e r ( p r i c e _ o v e r r i d e )   :   s e r v i c e . p r i c e ; 
 
   
 
 -     c o n s t   r   =   d b 
 
 -         . p r e p a r e ( 
 
 -             ` I N S E R T   I N T O   a p p o i n t m e n t s 
 
 -                 ( b u s i n e s s _ i d ,   s e r v i c e _ i d ,   e m p l o y e e _ i d ,   c l i e n t _ i d ,   s t a r t _ a t ,   e n d _ a t ,   s t a t u s ,   p r i c e ,   n o t e s ,   c r e a t e d _ b y _ u s e r _ i d ) 
 
 -               V A L U E S   ( ? ,   ? ,   ? ,   ? ,   ? ,   ? ,   ? ,   ? ,   ? ,   ? )   R E T U R N I N G   * ` 
 
 -         ) 
 
 -         . g e t ( 
 
 -             r e q . u s e r ! . b u s i n e s s _ i d , 
 
 -             N u m b e r ( s e r v i c e _ i d ) , 
 
 -             e m p I d , 
 
 -             c l i e n t I d , 
 
 -             s t a r t I s o , 
 
 -             e n d I s o , 
 
 -             f i n a l S t a t u s , 
 
 -             p r i c e , 
 
 -             n o t e s   | |   n u l l , 
 
 -             r e q . u s e r ! . i d 
 
 -         )   a s   a n y ; 
 
 +     t r y   { 
 
 +         c o n s t   r   =   r u n I n T r a n s a c t i o n ( d b ,   ( )   = >   { 
 
 +             / /   R e s o l v e r   e m p l e a d o   ( i g u a l   q u e   a n t e s ,   p e r o   u s a n d o   a u t o A s s i g n   s i   n i n g u n o ) 
 
 +             l e t   e m p I d   =   e m p l o y e e _ i d   ?   N u m b e r ( e m p l o y e e _ i d )   :   n u l l ; 
 
 +             i f   ( ! e m p I d   & &   r e q . u s e r ! . r o l e   = = =   " e m p l o y e e "   & &   r e q . u s e r ! . e m p l o y e e _ i d )   { 
 
 +                 e m p I d   =   r e q . u s e r ! . e m p l o y e e _ i d ; 
 
 +             } 
 
 +             i f   ( ! e m p I d )   { 
 
 +                 c o n s t   b i z R o w   =   d b . p r e p a r e ( ` S E L E C T   w o r k i n g _ h o u r s   w h   F R O M   b u s i n e s s e s   W H E R E   i d   =   ? ` ) . g e t ( r e q . u s e r ! . b u s i n e s s _ i d )   a s   a n y ; 
 
 +                 c o n s t   a a   =   a u t o A s s i g n ( d b ,   { 
 
 +                     b u s i n e s s I d :   N u m b e r ( r e q . u s e r ! . b u s i n e s s _ i d ) ,   s e r v i c e I d :   s e r v i c e . i d ,   s e r v i c e N a m e :   s e r v i c e . n a m e ,   s e r v i c e C a t e g o r y :   s e r v i c e . c a t e g o r y , 
 
 +                     s t a r t M s ,   e n d M s ,   b i z W h :   p a r s e W o r k i n g H o u r s ( b i z R o w ? . w h )   a s   a n y , 
 
 +                 } ) ; 
 
 +                 e m p I d   =   a a ? . e m p l o y e e I d   ? ?   n u l l ; 
 
 +             } 
 
 +             i f   ( ! e m p I d )   t h r o w   {   s t a t u s :   4 0 0 ,   e r r o r :   " N o   h a y   e m p l e a d o   a s i g n a d o   a   e s t e   s e r v i c i o "   } ; 
 
   
 
 -     i f   ( f i n a l S t a t u s   = = =   " c o m p l e t e d " )   { 
 
 -         d b . p r e p a r e ( 
 
 -             ` I N S E R T   I N T O   t i c k e t s   ( b u s i n e s s _ i d ,   a p p o i n t m e n t _ i d ,   c l i e n t _ i d ,   e m p l o y e e _ i d ,   s e r v i c e _ i d ,   a m o u n t ,   t i p ,   p a y m e n t _ m e t h o d ) 
 
 -               V A L U E S   ( ? ,   ? ,   ? ,   ? ,   ? ,   ? ,   0 ,   ' c a r d ' ) ` 
 
 -         ) . r u n ( r e q . u s e r ! . b u s i n e s s _ i d ,   r . i d ,   c l i e n t I d ,   e m p I d ,   N u m b e r ( s e r v i c e _ i d ) ,   p r i c e ) ; 
 
 -     } 
 
 +             / /   G u a r d   a n t i   d o b l e   r e s e r v a 
 
 +             i f   ( ! i s A v a i l a b l e ( d b ,   e m p I d ,   s t a r t M s ,   e n d M s ) )   t h r o w   {   s t a t u s :   4 0 9 ,   e r r o r :   " E s e   h o r a r i o   y a   e s t %   o c u p a d o   p a r a   e l   e s p e c i a l i s t a "   } ; 
 
 + 
 
 +             c o n s t   i n s e r t e d   =   d b 
 
 +                 . p r e p a r e ( 
 
 +                     ` I N S E R T   I N T O   a p p o i n t m e n t s 
 
 +                         ( b u s i n e s s _ i d ,   s e r v i c e _ i d ,   e m p l o y e e _ i d ,   c l i e n t _ i d ,   s t a r t _ a t ,   e n d _ a t ,   s t a t u s ,   p r i c e ,   n o t e s ,   c r e a t e d _ b y _ u s e r _ i d ) 
 
 +                       V A L U E S   ( ? ,   ? ,   ? ,   ? ,   ? ,   ? ,   ? ,   ? ,   ? ,   ? )   R E T U R N I N G   * ` 
 
 +                 ) 
 
 +                 . g e t ( r e q . u s e r ! . b u s i n e s s _ i d ,   N u m b e r ( s e r v i c e _ i d ) ,   e m p I d ,   c l i e n t I d ,   s t a r t I s o ,   e n d I s o ,   f i n a l S t a t u s ,   p r i c e ,   n o t e s   | |   n u l l ,   r e q . u s e r ! . i d )   a s   a n y ; 
 
   
 
 -     j o i n A p p o i n t m e n t ( r ) ; 
 
 -     r e s . s t a t u s ( 2 0 1 ) . j s o n ( {   a p p o i n t m e n t :   r   } ) ; 
 
 +             i f   ( f i n a l S t a t u s   = = =   " c o m p l e t e d " )   { 
 
 +                 d b . p r e p a r e ( 
 
 +                     ` I N S E R T   I N T O   t i c k e t s   ( b u s i n e s s _ i d ,   a p p o i n t m e n t _ i d ,   c l i e n t _ i d ,   e m p l o y e e _ i d ,   s e r v i c e _ i d ,   a m o u n t ,   t i p ,   p a y m e n t _ m e t h o d ) 
 
 +                       V A L U E S   ( ? ,   ? ,   ? ,   ? ,   ? ,   ? ,   0 ,   ' c a r d ' ) ` 
 
 +                 ) . r u n ( r e q . u s e r ! . b u s i n e s s _ i d ,   i n s e r t e d . i d ,   c l i e n t I d ,   e m p I d ,   N u m b e r ( s e r v i c e _ i d ) ,   p r i c e ) ; 
 
 +             } 
 
 +             j o i n A p p o i n t m e n t ( i n s e r t e d ) ; 
 
 +             r e t u r n   i n s e r t e d ; 
 
 +         } ) ; 
 
 +         r e s . s t a t u s ( 2 0 1 ) . j s o n ( {   a p p o i n t m e n t :   r   } ) ; 
 
 +     }   c a t c h   ( e :   a n y )   { 
 
 +         i f   ( e   & &   t y p e o f   e   = = =   " o b j e c t "   & &   e . s t a t u s )   r e t u r n   e r r ( r e s ,   e . s t a t u s ,   e . e r r o r ) ; 
 
 +         t h r o w   e ; 
 
 +     } 
 
   } ) ; 
 
   
 
   a p p o i n t m e n t s R o u t e r . p a t c h ( " / : i d " ,   ( r e q :   A u t h e d R e q u e s t ,   r e s )   = >   { 
 
 d i f f   - - g i t   a / s e r v e r / r o u t e s / b o o k i n g . t s   b / s e r v e r / r o u t e s / b o o k i n g . t s 
 
 i n d e x   a 8 0 b f 7 5 . . 1 0 4 4 1 2 7   1 0 0 6 4 4 
 
 - - -   a / s e r v e r / r o u t e s / b o o k i n g . t s 
 
 + + +   b / s e r v e r / r o u t e s / b o o k i n g . t s 
 
 @ @   - 1 , 5   + 1 , 1 0   @ @ 
 
   i m p o r t   {   R o u t e r   }   f r o m   " e x p r e s s " ; 
 
   i m p o r t   {   d b   }   f r o m   " . . / d b . t s " ; 
 
 + i m p o r t   { 
 
 +     p a r s e W o r k i n g H o u r s ,   g e t W o r k i n g H o u r s F o r D a t e ,   g e t C a n d i d a t e s ,   g e t E x i s t i n g B u s y , 
 
 +     p i c k B e s t S l o t E m p l o y e e ,   a u t o A s s i g n ,   i s A v a i l a b l e ,   r u n I n T r a n s a c t i o n , 
 
 +     t y p e   W o r k i n g H o u r s M a p , 
 
 + }   f r o m   " . . / l i b / s c h e d u l i n g . t s " ; 
 
   
 
   e x p o r t   c o n s t   b o o k i n g R o u t e r   =   R o u t e r ( ) ; 
 
   
 
 @ @   - 7 , 7   + 1 2 , 8   @ @   f u n c t i o n   p u b l i c B u s i n e s s ( s l u g :   s t r i n g )   { 
 
       r e t u r n   d b 
 
           . p r e p a r e ( 
 
               ` S E L E C T   i d ,   n a m e ,   i n d u s t r y ,   c u r r e n c y ,   c u r r e n c y _ s y m b o l ,   p h o n e ,   a d d r e s s ,   t i m e z o n e , 
 
 -                             b o o k i n g _ e n a b l e d ,   c a n c e l _ w i n d o w _ h o u r s ,   c a n c e l _ p e n a l t y _ p c t ,   r e q u i r e _ d e p o s i t ,   d e p o s i t _ p c t 
 
 +                             b o o k i n g _ e n a b l e d ,   c a n c e l _ w i n d o w _ h o u r s ,   c a n c e l _ p e n a l t y _ p c t ,   r e q u i r e _ d e p o s i t ,   d e p o s i t _ p c t , 
 
 +                             a u t o _ a s s i g n _ s p e c i a l i s t ,   w o r k i n g _ h o u r s 
 
                 F R O M   b u s i n e s s e s   W H E R E   s l u g   =   ?   A N D   s t a t u s   =   ' a c t i v e ' ` 
 
           ) 
 
           . g e t ( s l u g )   a s   a n y ; 
 
 @ @   - 4 7 , 5 5   + 5 3 , 7 5   @ @   b o o k i n g R o u t e r . g e t ( " / : s l u g / s l o t s " ,   ( r e q ,   r e s )   = >   { 
 
       }   e l s e   { 
 
           c a n d i d a t e s   =   d b . p r e p a r e ( ` S E L E C T   e m p l o y e e _ i d   i d   F R O M   e m p l o y e e _ s e r v i c e s   W H E R E   s e r v i c e _ i d   =   ? ` ) . a l l ( s e r v i c e I d ) . m a p ( ( r :   a n y )   = >   r . i d ) ; 
 
           i f   ( c a n d i d a t e s . l e n g t h   = = =   0 )   { 
 
 -             c o n s t   a n y   =   d b . p r e p a r e ( ` S E L E C T   i d   F R O M   e m p l o y e e s   W H E R E   b u s i n e s s _ i d   =   ?   A N D   a c t i v e   =   1   L I M I T   1 ` ) . g e t ( b i z . i d )   a s   a n y ; 
 
 -             c a n d i d a t e s   =   a n y   ?   [ a n y . i d ]   :   [ ] ; 
 
 +             c o n s t   a n y E m p   =   d b . p r e p a r e ( ` S E L E C T   i d   F R O M   e m p l o y e e s   W H E R E   b u s i n e s s _ i d   =   ?   A N D   a c t i v e   =   1   L I M I T   1 ` ) . g e t ( b i z . i d )   a s   a n y ; 
 
 +             c a n d i d a t e s   =   a n y E m p   ?   [ a n y E m p . i d ]   :   [ ] ; 
 
           } 
 
       } 
 
       i f   ( c a n d i d a t e s . l e n g t h   = = =   0 )   r e t u r n   r e s . j s o n ( {   s l o t s :   [ ]   } ) ; 
 
   
 
 -     / /   b u s i n e s s   h o u r s   0 9 : 0 0    2 0 : 0 0 ,   3 0 - m i n   g r i d ;   r e j e c t   p a s t   t i m e s 
 
 -     c o n s t   d a y S t a r t   =   n e w   D a t e ( ` $ { d a t e } T 0 9 : 0 0 : 0 0 ` ) ; 
 
 -     c o n s t   d a y E n d   =   n e w   D a t e ( ` $ { d a t e } T 2 0 : 0 0 : 0 0 ` ) ; 
 
 +     c o n s t   b i z W h   =   p a r s e W o r k i n g H o u r s ( b i z . w o r k i n g _ h o u r s )   a s   W o r k i n g H o u r s M a p   |   n u l l ; 
 
 + 
 
 +     / /   S i   e l   c l i e n t e   n o   e l i g i %%  e s p e c i a l i s t a ,   u s a r   e l   r a n k i n g   p a r a   m o s t r a r   e l   m e j o r   d i s p o n i b l e   p o r   s l o t . 
 
 +     c o n s t   u s e R a n k i n g   =   ! e m p l o y e e I d ; 
 
 +     c o n s t   c a n d I n f o s   =   u s e R a n k i n g   ?   g e t C a n d i d a t e s ( d b ,   b i z . i d ,   s e r v i c e I d )   :   [ ] ; 
 
 +     c o n s t   c a n d B u s y M a p   =   u s e R a n k i n g   ?   g e t E x i s t i n g B u s y ( d b ,   c a n d I n f o s . m a p ( ( c )   = >   c . i d ) ,   d a t e )   :   n e w   M a p ( ) ; 
 
 + 
 
 +     / /   P a r a   c u a n d o   s %   s e   e l i g i %%  e s p e c i a l i s t a :   v e n t a n a   =   h o r a r i o   d e   e s e   e m p l e a d o   ( o   n e g o c i o ) . 
 
 +     c o n s t   d a t e O b j   =   n e w   D a t e ( ` $ { d a t e } T 1 2 : 0 0 : 0 0 ` ) ; 
 
 +     c o n s t   s i n g l e E m p R o w   =   e m p l o y e e I d 
 
 +         ?   ( d b . p r e p a r e ( ` S E L E C T   w o r k i n g _ h o u r s   w h   F R O M   e m p l o y e e s   W H E R E   i d   =   ? ` ) . g e t ( e m p l o y e e I d )   a s   a n y ) 
 
 +         :   n u l l ; 
 
 +     c o n s t   s i n g l e E m p W h   =   s i n g l e E m p R o w   ?   p a r s e W o r k i n g H o u r s ( s i n g l e E m p R o w . w h )   :   n u l l ; 
 
 +     c o n s t   w i n d o w   =   e m p l o y e e I d 
 
 +         ?   ( g e t W o r k i n g H o u r s F o r D a t e ( s i n g l e E m p W h   a s   W o r k i n g H o u r s M a p   |   n u l l ,   b i z W h ,   d a t e O b j )   ? ?   g e t W o r k i n g H o u r s F o r D a t e ( n u l l ,   b i z W h ,   d a t e O b j ) ) 
 
 +         :   g e t W o r k i n g H o u r s F o r D a t e ( n u l l ,   b i z W h ,   d a t e O b j ) ; 
 
 + 
 
       c o n s t   n o w   =   n e w   D a t e ( ) ; 
 
       c o n s t   s l o t s :   {   t i m e :   s t r i n g ;   i s o :   s t r i n g ;   e m p l o y e e _ i d :   n u m b e r ;   e m p l o y e e _ n a m e :   s t r i n g   } [ ]   =   [ ] ; 
 
       c o n s t   d u r   =   s e r v i c e . d u r a t i o n _ m i n ; 
 
   
 
 -     / /   g a t h e r   e x i s t i n g   a p p o i n t m e n t s   t h a t   d a y   f o r   t h e s e   e m p l o y e e s 
 
 -     c o n s t   s t a r t O f D a y I s o   =   ` $ { d a t e } T 0 0 : 0 0 : 0 0 ` ; 
 
 -     c o n s t   e n d O f D a y I s o   =   ` $ { d a t e } T 2 3 : 5 9 : 5 9 ` ; 
 
 -     c o n s t   e x i s t i n g   =   d b 
 
 -         . p r e p a r e ( 
 
 -             ` S E L E C T   e m p l o y e e _ i d ,   s t a r t _ a t ,   e n d _ a t   F R O M   a p p o i n t m e n t s 
 
 -               W H E R E   b u s i n e s s _ i d   =   ?   A N D   e m p l o y e e _ i d   I N   ( $ { c a n d i d a t e s . m a p ( ( )   = >   " ? " ) . j o i n ( " , " ) } ) 
 
 -                   A N D   s t a t u s   I N   ( ' s c h e d u l e d ' , ' c o m p l e t e d ' )   A N D   s t a r t _ a t   > =   ?   A N D   s t a r t _ a t   < =   ? ` 
 
 -         ) 
 
 -         . a l l ( b i z . i d ,   . . . c a n d i d a t e s ,   s t a r t O f D a y I s o ,   e n d O f D a y I s o )   a s   a n y [ ] ; 
 
 +     i f   ( ! w i n d o w )   { 
 
 +         r e t u r n   r e s . j s o n ( {   s l o t s ,   s e r v i c e :   {   i d :   s e r v i c e . i d ,   n a m e :   s e r v i c e . n a m e ,   p r i c e :   s e r v i c e . p r i c e ,   d u r a t i o n _ m i n :   s e r v i c e . d u r a t i o n _ m i n   }   } ) ; 
 
 +     } 
 
 +     c o n s t   d a y S t a r t   =   w i n d o w . s t a r t M s ; 
 
 +     c o n s t   d a y E n d   =   w i n d o w . e n d M s ; 
 
   
 
 -     f o r   ( l e t   t   =   d a y S t a r t . g e t T i m e ( ) ;   t   +   d u r   *   6 0 0 0 0   < =   d a y E n d . g e t T i m e ( ) ;   t   + =   3 0   *   6 0 0 0 0 )   { 
 
 -         i f   ( t   <   n o w . g e t T i m e ( )   +   3 0   *   6 0 0 0 0 )   c o n t i n u e ;   / /   s k i p   p a s t   /   t o o - s o o n 
 
 +     / /   c i t a s   e x i s t e n t e s   d e l   d % a   p a r a   e l   c a s o   d e   e s p e c i a l i s t a   f i j o 
 
 +     c o n s t   e x i s t i n g   =   e m p l o y e e I d 
 
 +         ?   ( g e t E x i s t i n g B u s y ( d b ,   [ e m p l o y e e I d ] ,   d a t e ) . g e t ( e m p l o y e e I d )   ? ?   [ ] ) 
 
 +         :   [ ] ; 
 
 + 
 
 +     f o r   ( l e t   t   =   d a y S t a r t ;   t   +   d u r   *   6 0 0 0 0   < =   d a y E n d ;   t   + =   3 0   *   6 0 0 0 0 )   { 
 
 +         i f   ( t   <   n o w . g e t T i m e ( )   +   3 0   *   6 0 0 0 0 )   c o n t i n u e ;   / /   p a s a d o   /   d e m a s i a d o   p r o n t o 
 
           c o n s t   s l o t S t a r t   =   t ; 
 
           c o n s t   s l o t E n d   =   t   +   d u r   *   6 0 0 0 0 ; 
 
 -         / /   f i n d   a n   e m p l o y e e   f r e e   i n   t h i s   w i n d o w 
 
 -         f o r   ( c o n s t   e m p I d   o f   c a n d i d a t e s )   { 
 
 -             c o n s t   b u s y   =   e x i s t i n g . s o m e ( 
 
 -                 ( b )   = >   b . e m p l o y e e _ i d   = = =   e m p I d   & &   s l o t S t a r t   <   n e w   D a t e ( b . e n d _ a t ) . g e t T i m e ( )   & &   s l o t E n d   >   n e w   D a t e ( b . s t a r t _ a t ) . g e t T i m e ( ) 
 
 -             ) ; 
 
 +         l e t   c h o s e n :   {   i d :   n u m b e r ;   n a m e :   s t r i n g   }   |   n u l l   =   n u l l ; 
 
 +         i f   ( u s e R a n k i n g )   { 
 
 +             c h o s e n   =   p i c k B e s t S l o t E m p l o y e e ( c a n d I n f o s ,   c a n d B u s y M a p ,   b i z W h ,   {   n a m e :   s e r v i c e . n a m e ,   c a t e g o r y :   s e r v i c e . c a t e g o r y   } ,   s l o t S t a r t ,   s l o t E n d ) ; 
 
 +         }   e l s e   { 
 
 +             c o n s t   b u s y   =   e x i s t i n g . s o m e ( ( b )   = >   o v e r l a p s R a n g e ( s l o t S t a r t ,   s l o t E n d ,   b . s t a r t M s ,   b . e n d M s ) ) ; 
 
               i f   ( ! b u s y )   { 
 
 -                 c o n s t   e m p   =   d b . p r e p a r e ( ` S E L E C T   n a m e   F R O M   e m p l o y e e s   W H E R E   i d   =   ? ` ) . g e t ( e m p I d )   a s   a n y ; 
 
 -                 s l o t s . p u s h ( { 
 
 -                     t i m e :   n e w   D a t e ( t ) . t o L o c a l e T i m e S t r i n g ( " e s - M X " ,   {   h o u r :   " 2 - d i g i t " ,   m i n u t e :   " 2 - d i g i t " ,   h o u r 1 2 :   t r u e   } ) , 
 
 -                     i s o :   n e w   D a t e ( t ) . t o I S O S t r i n g ( ) , 
 
 -                     e m p l o y e e _ i d :   e m p I d , 
 
 -                     e m p l o y e e _ n a m e :   e m p ? . n a m e , 
 
 -                 } ) ; 
 
 -                 b r e a k ;   / /   o n e   f r e e   e m p l o y e e   p e r   s l o t   i s   e n o u g h 
 
 +                 c o n s t   e m p   =   d b . p r e p a r e ( ` S E L E C T   n a m e   F R O M   e m p l o y e e s   W H E R E   i d   =   ? ` ) . g e t ( e m p l o y e e I d )   a s   a n y ; 
 
 +                 c h o s e n   =   {   i d :   e m p l o y e e I d ,   n a m e :   e m p ? . n a m e   ? ?   " "   } ; 
 
               } 
 
           } 
 
 +         i f   ( c h o s e n )   { 
 
 +             s l o t s . p u s h ( { 
 
 +                 t i m e :   n e w   D a t e ( t ) . t o L o c a l e T i m e S t r i n g ( " e s - M X " ,   {   h o u r :   " 2 - d i g i t " ,   m i n u t e :   " 2 - d i g i t " ,   h o u r 1 2 :   t r u e   } ) , 
 
 +                 i s o :   n e w   D a t e ( t ) . t o I S O S t r i n g ( ) , 
 
 +                 e m p l o y e e _ i d :   c h o s e n . i d , 
 
 +                 e m p l o y e e _ n a m e :   c h o s e n . n a m e , 
 
 +             } ) ; 
 
 +         } 
 
           i f   ( s l o t s . l e n g t h   > =   4 0 )   b r e a k ; 
 
       } 
 
       r e s . j s o n ( {   s l o t s ,   s e r v i c e :   {   i d :   s e r v i c e . i d ,   n a m e :   s e r v i c e . n a m e ,   p r i c e :   s e r v i c e . p r i c e ,   d u r a t i o n _ m i n :   s e r v i c e . d u r a t i o n _ m i n   }   } ) ; 
 
   } ) ; 
 
   
 
 + f u n c t i o n   o v e r l a p s R a n g e ( a S t a r t :   n u m b e r ,   a E n d :   n u m b e r ,   b S t a r t :   n u m b e r ,   b E n d :   n u m b e r ) :   b o o l e a n   { 
 
 +     r e t u r n   a S t a r t   <   b E n d   & &   a E n d   >   b S t a r t ; 
 
 + } 
 
 + 
 
   / /   C r e a t e   a   b o o k i n g   f r o m   t h e   p u b l i c   s i t e   ( n o   a u t h ) :   c r e a t e s / f i n d s   c l i e n t   +   a p p o i n t m e n t 
 
   b o o k i n g R o u t e r . p o s t ( " / : s l u g / b o o k " ,   ( r e q ,   r e s )   = >   { 
 
       c o n s t   b i z   =   p u b l i c B u s i n e s s ( r e q . p a r a m s . s l u g ) ; 
 
 @ @   - 1 0 7 , 4 8   + 1 3 3 , 8 2   @ @   b o o k i n g R o u t e r . p o s t ( " / : s l u g / b o o k " ,   ( r e q ,   r e s )   = >   { 
 
       c o n s t   s t a r t   =   n e w   D a t e ( s t a r t _ a t ) ; 
 
       i f   ( i s N a N ( s t a r t . g e t T i m e ( ) )   | |   s t a r t . g e t T i m e ( )   <   D a t e . n o w ( ) )   r e t u r n   r e s . s t a t u s ( 4 0 0 ) . j s o n ( {   e r r o r :   " F e c h a   i n v % l i d a "   } ) ; 
 
   
 
 -     / /   r e s o l v e   e m p l o y e e 
 
 -     l e t   e m p I d   =   e m p l o y e e _ i d   ?   N u m b e r ( e m p l o y e e _ i d )   :   n u l l ; 
 
 -     i f   ( ! e m p I d )   { 
 
 -         c o n s t   c a n d   =   d b . p r e p a r e ( ` S E L E C T   e m p l o y e e _ i d   i d   F R O M   e m p l o y e e _ s e r v i c e s   W H E R E   s e r v i c e _ i d   =   ?   L I M I T   1 ` ) . g e t ( N u m b e r ( s e r v i c e _ i d ) )   a s   a n y ; 
 
 -         e m p I d   =   c a n d ? . i d   ? ?   n u l l ; 
 
 -     } 
 
 -     i f   ( ! e m p I d )   r e t u r n   r e s . s t a t u s ( 4 0 0 ) . j s o n ( {   e r r o r :   " S i n   e s p e c i a l i s t a   d i s p o n i b l e "   } ) ; 
 
 - 
 
 -     / /   r e s o l v e   c l i e n t   ( b y   p h o n e / e m a i l   o r   c r e a t e ) 
 
 -     l e t   c l i e n t I d :   n u m b e r   |   n u l l   =   n u l l ; 
 
 -     c o n s t   m a t c h   =   c l i e n t . p h o n e 
 
 -         ?   ( d b . p r e p a r e ( ` S E L E C T   i d   F R O M   c l i e n t s   W H E R E   b u s i n e s s _ i d   =   ?   A N D   p h o n e   =   ? ` ) . g e t ( b i z . i d ,   c l i e n t . p h o n e )   a s   a n y ) 
 
 -         :   c l i e n t . e m a i l 
 
 -         ?   ( d b . p r e p a r e ( ` S E L E C T   i d   F R O M   c l i e n t s   W H E R E   b u s i n e s s _ i d   =   ?   A N D   e m a i l   =   ? ` ) . g e t ( b i z . i d ,   c l i e n t . e m a i l )   a s   a n y ) 
 
 -         :   n u l l ; 
 
 -     i f   ( m a t c h )   c l i e n t I d   =   m a t c h . i d ; 
 
 -     e l s e   { 
 
 -         c o n s t   c r e a t e d   =   d b 
 
 -             . p r e p a r e ( ` I N S E R T   I N T O   c l i e n t s   ( b u s i n e s s _ i d ,   n a m e ,   e m a i l ,   p h o n e ,   t a g s )   V A L U E S   ( ? ,   ? ,   ? ,   ? ,   ' O n l i n e ' )   R E T U R N I N G   i d ` ) 
 
 -             . g e t ( b i z . i d ,   c l i e n t . n a m e ,   c l i e n t . e m a i l   | |   n u l l ,   c l i e n t . p h o n e   | |   n u l l )   a s   a n y ; 
 
 -         c l i e n t I d   =   c r e a t e d . i d ; 
 
 -     } 
 
 +     c o n s t   s t a r t M s   =   s t a r t . g e t T i m e ( ) ; 
 
 +     c o n s t   e n d M s   =   s t a r t M s   +   s e r v i c e . d u r a t i o n _ m i n   *   6 0 0 0 0 ; 
 
   
 
 -     c o n s t   e n d I s o   =   n e w   D a t e ( s t a r t . g e t T i m e ( )   +   s e r v i c e . d u r a t i o n _ m i n   *   6 0 0 0 0 ) . t o I S O S t r i n g ( ) . r e p l a c e ( / \ . \ d { 3 } Z $ / ,   " Z " ) ; 
 
 -     c o n s t   s t a r t I s o   =   s t a r t . t o I S O S t r i n g ( ) . r e p l a c e ( / \ . \ d { 3 } Z $ / ,   " Z " ) ; 
 
 -     c o n s t   a p p t   =   d b 
 
 -         . p r e p a r e ( 
 
 -             ` I N S E R T   I N T O   a p p o i n t m e n t s   ( b u s i n e s s _ i d ,   s e r v i c e _ i d ,   e m p l o y e e _ i d ,   c l i e n t _ i d ,   s t a r t _ a t ,   e n d _ a t ,   s t a t u s ,   p r i c e ,   n o t e s ) 
 
 -               V A L U E S   ( ? ,   ? ,   ? ,   ? ,   ? ,   ? ,   ' s c h e d u l e d ' ,   ? ,   ? )   R E T U R N I N G   * ` 
 
 -         ) 
 
 -         . g e t ( b i z . i d ,   N u m b e r ( s e r v i c e _ i d ) ,   e m p I d ,   c l i e n t I d ,   s t a r t I s o ,   e n d I s o ,   s e r v i c e . p r i c e ,   c l i e n t . n o t e s   | |   " R e s e r v a   o n l i n e " )   a s   a n y ; 
 
 - 
 
 -     r e s . s t a t u s ( 2 0 1 ) . j s o n ( { 
 
 -         a p p o i n t m e n t :   { 
 
 -             i d :   a p p t . i d , 
 
 -             s t a r t _ a t :   a p p t . s t a r t _ a t , 
 
 -             e n d _ a t :   a p p t . e n d _ a t , 
 
 -             p r i c e :   a p p t . p r i c e , 
 
 -             s e r v i c e _ n a m e :   s e r v i c e . n a m e , 
 
 -             e m p l o y e e _ n a m e :   ( d b . p r e p a r e ( ` S E L E C T   n a m e   F R O M   e m p l o y e e s   W H E R E   i d   =   ? ` ) . g e t ( e m p I d )   a s   a n y ) ? . n a m e , 
 
 -         } , 
 
 -         b u s i n e s s :   {   n a m e :   b i z . n a m e ,   c u r r e n c y _ s y m b o l :   b i z . c u r r e n c y _ s y m b o l   } , 
 
 -         c l i e n t _ c r e a t e d :   ! m a t c h , 
 
 -     } ) ; 
 
 +     / /   ,%%E l   c l i e n t e   f o r z %%  e s p e c i a l i s t a ?   S i   a u t o _ a s s i g n _ s p e c i a l i s t = 1 ,   s e   i g n o r a   a l   c l i e n t e   y   s e   a u t o - a s i g n a . 
 
 +     c o n s t   a u t o A s s i g n O n   =   ! ! b i z . a u t o _ a s s i g n _ s p e c i a l i s t ; 
 
 +     c o n s t   c l i e n t C h o s e   =   ! a u t o A s s i g n O n   & &   e m p l o y e e _ i d   ?   N u m b e r ( e m p l o y e e _ i d )   :   n u l l ; 
 
 + 
 
 +     t r y   { 
 
 +         c o n s t   r e s u l t   =   r u n I n T r a n s a c t i o n ( d b ,   ( )   = >   { 
 
 +             / /   1 )   R e s o l v e r   e s p e c i a l i s t a 
 
 +             l e t   e m p I d :   n u m b e r   |   n u l l   =   c l i e n t C h o s e ; 
 
 +             l e t   r e a s o n s :   s t r i n g [ ]   =   [ ] ; 
 
 +             i f   ( ! e m p I d )   { 
 
 +                 c o n s t   b i z W h   =   p a r s e W o r k i n g H o u r s ( b i z . w o r k i n g _ h o u r s )   a s   a n y ; 
 
 +                 c o n s t   a a   =   a u t o A s s i g n ( d b ,   { 
 
 +                     b u s i n e s s I d :   b i z . i d ,   s e r v i c e I d :   s e r v i c e . i d ,   s e r v i c e N a m e :   s e r v i c e . n a m e ,   s e r v i c e C a t e g o r y :   s e r v i c e . c a t e g o r y , 
 
 +                     s t a r t M s ,   e n d M s ,   b i z W h , 
 
 +                 } ) ; 
 
 +                 i f   ( ! a a )   t h r o w   {   s t a t u s :   4 0 9 ,   e r r o r :   " E S E _ H O R A R I O _ O C U P A D O "   } ; 
 
 +                 e m p I d   =   a a . e m p l o y e e I d ; 
 
 +                 r e a s o n s   =   a a . r e a s o n s ; 
 
 +             }   e l s e   { 
 
 +                 / /   v a l i d a r   q u e   o f r e c e   e l   s e r v i c i o 
 
 +                 c o n s t   o k   =   d b . p r e p a r e ( ` S E L E C T   1   F R O M   e m p l o y e e _ s e r v i c e s   W H E R E   s e r v i c e _ i d   =   ?   A N D   e m p l o y e e _ i d   =   ? ` ) . g e t ( s e r v i c e . i d ,   e m p I d ) ; 
 
 +                 i f   ( ! o k )   t h r o w   {   s t a t u s :   4 0 0 ,   e r r o r :   " E l   e s p e c i a l i s t a   n o   o f r e c e   e s t e   s e r v i c i o "   } ; 
 
 +                 / /   g u a r d   a n t i   d o b l e   r e s e r v a 
 
 +                 i f   ( ! i s A v a i l a b l e ( d b ,   e m p I d ,   s t a r t M s ,   e n d M s ) )   t h r o w   {   s t a t u s :   4 0 9 ,   e r r o r :   " E S E _ H O R A R I O _ O C U P A D O "   } ; 
 
 +                 r e a s o n s   =   [ " T u   e s p e c i a l i s t a   e l e g i d o " ] ; 
 
 +             } 
 
 + 
 
 +             / /   2 )   R e s o l v e r   c l i e n t e   ( p o r   p h o n e / e m a i l   o   c r e a r ) 
 
 +             l e t   c l i e n t I d :   n u m b e r   |   n u l l   =   n u l l ; 
 
 +             c o n s t   m a t c h   =   c l i e n t . p h o n e 
 
 +                 ?   ( d b . p r e p a r e ( ` S E L E C T   i d   F R O M   c l i e n t s   W H E R E   b u s i n e s s _ i d   =   ?   A N D   p h o n e   =   ? ` ) . g e t ( b i z . i d ,   c l i e n t . p h o n e )   a s   a n y ) 
 
 +                 :   c l i e n t . e m a i l 
 
 +                 ?   ( d b . p r e p a r e ( ` S E L E C T   i d   F R O M   c l i e n t s   W H E R E   b u s i n e s s _ i d   =   ?   A N D   e m a i l   =   ? ` ) . g e t ( b i z . i d ,   c l i e n t . e m a i l )   a s   a n y ) 
 
 +                 :   n u l l ; 
 
 +             i f   ( m a t c h )   c l i e n t I d   =   m a t c h . i d ; 
 
 +             e l s e   { 
 
 +                 c o n s t   c r e a t e d   =   d b 
 
 +                     . p r e p a r e ( ` I N S E R T   I N T O   c l i e n t s   ( b u s i n e s s _ i d ,   n a m e ,   e m a i l ,   p h o n e ,   t a g s )   V A L U E S   ( ? ,   ? ,   ? ,   ? ,   ' O n l i n e ' )   R E T U R N I N G   i d ` ) 
 
 +                     . g e t ( b i z . i d ,   c l i e n t . n a m e ,   c l i e n t . e m a i l   | |   n u l l ,   c l i e n t . p h o n e   | |   n u l l )   a s   a n y ; 
 
 +                 c l i e n t I d   =   c r e a t e d . i d ; 
 
 +             } 
 
 + 
 
 +             c o n s t   e n d I s o   =   n e w   D a t e ( e n d M s ) . t o I S O S t r i n g ( ) . r e p l a c e ( / \ . \ d { 3 } Z $ / ,   " Z " ) ; 
 
 +             c o n s t   s t a r t I s o   =   n e w   D a t e ( s t a r t M s ) . t o I S O S t r i n g ( ) . r e p l a c e ( / \ . \ d { 3 } Z $ / ,   " Z " ) ; 
 
 +             c o n s t   a p p t   =   d b 
 
 +                 . p r e p a r e ( 
 
 +                     ` I N S E R T   I N T O   a p p o i n t m e n t s   ( b u s i n e s s _ i d ,   s e r v i c e _ i d ,   e m p l o y e e _ i d ,   c l i e n t _ i d ,   s t a r t _ a t ,   e n d _ a t ,   s t a t u s ,   p r i c e ,   n o t e s ) 
 
 +                       V A L U E S   ( ? ,   ? ,   ? ,   ? ,   ? ,   ? ,   ' s c h e d u l e d ' ,   ? ,   ? )   R E T U R N I N G   * ` 
 
 +                 ) 
 
 +                 . g e t ( b i z . i d ,   N u m b e r ( s e r v i c e _ i d ) ,   e m p I d ,   c l i e n t I d ,   s t a r t I s o ,   e n d I s o ,   s e r v i c e . p r i c e ,   c l i e n t . n o t e s   | |   " R e s e r v a   o n l i n e " )   a s   a n y ; 
 
 + 
 
 +             c o n s t   e m p N a m e   =   ( d b . p r e p a r e ( ` S E L E C T   n a m e   F R O M   e m p l o y e e s   W H E R E   i d   =   ? ` ) . g e t ( e m p I d )   a s   a n y ) ? . n a m e ; 
 
 +             r e t u r n   {   a p p t ,   e m p I d :   e m p I d   a s   n u m b e r ,   e m p N a m e ,   r e a s o n s ,   c l i e n t C r e a t e d :   ! m a t c h   } ; 
 
 +         } ) ; 
 
 + 
 
 +         r e s . s t a t u s ( 2 0 1 ) . j s o n ( { 
 
 +             a p p o i n t m e n t :   { 
 
 +                 i d :   r e s u l t . a p p t . i d , 
 
 +                 s t a r t _ a t :   r e s u l t . a p p t . s t a r t _ a t , 
 
 +                 e n d _ a t :   r e s u l t . a p p t . e n d _ a t , 
 
 +                 p r i c e :   r e s u l t . a p p t . p r i c e , 
 
 +                 s e r v i c e _ n a m e :   s e r v i c e . n a m e , 
 
 +                 e m p l o y e e _ i d :   r e s u l t . e m p I d , 
 
 +                 e m p l o y e e _ n a m e :   r e s u l t . e m p N a m e , 
 
 +                 r e a s o n s :   r e s u l t . r e a s o n s , 
 
 +             } , 
 
 +             b u s i n e s s :   {   n a m e :   b i z . n a m e ,   c u r r e n c y _ s y m b o l :   b i z . c u r r e n c y _ s y m b o l   } , 
 
 +             c l i e n t _ c r e a t e d :   r e s u l t . c l i e n t C r e a t e d , 
 
 +         } ) ; 
 
 +     }   c a t c h   ( e :   a n y )   { 
 
 +         i f   ( e   & &   t y p e o f   e   = = =   " o b j e c t "   & &   e . s t a t u s )   { 
 
 +             r e t u r n   r e s . s t a t u s ( e . s t a t u s ) . j s o n ( {   e r r o r :   e . e r r o r   = = =   " E S E _ H O R A R I O _ O C U P A D O "   ?   " E s a   h o r a   a c a b a   d e   o c u p a r s e ,   e l i g e   o t r a . "   :   e . e r r o r   } ) ; 
 
 +         } 
 
 +         t h r o w   e ; 
 
 +     } 
 
   } ) ; 
 
 d i f f   - - g i t   a / s e r v e r / r o u t e s / e m p l o y e e s . t s   b / s e r v e r / r o u t e s / e m p l o y e e s . t s 
 
 i n d e x   a b d 5 e 7 7 . . 0 0 4 6 8 d e   1 0 0 6 4 4 
 
 - - -   a / s e r v e r / r o u t e s / e m p l o y e e s . t s 
 
 + + +   b / s e r v e r / r o u t e s / e m p l o y e e s . t s 
 
 @ @   - 7 3 , 1 1   + 7 3 , 1 2   @ @   e m p l o y e e s R o u t e r . g e t ( " / : i d " ,   ( r e q :   A u t h e d R e q u e s t ,   r e s )   = >   { 
 
   } ) ; 
 
   
 
   e m p l o y e e s R o u t e r . p o s t ( " / " ,   o w n e r O n l y ,   ( r e q :   A u t h e d R e q u e s t ,   r e s )   = >   { 
 
 -     c o n s t   {   n a m e ,   r o l e ,   e m a i l ,   p h o n e ,   c o l o r ,   s e r v i c e _ i d s   }   =   r e q . b o d y   ? ?   { } ; 
 
 +     c o n s t   {   n a m e ,   r o l e ,   e m a i l ,   p h o n e ,   c o l o r ,   s e r v i c e _ i d s ,   s p e c i a l t i e s ,   w o r k i n g _ h o u r s ,   e f f i c i e n c y _ s c o r e   }   =   r e q . b o d y   ? ?   { } ; 
 
       i f   ( ! n a m e )   r e t u r n   e r r ( r e s ,   4 0 0 ,   " E l   n o m b r e   e s   o b l i g a t o r i o " ) ; 
 
       c o n s t   r   =   d b 
 
           . p r e p a r e ( 
 
 -             ` I N S E R T   I N T O   e m p l o y e e s   ( b u s i n e s s _ i d ,   n a m e ,   r o l e ,   e m a i l ,   p h o n e ,   c o l o r )   V A L U E S   ( ? ,   ? ,   ? ,   ? ,   ? ,   ? )   R E T U R N I N G   * ` 
 
 +             ` I N S E R T   I N T O   e m p l o y e e s   ( b u s i n e s s _ i d ,   n a m e ,   r o l e ,   e m a i l ,   p h o n e ,   c o l o r ,   s p e c i a l t i e s ,   w o r k i n g _ h o u r s ,   e f f i c i e n c y _ s c o r e ) 
 
 +               V A L U E S   ( ? ,   ? ,   ? ,   ? ,   ? ,   ? ,   ? ,   ? ,   ? )   R E T U R N I N G   * ` 
 
           ) 
 
           . g e t ( 
 
               r e q . u s e r ! . b u s i n e s s _ i d , 
 
 @ @   - 8 5 , 7   + 8 6 , 1 0   @ @   e m p l o y e e s R o u t e r . p o s t ( " / " ,   o w n e r O n l y ,   ( r e q :   A u t h e d R e q u e s t ,   r e s )   = >   { 
 
               r o l e   | |   " E s p e c i a l i s t a " , 
 
               e m a i l   | |   n u l l , 
 
               p h o n e   | |   n u l l , 
 
 -             c o l o r   | |   " # 3 b 6 6 f f " 
 
 +             c o l o r   | |   " # 3 b 6 6 f f " , 
 
 +             J S O N . s t r i n g i f y ( A r r a y . i s A r r a y ( s p e c i a l t i e s )   ?   s p e c i a l t i e s   :   [ ] ) , 
 
 +             w o r k i n g _ h o u r s   ?   ( t y p e o f   w o r k i n g _ h o u r s   = = =   " s t r i n g "   ?   w o r k i n g _ h o u r s   :   J S O N . s t r i n g i f y ( w o r k i n g _ h o u r s ) )   :   n u l l , 
 
 +             t y p e o f   e f f i c i e n c y _ s c o r e   = = =   " n u m b e r "   ?   e f f i c i e n c y _ s c o r e   :   5 0 
 
           )   a s   a n y ; 
 
       i f   ( A r r a y . i s A r r a y ( s e r v i c e _ i d s ) )   { 
 
           c o n s t   i n s   =   d b . p r e p a r e ( ` I N S E R T   O R   I G N O R E   I N T O   e m p l o y e e _ s e r v i c e s   ( e m p l o y e e _ i d ,   s e r v i c e _ i d )   V A L U E S   ( ? ,   ? ) ` ) ; 
 
 @ @   - 9 8 , 1 1   + 1 0 2 , 9   @ @   e m p l o y e e s R o u t e r . p o s t ( " / " ,   o w n e r O n l y ,   ( r e q :   A u t h e d R e q u e s t ,   r e s )   = >   { 
 
   
 
   e m p l o y e e s R o u t e r . p a t c h ( " / : i d " ,   o w n e r O n l y ,   ( r e q :   A u t h e d R e q u e s t ,   r e s )   = >   { 
 
       c o n s t   i d   =   N u m b e r ( r e q . p a r a m s . i d ) ; 
 
 -     c o n s t   e x i s t i n g   =   d b 
 
 -         . p r e p a r e ( ` S E L E C T   *   F R O M   e m p l o y e e s   W H E R E   i d   =   ?   A N D   b u s i n e s s _ i d   =   ? ` ) 
 
 -         . g e t ( i d ,   r e q . u s e r ! . b u s i n e s s _ i d   a s   n u m b e r )   a s   a n y ; 
 
 +     c o n s t   e x i s t i n g   =   d b . p r e p a r e ( ` S E L E C T   *   F R O M   e m p l o y e e s   W H E R E   i d   =   ?   A N D   b u s i n e s s _ i d   =   ? ` ) . g e t ( i d ,   r e q . u s e r ! . b u s i n e s s _ i d   a s   n u m b e r )   a s   a n y ; 
 
       i f   ( ! e x i s t i n g )   r e t u r n   e r r ( r e s ,   4 0 4 ,   " E m p l e a d o   n o   e n c o n t r a d o " ) ; 
 
 -     c o n s t   {   n a m e ,   r o l e ,   e m a i l ,   p h o n e ,   c o l o r ,   a c t i v e ,   s e r v i c e _ i d s   }   =   r e q . b o d y   ? ?   { } ; 
 
 +     c o n s t   {   n a m e ,   r o l e ,   e m a i l ,   p h o n e ,   c o l o r ,   a c t i v e ,   s e r v i c e _ i d s ,   s p e c i a l t i e s ,   w o r k i n g _ h o u r s ,   e f f i c i e n c y _ s c o r e   }   =   r e q . b o d y   ? ?   { } ; 
 
       c o n s t   m e r g e d   =   { 
 
           n a m e :   n a m e   ? ?   e x i s t i n g . n a m e , 
 
           r o l e :   r o l e   ? ?   e x i s t i n g . r o l e , 
 
 @ @   - 1 1 0 , 1 0   + 1 1 2 , 1 7   @ @   e m p l o y e e s R o u t e r . p a t c h ( " / : i d " ,   o w n e r O n l y ,   ( r e q :   A u t h e d R e q u e s t ,   r e s )   = >   { 
 
           p h o n e :   p h o n e   ? ?   e x i s t i n g . p h o n e , 
 
           c o l o r :   c o l o r   ? ?   e x i s t i n g . c o l o r , 
 
           a c t i v e :   a c t i v e   = = =   u n d e f i n e d   ?   e x i s t i n g . a c t i v e   :   a c t i v e   ?   1   :   0 , 
 
 +         s p e c i a l t i e s :   s p e c i a l t i e s   ! = =   u n d e f i n e d 
 
 +             ?   ( t y p e o f   s p e c i a l t i e s   = = =   " s t r i n g "   ?   s p e c i a l t i e s   :   J S O N . s t r i n g i f y ( A r r a y . i s A r r a y ( s p e c i a l t i e s )   ?   s p e c i a l t i e s   :   [ ] ) ) 
 
 +             :   e x i s t i n g . s p e c i a l t i e s , 
 
 +         w o r k i n g _ h o u r s :   w o r k i n g _ h o u r s   ! = =   u n d e f i n e d 
 
 +             ?   ( w o r k i n g _ h o u r s   = = =   n u l l   ?   n u l l   :   t y p e o f   w o r k i n g _ h o u r s   = = =   " s t r i n g "   ?   w o r k i n g _ h o u r s   :   J S O N . s t r i n g i f y ( w o r k i n g _ h o u r s ) ) 
 
 +             :   e x i s t i n g . w o r k i n g _ h o u r s , 
 
 +         e f f i c i e n c y _ s c o r e :   e f f i c i e n c y _ s c o r e   ! = =   u n d e f i n e d   ?   N u m b e r ( e f f i c i e n c y _ s c o r e )   :   ( e x i s t i n g . e f f i c i e n c y _ s c o r e   ? ?   5 0 ) , 
 
       } ; 
 
       d b . p r e p a r e ( 
 
 -         ` U P D A T E   e m p l o y e e s   S E T   n a m e   =   ? ,   r o l e   =   ? ,   e m a i l   =   ? ,   p h o n e   =   ? ,   c o l o r   =   ? ,   a c t i v e   =   ?   W H E R E   i d   =   ? ` 
 
 -     ) . r u n ( m e r g e d . n a m e ,   m e r g e d . r o l e ,   m e r g e d . e m a i l ,   m e r g e d . p h o n e ,   m e r g e d . c o l o r ,   m e r g e d . a c t i v e ,   i d ) ; 
 
 +         ` U P D A T E   e m p l o y e e s   S E T   n a m e   =   ? ,   r o l e   =   ? ,   e m a i l   =   ? ,   p h o n e   =   ? ,   c o l o r   =   ? ,   a c t i v e   =   ? ,   s p e c i a l t i e s   =   ? ,   w o r k i n g _ h o u r s   =   ? ,   e f f i c i e n c y _ s c o r e   =   ?   W H E R E   i d   =   ? ` 
 
 +     ) . r u n ( m e r g e d . n a m e ,   m e r g e d . r o l e ,   m e r g e d . e m a i l ,   m e r g e d . p h o n e ,   m e r g e d . c o l o r ,   m e r g e d . a c t i v e ,   m e r g e d . s p e c i a l t i e s ,   m e r g e d . w o r k i n g _ h o u r s ,   m e r g e d . e f f i c i e n c y _ s c o r e ,   i d ) ; 
 
       i f   ( A r r a y . i s A r r a y ( s e r v i c e _ i d s ) )   { 
 
           d b . p r e p a r e ( ` D E L E T E   F R O M   e m p l o y e e _ s e r v i c e s   W H E R E   e m p l o y e e _ i d   =   ? ` ) . r u n ( i d ) ; 
 
           c o n s t   i n s   =   d b . p r e p a r e ( ` I N S E R T   O R   I G N O R E   I N T O   e m p l o y e e _ s e r v i c e s   ( e m p l o y e e _ i d ,   s e r v i c e _ i d )   V A L U E S   ( ? ,   ? ) ` ) ; 
 
 d i f f   - - g i t   a / s e r v e r / r o u t e s / s e t t i n g s . t s   b / s e r v e r / r o u t e s / s e t t i n g s . t s 
 
 i n d e x   3 7 4 8 3 b 4 . . c 5 7 1 d 2 c   1 0 0 6 4 4 
 
 - - -   a / s e r v e r / r o u t e s / s e t t i n g s . t s 
 
 + + +   b / s e r v e r / r o u t e s / s e t t i n g s . t s 
 
 @ @   - 1 7 , 1 3   + 1 7 , 1 6   @ @   c o n s t   F I E L D S   =   [ 
 
       " r e q u i r e _ d e p o s i t " , 
 
       " d e p o s i t _ p c t " , 
 
       " t i m e z o n e " , 
 
 +     " a u t o _ a s s i g n _ s p e c i a l i s t " , 
 
 +     " w o r k i n g _ h o u r s " , 
 
   ]   a s   c o n s t ; 
 
   
 
   s e t t i n g s R o u t e r . g e t ( " / " ,   ( r e q :   A u t h e d R e q u e s t ,   r e s )   = >   { 
 
       c o n s t   b   =   d b 
 
           . p r e p a r e ( 
 
               ` S E L E C T   i d ,   n a m e ,   i n d u s t r y ,   c u r r e n c y ,   c u r r e n c y _ s y m b o l ,   p h o n e ,   a d d r e s s ,   s l u g ,   b o o k i n g _ e n a b l e d , 
 
 -                             c a n c e l _ w i n d o w _ h o u r s ,   c a n c e l _ p e n a l t y _ p c t ,   r e q u i r e _ d e p o s i t ,   d e p o s i t _ p c t ,   t i m e z o n e 
 
 +                             c a n c e l _ w i n d o w _ h o u r s ,   c a n c e l _ p e n a l t y _ p c t ,   r e q u i r e _ d e p o s i t ,   d e p o s i t _ p c t ,   t i m e z o n e , 
 
 +                             a u t o _ a s s i g n _ s p e c i a l i s t ,   w o r k i n g _ h o u r s 
 
                 F R O M   b u s i n e s s e s   W H E R E   i d   =   ? ` 
 
           ) 
 
           . g e t ( r e q . u s e r ! . b u s i n e s s _ i d )   a s   a n y ; 
 
 @ @   - 3 9 , 6   + 4 2 , 1 2   @ @   s e t t i n g s R o u t e r . p a t c h ( " / " ,   o w n e r O n l y ,   ( r e q :   A u t h e d R e q u e s t ,   r e s )   = >   { 
 
       f o r   ( c o n s t   f   o f   F I E L D S )   { 
 
           i f   ( b o d y [ f ]   ! = =   u n d e f i n e d )   m e r g e d [ f ]   =   b o d y [ f ] ; 
 
       } 
 
 +     i f   ( m e r g e d . w o r k i n g _ h o u r s   & &   t y p e o f   m e r g e d . w o r k i n g _ h o u r s   ! = =   " s t r i n g " )   { 
 
 +         m e r g e d . w o r k i n g _ h o u r s   =   J S O N . s t r i n g i f y ( m e r g e d . w o r k i n g _ h o u r s ) ; 
 
 +     } 
 
 +     i f   ( m e r g e d . a u t o _ a s s i g n _ s p e c i a l i s t   ! = =   u n d e f i n e d )   { 
 
 +         m e r g e d . a u t o _ a s s i g n _ s p e c i a l i s t   =   m e r g e d . a u t o _ a s s i g n _ s p e c i a l i s t   ?   1   :   0 ; 
 
 +     } 
 
       / /   s l u g   u n i q u e n e s s   c h e c k 
 
       i f   ( m e r g e d . s l u g   ! = =   u n d e f i n e d )   { 
 
           m e r g e d . s l u g   =   S t r i n g ( m e r g e d . s l u g ) . t r i m ( ) . t o L o w e r C a s e ( ) . r e p l a c e ( / [ ^ a - z 0 - 9 - ] / g ,   " - " ) . r e p l a c e ( / - + / g ,   " - " ) . r e p l a c e ( / ^ - | - $ / g ,   " " ) ; 
 
 @ @   - 5 1 , 7   + 6 0 , 7   @ @   s e t t i n g s R o u t e r . p a t c h ( " / " ,   o w n e r O n l y ,   ( r e q :   A u t h e d R e q u e s t ,   r e s )   = >   { 
 
       m e r g e d . i d   =   r e q . u s e r ! . b u s i n e s s _ i d ; 
 
       d b . p r e p a r e ( ` U P D A T E   b u s i n e s s e s   S E T   $ { s e t s . j o i n ( " ,   " ) }   W H E R E   i d   =   @ i d ` ) . r u n ( m e r g e d ) ; 
 
       c o n s t   u p d a t e d   =   d b 
 
 -         . p r e p a r e ( ` S E L E C T   i d ,   n a m e ,   i n d u s t r y ,   c u r r e n c y ,   c u r r e n c y _ s y m b o l ,   p h o n e ,   a d d r e s s ,   s l u g ,   b o o k i n g _ e n a b l e d ,   c a n c e l _ w i n d o w _ h o u r s ,   c a n c e l _ p e n a l t y _ p c t ,   r e q u i r e _ d e p o s i t ,   d e p o s i t _ p c t ,   t i m e z o n e   F R O M   b u s i n e s s e s   W H E R E   i d   =   ? ` ) 
 
 +         . p r e p a r e ( ` S E L E C T   i d ,   n a m e ,   i n d u s t r y ,   c u r r e n c y ,   c u r r e n c y _ s y m b o l ,   p h o n e ,   a d d r e s s ,   s l u g ,   b o o k i n g _ e n a b l e d ,   c a n c e l _ w i n d o w _ h o u r s ,   c a n c e l _ p e n a l t y _ p c t ,   r e q u i r e _ d e p o s i t ,   d e p o s i t _ p c t ,   t i m e z o n e ,   a u t o _ a s s i g n _ s p e c i a l i s t ,   w o r k i n g _ h o u r s   F R O M   b u s i n e s s e s   W H E R E   i d   =   ? ` ) 
 
           . g e t ( r e q . u s e r ! . b u s i n e s s _ i d ) ; 
 
       r e s . j s o n ( {   s e t t i n g s :   u p d a t e d   } ) ; 
 
   } ) ; 
 
 d i f f   - - g i t   a / s h a r e d / t y p e s . t s   b / s h a r e d / t y p e s . t s 
 
 i n d e x   7 9 9 8 6 5 8 . . 6 7 e c 7 3 9   1 0 0 6 4 4 
 
 - - -   a / s h a r e d / t y p e s . t s 
 
 + + +   b / s h a r e d / t y p e s . t s 
 
 @ @   - 1 4 , 9   + 1 4 , 2 0   @ @   e x p o r t   i n t e r f a c e   B u s i n e s s   { 
 
       s t a t u s ? :   s t r i n g ; 
 
       t e m p l a t e ? :   s t r i n g   |   n u l l ; 
 
       t r i a l _ e n d s _ a t ? :   s t r i n g   |   n u l l ; 
 
 +     b o o k i n g _ e n a b l e d ? :   n u m b e r   |   b o o l e a n ; 
 
 +     c a n c e l _ w i n d o w _ h o u r s ? :   n u m b e r ; 
 
 +     c a n c e l _ p e n a l t y _ p c t ? :   n u m b e r ; 
 
 +     r e q u i r e _ d e p o s i t ? :   n u m b e r   |   b o o l e a n ; 
 
 +     d e p o s i t _ p c t ? :   n u m b e r ; 
 
 +     t i m e z o n e ? :   s t r i n g ; 
 
 +     a u t o _ a s s i g n _ s p e c i a l i s t ? :   n u m b e r   |   b o o l e a n ; 
 
 +     w o r k i n g _ h o u r s ? :   W o r k i n g H o u r s M a p   |   s t r i n g   |   n u l l ; 
 
       c r e a t e d _ a t ? :   s t r i n g ; 
 
   } 
 
   
 
 + e x p o r t   t y p e   W o r k i n g D a y   =   {   s t a r t :   s t r i n g ;   e n d :   s t r i n g   } ; 
 
 + e x p o r t   t y p e   W o r k i n g H o u r s M a p   =   R e c o r d < n u m b e r ,   W o r k i n g D a y   |   n u l l > ;   / /   1 = L u n        7 = D o m 
 
 + 
 
   e x p o r t   i n t e r f a c e   U s e r   { 
 
       i d :   n u m b e r ; 
 
       b u s i n e s s _ i d :   n u m b e r   |   n u l l ; 
 
 @ @   - 3 9 , 6   + 5 0 , 9   @ @   e x p o r t   i n t e r f a c e   E m p l o y e e   { 
 
       r a t i n g :   n u m b e r ; 
 
       h i r e _ d a t e :   s t r i n g   |   n u l l ; 
 
       s e r v i c e _ i d s ? :   n u m b e r [ ] ; 
 
 +     s p e c i a l t i e s ? :   s t r i n g [ ] ; 
 
 +     w o r k i n g _ h o u r s ? :   W o r k i n g H o u r s M a p   |   s t r i n g   |   n u l l ; 
 
 +     e f f i c i e n c y _ s c o r e ? :   n u m b e r ; 
 
       s t a t s ? :   E m p l o y e e S t a t s ; 
 
   } 
 
   
 
 d i f f   - - g i t   a / s r c / i n d e x . c s s   b / s r c / i n d e x . c s s 
 
 i n d e x   f 5 6 2 a 6 f . . 8 e 4 f 8 9 e   1 0 0 6 4 4 
 
 - - -   a / s r c / i n d e x . c s s 
 
 + + +   b / s r c / i n d e x . c s s 
 
 @ @   - 1 3 6 , 6   + 1 3 6 , 7   @ @   b o d y   { 
 
       f o n t - w e i g h t :   6 0 0   ! i m p o r t a n t ; 
 
       c u r s o r :   p o i n t e r ; 
 
       t r a n s i t i o n :   t r a n s f o r m   0 . 1 2 s ,   b o x - s h a d o w   0 . 1 2 s ; 
 
 +     o v e r f l o w :   h i d d e n ; 
 
   } 
 
   . f c - e v e n t : h o v e r   { 
 
       t r a n s f o r m :   t r a n s l a t e Y ( - 1 p x ) ; 
 
 @ @   - 1 4 9 , 6   + 1 5 0 , 1 6   @ @   b o d y   { 
 
   } 
 
   . f c - t i m e g r i d - e v e n t   { 
 
       o v e r f l o w :   h i d d e n ; 
 
 +     b o x - s h a d o w :   i n s e t   0   0   0   1 p x   r g b a ( 2 5 5 ,   2 5 5 ,   2 5 5 ,   0 . 3 5 ) ; 
 
 + } 
 
 + . f c - t i m e g r i d - e v e n t - h a r n e s s   { 
 
 +     m a r g i n - r i g h t :   2 p x   ! i m p o r t a n t ; 
 
 + } 
 
 + / *   W h e n   s l o t E v e n t O v e r l a p   i s   f a l s e ,   F u l l C a l e n d a r   p u t s   a   s m a l l   g a p   b e t w e e n 
 
 +       s i d e - b y - s i d e   e v e n t s ;   t i g h t e n   i t   a   t o u c h   s o   e a c h   e v e n t   g e t s   m o r e   r e a d a b l e 
 
 +       w i d t h   w i t h o u t   b l e e d i n g   i n t o   i t s   n e i g h b o u r .   * / 
 
 + . f c   . f c - t i m e g r i d - c o l - e v e n t s   { 
 
 +     c o l u m n - g a p :   2 p x ; 
 
   } 
 
   
 
   / *   L i s t   v i e w   ( g r e a t   o n   m o b i l e )   * / 
 
 @ @   - 2 5 8 , 2 4   + 2 6 9 , 2 6   @ @   b o d y   { 
 
       b a c k g r o u n d :   # f e c a c a ; 
 
   } 
 
   
 
 - . i n p u t , 
 
 - . s e l e c t , 
 
 - . t e x t a r e a   { 
 
 -     w i d t h :   1 0 0 % ; 
 
 -     b a c k g r o u n d :   # f f f f f f ; 
 
 -     b o r d e r :   1 p x   s o l i d   # e 5 e 7 e b ; 
 
 -     b o r d e r - r a d i u s :   0 . 6 5 r e m ; 
 
 -     p a d d i n g :   0 . 5 5 r e m   0 . 7 5 r e m ; 
 
 -     f o n t - s i z e :   0 . 8 7 5 r e m ; 
 
 -     c o l o r :   # 0 f 1 7 2 a ; 
 
 -     t r a n s i t i o n :   b o r d e r - c o l o r   0 . 1 5 s ,   b o x - s h a d o w   0 . 1 5 s ; 
 
 -     o u t l i n e :   n o n e ; 
 
 - } 
 
 - . i n p u t : f o c u s , 
 
 - . s e l e c t : f o c u s , 
 
 - . t e x t a r e a : f o c u s   { 
 
 -     b o r d e r - c o l o r :   # 3 b 6 6 f f ; 
 
 -     b o x - s h a d o w :   0   0   0   3 p x   r g b a ( 5 9 ,   1 0 2 ,   2 5 5 ,   0 . 1 5 ) ; 
 
 + @ l a y e r   c o m p o n e n t s   { 
 
 +     . i n p u t , 
 
 +     . s e l e c t , 
 
 +     . t e x t a r e a   { 
 
 +         w i d t h :   1 0 0 % ; 
 
 +         b a c k g r o u n d :   # f f f f f f ; 
 
 +         b o r d e r :   1 p x   s o l i d   # e 5 e 7 e b ; 
 
 +         b o r d e r - r a d i u s :   0 . 6 5 r e m ; 
 
 +         p a d d i n g :   0 . 5 5 r e m   0 . 7 5 r e m ; 
 
 +         f o n t - s i z e :   0 . 8 7 5 r e m ; 
 
 +         c o l o r :   # 0 f 1 7 2 a ; 
 
 +         t r a n s i t i o n :   b o r d e r - c o l o r   0 . 1 5 s ,   b o x - s h a d o w   0 . 1 5 s ; 
 
 +         o u t l i n e :   n o n e ; 
 
 +     } 
 
 +     . i n p u t : f o c u s , 
 
 +     . s e l e c t : f o c u s , 
 
 +     . t e x t a r e a : f o c u s   { 
 
 +         b o r d e r - c o l o r :   # 3 b 6 6 f f ; 
 
 +         b o x - s h a d o w :   0   0   0   3 p x   r g b a ( 5 9 ,   1 0 2 ,   2 5 5 ,   0 . 1 5 ) ; 
 
 +     } 
 
   } 
 
   . l a b e l   { 
 
       d i s p l a y :   b l o c k ; 
 
 d i f f   - - g i t   a / s r c / l i b / p u b l i c A p i . t s   b / s r c / l i b / p u b l i c A p i . t s 
 
 i n d e x   a b a 5 0 1 c . . 0 4 f 5 5 0 3   1 0 0 6 4 4 
 
 - - -   a / s r c / l i b / p u b l i c A p i . t s 
 
 + + +   b / s r c / l i b / p u b l i c A p i . t s 
 
 @ @   - 1 2 , 6   + 1 2 , 7   @ @   e x p o r t   i n t e r f a c e   P u b l i c B u s i n e s s   { 
 
       c a n c e l _ p e n a l t y _ p c t :   n u m b e r ; 
 
       r e q u i r e _ d e p o s i t :   b o o l e a n ; 
 
       d e p o s i t _ p c t :   n u m b e r ; 
 
 +     a u t o _ a s s i g n _ s p e c i a l i s t :   n u m b e r   |   b o o l e a n ; 
 
   } 
 
   
 
   e x p o r t   i n t e r f a c e   P u b l i c S e r v i c e   { 
 
 @ @   - 5 8 , 7   + 5 9 , 7   @ @   e x p o r t   i n t e r f a c e   B o o k C l i e n t   { 
 
   
 
   e x p o r t   i n t e r f a c e   B o o k P a y l o a d   { 
 
       s e r v i c e _ i d :   n u m b e r ; 
 
 -     e m p l o y e e _ i d :   n u m b e r ; 
 
 +     e m p l o y e e _ i d ? :   n u m b e r ; 
 
       s t a r t _ a t :   s t r i n g ; 
 
       c l i e n t :   B o o k C l i e n t ; 
 
   } 
 
 @ @   - 6 9 , 7   + 7 0 , 9   @ @   e x p o r t   i n t e r f a c e   B o o k R e s p o n s e   { 
 
           s t a r t _ a t :   s t r i n g ; 
 
           p r i c e :   n u m b e r ; 
 
           s e r v i c e _ n a m e :   s t r i n g ; 
 
 +         e m p l o y e e _ i d :   n u m b e r ; 
 
           e m p l o y e e _ n a m e :   s t r i n g ; 
 
 +         r e a s o n s :   s t r i n g [ ] ; 
 
       } ; 
 
       b u s i n e s s :   {   n a m e :   s t r i n g ;   c u r r e n c y _ s y m b o l :   s t r i n g   } ; 
 
       c l i e n t _ c r e a t e d :   b o o l e a n ; 
 
 d i f f   - - g i t   a / s r c / p a g e s / E m p l o y e e s P a g e . t s x   b / s r c / p a g e s / E m p l o y e e s P a g e . t s x 
 
 i n d e x   2 d 9 4 4 6 2 . . d c 4 1 b f c   1 0 0 6 4 4 
 
 - - -   a / s r c / p a g e s / E m p l o y e e s P a g e . t s x 
 
 + + +   b / s r c / p a g e s / E m p l o y e e s P a g e . t s x 
 
 @ @   - 1 6 , 6   + 1 6 , 7   @ @   i m p o r t   t y p e   {   E m p l o y e e   }   f r o m   " . . / . . / s h a r e d / t y p e s " ; 
 
   i m p o r t   {   P a g e H e a d e r ,   A v a t a r ,   S p i n n e r ,   E m p t y S t a t e   }   f r o m   " . . / c o m p o n e n t s / u i " ; 
 
   i m p o r t   {   M o d a l   }   f r o m   " . . / c o m p o n e n t s / M o d a l " ; 
 
   i m p o r t   {   f o r m a t C u r r e n c y ,   c n   }   f r o m   " . . / l i b / f o r m a t " ; 
 
 + i m p o r t   {   D E F A U L T _ W H ,   D A Y S ,   p a r s e W h   }   f r o m   " . . / l i b / w o r k i n g H o u r s " ; 
 
   
 
   c o n s t   C O L O R S   =   [ " # 3 b 6 6 f f " ,   " # f 1 7 6 1 6 " ,   " # 1 0 b 9 8 1 " ,   " # a 8 5 5 f 7 " ,   " # e c 4 8 9 9 " ,   " # 1 4 b 8 a 6 " ,   " # f 5 9 e 0 b " ,   " # 6 3 6 6 f 1 " ] ; 
 
   
 
 @ @   - 1 9 3 , 6   + 1 9 4 , 1 1   @ @   f u n c t i o n   E m p l o y e e M o d a l ( { 
 
       c o n s t   [ c o l o r ,   s e t C o l o r ]   =   u s e S t a t e ( C O L O R S [ 0 ] ) ; 
 
       c o n s t   [ a c t i v e ,   s e t A c t i v e ]   =   u s e S t a t e ( t r u e ) ; 
 
       c o n s t   [ s v c I d s ,   s e t S v c I d s ]   =   u s e S t a t e < n u m b e r [ ] > ( [ ] ) ; 
 
 +     c o n s t   [ s p e c i a l t i e s ,   s e t S p e c i a l t i e s ]   =   u s e S t a t e < s t r i n g [ ] > ( [ ] ) ; 
 
 +     c o n s t   [ s p e c i a l t y I n p u t ,   s e t S p e c i a l t y I n p u t ]   =   u s e S t a t e ( " " ) ; 
 
 +     c o n s t   [ e f f i c i e n c y ,   s e t E f f i c i e n c y ]   =   u s e S t a t e ( 5 0 ) ; 
 
 +     c o n s t   [ i n h e r i t H o u r s ,   s e t I n h e r i t H o u r s ]   =   u s e S t a t e ( t r u e ) ; 
 
 +     c o n s t   [ w h ,   s e t W h ]   =   u s e S t a t e < R e c o r d < n u m b e r ,   {   s t a r t :   s t r i n g ;   e n d :   s t r i n g   }   |   n u l l > > ( {   . . . D E F A U L T _ W H   } ) ; 
 
   
 
       u s e E f f e c t ( ( )   = >   { 
 
           i f   ( ! o p e n )   r e t u r n ; 
 
 @ @   - 2 0 4 , 6   + 2 1 0 , 1 2   @ @   f u n c t i o n   E m p l o y e e M o d a l ( { 
 
               s e t C o l o r ( e m p l o y e e . c o l o r ) ; 
 
               s e t A c t i v e ( ! ! e m p l o y e e . a c t i v e ) ; 
 
               s e t S v c I d s ( e m p l o y e e . s e r v i c e _ i d s   ? ?   [ ] ) ; 
 
 +             s e t S p e c i a l t i e s ( A r r a y . i s A r r a y ( e m p l o y e e . s p e c i a l t i e s )   ?   e m p l o y e e . s p e c i a l t i e s   :   [ ] ) ; 
 
 +             s e t E f f i c i e n c y ( t y p e o f   e m p l o y e e . e f f i c i e n c y _ s c o r e   = = =   " n u m b e r "   ?   e m p l o y e e . e f f i c i e n c y _ s c o r e   :   5 0 ) ; 
 
 +             c o n s t   p a r s e d   =   p a r s e W h ( e m p l o y e e . w o r k i n g _ h o u r s ) ; 
 
 +             c o n s t   h a s O w n   =   ! ! e m p l o y e e . w o r k i n g _ h o u r s   & &   O b j e c t . v a l u e s ( p a r s e d ) . s o m e ( ( v )   = >   v   ! = =   n u l l ) ; 
 
 +             s e t I n h e r i t H o u r s ( ! h a s O w n ) ; 
 
 +             s e t W h ( h a s O w n   ?   p a r s e d   :   {   . . . D E F A U L T _ W H   } ) ; 
 
           }   e l s e   { 
 
               s e t N a m e ( " " ) ; 
 
               s e t R o l e ( " E s p e c i a l i s t a " ) ; 
 
 @ @   - 2 1 2 , 1 2   + 2 2 4 , 2 8   @ @   f u n c t i o n   E m p l o y e e M o d a l ( { 
 
               s e t C o l o r ( C O L O R S [ M a t h . f l o o r ( M a t h . r a n d o m ( )   *   C O L O R S . l e n g t h ) ] ) ; 
 
               s e t A c t i v e ( t r u e ) ; 
 
               s e t S v c I d s ( [ ] ) ; 
 
 +             s e t S p e c i a l t i e s ( [ ] ) ; 
 
 +             s e t S p e c i a l t y I n p u t ( " " ) ; 
 
 +             s e t E f f i c i e n c y ( 5 0 ) ; 
 
 +             s e t I n h e r i t H o u r s ( t r u e ) ; 
 
 +             s e t W h ( {   . . . D E F A U L T _ W H   } ) ; 
 
           } 
 
       } ,   [ o p e n ,   e m p l o y e e ] ) ; 
 
   
 
       c o n s t   m u t   =   u s e M u t a t i o n ( { 
 
           m u t a t i o n F n :   a s y n c   ( )   = >   { 
 
 -             c o n s t   p a y l o a d   =   {   n a m e ,   r o l e ,   e m a i l ,   p h o n e ,   c o l o r ,   a c t i v e ,   s e r v i c e _ i d s :   s v c I d s   } ; 
 
 +             c o n s t   p a y l o a d   =   { 
 
 +                 n a m e , 
 
 +                 r o l e , 
 
 +                 e m a i l , 
 
 +                 p h o n e , 
 
 +                 c o l o r , 
 
 +                 a c t i v e , 
 
 +                 s e r v i c e _ i d s :   s v c I d s , 
 
 +                 s p e c i a l t i e s , 
 
 +                 e f f i c i e n c y _ s c o r e :   e f f i c i e n c y , 
 
 +                 w o r k i n g _ h o u r s :   i n h e r i t H o u r s   ?   n u l l   :   w h , 
 
 +             } ; 
 
               i f   ( e m p l o y e e )   r e t u r n   a p i . e m p l o y e e s . u p d a t e ( e m p l o y e e . i d ,   p a y l o a d ) ; 
 
               r e t u r n   a p i . e m p l o y e e s . c r e a t e ( p a y l o a d ) ; 
 
           } , 
 
 @ @   - 3 0 3 , 6   + 3 3 1 , 1 0 7   @ @   f u n c t i o n   E m p l o y e e M o d a l ( { 
 
                           } ) } 
 
                       < / d i v > 
 
                   < / d i v > 
 
 +                 < d i v > 
 
 +                     < l a b e l   c l a s s N a m e = " l a b e l " > E s p e c i a l i d a d e s < / l a b e l > 
 
 +                     < d i v   c l a s s N a m e = " f l e x   f l e x - w r a p   i t e m s - c e n t e r   g a p - 1 . 5   r o u n d e d - x l   b o r d e r   b o r d e r - s l a t e - 1 0 0   p - 2 " > 
 
 +                         { s p e c i a l t i e s . m a p ( ( s p )   = >   ( 
 
 +                             < s p a n   k e y = { s p }   c l a s s N a m e = " c h i p   b g - b r a n d - 5 0   t e x t - b r a n d - 7 0 0 " > 
 
 +                                 { s p } 
 
 +                                 < b u t t o n 
 
 +                                     t y p e = " b u t t o n " 
 
 +                                     o n C l i c k = { ( )   = >   s e t S p e c i a l t i e s ( ( a )   = >   a . f i l t e r ( ( x )   = >   x   ! = =   s p ) ) } 
 
 +                                     c l a s s N a m e = " m l - 0 . 5   t e x t - b r a n d - 4 0 0   h o v e r : t e x t - b r a n d - 7 0 0 " 
 
 +                                 > 
 
 +                                     % 
 
 +                                 < / b u t t o n > 
 
 +                             < / s p a n > 
 
 +                         ) ) } 
 
 +                         < i n p u t 
 
 +                             c l a s s N a m e = " m i n - w - [ 1 2 0 p x ]   f l e x - 1   b g - t r a n s p a r e n t   t e x t - s m   o u t l i n e - n o n e " 
 
 +                             p l a c e h o l d e r = " E j .   C o l o r a c i %%n   y   p u l s a   E n t e r " 
 
 +                             v a l u e = { s p e c i a l t y I n p u t } 
 
 +                             o n C h a n g e = { ( e )   = >   s e t S p e c i a l t y I n p u t ( e . t a r g e t . v a l u e ) } 
 
 +                             o n K e y D o w n = { ( e )   = >   { 
 
 +                                 i f   ( e . k e y   = = =   " E n t e r "   & &   s p e c i a l t y I n p u t . t r i m ( ) )   { 
 
 +                                     e . p r e v e n t D e f a u l t ( ) ; 
 
 +                                     s e t S p e c i a l t i e s ( ( a )   = >   [ . . . n e w   S e t ( [ . . . a ,   s p e c i a l t y I n p u t . t r i m ( ) ] ) ] ) ; 
 
 +                                     s e t S p e c i a l t y I n p u t ( " " ) ; 
 
 +                                 } 
 
 +                             } } 
 
 +                         / > 
 
 +                     < / d i v > 
 
 +                     < p   c l a s s N a m e = " m t - 1   t e x t - [ 1 1 p x ]   t e x t - s l a t e - 5 0 0 " > E t i q u e t a s   q u e   e l   a l g o r i t m o   c o m p a r a   c o n   l a   c a t e g o r % a   y   e l   n o m b r e   d e l   s e r v i c i o . < / p > 
 
 +                 < / d i v > 
 
 +                 < d i v > 
 
 +                     < l a b e l   c l a s s N a m e = " l a b e l " > 
 
 +                         E f i c i e n c i a   < s p a n   c l a s s N a m e = " m l - 1   t e x t - b r a n d - 7 0 0 " > { e f f i c i e n c y } < / s p a n > 
 
 +                     < / l a b e l > 
 
 +                     < i n p u t 
 
 +                         t y p e = " r a n g e " 
 
 +                         m i n = { 0 } 
 
 +                         m a x = { 1 0 0 } 
 
 +                         v a l u e = { e f f i c i e n c y } 
 
 +                         o n C h a n g e = { ( e )   = >   s e t E f f i c i e n c y ( N u m b e r ( e . t a r g e t . v a l u e ) ) } 
 
 +                         c l a s s N a m e = " w - f u l l   a c c e n t - b r a n d - 5 0 0 " 
 
 +                     / > 
 
 +                     < p   c l a s s N a m e = " m t - 1   t e x t - [ 1 1 p x ]   t e x t - s l a t e - 5 0 0 " > Q u %   t a n   r % p i d o / h % b i l   e s .   E l   a l g o r i t m o   p r e m i a   v a l o r e s   a l t o s   c u a n d o   h a y   e m p a t e   p o r   d i s p o n i b i l i d a d . < / p > 
 
 +                 < / d i v > 
 
 +                 < d i v > 
 
 +                     < l a b e l   c l a s s N a m e = " f l e x   c u r s o r - p o i n t e r   i t e m s - c e n t e r   g a p - 2 " > 
 
 +                         < i n p u t 
 
 +                             t y p e = " c h e c k b o x " 
 
 +                             c l a s s N a m e = " h - 4   w - 4   a c c e n t - b r a n d - 5 0 0 " 
 
 +                             c h e c k e d = { i n h e r i t H o u r s } 
 
 +                             o n C h a n g e = { ( e )   = >   s e t I n h e r i t H o u r s ( e . t a r g e t . c h e c k e d ) } 
 
 +                         / > 
 
 +                         < s p a n   c l a s s N a m e = " t e x t - s m   f o n t - b o l d   t e x t - s l a t e - 8 0 0 " > H e r e d a r   h o r a r i o   d e l   n e g o c i o < / s p a n > 
 
 +                     < / l a b e l > 
 
 +                     { ! i n h e r i t H o u r s   & &   ( 
 
 +                         < d i v   c l a s s N a m e = " m t - 2   s p a c e - y - 1 . 5 " > 
 
 +                             { D A Y S . m a p ( ( {   n ,   l a b e l   } )   = >   { 
 
 +                                 c o n s t   o n   =   ! ! w h [ n ] ; 
 
 +                                 r e t u r n   ( 
 
 +                                     < d i v   k e y = { n }   c l a s s N a m e = " f l e x   i t e m s - c e n t e r   g a p - 2   r o u n d e d - l g   b o r d e r   b o r d e r - s l a t e - 1 0 0   p x - 2   p y - 1 . 5 " > 
 
 +                                         < l a b e l   c l a s s N a m e = " f l e x   w - 2 4   c u r s o r - p o i n t e r   i t e m s - c e n t e r   g a p - 2   t e x t - x s   f o n t - s e m i b o l d   t e x t - s l a t e - 7 0 0 " > 
 
 +                                             < i n p u t 
 
 +                                                 t y p e = " c h e c k b o x " 
 
 +                                                 c l a s s N a m e = " h - 4   w - 4   a c c e n t - b r a n d - 5 0 0 " 
 
 +                                                 c h e c k e d = { o n } 
 
 +                                                 o n C h a n g e = { ( )   = > 
 
 +                                                     s e t W h ( {   . . . w h ,   [ n ] :   w h [ n ]   ?   n u l l   :   {   s t a r t :   " 0 9 : 0 0 " ,   e n d :   " 1 8 : 0 0 "   }   } ) 
 
 +                                                 } 
 
 +                                             / > 
 
 +                                             { l a b e l } 
 
 +                                         < / l a b e l > 
 
 +                                         { o n   ?   ( 
 
 +                                             < d i v   c l a s s N a m e = " f l e x   i t e m s - c e n t e r   g a p - 1 . 5 " > 
 
 +                                                 < i n p u t 
 
 +                                                     t y p e = " t i m e " 
 
 +                                                     c l a s s N a m e = " i n p u t   ! w - a u t o   ! p y - 1   t e x t - x s " 
 
 +                                                     v a l u e = { w h [ n ] ! . s t a r t } 
 
 +                                                     o n C h a n g e = { ( e )   = > 
 
 +                                                         s e t W h ( {   . . . w h ,   [ n ] :   {   . . . ( w h [ n ]   a s   {   s t a r t :   s t r i n g ;   e n d :   s t r i n g   } ) ,   s t a r t :   e . t a r g e t . v a l u e   }   } ) 
 
 +                                                     } 
 
 +                                                 / > 
 
 +                                                 < s p a n   c l a s s N a m e = " t e x t - x s   t e x t - s l a t e - 4 0 0 " > a < / s p a n > 
 
 +                                                 < i n p u t 
 
 +                                                     t y p e = " t i m e " 
 
 +                                                     c l a s s N a m e = " i n p u t   ! w - a u t o   ! p y - 1   t e x t - x s " 
 
 +                                                     v a l u e = { w h [ n ] ! . e n d } 
 
 +                                                     o n C h a n g e = { ( e )   = > 
 
 +                                                         s e t W h ( {   . . . w h ,   [ n ] :   {   . . . ( w h [ n ]   a s   {   s t a r t :   s t r i n g ;   e n d :   s t r i n g   } ) ,   e n d :   e . t a r g e t . v a l u e   }   } ) 
 
 +                                                     } 
 
 +                                                 / > 
 
 +                                             < / d i v > 
 
 +                                         )   :   ( 
 
 +                                             < s p a n   c l a s s N a m e = " t e x t - x s   f o n t - m e d i u m   t e x t - s l a t e - 4 0 0 " > C e r r a d o < / s p a n > 
 
 +                                         ) } 
 
 +                                     < / d i v > 
 
 +                                 ) ; 
 
 +                             } ) } 
 
 +                         < / d i v > 
 
 +                     ) } 
 
 +                 < / d i v > 
 
                   < l a b e l   c l a s s N a m e = " f l e x   i t e m s - c e n t e r   g a p - 2   t e x t - s m   f o n t - m e d i u m   t e x t - s l a t e - 7 0 0 " > 
 
                       < i n p u t   t y p e = " c h e c k b o x "   c h e c k e d = { a c t i v e }   o n C h a n g e = { ( e )   = >   s e t A c t i v e ( e . t a r g e t . c h e c k e d ) }   / > 
 
                       A c t i v o   ( p u e d e   r e c i b i r   c i t a s ) 
 
 d i f f   - - g i t   a / s r c / p a g e s / S e t t i n g s P a g e . t s x   b / s r c / p a g e s / S e t t i n g s P a g e . t s x 
 
 i n d e x   5 1 9 a 5 0 c . . c 1 4 2 3 6 c   1 0 0 6 4 4 
 
 - - -   a / s r c / p a g e s / S e t t i n g s P a g e . t s x 
 
 + + +   b / s r c / p a g e s / S e t t i n g s P a g e . t s x 
 
 @ @   - 1 0 , 9   + 1 0 , 1 2   @ @   i m p o r t   { 
 
       C o p y , 
 
       C h e c k , 
 
       E x t e r n a l L i n k , 
 
 +     W a n d 2 , 
 
 +     C l o c k , 
 
   }   f r o m   " l u c i d e - r e a c t " ; 
 
   i m p o r t   {   a p i   }   f r o m   " . . / l i b / a p i " ; 
 
   i m p o r t   {   P a g e H e a d e r ,   S p i n n e r   }   f r o m   " . . / c o m p o n e n t s / u i " ; 
 
 + i m p o r t   {   D E F A U L T _ W H ,   D A Y S ,   p a r s e W h   }   f r o m   " . . / l i b / w o r k i n g H o u r s " ; 
 
   
 
   e x p o r t   f u n c t i o n   S e t t i n g s P a g e ( )   { 
 
       c o n s t   q c   =   u s e Q u e r y C l i e n t ( ) ; 
 
 @ @   - 2 0 , 9   + 2 3 , 1 0   @ @   e x p o r t   f u n c t i o n   S e t t i n g s P a g e ( )   { 
 
       c o n s t   [ f ,   s e t F ]   =   u s e S t a t e < a n y > ( n u l l ) ; 
 
       c o n s t   [ c o p i e d ,   s e t C o p i e d ]   =   u s e S t a t e ( f a l s e ) ; 
 
       c o n s t   [ s a v e d ,   s e t S a v e d ]   =   u s e S t a t e ( f a l s e ) ; 
 
 +     c o n s t   [ w h ,   s e t W h ]   =   u s e S t a t e < R e c o r d < n u m b e r ,   {   s t a r t :   s t r i n g ;   e n d :   s t r i n g   }   |   n u l l > > ( {   . . . D E F A U L T _ W H   } ) ; 
 
   
 
       u s e E f f e c t ( ( )   = >   { 
 
 -         i f   ( d a t a ? . s e t t i n g s )   s e t F ( d a t a . s e t t i n g s ) ; 
 
 +         i f   ( d a t a ? . s e t t i n g s )   {   s e t F ( d a t a . s e t t i n g s ) ;   s e t W h ( p a r s e W h ( d a t a . s e t t i n g s . w o r k i n g _ h o u r s ) ) ;   } 
 
       } ,   [ d a t a ] ) ; 
 
   
 
       c o n s t   m u t   =   u s e M u t a t i o n ( { 
 
 @ @   - 3 9 , 6   + 4 3 , 8   @ @   e x p o r t   f u n c t i o n   S e t t i n g s P a g e ( )   { 
 
                   r e q u i r e _ d e p o s i t :   f . r e q u i r e _ d e p o s i t   ?   1   :   0 , 
 
                   d e p o s i t _ p c t :   N u m b e r ( f . d e p o s i t _ p c t ) , 
 
                   t i m e z o n e :   f . t i m e z o n e , 
 
 +                 a u t o _ a s s i g n _ s p e c i a l i s t :   f . a u t o _ a s s i g n _ s p e c i a l i s t   ?   1   :   0 , 
 
 +                 w o r k i n g _ h o u r s :   w h , 
 
               } ) , 
 
           o n S u c c e s s :   ( )   = >   { 
 
               q c . i n v a l i d a t e Q u e r i e s ( {   q u e r y K e y :   [ " s e t t i n g s " ]   } ) ; 
 
 @ @   - 9 7 , 6   + 1 0 3 , 1 9   @ @   e x p o r t   f u n c t i o n   S e t t i n g s P a g e ( )   { 
 
                                   < i n p u t   c l a s s N a m e = " i n p u t "   v a l u e = { f . s l u g }   o n C h a n g e = { ( e )   = >   s e t ( " s l u g " ,   e . t a r g e t . v a l u e ) }   p l a c e h o l d e r = " m i - n e g o c i o "   / > 
 
                               < / d i v > 
 
                           < / d i v > 
 
 +                         < l a b e l   c l a s s N a m e = " f l e x   c u r s o r - p o i n t e r   i t e m s - s t a r t   g a p - 3   r o u n d e d - x l   b o r d e r   b o r d e r - s l a t e - 2 0 0   p - 3 " > 
 
 +                             < i n p u t   t y p e = " c h e c k b o x "   c l a s s N a m e = " m t - 0 . 5   h - 4   w - 4   a c c e n t - b r a n d - 5 0 0 "   c h e c k e d = { ! ! f . a u t o _ a s s i g n _ s p e c i a l i s t }   o n C h a n g e = { ( e )   = >   s e t ( " a u t o _ a s s i g n _ s p e c i a l i s t " ,   e . t a r g e t . c h e c k e d ) }   / > 
 
 +                             < d i v > 
 
 +                                 < d i v   c l a s s N a m e = " f l e x   i t e m s - c e n t e r   g a p - 1 . 5   t e x t - s m   f o n t - b o l d   t e x t - s l a t e - 8 0 0 " > < W a n d 2   c l a s s N a m e = " h - 4   w - 4   t e x t - b r a n d - 5 0 0 "   / >   A s i g n a r   e s p e c i a l i s t a   a u t o m % t i c a m e n t e < / d i v > 
 
 +                                 < p   c l a s s N a m e = " t e x t - x s   t e x t - s l a t e - 5 0 0 " > E l   c l i e n t e   n o   e l i g e   e s p e c i a l i s t a :   e l   s i s t e m a   l o   a s i g n a   s e g %Q%n   e s p e c i a l i d a d ,   e f i c i e n c i a   y   d i s p o n i b i l i d a d .   E v i t a   d o b l e s   r e s e r v a s . < / p > 
 
 +                             < / d i v > 
 
 +                         < / l a b e l > 
 
 + 
 
 +                         < d i v > 
 
 +                             < l a b e l   c l a s s N a m e = " l a b e l   f l e x   i t e m s - c e n t e r   g a p - 1 . 5 " > < C l o c k   c l a s s N a m e = " h - 3 . 5   w - 3 . 5   t e x t - s l a t e - 4 0 0 "   / >   H o r a r i o   d e l   n e g o c i o < / l a b e l > 
 
 +                             < W o r k i n g H o u r s E d i t o r   v a l u e = { w h }   o n C h a n g e = { s e t W h }   / > 
 
 +                             < p   c l a s s N a m e = " m t - 1   t e x t - [ 1 1 p x ]   t e x t - s l a t e - 5 0 0 " > D e f i n e   q u %   d % a s   y   h o r a s   s e   o f r e c e n   c i t a s .   L o s   e s p e c i a l i s t a s   p u e d e n   t e n e r   s u   p r o p i o   h o r a r i o . < / p > 
 
 +                         < / d i v > 
 
                       < / d i v > 
 
                   < / d i v > 
 
   
 
 @ @   - 1 7 5 , 3   + 1 9 4 , 3 5   @ @   f u n c t i o n   S e c t i o n T i t l e ( {   i c o n :   I c o n ,   c o l o r ,   t i t l e ,   s u b t i t l e   } :   {   i c o n :   a n y ;   c o l o r 
 
           < / d i v > 
 
       ) ; 
 
   } 
 
 + 
 
 + f u n c t i o n   W o r k i n g H o u r s E d i t o r ( {   v a l u e ,   o n C h a n g e   } :   {   v a l u e :   R e c o r d < n u m b e r ,   {   s t a r t :   s t r i n g ;   e n d :   s t r i n g   }   |   n u l l > ;   o n C h a n g e :   ( v :   R e c o r d < n u m b e r ,   {   s t a r t :   s t r i n g ;   e n d :   s t r i n g   }   |   n u l l > )   = >   v o i d   } )   { 
 
 +     c o n s t   t o g g l e   =   ( n :   n u m b e r )   = >   o n C h a n g e ( {   . . . v a l u e ,   [ n ] :   v a l u e [ n ]   ?   n u l l   :   {   s t a r t :   " 0 9 : 0 0 " ,   e n d :   " 1 8 : 0 0 "   }   } ) ; 
 
 +     c o n s t   s e t   =   ( n :   n u m b e r ,   f i e l d :   " s t a r t "   |   " e n d " ,   v :   s t r i n g )   = >   { 
 
 +         c o n s t   c u r   =   v a l u e [ n ]   ? ?   {   s t a r t :   " 0 9 : 0 0 " ,   e n d :   " 1 8 : 0 0 "   } ; 
 
 +         o n C h a n g e ( {   . . . v a l u e ,   [ n ] :   {   . . . c u r ,   [ f i e l d ] :   v   }   } ) ; 
 
 +     } ; 
 
 +     r e t u r n   ( 
 
 +         < d i v   c l a s s N a m e = " s p a c e - y - 1 . 5 " > 
 
 +             { D A Y S . m a p ( ( {   n ,   l a b e l   } )   = >   { 
 
 +                 c o n s t   o n   =   ! ! v a l u e [ n ] ; 
 
 +                 r e t u r n   ( 
 
 +                     < d i v   k e y = { n }   c l a s s N a m e = " f l e x   i t e m s - c e n t e r   g a p - 2   r o u n d e d - l g   b o r d e r   b o r d e r - s l a t e - 1 0 0   p x - 2   p y - 1 . 5 " > 
 
 +                         < l a b e l   c l a s s N a m e = " f l e x   w - 2 4   c u r s o r - p o i n t e r   i t e m s - c e n t e r   g a p - 2   t e x t - x s   f o n t - s e m i b o l d   t e x t - s l a t e - 7 0 0 " > 
 
 +                             < i n p u t   t y p e = " c h e c k b o x "   c l a s s N a m e = " h - 4   w - 4   a c c e n t - b r a n d - 5 0 0 "   c h e c k e d = { o n }   o n C h a n g e = { ( )   = >   t o g g l e ( n ) }   / > 
 
 +                             { l a b e l } 
 
 +                         < / l a b e l > 
 
 +                         { o n   ?   ( 
 
 +                             < d i v   c l a s s N a m e = " f l e x   i t e m s - c e n t e r   g a p - 1 . 5 " > 
 
 +                                 < i n p u t   t y p e = " t i m e "   c l a s s N a m e = " i n p u t   ! w - a u t o   ! p y - 1   t e x t - x s "   v a l u e = { v a l u e [ n ] ! . s t a r t }   o n C h a n g e = { ( e )   = >   s e t ( n ,   " s t a r t " ,   e . t a r g e t . v a l u e ) }   / > 
 
 +                                 < s p a n   c l a s s N a m e = " t e x t - x s   t e x t - s l a t e - 4 0 0 " > a < / s p a n > 
 
 +                                 < i n p u t   t y p e = " t i m e "   c l a s s N a m e = " i n p u t   ! w - a u t o   ! p y - 1   t e x t - x s "   v a l u e = { v a l u e [ n ] ! . e n d }   o n C h a n g e = { ( e )   = >   s e t ( n ,   " e n d " ,   e . t a r g e t . v a l u e ) }   / > 
 
 +                             < / d i v > 
 
 +                         )   :   ( 
 
 +                             < s p a n   c l a s s N a m e = " t e x t - x s   f o n t - m e d i u m   t e x t - s l a t e - 4 0 0 " > C e r r a d o < / s p a n > 
 
 +                         ) } 
 
 +                     < / d i v > 
 
 +                 ) ; 
 
 +             } ) } 
 
 +         < / d i v > 
 
 +     ) ; 
 
 + } 
 
 d i f f   - - g i t   a / s r c / p a g e s / p u b l i c / B o o k i n g P a g e . t s x   b / s r c / p a g e s / p u b l i c / B o o k i n g P a g e . t s x 
 
 i n d e x   9 4 7 a 5 b 8 . . 1 4 2 7 d 0 0   1 0 0 6 4 4 
 
 - - -   a / s r c / p a g e s / p u b l i c / B o o k i n g P a g e . t s x 
 
 + + +   b / s r c / p a g e s / p u b l i c / B o o k i n g P a g e . t s x 
 
 @ @   - 2 5 , 6   + 2 5 , 7   @ @   i m p o r t   { 
 
       t y p e   B o o k R e s p o n s e , 
 
   }   f r o m   " . . / . . / l i b / p u b l i c A p i " ; 
 
   i m p o r t   {   S p i n n e r   }   f r o m   " . . / . . / c o m p o n e n t s / u i " ; 
 
 + i m p o r t   {   M o n t h C a l e n d a r   }   f r o m   " . . / . . / c o m p o n e n t s / M o n t h C a l e n d a r " ; 
 
   i m p o r t   {   c n ,   f o r m a t C u r r e n c y ,   f o r m a t D a t e ,   f o r m a t T i m e   }   f r o m   " . . / . . / l i b / f o r m a t " ; 
 
   
 
   f u n c t i o n   t o d a y S t r ( )   { 
 
 @ @   - 3 3 , 1 2   + 3 4 , 2 5   @ @   f u n c t i o n   t o d a y S t r ( )   { 
 
       r e t u r n   ` $ { d . g e t F u l l Y e a r ( ) } - $ { p a d ( d . g e t M o n t h ( )   +   1 ) } - $ { p a d ( d . g e t D a t e ( ) ) } ` ; 
 
   } 
 
   
 
 - c o n s t   S T E P S   =   [ 
 
 + f u n c t i o n   m a x B o o k a b l e D a t e ( )   { 
 
 +     c o n s t   d   =   n e w   D a t e ( ) ; 
 
 +     d . s e t M o n t h ( d . g e t M o n t h ( )   +   3 ) ; 
 
 +     c o n s t   p a d   =   ( n :   n u m b e r )   = >   S t r i n g ( n ) . p a d S t a r t ( 2 ,   " 0 " ) ; 
 
 +     r e t u r n   ` $ { d . g e t F u l l Y e a r ( ) } - $ { p a d ( d . g e t M o n t h ( )   +   1 ) } - $ { p a d ( d . g e t D a t e ( ) ) } ` ; 
 
 + } 
 
 + 
 
 + c o n s t   F U L L _ S T E P S   =   [ 
 
       {   n :   1 ,   l a b e l :   " S e r v i c i o "   } , 
 
       {   n :   2 ,   l a b e l :   " E s p e c i a l i s t a "   } , 
 
       {   n :   3 ,   l a b e l :   " H o r a r i o "   } , 
 
       {   n :   4 ,   l a b e l :   " D a t o s "   } , 
 
 - ] ; 
 
 + ]   a s   c o n s t ; 
 
 + 
 
 + f u n c t i o n   s t e p s F o r ( a u t o A s s i g n :   b o o l e a n )   { 
 
 +     r e t u r n   a u t o A s s i g n 
 
 +         ?   F U L L _ S T E P S . f i l t e r ( ( s )   = >   s . l a b e l   ! = =   " E s p e c i a l i s t a " ) . m a p ( ( s ,   i )   = >   ( {   n :   i   +   1 ,   l a b e l :   s . l a b e l ,   o r i g i n a l :   s . n   } ) ) 
 
 +         :   F U L L _ S T E P S . m a p ( ( s ,   i )   = >   ( {   n :   i   +   1 ,   l a b e l :   s . l a b e l ,   o r i g i n a l :   s . n   } ) ) ; 
 
 + } 
 
   
 
   e x p o r t   d e f a u l t   f u n c t i o n   B o o k i n g P a g e ( )   { 
 
       c o n s t   {   s l u g   }   =   u s e P a r a m s < {   s l u g :   s t r i n g   } > ( ) ; 
 
 @ @   - 6 3 , 6   + 7 7 , 1 1   @ @   e x p o r t   d e f a u l t   f u n c t i o n   B o o k i n g P a g e ( )   { 
 
       c o n s t   s e r v i c e s   =   d a t a ? . s e r v i c e s   ? ?   [ ] ; 
 
       c o n s t   e m p l o y e e s   =   d a t a ? . e m p l o y e e s   ? ?   [ ] ; 
 
   
 
 +     c o n s t   a u t o A s s i g n   =   ! ! b u s i n e s s ? . a u t o _ a s s i g n _ s p e c i a l i s t ; 
 
 +     c o n s t   s t e p s   =   u s e M e m o ( ( )   = >   s t e p s F o r ( a u t o A s s i g n ) ,   [ a u t o A s s i g n ] ) ; 
 
 +     c o n s t   s t e p C o u n t   =   s t e p s . l e n g t h ; 
 
 +     c o n s t   c u r r e n t O r i g i n a l   =   s t e p s . f i n d ( ( s )   = >   s . n   = = =   s t e p ) ? . o r i g i n a l ; 
 
 + 
 
       c o n s t   s e l e c t e d S e r v i c e   =   u s e M e m o < P u b l i c S e r v i c e   |   u n d e f i n e d > ( 
 
           ( )   = >   s e r v i c e s . f i n d ( ( s )   = >   s . i d   = = =   s e r v i c e I d ) , 
 
           [ s e r v i c e s ,   s e r v i c e I d ] 
 
 @ @   - 7 1 , 7   + 9 0 , 7   @ @   e x p o r t   d e f a u l t   f u n c t i o n   B o o k i n g P a g e ( )   { 
 
       c o n s t   s l o t s Q u e r y   =   u s e Q u e r y ( { 
 
           q u e r y K e y :   [ " p u b l i c " ,   " s l o t s " ,   s l u g ,   s e r v i c e I d ,   s e l e c t e d D a t e ,   e m p l o y e e I d ] , 
 
           q u e r y F n :   ( )   = >   g e t S l o t s ( s l u g ! ,   s e r v i c e I d ! ,   s e l e c t e d D a t e ,   e m p l o y e e I d   ? ?   u n d e f i n e d ) , 
 
 -         e n a b l e d :   s t e p   > =   3   & &   ! ! s e r v i c e I d   & &   ! ! s e l e c t e d D a t e   & &   ! r e s u l t , 
 
 +         e n a b l e d :   c u r r e n t O r i g i n a l   = = =   3   & &   ! ! s e r v i c e I d   & &   ! ! s e l e c t e d D a t e   & &   ! r e s u l t , 
 
       } ) ; 
 
   
 
       c o n s t   s l o t s   =   s l o t s Q u e r y . d a t a ? . s l o t s   ? ?   [ ] ; 
 
 @ @   - 1 3 0 , 7   + 1 4 9 , 7   @ @   e x p o r t   d e f a u l t   f u n c t i o n   B o o k i n g P a g e ( )   { 
 
       i f   ( ! b u s i n e s s . b o o k i n g _ e n a b l e d )   { 
 
           r e t u r n   ( 
 
               < d i v   c l a s s N a m e = " f l e x   m i n - h - s c r e e n   f l e x - c o l   b g - [ # f 6 f 7 f b ] " > 
 
 -                 < T o p B a r   n a m e = { b u s i n e s s . n a m e }   i n d u s t r y = { b u s i n e s s . i n d u s t r y }   s t e p = { 0 }   / > 
 
 +                 < T o p B a r   n a m e = { b u s i n e s s . n a m e }   i n d u s t r y = { b u s i n e s s . i n d u s t r y }   s t e p = { 0 }   s t e p C o u n t = { 4 }   s t e p s = { [ ] }   / > 
 
                   < m a i n   c l a s s N a m e = " f l e x   f l e x - 1   i t e m s - c e n t e r   j u s t i f y - c e n t e r   p x - 5   p y - 1 0 " > 
 
                       < d i v   c l a s s N a m e = " c a r d   w - f u l l   m a x - w - m d   p - 8   t e x t - c e n t e r   s h a d o w - c a r d   a n i m a t e - s l i d e - u p " > 
 
                           < d i v   c l a s s N a m e = " m x - a u t o   f l e x   h - 1 4   w - 1 4   i t e m s - c e n t e r   j u s t i f y - c e n t e r   r o u n d e d - 2 x l   b g - a m b e r - 1 0 0   t e x t - a m b e r - 6 0 0 " > 
 
 @ @   - 1 5 1 , 7   + 1 7 0 , 7   @ @   e x p o r t   d e f a u l t   f u n c t i o n   B o o k i n g P a g e ( )   { 
 
           ) ; 
 
       } 
 
   
 
 -     c o n s t   g o N e x t   =   ( )   = >   s e t S t e p ( ( s )   = >   M a t h . m i n ( 4 ,   s   +   1 ) ) ; 
 
 +     c o n s t   g o N e x t   =   ( )   = >   s e t S t e p ( ( s )   = >   M a t h . m i n ( s t e p C o u n t ,   s   +   1 ) ) ; 
 
       c o n s t   g o B a c k   =   ( )   = >   s e t S t e p ( ( s )   = >   M a t h . m a x ( 1 ,   s   -   1 ) ) ; 
 
   
 
       c o n s t   p i c k S e r v i c e   =   ( i d :   n u m b e r )   = >   { 
 
 @ @   - 1 6 8 , 7   + 1 8 7 , 7   @ @   e x p o r t   d e f a u l t   f u n c t i o n   B o o k i n g P a g e ( )   { 
 
   
 
       c o n s t   p i c k S l o t   =   ( s l o t :   P u b l i c S l o t )   = >   { 
 
           s e t S e l e c t e d S l o t ( s l o t ) ; 
 
 -         s e t S t e p ( 4 ) ; 
 
 +         s e t S t e p ( ( s )   = >   M a t h . m i n ( s t e p C o u n t ,   s   +   1 ) ) ; 
 
       } ; 
 
   
 
       c o n s t   h a n d l e B o o k   =   ( )   = >   { 
 
 @ @   - 1 7 6 , 7   + 1 9 5 , 7   @ @   e x p o r t   d e f a u l t   f u n c t i o n   B o o k i n g P a g e ( )   { 
 
           i f   ( ! c l i e n t . n a m e . t r i m ( ) )   r e t u r n ; 
 
           b o o k M u t . m u t a t e ( { 
 
               s e r v i c e _ i d :   s e l e c t e d S e r v i c e . i d , 
 
 -             e m p l o y e e _ i d :   s e l e c t e d S l o t . e m p l o y e e _ i d , 
 
 +             e m p l o y e e _ i d :   a u t o A s s i g n   ?   u n d e f i n e d   :   s e l e c t e d S l o t . e m p l o y e e _ i d , 
 
               s t a r t _ a t :   s e l e c t e d S l o t . i s o , 
 
               c l i e n t :   { 
 
                   n a m e :   c l i e n t . n a m e . t r i m ( ) , 
 
 @ @   - 1 8 8 , 2 6   + 2 0 7 , 2 7   @ @   e x p o r t   d e f a u l t   f u n c t i o n   B o o k i n g P a g e ( )   { 
 
       } ; 
 
   
 
       c o n s t   c a n C o n t i n u e   = 
 
 -         ( s t e p   = = =   1   & &   ! ! s e r v i c e I d )   | | 
 
 -         s t e p   = = =   2   | | 
 
 -         ( s t e p   = = =   3   & &   ! ! s e l e c t e d S l o t )   | | 
 
 -         ( s t e p   = = =   4   & &   c l i e n t . n a m e . t r i m ( ) . l e n g t h   >   0 ) ; 
 
 +         ( c u r r e n t O r i g i n a l   = = =   1   & &   ! ! s e r v i c e I d )   | | 
 
 +         c u r r e n t O r i g i n a l   = = =   2   | | 
 
 +         ( c u r r e n t O r i g i n a l   = = =   3   & &   ! ! s e l e c t e d S l o t )   | | 
 
 +         ( c u r r e n t O r i g i n a l   = = =   4   & &   c l i e n t . n a m e . t r i m ( ) . l e n g t h   >   0 ) ; 
 
   
 
       c o n s t   c u r r e n c y   =   b u s i n e s s . c u r r e n c y _ s y m b o l   | |   " $ " ; 
 
 -     c o n s t   p r i m a r y L a b e l   =   s t e p   = = =   4   ?   " C o n f i r m a r   r e s e r v a "   :   " C o n t i n u a r " ; 
 
 -     c o n s t   o n P r i m a r y   =   s t e p   = = =   4   ?   h a n d l e B o o k   :   g o N e x t ; 
 
 +     c o n s t   p r i m a r y L a b e l   =   c u r r e n t O r i g i n a l   = = =   4   ?   " C o n f i r m a r   r e s e r v a "   :   " C o n t i n u a r " ; 
 
 +     c o n s t   o n P r i m a r y   =   c u r r e n t O r i g i n a l   = = =   4   ?   h a n d l e B o o k   :   g o N e x t ; 
 
   
 
       r e t u r n   ( 
 
           < d i v   c l a s s N a m e = " f l e x   m i n - h - s c r e e n   f l e x - c o l   b g - g r a d i e n t - t o - b   f r o m - b r a n d - 5 0 / 5 0   v i a - [ # f 6 f 7 f b ]   t o - [ # f 6 f 7 f b ] " > 
 
 -             < T o p B a r   n a m e = { b u s i n e s s . n a m e }   i n d u s t r y = { b u s i n e s s . i n d u s t r y }   s t e p = { s t e p }   / > 
 
 +             < T o p B a r   n a m e = { b u s i n e s s . n a m e }   i n d u s t r y = { b u s i n e s s . i n d u s t r y }   s t e p = { s t e p }   s t e p C o u n t = { s t e p C o u n t }   s t e p s = { s t e p s }   / > 
 
   
 
 -             < m a i n   c l a s s N a m e = " m x - a u t o   w - f u l l   m a x - w - 2 x l   f l e x - 1   p x - 4   p b - 3 2   p t - 5   s m : p x - 6   m d : p b - 2 8 " > 
 
 -                 { s t e p   = = =   1   & &   ( 
 
 -                     < H e r o   b u s i n e s s = { b u s i n e s s }   / > 
 
 -                 ) } 
 
 +             < m a i n   c l a s s N a m e = { c n ( 
 
 +                 " m x - a u t o   w - f u l l   f l e x - 1   p x - 4   p b - 3 2   p t - 5   s m : p x - 6   m d : p b - 2 8 " , 
 
 +                 c u r r e n t O r i g i n a l   = = =   3   ?   " m a x - w - 5 x l "   :   " m a x - w - 2 x l " 
 
 +             ) } > 
 
 +                 { c u r r e n t O r i g i n a l   = = =   1   & &   < H e r o   b u s i n e s s = { b u s i n e s s }   / > } 
 
   
 
                   < d i v   c l a s s N a m e = " m t - 4 " > 
 
 -                     { s t e p   = = =   1   & &   ( 
 
 +                     { c u r r e n t O r i g i n a l   = = =   1   & &   ( 
 
                           < S t e p S h e l l 
 
                               i c o n = { < S p a r k l e s   c l a s s N a m e = " h - 4   w - 4 "   / > } 
 
                               t i t l e = " E l i g e   u n   s e r v i c i o " 
 
 @ @   - 2 2 2 , 7   + 2 4 2 , 7   @ @   e x p o r t   d e f a u l t   f u n c t i o n   B o o k i n g P a g e ( )   { 
 
                           < / S t e p S h e l l > 
 
                       ) } 
 
   
 
 -                     { s t e p   = = =   2   & &   ( 
 
 +                     { c u r r e n t O r i g i n a l   = = =   2   & &   ( 
 
                           < S t e p S h e l l 
 
                               i c o n = { < U s e r   c l a s s N a m e = " h - 4   w - 4 "   / > } 
 
                               t i t l e = " E l i g e   u n   e s p e c i a l i s t a " 
 
 @ @   - 2 3 6 , 7   + 2 5 6 , 7   @ @   e x p o r t   d e f a u l t   f u n c t i o n   B o o k i n g P a g e ( )   { 
 
                           < / S t e p S h e l l > 
 
                       ) } 
 
   
 
 -                     { s t e p   = = =   3   & &   s e l e c t e d S e r v i c e   & &   ( 
 
 +                     { c u r r e n t O r i g i n a l   = = =   3   & &   s e l e c t e d S e r v i c e   & &   ( 
 
                           < S t e p S h e l l 
 
                               i c o n = { < C a l e n d a r D a y s   c l a s s N a m e = " h - 4   w - 4 "   / > } 
 
                               t i t l e = " E l i g e   f e c h a   y   h o r a " 
 
 @ @   - 2 4 9 , 6   + 2 6 9 , 7   @ @   e x p o r t   d e f a u l t   f u n c t i o n   B o o k i n g P a g e ( )   { 
 
                                       s e t S e l e c t e d S l o t ( n u l l ) ; 
 
                                   } } 
 
                                   m i n = { t o d a y S t r ( ) } 
 
 +                                 m a x = { m a x B o o k a b l e D a t e ( ) } 
 
                                   s l o t s = { s l o t s } 
 
                                   l o a d i n g = { s l o t s Q u e r y . i s L o a d i n g } 
 
                                   i s E r r o r = { s l o t s Q u e r y . i s E r r o r } 
 
 @ @   - 2 5 8 , 7   + 2 7 9 , 7   @ @   e x p o r t   d e f a u l t   f u n c t i o n   B o o k i n g P a g e ( )   { 
 
                           < / S t e p S h e l l > 
 
                       ) } 
 
   
 
 -                     { s t e p   = = =   4   & &   s e l e c t e d S e r v i c e   & &   s e l e c t e d S l o t   & &   ( 
 
 +                     { c u r r e n t O r i g i n a l   = = =   4   & &   s e l e c t e d S e r v i c e   & &   s e l e c t e d S l o t   & &   ( 
 
                           < S t e p S h e l l 
 
                               i c o n = { < C a l e n d a r C h e c k   c l a s s N a m e = " h - 4   w - 4 "   / > } 
 
                               t i t l e = " T u s   d a t o s " 
 
 @ @   - 2 7 2 , 7   + 2 9 3 , 7   @ @   e x p o r t   d e f a u l t   f u n c t i o n   B o o k i n g P a g e ( )   { 
 
                                           < S u m m a r y R o w   l a b e l = " S e r v i c i o "   v a l u e = { s e l e c t e d S e r v i c e . n a m e }   / > 
 
                                           < S u m m a r y R o w   l a b e l = " F e c h a "   v a l u e = { f o r m a t D a t e ( s e l e c t e d S l o t . i s o ,   {   w e e k d a y :   " l o n g "   } ) }   / > 
 
                                           < S u m m a r y R o w   l a b e l = " H o r a "   v a l u e = { f o r m a t T i m e ( s e l e c t e d S l o t . i s o ) }   / > 
 
 -                                         < S u m m a r y R o w   l a b e l = " E s p e c i a l i s t a "   v a l u e = { s e l e c t e d S l o t . e m p l o y e e _ n a m e }   / > 
 
 +                                         { ! a u t o A s s i g n   & &   < S u m m a r y R o w   l a b e l = " E s p e c i a l i s t a "   v a l u e = { s e l e c t e d S l o t . e m p l o y e e _ n a m e }   / > } 
 
                                       < / > 
 
                                   } 
 
                               / > 
 
 @ @   - 2 8 4 , 6   + 3 0 5 , 7   @ @   e x p o r t   d e f a u l t   f u n c t i o n   B o o k i n g P a g e ( )   { 
 
               < A c t i o n B a r 
 
                   h i d d e n = { ! ! r e s u l t } 
 
                   s t e p = { s t e p } 
 
 +                 s t e p C o u n t = { s t e p C o u n t } 
 
                   g o B a c k = { g o B a c k } 
 
                   o n P r i m a r y = { o n P r i m a r y } 
 
                   p r i m a r y L a b e l = { p r i m a r y L a b e l } 
 
 @ @   - 3 0 1 , 1 1   + 3 2 3 , 1 1   @ @   e x p o r t   d e f a u l t   f u n c t i o n   B o o k i n g P a g e ( )   { 
 
       ) ; 
 
   } 
 
   
 
 - f u n c t i o n   T o p B a r ( {   n a m e ,   i n d u s t r y ,   s t e p   } :   {   n a m e :   s t r i n g ;   i n d u s t r y :   s t r i n g ;   s t e p :   n u m b e r   } )   { 
 
 -     c o n s t   c u r r e n t   =   S T E P S . f i n d ( ( s )   = >   s . n   = = =   s t e p ) ; 
 
 + f u n c t i o n   T o p B a r ( {   n a m e ,   i n d u s t r y ,   s t e p ,   s t e p C o u n t ,   s t e p s   } :   {   n a m e :   s t r i n g ;   i n d u s t r y :   s t r i n g ;   s t e p :   n u m b e r ;   s t e p C o u n t :   n u m b e r ;   s t e p s :   {   n :   n u m b e r ;   l a b e l :   s t r i n g   } [ ] ;   } )   { 
 
 +     c o n s t   c u r r e n t   =   s t e p s . f i n d ( ( s )   = >   s . n   = = =   s t e p ) ; 
 
       r e t u r n   ( 
 
           < h e a d e r   c l a s s N a m e = " s t i c k y   t o p - 0   z - 3 0   b o r d e r - b   b o r d e r - s l a t e - 2 0 0 / 7 0   b g - w h i t e / 8 5   b a c k d r o p - b l u r - m d " > 
 
 -             < d i v   c l a s s N a m e = " m x - a u t o   f l e x   w - f u l l   m a x - w - 3 x l   i t e m s - c e n t e r   j u s t i f y - b e t w e e n   g a p - 3   p x - 4   p y - 3   s m : p x - 6 " > 
 
 +             < d i v   c l a s s N a m e = " m x - a u t o   f l e x   w - f u l l   m a x - w - 5 x l   i t e m s - c e n t e r   j u s t i f y - b e t w e e n   g a p - 3   p x - 4   p y - 3   s m : p x - 6 " > 
 
                   < d i v   c l a s s N a m e = " f l e x   m i n - w - 0   i t e m s - c e n t e r   g a p - 2 . 5 " > 
 
                       < d i v   c l a s s N a m e = " f l e x   h - 9   w - 9   s h r i n k - 0   i t e m s - c e n t e r   j u s t i f y - c e n t e r   r o u n d e d - x l   b g - g r a d i e n t - t o - b r   f r o m - b r a n d - 5 0 0   t o - b r a n d - 7 0 0   t e x t - w h i t e   s h a d o w - s o f t " > 
 
                           < S p a r k l e s   c l a s s N a m e = " h - 4   w - 4 "   / > 
 
 @ @   - 3 1 9 , 1 0   + 3 4 1 , 1 0   @ @   f u n c t i o n   T o p B a r ( {   n a m e ,   i n d u s t r y ,   s t e p   } :   {   n a m e :   s t r i n g ;   i n d u s t r y :   s t r i n g ;   s t e p 
 
                   { s t e p   >   0   & &   ( 
 
                       < d i v   c l a s s N a m e = " f l e x   i t e m s - c e n t e r   g a p - 1 . 5 " > 
 
                           < s p a n   c l a s s N a m e = " h i d d e n   t e x t - [ 1 1 p x ]   f o n t - s e m i b o l d   u p p e r c a s e   t r a c k i n g - w i d e   t e x t - s l a t e - 4 0 0   s m : i n l i n e " > 
 
 -                             P a s o   { s t e p }   d e   4 
 
 +                             P a s o   { s t e p }   d e   { s t e p C o u n t } 
 
                           < / s p a n > 
 
                           < d i v   c l a s s N a m e = " h i d d e n   i t e m s - c e n t e r   g a p - 1   m d : f l e x " > 
 
 -                             { S T E P S . m a p ( ( s )   = >   ( 
 
 +                             { s t e p s . m a p ( ( s )   = >   ( 
 
                                   < d i v 
 
                                       k e y = { s . n } 
 
                                       c l a s s N a m e = { c n ( 
 
 @ @   - 3 4 2 , 7   + 3 6 4 , 7   @ @   f u n c t i o n   T o p B a r ( {   n a m e ,   i n d u s t r y ,   s t e p   } :   {   n a m e :   s t r i n g ;   i n d u s t r y :   s t r i n g ;   s t e p 
 
                           < d i v   c l a s s N a m e = " f l e x   i t e m s - c e n t e r   g a p - 1 . 5   r o u n d e d - f u l l   b g - b r a n d - 5 0   p x - 3   p y - 1   t e x t - x s   f o n t - b o l d   t e x t - b r a n d - 7 0 0   m d : h i d d e n " > 
 
                               < s p a n > { s t e p } < / s p a n > 
 
                               < s p a n   c l a s s N a m e = " f o n t - s e m i b o l d   t e x t - b r a n d - 4 0 0 " > / < / s p a n > 
 
 -                             < s p a n   c l a s s N a m e = " t e x t - b r a n d - 4 0 0 " > 4 < / s p a n > 
 
 +                             < s p a n   c l a s s N a m e = " t e x t - b r a n d - 4 0 0 " > { s t e p C o u n t } < / s p a n > 
 
                               < s p a n   c l a s s N a m e = " t e x t - b r a n d - 3 0 0 " > ,% < / s p a n > 
 
                               < s p a n > { c u r r e n t ? . l a b e l } < / s p a n > 
 
                           < / d i v > 
 
 @ @   - 5 5 6 , 6   + 5 7 8 , 7   @ @   f u n c t i o n   D a t e T i m e P i c k e r ( { 
 
       d a t e , 
 
       o n D a t e , 
 
       m i n , 
 
 +     m a x , 
 
       s l o t s , 
 
       l o a d i n g , 
 
       i s E r r o r , 
 
 @ @   - 5 6 5 , 2 8   + 5 8 8 , 4 2   @ @   f u n c t i o n   D a t e T i m e P i c k e r ( { 
 
       d a t e :   s t r i n g ; 
 
       o n D a t e :   ( d :   s t r i n g )   = >   v o i d ; 
 
       m i n :   s t r i n g ; 
 
 +     m a x ? :   s t r i n g ; 
 
       s l o t s :   P u b l i c S l o t [ ] ; 
 
       l o a d i n g :   b o o l e a n ; 
 
       i s E r r o r :   b o o l e a n ; 
 
       s e l e c t e d S l o t :   P u b l i c S l o t   |   n u l l ; 
 
       o n P i c k :   ( s :   P u b l i c S l o t )   = >   v o i d ; 
 
   } )   { 
 
 +     c o n s t   {   m o r n i n g ,   a f t e r n o o n   }   =   u s e M e m o ( ( )   = >   { 
 
 +         c o n s t   m o r n i n g :   P u b l i c S l o t [ ]   =   [ ] ; 
 
 +         c o n s t   a f t e r n o o n :   P u b l i c S l o t [ ]   =   [ ] ; 
 
 +         f o r   ( c o n s t   s   o f   s l o t s )   { 
 
 +             c o n s t   m   =   / ( \ d { 1 , 2 } ) : ( \ d { 2 } ) / . e x e c ( s . t i m e ) ; 
 
 +             c o n s t   h   =   m   ?   N u m b e r ( m [ 1 ] )   :   0 ; 
 
 +             c o n s t   p m   =   / P M / i . t e s t ( s . t i m e ) ; 
 
 +             c o n s t   h o u r 2 4   =   p m   & &   h   ! = =   1 2   ?   h   +   1 2   :   ! p m   & &   h   = = =   1 2   ?   0   :   h ; 
 
 +             ( h o u r 2 4   <   1 2   ?   m o r n i n g   :   a f t e r n o o n ) . p u s h ( s ) ; 
 
 +         } 
 
 +         r e t u r n   {   m o r n i n g ,   a f t e r n o o n   } ; 
 
 +     } ,   [ s l o t s ] ) ; 
 
 + 
 
       r e t u r n   ( 
 
 -         < d i v   c l a s s N a m e = " s p a c e - y - 4 " > 
 
 -             < d i v > 
 
 +         < d i v   c l a s s N a m e = " m d : g r i d   m d : g r i d - c o l s - [ m i n m a x ( 0 , 1 f r ) _ m i n m a x ( 0 , 1 . 1 f r ) ]   m d : i t e m s - s t a r t   m d : g a p - 8 " > 
 
 +             { / *   C o l u m n a   i z q u i e r d a :   c a l e n d a r i o   * / } 
 
 +             < d i v   c l a s s N a m e = " c a r d   p - 4 " > 
 
                   < l a b e l   c l a s s N a m e = " l a b e l   f l e x   i t e m s - c e n t e r   g a p - 1 . 5 " > 
 
                       < C a l e n d a r D a y s   c l a s s N a m e = " h - 3 . 5   w - 3 . 5   t e x t - s l a t e - 4 0 0 "   / >   F e c h a 
 
                   < / l a b e l > 
 
 -                 < i n p u t 
 
 -                     t y p e = " d a t e " 
 
 -                     c l a s s N a m e = " i n p u t " 
 
 -                     v a l u e = { d a t e } 
 
 -                     m i n = { m i n } 
 
 -                     o n C h a n g e = { ( e )   = >   e . t a r g e t . v a l u e   & &   o n D a t e ( e . t a r g e t . v a l u e ) } 
 
 -                 / > 
 
 +                 < M o n t h C a l e n d a r   v a l u e = { d a t e }   m i n = { m i n }   m a x = { m a x }   o n S e l e c t = { ( d )   = >   o n D a t e ( d ) }   / > 
 
 +                 < d i v   c l a s s N a m e = " m t - 3   f l e x   f l e x - w r a p   i t e m s - c e n t e r   g a p - 3   t e x t - [ 1 1 p x ]   t e x t - s l a t e - 5 0 0 " > 
 
 +                     < s p a n   c l a s s N a m e = " i n l i n e - f l e x   i t e m s - c e n t e r   g a p - 1 " > < s p a n   c l a s s N a m e = " h - 2   w - 2   r o u n d e d - f u l l   b g - a c c e n t - 5 0 0 "   / >   C o n   c u p o < / s p a n > 
 
 +                     < s p a n   c l a s s N a m e = " i n l i n e - f l e x   i t e m s - c e n t e r   g a p - 1 " > < s p a n   c l a s s N a m e = " h - 2   w - 2   r o u n d e d - f u l l   b g - b r a n d - 4 0 0 "   / >   H o y < / s p a n > 
 
 +                 < / d i v > 
 
               < / d i v > 
 
   
 
 -             < d i v > 
 
 +             { / *   C o l u m n a   d e r e c h a :   h o r a r i o s   * / } 
 
 +             < d i v   c l a s s N a m e = " m t - 4   m d : m t - 0 " > 
 
                   < l a b e l   c l a s s N a m e = " l a b e l   f l e x   i t e m s - c e n t e r   g a p - 1 . 5 " > 
 
                       < C l o c k   c l a s s N a m e = " h - 3 . 5   w - 3 . 5   t e x t - s l a t e - 4 0 0 "   / >   H o r a r i o   d i s p o n i b l e 
 
                   < / l a b e l > 
 
 @ @   - 5 9 7 , 1 4   + 6 3 4 , 1 2   @ @   f u n c t i o n   D a t e T i m e P i c k e r ( { 
 
                               < s p a n   c l a s s N a m e = " t e x t - s m   f o n t - m e d i u m " > B u s c a n d o   h o r a r i o s    < / s p a n > 
 
                           < / d i v > 
 
                       ) } 
 
 - 
 
                       { ! l o a d i n g   & &   i s E r r o r   & &   ( 
 
                           < d i v   c l a s s N a m e = " f l e x   f l e x - c o l   i t e m s - c e n t e r   g a p - 2   p y - 8   t e x t - c e n t e r " > 
 
                               < A l e r t C i r c l e   c l a s s N a m e = " h - 6   w - 6   t e x t - r o s e - 4 0 0 "   / > 
 
                               < p   c l a s s N a m e = " t e x t - s m   t e x t - s l a t e - 5 0 0 " > N o   p u d i m o s   c a r g a r   l o s   h o r a r i o s .   I n t e n t a   o t r a   f e c h a . < / p > 
 
                           < / d i v > 
 
                       ) } 
 
 - 
 
                       { ! l o a d i n g   & &   ! i s E r r o r   & &   s l o t s . l e n g t h   = = =   0   & &   ( 
 
                           < d i v   c l a s s N a m e = " f l e x   f l e x - c o l   i t e m s - c e n t e r   g a p - 2   p y - 8   t e x t - c e n t e r " > 
 
                               < C a l e n d a r D a y s   c l a s s N a m e = " h - 6   w - 6   t e x t - s l a t e - 3 0 0 "   / > 
 
 @ @   - 6 1 2 , 2 7   + 6 4 7 , 1 0   @ @   f u n c t i o n   D a t e T i m e P i c k e r ( { 
 
                               < p   c l a s s N a m e = " t e x t - x s   t e x t - s l a t e - 4 0 0 " > P r u e b a   c o n   o t r a   f e c h a   o   e s p e c i a l i s t a . < / p > 
 
                           < / d i v > 
 
                       ) } 
 
 - 
 
                       { ! l o a d i n g   & &   ! i s E r r o r   & &   s l o t s . l e n g t h   >   0   & &   ( 
 
 -                         < d i v   c l a s s N a m e = " g r i d   g r i d - c o l s - 3   g a p - 2   s m : g r i d - c o l s - 4 " > 
 
 -                             { s l o t s . m a p ( ( s l o t )   = >   { 
 
 -                                 c o n s t   a c t i v e   =   s e l e c t e d S l o t ? . i s o   = = =   s l o t . i s o   & &   s e l e c t e d S l o t ? . e m p l o y e e _ i d   = = =   s l o t . e m p l o y e e _ i d ; 
 
 -                                 r e t u r n   ( 
 
 -                                     < b u t t o n 
 
 -                                         k e y = { ` $ { s l o t . i s o } - $ { s l o t . e m p l o y e e _ i d } ` } 
 
 -                                         t y p e = " b u t t o n " 
 
 -                                         o n C l i c k = { ( )   = >   o n P i c k ( s l o t ) } 
 
 -                                         c l a s s N a m e = { c n ( 
 
 -                                             " r o u n d e d - x l   b o r d e r   p x - 2   p y - 2 . 5   t e x t - s m   f o n t - b o l d   t r a n s i t i o n - a l l " , 
 
 -                                             a c t i v e 
 
 -                                                 ?   " b o r d e r - b r a n d - 5 0 0   b g - b r a n d - 5 0 0   t e x t - w h i t e   s h a d o w - s o f t " 
 
 -                                                 :   " b o r d e r - s l a t e - 2 0 0   b g - w h i t e   t e x t - s l a t e - 7 0 0   h o v e r : b o r d e r - b r a n d - 4 0 0   h o v e r : b g - b r a n d - 5 0 " 
 
 -                                         ) } 
 
 -                                     > 
 
 -                                         { s l o t . t i m e } 
 
 -                                     < / b u t t o n > 
 
 -                                 ) ; 
 
 -                             } ) } 
 
 +                         < d i v   c l a s s N a m e = " s p a c e - y - 4 " > 
 
 +                             < S l o t G r o u p   t i t l e = " M a %%a n a "   s l o t s = { m o r n i n g }   s e l e c t e d S l o t = { s e l e c t e d S l o t }   o n P i c k = { o n P i c k }   / > 
 
 +                             < S l o t G r o u p   t i t l e = " T a r d e "   s l o t s = { a f t e r n o o n }   s e l e c t e d S l o t = { s e l e c t e d S l o t }   o n P i c k = { o n P i c k }   / > 
 
                           < / d i v > 
 
                       ) } 
 
                   < / d i v > 
 
 @ @   - 6 4 1 , 6   + 6 5 9 , 4 8   @ @   f u n c t i o n   D a t e T i m e P i c k e r ( { 
 
       ) ; 
 
   } 
 
   
 
 + f u n c t i o n   S l o t G r o u p ( { 
 
 +     t i t l e , 
 
 +     s l o t s , 
 
 +     s e l e c t e d S l o t , 
 
 +     o n P i c k , 
 
 + } :   { 
 
 +     t i t l e :   s t r i n g ; 
 
 +     s l o t s :   P u b l i c S l o t [ ] ; 
 
 +     s e l e c t e d S l o t :   P u b l i c S l o t   |   n u l l ; 
 
 +     o n P i c k :   ( s :   P u b l i c S l o t )   = >   v o i d ; 
 
 + } )   { 
 
 +     i f   ( s l o t s . l e n g t h   = = =   0 )   r e t u r n   n u l l ; 
 
 +     r e t u r n   ( 
 
 +         < d i v > 
 
 +             < d i v   c l a s s N a m e = " m b - 2   f l e x   i t e m s - c e n t e r   g a p - 2 " > 
 
 +                 < s p a n   c l a s s N a m e = " r o u n d e d - f u l l   b g - a c c e n t - 5 0   p x - 2   p y - 0 . 5   t e x t - [ 1 1 p x ]   f o n t - b o l d   u p p e r c a s e   t r a c k i n g - w i d e   t e x t - a c c e n t - 7 0 0 " > { t i t l e } < / s p a n > 
 
 +                 < s p a n   c l a s s N a m e = " t e x t - [ 1 1 p x ]   f o n t - m e d i u m   t e x t - s l a t e - 4 0 0 " > { s l o t s . l e n g t h }   o p c i o n e s < / s p a n > 
 
 +             < / d i v > 
 
 +             < d i v   c l a s s N a m e = " g r i d   g r i d - c o l s - 3   g a p - 2   s m : g r i d - c o l s - 4 " > 
 
 +                 { s l o t s . m a p ( ( s l o t )   = >   { 
 
 +                     c o n s t   a c t i v e   =   s e l e c t e d S l o t ? . i s o   = = =   s l o t . i s o   & &   s e l e c t e d S l o t ? . e m p l o y e e _ i d   = = =   s l o t . e m p l o y e e _ i d ; 
 
 +                     r e t u r n   ( 
 
 +                         < b u t t o n 
 
 +                             k e y = { ` $ { s l o t . i s o } - $ { s l o t . e m p l o y e e _ i d } ` } 
 
 +                             t y p e = " b u t t o n " 
 
 +                             o n C l i c k = { ( )   = >   o n P i c k ( s l o t ) } 
 
 +                             c l a s s N a m e = { c n ( 
 
 +                                 " r o u n d e d - x l   b o r d e r   p x - 2   p y - 2 . 5   t e x t - s m   f o n t - b o l d   t r a n s i t i o n - a l l " , 
 
 +                                 a c t i v e 
 
 +                                     ?   " b o r d e r - b r a n d - 5 0 0   b g - b r a n d - 5 0 0   t e x t - w h i t e   s h a d o w - s o f t " 
 
 +                                     :   " b o r d e r - s l a t e - 2 0 0   b g - w h i t e   t e x t - s l a t e - 7 0 0   h o v e r : b o r d e r - b r a n d - 4 0 0   h o v e r : b g - b r a n d - 5 0 " 
 
 +                             ) } 
 
 +                         > 
 
 +                             { s l o t . t i m e } 
 
 +                         < / b u t t o n > 
 
 +                     ) ; 
 
 +                 } ) } 
 
 +             < / d i v > 
 
 +         < / d i v > 
 
 +     ) ; 
 
 + } 
 
 + 
 
   f u n c t i o n   D e t a i l s F o r m ( { 
 
       c l i e n t , 
 
       s e t C l i e n t , 
 
 @ @   - 6 6 1 , 7   + 7 2 1 , 7   @ @   f u n c t i o n   D e t a i l s F o r m ( { 
 
                           < d i v   c l a s s N a m e = " r e l a t i v e " > 
 
                               < U s e r   c l a s s N a m e = " p o i n t e r - e v e n t s - n o n e   a b s o l u t e   l e f t - 3   t o p - 1 / 2   h - 4   w - 4   - t r a n s l a t e - y - 1 / 2   t e x t - s l a t e - 4 0 0 "   / > 
 
                               < i n p u t 
 
 -                                 c l a s s N a m e = " i n p u t   p l - 9 " 
 
 +                                 c l a s s N a m e = " i n p u t   p l - 1 0 " 
 
                                   v a l u e = { c l i e n t . n a m e } 
 
                                   o n C h a n g e = { ( e )   = >   s e t C l i e n t ( {   . . . c l i e n t ,   n a m e :   e . t a r g e t . v a l u e   } ) } 
 
                                   p l a c e h o l d e r = " T u   n o m b r e " 
 
 @ @   - 6 7 5 , 7   + 7 3 5 , 7   @ @   f u n c t i o n   D e t a i l s F o r m ( { 
 
                               < d i v   c l a s s N a m e = " r e l a t i v e " > 
 
                                   < P h o n e   c l a s s N a m e = " p o i n t e r - e v e n t s - n o n e   a b s o l u t e   l e f t - 3   t o p - 1 / 2   h - 4   w - 4   - t r a n s l a t e - y - 1 / 2   t e x t - s l a t e - 4 0 0 "   / > 
 
                                   < i n p u t 
 
 -                                     c l a s s N a m e = " i n p u t   p l - 9 " 
 
 +                                     c l a s s N a m e = " i n p u t   p l - 1 0 " 
 
                                       i n p u t M o d e = " t e l " 
 
                                       v a l u e = { c l i e n t . p h o n e } 
 
                                       o n C h a n g e = { ( e )   = >   s e t C l i e n t ( {   . . . c l i e n t ,   p h o n e :   e . t a r g e t . v a l u e   } ) } 
 
 @ @   - 6 8 9 , 7   + 7 4 9 , 7   @ @   f u n c t i o n   D e t a i l s F o r m ( { 
 
                                   < M a i l   c l a s s N a m e = " p o i n t e r - e v e n t s - n o n e   a b s o l u t e   l e f t - 3   t o p - 1 / 2   h - 4   w - 4   - t r a n s l a t e - y - 1 / 2   t e x t - s l a t e - 4 0 0 "   / > 
 
                                   < i n p u t 
 
                                       t y p e = " e m a i l " 
 
 -                                     c l a s s N a m e = " i n p u t   p l - 9 " 
 
 +                                     c l a s s N a m e = " i n p u t   p l - 1 0 " 
 
                                       v a l u e = { c l i e n t . e m a i l } 
 
                                       o n C h a n g e = { ( e )   = >   s e t C l i e n t ( {   . . . c l i e n t ,   e m a i l :   e . t a r g e t . v a l u e   } ) } 
 
                                       p l a c e h o l d e r = " t u c o r r e o @ e m a i l . c o m " 
 
 @ @   - 7 2 5 , 6   + 7 8 5 , 7   @ @   f u n c t i o n   S u m m a r y R o w ( {   l a b e l ,   v a l u e   } :   {   l a b e l :   s t r i n g ;   v a l u e :   s t r i n g   } )   { 
 
   f u n c t i o n   A c t i o n B a r ( { 
 
       h i d d e n , 
 
       s t e p , 
 
 +     s t e p C o u n t , 
 
       g o B a c k , 
 
       o n P r i m a r y , 
 
       p r i m a r y L a b e l , 
 
 @ @   - 7 3 6 , 6   + 7 9 7 , 7   @ @   f u n c t i o n   A c t i o n B a r ( { 
 
   } :   { 
 
       h i d d e n :   b o o l e a n ; 
 
       s t e p :   n u m b e r ; 
 
 +     s t e p C o u n t :   n u m b e r ; 
 
       g o B a c k :   ( )   = >   v o i d ; 
 
       o n P r i m a r y :   ( )   = >   v o i d ; 
 
       p r i m a r y L a b e l :   s t r i n g ; 
 
 @ @   - 7 4 8 , 7   + 8 1 0 , 7   @ @   f u n c t i o n   A c t i o n B a r ( { 
 
       i f   ( h i d d e n )   r e t u r n   n u l l ; 
 
       r e t u r n   ( 
 
           < d i v   c l a s s N a m e = " s t i c k y   b o t t o m - 0   z - 3 0   b o r d e r - t   b o r d e r - s l a t e - 2 0 0 / 7 0   b g - w h i t e / 9 0   b a c k d r o p - b l u r - m d " > 
 
 -             < d i v   c l a s s N a m e = " m x - a u t o   f l e x   w - f u l l   m a x - w - 2 x l   i t e m s - c e n t e r   g a p - 3   p x - 4   p y - 3   s m : p x - 6 " > 
 
 +             < d i v   c l a s s N a m e = " m x - a u t o   f l e x   w - f u l l   m a x - w - 5 x l   i t e m s - c e n t e r   g a p - 3   p x - 4   p y - 3   s m : p x - 6 " > 
 
                   { s t e p   >   1   & &   ( 
 
                       < b u t t o n   o n C l i c k = { g o B a c k }   c l a s s N a m e = " b t n   b t n - g h o s t   s h r i n k - 0 "   t y p e = " b u t t o n " > 
 
                           < C h e v r o n L e f t   c l a s s N a m e = " h - 4   w - 4 "   / >   < s p a n   c l a s s N a m e = " h i d d e n   s m : i n l i n e " > A t r % s < / s p a n > 
 
 @ @   - 7 6 4 , 7   + 8 2 6 , 7   @ @   f u n c t i o n   A c t i o n B a r ( { 
 
                           < / > 
 
                       )   :   ( 
 
                           < d i v   c l a s s N a m e = " t e x t - s m   f o n t - m e d i u m   t e x t - s l a t e - 4 0 0 " > 
 
 -                             { s t e p   = = =   1   ?   " S e l e c c i o n a   u n   s e r v i c i o "   :   " C o n t i n %Q%a   p a r a   r e s e r v a r " } 
 
 +                             { s t e p   = = =   1   ?   " S e l e c c i o n a   u n   s e r v i c i o "   :   ` P a s o   $ { s t e p }   d e   $ { s t e p C o u n t }   ,%   C o n t i n %Q%a   p a r a   r e s e r v a r ` } 
 
                           < / d i v > 
 
                       ) } 
 
                   < / d i v > 
 
 @ @   - 8 0 2 , 7   + 8 6 4 , 7   @ @   f u n c t i o n   C o n f i r m a t i o n ( { 
 
       c o n s t   c u r r e n c y   =   r e s u l t . b u s i n e s s . c u r r e n c y _ s y m b o l   | |   " $ " ; 
 
       r e t u r n   ( 
 
           < d i v   c l a s s N a m e = " f l e x   m i n - h - s c r e e n   f l e x - c o l   b g - g r a d i e n t - t o - b   f r o m - b r a n d - 5 0 / 6 0   t o - [ # f 6 f 7 f b ] " > 
 
 -             < T o p B a r   n a m e = { b u s i n e s s N a m e }   i n d u s t r y = " R e s e r v a   c o n f i r m a d a "   s t e p = { 0 }   / > 
 
 +             < T o p B a r   n a m e = { b u s i n e s s N a m e }   i n d u s t r y = " R e s e r v a   c o n f i r m a d a "   s t e p = { 0 }   s t e p C o u n t = { 4 }   s t e p s = { [ ] }   / > 
 
               < m a i n   c l a s s N a m e = " f l e x   f l e x - 1   i t e m s - c e n t e r   j u s t i f y - c e n t e r   p x - 5   p y - 1 0 " > 
 
                   < d i v   c l a s s N a m e = " w - f u l l   m a x - w - m d   a n i m a t e - s l i d e - u p " > 
 
                       < d i v   c l a s s N a m e = " c a r d   o v e r f l o w - h i d d e n   p - 0   t e x t - c e n t e r   s h a d o w - c a r d " > 
 
 @ @   - 8 2 5 , 6   + 8 8 7 , 1 7   @ @   f u n c t i o n   C o n f i r m a t i o n ( { 
 
                               < S u m m a r y R o w   l a b e l = " H o r a "   v a l u e = { f o r m a t T i m e ( a p p o i n t m e n t . s t a r t _ a t ) }   / > 
 
                               < d i v   c l a s s N a m e = " h - p x   b g - s l a t e - 1 0 0 "   / > 
 
                               < S u m m a r y R o w   l a b e l = " E s p e c i a l i s t a "   v a l u e = { a p p o i n t m e n t . e m p l o y e e _ n a m e }   / > 
 
 +                             { a p p o i n t m e n t . r e a s o n s   & &   a p p o i n t m e n t . r e a s o n s . l e n g t h   >   0   & &   ( 
 
 +                                 < d i v   c l a s s N a m e = " p x - 3   p b - 2   p t - 1 " > 
 
 +                                     < d i v   c l a s s N a m e = " f l e x   f l e x - w r a p   g a p - 1 . 5 " > 
 
 +                                         { a p p o i n t m e n t . r e a s o n s . m a p ( ( r )   = >   ( 
 
 +                                             < s p a n   k e y = { r }   c l a s s N a m e = " i n l i n e - f l e x   i t e m s - c e n t e r   g a p - 1   r o u n d e d - f u l l   b g - b r a n d - 5 0   p x - 2   p y - 0 . 5   t e x t - [ 1 1 p x ]   f o n t - b o l d   t e x t - b r a n d - 7 0 0 " > 
 
 +                                                 < S p a r k l e s   c l a s s N a m e = " h - 3   w - 3 "   / >   { r } 
 
 +                                             < / s p a n > 
 
 +                                         ) ) } 
 
 +                                     < / d i v > 
 
 +                                 < / d i v > 
 
 +                             ) } 
 
                               < d i v   c l a s s N a m e = " h - p x   b g - s l a t e - 1 0 0 "   / > 
 
                               < d i v   c l a s s N a m e = " f l e x   i t e m s - c e n t e r   j u s t i f y - b e t w e e n   g a p - 3   p x - 3   p y - 3 " > 
 
                                   < s p a n   c l a s s N a m e = " t e x t - x s   f o n t - s e m i b o l d   u p p e r c a s e   t r a c k i n g - w i d e   t e x t - s l a t e - 4 0 0 " > T o t a l < / s p a n > 
 
 