Ë
    Wk+v  ã                   ód  — d Z ddlZddlZddlmZ ddlmZ ddlmZm	Z	 ddl
mZmZmZmZ ddlmZ ddlmZmZmZ  ej*                  d	«      Zd
Zd\  ZZddddœZddddœZdZd\  ZZg d¢ZeD � ci c]  } | d   | d   “Œ c} Z  G d„ de!«      Z"dEd„Z#de$ddfd„Z%de&de&fd„Z'dee&   fd„Z(de)e&   fd „Z*d!e)e&   ddfd"„Z+d!e)e&   de)e&   fd#„Z,dFde$d$e-de)e&   fd%„Z.de$d&e$dee&   fd'„Z/d(e&d)e-de&fd*„Z0de$d+ee$   de$fd,„Z1de$d(e&de&fd-„Z2de$d.e3d(e&de&fd/„Z4de$d.e3ddfd0„Z5de$d1e)e3   ddfd2„Z6de$d.e3fd3„Z7de$d.e3d4e8de&fd5„Z9de$d.e3d6e3de$fd7„Z:de$d.e3d8e3d9e$fd:„Z;de$d.e3fd;„Z<de$d.e3d<ee&   de&fd=„Z=de$d.e3d>e8de&fd?„Z>de$d.e3de&fd@„Z?de$d.e3de&fdA„Z@de$d.e3dee&   fdB„ZAde3fdC„ZBde$de)e&   fdD„ZCyc c} w )Gu  
format_service.py â€” the formats a family can order for a photo, editable per school (client request: "edit the
formats and prices, add new photo formats and sizes, set their prices" from Settings).

Before this, the seven formats were fixed in code (school_service.FORMAT_PRICE_KEY) and only their prices were
settings. Now every school has a catalogue table:
  * the seven historical formats are rows too (`builtin`): their names, description, order, "popular" badge,
    on/off and what they deliver (kind) can be edited; their PRICE stays where it always was (school_settings `price_*`), so nothing that reads
    prices (and the existing price validation) has two sources of truth. Since 2026-10 they can be deleted like any
    product (client: "every format must be editable"): order lines carry their own name, kind and price, so nothing
    reads the row back. A deleted built-in keeps its row with `deleted_at` set, or `_ensure_builtins` would bring it
    back on the next read.
  * new formats (`fmt-{id}`): a size or support the client invents ("Tirage 13Ã—18", "Poster 30Ã—45", "NumÃ©rique
    + 3 tirages"â€¦), with a kind that says what it delivers: `print` (physical, handed out in class), `digital`
    (gives the HD download after payment) or `pack` (both). An object (key ring, magnetâ€¦) is a `print`: it is
    handed out in class.
ONE list of products (client brief 2026-10-21, sheet 3): the same product at the same price for a classic photo or an
AI photo, so the three "magic-*" built-in rows are hidden (never deleted: old orders and their downloads refer to
them). Each product has an optional image (`has_image`, WebP under PRODUCTS_DIR). The old `school_products` table
(key rings, mugsâ€¦) was merged into this one by `migrate_legacy_products`; its rows stay, unused, as a backup.

The server still owns prices: an order line is checked against this catalogue (format_line), and the line stored
on the order carries what it delivers (`kind`, `digital`) so downloads and print counts never depend on a format
that was edited or removed afterwards.

What a product delivers (`kind`): `print` (handed out in class), `digital` (the HD download), `pack` (both, ONE
price, both delivered) or `choice` (client 2026-10-28: "printed with its price, digital with its price, both with
its price"): three prices, `price` (print), `price_digital` (file) and `price_both` (print + file). A `choice` product
is never ordered as such: `expand` turns it into its three variants, `{id}` (print), `{id}:num` (file) and `{id}:both`
(print + file), for the portal and for the order check, so every order line still says what it delivers.

A product may list what it CONTAINS (`components`, client 2026-10-28: "for a pack, its name and the products in it,
so the lab knows what to print"): [{format_id, qty}] of other products of the school, one level only (a component
has no components). The lab zip and the recap sheet expand the pack into them; the order line keeps a copy, so
editing the pack later never changes a paid order. A component deleted since is left out.

A product may have a print TEMPLATE (`template`, client 2026-11-15): a PNG with transparent holes, so the lab folder
gives the finished montage (calendar, ID photo sheet) instead of the bare photo. See template_service; the order line
keeps a copy of it, like its components.
é    N)ÚOptional)Úconfig)ÚsignÚverify_signature)ÚTABLE_OPTIONSÚensure_columnÚget_dbÚtable_exists)Ú
utcnow_iso)Úschool_serviceÚtemplate_serviceÚtranslate_servicezmeeconic.formats)ÚprintÚdigitalÚpackÚchoice)z:numz:bothu   version numÃ©riquezdigital versionu   versiÃ³n digital©ÚfrÚenÚesu   tirage + numÃ©riquezprint + digitalzcopia + digitaliô  )é
   é2   ))zprint-10x15r   FÚprice_print_10x15)u   Tirage papier 10Ã—15u   10Ã—15 Printu   Copia papel 10Ã—15)z Format standard, remis en classez$Standard format, delivered at schoolu%   Formato estÃ¡ndar, entregado en claseT)zprint-20x30r   FÚprice_print_20x30)u   Tirage papier 20Ã—30u   20Ã—30 Printu   Copia papel 20Ã—30)zGrand format encadrablezLarge frameable formatzFormato grande enmarcableF)r   r   FÚprice_digital)u   NumÃ©rique HDú
