+
    ;i                        R t ^ RIHt ^ RIHtHt ^ RIt^ RIt^ RIH	t	 ^ RI
t
^ RIHtHtHtHt ]
P                   ! R4      tR R ltR	 R
 ltRRR^RR/R R lltR.tR# )zVoucher normal-price consensus loader/cache.

Extracted from `Inventory_Search_Folder.voucher_search` so web/desktop callers
can reuse the same logic from a standalone `Boot_Features` module.
)annotations)CounterdefaultdictN)Path)DictListOptionalTuplez^\s*(?P<style>\d{4,6})\s*,.*?,\s*(?P<normal>\d+(?:\.\d{2})?)\s*,,\s*(?P<discount>\d+(?:\.\d{1,2})?)\s*,\s*(?P<discounted>\d+(?:\.\d{2})?)\bc                    V ^8  d   QhRRRR/# )   voucher_rootr   return )formats   "gC:\Users\jasti\Documents\My_Sync\Shared\61_RW_Site\Pulled_Info\Boot_Features\voucher_price_consensus.py__annotate__r      s     ` `d `t `    c                    \        V 4      P                  4       P                  R ,          pVR,          P                  4       #   \         d2    \        T 4      P                  4       R,          P                  4       u # i ; i)configz"voucher_price_consensus_cache.jsonz#.voucher_price_consensus_cache.json)r   resolveparent	Exception)r   cfgs   & r   _price_consensus_cache_pathr      so    `< ((*11H<::CCEE `\"**,/TT]]__`s   A A 9A?>A?c                    V ^8  d   QhRRRR/# )r   r   r   r   zList[Tuple[str, int]]r   )r   s   "r   r   r   "   s      T 6K r   c                z   . p\        V 4      P                  4       P                  4       pVP                  4       '       g   V#  \        P
                  ! V4       F  w  r4p \        V4      pWb8X  d   R M\        VP                  V4      4      pVP                  4       p\        \        VR\        VP                  R,          4      4      4      p	VP                  Wy34       VP                  \        P                  R7       K  	  TP                  R R7       T#   \         d     K  i ; i  \         d    . u # i ; i).st_mtime_nsi ʚ;)keyc                0    V ^ ,          P                  4       # )    )casefold)ts   &r   <lambda>,_compute_voucher_dir_stamp.<locals>.<lambda>4   s    1Q4==?r   )r   
expanduserr   existsoswalkstrrelative_tostatintgetattrst_mtimeappendsortr!   r   )
r   outrootdirpathdirnames_prelstmtime_nss
   &         r   _compute_voucher_dir_stampr:   "   s    !#C((*224D;;==
$&GGDM GqMYcCd0C,DVVXwr=#bkkM>Y:Z[\

C?+#,,/ %2 HH*H+J   	s7   D*  BD?D* D'#D* &D''D* *D:9D:valid_styles	min_agreeforce_rebuildFc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r   r   r   r;   zOptional[set[str]]r<   r,   r=   boolr   zDict[str, float]r   )r   s   "r   r   r   8   sC     T TT %	T
 T T Tr   c                  \        V 4      P                  4       P                  4       p\        V4      p\	        V4      pV'       Ege    VP                  4       '       EdM   \        P                  ! VP                  RR7      4      p\        V\        4      '       Ed   \        VP                  R^ 4      4      ^8X  d   \        VP                  RR4      4      \        V4      8X  d   VP                  R4      V U	U
u. uF  w  rW.NK
  	  up
p	8X  d   \        VP                  R4      \        4      '       dw   VP                  R/ 4      P                  4        UUu/ uFI  w  r\        V4      '       g   K  \        T;'       g    ^ 4      ^ 8  g   K4  \        V4      \        V4      bKK  	  upp# \#        \$        4      p \'        VP)                  R4      4      pV F  p / pVP+                  R	RR
R7      ;_uu_ 4       pV F  p\,        P/                  T;'       g    R4      pV'       g   K,  V! VP1                  R4      4      pVe
   VV9  d   KP   \        VP1                  R4      4      pT^ 8:  d   Kt  TT9  g   K}  TTT&   K  	  RRR4       VP                  4        F"  w  ppVV,          V;;,          ^,          uu&   K$  	  K  	  / pVP                  4        F  w  ppV'       g   K  VP3                  ^4      pV^ ,          w  pp\5        V4      ^8  d   V^,          ^,          M^ pV\        V4      8  g   Ka  VV8  g   Kj  \        V4      V\        V4      &   K  	   VP6                  P9                  RRR7       R^R\        V4      RV U	U
u. uF  w  rW.NK
  	  up
p	RV/pVP;                  \        P<                  ! V^RR7      RR7       V# u up
p	i u uppi   \          d     EL<i ; i  \          d    . p EL&i ; i  \          d     EK  i ; i  + '       g   i     EL; i  \          d     EK^  i ; iu up
p	i   \          d     T# i ; i)zBBuild/load cached normal-price consensus from voucher `.md` files.zutf-8)encodingversionr2    	dir_stamppricesz*.mdrignore)rA   errorsstyleNnormalT)parentsexist_ok)indent	sort_keys)r   r%   r   r   r:   is_filejsonloads	read_text
isinstancedictr,   getr)   itemsfloatr   r   r   sortedrglobopen_VOUCHER_PRICE_LINE_REmatchgroupmost_commonlenr   mkdir
write_textdumps)r   normalize_styler;   r<   r=   r2   
cache_pathcurrent_stamppayloadabkvstyle_price_countsmd_filesr6   	file_seenflnmnormnormal_pricerE   counterranked	top_price	top_countsecond_counts   &$$$$                       r   #load_voucher_normal_price_consensusrx   8   s    ((*224D,T2J.t4M=	!!##**Z%9%97%9%KLw--GKK	156!;GKK34D	AK04VaV4VV"7;;x#8$?? %,KK"$=$C$C$E$EDAq6 )&+AFFma&7 )Aa($E  5@4H$**V,- 	*,Igh??1B.44RXX2>A *1777+;<D#/D4L !',QWWX->'? $q( 9,*6	$  @" '0oo&7"l"4(6!;6 '8) 2  "F+113g$$Q'%ay	9'*6{Qvay|AI&9|+C %i 0F3t9 4
t<qCI];]TQ1&];f	
 	djjdKV]^ M 5W
  		   % ! ! @??&  		$ <  Ms   O BO :OAO O2O 	OO'O ;O+ P&9PP&&PO?'P9	P>P&0P? P91P? O O('O(+O<;O<?P
PPPP#	P&&P65P69P? ?QQrx   )__doc__
__future__r   collectionsr   r   rP   r'   pathlibr   retypingr   r   r   r	   compiler[   r   r:   rx   __all__r   r   r   <module>r      sw    # ,  	  	 . . ) `,T (,	T
 T  Tn 1
1r   