From a54973f3e17ce04b88ceaafc7df8c6fee6a99e3a Mon Sep 17 00:00:00 2001 From: chriSmile0 Date: Wed, 19 Jun 2024 17:22:09 +0200 Subject: [PATCH 1/3] update auchan --- .gitignore | 2 +- dev/JSON_updates.php | 87 +- dev/copy_all_leclerc.html | 898 -- insiders_JS/analyze_request_leclerc.js | 12736 ----------------------- insiders_JS/cdata_WebFormSubmit.js | 44 - src/control_google_.js | 31 - src/libJSON/systemeu_per_city.json | 840 ++ src/libJSON/systemeu_per_ens.json | 840 ++ src/scrape_su.js | 76 +- src/scrapper_auchan.php | 29 +- src/scrapper_carrefour.php | 28 +- src/scrapper_intermarche.php | 4 +- src/scrapper_monoprix.php | 4 +- src/scrapper_systemeu.php | 58 +- your_project/process_p.php | 7 +- your_project/process_p2.php | 564 + your_project/usage.php | 6 +- your_project/usage2.php | 423 + 18 files changed, 2913 insertions(+), 13764 deletions(-) delete mode 100644 dev/copy_all_leclerc.html delete mode 100644 insiders_JS/analyze_request_leclerc.js delete mode 100644 insiders_JS/cdata_WebFormSubmit.js delete mode 100644 src/control_google_.js create mode 100644 src/libJSON/systemeu_per_city.json create mode 100644 src/libJSON/systemeu_per_ens.json create mode 100755 your_project/process_p2.php create mode 100755 your_project/usage2.php diff --git a/.gitignore b/.gitignore index 5847f3b..c8fcf9d 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,5 @@ test*.js *.phar *.lock *-lock.json -screen_*.png +*.png vendor \ No newline at end of file diff --git a/dev/JSON_updates.php b/dev/JSON_updates.php index ad702cb..d19a291 100644 --- a/dev/JSON_updates.php +++ b/dev/JSON_updates.php @@ -1,6 +1,7 @@ 1) ? "$tabs],\n" : ",\n" )) : ",\n"; } $next = $associative_tabs[$keys[$size-1]]; $rtn .= "$tabs\"".$keys[$size-1] . "\" : " . my_json_rec_encode($actual,$next,$tabs."\t").""; - $rtn .= (is_array($next)) ? ((array_keys($next)[0]!="0") ? "$tabs}\n" : "$tabs]\n") : "\n"; + $rtn .= (is_array($next)) ? ((array_keys($next)[0]!="0") ? "$tabs}\n" : ((sizeof($next) > 1) ? "$tabs],\n" : "\n" )) : "\n"; } else { - $rtn .= $actual . "[\n"; $size = sizeof($associative_tabs); - for($cpt = 0 ; $cpt < $size-1;$cpt++) { - $rtn .= "$tabs".$associative_tabs[$cpt].",\n"; + if($size == 1) { + $rtn .= $associative_tabs[0] .""; + } + else { + $rtn .= $actual . "[\n"; + for($cpt = 0 ; $cpt < $size-1;$cpt++) { + $rtn .= "$tabs".$associative_tabs[$cpt].",\n"; + } + $rtn .= "$tabs".$associative_tabs[$size-1]."\n"; } - $rtn .= "$tabs".$associative_tabs[$size-1]."\n"; } return $rtn; } @@ -90,7 +96,72 @@ function my_json_rec_encode(string $actual,$associative_tabs, string $tabs) { } -$file_content = file_get_contents('copy_all_leclerc.html'); +//-------------------------------- SYSTEMU SUB_PART --------------------------// + +/*$file_content = file_get_contents('copy_all_leclerc.html'); $rtn = array_lines_to_my_json(explode("\n",$file_content),$keys,"PostalCode"); -echo $rtn; +echo $rtn;*/ +/*function extract_href_su() { + $file_content = file_get_contents('copy_all_systemeu.html'); + $lines = explode("\nurl",$file_content); + $sub_lines = ""; + foreach($lines as $l) { + $sub_lines .= "url".substr($l,0,strpos($l,">"))."\n"; + } + return $sub_lines; +} +echo extract_href_su();*/ +function town_in_specific_syntax(string $town) : string { + $unwanted_array = array( 'Š'=>'S', 'š'=>'s', 'Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', + 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', + 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss', 'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c', + 'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o', + 'ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'þ'=>'b', 'ÿ'=>'y', '&' => ''); + $str = strtr( $town, $unwanted_array ); + $tr = str_replace(array(' ','+','\''), '',$str); + return strtolower($tr); +} + +function change_lines_su() { + $file_content = file_get_contents('links_idf_systemeu.html'); + $lines = explode("\n",$file_content); + $sub_lines = ""; + foreach($lines as $l) { + $town_type = (explode(";",town_in_specific_syntax($l))); + $sub_lines .= $town_type[1] . "-".$town_type[0]."\n"; + } + return $sub_lines; +} +//echo change_lines_su(); + +function create_json_per_ens() { + $file_content = file_get_contents('links_systemeu_sort.html'); + $lines = explode("\n",$file_content); + $types = ["uexpress","hyperu","superu"]; + $arr = array();//array([$types[0],$types[1],$types[2]]); + foreach($lines as $l) { + $i = 0; + $l = substr($l,31); + $t = ""; + for($i = 0; $i < 3; $i++) + if((strpos($l,$t=$types[$i])===0)) + break; + + $arr[$t][] = "\"".substr($l,strlen($t)+1)."\""; + } + return $arr; +} + +function create_json_per_city() { + $file_content = file_get_contents('links_systemeu_sort.html'); + $lines = explode("\n",$file_content); + foreach($lines as $l) { + $l = substr($l,31); + $t = substr($l,0,$p=strpos($l,"-")); + $arr[substr($l,$p+1)][] = "\"".$t."\""; + } + return $arr; +} +//echo my_json_encode(create_json_per_ens()); +//echo my_json_encode(create_json_per_city()); ?> \ No newline at end of file diff --git a/dev/copy_all_leclerc.html b/dev/copy_all_leclerc.html deleted file mode 100644 index 5d96167..0000000 --- a/dev/copy_all_leclerc.html +++ /dev/null @@ -1,898 +0,0 @@ -017402_1311_74960_Cran-Gevrier_2,9km -017403_1314_74370_Relais Pringy_4,3km -037302_147_73100_Grésy-sur-Aix_25,9km -027418_1333_74160_Relais Technopole d'Archamps_26,6km -027413_1313_74160_Relais Saint-Julien-en-Genevois_27,3km -027412_1400_74800_Relais Saint-Pierre-en-Faucigny_27,5km -037303_1265_73100_Relais Aix-les-Bains_28,4km -027420_1335_74130_Relais Bonneville Gare SNCF_29,8km -027415_1330_74100_Relais Pas-de-l'Echelle_29,9km -057301_1350_73460_Tournon/Albertville_32,5km -027402_87_74380_Cranves-Sales_33,7km -037301_146_73420_Voglans_34,3km -027411_86_74100_Ville-la-Grand / Annemasse _35,2km -027419_1374_74250_Relais Viuz-en-Sallaz_36,7km -027416_1331_74120_Relais Megève_38,2km -027301_84_73000_Chambéry_38,6km -027302_85_73490_La Ravoire_39,0km -027414_1356_74700_Relais Sallanches_39,9km -027303_1155_73000_Relais Chambéry_40,3km -123801_424_38480_Pont-de-Beauvoisin_55,0km -027417_1385_74400_Relais Chamonix_55,1km -083801_766_38300_Bourgoin-Jallieu_74,8km -083811_312_38070_Saint-Quentin-Fallavier_83,9km -010101_1_01700_Beynost_88,6km -063801_249_38130_Echirolles Comboire_90,5km -166902_493_01700_Les Echets / Miribel_94,2km -013901_735_39300_Champagnole_95,5km -010111_2_69140_Rillieux-la-Pape / Caluire-et-Cuire_97,4km -256901_576_69970_Chaponnay_97,4km -166903_494_69720_Rochetaillée_100,2km -206901_537_69200_Vénissieux_100,4km -166901_492_69730_Genay_101,2km -176901_510_69009_Lyon 9e_104,3km -013801_26_38160_Chatte_105,6km -067101_975_71500_Louhans_106,2km -093802_344_38200_Vienne_106,6km -226911_560_69530_Brignais_108,3km -226901_559_69290_Craponne_108,3km -266901_579_69400_Arnas_109,2km -196901_530_69400_Limas_109,5km -027101_83_71000_Mâcon_109,7km -216901_548_69380_Civrieux d'Azergues_110,5km -093801_343_38121_Reventin-Vaugris_110,8km -093803_345_69420_Ampuis_112,7km -054201_209_69700_Givors_113,2km -022501_1382_25300_Pontarlier_113,6km -093804_346_38370_Saint-Clair-du-Rhône_117,3km -074201_283_42410_Chavanay_119,8km -112601_397_26140_Saint-Rambert-d'Albon_123,3km -236901_570_69170_Tarare_129,1km -052601_203_26300_Bourg-de-Péage_129,2km -074211_284_07430_Davezieux_132,4km -117111_408_71100_Chalon sur Saône Sud Lux_136,2km -082602_308_07300_Tournon-sur-Rhône_138,4km -042501_1237_25800_Valdahon_139,8km -023901_1060_39100_Dole_140,4km -047102_795_71100_Chalon-sur-Saône_141,1km -047101_182_71880_Chatenoy-le-Royal_142,2km -082601_307_26500_Bourg-lès-Valence_142,6km -054211_210_42000_Saint-Etienne_142,7km -092602_338_07130_Saint-Peray_145,4km -092601_337_26000_Valence_146,7km -064201_250_42150_La Ricamarie / Saint-Etienne_146,8km -010501_6_05000_Gap Avenue Emile Didier_148,2km -024201_67_42163_Andrézieux Bouthéon_148,9km -032511_109_25000_Besançon_149,7km -010502_7_05000_Gap Avenue de Provence_151,4km -052101_734_21130_Auxonne_152,9km -064202_251_42700_Firminy_153,1km -087101_326_71300_Montceau-les-Mines_160,6km -034201_118_42153_Riorges / Roanne_160,6km -042101_161_21200_Beaune_160,8km -037101_144_71670_Le Breuil_162,1km -057101_230_71600_Paray-le-Monial_167,6km -022111_1068_21600_Longvic_175,1km -022101_54_21160_Marsannay-la-Côte / Dijon Sud_175,3km -210311_540_21800_Quetigny Dijon Est_176,4km -107101_389_71160_Digoin_177,0km -210301_539_21000_Dijon Capnord_179,5km -210302_1267_21121_Relais Fontaine-lès-Dijon_180,5km -097101_364_71400_Autun_183,7km -032501_108_25400_Audincourt_184,7km -032502_1001_25200_Le Piéton de Montbéliard Centre-ville_186,2km -102601_377_26200_Montélimar Sud_186,6km -032521_1192_25600_Sochaux_187,2km -037002_794_25200_Bethoncourt_188,0km -027001_82_70000_Noidans-lès-Vesoul_190,8km -037001_143_70400_Héricourt_194,6km -064211_252_43700_Brives Charensac_196,9km -017001_1091_70200_Lure_199,9km -019001_44_90000_Belfort_200,5km -056301_224_63300_Thiers_200,8km -019002_1035_90300_Valdoie_204,2km -058401_238_84500_Bollène_206,2km -096801_363_68560_Hirsingue_206,4km -030301_95_03300_Cusset / Vichy_209,8km -086801_325_68130_Altkirch_210,5km -030311_1139_03700_Bellerive-sur-Allier / Charmeil_212,8km -106801_388_68730_Blotzheim_216,7km -606801_607_68300_Saint-Louis_217,1km -646801_610_68290_Masevaux_219,0km -015201_32_52200_Langres_223,9km -036811_142_68200_Mulhouse Stoessel_224,2km -026801_81_68700_Cernay_225,1km -050302_197_03000_Moulins Sud_226,2km -626801_1087_68170_Rixheim_228,0km -035801_131_58300_Decize_228,8km -050301_196_03000_Avermes_228,8km -036801_141_68270_Mulhouse Wittenheim_230,2km -010401_4_04100_Manosque Route de Volx_230,7km -048401_191_84400_Apt_231,8km -016301_38_63100_Clermont Ferrand_232,2km -010402_5_04100_Manosque Saint-Joseph_232,4km -036301_137_63200_Enval / Volvic_236,7km -066801_264_68500_Guebwiller_237,7km -078801_1384_88200_Saint-Etienne Les Remiremont_238,4km -053001_205_30133_Les Angles / Avignon_241,4km -013001_23_30100_Alès_252,4km -021501_50_15100_Saint-Flour_252,7km -015811_35_58000_Saint-Eloi_253,8km -010601_8_06140_Vence_254,3km -018801_736_88140_Contrexeville_255,2km -261301_577_13650_Meyrargues_255,4km -038801_153_88190_Golbey_255,8km -160602_1282_06130_Relais Grasse-Place Buanderie fermé_256,6km -056811_229_68000_Colmar Les Erlen_257,0km -160601_483_06130_Grasse_258,2km -035201_126_52000_Chaumont_258,5km -015801_34_58000_Nevers_258,8km -616801_972_68124_Wintzenheim_259,2km -090611_336_06480_La Colle-sur-Loup_259,6km -028801_1015_88600_Bruyères_259,9km -056801_228_68000_Colmar Espace Korzilius_261,7km -160611_991_06250_Mougins_263,1km -168312_996_83300_Draguignan-Nord_264,5km -161301_484_13300_Salon-de-Provence_265,0km -025801_75_58500_Clamecy_265,1km -168313_1077_83300_Draguignan Sud_265,4km -228304_564_83600_Esterel fermé_267,2km -023012_1037_30000_Relais Nîmes Rue de la Madeleine_268,4km -023013_1292_30900_Relais Nîmes Castanet_269,7km -023001_60_30000_Nîmes Mas des Abeilles_270,0km -181301_518_13200_Arles_270,7km -168314_1337_83490_Relais Le Muy-Collet Redon_271,4km< -023011_61_30000_Nîmes Kennedy_271,9km -048801_193_88100_Saint-Dié-des-Vosges_273,1km -048901_194_89700_Tonnerre_274,0km -228301_561_83520_Roquebrune-sur-Argens_274,1km -068801_273_88300_Neufchâteau_276,6km -198301_531_83170_Brignoles_277,2km -228302_562_83600_Fréjus_277,2km -040301_157_03100_Montluçon Les Marais_277,6km -168301_496_83340_Cannet-des-Maures_279,0km -251301_574_13800_Istres_279,1km -228303_563_83700_Saint-Raphaël_279,6km -171302_501_13127_Vitrolles RN113_279,8km -036702_612_67600_Sélestat Quartier Ouest_281,1km -041001_158_10200_Bar-sur-Aube_281,7km -221311_976_13170_Les Pennes-Mirabeau_283,1km -036701_664_67600_Sélestat ZI Nord_283,3km -171301_500_13127_Vitrolles_283,4km -088801_330_88110_Raon l'Etape_284,2km -211301_541_13700_Marignane_286,0km -036703_1095_67600_Hilsenheim_286,1km -028902_1160_89000_Relais Auxerre Centre Ville_286,9km -168302_497_83790_Pignans_288,6km -028901_93_89000_Auxerre Perrigny_289,1km -051801_202_18200_Saint-Amand-Montrond_290,0km -053401_206_34400_Lunel_293,6km -238301_571_83310_Cogolin_296,6km -095401_352_54300_Lunéville_298,7km -031011_98_10270_Lusigny-sur-Barse_298,8km -021901_53_19200_Ussel_300,0km -018903_1295_89210_Relais Brienon-sur-Armançon_301,0km -031301_1378_13009_Marseille Sormiou_301,9km -025201_1402_52170_Rachecourt sur Marne_302,4km -041011_1111_10500_Brienne-le-Château_302,5km -118311_1195_13600_La Ciotat_303,0km -093401_340_34920_Le Crès / Montpellier_303,2km -056701_227_67150_Erstein_303,3km -656701_611_67210_Obernai_303,6km -018901_900_89400_Migennes_304,4km -018902_1269_89400_Relais Epineau-Les-Voves_304,6km -031021_99_10430_Rosières-près-Troyes_306,2km -125401_428_54500_Vandoeuvre-lès-Nancy_306,3km -031001_96_10410_Saint Parres aux Tertres / Troyes_306,6km -218301_550_83160_La Valette / Toulon_307,4km -011502_992_15000_Aurillac Piéton Centre Ville_307,5km -125403_1349_54500_Relais Vandoeuvre-Vélodrome_307,7km -218303_1198_83200_Relais Toulon Pont du Las_308,6km -155401_472_54200_Dommartin-lès-Toul_308,9km -218302_935_83000_Piéton Toulon_309,0km -011501_12_15000_Aurillac Belbex_309,1km -145402_1084_54000_Relais Saint-Dizier Nancy_310,4km -125402_1025_54000_Relais Nancy-Gare_310,4km -118301_413_83500_La Seyne-sur-Mer_310,4km -031801_105_18390_Bourges Saint-Germain-du-Puy_310,5km -093412_1003_34000_Relais Montpellier-Carnot_310,8km -093413_1004_34000_Relais Montpellier-Courreau_311,0km -175401_505_54000_Nancy_311,0km -175413_1274_54000_Relais Nancy Albert 1er_311,1km -656702_1146_67120_Duttlenheim_311,7km -093421_1145_34080_Montpellier Pierres Vives_311,8km -175411_506_54270_Essey-lès-Nancy_312,5km -031002_97_10600_Barberey / Troyes_314,0km -093411_341_34970_Montpellier Garosud_314,0km -051201_198_12100_Millau_314,6km -031802_1232_18000_Relais Bourges_315,1km -686701_1050_67400_Illkirch_315,4km -626701_608_67118_Geispolsheim Rond-point La Vigie_315,4km -025201_71_52100_Saint-Dizier_315,5km -145401_458_54390_Frouard_316,3km -015502_974_55500_Ligny-en-Barrois_316,6km -031811_106_18230_Saint-Doulchard / Bourges_316,8km -025201_1403_52100_Moëslains Base Aérienne 113_317,2km -746701_613_67810_Holtzheim Zone d'activité Holtzheim_317,7km -086702_1088_67100_Strasbourg (Neuhof)_319,1km -136801_1363_67310_Wasselonne_320,4km -065701_1310_57400_Sarrebourg_322,4km -086703_1127_67000_Relais Strasbourg (Esplanade)_322,5km -086711_1134_67100_Strasbourg (Port du Rhin)_322,9km -021202_49_12850_Onet-le-Château / Comtal_323,3km -086701_324_67200_Strasbourg (Marché gare)_323,6km -065703_1347_57260_Relais Dieuze_326,8km -015501_33_55000_Bar-le-Duc_327,0km -021201_48_12000_Rodez Saint-Eloi_327,1km -146701_1299_67300_Schiltigheim_327,1km -756701_1044_67450_Lampertheim-Strasbourg/Zone-Nord_328,8km -113402_1193_34700_Le Bosc Lodève_329,0km -065702_993_57370_Phalsbourg_329,7km -012301_20_23000_Guéret_329,7km -646701_609_67700_Monswiller_329,9km -113401_399_34800_Clermont l'Hérault La Salamane_330,2km -015503_1328_55000_Relais Fains-Véel_330,9km -038901_154_89100_Maillot / Sens_331,4km -021211_793_12450_Luc-la-Primaube_332,0km -084501_313_45500_Gien_333,3km -038902_1190_89100_Relais Sens_334,5km -105101_384_51300_Vitry-le-François_335,1km -035503_1371_55300_Saint-Mihiel_335,2km -034602_123_12110_Aubin / Decazeville_335,5km -033601_114_36100_Issoudun_337,4km -011801_16_18100_Vierzon_342,6km -011001_10_10100_Romilly-sur-Seine_343,0km -066701_756_67260_Sarre-Union_344,7km -054501_211_45200_Amilly_345,5km -766701_1061_67500_Haguenau_346,3km -813401_621_34120_Pézenas_347,2km -031901_107_19000_Tulle_347,6km -011002_1354_10400_Nogent-sur-Seine_349,4km -044601_1207_46130_Biars sur Cere_351,5km -055701_216_57155_Marly_352,0km -034601_122_46100_Figeac_352,1km -013602_1026_36000_Relais Châteauroux_355,3km -043611_1204_36250_Saint-Maur / Cap-Sud_356,9km -013601_25_36250_Saint-Maur Route de Tours_357,1km -035701_130_57500_Saint-Avold_359,3km -022301_55_23300_La Souterraine_360,6km -035101_124_51120_Sézanne_361,3km -085701_317_57140_Woippy_362,2km -095703_1264_57450_Farebersviller_362,4km -011901_17_19360_Malemort-sur-Corrèze_362,4km -816702_1147_67250_Soultz-sous-Forêts_362,5km -095701_1367_57470_Hombourg-Haut Place des Ifs_362,7km -055111_215_51000_Châlons-en-Champagne_362,7km -095701_1366_57470_Hombourg-Haut Place du collège_363,6km -095702_652_57800_Betting_363,6km -105401_385_54800_Conflans-Jarny_363,7km -033401_113_34420_Villeneuve-lès-Béziers Capiscol_363,9km -087701_328_77160_Provins_364,0km -047701_185_77130_Varennes-sur-Seine_364,1km -035501_128_55100_Haudainville_364,5km -094501_1386_45110_Saint Martin d'Abbat_365,4km -031201_101_12200_Villefranche-de-Rouergue_365,9km -055121_214_51510_Fagnières_366,5km -055101_213_51520_Saint-Martin-sur-le-Pré_367,4km -035502_129_55100_Verdun_367,7km -095701_353_57600_Morsbach / Forbach_368,3km -035702_860_57150_Creutzwald_368,4km -085711_1162_57280_Hauconcourt / Maizières-lès-Metz_369,0km -125101_426_51130_Vertus / Epernay_369,7km -095701_1379_57600_Forbach_371,0km -095701_1364_57540_Petite-Rosselle Place du marché_371,8km -095701_1365_57540_Petite-Rosselle Place de l'église_373,2km -105701_1089_57360_Amneville_373,5km -816701_998_67160_Wissembourg_374,1km -024101_66_41200_Romorantin_374,6km -028701_91_87000_Limoges Sud_374,7km -028711_92_87280_Limoges Nord_376,0km -094501_1387_45450_Ingrannes_377,5km -028721_983_87000_Limoges Wagner_378,0km -094501_1388_45450_Sully La Chapelle_378,2km -075701_288_57290_Fameck_378,8km -028101_1315_81380_Lescure d'Albigeois_380,2km -014601_30_46200_Souillac_380,9km -018102_1188_81000_Relais Albi Centre Ville_382,4km -094501_347_45430_Chécy_382,8km -127701_269_77820_Le Châtelet-en-Brie_382,9km -035111_125_51210_Montmirail_383,8km -045731_178_57180_Thionville Terville_383,9km -125111_1187_51530_Pierry / Epernay_384,1km -045711_175_57100_Thionville Veymerange_384,9km -018101_41_81000_Albi_385,5km -057702_234_77320_La Ferté-Gaucher_385,7km -125154_1129_51200_Relais Epernay_385,7km -095101_349_51160_Ay / Epernay_385,8km -044501_170_45160_Olivet La Source_386,1km -045722_177_57970_Thionville Basse-Ham_386,2km -045701_174_54560_Audun-Le-Roman_386,3km -095152_351_51530_Dizy / Epernay_387,6km -814501_622_45330_Malesherbes_387,9km -814502_623_45300_Pithiviers_388,9km -034511_120_45000_Orléans_390,4km -044502_1141_45000_Relais Orléans Centre-De Gaulle_390,6km -034501_119_45400_Fleury-les-Aubrais_392,7km -031101_100_11100_Narbonne_393,4km -034521_121_45140_Saint-Jean-de-la-Ruelle_393,6km -067701_268_77190_Dammarie-les-Lys_393,7km -057701_233_77120_Coulommiers_395,3km -058101_237_81660_Bout-du-Pont-de-l'Arn / Mazamet_397,7km -083702_1194_36700_Relais Châtillon-sur-Indre_397,8km -034502_1320_45140_Relais Ormes_397,9km -023601_63_36300_Le Blanc_397,9km -032401_789_24200_Sarlat La Caneda_399,4km -095111_350_51700_Dormans_399,5km -058102_1260_81200_Relais Mazamet-Gambetta_399,6km -057711_235_77515_Faremoutiers_399,9km -085114_1138_51350_Relais Cormontreuil_400,1km -064502_254_45130_Meung-sur-Loire_400,2km -085101_777_51500_Champfleury / Reims_400,3km -085122_1411_51100_Relais La Pompelle_401,0km -038101_148_81600_Gaillac_401,2km -064501_253_45190_Tavers / Beaugency_401,4km -024601_68_46000_Cahors_401,9km -085102_1240_51100_Relais Farman Croix Blandin_402,5km -078101_296_81100_Castres_402,6km -010811_750_08400_Vouziers_403,1km -048701_192_87000_Saint-Junien_403,3km -085112_1024_51100_Relais Reims-Université_404,5km -075103_1002_51100_Relais Reims-Libergier_404,7km -040201_155_02400_Château-Thierry_404,9km -085113_1105_51100_Relais Reims Elus_405,0km -075104_1094_51100_Relais Reims-Céres_405,0km -085111_316_51100_Reims Jean-Jaurès_405,3km -075106_1126_51100_Relais Reims-Clairmarais_405,6km -031102_964_11130_Sigean_405,9km -075105_1125_51430_Relais Tinqueux_406,0km -075107_1358_51100_Relais Reims Saint Thomas_406,1km -048101_189_81300_Graulhet_406,2km -034102_117_41350_Saint-Gervais-la-Forêt / Blois_407,2km -075101_287_51370_Saint-Brice-Courcelles_408,6km -097702_368_77580_Crécy-La-Chapelle_409,6km -108601_393_86500_Montmorillon_410,4km -099101_371_91090_Lisses_410,9km -034103_1285_41000_Relais Blois Quartier Gare_411,1km -129411_439_77170_Servon_411,5km -129101_1416_91670_Angerville_411,9km -034101_116_41000_Blois_412,0km -139101_451_91150_Etampes_413,4km -075102_963_51140_Jonchery-sur-Vesle_414,1km -083701_310_37600_Loches_414,8km -117701_411_77340_Pontault-Combault_416,3km -149101_463_91700_Fleury-Mérogis_416,5km -097701_367_77100_Mareuil-lès-Meaux_416,9km -137731_1206_77144_Montevrain_417,1km -077701_293_77100_Meaux_417,3km -048111_190_81500_Lavaur_418,5km -099111_372_91170_Viry Châtillon_418,6km -137701_449_77200_Torcy_418,6km -077702_988_77440_Lizy-sur-Ourcq_418,7km -069101_274_91230_Montgeron_418,8km -077703_1007_77100_Le Piéton de Meaux_418,9km -137721_1137_77400_Lagny-sur-Marne_420,0km -129401_438_94380_Bonneuil-sur-Marne_420,9km -021111_47_11000_Carcassonne Est La Cité_421,3km -079101_297_91420_Morangis_422,8km -021101_46_11000_Carcassonne_422,8km -038102_149_81370_Saint-Sulpice-La-Pointe_423,4km -082401_304_24750_Trélissac_425,8km -038201_150_82000_Montauban Aussonne_426,2km -952001_1157_20220_Corbara_426,6km -069401_275_94400_Vitry-sur-Seine_426,7km -043701_168_37400_Amboise_426,8km -952002_1167_20260_Relais Lumio_427,8km -017701_40_77270_Villeparisis_428,4km -079111_298_91120_Massy Palaiseau_429,4km -082402_305_24000_Périgueux Le Privilège_430,2km -118601_415_86800_Jardres / Chauvigny_430,3km -099401_1214_94270_Le Kremlin Bicêtre_430,4km -073101_280_31340_Villemur-sur-Tarn_430,5km -018201_42_82000_Montauban Sapiac_430,7km -082403_306_24660_Notre Dame de Sanilhac_431,3km -159101_982_91400_Gometz-La-Ville_431,5km -020801_965_08200_Sedan_431,8km -050211_1217_02600_Villers-Cotterêts_435,3km -026601_80_66000_Perpignan Polygone_435,4km -089301_331_93600_Aulnay-sous-Bois_436,3km -159301_481_93150_Blanc Mesnil_436,7km -146001_462_60330_Plessis_436,9km -159302_482_93120_La Courneuve_437,1km -014102_29_41100_Vendôme Route de Blois_437,2km -012801_21_28200_Saint-Denis-les-Ponts_438,1km -073103_760_31620_Fronton_438,3km -040211_156_02200_Soissons_439,2km -053701_207_37700_La Ville-aux-Dames_440,4km -153101_466_31180_Rouffiac / Toulouse_440,4km -014101_28_41100_Vendôme_440,6km -016601_39_66000_Perpignan Sud_440,6km -058601_239_86100_Châtellerault_440,8km -011101_11_11300_Limoux_441,2km -028202_1279_82200_Moissac_441,3km -146011_1242_60800_Crépy-en-Valois_442,2km -036611_140_66200_Elne_443,5km -099311_1173_93800_Epinay_443,6km -023701_64_37170_Chambray-lès-Tours_443,7km -179511_1165_95410_Groslay_444,6km -143101_454_31150_Bruguières_444,8km -028201_89_82100_Castelsarrasin_444,9km -159201_480_92700_Colombes Michelet_445,0km -061601_241_16110_Rivières / La Rochefoucauld_445,1km -169202_1149_92500_Rueil-Malmaison Bonaparte_445,4km -169203_1294_92500_Rueil-Malmaison Boulevard National_445,5km -932001_624_20600_Bastia_445,8km -123101_419_31130_Balma_445,9km -099323_1353_95880_Relais Enghien-Les-Bains_446,0km -156001_477_95470_Saint-Witz_446,2km -123121_1296_31650_Saint-Orens-de-Gameville_447,0km -033701_115_37100_Tours Nord_447,0km -127811_436_78390_Bois d'Arcy_447,6km -038603_1340_86000_Relais Poitiers Campus Parcobus Champlain_447,6km -073702_1034_37000_Relais Tours les Halles_447,7km -090201_334_02840_Athies-sous-Laon_448,0km -099321_464_95110_Sannois_448,1km -042801_165_28000_Chartres_448,1km -038605_1343_86000_Relais Poitiers Omnisport Saint-Eloi_448,3km -073701_282_37520_La Riche_448,5km -090212_1074_02000_Relais Laon Ville Haute_448,6km -123111_421_31400_Montaudran_449,4km -090211_335_02000_Laon_449,6km -038601_152_86000_Poitiers Saint-Benoît_450,0km -179501_517_95570_Moisselles / Domont_450,3km -012001_18_20620_Biguglia_451,0km -068601_272_86000_Poitiers Nord_451,2km -109502_1212_95390_Relais Saint-Prix_451,3km -143111_455_31700_Blagnac_451,3km -038602_1065_86000_Relais Poitiers Carnot_451,6km -109501_394_95320_Saint-Leu-la-Forêt_451,9km -038604_1342_86000_Relais Poitiers La Gare_452,0km -056011_220_60300_Senlis_453,1km -042811_166_28300_Mainvilliers_453,7km -064701_255_47300_Villeneuve-sur-Lot_454,0km -042402_163_24100_Bergerac Pasteur_454,5km -169501_498_95220_Herblay_454,7km -026003_1323_60260_Relais Lamorlaye_455,6km -036601_139_66160_Le Boulou_457,1km -077801_294_78260_Achères_458,0km -216001_914_60610_La Croix-Saint-Ouen_459,1km -041601_159_16700_Ruffec_459,1km -042401_162_24100_Bergerac_459,3km -103101_380_31120_Roques-sur-Garonne / Toulouse_460,3km -067801_270_78700_Conflans-Sainte-Honorine_460,3km -149501_465_95310_Saint-Ouen-l'Aumône_460,6km -031601_104_16160_Angoulême_461,5km -026001_76_60740_Saint-Maximin_461,5km -029501_94_95290_L'isle-Adam_462,0km -076001_1351_60700_Pont-Sainte-Maxence_462,5km -089503_1075_95500_Relais Pontoise_462,9km -096001_1254_95340_Chambly_463,5km -073703_1128_37130_Langeais_463,6km -026002_966_60160_Montataire_464,5km -089501_332_95520_Osny/Pontoise_464,9km -060201_743_02800_Beautor_466,9km -176001_509_60150_Thourotte_467,1km -176002_1284_60170_Ribécourt_468,0km -074702_632_47240_Bon-Encontre/Castelculier_469,2km -056012_1238_60140_Relais Liancourt_469,7km -063701_1230_37500_Chinon_470,6km -080201_299_02500_Hirson_470,9km -163101_1283_31470_Saint-Lys_472,1km -074701_285_47000_Agen_472,7km -010901_9_09100_Saint-Jean-du-Falga_473,9km -022401_56_33220_Pineuilh / Sainte-Foy_474,5km -089502_333_95640_Marines_477,0km -037201_145_72500_Château-du-Loir_477,1km -032811_111_28100_Dreux Le Pré_477,1km -098601_370_86202_Loudun_478,6km -186001_1083_60310_Lassigny_478,6km -032801_110_28100_Dreux Les Bâtes_478,7km -010201_3_28260_Oulins / Anet_481,3km -052801_204_28400_Margon / Nogent-Le-Rotrou_483,3km -058001_847_80400_HAM Muille-Villette_483,5km -212901_1010_02100_Neuville-Saint-Amand_484,4km -080202_1259_59610_Relais Fourmies_484,7km -020901_45_09000_Foix_485,4km -036001_134_60130_Saint-Just-en-Chaussée_486,1km -126011_430_95420_Magny-en-Vexin_486,3km -084701_828_47400_Tonneins_486,6km -077201_291_72400_Ferté-Bernard_486,6km -982002_626_20000_Ajaccio Rocade_487,5km -011602_14_16200_Jarnac_487,6km -982001_625_20167_Grand Ajaccio Baléone_487,7km -982003_1174_20000_Relais Cours Napoléon Coeur de ville_488,9km -022801_58_27320_Nonancourt / Saint-Lubin_489,4km -051601_200_16300_Barbezieux_490,8km -104701_382_47200_Marmande-Lolya_492,2km -057901_236_79400_Saint-Maixent-l'Ecole_492,5km -056001_219_60000_Beauvais_492,5km -028001_88_80500_Montdidier_493,5km -104711_891_47200_Marmande Route de Bordeaux_494,1km -982004_1191_20166_Relais Porticcio_494,3km -087901_329_79200_Parthenay_495,2km -126001_429_27140_Gisors_495,7km -183301_1293_33230_Coutras_496,5km -263301_578_33350_Saint-Magne-de-Castillon_497,3km -056021_221_60000_Tillé_497,3km -094901_348_49400_Saumur_498,8km -082701_309_27200_Vernon_498,9km -047901_186_79104_Thouars_500,4km -067202_266_72560_Changé / Le Mans_501,0km -011601_13_16100_Cognac_502,1km -033201_112_32000_Auch_502,4km -046102_180_27130_Verneuil-sur-Avre_502,5km -054701_1172_47700_Casteljaloux_504,6km -047211_184_72000_Le Mans Sud Brossolette_505,3km -196001_529_60120_Breteuil_505,7km -107901_391_79000_Niort Mendès France_506,3km -047212_1030_72000_Relais Le Mans-Centre_507,1km -225901_1317_59620_Aulnoye-Aymeries_507,1km -223301_556_33500_Libourne_507,5km -068001_848_80200_Peronne_508,5km -067201_265_72700_Allonnes_508,8km -102701_378_27000_Evreux Netreville_509,2km -102711_1321_27000_Evreux Lavoisier_509,3km -047201_183_72000_Le Mans Nord Rhin et Danube_509,3km -077901_295_79000_Niort Centre ville_510,7km -065903_260_59540_Caudry_511,3km -087201_327_72000_La Flèche_511,4km -107911_392_79000_Bessines / Niort_512,4km -161701_485_17500_Jonzac_512,6km -141701_453_17400_Saint-Jean-d'Angély_513,1km -223302_1243_33500_Relais Arveyres_513,8km -225902_1318_59750_Relais Feignies_514,2km -126002_1064_76220_Gournay en Bray_517,5km -065902_259_59267_Proville_519,9km -211701_542_17800_Pons_520,3km -097901_369_79300_Bressuire_521,0km -011711_1023_17100_Saintes-Terrefort_521,1km -046101_179_61300_L'Aigle_521,6km -063301_247_33210_Langon_522,6km -065901_258_59400_Cambrai_522,7km -048021_639_80440_Boves_522,9km -011701_15_17100_Saintes Abbaye_523,6km -063302_248_33410_Beguey_523,7km -092701_339_27100_Val-de-Reuil / Louviers_525,4km -144901_456_49320_Brissac-Quincé_525,8km -133101_442_31800_Estancarbon / Saint-Gaudens_525,9km -048011_188_62450_Bapaume Pas de Calais_526,5km -081701_303_17100_Saintes Les Coteaux_527,6km -048022_1348_80000_Relais Amiens-Centre_528,1km -048001_187_80136_Rivery / Amiens_528,2km -803301_617_33560_Sainte-Eulalie_528,4km -795902_1189_59224_Thiant_528,5km -795901_1114_59111_Lieu-Saint-Amand / Bouchain_529,1km -255902_1286_59300_Relais Aulnoy-Lez-Valenciennes_529,5km -803311_618_33370_Artigues / Bordeaux_529,6km -803304_1399_33150_Relais Cenon Cassagne_531,8km -051701_201_17700_Surgères_533,1km -042701_164_27110_Le Neubourg_533,2km -255901_459_59300_Valenciennes_533,3km -803303_1341_33150_Relais Cenon Jean Jaurès_533,4km -057201_231_72300_Sablé-sur-Sarthe_534,1km -163301_765_33390_Blaye_534,3km -145912_461_59135_Bellaing_535,3km -013301_24_33300_Bordeaux Chartrons_535,4km -803302_1104_33100_Relais Bordeaux Stalingrad_535,4km -013312_1082_33100_Relais Bordeaux Serr_535,4km -117211_410_61000_Alençon Courteille_535,6km -145911_460_59590_Raismes / Petite-forêt_535,9km -013313_1103_33300_Relais Bordeaux Paul Doumer_536,2km -013316_1208_33000_Relais Bordeaux Chapeau rouge_536,3km -013314_1151_33000_Relais Bordeaux Victor Hugo_536,3km -057601_232_76320_Saint-Pierre-lès-Elbeuf_536,4km -144911_457_49130_Les Ponts-de-Cé_536,7km -013315_1153_33000_Relais Bordeaux Fondaudège_536,7km -253301_575_33290_Le Pian-Médoc_537,5km -068511_1309_85200_Fontenay-Le-Comte Route de la Rochelle_537,6km -173301_503_33520_Bruges_538,1km -097902_642_79700_Mauléon_538,1km -117201_409_61250_Condé-sur-Sarthe_538,1km -068501_271_85200_Fontenay-le-Comte_538,7km -177602_512_76240_Mesnil-Esnard_539,1km -104901_383_49000_Angers_539,3km -233301_567_33140_Villenave-d'Ornon_539,4km -123313_1236_33700_Relais Mérignac Mondésir_540,2km -173302_1346_33200_Relais Bordeaux-Cauderan-Stéhélin_540,7km -177601_511_76300_Sotteville-lès-Rouen_540,9km -077601_292_76800_Saint-Etienne-du-Rouvray / Rouen_541,6km -123312_1235_33700_Relais Mérignac Yser_542,2km -105901_386_59230_Saint-Amand-les-Eaux_542,4km -177603_513_76000_Rouen Darnétal_542,8km -154911_471_49070_Beaucouzé_543,4km -105902_1032_59230_Saint-Amand-les-Eaux Gare_544,1km -134901_444_49120_Chemillé_544,4km -177605_1278_76000_Relais Rouen Armand Carrel_544,5km -035901_132_62117_Brebières_544,8km -177604_514_76100_Rouen Rive gauche_545,4km -071702_279_17430_Tonnay-Charente_546,0km -035903_1251_59500_Relais Douai Place Carnot_546,1km -127611_434_76230_Bois Guillaume_546,2km -123311_423_33167_Saint-Médard-en-Jalles_546,2km -062701_243_27300_Menneval / Bernay_546,5km -154901_470_49070_Saint-Jean-de-Linières_546,9km -076202_1008_62490_Fresnes Val de Scarpe_547,4km -035902_133_59119_Waziers / Douai_547,4km -078002_1404_80420_Relais Flixecourt_548,0km -086201_322_62000_Dainville_548,1km -071701_278_17300_Rochefort-sur-Mer_548,3km -076201_289_62223_Saint-Nicolas Val de Scarpe_548,8km -123301_422_33127_Saint-Jean-d'Illac_548,9km -114901_403_49306_Cholet Rond-point du lac de Ribou_549,5km -127601_433_76380_Bapeaume-les-Rouen_549,8km -088001_1186_80600_Doullens_550,5km -245902_1239_59310_Orchies parking E.Leclerc_551,2km -067601_267_76270_Neufchâtel-en-Bray_551,8km -245901_1244_59310_Orchies Carrière Dorée_552,3km -136201_1306_62970_Courcelles-lès-Lens_552,3km -164901_1072_49300_Cholet-Sud_553,1km -137602_448_76770_Le Houlme_553,6km -021701_51_17200_Saint-Sulpice-de-Royan_554,0km -035302_1406_53600_Relais Evron_554,0km -114911_404_49300_Cholet Les 3 Provinces_555,6km -021702_52_17640_Vaux-sur-Mer_557,2km -158501_479_85500_Les Herbiers_558,1km -208501_538_85110_Chantonnay_558,6km -085903_321_59242_Templeuve_558,6km -121701_416_17180_Périgny / La Rochelle_558,8km -101701_376_17320_Marennes_559,0km -137601_447_76360_Barentin_559,0km -793201_1059_40800_Aire-sur-l'Adour_559,3km -056502_821_65800_Orleix_559,3km -078001_1178_80580_Pont-Remy_559,4km -046201_181_62218_Loison_560,6km -045301_172_53200_Château-Gontier_560,9km -156201_1106_62800_Liévin_560,9km -168501_797_85400_Luçon La Belle Vie_562,0km -026102_1289_61200_Fontenai-sur-Orne_562,0km -026101_77_61200_Argentan_562,2km -036201_136_62220_Carvin_562,8km -056501_1359_65000_Tarbes Centre Ville_563,3km -061701_1408_17140_Lagord_564,1km -085901_319_59273_Fretin CRT Lesquin_565,6km -056501_226_65000_Tarbes Méridien_566,4km -078003_1405_80100_Relais Abbeville_566,6km -175901_508_59113_Seclin Lorival_566,8km -044001_169_40280_Saint-Pierre-du-Mont Grand Moun_567,6km -126202_1215_62980_Vermelles_568,2km -084901_933_49500_Segré_568,8km -061401_240_14100_Lisieux_568,9km -026201_78_62290_Noeux-les-Mines_569,4km -323301_779_33380_Mios_569,5km -026211_1381_62620_Barlin_569,9km -175902_1054_59120_Relais Loos Lez Lille_570,7km -186201_979_62130_Herlin-le-Sec_570,8km -323311_1275_33380_Biganos_571,5km -085902_320_59650_Villeneuve-d'Ascq_571,5km -125901_1270_59800_Lille-Fives_572,1km -085907_1300_59000_Relais Lille-Wazemmes_572,3km -126201_431_62660_Beuvry_572,7km -095904_357_59510_Hem-Avenue de l'Europe_573,0km -085905_990_59000_Relais Piéton Lille Molinel_573,1km -085906_1076_59000_Relais Piéton Lille Solférino_573,1km -025303_74_53000_Laval_573,1km -085908_1303_59800_Relais Lille-Saint-Maurice_573,2km -085910_1355_59000_Relais Lille Rihour_573,4km -185901_1211_59320_Hallennes-Lez-Haubourdin_573,5km -036101_135_61600_La Ferté-Macé_573,5km -085904_641_59800_Relais Piéton Lille Lion d'Or_573,8km -026202_79_62700_Bruay_574,6km -167601_495_76190_Yvetot_574,9km -085909_1339_59130_Relais Lille-Lambersart_575,0km -026211_1143_62232_Fouquières-les-Béthune_575,4km -095902_355_59150_Wattrelos_575,6km -131701_440_17310_Saint-Pierre d'Oleron_575,7km -025301_72_53810_Changé / Laval_575,9km -115903_407_59160_Lomme_576,5km -035301_127_53100_Mayenne_576,8km -221701_1268_17410_Saint-Martin-de-Ré_578,3km -025302_73_53940_Saint-Berthevin_578,4km -107601_390_76260_Etalondes_578,6km -026501_638_65100_Lourdes_578,9km -045302_173_53400_Craon_579,6km -243301_1226_33740_Arès_579,7km -118501_414_85600_Montaigu_581,8km -186201_1360_62140_Marconne_582,1km -154411_1256_44150_Ancenis Saint-Géréon_582,2km -111401_395_14700_Falaise_582,5km -294401_589_44190_Clisson_582,5km -095903_356_59960_Neuville-en-Ferrain_582,9km -081401_301_14130_Pont-l'Evêque_583,0km -087601_1322_76200_Dieppe _583,3km -087602_1324_76370_Relais Neuville-Les-Dieppe_583,9km -303302_1281_33260_La Teste-de-Buch_584,5km -115901_405_59850_Nieppe_584,8km -188501_919_85000_La Roche-sur-Yon Les Oudairies_585,1km -303303_1352_33260_Relais La Teste Lagrua_586,7km -148501_981_85000_La Roche-sur-Yon / La Roche Sud_587,2km -041401_1203_14600_Honfleur Outlet_587,8km -096401_361_64000_Pau Université_588,1km -056201_1401_80120_Vron_588,4km -176201_218_62190_Lillers_589,9km -056201_1373_62990_Maresquel-Ecquemicourt_589,9km -096412_387_64110_Mazères / Pau-Sud_590,3km -056201_1396_62204_Campagne-lès-Hesdin_591,1km -364403_1124_44430_Loroux-Bottereau_591,8km -115902_406_59270_Bailleul_592,1km -056201_1372_62310_Fruges Mairie_592,2km -081402_302_14800_Touques / Deauville_592,3km -096411_362_64140_Lons_592,6km -056201_1393_62990_Beaurainville_592,8km -218501_551_85170_Le Poiré-sur-Vie_592,9km -781401_614_14370_Argences_593,1km -176202_640_62120_Aire-Sur-La-Lys_594,1km -024001_65_40600_Biscarrosse_594,9km -016101_36_61100_Flers_595,3km -097601_365_76700_Gonfreville-l'Orcher_596,8km -055901_217_59190_Hazebrouck_597,0km -026401_637_64170_Artix_597,8km -364401_602_44115_Basse Goulaine / Nantes_597,8km -157601_478_76460_Saint Valery en Caux_598,2km -056201_1395_62170_Wailly-Beaucamp_598,4km -016102_37_61790_Saint-Pierre-du-Regard_599,7km -097602_366_76600_Le Havre Docks Vauban_600,3km -056201_1398_62170_Ecuires_601,1km -097603_1096_76600_Relais Le Havre Lafayette_602,0km -234401_568_44300_Nantes Paridis_603,0km -097604_1257_76600_Relais Le Havre 4 Chemins_603,1km -244401_572_44412_Rezé Océane_603,6km -056201_223_62170_Attin / Montreuil-sur-Mer_603,7km -101401_374_14123_Cormelles-le-Royal / Caen Sud_603,8km -994407_1144_44000_Relais Nantes Carnot fermé_604,4km -101404_633_14123_Ifs_604,7km -217602_909_76400_Saint-Léonard_604,8km -994406_1122_44000_Relais Nantes Bouffay fermé_605,0km -994405_1109_44000_Relais Nantes République fermé_605,0km -101402_375_14460_Colombelles_605,3km -224401_1070_44000_Duquesne_605,3km -217601_549_76400_Fécamp_605,4km -224401_1100_44000_Médiathèque_605,5km -224401_1071_44000_Mercoeur_605,6km -324401_595_44110_Châteaubriant_606,2km -124401_425_44406_Rezé Atout Sud_606,3km -034001_1319_40200_Mimizan_607,1km -096202_360_62575_Blendecques_607,1km -056201_1407_62650_Preures_607,4km -101403_1011_14000_Piéton Les Rives de l'Orne_607,4km -153501_468_35500_Vitré_608,1km -031412_1123_14000_Relais Caen Bernières_608,3km -274401_581_44700_Orvault / Grand Val_608,9km -096203_1062_62500_Saint-Omer_609,8km -036401_138_64300_Orthez_609,8km -031401_102_14000_Caen Cote de Nacre_610,3km -096201_359_62500_Leulinghem_610,8km -031411_103_14760_Bretteville-sur-Odon_611,0km -224401_557_44807_Saint-Herblain Atlantis_611,3km -096204_920_62380_Lumbres_612,0km -198501_532_85340_Les Sables d'Olonne_612,3km -086401_323_64400_Oloron_612,9km -166201_986_62630_Etaples-sur-Mer/Le Touquet_613,0km -031421_1140_14650_Carpiquet_613,8km -014001_27_40990_Saint-Paul-lès-Dax_614,8km -274411_582_44360_Nantes Ouest RN 165_618,8km -151401_1297_14310_Villers-Bocage_619,6km -138502_796_44270_Machecoul_619,7km -093501_342_35133_Fougères Lécousse_620,4km -051401_199_14500_Vire_621,3km -178501_515_85800_Saint-Gilles-Croix-de-Vie_623,8km -178503_515_85800_Saint-Gilles-Croix-de-Vie Livraison à domicile f_623,8km -215901_547_59380_Quaedypre Bergues_624,5km -138501_450_85300_Challans_624,6km -384401_905_44130_Blain_626,0km -178502_516_85270_Saint-Hilaire-de-Riez_626,2km -066201_261_62230_Outreau_629,3km -023501_62_35530_Noyal-sur-Vilaine_629,6km -203501_535_35470_Bain-de-Bretagne_632,4km -344403_599_44580_Bourgneuf-en-Retz_632,5km -146401_962_64120_Aïcirits_633,2km -155903_1152_59240_Rosendael_634,2km -084001_1258_40140_Soustons_634,3km -155902_476_59140_Dunkerque Centre Marine_634,5km -193501_524_35770_Vern Val d'Orson_635,1km -054001_208_40230_Saint-Vincent-de-Tyrosse_635,1km -155901_475_59279_Loon Plage Grande Synthe_636,0km -071401_277_14400_Bayeux_636,0km -113501_400_35510_Cesson Autopôle_636,3km -193502_525_35230_Noyal-Châtillon_638,3km -163522_1231_35760_Relais Rennes Guéhenno_640,4km -344404_985_44320_Saint-Père-en-Retz_642,0km -075001_286_50300_Avranches_642,2km -163501_488_35760_Saint-Grégoire / Rennes_642,2km -113521_402_35000_Rennes Cleunay_642,9km -163521_1142_35760_Rennes / Grand-Quartier fermé_643,0km -113511_401_35170_Bruz Ker Lann_643,1km -344401_597_44210_Pornic_645,4km -015011_1308_50000_Saint-Lô_647,3km -163511_489_35520_Cap Malo La Mézière_647,8km -344406_1107_44730_Relais Saint-Michel-Chef-Chef_648,6km -304401_592_44160_Pontchâteau_648,9km -344402_598_44250_Saint-Brévin_650,4km -015013_1305_50180_Agneaux_651,4km -314401_594_44460_Saint-Nicolas-de-Redon_654,2km -284401_586_44600_Saint-Nazaire-l'Immaculée_658,3km -173501_504_35137_Pleumeleuc_660,1km -066402_967_64600_Montaury Anglet Lockers_660,4km -066411_262_64600_Anglet_660,9km -136401_446_64200_Bassussarry_661,0km -136402_263_64200_Biarritz_663,5km -055001_212_50400_Granville_664,7km -394401_645_44410_Herbignac_666,6km -045001_171_50500_Saint-Hilaire-Petitville / Carentan_667,5km -085001_314_50200_Coutances_668,1km -354401_600_44350_Guérande_671,1km -354402_600_44350_Guérande Livraison à domicile Fermé_671,1km -076401_290_64500_Saint-Jean-de-Luz_673,4km -112202_1196_22100_Relais Lanvallay_678,2km -112201_396_22100_Dinan_680,8km -133501_443_35400_Saint-Malo_683,1km -215601_545_56800_Ploërmel_686,2km -242201_926_22130_Pluduno-Plancoët_696,8km -215611_546_56120_Josselin_697,1km -155611_474_56450_Theix-Noyalo_699,5km -155612_1301_56000_Relais Vannes-Centre Ville_704,3km -155601_473_56000_Vannes_706,7km -065001_256_50110_Tourlaville_710,2km -162201_486_22400_Lamballe_712,1km -025002_70_50690_Martinvast_712,7km -025001_69_50460_Equeurdreville_715,0km -195603_528_56500_Moréac_716,1km -232201_565_22370_Pléneuf-Val-André_718,2km -172201_502_22600_Loudéac_719,3km -175601_507_56400_Auray_722,1km -162202_487_22120_Yffiniac_723,4km -195602_1227_56150_Baud_728,8km -195601_1228_56300_Pontivy_728,9km -212202_544_22000_Saint-Brieuc_729,1km -222202_554_22950_Trégueux les Chatelets_730,5km -202202_534_22440_Le Carpont Ploufragan_731,8km -202201_533_22440_Centre Ville Ploufragan_732,5km -222201_553_22800_Saint-Brandan / Quintin_736,5km -212201_543_22440_Trémuson_738,9km -165601_490_56700_Kervignac_741,4km -165611_491_56700_Hennebont_744,2km -245601_573_56750_Riantec_746,9km -182202_520_22290_Lanvollon_750,7km -205601_536_56260_Larmor-Plage_751,3km -235601_569_56530_Quéven_755,5km -122201_417_22970_Ploumagoar / Guingamp_757,3km -132201_441_22110_Plouguernevel_759,3km -122203_1302_22200_Relais Plouisy/Guingamp_761,2km -182201_519_22500_Paimpol_762,0km -292902_588_29300_Rédéné / Quimperlé Est_763,0km -292901_587_29300_Quimperlé_768,2km -122202_418_22140_Bégard_775,1km -135601_445_56110_Gourin_779,3km -112901_398_29270_Carhaix Plouguer_779,4km -232901_566_29390_Scaer_783,0km -012201_19_22300_Lannion Route de Guingamp_786,8km -192201_523_22300_Lannion Route de Perros Guirec_788,4km -792902_616_29140_Rosporden_791,2km -792901_615_29900_Concarneau_794,1km -252901_989_29520_Châteauneuf-du-Faou_795,1km -602901_606_29170_Fouesnant / Pleuven_802,7km -182901_521_29600_Morlaix_807,2km -282903_585_29000_Quimper Sud Ergue Armel_807,7km -182902_522_29600_Saint-Martin-des-Champs_809,8km -282901_583_29000_Quimper Nord Parc Expos_810,8km -282902_584_29000_Quimper Ouest Lududu_811,5km -222901_555_29150_Châteaulin_814,5km -062901_244_29720_Plonéour-Lanvern_817,4km -062902_245_29120_Plomeur Pendreff_819,7km -312901_593_29400_Landivisiau_822,2km -022901_59_29250_Saint-Pol-de-Léon_823,0km -362902_1045_29100_Douarnenez-Pouldavid_828,5km -362901_601_29100_Douarnenez Tréboul_830,2km -012902_1170_29800_Landerneau_834,9km -342901_596_29470_Plougastel_838,2km -012901_1171_29800_Saint-Thonan_839,2km -102901_379_29160_Crozon_839,4km -392901_604_29480_Le Relecq-Kerhuon_842,9km -272901_580_29260_Le Folgoët_843,2km -262901_903_29770_Audierne_843,9km -392902_605_29490_Guipavas_844,9km -032901_1009_29200_Brest Le Port_847,6km -812911_1247_29850_Brest Porte de Gouesnou_848,4km -812901_620_29200_Brest Keraudren_848,9km -302902_591_29200_Brest 1ère DFL_852,8km -302901_590_29820_Guilers_855,7km -402901_917_29870_Lannilis_855,7km -382901_603_29830_Ploudalmézeau_865,6km \ No newline at end of file diff --git a/insiders_JS/analyze_request_leclerc.js b/insiders_JS/analyze_request_leclerc.js deleted file mode 100644 index c59afd6..0000000 --- a/insiders_JS/analyze_request_leclerc.js +++ /dev/null @@ -1,12736 +0,0 @@ -var WPAD007 = WPAD007 || { -}; -WPAD007 = { - OuvrirPopinContenu: function (n) { - Utl.Loader.afficher(); - var t = { - sCodeSite: '', - sTypeContenu: n, - sNomControle: 'ascWPAD343_ContenuStatique' - }; - WCTD601.Handler.Appeler({ - config: { - url: Utilitaires.Ressources.mpgeWPAD007_Drive.PARAM_URL_HANDLER_RECUP_CONTENU - }, - data: t, - onChampSucces: function (t) { - WCTD201.Class.PopinManager.OuvrirPopin({ - sNomPopin: 'popinContenu_' + n, - fClient: !0, - conteneurType: WCTD201.Class.Scrollpane, - conteneur: { - contenu: t.objDonneesReponse, - fScrollOut: !0 - }, - popin: { - sOnComplete: function () { - WCTD601.View.RaiseUpdate(); - Utl.Loader.masquer() - } - } - }) - } - }) - } -}; -var WPAD025 = WPAD025 || { -}; -$(document).ready(function () { - Utilitaires.Pubsub.on('Maps.Affichage', function () { - $('.divWPAD025_NbDrives').addClass('masquer') - }); - Utilitaires.Pubsub.on('Maps.Masquage', function () { - $('.divWPAD025_NbDrives').removeClass('masquer') - }) -}); -$(window).bind('load', function () { - if ($.WCTD204_QueryString.sIdFrom != undefined) WPAD025.ScrollerHauteCarte(); - else if ($.WCTD204_QueryString.mag != undefined) { - var n = $.WCTD204_QueryString.mag.split('-'); - WPAD025.AfficherPointsRetrait(n[0], n[1]) - } else $.WCTD204_QueryString.sEmail != undefined && WPAD025.AfficherReinitMotDePasse($.WCTD204_QueryString.sEmail) -}); -WPAD025 = { - ScrollerHauteCarte: function () { - WPAD337.ScrollerHauteCarte() - }, - AfficherPointsRetrait: function (n, t) { - WPAD338.AfficherPointsRetrait('MAGASIN', null, null, null, null, n, t) - }, - AfficherReinitMotDePasse: function () { - $('.aWCLD312_MdpOublie').first().trigger('click') - } -}; -!function (n) { - function t(r) { - if (i[r]) return i[r].exports; - var u = i[r] = { - i: r, - l: !1, - exports: { - } - }; - return n[r].call(u.exports, u, u.exports, t), - u.l = !0, - u.exports - } - var i = { - }; - t.m = n; - t.c = i; - t.d = function (n, i, r) { - t.o(n, i) || Object.defineProperty(n, i, { - enumerable: !0, - get: r - }) - }; - t.r = function (n) { - 'undefined' != typeof Symbol && Symbol.toStringTag && Object.defineProperty(n, Symbol.toStringTag, { - value: 'Module' - }); - Object.defineProperty(n, '__esModule', { - value: !0 - }) - }; - t.t = function (n, i) { - var r, - u; - if ((1 & i && (n = t(n)), 8 & i) || 4 & i && 'object' == typeof n && n && n.__esModule) return n; - if (r = Object.create(null), t.r(r), Object.defineProperty(r, 'default', { - enumerable: !0, - value: n - }), 2 & i && 'string' != typeof n) for (u in n) t.d(r, u, function (t) { - return n[t] - }.bind(null, u)); - return r - }; - t.n = function (n) { - var i = n && n.__esModule ? function () { - return n.default - } - : function () { - return n - }; - return t.d(i, 'a', i), - i - }; - t.o = function (n, t) { - return Object.prototype.hasOwnProperty.call(n, t) - }; - t.p = ''; - t(t.s = 32) -}([function (n, t, i) { - (function (t, i) { - /*! - * @overview es6-promise - a tiny implementation of Promises/A+. - * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) - * @license Licensed under MIT license - * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE - * @version v4.2.8+1e68dce6 - */ - var r; - r = function () { - 'use strict'; - function v(n) { - return 'function' == typeof n - } - function p() { - var n = setTimeout; - return function () { - return n(o, 1) - } - } - function o() { - for (var n = 0; n < h; n += 2) e[n](e[n + 1]), - e[n] = void 0, - e[n + 1] = void 0; - h = 0 - } - function k(n, t) { - var u = this, - i = new this.constructor(s), - r, - e; - return void 0 === i[l] && lt(i), - r = u._state, - r ? (e = arguments[r - 1], f(function () { - return ct(r, i, e, u._result) - })) : g(u, i, n, t), - i - } - function d(n) { - if (n && 'object' == typeof n && n.constructor === this) return n; - var t = new this(s); - return a(t, n), - t - } - function s() { - } - function ht(t, i, r) { - i.constructor === t.constructor && r === k && i.constructor.resolve === d ? function (t, i) { - 1 === i._state ? u(t, i._result) : 2 === i._state ? n(t, i._result) : g(i, void 0, function (n) { - return a(t, n) - }, function (i) { - return n(t, i) - }) - }(t, i) : void 0 === r ? u(t, i) : v(r) ? function (t, i, r) { - f(function (t) { - var f = !1, - e = function (n, t, i, r) { - try { - n.call(t, i, r) - } catch (n) { - return n - } - }(r, i, function (n) { - f || (f = !0, i !== n ? a(t, n) : u(t, n)) - }, function (i) { - f || (f = !0, n(t, i)) - }, t._label); - !f && e && (f = !0, n(t, e)) - }, t) - }(t, i, r) : u(t, i) - } - function a(t, i) { - var r, - e, - f; - if (t === i) n(t, new TypeError('You cannot resolve a promise with itself')); - else if (f = typeof (e = i), null === e || 'object' !== f && 'function' !== f) u(t, i); - else { - r = void 0; - try { - r = i.then - } catch (i) { - return void n(t, i) - } - ht(t, i, r) - } - } - function pt(n) { - n._onerror && n._onerror(n._result); - nt(n) - } - function u(n, t) { - void 0 === n._state && (n._result = t, n._state = 1, 0 !== n._subscribers.length && f(nt, n)) - } - function n(n, t) { - void 0 === n._state && (n._state = 2, n._result = t, f(pt, n)) - } - function g(n, t, i, r) { - var u = n._subscribers, - e = u.length; - n._onerror = null; - u[e] = t; - u[e + 1] = i; - u[e + 2] = r; - 0 === e && n._state && f(nt, n) - } - function nt(n) { - var t = n._subscribers, - f = n._state; - if (0 !== t.length) { - for (var r = void 0, u = void 0, e = n._result, i = 0; i < t.length; i += 3) r = t[i], - u = t[i + f], - r ? ct(f, r, u, e) : u(e); - n._subscribers.length = 0 - } - } - function ct(t, i, r, f) { - var s = v(r), - e = void 0, - h = void 0, - o = !0; - if (s) { - try { - e = r(f) - } catch (v) { - o = !1; - h = v - } - if (i === e) return void n(i, new TypeError('A promises callback cannot return that same promise.')) - } else e = f; - void 0 !== i._state || (s && o ? a(i, e) : !1 === o ? n(i, h) : 1 === t ? u(i, e) : 2 === t && n(i, e)) - } - function lt(n) { - n[l] = tt++; - n._state = void 0; - n._result = void 0; - n._subscribers = [ - ] - } - var it = Array.isArray ? Array.isArray : function (n) { - return '[object Array]' === Object.prototype.toString.call(n) - }, - h = 0, - rt = void 0, - y = void 0, - f = function (n, t) { - e[h] = n; - e[h + 1] = t; - 2 === (h += 2) && (y ? y(o) : c()) - }, - ut = 'undefined' != typeof window ? window : void 0, - ft = ut || { - }, - et = ft.MutationObserver || ft.WebKitMutationObserver, - vt = 'undefined' == typeof self && void 0 !== t && '[object process]' === { - }.toString.call(t), - yt = 'undefined' != typeof Uint8ClampedArray && 'undefined' != typeof importScripts && 'undefined' != typeof MessageChannel, - e = new Array(1000), - ot, - w, - st, - b, - c = void 0, - l, - tt, - at, - r; - return vt ? c = function () { - return t.nextTick(o) - } - : et ? (w = 0, st = new et(o), b = document.createTextNode(''), st.observe(b, { - characterData: !0 - }), c = function () { - b.data = w = ++w % 2 - }) : yt ? ((ot = new MessageChannel).port1.onmessage = o, c = function () { - return ot.port2.postMessage(0) - }) : c = void 0 === ut ? function () { - try { - var n = Function('return this') ().require('vertx'); - return void 0 !== (rt = n.runOnLoop || n.runOnContext) ? function () { - rt(o) - } - : p() - } catch (n) { - return p() - } - }() : p(), - l = Math.random().toString(36).substring(2), - tt = 0, - at = function () { - function t(t, i) { - this._instanceConstructor = t; - this.promise = new t(s); - this.promise[l] || lt(this.promise); - it(i) ? (this.length = i.length, this._remaining = i.length, this._result = new Array(this.length), 0 === this.length ? u(this.promise, this._result) : (this.length = this.length || 0, this._enumerate(i), 0 === this._remaining && u(this.promise, this._result))) : n(this.promise, new Error('Array Methods must be provided an Array')) - } - return t.prototype._enumerate = function (n) { - for (var t = 0; void 0 === this._state && t < n.length; t++) this._eachEntry(n[t], t) - }, - t.prototype._eachEntry = function (t, i) { - var u = this._instanceConstructor, - o = u.resolve, - e; - if (o === d) { - var f = void 0, - h = void 0, - c = !1; - try { - f = t.then - } catch (t) { - c = !0; - h = t - } - f === k && void 0 !== t._state ? this._settledAt(t._state, i, t._result) : 'function' != typeof f ? (this._remaining--, this._result[i] = t) : u === r ? (e = new u(s), c ? n(e, h) : ht(e, t, f), this._willSettleAt(e, i)) : this._willSettleAt(new u(function (n) { - return n(t) - }), i) - } else this._willSettleAt(o(t), i) - }, - t.prototype._settledAt = function (t, i, r) { - var f = this.promise; - void 0 === f._state && (this._remaining--, 2 === t ? n(f, r) : this._result[i] = r); - 0 === this._remaining && u(f, this._result) - }, - t.prototype._willSettleAt = function (n, t) { - var i = this; - g(n, void 0, function (n) { - return i._settledAt(1, t, n) - }, function (n) { - return i._settledAt(2, t, n) - }) - }, - t - }(), - r = function () { - function t(i) { - this[l] = tt++; - this._result = this._state = void 0; - this._subscribers = [ - ]; - s !== i && ('function' != typeof i && function () { - throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); - }(), this instanceof t ? function (t, i) { - try { - i(function (n) { - a(t, n) - }, function (i) { - n(t, i) - }) - } catch (i) { - n(t, i) - } - }(this, i) : function () { - throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.'); - }()) - } - return t.prototype.catch = function (n) { - return this.then(null, n) - }, - t.prototype.finally = function (n) { - var t = this.constructor; - return v(n) ? this.then(function (i) { - return t.resolve(n()).then(function () { - return i - }) - }, function (i) { - return t.resolve(n()).then(function () { - throw i; - }) - }) : this.then(n, n) - }, - t - }(), - r.prototype.then = k, - r.all = function (n) { - return new at(this, n).promise - }, - r.race = function (n) { - var t = this; - return it(n) ? new t(function (i, r) { - for (var f = n.length, u = 0; u < f; u++) t.resolve(n[u]).then(i, r) - }) : new t(function (n, t) { - return t(new TypeError('You must pass an array to race.')) - }) - }, - r.resolve = d, - r.reject = function (t) { - var i = new this(s); - return n(i, t), - i - }, - r._setScheduler = function (n) { - y = n - }, - r._setAsap = function (n) { - f = n - }, - r._asap = f, - r.polyfill = function () { - var n = void 0, - t, - u; - if (void 0 !== i) n = i; - else if ('undefined' != typeof self) n = self; - else try { - n = Function('return this') () - } catch (n) { - throw new Error('polyfill failed because global object is unavailable in this environment'); - } - if (t = n.Promise, t) { - u = null; - try { - u = Object.prototype.toString.call(t.resolve()) - } catch (n) { - } - if ('[object Promise]' === u && !t.cast) return - } - n.Promise = r - }, - r.Promise = r, - r - }; - n.exports = r() - }).call(this, i(13), i(14)) -}, -function (n, t) { - 'use strict'; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.Injectable = t.JsInject = void 0; - var i = function () { - function n() { - var n = this; - this.container = { - }; - this.container.$$jsInject = function () { - return n - } - } - var t; - return n.prototype.get = function (n, t) { - var i = this.container[n]; - if (i) return 'object' == typeof i ? i : i(t || 0); - throw 'Service does not exist.'; - }, - n.prototype.invoke = function (n, t, i, r) { - var u = 0, - e = [ - ], - f = r || 0; - if (f > 20) throw 'Maximum recursion at ' + f; - for (; u < t.length; u += 1) e.push(this.get(t[u], f + 1)); - return n.apply(i, e) - }, - n.prototype.register = function (n, t) { - var r, - u = this, - i; - if (r = t, '[object Array]' !== Object.prototype.toString.call(r)) throw 'Must pass array.'; - if (this.container[n]) throw 'Already registered.'; - if ('function' != typeof t[t.length - 1]) throw 'Must pass function to invoke.'; - if ('function' == typeof t[0] && 'object' == typeof t[0]()) return t[t.length - 1].prototype, - i = t[0](), - this.container[n] = i, - i; - this.container[n] = function (i) { - var r, - f, - e, - h = i || 0, - o = function () { - }, - s = t[t.length - 1], - c = 1 === t.length ? t[0].$$deps || [ - ] : t.slice(0, t.length - 1); - return o.prototype = s.prototype, - f = new o, - e = u.invoke(s, c, f, h + 1), - r = e || f, - u.container[n] = function () { - return r - }, - r - } - }, - Object.defineProperty(n, 'ServiceLocator', { - get: function () { - return this._JsInjectInstance.getInstance() - }, - enumerable: !1, - configurable: !0 - }), - n._JsInjectInstance = { - getInstance: function () { - return t || (t = new n), - t - } - }, - n - }(); - t.JsInject = i; - t.Injectable = function (n) { - return function (t) { - if (n.dependence || (n.dependence = [ - ]), !n.name) throw 'L\'objet ' + t.name + ' n\'a pas le param�tre \'name\' dans son d�corateur \'@Injectable\''; - n.dependence.push(t); - i.ServiceLocator.container[n.name] || i.ServiceLocator.register(n.name, n.dependence) - } - } -}, -function (n, t, i) { - 'use strict'; - (function (n) { - var o = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - s = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }, - e; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.jsWPAD335_Recherche = void 0; - var h = i(6), - u = i(3), - c = i(15), - l = i(16), - a = i(4), - v = i(17), - r = 'CPR', - f = function () { - function t() { - if (this.APIDeferredChargement = $.Deferred(), this.MagasinsDeferredChargement = $.Deferred(), this.MagasinsCharges = !1, this.MagasinsEnCoursChargement = !1, this.lstPictos = [ - ], this.RedirigerPasserelle = function (n, t) { - window.WCTD601.Cookie.SetCookie({ - cle: 'clsWPAD042:RecherchePasserelle', - value: 'pr=' + t, - path: '/', - domain: null, - duree: 365, - escape: !1 - }); - window.location.href = n + '&drive=' + t - }, this.EnregistrerCodePostalRecherche = function (n) { - sessionStorage.setItem(r, n) - }, this.SupprimerCodePostalRecherche = function () { - sessionStorage.getItem(r) && sessionStorage.removeItem(r) - }, this.VerifierNavigateurGeoloc = function () { - return l.WCTD204.VerifierNavigateurGeoloc() - }, null != window.Utilitaires.Ressources.ascWPAD335_Recherche) { - this.DivMap = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_DIV_MAP; - this.DivResultatVilles = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_DIV_RESULTAT_VILLES; - this.DivResultatPointsRetrait = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_DIV_RESULTAT_POINTS_RETRAIT; - this.TxtRecherche = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_TXT_RECHERCHE; - this.TxtRechercheSecours = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_TXT_RECHERCHE_SECOURS; - this.UrlAPIGoogleMaps = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_URL_API; - this.UrlApiWoosmap = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_URL_API_WOOSMAP; - this.UrlLIBGoogleMaps = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_URL_LIB; - this.ApiKeyWoosmap = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_API_KEY_WOOSMAP; - this.DelaiAffichageAutocompletion = parseInt(window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_DELAI_AFFICHAGE_AUTOCOMPLETION); - this.DureeTimeoutConnexionApi = parseInt(window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_DUREE_TIMEOUT_CONNEXION_API); - this.MsgZeroResultat = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_ZERO_RESULTAT; - this.MsgErreurGeoloc = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_ERREUR_GEOLOC; - this.MsgOuvertureProchaine = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_OUVERTURE_PROCHAINE; - this.MsgNouveau = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_NOUVEAU; - this.MsgGeolocZeroResultat = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_GEOLOC_ZERO_RESULTAT; - this.MsgGeolocUnResultat = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_GEOLOC_UN_RESULTAT; - this.MsgGeolocNResultats = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_GEOLOC_N_RESULTATS; - this.MsgRechercheZeroResultat = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_RECHERCHE_ZERO_RESULTAT; - this.MsgRechercheUnResultat = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_RECHERCHE_UN_RESULTAT; - this.MsgRechercheNResultats = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_RECHERCHE_N_RESULTATS; - this.MsgRechercheVide = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_RECHERCHE_VIDE; - this.MsgUniversTraiteur = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_UNIVERS_TRAITEUR; - this.MsgUniversDrive = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_UNIVERS_DRIVE; - this.MsgRetraitUniversTraiteur = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_RETRAIT_UNIVERS_TRAITEUR; - this.MsgRetraitUniversDrive = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_RETRAIT_UNIVERS_DRIVE; - this.MsgAdresseHorsZoneLAD = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_ADRESSE_HORS_ZONE; - this.MsgAdresseProchaineZoneLAD = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_ADRESSE_PROCHAINE_ZONE; - this.MsgAdresseHorsZoneLADCP = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_ADRESSE_HORS_ZONE_CP; - this.MsgAdresseProchaineZoneLADCP = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_ADRESSE_PROCHAINE_ZONE_CP; - this.MsgErreurSaisie = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_ERREUR_SAISIE; - this.MsgBandeauDriveVersLAD = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_DRIVE_VERS_LAD; - this.UrlAccueil = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_URL_ACCUEIL; - this.UrlHandlerContexte = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_URL_HANDLER_MISE_A_JOUR_CONTEXTE; - this.UrlAccueilLAD = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_URL_ACCUEIL_LAD; - this.Univers = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_UNIVERS; - this.Marque = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_MARQUE; - this.Perimetre = parseFloat(window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_PERIMETRE); - this.Pays = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_PAYS; - this.CodePays = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_CODE_PAYS; - this.TypeAutocompletion = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_TYPE_AUTOCOMPLETE; - var n = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_GOOGLE_ACTIF, - t = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_WOOSMAP_ACTIF; - this.GoogleMapsActif = 'O' == n || 'true' == n.toLowerCase(); - this.WoosmapActif = 'O' == t || 'true' == t.toLowerCase(); - this.AfficherDistance = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_DISTANCE; - this.NbMagasinsResultat = parseInt(window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_NB_RESULTATS); - this.UrlWebApirRecupererPR = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_URL_WEBAPI_RECUP_PR; - this.MapLatitudeInitiale = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_MAP_LATITUDE; - this.MapLongitudeInitiale = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_MAP_LONGITUDE; - this.MapZoomMinimum = parseInt(window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_MAP_ZOOM_MIN); - this.MapZoomMaximum = parseInt(window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_MAP_ZOOM_MAX); - this.EncartChezMoiActif = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_ENCART_CHEZ_MOI_ACTIF; - this.EncartChezMoiLatitude = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_ENCART_CHEZ_MOI_LATITUDE; - this.EncartChezMoiLongitude = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_ENCART_CHEZ_MOI_LONGITUDE; - this.EncartChezMoiZoom = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_ENCART_CHEZ_MOI_ZOOM; - this.EncartChezMoiZonesLimitrophes = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_ENCART_CHEZ_MOI_ZONES_LIMITROPHES; - this.lstPictos = JSON.parse(window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_PICTOS); - this.UrlPasserelle = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_URL_PASSERELLE - } - } - return Object.defineProperty(t.prototype, 'LstPointsRetraitRecherche', { - get: function () { - return this._LstPointsRetraitRecherche - }, - set: function (n) { - this._LstPointsRetraitRecherche = n - }, - enumerable: !1, - configurable: !0 - }), - t.prototype.listePointRetraitMatch = function (n, t, i) { - var r = this, - f = [ - ]; - return $.isEmptyObject(t) || $.each(t, function (t, e) { - e && e.lstMotsCles && $.each(e.lstMotsCles, function (t, o) { - if (r.Comparer2chaines(o, i) && - 1 === r.VerifierUnicite(n, o) && - 1 === f.findIndex(function (n) { - return n.Description === o - })) { - var s = new u.InformationResultatRecherche(e.rLatitude, e.rLongitude, o, 'pointRetrait', null, null, null, null, e.sCodePostal, r.CodePays); - f.push(s) - } - }) - }), - f.sort(function (n, t) { - return n.Description < t.Description ? - 1 : t.Description > n.Description ? 1 : 0 - }).slice(0, 3) - }, - t.prototype.LogInfo = function (n, t) { - window.Utl.Log.logInfo(n + ' - ' + t) - }, - t.prototype.LogWarn = function (n, t) { - window.Utl.Log.logWarn(n + ' - ' + t) - }, - t.prototype.construireResultatRecherche = function (n, t, i) { - var r = [ - ], - f; - return (n.sort(function (n, t) { - return n.Description > t.Description ? 1 : - 1 - }), r = n.concat(t), $.isEmptyObject(r)) && (f = new u.InformationResultatRecherche(null, null, i, 'inconnu', null, null, null, null, null, this.CodePays), r.push(f)), - r - }, - t.prototype.InitialiserModeSecoursAvecLog = function (n, t) { - null != n && null != t && this.LogWarn(n, t); - this.InitialiserModeSecours() - }, - t.prototype.InitialiserModeSecours = function () { - var n = c.CustomEventPolyfill('ModeSecours', null); - document.dispatchEvent(n) - }, - t.prototype.VerifierCPEtAfficherPR = function (n, t, i, r, u) { - return o(this, void 0, void 0, function () { - var f, - o, - e, - a, - v, - y, - p, - w, - b, - k, - d, - g, - nt, - c, - l = this; - return s(this, function (s) { - switch (s.label) { - case 0: - return s.trys.push([0, - 2, - , - 3]), - n.CodePays = this.CodePays, - [ - 4, - h.VerifierZonesLivraison(n, u) - ]; - case 1: - return f = s.sent(), - [ - 3, - 3 - ]; - case 2: - return o = s.sent(), - 'SILENCIEUX' != t ? (o && o.codePostal && o.ville && $(this.TxtRecherche).val(o.codePostal + ' ' + o.ville), window.WPAD337.MasquerGoogleMaps(), [ - 2, - this.AfficherMessage(this.MsgAdresseHorsZoneLADCP, 'msgErreur') - ]) : 'function' == typeof eval(r) ? (c = eval(r), [ - 2, - c() - ]) : [ - 3, - 3 - ]; - case 3: - if ($(this.TxtRecherche).val(f.codePostal + ' ' + f.ville), 'O' != f.etatSite) return [3, - 8]; - e = this.traiterAddresseLivraisonCookie(f); - a = e.no; - v = e.rue; - y = e.lat; - p = e.lon; - w = e.adr; - b = e.cp; - k = e.ville; - d = e.pays; - s.label = 4; - case 4: - return s.trys.push([4, - 6, - , - 7]), - [ - 4, - this.MemoriserAdresseLivraison(a, v, k, b, d, y, p, w, '') - ]; - case 5: - return s.sent(), - [ - 3, - 7 - ]; - case 6: - return g = s.sent(), - this.LogWarn('jsWPAD335_Recherche', 'impossible de Memoriser l\'adressede livraison dans le cookie: ' + g), - [ - 3, - 7 - ]; - case 7: - return nt = window.WPAD338.ConstruirePointsRetrait('SELECTION_MULTI_SERVICES', null, null, null, null, f.noPL, null, f.codePostal), - nt.done(function (n, t) { - var r, - u; - for (l.LstPointsRetraitRecherche = Array(), r = 0; r < t.length; r++) 1 != t[r].eService && l.LstPointsRetraitRecherche.push(t[r].sNoPR); - ($(l.DivResultatPointsRetrait).html(n), 'function' == typeof eval(i)) && (u = eval(i), u(f)) - }), - [ - 3, - 9 - ]; - case 8: - 'I' == f.etatSite && ('SILENCIEUX' != t ? (window.WPAD335.AfficherMessage(this.MsgAdresseProchaineZoneLADCP, 'msgProchainement'), window.WPAD376.AfficherOuverturePrivee(f.codePostal, f.univers, f.noPL)) : 'function' == typeof eval(r) && (c = eval(r), c())); - s.label = 9; - case 9: - return [2] - } - }) - }) - }, - t.prototype.traiterAddresseLivraisonCookie = function (n) { - var t = this.RecupererAdresseLivraison(), - r = '', - u = '', - i = '', - f = '', - e = '', - o = '', - s = '', - h = ''; - return t && ('no' in t && (r = t.no), 'rue' in t && (u = t.rue), 'cp' in t && (i = t.cp), 'ville' in t && (f = t.ville), 'pays' in t && (e = t.pays), 'lat' in t && (o = t.lat), 'lon' in t && (s = t.lon), 'adr' in t && (h = t.adr)), - n.codePostal != i && (r = '', u = '', i = n.codePostal, f = n.ville, e = n.pays, o = n.latitude, s = n.longitude, h = n.adresse), - { - no: r, - rue: u, - lat: o, - lon: s, - adr: h, - cp: i, - ville: f, - pays: e - } - }, - t.prototype.AfficherPointsRetrait = function (n, t, i, r) { - var e; - this.LstPointsRetraitRecherche = [ - ]; - $(this.DivResultatVilles).hide(); - $(this.DivResultatVilles).empty(); - $(this.DivResultatPointsRetrait).show(); - $(this.DivResultatPointsRetrait).empty(); - var o = this.CalculerDistancePointsRetrait(n, t, i), - u = this.magasinProche(o, n), - s = u.resultatHTML, - f = u.nbResultats; - return this.LstPointsRetraitRecherche = u.lstPointsRetraitRecherche, - e = this.titreAffichage(r, f, void 0), - this.doisAfficherBandeau(r, t, i, !1, e, s, f), - this.LstPointsRetraitRecherche - }, - t.prototype.AfficherPointsRetraitSuite = function (n, t, i, r) { - r && (t = $(t).append($('
  • ').append($('').attr('class', 'aWPAD313_BandeauLad').attr('href', this.UrlAccueilLAD).html('' + this.MsgBandeauDriveVersLAD + '')))); - $(this.DivResultatPointsRetrait).append($('
    ').append($('
    ').append(n.titre))).html(); - $(this.DivResultatPointsRetrait).append($('
    ').append(t)).html(); - 0 != i && ('iDRIVE' == this.Univers && 'iCHEZMOI' != this.Marque ? $('#btnWPAD313_MapLAD').removeClass('masquer') : $('#btnWPAD313_Map').removeClass('masquer')) - }, - t.prototype.MemoriserAdresseLivraison = function (t, i, r, u, f, e, o, s, h) { - var c = this, - l = { - sTypeContexte: 'ContexteAdresse', - sNumeroRue: t, - sRue: i, - sVille: r, - sCodePostal: u, - sPays: f, - sLatitude: e, - sLongitude: o, - sAdresse: s, - sLocationType: h - }; - return new n(function (n, t) { - window.Utilitaires.Ajax.appeler({ - config: { - type: window.Utilitaires.Constantes.Ajax.Type.iHANDLER, - method: window.Utilitaires.Constantes.Ajax.Methode.iPOST, - url: c.UrlHandlerContexte, - xhrFields: { - withCredentials: !0 - }, - data: l, - dataType: 'json' - } - }).done(function () { - n() - }).fail(function () { - t() - }) - }) - }, - t.prototype.RecupererAdresseLivraison = function () { - var r, - n = window.WCTD601.Cookie.GetCookie('clsWCSD190:Lad'), - u, - t, - i; - if (n) for (n = decodeURIComponent(escape(n)), r = Object(), u = n.split('&'), t = 0; t < u.length; t++) i = u[t].split('='), - i && (r[i[0]] = i[1].replace(/\+/g, ' ')); - return r - }, - t.prototype.AfficherFicheMagasin = function (n, t) { - a.WPAD329.AfficherFicheMagasin(n, t, !1, !1) - }, - t.prototype.AfficherMessage = function (n, t) { - var i; - $(this.DivResultatVilles).empty(); - $(this.DivResultatVilles).show(); - i = t ? '
    ' : '
    '; - $(this.DivResultatVilles).append($('
    ').append($(i).html(n))) - }, - t.prototype.MasquerMessage = function () { - $(this.DivResultatVilles + ' dt').remove() - }, - t.prototype.AfficherLoader = function () { - $(this.TxtRecherche).addClass('loading') - }, - t.prototype.MasquerLoader = function () { - $(this.TxtRecherche).removeClass('loading') - }, - t.prototype.CalculerDistancePointsRetrait = function (n, t, i) { - var u = this, - r = [ - ]; - return n.forEach(function (n, f) { - var h = f, - c = n.rLatitude, - l = n.rLongitude, - e = n.sEtatSite, - a = n.fSitePrive, - o, - s; - 'O' != e && 'I' != e || a || (o = u.CalculerDistanceGPS(t, i, c, l), s = { - noPointRetrait: h, - distance: parseFloat(o.toFixed(2)) - }, r.push(s)) - }), - r - }, - t.prototype.VerifierUnicite = function (n, t) { - return n.forEach(function (n, i) { - if (n.Description == t) return i - }), - - 1 - }, - t.prototype.Comparer2chaines = function (n, t) { - return t = t || '', - 0 == (n = n || '').toLowerCase().indexOf(t.toLowerCase()) - }, - t.prototype.CalculerDistanceGPS = function (n, t, i, r) { - var f = this.ToRad(i - n), - e = this.ToRad(r - t), - u; - return n = this.ToRad(n), - i = this.ToRad(i), - u = Math.sin(f / 2) * Math.sin(f / 2) + Math.sin(e / 2) * Math.sin(e / 2) * Math.cos(n) * Math.cos(i), - 12742 * Math.atan2(Math.sqrt(u), Math.sqrt(1 - u)) - }, - t.prototype.CalculerPointMilieuGPS = function (n, t, i, r) { - var e = this.ToRad(r - t); - n = this.ToRad(n); - i = this.ToRad(i); - t = this.ToRad(t); - var u = Math.cos(i) * Math.cos(e), - f = Math.cos(i) * Math.sin(e), - o = Math.atan2(Math.sin(n) + Math.sin(i), Math.sqrt((Math.cos(n) + u) * (Math.cos(n) + u) + f * f)), - s = t + Math.atan2(f, Math.cos(n) + u); - return new google.maps.LatLng(this.ToDeg(o), this.ToDeg(s)) - }, - t.prototype.ToRad = function (n) { - return n * Math.PI / 180 - }, - t.prototype.ToDeg = function (n) { - return n * (180 / Math.PI) - }, - t.prototype.ConstruireDDLPointsRetrait = function (n, t, i, r) { - var e = this, - u = Array(), - f, - o; - null != r && (f = Object(), f.sTexte = r, f.sValeur = '', f.fSelected = !0, u.push(f)); - n.forEach(function (n) { - if (('1' == n.eTypePR || '5' == n.eTypePR) && 'F' != n.sEtatSite && 'N' != n.sEtatSite && !n.fSitePrive) { - var i = n.sNomPL, - r = n.sCodePostal, - f = n.sNoPL, - e = n.sNoPR, - t = Object(); - t.sTexte = '' + r + ' - ' + i; - t.sValeur = f + '|' + e; - u.push(t) - } - }); - u = u.sort(function (n, t) { - return n.sTexte < t.sTexte ? - 1 : n.sTexte > t.sTexte ? 1 : 0 - }); - o = window.WCTD201.Class.DropDownList.Construire({ - data: u, - iLargeur: i - }); - $(t).html(o); - window.WCTD601.View.RaiseUpdate(); - $(t + ' .selWCTD240_DDList').change(function (n) { - var t = $(n.currentTarget).find(':selected').val().toString(), - i, - r; - '' != t && (i = t.split('|'), r = $(n.currentTarget).find(':selected').text().split(' - ') [0], e.SupprimerCodePostalRecherche(), e.EnregistrerCodePostalRecherche(r), window.WPAD338.AfficherPointsRetrait('SELECTION', null, null, null, null, i[0], null)) - }) - }, - t.prototype.sort_by = function (n, t, i) { - var r = i ? function (t) { - return i(t[n]) - } - : function (t) { - return t[n] - }, - u = t ? - 1 : 1; - return function (n, t) { - var i = n > t ? 1 : 0, - f = n < t ? 1 : 0; - return n = r(n), - t = r(t), - u * (i - f) - } - }, - t.prototype.doisAfficherBandeau = function (n, t, i, r, u, f, e) { - this.AfficherPointsRetraitSuite(u, f, e, r) - }, - t.prototype.titreAffichage = function (n, t, i) { - var r; - if ('geolocalisation' == n) switch (t) { - case 0: - r = this.MsgGeolocZeroResultat; - break; - case 1: - r = this.MsgGeolocUnResultat; - break; - default: - r = this.MsgGeolocNResultats - } else switch (t) { - case 0: - r = (i = this.MsgRechercheZeroResultat).replace('#1', n); - break; - case 1: - r = (i = this.MsgRechercheUnResultat).replace('#1', n); - break; - default: - r = (i = this.MsgRechercheNResultats).replace('#1', n) - } - return { - titre: r, - str: i - } - }, - t.prototype.magasinProche = function (n, t) { - var c = 0, - l = [ - ], - a, - u, - r, - s, - i, - o; - if ((n = n.sort(function (n, t) { - return n.distance - t.distance - })).length > 0) for (a = n.length > this.NbMagasinsResultat ? this.NbMagasinsResultat - 1 : n.length, u = document.createElement('ul'), r = 0; r < a; r++) if (s = n[r].distance, s <= this.Perimetre) { - if (c++, i = n[r].noPointRetrait, 'iDRIVE' != this.Univers || 'iCHEZMOI' == this.Marque) { - var h, - v = t[i].sNoPL, - y = t[i].sCodePostal, - p = t[i].sNomPR, - w = t[i].sEtatSite, - b = t[i].fNouveauSite, - k = (t[i].eUnivers, t[i].eTypePR), - f = '', - e = ''; - 'I' == w ? (f = this.MsgOuvertureProchaine, e = 'etat-ouverture') : 'O' == b && (f = this.MsgNouveau, e = 'etat-nouveau'); - h = this.AfficherDistance ? p + ' - ' + s + ' km' : p; - o = ''; - o = 2 == k ? this.MsgRetraitUniversTraiteur : this.MsgRetraitUniversDrive; - void 0 !== window.WPAD001 ? $(u).append($('
  • ').append($('').attr('href', 'javascript:void(0);').attr('onclick', 'WPAD335.AfficherFicheMagasin(\'' + v + '\',\'' + i + '\')').append($('').addClass('univers').append(o)).append($('').append(y)).append(h).append($('').addClass('etat').addClass(e).append(f)))) : void 0 !== window.WPAD040 && $(u).append($('
  • ').append($('').attr('href', 'javascript:void(0);').attr('onclick', 'WPAD335.RedirigerPasserelle(\'' + this.UrlPasserelle + '\',\'' + v + '\')').append($('').addClass('univers').append(o)).append($('').append(y)).append(h).append($('').addClass('etat').addClass(e).append(f)))) - } - l.push(i) - } - return { - resultatHTML: u, - nbResultats: c, - lstPointsRetraitRecherche: l - } - }, - t.DataTrackPush = function (n, t) { - var i = n + ' | ' + t; - v.WTRK306.EnvoyerEvenementManuel({ - evenementCategorie: 'Drive', - evenementAction: 'Recherche Portail', - evenementLibelle: i - }) - }, - t - }(); - t.jsWPAD335_Recherche = f; - e = new f; - window.WPAD335 = e - }).call(this, i(0).Promise) -}, -function (n, t) { - 'use strict'; - var i, - r, - u; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.TypeLieu = t.AdresseGeocodage = t.ResultatGeocodage = t.InformationResultatRecherche = void 0; - i = function (n, t, i, r, u, f, e, o, s, h) { - this.latitude = n; - this.longitude = t; - this.Description = i; - this.TypeRecherche = r; - this.TypeResultat = u; - this.PlaceId = f; - this.Ville = e; - this.Arrondissement = o; - this.CodePostal = s; - this.CodePays = h - }; - t.InformationResultatRecherche = i; - r = function () { - this.LstAdresse = [ - ]; - this.LstCodePostalLieu = [ - ] - }; - t.ResultatGeocodage = r; - u = function () { - }; - t.AdresseGeocodage = u, - function (n) { - n.APPROXIMATE = 'APPROXIMATE'; - n.GEOMETRIC_CENTER = 'GEOMETRIC_CENTER'; - n.RANGE_INTERPOLATED = 'RANGE_INTERPOLATED'; - n.ROOFTOP = 'ROOFTOP' - }(t.TypeLieu || (t.TypeLieu = { - })) -}, -function (n, t, i) { - 'use strict'; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.WPAD329 = void 0; - var u = i(7), - f = i(8), - r = i(9); - $(document).ready(function () { - window.Utilitaires.Pubsub.on('Auth.Connexion', function (n) { - t.WPAD329.AbonnementConnecter(n) - }); - window.Utilitaires.Pubsub.on('Auth.Deconnexion', function (n) { - t.WPAD329.AbonnementDeconnecter(n) - }) - }); - t.WPAD329 = { - noPointLivraison: void 0, - AbonnementConnecter: function () { - null != t.WPAD329.noPointLivraison && t.WPAD329.AfficherFicheMagasin(t.WPAD329.noPointLivraison, null, !1, !1) - }, - AbonnementDeconnecter: function () { - null != t.WPAD329.noPointLivraison && t.WPAD329.AfficherFicheMagasin(t.WPAD329.noPointLivraison, null, !1, !1) - }, - AfficherFicheMagasin: function (n, i, e, o) { - if (null == n) r.WPAD001.modalNavigate('close', !1); - else { - window.Utl.Loader.afficher(); - var s = 'FICHE'; - o && (s = 'FICHE_SELECTION'); - window.WPAD338.ConstruirePointsRetrait(s, null, null, null, null, n, i, null).done(function (n, i) { - $('#divWPAD329_Magasin').html(n); - i.length > 0 && (u.WPAD327.MettreAJourConnexionInscription(i[0].sUrlInscription, i[0].sUrlConnexion, i[0].sEtatSite, i.fConnecte, i.fEstMobile), f.WPAD334.MettreAJourBandeau(i[0].sNomPR, i[0].sUrlSiteCourses, i[0].sUrlSiteAccueil, i[0].sEtatSite, i.fConnecte, e), t.WPAD329.MettreAJourAideEnLigne(i[0].eMarque, i[0].sNomPL, i[0].sUrlAideEnLigne)); - var o = 'divModalMagasin&' + i[0].sNoPL; - r.WPAD001.modalNavigate(o, !0); - window.Utl.Loader.masquer() - }).fail(function () { - }) - } - }, - MettreAJourAideEnLigne: function (n, t, i) { - 1 == n ? ($('#spanNomMagasin').html(t), $('[id$=btnAccederAeL]').on('click', function () { - return window.open(encodeURI(i), '', 'width=870,height=750,toolbars=no,scrollbars=yes,status=no,resizable=yes'), - !1 - }), $('#divAideEnLigne').show()) : $('#divAideEnLigne').hide() - } - }; - t.WPAD329 = t.WPAD329 || { - }; - window.WPAD329 = t.WPAD329 -}, -function (n) { - n.exports = jQuery -}, -function (n, t, i) { - 'use strict'; - (function (n) { - function o(n, t) { - return u(this, void 0, void 0, function () { - var u, - i; - return f(this, function () { - return u = $.Deferred(), - i = new r, - n.forEach(function (n, r) { - var o = r, - s = n.sNoPL, - h = n.eUnivers, - f = n.sEtatSite, - c = n.fSitePrive, - e = n.lstZonesLivraison, - l; - null != e && ('O' == f || 'I' == f) && (l = function (n) { - var t = [ - ]; - return $.each(n, function (n, i) { - i.fExclus && t.push(i.sCodePostal) - }), - t - }(e), e.forEach(function (n) { - if (!n.fExclus && (null == n.sCodePostal && t.startsWith(n.sCodeDepartement) && l.indexOf(t) < 0 || n.sCodePostal == t)) return i.noPL = s, - i.noPR = o, - i.univers = h, - i.etatSite = f, - i.sitePrive = c, - !1 - })); - u.resolve(i) - }), - [ - 2, - u.promise() - ] - }) - }) - } - var u = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - f = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }, - e, - r; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.ZoneLivraison = t.VerifierZonesLivraison = t.VerifierZonesLivraisonCodePostal = void 0; - e = i(1); - t.VerifierZonesLivraisonCodePostal = o; - t.VerifierZonesLivraison = function (t, i) { - return u(this, void 0, void 0, function () { - return f(this, function () { - return [2, - new n(function (n, r) { - e.JsInject.ServiceLocator.get('RecherchePositionController').GeocodageCodePostal(t).then(function (u) { - var f, - e, - c = u.Ville, - s = u.LstCodePostalLieu[0], - h; - (e = '', s && ('' != e && (e += ' - '), e += s), c && ('' != e && (e += ' '), e += c), null == s) && (h = /[0-9]{5}/, t.Description.match(h) && t.Description.match(h) [0] && (s = t.Description.match(h) [0])); - o(i, s).then(function (i) { - (f = i).ville = c; - f.codePostal = s; - f.pays = u.CodePays; - f.adresse = e; - f.latitude = t.latitude && t.latitude.toString() || ''; - f.longitude = t.longitude && t.longitude.toString() || ''; - f.locationType = u.TypeLieu; - f.noPR ? n(f) : r(new Error('Erreur lors de la verification de la zone de livraiso, pas de pr')) - }) - }).catch(function (n) { - r(new Error('Erreur lors de la verification de la zone de livraison' + n)) - }) - })] - }) - }) - }; - r = function () { - }; - t.ZoneLivraison = r - }).call(this, i(0).Promise) -}, -function (n, t) { - var i = i || { - }; - t = t || { - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - $(document).ready(function () { - Utilitaires.Pubsub.on('Auth.Connexion', function (n) { - i.AbonnementConnecter(n) - }); - Utilitaires.Pubsub.on('Auth.Deconnexion', function (n) { - i.AbonnementDeconnecter(n) - }) - }); - i = { - AbonnementConnecter: function () { - $('[id$=_sectionWPAD327_ConnexionInscription]').addClass('masquer') - }, - AbonnementDeconnecter: function () { - $('[id$=_sectionWPAD327_ConnexionInscription]').removeClass('masquer') - }, - MettreAJourConnexionInscription: function (n, t, i, r, u) { - 'O' != i || r ? $('[id$=_sectionWPAD327_ConnexionInscription]').addClass('masquer') : $('[id$=_sectionWPAD327_ConnexionInscription]').removeClass('masquer'); - $('[id$=_aWPAD327_InscrivezVous]').attr('href', n); - u ? $('[id$=_aWPAD327_SeConnecter]').attr('href', t) : $('[id$=_aWPAD327_SeConnecter]').click(function (n) { - n.preventDefault(); - n.stopPropagation(); - $('html, body').animate({ - scrollTop: 0 - }, 300).promise().then(function () { - $('.aWPAD346_NonConnecte').click(); - $('.aWPAD354_NonConnecte').click() - }) - }) - } - }; - 'undefined' != typeof Sys && Sys.Application.notifyScriptLoaded(); - t.WPAD327 = i -}, -function (n, t) { - var i = i || { - }; - t = t || { - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - $(document).ready(function () { - i.AffichageSticky(); - Utilitaires.Pubsub.on('Auth.Connexion', function (n) { - i.AbonnementConnecter(n) - }); - Utilitaires.Pubsub.on('Auth.Deconnexion', function (n) { - i.AbonnementDeconnecter(n) - }) - }); - i = { - Etat: void 0, - LOC_ENTRER: void 0, - LOC_CHOISIR: void 0, - LOC_CONNECTE: void 0, - LOC_LECLERC_TITRE: void 0, - AbonnementConnecter: function () { - $('[id$=_aWPAD334_AccesDrive]').removeClass('masquer'); - $('[id$=_spanWPAD334_Titre1]').html(i.LOC_LECLERC_TITRE); - $('[id$=_spanWPAD334_Titre1]').removeClass('spanWPAD334_Titre1'); - $('[id$=_spanWPAD334_Titre2]').html(''); - $('[id$=_spanWPAD334_AccesDrive]').html(i.LOC_ENTRER); - 'O' != i.Etat && $('[id$=_aWPAD334_AccesDrive]').addClass('masquer') - }, - AbonnementDeconnecter: function () { - $('[id$=_aWPAD334_AccesDrive]').removeClass('masquer'); - $('[id$=_spanWPAD334_Titre1]').html(i.LOC_LECLERC_TITRE); - $('[id$=_spanWPAD334_Titre1]').removeClass('spanWPAD334_Titre1'); - $('[id$=_spanWPAD334_Titre2]').html(''); - $('[id$=_spanWPAD334_AccesDrive]').html(i.LOC_CHOISIR); - 'O' != i.Etat && $('[id$=_aWPAD334_AccesDrive]').addClass('masquer') - }, - MettreAJourBandeau: function (n, t, r, u, f, e) { - if (null != Utilitaires.Ressources.ascWPAD334_BandeauMagasin) { - switch (Utilitaires.Ressources.ascWPAD334_BandeauMagasin.PARAM_MARQUE_UNIVERS) { - case 'iTRAITEUR': - i.LOC_ENTRER = Utilitaires.Ressources.ascWPAD334_BandeauMagasin.LOC_ENTRER_TRAITEUR; - i.LOC_CHOISIR = Utilitaires.Ressources.ascWPAD334_BandeauMagasin.LOC_CHOISIR_TRAITEUR; - i.LOC_CONNECTE = Utilitaires.Ressources.ascWPAD334_BandeauMagasin.LOC_CONNECTE_TRAITEUR; - i.LOC_LECLERC_TITRE = Utilitaires.Ressources.ascWPAD334_BandeauMagasin.LOC_LECLERC_TITRE_TRAITEUR; - break; - default: - i.LOC_ENTRER = Utilitaires.Ressources.ascWPAD334_BandeauMagasin.LOC_ENTRER_DRIVE; - i.LOC_CHOISIR = Utilitaires.Ressources.ascWPAD334_BandeauMagasin.LOC_CHOISIR_DRIVE; - i.LOC_CONNECTE = Utilitaires.Ressources.ascWPAD334_BandeauMagasin.LOC_CONNECTE_DRIVE; - i.LOC_LECLERC_TITRE = Utilitaires.Ressources.ascWPAD334_BandeauMagasin.LOC_LECLERC_TITRE_DRIVE - } - $('[id$=_spanWPAD334_NomDrive]').html(n); - $('[id$=_aWPAD334_AccesDrive]').attr('href', t); - null != $.WCTD204_QueryString.sProvenance && 'SM' == $.WCTD204_QueryString.sProvenance ? ($('.aWPAD334_Retour').attr('href', t), $('.aWPAD334_Retour').off()) : $.WCTD204_QueryString.desktopversion || (document.URL.contains('divModalRecherche') ? $('.aWPAD334_Retour').attr('href', 'javascript:void(0)') : ($('.aWPAD334_Retour').attr('href', r + '/?sRedirect=false'), $('.aWPAD334_Retour').off())); - i.Etat = u; - f ? (i.AbonnementConnecter(), e && ($('[id$=_spanWPAD334_Titre1]').html(i.LOC_CONNECTE), $('[id$=_spanWPAD334_Titre1]').addClass('spanWPAD334_Titre1'), $('[id$=_spanWPAD334_Titre2]').html(n))) : i.AbonnementDeconnecter() - } - }, - AffichageSticky: function () { - $('.divModalMagasin').hasClass('modal-active') && $('.divModalMagasin').scrollTop() >= 100 ? $('.headerWPAD334_Sticky').css({ - position: '-webkit-sticky', - position: 'sticky', - top: '0px', - display: 'table' - }) : $('.headerWPAD334_Sticky').hide(); - $('.divModalMagasin').off('scroll').on('scroll', function () { - $('.divModalMagasin').hasClass('modal-active') && $('.divModalMagasin').scrollTop() >= 100 ? $('.headerWPAD334_Sticky').css({ - position: '-webkit-sticky', - position: 'sticky', - top: '0px', - display: 'table' - }) : $('.headerWPAD334_Sticky').hide() - }); - $('body').off('modale-open').on('modale-open', function () { - i.AffichageSticky() - }) - } - }; - 'undefined' != typeof Sys && Sys.Application.notifyScriptLoaded(); - t.WPAD334 = i -}, -function (n, t) { - var i = i || { - }, - t = t || { - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - $(document).ready(function () { - $('[data-modal]').on('click', function (n) { - i.stopEvent(n); - var t = !0; - null != $(this).data('history') && 0 != $(this).data('history') || (t = !1); - i.modalNavigate($(this).data('modal'), t, $(this).data('modalcallback')) - }); - $(window).on('popstate', function () { - var n = '' !== window.location.hash.slice(2) ? window.location.hash.slice(2) : 'close'; - i.modalNavigate(n, !1) - }); - $(window).on('load', function () { - var r = window.location.hash.slice(2), - t, - n; - if (r) { - t = r.split('&'); - n = n || { - }; - switch (t[0]) { - case 'divModalMagasin': - 'function' == typeof n.AfficherFicheMagasin && function (n, t) { - n[1] && i.modalNavigate(n[0], !1, t(n[1])) - }(t, n.AfficherFicheMagasin) - } - } - }) - }); - i = { - zIndex: 50, - windowScrolltop: 0, - modaleActive: [ - ], - modalNavigate: function (n, t, r) { - var o = n.split('&'), - u = o[0], - s = o[1], - f, - h, - c, - l, - e; - /[_=&]/.test(u) || (f = $('.' + u), h = 'close' !== u ? '#_' + u : '#_', 'back' === u ? history.back() : (t && (e = h + (s ? '&' + s : ''), history.pushState(null, null, e)), 'close' !== u ? f.length && ((f.addClass('modal-active').css('z-index', i.zIndex), $('.hdWCSD347_Bandeau ~ #sectionWCRS001_MainContent').css('z-index', 30), i.modaleActive.push(f), i.zIndex++, 'function' == typeof eval(r)) && (c = eval(r), c()), $('body').trigger('modale-open'), setTimeout(function () { - i.windowScrolltop = $(window).scrollTop(); - $('form > *:not(.modal-active)').hide(); - $('form > .modal-active').show() - }, 400)) : Utilitaires.Ressources.clsWPAD041_MasterBase && null != Utilitaires.Ressources.clsWPAD041_MasterBase.PARAM_URL_REDIRECTION_PAGE_APPELANTE ? history.back() : (i.modaleActive[i.modaleActive.length - 1] && (i.modaleActive[i.modaleActive.length - 1].removeClass('modal-active'), $('.hdWCSD347_Bandeau ~ #sectionWCRS001_MainContent').css('z-index', 10), i.modaleActive[i.modaleActive.length - 2]) && (l = i.modaleActive[i.modaleActive.length - 2].selector.replace('.', ''), e = document.URL.replace('/#_', '/#_' + l), history.pushState({ - }, '', e)), i.modaleActive.pop(), $('body').removeClass('modal-opened'), $('form > *').show(), $(window).scrollTop(i.windowScrolltop)))) - }, - RetourHautDePage: function () { - (i.modaleActive.length > 0 ? i.modaleActive[i.modaleActive.length - 1] : $('html, body')).stop().animate({ - scrollTop: 0 - }, 500) - }, - FermerModales: function () { - i.modalNavigate('close'); - i.ScrollerHautRecherche() - }, - ScrollerHautRecherche: function () { - $('html,body').stop().animate({ - scrollTop: $('.sectionRecherche').offset().top - 20 - }, 300) - }, - stopEvent: function (n) { - n.preventDefault(); - n.stopPropagation() - } - }; - 'undefined' != typeof Sys && Sys.Application.notifyScriptLoaded(); - t.WPAD001 = i -}, -function (n, t, i) { - 'use strict'; - (function (n) { - var f = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - e = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }, - s = this && this.__importDefault || function (n) { - return n && n.__esModule ? n : { - 'default': n - } - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.jsWPAD337_RechercheCarte = void 0; - var r = s(i(5)), - h = i(2), - u = i(1), - o = i(3), - c = function () { - function n() { - var n = this, - t; - this.LstMarkers = [ - ]; - this.LstPointsCarte = [ - ]; - this.LstMarkersRecherche = [ - ]; - this.LstMarkersSpec = [ - ]; - this.objRecherche = new h.jsWPAD335_Recherche; - this.flightPathList = [ - ]; - this.AfficherCarte = function (t) { - return f(n, void 0, void 0, function () { - var n, - i, - r, - u; - return e(this, function (f) { - switch (f.label) { - case 0: - return f.trys.push([0, - 3, - , - 4]), - [ - 4, - this.GoogleMapService.APIMap() - ]; - case 1: - return n = f.sent(), - [ - 4, - this.PointRetraitController.GetPointsRetrait(!0) - ]; - case 2: - if (i = f.sent(), this.GoogleMapService.fMapEstInit || (this.pInitialiserCarte(n, i), this.GoogleMapService.fMapEstInit = !0), r = this, !('inconnu' == t.TypeRecherche || t.latitude && t.longitude)) throw new Error('Il manque longitude ou latitude sur le clic d\'une region'); - return r.pAfficherCarteSuite(n, i, t), - [ - 2, - n - ]; - case 3: - return u = f.sent(), - this.objRecherche.InitialiserModeSecoursAvecLog('AfficherCarte', 'Erreur lors de l\'affichage de la carte: ' + u), - [ - 3, - 4 - ]; - case 4: - return [2] - } - }) - }) - }; - this.pAfficherCarteSuite = function (t, i, r) { - var f, - u = !0, - e = n, - o, - s; - 'region' == r.TypeRecherche ? (u = !1, f = 7, o = new google.maps.LatLng(r.latitude, r.longitude), e.pPositionner(t, o, 7, u, !1, null, null)) : (s = new google.maps.LatLng(r.latitude, r.longitude), e.pPositionner(t, s, f, u, !0, null, null)) - }; - this.pCreerMarkerSpecifique = function (t, i) { - var u, - f, - r, - e; - switch (u = n.pCreerImageMarkerSpecifique(n.objRecherche.lstPictos[i].sUrl, n.objRecherche.lstPictos[i].iLargeur, n.objRecherche.lstPictos[i].iHauteur), f = new google.maps.LatLng(n.objRecherche.EncartChezMoiLatitude, n.objRecherche.EncartChezMoiLongitude), (r = new google.maps.Marker({ - position: f, - icon: u, - zIndex: 101, - optimized: !0 - })).setMap(t), i) { - case 'laddrive': - r.setMap(t); - r.addListener('click', function () { - window.location.href = n.objRecherche.UrlAccueilLAD - }); - e = r; - google.maps.event.addListener(t, 'zoom_changed', function () { - var n = t.getZoom(); - e.setVisible(n >= window.WPAD337.googleMapOption.markerParisZoom) - }) - } - return r - }; - this.pPositionner = function (t, i, r, u, f) { - var e, - o; - (n.pAfficherGoogleMaps(t), t.bounds_changed = function () { - if ('iCHEZMOI' != n.objRecherche.Marque) { - for (var r, u = 0, i = 0; i < n.LstMarkers.length; i++) null != t && t.getBounds().contains(n.LstMarkers[i].getPosition()) && (u++, r = n.LstMarkers[i]); - 1 == u && 'iDRIVE' != n.objRecherche.Marque && google.maps.event.trigger(r, 'click') - } - n.ScrollerHauteCarte(); - t.bounds_changed = null - }, n.pResetMarkers(n.LstMarkersRecherche), n.pResetMarkers(n.LstMarkersSpec), u) && (e = n.pCreerMarker(t, null, i), n.LstMarkersRecherche.push(e)); - 'iDRIVE' == n.objRecherche.Univers && 'iCHEZMOI' != n.objRecherche.Marque && 'O' == n.objRecherche.EncartChezMoiActif && (o = n.pCreerMarkerSpecifique(t, 'laddrive'), n.LstMarkersSpec.push(o)); - f ? n.pZoomAutomatique(t, i) : n.pZooFixe(t, r, i) - }; - jQuery('.imgWPAD337_Carte') [0] && r.default('.imgWPAD337_Carte').maphilight({ - fade: !1, - fillColor: 'f18e00' - }); - t = this; - null != window.Utilitaires.Ressources.ascWPAD337_RechercheCarte && (window.Utilitaires.Ressources.ascWPAD337_RechercheCarte.PARAM_CARTE_STATIQUE.bool() || r.default('.divWPAD337_Carte area, .divWPAD337_Carte img[class*=imgWPAD337_PictoMagasin]').click(function (n) { - var i, - u, - f; - n.stopImmediatePropagation(); - i = ''; - (i = r.default(n.currentTarget).attr('id') ? r.default(n.currentTarget).attr('id') : r.default(n.currentTarget).attr('alt'), t.RecherchePositionController.ApiMapActif()) ? (u = JSON.parse(window.Utilitaires.Ressources.ascWPAD337_RechercheCarte.PARAM_REGIONS), f = new o.InformationResultatRecherche(u[i].nrLatitudeGPS, u[i].nrLongitudeGPS, u[i].sLibelleRegion, 'region', null, null, null, null, null, null), t.AfficherCarte(f)) : t.objRecherche.InitialiserModeSecours() - })) - } - return Object.defineProperty(n.prototype, 'RecherchePositionController', { - get: function () { - return u.JsInject.ServiceLocator.get('RecherchePositionController') - }, - enumerable: !1, - configurable: !0 - }), - Object.defineProperty(n.prototype, 'GoogleMapService', { - get: function () { - return u.JsInject.ServiceLocator.get('GoogleMapService') - }, - enumerable: !1, - configurable: !0 - }), - Object.defineProperty(n.prototype, 'PointRetraitController', { - get: function () { - return u.JsInject.ServiceLocator.get('PointRetraitController') - }, - enumerable: !1, - configurable: !0 - }), - n.prototype.ScrollerHauteCarte = function () { - r.default('.divWPAD336_RechercheTraiteur').length > 0 ? r.default('html,body').stop().animate({ - scrollTop: r.default('.divWPAD337_RechercheCarte').offset().top - 190 - }, 300) : r.default('.divWPAD337_RechercheCarte').length > 0 && r.default('html,body').stop().animate({ - scrollTop: r.default('.divWPAD337_RechercheCarte').offset().top - 220 - }, 300) - }, - n.prototype.MasquerGoogleMaps = function () { - r.default('.divWPAD337_Map').addClass('masquer'); - r.default('.divWPAD337_RechercheCarte').removeClass('active'); - 'iCHEZMOI' == this.objRecherche.Marque ? r.default('.divWPAD337_RechercheCarte').parent().removeClass('open') : r.default('.divWPAD337_Carte').removeClass('masquer'); - window.Utilitaires.Pubsub.trigger('Maps.Masquage') - }, - Object.defineProperty(n.prototype, 'DivCarteName', { - get: function () { - return 'divWPAD337_Carte' - }, - enumerable: !1, - configurable: !0 - }), - Object.defineProperty(n.prototype, 'DivCarteClass', { - get: function () { - return '.' + this.DivCarteName - }, - enumerable: !1, - configurable: !0 - }), - n.prototype.pInitialiserCarte = function (n, t) { - var i, - u, - r, - f, - e, - o; - window.WPAD337.googleMapOption = { - minDistanceZoom: 1000, - facteur: 1, - nombreDePoints: 10, - distanceMaximum: 30000, - markerParisZoom: 10, - offset: 2500, - debug: !1 - }; - this.LstMarkers = [ - ]; - i = this.pConstruireListPointsCarte(t); - i.iIdPointCarte; - i.pointCarte; - i.pointRetrait; - i.lstPointsRetrait; - for (u in this.LstPointsCarte) { - r = void 0; - try { - r = this.pCreerMarker(n, this.LstPointsCarte[u], null) - } catch (n) { - throw new Error('Marker impossible à créer: ' + n); - } - r && this.LstMarkers.push(r) - } - f = new google.maps.LatLng(this.objRecherche.MapLatitudeInitiale, this.objRecherche.MapLongitudeInitiale); - e = { - zoom: this.objRecherche.MapZoomMinimum, - center: f, - zoomControlOptions: { - style: google.maps.ZoomControlStyle.LARGE, - position: google.maps.ControlPosition.LEFT_CENTER - }, - zoomControl: !0, - mapTypeControl: !1, - scaleControl: !1, - streetViewControl: !0, - rotateControl: !1, - fullscreenControl: !1, - mapTypeId: google.maps.MapTypeId.ROADMAP, - minDistanceZoom: this.objRecherche.MapZoomMinimum, - maxZoom: this.objRecherche.MapZoomMaximum - }; - n.setOptions(e); - o = this; - google.maps.event.addListener(n, 'zoom_changed', function () { - o.pCalculerMarkers(n) - }) - }, - n.prototype.pConstruireListPointsCarte = function (n) { - var u, - r, - i, - f = [ - ]; - for (var t in n) 'F' == n[t].sEtatSite || 'N' == n[t].sEtatSite || 1 == n[t].eService || n[t].fSitePrive || (u = n[t].iIdPointCarte, (r = Object()).iIdPointCarte = n[t].iIdPointCarte, r.rLatitude = n[t].rLatitude, r.rLongitude = n[t].rLongitude, (i = Object()).sNoPointRetrait = t, i.sNom = n[t].sNomPL, i.sNomPR = n[t].sNomPR, i.sCodePostal = n[t].sCodePostal, i.eTypePR = n[t].eTypePR, i.eService = n[t].eService, i.sNoPointLivraison = n[t].sNoPL, i.sEtatSite = n[t].sEtatSite, i.fNouveauSite = n[t].fNouveauSite, i.fSitePrive = n[t].fSitePrive, i.iIdUnivers = n[t].eUnivers, null == this.LstPointsCarte[u] ? ((f = Array()).push(i), r.lstPointsRetrait = f, this.LstPointsCarte[u] = r) : this.LstPointsCarte[u].lstPointsRetrait.push(i)); - return { - iIdPointCarte: u, - pointCarte: r, - pointRetrait: i, - lstPointsRetrait: f - } - }, - n.prototype.pCreerMarker = function (n, t, i) { - var e, - r, - f, - u, - l = this, - o, - s, - c, - h; - switch (this.objRecherche.Marque) { - case 'iCHEZMOI': - u = '3'; - break; - default: - u = '1' - } - if (null != i) r = 'position', - 'iCHEZMOI' == this.objRecherche.Marque || (e = this.pCreerImageMarker(this.objRecherche.lstPictos[r + u].sUrl, this.objRecherche.lstPictos[r + u].iLargeur, this.objRecherche.lstPictos[r + u].iHauteur, this.objRecherche.lstPictos[r + u].iOffset), (f = new google.maps.Marker({ - position: i, - icon: e, - zIndex: 0, - optimized: !0 - })).setMap(n)); - else { - for (o = !0, s = 0; s < t.lstPointsRetrait.length; s++) o = o && t.lstPointsRetrait[s].fNouveauSite; - r = o ? 'nouveau' : 'ouvert'; - 1 == t.lstPointsRetrait.length && 'I' == t.lstPointsRetrait[0].sEtatSite && (r = 'preinscription'); - e = this.pCreerImageMarker(this.objRecherche.lstPictos[r + u].sUrl, this.objRecherche.lstPictos[r + u].iLargeur, this.objRecherche.lstPictos[r + u].iHauteur, this.objRecherche.lstPictos[r + u].iOffset); - c = new google.maps.LatLng(parseFloat(t.rLatitude), parseFloat(t.rLongitude)); - h = ''; - switch (t.lstPointsRetrait[0].eTypePR) { - case 3: - h = 'E.Leclerc Relais ' + t.lstPointsRetrait[0].sNomPR + ' (' + t.lstPointsRetrait[0].sCodePostal + ')'; - break; - default: - h = t.lstPointsRetrait[0].sNomPR + ' (' + t.lstPointsRetrait[0].sCodePostal + ')' - }(f = new google.maps.Marker({ - position: c, - icon: e, - title: h, - zIndex: 101, - optimized: !1 - })).iIdPointCarte = t.iIdPointCarte; - 'iCHEZMOI' == this.objRecherche.Marque ? f.addListener('click', function () { - l.pCentrerPointRetrait(n, t.lstPointsRetrait[0].sCodePostal, parseFloat(t.rLatitude), parseFloat(t.rLongitude)) - }) : f.addListener('click', function () { - window.WPAD338.AfficherPointsRetrait('SELECTION', null, null, t.iIdPointCarte, null, null, null) - }) - } - return f - }, - n.prototype.pCentrerPointRetrait = function (n, t, i, r) { - var u = this; - this.PointRetraitController.GetPointsRetrait(!0).then(function (f) { - var s = new o.InformationResultatRecherche(i, r, t, null, null, null, null, null, t, null), - e; - u.objRecherche.VerifierCPEtAfficherPR(s, 'SILENCIEUX', window.WPAD369.AfficherBandeauLAD, null, f); - e = new google.maps.LatLng(i, r); - n.setCenter(e); - n.setZoom(18) - }) - }, - n.prototype.pCreerImageMarker = function (n, t, i, r) { - return { - url: n, - scaledSize: new google.maps.Size(t, i), - size: new google.maps.Size(parseInt(t), parseInt(i)), - anchor: new google.maps.Point(parseInt(t) / 2 - parseInt(r), parseInt(i)) - } - }, - n.prototype.pCreerImageMarkerSpecifique = function (n, t, i) { - return { - url: n, - scaledSize: new google.maps.Size(t, i), - size: new google.maps.Size(parseInt(t), parseInt(i)), - anchor: new google.maps.Point(parseInt(t) / 2, parseInt(i) / 2) - } - }, - n.prototype.pCalculerMarkers = function (n) { - var i = this, - r, - u, - t; - for (this.Clusters && this.Clusters.clearMarkers(), r = [ - { - url: this.objRecherche.lstPictos.cluster1.sUrl, - height: this.objRecherche.lstPictos.cluster1.iHauteur, - width: this.objRecherche.lstPictos.cluster1.iLargeur, - textColor: '#fff', - textSize: 10, - fontFamily: 'Arial', - fontWeight: 'True', - anchor: [ - 4, - 28 - ], - zindex: 9999 - }, - { - url: this.objRecherche.lstPictos.cluster1.sUrl, - height: this.objRecherche.lstPictos.cluster1.iHauteur, - width: this.objRecherche.lstPictos.cluster1.iLargeur, - textColor: '#fff', - textSize: 10, - fontFamily: 'Arial', - fontWeight: 'True', - anchor: [ - 4, - 24 - ], - zindex: 9999 - } - ], this.Clusters = new window.MarkerClusterer(n, this.LstMarkers, { - maxZoom: 10, - gridSize: 20, - styles: r, - averageCenter: !0 - }), google.maps.event.addListener(this.Clusters, 'clusterclick', function (t) { - i.DernierClusterClique = t; - i.pAfficherCluster(t.getMarkers(), n) - }), u = n.getZoom(), t = 0; t < this.LstMarkersSpec.length; t++) this.LstMarkersSpec[t].setVisible(u > this.objRecherche.EncartChezMoiZoom) - }, - n.prototype.pZooFixe = function (n, t, i) { - n.setCenter(i); - n.setZoom(t); - this.ScrollerHauteCarte() - }, - n.prototype.pZoomAutomatique = function (n, t) { - var i = { - }, - r; - this.cercle && this.cercle.setMap(null); - r = this.pTrouverLesPointsProche(n, t, window.WPAD337.googleMapOption.facteur, window.WPAD337.googleMapOption.offset, window.WPAD337.googleMapOption.nombreDePoints, window.WPAD337.googleMapOption.distanceMaximum); - null != (i = this.pConstruireCercle(r, t, n, i)) ? (window.WPAD337.googleMapOption.debug && (i.strokeColor = '#FFFFFF', i.strokeOpacity = 1, i.strokeWeight = 2, i.fillOpacity = 0, i.visible = !0), i.radius = i.radius < window.WPAD337.googleMapOption.minDistanceZoom ? window.WPAD337.googleMapOption.minDistanceZoom : i.radius + i.radius, n.fitBounds(i.getBounds()), this.cercle = i) : (n.setCenter(t), n.setZoom(this.objRecherche.MapZoomMaximum)) - }, - n.prototype.pConstruireCercle = function (n, t, i) { - var r, - u; - return n.length > 1 ? (n.unshift(t), this.pCalculCercleMultiPoints(i, n)) : 1 == n.length ? (r = n[0], r.distance < window.WPAD337.googleMapOption.distanceMaximum) ? this.pCalculCercleUnPoint(i, t, r) : (console.warn('Impossible de trouver les points proches'), u = { - center: t, - fillOpacity: 0, - strokeOpacity: 0, - map: i, - radius: window.WPAD337.googleMapOption.distanceMaximum - }, new google.maps.Circle(u)) : void 0 - }, - n.prototype.pResetMarkers = function (n) { - null != n && n.forEach(function (n) { - n && n.setMap(null) - }); - n = [ - ] - }, - n.prototype.pTrouverLesPointsProche = function (n, t, i, r, u, f) { - var e = this.LstMarkers.map(function (n) { - return { - lat: n.getPosition().lat, - lng: n.getPosition().lng, - distance: google.maps.geometry.spherical.computeDistanceBetween(t, n.getPosition()) - } - }).sort(function (n, t) { - return n.distance - t.distance - }).slice(0, u), - l = e[0], - a = e.filter(function (n) { - return n.distance < f - }), - o, - h, - p, - c; - if (0 === a.length) return [l]; - var s = (e = a).map(function (n) { - return n.distance - }), - v = s.length, - w = s.reduce(function (n, t) { - return n + t - }) / v, - b = Math.sqrt(s.map(function (n) { - return Math.pow(n - w, 2) - }).reduce(function (n, t) { - return n + t - }) / v), - y = l.distance + (b + r) * i, - k = e.filter(function (n) { - return n.distance <= y - }); - if (window.WPAD337.googleMapOption.debug) { - o = { - center: t, - fillOpacity: 0, - strokeOpacity: 0, - map: n, - radius: y - }; - for (h in this.flightPathList && this.flightPathList.forEach(function (n) { - return n.setMap(null) - }), this.flightPathList = [ - ], e) p = [ - new google.maps.LatLng(e[h].lat(), e[h].lng()), - t - ], - c = new google.maps.Polyline({ - path: p, - geodesic: !0, - strokeColor: '#FF0000', - strokeOpacity: 1, - strokeWeight: 2 - }), - c.setMap(n), - this.flightPathList.push(c); - o.fillColor = 'red'; - o.fillOpacity = 0.2; - o.visible = !0; - this.circleDebug && this.circleDebug.setMap(null); - this.circleDebug = new google.maps.Circle(o); - this.circleDebug.setMap(n) - } - return k - }, - n.prototype.pCalculCercleMultiPoints = function (n, t) { - var r = this, - u = t.reduce(function (n, t, i, r) { - return n + t.lat() / r.length - }, 0), - f = t.reduce(function (n, t, i, r) { - return n + t.lng() / r.length - }, 0), - i = new google.maps.LatLng(u, f), - e = t.map(function (n) { - return r.objRecherche.CalculerDistanceGPS(i.lat(), i.lng(), n.lat(), n.lng()) - }).sort(function (n, t) { - return t - n - }) [0] / 2, - o = { - center: i, - fillOpacity: 0, - strokeOpacity: 0, - map: n, - radius: 1000 * e - }; - return new google.maps.Circle(o) - }, - n.prototype.pCalculCercleUnPoint = function (n, t, i) { - var r = this.objRecherche.CalculerPointMilieuGPS(t.lat(), t.lng(), i.lat(), i.lng()), - u = this.objRecherche.CalculerDistanceGPS(r.lat(), r.lng(), i.lat(), i.lng()), - f = { - center: r, - fillOpacity: 0, - strokeOpacity: 0, - map: n, - radius: 1000 * u - }; - return new google.maps.Circle(f) - }, - n.prototype.pCalculerDistance = function (n) { - var t = this.pCalculerCoodGPSPointPlusProche(n), - i = new google.maps.LatLng(t.lat, t.lng); - return google.maps.geometry.spherical.computeDistanceBetween(n, i) / 1000 - }, - n.prototype.pCalculerCoodGPSPointPlusProche = function (n) { - for (var r, i, u = 1000000, f = n.lat(), e = n.lng(), t = 0; t < this.LstMarkers.length; t++) r = google.maps.geometry.spherical.computeDistanceBetween(n, this.LstMarkers[t].getPosition()), - r < u && (u = r, f = this.LstMarkers[t].getPosition().lat(), e = this.LstMarkers[t].getPosition().lng()); - return i = Object(), - i.lat = f, - i.lng = e, - i - }, - n.prototype.pAfficherCluster = function (n, t) { - var i, - s, - r, - u, - o, - l; - for (window.Utl.Loader.afficher(), i = '', s = !1, 'iTRAITEUR' == this.objRecherche.Univers ? i = this.objRecherche.MsgUniversTraiteur : 'iCHEZMOI' == this.objRecherche.Marque ? (s = !0, event.stopPropagation()) : i = this.objRecherche.MsgUniversDrive, r = Object(), u = 0; u < n.length; u++) { - var h, - f = Object(), - e = n[u].iIdPointCarte, - c = this.LstPointsCarte[e].lstPointsRetrait[0].sNoPointLivraison; - h = i + ' ' + this.LstPointsCarte[e].lstPointsRetrait[0].sNomPR + ' (' + this.LstPointsCarte[e].lstPointsRetrait[0].sCodePostal + ')'; - f.iIdPointCarte = e; - f.sTexte = h; - f.sNoPL = c; - r[c] = f - } - o = Array(); - for (l in r) o.push(r[l]); - 0 == s && 1 == o.length ? window.WPAD338.AfficherPointsRetrait('SELECTION', null, null, null, null, o[0].sNoPL, null) : (window.Utl.Loader.masquer(), this.pZoomerCluster(t)) - }, - n.prototype.pOuvrirPopinCluster = function (n) { - return window.WCTD201.Class.PopinManager.OuvrirPopin({ - conteneurType: window.WCTD201.Class.Scrollpane, - conteneur: { - fScrollOut: !0, - fSCrollMasquer: !1 - }, - fClient: !0, - popin: { - contenu: n, - sOnComplete: function () { - window.Utl.Loader.masquer() - } - }, - sNomPopin: 'popinPointRetrait' - }), - !1 - }, - n.prototype.ZoomerCluster = function () { - return f(this, void 0, void 0, function () { - var n; - return e(this, function (t) { - switch (t.label) { - case 0: - return [4, - this.GoogleMapService.APIMap()]; - case 1: - return n = t.sent(), - this.pZoomerCluster(n), - [ - 2 - ] - } - }) - }) - }, - n.prototype.pZoomerCluster = function (n) { - window.WCTD201.Class.PopinManager.FermerPopin(); - n.fitBounds(this.DernierClusterClique.getBounds()); - this.ScrollerHauteCarte() - }, - n.prototype.pAfficherGoogleMaps = function (n) { - r.default('.divWPAD337_Map').removeClass('masquer'); - r.default('.divWPAD337_RechercheCarte').addClass('active'); - 'iCHEZMOI' == this.objRecherche.Marque ? r.default('.divWPAD337_RechercheCarte').parent().addClass('open') : r.default('.divWPAD337_Carte').addClass('masquer'); - google.maps.event.trigger(n, 'resize'); - window.Utilitaires.Pubsub.trigger('Maps.Affichage') - }, - n.prototype.pStopEvent = function (n) { - n.preventDefault(); - n.stopPropagation() - }, - n - }(); - t.jsWPAD337_RechercheCarte = c - }).call(this, i(0).Promise) -}, -function (n, t, i) { - 'use strict'; - (function (n) { - var f = this && this.__decorate || function (n, t, i, r) { - var f, - e = arguments.length, - u = e < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r, - o; - if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) u = Reflect.decorate(n, t, i, r); - else for (o = n.length - 1; o >= 0; o--) (f = n[o]) && (u = (e < 3 ? f(u) : e > 3 ? f(t, i, u) : f(t, i)) || u); - return e > 3 && u && Object.defineProperty(t, i, u), - u - }, - r = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - u = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.PointRetraitService = void 0; - var e = i(21), - o = i(1), - s = function () { - function n() { - this._dicPointsRetraitLad = null - } - return Object.defineProperty(n.prototype, 'dicPointsRetraitLad', { - get: function () { - return this._dicPointsRetraitLad - }, - enumerable: !1, - configurable: !0 - }), - n.prototype.GetMotsCles = function (n) { - return r(this, void 0, void 0, function () { - return u(this, function (t) { - switch (t.label) { - case 0: - return $.isEmptyObject(this.LstMotsCles) ? [ - 4, - this.pFetchMagasinEtLstMotsCles(n) - ] : [ - 2, - this.LstMotsCles - ]; - case 1: - return t.sent(), - [ - 2, - this.LstMotsCles - ] - } - }) - }) - }, - n.prototype.GetMagasins = function (n) { - return r(this, void 0, void 0, function () { - return u(this, function (t) { - switch (t.label) { - case 0: - return this.LstMotsCles && this._LstPointsRetrait.length > 0 ? [ - 2, - this._LstPointsRetrait - ] : [ - 4, - this.pFetchMagasinEtLstMotsCles(n) - ]; - case 1: - return t.sent(), - this._dicPointsRetraitLad || (this._dicPointsRetraitLad = this.initPointDeRetraitLadParCodePostal(this._LstPointsRetrait)), - [ - 2, - this._LstPointsRetrait - ] - } - }) - }) - }, - n.prototype.pFetchMagasinEtLstMotsCles = function (n) { - return r(this, void 0, void 0, function () { - var t; - return u(this, function (i) { - switch (i.label) { - case 0: - return [4, - e.chargerMagasins(n)]; - case 1: - return t = i.sent(), - this._LstPointsRetrait = t.lstPointRetrait, - this._LstMotsCles = t.lstMotsCles, - this._dicPointsRetraitLad = t.dicPointsRetraitLad, - [ - 2, - t - ] - } - }) - }) - }, - Object.defineProperty(n.prototype, 'LstPointsRetrait', { - get: function () { - return this._LstPointsRetrait - }, - enumerable: !1, - configurable: !0 - }), - Object.defineProperty(n.prototype, 'LstMotsCles', { - get: function () { - return this._LstMotsCles - }, - enumerable: !1, - configurable: !0 - }), - n = f([o.Injectable({ - name: 'PointRetraitService', - dependence: [ - ] - })], n) - }(); - t.PointRetraitService = s - }).call(this, i(0).Promise) -}, -function (n) { - var t, - r, - i; - t = { - }; - r = 0; - i = function (n) { - var t = document.getElementsByTagName('script') [0]; - t.parentNode.insertBefore(n, t) - }; - n.exports = function (n, u, f) { - var o; - u && 'function' != typeof u && (f = u.context || f, o = u.setup, u = u.callback); - var s, - h, - e = document.createElement('script'), - a = !1, - c = function () { - a || (a = !0, h(), u && u.call(f, s)) - }, - l = function () { - s = new Error(n || 'EMPTY'); - c() - }; - if (!e.readyState || 'async' in e) h = function () { - e.onload = e.onerror = null - }, - e.onerror = l, - e.onload = c, - e.async = !0, - e.charset = 'utf-8', - o && o.call(f, e), - e.src = n, - i(e); - else { - var v = r++, - p = { - loaded: !0, - complete: !0 - }, - y = !1; - h = function () { - e.onreadystatechange = e.onerror = null; - t[v] = void 0 - }; - e.onreadystatechange = function () { - var n = e.readyState; - if (!s) { - if (!y && p[n] && (y = !0, i(e)), 'loaded' === n && (e.children, 'loading' === e.readyState)) return l(); - 'complete' === e.readyState && c() - } - }; - e.onerror = l; - t[v] = e; - o && o.call(f, e); - e.src = n - } - } -}, -function (n) { - function h() { - throw new Error('setTimeout has not been defined'); - } - function c() { - throw new Error('clearTimeout has not been defined'); - } - function l(n) { - if (i === setTimeout) return setTimeout(n, 0); - if ((i === h || !i) && setTimeout) return i = setTimeout, - setTimeout(n, 0); - try { - return i(n, 0) - } catch (t) { - try { - return i.call(null, n, 0) - } catch (t) { - return i.call(this, n, 0) - } - } - } - function y() { - o && e && (o = !1, e.length ? u = e.concat(u) : s = - 1, u.length && a()) - } - function a() { - var t, - n; - if (!o) { - for (t = l(y), o = !0, n = u.length; n; ) { - for (e = u, u = [ - ]; ++s < n; ) e && e[s].run(); - s = - 1; - n = u.length - } - e = null; - o = !1, - function (n) { - if (r === clearTimeout) return clearTimeout(n); - if ((r === c || !r) && clearTimeout) return r = clearTimeout, - clearTimeout(n); - try { - r(n) - } catch (t) { - try { - return r.call(null, n) - } catch (t) { - return r.call(this, n) - } - } - }(t) - } - } - function v(n, t) { - this.fun = n; - this.array = t - } - function f() { - } - var i, - r, - t = n.exports = { - }; - !function () { - try { - i = 'function' == typeof setTimeout ? setTimeout : h - } catch (n) { - i = h - } - try { - r = 'function' == typeof clearTimeout ? clearTimeout : c - } catch (n) { - r = c - } - }(); - var e, - u = [ - ], - o = !1, - s = - 1; - t.nextTick = function (n) { - var i = new Array(arguments.length - 1), - t; - if (arguments.length > 1) for (t = 1; t < arguments.length; t++) i[t - 1] = arguments[t]; - u.push(new v(n, i)); - 1 !== u.length || o || l(a) - }; - v.prototype.run = function () { - this.fun.apply(null, this.array) - }; - t.title = 'browser'; - t.browser = !0; - t.env = { - }; - t.argv = [ - ]; - t.version = ''; - t.versions = { - }; - t.on = f; - t.addListener = f; - t.once = f; - t.off = f; - t.removeListener = f; - t.removeAllListeners = f; - t.emit = f; - t.prependListener = f; - t.prependOnceListener = f; - t.listeners = function () { - return [] - }; - t.binding = function () { - throw new Error('process.binding is not supported'); - }; - t.cwd = function () { - return '/' - }; - t.chdir = function () { - throw new Error('process.chdir is not supported'); - }; - t.umask = function () { - return 0 - } -}, -function (n) { - var t = function () { - return this - }(); - try { - t = t || new Function('return this') () - } catch (n) { - 'object' == typeof window && (t = window) - } - n.exports = t -}, -function (n, t) { - 'use strict'; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.CustomEventPolyfill = void 0; - t.CustomEventPolyfill = function (n, t) { - t = t || { - bubbles: !1, - cancelable: !1, - detail: null - }; - var i = document.createEvent('CustomEvent'); - return i.initCustomEvent(n, t.bubbles, t.cancelable, t.detail), - i - } -}, -function (n, t) { - var i = i || { - }; - t = t || { - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.WCTD204 = void 0, - function (n) { - n.fn.WCTD204_Marquer = function () { - return this.not('.marquer').addClass('marquer') - }; - n.WCTD204_QueryString = function (n) { - var i, - r, - t; - if ('' == n) return { - }; - for (i = { - }, r = 0; r < n.length; ++r) if (t = n[r].split('='), 2 == t.length) try { - i[t[0]] = decodeURIComponent(t[1].replace(/\+/g, ' ')) - } catch (n) { - i[t[0]] = 'erreur' - } - return i - }(window.location.search.substr(1).split('&')); - n.fn.WCTD204_isOnScreen = function () { - if (this.length) { - var t = this.offset().top, - r = this.height(), - i = n(window).scrollTop(), - u = n(window).height(); - return t + r - i >= 0 && i + u - t >= 0 - } - return !1 - } - }(jQuery); - i = { - SetCookie: function (n) { - var t = '', - r = '', - u = '', - i; - (t = n.dateExpiration, null != n.duree) && (i = new Date, i.setDate(i.getDate() + n.duree), t = ' expires=' + i.toUTCString() + ';'); - null != n.path && (r = ' path=' + n.path + ';'); - null != n.domain && 'localhost' != n.domain && (u = ' domain=' + n.domain + ';'); - null == n.escape ? document.cookie = n.cle + '=' + escape(n.value) + ';' + t + r + u : 0 == n.escape && (document.cookie = n.cle + '=' + n.value + ';' + t + r + u) - }, - GetCookie: function (n) { - var t = document.cookie, - i = t.indexOf(' ' + n + '='), - r; - return ( - 1 == i && (i = t.indexOf(n + '=')), - 1 == i) ? t = null : (i = t.indexOf('=', i) + 1, r = t.indexOf(';', i), - 1 == r && (r = t.length), t = unescape(t.substring(i, r))), - t - }, - IdentifierNavigateur: function (n, t) { - var u, - f, - r, - e, - o = { - Edge: [ - /Edge\/(\S+)/ - ], - Chrome: [ - /Chrome\/(\S+)/ - ], - Firefox: [ - /Firefox\/(\S+)/ - ], - Android: [ - /Android (\d+)/ - ], - MSIE: [ - /MSIE (\S+);/, - /rv:(\S+)\)/ - ], - Opera: [ - /Opera\/.*?Version\/(\S+)/, - /Opera\/(\S+)/ - ], - Safari: [ - /Version\/(\S+).*?Safari\/(\S+)/ - ] - }, - i; - for (r in void 0 === n && (n = navigator.userAgent), void 0 === t ? t = 2 : 0 === t && (t = 1337), o) for (; u = o[r].shift(); ) if (f = n.match(u)) return e = f[1].match(new RegExp('[^.]+(?:.[^.]+){0,' + --t + '}')) [0], - i = Array(), - i.browser = r, - i.version = e, - i; - return null - }, - EstMobile: function () { - return !!(navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i)) - }, - VerifierNavigateurGeoloc: function () { - return !0 - } - }; - String.prototype.contains = function (n) { - return - 1 != this.indexOf(n) - }; - String.prototype.replaceAll = function (n, t) { - return this.split(n).join(t) - }; - String.prototype.bool = function () { - return /^true$/i.test(this) - }; - Function.prototype.ToString = function () { - return this.toString() - }; - 'undefined' != typeof Sys && Sys.Application.notifyScriptLoaded(); - t.WCTD204 = i -}, -function (n, t) { - var i = i || { - }; - t = t || { - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.WTRK306 = void 0; - i = { - InjectionDataTrack: function (n, t) { - WTRK306_InjectionDataTrack(n, t) - }, - EnvoyerEvenementManuel: function (n) { - WTRK306_EnvoyerEvenementManuel(n) - } - }; - 'undefined' != typeof Sys && Sys.Application.notifyScriptLoaded(); - t.WTRK306 = i -}, -function (n, t, i) { - 'use strict'; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.InitInjectable = void 0; - var u = i(20), - r = i(11), - f = i(22), - e = i(23), - o = i(25), - s = i(27), - h = i(10), - c = i(28), - l = function () { - function n() { - n.PointRetraitService = n.PointRetraitService || new r.PointRetraitService; - n.RecherchePositionController = n.RecherchePositionController || new u.RecherchePositionController; - n.PointRetraitService = n.PointRetraitService || new r.PointRetraitService; - n.PointRetraitController = n.PointRetraitController || new f.PointRetraitController; - n.WoosmapController = n.WoosmapController || new e.WoosmapController; - n.WoosmapService = n.WoosmapService || new o.WoosmapService; - n.GoogleMapController = n.GoogleMapController || new s.GoogleMapController; - n.rechercheCarte = n.rechercheCarte || new h.jsWPAD337_RechercheCarte; - n.GoogleMapService = n.GoogleMapService || new c.GoogleMapService; - n.SetNamespaceMapping() - } - return n.SetNamespaceMapping = function () { - window.WPAD337 = n.rechercheCarte - }, - n - }(); - t.InitInjectable = l -}, -function (n, t, i) { - 'use strict'; - (function (n) { - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.deferedToPromise = t.MakeQuerablePromise = void 0; - t.MakeQuerablePromise = function (n) { - var i = n; - if (i.isResolved) return i; - var r = !0, - u = !1, - f = !1, - t = i.then(function (n) { - return f = !0, - r = !1, - n - }, function (n) { - throw u = !0, - r = !1, - n; - }); - return t.isFulfilled = function () { - return f - }, - t.isPending = function () { - return r - }, - t.isRejected = function () { - return u - }, - t - }; - t.deferedToPromise = function (t) { - return t.done ? new n(function (n, i) { - t.done(function (t) { - return n(t) - }); - t.fail(function (n) { - return i(n) - }) - }) : t - } - }).call(this, i(0).Promise) -}, -function (n, t, i) { - 'use strict'; - (function (n) { - var e = this && this.__decorate || function (n, t, i, r) { - var f, - e = arguments.length, - u = e < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r, - o; - if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) u = Reflect.decorate(n, t, i, r); - else for (o = n.length - 1; o >= 0; o--) (f = n[o]) && (u = (e < 3 ? f(u) : e > 3 ? f(t, i, u) : f(t, i)) || u); - return e > 3 && u && Object.defineProperty(t, i, u), - u - }, - r = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - u = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.RecherchePositionController = void 0; - var o = i(2), - s = i(1), - f = i(3), - h = function () { - function t(n, t, i) { - var f = this; - void 0 === n && (n = null); - void 0 === t && (t = null); - void 0 === i && (i = null); - this.objWoosmapController = n; - this.objGooglemapController = t; - this.objPointRetraitController = i; - this.objRecherche = new o.jsWPAD335_Recherche; - this.MasquerMessage = function () { - f.objRecherche.MasquerMessage() - }; - this.AfficherPointsRetrait = function (n) { - return r(f, void 0, void 0, function () { - var t; - return u(this, function (i) { - switch (i.label) { - case 0: - return this.AfficherLoader(!0), - [ - 4, - this.objPointRetraitController.GetPointsRetrait(this.ApiMapActif()) - ]; - case 1: - return t = i.sent(), - this.AfficherLoader(!1), - this.objPointRetraitController.LstPointsRetraitRecherche = this.objRecherche.AfficherPointsRetrait(t, n.latitude, n.longitude, n.Description), - [ - 2, - this.objPointRetraitController.LstPointsRetraitRecherche - ] - } - }) - }) - } - } - return Object.defineProperty(t.prototype, 'recherchePositionController', { - get: function () { - return null != this.objGooglemapController && 1 == this.objGooglemapController.apiMapActif() ? null != this.objWoosmapController && this.objWoosmapController.apiMapActif() ? this.objWoosmapController : this.objGooglemapController : (this.objRecherche.InitialiserModeSecours(), null) - }, - enumerable: !1, - configurable: !0 - }), - t.prototype.ChargerAPI = function () { - var n = this; - this.AfficherLoader(!0); - this.ApiMapActif() ? (null != this.objWoosmapController && this.objWoosmapController.apiMapActif() ? this.objWoosmapController.chargerAPI().catch(function (t) { - var i = 'Erreur lors du chargement de l\'API Woosmap: ' + t; - n.objRecherche.LogWarn('ChargerAPI Woosmap erreur', i); - n.ChargerAPIGoogleMaps() - }) : this.ChargerAPIGoogleMaps(), this.AfficherLoader(!1)) : (this.AfficherLoader(!1), this.objRecherche.InitialiserModeSecours()) - }, - t.prototype.ChargerAPIGoogleMaps = function () { - var t, - n = this; - return this.objGooglemapController.chargerAPI().catch(function (i) { - t = 'Erreur lors du chargement de l\'API Google Maps: ' + i; - n.objRecherche.LogWarn('ChargerAPI Google Maps erreur', t); - n.objWoosmapController = null; - n.objGooglemapController = null; - n.objRecherche.InitialiserModeSecours() - }) - }, - t.prototype.RechercherAutoCompletion = function (n, t) { - return r(this, void 0, void 0, function () { - var i, - r; - return u(this, function (u) { - switch (u.label) { - case 0: - if (!this.ApiMapActif()) return [3, - 5]; - u.label = 1; - case 1: - return u.trys.push([1, - 3, - , - 4]), - [ - 4, - this.recherchePositionController.rechercherAutoCompletion(n, t) - ]; - case 2: - return [2, - u.sent()]; - case 3: - return i = u.sent(), - r = 'Erreur lors de la recherche autocompletion: ' + i, - this.objRecherche.LogWarn('RechercherAutoCompletion', r), - [ - 3, - 4 - ]; - case 4: - return [3, - 6]; - case 5: - this.objRecherche.InitialiserModeSecours(); - u.label = 6; - case 6: - return [2] - } - }) - }) - }, - t.prototype.SelectionnerResultat = function (t) { - return r(this, void 0, void 0, function () { - var i = this; - return u(this, function () { - return [2, - new n(function (n, f) { - return r(i, void 0, void 0, function () { - var r, - e, - i; - return u(this, function (u) { - switch (u.label) { - case 0: - if (!this.ApiMapActif()) return [3, - 5]; - u.label = 1; - case 1: - return u.trys.push([1, - 3, - , - 4]), - this.objRecherche.SupprimerCodePostalRecherche(), - [ - 4, - this.recherchePositionController.selectionnerResultat(t) - ]; - case 2: - return null == (i = u.sent()).CodePostal && '' == i.CodePostal || this.objRecherche.EnregistrerCodePostalRecherche(i.CodePostal), - null == i || 'inconnu' == i.TypeRecherche ? ($(this.objRecherche.DivResultatVilles).hide(), this.objRecherche.AfficherMessage(this.objRecherche.MsgZeroResultat, 'msgErreur'), [ - 2, - n(null) - ]) : [ - 2, - n(i) - ]; - case 3: - return r = u.sent(), - e = 'Erreur lors de la selection du resultat: ' + r, - this.objRecherche.LogWarn('SelectionnerResultat', e), - [ - 2, - f([]) - ]; - case 4: - return [3, - 6]; - case 5: - return i = [ - ], - this.objRecherche.InitialiserModeSecours(), - [ - 2, - f(i) - ]; - case 6: - return [2] - } - }) - }) - })] - }) - }) - }, - t.prototype.GeocodageCodePostal = function (t) { - return r(this, void 0, void 0, function () { - var i = this; - return u(this, function () { - return [2, - new n(function (n) { - return r(i, void 0, void 0, function () { - var r, - f, - i; - return u(this, function (u) { - switch (u.label) { - case 0: - if (null == t.Description || null == t.latitude || null == t.longitude || null == t.CodePostal || null == t.Ville) return [3, - 1]; - try { - this.recherchePositionController.apiMapActif() && n(this.pRetournerPositionFormater(t)) - } catch (t) { - i = 'Impossible de faire la recherche Geocodage' + t; - this.objRecherche.LogWarn('GeocodageCodePostal 1er if', i); - n(null) - } - return [3, - 4]; - case 1: - return u.trys.push([1, - 3, - , - 4]), - this.recherchePositionController.apiMapActif() || this.objRecherche.InitialiserModeSecours(), - [ - 4, - this.recherchePositionController.geocodage(t) - ]; - case 2: - return r = u.sent(), - [ - 2, - n(r[0]) - ]; - case 3: - return f = u.sent(), - i = 'Impossible de faire la recherche Geocodage avec woosmap: ' + f, - this.objRecherche.LogWarn('GeocodageCodePostal 2nd if', i), - n(null), - [ - 3, - 4 - ]; - case 4: - return [2] - } - }) - }) - })] - }) - }) - }, - t.prototype.GeocodageInverseCodePostal = function (n, t) { - return r(this, void 0, void 0, function () { - return u(this, function (i) { - switch (i.label) { - case 0: - return [4, - this.objGooglemapController.geocodageInverseGetCodePostal(n, t)]; - case 1: - return [2, - i.sent()] - } - }) - }) - }, - t.prototype.ApiMapActif = function () { - return this.recherchePositionController && this.recherchePositionController.apiMapActif() - }, - t.prototype.AfficherLoader = function (n) { - n ? this.objRecherche.AfficherLoader() : this.objRecherche.MasquerLoader() - }, - t.prototype.pRetournerPositionFormater = function (n) { - var t = new f.ResultatGeocodage, - u = [ - ], - r = new f.AdresseGeocodage, - i; - return r.NomLong = n.Description, - r.NomCourt = n.CodePostal, - r.Types = [ - 'postal_code' - ], - u.push(r), - i = new f.AdresseGeocodage, - i.NomLong = n.Description, - i.NomCourt = n.Ville, - i.Types = [ - 'locality' - ], - u.push(i), - t.LstCodePostalLieu = [ - n.CodePostal - ], - t.Ville = n.Ville, - t.LstAdresse = u, - t.TypeLieu = f.TypeLieu.APPROXIMATE, - t.Latitude = n.latitude, - t.Longitude = n.longitude, - t - }, - t = e([s.Injectable({ - name: 'RecherchePositionController', - dependence: [ - 'WoosmapController', - 'GoogleMapController', - 'PointRetraitController' - ] - })], t) - }(); - t.RecherchePositionController = h - }).call(this, i(0).Promise) -}, -function (n, t, i) { - 'use strict'; - (function (n) { - var i = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - r = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.chargerMagasins = void 0; - t.chargerMagasins = function (t) { - return i(this, void 0, void 0, function () { - return r(this, function () { - return [2, - new n(function (n, i) { - null != t && function (n, t, i) { - window.Utilitaires.Ajax.appeler({ - config: { - type: window.Utilitaires.Constantes.Ajax.Type.iURL, - method: window.Utilitaires.Constantes.Ajax.Methode.iGET, - url: n, - dataType: 'json', - contentType: 'application/json; charset=utf-8' - } - }).done(function (n) { - var f; - if (null != n) { - for (var e = [ - ], o = { - }, u = JSON.parse(JSON.stringify(n)).sReponse, s = 1, r = 0; r < u.length; r++) u[r] && (e[Number(u[r].sNoPR)] = u[r]), - null != u[r].lstMotsCle && (f = Object(), f.lstMotsCles = u[r].lstMotsCle, f.rLatitude = u[r].rLatitude, f.rLongitude = u[r].rLongitude, f.sCodePostal = u[r].sCodePostal, o[s] = f, s++); - t({ - lstPointRetrait: e, - lstMotsCles: o, - dicPointsRetraitLad: { - } - }) - } else i('Une erreur s\'est produite lors du chargement des PR.') - }).fail(function (n) { - return i('Pb lors du chargement des PR: ' + n.toString()) - }) - }(t, n, i) - })] - }) - }) - } - }).call(this, i(0).Promise) -}, -function (n, t, i) { - 'use strict'; - (function (n) { - var f = this && this.__decorate || function (n, t, i, r) { - var f, - e = arguments.length, - u = e < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r, - o; - if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) u = Reflect.decorate(n, t, i, r); - else for (o = n.length - 1; o >= 0; o--) (f = n[o]) && (u = (e < 3 ? f(u) : e > 3 ? f(t, i, u) : f(t, i)) || u); - return e > 3 && u && Object.defineProperty(t, i, u), - u - }, - r = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - u = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.PointRetraitController = void 0; - var e = i(1), - o = i(11), - s = i(2), - h = function () { - function n(n) { - var t = this; - void 0 === n && (n = null); - this.pointRetraitService = n; - this._lstPointsRetraitRecherche = [ - ]; - this.GetLstMotsCles = function () { - return r(t, void 0, void 0, function () { - return u(this, function (n) { - switch (n.label) { - case 0: - return [4, - this.pointRetraitService.GetMotsCles(this._objRecherche.UrlWebApirRecupererPR)]; - case 1: - return [2, - n.sent()] - } - }) - }) - }; - this.GetPointsRetrait = function (n) { - return r(t, void 0, void 0, function () { - var t; - return u(this, function (i) { - switch (i.label) { - case 0: - return t = [ - ], - [ - 4, - this.pGetPointsRetraitBrut() - ]; - case 1: - return t = i.sent(), - n || (t = this.pFiltreCodePostalNull(t)), - [ - 2, - t - ] - } - }) - }) - }; - this.pGetPointsRetraitBrut = function () { - return r(t, void 0, void 0, function () { - return u(this, function (n) { - switch (n.label) { - case 0: - return [4, - this.pointRetraitService.GetMagasins(this._objRecherche.UrlWebApirRecupererPR)]; - case 1: - return [2, - n.sent()] - } - }) - }) - }; - this._objRecherche = new s.jsWPAD335_Recherche; - this.pointRetraitService = new o.PointRetraitService - } - return Object.defineProperty(n.prototype, 'LstPointsRetraitRecherche', { - get: function () { - return this._lstPointsRetraitRecherche - }, - set: function (n) { - this._lstPointsRetraitRecherche = n - }, - enumerable: !1, - configurable: !0 - }), - n.prototype.RecupererPointRetraitLadParCodePostal = function (n) { - if (!n) return []; - if (!this.pointRetraitService.dicPointsRetraitLad) throw Error('dicPointsRetraitLad ne peux pas etre vide'); - var t = this.pointRetraitService.dicPointsRetraitLad[n]; - return t && 0 != t.length ? t.filter(function (n) { - return 'O' == n.sEtatSite || 'I' == n.sEtatSite - }).map(function (n) { - return n.lstZonesLivraison = n.lstZonesLivraison.filter(function (n) { - return !n.fExclus - }), - n - }) : [ - ] - }, - n.prototype.RetrouverPrVisible = function (n, t, i) { - var r = [ - ]; - return n.forEach(function (n) { - n.rLatitude <= t.lat() && n.rLatitude > i.lat() && n.rLongitude <= t.lng() && n.rLongitude >= i.lng() && ('O' != n.sEtatSite && 'I' != n.sEtatSite || r.push(n)) - }), - r - }, - n.prototype.pFiltreCodePostalNull = function (n) { - return n.filter(function (n) { - return null != n.sCodePostal - }).reduce(function (n, t) { - return n && (n[t.sNoPR] = t), - n - }, { - }) - }, - n = f([e.Injectable({ - name: 'PointRetraitController', - dependence: [ - 'PointRetraitService' - ] - })], n) - }(); - t.PointRetraitController = h - }).call(this, i(0).Promise) -}, -function (n, t, i) { - 'use strict'; - (function (n) { - var f = this && this.__decorate || function (n, t, i, r) { - var f, - e = arguments.length, - u = e < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r, - o; - if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) u = Reflect.decorate(n, t, i, r); - else for (o = n.length - 1; o >= 0; o--) (f = n[o]) && (u = (e < 3 ? f(u) : e > 3 ? f(t, i, u) : f(t, i)) || u); - return e > 3 && u && Object.defineProperty(t, i, u), - u - }, - r = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - u = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.WoosmapController = void 0; - var e = i(24), - o = i(1), - s = i(2), - h = function () { - function t(t, i) { - var f = this; - void 0 === t && (t = null); - void 0 === i && (i = null); - this.woosmapService = t; - this.pointRetraitController = i; - this.objAffichageWoosmap = new e.AffichageWoosmap; - this._statusOK = !0; - this.chargerAPI = function () { - return r(f, void 0, void 0, function () { - var t = this; - return u(this, function () { - return [2, - new n(function (n, i) { - return r(t, void 0, void 0, function () { - var t; - return u(this, function (r) { - switch (r.label) { - case 0: - if (this.woosmapService.apiPresente()) return [3, - 4]; - r.label = 1; - case 1: - return r.trys.push([1, - 3, - , - 4]), - [ - 4, - this.woosmapService.chargerAPI() - ]; - case 2: - return r.sent(), - n(), - [ - 3, - 4 - ]; - case 3: - return t = r.sent(), - this._statusOK = !1, - i(t), - [ - 3, - 4 - ]; - case 4: - return n(), - [ - 2 - ] - } - }) - }) - })] - }) - }) - }; - this.traiterRecherche = function (n, t, i) { - return r(f, void 0, void 0, function () { - var r; - return u(this, function (u) { - switch (u.label) { - case 0: - return [4, - this.pointRetraitController.GetLstMotsCles()]; - case 1: - return r = u.sent(), - this.objAffichageWoosmap.AfficherResultatAutoCompletionWoosmap(n, r, t, i), - [ - 2 - ] - } - }) - }) - }; - this.selectionnerResultat = function (n) { - return r(f, void 0, void 0, function () { - var t, - i; - return u(this, function (r) { - switch (r.label) { - case 0: - return r.trys.push([0, - 2, - , - 3]), - [ - 4, - this.woosmapService.recupererDetailsLocalite(n) - ]; - case 1: - return t = r.sent(), - [ - 2, - this.objAffichageWoosmap.SelectionnerResultat(t, n) - ]; - case 2: - throw i = r.sent(), - this._statusOK = !1, - new Error(i); - case 3: - return [2] - } - }) - }) - }; - this._objRecherche = new s.jsWPAD335_Recherche - } - return Object.defineProperty(t.prototype, 'MasquerSuggestion', { - get: function () { - return this._MasquerSuggestion - }, - set: function (n) { - this._MasquerSuggestion = n - }, - enumerable: !1, - configurable: !0 - }), - t.prototype.apiMapActif = function () { - return this._objRecherche.WoosmapActif && this._statusOK - }, - t.prototype.rechercherAutoCompletion = function (t, i) { - return r(this, void 0, void 0, function () { - var f = this; - return u(this, function () { - return clearTimeout(this.execRecherche), - clearTimeout(this.timeOutProcess), - [ - 2, - new n(function (n, e) { - f.execRecherche = window.setTimeout(function () { - return r(f, void 0, void 0, function () { - var r, - f; - return u(this, function (u) { - switch (u.label) { - case 0: - return u.trys.push([0, - 4, - , - 5]), - [ - 4, - this.chargerAPI() - ]; - case 1: - return u.sent(), - this.MasquerSuggestion = i, - [ - 4, - this.woosmapService.rechercher(t, this._objRecherche.CodePays) - ]; - case 2: - return r = u.sent(), - [ - 4, - this.traiterRecherche(r, t, this.MasquerSuggestion) - ]; - case 3: - return u.sent(), - clearTimeout(this.timeOutProcess), - n(null), - [ - 3, - 5 - ]; - case 4: - return f = u.sent(), - this._statusOK = !1, - e(f), - [ - 3, - 5 - ]; - case 5: - return [2] - } - }) - }) - }, f._objRecherche.DelaiAffichageAutocompletion); - f.timeOutProcess = window.setTimeout(function () { - return r(f, void 0, void 0, function () { - return u(this, function () { - return clearTimeout(this.execRecherche), - this._statusOK = !1, - $(this._objRecherche.TxtRecherche).blur(), - $(this._objRecherche.TxtRecherche).val(''), - i = !0, - this.MasquerSuggestion = i, - e('Timeout dépassé lors de l\'autocomplétion sur l\'API Woosmap.'), - [ - 2 - ] - }) - }) - }, f._objRecherche.DureeTimeoutConnexionApi) - }) - ] - }) - }) - }, - t.prototype.geocodage = function (n) { - return r(this, void 0, void 0, function () { - var t, - i; - return u(this, function (r) { - switch (r.label) { - case 0: - return clearTimeout(this.execRecherche), - [ - 4, - this.chargerAPI() - ]; - case 1: - r.sent(); - t = [ - ]; - r.label = 2; - case 2: - return r.trys.push([2, - 5, - , - 6]), - [ - 4, - this.woosmapService.rechercherCodePostaux(n.CodePostal) - ]; - case 3: - return t = r.sent(), - [ - 4, - this.traiterRecherche(t, n.CodePostal, !0) - ]; - case 4: - return r.sent(), - [ - 3, - 6 - ]; - case 5: - throw i = r.sent(), - this._statusOK = !1, - i; - case 6: - return [2, - t] - } - }) - }) - }, - t = f([o.Injectable({ - name: 'WoosmapController', - dependence: [ - 'WoosmapService', - 'PointRetraitController' - ] - })], t) - }(); - t.WoosmapController = h - }).call(this, i(0).Promise) -}, -function (n, t, i) { - 'use strict'; - (function (n) { - var u = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - f = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.AffichageWoosmap = void 0; - var e = i(2), - r = i(3), - o = function () { - function n() { - this.objRecherche = new e.jsWPAD335_Recherche - } - return n.prototype.AfficherResultatAutoCompletionWoosmap = function (n, t, i, r) { - var f, - u, - e; - $(this.objRecherche.DivResultatVilles).empty(); - $(this.objRecherche.DivResultatPointsRetrait).empty(); - $(this.objRecherche.DivResultatVilles).show(); - u = this.construireListePrediction(n); - e = this.objRecherche.listePointRetraitMatch(u, t, i); - f = this.objRecherche.construireResultatRecherche(e, u, i); - this.affichagerResultat(f, r); - this.objRecherche.MasquerLoader() - }, - n.prototype.affichagerResultat = function (n, t) { - var i = document.createElement('ul'); - n.forEach(function (n) { - $(i).append($('
  • ').append($('').attr('data-type', n.TypeRecherche).attr('data-type-resultat', n.TypeResultat).attr('data-place-id', n.PlaceId).attr('data-latitude', n.latitude).attr('data-longitude', n.longitude).attr('data-description', n.Description).attr('data-ville', n.Ville).attr('data-arrondissement', n.Arrondissement).attr('data-code-postal', n.CodePostal).attr('data-code-pays', n.CodePays).html(n.Description))).html() - }); - t && $(this.objRecherche.DivResultatVilles).hide(); - $(this.objRecherche.DivResultatVilles).append($('
    ').append($('
    ').append(i))) - }, - n.prototype.adapterObjectWoosmap = function (n) { - var t; - return null != n.LstCodePostalLieu && (t = n.LstCodePostalLieu[0]), - new r.InformationResultatRecherche(n.Latitude, n.Longitude, n.AdresseFormatee, 'prediction', n.TypeResultat, n.IdLieu, n.Ville, n.Arrondissement, t, null) - }, - n.prototype.construireListePrediction = function (n) { - var t = this; - return n.map(function (n) { - return n.AdresseFormatee = n.AdresseFormatee.replace(' ' + t.objRecherche.Pays, '').replace(/,$/g, ''), - t.adapterObjectWoosmap(n) - }) - }, - n.prototype.SelectionnerResultat = function (n, t) { - return u(this, void 0, void 0, function () { - var i, - u, - e, - o, - s, - h, - c, - l, - a, - v; - return f(this, function () { - return o = t.attr('data-type'), - s = t.attr('data-type-resultat'), - h = t.attr('data-description'), - i = n.Latitude, - u = n.Longitude, - c = t.attr('data-place-id'), - l = n.Ville, - a = n.Arrondissement, - n.LstAdresse.length > 0 && 'postal_code' == n.LstAdresse[0].Types[0] && (e = n.LstCodePostalLieu[0]), - v = n.CodePays, - [ - 2, - new r.InformationResultatRecherche(i, u, h, o, s, c, l, a, e, v) - ] - }) - }) - }, - n - }(); - t.AffichageWoosmap = o - }).call(this, i(0).Promise) -}, -function (n, t, i) { - 'use strict'; - (function (n) { - var o = this && this.__decorate || function (n, t, i, r) { - var f, - e = arguments.length, - u = e < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r, - o; - if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) u = Reflect.decorate(n, t, i, r); - else for (o = n.length - 1; o >= 0; o--) (f = n[o]) && (u = (e < 3 ? f(u) : e > 3 ? f(t, i, u) : f(t, i)) || u); - return e > 3 && u && Object.defineProperty(t, i, u), - u - }, - r = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - u = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }, - s = this && this.__importDefault || function (n) { - return n && n.__esModule ? n : { - 'default': n - } - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.WoosmapService = void 0; - var h = s(i(12)), - c = i(1), - e = i(26), - f = i(3), - l = i(2), - a = function () { - function t() { - var n = this; - this._fStatutOK = !0; - this.pChargerWoosmap = function () { - n._objAutocomplete = new window.woosmap.localities.AutocompleteService(n._objRecherche.ApiKeyWoosmap); - n._fStatutOK = !0 - }; - this.pDechargerWoosmap = function (t) { - throw n._objAutocomplete = null, - n._fStatutOK = !1, - new Error(t); - }; - this._objRecherche = new l.jsWPAD335_Recherche - } - return t.prototype.chargerAPI = function () { - return r(this, void 0, void 0, function () { - var n; - return u(this, function (t) { - switch (t.label) { - case 0: - if (this.apiPresente()) return [3, - 4]; - t.label = 1; - case 1: - return t.trys.push([1, - 3, - , - 4]), - [ - 4, - this.pChargerApiSansVerification() - ]; - case 2: - return t.sent(), - [ - 3, - 4 - ]; - case 3: - throw n = t.sent(), - new Error('Probleme lors du chargement de woosmap: ' + n); - case 4: - return [2] - } - }) - }) - }, - t.prototype.pChargerApiSansVerification = function () { - return r(this, void 0, void 0, function () { - var t, - i, - r = this; - return u(this, function () { - return t = new n(function (n, t) { - h.default(r._objRecherche.UrlApiWoosmap, function (i) { - i && t(new Error('Probleme de chargment de l\'API woosmap : ' + i)); - n() - }) - }), - i = new n(function (n, t) { - setTimeout(function () { - t('timeout chargement woosmap') - }, r._objRecherche.DureeTimeoutConnexionApi || 5000) - }), - [ - 2, - n.race([t, - i]).then(this.pChargerWoosmap, this.pDechargerWoosmap) - ] - }) - }) - }, - t.prototype.apiPresente = function () { - return !!(this._fStatutOK && window.woosmap && window.woosmap.localities) - }, - t.prototype.rechercher = function (t, i) { - return r(this, void 0, void 0, function () { - var r = this; - return u(this, function () { - return [2, - new n(function (n, u) { - var f = { - country: i - }, - o = new e.WoosmapQuery(t, f, null); - r._objAutocomplete.autocomplete(o, function (t) { - n(r.pConvertirLocalites(t.localities)) - }, function (n, t) { - u(new Error('rechercher / Probleme d\'appel a woosmap - error ' + n + ' : ' + t)) - }) - })] - }) - }) - }, - t.prototype.rechercherCodePostaux = function (t) { - return r(this, void 0, void 0, function () { - var i = this; - return u(this, function () { - return [2, - new n(function (n, r) { - var u = new e.WoosmapQuery(t, { - country: 'fr' - }, 'postal_code'); - i._objAutocomplete.autocomplete(u, function (t) { - n(i.pConvertirLocalites(t.localities)) - }, function (n, t) { - r(new Error('rechercherCodePostaux / Probleme d\'appel a woosmap - error ' + n + ' : ' + t)) - }) - })] - }) - }) - }, - t.prototype.recupererDetailsLocalite = function (t) { - return r(this, void 0, void 0, function () { - var r, - i, - e = this; - return u(this, function () { - return r = t.attr('data-type'), - i = new f.ResultatGeocodage, - [ - 2, - new n(function (n, u) { - 'pointRetrait' != r ? e._objAutocomplete.getDetails(t.attr('data-place-id'), function (t) { - 'postal_code' == t.types[0] ? (i.Ville = t.address_components[1].long_name, i.LstCodePostalLieu = [ - t.name - ]) : (i.Ville = t.name, i.LstCodePostalLieu = [ - t.address_components[1].long_name - ]); - i.Arrondissement = t.address_components[1].long_name; - i.LstAdresse = [ - ]; - var r = new f.AdresseGeocodage; - r.Types = t.types; - r.NomCourt = t.name; - i.LstAdresse.push(r); - i.Latitude = t.geometry.location.lat; - i.Longitude = t.geometry.location.lng; - n(i) - }, function (n, t) { - u(new Error('rechercher / Probleme d\'appel a woosmap - error ' + n + ' : ' + t)) - }) : (i.Ville = t.attr('data-ville'), i.LstCodePostalLieu = t.attr('data-code-postal').split(';'), i.Arrondissement = t.attr('data-arrondissement'), i.Latitude = + t.attr('data-latitude'), i.Longitude = + t.attr('data-longitude'), i.CodePays = t.attr('data-code-pays'), n(i)) - }) - ] - }) - }) - }, - t.prototype.pConvertirLocalites = function (n) { - var t = [ - ]; - return null != n && n.forEach(function (n) { - var i = new f.ResultatGeocodage, - r; - i.AdresseFormatee = n.description; - i.IdLieu = n.public_id; - i.TypeResultat = n.type; - i.Ville = ''; - i.LstCodePostalLieu = [ - ]; - i.Arrondissement = ''; - i.LstAdresse = [ - ]; - r = new f.AdresseGeocodage; - r.Types = [ - ]; - r.NomCourt = ''; - r.NomLong = n.description; - i.LstAdresse.push(r); - i.Latitude = 0; - i.Longitude = 0; - t.push(i) - }), - t - }, - t = o([c.Injectable({ - name: 'WoosmapService', - dependence: [ - ] - })], t) - }(); - t.WoosmapService = a - }).call(this, i(0).Promise) -}, -function (n, t) { - 'use strict'; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.WoosmapQuery = void 0; - var i = function (n, t, i) { - this.input = n; - this.components = t; - this.types = i - }; - t.WoosmapQuery = i -}, -function (n, t, i) { - 'use strict'; - (function (n) { - var e = this && this.__decorate || function (n, t, i, r) { - var f, - e = arguments.length, - u = e < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r, - o; - if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) u = Reflect.decorate(n, t, i, r); - else for (o = n.length - 1; o >= 0; o--) (f = n[o]) && (u = (e < 3 ? f(u) : e > 3 ? f(t, i, u) : f(t, i)) || u); - return e > 3 && u && Object.defineProperty(t, i, u), - u - }, - r = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - u = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.GoogleMapController = void 0; - var o = i(1), - s = i(2), - f = i(3), - h = function () { - function t(t, i) { - var e = this; - void 0 === t && (t = null); - void 0 === i && (i = null); - this.googleMapService = t; - this.pointRetraitController = i; - this._fMasquerSuggestion = !1; - this._statusOK = !0; - this.rechercherAutoCompletion = function (n, t) { - return r(e, void 0, void 0, function () { - var i, - r, - f; - return u(this, function (u) { - switch (u.label) { - case 0: - t = t; - u.label = 1; - case 1: - return u.trys.push([1, - 4, - , - 5]), - [ - 4, - this.googleMapService.ExecuterRechercheAutocomplete(n) - ]; - case 2: - return i = u.sent(), - [ - 4, - this.pointRetraitController.GetLstMotsCles() - ]; - case 3: - return r = u.sent(), - this.afficherResultatAutoCompletion(i, r, n), - [ - 3, - 5 - ]; - case 4: - throw f = u.sent(), - this._statusOK = !1, - f; - case 5: - return [2] - } - }) - }) - }; - this.traiterRechercheGeocodage = function (n) { - return r(e, void 0, void 0, function () { - var t; - return u(this, function () { - return t = document.createElement('ul'), - $(t).append($('
  • ').append($('').attr('data-type', 'postal_code').attr('data-place-id', n.IdLieu).attr('data-latitude', n.Latitude).attr('data-longitude', n.Longitude).attr('data-description', n.AdresseFormatee).attr('data-ville', n.Ville).attr('data-arrondissement', n.Arrondissement).attr('data-code-postal', n.LstCodePostalLieu[0]).attr('data-code-pays', n.CodePays).html(n.AdresseFormatee))).html(), - $(this._objRecherche.DivResultatVilles).hide(), - $(this._objRecherche.DivResultatVilles).append($('
    ').append($('
    ').append(t))), - [ - 2 - ] - }) - }) - }; - this.afficherResultatAutoCompletion = function (n, t, i) { - var u, - r, - f; - $(e._objRecherche.DivResultatVilles).empty(); - $(e._objRecherche.DivResultatPointsRetrait).empty(); - $(e._objRecherche.DivResultatVilles).show(); - r = e.construirelistePrediction(n); - f = e._objRecherche.listePointRetraitMatch(r, t, i); - u = e._objRecherche.construireResultatRecherche(f, r, i); - e.affichagerResultat(u, e._fMasquerSuggestion); - e._objRecherche.MasquerLoader() - }; - this.construirelistePrediction = function (n) { - var t = [ - ], - r = e, - i = [ - ]; - return n.map(function (n) { - return i.push(n) - }), - i.forEach(function (n) { - var i = r.pConvertirAutocompletePrediction(n); - t.push(i) - }), - t - }; - this.selectionnerResultat = function (t) { - return r(e, void 0, void 0, function () { - var i = this; - return u(this, function () { - return [2, - new n(function (n) { - return r(i, void 0, void 0, function () { - var i, - r, - e, - s, - h, - c, - l, - o, - a, - v, - y; - return u(this, function (u) { - switch (u.label) { - case 0: - return u.trys.push([0, - 5, - , - 6]), - i = void 0, - null == t ? [ - 3, - 4 - ] : (r = t.attr('data-type'), e = t.attr('data-description'), s = t.attr('data-ville'), h = t.attr('data-arrondissement'), c = t.attr('data-latitude'), l = t.attr('data-longitude'), o = t.attr('data-place-id'), a = t.attr('data-code-postal'), v = t.attr('data-code-pays'), 'prediction' != r ? [ - 3, - 2 - ] : [ - 4, - this.googleMapService.RecupererLieuDetail(o, e, r) - ]); - case 1: - return i = u.sent(), - [ - 3, - 3 - ]; - case 2: - i = new f.InformationResultatRecherche(c, l, e, r, null, o, s, h, a, v); - u.label = 3; - case 3: - return [2, - n(i)]; - case 4: - return [3, - 6]; - case 5: - throw y = u.sent(), - this._statusOK = !1, - new Error(y); - case 6: - return [2] - } - }) - }) - })] - }) - }) - }; - this._objRecherche = new s.jsWPAD335_Recherche - } - return t.prototype.geocodage = function (n) { - return r(this, void 0, void 0, function () { - var t, - i; - return u(this, function (r) { - switch (r.label) { - case 0: - n.CodePays = n.CodePays || this._objRecherche.CodePays; - r.label = 1; - case 1: - return r.trys.push([1, - 4, - , - 5]), - [ - 4, - this.googleMapService.Geocodage(n) - ]; - case 2: - return t = r.sent(), - [ - 4, - this.traiterRechercheGeocodage(t[0]) - ]; - case 3: - return r.sent(), - [ - 2, - t - ]; - case 4: - throw i = r.sent(), - this._statusOK = !1, - i; - case 5: - return [2] - } - }) - }) - }, - t.prototype.geocodageInverseGetCodePostal = function (n, t) { - return r(this, void 0, void 0, function () { - var r, - s, - h, - f, - e, - o, - c, - i; - return u(this, function (u) { - switch (u.label) { - case 0: - return [4, - this.googleMapService.geocodeInverseLatLng(n, t)]; - case 1: - return r = u.sent(), - s = r.map(function (n) { - return n.address_components - }).map(function (n) { - return n.filter(function (n) { - return n.types.includes('postal_code') - }) - }), - h = r.map(function (n) { - return n.address_components - }).map(function (n) { - return n.filter(function (n) { - return n.types.includes('locality') - }) - }), - f = s.filter(function (n) { - return n.length > 0 - }) [0], - e = h.filter(function (n) { - return n.length > 0 - }) [0], - o = f[0] ? f[0].short_name : '', - c = e[0] ? e[0].short_name : '', - (i = { - }).latitude = Number(n), - i.longitude = Number(t), - i.CodePostal = o, - i.Ville = c, - i.Description = o, - [ - 2, - i - ] - } - }) - }) - }, - t.prototype.chargerAPI = function () { - return r(this, void 0, void 0, function () { - return u(this, function (n) { - switch (n.label) { - case 0: - return [4, - this.googleMapService.ChargerAPI()]; - case 1: - return n.sent(), - [ - 2 - ] - } - }) - }) - }, - t.prototype.apiMapActif = function () { - return this._objRecherche.GoogleMapsActif && this._statusOK - }, - t.prototype.affichagerResultat = function (n, t) { - var i = document.createElement('ul'), - r = !0; - n.forEach(function (n) { - 'inconnu' != n.TypeRecherche && (r = !1); - $(i).append($('
  • ').append($('').attr('data-type', n.TypeRecherche).attr('data-place-id', n.PlaceId).attr('data-latitude', n.latitude).attr('data-longitude', n.longitude).attr('data-description', n.Description).attr('data-ville', n.Ville).attr('data-arrondissement', n.Arrondissement).html(n.Description))).html() - }); - (r || t) && $(this._objRecherche.DivResultatVilles).hide(); - $(this._objRecherche.DivResultatVilles).append($('
    ').append($('
    ').append(i))) - }, - t.prototype.pConvertirAutocompletePrediction = function (n) { - var t, - i, - r; - return t = - 1 != n.types.indexOf('postal_code') ? n.terms[0].value : n.description.replace(/,/g, '').replace(' ' + this._objRecherche.Pays, ''), - i = n.place_id, - r = n.structured_formatting.main_text, - new f.InformationResultatRecherche(null, null, t, 'prediction', null, i, r, null, null, null) - }, - t = e([o.Injectable({ - name: 'GoogleMapController', - dependence: [ - 'GoogleMapService', - 'PointRetraitController' - ] - })], t) - }(); - t.GoogleMapController = h - }).call(this, i(0).Promise) -}, -function (n, t, i) { - 'use strict'; - (function (n) { - var s = this && this.__decorate || function (n, t, i, r) { - var f, - e = arguments.length, - u = e < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r, - o; - if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) u = Reflect.decorate(n, t, i, r); - else for (o = n.length - 1; o >= 0; o--) (f = n[o]) && (u = (e < 3 ? f(u) : e > 3 ? f(t, i, u) : f(t, i)) || u); - return e > 3 && u && Object.defineProperty(t, i, u), - u - }, - r = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - u = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }, - h = this && this.__importDefault || function (n) { - return n && n.__esModule ? n : { - 'default': n - } - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.GoogleMapService = void 0; - var e = h(i(12)), - c = i(1), - l = i(2), - f = i(3), - o = i(29), - a = i(19), - v = function () { - function t() { - var t = this; - this.pInitInstanceGoogleMaps = function () { - var n = t._objRecherche.DivMap; - t._apiMap = new google.maps.Map(document.getElementById(n), { - }); - t._apiServicePlace = new google.maps.places.PlacesService(t._apiMap); - t._apiServiceAutoComplete = new google.maps.places.AutocompleteService; - t._apiGeocoder = new google.maps.Geocoder - }; - this.DechargerGoogleMaps = function (n) { - throw t._apiMap = null, - t._apiServicePlace = null, - t._apiServiceAutoComplete = null, - t._apiGeocoder = null, - new Error(n); - }; - this.ExecuterRechercheAutocomplete = function (i) { - return r(t, void 0, void 0, function () { - var t, - f, - e = this; - return u(this, function (o) { - switch (o.label) { - case 0: - return t = { - input: i, - types: [ - '(regions)' - ], - componentRestrictions: { - country: '' + this._objRecherche.CodePays - } - }, - [ - 4, - this.APIAutoComplete() - ]; - case 1: - return f = o.sent(), - [ - 2, - new n(function (n, i) { - return r(e, void 0, void 0, function () { - return u(this, function () { - return f.getPlacePredictions(t, function (t, r) { - return r == google.maps.places.PlacesServiceStatus.ZERO_RESULTS ? n([]) : (r != google.maps.places.PlacesServiceStatus.OK && i(Error('Google map getPlacePredictions error : ' + r)), n(t)) - }), - [ - 2 - ] - }) - }) - }) - ] - } - }) - }) - }; - this.RecupererLieuDetail = function (i, e, o) { - return r(t, void 0, void 0, function () { - var t, - r, - s, - h; - return u(this, function (u) { - switch (u.label) { - case 0: - return [4, - this.APIServicePlace()]; - case 1: - return h = u.sent(), - [ - 2, - new n(function (n, u) { - h.getDetails({ - placeId: i - }, function (i, h) { - h == google.maps.places.PlacesServiceStatus.OK ? (t = i.geometry.location.lat(), r = i.geometry.location.lng(), s = new f.InformationResultatRecherche(t, r, e, o, null, i.types[0], null, null, null, null), n(s)) : u(null) - }) - }) - ] - } - }) - }) - }; - this._objRecherche = new l.jsWPAD335_Recherche; - this._urlLib = this._objRecherche.UrlLIBGoogleMaps - } - return t.prototype.APIMap = function () { - return r(this, void 0, void 0, function () { - return u(this, function (n) { - switch (n.label) { - case 0: - return [4, - this.ChargerAPI()]; - case 1: - return n.sent(), - [ - 2, - this._apiMap - ] - } - }) - }) - }, - t.prototype.APIGeocoder = function () { - return r(this, void 0, void 0, function () { - return u(this, function (n) { - switch (n.label) { - case 0: - return [4, - this.ChargerAPI()]; - case 1: - return n.sent(), - [ - 2, - this._apiGeocoder - ] - } - }) - }) - }, - t.prototype.APIAutoComplete = function () { - return r(this, void 0, void 0, function () { - return u(this, function (n) { - switch (n.label) { - case 0: - return [4, - this.ChargerAPI()]; - case 1: - return n.sent(), - [ - 2, - this._apiServiceAutoComplete - ] - } - }) - }) - }, - t.prototype.APIServicePlace = function () { - return r(this, void 0, void 0, function () { - return u(this, function (n) { - switch (n.label) { - case 0: - return [4, - this.ChargerAPI()]; - case 1: - return n.sent(), - [ - 2, - this._apiServicePlace - ] - } - }) - }) - }, - t.prototype.apiPresente = function () { - return null != (window.google && window.google.maps && window.google.maps.Geocoder && window.google.maps.places && window.google.maps.places.PlacesService && window.google.maps.places.AutocompleteService) - }, - t.prototype.ChargerAPI = function () { - return r(this, void 0, void 0, function () { - var t; - return u(this, function (i) { - switch (i.label) { - case 0: - if (this.apiPresente()) return [3, - 5]; - i.label = 1; - case 1: - return i.trys.push([1, - 3, - , - 4]), - window.promiseChargeGoogleMap && window.promiseChargeGoogleMap.isPending() || (window.promiseChargeGoogleMap = a.MakeQuerablePromise(this.pChargerApiSansVerification())), - [ - 4, - window.promiseChargeGoogleMap - ]; - case 2: - return [2, - i.sent()]; - case 3: - throw t = i.sent(), - new Error('Probleme lors du chargement de Googlemap : ' + t); - case 4: - return [3, - 6]; - case 5: - return null != (this._apiMap && this._apiGeocoder && this._apiServiceAutoComplete && this._apiServicePlace) || this.pInitInstanceGoogleMaps(), - [ - 2, - n.resolve() - ]; - case 6: - return [2] - } - }) - }) - }, - t.prototype.pChargerApiSansVerification = function () { - return r(this, void 0, void 0, function () { - var t, - r, - i = this; - return u(this, function () { - return (t = [ - ]).push(new n(function (n, t) { - e.default(i._objRecherche.UrlAPIGoogleMaps + '&libraries=places,geometry', function (i) { - i && t(i); - n(null) - }) - })), - t.push(new n(function (n, t) { - e.default(i._urlLib, function (i) { - i && t(i); - n(null) - }) - })), - r = new n(function (n, t) { - setTimeout(function () { - t('timeout chargement google map') - }, i._objRecherche.DureeTimeoutConnexionApi || 5000) - }), - [ - 2, - n.race([n.all(t), - r]).then(this.pInitInstanceGoogleMaps, this.DechargerGoogleMaps) - ] - }) - }) - }, - t.prototype.Geocodage = function (t) { - return r(this, void 0, void 0, function () { - var r, - i, - f = this; - return u(this, function (u) { - switch (u.label) { - case 0: - return r = this, - [ - 4, - this.APIGeocoder() - ]; - case 1: - return u.sent(), - i = new o.GeocoderRequest, - null != t.PlaceId ? i.placeId = t.PlaceId : (i.componentRestrictions = new o.GeocoderComponentRestrictions, i.address = t.Description, i.componentRestrictions.postalCode = t.CodePostal, i.location = new google.maps.LatLng(t.latitude, t.longitude), i.componentRestrictions.country = t.CodePays), - [ - 2, - new n(function (n, t) { - r._apiGeocoder.geocode(i, function (i, r) { - if (r == google.maps.places.PlacesServiceStatus.ZERO_RESULTS) return n([]); - r != google.maps.places.PlacesServiceStatus.OK && t(new Error('Google map getPlacePredictions error : ' + r)); - var u = f.pConvertirGoogleGeocoderResult(i); - return n(u) - }) - }) - ] - } - }) - }) - }, - t.prototype.geocodeInverseLatLng = function () { - for (var i = [ - ], t = 0; t < arguments.length; t++) i[t] = arguments[t]; - return r(this, void 0, void 0, function () { - var t, - r, - f, - e; - return u(this, function (u) { - switch (u.label) { - case 0: - return [4, - this.APIGeocoder()]; - case 1: - return t = u.sent(), - r = i[0], - f = i[1], - e = { - lat: parseFloat(r), - lng: parseFloat(f) - }, - [ - 2, - new n(function (n, i) { - t.geocode({ - location: e - }, function (t, r) { - 'OK' === r ? t[0] ? n(t) : n(null) : i(new Error('Geocoder failed due to: ' + r)) - }) - }) - ] - } - }) - }) - }, - t.prototype.pConvertirGoogleGeocoderResult = function (n) { - var t = [ - ]; - return null != n && n.forEach(function (n) { - var i = new f.ResultatGeocodage; - i.AdresseFormatee = n.formatted_address; - null != n.address_components && n.address_components.forEach(function (n) { - var t = new f.AdresseGeocodage; - t.NomCourt = n.short_name; - t.NomLong = n.long_name; - t.Types = n.types; - i.LstAdresse.push(t); - - 1 != t.Types.indexOf('postal_code') && i.LstCodePostalLieu.push(t.NomCourt); - - 1 != t.Types.indexOf('locality') && (i.Ville = t.NomCourt); - - 1 != t.Types.indexOf('country') && (i.CodePays = t.NomCourt) - }); - i.IdLieu = n.place_id; - null != n.postcode_localities && (i.LstCodePostalLieu = n.postcode_localities); - i.MatchPartiellement = n.partial_match; - null != n.geometry && (i.TypeLieu = f.TypeLieu[n.geometry.location_type], null != n.geometry.location && (i.Latitude = n.geometry.location.lat(), i.Longitude = n.geometry.location.lng())); - i.Types = n.types; - t.push(i) - }), - t - }, - t = s([c.Injectable({ - name: 'GoogleMapService', - dependence: [ - ] - })], t) - }(); - t.GoogleMapService = v - }).call(this, i(0).Promise) -}, -function (n, t) { - 'use strict'; - var i, - r, - u, - f, - e; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.GeocoderGeometry = t.GeocoderAddressComponent = t.GeocoderResult = t.GeocoderComponentRestrictions = t.GeocoderRequest = void 0; - i = function () { - }; - t.GeocoderRequest = i; - r = function () { - }; - t.GeocoderComponentRestrictions = r; - u = function () { - }; - t.GeocoderResult = u; - f = function () { - }; - t.GeocoderAddressComponent = f; - e = function () { - }; - t.GeocoderGeometry = e -}, -function (n, t, i) { - 'use strict'; - var u, - e = this && this.__extends || (u = function (n, t) { - return (u = Object.setPrototypeOf || { - __proto__: [ - ] - } - instanceof Array && function (n, t) { - n.__proto__ = t - } - || function (n, t) { - for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (n[i] = t[i]) - }) (n, t) - }, function (n, t) { - function i() { - this.constructor = n - } - if ('function' != typeof t && null !== t) throw new TypeError('Class extends value ' + String(t) + ' is not a constructor or null'); - u(n, t); - n.prototype = null === t ? Object.create(t) : (i.prototype = t.prototype, new i) - }), - o = this && this.__importDefault || function (n) { - return n && n.__esModule ? n : { - 'default': n - } - }, - f; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.jsWPAD383_ListeDrive = t.FacettePointRetrait = void 0; - var r, - s = o(i(5)), - h = i(1), - c = i(18); - !function (n) { - function t() { - return null !== n && n.apply(this, arguments) || this - } - e(t, n) - }(EventTarget); - !function (n) { - n.Tous = 'Tous'; - n.Drive = 'Drive'; - n.Relais = 'Relais'; - n.ChezMoi = 'ChezMoi' - }(r = t.FacettePointRetrait || (t.FacettePointRetrait = { - })); - f = function () { - function n(n) { - var t = this; - this._divListeDriveSelector = 'idDivWPAD337_Liste'; - this._buttonFiltreSelector = 'ctrlMapLAD__filtre'; - this._divListeDriveMobileSelector = 'divWPAD313_ResultatPointsRetrait'; - this._lstPointRetraits = [ - ]; - this._listPointRetraitsFiltre = [ - ]; - this.pDemarrerListenerFiltre = function (n) { - document.querySelector('.' + t._buttonFiltreSelector).addEventListener('click', function (i) { - var u = i.target, - r; - document.querySelectorAll('.' + t._buttonFiltreSelector + '>.btn-leclerc.btn-mini.btn-blanc').forEach(function (n) { - return n.classList.remove('active') - }); - t.enuFacetteActuel = u.value; - r = t.pFiltrerPointRetrait(t._listPointRetraitsFiltre, t.enuFacetteActuel, n); - t.AfficherListPointLivraisonAffichable(r) - }) - }; - this.pDemarrerListenerFiltreMobile = function (n) { - document.querySelector('.' + t._buttonFiltreSelector).addEventListener('click', function (i) { - var u = i.target, - r; - document.querySelectorAll('.' + t._buttonFiltreSelector + '>.btn-leclerc.btn-mini.btn-blanc').forEach(function (n) { - return n.classList.remove('active') - }); - t.enuFacetteActuel = u.value; - r = t.pFiltrerPointRetrait(t._listPointRetraitsFiltre, t.enuFacetteActuel, n); - t.pAfficherListPointLivraisonAffichableMobile(r) - }) - }; - s.default(document).ready(function () { - new c.InitInjectable; - t._objRecherche = n; - t._objPointRetrait = h.JsInject.ServiceLocator.get('PointRetraitController'); - t.InitialisationAbonnements() - }) - } - return Object.defineProperty(n.prototype, 'enuFacetteActuel', { - get: function () { - return this._enuFacetteActuel - }, - set: function (n) { - var t = this; - this._enuFacetteActuel = n; - document.querySelectorAll('.' + this._buttonFiltreSelector + '>.btn-leclerc.btn-mini.btn-blanc').forEach(function (n) { - n.value == t._enuFacetteActuel ? n.classList.add('active') : n.classList.remove('active') - }) - }, - enumerable: !1, - configurable: !0 - }), - n.prototype.InitialisationAbonnements = function () { - var n = this; - this._objPointRetrait.GetPointsRetrait(!0).then(function (t) { - n._lstPointRetraits = t - }).catch(function (n) { - console.log(n) - }) - }, - n.prototype.pAjouterInformationComplementaire = function (n, t, i) { - var f = this, - u = [ - ]; - return t.forEach(function (t) { - var o, - s, - h, - e; - if (!t.fSitePrive) { - if (t.nDistance = f._objRecherche.CalculerDistanceGPS(t.rLatitude, t.rLongitude, n.latitude, n.longitude), t.sTypeLAD = null, 0 != t.lstZonesLivraison.length) if (i) { - for (t.sTypeLAD = 'indisponible', o = 0, s = t.lstZonesLivraison; o < s.length; o++) if (h = s[o], !h.fExclus && h.sCodePostal == n.CodePostal) { - t.sTypeLAD = 'disponible'; - break - } - } else t.sTypeLAD = 'sousReserve'; - e = t; - switch (e.facettes = [ - ], e.eTypePR) { - case 1: - e.facettes.push(r.Drive); - break; - case 3: - case 4: - e.facettes.push(r.Relais) - } - 5 != t.eTypePR && 13 != t.eTypePR && 16 != t.eTypePR && 15 != t.eTypePR || (e.facettes = [ - r.Relais - ]); - t.lstZonesLivraison.length > 0 && e.facettes.push(r.ChezMoi); - u.push(e) - } - }), - u - }, - n.prototype.pInitFiltrerEtCompleterAfficher = function (n, t, i, u) { - var f = this, - e; - this.enuFacetteActuel = r.Tous; - e = /^[0-9]{5}/.test(i.Description); - t.then(function (n) { - var o, - t, - s, - h; - null != u ? (o = f._lstPointRetraits.filter(function (n) { - return u.some(function (t) { - return n.sNoPR == t - }) - }), f._listPointRetraitsFiltre = f.pRecupererTousLesPointRetraitFiltre(o, void 0, void 0, i, e), f._listPointRetraitsFiltre = f._listPointRetraitsFiltre.sort(function (n, t) { - return n.nDistance - t.nDistance - }), f.AfficherListPointLivraisonAffichable(f._listPointRetraitsFiltre), f.pDemarrerListenerFiltre(e)) : n.addListener('idle', function () { - t = n.getBounds(); - s = t.getNorthEast(); - h = t.getSouthWest(); - f._listPointRetraitsFiltre = f.pRecupererTousLesPointRetraitFiltre(f._lstPointRetraits, s, h, i, e); - f._listPointRetraitsFiltre = f._listPointRetraitsFiltre.sort(function (n, t) { - return n.nDistance - t.nDistance - }); - f.AfficherListPointLivraisonAffichable(f._listPointRetraitsFiltre); - f.pDemarrerListenerFiltre(e) - }); - document.querySelector('.' + f._buttonFiltreSelector + ' button[value=' + r.Tous + ']').click() - }) - }, - n.prototype.pFiltrerPointRetrait = function (n, t, i) { - return t == r.Tous ? n : t == r.ChezMoi && i ? n.filter(function (n) { - return n.facettes.includes(r.ChezMoi) && 'indisponible' != n.sTypeLAD - }) : n.filter(function (n) { - return n.facettes.includes(t) - }) - }, - n.prototype.InitialiserAffichageListePR = function (n, t, i) { - var r = document.getElementById(this._divListeDriveSelector); - r.innerHTML = ''; - this.pInitFiltrerEtCompleterAfficher(r, n, t, i); - r.classList.remove('masquer') - }, - n.prototype.AfficherListPointLivraisonAffichable = function (n) { - var t = document.getElementById(this._divListeDriveSelector); - t.innerHTML = ''; - n.length > 0 ? this.pCreerEtInsererIHMDriveDesktop(t, n) : this.pAucunResultaIHMDriveDesktopCore(t) - }, - n.prototype.pRecupererTousLesPointRetraitFiltre = function (n, t, i, r, u) { - var s, - f = n, - e, - o, - h; - return null != t && null != i && (f = this._objPointRetrait.RetrouverPrVisible(n, t, i)), - e = this._lstPointRetraits.filter(function (n) { - return n.lstZonesLivraison.some(function (n) { - return n.sCodePostal == r.CodePostal && !n.fExclus - }) && n.sNoPL == n.sNoPR && ('I' == n.sEtatSite || 'O' == n.sEtatSite) - }), - o = this.pMergeListePR(f, e), - (s = this.pAjouterInformationComplementaire(r, o, u), 1 == o.length) && (h = f.length > 0 ? f[0] : e[0], window.WPAD338.AfficherPointsRetrait('SELECTION', null, null, h.iIdPointCarte, null, null, null)), - s - }, - n.prototype.pMergeListePR = function (n, t) { - var i = [ - ]; - return t.forEach(function (t) { - n.some(function (n) { - return n.sNoPL == t.sNoPL - }) || i.push(t) - }), - [ - ].concat(n, i) - }, - n.prototype.pAucunResultaIHMDriveDesktopCore = function (n) { - var t = document.createElement('div'); - t.className = 'ctrlMapLAD__cartouches_vide'; - t.innerHTML = '\n
    \n

    ' + window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_DRIVE_VIDE + '

    \n
    \n '; - n.appendChild(t) - }, - n.prototype.pCreerEtInsererIHMDriveDesktop = function (n, t) { - var i = this; - t.forEach(function (t) { - i.pCreerEtInsererIHMDriveDesktopCore(n, t.sNoPL, t.sNoPR, t.sNomPR, t.sCodePostal, t.nDistance, t.iIdPointCarte, t.sTypeLAD, - 1 != t.facettes.indexOf(r.Relais), t.eTypePR) - }) - }, - n.prototype.pCreerEtInsererIHMDriveDesktopCore = function (n, t, i, r, u, f, e, o, s, h) { - var c = document.createElement('div'); - return c.className = 'ctrlMapLAD__cartouches', - c.id = 'liDrive_' + t, - c.innerHTML = '\n
    \n

    ' + u + ' ' + r + ' - ' + f.toLocaleString('fr-FR', { - minimumFractionDigits: 1, - maximumFractionDigits: 1 - }) + ' km \n

    \n
    \n
    \n
    \n ' + window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_DRIVE + '\n \n
    \n
    \n\n \n ' + (16 == h || 15 == h ? 'Relais (camion)' : 'Relais') + '\n
    \n
    \n
    \n \n
    \n ' + window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_CHEZ_MOI + '\n
    \n ' + ('indisponible' == o ? window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_CHEZ_MOI_INDISPONIBLE : '') + ' ' + ('sousReserve' == o ? window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_CHEZ_MOI_SOUS_RESERVE : '') + '\n
    \n
    \n
    ', - c.setAttribute('onclick', 'window[\'WPAD338\'].AfficherPointsRetrait("SELECTION", null, null, ' + e + ', null, null, null)'), - n.appendChild(c), - c - }, - n.prototype.AfficherListeMobile = function (n, t, i) { - var f, - s = this, - e = document.getElementById(this._divListeDriveMobileSelector), - o, - u; - e.innerHTML = ''; - this.enuFacetteActuel = r.Tous; - f = this._lstPointRetraits.filter(function (n) { - return t.some(function (t) { - return n.sNoPR == t - }) - }); - this._listPointRetraitsFiltre = this.pAjouterInformationComplementaire(n, f, i); - this._listPointRetraitsFiltre.sort(function (n, t) { - return n.nDistance - t.nDistance - }); - this._listPointRetraitsFiltre.forEach(function (n) { - s.pCreerEtInsererIHMDriveMobile(e, n.sNoPL, n.sNoPR, n.sNomPR, n.sCodePostal, n.nDistance, n.iIdPointCarte, n.sTypeLAD, - 1 != n.facettes.indexOf(r.Relais), n.eTypePR) - }); - o = this.pFiltrerPointRetrait(this._listPointRetraitsFiltre, this.enuFacetteActuel, i); - 0 === Object.keys(o).length && (u = document.getElementById(this._divListeDriveMobileSelector), u.innerHTML = '', this.pAucunResultaIHMDriveDesktopCore(u)); - this.pDemarrerListenerFiltreMobile(i) - }, - n.prototype.pCreerEtInsererIHMDriveMobile = function (n, t, i, r, u, f, e, o, s, h) { - var c = document.createElement('div'); - return c.className = 'ctrlMapLAD__cartouches', - c.id = 'liDrive_' + t, - c.innerHTML = '\n
    \n

    ' + u + ' ' + r + ' - ' + f.toLocaleString('fr-FR', { - minimumFractionDigits: 1, - maximumFractionDigits: 1 - }) + ' km\n

    \n
    \n
    \n
    \n ' + window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_DRIVE + '\n
    \n
    \n \n ' + (16 == h || 15 == h ? 'Relais (camion)' : 'Relais') + '
    \n
    \n
    \n \n
    \n ' + window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_CHEZ_MOI + '\n
    \n ' + ('indisponible' == o ? window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_CHEZ_MOI_INDISPONIBLE : '') + ' ' + ('sousReserve' == o ? window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_CHEZ_MOI_SOUS_RESERVE : '') + '\n
    \n
    \n
    ', - c.addEventListener('click', function () { - window.WPAD335.AfficherFicheMagasin(t, i) - }), - n.appendChild(c), - c - }, - n.prototype.pAfficherListPointLivraisonAffichableMobile = function (n) { - var i = this, - t = document.getElementById(this._divListeDriveMobileSelector); - t.innerHTML = ''; - n.length > 0 ? (n.sort(function (n, t) { - return n.nDistance - t.nDistance - }), n.forEach(function (n) { - i.pCreerEtInsererIHMDriveMobile(t, n.sNoPL, n.sNoPR, n.sNomPR, n.sCodePostal, n.nDistance, n.iIdPointCarte, n.sTypeLAD, - 1 != n.facettes.indexOf(r.Relais), n.eTypePR) - })) : this.pAucunResultaIHMDriveDesktopCore(t) - }, - n - }(); - t.jsWPAD383_ListeDrive = f -}, -function (n, t) { - 'use strict'; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.PositionOptionsImpl = void 0; - var i = function () { - }; - t.PositionOptionsImpl = i -}, -function (n, t, i) { - 'use strict'; - var e; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.jsWPAD344_RechercheDrive = void 0; - var r = i(2), - o = i(10), - s = i(30), - u = i(1), - h = i(18), - c = i(3), - l = i(31), - f = function () { - function n() { - var n = this; - this.pTraiterGeolocalisationSucces = function (t) { - var u = t.coords.latitude, - f = t.coords.longitude, - i = new c.InformationResultatRecherche(u, f, null, null, null, null, null, null, null, null), - r; - n._objRecherche.MasquerLoader(); - r = n.AfficherCarte(i); - 'iDRIVE' == n._objRecherche.Univers && n.AfficherListeDrive(r, i, null) - }; - this.pTraiterGeolocalisationErreur = function (t) { - switch (t.code) { - case t.PERMISSION_DENIED: - case t.POSITION_UNAVAILABLE: - case t.TIMEOUT: - break; - default: - n._objRecherche.LogWarn('TraiterGeolocalisationErreur', 'Erreur geolocatisation : ' + t) - } - n._objRecherche.MasquerLoader(); - n._objRecherche.AfficherMessage(n._objRecherche.MsgErreurGeoloc, 'msgErreur') - }; - this.AfficherCarte = function (t) { - return $(n._objRecherche.DivResultatVilles).hide(), - $(n._objRecherche.DivResultatVilles).empty(), - $(n._objRecherche.TxtRecherche).val(''), - n.objRechercheCarte.AfficherCarte(t) - }; - this.AfficherListeDrive = function (t, i, r) { - $(n._objRecherche.DivResultatVilles).hide(); - $(n._objRecherche.DivResultatVilles).empty(); - $(n._objRecherche.TxtRecherche).val(''); - n.objListeDrive.InitialiserAffichageListePR(t, i, r) - }; - this.listeModeDegradeHandler = function () { - $('.divWPAD344_ZoneSaisie').addClass('divWPAD344_ZoneSaisieDDL'); - $('.divWPAD344_ZoneSaisie').css('height', '33px'); - var t = ''; - null != window.Utilitaires.Ressources.ascWPAD344_RechercheDrive && (t = window.Utilitaires.Ressources.ascWPAD344_RechercheDrive.LOC_WARTERMARK_RECHERCHE_DEGRADE); - $(document.getElementsByClassName(n.objRechercheCarte.DivCarteName) [0]).css('pointer-events', 'none'); - n.objPointRetraitController.GetPointsRetrait(!0).then(function (i) { - n._objRecherche.ConstruireDDLPointsRetrait(i, '.divWPAD344_ZoneSaisie', null, t) - }) - }; - this.SelectionnerResultat = function (t, i) { - n.objRecherchePositionController.SelectionnerResultat(t).then(function (t) { - var f, - u; - null != t && (f = t.Description, r.jsWPAD335_Recherche.DataTrackPush(null != i ? i : '', f), u = n.AfficherCarte(t), 'iDRIVE' == n._objRecherche.Univers && ('none' == $('.ctrlMapLAD__map').css('display') ? n.objRecherchePositionController.AfficherPointsRetrait(t).then(function (i) { - n.AfficherListeDrive(u, t, i) - }) : n.AfficherListeDrive(u, t, null))) - }) - }; - $(document).ready(function () { - new h.InitInjectable; - n._objRecherche = new r.jsWPAD335_Recherche; - n.objRechercheCarte = new o.jsWPAD337_RechercheCarte; - n.objListeDrive = new s.jsWPAD383_ListeDrive(n._objRecherche); - n.objRecherchePositionController = u.JsInject.ServiceLocator.get('RecherchePositionController'); - n.objPointRetraitController = u.JsInject.ServiceLocator.get('PointRetraitController'); - n.InitialisationAbonnements() - }); - document.addEventListener('ModeSecours', function () { - n.listeModeDegradeHandler() - }) - } - return n.prototype.pGeolocaliser = function () { - try { - if ($(this._objRecherche.DivResultatVilles).empty(), $(this._objRecherche.TxtRecherche).val(''), this._objRecherche.MasquerMessage(), navigator.geolocation) { - this._objRecherche.AfficherLoader(); - var n = new l.PositionOptionsImpl; - n.maximumAge = 600000; - n.timeout = 15000; - n.enableHighAccuracy = !0; - navigator.geolocation.getCurrentPosition(this.pTraiterGeolocalisationSucces, this.pTraiterGeolocalisationErreur, n) - } else this._objRecherche.AfficherMessage(this._objRecherche.MsgErreurGeoloc, 'msgErreur') - } catch (n) { - this._objRecherche.AfficherMessage(this._objRecherche.MsgErreurGeoloc, 'msgErreur'); - this._objRecherche.LogWarn('Drive: Geolocaliser', 'Erreur lors de la géolocalisation: ' + n) - } - }, - n.prototype.RechercherElementSelectionne = function (n) { - if (null == this.element) if ($(this._objRecherche.DivResultatVilles + ' a').length > 0) { - var t = $(this._objRecherche.DivResultatVilles + ' li > a').first(); - this.SelectionnerResultat(t, n) - } else '' == $(this._objRecherche.TxtRecherche).val() && (this._objRecherche.AfficherMessage(this._objRecherche.MsgRechercheVide, 'msgErreur'), this.objRechercheCarte.MasquerGoogleMaps()); - else t = $(this.element).children().first(), - this.element = null, - this.SelectionnerResultat(t, n) - }, - n.prototype.InitialisationAbonnements = function () { - var n = this; - $(this._objRecherche.TxtRecherche).keyup(function (t) { - var r, - i; - 38 == t.keyCode || 40 == t.keyCode || 13 == t.keyCode || 3 == t.keyCode ? ($(n._objRecherche.DivResultatVilles + ' li').each(function () { - $(this).hasClass('selection') && (n.element = $(this)) - }), 38 == t.keyCode && ($(n.element).is(':first-child') || ($(n.element).removeClass('selection'), $(n.element).prev().addClass('selection'))), 40 == t.keyCode && (null != n.element ? $(n.element).is(':last-child') || ($(n.element).removeClass('selection'), $(n.element).next().addClass('selection')) : $(n._objRecherche.DivResultatVilles + ' li').first().addClass('selection')), 13 == t.keyCode || 3 == t.keyCode) && (r = $(n._objRecherche.TxtRecherche).val(), n.rechercheEnCours && n.rechercheEnCours.then(function () { - n.RechercherElementSelectionne(r) - })) : (n._objRecherche.MasquerMessage(), n.element = null, i = $(n._objRecherche.TxtRecherche).val().toString(), i.length >= 2 ? n.rechercheEnCours = n.objRecherchePositionController.RechercherAutoCompletion(i, !1) : $(n._objRecherche.DivResultatVilles).hide()) - }); - $(this._objRecherche.TxtRecherche).focusin(function () { - $(n._objRecherche.DivResultatVilles).hide(); - $(n._objRecherche.DivResultatVilles).empty(); - $(n._objRecherche.TxtRecherche).val(''); - n.objRecherchePositionController.ChargerAPI(); - n.objRecherchePositionController.ApiMapActif() || n._objRecherche.InitialiserModeSecours() - }); - $('body').on('click', this._objRecherche.DivResultatVilles + ' a', function () { - var t = $(n._objRecherche.TxtRecherche).val(); - n.SelectionnerResultat($(this), t) - }); - $('body').on('click', function () { - $(n._objRecherche.DivResultatVilles).hide(); - $(n._objRecherche.DivResultatVilles).empty(); - $(n._objRecherche.TxtRecherche).val('') - }); - $('#btnChoisir').on('click', function (t) { - var i = $(n._objRecherche.TxtRecherche).val(); - t.preventDefault(); - t.stopPropagation(); - n.rechercheEnCours ? n.rechercheEnCours.then(function () { - n.RechercherElementSelectionne(i) - }) : n._objRecherche.AfficherMessage(n._objRecherche.MsgRechercheVide, 'msgErreur') - }); - window.WCTD204.VerifierNavigateurGeoloc() || $('#aWPAD344_Geolocalisation').hide(); - $('#aWPAD344_Geolocalisation').click(function () { - n.pGeolocaliser() - }); - this.objRecherchePositionController.ApiMapActif() || this._objRecherche.InitialiserModeSecours() - }, - n - }(); - t.jsWPAD344_RechercheDrive = f; - e = new f; - window.WPAD344 = e -} -]); - - - - - - - - - - - - - - - - -/********************************************************************************************************************************************************* - * *********************************************************************************************************** - * SEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEPPPPPPPPPPPPPPPPPPPPPAAAAAAAAAAAAAAAAAAAAARRRRRRRRRRRRRRRATTTTTTTTTTIONNNNNNNNNN - * ******************************************************************************* - * ****************************************************************************** -*/ - - - - - - - - - - - - - - - - - - - - - - - - - -!function (n) { - function t(r) { - if (i[r]) return i[r].exports; - var u = i[r] = { - i: r, - l: !1, - exports: { - } - }; - return n[r].call(u.exports, u, u.exports, t), - u.l = !0, - u.exports - } - var i = { - }; - t.m = n; - t.c = i; - t.d = function (n, i, r) { - t.o(n, i) || Object.defineProperty(n, i, { - enumerable: !0, - get: r - }) - }; - t.r = function (n) { - 'undefined' != typeof Symbol && Symbol.toStringTag && Object.defineProperty(n, Symbol.toStringTag, { - value: 'Module' - }); - Object.defineProperty(n, '__esModule', { - value: !0 - }) - }; - t.t = function (n, i) { - var r, - u; - if ((1 & i && (n = t(n)), 8 & i) || 4 & i && 'object' == typeof n && n && n.__esModule) return n; - if (r = Object.create(null), t.r(r), Object.defineProperty(r, 'default', { - enumerable: !0, - value: n - }), 2 & i && 'string' != typeof n) for (u in n) t.d(r, u, function (t) { - return n[t] - }.bind(null, u)); - return r - }; - t.n = function (n) { - var i = n && n.__esModule ? function () { - return n.default - } - : function () { - return n - }; - return t.d(i, 'a', i), - i - }; - t.o = function (n, t) { - return Object.prototype.hasOwnProperty.call(n, t) - }; - t.p = ''; - t(t.s = 30) -}([function (n, t, i) { - (function (t, i) { - /*! - * @overview es6-promise - a tiny implementation of Promises/A+. - * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) - * @license Licensed under MIT license - * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE - * @version v4.2.8+1e68dce6 - */ - var r; - r = function () { - 'use strict'; - function v(n) { - return 'function' == typeof n - } - function p() { - var n = setTimeout; - return function () { - return n(o, 1) - } - } - function o() { - for (var n = 0; n < h; n += 2) e[n](e[n + 1]), - e[n] = void 0, - e[n + 1] = void 0; - h = 0 - } - function k(n, t) { - var u = this, - i = new this.constructor(s), - r, - e; - return void 0 === i[l] && lt(i), - r = u._state, - r ? (e = arguments[r - 1], f(function () { - return ct(r, i, e, u._result) - })) : g(u, i, n, t), - i - } - function d(n) { - if (n && 'object' == typeof n && n.constructor === this) return n; - var t = new this(s); - return a(t, n), - t - } - function s() { - } - function ht(t, i, r) { - i.constructor === t.constructor && r === k && i.constructor.resolve === d ? function (t, i) { - 1 === i._state ? u(t, i._result) : 2 === i._state ? n(t, i._result) : g(i, void 0, function (n) { - return a(t, n) - }, function (i) { - return n(t, i) - }) - }(t, i) : void 0 === r ? u(t, i) : v(r) ? function (t, i, r) { - f(function (t) { - var f = !1, - e = function (n, t, i, r) { - try { - n.call(t, i, r) - } catch (n) { - return n - } - }(r, i, function (n) { - f || (f = !0, i !== n ? a(t, n) : u(t, n)) - }, function (i) { - f || (f = !0, n(t, i)) - }, t._label); - !f && e && (f = !0, n(t, e)) - }, t) - }(t, i, r) : u(t, i) - } - function a(t, i) { - var r, - e, - f; - if (t === i) n(t, new TypeError('You cannot resolve a promise with itself')); - else if (f = typeof (e = i), null === e || 'object' !== f && 'function' !== f) u(t, i); - else { - r = void 0; - try { - r = i.then - } catch (i) { - return void n(t, i) - } - ht(t, i, r) - } - } - function pt(n) { - n._onerror && n._onerror(n._result); - nt(n) - } - function u(n, t) { - void 0 === n._state && (n._result = t, n._state = 1, 0 !== n._subscribers.length && f(nt, n)) - } - function n(n, t) { - void 0 === n._state && (n._state = 2, n._result = t, f(pt, n)) - } - function g(n, t, i, r) { - var u = n._subscribers, - e = u.length; - n._onerror = null; - u[e] = t; - u[e + 1] = i; - u[e + 2] = r; - 0 === e && n._state && f(nt, n) - } - function nt(n) { - var t = n._subscribers, - f = n._state; - if (0 !== t.length) { - for (var r = void 0, u = void 0, e = n._result, i = 0; i < t.length; i += 3) r = t[i], - u = t[i + f], - r ? ct(f, r, u, e) : u(e); - n._subscribers.length = 0 - } - } - function ct(t, i, r, f) { - var s = v(r), - e = void 0, - h = void 0, - o = !0; - if (s) { - try { - e = r(f) - } catch (v) { - o = !1; - h = v - } - if (i === e) return void n(i, new TypeError('A promises callback cannot return that same promise.')) - } else e = f; - void 0 !== i._state || (s && o ? a(i, e) : !1 === o ? n(i, h) : 1 === t ? u(i, e) : 2 === t && n(i, e)) - } - function lt(n) { - n[l] = tt++; - n._state = void 0; - n._result = void 0; - n._subscribers = [ - ] - } - var it = Array.isArray ? Array.isArray : function (n) { - return '[object Array]' === Object.prototype.toString.call(n) - }, - h = 0, - rt = void 0, - y = void 0, - f = function (n, t) { - e[h] = n; - e[h + 1] = t; - 2 === (h += 2) && (y ? y(o) : c()) - }, - ut = 'undefined' != typeof window ? window : void 0, - ft = ut || { - }, - et = ft.MutationObserver || ft.WebKitMutationObserver, - vt = 'undefined' == typeof self && void 0 !== t && '[object process]' === { - }.toString.call(t), - yt = 'undefined' != typeof Uint8ClampedArray && 'undefined' != typeof importScripts && 'undefined' != typeof MessageChannel, - e = new Array(1000), - ot, - w, - st, - b, - c = void 0, - l, - tt, - at, - r; - return vt ? c = function () { - return t.nextTick(o) - } - : et ? (w = 0, st = new et(o), b = document.createTextNode(''), st.observe(b, { - characterData: !0 - }), c = function () { - b.data = w = ++w % 2 - }) : yt ? ((ot = new MessageChannel).port1.onmessage = o, c = function () { - return ot.port2.postMessage(0) - }) : c = void 0 === ut ? function () { - try { - var n = Function('return this') ().require('vertx'); - return void 0 !== (rt = n.runOnLoop || n.runOnContext) ? function () { - rt(o) - } - : p() - } catch (n) { - return p() - } - }() : p(), - l = Math.random().toString(36).substring(2), - tt = 0, - at = function () { - function t(t, i) { - this._instanceConstructor = t; - this.promise = new t(s); - this.promise[l] || lt(this.promise); - it(i) ? (this.length = i.length, this._remaining = i.length, this._result = new Array(this.length), 0 === this.length ? u(this.promise, this._result) : (this.length = this.length || 0, this._enumerate(i), 0 === this._remaining && u(this.promise, this._result))) : n(this.promise, new Error('Array Methods must be provided an Array')) - } - return t.prototype._enumerate = function (n) { - for (var t = 0; void 0 === this._state && t < n.length; t++) this._eachEntry(n[t], t) - }, - t.prototype._eachEntry = function (t, i) { - var u = this._instanceConstructor, - o = u.resolve, - e; - if (o === d) { - var f = void 0, - h = void 0, - c = !1; - try { - f = t.then - } catch (t) { - c = !0; - h = t - } - f === k && void 0 !== t._state ? this._settledAt(t._state, i, t._result) : 'function' != typeof f ? (this._remaining--, this._result[i] = t) : u === r ? (e = new u(s), c ? n(e, h) : ht(e, t, f), this._willSettleAt(e, i)) : this._willSettleAt(new u(function (n) { - return n(t) - }), i) - } else this._willSettleAt(o(t), i) - }, - t.prototype._settledAt = function (t, i, r) { - var f = this.promise; - void 0 === f._state && (this._remaining--, 2 === t ? n(f, r) : this._result[i] = r); - 0 === this._remaining && u(f, this._result) - }, - t.prototype._willSettleAt = function (n, t) { - var i = this; - g(n, void 0, function (n) { - return i._settledAt(1, t, n) - }, function (n) { - return i._settledAt(2, t, n) - }) - }, - t - }(), - r = function () { - function t(i) { - this[l] = tt++; - this._result = this._state = void 0; - this._subscribers = [ - ]; - s !== i && ('function' != typeof i && function () { - throw new TypeError('You must pass a resolver function as the first argument to the promise constructor'); - }(), this instanceof t ? function (t, i) { - try { - i(function (n) { - a(t, n) - }, function (i) { - n(t, i) - }) - } catch (i) { - n(t, i) - } - }(this, i) : function () { - throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.'); - }()) - } - return t.prototype.catch = function (n) { - return this.then(null, n) - }, - t.prototype.finally = function (n) { - var t = this.constructor; - return v(n) ? this.then(function (i) { - return t.resolve(n()).then(function () { - return i - }) - }, function (i) { - return t.resolve(n()).then(function () { - throw i; - }) - }) : this.then(n, n) - }, - t - }(), - r.prototype.then = k, - r.all = function (n) { - return new at(this, n).promise - }, - r.race = function (n) { - var t = this; - return it(n) ? new t(function (i, r) { - for (var f = n.length, u = 0; u < f; u++) t.resolve(n[u]).then(i, r) - }) : new t(function (n, t) { - return t(new TypeError('You must pass an array to race.')) - }) - }, - r.resolve = d, - r.reject = function (t) { - var i = new this(s); - return n(i, t), - i - }, - r._setScheduler = function (n) { - y = n - }, - r._setAsap = function (n) { - f = n - }, - r._asap = f, - r.polyfill = function () { - var n = void 0, - t, - u; - if (void 0 !== i) n = i; - else if ('undefined' != typeof self) n = self; - else try { - n = Function('return this') () - } catch (n) { - throw new Error('polyfill failed because global object is unavailable in this environment'); - } - if (t = n.Promise, t) { - u = null; - try { - u = Object.prototype.toString.call(t.resolve()) - } catch (n) { - } - if ('[object Promise]' === u && !t.cast) return - } - n.Promise = r - }, - r.Promise = r, - r - }; - n.exports = r() - }).call(this, i(13), i(14)) -}, -function (n, t) { - 'use strict'; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.Injectable = t.JsInject = void 0; - var i = function () { - function n() { - var n = this; - this.container = { - }; - this.container.$$jsInject = function () { - return n - } - } - var t; - return n.prototype.get = function (n, t) { - var i = this.container[n]; - if (i) return 'object' == typeof i ? i : i(t || 0); - throw 'Service does not exist.'; - }, - n.prototype.invoke = function (n, t, i, r) { - var u = 0, - e = [ - ], - f = r || 0; - if (f > 20) throw 'Maximum recursion at ' + f; - for (; u < t.length; u += 1) e.push(this.get(t[u], f + 1)); - return n.apply(i, e) - }, - n.prototype.register = function (n, t) { - var r, - u = this, - i; - if (r = t, '[object Array]' !== Object.prototype.toString.call(r)) throw 'Must pass array.'; - if (this.container[n]) throw 'Already registered.'; - if ('function' != typeof t[t.length - 1]) throw 'Must pass function to invoke.'; - if ('function' == typeof t[0] && 'object' == typeof t[0]()) return t[t.length - 1].prototype, - i = t[0](), - this.container[n] = i, - i; - this.container[n] = function (i) { - var r, - f, - e, - h = i || 0, - o = function () { - }, - s = t[t.length - 1], - c = 1 === t.length ? t[0].$$deps || [ - ] : t.slice(0, t.length - 1); - return o.prototype = s.prototype, - f = new o, - e = u.invoke(s, c, f, h + 1), - r = e || f, - u.container[n] = function () { - return r - }, - r - } - }, - Object.defineProperty(n, 'ServiceLocator', { - get: function () { - return this._JsInjectInstance.getInstance() - }, - enumerable: !1, - configurable: !0 - }), - n._JsInjectInstance = { - getInstance: function () { - return t || (t = new n), - t - } - }, - n - }(); - t.JsInject = i; - t.Injectable = function (n) { - return function (t) { - if (n.dependence || (n.dependence = [ - ]), !n.name) throw 'L\'objet ' + t.name + ' n\'a pas le param�tre \'name\' dans son d�corateur \'@Injectable\''; - n.dependence.push(t); - i.ServiceLocator.container[n.name] || i.ServiceLocator.register(n.name, n.dependence) - } - } -}, -function (n, t, i) { - 'use strict'; - (function (n) { - var o = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - s = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }, - e; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.jsWPAD335_Recherche = void 0; - var h = i(6), - u = i(3), - c = i(15), - l = i(16), - a = i(4), - v = i(17), - r = 'CPR', - f = function () { - function t() { - if (this.APIDeferredChargement = $.Deferred(), this.MagasinsDeferredChargement = $.Deferred(), this.MagasinsCharges = !1, this.MagasinsEnCoursChargement = !1, this.lstPictos = [ - ], this.RedirigerPasserelle = function (n, t) { - window.WCTD601.Cookie.SetCookie({ - cle: 'clsWPAD042:RecherchePasserelle', - value: 'pr=' + t, - path: '/', - domain: null, - duree: 365, - escape: !1 - }); - window.location.href = n + '&drive=' + t - }, this.EnregistrerCodePostalRecherche = function (n) { - sessionStorage.setItem(r, n) - }, this.SupprimerCodePostalRecherche = function () { - sessionStorage.getItem(r) && sessionStorage.removeItem(r) - }, this.VerifierNavigateurGeoloc = function () { - return l.WCTD204.VerifierNavigateurGeoloc() - }, null != window.Utilitaires.Ressources.ascWPAD335_Recherche) { - this.DivMap = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_DIV_MAP; - this.DivResultatVilles = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_DIV_RESULTAT_VILLES; - this.DivResultatPointsRetrait = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_DIV_RESULTAT_POINTS_RETRAIT; - this.TxtRecherche = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_TXT_RECHERCHE; - this.TxtRechercheSecours = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_TXT_RECHERCHE_SECOURS; - this.UrlAPIGoogleMaps = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_URL_API; - this.UrlApiWoosmap = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_URL_API_WOOSMAP; - this.UrlLIBGoogleMaps = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_URL_LIB; - this.ApiKeyWoosmap = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_API_KEY_WOOSMAP; - this.DelaiAffichageAutocompletion = parseInt(window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_DELAI_AFFICHAGE_AUTOCOMPLETION); - this.DureeTimeoutConnexionApi = parseInt(window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_DUREE_TIMEOUT_CONNEXION_API); - this.MsgZeroResultat = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_ZERO_RESULTAT; - this.MsgErreurGeoloc = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_ERREUR_GEOLOC; - this.MsgOuvertureProchaine = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_OUVERTURE_PROCHAINE; - this.MsgNouveau = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_NOUVEAU; - this.MsgGeolocZeroResultat = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_GEOLOC_ZERO_RESULTAT; - this.MsgGeolocUnResultat = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_GEOLOC_UN_RESULTAT; - this.MsgGeolocNResultats = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_GEOLOC_N_RESULTATS; - this.MsgRechercheZeroResultat = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_RECHERCHE_ZERO_RESULTAT; - this.MsgRechercheUnResultat = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_RECHERCHE_UN_RESULTAT; - this.MsgRechercheNResultats = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_RECHERCHE_N_RESULTATS; - this.MsgRechercheVide = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_RECHERCHE_VIDE; - this.MsgUniversTraiteur = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_UNIVERS_TRAITEUR; - this.MsgUniversDrive = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_UNIVERS_DRIVE; - this.MsgRetraitUniversTraiteur = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_RETRAIT_UNIVERS_TRAITEUR; - this.MsgRetraitUniversDrive = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_RETRAIT_UNIVERS_DRIVE; - this.MsgAdresseHorsZoneLAD = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_ADRESSE_HORS_ZONE; - this.MsgAdresseProchaineZoneLAD = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_ADRESSE_PROCHAINE_ZONE; - this.MsgAdresseHorsZoneLADCP = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_ADRESSE_HORS_ZONE_CP; - this.MsgAdresseProchaineZoneLADCP = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_ADRESSE_PROCHAINE_ZONE_CP; - this.MsgErreurSaisie = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_ERREUR_SAISIE; - this.MsgBandeauDriveVersLAD = window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_DRIVE_VERS_LAD; - this.UrlAccueil = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_URL_ACCUEIL; - this.UrlHandlerContexte = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_URL_HANDLER_MISE_A_JOUR_CONTEXTE; - this.UrlAccueilLAD = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_URL_ACCUEIL_LAD; - this.Univers = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_UNIVERS; - this.Marque = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_MARQUE; - this.Perimetre = parseFloat(window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_PERIMETRE); - this.Pays = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_PAYS; - this.CodePays = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_CODE_PAYS; - this.TypeAutocompletion = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_TYPE_AUTOCOMPLETE; - var n = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_GOOGLE_ACTIF, - t = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_WOOSMAP_ACTIF; - this.GoogleMapsActif = 'O' == n || 'true' == n.toLowerCase(); - this.WoosmapActif = 'O' == t || 'true' == t.toLowerCase(); - this.AfficherDistance = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_DISTANCE; - this.NbMagasinsResultat = parseInt(window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_NB_RESULTATS); - this.UrlWebApirRecupererPR = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_URL_WEBAPI_RECUP_PR; - this.MapLatitudeInitiale = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_MAP_LATITUDE; - this.MapLongitudeInitiale = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_MAP_LONGITUDE; - this.MapZoomMinimum = parseInt(window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_MAP_ZOOM_MIN); - this.MapZoomMaximum = parseInt(window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_MAP_ZOOM_MAX); - this.EncartChezMoiActif = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_ENCART_CHEZ_MOI_ACTIF; - this.EncartChezMoiLatitude = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_ENCART_CHEZ_MOI_LATITUDE; - this.EncartChezMoiLongitude = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_ENCART_CHEZ_MOI_LONGITUDE; - this.EncartChezMoiZoom = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_ENCART_CHEZ_MOI_ZOOM; - this.EncartChezMoiZonesLimitrophes = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_ENCART_CHEZ_MOI_ZONES_LIMITROPHES; - this.lstPictos = JSON.parse(window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_PICTOS); - this.UrlPasserelle = window.Utilitaires.Ressources.ascWPAD335_Recherche.PARAM_URL_PASSERELLE - } - } - return Object.defineProperty(t.prototype, 'LstPointsRetraitRecherche', { - get: function () { - return this._LstPointsRetraitRecherche - }, - set: function (n) { - this._LstPointsRetraitRecherche = n - }, - enumerable: !1, - configurable: !0 - }), - t.prototype.listePointRetraitMatch = function (n, t, i) { - var r = this, - f = [ - ]; - return $.isEmptyObject(t) || $.each(t, function (t, e) { - e && e.lstMotsCles && $.each(e.lstMotsCles, function (t, o) { - if (r.Comparer2chaines(o, i) && - 1 === r.VerifierUnicite(n, o) && - 1 === f.findIndex(function (n) { - return n.Description === o - })) { - var s = new u.InformationResultatRecherche(e.rLatitude, e.rLongitude, o, 'pointRetrait', null, null, null, null, e.sCodePostal, r.CodePays); - f.push(s) - } - }) - }), - f.sort(function (n, t) { - return n.Description < t.Description ? - 1 : t.Description > n.Description ? 1 : 0 - }).slice(0, 3) - }, - t.prototype.LogInfo = function (n, t) { - window.Utl.Log.logInfo(n + ' - ' + t) - }, - t.prototype.LogWarn = function (n, t) { - window.Utl.Log.logWarn(n + ' - ' + t) - }, - t.prototype.construireResultatRecherche = function (n, t, i) { - var r = [ - ], - f; - return (n.sort(function (n, t) { - return n.Description > t.Description ? 1 : - 1 - }), r = n.concat(t), $.isEmptyObject(r)) && (f = new u.InformationResultatRecherche(null, null, i, 'inconnu', null, null, null, null, null, this.CodePays), r.push(f)), - r - }, - t.prototype.InitialiserModeSecoursAvecLog = function (n, t) { - null != n && null != t && this.LogWarn(n, t); - this.InitialiserModeSecours() - }, - t.prototype.InitialiserModeSecours = function () { - var n = c.CustomEventPolyfill('ModeSecours', null); - document.dispatchEvent(n) - }, - t.prototype.VerifierCPEtAfficherPR = function (n, t, i, r, u) { - return o(this, void 0, void 0, function () { - var f, - o, - e, - a, - v, - y, - p, - w, - b, - k, - d, - g, - nt, - c, - l = this; - return s(this, function (s) { - switch (s.label) { - case 0: - return s.trys.push([0, - 2, - , - 3]), - n.CodePays = this.CodePays, - [ - 4, - h.VerifierZonesLivraison(n, u) - ]; - case 1: - return f = s.sent(), - [ - 3, - 3 - ]; - case 2: - return o = s.sent(), - 'SILENCIEUX' != t ? (o && o.codePostal && o.ville && $(this.TxtRecherche).val(o.codePostal + ' ' + o.ville), window.WPAD337.MasquerGoogleMaps(), [ - 2, - this.AfficherMessage(this.MsgAdresseHorsZoneLADCP, 'msgErreur') - ]) : 'function' == typeof eval(r) ? (c = eval(r), [ - 2, - c() - ]) : [ - 3, - 3 - ]; - case 3: - if ($(this.TxtRecherche).val(f.codePostal + ' ' + f.ville), 'O' != f.etatSite) return [3, - 8]; - e = this.traiterAddresseLivraisonCookie(f); - a = e.no; - v = e.rue; - y = e.lat; - p = e.lon; - w = e.adr; - b = e.cp; - k = e.ville; - d = e.pays; - s.label = 4; - case 4: - return s.trys.push([4, - 6, - , - 7]), - [ - 4, - this.MemoriserAdresseLivraison(a, v, k, b, d, y, p, w, '') - ]; - case 5: - return s.sent(), - [ - 3, - 7 - ]; - case 6: - return g = s.sent(), - this.LogWarn('jsWPAD335_Recherche', 'impossible de Memoriser l\'adressede livraison dans le cookie: ' + g), - [ - 3, - 7 - ]; - case 7: - return nt = window.WPAD338.ConstruirePointsRetrait('SELECTION_MULTI_SERVICES', null, null, null, null, f.noPL, null, f.codePostal), - nt.done(function (n, t) { - var r, - u; - for (l.LstPointsRetraitRecherche = Array(), r = 0; r < t.length; r++) 1 != t[r].eService && l.LstPointsRetraitRecherche.push(t[r].sNoPR); - ($(l.DivResultatPointsRetrait).html(n), 'function' == typeof eval(i)) && (u = eval(i), u(f)) - }), - [ - 3, - 9 - ]; - case 8: - 'I' == f.etatSite && ('SILENCIEUX' != t ? (window.WPAD335.AfficherMessage(this.MsgAdresseProchaineZoneLADCP, 'msgProchainement'), window.WPAD376.AfficherOuverturePrivee(f.codePostal, f.univers, f.noPL)) : 'function' == typeof eval(r) && (c = eval(r), c())); - s.label = 9; - case 9: - return [2] - } - }) - }) - }, - t.prototype.traiterAddresseLivraisonCookie = function (n) { - var t = this.RecupererAdresseLivraison(), - r = '', - u = '', - i = '', - f = '', - e = '', - o = '', - s = '', - h = ''; - return t && ('no' in t && (r = t.no), 'rue' in t && (u = t.rue), 'cp' in t && (i = t.cp), 'ville' in t && (f = t.ville), 'pays' in t && (e = t.pays), 'lat' in t && (o = t.lat), 'lon' in t && (s = t.lon), 'adr' in t && (h = t.adr)), - n.codePostal != i && (r = '', u = '', i = n.codePostal, f = n.ville, e = n.pays, o = n.latitude, s = n.longitude, h = n.adresse), - { - no: r, - rue: u, - lat: o, - lon: s, - adr: h, - cp: i, - ville: f, - pays: e - } - }, - t.prototype.AfficherPointsRetrait = function (n, t, i, r) { - var e; - this.LstPointsRetraitRecherche = [ - ]; - $(this.DivResultatVilles).hide(); - $(this.DivResultatVilles).empty(); - $(this.DivResultatPointsRetrait).show(); - $(this.DivResultatPointsRetrait).empty(); - var o = this.CalculerDistancePointsRetrait(n, t, i), - u = this.magasinProche(o, n), - s = u.resultatHTML, - f = u.nbResultats; - return this.LstPointsRetraitRecherche = u.lstPointsRetraitRecherche, - e = this.titreAffichage(r, f, void 0), - this.doisAfficherBandeau(r, t, i, !1, e, s, f), - this.LstPointsRetraitRecherche - }, - t.prototype.AfficherPointsRetraitSuite = function (n, t, i, r) { - r && (t = $(t).append($('
  • ').append($('').attr('class', 'aWPAD313_BandeauLad').attr('href', this.UrlAccueilLAD).html('' + this.MsgBandeauDriveVersLAD + '')))); - $(this.DivResultatPointsRetrait).append($('
    ').append($('
    ').append(n.titre))).html(); - $(this.DivResultatPointsRetrait).append($('
    ').append(t)).html(); - 0 != i && ('iDRIVE' == this.Univers && 'iCHEZMOI' != this.Marque ? $('#btnWPAD313_MapLAD').removeClass('masquer') : $('#btnWPAD313_Map').removeClass('masquer')) - }, - t.prototype.MemoriserAdresseLivraison = function (t, i, r, u, f, e, o, s, h) { - var c = this, - l = { - sTypeContexte: 'ContexteAdresse', - sNumeroRue: t, - sRue: i, - sVille: r, - sCodePostal: u, - sPays: f, - sLatitude: e, - sLongitude: o, - sAdresse: s, - sLocationType: h - }; - return new n(function (n, t) { - window.Utilitaires.Ajax.appeler({ - config: { - type: window.Utilitaires.Constantes.Ajax.Type.iHANDLER, - method: window.Utilitaires.Constantes.Ajax.Methode.iPOST, - url: c.UrlHandlerContexte, - xhrFields: { - withCredentials: !0 - }, - data: l, - dataType: 'json' - } - }).done(function () { - n() - }).fail(function () { - t() - }) - }) - }, - t.prototype.RecupererAdresseLivraison = function () { - var r, - n = window.WCTD601.Cookie.GetCookie('clsWCSD190:Lad'), - u, - t, - i; - if (n) for (n = decodeURIComponent(escape(n)), r = Object(), u = n.split('&'), t = 0; t < u.length; t++) i = u[t].split('='), - i && (r[i[0]] = i[1].replace(/\+/g, ' ')); - return r - }, - t.prototype.AfficherFicheMagasin = function (n, t) { - a.WPAD329.AfficherFicheMagasin(n, t, !1, !1) - }, - t.prototype.AfficherMessage = function (n, t) { - var i; - $(this.DivResultatVilles).empty(); - $(this.DivResultatVilles).show(); - i = t ? '
    ' : '
    '; - $(this.DivResultatVilles).append($('
    ').append($(i).html(n))) - }, - t.prototype.MasquerMessage = function () { - $(this.DivResultatVilles + ' dt').remove() - }, - t.prototype.AfficherLoader = function () { - $(this.TxtRecherche).addClass('loading') - }, - t.prototype.MasquerLoader = function () { - $(this.TxtRecherche).removeClass('loading') - }, - t.prototype.CalculerDistancePointsRetrait = function (n, t, i) { - var u = this, - r = [ - ]; - return n.forEach(function (n, f) { - var h = f, - c = n.rLatitude, - l = n.rLongitude, - e = n.sEtatSite, - a = n.fSitePrive, - o, - s; - 'O' != e && 'I' != e || a || (o = u.CalculerDistanceGPS(t, i, c, l), s = { - noPointRetrait: h, - distance: parseFloat(o.toFixed(2)) - }, r.push(s)) - }), - r - }, - t.prototype.VerifierUnicite = function (n, t) { - return n.forEach(function (n, i) { - if (n.Description == t) return i - }), - - 1 - }, - t.prototype.Comparer2chaines = function (n, t) { - return t = t || '', - 0 == (n = n || '').toLowerCase().indexOf(t.toLowerCase()) - }, - t.prototype.CalculerDistanceGPS = function (n, t, i, r) { - var f = this.ToRad(i - n), - e = this.ToRad(r - t), - u; - return n = this.ToRad(n), - i = this.ToRad(i), - u = Math.sin(f / 2) * Math.sin(f / 2) + Math.sin(e / 2) * Math.sin(e / 2) * Math.cos(n) * Math.cos(i), - 12742 * Math.atan2(Math.sqrt(u), Math.sqrt(1 - u)) - }, - t.prototype.CalculerPointMilieuGPS = function (n, t, i, r) { - var e = this.ToRad(r - t); - n = this.ToRad(n); - i = this.ToRad(i); - t = this.ToRad(t); - var u = Math.cos(i) * Math.cos(e), - f = Math.cos(i) * Math.sin(e), - o = Math.atan2(Math.sin(n) + Math.sin(i), Math.sqrt((Math.cos(n) + u) * (Math.cos(n) + u) + f * f)), - s = t + Math.atan2(f, Math.cos(n) + u); - return new google.maps.LatLng(this.ToDeg(o), this.ToDeg(s)) - }, - t.prototype.ToRad = function (n) { - return n * Math.PI / 180 - }, - t.prototype.ToDeg = function (n) { - return n * (180 / Math.PI) - }, - t.prototype.ConstruireDDLPointsRetrait = function (n, t, i, r) { - var e = this, - u = Array(), - f, - o; - null != r && (f = Object(), f.sTexte = r, f.sValeur = '', f.fSelected = !0, u.push(f)); - n.forEach(function (n) { - if (('1' == n.eTypePR || '5' == n.eTypePR) && 'F' != n.sEtatSite && 'N' != n.sEtatSite && !n.fSitePrive) { - var i = n.sNomPL, - r = n.sCodePostal, - f = n.sNoPL, - e = n.sNoPR, - t = Object(); - t.sTexte = '' + r + ' - ' + i; - t.sValeur = f + '|' + e; - u.push(t) - } - }); - u = u.sort(function (n, t) { - return n.sTexte < t.sTexte ? - 1 : n.sTexte > t.sTexte ? 1 : 0 - }); - o = window.WCTD201.Class.DropDownList.Construire({ - data: u, - iLargeur: i - }); - $(t).html(o); - window.WCTD601.View.RaiseUpdate(); - $(t + ' .selWCTD240_DDList').change(function (n) { - var t = $(n.currentTarget).find(':selected').val().toString(), - i, - r; - '' != t && (i = t.split('|'), r = $(n.currentTarget).find(':selected').text().split(' - ') [0], e.SupprimerCodePostalRecherche(), e.EnregistrerCodePostalRecherche(r), window.WPAD338.AfficherPointsRetrait('SELECTION', null, null, null, null, i[0], null)) - }) - }, - t.prototype.sort_by = function (n, t, i) { - var r = i ? function (t) { - return i(t[n]) - } - : function (t) { - return t[n] - }, - u = t ? - 1 : 1; - return function (n, t) { - var i = n > t ? 1 : 0, - f = n < t ? 1 : 0; - return n = r(n), - t = r(t), - u * (i - f) - } - }, - t.prototype.doisAfficherBandeau = function (n, t, i, r, u, f, e) { - this.AfficherPointsRetraitSuite(u, f, e, r) - }, - t.prototype.titreAffichage = function (n, t, i) { - var r; - if ('geolocalisation' == n) switch (t) { - case 0: - r = this.MsgGeolocZeroResultat; - break; - case 1: - r = this.MsgGeolocUnResultat; - break; - default: - r = this.MsgGeolocNResultats - } else switch (t) { - case 0: - r = (i = this.MsgRechercheZeroResultat).replace('#1', n); - break; - case 1: - r = (i = this.MsgRechercheUnResultat).replace('#1', n); - break; - default: - r = (i = this.MsgRechercheNResultats).replace('#1', n) - } - return { - titre: r, - str: i - } - }, - t.prototype.magasinProche = function (n, t) { - var c = 0, - l = [ - ], - a, - u, - r, - s, - i, - o; - if ((n = n.sort(function (n, t) { - return n.distance - t.distance - })).length > 0) for (a = n.length > this.NbMagasinsResultat ? this.NbMagasinsResultat - 1 : n.length, u = document.createElement('ul'), r = 0; r < a; r++) if (s = n[r].distance, s <= this.Perimetre) { - if (c++, i = n[r].noPointRetrait, 'iDRIVE' != this.Univers || 'iCHEZMOI' == this.Marque) { - var h, - v = t[i].sNoPL, - y = t[i].sCodePostal, - p = t[i].sNomPR, - w = t[i].sEtatSite, - b = t[i].fNouveauSite, - k = (t[i].eUnivers, t[i].eTypePR), - f = '', - e = ''; - 'I' == w ? (f = this.MsgOuvertureProchaine, e = 'etat-ouverture') : 'O' == b && (f = this.MsgNouveau, e = 'etat-nouveau'); - h = this.AfficherDistance ? p + ' - ' + s + ' km' : p; - o = ''; - o = 2 == k ? this.MsgRetraitUniversTraiteur : this.MsgRetraitUniversDrive; - void 0 !== window.WPAD001 ? $(u).append($('
  • ').append($('').attr('href', 'javascript:void(0);').attr('onclick', 'WPAD335.AfficherFicheMagasin(\'' + v + '\',\'' + i + '\')').append($('').addClass('univers').append(o)).append($('').append(y)).append(h).append($('').addClass('etat').addClass(e).append(f)))) : void 0 !== window.WPAD040 && $(u).append($('
  • ').append($('').attr('href', 'javascript:void(0);').attr('onclick', 'WPAD335.RedirigerPasserelle(\'' + this.UrlPasserelle + '\',\'' + v + '\')').append($('').addClass('univers').append(o)).append($('').append(y)).append(h).append($('').addClass('etat').addClass(e).append(f)))) - } - l.push(i) - } - return { - resultatHTML: u, - nbResultats: c, - lstPointsRetraitRecherche: l - } - }, - t.DataTrackPush = function (n, t) { - var i = n + ' | ' + t; - v.WTRK306.EnvoyerEvenementManuel({ - evenementCategorie: 'Drive', - evenementAction: 'Recherche Portail', - evenementLibelle: i - }) - }, - t - }(); - t.jsWPAD335_Recherche = f; - e = new f; - window.WPAD335 = e - }).call(this, i(0).Promise) -}, -function (n, t) { - 'use strict'; - var i, - r, - u; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.TypeLieu = t.AdresseGeocodage = t.ResultatGeocodage = t.InformationResultatRecherche = void 0; - i = function (n, t, i, r, u, f, e, o, s, h) { - this.latitude = n; - this.longitude = t; - this.Description = i; - this.TypeRecherche = r; - this.TypeResultat = u; - this.PlaceId = f; - this.Ville = e; - this.Arrondissement = o; - this.CodePostal = s; - this.CodePays = h - }; - t.InformationResultatRecherche = i; - r = function () { - this.LstAdresse = [ - ]; - this.LstCodePostalLieu = [ - ] - }; - t.ResultatGeocodage = r; - u = function () { - }; - t.AdresseGeocodage = u, - function (n) { - n.APPROXIMATE = 'APPROXIMATE'; - n.GEOMETRIC_CENTER = 'GEOMETRIC_CENTER'; - n.RANGE_INTERPOLATED = 'RANGE_INTERPOLATED'; - n.ROOFTOP = 'ROOFTOP' - }(t.TypeLieu || (t.TypeLieu = { - })) -}, -function (n, t, i) { - 'use strict'; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.WPAD329 = void 0; - var u = i(7), - f = i(8), - r = i(9); - $(document).ready(function () { - window.Utilitaires.Pubsub.on('Auth.Connexion', function (n) { - t.WPAD329.AbonnementConnecter(n) - }); - window.Utilitaires.Pubsub.on('Auth.Deconnexion', function (n) { - t.WPAD329.AbonnementDeconnecter(n) - }) - }); - t.WPAD329 = { - noPointLivraison: void 0, - AbonnementConnecter: function () { - null != t.WPAD329.noPointLivraison && t.WPAD329.AfficherFicheMagasin(t.WPAD329.noPointLivraison, null, !1, !1) - }, - AbonnementDeconnecter: function () { - null != t.WPAD329.noPointLivraison && t.WPAD329.AfficherFicheMagasin(t.WPAD329.noPointLivraison, null, !1, !1) - }, - AfficherFicheMagasin: function (n, i, e, o) { - if (null == n) r.WPAD001.modalNavigate('close', !1); - else { - window.Utl.Loader.afficher(); - var s = 'FICHE'; - o && (s = 'FICHE_SELECTION'); - window.WPAD338.ConstruirePointsRetrait(s, null, null, null, null, n, i, null).done(function (n, i) { - $('#divWPAD329_Magasin').html(n); - i.length > 0 && (u.WPAD327.MettreAJourConnexionInscription(i[0].sUrlInscription, i[0].sUrlConnexion, i[0].sEtatSite, i.fConnecte, i.fEstMobile), f.WPAD334.MettreAJourBandeau(i[0].sNomPR, i[0].sUrlSiteCourses, i[0].sUrlSiteAccueil, i[0].sEtatSite, i.fConnecte, e), t.WPAD329.MettreAJourAideEnLigne(i[0].eMarque, i[0].sNomPL, i[0].sUrlAideEnLigne)); - var o = 'divModalMagasin&' + i[0].sNoPL; - r.WPAD001.modalNavigate(o, !0); - window.Utl.Loader.masquer() - }).fail(function () { - }) - } - }, - MettreAJourAideEnLigne: function (n, t, i) { - 1 == n ? ($('#spanNomMagasin').html(t), $('[id$=btnAccederAeL]').on('click', function () { - return window.open(encodeURI(i), '', 'width=870,height=750,toolbars=no,scrollbars=yes,status=no,resizable=yes'), - !1 - }), $('#divAideEnLigne').show()) : $('#divAideEnLigne').hide() - } - }; - t.WPAD329 = t.WPAD329 || { - }; - window.WPAD329 = t.WPAD329 -}, -function (n) { - n.exports = jQuery -}, -function (n, t, i) { - 'use strict'; - (function (n) { - function o(n, t) { - return u(this, void 0, void 0, function () { - var u, - i; - return f(this, function () { - return u = $.Deferred(), - i = new r, - n.forEach(function (n, r) { - var o = r, - s = n.sNoPL, - h = n.eUnivers, - f = n.sEtatSite, - c = n.fSitePrive, - e = n.lstZonesLivraison, - l; - null != e && ('O' == f || 'I' == f) && (l = function (n) { - var t = [ - ]; - return $.each(n, function (n, i) { - i.fExclus && t.push(i.sCodePostal) - }), - t - }(e), e.forEach(function (n) { - if (!n.fExclus && (null == n.sCodePostal && t.startsWith(n.sCodeDepartement) && l.indexOf(t) < 0 || n.sCodePostal == t)) return i.noPL = s, - i.noPR = o, - i.univers = h, - i.etatSite = f, - i.sitePrive = c, - !1 - })); - u.resolve(i) - }), - [ - 2, - u.promise() - ] - }) - }) - } - var u = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - f = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }, - e, - r; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.ZoneLivraison = t.VerifierZonesLivraison = t.VerifierZonesLivraisonCodePostal = void 0; - e = i(1); - t.VerifierZonesLivraisonCodePostal = o; - t.VerifierZonesLivraison = function (t, i) { - return u(this, void 0, void 0, function () { - return f(this, function () { - return [2, - new n(function (n, r) { - e.JsInject.ServiceLocator.get('RecherchePositionController').GeocodageCodePostal(t).then(function (u) { - var f, - e, - c = u.Ville, - s = u.LstCodePostalLieu[0], - h; - (e = '', s && ('' != e && (e += ' - '), e += s), c && ('' != e && (e += ' '), e += c), null == s) && (h = /[0-9]{5}/, t.Description.match(h) && t.Description.match(h) [0] && (s = t.Description.match(h) [0])); - o(i, s).then(function (i) { - (f = i).ville = c; - f.codePostal = s; - f.pays = u.CodePays; - f.adresse = e; - f.latitude = t.latitude && t.latitude.toString() || ''; - f.longitude = t.longitude && t.longitude.toString() || ''; - f.locationType = u.TypeLieu; - f.noPR ? n(f) : r(new Error('Erreur lors de la verification de la zone de livraiso, pas de pr')) - }) - }).catch(function (n) { - r(new Error('Erreur lors de la verification de la zone de livraison' + n)) - }) - })] - }) - }) - }; - r = function () { - }; - t.ZoneLivraison = r - }).call(this, i(0).Promise) -}, -function (n, t) { - var i = i || { - }; - t = t || { - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - $(document).ready(function () { - Utilitaires.Pubsub.on('Auth.Connexion', function (n) { - i.AbonnementConnecter(n) - }); - Utilitaires.Pubsub.on('Auth.Deconnexion', function (n) { - i.AbonnementDeconnecter(n) - }) - }); - i = { - AbonnementConnecter: function () { - $('[id$=_sectionWPAD327_ConnexionInscription]').addClass('masquer') - }, - AbonnementDeconnecter: function () { - $('[id$=_sectionWPAD327_ConnexionInscription]').removeClass('masquer') - }, - MettreAJourConnexionInscription: function (n, t, i, r, u) { - 'O' != i || r ? $('[id$=_sectionWPAD327_ConnexionInscription]').addClass('masquer') : $('[id$=_sectionWPAD327_ConnexionInscription]').removeClass('masquer'); - $('[id$=_aWPAD327_InscrivezVous]').attr('href', n); - u ? $('[id$=_aWPAD327_SeConnecter]').attr('href', t) : $('[id$=_aWPAD327_SeConnecter]').click(function (n) { - n.preventDefault(); - n.stopPropagation(); - $('html, body').animate({ - scrollTop: 0 - }, 300).promise().then(function () { - $('.aWPAD346_NonConnecte').click(); - $('.aWPAD354_NonConnecte').click() - }) - }) - } - }; - 'undefined' != typeof Sys && Sys.Application.notifyScriptLoaded(); - t.WPAD327 = i -}, -function (n, t) { - var i = i || { - }; - t = t || { - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - $(document).ready(function () { - i.AffichageSticky(); - Utilitaires.Pubsub.on('Auth.Connexion', function (n) { - i.AbonnementConnecter(n) - }); - Utilitaires.Pubsub.on('Auth.Deconnexion', function (n) { - i.AbonnementDeconnecter(n) - }) - }); - i = { - Etat: void 0, - LOC_ENTRER: void 0, - LOC_CHOISIR: void 0, - LOC_CONNECTE: void 0, - LOC_LECLERC_TITRE: void 0, - AbonnementConnecter: function () { - $('[id$=_aWPAD334_AccesDrive]').removeClass('masquer'); - $('[id$=_spanWPAD334_Titre1]').html(i.LOC_LECLERC_TITRE); - $('[id$=_spanWPAD334_Titre1]').removeClass('spanWPAD334_Titre1'); - $('[id$=_spanWPAD334_Titre2]').html(''); - $('[id$=_spanWPAD334_AccesDrive]').html(i.LOC_ENTRER); - 'O' != i.Etat && $('[id$=_aWPAD334_AccesDrive]').addClass('masquer') - }, - AbonnementDeconnecter: function () { - $('[id$=_aWPAD334_AccesDrive]').removeClass('masquer'); - $('[id$=_spanWPAD334_Titre1]').html(i.LOC_LECLERC_TITRE); - $('[id$=_spanWPAD334_Titre1]').removeClass('spanWPAD334_Titre1'); - $('[id$=_spanWPAD334_Titre2]').html(''); - $('[id$=_spanWPAD334_AccesDrive]').html(i.LOC_CHOISIR); - 'O' != i.Etat && $('[id$=_aWPAD334_AccesDrive]').addClass('masquer') - }, - MettreAJourBandeau: function (n, t, r, u, f, e) { - if (null != Utilitaires.Ressources.ascWPAD334_BandeauMagasin) { - switch (Utilitaires.Ressources.ascWPAD334_BandeauMagasin.PARAM_MARQUE_UNIVERS) { - case 'iTRAITEUR': - i.LOC_ENTRER = Utilitaires.Ressources.ascWPAD334_BandeauMagasin.LOC_ENTRER_TRAITEUR; - i.LOC_CHOISIR = Utilitaires.Ressources.ascWPAD334_BandeauMagasin.LOC_CHOISIR_TRAITEUR; - i.LOC_CONNECTE = Utilitaires.Ressources.ascWPAD334_BandeauMagasin.LOC_CONNECTE_TRAITEUR; - i.LOC_LECLERC_TITRE = Utilitaires.Ressources.ascWPAD334_BandeauMagasin.LOC_LECLERC_TITRE_TRAITEUR; - break; - default: - i.LOC_ENTRER = Utilitaires.Ressources.ascWPAD334_BandeauMagasin.LOC_ENTRER_DRIVE; - i.LOC_CHOISIR = Utilitaires.Ressources.ascWPAD334_BandeauMagasin.LOC_CHOISIR_DRIVE; - i.LOC_CONNECTE = Utilitaires.Ressources.ascWPAD334_BandeauMagasin.LOC_CONNECTE_DRIVE; - i.LOC_LECLERC_TITRE = Utilitaires.Ressources.ascWPAD334_BandeauMagasin.LOC_LECLERC_TITRE_DRIVE - } - $('[id$=_spanWPAD334_NomDrive]').html(n); - $('[id$=_aWPAD334_AccesDrive]').attr('href', t); - null != $.WCTD204_QueryString.sProvenance && 'SM' == $.WCTD204_QueryString.sProvenance ? ($('.aWPAD334_Retour').attr('href', t), $('.aWPAD334_Retour').off()) : $.WCTD204_QueryString.desktopversion || (document.URL.contains('divModalRecherche') ? $('.aWPAD334_Retour').attr('href', 'javascript:void(0)') : ($('.aWPAD334_Retour').attr('href', r + '/?sRedirect=false'), $('.aWPAD334_Retour').off())); - i.Etat = u; - f ? (i.AbonnementConnecter(), e && ($('[id$=_spanWPAD334_Titre1]').html(i.LOC_CONNECTE), $('[id$=_spanWPAD334_Titre1]').addClass('spanWPAD334_Titre1'), $('[id$=_spanWPAD334_Titre2]').html(n))) : i.AbonnementDeconnecter() - } - }, - AffichageSticky: function () { - $('.divModalMagasin').hasClass('modal-active') && $('.divModalMagasin').scrollTop() >= 100 ? $('.headerWPAD334_Sticky').css({ - position: '-webkit-sticky', - position: 'sticky', - top: '0px', - display: 'table' - }) : $('.headerWPAD334_Sticky').hide(); - $('.divModalMagasin').off('scroll').on('scroll', function () { - $('.divModalMagasin').hasClass('modal-active') && $('.divModalMagasin').scrollTop() >= 100 ? $('.headerWPAD334_Sticky').css({ - position: '-webkit-sticky', - position: 'sticky', - top: '0px', - display: 'table' - }) : $('.headerWPAD334_Sticky').hide() - }); - $('body').off('modale-open').on('modale-open', function () { - i.AffichageSticky() - }) - } - }; - 'undefined' != typeof Sys && Sys.Application.notifyScriptLoaded(); - t.WPAD334 = i -}, -function (n, t) { - var i = i || { - }, - t = t || { - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - $(document).ready(function () { - $('[data-modal]').on('click', function (n) { - i.stopEvent(n); - var t = !0; - null != $(this).data('history') && 0 != $(this).data('history') || (t = !1); - i.modalNavigate($(this).data('modal'), t, $(this).data('modalcallback')) - }); - $(window).on('popstate', function () { - var n = '' !== window.location.hash.slice(2) ? window.location.hash.slice(2) : 'close'; - i.modalNavigate(n, !1) - }); - $(window).on('load', function () { - var r = window.location.hash.slice(2), - t, - n; - if (r) { - t = r.split('&'); - n = n || { - }; - switch (t[0]) { - case 'divModalMagasin': - 'function' == typeof n.AfficherFicheMagasin && function (n, t) { - n[1] && i.modalNavigate(n[0], !1, t(n[1])) - }(t, n.AfficherFicheMagasin) - } - } - }) - }); - i = { - zIndex: 50, - windowScrolltop: 0, - modaleActive: [ - ], - modalNavigate: function (n, t, r) { - var o = n.split('&'), - u = o[0], - s = o[1], - f, - h, - c, - l, - e; - /[_=&]/.test(u) || (f = $('.' + u), h = 'close' !== u ? '#_' + u : '#_', 'back' === u ? history.back() : (t && (e = h + (s ? '&' + s : ''), history.pushState(null, null, e)), 'close' !== u ? f.length && ((f.addClass('modal-active').css('z-index', i.zIndex), $('.hdWCSD347_Bandeau ~ #sectionWCRS001_MainContent').css('z-index', 30), i.modaleActive.push(f), i.zIndex++, 'function' == typeof eval(r)) && (c = eval(r), c()), $('body').trigger('modale-open'), setTimeout(function () { - i.windowScrolltop = $(window).scrollTop(); - $('form > *:not(.modal-active)').hide(); - $('form > .modal-active').show() - }, 400)) : Utilitaires.Ressources.clsWPAD041_MasterBase && null != Utilitaires.Ressources.clsWPAD041_MasterBase.PARAM_URL_REDIRECTION_PAGE_APPELANTE ? history.back() : (i.modaleActive[i.modaleActive.length - 1] && (i.modaleActive[i.modaleActive.length - 1].removeClass('modal-active'), $('.hdWCSD347_Bandeau ~ #sectionWCRS001_MainContent').css('z-index', 10), i.modaleActive[i.modaleActive.length - 2]) && (l = i.modaleActive[i.modaleActive.length - 2].selector.replace('.', ''), e = document.URL.replace('/#_', '/#_' + l), history.pushState({ - }, '', e)), i.modaleActive.pop(), $('body').removeClass('modal-opened'), $('form > *').show(), $(window).scrollTop(i.windowScrolltop)))) - }, - RetourHautDePage: function () { - (i.modaleActive.length > 0 ? i.modaleActive[i.modaleActive.length - 1] : $('html, body')).stop().animate({ - scrollTop: 0 - }, 500) - }, - FermerModales: function () { - i.modalNavigate('close'); - i.ScrollerHautRecherche() - }, - ScrollerHautRecherche: function () { - $('html,body').stop().animate({ - scrollTop: $('.sectionRecherche').offset().top - 20 - }, 300) - }, - stopEvent: function (n) { - n.preventDefault(); - n.stopPropagation() - } - }; - 'undefined' != typeof Sys && Sys.Application.notifyScriptLoaded(); - t.WPAD001 = i -}, -function (n, t, i) { - 'use strict'; - (function (n) { - var f = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - e = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }, - s = this && this.__importDefault || function (n) { - return n && n.__esModule ? n : { - 'default': n - } - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.jsWPAD337_RechercheCarte = void 0; - var r = s(i(5)), - h = i(2), - u = i(1), - o = i(3), - c = function () { - function n() { - var n = this, - t; - this.LstMarkers = [ - ]; - this.LstPointsCarte = [ - ]; - this.LstMarkersRecherche = [ - ]; - this.LstMarkersSpec = [ - ]; - this.objRecherche = new h.jsWPAD335_Recherche; - this.flightPathList = [ - ]; - this.AfficherCarte = function (t) { - return f(n, void 0, void 0, function () { - var n, - i, - r, - u; - return e(this, function (f) { - switch (f.label) { - case 0: - return f.trys.push([0, - 3, - , - 4]), - [ - 4, - this.GoogleMapService.APIMap() - ]; - case 1: - return n = f.sent(), - [ - 4, - this.PointRetraitController.GetPointsRetrait(!0) - ]; - case 2: - if (i = f.sent(), this.GoogleMapService.fMapEstInit || (this.pInitialiserCarte(n, i), this.GoogleMapService.fMapEstInit = !0), r = this, !('inconnu' == t.TypeRecherche || t.latitude && t.longitude)) throw new Error('Il manque longitude ou latitude sur le clic d\'une region'); - return r.pAfficherCarteSuite(n, i, t), - [ - 2, - n - ]; - case 3: - return u = f.sent(), - this.objRecherche.InitialiserModeSecoursAvecLog('AfficherCarte', 'Erreur lors de l\'affichage de la carte: ' + u), - [ - 3, - 4 - ]; - case 4: - return [2] - } - }) - }) - }; - this.pAfficherCarteSuite = function (t, i, r) { - var f, - u = !0, - e = n, - o, - s; - 'region' == r.TypeRecherche ? (u = !1, f = 7, o = new google.maps.LatLng(r.latitude, r.longitude), e.pPositionner(t, o, 7, u, !1, null, null)) : (s = new google.maps.LatLng(r.latitude, r.longitude), e.pPositionner(t, s, f, u, !0, null, null)) - }; - this.pCreerMarkerSpecifique = function (t, i) { - var u, - f, - r, - e; - switch (u = n.pCreerImageMarkerSpecifique(n.objRecherche.lstPictos[i].sUrl, n.objRecherche.lstPictos[i].iLargeur, n.objRecherche.lstPictos[i].iHauteur), f = new google.maps.LatLng(n.objRecherche.EncartChezMoiLatitude, n.objRecherche.EncartChezMoiLongitude), (r = new google.maps.Marker({ - position: f, - icon: u, - zIndex: 101, - optimized: !0 - })).setMap(t), i) { - case 'laddrive': - r.setMap(t); - r.addListener('click', function () { - window.location.href = n.objRecherche.UrlAccueilLAD - }); - e = r; - google.maps.event.addListener(t, 'zoom_changed', function () { - var n = t.getZoom(); - e.setVisible(n >= window.WPAD337.googleMapOption.markerParisZoom) - }) - } - return r - }; - this.pPositionner = function (t, i, r, u, f) { - var e, - o; - (n.pAfficherGoogleMaps(t), t.bounds_changed = function () { - if ('iCHEZMOI' != n.objRecherche.Marque) { - for (var r, u = 0, i = 0; i < n.LstMarkers.length; i++) null != t && t.getBounds().contains(n.LstMarkers[i].getPosition()) && (u++, r = n.LstMarkers[i]); - 1 == u && 'iDRIVE' != n.objRecherche.Marque && google.maps.event.trigger(r, 'click') - } - n.ScrollerHauteCarte(); - t.bounds_changed = null - }, n.pResetMarkers(n.LstMarkersRecherche), n.pResetMarkers(n.LstMarkersSpec), u) && (e = n.pCreerMarker(t, null, i), n.LstMarkersRecherche.push(e)); - 'iDRIVE' == n.objRecherche.Univers && 'iCHEZMOI' != n.objRecherche.Marque && 'O' == n.objRecherche.EncartChezMoiActif && (o = n.pCreerMarkerSpecifique(t, 'laddrive'), n.LstMarkersSpec.push(o)); - f ? n.pZoomAutomatique(t, i) : n.pZooFixe(t, r, i) - }; - jQuery('.imgWPAD337_Carte') [0] && r.default('.imgWPAD337_Carte').maphilight({ - fade: !1, - fillColor: 'f18e00' - }); - t = this; - null != window.Utilitaires.Ressources.ascWPAD337_RechercheCarte && (window.Utilitaires.Ressources.ascWPAD337_RechercheCarte.PARAM_CARTE_STATIQUE.bool() || r.default('.divWPAD337_Carte area, .divWPAD337_Carte img[class*=imgWPAD337_PictoMagasin]').click(function (n) { - var i, - u, - f; - n.stopImmediatePropagation(); - i = ''; - (i = r.default(n.currentTarget).attr('id') ? r.default(n.currentTarget).attr('id') : r.default(n.currentTarget).attr('alt'), t.RecherchePositionController.ApiMapActif()) ? (u = JSON.parse(window.Utilitaires.Ressources.ascWPAD337_RechercheCarte.PARAM_REGIONS), f = new o.InformationResultatRecherche(u[i].nrLatitudeGPS, u[i].nrLongitudeGPS, u[i].sLibelleRegion, 'region', null, null, null, null, null, null), t.AfficherCarte(f)) : t.objRecherche.InitialiserModeSecours() - })) - } - return Object.defineProperty(n.prototype, 'RecherchePositionController', { - get: function () { - return u.JsInject.ServiceLocator.get('RecherchePositionController') - }, - enumerable: !1, - configurable: !0 - }), - Object.defineProperty(n.prototype, 'GoogleMapService', { - get: function () { - return u.JsInject.ServiceLocator.get('GoogleMapService') - }, - enumerable: !1, - configurable: !0 - }), - Object.defineProperty(n.prototype, 'PointRetraitController', { - get: function () { - return u.JsInject.ServiceLocator.get('PointRetraitController') - }, - enumerable: !1, - configurable: !0 - }), - n.prototype.ScrollerHauteCarte = function () { - r.default('.divWPAD336_RechercheTraiteur').length > 0 ? r.default('html,body').stop().animate({ - scrollTop: r.default('.divWPAD337_RechercheCarte').offset().top - 190 - }, 300) : r.default('.divWPAD337_RechercheCarte').length > 0 && r.default('html,body').stop().animate({ - scrollTop: r.default('.divWPAD337_RechercheCarte').offset().top - 220 - }, 300) - }, - n.prototype.MasquerGoogleMaps = function () { - r.default('.divWPAD337_Map').addClass('masquer'); - r.default('.divWPAD337_RechercheCarte').removeClass('active'); - 'iCHEZMOI' == this.objRecherche.Marque ? r.default('.divWPAD337_RechercheCarte').parent().removeClass('open') : r.default('.divWPAD337_Carte').removeClass('masquer'); - window.Utilitaires.Pubsub.trigger('Maps.Masquage') - }, - Object.defineProperty(n.prototype, 'DivCarteName', { - get: function () { - return 'divWPAD337_Carte' - }, - enumerable: !1, - configurable: !0 - }), - Object.defineProperty(n.prototype, 'DivCarteClass', { - get: function () { - return '.' + this.DivCarteName - }, - enumerable: !1, - configurable: !0 - }), - n.prototype.pInitialiserCarte = function (n, t) { - var i, - u, - r, - f, - e, - o; - window.WPAD337.googleMapOption = { - minDistanceZoom: 1000, - facteur: 1, - nombreDePoints: 10, - distanceMaximum: 30000, - markerParisZoom: 10, - offset: 2500, - debug: !1 - }; - this.LstMarkers = [ - ]; - i = this.pConstruireListPointsCarte(t); - i.iIdPointCarte; - i.pointCarte; - i.pointRetrait; - i.lstPointsRetrait; - for (u in this.LstPointsCarte) { - r = void 0; - try { - r = this.pCreerMarker(n, this.LstPointsCarte[u], null) - } catch (n) { - throw new Error('Marker impossible à créer: ' + n); - } - r && this.LstMarkers.push(r) - } - f = new google.maps.LatLng(this.objRecherche.MapLatitudeInitiale, this.objRecherche.MapLongitudeInitiale); - e = { - zoom: this.objRecherche.MapZoomMinimum, - center: f, - zoomControlOptions: { - style: google.maps.ZoomControlStyle.LARGE, - position: google.maps.ControlPosition.LEFT_CENTER - }, - zoomControl: !0, - mapTypeControl: !1, - scaleControl: !1, - streetViewControl: !0, - rotateControl: !1, - fullscreenControl: !1, - mapTypeId: google.maps.MapTypeId.ROADMAP, - minDistanceZoom: this.objRecherche.MapZoomMinimum, - maxZoom: this.objRecherche.MapZoomMaximum - }; - n.setOptions(e); - o = this; - google.maps.event.addListener(n, 'zoom_changed', function () { - o.pCalculerMarkers(n) - }) - }, - n.prototype.pConstruireListPointsCarte = function (n) { - var u, - r, - i, - f = [ - ]; - for (var t in n) 'F' == n[t].sEtatSite || 'N' == n[t].sEtatSite || 1 == n[t].eService || n[t].fSitePrive || (u = n[t].iIdPointCarte, (r = Object()).iIdPointCarte = n[t].iIdPointCarte, r.rLatitude = n[t].rLatitude, r.rLongitude = n[t].rLongitude, (i = Object()).sNoPointRetrait = t, i.sNom = n[t].sNomPL, i.sNomPR = n[t].sNomPR, i.sCodePostal = n[t].sCodePostal, i.eTypePR = n[t].eTypePR, i.eService = n[t].eService, i.sNoPointLivraison = n[t].sNoPL, i.sEtatSite = n[t].sEtatSite, i.fNouveauSite = n[t].fNouveauSite, i.fSitePrive = n[t].fSitePrive, i.iIdUnivers = n[t].eUnivers, null == this.LstPointsCarte[u] ? ((f = Array()).push(i), r.lstPointsRetrait = f, this.LstPointsCarte[u] = r) : this.LstPointsCarte[u].lstPointsRetrait.push(i)); - return { - iIdPointCarte: u, - pointCarte: r, - pointRetrait: i, - lstPointsRetrait: f - } - }, - n.prototype.pCreerMarker = function (n, t, i) { - var e, - r, - f, - u, - l = this, - o, - s, - c, - h; - switch (this.objRecherche.Marque) { - case 'iCHEZMOI': - u = '3'; - break; - default: - u = '1' - } - if (null != i) r = 'position', - 'iCHEZMOI' == this.objRecherche.Marque || (e = this.pCreerImageMarker(this.objRecherche.lstPictos[r + u].sUrl, this.objRecherche.lstPictos[r + u].iLargeur, this.objRecherche.lstPictos[r + u].iHauteur, this.objRecherche.lstPictos[r + u].iOffset), (f = new google.maps.Marker({ - position: i, - icon: e, - zIndex: 0, - optimized: !0 - })).setMap(n)); - else { - for (o = !0, s = 0; s < t.lstPointsRetrait.length; s++) o = o && t.lstPointsRetrait[s].fNouveauSite; - r = o ? 'nouveau' : 'ouvert'; - 1 == t.lstPointsRetrait.length && 'I' == t.lstPointsRetrait[0].sEtatSite && (r = 'preinscription'); - e = this.pCreerImageMarker(this.objRecherche.lstPictos[r + u].sUrl, this.objRecherche.lstPictos[r + u].iLargeur, this.objRecherche.lstPictos[r + u].iHauteur, this.objRecherche.lstPictos[r + u].iOffset); - c = new google.maps.LatLng(parseFloat(t.rLatitude), parseFloat(t.rLongitude)); - h = ''; - switch (t.lstPointsRetrait[0].eTypePR) { - case 3: - h = 'E.Leclerc Relais ' + t.lstPointsRetrait[0].sNomPR + ' (' + t.lstPointsRetrait[0].sCodePostal + ')'; - break; - default: - h = t.lstPointsRetrait[0].sNomPR + ' (' + t.lstPointsRetrait[0].sCodePostal + ')' - }(f = new google.maps.Marker({ - position: c, - icon: e, - title: h, - zIndex: 101, - optimized: !1 - })).iIdPointCarte = t.iIdPointCarte; - 'iCHEZMOI' == this.objRecherche.Marque ? f.addListener('click', function () { - l.pCentrerPointRetrait(n, t.lstPointsRetrait[0].sCodePostal, parseFloat(t.rLatitude), parseFloat(t.rLongitude)) - }) : f.addListener('click', function () { - window.WPAD338.AfficherPointsRetrait('SELECTION', null, null, t.iIdPointCarte, null, null, null) - }) - } - return f - }, - n.prototype.pCentrerPointRetrait = function (n, t, i, r) { - var u = this; - this.PointRetraitController.GetPointsRetrait(!0).then(function (f) { - var s = new o.InformationResultatRecherche(i, r, t, null, null, null, null, null, t, null), - e; - u.objRecherche.VerifierCPEtAfficherPR(s, 'SILENCIEUX', window.WPAD369.AfficherBandeauLAD, null, f); - e = new google.maps.LatLng(i, r); - n.setCenter(e); - n.setZoom(18) - }) - }, - n.prototype.pCreerImageMarker = function (n, t, i, r) { - return { - url: n, - scaledSize: new google.maps.Size(t, i), - size: new google.maps.Size(parseInt(t), parseInt(i)), - anchor: new google.maps.Point(parseInt(t) / 2 - parseInt(r), parseInt(i)) - } - }, - n.prototype.pCreerImageMarkerSpecifique = function (n, t, i) { - return { - url: n, - scaledSize: new google.maps.Size(t, i), - size: new google.maps.Size(parseInt(t), parseInt(i)), - anchor: new google.maps.Point(parseInt(t) / 2, parseInt(i) / 2) - } - }, - n.prototype.pCalculerMarkers = function (n) { - var i = this, - r, - u, - t; - for (this.Clusters && this.Clusters.clearMarkers(), r = [ - { - url: this.objRecherche.lstPictos.cluster1.sUrl, - height: this.objRecherche.lstPictos.cluster1.iHauteur, - width: this.objRecherche.lstPictos.cluster1.iLargeur, - textColor: '#fff', - textSize: 10, - fontFamily: 'Arial', - fontWeight: 'True', - anchor: [ - 4, - 28 - ], - zindex: 9999 - }, - { - url: this.objRecherche.lstPictos.cluster1.sUrl, - height: this.objRecherche.lstPictos.cluster1.iHauteur, - width: this.objRecherche.lstPictos.cluster1.iLargeur, - textColor: '#fff', - textSize: 10, - fontFamily: 'Arial', - fontWeight: 'True', - anchor: [ - 4, - 24 - ], - zindex: 9999 - } - ], this.Clusters = new window.MarkerClusterer(n, this.LstMarkers, { - maxZoom: 10, - gridSize: 20, - styles: r, - averageCenter: !0 - }), google.maps.event.addListener(this.Clusters, 'clusterclick', function (t) { - i.DernierClusterClique = t; - i.pAfficherCluster(t.getMarkers(), n) - }), u = n.getZoom(), t = 0; t < this.LstMarkersSpec.length; t++) this.LstMarkersSpec[t].setVisible(u > this.objRecherche.EncartChezMoiZoom) - }, - n.prototype.pZooFixe = function (n, t, i) { - n.setCenter(i); - n.setZoom(t); - this.ScrollerHauteCarte() - }, - n.prototype.pZoomAutomatique = function (n, t) { - var i = { - }, - r; - this.cercle && this.cercle.setMap(null); - r = this.pTrouverLesPointsProche(n, t, window.WPAD337.googleMapOption.facteur, window.WPAD337.googleMapOption.offset, window.WPAD337.googleMapOption.nombreDePoints, window.WPAD337.googleMapOption.distanceMaximum); - null != (i = this.pConstruireCercle(r, t, n, i)) ? (window.WPAD337.googleMapOption.debug && (i.strokeColor = '#FFFFFF', i.strokeOpacity = 1, i.strokeWeight = 2, i.fillOpacity = 0, i.visible = !0), i.radius = i.radius < window.WPAD337.googleMapOption.minDistanceZoom ? window.WPAD337.googleMapOption.minDistanceZoom : i.radius + i.radius, n.fitBounds(i.getBounds()), this.cercle = i) : (n.setCenter(t), n.setZoom(this.objRecherche.MapZoomMaximum)) - }, - n.prototype.pConstruireCercle = function (n, t, i) { - var r, - u; - return n.length > 1 ? (n.unshift(t), this.pCalculCercleMultiPoints(i, n)) : 1 == n.length ? (r = n[0], r.distance < window.WPAD337.googleMapOption.distanceMaximum) ? this.pCalculCercleUnPoint(i, t, r) : (console.warn('Impossible de trouver les points proches'), u = { - center: t, - fillOpacity: 0, - strokeOpacity: 0, - map: i, - radius: window.WPAD337.googleMapOption.distanceMaximum - }, new google.maps.Circle(u)) : void 0 - }, - n.prototype.pResetMarkers = function (n) { - null != n && n.forEach(function (n) { - n && n.setMap(null) - }); - n = [ - ] - }, - n.prototype.pTrouverLesPointsProche = function (n, t, i, r, u, f) { - var e = this.LstMarkers.map(function (n) { - return { - lat: n.getPosition().lat, - lng: n.getPosition().lng, - distance: google.maps.geometry.spherical.computeDistanceBetween(t, n.getPosition()) - } - }).sort(function (n, t) { - return n.distance - t.distance - }).slice(0, u), - l = e[0], - a = e.filter(function (n) { - return n.distance < f - }), - o, - h, - p, - c; - if (0 === a.length) return [l]; - var s = (e = a).map(function (n) { - return n.distance - }), - v = s.length, - w = s.reduce(function (n, t) { - return n + t - }) / v, - b = Math.sqrt(s.map(function (n) { - return Math.pow(n - w, 2) - }).reduce(function (n, t) { - return n + t - }) / v), - y = l.distance + (b + r) * i, - k = e.filter(function (n) { - return n.distance <= y - }); - if (window.WPAD337.googleMapOption.debug) { - o = { - center: t, - fillOpacity: 0, - strokeOpacity: 0, - map: n, - radius: y - }; - for (h in this.flightPathList && this.flightPathList.forEach(function (n) { - return n.setMap(null) - }), this.flightPathList = [ - ], e) p = [ - new google.maps.LatLng(e[h].lat(), e[h].lng()), - t - ], - c = new google.maps.Polyline({ - path: p, - geodesic: !0, - strokeColor: '#FF0000', - strokeOpacity: 1, - strokeWeight: 2 - }), - c.setMap(n), - this.flightPathList.push(c); - o.fillColor = 'red'; - o.fillOpacity = 0.2; - o.visible = !0; - this.circleDebug && this.circleDebug.setMap(null); - this.circleDebug = new google.maps.Circle(o); - this.circleDebug.setMap(n) - } - return k - }, - n.prototype.pCalculCercleMultiPoints = function (n, t) { - var r = this, - u = t.reduce(function (n, t, i, r) { - return n + t.lat() / r.length - }, 0), - f = t.reduce(function (n, t, i, r) { - return n + t.lng() / r.length - }, 0), - i = new google.maps.LatLng(u, f), - e = t.map(function (n) { - return r.objRecherche.CalculerDistanceGPS(i.lat(), i.lng(), n.lat(), n.lng()) - }).sort(function (n, t) { - return t - n - }) [0] / 2, - o = { - center: i, - fillOpacity: 0, - strokeOpacity: 0, - map: n, - radius: 1000 * e - }; - return new google.maps.Circle(o) - }, - n.prototype.pCalculCercleUnPoint = function (n, t, i) { - var r = this.objRecherche.CalculerPointMilieuGPS(t.lat(), t.lng(), i.lat(), i.lng()), - u = this.objRecherche.CalculerDistanceGPS(r.lat(), r.lng(), i.lat(), i.lng()), - f = { - center: r, - fillOpacity: 0, - strokeOpacity: 0, - map: n, - radius: 1000 * u - }; - return new google.maps.Circle(f) - }, - n.prototype.pCalculerDistance = function (n) { - var t = this.pCalculerCoodGPSPointPlusProche(n), - i = new google.maps.LatLng(t.lat, t.lng); - return google.maps.geometry.spherical.computeDistanceBetween(n, i) / 1000 - }, - n.prototype.pCalculerCoodGPSPointPlusProche = function (n) { - for (var r, i, u = 1000000, f = n.lat(), e = n.lng(), t = 0; t < this.LstMarkers.length; t++) r = google.maps.geometry.spherical.computeDistanceBetween(n, this.LstMarkers[t].getPosition()), - r < u && (u = r, f = this.LstMarkers[t].getPosition().lat(), e = this.LstMarkers[t].getPosition().lng()); - return i = Object(), - i.lat = f, - i.lng = e, - i - }, - n.prototype.pAfficherCluster = function (n, t) { - var i, - s, - r, - u, - o, - l; - for (window.Utl.Loader.afficher(), i = '', s = !1, 'iTRAITEUR' == this.objRecherche.Univers ? i = this.objRecherche.MsgUniversTraiteur : 'iCHEZMOI' == this.objRecherche.Marque ? (s = !0, event.stopPropagation()) : i = this.objRecherche.MsgUniversDrive, r = Object(), u = 0; u < n.length; u++) { - var h, - f = Object(), - e = n[u].iIdPointCarte, - c = this.LstPointsCarte[e].lstPointsRetrait[0].sNoPointLivraison; - h = i + ' ' + this.LstPointsCarte[e].lstPointsRetrait[0].sNomPR + ' (' + this.LstPointsCarte[e].lstPointsRetrait[0].sCodePostal + ')'; - f.iIdPointCarte = e; - f.sTexte = h; - f.sNoPL = c; - r[c] = f - } - o = Array(); - for (l in r) o.push(r[l]); - 0 == s && 1 == o.length ? window.WPAD338.AfficherPointsRetrait('SELECTION', null, null, null, null, o[0].sNoPL, null) : (window.Utl.Loader.masquer(), this.pZoomerCluster(t)) - }, - n.prototype.pOuvrirPopinCluster = function (n) { - return window.WCTD201.Class.PopinManager.OuvrirPopin({ - conteneurType: window.WCTD201.Class.Scrollpane, - conteneur: { - fScrollOut: !0, - fSCrollMasquer: !1 - }, - fClient: !0, - popin: { - contenu: n, - sOnComplete: function () { - window.Utl.Loader.masquer() - } - }, - sNomPopin: 'popinPointRetrait' - }), - !1 - }, - n.prototype.ZoomerCluster = function () { - return f(this, void 0, void 0, function () { - var n; - return e(this, function (t) { - switch (t.label) { - case 0: - return [4, - this.GoogleMapService.APIMap()]; - case 1: - return n = t.sent(), - this.pZoomerCluster(n), - [ - 2 - ] - } - }) - }) - }, - n.prototype.pZoomerCluster = function (n) { - window.WCTD201.Class.PopinManager.FermerPopin(); - n.fitBounds(this.DernierClusterClique.getBounds()); - this.ScrollerHauteCarte() - }, - n.prototype.pAfficherGoogleMaps = function (n) { - r.default('.divWPAD337_Map').removeClass('masquer'); - r.default('.divWPAD337_RechercheCarte').addClass('active'); - 'iCHEZMOI' == this.objRecherche.Marque ? r.default('.divWPAD337_RechercheCarte').parent().addClass('open') : r.default('.divWPAD337_Carte').addClass('masquer'); - google.maps.event.trigger(n, 'resize'); - window.Utilitaires.Pubsub.trigger('Maps.Affichage') - }, - n.prototype.pStopEvent = function (n) { - n.preventDefault(); - n.stopPropagation() - }, - n - }(); - t.jsWPAD337_RechercheCarte = c - }).call(this, i(0).Promise) -}, -function (n, t, i) { - 'use strict'; - (function (n) { - var f = this && this.__decorate || function (n, t, i, r) { - var f, - e = arguments.length, - u = e < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r, - o; - if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) u = Reflect.decorate(n, t, i, r); - else for (o = n.length - 1; o >= 0; o--) (f = n[o]) && (u = (e < 3 ? f(u) : e > 3 ? f(t, i, u) : f(t, i)) || u); - return e > 3 && u && Object.defineProperty(t, i, u), - u - }, - r = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - u = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.PointRetraitService = void 0; - var e = i(21), - o = i(1), - s = function () { - function n() { - this._dicPointsRetraitLad = null - } - return Object.defineProperty(n.prototype, 'dicPointsRetraitLad', { - get: function () { - return this._dicPointsRetraitLad - }, - enumerable: !1, - configurable: !0 - }), - n.prototype.GetMotsCles = function (n) { - return r(this, void 0, void 0, function () { - return u(this, function (t) { - switch (t.label) { - case 0: - return $.isEmptyObject(this.LstMotsCles) ? [ - 4, - this.pFetchMagasinEtLstMotsCles(n) - ] : [ - 2, - this.LstMotsCles - ]; - case 1: - return t.sent(), - [ - 2, - this.LstMotsCles - ] - } - }) - }) - }, - n.prototype.GetMagasins = function (n) { - return r(this, void 0, void 0, function () { - return u(this, function (t) { - switch (t.label) { - case 0: - return this.LstMotsCles && this._LstPointsRetrait.length > 0 ? [ - 2, - this._LstPointsRetrait - ] : [ - 4, - this.pFetchMagasinEtLstMotsCles(n) - ]; - case 1: - return t.sent(), - this._dicPointsRetraitLad || (this._dicPointsRetraitLad = this.initPointDeRetraitLadParCodePostal(this._LstPointsRetrait)), - [ - 2, - this._LstPointsRetrait - ] - } - }) - }) - }, - n.prototype.pFetchMagasinEtLstMotsCles = function (n) { - return r(this, void 0, void 0, function () { - var t; - return u(this, function (i) { - switch (i.label) { - case 0: - return [4, - e.chargerMagasins(n)]; - case 1: - return t = i.sent(), - this._LstPointsRetrait = t.lstPointRetrait, - this._LstMotsCles = t.lstMotsCles, - this._dicPointsRetraitLad = t.dicPointsRetraitLad, - [ - 2, - t - ] - } - }) - }) - }, - Object.defineProperty(n.prototype, 'LstPointsRetrait', { - get: function () { - return this._LstPointsRetrait - }, - enumerable: !1, - configurable: !0 - }), - Object.defineProperty(n.prototype, 'LstMotsCles', { - get: function () { - return this._LstMotsCles - }, - enumerable: !1, - configurable: !0 - }), - n = f([o.Injectable({ - name: 'PointRetraitService', - dependence: [ - ] - })], n) - }(); - t.PointRetraitService = s - }).call(this, i(0).Promise) -}, -function (n) { - var t, - r, - i; - t = { - }; - r = 0; - i = function (n) { - var t = document.getElementsByTagName('script') [0]; - t.parentNode.insertBefore(n, t) - }; - n.exports = function (n, u, f) { - var o; - u && 'function' != typeof u && (f = u.context || f, o = u.setup, u = u.callback); - var s, - h, - e = document.createElement('script'), - a = !1, - c = function () { - a || (a = !0, h(), u && u.call(f, s)) - }, - l = function () { - s = new Error(n || 'EMPTY'); - c() - }; - if (!e.readyState || 'async' in e) h = function () { - e.onload = e.onerror = null - }, - e.onerror = l, - e.onload = c, - e.async = !0, - e.charset = 'utf-8', - o && o.call(f, e), - e.src = n, - i(e); - else { - var v = r++, - p = { - loaded: !0, - complete: !0 - }, - y = !1; - h = function () { - e.onreadystatechange = e.onerror = null; - t[v] = void 0 - }; - e.onreadystatechange = function () { - var n = e.readyState; - if (!s) { - if (!y && p[n] && (y = !0, i(e)), 'loaded' === n && (e.children, 'loading' === e.readyState)) return l(); - 'complete' === e.readyState && c() - } - }; - e.onerror = l; - t[v] = e; - o && o.call(f, e); - e.src = n - } - } -}, -function (n) { - function h() { - throw new Error('setTimeout has not been defined'); - } - function c() { - throw new Error('clearTimeout has not been defined'); - } - function l(n) { - if (i === setTimeout) return setTimeout(n, 0); - if ((i === h || !i) && setTimeout) return i = setTimeout, - setTimeout(n, 0); - try { - return i(n, 0) - } catch (t) { - try { - return i.call(null, n, 0) - } catch (t) { - return i.call(this, n, 0) - } - } - } - function y() { - o && e && (o = !1, e.length ? u = e.concat(u) : s = - 1, u.length && a()) - } - function a() { - var t, - n; - if (!o) { - for (t = l(y), o = !0, n = u.length; n; ) { - for (e = u, u = [ - ]; ++s < n; ) e && e[s].run(); - s = - 1; - n = u.length - } - e = null; - o = !1, - function (n) { - if (r === clearTimeout) return clearTimeout(n); - if ((r === c || !r) && clearTimeout) return r = clearTimeout, - clearTimeout(n); - try { - r(n) - } catch (t) { - try { - return r.call(null, n) - } catch (t) { - return r.call(this, n) - } - } - }(t) - } - } - function v(n, t) { - this.fun = n; - this.array = t - } - function f() { - } - var i, - r, - t = n.exports = { - }; - !function () { - try { - i = 'function' == typeof setTimeout ? setTimeout : h - } catch (n) { - i = h - } - try { - r = 'function' == typeof clearTimeout ? clearTimeout : c - } catch (n) { - r = c - } - }(); - var e, - u = [ - ], - o = !1, - s = - 1; - t.nextTick = function (n) { - var i = new Array(arguments.length - 1), - t; - if (arguments.length > 1) for (t = 1; t < arguments.length; t++) i[t - 1] = arguments[t]; - u.push(new v(n, i)); - 1 !== u.length || o || l(a) - }; - v.prototype.run = function () { - this.fun.apply(null, this.array) - }; - t.title = 'browser'; - t.browser = !0; - t.env = { - }; - t.argv = [ - ]; - t.version = ''; - t.versions = { - }; - t.on = f; - t.addListener = f; - t.once = f; - t.off = f; - t.removeListener = f; - t.removeAllListeners = f; - t.emit = f; - t.prependListener = f; - t.prependOnceListener = f; - t.listeners = function () { - return [] - }; - t.binding = function () { - throw new Error('process.binding is not supported'); - }; - t.cwd = function () { - return '/' - }; - t.chdir = function () { - throw new Error('process.chdir is not supported'); - }; - t.umask = function () { - return 0 - } -}, -function (n) { - var t = function () { - return this - }(); - try { - t = t || new Function('return this') () - } catch (n) { - 'object' == typeof window && (t = window) - } - n.exports = t -}, -function (n, t) { - 'use strict'; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.CustomEventPolyfill = void 0; - t.CustomEventPolyfill = function (n, t) { - t = t || { - bubbles: !1, - cancelable: !1, - detail: null - }; - var i = document.createEvent('CustomEvent'); - return i.initCustomEvent(n, t.bubbles, t.cancelable, t.detail), - i - } -}, -function (n, t) { - var i = i || { - }; - t = t || { - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.WCTD204 = void 0, - function (n) { - n.fn.WCTD204_Marquer = function () { - return this.not('.marquer').addClass('marquer') - }; - n.WCTD204_QueryString = function (n) { - var i, - r, - t; - if ('' == n) return { - }; - for (i = { - }, r = 0; r < n.length; ++r) if (t = n[r].split('='), 2 == t.length) try { - i[t[0]] = decodeURIComponent(t[1].replace(/\+/g, ' ')) - } catch (n) { - i[t[0]] = 'erreur' - } - return i - }(window.location.search.substr(1).split('&')); - n.fn.WCTD204_isOnScreen = function () { - if (this.length) { - var t = this.offset().top, - r = this.height(), - i = n(window).scrollTop(), - u = n(window).height(); - return t + r - i >= 0 && i + u - t >= 0 - } - return !1 - } - }(jQuery); - i = { - SetCookie: function (n) { - var t = '', - r = '', - u = '', - i; - (t = n.dateExpiration, null != n.duree) && (i = new Date, i.setDate(i.getDate() + n.duree), t = ' expires=' + i.toUTCString() + ';'); - null != n.path && (r = ' path=' + n.path + ';'); - null != n.domain && 'localhost' != n.domain && (u = ' domain=' + n.domain + ';'); - null == n.escape ? document.cookie = n.cle + '=' + escape(n.value) + ';' + t + r + u : 0 == n.escape && (document.cookie = n.cle + '=' + n.value + ';' + t + r + u) - }, - GetCookie: function (n) { - var t = document.cookie, - i = t.indexOf(' ' + n + '='), - r; - return ( - 1 == i && (i = t.indexOf(n + '=')), - 1 == i) ? t = null : (i = t.indexOf('=', i) + 1, r = t.indexOf(';', i), - 1 == r && (r = t.length), t = unescape(t.substring(i, r))), - t - }, - IdentifierNavigateur: function (n, t) { - var u, - f, - r, - e, - o = { - Edge: [ - /Edge\/(\S+)/ - ], - Chrome: [ - /Chrome\/(\S+)/ - ], - Firefox: [ - /Firefox\/(\S+)/ - ], - Android: [ - /Android (\d+)/ - ], - MSIE: [ - /MSIE (\S+);/, - /rv:(\S+)\)/ - ], - Opera: [ - /Opera\/.*?Version\/(\S+)/, - /Opera\/(\S+)/ - ], - Safari: [ - /Version\/(\S+).*?Safari\/(\S+)/ - ] - }, - i; - for (r in void 0 === n && (n = navigator.userAgent), void 0 === t ? t = 2 : 0 === t && (t = 1337), o) for (; u = o[r].shift(); ) if (f = n.match(u)) return e = f[1].match(new RegExp('[^.]+(?:.[^.]+){0,' + --t + '}')) [0], - i = Array(), - i.browser = r, - i.version = e, - i; - return null - }, - EstMobile: function () { - return !!(navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/webOS/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPad/i) || navigator.userAgent.match(/iPod/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/Windows Phone/i)) - }, - VerifierNavigateurGeoloc: function () { - return !0 - } - }; - String.prototype.contains = function (n) { - return - 1 != this.indexOf(n) - }; - String.prototype.replaceAll = function (n, t) { - return this.split(n).join(t) - }; - String.prototype.bool = function () { - return /^true$/i.test(this) - }; - Function.prototype.ToString = function () { - return this.toString() - }; - 'undefined' != typeof Sys && Sys.Application.notifyScriptLoaded(); - t.WCTD204 = i -}, -function (n, t) { - var i = i || { - }; - t = t || { - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.WTRK306 = void 0; - i = { - InjectionDataTrack: function (n, t) { - WTRK306_InjectionDataTrack(n, t) - }, - EnvoyerEvenementManuel: function (n) { - WTRK306_EnvoyerEvenementManuel(n) - } - }; - 'undefined' != typeof Sys && Sys.Application.notifyScriptLoaded(); - t.WTRK306 = i -}, -function (n, t, i) { - 'use strict'; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.InitInjectable = void 0; - var u = i(20), - r = i(11), - f = i(22), - e = i(23), - o = i(25), - s = i(27), - h = i(10), - c = i(28), - l = function () { - function n() { - n.PointRetraitService = n.PointRetraitService || new r.PointRetraitService; - n.RecherchePositionController = n.RecherchePositionController || new u.RecherchePositionController; - n.PointRetraitService = n.PointRetraitService || new r.PointRetraitService; - n.PointRetraitController = n.PointRetraitController || new f.PointRetraitController; - n.WoosmapController = n.WoosmapController || new e.WoosmapController; - n.WoosmapService = n.WoosmapService || new o.WoosmapService; - n.GoogleMapController = n.GoogleMapController || new s.GoogleMapController; - n.rechercheCarte = n.rechercheCarte || new h.jsWPAD337_RechercheCarte; - n.GoogleMapService = n.GoogleMapService || new c.GoogleMapService; - n.SetNamespaceMapping() - } - return n.SetNamespaceMapping = function () { - window.WPAD337 = n.rechercheCarte - }, - n - }(); - t.InitInjectable = l -}, -function (n, t, i) { - 'use strict'; - (function (n) { - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.deferedToPromise = t.MakeQuerablePromise = void 0; - t.MakeQuerablePromise = function (n) { - var i = n; - if (i.isResolved) return i; - var r = !0, - u = !1, - f = !1, - t = i.then(function (n) { - return f = !0, - r = !1, - n - }, function (n) { - throw u = !0, - r = !1, - n; - }); - return t.isFulfilled = function () { - return f - }, - t.isPending = function () { - return r - }, - t.isRejected = function () { - return u - }, - t - }; - t.deferedToPromise = function (t) { - return t.done ? new n(function (n, i) { - t.done(function (t) { - return n(t) - }); - t.fail(function (n) { - return i(n) - }) - }) : t - } - }).call(this, i(0).Promise) -}, -function (n, t, i) { - 'use strict'; - (function (n) { - var e = this && this.__decorate || function (n, t, i, r) { - var f, - e = arguments.length, - u = e < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r, - o; - if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) u = Reflect.decorate(n, t, i, r); - else for (o = n.length - 1; o >= 0; o--) (f = n[o]) && (u = (e < 3 ? f(u) : e > 3 ? f(t, i, u) : f(t, i)) || u); - return e > 3 && u && Object.defineProperty(t, i, u), - u - }, - r = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - u = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.RecherchePositionController = void 0; - var o = i(2), - s = i(1), - f = i(3), - h = function () { - function t(n, t, i) { - var f = this; - void 0 === n && (n = null); - void 0 === t && (t = null); - void 0 === i && (i = null); - this.objWoosmapController = n; - this.objGooglemapController = t; - this.objPointRetraitController = i; - this.objRecherche = new o.jsWPAD335_Recherche; - this.MasquerMessage = function () { - f.objRecherche.MasquerMessage() - }; - this.AfficherPointsRetrait = function (n) { - return r(f, void 0, void 0, function () { - var t; - return u(this, function (i) { - switch (i.label) { - case 0: - return this.AfficherLoader(!0), - [ - 4, - this.objPointRetraitController.GetPointsRetrait(this.ApiMapActif()) - ]; - case 1: - return t = i.sent(), - this.AfficherLoader(!1), - this.objPointRetraitController.LstPointsRetraitRecherche = this.objRecherche.AfficherPointsRetrait(t, n.latitude, n.longitude, n.Description), - [ - 2, - this.objPointRetraitController.LstPointsRetraitRecherche - ] - } - }) - }) - } - } - return Object.defineProperty(t.prototype, 'recherchePositionController', { - get: function () { - return null != this.objGooglemapController && 1 == this.objGooglemapController.apiMapActif() ? null != this.objWoosmapController && this.objWoosmapController.apiMapActif() ? this.objWoosmapController : this.objGooglemapController : (this.objRecherche.InitialiserModeSecours(), null) - }, - enumerable: !1, - configurable: !0 - }), - t.prototype.ChargerAPI = function () { - var n = this; - this.AfficherLoader(!0); - this.ApiMapActif() ? (null != this.objWoosmapController && this.objWoosmapController.apiMapActif() ? this.objWoosmapController.chargerAPI().catch(function (t) { - var i = 'Erreur lors du chargement de l\'API Woosmap: ' + t; - n.objRecherche.LogWarn('ChargerAPI Woosmap erreur', i); - n.ChargerAPIGoogleMaps() - }) : this.ChargerAPIGoogleMaps(), this.AfficherLoader(!1)) : (this.AfficherLoader(!1), this.objRecherche.InitialiserModeSecours()) - }, - t.prototype.ChargerAPIGoogleMaps = function () { - var t, - n = this; - return this.objGooglemapController.chargerAPI().catch(function (i) { - t = 'Erreur lors du chargement de l\'API Google Maps: ' + i; - n.objRecherche.LogWarn('ChargerAPI Google Maps erreur', t); - n.objWoosmapController = null; - n.objGooglemapController = null; - n.objRecherche.InitialiserModeSecours() - }) - }, - t.prototype.RechercherAutoCompletion = function (n, t) { - return r(this, void 0, void 0, function () { - var i, - r; - return u(this, function (u) { - switch (u.label) { - case 0: - if (!this.ApiMapActif()) return [3, - 5]; - u.label = 1; - case 1: - return u.trys.push([1, - 3, - , - 4]), - [ - 4, - this.recherchePositionController.rechercherAutoCompletion(n, t) - ]; - case 2: - return [2, - u.sent()]; - case 3: - return i = u.sent(), - r = 'Erreur lors de la recherche autocompletion: ' + i, - this.objRecherche.LogWarn('RechercherAutoCompletion', r), - [ - 3, - 4 - ]; - case 4: - return [3, - 6]; - case 5: - this.objRecherche.InitialiserModeSecours(); - u.label = 6; - case 6: - return [2] - } - }) - }) - }, - t.prototype.SelectionnerResultat = function (t) { - return r(this, void 0, void 0, function () { - var i = this; - return u(this, function () { - return [2, - new n(function (n, f) { - return r(i, void 0, void 0, function () { - var r, - e, - i; - return u(this, function (u) { - switch (u.label) { - case 0: - if (!this.ApiMapActif()) return [3, - 5]; - u.label = 1; - case 1: - return u.trys.push([1, - 3, - , - 4]), - this.objRecherche.SupprimerCodePostalRecherche(), - [ - 4, - this.recherchePositionController.selectionnerResultat(t) - ]; - case 2: - return null == (i = u.sent()).CodePostal && '' == i.CodePostal || this.objRecherche.EnregistrerCodePostalRecherche(i.CodePostal), - null == i || 'inconnu' == i.TypeRecherche ? ($(this.objRecherche.DivResultatVilles).hide(), this.objRecherche.AfficherMessage(this.objRecherche.MsgZeroResultat, 'msgErreur'), [ - 2, - n(null) - ]) : [ - 2, - n(i) - ]; - case 3: - return r = u.sent(), - e = 'Erreur lors de la selection du resultat: ' + r, - this.objRecherche.LogWarn('SelectionnerResultat', e), - [ - 2, - f([]) - ]; - case 4: - return [3, - 6]; - case 5: - return i = [ - ], - this.objRecherche.InitialiserModeSecours(), - [ - 2, - f(i) - ]; - case 6: - return [2] - } - }) - }) - })] - }) - }) - }, - t.prototype.GeocodageCodePostal = function (t) { - return r(this, void 0, void 0, function () { - var i = this; - return u(this, function () { - return [2, - new n(function (n) { - return r(i, void 0, void 0, function () { - var r, - f, - i; - return u(this, function (u) { - switch (u.label) { - case 0: - if (null == t.Description || null == t.latitude || null == t.longitude || null == t.CodePostal || null == t.Ville) return [3, - 1]; - try { - this.recherchePositionController.apiMapActif() && n(this.pRetournerPositionFormater(t)) - } catch (t) { - i = 'Impossible de faire la recherche Geocodage' + t; - this.objRecherche.LogWarn('GeocodageCodePostal 1er if', i); - n(null) - } - return [3, - 4]; - case 1: - return u.trys.push([1, - 3, - , - 4]), - this.recherchePositionController.apiMapActif() || this.objRecherche.InitialiserModeSecours(), - [ - 4, - this.recherchePositionController.geocodage(t) - ]; - case 2: - return r = u.sent(), - [ - 2, - n(r[0]) - ]; - case 3: - return f = u.sent(), - i = 'Impossible de faire la recherche Geocodage avec woosmap: ' + f, - this.objRecherche.LogWarn('GeocodageCodePostal 2nd if', i), - n(null), - [ - 3, - 4 - ]; - case 4: - return [2] - } - }) - }) - })] - }) - }) - }, - t.prototype.GeocodageInverseCodePostal = function (n, t) { - return r(this, void 0, void 0, function () { - return u(this, function (i) { - switch (i.label) { - case 0: - return [4, - this.objGooglemapController.geocodageInverseGetCodePostal(n, t)]; - case 1: - return [2, - i.sent()] - } - }) - }) - }, - t.prototype.ApiMapActif = function () { - return this.recherchePositionController && this.recherchePositionController.apiMapActif() - }, - t.prototype.AfficherLoader = function (n) { - n ? this.objRecherche.AfficherLoader() : this.objRecherche.MasquerLoader() - }, - t.prototype.pRetournerPositionFormater = function (n) { - var t = new f.ResultatGeocodage, - u = [ - ], - r = new f.AdresseGeocodage, - i; - return r.NomLong = n.Description, - r.NomCourt = n.CodePostal, - r.Types = [ - 'postal_code' - ], - u.push(r), - i = new f.AdresseGeocodage, - i.NomLong = n.Description, - i.NomCourt = n.Ville, - i.Types = [ - 'locality' - ], - u.push(i), - t.LstCodePostalLieu = [ - n.CodePostal - ], - t.Ville = n.Ville, - t.LstAdresse = u, - t.TypeLieu = f.TypeLieu.APPROXIMATE, - t.Latitude = n.latitude, - t.Longitude = n.longitude, - t - }, - t = e([s.Injectable({ - name: 'RecherchePositionController', - dependence: [ - 'WoosmapController', - 'GoogleMapController', - 'PointRetraitController' - ] - })], t) - }(); - t.RecherchePositionController = h - }).call(this, i(0).Promise) -}, -function (n, t, i) { - 'use strict'; - (function (n) { - var i = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - r = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.chargerMagasins = void 0; - t.chargerMagasins = function (t) { - return i(this, void 0, void 0, function () { - return r(this, function () { - return [2, - new n(function (n, i) { - null != t && function (n, t, i) { - window.Utilitaires.Ajax.appeler({ - config: { - type: window.Utilitaires.Constantes.Ajax.Type.iURL, - method: window.Utilitaires.Constantes.Ajax.Methode.iGET, - url: n, - dataType: 'json', - contentType: 'application/json; charset=utf-8' - } - }).done(function (n) { - var f; - if (null != n) { - for (var e = [ - ], o = { - }, u = JSON.parse(JSON.stringify(n)).sReponse, s = 1, r = 0; r < u.length; r++) u[r] && (e[Number(u[r].sNoPR)] = u[r]), - null != u[r].lstMotsCle && (f = Object(), f.lstMotsCles = u[r].lstMotsCle, f.rLatitude = u[r].rLatitude, f.rLongitude = u[r].rLongitude, f.sCodePostal = u[r].sCodePostal, o[s] = f, s++); - t({ - lstPointRetrait: e, - lstMotsCles: o, - dicPointsRetraitLad: { - } - }) - } else i('Une erreur s\'est produite lors du chargement des PR.') - }).fail(function (n) { - return i('Pb lors du chargement des PR: ' + n.toString()) - }) - }(t, n, i) - })] - }) - }) - } - }).call(this, i(0).Promise) -}, -function (n, t, i) { - 'use strict'; - (function (n) { - var f = this && this.__decorate || function (n, t, i, r) { - var f, - e = arguments.length, - u = e < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r, - o; - if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) u = Reflect.decorate(n, t, i, r); - else for (o = n.length - 1; o >= 0; o--) (f = n[o]) && (u = (e < 3 ? f(u) : e > 3 ? f(t, i, u) : f(t, i)) || u); - return e > 3 && u && Object.defineProperty(t, i, u), - u - }, - r = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - u = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.PointRetraitController = void 0; - var e = i(1), - o = i(11), - s = i(2), - h = function () { - function n(n) { - var t = this; - void 0 === n && (n = null); - this.pointRetraitService = n; - this._lstPointsRetraitRecherche = [ - ]; - this.GetLstMotsCles = function () { - return r(t, void 0, void 0, function () { - return u(this, function (n) { - switch (n.label) { - case 0: - return [4, - this.pointRetraitService.GetMotsCles(this._objRecherche.UrlWebApirRecupererPR)]; - case 1: - return [2, - n.sent()] - } - }) - }) - }; - this.GetPointsRetrait = function (n) { - return r(t, void 0, void 0, function () { - var t; - return u(this, function (i) { - switch (i.label) { - case 0: - return t = [ - ], - [ - 4, - this.pGetPointsRetraitBrut() - ]; - case 1: - return t = i.sent(), - n || (t = this.pFiltreCodePostalNull(t)), - [ - 2, - t - ] - } - }) - }) - }; - this.pGetPointsRetraitBrut = function () { - return r(t, void 0, void 0, function () { - return u(this, function (n) { - switch (n.label) { - case 0: - return [4, - this.pointRetraitService.GetMagasins(this._objRecherche.UrlWebApirRecupererPR)]; - case 1: - return [2, - n.sent()] - } - }) - }) - }; - this._objRecherche = new s.jsWPAD335_Recherche; - this.pointRetraitService = new o.PointRetraitService - } - return Object.defineProperty(n.prototype, 'LstPointsRetraitRecherche', { - get: function () { - return this._lstPointsRetraitRecherche - }, - set: function (n) { - this._lstPointsRetraitRecherche = n - }, - enumerable: !1, - configurable: !0 - }), - n.prototype.RecupererPointRetraitLadParCodePostal = function (n) { - if (!n) return []; - if (!this.pointRetraitService.dicPointsRetraitLad) throw Error('dicPointsRetraitLad ne peux pas etre vide'); - var t = this.pointRetraitService.dicPointsRetraitLad[n]; - return t && 0 != t.length ? t.filter(function (n) { - return 'O' == n.sEtatSite || 'I' == n.sEtatSite - }).map(function (n) { - return n.lstZonesLivraison = n.lstZonesLivraison.filter(function (n) { - return !n.fExclus - }), - n - }) : [ - ] - }, - n.prototype.RetrouverPrVisible = function (n, t, i) { - var r = [ - ]; - return n.forEach(function (n) { - n.rLatitude <= t.lat() && n.rLatitude > i.lat() && n.rLongitude <= t.lng() && n.rLongitude >= i.lng() && ('O' != n.sEtatSite && 'I' != n.sEtatSite || r.push(n)) - }), - r - }, - n.prototype.pFiltreCodePostalNull = function (n) { - return n.filter(function (n) { - return null != n.sCodePostal - }).reduce(function (n, t) { - return n && (n[t.sNoPR] = t), - n - }, { - }) - }, - n = f([e.Injectable({ - name: 'PointRetraitController', - dependence: [ - 'PointRetraitService' - ] - })], n) - }(); - t.PointRetraitController = h - }).call(this, i(0).Promise) -}, -function (n, t, i) { - 'use strict'; - (function (n) { - var f = this && this.__decorate || function (n, t, i, r) { - var f, - e = arguments.length, - u = e < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r, - o; - if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) u = Reflect.decorate(n, t, i, r); - else for (o = n.length - 1; o >= 0; o--) (f = n[o]) && (u = (e < 3 ? f(u) : e > 3 ? f(t, i, u) : f(t, i)) || u); - return e > 3 && u && Object.defineProperty(t, i, u), - u - }, - r = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - u = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.WoosmapController = void 0; - var e = i(24), - o = i(1), - s = i(2), - h = function () { - function t(t, i) { - var f = this; - void 0 === t && (t = null); - void 0 === i && (i = null); - this.woosmapService = t; - this.pointRetraitController = i; - this.objAffichageWoosmap = new e.AffichageWoosmap; - this._statusOK = !0; - this.chargerAPI = function () { - return r(f, void 0, void 0, function () { - var t = this; - return u(this, function () { - return [2, - new n(function (n, i) { - return r(t, void 0, void 0, function () { - var t; - return u(this, function (r) { - switch (r.label) { - case 0: - if (this.woosmapService.apiPresente()) return [3, - 4]; - r.label = 1; - case 1: - return r.trys.push([1, - 3, - , - 4]), - [ - 4, - this.woosmapService.chargerAPI() - ]; - case 2: - return r.sent(), - n(), - [ - 3, - 4 - ]; - case 3: - return t = r.sent(), - this._statusOK = !1, - i(t), - [ - 3, - 4 - ]; - case 4: - return n(), - [ - 2 - ] - } - }) - }) - })] - }) - }) - }; - this.traiterRecherche = function (n, t, i) { - return r(f, void 0, void 0, function () { - var r; - return u(this, function (u) { - switch (u.label) { - case 0: - return [4, - this.pointRetraitController.GetLstMotsCles()]; - case 1: - return r = u.sent(), - this.objAffichageWoosmap.AfficherResultatAutoCompletionWoosmap(n, r, t, i), - [ - 2 - ] - } - }) - }) - }; - this.selectionnerResultat = function (n) { - return r(f, void 0, void 0, function () { - var t, - i; - return u(this, function (r) { - switch (r.label) { - case 0: - return r.trys.push([0, - 2, - , - 3]), - [ - 4, - this.woosmapService.recupererDetailsLocalite(n) - ]; - case 1: - return t = r.sent(), - [ - 2, - this.objAffichageWoosmap.SelectionnerResultat(t, n) - ]; - case 2: - throw i = r.sent(), - this._statusOK = !1, - new Error(i); - case 3: - return [2] - } - }) - }) - }; - this._objRecherche = new s.jsWPAD335_Recherche - } - return Object.defineProperty(t.prototype, 'MasquerSuggestion', { - get: function () { - return this._MasquerSuggestion - }, - set: function (n) { - this._MasquerSuggestion = n - }, - enumerable: !1, - configurable: !0 - }), - t.prototype.apiMapActif = function () { - return this._objRecherche.WoosmapActif && this._statusOK - }, - t.prototype.rechercherAutoCompletion = function (t, i) { - return r(this, void 0, void 0, function () { - var f = this; - return u(this, function () { - return clearTimeout(this.execRecherche), - clearTimeout(this.timeOutProcess), - [ - 2, - new n(function (n, e) { - f.execRecherche = window.setTimeout(function () { - return r(f, void 0, void 0, function () { - var r, - f; - return u(this, function (u) { - switch (u.label) { - case 0: - return u.trys.push([0, - 4, - , - 5]), - [ - 4, - this.chargerAPI() - ]; - case 1: - return u.sent(), - this.MasquerSuggestion = i, - [ - 4, - this.woosmapService.rechercher(t, this._objRecherche.CodePays) - ]; - case 2: - return r = u.sent(), - [ - 4, - this.traiterRecherche(r, t, this.MasquerSuggestion) - ]; - case 3: - return u.sent(), - clearTimeout(this.timeOutProcess), - n(null), - [ - 3, - 5 - ]; - case 4: - return f = u.sent(), - this._statusOK = !1, - e(f), - [ - 3, - 5 - ]; - case 5: - return [2] - } - }) - }) - }, f._objRecherche.DelaiAffichageAutocompletion); - f.timeOutProcess = window.setTimeout(function () { - return r(f, void 0, void 0, function () { - return u(this, function () { - return clearTimeout(this.execRecherche), - this._statusOK = !1, - $(this._objRecherche.TxtRecherche).blur(), - $(this._objRecherche.TxtRecherche).val(''), - i = !0, - this.MasquerSuggestion = i, - e('Timeout dépassé lors de l\'autocomplétion sur l\'API Woosmap.'), - [ - 2 - ] - }) - }) - }, f._objRecherche.DureeTimeoutConnexionApi) - }) - ] - }) - }) - }, - t.prototype.geocodage = function (n) { - return r(this, void 0, void 0, function () { - var t, - i; - return u(this, function (r) { - switch (r.label) { - case 0: - return clearTimeout(this.execRecherche), - [ - 4, - this.chargerAPI() - ]; - case 1: - r.sent(); - t = [ - ]; - r.label = 2; - case 2: - return r.trys.push([2, - 5, - , - 6]), - [ - 4, - this.woosmapService.rechercherCodePostaux(n.CodePostal) - ]; - case 3: - return t = r.sent(), - [ - 4, - this.traiterRecherche(t, n.CodePostal, !0) - ]; - case 4: - return r.sent(), - [ - 3, - 6 - ]; - case 5: - throw i = r.sent(), - this._statusOK = !1, - i; - case 6: - return [2, - t] - } - }) - }) - }, - t = f([o.Injectable({ - name: 'WoosmapController', - dependence: [ - 'WoosmapService', - 'PointRetraitController' - ] - })], t) - }(); - t.WoosmapController = h - }).call(this, i(0).Promise) -}, -function (n, t, i) { - 'use strict'; - (function (n) { - var u = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - f = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.AffichageWoosmap = void 0; - var e = i(2), - r = i(3), - o = function () { - function n() { - this.objRecherche = new e.jsWPAD335_Recherche - } - return n.prototype.AfficherResultatAutoCompletionWoosmap = function (n, t, i, r) { - var f, - u, - e; - $(this.objRecherche.DivResultatVilles).empty(); - $(this.objRecherche.DivResultatPointsRetrait).empty(); - $(this.objRecherche.DivResultatVilles).show(); - u = this.construireListePrediction(n); - e = this.objRecherche.listePointRetraitMatch(u, t, i); - f = this.objRecherche.construireResultatRecherche(e, u, i); - this.affichagerResultat(f, r); - this.objRecherche.MasquerLoader() - }, - n.prototype.affichagerResultat = function (n, t) { - var i = document.createElement('ul'); - n.forEach(function (n) { - $(i).append($('
  • ').append($('').attr('data-type', n.TypeRecherche).attr('data-type-resultat', n.TypeResultat).attr('data-place-id', n.PlaceId).attr('data-latitude', n.latitude).attr('data-longitude', n.longitude).attr('data-description', n.Description).attr('data-ville', n.Ville).attr('data-arrondissement', n.Arrondissement).attr('data-code-postal', n.CodePostal).attr('data-code-pays', n.CodePays).html(n.Description))).html() - }); - t && $(this.objRecherche.DivResultatVilles).hide(); - $(this.objRecherche.DivResultatVilles).append($('
    ').append($('
    ').append(i))) - }, - n.prototype.adapterObjectWoosmap = function (n) { - var t; - return null != n.LstCodePostalLieu && (t = n.LstCodePostalLieu[0]), - new r.InformationResultatRecherche(n.Latitude, n.Longitude, n.AdresseFormatee, 'prediction', n.TypeResultat, n.IdLieu, n.Ville, n.Arrondissement, t, null) - }, - n.prototype.construireListePrediction = function (n) { - var t = this; - return n.map(function (n) { - return n.AdresseFormatee = n.AdresseFormatee.replace(' ' + t.objRecherche.Pays, '').replace(/,$/g, ''), - t.adapterObjectWoosmap(n) - }) - }, - n.prototype.SelectionnerResultat = function (n, t) { - return u(this, void 0, void 0, function () { - var i, - u, - e, - o, - s, - h, - c, - l, - a, - v; - return f(this, function () { - return o = t.attr('data-type'), - s = t.attr('data-type-resultat'), - h = t.attr('data-description'), - i = n.Latitude, - u = n.Longitude, - c = t.attr('data-place-id'), - l = n.Ville, - a = n.Arrondissement, - n.LstAdresse.length > 0 && 'postal_code' == n.LstAdresse[0].Types[0] && (e = n.LstCodePostalLieu[0]), - v = n.CodePays, - [ - 2, - new r.InformationResultatRecherche(i, u, h, o, s, c, l, a, e, v) - ] - }) - }) - }, - n - }(); - t.AffichageWoosmap = o - }).call(this, i(0).Promise) -}, -function (n, t, i) { - 'use strict'; - (function (n) { - var o = this && this.__decorate || function (n, t, i, r) { - var f, - e = arguments.length, - u = e < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r, - o; - if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) u = Reflect.decorate(n, t, i, r); - else for (o = n.length - 1; o >= 0; o--) (f = n[o]) && (u = (e < 3 ? f(u) : e > 3 ? f(t, i, u) : f(t, i)) || u); - return e > 3 && u && Object.defineProperty(t, i, u), - u - }, - r = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - u = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }, - s = this && this.__importDefault || function (n) { - return n && n.__esModule ? n : { - 'default': n - } - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.WoosmapService = void 0; - var h = s(i(12)), - c = i(1), - e = i(26), - f = i(3), - l = i(2), - a = function () { - function t() { - var n = this; - this._fStatutOK = !0; - this.pChargerWoosmap = function () { - n._objAutocomplete = new window.woosmap.localities.AutocompleteService(n._objRecherche.ApiKeyWoosmap); - n._fStatutOK = !0 - }; - this.pDechargerWoosmap = function (t) { - throw n._objAutocomplete = null, - n._fStatutOK = !1, - new Error(t); - }; - this._objRecherche = new l.jsWPAD335_Recherche - } - return t.prototype.chargerAPI = function () { - return r(this, void 0, void 0, function () { - var n; - return u(this, function (t) { - switch (t.label) { - case 0: - if (this.apiPresente()) return [3, - 4]; - t.label = 1; - case 1: - return t.trys.push([1, - 3, - , - 4]), - [ - 4, - this.pChargerApiSansVerification() - ]; - case 2: - return t.sent(), - [ - 3, - 4 - ]; - case 3: - throw n = t.sent(), - new Error('Probleme lors du chargement de woosmap: ' + n); - case 4: - return [2] - } - }) - }) - }, - t.prototype.pChargerApiSansVerification = function () { - return r(this, void 0, void 0, function () { - var t, - i, - r = this; - return u(this, function () { - return t = new n(function (n, t) { - h.default(r._objRecherche.UrlApiWoosmap, function (i) { - i && t(new Error('Probleme de chargment de l\'API woosmap : ' + i)); - n() - }) - }), - i = new n(function (n, t) { - setTimeout(function () { - t('timeout chargement woosmap') - }, r._objRecherche.DureeTimeoutConnexionApi || 5000) - }), - [ - 2, - n.race([t, - i]).then(this.pChargerWoosmap, this.pDechargerWoosmap) - ] - }) - }) - }, - t.prototype.apiPresente = function () { - return !!(this._fStatutOK && window.woosmap && window.woosmap.localities) - }, - t.prototype.rechercher = function (t, i) { - return r(this, void 0, void 0, function () { - var r = this; - return u(this, function () { - return [2, - new n(function (n, u) { - var f = { - country: i - }, - o = new e.WoosmapQuery(t, f, null); - r._objAutocomplete.autocomplete(o, function (t) { - n(r.pConvertirLocalites(t.localities)) - }, function (n, t) { - u(new Error('rechercher / Probleme d\'appel a woosmap - error ' + n + ' : ' + t)) - }) - })] - }) - }) - }, - t.prototype.rechercherCodePostaux = function (t) { - return r(this, void 0, void 0, function () { - var i = this; - return u(this, function () { - return [2, - new n(function (n, r) { - var u = new e.WoosmapQuery(t, { - country: 'fr' - }, 'postal_code'); - i._objAutocomplete.autocomplete(u, function (t) { - n(i.pConvertirLocalites(t.localities)) - }, function (n, t) { - r(new Error('rechercherCodePostaux / Probleme d\'appel a woosmap - error ' + n + ' : ' + t)) - }) - })] - }) - }) - }, - t.prototype.recupererDetailsLocalite = function (t) { - return r(this, void 0, void 0, function () { - var r, - i, - e = this; - return u(this, function () { - return r = t.attr('data-type'), - i = new f.ResultatGeocodage, - [ - 2, - new n(function (n, u) { - 'pointRetrait' != r ? e._objAutocomplete.getDetails(t.attr('data-place-id'), function (t) { - 'postal_code' == t.types[0] ? (i.Ville = t.address_components[1].long_name, i.LstCodePostalLieu = [ - t.name - ]) : (i.Ville = t.name, i.LstCodePostalLieu = [ - t.address_components[1].long_name - ]); - i.Arrondissement = t.address_components[1].long_name; - i.LstAdresse = [ - ]; - var r = new f.AdresseGeocodage; - r.Types = t.types; - r.NomCourt = t.name; - i.LstAdresse.push(r); - i.Latitude = t.geometry.location.lat; - i.Longitude = t.geometry.location.lng; - n(i) - }, function (n, t) { - u(new Error('rechercher / Probleme d\'appel a woosmap - error ' + n + ' : ' + t)) - }) : (i.Ville = t.attr('data-ville'), i.LstCodePostalLieu = t.attr('data-code-postal').split(';'), i.Arrondissement = t.attr('data-arrondissement'), i.Latitude = + t.attr('data-latitude'), i.Longitude = + t.attr('data-longitude'), i.CodePays = t.attr('data-code-pays'), n(i)) - }) - ] - }) - }) - }, - t.prototype.pConvertirLocalites = function (n) { - var t = [ - ]; - return null != n && n.forEach(function (n) { - var i = new f.ResultatGeocodage, - r; - i.AdresseFormatee = n.description; - i.IdLieu = n.public_id; - i.TypeResultat = n.type; - i.Ville = ''; - i.LstCodePostalLieu = [ - ]; - i.Arrondissement = ''; - i.LstAdresse = [ - ]; - r = new f.AdresseGeocodage; - r.Types = [ - ]; - r.NomCourt = ''; - r.NomLong = n.description; - i.LstAdresse.push(r); - i.Latitude = 0; - i.Longitude = 0; - t.push(i) - }), - t - }, - t = o([c.Injectable({ - name: 'WoosmapService', - dependence: [ - ] - })], t) - }(); - t.WoosmapService = a - }).call(this, i(0).Promise) -}, -function (n, t) { - 'use strict'; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.WoosmapQuery = void 0; - var i = function (n, t, i) { - this.input = n; - this.components = t; - this.types = i - }; - t.WoosmapQuery = i -}, -function (n, t, i) { - 'use strict'; - (function (n) { - var e = this && this.__decorate || function (n, t, i, r) { - var f, - e = arguments.length, - u = e < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r, - o; - if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) u = Reflect.decorate(n, t, i, r); - else for (o = n.length - 1; o >= 0; o--) (f = n[o]) && (u = (e < 3 ? f(u) : e > 3 ? f(t, i, u) : f(t, i)) || u); - return e > 3 && u && Object.defineProperty(t, i, u), - u - }, - r = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - u = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.GoogleMapController = void 0; - var o = i(1), - s = i(2), - f = i(3), - h = function () { - function t(t, i) { - var e = this; - void 0 === t && (t = null); - void 0 === i && (i = null); - this.googleMapService = t; - this.pointRetraitController = i; - this._fMasquerSuggestion = !1; - this._statusOK = !0; - this.rechercherAutoCompletion = function (n, t) { - return r(e, void 0, void 0, function () { - var i, - r, - f; - return u(this, function (u) { - switch (u.label) { - case 0: - t = t; - u.label = 1; - case 1: - return u.trys.push([1, - 4, - , - 5]), - [ - 4, - this.googleMapService.ExecuterRechercheAutocomplete(n) - ]; - case 2: - return i = u.sent(), - [ - 4, - this.pointRetraitController.GetLstMotsCles() - ]; - case 3: - return r = u.sent(), - this.afficherResultatAutoCompletion(i, r, n), - [ - 3, - 5 - ]; - case 4: - throw f = u.sent(), - this._statusOK = !1, - f; - case 5: - return [2] - } - }) - }) - }; - this.traiterRechercheGeocodage = function (n) { - return r(e, void 0, void 0, function () { - var t; - return u(this, function () { - return t = document.createElement('ul'), - $(t).append($('
  • ').append($('').attr('data-type', 'postal_code').attr('data-place-id', n.IdLieu).attr('data-latitude', n.Latitude).attr('data-longitude', n.Longitude).attr('data-description', n.AdresseFormatee).attr('data-ville', n.Ville).attr('data-arrondissement', n.Arrondissement).attr('data-code-postal', n.LstCodePostalLieu[0]).attr('data-code-pays', n.CodePays).html(n.AdresseFormatee))).html(), - $(this._objRecherche.DivResultatVilles).hide(), - $(this._objRecherche.DivResultatVilles).append($('
    ').append($('
    ').append(t))), - [ - 2 - ] - }) - }) - }; - this.afficherResultatAutoCompletion = function (n, t, i) { - var u, - r, - f; - $(e._objRecherche.DivResultatVilles).empty(); - $(e._objRecherche.DivResultatPointsRetrait).empty(); - $(e._objRecherche.DivResultatVilles).show(); - r = e.construirelistePrediction(n); - f = e._objRecherche.listePointRetraitMatch(r, t, i); - u = e._objRecherche.construireResultatRecherche(f, r, i); - e.affichagerResultat(u, e._fMasquerSuggestion); - e._objRecherche.MasquerLoader() - }; - this.construirelistePrediction = function (n) { - var t = [ - ], - r = e, - i = [ - ]; - return n.map(function (n) { - return i.push(n) - }), - i.forEach(function (n) { - var i = r.pConvertirAutocompletePrediction(n); - t.push(i) - }), - t - }; - this.selectionnerResultat = function (t) { - return r(e, void 0, void 0, function () { - var i = this; - return u(this, function () { - return [2, - new n(function (n) { - return r(i, void 0, void 0, function () { - var i, - r, - e, - s, - h, - c, - l, - o, - a, - v, - y; - return u(this, function (u) { - switch (u.label) { - case 0: - return u.trys.push([0, - 5, - , - 6]), - i = void 0, - null == t ? [ - 3, - 4 - ] : (r = t.attr('data-type'), e = t.attr('data-description'), s = t.attr('data-ville'), h = t.attr('data-arrondissement'), c = t.attr('data-latitude'), l = t.attr('data-longitude'), o = t.attr('data-place-id'), a = t.attr('data-code-postal'), v = t.attr('data-code-pays'), 'prediction' != r ? [ - 3, - 2 - ] : [ - 4, - this.googleMapService.RecupererLieuDetail(o, e, r) - ]); - case 1: - return i = u.sent(), - [ - 3, - 3 - ]; - case 2: - i = new f.InformationResultatRecherche(c, l, e, r, null, o, s, h, a, v); - u.label = 3; - case 3: - return [2, - n(i)]; - case 4: - return [3, - 6]; - case 5: - throw y = u.sent(), - this._statusOK = !1, - new Error(y); - case 6: - return [2] - } - }) - }) - })] - }) - }) - }; - this._objRecherche = new s.jsWPAD335_Recherche - } - return t.prototype.geocodage = function (n) { - return r(this, void 0, void 0, function () { - var t, - i; - return u(this, function (r) { - switch (r.label) { - case 0: - n.CodePays = n.CodePays || this._objRecherche.CodePays; - r.label = 1; - case 1: - return r.trys.push([1, - 4, - , - 5]), - [ - 4, - this.googleMapService.Geocodage(n) - ]; - case 2: - return t = r.sent(), - [ - 4, - this.traiterRechercheGeocodage(t[0]) - ]; - case 3: - return r.sent(), - [ - 2, - t - ]; - case 4: - throw i = r.sent(), - this._statusOK = !1, - i; - case 5: - return [2] - } - }) - }) - }, - t.prototype.geocodageInverseGetCodePostal = function (n, t) { - return r(this, void 0, void 0, function () { - var r, - s, - h, - f, - e, - o, - c, - i; - return u(this, function (u) { - switch (u.label) { - case 0: - return [4, - this.googleMapService.geocodeInverseLatLng(n, t)]; - case 1: - return r = u.sent(), - s = r.map(function (n) { - return n.address_components - }).map(function (n) { - return n.filter(function (n) { - return n.types.includes('postal_code') - }) - }), - h = r.map(function (n) { - return n.address_components - }).map(function (n) { - return n.filter(function (n) { - return n.types.includes('locality') - }) - }), - f = s.filter(function (n) { - return n.length > 0 - }) [0], - e = h.filter(function (n) { - return n.length > 0 - }) [0], - o = f[0] ? f[0].short_name : '', - c = e[0] ? e[0].short_name : '', - (i = { - }).latitude = Number(n), - i.longitude = Number(t), - i.CodePostal = o, - i.Ville = c, - i.Description = o, - [ - 2, - i - ] - } - }) - }) - }, - t.prototype.chargerAPI = function () { - return r(this, void 0, void 0, function () { - return u(this, function (n) { - switch (n.label) { - case 0: - return [4, - this.googleMapService.ChargerAPI()]; - case 1: - return n.sent(), - [ - 2 - ] - } - }) - }) - }, - t.prototype.apiMapActif = function () { - return this._objRecherche.GoogleMapsActif && this._statusOK - }, - t.prototype.affichagerResultat = function (n, t) { - var i = document.createElement('ul'), - r = !0; - n.forEach(function (n) { - 'inconnu' != n.TypeRecherche && (r = !1); - $(i).append($('
  • ').append($('').attr('data-type', n.TypeRecherche).attr('data-place-id', n.PlaceId).attr('data-latitude', n.latitude).attr('data-longitude', n.longitude).attr('data-description', n.Description).attr('data-ville', n.Ville).attr('data-arrondissement', n.Arrondissement).html(n.Description))).html() - }); - (r || t) && $(this._objRecherche.DivResultatVilles).hide(); - $(this._objRecherche.DivResultatVilles).append($('
    ').append($('
    ').append(i))) - }, - t.prototype.pConvertirAutocompletePrediction = function (n) { - var t, - i, - r; - return t = - 1 != n.types.indexOf('postal_code') ? n.terms[0].value : n.description.replace(/,/g, '').replace(' ' + this._objRecherche.Pays, ''), - i = n.place_id, - r = n.structured_formatting.main_text, - new f.InformationResultatRecherche(null, null, t, 'prediction', null, i, r, null, null, null) - }, - t = e([o.Injectable({ - name: 'GoogleMapController', - dependence: [ - 'GoogleMapService', - 'PointRetraitController' - ] - })], t) - }(); - t.GoogleMapController = h - }).call(this, i(0).Promise) -}, -function (n, t, i) { - 'use strict'; - (function (n) { - var s = this && this.__decorate || function (n, t, i, r) { - var f, - e = arguments.length, - u = e < 3 ? t : null === r ? r = Object.getOwnPropertyDescriptor(t, i) : r, - o; - if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate) u = Reflect.decorate(n, t, i, r); - else for (o = n.length - 1; o >= 0; o--) (f = n[o]) && (u = (e < 3 ? f(u) : e > 3 ? f(t, i, u) : f(t, i)) || u); - return e > 3 && u && Object.defineProperty(t, i, u), - u - }, - r = this && this.__awaiter || function (t, i, r, u) { - return new (r || (r = n)) (function (n, f) { - function o(n) { - try { - e(u.next(n)) - } catch (n) { - f(n) - } - } - function s(n) { - try { - e(u.throw(n)) - } catch (n) { - f(n) - } - } - function e(t) { - var i; - t.done ? n(t.value) : (i = t.value, i instanceof r ? i : new r(function (n) { - n(i) - })).then(o, s) - } - e((u = u.apply(t, i || [ - ])).next()) - }) - }, - u = this && this.__generator || function (n, t) { - function o(e) { - return function (o) { - return function (e) { - if (f) throw new TypeError('Generator is already executing.'); - for (; r; ) try { - if (f = 1, u && (i = 2 & e[0] ? u.return : e[0] ? u.throw || ((i = u.return) && i.call(u), 0) : u.next) && !(i = i.call(u, e[1])).done) return i; - switch (u = 0, i && (e = [ - 2 & e[0], - i.value - ]), e[0]) { - case 0: - case 1: - i = e; - break; - case 4: - return r.label++, - { - value: e[1], - done: !1 - }; - case 5: - r.label++; - u = e[1]; - e = [ - 0 - ]; - continue; - case 7: - e = r.ops.pop(); - r.trys.pop(); - continue; - default: - if (!(i = r.trys, (i = i.length > 0 && i[i.length - 1]) || 6 !== e[0] && 2 !== e[0])) { - r = 0; - continue - } - if (3 === e[0] && (!i || e[1] > i[0] && e[1] < i[3])) { - r.label = e[1]; - break - } - if (6 === e[0] && r.label < i[1]) { - r.label = i[1]; - i = e; - break - } - if (i && r.label < i[2]) { - r.label = i[2]; - r.ops.push(e); - break - } - i[2] && r.ops.pop(); - r.trys.pop(); - continue - } - e = t.call(n, r) - } catch (n) { - e = [ - 6, - n - ]; - u = 0 - } finally { - f = i = 0 - } - if (5 & e[0]) throw e[1]; - return { - value: e[0] ? e[1] : void 0, - done: !0 - } - }([e, - o]) - } - } - var f, - u, - i, - e, - r = { - label: 0, - sent: function () { - if (1 & i[0]) throw i[1]; - return i[1] - }, - trys: [ - ], - ops: [ - ] - }; - return e = { - next: o(0), - 'throw': o(1), - 'return': o(2) - }, - 'function' == typeof Symbol && (e[Symbol.iterator] = function () { - return this - }), - e - }, - h = this && this.__importDefault || function (n) { - return n && n.__esModule ? n : { - 'default': n - } - }; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.GoogleMapService = void 0; - var e = h(i(12)), - c = i(1), - l = i(2), - f = i(3), - o = i(29), - a = i(19), - v = function () { - function t() { - var t = this; - this.pInitInstanceGoogleMaps = function () { - var n = t._objRecherche.DivMap; - t._apiMap = new google.maps.Map(document.getElementById(n), { - }); - t._apiServicePlace = new google.maps.places.PlacesService(t._apiMap); - t._apiServiceAutoComplete = new google.maps.places.AutocompleteService; - t._apiGeocoder = new google.maps.Geocoder - }; - this.DechargerGoogleMaps = function (n) { - throw t._apiMap = null, - t._apiServicePlace = null, - t._apiServiceAutoComplete = null, - t._apiGeocoder = null, - new Error(n); - }; - this.ExecuterRechercheAutocomplete = function (i) { - return r(t, void 0, void 0, function () { - var t, - f, - e = this; - return u(this, function (o) { - switch (o.label) { - case 0: - return t = { - input: i, - types: [ - '(regions)' - ], - componentRestrictions: { - country: '' + this._objRecherche.CodePays - } - }, - [ - 4, - this.APIAutoComplete() - ]; - case 1: - return f = o.sent(), - [ - 2, - new n(function (n, i) { - return r(e, void 0, void 0, function () { - return u(this, function () { - return f.getPlacePredictions(t, function (t, r) { - return r == google.maps.places.PlacesServiceStatus.ZERO_RESULTS ? n([]) : (r != google.maps.places.PlacesServiceStatus.OK && i(Error('Google map getPlacePredictions error : ' + r)), n(t)) - }), - [ - 2 - ] - }) - }) - }) - ] - } - }) - }) - }; - this.RecupererLieuDetail = function (i, e, o) { - return r(t, void 0, void 0, function () { - var t, - r, - s, - h; - return u(this, function (u) { - switch (u.label) { - case 0: - return [4, - this.APIServicePlace()]; - case 1: - return h = u.sent(), - [ - 2, - new n(function (n, u) { - h.getDetails({ - placeId: i - }, function (i, h) { - h == google.maps.places.PlacesServiceStatus.OK ? (t = i.geometry.location.lat(), r = i.geometry.location.lng(), s = new f.InformationResultatRecherche(t, r, e, o, null, i.types[0], null, null, null, null), n(s)) : u(null) - }) - }) - ] - } - }) - }) - }; - this._objRecherche = new l.jsWPAD335_Recherche; - this._urlLib = this._objRecherche.UrlLIBGoogleMaps - } - return t.prototype.APIMap = function () { - return r(this, void 0, void 0, function () { - return u(this, function (n) { - switch (n.label) { - case 0: - return [4, - this.ChargerAPI()]; - case 1: - return n.sent(), - [ - 2, - this._apiMap - ] - } - }) - }) - }, - t.prototype.APIGeocoder = function () { - return r(this, void 0, void 0, function () { - return u(this, function (n) { - switch (n.label) { - case 0: - return [4, - this.ChargerAPI()]; - case 1: - return n.sent(), - [ - 2, - this._apiGeocoder - ] - } - }) - }) - }, - t.prototype.APIAutoComplete = function () { - return r(this, void 0, void 0, function () { - return u(this, function (n) { - switch (n.label) { - case 0: - return [4, - this.ChargerAPI()]; - case 1: - return n.sent(), - [ - 2, - this._apiServiceAutoComplete - ] - } - }) - }) - }, - t.prototype.APIServicePlace = function () { - return r(this, void 0, void 0, function () { - return u(this, function (n) { - switch (n.label) { - case 0: - return [4, - this.ChargerAPI()]; - case 1: - return n.sent(), - [ - 2, - this._apiServicePlace - ] - } - }) - }) - }, - t.prototype.apiPresente = function () { - return null != (window.google && window.google.maps && window.google.maps.Geocoder && window.google.maps.places && window.google.maps.places.PlacesService && window.google.maps.places.AutocompleteService) - }, - t.prototype.ChargerAPI = function () { - return r(this, void 0, void 0, function () { - var t; - return u(this, function (i) { - switch (i.label) { - case 0: - if (this.apiPresente()) return [3, - 5]; - i.label = 1; - case 1: - return i.trys.push([1, - 3, - , - 4]), - window.promiseChargeGoogleMap && window.promiseChargeGoogleMap.isPending() || (window.promiseChargeGoogleMap = a.MakeQuerablePromise(this.pChargerApiSansVerification())), - [ - 4, - window.promiseChargeGoogleMap - ]; - case 2: - return [2, - i.sent()]; - case 3: - throw t = i.sent(), - new Error('Probleme lors du chargement de Googlemap : ' + t); - case 4: - return [3, - 6]; - case 5: - return null != (this._apiMap && this._apiGeocoder && this._apiServiceAutoComplete && this._apiServicePlace) || this.pInitInstanceGoogleMaps(), - [ - 2, - n.resolve() - ]; - case 6: - return [2] - } - }) - }) - }, - t.prototype.pChargerApiSansVerification = function () { - return r(this, void 0, void 0, function () { - var t, - r, - i = this; - return u(this, function () { - return (t = [ - ]).push(new n(function (n, t) { - e.default(i._objRecherche.UrlAPIGoogleMaps + '&libraries=places,geometry', function (i) { - i && t(i); - n(null) - }) - })), - t.push(new n(function (n, t) { - e.default(i._urlLib, function (i) { - i && t(i); - n(null) - }) - })), - r = new n(function (n, t) { - setTimeout(function () { - t('timeout chargement google map') - }, i._objRecherche.DureeTimeoutConnexionApi || 5000) - }), - [ - 2, - n.race([n.all(t), - r]).then(this.pInitInstanceGoogleMaps, this.DechargerGoogleMaps) - ] - }) - }) - }, - t.prototype.Geocodage = function (t) { - return r(this, void 0, void 0, function () { - var r, - i, - f = this; - return u(this, function (u) { - switch (u.label) { - case 0: - return r = this, - [ - 4, - this.APIGeocoder() - ]; - case 1: - return u.sent(), - i = new o.GeocoderRequest, - null != t.PlaceId ? i.placeId = t.PlaceId : (i.componentRestrictions = new o.GeocoderComponentRestrictions, i.address = t.Description, i.componentRestrictions.postalCode = t.CodePostal, i.location = new google.maps.LatLng(t.latitude, t.longitude), i.componentRestrictions.country = t.CodePays), - [ - 2, - new n(function (n, t) { - r._apiGeocoder.geocode(i, function (i, r) { - if (r == google.maps.places.PlacesServiceStatus.ZERO_RESULTS) return n([]); - r != google.maps.places.PlacesServiceStatus.OK && t(new Error('Google map getPlacePredictions error : ' + r)); - var u = f.pConvertirGoogleGeocoderResult(i); - return n(u) - }) - }) - ] - } - }) - }) - }, - t.prototype.geocodeInverseLatLng = function () { - for (var i = [ - ], t = 0; t < arguments.length; t++) i[t] = arguments[t]; - return r(this, void 0, void 0, function () { - var t, - r, - f, - e; - return u(this, function (u) { - switch (u.label) { - case 0: - return [4, - this.APIGeocoder()]; - case 1: - return t = u.sent(), - r = i[0], - f = i[1], - e = { - lat: parseFloat(r), - lng: parseFloat(f) - }, - [ - 2, - new n(function (n, i) { - t.geocode({ - location: e - }, function (t, r) { - 'OK' === r ? t[0] ? n(t) : n(null) : i(new Error('Geocoder failed due to: ' + r)) - }) - }) - ] - } - }) - }) - }, - t.prototype.pConvertirGoogleGeocoderResult = function (n) { - var t = [ - ]; - return null != n && n.forEach(function (n) { - var i = new f.ResultatGeocodage; - i.AdresseFormatee = n.formatted_address; - null != n.address_components && n.address_components.forEach(function (n) { - var t = new f.AdresseGeocodage; - t.NomCourt = n.short_name; - t.NomLong = n.long_name; - t.Types = n.types; - i.LstAdresse.push(t); - - 1 != t.Types.indexOf('postal_code') && i.LstCodePostalLieu.push(t.NomCourt); - - 1 != t.Types.indexOf('locality') && (i.Ville = t.NomCourt); - - 1 != t.Types.indexOf('country') && (i.CodePays = t.NomCourt) - }); - i.IdLieu = n.place_id; - null != n.postcode_localities && (i.LstCodePostalLieu = n.postcode_localities); - i.MatchPartiellement = n.partial_match; - null != n.geometry && (i.TypeLieu = f.TypeLieu[n.geometry.location_type], null != n.geometry.location && (i.Latitude = n.geometry.location.lat(), i.Longitude = n.geometry.location.lng())); - i.Types = n.types; - t.push(i) - }), - t - }, - t = s([c.Injectable({ - name: 'GoogleMapService', - dependence: [ - ] - })], t) - }(); - t.GoogleMapService = v - }).call(this, i(0).Promise) -}, -function (n, t) { - 'use strict'; - var i, - r, - u, - f, - e; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.GeocoderGeometry = t.GeocoderAddressComponent = t.GeocoderResult = t.GeocoderComponentRestrictions = t.GeocoderRequest = void 0; - i = function () { - }; - t.GeocoderRequest = i; - r = function () { - }; - t.GeocoderComponentRestrictions = r; - u = function () { - }; - t.GeocoderResult = u; - f = function () { - }; - t.GeocoderAddressComponent = f; - e = function () { - }; - t.GeocoderGeometry = e -}, -function (n, t, i) { - 'use strict'; - var u, - e = this && this.__extends || (u = function (n, t) { - return (u = Object.setPrototypeOf || { - __proto__: [ - ] - } - instanceof Array && function (n, t) { - n.__proto__ = t - } - || function (n, t) { - for (var i in t) Object.prototype.hasOwnProperty.call(t, i) && (n[i] = t[i]) - }) (n, t) - }, function (n, t) { - function i() { - this.constructor = n - } - if ('function' != typeof t && null !== t) throw new TypeError('Class extends value ' + String(t) + ' is not a constructor or null'); - u(n, t); - n.prototype = null === t ? Object.create(t) : (i.prototype = t.prototype, new i) - }), - o = this && this.__importDefault || function (n) { - return n && n.__esModule ? n : { - 'default': n - } - }, - f; - Object.defineProperty(t, '__esModule', { - value: !0 - }); - t.jsWPAD383_ListeDrive = t.FacettePointRetrait = void 0; - var r, - s = o(i(5)), - h = i(1), - c = i(18); - !function (n) { - function t() { - return null !== n && n.apply(this, arguments) || this - } - e(t, n) - }(EventTarget); - !function (n) { - n.Tous = 'Tous'; - n.Drive = 'Drive'; - n.Relais = 'Relais'; - n.ChezMoi = 'ChezMoi' - }(r = t.FacettePointRetrait || (t.FacettePointRetrait = { - })); - f = function () { - function n(n) { - var t = this; - this._divListeDriveSelector = 'idDivWPAD337_Liste'; - this._buttonFiltreSelector = 'ctrlMapLAD__filtre'; - this._divListeDriveMobileSelector = 'divWPAD313_ResultatPointsRetrait'; - this._lstPointRetraits = [ - ]; - this._listPointRetraitsFiltre = [ - ]; - this.pDemarrerListenerFiltre = function (n) { - document.querySelector('.' + t._buttonFiltreSelector).addEventListener('click', function (i) { - var u = i.target, - r; - document.querySelectorAll('.' + t._buttonFiltreSelector + '>.btn-leclerc.btn-mini.btn-blanc').forEach(function (n) { - return n.classList.remove('active') - }); - t.enuFacetteActuel = u.value; - r = t.pFiltrerPointRetrait(t._listPointRetraitsFiltre, t.enuFacetteActuel, n); - t.AfficherListPointLivraisonAffichable(r) - }) - }; - this.pDemarrerListenerFiltreMobile = function (n) { - document.querySelector('.' + t._buttonFiltreSelector).addEventListener('click', function (i) { - var u = i.target, - r; - document.querySelectorAll('.' + t._buttonFiltreSelector + '>.btn-leclerc.btn-mini.btn-blanc').forEach(function (n) { - return n.classList.remove('active') - }); - t.enuFacetteActuel = u.value; - r = t.pFiltrerPointRetrait(t._listPointRetraitsFiltre, t.enuFacetteActuel, n); - t.pAfficherListPointLivraisonAffichableMobile(r) - }) - }; - s.default(document).ready(function () { - new c.InitInjectable; - t._objRecherche = n; - t._objPointRetrait = h.JsInject.ServiceLocator.get('PointRetraitController'); - t.InitialisationAbonnements() - }) - } - return Object.defineProperty(n.prototype, 'enuFacetteActuel', { - get: function () { - return this._enuFacetteActuel - }, - set: function (n) { - var t = this; - this._enuFacetteActuel = n; - document.querySelectorAll('.' + this._buttonFiltreSelector + '>.btn-leclerc.btn-mini.btn-blanc').forEach(function (n) { - n.value == t._enuFacetteActuel ? n.classList.add('active') : n.classList.remove('active') - }) - }, - enumerable: !1, - configurable: !0 - }), - n.prototype.InitialisationAbonnements = function () { - var n = this; - this._objPointRetrait.GetPointsRetrait(!0).then(function (t) { - n._lstPointRetraits = t - }).catch(function (n) { - console.log(n) - }) - }, - n.prototype.pAjouterInformationComplementaire = function (n, t, i) { - var f = this, - u = [ - ]; - return t.forEach(function (t) { - var o, - s, - h, - e; - if (!t.fSitePrive) { - if (t.nDistance = f._objRecherche.CalculerDistanceGPS(t.rLatitude, t.rLongitude, n.latitude, n.longitude), t.sTypeLAD = null, 0 != t.lstZonesLivraison.length) if (i) { - for (t.sTypeLAD = 'indisponible', o = 0, s = t.lstZonesLivraison; o < s.length; o++) if (h = s[o], !h.fExclus && h.sCodePostal == n.CodePostal) { - t.sTypeLAD = 'disponible'; - break - } - } else t.sTypeLAD = 'sousReserve'; - e = t; - switch (e.facettes = [ - ], e.eTypePR) { - case 1: - e.facettes.push(r.Drive); - break; - case 3: - case 4: - e.facettes.push(r.Relais) - } - 5 != t.eTypePR && 13 != t.eTypePR && 16 != t.eTypePR && 15 != t.eTypePR || (e.facettes = [ - r.Relais - ]); - t.lstZonesLivraison.length > 0 && e.facettes.push(r.ChezMoi); - u.push(e) - } - }), - u - }, - n.prototype.pInitFiltrerEtCompleterAfficher = function (n, t, i, u) { - var f = this, - e; - this.enuFacetteActuel = r.Tous; - e = /^[0-9]{5}/.test(i.Description); - t.then(function (n) { - var o, - t, - s, - h; - null != u ? (o = f._lstPointRetraits.filter(function (n) { - return u.some(function (t) { - return n.sNoPR == t - }) - }), f._listPointRetraitsFiltre = f.pRecupererTousLesPointRetraitFiltre(o, void 0, void 0, i, e), f._listPointRetraitsFiltre = f._listPointRetraitsFiltre.sort(function (n, t) { - return n.nDistance - t.nDistance - }), f.AfficherListPointLivraisonAffichable(f._listPointRetraitsFiltre), f.pDemarrerListenerFiltre(e)) : n.addListener('idle', function () { - t = n.getBounds(); - s = t.getNorthEast(); - h = t.getSouthWest(); - f._listPointRetraitsFiltre = f.pRecupererTousLesPointRetraitFiltre(f._lstPointRetraits, s, h, i, e); - f._listPointRetraitsFiltre = f._listPointRetraitsFiltre.sort(function (n, t) { - return n.nDistance - t.nDistance - }); - f.AfficherListPointLivraisonAffichable(f._listPointRetraitsFiltre); - f.pDemarrerListenerFiltre(e) - }); - document.querySelector('.' + f._buttonFiltreSelector + ' button[value=' + r.Tous + ']').click() - }) - }, - n.prototype.pFiltrerPointRetrait = function (n, t, i) { - return t == r.Tous ? n : t == r.ChezMoi && i ? n.filter(function (n) { - return n.facettes.includes(r.ChezMoi) && 'indisponible' != n.sTypeLAD - }) : n.filter(function (n) { - return n.facettes.includes(t) - }) - }, - n.prototype.InitialiserAffichageListePR = function (n, t, i) { - var r = document.getElementById(this._divListeDriveSelector); - r.innerHTML = ''; - this.pInitFiltrerEtCompleterAfficher(r, n, t, i); - r.classList.remove('masquer') - }, - n.prototype.AfficherListPointLivraisonAffichable = function (n) { - var t = document.getElementById(this._divListeDriveSelector); - t.innerHTML = ''; - n.length > 0 ? this.pCreerEtInsererIHMDriveDesktop(t, n) : this.pAucunResultaIHMDriveDesktopCore(t) - }, - n.prototype.pRecupererTousLesPointRetraitFiltre = function (n, t, i, r, u) { - var s, - f = n, - e, - o, - h; - return null != t && null != i && (f = this._objPointRetrait.RetrouverPrVisible(n, t, i)), - e = this._lstPointRetraits.filter(function (n) { - return n.lstZonesLivraison.some(function (n) { - return n.sCodePostal == r.CodePostal && !n.fExclus - }) && n.sNoPL == n.sNoPR && ('I' == n.sEtatSite || 'O' == n.sEtatSite) - }), - o = this.pMergeListePR(f, e), - (s = this.pAjouterInformationComplementaire(r, o, u), 1 == o.length) && (h = f.length > 0 ? f[0] : e[0], window.WPAD338.AfficherPointsRetrait('SELECTION', null, null, h.iIdPointCarte, null, null, null)), - s - }, - n.prototype.pMergeListePR = function (n, t) { - var i = [ - ]; - return t.forEach(function (t) { - n.some(function (n) { - return n.sNoPL == t.sNoPL - }) || i.push(t) - }), - [ - ].concat(n, i) - }, - n.prototype.pAucunResultaIHMDriveDesktopCore = function (n) { - var t = document.createElement('div'); - t.className = 'ctrlMapLAD__cartouches_vide'; - t.innerHTML = '\n
    \n

    ' + window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_DRIVE_VIDE + '

    \n
    \n '; - n.appendChild(t) - }, - n.prototype.pCreerEtInsererIHMDriveDesktop = function (n, t) { - var i = this; - t.forEach(function (t) { - i.pCreerEtInsererIHMDriveDesktopCore(n, t.sNoPL, t.sNoPR, t.sNomPR, t.sCodePostal, t.nDistance, t.iIdPointCarte, t.sTypeLAD, - 1 != t.facettes.indexOf(r.Relais), t.eTypePR) - }) - }, - n.prototype.pCreerEtInsererIHMDriveDesktopCore = function (n, t, i, r, u, f, e, o, s, h) { - var c = document.createElement('div'); - return c.className = 'ctrlMapLAD__cartouches', - c.id = 'liDrive_' + t, - c.innerHTML = '\n
    \n

    ' + u + ' ' + r + ' - ' + f.toLocaleString('fr-FR', { - minimumFractionDigits: 1, - maximumFractionDigits: 1 - }) + ' km \n

    \n
    \n
    \n
    \n ' + window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_DRIVE + '\n \n
    \n
    \n\n \n ' + (16 == h || 15 == h ? 'Relais (camion)' : 'Relais') + '\n
    \n
    \n
    \n \n
    \n ' + window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_CHEZ_MOI + '\n
    \n ' + ('indisponible' == o ? window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_CHEZ_MOI_INDISPONIBLE : '') + ' ' + ('sousReserve' == o ? window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_CHEZ_MOI_SOUS_RESERVE : '') + '\n
    \n
    \n
    ', - c.setAttribute('onclick', 'window[\'WPAD338\'].AfficherPointsRetrait("SELECTION", null, null, ' + e + ', null, null, null)'), - n.appendChild(c), - c - }, - n.prototype.AfficherListeMobile = function (n, t, i) { - var f, - s = this, - e = document.getElementById(this._divListeDriveMobileSelector), - o, - u; - e.innerHTML = ''; - this.enuFacetteActuel = r.Tous; - f = this._lstPointRetraits.filter(function (n) { - return t.some(function (t) { - return n.sNoPR == t - }) - }); - this._listPointRetraitsFiltre = this.pAjouterInformationComplementaire(n, f, i); - this._listPointRetraitsFiltre.sort(function (n, t) { - return n.nDistance - t.nDistance - }); - this._listPointRetraitsFiltre.forEach(function (n) { - s.pCreerEtInsererIHMDriveMobile(e, n.sNoPL, n.sNoPR, n.sNomPR, n.sCodePostal, n.nDistance, n.iIdPointCarte, n.sTypeLAD, - 1 != n.facettes.indexOf(r.Relais), n.eTypePR) - }); - o = this.pFiltrerPointRetrait(this._listPointRetraitsFiltre, this.enuFacetteActuel, i); - 0 === Object.keys(o).length && (u = document.getElementById(this._divListeDriveMobileSelector), u.innerHTML = '', this.pAucunResultaIHMDriveDesktopCore(u)); - this.pDemarrerListenerFiltreMobile(i) - }, - n.prototype.pCreerEtInsererIHMDriveMobile = function (n, t, i, r, u, f, e, o, s, h) { - var c = document.createElement('div'); - return c.className = 'ctrlMapLAD__cartouches', - c.id = 'liDrive_' + t, - c.innerHTML = '\n
    \n

    ' + u + ' ' + r + ' - ' + f.toLocaleString('fr-FR', { - minimumFractionDigits: 1, - maximumFractionDigits: 1 - }) + ' km\n

    \n
    \n
    \n
    \n ' + window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_DRIVE + '\n
    \n
    \n \n ' + (16 == h || 15 == h ? 'Relais (camion)' : 'Relais') + '
    \n
    \n
    \n \n
    \n ' + window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_CHEZ_MOI + '\n
    \n ' + ('indisponible' == o ? window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_CHEZ_MOI_INDISPONIBLE : '') + ' ' + ('sousReserve' == o ? window.Utilitaires.Ressources.ascWPAD335_Recherche.LOC_CHEZ_MOI_SOUS_RESERVE : '') + '\n
    \n
    \n
    ', - c.addEventListener('click', function () { - window.WPAD335.AfficherFicheMagasin(t, i) - }), - n.appendChild(c), - c - }, - n.prototype.pAfficherListPointLivraisonAffichableMobile = function (n) { - var i = this, - t = document.getElementById(this._divListeDriveMobileSelector); - t.innerHTML = ''; - n.length > 0 ? (n.sort(function (n, t) { - return n.nDistance - t.nDistance - }), n.forEach(function (n) { - i.pCreerEtInsererIHMDriveMobile(t, n.sNoPL, n.sNoPR, n.sNomPR, n.sCodePostal, n.nDistance, n.iIdPointCarte, n.sTypeLAD, - 1 != n.facettes.indexOf(r.Relais), n.eTypePR) - })) : this.pAucunResultaIHMDriveDesktopCore(t) - }, - n - }(); - t.jsWPAD383_ListeDrive = f -} -]); -var WPAD345 = WPAD345 || { -}; -$(document).ready(function () { - WPAD345.VerifierBasculeDesktopMobile(); - WPAD345.VerifierAffichageLiensMobileDesktop(); - $('[id$=_btnWPAD345_SiteMobile]').on('click', function (n) { - WPAD345.stopEvent(n); - WPAD345.BasculerDesktopMobile() - }); - $('#lnkWPAD345_PopinApplications').on('click', function (n) { - WPAD345.stopEvent(n); - WPAD345.OuvrirPopinApplications() - }) -}); -WPAD345 = { - BasculerDesktopMobile: function () { - var n = document.location.hostname.substring(document.location.hostname.indexOf('.') + 1); - WCTD601.Cookie.SetCookie({ - cle: 'desktopversion', - value: 'false', - path: '/', - domain: n, - duree: 365 - }); - location.reload() - }, - OuvrirPopinApplications: function () { - Utl.Loader.afficher(); - WCTD601.Handler.Appeler({ - config: { - url: Utilitaires.Ressources.ascWPAD345_FooterDrive.PARAM_URL_HANDLER_RECUP_CONTENU - }, - data: { - sCodeSite: '', - sTypeContenu: 'DRIVE_APPLICATIONS', - sNomControle: 'ascWPAD343_ContenuStatique' - }, - onChampSucces: function (n) { - WCTD201.Class.PopinManager.OuvrirPopin({ - sNomPopin: 'popinContenu_DRIVE_APPLICATIONS', - fClient: !0, - conteneurType: WCTD201.Class.Scrollpane, - conteneur: { - contenu: n.objDonneesReponse, - fScrollOut: !0 - }, - popin: { - sOnComplete: function () { - WCTD601.View.RaiseUpdate(); - Utl.Loader.masquer() - } - } - }) - } - }) - }, - VerifierBasculeDesktopMobile: function () { - var n = document.location.hostname.substring(document.location.hostname.indexOf('.') + 1), - t; - Utilitaires.Navigateur.estEcranMobile() || (WCTD601.Cookie.SetCookie({ - cle: 'desktopversion', - value: '', - path: '/', - domain: n, - duree: - 1 - }), WCTD601.Cookie.SetCookie({ - cle: 'maintenancemobile', - value: '', - path: '/', - domain: n, - duree: - 1 - })); - t = WCTD601.Cookie.GetCookie('desktopversion'); - t == null && Utilitaires.Navigateur.estEcranMobile() && WPAD345.BasculerDesktopMobile() - }, - VerifierAffichageLiensMobileDesktop: function () { - var n = WCTD601.Cookie.GetCookie('desktopversion'); - n != null && $('.divWPAD345_LiensNiveau3').removeClass('masquer') - }, - stopEvent: function (n) { - n.preventDefault(); - n.stopPropagation() - } -}; -var WPAD346 = WPAD346 || { -}; -$(function () { - $.WCTD204_QueryString.sConnect != undefined && $('.divWPAD346_NonConnecte').is(':visible') && WPAD346.OuvrirPopinAuthentification(); - $('.aWPAD346_NonConnecte').on('click', function (n) { - WPAD346.stopEvent(n); - WPAD041.ForcerRedirectionBonDomain() || WPAD346.OuvrirPopinAuthentification() - }); - $('.aWPAD346_Connecte').on('click', function (n) { - WPAD346.stopEvent(n); - WPAD346.ToggleConnectPopin(!0) - }); - $('.aWPAD346_PopinToggle').on('click', function (n) { - WPAD346.stopEvent(n); - WPAD346.FermerLayers(); - WPAD346.OuvrirPopinPointRetraitPrefere(!0) - }); - $('.divWPAD346_Overlay').on('click', function (n) { - WPAD346.stopEvent(n); - WPAD346.FermerLayers() - }); - Utilitaires.Pubsub.on('Auth.Connexion', function (n) { - WPAD346.AbonnementConnecter(n) - }); - Utilitaires.Pubsub.on('Auth.Deconnexion', function (n) { - WPAD346.AbonnementDeconnecter(n) - }) -}); -WPAD346 = { - ToggleConnectPopin: function (n) { - n ? $('.divWPAD346_Connecte .divWPAD346_ConnexionBox').toggle() : $('.divWPAD346_NonConnecte .divWPAD346_ConnexionBox').toggle(); - $(this).toggleClass('open'); - $('.divWPAD346_Overlay').toggle(); - var t = null, - i = $($.find('.captcha')); - i && i.length == 1 && (t = i.data('id-captcha')); - t && WCLD320_Captcha.rafraichirCaptcha(t) - }, - AbonnementConnecter: function (n) { - WPAD346.FermerLayers(); - var u = n.sNom, - r = n.sPrenom, - i = n.sNomMagasin, - f = n.sNoPL, - e = n.sNoPR, - o = n.fromCache, - t; - t = r != undefined ? r : u; - t.length > 22 && (t = t.substring(0, 22) + ' ...'); - i == null && (i = Utilitaires.Ressources.ascWPAD346_ConnexionDrive.LOC_SELECT); - $('#spanWPAD346_Bonjour').html(t); - $('#spanWPAD346_Magasin').html(i); - $('.aWPAD346_PopinToggle').attr('data-pl', f); - $('.aWPAD346_PopinToggle').attr('data-pr', e); - $('.divWPAD346_Connecte').removeClass('masquer').addClass('afficher'); - $('.divWPAD346_NonConnecte').removeClass('afficher').addClass('masquer') - }, - AbonnementDeconnecter: function () { - WPAD346.FermerLayers(); - $('.divWPAD346_NonConnecte').removeClass('masquer').addClass('afficher'); - $('.divWPAD346_Connecte').removeClass('afficher').addClass('masquer') - }, - FermerLayers: function () { - $('.divWPAD346_ConnexionBox, .divWPAD346_Overlay').hide(); - $('.divWPAD346_Connexion .open').removeClass('open') - }, - OuvrirPopinPointRetraitPrefere: function (n) { - var t = $('.aWPAD346_PopinToggle').attr('data-pl'), - i = $('.aWPAD346_PopinToggle').attr('data-pr'); - t ? WPAD338.AfficherPointsRetrait('MAGASIN', null, null, null, null, t, i) : n && WPAD346.ScrollerHauteCarte() - }, - ScrollerHauteCarte: function () { - WPAD337.ScrollerHauteCarte() - }, - stopEvent: function (n) { - n.preventDefault(); - n.stopPropagation() - }, - OuvrirPopinAuthentification: function () { - Utilitaires.Ressources.ascWPAD346_ConnexionDrive.PARAM_MODE_CCU_INACTIF == 'O' ? (WPAD346.ToggleConnectPopin(!1), $('.txtWCLD312_Login').focus()) : WCTD201.Class.PopinManager.OuvrirPopin({ - sNomPopin: 'WCLD151_OuverturePopinAuthentificationCCU', - data: { - sMessageHeader: '' - } - }).done(function () { - WCLD320_CaptchaOnLoadHcaptcha && typeof WCLD320_CaptchaOnLoadHcaptcha == 'function' && WCLD320_CaptchaOnLoadHcaptcha() - }) - } -}; -var WPAD348 = WPAD348 || { -}; -$(document).ready(function () { -}); -WPAD348 = { - OuvrirPopinReassurance: function (n) { - Utl.Loader.afficher(); - var t = { - sCodeSite: '', - sTypeContenu: n, - sNomControle: 'ascWPAD343_ContenuStatique' - }; - WCTD601.Handler.Appeler({ - config: { - url: Utilitaires.Ressources.ascWPAD348_EngagementsDrive.PARAM_URL_HANDLER_RECUP_CONTENU - }, - data: t, - onChampSucces: function (t) { - WCTD201.Class.PopinManager.OuvrirPopin({ - sNomPopin: 'popinContenu_' + n, - fClient: !0, - conteneurType: WCTD201.Class.Scrollpane, - conteneur: { - contenu: t.objDonneesReponse, - fScrollOut: !0 - }, - popin: { - sOnComplete: function () { - WCTD601.View.RaiseUpdate(); - Utl.Loader.masquer() - } - } - }) - } - }) - }, - stopEvent: function (n) { - n.preventDefault(); - n.stopPropagation() - } -}; -if (typeof (Sys) !== 'undefined') Sys.Application.notifyScriptLoaded(); diff --git a/insiders_JS/cdata_WebFormSubmit.js b/insiders_JS/cdata_WebFormSubmit.js deleted file mode 100644 index de29d21..0000000 --- a/insiders_JS/cdata_WebFormSubmit.js +++ /dev/null @@ -1,44 +0,0 @@ - -// - - - - -//Votre panier a été sauvegardé. Vous le retrouverez automatiquement lors de votre prochaine connexion.","sValidationGroup":"WCLD312_ctl00_ucWPAD007_ConnexionDrive_ctl00","sUrlHandlerVerifierLoginMitigation":"https://fd14-secure.leclercdrive.fr/drive/verifierloginmitigation.ashz","sUrlBlocageListeNoire":"https://www.leclercdrive.fr/blocage-login.aspx","sUrlBlocageEchecConnexion":"https://www.leclercdrive.fr/blocage-login-echec-connexion.aspx","sUrlBlocageNbCompteIP":"https://www.leclercdrive.fr/blocage-login-echec-ip.aspx","sUrlBlocageNbTerminalCompte":"https://www.leclercdrive.fr/blocage-login-limite-device.aspx","sUrlBlocageNbIpCompte":"https://www.leclercdrive.fr/blocage-login-limite-ip.aspx","enuMarque":1,"sNoPointLivraisonConnexion":"","eUniversContexte":"2"});Utilitaires.widget.initOptions('ctl00_ucWPAD007_ConnexionDrive_ctl01_pnlWCLD312_ConnexionBase',{"sUrlRedirection":null,"sUrlHandlerConnecter":"https://fd14-secure.leclercdrive.fr/drive/connecter.ashz","sUrlHandlerDeconnecter":"https://www.leclercdrive.fr/deconnecter.ashz","sUrlStatistiques":"https://www.leclercdrive.fr/Statistiques/","sUrlParcoursAjoutDonnees":null,"fRechargement":false,"sLocTitreDeconnexion":"Déconnexion","sLocTexteDeconnexion":"Votre demande de déconnexion a bien été prise en compte.
    Votre panier a été sauvegardé. Vous le retrouverez automatiquement lors de votre prochaine connexion.","sValidationGroup":"WCLD312_ctl00_ucWPAD007_ConnexionDrive_ctl01","sUrlHandlerVerifierLoginMitigation":"https://fd14-secure.leclercdrive.fr/drive/verifierloginmitigation.ashz","sUrlBlocageListeNoire":"https://www.leclercdrive.fr/blocage-login.aspx","sUrlBlocageEchecConnexion":"https://www.leclercdrive.fr/blocage-login-echec-connexion.aspx","sUrlBlocageNbCompteIP":"https://www.leclercdrive.fr/blocage-login-echec-ip.aspx","sUrlBlocageNbTerminalCompte":"https://www.leclercdrive.fr/blocage-login-limite-device.aspx","sUrlBlocageNbIpCompte":"https://www.leclercdrive.fr/blocage-login-limite-ip.aspx","enuMarque":1,"sNoPointLivraisonConnexion":"","eUniversContexte":"2"}); - document.getElementById('ctl00_ucWPAD007_ConnexionDrive_ctl00_rfvWCLD312_Mdp').dispose = function() { - Array.remove(Page_Validators, document.getElementById('ctl00_ucWPAD007_ConnexionDrive_ctl00_rfvWCLD312_Mdp')); - } - //]]> - - - -// - \ No newline at end of file diff --git a/src/control_google_.js b/src/control_google_.js deleted file mode 100644 index a5ae0e6..0000000 --- a/src/control_google_.js +++ /dev/null @@ -1,31 +0,0 @@ -const {By, Builder, Browser} = require('selenium-webdriver'); -const assert = require("assert"); - -(async function firstTest() { // TEST SOON WAITED WORK, TRY CLICK - let driver; - - try { - driver = await new Builder().forBrowser(Browser.CHROME).build(); - await driver.get('https://intermarche.com'); - - let title = await driver.getTitle(); - console.log(title); - //assert.equal("Web form", title); - - await driver.manage().setTimeouts({implicit: 500}); - - /*let textBox = await driver.findElement(By.name('my-text')); - let submitButton = await driver.findElement(By.css('button')); - - await textBox.sendKeys('Selenium'); - await submitButton.click(); - - let message = await driver.findElement(By.id('message')); - let value = await message.getText(); - assert.equal("Received!", value);*/ - } catch (e) { - console.log(e) - } finally { - await driver.quit(); - } -}()) \ No newline at end of file diff --git a/src/libJSON/systemeu_per_city.json b/src/libJSON/systemeu_per_city.json new file mode 100644 index 0000000..986db26 --- /dev/null +++ b/src/libJSON/systemeu_per_city.json @@ -0,0 +1,840 @@ +{ + "abbeville" : "hyperu", + "agde" : "hyperu", + "aizenay" : "hyperu", + "ales" : "hyperu", + "barallemarquion" : "hyperu", + "baule" : "hyperu", + "biachesaintvaast" : "hyperu", + "blain" : "hyperu", + "blainvillesurorne" : "hyperu", + "bourgueil" : "hyperu", + "briecomterobert" : "hyperu", + "challans" : "hyperu", + "champagnole" : "hyperu", + "chantonnay" : "hyperu", + "chateaugiron" : "hyperu", + "clermontlherault" : "hyperu", + "combourg" : "hyperu", + "douvresladelivrande" : "hyperu", + "ecommoy" : "hyperu", + "exincourt" : "hyperu", + "fontenaylecomte" : "hyperu", + "guichen" : "hyperu", + "gujanmestras" : "hyperu", + "hanches" : "hyperu", + "lachapellesurerdre" : "hyperu", + "lamontagne" : "hyperu", + "larochellebeaulieu" : "hyperu", + "larochesuryon" : [ + "hyperu", + "superu" + ], + "legrandquevilly" : "hyperu", + "lesherbiers" : "hyperu", + "mayenne" : "hyperu", + "mende" : "hyperu", + "montmorot" : "hyperu", + "murserigne" : "hyperu", + "nieppe" : "hyperu", + "parthenay" : "hyperu", + "perigueuxboulazac" : "hyperu", + "plancoet" : "hyperu", + "pontarlier" : "hyperu", + "pontdebeauvoisin" : "hyperu", + "rumilly" : "hyperu", + "saintave" : "hyperu", + "saintes" : "hyperu", + "sainthilairederiez" : "hyperu", + "saintjunien" : "hyperu", + "saintphilbertdegrandlieu" : "hyperu", + "saintromaindecolbosc" : "hyperu", + "savenay" : "hyperu", + "vallet" : "hyperu", + "vernouillet" : "hyperu", + "villefranchedelauragais" : "hyperu", + "vitre" : "hyperu", + "vitryenartois" : "hyperu", + "yffiniac" : "hyperu", + "argentieres" : "marcheru", + "aigueblanche" : "superu", + "aiguilhe" : "superu", + "aimargues" : "superu", + "aixesurvienne" : "superu", + "albert" : "superu", + "alencon" : "superu", + "alessalindres" : "superu", + "alissas" : "superu", + "ambazac" : "superu", + "ancenis" : "superu", + "andard" : "superu", + "angersjustices" : "superu", + "angresse" : "superu", + "annonay" : "superu", + "arbois" : "superu", + "arcsurtille" : "superu", + "argentsursauldre" : "superu", + "arlanc" : "superu", + "arnage" : "superu", + "arradon" : "superu", + "arthonenretz" : "superu", + "arvert" : "superu", + "athismons" : "superu", + "audincourt" : "superu", + "auneaubleurysaintsymphorien" : "superu", + "auray" : "superu", + "bans" : "superu", + "bassens" : "superu", + "bauge" : "superu", + "baumelesdames" : "superu", + "bazas" : "superu", + "beaucouze" : "superu", + "beaumonthague" : "superu", + "beaumontlesvalence" : "superu", + "beaumontsursarthe" : "superu", + "beaunelarolande" : "superu", + "beaupreau" : "superu", + "beauvoirsurmer" : "superu", + "beconlesgranits" : "superu", + "belberaud" : "superu", + "belinbeliet" : "superu", + "belleileenmer" : "superu", + "bellevigny" : "superu", + "belz" : "superu", + "benejacq" : "superu", + "besancon" : "superu", + "bessancourtmeuniers" : "superu", + "bessesurbraye" : "superu", + "bessieres" : "superu", + "binic" : "superu", + "biscarrosse" : "superu", + "biviers" : "superu", + "blangysurbresle" : "superu", + "blayelesmines" : "superu", + "bletterans" : "superu", + "bonne" : "superu", + "bonnetable" : "superu", + "bonnysurloire" : "superu", + "bonsecours" : "superu", + "bouaye" : "superu", + "bouloire" : "superu", + "bourgsaintmaurice" : "superu", + "brecey" : "superu", + "brehal" : "superu", + "brestkeredern" : "superu", + "bretignollessurmer" : "superu", + "bricquebecencotentin" : "superu", + "brochongevrey" : "superu", + "broons" : "superu", + "brou" : "superu", + "bruguieres" : "superu", + "bruz" : "superu", + "buxerolles" : "superu", + "caen" : "superu", + "camblanes" : "superu", + "camphinenpevele" : "superu", + "cancale" : "superu", + "cande" : "superu", + "carentoir" : "superu", + "carquefou" : "superu", + "castelnaulelez" : "superu", + "castres" : "superu", + "caussade" : "superu", + "cavignac" : "superu", + "cerizay" : "superu", + "cestas" : "superu", + "chabanais" : "superu", + "chabris" : "superu", + "chalettesurloing" : "superu", + "chalonnessurloire" : "superu", + "chambery" : "superu", + "chamonix" : [ + "superu", + "uexpress" + ], + "champdeniers" : "superu", + "chanceauxsurchoisille" : "superu", + "change" : "superu", + "charlysurmarne" : "superu", + "chateaubourg" : "superu", + "chateaubriant" : "superu", + "chateaudolonne" : "superu", + "chateaulavalliere" : "superu", + "chateauneuflaforet" : "superu", + "chateauneufsurcharente" : "superu", + "chateauneufsurloire" : "superu", + "chateauneufsursarthe" : "superu", + "chatellerault" : "superu", + "chatilloncoligny" : "superu", + "chatouberteaux" : "superu", + "chemille" : "superu", + "chenove" : "superu", + "chinon" : "superu", + "chissayentouraine" : "superu", + "civray" : "superu", + "clamartcentre" : "superu", + "claoueylege" : "superu", + "cognin" : "superu", + "colombe" : "superu", + "colombelles" : "superu", + "colomiers" : "superu", + "combrit" : "superu", + "condeennormandie" : "superu", + "conlie-1" : "superu", + "contres" : "superu", + "corze" : "superu", + "couillypontauxdames" : "superu", + "coulongessurlautize" : "superu", + "coursan" : "superu", + "courvillesureure" : "superu", + "cozes" : "superu", + "craonsaintclement" : "superu", + "craponnesurarzon" : "superu", + "daoulas" : "superu", + "decazeville" : "superu", + "derval" : "superu", + "devecey" : "superu", + "dieulefit" : "superu", + "doldebretagne" : "superu", + "dompierresurbesbre" : "superu", + "donzere" : "superu", + "douelafontaine" : "superu", + "dozule" : "superu", + "draveil" : "superu", + "dunsurauron" : "superu", + "durtal" : "superu", + "eaunes" : "superu", + "echillais" : "superu", + "echire" : "superu", + "ecouen" : "superu", + "egat" : "superu", + "egletons-1" : "superu", + "eguzon" : "superu", + "ernee" : "superu", + "erquy" : "superu", + "espalion" : "superu", + "essert" : "superu", + "etrepagny" : "superu", + "evreux" : "superu", + "evron" : "superu", + "eysines" : "superu", + "farguessainthilaire" : "superu", + "fereentardenois" : "superu", + "ferrieresenbray" : "superu", + "feytiat" : "superu", + "flixecourt" : "superu", + "flourens" : "superu", + "fonbeauzard" : "superu", + "fontenaylefleury" : "superu", + "fouraslesbains" : "superu", + "franquevillesaintpierre" : "superu", + "frasne" : "superu", + "fresnaysursarthe" : "superu", + "gagnac" : "superu", + "galgon" : "superu", + "gan" : "superu", + "ganges" : "superu", + "gemozac" : "superu", + "gennes" : "superu", + "gergy" : "superu", + "getigne" : "superu", + "gorron" : "superu", + "gourdanpolignan" : "superu", + "grandfortphilippe" : "superu", + "grenadesurgaronne" : "superu", + "grenoble" : "superu", + "guemenepenfao" : "superu", + "guidel" : "superu", + "guipavas" : "superu", + "guipry" : "superu", + "hazebrouck" : "superu", + "heric" : "superu", + "hericourt" : "superu", + "herouvillesaintclair" : "superu", + "houplines" : "superu", + "ifs" : "superu", + "igoville" : "superu", + "illesurtet" : "superu", + "janze" : "superu", + "josselin" : "superu", + "jouelestours" : "superu", + "labastidesaintpierre" : "superu", + "labathie" : "superu", + "labruffiere" : "superu", + "lacanau" : "superu", + "lachabossiere" : "superu", + "lachapellebassemer" : "superu", + "lachartresurleloir" : "superu", + "lachataigneraie" : "superu", + "lachatre" : "superu", + "lachaume" : "superu", + "lacouronne" : "superu", + "lafertesaintaubin" : "superu", + "laguerchedebretagne" : "superu", + "laiguillonsurmer" : "superu", + "laiz" : "superu", + "lamadeleine" : "superu", + "lamastre" : "superu", + "lamotheachard" : "superu", + "lamotteservolex" : "superu", + "lamure" : "superu", + "landivisiau" : "superu", + "landudec" : "superu", + "langeac" : "superu", + "lanmeur" : "superu", + "lanvallay" : "superu", + "lanvollon" : "superu", + "lapommeraye" : "superu", + "laravoire" : "superu", + "larbresle" : "superu", + "lariche" : "superu", + "larocheposay" : "superu", + "larochette" : "superu", + "lasuzesursarthe" : "superu", + "latourette" : "superu", + "latranchesurmer" : "superu", + "laturballe" : "superu", + "lavardac" : "superu", + "lavaur" : "superu", + "lavelanet" : "superu", + "laverpilliere" : "superu", + "lebourgneuflaforet" : "superu", + "lechateaudoleron" : "superu", + "lechesnaypottier" : "superu", + "lecheylard" : "superu", + "lefaou" : "superu", + "lege" : "superu", + "legrauduroiportdepeche" : "superu", + "leguevin" : "superu", + "lehavreporteoceane" : "superu", + "lehom" : "superu", + "lemans" : "superu", + "lemolaylittry" : "superu", + "lepalaissurvienne" : "superu", + "leplessisrobinson" : "superu", + "leplessistrevise" : "superu", + "leportmarly" : "superu", + "lerheu" : "superu", + "lerussey" : "superu", + "lesessarts" : "superu", + "leshouches" : "superu", + "lespieux" : "superu", + "lesvans" : "superu", + "levigan" : "superu", + "levroux" : "superu", + "lhermitage" : "superu", + "lhorme" : "superu", + "liffre" : "superu", + "ligne" : "superu", + "lilebouchard" : "superu", + "limoges" : "superu", + "limogescorgnac" : "superu", + "limoux" : "superu", + "lislejourdain" : "superu", + "litetmixe" : "superu", + "loches" : "superu", + "lodeve" : "superu", + "loisin" : "superu", + "longuejumelles" : "superu", + "loudeac" : "superu", + "loudun" : "superu", + "loury" : "superu", + "louvignedudesert" : "superu", + "lubersac" : "superu", + "lucon" : "superu", + "lumbres" : "superu", + "luynes" : "superu", + "lyon6eme" : "superu", + "lyongerland" : "superu", + "lyonmaisonsneuves" : "superu", + "lyonmoulinavent" : "superu", + "machecoul" : "superu", + "magland" : "superu", + "magne" : "superu", + "malansac" : "superu", + "malemort" : "superu", + "mamers" : "superu", + "mansle" : "superu", + "marans" : "superu", + "mareilenchampagne" : "superu", + "marguerittes" : "superu", + "marignier" : "superu", + "marmande" : "superu", + "maromme" : "superu", + "martrestolosane" : "superu", + "marvejols" : "superu", + "masseube" : "superu", + "matignon" : "superu", + "maubourguet" : "superu", + "mauleon" : "superu", + "maulevrier" : "superu", + "mauron-1" : "superu", + "mauvezin" : "superu", + "maze" : "superu", + "melesse" : "superu", + "mer" : "superu", + "merdrignac" : "superu", + "merville" : "superu", + "meslaydumaine" : "superu", + "mirambeau" : "superu", + "mirepoix" : "superu", + "moncoutant" : "superu", + "mondeville" : "superu", + "mondoubleau" : "superu", + "montarnaud" : "superu", + "montauban" : "superu", + "montbeliardsaintesuzanne" : "superu", + "montfortlegesnois" : "superu", + "montgeron" : "superu", + "montlouis" : "superu", + "montluel-1" : "superu", + "montmelian" : "superu", + "montmoreau" : "superu", + "montmorillon" : "superu", + "montoirdebretagne" : "superu", + "montpellier" : "superu", + "montrabe" : "superu", + "montreuilbellay" : "superu", + "montreuilnvlefrance" : "superu", + "monts" : "superu", + "montsaintaignan" : "superu", + "morcenx" : "superu", + "mordelles" : "superu", + "mortagnesursevre" : "superu", + "muzillac" : "superu", + "nanteschenaie" : "superu", + "nantesdalby" : "superu", + "nantessaintjacques" : "superu", + "negrepelisse" : "superu", + "neuillepontpierre" : "superu", + "neuillysurmarneptegournay" : "superu", + "neuvilleauxbois" : "superu", + "neuvilledepoitou" : "superu", + "nexon" : "superu", + "nieulsurmer" : "superu", + "niort" : "superu", + "noe" : "superu", + "noirmoutier" : "superu", + "noisiel" : "superu", + "noisylegdchampy" : "superu", + "noisylegrandcossonneau" : "superu", + "noisylegrandperi" : "superu", + "noisyleroi" : "superu", + "nontron" : "superu", + "nortsurerdre" : "superu", + "notredamedesanilhac" : "superu", + "noyalchatillon" : "superu", + "nozay" : "superu", + "nyons" : "superu", + "olemps" : "superu", + "olonnesurmer" : "superu", + "onetlechateau" : "superu", + "orgelet" : "superu", + "orthez" : "superu", + "ouillylevicomte" : "superu", + "paimboeuf" : "superu", + "parentis" : "superu", + "parigneleveque" : "superu", + "parisclichy" : "superu", + "pariscustine" : "superu", + "parisornano" : "superu", + "parispaulbert" : "superu", + "passy-1" : "superu", + "paysdemontaigu" : "superu", + "paysdemontfort" : "superu", + "payslionnais" : "superu", + "perpignandesnoyes" : "superu", + "perreux" : "superu", + "pignan" : "superu", + "pineuilh" : "superu", + "pipriac" : "superu", + "plabennec" : "superu", + "plelanlegrand" : "superu", + "plemet" : "superu", + "plestinlesgreves" : "superu", + "pleurtuit" : "superu", + "pleyberchrist" : "superu", + "plobannalec" : "superu", + "ploermel" : "superu", + "plogonnec" : "superu", + "plouarzel" : "superu", + "plouersurrance" : "superu", + "plougasteldaoulas" : "superu", + "pluvigner" : "superu", + "podensac" : "superu", + "poitierssud" : "superu", + "pomerols" : "superu", + "pontcharra" : "superu", + "pontcroix" : "superu", + "pontdain" : "superu", + "pontduchateau" : "superu", + "pontivy" : "superu", + "pontsaintmartin" : "superu", + "pontscorff" : "superu", + "pornicouest" : "superu", + "portlanouvelle" : "superu", + "pouance" : "superu", + "pouilleylesvignes" : "superu", + "pouilly" : "superu", + "pouzauges" : "superu", + "prades" : "superu", + "preenpail" : "superu", + "pringy" : "superu", + "prisse" : "superu", + "pruniersensologne" : "superu", + "quiberon" : "superu", + "rennesfougeres" : "superu", + "rennessaintgregoire" : "superu", + "rennessaintjacques" : "superu", + "rennessud" : "superu", + "retiers" : "superu", + "reveltourdan" : "superu", + "reze" : "superu", + "rochelezbeaupre" : "superu", + "roissyenbrie" : "superu", + "romans" : "superu", + "romansmeilleux" : "superu", + "romille" : "superu", + "rosporden" : "superu", + "rouillac-2" : "superu", + "roujan" : "superu", + "royan" : [ + "superu", + "uexpress" + ], + "ruoms" : "superu", + "sablesursarthe" : "superu", + "saintaffrique" : "superu", + "saintaignan" : "superu", + "saintamour" : "superu", + "saintaquilindepacy" : "superu", + "saintaubindaubigne" : "superu", + "saintbarthcoeurdeville" : "superu", + "saintbarthelemy" : "superu", + "saintbenoitdusault" : "superu", + "saintbrevinlespins" : "superu", + "saintbriceencogles" : "superu", + "saintchelydapcher" : "superu", + "saintcierssurgironde" : "superu", + "saintcontest" : "superu", + "saintdonat" : "superu", + "saintebazeille" : "superu", + "saintegenevieve" : "superu", + "saintejammesursarthe" : "superu", + "saintemereeglise" : "superu", + "saintepazanne" : "superu", + "saintetiennedemontluc" : "superu", + "saintetiennesaintgeoirs" : "superu", + "saintflorentsurcher" : "superu", + "saintfulgent" : "superu", + "saintgeorgesdedidonne" : "superu", + "saintgeorgeslesbaillargeaux" : "superu", + "saintgeorgessurloire" : "superu", + "saintgermaindubois" : "superu", + "saintgermainlembron" : "superu", + "saintgildasdesbois" : "superu", + "saintgillescroixdevie" : "superu", + "saintherblain" : "superu", + "sainthippolytedufort" : "superu", + "saintjames" : "superu", + "saintjeandemonts" : "superu", + "saintjorioz" : "superu", + "saintlangislesmortagne" : "superu", + "saintlaurentengrandvaux" : "superu", + "saintlaurentmedoc" : "superu", + "saintlaurentnouan" : "superu", + "saintlegerdelamartiniere" : "superu", + "saintmacaireenmauges" : "superu", + "saintmarslajaille" : "superu", + "saintmartialdalbarede" : "superu", + "saintmartindeseignanx" : "superu", + "saintmeenlegrand" : "superu", + "saintmichelchefchef" : "superu", + "saintnazaire" : "superu", + "saintnicolasdupelem" : "superu", + "saintpalaissurmer" : "superu", + "saintperesurloire" : "superu", + "saintpierredoleron" : "superu", + "saintpoldeleon" : "superu", + "saintpryvesaintmesmin" : "superu", + "saintpython" : "superu", + "saintremydesille" : "superu", + "saintrogatien" : "superu", + "saintsauveurlevicomte" : "superu", + "saintsavinien" : "superu", + "saintsebastiensurloire" : "superu", + "saintseurinsurlisle" : "superu", + "saintsorlinenvalloire" : "superu", + "saintsulpice" : "superu", + "saintsylvaindanjou" : "superu", + "saintvit" : "superu", + "saintyrieixsurcharente" : "superu", + "salbris" : "superu", + "saline" : "superu", + "salinslesbains" : "superu", + "salinslesthermes" : "superu", + "sandillon" : "superu", + "saone" : "superu", + "sartillybaiebocage" : "superu", + "saujon" : "superu", + "saumur" : "superu", + "sautron" : "superu", + "sauveterredeguyenne" : "superu", + "sauzevaussais" : "superu", + "savignelathan" : "superu", + "savigneux" : "superu", + "savignysurorge" : "superu", + "secondigny" : "superu", + "segre" : "superu", + "seilhac" : "superu", + "sellessurcher" : "superu", + "senneceylesdijon" : "superu", + "serqueux" : "superu", + "servian" : "superu", + "sombernon" : "superu", + "soual" : "superu", + "stegenevieve" : "superu", + "surylecomtal" : "superu", + "talantarandes" : "superu", + "talantbelvedere" : "superu", + "talmontsainthilaire" : "superu", + "taninges" : "superu", + "tarasconsurariege" : "superu", + "tavaux" : "superu", + "terdeghem" : "superu", + "terresdecaux" : "superu", + "thezanlesbeziers" : "superu", + "thouarce" : "superu", + "thouaresurloire" : "superu", + "thouars" : "superu", + "thourotte" : "superu", + "thuirlesaspres" : "superu", + "tierce" : "superu", + "tinteniac" : "superu", + "tonnaycharente" : "superu", + "trebes" : "superu", + "tregastel" : "superu", + "treguier" : "superu", + "treillieres" : "superu", + "trelazelapyramide" : "superu", + "trelazelaquantiniere" : "superu", + "tullelaguenne" : "superu", + "ustaritz" : "superu", + "uzerche" : "superu", + "valdahon" : "superu", + "valdoie" : "superu", + "valdoust" : "superu", + "varades" : "superu", + "vaucresson" : "superu", + "venareyleslaumes" : "superu", + "verdunsurgaronne" : "superu", + "vergeze" : "superu", + "verneuilsurvienne" : "superu", + "verniolle" : "superu", + "vernoillefourrier" : "superu", + "vernousurbrenne" : "superu", + "vertou" : "superu", + "viclecomte" : "superu", + "vierzon" : "superu", + "vihiers" : "superu", + "villaines" : "superu", + "villarslesdombes" : "superu", + "villeboislavalette" : "superu", + "villeurbanne" : "superu", + "vinzier" : "superu", + "viroflay" : "superu", + "vivonne" : "superu", + "voiron" : "superu", + "voreppe" : "superu", + "vouille" : "superu", + "wormhout" : "superu", + "ydes" : "superu", + "yerville" : "superu", + "yssingeaux" : "superu", + "agen" : "uexpress", + "agoncoutainville" : "uexpress", + "allonzierlacaille" : "uexpress", + "ambares" : "uexpress", + "angersbeaussier" : "uexpress", + "angerscapucins" : "uexpress", + "angersuniversite" : "uexpress", + "argentat" : "uexpress", + "argentre" : "uexpress", + "bavilliers" : "uexpress", + "bayeux" : "uexpress", + "bayonne" : "uexpress", + "bazouges" : "uexpress", + "bernay" : "uexpress", + "bolbec" : "uexpress", + "bordeauxcapucins" : "uexpress", + "bordeauxdelacroix" : "uexpress", + "bordeauxnansouty" : "uexpress", + "bordeauxsaintecatherine" : "uexpress", + "bourgneufenretz" : "uexpress", + "brax" : "uexpress", + "brestrecouvrance" : "uexpress", + "briare" : "uexpress", + "calvisson" : "uexpress", + "camaret" : "uexpress", + "castelmoronsurlot" : "uexpress", + "ceyzeriat" : "uexpress", + "chateauneufdurhone" : "uexpress", + "chateaurenard" : "uexpress", + "chateauroux" : "uexpress", + "chauvigny" : "uexpress", + "chefboutonne" : "uexpress", + "cholet" : "uexpress", + "cleder" : "uexpress", + "condesurvire" : "uexpress", + "corbelin" : "uexpress", + "crozon" : "uexpress", + "cuiseaux" : "uexpress", + "die" : "uexpress", + "dijon" : "uexpress", + "dompierresurmer" : "uexpress", + "feyzin" : "uexpress", + "gabarret" : "uexpress", + "gouesnou" : "uexpress", + "grandfougeray" : "uexpress", + "grandvillage" : "uexpress", + "grenoblevizille" : "uexpress", + "guerlesquin" : "uexpress", + "hautegoulaine" : "uexpress", + "idron" : "uexpress", + "isle" : "uexpress", + "jarnac" : "uexpress", + "labazoge" : "uexpress", + "lagarnache" : "uexpress", + "lagrandemotte" : "uexpress", + "lahayepesnel" : "uexpress", + "langon" : "uexpress", + "larochellemireuil" : "uexpress", + "latremblade" : "uexpress", + "lebarp" : "uexpress", + "leblanc" : "uexpress", + "lebourget" : "uexpress", + "lehavre" : "uexpress", + "lemansbollee" : "uexpress", + "lemansdegaulle" : "uexpress", + "lemansrepublique" : "uexpress", + "lemesnilleroi" : "uexpress", + "lencloitre" : "uexpress", + "leognan" : "uexpress", + "lesdeuxalpes" : "uexpress", + "lesessartsleroi" : "uexpress", + "levalloisperret" : "uexpress", + "lhuisserie" : "uexpress", + "lillesaintsebastien" : "uexpress", + "limogesgaredescharentes" : "uexpress", + "loiron" : "uexpress", + "lorient" : "uexpress", + "lyon2eme" : "uexpress", + "lyon3bonnel" : "uexpress", + "lyon6emevilleurbanne" : "uexpress", + "lyonalbertthomas" : "uexpress", + "lyoncroixrousse" : "uexpress", + "lyonmonplaisirlumiere" : "uexpress", + "lyonmontchat" : "uexpress", + "lyonpartdieu" : "uexpress", + "lyonrempartsdainay" : "uexpress", + "lyonsaintlouis" : "uexpress", + "lyonuniversite" : "uexpress", + "mandeure" : "uexpress", + "maraussan" : "uexpress", + "marciac" : "uexpress", + "marolleslesbraults" : "uexpress", + "marsillargues" : "uexpress", + "marsilly" : "uexpress", + "martainville" : "uexpress", + "matha" : "uexpress", + "mesanger" : "uexpress", + "meschers" : "uexpress", + "molietsetmaa" : "uexpress", + "montargis" : "uexpress", + "montbazens" : "uexpress", + "montdemarsan" : "uexpress", + "montendre" : "uexpress", + "montoiresurleloir" : "uexpress", + "montreuilsignac" : "uexpress", + "montrouge" : "uexpress", + "morlaas" : "uexpress", + "nantesbeaujoire" : "uexpress", + "nanteslafayette" : "uexpress", + "nantespetitport" : "uexpress", + "neuillysurseine" : "uexpress", + "nieul" : "uexpress", + "nieulledolent" : "uexpress", + "nimes" : "uexpress", + "oradoursurglane" : "uexpress", + "oradoursurvayres" : "uexpress", + "orchampsvennes" : "uexpress", + "orleanslasource" : "uexpress", + "ornans" : "uexpress", + "parischampionnet" : "uexpress", + "parisdufrenoy" : "uexpress", + "parisfederation" : "uexpress", + "parisjemmapes" : "uexpress", + "parislafayette" : "uexpress", + "parisoberkampf" : "uexpress", + "parisorfila" : "uexpress", + "parispetitscarreaux" : "uexpress", + "paristombeissoire" : "uexpress", + "perpignan" : "uexpress", + "perrecylesforges" : "uexpress", + "plouaret" : "uexpress", + "poissy" : "uexpress", + "poitierslescouronneries" : "uexpress", + "poitiersmermoz" : "uexpress", + "pontsaintesprit" : "uexpress", + "porniccentre" : "uexpress", + "pujols" : "uexpress", + "quintin" : "uexpress", + "redon" : "uexpress", + "rennesbeauregard" : "uexpress", + "rennesbrest" : "uexpress", + "renneshoche" : "uexpress", + "rennesliberte" : "uexpress", + "rennessainthelier" : "uexpress", + "rignac" : "uexpress", + "rochefortdugard" : "uexpress", + "rouenmairie" : "uexpress", + "rouenvieuxmarche" : "uexpress", + "roumazieres" : "uexpress", + "rueilmalmaison" : "uexpress", + "ruffieux" : "uexpress", + "saintaigulin" : "uexpress", + "saintbrieuccesson" : "uexpress", + "saintdenisdelhotel" : "uexpress", + "saintelucesurloire" : "uexpress", + "saintetiennemontplaisir" : "uexpress", + "saintgeorgesdubois" : "uexpress", + "sainthilairebonneval" : "uexpress", + "saintjacquessurdarnetal" : "uexpress", + "saintjeandevedas" : "uexpress", + "saintjeanducardonnay" : "uexpress", + "saintjeandugard" : "uexpress", + "saintlaurentdaigouze" : "uexpress", + "saintmarsdudesert" : "uexpress", + "saintmedarddemussidan" : "uexpress", + "saintpereenretz" : "uexpress", + "saintponsdethomieres" : "uexpress", + "saintromainengal" : "uexpress", + "saintsymphoriendozon" : "uexpress", + "salviac" : "uexpress", + "saultdenavailles" : "uexpress", + "semussac" : "uexpress", + "serezindurhone" : "uexpress", + "starnoultenyvelines" : "uexpress", + "stbonnetdejoux" : "uexpress", + "stdidiersurchalaronne" : "uexpress", + "stmaurdesfosses" : "uexpress", + "suresnes" : "uexpress", + "surgeres" : "uexpress", + "tourseurope" : "uexpress", + "toursgare" : "uexpress", + "vannes" : "uexpress", + "vauxsurmer" : "uexpress", + "vernaison" : "uexpress", + "vesoul" : "uexpress", + "vincennesdefrance" : "uexpress" +} \ No newline at end of file diff --git a/src/libJSON/systemeu_per_ens.json b/src/libJSON/systemeu_per_ens.json new file mode 100644 index 0000000..0b6e5f1 --- /dev/null +++ b/src/libJSON/systemeu_per_ens.json @@ -0,0 +1,840 @@ +{ + "hyperu" : [ + "abbeville", + "agde", + "aizenay", + "ales", + "barallemarquion", + "baule", + "biachesaintvaast", + "blain", + "blainvillesurorne", + "bourgueil", + "briecomterobert", + "challans", + "champagnole", + "chantonnay", + "chateaugiron", + "clermontlherault", + "combourg", + "douvresladelivrande", + "ecommoy", + "exincourt", + "fontenaylecomte", + "guichen", + "gujanmestras", + "hanches", + "lachapellesurerdre", + "lamontagne", + "larochellebeaulieu", + "larochesuryon", + "legrandquevilly", + "lesherbiers", + "mayenne", + "mende", + "montmorot", + "murserigne", + "nieppe", + "parthenay", + "perigueuxboulazac", + "plancoet", + "pontarlier", + "pontdebeauvoisin", + "rumilly", + "saintave", + "saintes", + "sainthilairederiez", + "saintjunien", + "saintphilbertdegrandlieu", + "saintromaindecolbosc", + "savenay", + "vallet", + "vernouillet", + "villefranchedelauragais", + "vitre", + "vitryenartois", + "yffiniac" + ], + "superu" : [ + "u-argentieres", + "aigueblanche", + "aiguilhe", + "aimargues", + "aixesurvienne", + "albert", + "alencon", + "alessalindres", + "alissas", + "ambazac", + "ancenis", + "andard", + "angersjustices", + "angresse", + "annonay", + "arbois", + "arcsurtille", + "argentsursauldre", + "arlanc", + "arnage", + "arradon", + "arthonenretz", + "arvert", + "athismons", + "audincourt", + "auneaubleurysaintsymphorien", + "auray", + "bans", + "bassens", + "bauge", + "baumelesdames", + "bazas", + "beaucouze", + "beaumonthague", + "beaumontlesvalence", + "beaumontsursarthe", + "beaunelarolande", + "beaupreau", + "beauvoirsurmer", + "beconlesgranits", + "belberaud", + "belinbeliet", + "belleileenmer", + "bellevigny", + "belz", + "benejacq", + "besancon", + "bessancourtmeuniers", + "bessesurbraye", + "bessieres", + "binic", + "biscarrosse", + "biviers", + "blangysurbresle", + "blayelesmines", + "bletterans", + "bonne", + "bonnetable", + "bonnysurloire", + "bonsecours", + "bouaye", + "bouloire", + "bourgsaintmaurice", + "brecey", + "brehal", + "brestkeredern", + "bretignollessurmer", + "bricquebecencotentin", + "brochongevrey", + "broons", + "brou", + "bruguieres", + "bruz", + "buxerolles", + "caen", + "camblanes", + "camphinenpevele", + "cancale", + "cande", + "carentoir", + "carquefou", + "castelnaulelez", + "castres", + "caussade", + "cavignac", + "cerizay", + "cestas", + "chabanais", + "chabris", + "chalettesurloing", + "chalonnessurloire", + "chambery", + "chamonix", + "champdeniers", + "chanceauxsurchoisille", + "change", + "charlysurmarne", + "chateaubourg", + "chateaubriant", + "chateaudolonne", + "chateaulavalliere", + "chateauneuflaforet", + "chateauneufsurcharente", + "chateauneufsurloire", + "chateauneufsursarthe", + "chatellerault", + "chatilloncoligny", + "chatouberteaux", + "chemille", + "chenove", + "chinon", + "chissayentouraine", + "civray", + "clamartcentre", + "claoueylege", + "cognin", + "colombe", + "colombelles", + "colomiers", + "combrit", + "condeennormandie", + "conlie-1", + "contres", + "corze", + "couillypontauxdames", + "coulongessurlautize", + "coursan", + "courvillesureure", + "cozes", + "craonsaintclement", + "craponnesurarzon", + "daoulas", + "decazeville", + "derval", + "devecey", + "dieulefit", + "doldebretagne", + "dompierresurbesbre", + "donzere", + "douelafontaine", + "dozule", + "draveil", + "dunsurauron", + "durtal", + "eaunes", + "echillais", + "echire", + "ecouen", + "egat", + "egletons-1", + "eguzon", + "ernee", + "erquy", + "espalion", + "essert", + "etrepagny", + "evreux", + "evron", + "eysines", + "farguessainthilaire", + "fereentardenois", + "ferrieresenbray", + "feytiat", + "flixecourt", + "flourens", + "fonbeauzard", + "fontenaylefleury", + "fouraslesbains", + "franquevillesaintpierre", + "frasne", + "fresnaysursarthe", + "gagnac", + "galgon", + "gan", + "ganges", + "gemozac", + "gennes", + "gergy", + "getigne", + "gorron", + "gourdanpolignan", + "grandfortphilippe", + "grenadesurgaronne", + "grenoble", + "guemenepenfao", + "guidel", + "guipavas", + "guipry", + "hazebrouck", + "heric", + "hericourt", + "herouvillesaintclair", + "houplines", + "ifs", + "igoville", + "illesurtet", + "janze", + "josselin", + "jouelestours", + "labastidesaintpierre", + "labathie", + "labruffiere", + "lacanau", + "lachabossiere", + "lachapellebassemer", + "lachartresurleloir", + "lachataigneraie", + "lachatre", + "lachaume", + "lacouronne", + "lafertesaintaubin", + "laguerchedebretagne", + "laiguillonsurmer", + "laiz", + "lamadeleine", + "lamastre", + "lamotheachard", + "lamotteservolex", + "lamure", + "landivisiau", + "landudec", + "langeac", + "lanmeur", + "lanvallay", + "lanvollon", + "lapommeraye", + "laravoire", + "larbresle", + "lariche", + "larocheposay", + "larochesuryon", + "larochette", + "lasuzesursarthe", + "latourette", + "latranchesurmer", + "laturballe", + "lavardac", + "lavaur", + "lavelanet", + "laverpilliere", + "lebourgneuflaforet", + "lechateaudoleron", + "lechesnaypottier", + "lecheylard", + "lefaou", + "lege", + "legrauduroiportdepeche", + "leguevin", + "lehavreporteoceane", + "lehom", + "lemans", + "lemolaylittry", + "lepalaissurvienne", + "leplessisrobinson", + "leplessistrevise", + "leportmarly", + "lerheu", + "lerussey", + "lesessarts", + "leshouches", + "lespieux", + "lesvans", + "levigan", + "levroux", + "lhermitage", + "lhorme", + "liffre", + "ligne", + "lilebouchard", + "limoges", + "limogescorgnac", + "limoux", + "lislejourdain", + "litetmixe", + "loches", + "lodeve", + "loisin", + "longuejumelles", + "loudeac", + "loudun", + "loury", + "louvignedudesert", + "lubersac", + "lucon", + "lumbres", + "luynes", + "lyon6eme", + "lyongerland", + "lyonmaisonsneuves", + "lyonmoulinavent", + "machecoul", + "magland", + "magne", + "malansac", + "malemort", + "mamers", + "mansle", + "marans", + "mareilenchampagne", + "marguerittes", + "marignier", + "marmande", + "maromme", + "martrestolosane", + "marvejols", + "masseube", + "matignon", + "maubourguet", + "mauleon", + "maulevrier", + "mauron-1", + "mauvezin", + "maze", + "melesse", + "mer", + "merdrignac", + "merville", + "meslaydumaine", + "mirambeau", + "mirepoix", + "moncoutant", + "mondeville", + "mondoubleau", + "montarnaud", + "montauban", + "montbeliardsaintesuzanne", + "montfortlegesnois", + "montgeron", + "montlouis", + "montluel-1", + "montmelian", + "montmoreau", + "montmorillon", + "montoirdebretagne", + "montpellier", + "montrabe", + "montreuilbellay", + "montreuilnvlefrance", + "monts", + "montsaintaignan", + "morcenx", + "mordelles", + "mortagnesursevre", + "muzillac", + "nanteschenaie", + "nantesdalby", + "nantessaintjacques", + "negrepelisse", + "neuillepontpierre", + "neuillysurmarneptegournay", + "neuvilleauxbois", + "neuvilledepoitou", + "nexon", + "nieulsurmer", + "niort", + "noe", + "noirmoutier", + "noisiel", + "noisylegdchampy", + "noisylegrandcossonneau", + "noisylegrandperi", + "noisyleroi", + "nontron", + "nortsurerdre", + "notredamedesanilhac", + "noyalchatillon", + "nozay", + "nyons", + "olemps", + "olonnesurmer", + "onetlechateau", + "orgelet", + "orthez", + "ouillylevicomte", + "paimboeuf", + "parentis", + "parigneleveque", + "parisclichy", + "pariscustine", + "parisornano", + "parispaulbert", + "passy-1", + "paysdemontaigu", + "paysdemontfort", + "payslionnais", + "perpignandesnoyes", + "perreux", + "pignan", + "pineuilh", + "pipriac", + "plabennec", + "plelanlegrand", + "plemet", + "plestinlesgreves", + "pleurtuit", + "pleyberchrist", + "plobannalec", + "ploermel", + "plogonnec", + "plouarzel", + "plouersurrance", + "plougasteldaoulas", + "pluvigner", + "podensac", + "poitierssud", + "pomerols", + "pontcharra", + "pontcroix", + "pontdain", + "pontduchateau", + "pontivy", + "pontsaintmartin", + "pontscorff", + "pornicouest", + "portlanouvelle", + "pouance", + "pouilleylesvignes", + "pouilly", + "pouzauges", + "prades", + "preenpail", + "pringy", + "prisse", + "pruniersensologne", + "quiberon", + "rennesfougeres", + "rennessaintgregoire", + "rennessaintjacques", + "rennessud", + "retiers", + "reveltourdan", + "reze", + "rochelezbeaupre", + "roissyenbrie", + "romans", + "romansmeilleux", + "romille", + "rosporden", + "rouillac-2", + "roujan", + "royan", + "ruoms", + "sablesursarthe", + "saintaffrique", + "saintaignan", + "saintamour", + "saintaquilindepacy", + "saintaubindaubigne", + "saintbarthcoeurdeville", + "saintbarthelemy", + "saintbenoitdusault", + "saintbrevinlespins", + "saintbriceencogles", + "saintchelydapcher", + "saintcierssurgironde", + "saintcontest", + "saintdonat", + "saintebazeille", + "saintegenevieve", + "saintejammesursarthe", + "saintemereeglise", + "saintepazanne", + "saintetiennedemontluc", + "saintetiennesaintgeoirs", + "saintflorentsurcher", + "saintfulgent", + "saintgeorgesdedidonne", + "saintgeorgeslesbaillargeaux", + "saintgeorgessurloire", + "saintgermaindubois", + "saintgermainlembron", + "saintgildasdesbois", + "saintgillescroixdevie", + "saintherblain", + "sainthippolytedufort", + "saintjames", + "saintjeandemonts", + "saintjorioz", + "saintlangislesmortagne", + "saintlaurentengrandvaux", + "saintlaurentmedoc", + "saintlaurentnouan", + "saintlegerdelamartiniere", + "saintmacaireenmauges", + "saintmarslajaille", + "saintmartialdalbarede", + "saintmartindeseignanx", + "saintmeenlegrand", + "saintmichelchefchef", + "saintnazaire", + "saintnicolasdupelem", + "saintpalaissurmer", + "saintperesurloire", + "saintpierredoleron", + "saintpoldeleon", + "saintpryvesaintmesmin", + "saintpython", + "saintremydesille", + "saintrogatien", + "saintsauveurlevicomte", + "saintsavinien", + "saintsebastiensurloire", + "saintseurinsurlisle", + "saintsorlinenvalloire", + "saintsulpice", + "saintsylvaindanjou", + "saintvit", + "saintyrieixsurcharente", + "salbris", + "saline", + "salinslesbains", + "salinslesthermes", + "sandillon", + "saone", + "sartillybaiebocage", + "saujon", + "saumur", + "sautron", + "sauveterredeguyenne", + "sauzevaussais", + "savignelathan", + "savigneux", + "savignysurorge", + "secondigny", + "segre", + "seilhac", + "sellessurcher", + "senneceylesdijon", + "serqueux", + "servian", + "sombernon", + "soual", + "stegenevieve", + "surylecomtal", + "talantarandes", + "talantbelvedere", + "talmontsainthilaire", + "taninges", + "tarasconsurariege", + "tavaux", + "terdeghem", + "terresdecaux", + "thezanlesbeziers", + "thouarce", + "thouaresurloire", + "thouars", + "thourotte", + "thuirlesaspres", + "tierce", + "tinteniac", + "tonnaycharente", + "trebes", + "tregastel", + "treguier", + "treillieres", + "trelazelapyramide", + "trelazelaquantiniere", + "tullelaguenne", + "ustaritz", + "uzerche", + "valdahon", + "valdoie", + "valdoust", + "varades", + "vaucresson", + "venareyleslaumes", + "verdunsurgaronne", + "vergeze", + "verneuilsurvienne", + "verniolle", + "vernoillefourrier", + "vernousurbrenne", + "vertou", + "viclecomte", + "vierzon", + "vihiers", + "villaines", + "villarslesdombes", + "villeboislavalette", + "villeurbanne", + "vinzier", + "viroflay", + "vivonne", + "voiron", + "voreppe", + "vouille", + "wormhout", + "ydes", + "yerville", + "yssingeaux" + ], + "uexpress" : [ + "agen", + "agoncoutainville", + "allonzierlacaille", + "ambares", + "angersbeaussier", + "angerscapucins", + "angersuniversite", + "argentat", + "argentre", + "bavilliers", + "bayeux", + "bayonne", + "bazouges", + "bernay", + "bolbec", + "bordeauxcapucins", + "bordeauxdelacroix", + "bordeauxnansouty", + "bordeauxsaintecatherine", + "bourgneufenretz", + "brax", + "brestrecouvrance", + "briare", + "calvisson", + "camaret", + "castelmoronsurlot", + "ceyzeriat", + "chamonix", + "chateauneufdurhone", + "chateaurenard", + "chateauroux", + "chauvigny", + "chefboutonne", + "cholet", + "cleder", + "condesurvire", + "corbelin", + "crozon", + "cuiseaux", + "die", + "dijon", + "dompierresurmer", + "feyzin", + "gabarret", + "gouesnou", + "grandfougeray", + "grandvillage", + "grenoblevizille", + "guerlesquin", + "hautegoulaine", + "idron", + "isle", + "jarnac", + "labazoge", + "lagarnache", + "lagrandemotte", + "lahayepesnel", + "langon", + "larochellemireuil", + "latremblade", + "lebarp", + "leblanc", + "lebourget", + "lehavre", + "lemansbollee", + "lemansdegaulle", + "lemansrepublique", + "lemesnilleroi", + "lencloitre", + "leognan", + "lesdeuxalpes", + "lesessartsleroi", + "levalloisperret", + "lhuisserie", + "lillesaintsebastien", + "limogesgaredescharentes", + "loiron", + "lorient", + "lyon2eme", + "lyon3bonnel", + "lyon6emevilleurbanne", + "lyonalbertthomas", + "lyoncroixrousse", + "lyonmonplaisirlumiere", + "lyonmontchat", + "lyonpartdieu", + "lyonrempartsdainay", + "lyonsaintlouis", + "lyonuniversite", + "mandeure", + "maraussan", + "marciac", + "marolleslesbraults", + "marsillargues", + "marsilly", + "martainville", + "matha", + "mesanger", + "meschers", + "molietsetmaa", + "montargis", + "montbazens", + "montdemarsan", + "montendre", + "montoiresurleloir", + "montreuilsignac", + "montrouge", + "morlaas", + "nantesbeaujoire", + "nanteslafayette", + "nantespetitport", + "neuillysurseine", + "nieul", + "nieulledolent", + "nimes", + "oradoursurglane", + "oradoursurvayres", + "orchampsvennes", + "orleanslasource", + "ornans", + "parischampionnet", + "parisdufrenoy", + "parisfederation", + "parisjemmapes", + "parislafayette", + "parisoberkampf", + "parisorfila", + "parispetitscarreaux", + "paristombeissoire", + "perpignan", + "perrecylesforges", + "plouaret", + "poissy", + "poitierslescouronneries", + "poitiersmermoz", + "pontsaintesprit", + "porniccentre", + "pujols", + "quintin", + "redon", + "rennesbeauregard", + "rennesbrest", + "renneshoche", + "rennesliberte", + "rennessainthelier", + "rignac", + "rochefortdugard", + "rouenmairie", + "rouenvieuxmarche", + "roumazieres", + "royan", + "rueilmalmaison", + "ruffieux", + "saintaigulin", + "saintbrieuccesson", + "saintdenisdelhotel", + "saintelucesurloire", + "saintetiennemontplaisir", + "saintgeorgesdubois", + "sainthilairebonneval", + "saintjacquessurdarnetal", + "saintjeandevedas", + "saintjeanducardonnay", + "saintjeandugard", + "saintlaurentdaigouze", + "saintmarsdudesert", + "saintmedarddemussidan", + "saintpereenretz", + "saintponsdethomieres", + "saintromainengal", + "saintsymphoriendozon", + "salviac", + "saultdenavailles", + "semussac", + "serezindurhone", + "starnoultenyvelines", + "stbonnetdejoux", + "stdidiersurchalaronne", + "stmaurdesfosses", + "suresnes", + "surgeres", + "tourseurope", + "toursgare", + "vannes", + "vauxsurmer", + "vernaison", + "vesoul", + "vincennesdefrance" + ] +} \ No newline at end of file diff --git a/src/scrape_su.js b/src/scrape_su.js index b4d70db..24f3130 100644 --- a/src/scrape_su.js +++ b/src/scrape_su.js @@ -59,13 +59,16 @@ async function scrape(url,town,product) { //await page.waitForTimeout(2000); await page.screenshot({path:'screen_home_su.png'}); await page.waitForSelector('#popin_tc_privacy_button_2'); - await page.click('#popin_tc_privacy_button_2'); + + /*await page.click('#popin_tc_privacy_button_2'); // -----------------------NO DETECTION BOT USAGE (15 hit OK)----------------------------// await page.waitForSelector('#store-search'); await page.type('#store-search',town,{delay: 100}); // -----------------------NO DETECTION BOT USAGE (15 hit OK)----------------------------// - await page.waitForTimeout(3000); //-> necessary ? delay ? + //await page.waitForTimeout(3000); //-> necessary ? delay ? + const sleep = ms => new Promise(res => setTimeout(res, ms)); + await sleep(3000); await page.waitForSelector('.ab-prehome-search-suggestion'); await page.click('.ab-prehome-search-suggestion'); @@ -76,7 +79,7 @@ async function scrape(url,town,product) { await page.click('.store-delivery-mode-arrow'); await page.waitForSelector('.ui-button'); const wq2 = await page.$('.ui-button'); - wq2.click(); + wq2.click();*/ /*if(wq2 === null) { // - NO Question console.log("no wq2"); // OK } @@ -89,7 +92,8 @@ async function scrape(url,town,product) { if(wq2_pos !== null) wq2.click(); }*/ - await page.waitForTimeout(1000); + //await page.waitForTimeout(1000); + /*await sleep(1000); await page.type('#q',product,{delay: 100}); await page.waitForTimeout(1000); const suggets1 = await page.$('xpath//html/body/div[3]/main/div[1]/header/div[4]/div[2]/div/div[1]/div[1]/div[1]/a'); @@ -121,15 +125,67 @@ async function scrape(url,town,product) { // -----------------------NO DETECTION BOT USAGE(n hit OK ?)----------------------------// for(var i = 2 ; i < nb_page+1; i++) { await page.goto(_url+ '&page='+i); - await page.waitForTimeout(1000); + //await page.waitForTimeout(1000); + await sleep(1000); const content = await page.content(); const sub_line = content.substring(content.indexOf("products")); retour += sub_line.substring(0,sub_line.indexOf("page_filter")) + "\n"; - } - console.log(retour); + }*/ + //console.log(retour); + const content = await page.content(); + console.log(content) await browser.close(); } -url = "https://www.coursesu.com/drive/home"; -town = argv[2]; +//url = "https://www.coursesu.com/drive/home"; +//url2 = "https://www.coursesu.com/drive-superu-"; +link = argv[2]; product = argv[3]; -scrape(url,town,product); \ No newline at end of file +scrape_v2(link,product); + + +async function scrape_v2(url,product) { + const sleep = ms => new Promise(res => setTimeout(res, ms)); + const browser = await puppeteer.launch({headless: 'new'}); + const page = await browser.newPage(); + //parse town if it's necessary -> PHP better + await page.goto(url); + const url_ = await page.url(); + console.log(url_); + console.log(product); + const title = await page.title(); + console.log(title); + + const dD = url_.indexOf("on/demand"); + console.log(dD); + if(dD != -1) { + console.log("DataDome activate"); + //break_js.loadedBrk(page,url,'#captcha__puzzle','.slider',"canva_rd.png","screen_su.png"); + } + else { + console.log("No DataDome"); + } + // -----------------------NO DETECTION BOT USAGE (15 hit OK) ----------------------------// + await page.screenshot({path:'screen_home_su2.png'}); + await page.waitForSelector('#popin_tc_privacy_button'); + await page.click('#popin_tc_privacy_button'); + /*await page.waitForSelector('#q'); + await page.type('#q',product,{delay: 100}); + + await sleep(1000); + await page.screenshot({ path: 'screen_after_search_.png', fullPage: true }); // necessary Idk why + const suggets1 = await page.$('xpath//html/body/div[3]/main/div[1]/header/div[4]/div[2]/div/div[1]/div[1]/div[1]/a'); + if(suggets1 !== null) { + const suggets1_bouding = await suggets1.boundingBox(); + console.log(suggets1_bouding); + suggets1.click(); + } + await sleep(1000); + await page.screenshot({ path: 'screen_after_search2_.png', fullPage: true }); + + await sleep(5000); + await page.screenshot({ path: 'screen_after_search3_.png', fullPage: true }); + await sleep(1000);*/ + const content = await page.content(); + console.log(content); + await browser.close(); +} \ No newline at end of file diff --git a/src/scrapper_auchan.php b/src/scrapper_auchan.php index 474d366..0a43827 100644 --- a/src/scrapper_auchan.php +++ b/src/scrapper_auchan.php @@ -47,8 +47,8 @@ use Facebook\WebDriver\WebDriverKeys as WebDriverKeys; use Facebook\WebDriver\Firefox\FirefoxDriver as FirefoxDriver; use Facebook\WebDriver\Firefox\FirefoxProfile as FirefoxProfile; -require __DIR__ . '/../../../autoload.php'; // EXPORT -//require __DIR__ . '/../vendor/autoload.php'; // DEV +//require __DIR__ . '/../../../autoload.php'; // EXPORT +require __DIR__ . '/../vendor/autoload.php'; // DEV function extract_brand_a(string $label) : string { @@ -302,7 +302,7 @@ function extract_source_auchan(string $url,$driver, string $town, string $target $res_find[0]->sendKeys(WebDriverKeys::ENTER); } echo "AUCHA2:".$res_find[1]."\n"; - sleep(5); + sleep(1); $res_find = findElement_a($driver,"xpath","/html/body/div[3]/div[2]/div[2]/div[4]/article[1]/div[2]/footer/button",$res_find[1]); // click option if($res_find[0]!=="") { try { @@ -313,13 +313,24 @@ function extract_source_auchan(string $url,$driver, string $town, string $target $res_find[1] = $e->getMessage(); } } + try { + $driver->findElement(WebDriverBy::id('onetrust-accept-btn-handler'))->click(); // accept just try + } + catch(Exception $e) { + $res_find[1] = $e->getMessage(); + } + + //sleep(1); echo "AUCHA3:".$res_find[1]."\n"; - $res_find = findElement_a($driver,"xpath","/html/body/div[13]/div[1]/main/div[1]/div[1]/div/div[1]/input",$res_find[1]); + $res_find = findElement_a($driver,"xpath","/html/body/div[14]/div[1]/main/div[1]/div[1]/div/div[1]/input",$res_find[1]); + $driver->takescreenshot('t.png'); + //echo "res_find1 : ".$res_find[1]."\n"; + var_dump($res_find[1]); if($res_find[0]!=="") $res_find[0]->sendKeys($town); echo "AUCHA4:".$res_find[1]."\n"; - sleep(2); - $res_find = findElement_a($driver,"class","journey__search-suggests-list",$res_find[1]); // click option + sleep(3); + $res_find = findElement_a($driver,"class","journey__search-suggests-list",$res_find[1]); // click option*/ if($res_find[0]!=="") { try { sleep(1); // for the moment @@ -329,8 +340,11 @@ function extract_source_auchan(string $url,$driver, string $town, string $target $res_find[1] = $e->getMessage(); } } + + sleep(2); + $driver->takescreenshot('t2.png'); echo "AUCHA5:".$res_find[1]."\n"; - $res_find = findElement_a($driver,"xpath","/html/body/div[13]/div[1]/main/div[1]/div[2]/div[2]/section/div[1]/div/div/div[2]/form/button",$res_find[1]); + $res_find = findElement_a($driver,"xpath","/html/body/div[14]/div[1]/main/div[1]/div[2]/div[2]/section/div[1]/div/div/div[2]/form/button",$res_find[1]); if($res_find[0]!=="") $res_find[0]->submit(); sleep(4); @@ -344,6 +358,7 @@ function extract_source_auchan(string $url,$driver, string $town, string $target } } if($error !== "") { + var_dump($driver->getPageSource()); $driver->quit(); return array(); } diff --git a/src/scrapper_carrefour.php b/src/scrapper_carrefour.php index 607f705..104e179 100644 --- a/src/scrapper_carrefour.php +++ b/src/scrapper_carrefour.php @@ -51,8 +51,8 @@ use Facebook\WebDriver\WebDriverExpectedCondition as WebDriverExpectedCondition; use Facebook\WebDriver\Firefox\FirefoxDriver as FirefoxDriver; use Facebook\WebDriver\Firefox\FirefoxProfile as FirefoxProfile; -require __DIR__ . '/../../../autoload.php'; // EXPORT -//require __DIR__ . '/../vendor/autoload.php'; // DEV +//require __DIR__ . '/../../../autoload.php'; // EXPORT +require __DIR__ . '/../vendor/autoload.php'; // DEV function extract_brand_c(string $title) : string { preg_match_all('/[A-Z][A-Z]+/',$title,$matches2); @@ -410,7 +410,6 @@ function parse_json_product(string $output_json) : array { ], ], "packaging" => [], - "nutriscore" => [], ]; $page_needed_key = [ // On META @@ -519,8 +518,7 @@ function content_scrap_carrefour(string $target_product, string $city, int $p, b ], ], ], - "packaging" => [], - "nutriscore" => [], + "packaging" => [] ]; $page_needed_key = [ // On META @@ -543,16 +541,18 @@ function content_scrap_carrefour(string $target_product, string $city, int $p, b $nb_page = $infos['totalPage']; $current_page = $infos['currentPage']; $next_page = $current_page+1; - for($i = $next_page ; $i < $nb_page+1 ; $i++) { - $url_ = $url."&noRedirect=1&page=".$i; - $file_content = extract_source_carrefour($url_,$driver,$city,$target_product); - if($file_content !== "") { - $sp_res = search_product_in_script_json_c($file_content,$target_product); - if(empty($sp_res)) { - $driver->quit(); - return $rtn; + if($nb_page < 5) { + for($i = $next_page ; $i < $nb_page+1 ; $i++) { + $url_ = $url."&noRedirect=1&page=".$i; + $file_content = extract_source_carrefour($url_,$driver,$city,$target_product); + if($file_content !== "") { + $sp_res = search_product_in_script_json_c($file_content,$target_product); + if(empty($sp_res)) { + $driver->quit(); + return $rtn; + } + $rtn = array_merge($rtn,extract_info_for_all_products_c($sp_res["products"],$product_needed_key)); } - $rtn = array_merge($rtn,extract_info_for_all_products_c($sp_res["products"],$product_needed_key)); } } $driver->quit(); diff --git a/src/scrapper_intermarche.php b/src/scrapper_intermarche.php index 103da4e..7aad7e2 100644 --- a/src/scrapper_intermarche.php +++ b/src/scrapper_intermarche.php @@ -58,8 +58,8 @@ use Facebook\WebDriver\WebDriverKeys as WebDriverKeys; use Facebook\WebDriver\Firefox\FirefoxDriver as FirefoxDriver; use Facebook\WebDriver\Firefox\FirefoxProfile as FirefoxProfile; -require __DIR__ . '/../../../autoload.php'; // EXPORT -//require __DIR__ . '/../vendor/autoload.php'; // DEV +//require __DIR__ . '/../../../autoload.php'; // EXPORT +require __DIR__ . '/../vendor/autoload.php'; // DEV function change_quantity_i(string $libelle, $kg_price, $price) : string { preg_match_all('!\d+(?:\.\d{1,2})?!', $libelle, $matches); diff --git a/src/scrapper_monoprix.php b/src/scrapper_monoprix.php index 9b1717d..971a708 100644 --- a/src/scrapper_monoprix.php +++ b/src/scrapper_monoprix.php @@ -45,8 +45,8 @@ use Facebook\WebDriver\Remote\RemoteWebDriver as RemoteWebDriver; use Facebook\WebDriver\Firefox\FirefoxDriver as FirefoxDriver; use Facebook\WebDriver\Firefox\FirefoxProfile as FirefoxProfile; -require __DIR__ . '/../../../autoload.php'; // EXPORT -//require __DIR__ . '/../vendor/autoload.php'; // DEV +//require __DIR__ . '/../../../autoload.php'; // EXPORT +require __DIR__ . '/../vendor/autoload.php'; // DEV function change_quantity_m(string $libelle) : string { $libelle = strtolower($libelle); diff --git a/src/scrapper_systemeu.php b/src/scrapper_systemeu.php index 334da25..a6a9a8e 100644 --- a/src/scrapper_systemeu.php +++ b/src/scrapper_systemeu.php @@ -39,6 +39,16 @@ // URL1 = https://www.coursesu.com/drive/home namespace ChriSmile0\Scrapper; +function town_in_specific_syntax(string $town) : string { + $unwanted_array = array( 'Š'=>'S', 'š'=>'s', 'Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', + 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', + 'Ú'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss', 'à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a', 'å'=>'a', 'æ'=>'a', 'ç'=>'c', + 'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o', + 'ö'=>'o', 'ø'=>'o', 'ù'=>'u', 'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'þ'=>'b', 'ÿ'=>'y' ); + $str = strtr( $town, $unwanted_array ); + $tr = str_replace(array(' ','-','\''), '',$str); + return strtolower($tr); +} function change_quantity_u(string $libelle) : string { $libelle = strtolower($libelle); @@ -89,7 +99,42 @@ function change_quantity_u(string $libelle) : string { return $libelle; } - +/** + * [BRIEF] A function for extract the html content of the leclerc website + * @param string $city The store to target + * @param string $type + * @example research_city_json("libJSON/.json","Paris") + * @author chriSmile0 + * @return string the url +*/ +function research_city_in_JSON_su(string $city, string $type) : string { + $file_content = file_get_contents(__DIR__."/libJSON/systemeu_per_city.json"); + $arr = json_decode($file_content,true); + $t = ""; + $c = ""; + $city_ = town_in_specific_syntax($city); + foreach($arr as $k => $v) { + if($k === $city_) { + if(is_array($v)) { + foreach($v as $val) + if($val === $type) { + $t = $val; + break; + } + if($t === "") { + $t = $v[0]; + } + } + $t = ($t === "") ? $v : $t; + $c = $k; + break; + } + } + if($t === "" || $c === "") + return ""; + $universal_URL = "https://www.coursesu.com/drive-"; + return $universal_URL."$t-"."$c"; +} /** * [BRIEF] simulate the url get in the browser and return the display content @@ -102,12 +147,14 @@ function change_quantity_u(string $libelle) : string { */ function extract_source_systemeu(string $town, string $target) : string { $town_ = escapeshellarg($town); + $link_ = research_city_in_JSON_su($town_,"superu"); + //return $link_; $nodeScriptPath = __DIR__.'/scrape_su.js'; // while $src.indexOF('products') == -1) ?? because not 100% regular for the moment $dest = __DIR__.'/products.txt'; - shell_exec("`node $nodeScriptPath $town_ $target > $dest`"); + shell_exec("`node $nodeScriptPath $link_ $target > $dest`"); $src = file_get_contents(__DIR__. "/products.txt"); // OK - shell_exec("rm $dest"); + //shell_exec("rm $dest"); return $src; } @@ -345,9 +392,10 @@ function main_s($argc, $argv) : bool { echo "EXECUTION FINISH WITH SUCCESS \n"; return 1; } +//var_dump(research_city_in_JSON_su("chamonix","hyperu")); // OK //main_s($argc,$argv); -//var_dump(content_scrap_systemeu("Lardons","Voglans")); -//var_dump(extract_source_systemeu("Voglans","Lardons")); +//var_dump(content_scrap_systemeu("Lardons","Chambéry")); // WORK BUT DATADOME AGAIN +//var_dump(extract_source_systemeu("Chambéry","Lardons")); /** * [BRIEF] * @param diff --git a/your_project/process_p.php b/your_project/process_p.php index 42d84b3..50b86e9 100644 --- a/your_project/process_p.php +++ b/your_project/process_p.php @@ -145,8 +145,8 @@ function sort_list(array $products) { function main_(array $elements, int $web_server) { $str = my_json_encoding($elements); - exec("php usage.php $str $web_server > out.txt"); - $rtn = file_get_contents("out.txt"); + //exec("php usage.php $str $web_server > out.txt"); + $rtn = file_get_contents("proofs/dump_auchan.txt"); $parsing = parse_exec_usage($rtn); return $parsing; } @@ -155,6 +155,7 @@ function main_(array $elements, int $web_server) { $arr2 = array("Leclerc"=>["lardons","Voglans"]); $arr3 = array("Monoprix"=>["lardons"]); $arr23 = array("Leclerc"=>["lardons","Voglans"],"Monoprix"=>["lardons"]); +$arr31 = array("Auchan"=>["lardons","Paris"]); function my_json_encoding(array $to_encode) { // FOR MAIN PARAMETER @@ -354,5 +355,5 @@ function main(string $command_line, bool $web) { } //main(implode(" ",$argv),false); -main_($arr23,2); +var_dump(main_($arr31,2)); ?> \ No newline at end of file diff --git a/your_project/process_p2.php b/your_project/process_p2.php new file mode 100755 index 0000000..c9132d8 --- /dev/null +++ b/your_project/process_p2.php @@ -0,0 +1,564 @@ + ["lardons","Paris"], + "Leclerc" => ["lardons","Paris"], + "Auchan" => ["lardons","Paris"], + "SystemeU" => ["lardons","Paris"], + "Intermarche" => ["lardons","Paris"], + "Monoprix" => ["lardons"] +]; + +$names_products = [ // NAME PRODUCT + "Carrefour" => "title", + "Leclerc" => "sLibelleLigne1|sLibelleLigne2", + "Auchan" => "label", + "SystemeU" => "brand", + "Intermarche" => "informations", + "Monoprix" => "name" +]; + + +$finalLabels = [ + "name", + "price" +]; + +$Carrefour = [ // replace by get_items + "ean", + "title", + "brand", + "slug", + "offerServiceId", + "offers" => [ + "ean" => [ + "offerServiceId" => [ + "attributes" => [ + "price", + "promotion", + "promotions" + ], + ], + ], + ], + "packaging", + "nutriscore" +]; +$Leclerc = [ // replace by get items + "sLibelleLigne1", + "sLibelleLigne2", + "sPrixUnitaire", + "nrPVUnitaireTTC", + "sPrixPromo", + "sPrixParUniteDeMesure", + "nrPVParUniteDeMesureTTC", + "sUrlPageProduit" +]; + +/* +$elements0 = array("Leclerc"=>["Lardons","Voglans"],"Monoprix"=>["Lardons"]); +$elements1 = array("Leclerc"=>["Lardons","Voglans"]); +$elements3 = array("Monoprix"=>["Lardons"],"Carrefour"=>["Lardons","Paris"]); +$elements4 = array("Carrefour"=>["Lardons","Paris"]); +$elements5 = array("Monoprix"=>["lardons"]); +*/ + +$dis = $zone = $type = $product = $choices = ""; + +$all_types = ["Poisson","Viande","EpicerieSa","EpicerieSu","Pains","Patisserie" + ,"Charcuterie","Surgele","Boisson","Bebe","Bio","Hygiene","Beaute" + ,"Entretien","Nettoyage","Animalerie","Loisirs","Maison","Laiterie" + ,"Oeufs","Fruits","Legumes","Lardons","Saumon" +]; + +$rayons = ["Boulangerie","Fruits"]; // FOR ANOTHER UPDATE OF SCRAPPER (2.0? NOW=1.4) + +$choice_ens = array(); +$possible_ens = ["Carrefour","Leclerc","Monoprix","Auchan","Intermarche","SystemeU"];//ADD SU LATER +$active_ens = ["Carrefour"=>false,"Leclerc"=>false,"Monoprix"=>false,"Auchan"=>false,"Intermarche"=>false,"SystemeU"=>false]; + +$labelErr = $typeErr = ""; + +//---------------------------------UTILS--------------------------------------// +function test_input2($data) { + return (is_string($data)) ? htmlspecialchars(stripslashes(trim($data))) : FALSE; +} + +function validate_product(string $product, string $type) { + $nom = test_input2($product); + if(!preg_match("/^[a-zA-Z- éè]{2,30}$/",$nom)) { + switch($type) { + case "type": + $GLOBALS['typeErr'] = "Espace et tiret autorisés ainsi que les majuscules"; + break; + case "label": + $GLOBALS['labelErr'] = "Espace et tiret autorisés ainsi que les majuscules"; + break; + default: + break; + } + return FALSE; + } + return $nom; +} + +function cmp_label(string $label1, string $label2) { + $split_l1 = explode(" ",strtolower($label1)." "); + $split_l2 = explode(" ",strtolower($label2)." "); + $s1 = sizeof($split_l1); + $s2 = sizeof($split_l2); + $i1 = 0; + $i2 = 0; + $commons1 = ""; + foreach($split_l1 as $sl1) { + foreach($split_l2 as $sl2) { + if($sl1 == $sl2) { + $commons1 .= " $sl1"; + $i1++; + break; + } + } + } + $commons2 = ""; + foreach($split_l2 as $sl2) { + foreach($split_l1 as $sl1) { + if($sl2 == $sl1) { + $commons2 .= " $sl2"; + $i2++; + break; + } + } + } + if(($s1 === $i1)) + return substr($commons1,1); + return ""; +} + + +function sort_list(array $products) { + $l = $products; + $sort = array(); + $index = 0; + foreach($l as $p) { + $found = false; + $index = 0; + foreach($sort as $s) { + if(($c = cmp_label($p['name'],$s['name'])) !== "") { + $found = TRUE; + break; + } + $index++; + } + if($found === TRUE) { + if(stristr($sort[$index]['ens'],$p['ens'])!==FALSE) + continue; + $sort[$index]['ens'] .= "|".$p['ens']; + $sort[$index]['prix'] .= "|".$p['prix']; + } + else + $sort[] = $p; + + } + return $sort; +} + +function init_in_ens(string $init) : string { + switch($init) { + case "c": + return "Carrefour"; + case "l": + return "Leclerc"; + case "m": + return "Monoprix"; + case "a": + return "Auchan"; + case "i": + return "Intermarche"; + case "s": + return "SystemeU"; + default: + return "X"; + break; + } +} + +//-----------------------------END UTILS--------------------------------------// +function main_(array $elements) { + $str = my_json_encoding($elements); + $cmd = PHP_BINDIR."/php " .__DIR__."/usage2.php $str > out.txt"; + exec($cmd); + $rtn = file_get_contents("out.txt"); + $parsing = parse_exec_usage($rtn); + return $parsing; +} + +function main_web(array $elements) { + $str = my_json_encoding($elements); + $cmd = PHP_BINDIR."/php " .__DIR__."/usage2.php $str"; + $rtn = exec($cmd); + $parsing = parse_exec_usage($rtn); + return $parsing; +} + +function my_json_encoding(array $to_encode) { // FOR MAIN PARAMETER + $str = json_encode($to_encode); + $res = ""; + $size = strlen($str); + for($i = 0; $i < $size ;$i++) + $res .= ($str[$i] === '"') ? '\"' : (($str[$i] === "'") ? "\'" : $str[$i]); + + return $res; +} + +function parse_exec_usage(string $rtn) { + return json_decode(substr($rtn,strpos($rtn,"{\"")),true); +} + +function create_cmp_product(array $all_products, string $compare_product) { // easy with 1.2 Scrapper Version + $save_products = array(); + + foreach($all_products as $k => $v) { + if($v !== NULL) { + $old_k = $k; + foreach($v as $k => $p) { // + if($old_k === "Carrefour") { + foreach($p as $val) { + //($val['brand']==="") ? "Inconnu" : $val["brand"] -> to store + $save_products[] = ["brand"=>$val['brand'],"name"=>$val['title']." ".$val["packaging"],"ens"=>$old_k.":".$k,"prix"=>$val['price']['price']]; + } + } + if($old_k === "Leclerc") { + foreach($p as $val) { + $save_products[] = ["brand"=>$val['brand'],"name"=>$val['sLibelleLigne1']." ".$val['sLibelleLigne2'],"ens"=>$old_k.":".$k,"prix"=>$val['nrPVUnitaireTTC']]; + } + } + if($old_k === "Monoprix") { + foreach($p as $val) { + $save_products[] = ["brand"=>$val['brand'],"name"=>$val['name'],"ens"=>$old_k.":".$k,"prix"=>$val['price']['current']['amount']]; + } + } + if($old_k === "Auchan") { + foreach($p as $val) { + $save_products[] = ["brand"=>$val['brand'],"name"=>$val['label']." ".$val['quantity'],"ens"=>$old_k.":".$k,"prix"=>$val['price']]; + } + } + if($old_k === "Intermarche") { + foreach($p as $val) { + $infos = $val["informations"]; + $save_products[] = ["brand"=>$infos['brand'],"name"=>$infos['title']." ".$infos["packaging"]." ".$infos["brand"],"ens"=>$old_k.":".$k,"prix"=>$val['prices']['value']]; + } + } + if($old_k === "SystemeU") { + foreach($p as $val) { + $save_products[] = ["brand"=>$val['brand'],"name"=>$val['name'],"ens"=>$old_k.":".$k,"prix"=>$val['price']]; + } + } + } + } + } + $all_brands = array(); + $products_by_brand = array(); + + foreach($save_products as $elem) { + if(!in_array($lower=strtolower($elem['brand']),$all_brands)) { + $all_brands[] = $lower; + $products_by_brand = array_merge($products_by_brand,[$lower=>[$elem['ens'],[$elem]]]); + } + else { + $products_by_brand[$lower][1][] = $elem; + if(stristr($products_by_brand[$lower][0],$elem['ens'])===FALSE) // REPLACE BY STR_CONTAINS IN PHP8.0 + $products_by_brand[$lower][0] .= "|".$elem['ens']; + } + + } + $cmp = 0; + if(sizeof($all_products)==1) + $cmp = -1; + + $comparable_ens = array(); + foreach($products_by_brand as $k=>$pb) + if((substr_count($pb[0],"|"))>$cmp) + $comparable_ens = array_merge($comparable_ens,[$k=>$pb]); + + $sort_list_p = array(); + foreach($comparable_ens as $k=>$pb) + $sort_list_p = array_merge($sort_list_p,[$k=>sort_list($pb[1])]); + + return $sort_list_p; +} + +function display_each_brand(array $comparable_brand) { + $rtn = ""; + $all_brands = array_keys($comparable_brand); + $rtn .= "
    "; + foreach($all_brands as $b) { + $br = (($b==="") ? "Inconnu" : $b); + $rtn .= "
    $br
    "; + $rtn .= ""; + foreach($comparable_brand[$b] as $product) { // [1] for comparable ens + $rtn .= display_each_product($product); + } + $rtn .= "
    NameENS:CityPrice
    "; + } + return $rtn . "
    "; +} + +function display_each_product(array $product) { + $rtn = ""; + foreach($product as $k=>$elem) { + if($k=="brand") + continue; + if(count(($tab_elem = explode("|",$elem)))>1) { + $rtn .= "
    "; + if($k=="prix") { + $min = min($tab_elem); + $spe = "style=\"border:solid blue;\""; + foreach($tab_elem as $t) + $rtn .= "$t"; + + } + else { + foreach($tab_elem as $t) + $rtn .= "$t"; + } + $rtn .= "
    "; + } + else { + $rtn .= "$elem "; + } + } + $rtn .= "\n"; + return $rtn; +} + +function display_compare(array $globals, string $product, string $label) { + $elements = array(); + foreach($globals as $k => $e) + $elements = array_merge($elements,[$k=>[$product,$e]]); + + $to_display = main_($elements); // OK + return display_each_brand(create_cmp_product($to_display,$label)); +} + +function display_compare_web(array $globals, string $product, string $label) { + $elements = array(); + foreach($globals as $k => $e) + $elements = array_merge($elements,[$k=>[$product,$e]]); + + $to_display = main_web($elements); // OK + return display_each_brand(create_cmp_product($to_display,$label)); +} + +function display_globals(array $globals) : string { + $rtn = ""; + foreach($globals as $k => $v) { + $rtn .= "$k : "; + foreach($globals[$k] as $v) + $rtn .= "$v "; + $rtn .= "\n"; + } + return $rtn; +} + +function display_ens(array $checkbox_ens) : string { + $rtn = ""; + foreach($checkbox_ens as $k => $v) + $rtn .= ($v) ? $k.";" : ""; + + return $rtn; +} + +function display_cities(array $cities) : string { + return implode("|",$cities); +} + +function display_type(string $type) : string { + $rtn = ""; + if(in_array($type,$GLOBALS['all_types'])) { + return $type; + } + return $rtn; +} + +function display_product(string $product) : string { + $rtn = ""; + $rtn .= $product; + return $rtn; +} + +function onceens_multistores(array $post, array $ens) { + // process to compare many stores of once ens (expect Monoprix) + $all_cities = array(); + foreach($post as $k => $v) { + $f_once = FALSE; + if(strpos($k,"city_") === 0 && $v !== "") { // check $k and $v + $all_cities[init_in_ens(substr($k,5,1))][] = $v; + $f_once = TRUE; + } + if(($f_once == FALSE) && (in_array($t=init_in_ens(substr($k,5,1)),$ens))) + $all_cities[$t][] = "Paris"; + } + + + return $all_cities; +} + +function parse_command_line(string $command_line) { + // EXAMPLE : php7.2 process_p.php --ens=Auchan,Leclerc --cities="Paris"+"Bordeaux","Voglans" --product="Lardons" --label_product="Lardons fumes" + $arr = explode(" ",$command_line,2); + if(sizeof($arr) == 1) { + echo "ERROR arguments : --ens= --cities= --products= --label_product=[OPTION]\n"; + } + else { + $options = array_slice(explode(" --"," ".$arr[1]),1); + if(($s = sizeof($options))>=3 && $s < 5) { + $elements = [ + "ens"=>explode(",",substr($options[0],strpos($options[0],"=")+1)), + "cities"=>explode(",",substr($options[1],strpos($options[1],"=")+1)), + "product"=>explode(",",substr($options[2],strpos($options[2],"=")+1)) + ]; + if($s == 4) + $elements = array_merge($elements,["label"=>explode(",",substr($options[3],strpos($options[3],"=")+1))]); + foreach($elements["cities"] as $k => $v) + $elements["cities"][$k] = explode("+",$v); + + $elements["globals"] = array_combine($elements["ens"],$elements["cities"]); + return $elements; + } + else { + echo "ERROR arguments : --ens= --cities= --product= \n"; + } + } + return array(); +} + +function main(string $command_line, bool $web) { + if(!$web) { + $fields = parse_command_line($command_line); + var_dump($fields); + $ens = $fields["ens"]; + $GLOBALS['active_ens'] = $ens; + $cities = $fields["cities"]; // for the moment is one city + $globals = $fields["globals"]; + $products = $fields["product"][0]; // "" + $labels = $fields["label"][0]; // "" + //display_cities($globals); + echo $products."\n"; + echo display_globals($globals); + echo display_compare($globals,$products,$labels); + /*$GLOBALS['zone'] = "Zone de recherche : ".($c=display_cities($cities)); + $GLOBALS['type'] = "Type de produit : ".($p=display_type($products)); + $GLOBALS['product'] = "Produit : ".($p2=display_product($labels)); // update now + $GLOBALS['choices'] = "Comparaison des enseignes : ".display_ens($ens); + $GLOBALS['dis'] = display_compare($ens,$p,$p2,$cities); + echo $GLOBALS['dis'];*/ + } + else { // TO UPDATE IN WEB VERSION + if(isset($_POST['submitproduct'])) { + $keys = array_keys($GLOBALS['active_ens']); + $len_ens2 = sizeof($keys); + for($i = 1; $i < $len_ens2+1; $i++) + $GLOBALS['active_ens'][$keys[$i-1]] = (isset($_POST["c".$i])); + //tab of $cities + $cities = array(); + $GLOBALS['zone'] = "Zone de recherche : ".($c=display_cities(array($_POST['city']))); + $GLOBALS['type'] = "Type de produit : ".($p=display_type($_POST['p'])); + $GLOBALS['product'] = "Produit : ".($p2=display_product($_POST['p2'])); + $GLOBALS['choices'] = "Comparaison des enseignes : ".display_ens($GLOBALS['active_ens']); + $GLOBALS['dis'] = display_compare_web($GLOBALS['active_ens'],$p,$p2,[$c]); //$cities + } + } + +} + +//main(implode(" ",$argv),false); + +if(isset($_POST['submitproduct'])) { + $keys = array_keys($GLOBALS['active_ens']); + $ens = $GLOBALS['active_ens']; + $len_ens2 = sizeof($keys); + for($i = 1; $i < $len_ens2+1; $i++) + $ens[$keys[$i-1]] = (isset($_POST["c".$i])); + + $p_ = validate_product($_POST['p'],"product"); + $l_ = validate_product($_POST['p2'],"label"); + if($p_ === FALSE || $l_ === FALSE) + return NULL; + + $GLOBALS['type'] = "Type de produit : ".($p=display_type($_POST['p'])); + $GLOBALS['product'] = "Produit : ".($p2=display_product($_POST['p2'])); + $GLOBALS['choices'] = "Comparaison des enseignes : ".display_ens($GLOBALS['active_ens']); + $ens2 = array(); + foreach($ens as $k => $v) { + if($v === true) { + $ens2[] = $k; + } + } + /*echo "pass \n"; + var_dump($ens2); + echo "globals \n";*/ + $globals = onceens_multistores($_POST,$ens2); // OK + //var_dump($globals); + echo display_compare_web($globals,$p,$p2); // OK +} + +function post_to_otherphp_file(string $url, array $key_elements) { + $body = ""; + foreach($key_elements as $k => $v) { // $key_elements directly in $body is possible + $k_ = test_input2($k); + $v_ = test_input2($v); + if($k_ !== FALSE && $v_ !== FALSE) + $body .= "&$k_=$v_"; + } + $c = curl_init ($url); + curl_setopt ($c, CURLOPT_POST, true); + curl_setopt ($c, CURLOPT_POSTFIELDS, http_build_query($key_elements));//["store"=>$body]); + curl_setopt($c, CURLOPT_RETURNTRANSFER,true); + $page = curl_exec ($c); + echo "page \n"; + echo $page; + curl_close ($c); +} + +//$url_ = 'pricecomparator.co/product/cities.php'; +//post_to_otherphp_file($url_,["Monoprix"=>"Test"]); +//echo display_compare(["Monoprix"=>["Paris","Annecy"],"Carrefour"=>["Paris","Brest"]],"lardons","lardons"); // !!!!!!!!!!!! +//echo display_compare_web(["Monoprix"=>["Paris","Annecy"],"Carrefour"=>["Paris","Brest"]],"lardons","lardons"); +//var_dump(display_compare(["Carrefour"=>["Paris"]],"lardons","lardons")); + +//var_dump(parse_exec_usage(file_get_contents("t_u.txt"))); +//var_dump(display_compare(["Monoprix"],"lardons","lardons",["Paris","Annecy"])); +//var_dump(parse_exec_usage(file_get_contents("t_u.txt"))); OK + +function post(string $url, array $fields) { + //$url = 'pricecomparator.co/product/cities.php';//'http://localhost/mc/upload.php'; + $fields_string = ""; + foreach($fields as $key=>$value) { + $key_ = test_input2($key); + $value_ = test_input2($value); + if($key_ !== FALSE && $value_ !== FALSE) + $fields_string .= $key_.'='.$value_.'&'; + + } + rtrim($fields_string, '&'); + $ch = curl_init(); + curl_setopt($ch,CURLOPT_URL, $url); + curl_setopt($ch,CURLOPT_POST, count($fields)); + curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string); + curl_exec($ch); +} +//post("pricecomparator.co/product/cities.php",["__)(__"=>"1","Monoprix"=>"L'yon"]); + +//var_dump(display_compare(["Auchan"=>["Paris"]],"Lardons","lardons")); +var_dump(display_compare(["Monoprix"=>["Paris"],"Auchan"=>["Paris"]],"Lardons","Lardons")); +//var_dump(display_compare(["Monoprix"=>["Paris"]],"Lardons","lardons")); + +?> \ No newline at end of file diff --git a/your_project/usage.php b/your_project/usage.php index e7962b7..fa71f8d 100644 --- a/your_project/usage.php +++ b/your_project/usage.php @@ -361,11 +361,11 @@ function main_u($argc, $argv) { } //echo json_encode(globals_execs($scrappers_usages_min_ca)); -main_u($argc,$argv); +//main_u($argc,$argv); //var_dump(globals_execs($scrappers_usages_min_mc,2)); -//var_dump(use_content_scrapper_auchan("Lardons","Paris",4444)); +//var_dump(use_content_scrapper_auchan("Lardons","Paris",4444,false)); //var_dump(use_content_scrapper_leclerc("Saumon","Annecy")); -//var_dump(use_content_scrapper_carrefour("Lardons fume","Paris",4444)); +//var_dump(use_content_scrapper_carrefour("Lardons","Paris",4444,false)); //var_dump(use_content_scrapper_intermarche("Lardons","Paris",4444)); //var_dump(use_content_scrapper_monoprix("Lardons",4444,true)); // TRY THIS //var_dump(use_content_scrapper_systemeu("Lardons","Paris")); diff --git a/your_project/usage2.php b/your_project/usage2.php new file mode 100755 index 0000000..cf7a58a --- /dev/null +++ b/your_project/usage2.php @@ -0,0 +1,423 @@ + ["lardons","Paris"], + "Leclerc" => ["lardons","Paris"], + "Auchan" => ["lardons","Paris"], + "SystemeU" => ["lardons","Paris"], + "Intermarche" => ["lardons","Paris"], + "Monoprix" => ["lardons"] +]; +$scrappers_usages_min = [ + "Carrefour" => ["lardons","Paris"] +]; + +$scrappers_usages_min_mon = [ + "Monoprix" => ["lardons",["Paris","Annecy"]] +]; + +$scrappers_usages_min_mon2 = [ + "Monoprix" => ["lardons",["Paris","Annecy"]], + "Carrefour" => ["lardons",["Paris","Brest"]] +]; + + +$scrappers_usages_min2 = [ + "Carrefour" => ["lardons","Paris"], + "Monoprix" => ["lardons"] +]; + +$scrappers_usages_min3 = [ + "Carrefour" => ["lardons","Paris"], + "Monoprix" => ["lardons"], + "Leclerc" => ["Lardons","Voglans"] +]; + +$scrappers_usages_min4 = [ + "Carrefour" => ["lardons","Paris"], + "Monoprix" => ["lardons"], + "Leclerc" => ["Lardons","Voglans"], + "Auchan" => ["lardons","Paris"] // NOT STABLE +]; + +$scrappers_usages_min5 = [ + "Carrefour" => ["lardons","Paris"], + "Monoprix" => ["lardons"], + "Leclerc" => ["Lardons","Voglans"], + "Auchan" => ["lardons","Paris"], + "Intermarche" => ["lardons","Paris"] +]; + +$scrappers_usages_min_a = [ + "Auchan" => ["lardons",["Paris"]] +]; + +$scrappers_usages_min_c = [ + "Carrefour" => ["lardons","Paris"] +]; + +$scrappers_usages_min_l = [ + "Leclerc" => ["lardons","Voglans"] +]; + +$scrappers_usages_min_ca = [ + "Auchan" => ["lardons","Paris"], + "Carrefour" => ["lardons","Paris"] +]; + +/** + * [BRIEF] CHECK + * @param array $scrap the result of a scrapping function + * @example check_scrapper_return(content_scrap_leclerc("..","..")) + * @author chriSmile0 + * @return -1 or content of $scrap +*/ +function check_scrapper_return(array $scrap) { + if(empty($scrap)) + return -1; + return $scrap; +} + +/** + * [BRIEF] If A/C/I/M then : + * - We launch 2 process, one for the geckodriver, and the other for the duplicate + * - When we sure the geckodriver is launch we call the target scrapper by the `$key` + * - We kill all sub processes and geckodriver processes + * Else (no need process) + * The return is the size of the return or just a ',' if we found nothing + * + * @param string $key the supermarket name + * @param array $scrapper_usage the research and the target city + * @param int $port port to connect geckodriver in case we use the port + * @example parrallelize_scrapping_process("Monoprix",["lardons"],4444=default) + * @author chriSmile0 + * @return string content_scrap_... return or "," if not found +*/ +function parrallelize_scrapping_process(string $key, array $scrapper_usage, + int $port, int $portf, int $store ) : string { // gecko -> auchan,monoprix,carrefour,intermarcheà + $childs = array(); + $ens = $key[0]; + $rtn = ""; + $gb_rtn = array(); + $content = array(); + //$nb_cities = count($scrapper_usage[1]); + echo "portf : $portf\n"; + echo "store : $store \n"; + var_dump($scrapper_usage); + $i = $store; + // Solution 1 for multi store create loop here + /** + * Pros : each city have your own geckodriver + * Cons : many process + */ + // Solution 2 $scrapper_usage[1] in content_scrap_* + /** + * Pros : Light in process + * Cons : + */ + // Solution 1 in globals_execs -> choice for the moment + if($ens !== "S" && $ens !== "L") { + $childs = array(); + for($x = 0; $x < 2; $x++) { + if($x == 1) + sleep(1); + switch($pid = pcntl_fork()) { + case -1: + die('Fork failed'); + exit(0); + case 0: + if($x == 0) + exec("geckodriver -p $port"); + exit(); // IMPORTANT + default: + $childs[] = $pid; + break; + } + } + $exec_scrapper = 0; + while(count($childs) > 0) { + foreach($childs as $key => $pid) { + $res = pcntl_waitpid($pid, $status, WNOHANG); + if($res == -1 || $res > 0) { + unset($childs[$key]); + } + if(($res == 0) && (count($childs)==1)) { // geckodriver is launch + if(!$exec_scrapper) { + $exec_scrapper = 1; + switch($ens) { + case "A": + $content = content_scrap_auchan($scrapper_usage[0],$scrapper_usage[1][$i],$port,false); // MULTI STORE SOON -> $scrapper_usage[1] + break; + case "C": + $content = content_scrap_carrefour($scrapper_usage[0],$scrapper_usage[1][$i],$port,false); + break; + case "I": + $content = content_scrap_intermarche($scrapper_usage[0],$scrapper_usage[1][$i],$port,false); + break; + case "M": + $content = content_scrap_monoprix($scrapper_usage[0],$port,false); + break; + default: + $exec_scrapper = 2; // ERROR + break; + } + } + system("kill -s kill $pid"); // kill geckodriver launcher + exec("kill -s kill `lsof -i -P | grep -e :$port | grep -Eo '[0-9]{1,10}' | head -n 1`"); + } + } + } + } + else if($ens === "L") { // NO GECKODRIVER + $content = content_scrap_leclerc($scrapper_usage[0],$scrapper_usage[1][$i]); + } + else if($ens === "S") { // PUPPETEER + $content = content_scrap_systemeu($scrapper_usage[0],$scrapper_usage[1][$i]); + } + else { // UNKNOWN + $content = ""; + } + $rtn = (check_scrapper_return($content)==-1) ? "NO" : json_encode($content); + if($rtn !== "NO") + return "".strlen($rtn).",".$rtn; + return ","; +} + +/** + * @version 2 -> use web_server element to true because geckodriver is in the execution + * [BRIEF] If A/C/I/M then : + * - We launch 2 process, one for the geckodriver, and the other for the duplicate + * - When we sure the geckodriver is launch we call the target scrapper by the `$key` + * - We kill all sub processes and geckodriver processes + * Else (no need process) + * The return is the size of the return or just a ',' if we found nothing + * + * @param string $key the supermarket name + * @param array $scrapper_usage the research and the target city + * @param int $port port to connect geckodriver in case we use the port + * @example parrallelize_scrapping_process("Monoprix",["lardons"],4444=default) + * @author chriSmile0 + * @return string content_scrap_... return or "," if not found +*/ +function parrallelize_scrapping_process_v2(string $key, array $scrapper_usage, + int $port) : string { // gecko -> auchan,monoprix,carrefour,intermarche + echo "v2 \n"; + $ens = $key[0]; + $rtn = ""; + $content = array(); + if($ens !== "S" && $ens !== "L") { + switch($ens) { + case "A": + $content = content_scrap_auchan($scrapper_usage[0],$scrapper_usage[1],$port,true); + break; + case "C": + $content = content_scrap_carrefour($scrapper_usage[0],$scrapper_usage[1],$port,true); + break; + case "I": + $content = content_scrap_intermarche($scrapper_usage[0],$scrapper_usage[1],$port,true); + break; + case "M": + $content = content_scrap_monoprix($scrapper_usage[0],$port,true); + break; + default: + break; + } + } + else if($ens === "L") { // NO GECKODRIVER + $content = content_scrap_leclerc($scrapper_usage[0],$scrapper_usage[1]); + } + else if($ens === "S") { // PUPPETEER + $content = content_scrap_systemeu($scrapper_usage[0],$scrapper_usage[1]); + } + else { // UNKNOWN + $content = ""; + } + $rtn = (check_scrapper_return($content)==-1) ? "" : json_encode($content); + if($rtn !== "") + return "".strlen($rtn).",".$rtn; + return ","; +} + + +/** + * [BRIEF] + * @param array $scrappers_usage target supermarket and target_product and town + * @example globals_execs(["Monoprix"=>["lardons"]) + * @author chriSmile0 + * @return the scrapping content of each usage in the array in parameter +*/ +function globals_execs_locals(array $scrappers_usage) { + $recv_content = array(); + $returns = array(); + $arrys = array(); + $i = 0; + $returns = array(); + foreach($scrappers_usage as $key => $usages) { + $port = 0; + $returns = array_merge($returns,[$key=>parrallelize_scrapping_process_v2($key,$usages,$port)]); // DUMP RESULT IN PIPE + } + return $returns; +} + +/** + * [BRIEF] + * @param array $scrappers_usage target supermarket and target_product and town + * @example globals_execs(["Monoprix"=>["lardons"]) + * @author chriSmile0 + * @return the scrapping content of each usage in the array in parameter +*/ +function globals_execs_server(array $scrappers_usage) {// OK + $childs = array(); + $recv_content = array(); + $ports = 4444; + $returns = array(); + $arrys = array(); + $i = 0; + foreach($scrappers_usage as $key => $usages) { + $returns[$key] = []; + $portd = $ports+$i; + $nb_port = sizeof($usages[1]); + $arrys[] = array(); + for($j = 0 , $k = $i ;$k < $i+$nb_port ;$k++,$j++) { + $recv_content[] = [$key,false,$portd+$j]; + socket_create_pair(AF_UNIX, SOCK_STREAM, 0, $arrys[$k]); + switch($pid = pcntl_fork()) { + case -1: + die('Fork failed'); + exit(0); + case 0: + $rtn = parrallelize_scrapping_process($key,$usages,$portd+$j,$nb_port,$j); // DUMP RESULT IN PIPE + $offset = 0; + $size = substr($rtn,0,$offset=strpos($rtn,",")); + $size = ($size===FALSE || $size==="") ? "0" : $size; // FALSE -> 7.2, "" -> 8.0 // FOR REST OF THE PACKAGE FOR COMPATIBILITY!!! + echo "s : $size $key \n"; + echo "o : $offset $key\n"; + socket_close($arrys[$k][1]); + socket_write($arrys[$k][0], $size); + if($offset > 0) { + $rtn_t = substr($rtn,$offset+1); + if(socket_read($arrys[$k][0],2)=="OK") + socket_write($arrys[$k][0], $rtn_t, strlen($rtn_t)); + + } + socket_close($arrys[$k][0]); + exit(1); // IMPORTANT + default: + $childs[] = [$pid,$k,$key,$usages[1][$j]]; + break; + } + } + $i += $nb_port; + } + while(count($childs) > 0) { + foreach($childs as $key => $pid) { + $res = pcntl_waitpid($pid[0], $status, WNOHANG); + if($res == -1 || $res > 0) { + unset($childs[$key]); + } + + if(($res == 0) && (!$recv_content[$key][1])) { + socket_close($arrys[$pid[1]][0]); + $size = trim(socket_read($arrys[$pid[1]][1],10)); + if($size > 0) // send content + if(socket_write($arrys[$pid[1]][1],"OK")) + if($rtn_tt = trim(socket_read($arrys[$pid[1]][1],$size))) { + $returns[$pid[2]] = array_merge($returns[$pid[2]],[$pid[3]=>json_decode($rtn_tt,true)]); + $recv_content[$key][1] = true; + } + + socket_close($arrys[$pid[1]][1]); + } + } + } + foreach($recv_content as $rc) { // check if we have all contents, if this is not the case we relaunch the forgot research + if($rc[1]==false) + echo "re-LAUNCH :".$rc[0].", on port : ".$rc[2]."\n"; + } + return $returns; +} + +function my_json_encoding_2($to_encode) { // FOR MAIN PARAMETER + $str = json_encode($to_encode); + $res = ""; + $size = strlen($str); + for($i = 0; $i < $size ;$i++) + $res .= ($str[$i] === '"') ? '\"' : (($str[$i] === "'") ? "\'" : $str[$i]); + + return $res; +} + +function main_u($argc, $argv) { + $arr = implode(",",array_slice($argv,1)); + $elements = json_decode($arr,true);// OK + //var_dump($elements); + echo json_encode(globals_execs_server($elements)); // recv this in process_p for print + //var_dump($elements); +} + +main_u($argc,$argv); +//echo "min_mon \n"; +//var_dump($scrappers_usages_min_mon); +//echo parrallelize_scrapping_process("Monoprix",["lardons","lardons"],4444,2); +//echo json_encode(globals_execs_server($scrappers_usages_min_a)); +//var_dump(use_content_scrapper_monoprix("Lardons",4444,false)); +//var_dump(parrallelize_scrapping_process("Monoprix",["lardons",["Paris"]],4444,1)); +//var_dump(use_content_scrapper_auchan("Lardons","Paris",4444,false)); +?> \ No newline at end of file From c9a9fbe7643c3076d2af561d1765bcb656736f80 Mon Sep 17 00:00:00 2001 From: chriSmile0 Date: Wed, 19 Jun 2024 17:25:02 +0200 Subject: [PATCH 2/3] auchan,carrefour,monoprix work correctly --- your_project/process_p.php | 347 +++++++++++++++++----- your_project/process_p2.php | 564 ------------------------------------ your_project/usage.php | 193 +++++++----- your_project/usage2.php | 423 --------------------------- 4 files changed, 398 insertions(+), 1129 deletions(-) mode change 100644 => 100755 your_project/process_p.php delete mode 100755 your_project/process_p2.php mode change 100644 => 100755 your_project/usage.php delete mode 100755 your_project/usage2.php diff --git a/your_project/process_p.php b/your_project/process_p.php old mode 100644 new mode 100755 index 50b86e9..d950d36 --- a/your_project/process_p.php +++ b/your_project/process_p.php @@ -1,4 +1,3 @@ - ["Lardons","Voglans"],"Monoprix"=>["Lardons"]); +$elements1 = array("Leclerc"=>["Lardons","Voglans"]); +$elements3 = array("Monoprix"=>["Lardons"],"Carrefour"=>["Lardons","Paris"]); +$elements4 = array("Carrefour"=>["Lardons","Paris"]); +$elements5 = array("Monoprix"=>["lardons"]); +*/ $dis = $zone = $type = $product = $choices = ""; @@ -74,13 +79,37 @@ ,"Oeufs","Fruits","Legumes","Lardons","Saumon" ]; -$rayons = ["Boulangerie","Fruits"]; // FOR NEXT UPDATE +$rayons = ["Boulangerie","Fruits"]; // FOR ANOTHER UPDATE OF SCRAPPER (2.0? NOW=1.4) $choice_ens = array(); -$possible_ens = ["Carrefour","Leclerc","Monoprix","Auchan","Intermarche"];//ADD SU LATER -$active_ens = ["Carrefour"=>false,"Leclerc"=>false,"Monoprix"=>false,"Auchan"=>false,"Intermarche"=>false]; +$possible_ens = ["Carrefour","Leclerc","Monoprix","Auchan","Intermarche","SystemeU"];//ADD SU LATER +$active_ens = ["Carrefour"=>false,"Leclerc"=>false,"Monoprix"=>false,"Auchan"=>false,"Intermarche"=>false,"SystemeU"=>false]; + +$labelErr = $typeErr = ""; //---------------------------------UTILS--------------------------------------// +function test_input2($data) { + return (is_string($data)) ? htmlspecialchars(stripslashes(trim($data))) : FALSE; +} + +function validate_product(string $product, string $type) { + $nom = test_input2($product); + if(!preg_match("/^[a-zA-Z- éè]{2,30}$/",$nom)) { + switch($type) { + case "type": + $GLOBALS['typeErr'] = "Espace et tiret autorisés ainsi que les majuscules"; + break; + case "label": + $GLOBALS['labelErr'] = "Espace et tiret autorisés ainsi que les majuscules"; + break; + default: + break; + } + return FALSE; + } + return $nom; +} + function cmp_label(string $label1, string $label2) { $split_l1 = explode(" ",strtolower($label1)." "); $split_l2 = explode(" ",strtolower($label2)." "); @@ -141,22 +170,43 @@ function sort_list(array $products) { return $sort; } -//-----------------------------END UTILS--------------------------------------// +function init_in_ens(string $init) : string { + switch($init) { + case "c": + return "Carrefour"; + case "l": + return "Leclerc"; + case "m": + return "Monoprix"; + case "a": + return "Auchan"; + case "i": + return "Intermarche"; + case "s": + return "SystemeU"; + default: + return "X"; + break; + } +} -function main_(array $elements, int $web_server) { +//-----------------------------END UTILS--------------------------------------// +function main_(array $elements) { $str = my_json_encoding($elements); - //exec("php usage.php $str $web_server > out.txt"); - $rtn = file_get_contents("proofs/dump_auchan.txt"); + $cmd = PHP_BINDIR."/php " .__DIR__."/usage.php $str > out.txt"; + exec($cmd); + $rtn = file_get_contents("out.txt"); $parsing = parse_exec_usage($rtn); return $parsing; } -$arr = array("Auchan"=>["Lardons","Paris"]); -$arr2 = array("Leclerc"=>["lardons","Voglans"]); -$arr3 = array("Monoprix"=>["lardons"]); -$arr23 = array("Leclerc"=>["lardons","Voglans"],"Monoprix"=>["lardons"]); -$arr31 = array("Auchan"=>["lardons","Paris"]); - +function main_web(array $elements) { + $str = my_json_encoding($elements); + $cmd = PHP_BINDIR."/php " .__DIR__."/usage.php $str"; + $rtn = exec($cmd); + $parsing = parse_exec_usage($rtn); + return $parsing; +} function my_json_encoding(array $to_encode) { // FOR MAIN PARAMETER $str = json_encode($to_encode); @@ -174,44 +224,49 @@ function parse_exec_usage(string $rtn) { function create_cmp_product(array $all_products, string $compare_product) { // easy with 1.2 Scrapper Version $save_products = array(); + foreach($all_products as $k => $v) { if($v !== NULL) { - if($k === "Carrefour") { - foreach($v as $val) { - $save_products[] = ["brand"=>$val['brand'],"name"=>$val['title'],"ens"=>$k,"prix"=>$val['price']['price']]; + $old_k = $k; + foreach($v as $k => $p) { // + if($old_k === "Carrefour") { + foreach($p as $val) { + //($val['brand']==="") ? "Inconnu" : $val["brand"] -> to store + $save_products[] = ["brand"=>$val['brand'],"name"=>$val['title']." ".$val["packaging"],"ens"=>$old_k.":".$k,"prix"=>$val['price']['price']]; + } } - } - if($k === "Leclerc") { - foreach($v as $val) { - $save_products[] = ["brand"=>$val['brand'],"name"=>$val['sLibelleLigne1']." ".$val['sLibelleLigne2'],"ens"=>$k,"prix"=>$val['nrPVUnitaireTTC']]; + if($old_k === "Leclerc") { + foreach($p as $val) { + $save_products[] = ["brand"=>$val['brand'],"name"=>$val['sLibelleLigne1']." ".$val['sLibelleLigne2'],"ens"=>$old_k.":".$k,"prix"=>$val['nrPVUnitaireTTC']]; + } } - } - if($k === "Monoprix") { - foreach($v as $val) { - $save_products[] = ["brand"=>$val['brand'],"name"=>$val['name'],"ens"=>$k,"prix"=>$val['price']['current']['amount']]; + if($old_k === "Monoprix") { + foreach($p as $val) { + $save_products[] = ["brand"=>$val['brand'],"name"=>$val['name'],"ens"=>$old_k.":".$k,"prix"=>$val['price']['current']['amount']]; + } } - } - if($k === "Auchan") { - foreach($v as $val) { - $save_products[] = ["brand"=>$val['brand'],"name"=>$val['label']." ".$val['quantity'],"ens"=>$k,"prix"=>$val['price']]; + if($old_k === "Auchan") { + foreach($p as $val) { + $save_products[] = ["brand"=>$val['brand'],"name"=>$val['label']." ".$val['quantity'],"ens"=>$old_k.":".$k,"prix"=>$val['price']]; + } } - } - if($k === "Intermarche") { - foreach($v as $val) { - $infos = $val["informations"]; - $save_products[] = ["brand"=>$infos['brand'],"name"=>$infos['title']." ".$infos["packaging"]." ".$infos["brand"],"ens"=>$k,"prix"=>$val['prices']['value']]; + if($old_k === "Intermarche") { + foreach($p as $val) { + $infos = $val["informations"]; + $save_products[] = ["brand"=>$infos['brand'],"name"=>$infos['title']." ".$infos["packaging"]." ".$infos["brand"],"ens"=>$old_k.":".$k,"prix"=>$val['prices']['value']]; + } } - } - if($k === "SystemeU") { - foreach($v as $val) { - $save_products[] = ["brand"=>$val['brand'],"name"=>$val['name'],"ens"=>$k,"prix"=>$val['price']]; + if($old_k === "SystemeU") { + foreach($p as $val) { + $save_products[] = ["brand"=>$val['brand'],"name"=>$val['name'],"ens"=>$old_k.":".$k,"prix"=>$val['price']]; + } } } } - } $all_brands = array(); $products_by_brand = array(); + foreach($save_products as $elem) { if(!in_array($lower=strtolower($elem['brand']),$all_brands)) { $all_brands[] = $lower; @@ -224,50 +279,93 @@ function create_cmp_product(array $all_products, string $compare_product) { // e } } + $cmp = 0; + if(sizeof($all_products)==1) + $cmp = -1; + $comparable_ens = array(); - foreach($products_by_brand as $k=>$pb) { - if((substr_count($pb[0],"|"))>0) + foreach($products_by_brand as $k=>$pb) + if((substr_count($pb[0],"|"))>$cmp) $comparable_ens = array_merge($comparable_ens,[$k=>$pb]); - } - + $sort_list_p = array(); - foreach($comparable_ens as $k=>$pb) { + foreach($comparable_ens as $k=>$pb) $sort_list_p = array_merge($sort_list_p,[$k=>sort_list($pb[1])]); - } + return $sort_list_p; - } function display_each_brand(array $comparable_brand) { $rtn = ""; $all_brands = array_keys($comparable_brand); + $rtn .= "
    "; foreach($all_brands as $b) { + $br = (($b==="") ? "Inconnu" : $b); + $rtn .= "
    $br
    "; + $rtn .= ""; foreach($comparable_brand[$b] as $product) { // [1] for comparable ens $rtn .= display_each_product($product); } + $rtn .= "
    NameENS:CityPrice
    "; } - return $rtn; + return $rtn . "
    "; } function display_each_product(array $product) { - $rtn = ""; - foreach($product as $k=>$elem) - $rtn .= "$k:$elem"; - - $rtn .= "\n"; + $rtn = ""; + foreach($product as $k=>$elem) { + if($k=="brand") + continue; + if(count(($tab_elem = explode("|",$elem)))>1) { + $rtn .= "
    "; + if($k=="prix") { + $min = min($tab_elem); + $spe = "style=\"border:solid blue;\""; + foreach($tab_elem as $t) + $rtn .= "$t"; + + } + else { + foreach($tab_elem as $t) + $rtn .= "$t"; + } + $rtn .= "
    "; + } + else { + $rtn .= "$elem "; + } + } + $rtn .= "\n"; return $rtn; } -function display_compare(array $ens, string $product, string $label, array $cities) { +function display_compare(array $globals, string $product, string $label) { + $elements = array(); + foreach($globals as $k => $e) + $elements = array_merge($elements,[$k=>[$product,$e]]); + + $to_display = main_($elements); // OK + return display_each_brand(create_cmp_product($to_display,$label)); +} + +function display_compare_web(array $globals, string $product, string $label) { $elements = array(); - $i = 0; - foreach($ens as $e) { - $elements = array_merge($elements,[$e=>[$product,$cities[$i]]]); - $i++; + foreach($globals as $k => $e) + $elements = array_merge($elements,[$k=>[$product,$e]]); + + $to_display = main_web($elements); // OK + return display_each_brand(create_cmp_product($to_display,$label)); +} + +function display_globals(array $globals) : string { + $rtn = ""; + foreach($globals as $k => $v) { + $rtn .= "$k : "; + foreach($globals[$k] as $v) + $rtn .= "$v "; + $rtn .= "\n"; } - $to_display = main_($elements,1); // OK - $full_rtn = display_each_brand(create_cmp_product($to_display,$label)); - return $full_rtn; + return $rtn; } function display_ens(array $checkbox_ens) : string { @@ -296,8 +394,25 @@ function display_product(string $product) : string { return $rtn; } +function onceens_multistores(array $post, array $ens) { + // process to compare many stores of once ens (expect Monoprix) + $all_cities = array(); + foreach($post as $k => $v) { + $f_once = FALSE; + if(strpos($k,"city_") === 0 && $v !== "") { // check $k and $v + $all_cities[init_in_ens(substr($k,5,1))][] = $v; + $f_once = TRUE; + } + if(($f_once == FALSE) && (in_array($t=init_in_ens(substr($k,5,1)),$ens))) + $all_cities[$t][] = "Paris"; + } + + + return $all_cities; +} + function parse_command_line(string $command_line) { - // EXAMPLE : php7.2 process_p.php --ens=Auchan,Leclerc --cities="Paris","Voglans" --products="Lardons" --label_products="Lardons fumes" + // EXAMPLE : php7.2 process_p.php --ens=Auchan,Leclerc --cities="Paris"+"Bordeaux","Voglans" --product="Lardons" --label_product="Lardons fumes" $arr = explode(" ",$command_line,2); if(sizeof($arr) == 1) { echo "ERROR arguments : --ens= --cities= --products= --label_product=[OPTION]\n"; @@ -308,15 +423,18 @@ function parse_command_line(string $command_line) { $elements = [ "ens"=>explode(",",substr($options[0],strpos($options[0],"=")+1)), "cities"=>explode(",",substr($options[1],strpos($options[1],"=")+1)), - "products"=>explode(",",substr($options[2],strpos($options[2],"=")+1)) + "product"=>explode(",",substr($options[2],strpos($options[2],"=")+1)) ]; if($s == 4) - $elements = array_merge($elements,["labels"=>explode(",",substr($options[3],strpos($options[3],"=")+1))]); + $elements = array_merge($elements,["label"=>explode(",",substr($options[3],strpos($options[3],"=")+1))]); + foreach($elements["cities"] as $k => $v) + $elements["cities"][$k] = explode("+",$v); + $elements["globals"] = array_combine($elements["ens"],$elements["cities"]); return $elements; } else { - echo "ERROR arguments : --ens= --cities= --products= \n"; + echo "ERROR arguments : --ens= --cities= --product= \n"; } } return array(); @@ -325,17 +443,23 @@ function parse_command_line(string $command_line) { function main(string $command_line, bool $web) { if(!$web) { $fields = parse_command_line($command_line); + var_dump($fields); $ens = $fields["ens"]; $GLOBALS['active_ens'] = $ens; $cities = $fields["cities"]; // for the moment is one city - $products = $fields["products"][0]; // "" - $labels = $fields["labels"][0]; // "" - $GLOBALS['zone'] = "Zone de recherche : ".($c=display_cities($cities)); + $globals = $fields["globals"]; + $products = $fields["product"][0]; // "" + $labels = $fields["label"][0]; // "" + //display_cities($globals); + echo $products."\n"; + echo display_globals($globals); + echo display_compare($globals,$products,$labels); + /*$GLOBALS['zone'] = "Zone de recherche : ".($c=display_cities($cities)); $GLOBALS['type'] = "Type de produit : ".($p=display_type($products)); $GLOBALS['product'] = "Produit : ".($p2=display_product($labels)); // update now $GLOBALS['choices'] = "Comparaison des enseignes : ".display_ens($ens); $GLOBALS['dis'] = display_compare($ens,$p,$p2,$cities); - echo $GLOBALS['dis']; + echo $GLOBALS['dis'];*/ } else { // TO UPDATE IN WEB VERSION if(isset($_POST['submitproduct'])) { @@ -349,11 +473,92 @@ function main(string $command_line, bool $web) { $GLOBALS['type'] = "Type de produit : ".($p=display_type($_POST['p'])); $GLOBALS['product'] = "Produit : ".($p2=display_product($_POST['p2'])); $GLOBALS['choices'] = "Comparaison des enseignes : ".display_ens($GLOBALS['active_ens']); - $GLOBALS['dis'] = display_compare($GLOBALS['active_ens'],$p,$p2,[$c]); //$cities + $GLOBALS['dis'] = display_compare_web($GLOBALS['active_ens'],$p,$p2,[$c]); //$cities } } } + //main(implode(" ",$argv),false); -var_dump(main_($arr31,2)); + +if(isset($_POST['submitproduct'])) { + $keys = array_keys($GLOBALS['active_ens']); + $ens = $GLOBALS['active_ens']; + $len_ens2 = sizeof($keys); + for($i = 1; $i < $len_ens2+1; $i++) + $ens[$keys[$i-1]] = (isset($_POST["c".$i])); + + $p_ = validate_product($_POST['p'],"product"); + $l_ = validate_product($_POST['p2'],"label"); + if($p_ === FALSE || $l_ === FALSE) + return NULL; + + $GLOBALS['type'] = "Type de produit : ".($p=display_type($_POST['p'])); + $GLOBALS['product'] = "Produit : ".($p2=display_product($_POST['p2'])); + $GLOBALS['choices'] = "Comparaison des enseignes : ".display_ens($GLOBALS['active_ens']); + $ens2 = array(); + foreach($ens as $k => $v) { + if($v === true) { + $ens2[] = $k; + } + } + /*echo "pass \n"; + var_dump($ens2); + echo "globals \n";*/ + $globals = onceens_multistores($_POST,$ens2); // OK + //var_dump($globals); + echo display_compare_web($globals,$p,$p2); // OK +} + +function post_to_otherphp_file(string $url, array $key_elements) { + $body = ""; + foreach($key_elements as $k => $v) { // $key_elements directly in $body is possible + $k_ = test_input2($k); + $v_ = test_input2($v); + if($k_ !== FALSE && $v_ !== FALSE) + $body .= "&$k_=$v_"; + } + $c = curl_init ($url); + curl_setopt ($c, CURLOPT_POST, true); + curl_setopt ($c, CURLOPT_POSTFIELDS, http_build_query($key_elements));//["store"=>$body]); + curl_setopt($c, CURLOPT_RETURNTRANSFER,true); + $page = curl_exec ($c); + echo "page \n"; + echo $page; + curl_close ($c); +} + +//$url_ = 'pricecomparator.co/product/cities.php'; +//post_to_otherphp_file($url_,["Monoprix"=>"Test"]); +//echo display_compare(["Monoprix"=>["Paris","Annecy"],"Carrefour"=>["Paris","Brest"]],"lardons","lardons"); // !!!!!!!!!!!! +//echo display_compare_web(["Monoprix"=>["Paris","Annecy"],"Carrefour"=>["Paris","Brest"]],"lardons","lardons"); +//var_dump(display_compare(["Carrefour"=>["Paris"]],"lardons","lardons")); + +//var_dump(parse_exec_usage(file_get_contents("t_u.txt"))); +//var_dump(display_compare(["Monoprix"],"lardons","lardons",["Paris","Annecy"])); +//var_dump(parse_exec_usage(file_get_contents("t_u.txt"))); OK + +function post(string $url, array $fields) { + //$url = 'pricecomparator.co/product/cities.php';//'http://localhost/mc/upload.php'; + $fields_string = ""; + foreach($fields as $key=>$value) { + $key_ = test_input2($key); + $value_ = test_input2($value); + if($key_ !== FALSE && $value_ !== FALSE) + $fields_string .= $key_.'='.$value_.'&'; + + } + rtrim($fields_string, '&'); + $ch = curl_init(); + curl_setopt($ch,CURLOPT_URL, $url); + curl_setopt($ch,CURLOPT_POST, count($fields)); + curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string); + curl_exec($ch); +} +//post("pricecomparator.co/product/cities.php",["__)(__"=>"1","Monoprix"=>"L'yon"]); + +//var_dump(display_compare(["Auchan"=>["Paris"]],"Lardons","lardons")); +var_dump(display_compare(["Monoprix"=>["Paris"],"Auchan"=>["Paris"]],"Lardons","Lardons")); +//var_dump(display_compare(["Monoprix"=>["Paris"]],"Lardons","lardons")); + ?> \ No newline at end of file diff --git a/your_project/process_p2.php b/your_project/process_p2.php deleted file mode 100755 index c9132d8..0000000 --- a/your_project/process_p2.php +++ /dev/null @@ -1,564 +0,0 @@ - ["lardons","Paris"], - "Leclerc" => ["lardons","Paris"], - "Auchan" => ["lardons","Paris"], - "SystemeU" => ["lardons","Paris"], - "Intermarche" => ["lardons","Paris"], - "Monoprix" => ["lardons"] -]; - -$names_products = [ // NAME PRODUCT - "Carrefour" => "title", - "Leclerc" => "sLibelleLigne1|sLibelleLigne2", - "Auchan" => "label", - "SystemeU" => "brand", - "Intermarche" => "informations", - "Monoprix" => "name" -]; - - -$finalLabels = [ - "name", - "price" -]; - -$Carrefour = [ // replace by get_items - "ean", - "title", - "brand", - "slug", - "offerServiceId", - "offers" => [ - "ean" => [ - "offerServiceId" => [ - "attributes" => [ - "price", - "promotion", - "promotions" - ], - ], - ], - ], - "packaging", - "nutriscore" -]; -$Leclerc = [ // replace by get items - "sLibelleLigne1", - "sLibelleLigne2", - "sPrixUnitaire", - "nrPVUnitaireTTC", - "sPrixPromo", - "sPrixParUniteDeMesure", - "nrPVParUniteDeMesureTTC", - "sUrlPageProduit" -]; - -/* -$elements0 = array("Leclerc"=>["Lardons","Voglans"],"Monoprix"=>["Lardons"]); -$elements1 = array("Leclerc"=>["Lardons","Voglans"]); -$elements3 = array("Monoprix"=>["Lardons"],"Carrefour"=>["Lardons","Paris"]); -$elements4 = array("Carrefour"=>["Lardons","Paris"]); -$elements5 = array("Monoprix"=>["lardons"]); -*/ - -$dis = $zone = $type = $product = $choices = ""; - -$all_types = ["Poisson","Viande","EpicerieSa","EpicerieSu","Pains","Patisserie" - ,"Charcuterie","Surgele","Boisson","Bebe","Bio","Hygiene","Beaute" - ,"Entretien","Nettoyage","Animalerie","Loisirs","Maison","Laiterie" - ,"Oeufs","Fruits","Legumes","Lardons","Saumon" -]; - -$rayons = ["Boulangerie","Fruits"]; // FOR ANOTHER UPDATE OF SCRAPPER (2.0? NOW=1.4) - -$choice_ens = array(); -$possible_ens = ["Carrefour","Leclerc","Monoprix","Auchan","Intermarche","SystemeU"];//ADD SU LATER -$active_ens = ["Carrefour"=>false,"Leclerc"=>false,"Monoprix"=>false,"Auchan"=>false,"Intermarche"=>false,"SystemeU"=>false]; - -$labelErr = $typeErr = ""; - -//---------------------------------UTILS--------------------------------------// -function test_input2($data) { - return (is_string($data)) ? htmlspecialchars(stripslashes(trim($data))) : FALSE; -} - -function validate_product(string $product, string $type) { - $nom = test_input2($product); - if(!preg_match("/^[a-zA-Z- éè]{2,30}$/",$nom)) { - switch($type) { - case "type": - $GLOBALS['typeErr'] = "Espace et tiret autorisés ainsi que les majuscules"; - break; - case "label": - $GLOBALS['labelErr'] = "Espace et tiret autorisés ainsi que les majuscules"; - break; - default: - break; - } - return FALSE; - } - return $nom; -} - -function cmp_label(string $label1, string $label2) { - $split_l1 = explode(" ",strtolower($label1)." "); - $split_l2 = explode(" ",strtolower($label2)." "); - $s1 = sizeof($split_l1); - $s2 = sizeof($split_l2); - $i1 = 0; - $i2 = 0; - $commons1 = ""; - foreach($split_l1 as $sl1) { - foreach($split_l2 as $sl2) { - if($sl1 == $sl2) { - $commons1 .= " $sl1"; - $i1++; - break; - } - } - } - $commons2 = ""; - foreach($split_l2 as $sl2) { - foreach($split_l1 as $sl1) { - if($sl2 == $sl1) { - $commons2 .= " $sl2"; - $i2++; - break; - } - } - } - if(($s1 === $i1)) - return substr($commons1,1); - return ""; -} - - -function sort_list(array $products) { - $l = $products; - $sort = array(); - $index = 0; - foreach($l as $p) { - $found = false; - $index = 0; - foreach($sort as $s) { - if(($c = cmp_label($p['name'],$s['name'])) !== "") { - $found = TRUE; - break; - } - $index++; - } - if($found === TRUE) { - if(stristr($sort[$index]['ens'],$p['ens'])!==FALSE) - continue; - $sort[$index]['ens'] .= "|".$p['ens']; - $sort[$index]['prix'] .= "|".$p['prix']; - } - else - $sort[] = $p; - - } - return $sort; -} - -function init_in_ens(string $init) : string { - switch($init) { - case "c": - return "Carrefour"; - case "l": - return "Leclerc"; - case "m": - return "Monoprix"; - case "a": - return "Auchan"; - case "i": - return "Intermarche"; - case "s": - return "SystemeU"; - default: - return "X"; - break; - } -} - -//-----------------------------END UTILS--------------------------------------// -function main_(array $elements) { - $str = my_json_encoding($elements); - $cmd = PHP_BINDIR."/php " .__DIR__."/usage2.php $str > out.txt"; - exec($cmd); - $rtn = file_get_contents("out.txt"); - $parsing = parse_exec_usage($rtn); - return $parsing; -} - -function main_web(array $elements) { - $str = my_json_encoding($elements); - $cmd = PHP_BINDIR."/php " .__DIR__."/usage2.php $str"; - $rtn = exec($cmd); - $parsing = parse_exec_usage($rtn); - return $parsing; -} - -function my_json_encoding(array $to_encode) { // FOR MAIN PARAMETER - $str = json_encode($to_encode); - $res = ""; - $size = strlen($str); - for($i = 0; $i < $size ;$i++) - $res .= ($str[$i] === '"') ? '\"' : (($str[$i] === "'") ? "\'" : $str[$i]); - - return $res; -} - -function parse_exec_usage(string $rtn) { - return json_decode(substr($rtn,strpos($rtn,"{\"")),true); -} - -function create_cmp_product(array $all_products, string $compare_product) { // easy with 1.2 Scrapper Version - $save_products = array(); - - foreach($all_products as $k => $v) { - if($v !== NULL) { - $old_k = $k; - foreach($v as $k => $p) { // - if($old_k === "Carrefour") { - foreach($p as $val) { - //($val['brand']==="") ? "Inconnu" : $val["brand"] -> to store - $save_products[] = ["brand"=>$val['brand'],"name"=>$val['title']." ".$val["packaging"],"ens"=>$old_k.":".$k,"prix"=>$val['price']['price']]; - } - } - if($old_k === "Leclerc") { - foreach($p as $val) { - $save_products[] = ["brand"=>$val['brand'],"name"=>$val['sLibelleLigne1']." ".$val['sLibelleLigne2'],"ens"=>$old_k.":".$k,"prix"=>$val['nrPVUnitaireTTC']]; - } - } - if($old_k === "Monoprix") { - foreach($p as $val) { - $save_products[] = ["brand"=>$val['brand'],"name"=>$val['name'],"ens"=>$old_k.":".$k,"prix"=>$val['price']['current']['amount']]; - } - } - if($old_k === "Auchan") { - foreach($p as $val) { - $save_products[] = ["brand"=>$val['brand'],"name"=>$val['label']." ".$val['quantity'],"ens"=>$old_k.":".$k,"prix"=>$val['price']]; - } - } - if($old_k === "Intermarche") { - foreach($p as $val) { - $infos = $val["informations"]; - $save_products[] = ["brand"=>$infos['brand'],"name"=>$infos['title']." ".$infos["packaging"]." ".$infos["brand"],"ens"=>$old_k.":".$k,"prix"=>$val['prices']['value']]; - } - } - if($old_k === "SystemeU") { - foreach($p as $val) { - $save_products[] = ["brand"=>$val['brand'],"name"=>$val['name'],"ens"=>$old_k.":".$k,"prix"=>$val['price']]; - } - } - } - } - } - $all_brands = array(); - $products_by_brand = array(); - - foreach($save_products as $elem) { - if(!in_array($lower=strtolower($elem['brand']),$all_brands)) { - $all_brands[] = $lower; - $products_by_brand = array_merge($products_by_brand,[$lower=>[$elem['ens'],[$elem]]]); - } - else { - $products_by_brand[$lower][1][] = $elem; - if(stristr($products_by_brand[$lower][0],$elem['ens'])===FALSE) // REPLACE BY STR_CONTAINS IN PHP8.0 - $products_by_brand[$lower][0] .= "|".$elem['ens']; - } - - } - $cmp = 0; - if(sizeof($all_products)==1) - $cmp = -1; - - $comparable_ens = array(); - foreach($products_by_brand as $k=>$pb) - if((substr_count($pb[0],"|"))>$cmp) - $comparable_ens = array_merge($comparable_ens,[$k=>$pb]); - - $sort_list_p = array(); - foreach($comparable_ens as $k=>$pb) - $sort_list_p = array_merge($sort_list_p,[$k=>sort_list($pb[1])]); - - return $sort_list_p; -} - -function display_each_brand(array $comparable_brand) { - $rtn = ""; - $all_brands = array_keys($comparable_brand); - $rtn .= "
    "; - foreach($all_brands as $b) { - $br = (($b==="") ? "Inconnu" : $b); - $rtn .= "
    $br
    "; - $rtn .= ""; - foreach($comparable_brand[$b] as $product) { // [1] for comparable ens - $rtn .= display_each_product($product); - } - $rtn .= "
    NameENS:CityPrice
    "; - } - return $rtn . "
    "; -} - -function display_each_product(array $product) { - $rtn = ""; - foreach($product as $k=>$elem) { - if($k=="brand") - continue; - if(count(($tab_elem = explode("|",$elem)))>1) { - $rtn .= "
    "; - if($k=="prix") { - $min = min($tab_elem); - $spe = "style=\"border:solid blue;\""; - foreach($tab_elem as $t) - $rtn .= "$t"; - - } - else { - foreach($tab_elem as $t) - $rtn .= "$t"; - } - $rtn .= "
    "; - } - else { - $rtn .= "$elem "; - } - } - $rtn .= "\n"; - return $rtn; -} - -function display_compare(array $globals, string $product, string $label) { - $elements = array(); - foreach($globals as $k => $e) - $elements = array_merge($elements,[$k=>[$product,$e]]); - - $to_display = main_($elements); // OK - return display_each_brand(create_cmp_product($to_display,$label)); -} - -function display_compare_web(array $globals, string $product, string $label) { - $elements = array(); - foreach($globals as $k => $e) - $elements = array_merge($elements,[$k=>[$product,$e]]); - - $to_display = main_web($elements); // OK - return display_each_brand(create_cmp_product($to_display,$label)); -} - -function display_globals(array $globals) : string { - $rtn = ""; - foreach($globals as $k => $v) { - $rtn .= "$k : "; - foreach($globals[$k] as $v) - $rtn .= "$v "; - $rtn .= "\n"; - } - return $rtn; -} - -function display_ens(array $checkbox_ens) : string { - $rtn = ""; - foreach($checkbox_ens as $k => $v) - $rtn .= ($v) ? $k.";" : ""; - - return $rtn; -} - -function display_cities(array $cities) : string { - return implode("|",$cities); -} - -function display_type(string $type) : string { - $rtn = ""; - if(in_array($type,$GLOBALS['all_types'])) { - return $type; - } - return $rtn; -} - -function display_product(string $product) : string { - $rtn = ""; - $rtn .= $product; - return $rtn; -} - -function onceens_multistores(array $post, array $ens) { - // process to compare many stores of once ens (expect Monoprix) - $all_cities = array(); - foreach($post as $k => $v) { - $f_once = FALSE; - if(strpos($k,"city_") === 0 && $v !== "") { // check $k and $v - $all_cities[init_in_ens(substr($k,5,1))][] = $v; - $f_once = TRUE; - } - if(($f_once == FALSE) && (in_array($t=init_in_ens(substr($k,5,1)),$ens))) - $all_cities[$t][] = "Paris"; - } - - - return $all_cities; -} - -function parse_command_line(string $command_line) { - // EXAMPLE : php7.2 process_p.php --ens=Auchan,Leclerc --cities="Paris"+"Bordeaux","Voglans" --product="Lardons" --label_product="Lardons fumes" - $arr = explode(" ",$command_line,2); - if(sizeof($arr) == 1) { - echo "ERROR arguments : --ens= --cities= --products= --label_product=[OPTION]\n"; - } - else { - $options = array_slice(explode(" --"," ".$arr[1]),1); - if(($s = sizeof($options))>=3 && $s < 5) { - $elements = [ - "ens"=>explode(",",substr($options[0],strpos($options[0],"=")+1)), - "cities"=>explode(",",substr($options[1],strpos($options[1],"=")+1)), - "product"=>explode(",",substr($options[2],strpos($options[2],"=")+1)) - ]; - if($s == 4) - $elements = array_merge($elements,["label"=>explode(",",substr($options[3],strpos($options[3],"=")+1))]); - foreach($elements["cities"] as $k => $v) - $elements["cities"][$k] = explode("+",$v); - - $elements["globals"] = array_combine($elements["ens"],$elements["cities"]); - return $elements; - } - else { - echo "ERROR arguments : --ens= --cities= --product= \n"; - } - } - return array(); -} - -function main(string $command_line, bool $web) { - if(!$web) { - $fields = parse_command_line($command_line); - var_dump($fields); - $ens = $fields["ens"]; - $GLOBALS['active_ens'] = $ens; - $cities = $fields["cities"]; // for the moment is one city - $globals = $fields["globals"]; - $products = $fields["product"][0]; // "" - $labels = $fields["label"][0]; // "" - //display_cities($globals); - echo $products."\n"; - echo display_globals($globals); - echo display_compare($globals,$products,$labels); - /*$GLOBALS['zone'] = "Zone de recherche : ".($c=display_cities($cities)); - $GLOBALS['type'] = "Type de produit : ".($p=display_type($products)); - $GLOBALS['product'] = "Produit : ".($p2=display_product($labels)); // update now - $GLOBALS['choices'] = "Comparaison des enseignes : ".display_ens($ens); - $GLOBALS['dis'] = display_compare($ens,$p,$p2,$cities); - echo $GLOBALS['dis'];*/ - } - else { // TO UPDATE IN WEB VERSION - if(isset($_POST['submitproduct'])) { - $keys = array_keys($GLOBALS['active_ens']); - $len_ens2 = sizeof($keys); - for($i = 1; $i < $len_ens2+1; $i++) - $GLOBALS['active_ens'][$keys[$i-1]] = (isset($_POST["c".$i])); - //tab of $cities - $cities = array(); - $GLOBALS['zone'] = "Zone de recherche : ".($c=display_cities(array($_POST['city']))); - $GLOBALS['type'] = "Type de produit : ".($p=display_type($_POST['p'])); - $GLOBALS['product'] = "Produit : ".($p2=display_product($_POST['p2'])); - $GLOBALS['choices'] = "Comparaison des enseignes : ".display_ens($GLOBALS['active_ens']); - $GLOBALS['dis'] = display_compare_web($GLOBALS['active_ens'],$p,$p2,[$c]); //$cities - } - } - -} - -//main(implode(" ",$argv),false); - -if(isset($_POST['submitproduct'])) { - $keys = array_keys($GLOBALS['active_ens']); - $ens = $GLOBALS['active_ens']; - $len_ens2 = sizeof($keys); - for($i = 1; $i < $len_ens2+1; $i++) - $ens[$keys[$i-1]] = (isset($_POST["c".$i])); - - $p_ = validate_product($_POST['p'],"product"); - $l_ = validate_product($_POST['p2'],"label"); - if($p_ === FALSE || $l_ === FALSE) - return NULL; - - $GLOBALS['type'] = "Type de produit : ".($p=display_type($_POST['p'])); - $GLOBALS['product'] = "Produit : ".($p2=display_product($_POST['p2'])); - $GLOBALS['choices'] = "Comparaison des enseignes : ".display_ens($GLOBALS['active_ens']); - $ens2 = array(); - foreach($ens as $k => $v) { - if($v === true) { - $ens2[] = $k; - } - } - /*echo "pass \n"; - var_dump($ens2); - echo "globals \n";*/ - $globals = onceens_multistores($_POST,$ens2); // OK - //var_dump($globals); - echo display_compare_web($globals,$p,$p2); // OK -} - -function post_to_otherphp_file(string $url, array $key_elements) { - $body = ""; - foreach($key_elements as $k => $v) { // $key_elements directly in $body is possible - $k_ = test_input2($k); - $v_ = test_input2($v); - if($k_ !== FALSE && $v_ !== FALSE) - $body .= "&$k_=$v_"; - } - $c = curl_init ($url); - curl_setopt ($c, CURLOPT_POST, true); - curl_setopt ($c, CURLOPT_POSTFIELDS, http_build_query($key_elements));//["store"=>$body]); - curl_setopt($c, CURLOPT_RETURNTRANSFER,true); - $page = curl_exec ($c); - echo "page \n"; - echo $page; - curl_close ($c); -} - -//$url_ = 'pricecomparator.co/product/cities.php'; -//post_to_otherphp_file($url_,["Monoprix"=>"Test"]); -//echo display_compare(["Monoprix"=>["Paris","Annecy"],"Carrefour"=>["Paris","Brest"]],"lardons","lardons"); // !!!!!!!!!!!! -//echo display_compare_web(["Monoprix"=>["Paris","Annecy"],"Carrefour"=>["Paris","Brest"]],"lardons","lardons"); -//var_dump(display_compare(["Carrefour"=>["Paris"]],"lardons","lardons")); - -//var_dump(parse_exec_usage(file_get_contents("t_u.txt"))); -//var_dump(display_compare(["Monoprix"],"lardons","lardons",["Paris","Annecy"])); -//var_dump(parse_exec_usage(file_get_contents("t_u.txt"))); OK - -function post(string $url, array $fields) { - //$url = 'pricecomparator.co/product/cities.php';//'http://localhost/mc/upload.php'; - $fields_string = ""; - foreach($fields as $key=>$value) { - $key_ = test_input2($key); - $value_ = test_input2($value); - if($key_ !== FALSE && $value_ !== FALSE) - $fields_string .= $key_.'='.$value_.'&'; - - } - rtrim($fields_string, '&'); - $ch = curl_init(); - curl_setopt($ch,CURLOPT_URL, $url); - curl_setopt($ch,CURLOPT_POST, count($fields)); - curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string); - curl_exec($ch); -} -//post("pricecomparator.co/product/cities.php",["__)(__"=>"1","Monoprix"=>"L'yon"]); - -//var_dump(display_compare(["Auchan"=>["Paris"]],"Lardons","lardons")); -var_dump(display_compare(["Monoprix"=>["Paris"],"Auchan"=>["Paris"]],"Lardons","Lardons")); -//var_dump(display_compare(["Monoprix"=>["Paris"]],"Lardons","lardons")); - -?> \ No newline at end of file diff --git a/your_project/usage.php b/your_project/usage.php old mode 100644 new mode 100755 index fa71f8d..cf7a58a --- a/your_project/usage.php +++ b/your_project/usage.php @@ -15,23 +15,27 @@ function use_scrapper(string $url, bool $with_js) { // OK return scrap_https($url,$with_js); } -function use_content_scrapper_auchan(string $product, string $city, int $p, bool $web_server) { // OK +function use_content_scrapper_auchan(string $product, string $city, int $p, + bool $web_server) { return content_scrap_auchan($product,$city,$p,$web_server); } -function use_content_scrapper_carrefour(string $product, string $city, int $p, bool $web_server) { // OK +function use_content_scrapper_carrefour(string $product, string $city, int $p, + bool $web_server) { return content_scrap_carrefour($product,$city,$p,$web_server); } -function use_content_scrapper_leclerc(string $product, string $city) { // OK +function use_content_scrapper_leclerc(string $product, string $city) { return content_scrap_leclerc($product,$city); } -function use_content_scrapper_intermarche(string $product, string $city, int $p, bool $web_server) { // OK +function use_content_scrapper_intermarche(string $product, string $city, int $p, + bool $web_server) { return content_scrap_intermarche($product,$city,$p,$web_server); } -function use_content_scrapper_monoprix(string $product, int $p, bool $web_server) { // OK +function use_content_scrapper_monoprix(string $product, int $p, + bool $web_server) { return content_scrap_monoprix($product,$p,$web_server); } @@ -39,14 +43,14 @@ function use_content_scrapper_systemeu(string $product, string $city) { // OK return content_scrap_systemeu($product,$city); } - -//var_dump(use_scrapper("https://Wikipedia.com",true)); // OK -//var_dump(use_content_scrapper_leclerc("Lardons","Voglans")); // OK -//var_dump(use_content_scrapper_carrefour("lardons","Paris")); // OK -//var_dump(use_content_scrapper_monoprix("Lardons")); // OK -//var_dump(use_content_scrapper_auchan("lardons","Paris")); // OK -//var_dump(use_content_scrapper_intermarche("lardons","Paris"));// OK -//var_dump(use_content_scrapper_systemeu("Lardons","Voglans")); // OK +//$w_s = false; +//var_dump(use_scrapper("https://Wikipedia.com",true)); // OK +//var_dump(use_content_scrapper_leclerc("Lardons","Voglans")); // OK +//var_dump(use_content_scrapper_carrefour("lardons","Paris",$w_s)); // OK +//var_dump(use_content_scrapper_monoprix("Lardons",,$w_s)); // OK +//var_dump(use_content_scrapper_auchan("lardons","Paris",,$w_s)); // OK +//var_dump(use_content_scrapper_intermarche("lardons","Paris",,$w_s)); // OK +//var_dump(use_content_scrapper_systemeu("Lardons","Voglans")); // OK // WITH INTERNAL GECKO TEST : @@ -61,11 +65,20 @@ function use_content_scrapper_systemeu(string $product, string $city) { // OK "Intermarche" => ["lardons","Paris"], "Monoprix" => ["lardons"] ]; - $scrappers_usages_min = [ "Carrefour" => ["lardons","Paris"] ]; +$scrappers_usages_min_mon = [ + "Monoprix" => ["lardons",["Paris","Annecy"]] +]; + +$scrappers_usages_min_mon2 = [ + "Monoprix" => ["lardons",["Paris","Annecy"]], + "Carrefour" => ["lardons",["Paris","Brest"]] +]; + + $scrappers_usages_min2 = [ "Carrefour" => ["lardons","Paris"], "Monoprix" => ["lardons"] @@ -84,11 +97,6 @@ function use_content_scrapper_systemeu(string $product, string $city) { // OK "Auchan" => ["lardons","Paris"] // NOT STABLE ]; -$scrappers_usages_min_mc = [ - "Monoprix" => ["lardons"], - "Leclerc" => ["Lardons","Voglans"] -]; - $scrappers_usages_min5 = [ "Carrefour" => ["lardons","Paris"], "Monoprix" => ["lardons"], @@ -98,7 +106,7 @@ function use_content_scrapper_systemeu(string $product, string $city) { // OK ]; $scrappers_usages_min_a = [ - "Auchan" => ["lardons","Paris"] + "Auchan" => ["lardons",["Paris"]] ]; $scrappers_usages_min_c = [ @@ -142,13 +150,31 @@ function check_scrapper_return(array $scrap) { * @author chriSmile0 * @return string content_scrap_... return or "," if not found */ -function parrallelize_scrapping_process(string $key, array $scrapper_usage, - int $port) : string { // gecko -> auchan,monoprix,carrefour,intermarche +function parrallelize_scrapping_process(string $key, array $scrapper_usage, + int $port, int $portf, int $store ) : string { // gecko -> auchan,monoprix,carrefour,intermarcheà $childs = array(); $ens = $key[0]; $rtn = ""; + $gb_rtn = array(); $content = array(); + //$nb_cities = count($scrapper_usage[1]); + echo "portf : $portf\n"; + echo "store : $store \n"; + var_dump($scrapper_usage); + $i = $store; + // Solution 1 for multi store create loop here + /** + * Pros : each city have your own geckodriver + * Cons : many process + */ + // Solution 2 $scrapper_usage[1] in content_scrap_* + /** + * Pros : Light in process + * Cons : + */ + // Solution 1 in globals_execs -> choice for the moment if($ens !== "S" && $ens !== "L") { + $childs = array(); for($x = 0; $x < 2; $x++) { if($x == 1) sleep(1); @@ -177,13 +203,13 @@ function parrallelize_scrapping_process(string $key, array $scrapper_usage, $exec_scrapper = 1; switch($ens) { case "A": - $content = content_scrap_auchan($scrapper_usage[0],$scrapper_usage[1],$port,false); + $content = content_scrap_auchan($scrapper_usage[0],$scrapper_usage[1][$i],$port,false); // MULTI STORE SOON -> $scrapper_usage[1] break; case "C": - $content = content_scrap_carrefour($scrapper_usage[0],$scrapper_usage[1],$port,false); + $content = content_scrap_carrefour($scrapper_usage[0],$scrapper_usage[1][$i],$port,false); break; case "I": - $content = content_scrap_intermarche($scrapper_usage[0],$scrapper_usage[1],$port,false); + $content = content_scrap_intermarche($scrapper_usage[0],$scrapper_usage[1][$i],$port,false); break; case "M": $content = content_scrap_monoprix($scrapper_usage[0],$port,false); @@ -200,18 +226,18 @@ function parrallelize_scrapping_process(string $key, array $scrapper_usage, } } else if($ens === "L") { // NO GECKODRIVER - $content = content_scrap_leclerc($scrapper_usage[0],$scrapper_usage[1]); + $content = content_scrap_leclerc($scrapper_usage[0],$scrapper_usage[1][$i]); } else if($ens === "S") { // PUPPETEER - $content = content_scrap_systemeu($scrapper_usage[0],$scrapper_usage[1]); + $content = content_scrap_systemeu($scrapper_usage[0],$scrapper_usage[1][$i]); } else { // UNKNOWN $content = ""; } - $rtn = (check_scrapper_return($content)==-1) ? "" : json_encode($content); - if($rtn !== "") + $rtn = (check_scrapper_return($content)==-1) ? "NO" : json_encode($content); + if($rtn !== "NO") return "".strlen($rtn).",".$rtn; - return ","; + return ","; } /** @@ -232,6 +258,7 @@ function parrallelize_scrapping_process(string $key, array $scrapper_usage, */ function parrallelize_scrapping_process_v2(string $key, array $scrapper_usage, int $port) : string { // gecko -> auchan,monoprix,carrefour,intermarche + echo "v2 \n"; $ens = $key[0]; $rtn = ""; $content = array(); @@ -268,6 +295,27 @@ function parrallelize_scrapping_process_v2(string $key, array $scrapper_usage, return ","; } + +/** + * [BRIEF] + * @param array $scrappers_usage target supermarket and target_product and town + * @example globals_execs(["Monoprix"=>["lardons"]) + * @author chriSmile0 + * @return the scrapping content of each usage in the array in parameter +*/ +function globals_execs_locals(array $scrappers_usage) { + $recv_content = array(); + $returns = array(); + $arrys = array(); + $i = 0; + $returns = array(); + foreach($scrappers_usage as $key => $usages) { + $port = 0; + $returns = array_merge($returns,[$key=>parrallelize_scrapping_process_v2($key,$usages,$port)]); // DUMP RESULT IN PIPE + } + return $returns; +} + /** * [BRIEF] * @param array $scrappers_usage target supermarket and target_product and town @@ -275,44 +323,48 @@ function parrallelize_scrapping_process_v2(string $key, array $scrapper_usage, * @author chriSmile0 * @return the scrapping content of each usage in the array in parameter */ -function globals_execs(array $scrappers_usage, int $v1_or_v2) { // OK +function globals_execs_server(array $scrappers_usage) {// OK $childs = array(); $recv_content = array(); $ports = 4444; $returns = array(); $arrys = array(); $i = 0; - var_dump($childs); foreach($scrappers_usage as $key => $usages) { - $port = $ports+$i; - $recv_content[] = [$key,false,$port]; + $returns[$key] = []; + $portd = $ports+$i; + $nb_port = sizeof($usages[1]); $arrys[] = array(); - socket_create_pair(AF_UNIX, SOCK_STREAM, 0, $arrys[$i]); - switch($pid = pcntl_fork()) { - case -1: - die('Fork failed'); - exit(0); - case 0: - $rtn = ($v1_or_v2==1) ? parrallelize_scrapping_process($key,$usages,$port) : parrallelize_scrapping_process_v2($key,$usages,$port); // DUMP RESULT IN PIPE - $offset = 0; - $size = substr($rtn,0,$offset=strpos($rtn,",")); - $size = ($size===FALSE || $size==="") ? "0" : $size; // FALSE -> 7.2, "" -> 8.0 // FOR REST OF THE PACKAGE FOR COMPATIBILITY!!! - socket_close($arrys[$i][1]); - socket_write($arrys[$i][0], $size); - if($offset > 0) { - $rtn_t = substr($rtn,$offset+1); - if(socket_read($arrys[$i][0],2)=="OK") - socket_write($arrys[$i][0], $rtn_t, strlen($rtn_t)); + for($j = 0 , $k = $i ;$k < $i+$nb_port ;$k++,$j++) { + $recv_content[] = [$key,false,$portd+$j]; + socket_create_pair(AF_UNIX, SOCK_STREAM, 0, $arrys[$k]); + switch($pid = pcntl_fork()) { + case -1: + die('Fork failed'); + exit(0); + case 0: + $rtn = parrallelize_scrapping_process($key,$usages,$portd+$j,$nb_port,$j); // DUMP RESULT IN PIPE + $offset = 0; + $size = substr($rtn,0,$offset=strpos($rtn,",")); + $size = ($size===FALSE || $size==="") ? "0" : $size; // FALSE -> 7.2, "" -> 8.0 // FOR REST OF THE PACKAGE FOR COMPATIBILITY!!! + echo "s : $size $key \n"; + echo "o : $offset $key\n"; + socket_close($arrys[$k][1]); + socket_write($arrys[$k][0], $size); + if($offset > 0) { + $rtn_t = substr($rtn,$offset+1); + if(socket_read($arrys[$k][0],2)=="OK") + socket_write($arrys[$k][0], $rtn_t, strlen($rtn_t)); - } - socket_close($arrys[$i][0]); - exit(1); // IMPORTANT - default: - $childs[] = [$pid,$i,$key]; - break; - + } + socket_close($arrys[$k][0]); + exit(1); // IMPORTANT + default: + $childs[] = [$pid,$k,$key,$usages[1][$j]]; + break; + } } - $i++; + $i += $nb_port; } while(count($childs) > 0) { foreach($childs as $key => $pid) { @@ -320,13 +372,14 @@ function globals_execs(array $scrappers_usage, int $v1_or_v2) { // OK if($res == -1 || $res > 0) { unset($childs[$key]); } + if(($res == 0) && (!$recv_content[$key][1])) { socket_close($arrys[$pid[1]][0]); $size = trim(socket_read($arrys[$pid[1]][1],10)); if($size > 0) // send content if(socket_write($arrys[$pid[1]][1],"OK")) if($rtn_tt = trim(socket_read($arrys[$pid[1]][1],$size))) { - $returns = array_merge($returns,[$pid[2]=>json_decode($rtn_tt,true)]); + $returns[$pid[2]] = array_merge($returns[$pid[2]],[$pid[3]=>json_decode($rtn_tt,true)]); $recv_content[$key][1] = true; } @@ -351,22 +404,20 @@ function my_json_encoding_2($to_encode) { // FOR MAIN PARAMETER return $res; } - function main_u($argc, $argv) { - $web_server = intval($argv[2]); - array_pop($argv); $arr = implode(",",array_slice($argv,1)); $elements = json_decode($arr,true);// OK - echo json_encode(globals_execs($elements,$web_server)); // recv this in process_p for print + //var_dump($elements); + echo json_encode(globals_execs_server($elements)); // recv this in process_p for print + //var_dump($elements); } -//echo json_encode(globals_execs($scrappers_usages_min_ca)); -//main_u($argc,$argv); -//var_dump(globals_execs($scrappers_usages_min_mc,2)); +main_u($argc,$argv); +//echo "min_mon \n"; +//var_dump($scrappers_usages_min_mon); +//echo parrallelize_scrapping_process("Monoprix",["lardons","lardons"],4444,2); +//echo json_encode(globals_execs_server($scrappers_usages_min_a)); +//var_dump(use_content_scrapper_monoprix("Lardons",4444,false)); +//var_dump(parrallelize_scrapping_process("Monoprix",["lardons",["Paris"]],4444,1)); //var_dump(use_content_scrapper_auchan("Lardons","Paris",4444,false)); -//var_dump(use_content_scrapper_leclerc("Saumon","Annecy")); -//var_dump(use_content_scrapper_carrefour("Lardons","Paris",4444,false)); -//var_dump(use_content_scrapper_intermarche("Lardons","Paris",4444)); -//var_dump(use_content_scrapper_monoprix("Lardons",4444,true)); // TRY THIS -//var_dump(use_content_scrapper_systemeu("Lardons","Paris")); ?> \ No newline at end of file diff --git a/your_project/usage2.php b/your_project/usage2.php deleted file mode 100755 index cf7a58a..0000000 --- a/your_project/usage2.php +++ /dev/null @@ -1,423 +0,0 @@ - ["lardons","Paris"], - "Leclerc" => ["lardons","Paris"], - "Auchan" => ["lardons","Paris"], - "SystemeU" => ["lardons","Paris"], - "Intermarche" => ["lardons","Paris"], - "Monoprix" => ["lardons"] -]; -$scrappers_usages_min = [ - "Carrefour" => ["lardons","Paris"] -]; - -$scrappers_usages_min_mon = [ - "Monoprix" => ["lardons",["Paris","Annecy"]] -]; - -$scrappers_usages_min_mon2 = [ - "Monoprix" => ["lardons",["Paris","Annecy"]], - "Carrefour" => ["lardons",["Paris","Brest"]] -]; - - -$scrappers_usages_min2 = [ - "Carrefour" => ["lardons","Paris"], - "Monoprix" => ["lardons"] -]; - -$scrappers_usages_min3 = [ - "Carrefour" => ["lardons","Paris"], - "Monoprix" => ["lardons"], - "Leclerc" => ["Lardons","Voglans"] -]; - -$scrappers_usages_min4 = [ - "Carrefour" => ["lardons","Paris"], - "Monoprix" => ["lardons"], - "Leclerc" => ["Lardons","Voglans"], - "Auchan" => ["lardons","Paris"] // NOT STABLE -]; - -$scrappers_usages_min5 = [ - "Carrefour" => ["lardons","Paris"], - "Monoprix" => ["lardons"], - "Leclerc" => ["Lardons","Voglans"], - "Auchan" => ["lardons","Paris"], - "Intermarche" => ["lardons","Paris"] -]; - -$scrappers_usages_min_a = [ - "Auchan" => ["lardons",["Paris"]] -]; - -$scrappers_usages_min_c = [ - "Carrefour" => ["lardons","Paris"] -]; - -$scrappers_usages_min_l = [ - "Leclerc" => ["lardons","Voglans"] -]; - -$scrappers_usages_min_ca = [ - "Auchan" => ["lardons","Paris"], - "Carrefour" => ["lardons","Paris"] -]; - -/** - * [BRIEF] CHECK - * @param array $scrap the result of a scrapping function - * @example check_scrapper_return(content_scrap_leclerc("..","..")) - * @author chriSmile0 - * @return -1 or content of $scrap -*/ -function check_scrapper_return(array $scrap) { - if(empty($scrap)) - return -1; - return $scrap; -} - -/** - * [BRIEF] If A/C/I/M then : - * - We launch 2 process, one for the geckodriver, and the other for the duplicate - * - When we sure the geckodriver is launch we call the target scrapper by the `$key` - * - We kill all sub processes and geckodriver processes - * Else (no need process) - * The return is the size of the return or just a ',' if we found nothing - * - * @param string $key the supermarket name - * @param array $scrapper_usage the research and the target city - * @param int $port port to connect geckodriver in case we use the port - * @example parrallelize_scrapping_process("Monoprix",["lardons"],4444=default) - * @author chriSmile0 - * @return string content_scrap_... return or "," if not found -*/ -function parrallelize_scrapping_process(string $key, array $scrapper_usage, - int $port, int $portf, int $store ) : string { // gecko -> auchan,monoprix,carrefour,intermarcheà - $childs = array(); - $ens = $key[0]; - $rtn = ""; - $gb_rtn = array(); - $content = array(); - //$nb_cities = count($scrapper_usage[1]); - echo "portf : $portf\n"; - echo "store : $store \n"; - var_dump($scrapper_usage); - $i = $store; - // Solution 1 for multi store create loop here - /** - * Pros : each city have your own geckodriver - * Cons : many process - */ - // Solution 2 $scrapper_usage[1] in content_scrap_* - /** - * Pros : Light in process - * Cons : - */ - // Solution 1 in globals_execs -> choice for the moment - if($ens !== "S" && $ens !== "L") { - $childs = array(); - for($x = 0; $x < 2; $x++) { - if($x == 1) - sleep(1); - switch($pid = pcntl_fork()) { - case -1: - die('Fork failed'); - exit(0); - case 0: - if($x == 0) - exec("geckodriver -p $port"); - exit(); // IMPORTANT - default: - $childs[] = $pid; - break; - } - } - $exec_scrapper = 0; - while(count($childs) > 0) { - foreach($childs as $key => $pid) { - $res = pcntl_waitpid($pid, $status, WNOHANG); - if($res == -1 || $res > 0) { - unset($childs[$key]); - } - if(($res == 0) && (count($childs)==1)) { // geckodriver is launch - if(!$exec_scrapper) { - $exec_scrapper = 1; - switch($ens) { - case "A": - $content = content_scrap_auchan($scrapper_usage[0],$scrapper_usage[1][$i],$port,false); // MULTI STORE SOON -> $scrapper_usage[1] - break; - case "C": - $content = content_scrap_carrefour($scrapper_usage[0],$scrapper_usage[1][$i],$port,false); - break; - case "I": - $content = content_scrap_intermarche($scrapper_usage[0],$scrapper_usage[1][$i],$port,false); - break; - case "M": - $content = content_scrap_monoprix($scrapper_usage[0],$port,false); - break; - default: - $exec_scrapper = 2; // ERROR - break; - } - } - system("kill -s kill $pid"); // kill geckodriver launcher - exec("kill -s kill `lsof -i -P | grep -e :$port | grep -Eo '[0-9]{1,10}' | head -n 1`"); - } - } - } - } - else if($ens === "L") { // NO GECKODRIVER - $content = content_scrap_leclerc($scrapper_usage[0],$scrapper_usage[1][$i]); - } - else if($ens === "S") { // PUPPETEER - $content = content_scrap_systemeu($scrapper_usage[0],$scrapper_usage[1][$i]); - } - else { // UNKNOWN - $content = ""; - } - $rtn = (check_scrapper_return($content)==-1) ? "NO" : json_encode($content); - if($rtn !== "NO") - return "".strlen($rtn).",".$rtn; - return ","; -} - -/** - * @version 2 -> use web_server element to true because geckodriver is in the execution - * [BRIEF] If A/C/I/M then : - * - We launch 2 process, one for the geckodriver, and the other for the duplicate - * - When we sure the geckodriver is launch we call the target scrapper by the `$key` - * - We kill all sub processes and geckodriver processes - * Else (no need process) - * The return is the size of the return or just a ',' if we found nothing - * - * @param string $key the supermarket name - * @param array $scrapper_usage the research and the target city - * @param int $port port to connect geckodriver in case we use the port - * @example parrallelize_scrapping_process("Monoprix",["lardons"],4444=default) - * @author chriSmile0 - * @return string content_scrap_... return or "," if not found -*/ -function parrallelize_scrapping_process_v2(string $key, array $scrapper_usage, - int $port) : string { // gecko -> auchan,monoprix,carrefour,intermarche - echo "v2 \n"; - $ens = $key[0]; - $rtn = ""; - $content = array(); - if($ens !== "S" && $ens !== "L") { - switch($ens) { - case "A": - $content = content_scrap_auchan($scrapper_usage[0],$scrapper_usage[1],$port,true); - break; - case "C": - $content = content_scrap_carrefour($scrapper_usage[0],$scrapper_usage[1],$port,true); - break; - case "I": - $content = content_scrap_intermarche($scrapper_usage[0],$scrapper_usage[1],$port,true); - break; - case "M": - $content = content_scrap_monoprix($scrapper_usage[0],$port,true); - break; - default: - break; - } - } - else if($ens === "L") { // NO GECKODRIVER - $content = content_scrap_leclerc($scrapper_usage[0],$scrapper_usage[1]); - } - else if($ens === "S") { // PUPPETEER - $content = content_scrap_systemeu($scrapper_usage[0],$scrapper_usage[1]); - } - else { // UNKNOWN - $content = ""; - } - $rtn = (check_scrapper_return($content)==-1) ? "" : json_encode($content); - if($rtn !== "") - return "".strlen($rtn).",".$rtn; - return ","; -} - - -/** - * [BRIEF] - * @param array $scrappers_usage target supermarket and target_product and town - * @example globals_execs(["Monoprix"=>["lardons"]) - * @author chriSmile0 - * @return the scrapping content of each usage in the array in parameter -*/ -function globals_execs_locals(array $scrappers_usage) { - $recv_content = array(); - $returns = array(); - $arrys = array(); - $i = 0; - $returns = array(); - foreach($scrappers_usage as $key => $usages) { - $port = 0; - $returns = array_merge($returns,[$key=>parrallelize_scrapping_process_v2($key,$usages,$port)]); // DUMP RESULT IN PIPE - } - return $returns; -} - -/** - * [BRIEF] - * @param array $scrappers_usage target supermarket and target_product and town - * @example globals_execs(["Monoprix"=>["lardons"]) - * @author chriSmile0 - * @return the scrapping content of each usage in the array in parameter -*/ -function globals_execs_server(array $scrappers_usage) {// OK - $childs = array(); - $recv_content = array(); - $ports = 4444; - $returns = array(); - $arrys = array(); - $i = 0; - foreach($scrappers_usage as $key => $usages) { - $returns[$key] = []; - $portd = $ports+$i; - $nb_port = sizeof($usages[1]); - $arrys[] = array(); - for($j = 0 , $k = $i ;$k < $i+$nb_port ;$k++,$j++) { - $recv_content[] = [$key,false,$portd+$j]; - socket_create_pair(AF_UNIX, SOCK_STREAM, 0, $arrys[$k]); - switch($pid = pcntl_fork()) { - case -1: - die('Fork failed'); - exit(0); - case 0: - $rtn = parrallelize_scrapping_process($key,$usages,$portd+$j,$nb_port,$j); // DUMP RESULT IN PIPE - $offset = 0; - $size = substr($rtn,0,$offset=strpos($rtn,",")); - $size = ($size===FALSE || $size==="") ? "0" : $size; // FALSE -> 7.2, "" -> 8.0 // FOR REST OF THE PACKAGE FOR COMPATIBILITY!!! - echo "s : $size $key \n"; - echo "o : $offset $key\n"; - socket_close($arrys[$k][1]); - socket_write($arrys[$k][0], $size); - if($offset > 0) { - $rtn_t = substr($rtn,$offset+1); - if(socket_read($arrys[$k][0],2)=="OK") - socket_write($arrys[$k][0], $rtn_t, strlen($rtn_t)); - - } - socket_close($arrys[$k][0]); - exit(1); // IMPORTANT - default: - $childs[] = [$pid,$k,$key,$usages[1][$j]]; - break; - } - } - $i += $nb_port; - } - while(count($childs) > 0) { - foreach($childs as $key => $pid) { - $res = pcntl_waitpid($pid[0], $status, WNOHANG); - if($res == -1 || $res > 0) { - unset($childs[$key]); - } - - if(($res == 0) && (!$recv_content[$key][1])) { - socket_close($arrys[$pid[1]][0]); - $size = trim(socket_read($arrys[$pid[1]][1],10)); - if($size > 0) // send content - if(socket_write($arrys[$pid[1]][1],"OK")) - if($rtn_tt = trim(socket_read($arrys[$pid[1]][1],$size))) { - $returns[$pid[2]] = array_merge($returns[$pid[2]],[$pid[3]=>json_decode($rtn_tt,true)]); - $recv_content[$key][1] = true; - } - - socket_close($arrys[$pid[1]][1]); - } - } - } - foreach($recv_content as $rc) { // check if we have all contents, if this is not the case we relaunch the forgot research - if($rc[1]==false) - echo "re-LAUNCH :".$rc[0].", on port : ".$rc[2]."\n"; - } - return $returns; -} - -function my_json_encoding_2($to_encode) { // FOR MAIN PARAMETER - $str = json_encode($to_encode); - $res = ""; - $size = strlen($str); - for($i = 0; $i < $size ;$i++) - $res .= ($str[$i] === '"') ? '\"' : (($str[$i] === "'") ? "\'" : $str[$i]); - - return $res; -} - -function main_u($argc, $argv) { - $arr = implode(",",array_slice($argv,1)); - $elements = json_decode($arr,true);// OK - //var_dump($elements); - echo json_encode(globals_execs_server($elements)); // recv this in process_p for print - //var_dump($elements); -} - -main_u($argc,$argv); -//echo "min_mon \n"; -//var_dump($scrappers_usages_min_mon); -//echo parrallelize_scrapping_process("Monoprix",["lardons","lardons"],4444,2); -//echo json_encode(globals_execs_server($scrappers_usages_min_a)); -//var_dump(use_content_scrapper_monoprix("Lardons",4444,false)); -//var_dump(parrallelize_scrapping_process("Monoprix",["lardons",["Paris"]],4444,1)); -//var_dump(use_content_scrapper_auchan("Lardons","Paris",4444,false)); -?> \ No newline at end of file From ce142394efa3d4e9fa60e2f28a88ed93a18053a3 Mon Sep 17 00:00:00 2001 From: chriSmile0 Date: Thu, 20 Jun 2024 09:57:53 +0200 Subject: [PATCH 3/3] V1.5 --- README.md | 24 ++++++++++++------------ src/scrapper_auchan.php | 4 ++-- src/scrapper_carrefour.php | 4 ++-- src/scrapper_intermarche.php | 4 ++-- src/scrapper_monoprix.php | 4 ++-- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 2db73e8..be39dcd 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # Scrapper -## STATUS [PENDING] +## STATUS [ACTIVE] -## UPDATE 05/20/2024 +## UPDATE 06/20/2024 **At this time `Intermarche`,`SystemeU` and `Leclerc` use `Datadome` protection** - `Intermarche` -> Impossible for me to bypass the new version of Datadome -> Target waiting -- `SystemeU` -> Bypass the old version of Datadome in this website -- `Leclerc` -> Bypass OK +- `SystemeU` -> Same to Intermarche , bypass with proxy and IP Rotating is possible +- `Leclerc` -> Same to Intermarche ## PRESHOT 2024 TARGET EVOLUTION - `SystemeU` -> Update the version of the DataDome Solution @@ -54,7 +54,6 @@ Or API : Paths
     dev
    -├── copy_all_leclerc.html
     └── JSON_updates.php
     project
     ├── infos_programs.php
    @@ -104,7 +103,7 @@ README.md
     
     ## Version 
     
    -### V1.4.1
    +### V1.5
     - Basic version of scrapper : 
       - [x] http, https
       - [x] html content generate by JS -> `puppeteer`  
    @@ -114,11 +113,11 @@ README.md
     
     - Specific version for specific website : 
       - The french supermarket compagny : 
    -    - [Leclerc](https://leclerc.fr) : 
    +    - [Leclerc](https://leclerc.fr) [**BLOCKED**]: 
           - [x] parse specific JS -> json
           - [x] usage of https of [basic version](scrapper.php) : 
           - [x] NoBot Solutions **DataDome** Solution
    -      - [x] Bypass NoBot Solutions with knownledge of all stores (`libJSON/leclercs.json`)
    +      - Try Bypass NoBot Solutions with knownledge of all stores (`libJSON/leclercs.json`) (works before Datadome Solution buy)
         - [Carrefour](https://www.carrefour.fr) : 
           - [x] parse specific JS -> json
           - [x] usage of `php-webdriver` 
    @@ -135,12 +134,13 @@ README.md
         - [Intermaché](https://www.intermarche.com) [**BLOCKED**] :
           - [x] parse specific JS -> json 
           - [x] usage of `php-webdriver`
    -      - [x] NoBot Solutions -> **DataDome** Solution -> `NEW_VERSION`
    -    - [SystemeU](https://www.magasins-u.com) [**UPDATE SOON FOR NEW PUPPETEER VERSION**]:  
    +      - [x] NoBot Solutions -> **DataDome** Solution
    +    - [SystemeU](https://www.magasins-u.com) [**BLOCKED**]:  
           - [x] parse specific JS -> json (products only on the display page)
           - [ ] usage of `puppeteer` or `php-webdriver` **IMPOSSIBLE**
    -      - [x] NoBot Solutions -> **DataDome** Solution -> `OLD VERSION`
    -      - [x] Necessary to use `puppeteer-extra-plugin-stealth`   
    +      - [x] NoBot Solutions -> **DataDome** Solution
    +      - [x] Necessary to use `puppeteer-extra-plugin-stealth` -> not enough
    +      - Try Bypass with src/libJSON/* (scrape2() in `scrape_su.js`) but blocked again 
      
     
     ## Features 
    \ No newline at end of file
    diff --git a/src/scrapper_auchan.php b/src/scrapper_auchan.php
    index 0a43827..8a5226e 100644
    --- a/src/scrapper_auchan.php
    +++ b/src/scrapper_auchan.php
    @@ -47,8 +47,8 @@
     use Facebook\WebDriver\WebDriverKeys as WebDriverKeys;
     use Facebook\WebDriver\Firefox\FirefoxDriver as FirefoxDriver;
     use Facebook\WebDriver\Firefox\FirefoxProfile as FirefoxProfile;
    -//require __DIR__ . '/../../../autoload.php'; // EXPORT 
    -require __DIR__ . '/../vendor/autoload.php'; // DEV
    +require __DIR__ . '/../../../autoload.php'; // EXPORT 
    +//require __DIR__ . '/../vendor/autoload.php'; // DEV
     
     
     function extract_brand_a(string $label) : string {
    diff --git a/src/scrapper_carrefour.php b/src/scrapper_carrefour.php
    index 104e179..851c98c 100644
    --- a/src/scrapper_carrefour.php
    +++ b/src/scrapper_carrefour.php
    @@ -51,8 +51,8 @@
     use Facebook\WebDriver\WebDriverExpectedCondition as WebDriverExpectedCondition;
     use Facebook\WebDriver\Firefox\FirefoxDriver as FirefoxDriver;
     use Facebook\WebDriver\Firefox\FirefoxProfile as FirefoxProfile;
    -//require __DIR__ . '/../../../autoload.php'; // EXPORT 
    -require __DIR__ . '/../vendor/autoload.php'; // DEV
    +require __DIR__ . '/../../../autoload.php'; // EXPORT 
    +//require __DIR__ . '/../vendor/autoload.php'; // DEV
     
     function extract_brand_c(string $title) : string {
     	preg_match_all('/[A-Z][A-Z]+/',$title,$matches2);
    diff --git a/src/scrapper_intermarche.php b/src/scrapper_intermarche.php
    index 7aad7e2..103da4e 100644
    --- a/src/scrapper_intermarche.php
    +++ b/src/scrapper_intermarche.php
    @@ -58,8 +58,8 @@
     use Facebook\WebDriver\WebDriverKeys as WebDriverKeys;
     use Facebook\WebDriver\Firefox\FirefoxDriver as FirefoxDriver;
     use Facebook\WebDriver\Firefox\FirefoxProfile as FirefoxProfile;
    -//require __DIR__ . '/../../../autoload.php'; // EXPORT 
    -require __DIR__ . '/../vendor/autoload.php'; // DEV
    +require __DIR__ . '/../../../autoload.php'; // EXPORT 
    +//require __DIR__ . '/../vendor/autoload.php'; // DEV
     
     function change_quantity_i(string $libelle, $kg_price, $price) : string  {
     	preg_match_all('!\d+(?:\.\d{1,2})?!', $libelle, $matches);
    diff --git a/src/scrapper_monoprix.php b/src/scrapper_monoprix.php
    index 971a708..9b1717d 100644
    --- a/src/scrapper_monoprix.php
    +++ b/src/scrapper_monoprix.php
    @@ -45,8 +45,8 @@
     use Facebook\WebDriver\Remote\RemoteWebDriver as RemoteWebDriver;
     use Facebook\WebDriver\Firefox\FirefoxDriver as FirefoxDriver;
     use Facebook\WebDriver\Firefox\FirefoxProfile as FirefoxProfile;
    -//require __DIR__ . '/../../../autoload.php'; // EXPORT 
    -require __DIR__ . '/../vendor/autoload.php'; // DEV
    +require __DIR__ . '/../../../autoload.php'; // EXPORT 
    +//require __DIR__ . '/../vendor/autoload.php'; // DEV
     
     function change_quantity_m(string $libelle) : string { 
     	$libelle = strtolower($libelle);