Digital HDr   ©u"   TÃ©lÃ©chargement haute dÃ©finitionzHigh-definition downloadu   Descarga en alta definiciÃ³nF)r   r   FÚ
price_pack)zPack completzComplete packzPack completo)u   Tirage 10Ã—15 + numÃ©rique HDu   10Ã—15 print + digital HDu   Copia 10Ã—15 + digital HDF)zmagic-printr   TÚprice_magic_print)u   Impression magique 10Ã—15u   Magic 10Ã—15 printu   ImpresiÃ³n mÃ¡gica 10Ã—15)zTirage papier, remis en classez Paper print, delivered at schoolzCopia papel, entregada en claseF)zmagic-digitalr   TÚprice_magic_digital)u   NumÃ©rique magique HDzMagic digital HDu   Digital mÃ¡gico HDr   F)z
magic-packr   TÚprice_magic_pack)zPack magiquez
Magic packu   Pack mÃ¡gico)u   Impression + numÃ©rique HDzPrint + digital HDu   ImpresiÃ³n + digital HDTé   c                   ó   — e Zd Zy)ÚFormatErrorN)Ú__name__Ú
__module__Ú__qualname__© ó    ú2/var/www/photos/backend/services/format_service.pyr$   r$   Z   s   „ Ør)   r$   Úreturnc            	      óê  — t        «       5 } | j                  dt        › �«       t        | ddd«       t        | ddd«       t        | ddd«       t        | dd	d
«       t        | ddd
«       t        | ddd«       dD ]S  }| j                  d|f«      j	                  «       }|sŒ'|d   xs dt
        k  sŒ8| j                  d|› dt
        › d�«       ŒU | j                  «        d d d «       y # 1 sw Y   y xY w)NaÑ  
        CREATE TABLE IF NOT EXISTS school_formats (
            id         INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
            school_id  VARCHAR(64)  NOT NULL,
            format_id  VARCHAR(40)  NOT NULL,
            builtin    TINYINT NOT NULL DEFAULT 0,
            kind       VARCHAR(10)  NOT NULL,
            magic      TINYINT NOT NULL DEFAULT 0,
            name_fr    VARCHAR(80)  NOT NULL,
            name_en    VARCHAR(80)  NOT NULL DEFAULT '',
            name_es    VARCHAR(80)  NOT NULL DEFAULT '',
            sub_fr     VARCHAR(500) NOT NULL DEFAULT '',
            sub_en     VARCHAR(500) NOT NULL DEFAULT '',
            sub_es     VARCHAR(500) NOT NULL DEFAULT '',
            price      DOUBLE,
            popular    TINYINT NOT NULL DEFAULT 0,
            active     TINYINT NOT NULL DEFAULT 1,
            sort_order INT NOT NULL DEFAULT 0,
            created_at VARCHAR(40),
            UNIQUE KEY uq_school_format (school_id, format_id)
        ) Úschool_formatsÚ	has_imagezINT NOT NULL DEFAULT 0Ú
deleted_atzVARCHAR(40)Ú
componentsÚTEXTr   ÚDOUBLEÚ
price_bothÚtemplate)Úsub_frÚsub_enÚsub_esz”SELECT CHARACTER_MAXIMUM_LENGTH AS n FROM information_schema.COLUMNS WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME='school_formats' AND COLUMN_NAME=?Únr   z"ALTER TABLE school_formats MODIFY z	 VARCHAR(z) NOT NULL DEFAULT '')r	   Úexecuter   r   ÚfetchoneÚSUB_MAXÚcommit)ÚconnÚcolÚrs      r*   Úinit_format_tabler@   ^   s  € Ü	‹ð "�TØ�‰ð ô( ˆ/ð)ô 	ô, 	�dÐ,¨kÐ;SÔTÜ�dÐ,¨l¸MÔJÜ�dÐ,¨l¸FÔCÜ�dÐ,¨o¸xÔHÜ�dÐ,¨l¸HÔEÜ�dÐ,¨j¸&ÔAØ1ò 	pˆCØ—‘ð iØknÐjpórßrzÑrzÓr|ð â�a˜‘f’k ¤WÓ,Ø—‘ÐAÀ#ÀÀiÔPWÈyÐXmÐnÕoð		pð
 	�‰Œ÷E"÷ "ñ "ús   ‹BC)Â!C)Â2.C)Ã)C2Ú	school_idc           
      óŠ  — | j                  d|f«      D �ch c]  }|d   ’Œ	 }}t        D �cg c]  }|d   |vsŒ|d   ‘Œ }}t        t        «      D ]S  \  }\  }}}	}
}}}||vrŒ| j                  d|||t        |	«      g|¢|¢t        |«      ‘|dz   dz  ‘t	        «       ‘­«       ŒU |r| j                  «        yyc c}w c c}w )zeThe historical formats exist as rows for every school (created the first time the catalogue is read).zDSELECT format_id FROM school_formats WHERE school_id=? AND builtin=1Ú	format_idr   zÝINSERT IGNORE INTO school_formats (school_id, format_id, builtin, kind, magic, name_fr, name_en, name_es, sub_fr, sub_en, sub_es, price, popular, active, sort_order, created_at) VALUES (?,?,1,?,?,?,?,?,?,?,?,NULL,?,1,?,?)é   r   N)r9   ÚBUILTINSÚ	enumerateÚintr   r<   )r=   rA   r?   ÚhaveÚbÚmissingÚiÚfidÚkindÚmagicÚ_pkÚnamesÚsubsÚpopulars                 r*   Ú_ensure_builtinsrS   „   sõ   € à$(§L¡LÐ1wØ2;°ó%?ö @˜qˆAˆk‹Nð @€Dð @ä%Ö:˜¨¨1©°TÒ)9ˆq�‹tÐ:€GÐ:Ü<EÄhÓ<Oò iÑ8ˆÑ8ˆC��u˜c 5¨$°Ø�gÑØØ�‰ð:ð ˜˜T¤3 u£:Ðg°Ðg¸Ðg¼cÀ'»lÐgÈQÐQRÉUÐVXÉLÐgÔZdÓZfÑgõ		iðiñ Ø�‰�ð ùò@ùâ:s   –B;¬C ¹C Úsettingsc                 óä  — | d   rt        |t        | d         «      nt        | d   xs d«      }i d| d   “d| d   “dt        | d   «      “d| d   “dt        | d   «      “d|“dt        | d   «      “d	t        | d	   «      “d
| d
   “d| d   “d| d   xs | d   “d| d   xs | d   “d| d   “d| d   xs | d   “d| d   xs | d   “d| d   dv “d| d   dv “t        | d   xs d«      t        | d   xs d«      | d   rd| d   › d| d   › d| d   › �nd | d   rt        | d   | d   | d   «      nd t	        | d   «      t        | d   «      t        j                  | d   t        | d   «      «      dœ¥S )NÚbuiltinrC   Úpricer   ÚidrM   rN   rR   ÚactiveÚ
sort_orderÚname_frÚname_enÚname_esr5   r6   r7   Úphysical)r   r   r   r   )r   r   r   r   r3   r.   z/api/portal/format-image/rA   ú/ú.webp?v=r0   r4   )r   r3   Ú	image_urlÚimage_admin_urlr0   r4   Útemplate_view)ÚfloatÚ_BUILTIN_PRICE_KEYÚboolÚ_admin_image_urlÚ_parse_componentsÚ_parse_templater   Ú
admin_view)r?   rT   rW   s      r*   Ú_row_to_dictrk   •   sS  € ØCDÀYÂ<ŒE�(Ô-¨a°©nÑ=Ñ>Ô?ÔUZÐ[\Ð]dÑ[eÒ[jÐijÓUk€EðØˆa�‰gðØ" A k¡NðØ4=¼tÀAÀiÁLÓ?QðØSYÐ[\Ð]cÑ[dðà”�a˜‘jÓ!ðà#*¨Eðà3<¼dÀ1ÀYÁ<Ó>PðàRZÔ\`ÐabÐckÑalÓ\mðð 	�a˜‘oðð 	�1�Y‘<ð	ð "+¨A¨i©LÒ,H¸A¸i¹Lð	ð KTÐUVÐW`ÑUaÒUqÐefÐgpÑeqð	ð
 	�!�H‘+ðð
  (¨¨8©Ò)C¸¸(¹ðð
 FNÈqÐQYÉ{ÒOiÐ^_Ð`hÑ^iðð 	�A�f‘IÐ!<Ð<ðð ?HÈÈ6ÉÐVsÐIsðô ˜q Ñ1Ò6°QÓ7ÄuÈQÈ|É_ÒMaÐ`aÓGbà˜+šð 1°°;±Ð0@ÀÀ!ÀDÁ'ÀÈ(ÐSTÐU`ÑSaÐRbÑcØ,0ð YZÐZeÒXfÔ+¨A¨k©N¸A¸d¹GÀQÀ{Á^ÔTÐlpÜ'¨¨,©Ó8ä# A j¡MÓ2Ü)×4Ñ4°Q°{±^Ä_ÐUVÐWaÑUbÓEcÓdò!ð r)   c                 óÀ   — 	 | rt        j                  | «      nd }t        |t        «      r$|j	                  d«      r|j	                  d«      r|S d S # t
        $ r Y y w xY w)NÚfileÚslots)ÚjsonÚloadsÚ
isinstanceÚdictÚgetÚ
ValueError)ÚrawÚts     r*   ri   ri   «   sS   € ðÙ"ŒD�J‰J�sŒO¨ˆÜ˜q¤$Ô'¨A¯E©E°&¬M¸a¿e¹eÀG¼nˆqÐVÐRVÐVøÜò Ùðús   ‚AA ÁA Á	AÁAc                 óÊ   — 	 t        j                  | xs d«      D �cg c]  }t        |d   «      t        |d   «      dœ‘Œ! c}S c c}w # t        t
        t        f$ r g cY S w xY w)Nz[]rC   Úqty©rC   rx   )ro   rp   ÚstrrG   rt   Ú	TypeErrorÚKeyError)ru   Úcs     r*   rh   rh   ³   s^   € ðÜRV×R\ÑR\Ð]`Ò]hÐdhÓRiÖjÈQœc ! K¡.Ó1¼#¸aÀ¹h»-ÓHÒjÐjùÒjøÜœ	¤8Ð,ò ØŠ	ðús"   ‚A	 �$AÁA	 ÁA	 Á	A"Á!A"Úformatsc                 óÎ   — | D �ci c]  }|d   |“Œ
 }}| D ]=  }|d   D ��cg c]'  }|d   |v ri |¥dD �ci c]  }|||d      |   “Œ c}¥‘Œ) c}}|d<   Œ? yc c}w c c}w c c}}w )zZEach component gets the names and what it delivers of the product it points at (in place).rC   r0   )r[   r\   r]   r^   r   r4   Nr(   )r~   ÚfÚby_idr}   Úks        r*   Ú_resolverƒ   º   s§   € à(/Ö0 1ˆQˆ{‰^˜QÑÐ0€EÐ0Øò Pˆà$% l¡O÷PØ °q¸±~ÈÑ7Nð P˜að  Pð  JNö  $OÀA A u¨Q¨{©^Ñ'<¸QÑ'?Ñ$?ò  $Oò  Pó Pˆˆ,ŠñPùò 1ùò $Oùó Ps   …A¡A!´AÁA!ÁA!c                 ó   — g }| D ]Á  }|d   dk7  r|j                  |«       Œ|j                  i |¥ddd|d   ddœ¥«       t        dd|d	   dt        ft        d
d|d   dt        ffD ]^  \  }}}}}}|j                  i |¥|d   |z   ||d|g dœ¥|ri ndddœ¥|d   |dœ¥dD �	ci c]  }	d|	› �|d|	› �   › d||	   › �“Œ c}	¥«       Œ` ŒÃ |S c c}	w )a  The orderable list: a `choice` product becomes its print variant (same id), its file (`{id}:num`) and its
    print + file (`{id}:both`), each at its own price, the names saying which. `group` / `variant` let the portal show
    them as one product with three options.rM   r   r   TFrC   )rM   r^   r   ÚgroupÚvariantr   r   r   r3   Úboth)rC   rM   r^   r   rW   r0   N)r4   rc   ©r…   r†   r   Úname_u    Â· )ÚappendÚDIGITAL_SUFFIXÚ_DIGITAL_LABELÚBOTH_SUFFIXÚ_BOTH_LABEL)
r~   Úoutr€   ÚsuffixrM   r^   rW   r†   ÚlabelÚlgs
             r*   Úexpandr“   Â   s^  € ð €CØò 
mˆØˆV‰9˜Ò Ø�J‰J�qŒMØØ�
‰
Ðz�aÐz °dÀuÐWXÐYdÑWeÐryÒzÔ{ä ¨E°1°_Ñ3EÀyÔR`ÐaÜ˜f d¨A¨l©O¸VÄ[ÐQð>Sò 	mÑ9ˆF�D˜( E¨7°Eð �J‰Jð l˜!ð l¨!¨K©.¸6Ñ*AÈ4Ð]eÐrvØ!&°bòlÙCK¹RÐ^bÐuyÑQzðlð GHð  ITñ  GUð  biòlàWiÖjÐQS˜U 2 $˜<¨A°°b°T¨l©OÐ+<¸DÀÀrÁÀÐ)LÑLÒjðlõ mñ	mð
mð €Jùò ks   Â"CÚactive_onlyc                 óV  — t        «       5 }t        || «       t        j                  | |«      }|j	                  d| f«      j                  «       }ddd«       D �cg c]  }t        |«      ‘Œ }}t        |«       |r|D �cg c]
  }|d   sŒ	|‘Œ c}S |S # 1 sw Y   ŒGxY wc c}w c c}w )z›The school's products in order. The hidden `magic-*` rows (one list for classic and AI photos) are not
    listed: nobody can offer or order them any more.ziSELECT * FROM school_formats WHERE school_id=? AND magic=0 AND deleted_at IS NULL ORDER BY sort_order, idNrY   )r	   rS   r   Úget_settingsr9   Úfetchallrk   rƒ   )rA   r”   r=   rT   Úrowsr?   r�   r€   s           r*   Úlist_formatsr™   Õ   s«   € ô 
‹ð P�TÜ˜˜yÔ)Ü!×.Ñ.¨y¸$Ó?ˆØ�|‰|ð 6Ø8A°|óEßEMÁXÃZð 	÷Pð
 /3Ö
3¨Œ<˜˜8Õ$Ð
3€CÐ
3ÜˆS„MÙ.9�sÖ*�!˜a ›kŠAÒ*ÐB¸sÐB÷Pð Püò
 4ùâ*s   ‹ABÁB!Â
B&ÂB&ÂBrC   c                 ó@   ‡— t        ˆfd„t        | «      D «       d «      S )Nc              3   ó4   •K  — | ]  }|d    ‰k(  sŒ|–— Œ y­w)rC   Nr(   )Ú.0r€   rC   s     €r*   ú	<genexpr>zget_format.<locals>.<genexpr>ã   s   øè ø€ ÒS�q°q¸±~ÈÓ7R”ÑSùs   ƒ‘)Únextr™   )rA   rC   s    `r*   Ú
get_formatrŸ   â   s   ø€ ÜÓSœL¨Ó3ÔSÐUYÓZÐZr)   ÚbodyÚcreatingc           
      óº  — i }dD ]W  }ddt         ffD ]H  \  }}|› d|› �}|| v sŒ| |   €Œdj                  t        | |   «      j                  «       «      d | ||<   ŒJ ŒY |r|j	                  d«      st        d«      ‚d|v r|d   st        d«      ‚d	| v r$| d	   �| d	   t        vrt        d
«      ‚| d	   |d	<   n|rt        d«      ‚dD ]M  }|| v sŒ| |   €Œ	 t        t        | |   «      d«      }d|cxk  rdk  st        d«      ‚ t        d«      ‚|||<   ŒO |rd|vrt        d«      ‚|r'|j	                  d	«      dk(  rd|vsd|vrt        d«      ‚dD ]'  }	|	| v sŒ| |	   €Œt        t        | |	   «      «      ||	<   Œ) d| v r*| d   �%t        dt        dt        | d   «      «      «      |d<   d| v r| d   �| d   |d<   |S # t        t        f$ r t        d«      ‚w xY w)Nr   )ÚnameéP   ÚsubÚ_ú r[   zThe French name is required.z The French name cannot be empty.rM   z$kind must be print, digital or pack.z*kind is required (print, digital or pack).)rW   r   r3   é   zInvalid price.r   i'  u*   The price must be between 0 and 10000 â‚¬.rW   zprice is required.r   r   r3   z=A product sold as print, file or both needs the three prices.)rR   rY   rZ   i † r0   )r;   Újoinrz   Úsplitrs   r$   ÚKINDSÚroundrd   r{   rt   rG   rf   ÚmaxÚmin)
r    r¡   r�   ÚlangÚfieldÚmxr‚   ÚkeyrW   Úflags
             r*   Ú_cleanr´   æ   s_  € Ø€CØ"ò =ˆØ&¨´Ð(8Ð9ò 	=‰IˆE�2Ø�'˜˜4˜&Ð!ˆAØ�DŠy˜T !™WÑ0ØŸ™¤# d¨1¡g£,×"4Ñ"4Ó"6Ó7¸¸Ð<��A’ñ	=ð=ñ
 ˜Ÿ™ 	Ô*ÜÐ8Ó9Ð9Ø�CÑ  I¢ÜÐ<Ó=Ð=Ø��~˜$˜v™,Ð2Ø�‰<œuÑ$ÜÐDÓEÐEØ˜6‘lˆˆFŠÙ	ÜÐFÓGÐGØ7ò ˆØ�$Š;˜4 ™9Ñ0ð4Üœe D¨¡IÓ.°Ó2�ð ˜Ô& Ò&Ü!Ð"NÓOÐOð 'Ü!Ð"NÓOÐOØˆC�ŠHðñ �G 3Ñ&ÜÐ.Ó/Ð/Ù�C—G‘G˜F“O xÒ/°_ÈCÑ5OÐS_ÐgjÑSjÜÐYÓZÐZØ%ò .ˆØ�4Š<˜D ™JÑ2ÜœD  d¡Ó,Ó-ˆC�ŠIð.ð �tÑ  \Ñ 2Ð >Ü ¤3 v¬s°4¸Ñ3EÓ/FÓ#GÓHˆˆLÑØ�tÑ  \Ñ 2Ð >Ø  Ñ.ˆˆLÑØ€Jøô! œzÐ*ò 4Ü!Ð"2Ó3Ð3ð4ús   ÃF?Æ?GÚown_format_idc           	      ó  — t        |t        «      rt        |«      t        kD  rt	        dt        › d�«      ‚| j                  d|f«      D �ci c]  }|d   |“Œ
 }}i }|D ]‹  }	 t        |d   «      t        |d   «      }	}||vs||k(  rt	        d«      ‚t        ||   d   «      rt	        d	«      ‚d
|	cxk  r	t        k  sn t	        dt        › d�«      ‚|j                  |d«      |	z   ||<   Œ� |r3|r1| j                  d|d|› d�f«      j                  «       rt	        d«      ‚t        j                   |j#                  «       D �
�cg c]
  \  }
}|
|dœ‘Œ c}}
«      S c c}w # t        t        t        f$ r t	        d«      ‚w xY wc c}}
w )zIThe JSON to store, or FormatError. Same product twice = quantities added.zA pack lists at most z
 products.zeSELECT format_id, components FROM school_formats WHERE school_id=? AND deleted_at IS NULL AND magic=0rC   rx   z8Each product of the pack needs a product and a quantity.z6A pack can only contain other products of this school.r0   z#A pack cannot contain another pack.rD   z#The quantity must be between 1 and ú.r   z[SELECT 1 FROM school_formats WHERE school_id=? AND deleted_at IS NULL AND components LIKE ?z%"z"%z6This product is in a pack: it cannot be a pack itself.ry   )rq   ÚlistÚlenÚMAX_COMPONENTSr$   r9   rz   rG   r{   r|   rt   rh   ÚMAX_COMPONENT_QTYrs   r:   ro   ÚdumpsÚitems)r=   rA   rµ   Úcompsr?   r˜   Úmergedr}   rL   rx   r‚   Úvs               r*   Ú_check_componentsrÁ     s«  € ä�eœTÔ"¤c¨%£j´>Ò&AÜÐ1´.Ð1AÀÐLÓMÐMØ'+§|¡|ØoÐr{Ðq}ó(ö @ !ˆAˆk‰N˜AÑð @€Dð @à€FØò /ˆð	ZÜ˜1˜[™>Ó*¬C°°%±«M�ˆCð �d‰?˜c ]Ò2ÜÐVÓWÐWÜ˜T #™Y |Ñ4Ô5ÜÐCÓDÐDØ�CÔ,Ô,Ô,ÜÐ CÔDUÐCVÐVWÐXÓYÐYØ—j‘j  aÓ(¨3Ñ.ˆˆsŠð/ñ ™ D§L¡LØiØ˜"˜]˜O¨2Ð.Ð/ó%1ç19±³ð%<ô ÐRÓSÐSÜ�:‰:¸f¿l¹l»n×M±d°a¸ Q¨qÓ1ÓMÓNÐNùò'@øô œ8¤ZÐ0ò 	ZÜÐXÓYÐYð	Züó Ns   ÁEÁ"EÅF
Å E?c                 ód  — t        |d¬«      }d}dD ��cg c]^  }t        j                  D ]I  }|j                  |› d�«      r3|j                  |› d|› �«      s|› d|› �|j                  |› d�d«      |f‘ŒK Œ` }}}|rgt        j                  |D �cg c]  }|d   ‘Œ	 c}«      }|€d}n<t        |«      D ].  \  }	\  }
}}||   |	   d	|
j                  d
«      rdnt         ||
<   Œ0 t        «       5 }t        || «       |j                  d| f«      j                  «       d   xs d}|j                  d| dt        «       › �|d   d|d   |j                  dd«      |j                  dd«      |j                  dd«      |j                  dd«      |j                  dd«      |d   |j                  dd«      |j                  dd«      |j                  d|dz   «      t        «       |j                  d«      |j                  d«      f«      }d|j                  › �}|j                  d ||j                  f«       |j                  d!«      r-|j                  d"t        || ||d!   «      |j                  f«       |j                  «        d	d	d	«       t!        | «      }|rd|d#<   |S c c}}w c c}w # 1 sw Y   Œ)xY w)$zÌA product typed in French. Whatever EN / ES text was not given is translated now; if no translation service
    answers the product is saved anyway (shown in French) and `translation_unavailable` says so.T©r¡   F)r£   r¥   Ú_frr¦   Ú rD   Nr£   r¤   zASELECT MAX(sort_order) AS m FROM school_formats WHERE school_id=?Úmr   zòINSERT INTO school_formats (school_id, format_id, builtin, kind, magic, name_fr, name_en, name_es, sub_fr, sub_en, sub_es, price, popular, active, sort_order, created_at, price_digital, price_both) VALUES (?,?,0,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)útmp-rM   r[   r\   r]   r5   r6   r7   rW   rR   rY   rZ   r   r   r3   úfmt-ú0UPDATE school_formats SET format_id=? WHERE id=?r0   z1UPDATE school_formats SET components=? WHERE id=?Útranslation_unavailable)r´   r   ÚTARGETSrs   Ú	translaterF   Ú
startswithr;   r	   rS   r9   r:   r   Ú	lastrowidrÁ   r<   rŸ   )rA   r    ÚdataÚunavailabler°   r¯   ÚgapsÚgÚdonerK   r²   Ú_srcr=   ÚtopÚcurrL   Úfmts                    r*   Úcreate_formatrØ   (  sÕ  € ô �$ Ô&€DØ€Kà(÷LØÔ5F×5NÑ5NòLØ-1Ø�x‰x˜5˜' ˜Ô&¨t¯x©x¸5¸'ÀÀ4À&Ð8IÔ/Jð ˆw�a˜�vÐ §¡¨E¨7°#¨¸Ó ;¸TÒBð LÐBð L€Dñ Lñ Ü ×*Ñ*¸$Ö+?°Q¨A¨a«DÒ+?Ó@ˆØˆ<Ø‰Kä(1°$«ò VÑ$�Ñ$�C˜˜tØ  ™J q™MÐ*T°·±ÀÔ1G©2ÌWÐU��S’	ðVä	‹ð �TÜ˜˜yÔ)Ø�l‰lÐ^ÐajÐ`lÓm×vÑvÓxÐy|Ñ}ò  Cð  BCˆØ�l‰lð;ð ˜$œz›|˜nÐ-¨t°F©|¸QÀÀYÁØ�X‰X�i Ó$ d§h¡h¨y¸"Ó&=¸t¿x¹xÈÐRTÓ?UÐW[×W_ÑW_Ð`hÐjlÓWmØ�X‰X�h Ó# T¨'¡]°D·H±H¸YÈÓ4JÈDÏHÉHÐU]Ð_`ÓLaØ�X‰X�l C¨"¡HÓ-¬z«|¸T¿X¹XÀoÓ=VÐX\×X`ÑX`ÐamÓXnðpó	qˆð �S—]‘]�OÐ$ˆØ�‰ÐGÈ#ÈsÏ}É}ÐI]Ô^Ø�8‰8�LÔ!Ø�L‰LÐLÜ+¨D°)¸SÀ$À|ÑBTÓUÐWZ×WdÑWdÐeôgà�‰Œ÷!ô" �Y Ó
$€CÙØ)-ˆÐ%Ñ&Ø€Jùó=Lùò ,@÷ð ús   •A#JÂJ!Ã.FJ&Ê&J/Úrow_idc                 ó,  — t        |d¬«      }t        «       5 }|j                  d|| f«      j                  «       }|st	        d«      ‚|d   r6|j                  dd «      }|�"t        j                  | t        |d      |i«       d|v rt        || |d   |d   «      |d<   |rQd	j                  d
„ |D «       «      }|j                  d|› d�g |j                  «       ¢|‘­«       |j                  «        |d   }d d d «       t        | «      S # 1 sw Y   ŒxY w)NFrÃ   úNSELECT * FROM school_formats WHERE id=? AND school_id=? AND deleted_at IS NULLzFormat not found.rV   rW   rC   r0   z, c              3   ó&   K  — | ]	  }|› d �–— Œ y­w)z=?Nr(   )rœ   r‚   s     r*   r�   z update_format.<locals>.<genexpr>_  s   è ø€ Ò4¨! ˜s "œXÑ4ùs   ‚zUPDATE school_formats SET z WHERE id=?)r´   r	   r9   r:   ÚLookupErrorÚpopr   Úupdate_settingsre   rÁ   r©   Úvaluesr<   rŸ   )	rA   rÙ   r    rÏ   r=   ÚrowrW   ÚsetsrL   s	            r*   Úupdate_formatrã   N  s)  € Ü�$ Ô'€DÜ	‹ð �TØ�l‰lÐkØ" IÐ.ó0ß08±³
ð 	áÜÐ1Ó2Ð2ØˆyŠ>ð —H‘H˜W dÓ+ˆEØÐ Ü×.Ñ.¨yÔ;MÈcÐR]ÑN^Ñ;_ÐafÐ:gÔhØ˜4ÑÜ!2°4¸ÀCÈÑDTÐVZÐ[gÑVhÓ!iˆD�ÑÙØ—9‘9Ñ4¨tÔ4Ó4ˆDØ�L‰LÐ5°d°V¸;ÐGÐIaÈ4Ï;É;Ë=ÐIaÐZ`ÑIaÔbØ�K‰KŒMØ�+Ñˆ÷%ô& �i Ó%Ð%÷'ð ús   ˜CD
Ä
Dc                 ó‚  — t        «       5 }|j                  d|| f«      j                  «       }|st        d«      ‚|d   r|j                  dt	        «       |f«       n|j                  d|f«       |j                  «        ddd«       	 t        | |«      j                  d¬«       y# 1 sw Y   Œ'xY w# t        $ r Y yw xY w)	zËAny product can be deleted. Paid orders keep the name, kind and price on their own lines, so the history
    and the recap stay complete. A built-in one is only marked deleted (see the module docstring).rÛ   úProduct not found.rV   zHUPDATE school_formats SET deleted_at=?, active=0, has_image=0 WHERE id=?z%DELETE FROM school_formats WHERE id=?NT)Ú
missing_ok)	r	   r9   r:   rÝ   r   r<   Ú
image_pathÚunlinkÚOSError©rA   rÙ   r=   rá   s       r*   Údelete_formatrë   f  s¼   € ô 
‹ð 	�TØ�l‰lÐkØ" IÐ.ó0ß08±³
ð 	áÜÐ2Ó3Ð3ØˆyŠ>Ø�L‰LÐcÔfpÓfrÐtzÐe{Õ|à�L‰LÐ@À6À)ÔLØ�‰Œ÷	ðÜ�9˜fÓ%×,Ñ,¸Ð,Õ=÷	ð 	ûô ò Ùðús   ‹A5B&Â	B2 Â&B/Â2	B>Â=B>Úrow_idsc                 óª  ‡— t        «       5 }t        || «       |j                  d| f«      D �ch c]  }|d   ’Œ	 c}Š|r4t        ˆfd„|D «       «      s t	        t        |«      «      t	        |«      k7  rt        d«      ‚t        |«      D ]  \  }}|j                  d|dz   dz  |f«       Œ! |j                  «        ddd«       yc c}w # 1 sw Y   yxY w)	un   Display order = the order of `row_ids` (the â†‘ â†“ buttons). Products not listed keep their place after them.zFSELECT id FROM school_formats WHERE school_id=? AND deleted_at IS NULLrX   c              3   ó&   •K  — | ]  }|‰v–— Œ
 y ­w)Nr(   )rœ   rK   Úmines     €r*   r�   zreorder.<locals>.<genexpr>  s   øè ø€ Ò=°˜a tœmÑ=ùs   ƒzUnknown product in the list.z1UPDATE school_formats SET sort_order=? WHERE id=?rD   r   N)	r	   rS   r9   Úanyr¹   Úsetr$   rF   r<   )rA   rì   r=   r?   ÚposÚridrï   s         @r*   Úreorderrô   y  sÓ   ø€ ä	‹ð �TÜ˜˜yÔ)Ø!%§¡Ð.vØ/8¨ló"<ö =˜A��$“ò =ˆáœ#Ó=°WÔ=Ô=ÄÄSÈÃ\ÓARÔVYÐZaÓVbÒAbÜÐ<Ó=Ð=Ü! 'Ó*ò 	e‰HˆC�Ø�L‰LÐLÐPSÐVWÑPWÐ[]É~Ð_bÐNcÕdð	eà�‰Œ÷ð ùò=÷ð ús   Œ"C	®CºBC	ÃC	Ã	Cc                 óH   — t         j                  | z  dt        |«      › d�z  S )Nr€   ú.webp)r   ÚPRODUCTS_DIRrG   ©rA   rÙ   s     r*   rç   rç   ˆ  s%   € Ü×Ñ Ñ*¨q´°V³°¸UÐ-CÑCÐCr)   Úwebpc                 óô  — t        «       5 }|j                  d|| f«      j                  «       st        d«      ‚	 d d d «       t	        | |«      }|j
                  j                  dd¬«       |j                  |«       t        «       5 }|j                  d|f«       |j                  «        |j                  d|f«      j                  «       }d d d «       t        | d   «      S # 1 sw Y   Œ©xY w# 1 sw Y   Œ$xY w)NúNSELECT 1 FROM school_formats WHERE id=? AND school_id=? AND deleted_at IS NULLrå   T)ÚparentsÚexist_okz:UPDATE school_formats SET has_image=has_image+1 WHERE id=?z/SELECT format_id FROM school_formats WHERE id=?rC   )
r	   r9   r:   rÝ   rç   ÚparentÚmkdirÚwrite_bytesr<   rŸ   )rA   rÙ   rù   r=   Úpathrá   s         r*   Ú
save_imager  Œ  sñ   € Ü	‹ð 4�TØ�|‰|ÐlØ# YÐ/ó1ß19±³ð<äÐ2Ó3Ð3ð<÷4ô �i Ó(€DØ‡K�K×Ñ˜d¨TÐÔ2Ø×Ñ�TÔÜ	‹ð d�TØ�‰ÐQÐTZÐS\Ô]Ø�‰ŒØ�l‰lÐLÈvÈiÓX×aÑaÓcˆ÷dô �i  [Ñ!1Ó2Ð2÷4ð 4ú÷dð dús   ‹.C"ÂAC.Ã"C+Ã.C7Úversionc           
      ór   — t        d| › dt        |«      › �d«      \  }}d| › dt        |«      › d|› d|› d|› �
S )Núformat-image:r_   i  z/api/media/format-image/r`   z&exp=z&sig=)r   rG   )rA   rÙ   r  ÚexpÚsigs        r*   rg   rg   ›  sQ   € Ü�m I ;¨a´°F³¨}Ð=¸tÓD�H€CˆØ% i [°´#°f³+°¸hÀwÀiÈuÐUXÐTYÐY^Ð_bÐ^cÐdÐdr)   r  r  c                 ó  — t        d| › dt        |«      › �||«      syt        «       5 }|j                  d|| f«      j	                  «       }ddd«       t        | |«      }r|j                  «       r|S dS # 1 sw Y   Œ+xY w)zjThe picture of a product, offered or not, for a signed Settings link; None if the link or the file is bad.r  r_   Nz^SELECT 1 FROM school_formats WHERE id=? AND school_id=? AND deleted_at IS NULL AND has_image>0)r   rG   r	   r9   r:   rç   Úis_file)rA   rÙ   r  r  r=   rá   r  s          r*   Úadmin_imager
     s„   € ä˜m¨I¨;°a¼¸F»°}ÐEÀsÈCÔPØÜ	‹ð ;�TØ�l‰lÐ{Ø" IÐ.ó0ß08±³
ð 	÷;ô �i Ó(€DÙ˜4Ÿ<™<œ>ˆ4Ð3¨tÐ3÷	;ð ;ús   ¨#A5Á5A>c                 óÈ   — t        «       5 }|j                  d|| f«      j                  «       }ddd«       t        | |«      }r|j	                  «       r|S dS # 1 sw Y   Œ+xY w)z]The file of an OFFERED product's picture (a hidden product's picture is not public), or None.zTSELECT 1 FROM school_formats WHERE id=? AND school_id=? AND active=1 AND has_image>0N)r	   r9   r:   rç   r	  )rA   rÙ   r=   rá   r  s        r*   Úpublic_imager  «  sd   € ä	‹ð ;�TØ�l‰lÐqØ" IÐ.ó0ß08±³
ð 	÷;ô �i Ó(€DÙ˜4Ÿ<™<œ>ˆ4Ð3¨tÐ3÷	;ð ;ús   ‹#AÁA!Útplc                 ó2  — t        «       5 }|j                  d|| f«      j                  «       }|st        d«      ‚|j                  d|rt	        j
                  |«      nd |f«       |j                  «        d d d «       t        | d   «      S # 1 sw Y   ŒxY w)NzVSELECT format_id FROM school_formats WHERE id=? AND school_id=? AND deleted_at IS NULLrå   z/UPDATE school_formats SET template=? WHERE id=?rC   )r	   r9   r:   rÝ   ro   r¼   r<   rŸ   )rA   rÙ   r  r=   rá   s        r*   Ú_set_templater  ¶  s‘   € Ü	‹ð �TØ�l‰lÐsØ" IÐ.ó0ß08±³
ð 	áÜÐ2Ó3Ð3Ø�‰ÐFÑ\_ÌÏÉÐTWÌÐeiÐkqÐHrÔsØ�‰Œ÷ô �i  [Ñ!1Ó2Ð2÷ð ús   ‹A+BÂBru   c                 óÞ   — t        «       5 }|j                  d|| f«      j                  «       st        d«      ‚	 ddd«       t	        | |t        j                  | |«      «      S # 1 sw Y   Œ*xY w)zgA new PNG for the product (template_service.TemplateError if refused). Orders already paid keep theirs.rû   rå   N)r	   r9   r:   rÝ   r  r   Úsave)rA   rÙ   ru   r=   s       r*   Úsave_templater  Á  sq   € ä	‹ð 4�TØ�|‰|ÐlØ# YÐ/ó1ß19±³ð<äÐ2Ó3Ð3ð<÷4ô ˜ FÔ,<×,AÑ,AÀ)ÈSÓ,QÓRÐR÷	4ð 4ús   ‹.A#Á#A,c           	      ó,  — t        «       5 }|j                  d|| f«      j                  «       }d d d «       st        d«      ‚t	        |d   «      }|st        j                  d«      ‚t        | |t        j                  |||«      «      S # 1 sw Y   Œ]xY w)NúUSELECT template FROM school_formats WHERE id=? AND school_id=? AND deleted_at IS NULLrå   r4   zThis product has no template.)	r	   r9   r:   rÝ   ri   r   ÚTemplateErrorr  Ú	with_size)rA   rÙ   Úwidth_mmÚ	height_mmr=   rá   r  s          r*   Úresize_templater  Ê  s•   € Ü	‹ð ;�TØ�l‰lÐrØ" IÐ.ó0ß08±³
ð 	÷;ñ ÜÐ.Ó/Ð/Ü
˜#˜j™/Ó
*€CÙÜ×,Ñ,Ð-LÓMÐMÜ˜ FÔ,<×,FÑ,FÀsÈHÐV_Ó,`ÓaÐa÷;ð ;ús   ‹#B
Â
Bc                 ó   — t        | |d«      S )zdBack to "no template": the bare photo goes to the lab. The file stays (paid orders may point at it).N)r  rø   s     r*   Úclear_templater  Ö  s   € ä˜ F¨DÓ1Ð1r)   c                 óº   — t        «       5 }|j                  d|| f«      j                  «       }d d d «       st        d«      ‚t	        |d   «      S # 1 sw Y   Œ$xY w)Nr  rå   r4   )r	   r9   r:   rÝ   ri   rê   s       r*   Útemplate_ofr  Û  sa   € Ü	‹ð ;�TØ�l‰lÐrØ" IÐ.ó0ß08±³
ð 	÷;ñ ÜÐ.Ó/Ð/Ü˜3˜z™?Ó+Ð+÷;ð ;ús   ‹#AÁAc                  ó&  — ddl } d}t        «       5 }t        |d«      s
	 ddd«       yt        |ddd«       |j	                  d«      j                  «       }|D ]û  }|j	                  d|d   d	|d
   › dt        «       › �|d   |d   |d   |d   |d   d|d   xs dz   |d   f	«      }|j                  }|j	                  dd|› �|f«       t        j                  |d   z  t        |d
   «      › d�z  }|d   rB|j                  «       r2| j                  |t        |d   |«      «       |j	                  d|f«       |j	                  d||d
   f«       |dz  }Œý |j                  «        ddd«       |rt        j!                  d|«       |S # 1 sw Y   Œ#xY w)uÆ   Products made before the single list (`school_products`: key rings, mugsâ€¦) become rows here, picture
    included. Once: the old row remembers where it went. Their old orders keep their own lines.r   NÚschool_productsÚmigrated_toÚINTz7SELECT * FROM school_products WHERE migrated_to IS NULLzÈINSERT INTO school_formats (school_id, format_id, builtin, kind, magic, name_fr, name_en, name_es, price, popular, active, sort_order, created_at, has_image) VALUES (?,?,0,'print',0,?,?,?,?,0,?,?,?,0)rA   rÇ   rX   ú-r[   r\   r]   rW   rY   iè  rZ   Ú
created_atrÉ   rÈ   rö   r.   z0UPDATE school_formats SET has_image=1 WHERE id=?z3UPDATE school_products SET migrated_to=? WHERE id=?rD   z4Catalogue: %d product(s) merged into the single list)Úshutilr	   r
   r   r9   r—   r   rÎ   r   r÷   rG   r	  Úcopyfilerç   r<   ÚloggerÚinfo)r$  Úmovedr=   r˜   r?   rÖ   Únew_idÚold_imgs           r*   Úmigrate_legacy_productsr+  æ  sÃ  € ó Ø€EÜ	‹ð �TÜ˜DÐ"3Ô4Ø÷ð ô 	�dÐ-¨}¸eÔDØ�|‰|ÐUÓV×_Ñ_ÓaˆØò 	ˆAØ—,‘,ðxà�;‘ 4¨¨$© y°´*³,°Ð!@À!ÀIÁ,ÐPQÐR[ÑP\Ð^_Ð`iÑ^jÐlmÐnuÑlvØ�8‘˜d a¨¡oÒ&:¸Ñ;¸Q¸|¹_ðNóOˆCð
 —]‘]ˆFØ�L‰LÐKÐPTÐU[ÐT\ÈoÐ_eÐMfÔgÜ×)Ñ)¨A¨k©NÑ:ÄÀAÀdÁGÃ¸~ÈUÐ=SÑSˆGØ�Š~ '§/¡/Ô"3Ø—‘ ¬°A°k±NÀFÓ)KÔLØ—‘ÐOÐRXÐQZÔ[Ø�L‰LÐNÐQWÐYZÐ[_ÑY`ÐPaÔbØ�Q‰J‰Eð	ð 	�‰Œ÷'ñ( Ü�‰ÐJÈEÔRØ€L÷-ð ús   ‘F¨D=FÆFc                 ó®   — t        t        | d¬«      «      D ��cg c])  }i dD �ci c]  }|||   “Œ
 c}¥d|v r|d   |d   dœni ¥‘Œ+ c}}S c c}w c c}}w )u¡   Offered products for the family's gallery, in order â€” the same list for classic and AI photos. A `choice`
    product comes as its two variants (see `expand`).T)r”   )rC   rM   rW   rR   r^   r   r[   r\   r]   r5   r6   r7   ra   r…   r†   rˆ   )r“   r™   )rA   r€   r‚   s      r*   Úportal_viewr-    s�   € ô œL¨ÀÔEÓF÷Hð ðYð "cö d˜A��1�Q‘4‘ò dð YàBIÈQÁ,˜!˜G™*°°9±Ò>ÐTVòYó Hð Hùò dùó Hs   š
A¤A±AÁA)r+   N)F)DÚ__doc__ro   ÚloggingÚtypingr   Úcorer   Úcore.securityr   r   Úcore.dbr   r   r	   r
   Úcore.timeutilr   Úservicesr   r   r   Ú	getLoggerr&  r«   r‹   r�   rŒ   rŽ   r;   rº   r»   rE   re   rt   r$   r@   rz   rS   rr   rk   ri   r¸   rh   rƒ   r“   rf   r™   rŸ   r´   rÁ   rØ   rG   rã   rë   rô   rç   Úbytesr  rg   r
  r  r  r  r  r  r  r+  r-  )rI   s   0r*   ú<module>r8     s‚  ðñ'óP Û Ý å ß 0ß FÓ FÝ $ß HÑ Hà	ˆ×	Ñ	Ð-Ó	.€à.€Ø-Ñ €�Ø,Ð4EÐM_Ñ`€Ø*Ð2CÐK\Ñ]€ð €Ø$*Ñ !€Ð!ò€ð. +3Ö3 Q�a˜‘d˜A˜a™D‘jÒ3Ð ô	�*ô 	ó#ðL cð ¨dó ð"˜dð  tó ð,˜H T™Nó ð˜d 4™jó ðP�d˜4‘jð P Tó Pð�D˜‘Jð  4¨¡:ó ñ&
C˜Cð 
C¨dð 
C¸tÀD¹zó 
Cð[˜#ð [¨#ð [°(¸4±.ó [ð%�ð % ð %¨$ó %ðPO sð O¸8ÀC¹=ð OÐTWó Oð4#˜Sð #¨ð #°ó #ðL&˜Sð &¨#ð &°Tð &¸dó &ð0˜Sð ¨#ð °$ó ð&
�sð 
 T¨#¡Yð 
°4ó 
ðD˜#ð D só Dð3˜#ð 3 sð 3°%ð 3¸Dó 3ðe ð e¨Sð e¸3ð eÀ3ó eð
4˜3ð 4¨ð 4°#ð 4¸Có 4ð4˜Cð 4¨ó 4ð3˜Sð 3¨#ð 3°H¸T±Nð 3Àtó 3ðS˜Sð S¨#ð S°Eð S¸dó Sð	b˜sð 	b¨Cð 	bÈó 	bð2˜cð 2¨3ð 2°4ó 2ð
,˜3ð ,¨ð ,°¸±ó ,ð ó ð<H˜3ð H 4¨¡:ô Hùò[ 4s   Á/F-